@canonmsg/claude-code-plugin 0.19.5 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -86,7 +86,7 @@ Channel mode forwards messages between Canon conversations and the embedded Clau
86
86
  ## Development
87
87
 
88
88
  ```bash
89
- cd packages/claude-code-plugin
89
+ cd adapters/claude-code-plugin
90
90
  npm install
91
91
  npm run build
92
92
  ```
@@ -1,4 +1,4 @@
1
- import { type CanonUnifiedDiff } from '@canonmsg/core';
1
+ import { type CanonUnifiedDiff } from '@canonmsg/core/contract';
2
2
  /** Read a file's text, or null when the file does not exist. */
3
3
  export type ApprovalDiffReadFile = (filePath: string) => Promise<string | null>;
4
4
  export interface SynthesizeApprovalDiffOptions {
@@ -1,5 +1,5 @@
1
1
  import { isAbsolute, join, relative } from 'node:path';
2
- import { sanitizeUnifiedDiffForSharing, truncateUnifiedDiff, } from '@canonmsg/core';
2
+ import { sanitizeUnifiedDiffForSharing, truncateUnifiedDiff, } from '@canonmsg/core/contract';
3
3
  /** Unified-hunk context lines on either side of a change (git default). */
4
4
  const HUNK_CONTEXT_LINES = 3;
5
5
  /**
@@ -1,4 +1,4 @@
1
- import type { ApprovalManager } from '@canonmsg/core';
1
+ import type { ApprovalManager } from '@canonmsg/core/host';
2
2
  /**
3
3
  * HTTP server that bridges Claude Code's PermissionRequest hook
4
4
  * to Canon's ApprovalManager.
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Packaged canon-bridge daemon resolution (bridge plan Phase 6, §F3).
3
+ *
4
+ * On a fresh npm install nothing has populated ~/.canon/bin yet, so
5
+ * connectBridge()'s fallback chain (explicit binPath → $CANON_BRIDGE_BIN →
6
+ * the shared install) has nothing to spawn. The plugin therefore ships the
7
+ * daemon as its own @canonmsg/bridge dependency and passes the packaged
8
+ * dist entry as binPath.
9
+ *
10
+ * $CANON_BRIDGE_BIN still wins: when the env override is set we return
11
+ * undefined and let connectBridge()'s own env resolution take it (an
12
+ * options.binPath would out-rank the env var otherwise).
13
+ */
14
+ export declare function resolvePackagedBridgeBin(env?: NodeJS.ProcessEnv): string | undefined;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Packaged canon-bridge daemon resolution (bridge plan Phase 6, §F3).
3
+ *
4
+ * On a fresh npm install nothing has populated ~/.canon/bin yet, so
5
+ * connectBridge()'s fallback chain (explicit binPath → $CANON_BRIDGE_BIN →
6
+ * the shared install) has nothing to spawn. The plugin therefore ships the
7
+ * daemon as its own @canonmsg/bridge dependency and passes the packaged
8
+ * dist entry as binPath.
9
+ *
10
+ * $CANON_BRIDGE_BIN still wins: when the env override is set we return
11
+ * undefined and let connectBridge()'s own env resolution take it (an
12
+ * options.binPath would out-rank the env var otherwise).
13
+ */
14
+ import { createRequire } from 'node:module';
15
+ import { dirname, join as joinPath } from 'node:path';
16
+ export function resolvePackagedBridgeBin(env = process.env) {
17
+ if (env.CANON_BRIDGE_BIN)
18
+ return undefined;
19
+ try {
20
+ const require = createRequire(import.meta.url);
21
+ const manifestPath = require.resolve('@canonmsg/bridge/package.json');
22
+ return joinPath(dirname(manifestPath), 'dist', 'main.js');
23
+ }
24
+ catch {
25
+ return undefined;
26
+ }
27
+ }
@@ -1,2 +1,2 @@
1
- export { handleCliMetadataRequest, isDirectExecution, readCliPackageVersion, runCli, } from '@canonmsg/core';
2
- export type { CliMetadata, RunCliMetadataOptions, } from '@canonmsg/core';
1
+ export { handleCliMetadataRequest, isDirectExecution, readCliPackageVersion, runCli, } from '@canonmsg/core/local';
2
+ export type { CliMetadata, RunCliMetadataOptions, } from '@canonmsg/core/local';
package/dist/cli-entry.js CHANGED
@@ -1 +1 @@
1
- export { handleCliMetadataRequest, isDirectExecution, readCliPackageVersion, runCli, } from '@canonmsg/core';
1
+ export { handleCliMetadataRequest, isDirectExecution, readCliPackageVersion, runCli, } from '@canonmsg/core/local';
package/dist/host.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { type SDKControlReloadPluginsResponse } from '@anthropic-ai/claude-agent-sdk';
3
- import { type CanonRuntimeCommandDescriptor } from '@canonmsg/core';
3
+ import { type CanonRuntimeCommandDescriptor } from '@canonmsg/core/contract';
4
4
  /**
5
5
  * Claude Code's own slash commands (built-ins, plugins, project .claude/
6
6
  * commands) are executable when sent as prompt text, so the runtime's command