feat: openclaw plugin activation and keygen#377
Merged
Conversation
Add activate() as the single canonical entry point that wires all adapter components from config. Calls existing factory functions (resolveSigner, createPluginInstance, createFileReceiptWriter) with FsSpoolStore and FsDedupeIndex from @peac/capture-node -- no logic duplication. Add generateSigningKey() for Ed25519 keypair generation via @peac/crypto, with keygenCli() for CLI usage and peac-keygen bin entry. Changes: - activate.ts: high-level entry wiring stores, signer, writer, instance, tools - keygen.ts: Ed25519 key generation, JWK file output with 0o600 permissions - keygen-cli.ts: CLI entry point for peac-keygen binary - index.ts: export activate, keygen types and functions - package.json: add @peac/capture-node dep, bin entry, bump @types/node to ^22 - tsup.config.ts: add keygen-cli entry point - openclaw.plugin.json: bump version 0.10.6 -> 0.10.12 - check-publish-list.sh: add adapter-openclaw to tested, capture-core to tracked, fix hardcoded count 40 -> 42 Tests: 22 new tests (12 activate + 10 keygen), 161 total adapter tests passing.
The CI publish-manifest closure check failed because @peac/capture-node was not in the manifest or directory mappings. This package was added in PR #376 but the publish-related scripts were not updated. - publish-manifest.json: add capture-node (20 -> 21 packages) - check-publish-closure.ts: add capture-node nested mapping - pack-smoke.mjs: add capture-node PKG_DIRS mapping
- createStatusTool: accept getter function for live stats instead of stale snapshot. Backwards-compatible: still accepts static PluginStats. - activate.ts: pass stats getter to createStatusTool - activate.ts: add explicit type annotation on onWarning callback - tsconfig.core.json: add packages/capture/node/src to includes so CI typecheck resolves @peac/capture-node imports
typecheck:core failed because the paths block was missing capture-node, so TS could not resolve the bare specifier imported in adapter-openclaw/src/activate.ts.
- openclaw.plugin.json version 0.10.12 -> 0.10.11 to match package.json - Add scripts/check-json-dupes.mjs: detects duplicate keys in JSON files (JSON parsers silently accept duplicates with last-write-wins) - Wire check-json-dupes into guard.sh alongside existing bidi scanner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bridges
@peac/adapter-openclawfrom "code on npm" to "someone installs this and it works." Adds the two missing pieces: a high-level activation entry point and a signing key generator.activate()-- single canonical entry point that wires all adapter components from config. Calls existing factory functions (resolveSigner,createPluginInstance,createFileReceiptWriter) withFsSpoolStore+FsDedupeIndexfrom@peac/capture-node. No logic duplication -- pure composition of existing building blocks.generateSigningKey()-- Ed25519 keypair generation via@peac/cryptogenerateKeypair(). ReusesgenerateKeyId()from plugin.ts for kid derivation. Writes private JWK to disk with0o600permissions. CLI entry viapeac-keygenbin.activate,generateSigningKey,keygenCli+ all associated types added to barrel export.Files changed
src/activate.tssrc/keygen.tsgenerateKeyId()src/keygen-cli.tspeac-keygenbinarysrc/index.tspackage.json@peac/capture-nodedep,binentry, bump@types/nodeto^22tsup.config.tskeygen-clientry pointopenclaw.plugin.json0.10.6->0.10.12tests/activate.test.tstests/keygen.test.tsscripts/check-publish-list.shscripts/publish-manifest.json@peac/capture-node(20 -> 21 packages)scripts/check-publish-closure.tsscripts/pack-smoke.mjsExisting code reused (not rewritten)
createHookHandler()from hooks.tscreateReceiptEmitter()+createBackgroundService()from emitter.tscreateJwkSigner()+resolveSigner()+generateKeyId()from plugin.tscreateFileReceiptWriter()from plugin.tsmapToolCallEvent()from mapper.tsDepends on
@peac/capture-node) -- MERGEDTest plan