@claude-flow/cli 3.32.41 → 3.34.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/.claude/helpers/.helpers-version +1 -1
- package/.claude/helpers/helpers.manifest.json +2 -2
- package/.claude/helpers/statusline.cjs +0 -0
- package/README.md +0 -2
- package/catalog-manifest.json +2 -2
- package/dist/src/commands/agent.js +2 -1
- package/dist/src/commands/agntcy/index.d.ts +64 -0
- package/dist/src/commands/agntcy/index.js +64 -0
- package/dist/src/commands/agntcy/publish.d.ts +43 -0
- package/dist/src/commands/agntcy/publish.js +121 -0
- package/dist/src/commands/agntcy/runtime.d.ts +90 -0
- package/dist/src/commands/agntcy/runtime.js +115 -0
- package/dist/src/commands/agntcy/swarm-join.d.ts +28 -0
- package/dist/src/commands/agntcy/swarm-join.js +85 -0
- package/dist/src/commands/agntcy/transport.d.ts +24 -0
- package/dist/src/commands/agntcy/transport.js +95 -0
- package/dist/src/commands/index.d.ts +1 -0
- package/dist/src/commands/index.js +5 -0
- package/dist/src/commands/swarm.js +2 -1
- package/node_modules/@claude-flow/security/dist/index.d.ts +1 -0
- package/node_modules/@claude-flow/security/dist/index.d.ts.map +1 -1
- package/node_modules/@claude-flow/security/dist/index.js +5 -0
- package/node_modules/@claude-flow/security/dist/index.js.map +1 -1
- package/node_modules/@claude-flow/security/dist/mcp-caller-identity.d.ts +90 -0
- package/node_modules/@claude-flow/security/dist/mcp-caller-identity.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/mcp-caller-identity.js +0 -0
- package/node_modules/@claude-flow/security/dist/mcp-caller-identity.js.map +1 -0
- package/package.json +2 -1
- package/.claude/.proven-config-version +0 -1
- package/.claude/proven-config.json +0 -42
|
@@ -1 +1 @@
|
|
|
1
|
-
3.32.
|
|
1
|
+
3.32.29
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest": {
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.34.0",
|
|
4
4
|
"files": {
|
|
5
5
|
"auto-memory-hook.mjs": "68be7e9a9eba7bf9c4e8a230db7bf61a243b965639f8504842799d6c6ca28762",
|
|
6
6
|
"hook-handler.cjs": "dae295fb9ae2626b89899c19a20cc911541af82b52d2eeb9b214d618b96e9a86",
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
"statusline.cjs": "0457fe53f8cd2c56458ff178392536a5868efd1a573665fa43bc01d2d95ca677"
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
|
-
"signature": "
|
|
11
|
+
"signature": "GyTvYvhL7vIta/4yyz1rIyl+DWJ+x4dJVfmcrKZJXlh4E/TcQK2bszRznlaG1o7LWSZTudaYj50w+/7dlv6lDg==",
|
|
12
12
|
"algorithm": "ed25519"
|
|
13
13
|
}
|
|
File without changes
|
package/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
3
|
[](https://cognitum.one/agentic-engineering)
|
|
4
|
-
[](https://agentics.org/siliconvalley/?UTM=GH-RuFlo-SV)
|
|
5
|
-
|
|
6
4
|
|
|
7
5
|
<!-- Try Ruflo — the 4 badges first-time visitors actually act on -->
|
|
8
6
|
[](https://flo.ruv.io/)
|
package/catalog-manifest.json
CHANGED
|
@@ -6,6 +6,7 @@ import { output } from '../output.js';
|
|
|
6
6
|
import { select, confirm, input } from '../prompt.js';
|
|
7
7
|
import { callMCPTool, MCPClientError } from '../mcp-client.js';
|
|
8
8
|
import { wasmSubcommands } from './agent-wasm.js';
|
|
9
|
+
import { agentPublishCommand } from './agntcy/publish.js';
|
|
9
10
|
import * as fs from 'fs';
|
|
10
11
|
import * as path from 'path';
|
|
11
12
|
/**
|
|
@@ -906,7 +907,7 @@ function formatLogLevel(level) {
|
|
|
906
907
|
export const agentCommand = {
|
|
907
908
|
name: 'agent',
|
|
908
909
|
description: 'Agent management commands',
|
|
909
|
-
subcommands: [spawnCommand, listCommand, statusCommand, stopCommand, metricsCommand, poolCommand, healthCommand, logsCommand, ...wasmSubcommands],
|
|
910
|
+
subcommands: [spawnCommand, listCommand, statusCommand, stopCommand, metricsCommand, poolCommand, healthCommand, logsCommand, ...wasmSubcommands, agentPublishCommand],
|
|
910
911
|
options: [],
|
|
911
912
|
examples: [
|
|
912
913
|
{ command: 'claude-flow agent spawn -t coder', description: 'Spawn a coder agent' },
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V3 CLI AGNTCY/Outshift Runtime Integration — ADR-380 §2.
|
|
3
|
+
*
|
|
4
|
+
* Scaffolds the three new `ruflo` CLI verbs ADR-380 §2 specifies:
|
|
5
|
+
*
|
|
6
|
+
* ruflo transport use slim
|
|
7
|
+
* ruflo agent publish
|
|
8
|
+
* ruflo swarm join <namespace>
|
|
9
|
+
*
|
|
10
|
+
* ============================================================================
|
|
11
|
+
* INTEGRATION STATUS: NOT WIRED IN. This module is intentionally
|
|
12
|
+
* self-contained and is NOT imported by, or registered with, the CLI's
|
|
13
|
+
* central command registry/index. A later, separate pass must:
|
|
14
|
+
*
|
|
15
|
+
* 1. Add `transportCommand` as a new top-level command (alongside
|
|
16
|
+
* `agent`, `swarm`, etc. in whatever file enumerates top-level
|
|
17
|
+
* commands today).
|
|
18
|
+
* 2. Merge `agentPublishCommand` into the existing `agentCommand`'s
|
|
19
|
+
* `subcommands` array in `../agent.ts`.
|
|
20
|
+
* 3. Merge `swarmJoinCommand` into the existing `swarmCommand`'s
|
|
21
|
+
* `subcommands` array in `../swarm.ts`.
|
|
22
|
+
* 4. Decide (per ADR-380's own "Open Questions") whether `transport use`
|
|
23
|
+
* is a per-swarm or global-session setting before wiring state
|
|
24
|
+
* persistence for the selected transport.
|
|
25
|
+
*
|
|
26
|
+
* No file outside `v3/@claude-flow/cli/src/commands/agntcy/` is touched by
|
|
27
|
+
* this scaffold.
|
|
28
|
+
* ============================================================================
|
|
29
|
+
*
|
|
30
|
+
* ARCHITECTURAL CONSTRAINT (mirrors ADR-150 §"architectural constraint",
|
|
31
|
+
* which ADR-380 §1 explicitly follows):
|
|
32
|
+
* - No `@claude-flow/agntcy` (or any other AGNTCY/SLIM/Outshift) package
|
|
33
|
+
* exists on npm or crates.io yet — verified 404 on every plausible
|
|
34
|
+
* name. Nothing in this directory statically imports one.
|
|
35
|
+
* - Every runtime touchpoint goes through `detectAgntcyRuntime()` in
|
|
36
|
+
* `runtime.ts`, which only ever does a guarded dynamic `import()`
|
|
37
|
+
* wrapped in try/catch, and only after an explicit
|
|
38
|
+
* `RUFLO_AGNTCY_SLIM_ENDPOINT` env var opt-in.
|
|
39
|
+
* - Every command in this directory exits 0 (not an error) when AGNTCY/
|
|
40
|
+
* SLIM is not configured — this is optional, removable augmentation,
|
|
41
|
+
* not a required dependency. The CLI, and these commands' own local
|
|
42
|
+
* fallback behavior, work identically whether or not this directory
|
|
43
|
+
* exists at all.
|
|
44
|
+
*
|
|
45
|
+
* Created with care by ruv.io
|
|
46
|
+
*/
|
|
47
|
+
import type { Command } from '../../types.js';
|
|
48
|
+
export { transportCommand, useCommand } from './transport.js';
|
|
49
|
+
export { agentPublishCommand } from './publish.js';
|
|
50
|
+
export { swarmJoinCommand } from './swarm-join.js';
|
|
51
|
+
export { detectAgntcyRuntime, AGNTCY_ENDPOINT_ENV, AGNTCY_PACKAGE_NAME, AGNTCY_ADR_PATH, AGNTCY_NOT_CONFIGURED_MESSAGE, } from './runtime.js';
|
|
52
|
+
export type { AgntcyRuntimeStatus } from './runtime.js';
|
|
53
|
+
export { validateOasfRecordShape, } from './publish.js';
|
|
54
|
+
export type { OasfAgentRecordShape, OasfValidationResult } from './publish.js';
|
|
55
|
+
export { validateNamespace } from './swarm-join.js';
|
|
56
|
+
/**
|
|
57
|
+
* Convenience bundle for the later integration pass — NOT a registered
|
|
58
|
+
* command tree itself (there is no top-level `agntcy` verb per ADR-380;
|
|
59
|
+
* each of these attaches to an existing or new top-level command per the
|
|
60
|
+
* mapping documented above).
|
|
61
|
+
*/
|
|
62
|
+
export declare const agntcyCommands: readonly Command[];
|
|
63
|
+
export default agntcyCommands;
|
|
64
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V3 CLI AGNTCY/Outshift Runtime Integration — ADR-380 §2.
|
|
3
|
+
*
|
|
4
|
+
* Scaffolds the three new `ruflo` CLI verbs ADR-380 §2 specifies:
|
|
5
|
+
*
|
|
6
|
+
* ruflo transport use slim
|
|
7
|
+
* ruflo agent publish
|
|
8
|
+
* ruflo swarm join <namespace>
|
|
9
|
+
*
|
|
10
|
+
* ============================================================================
|
|
11
|
+
* INTEGRATION STATUS: NOT WIRED IN. This module is intentionally
|
|
12
|
+
* self-contained and is NOT imported by, or registered with, the CLI's
|
|
13
|
+
* central command registry/index. A later, separate pass must:
|
|
14
|
+
*
|
|
15
|
+
* 1. Add `transportCommand` as a new top-level command (alongside
|
|
16
|
+
* `agent`, `swarm`, etc. in whatever file enumerates top-level
|
|
17
|
+
* commands today).
|
|
18
|
+
* 2. Merge `agentPublishCommand` into the existing `agentCommand`'s
|
|
19
|
+
* `subcommands` array in `../agent.ts`.
|
|
20
|
+
* 3. Merge `swarmJoinCommand` into the existing `swarmCommand`'s
|
|
21
|
+
* `subcommands` array in `../swarm.ts`.
|
|
22
|
+
* 4. Decide (per ADR-380's own "Open Questions") whether `transport use`
|
|
23
|
+
* is a per-swarm or global-session setting before wiring state
|
|
24
|
+
* persistence for the selected transport.
|
|
25
|
+
*
|
|
26
|
+
* No file outside `v3/@claude-flow/cli/src/commands/agntcy/` is touched by
|
|
27
|
+
* this scaffold.
|
|
28
|
+
* ============================================================================
|
|
29
|
+
*
|
|
30
|
+
* ARCHITECTURAL CONSTRAINT (mirrors ADR-150 §"architectural constraint",
|
|
31
|
+
* which ADR-380 §1 explicitly follows):
|
|
32
|
+
* - No `@claude-flow/agntcy` (or any other AGNTCY/SLIM/Outshift) package
|
|
33
|
+
* exists on npm or crates.io yet — verified 404 on every plausible
|
|
34
|
+
* name. Nothing in this directory statically imports one.
|
|
35
|
+
* - Every runtime touchpoint goes through `detectAgntcyRuntime()` in
|
|
36
|
+
* `runtime.ts`, which only ever does a guarded dynamic `import()`
|
|
37
|
+
* wrapped in try/catch, and only after an explicit
|
|
38
|
+
* `RUFLO_AGNTCY_SLIM_ENDPOINT` env var opt-in.
|
|
39
|
+
* - Every command in this directory exits 0 (not an error) when AGNTCY/
|
|
40
|
+
* SLIM is not configured — this is optional, removable augmentation,
|
|
41
|
+
* not a required dependency. The CLI, and these commands' own local
|
|
42
|
+
* fallback behavior, work identically whether or not this directory
|
|
43
|
+
* exists at all.
|
|
44
|
+
*
|
|
45
|
+
* Created with care by ruv.io
|
|
46
|
+
*/
|
|
47
|
+
export { transportCommand, useCommand } from './transport.js';
|
|
48
|
+
export { agentPublishCommand } from './publish.js';
|
|
49
|
+
export { swarmJoinCommand } from './swarm-join.js';
|
|
50
|
+
export { detectAgntcyRuntime, AGNTCY_ENDPOINT_ENV, AGNTCY_PACKAGE_NAME, AGNTCY_ADR_PATH, AGNTCY_NOT_CONFIGURED_MESSAGE, } from './runtime.js';
|
|
51
|
+
export { validateOasfRecordShape, } from './publish.js';
|
|
52
|
+
export { validateNamespace } from './swarm-join.js';
|
|
53
|
+
import { transportCommand } from './transport.js';
|
|
54
|
+
import { agentPublishCommand } from './publish.js';
|
|
55
|
+
import { swarmJoinCommand } from './swarm-join.js';
|
|
56
|
+
/**
|
|
57
|
+
* Convenience bundle for the later integration pass — NOT a registered
|
|
58
|
+
* command tree itself (there is no top-level `agntcy` verb per ADR-380;
|
|
59
|
+
* each of these attaches to an existing or new top-level command per the
|
|
60
|
+
* mapping documented above).
|
|
61
|
+
*/
|
|
62
|
+
export const agntcyCommands = [transportCommand, agentPublishCommand, swarmJoinCommand];
|
|
63
|
+
export default agntcyCommands;
|
|
64
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V3 CLI `ruflo agent publish` — ADR-380 §2.
|
|
3
|
+
*
|
|
4
|
+
* Emits the AGNTCY-identified, OASF-described agent record (produced
|
|
5
|
+
* build-time by the companion metaharness ADR-240 §2.1/2.2) to the
|
|
6
|
+
* configured AGNTCY Directory (https://github.com/agntcy/dir).
|
|
7
|
+
*
|
|
8
|
+
* This scaffold does NOT implement the Directory publish protocol — no
|
|
9
|
+
* SLIM/Directory SDK is installable yet (verified 404 on every plausible
|
|
10
|
+
* npm/crates.io name). It implements the one thing that IS real without
|
|
11
|
+
* an external SDK: reading a local OASF-shaped manifest off disk (the
|
|
12
|
+
* artifact metaharness ADR-240 is responsible for producing) and
|
|
13
|
+
* validating its shape before attempting a publish, so the eventual
|
|
14
|
+
* network call has a real payload to send rather than being invented at
|
|
15
|
+
* publish time.
|
|
16
|
+
*
|
|
17
|
+
* NOT WIRED INTO THE MAIN CLI ROUTER YET. This file is exported for a
|
|
18
|
+
* later integration pass to attach as a new subcommand of the existing
|
|
19
|
+
* `agent` command (`v3/@claude-flow/cli/src/commands/agent.ts`).
|
|
20
|
+
*/
|
|
21
|
+
import type { Command } from '../../types.js';
|
|
22
|
+
/** Minimal shape check for the OASF agent record metaharness ADR-240 §2.1/2.2 produces. */
|
|
23
|
+
export interface OasfAgentRecordShape {
|
|
24
|
+
name: unknown;
|
|
25
|
+
version: unknown;
|
|
26
|
+
identity?: unknown;
|
|
27
|
+
capabilities?: unknown;
|
|
28
|
+
[key: string]: unknown;
|
|
29
|
+
}
|
|
30
|
+
export interface OasfValidationResult {
|
|
31
|
+
valid: boolean;
|
|
32
|
+
errors: string[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Validate that a parsed JSON value looks like an OASF agent record —
|
|
36
|
+
* deterministic shape check, no network, no LLM. Kept exported so the
|
|
37
|
+
* test file can exercise it directly without spawning the whole command.
|
|
38
|
+
*/
|
|
39
|
+
export declare function validateOasfRecordShape(record: unknown): OasfValidationResult;
|
|
40
|
+
declare const publishCommand: Command;
|
|
41
|
+
export { publishCommand as agentPublishCommand };
|
|
42
|
+
export default publishCommand;
|
|
43
|
+
//# sourceMappingURL=publish.d.ts.map
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V3 CLI `ruflo agent publish` — ADR-380 §2.
|
|
3
|
+
*
|
|
4
|
+
* Emits the AGNTCY-identified, OASF-described agent record (produced
|
|
5
|
+
* build-time by the companion metaharness ADR-240 §2.1/2.2) to the
|
|
6
|
+
* configured AGNTCY Directory (https://github.com/agntcy/dir).
|
|
7
|
+
*
|
|
8
|
+
* This scaffold does NOT implement the Directory publish protocol — no
|
|
9
|
+
* SLIM/Directory SDK is installable yet (verified 404 on every plausible
|
|
10
|
+
* npm/crates.io name). It implements the one thing that IS real without
|
|
11
|
+
* an external SDK: reading a local OASF-shaped manifest off disk (the
|
|
12
|
+
* artifact metaharness ADR-240 is responsible for producing) and
|
|
13
|
+
* validating its shape before attempting a publish, so the eventual
|
|
14
|
+
* network call has a real payload to send rather than being invented at
|
|
15
|
+
* publish time.
|
|
16
|
+
*
|
|
17
|
+
* NOT WIRED INTO THE MAIN CLI ROUTER YET. This file is exported for a
|
|
18
|
+
* later integration pass to attach as a new subcommand of the existing
|
|
19
|
+
* `agent` command (`v3/@claude-flow/cli/src/commands/agent.ts`).
|
|
20
|
+
*/
|
|
21
|
+
import { output } from '../../output.js';
|
|
22
|
+
import { readFile } from 'fs/promises';
|
|
23
|
+
import { AGNTCY_NOT_CONFIGURED_MESSAGE, AGNTCY_PACKAGE_NAME, detectAgntcyRuntime, } from './runtime.js';
|
|
24
|
+
/**
|
|
25
|
+
* Validate that a parsed JSON value looks like an OASF agent record —
|
|
26
|
+
* deterministic shape check, no network, no LLM. Kept exported so the
|
|
27
|
+
* test file can exercise it directly without spawning the whole command.
|
|
28
|
+
*/
|
|
29
|
+
export function validateOasfRecordShape(record) {
|
|
30
|
+
const errors = [];
|
|
31
|
+
if (typeof record !== 'object' || record === null || Array.isArray(record)) {
|
|
32
|
+
return { valid: false, errors: ['record is not a JSON object'] };
|
|
33
|
+
}
|
|
34
|
+
const rec = record;
|
|
35
|
+
if (typeof rec.name !== 'string' || rec.name.trim().length === 0) {
|
|
36
|
+
errors.push('missing or empty required field "name"');
|
|
37
|
+
}
|
|
38
|
+
if (typeof rec.version !== 'string' || rec.version.trim().length === 0) {
|
|
39
|
+
errors.push('missing or empty required field "version"');
|
|
40
|
+
}
|
|
41
|
+
return { valid: errors.length === 0, errors };
|
|
42
|
+
}
|
|
43
|
+
const DEFAULT_MANIFEST_PATH = '.agntcy/agent.oasf.json';
|
|
44
|
+
const publishCommand = {
|
|
45
|
+
name: 'publish',
|
|
46
|
+
description: 'Publish the AGNTCY-identified, OASF-described agent record to the configured Directory (ADR-380 §2)',
|
|
47
|
+
options: [
|
|
48
|
+
{
|
|
49
|
+
name: 'manifest',
|
|
50
|
+
short: 'm',
|
|
51
|
+
description: 'Path to the OASF agent record produced by metaharness (ADR-240)',
|
|
52
|
+
type: 'string',
|
|
53
|
+
default: DEFAULT_MANIFEST_PATH,
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
examples: [
|
|
57
|
+
{ command: 'ruflo agent publish', description: 'Publish the local OASF agent record to the AGNTCY Directory' },
|
|
58
|
+
{ command: 'ruflo agent publish --manifest ./out/agent.oasf.json', description: 'Publish a specific manifest' },
|
|
59
|
+
],
|
|
60
|
+
action: async (ctx) => {
|
|
61
|
+
const manifestPath = ctx.flags.manifest || DEFAULT_MANIFEST_PATH;
|
|
62
|
+
// Step 1 (real, no SDK needed): locate + shape-validate the manifest.
|
|
63
|
+
let raw;
|
|
64
|
+
try {
|
|
65
|
+
raw = await readFile(manifestPath, 'utf-8');
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
output.printError(`No OASF agent record found at "${manifestPath}". Run the metaharness ADR-240 build step first, ` +
|
|
69
|
+
'or pass --manifest <path>.');
|
|
70
|
+
return { success: false, exitCode: 1 };
|
|
71
|
+
}
|
|
72
|
+
let parsed;
|
|
73
|
+
try {
|
|
74
|
+
parsed = JSON.parse(raw);
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
output.printError(`"${manifestPath}" is not valid JSON: ${error instanceof Error ? error.message : String(error)}`);
|
|
78
|
+
return { success: false, exitCode: 1 };
|
|
79
|
+
}
|
|
80
|
+
const validation = validateOasfRecordShape(parsed);
|
|
81
|
+
if (!validation.valid) {
|
|
82
|
+
output.printError(`"${manifestPath}" is not a valid OASF agent record:`);
|
|
83
|
+
for (const err of validation.errors) {
|
|
84
|
+
output.writeln(` - ${err}`);
|
|
85
|
+
}
|
|
86
|
+
return { success: false, exitCode: 1 };
|
|
87
|
+
}
|
|
88
|
+
// Step 2 (stub, requires the not-yet-published runtime): the actual
|
|
89
|
+
// Directory publish call.
|
|
90
|
+
const status = await detectAgntcyRuntime();
|
|
91
|
+
if (!status.configured) {
|
|
92
|
+
output.printInfo(AGNTCY_NOT_CONFIGURED_MESSAGE);
|
|
93
|
+
output.printInfo(`Validated OASF record at "${manifestPath}" locally (name=${parsed.name}, ` +
|
|
94
|
+
`version=${parsed.version}); publish to the Directory was skipped.`);
|
|
95
|
+
return {
|
|
96
|
+
success: true,
|
|
97
|
+
data: { published: false, manifestPath, configured: false, reason: status.reason },
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
try {
|
|
101
|
+
const mod = (await import(AGNTCY_PACKAGE_NAME));
|
|
102
|
+
if (typeof mod.publishAgentRecord !== 'function') {
|
|
103
|
+
throw new Error(`"${AGNTCY_PACKAGE_NAME}" is installed but does not export publishAgentRecord()`);
|
|
104
|
+
}
|
|
105
|
+
const result = await mod.publishAgentRecord({
|
|
106
|
+
endpoint: status.endpoint,
|
|
107
|
+
record: parsed,
|
|
108
|
+
});
|
|
109
|
+
output.printSuccess(`Published agent record${result?.uri ? ` to ${result.uri}` : ''}.`);
|
|
110
|
+
return { success: true, data: { published: true, manifestPath, uri: result?.uri } };
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
114
|
+
output.printError(`Directory publish failed: ${message}`);
|
|
115
|
+
return { success: true, data: { published: false, manifestPath, error: message } };
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
export { publishCommand as agentPublishCommand };
|
|
120
|
+
export default publishCommand;
|
|
121
|
+
//# sourceMappingURL=publish.js.map
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V3 CLI AGNTCY/SLIM Runtime Presence Check — ADR-380 §1.
|
|
3
|
+
*
|
|
4
|
+
* ADR-380 introduces three new `ruflo` CLI verbs (`transport use slim`,
|
|
5
|
+
* `agent publish`, `swarm join <namespace>`) that talk to Cisco Outshift's
|
|
6
|
+
* AGNTCY ecosystem (SLIM transport, Directory publish, group membership).
|
|
7
|
+
*
|
|
8
|
+
* CORRECTED (2026-07-31): the original scaffold guessed at a package name
|
|
9
|
+
* (`@claude-flow/agntcy`) and concluded no real SLIM SDK existed anywhere.
|
|
10
|
+
* That check only tried guessed names — the real package is
|
|
11
|
+
* `@agntcy/slim-bindings` (npm, real, published, documented for plain
|
|
12
|
+
* Node.js use).
|
|
13
|
+
*
|
|
14
|
+
* `@agntcy/slim-bindings@1.4.1` (npm `latest`) fails to load in plain Node —
|
|
15
|
+
* a transitive dependency (`uniffi-bindgen-react-native`) ships raw,
|
|
16
|
+
* uncompiled TypeScript as its package.json `main`, which only works inside
|
|
17
|
+
* a bundler (Metro, for its React Native use case). Filed upstream:
|
|
18
|
+
* agntcy/slim#1916 and jhugman/uniffi-bindgen-react-native#422 (root cause).
|
|
19
|
+
*
|
|
20
|
+
* UPDATE (2026-07-31, later): the SLIM maintainers confirmed they've moved
|
|
21
|
+
* off `uniffi-bindgen-react-native` onto `@ubjs/core`/`@ubjs/node` (compiled
|
|
22
|
+
* output, not raw TS) in the `alpha` dist-tag (`2.0.0-alpha.4+`), not yet
|
|
23
|
+
* promoted to `latest`. Verified live: a real server-bring-up + client-
|
|
24
|
+
* connect + graceful-shutdown smoke test against `@agntcy/slim-bindings@
|
|
25
|
+
* 2.0.0-alpha.5` succeeds under plain Node with zero errors. `package.json`
|
|
26
|
+
* now pins that exact alpha version (not a caret range — this is a
|
|
27
|
+
* pre-release channel, pin deliberately rather than floating) until the fix
|
|
28
|
+
* is promoted to `latest`, tracked by the same issue.
|
|
29
|
+
*
|
|
30
|
+
* This module's existing graceful-degradation design already handled this
|
|
31
|
+
* correctly without any change to its logic: `detectAgntcyRuntime()`'s
|
|
32
|
+
* catch-all branch (anything other than MODULE_NOT_FOUND) reports the real
|
|
33
|
+
* underlying error and falls back to local transport when the import fails.
|
|
34
|
+
* Now that the pinned version actually loads, the happy path
|
|
35
|
+
* (`configured: true`) is real and verified, not aspirational — no change
|
|
36
|
+
* to this function was needed either way.
|
|
37
|
+
*
|
|
38
|
+
* Per ADR-150's precedent (which ADR-380 §1 explicitly follows, not
|
|
39
|
+
* ADR-321's hard-dependency exception):
|
|
40
|
+
* - removable: deleting this whole directory changes nothing
|
|
41
|
+
* about the rest of the CLI working.
|
|
42
|
+
* - optional-only: `@agntcy/slim-bindings` MUST live in
|
|
43
|
+
* optionalDependencies, never `dependencies`.
|
|
44
|
+
* - graceful degradation: every caller of `detectAgntcyRuntime()` falls
|
|
45
|
+
* back to the local transport / existing
|
|
46
|
+
* authorization model on `configured: false`.
|
|
47
|
+
* - CI-gated: a "works without AGNTCY installed" smoke test
|
|
48
|
+
* is exercised by __tests__/agntcy-commands.test.ts.
|
|
49
|
+
*/
|
|
50
|
+
/** Env var an operator sets to point ruflo at a SLIM endpoint. */
|
|
51
|
+
export declare const AGNTCY_ENDPOINT_ENV = "RUFLO_AGNTCY_SLIM_ENDPOINT";
|
|
52
|
+
/**
|
|
53
|
+
* The real SLIM Node.js bindings package (npm, published, real). Kept as a
|
|
54
|
+
* named constant (not a string literal scattered through the module) so a
|
|
55
|
+
* single edit repoints every dynamic-import call site if that ever changes.
|
|
56
|
+
* Currently fails to load due to an upstream packaging bug — see this
|
|
57
|
+
* file's header comment — which `detectAgntcyRuntime()`'s catch-all branch
|
|
58
|
+
* already handles gracefully.
|
|
59
|
+
*/
|
|
60
|
+
export declare const AGNTCY_PACKAGE_NAME = "@agntcy/slim-bindings";
|
|
61
|
+
/** Pointer to the ADR every "not configured" message should send users to. */
|
|
62
|
+
export declare const AGNTCY_ADR_PATH = "v3/docs/adr/ADR-380-agntcy-outshift-runtime-integration.md";
|
|
63
|
+
export declare const AGNTCY_NOT_CONFIGURED_MESSAGE: string;
|
|
64
|
+
export interface AgntcyRuntimeStatus {
|
|
65
|
+
/** True only when an endpoint is set AND the optional runtime package resolves. */
|
|
66
|
+
configured: boolean;
|
|
67
|
+
/** Human-readable reason for the current status — always safe to print. */
|
|
68
|
+
reason: string;
|
|
69
|
+
/** The configured endpoint, if any (present even when configured is false, e.g. package missing). */
|
|
70
|
+
endpoint?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Detect whether the optional AGNTCY/SLIM runtime is available.
|
|
74
|
+
*
|
|
75
|
+
* This function never throws and never makes a network call. It performs,
|
|
76
|
+
* in order:
|
|
77
|
+
* 1. An env var presence check for {@link AGNTCY_ENDPOINT_ENV}. Absent →
|
|
78
|
+
* not configured, no further work.
|
|
79
|
+
* 2. A dynamic `import()` of {@link AGNTCY_PACKAGE_NAME} (or `packageName`
|
|
80
|
+
* if overridden), wrapped in try/catch. Verified live: the pinned
|
|
81
|
+
* `2.0.0-alpha.5` resolves cleanly — `configured: true` is a real,
|
|
82
|
+
* exercised path today, not just a theoretical one.
|
|
83
|
+
*
|
|
84
|
+
* @param env Injectable for tests; defaults to `process.env`.
|
|
85
|
+
* @param packageName Injectable for tests (to simulate "package not
|
|
86
|
+
* installed" without needing to actually uninstall the real optional
|
|
87
|
+
* dependency); defaults to {@link AGNTCY_PACKAGE_NAME}.
|
|
88
|
+
*/
|
|
89
|
+
export declare function detectAgntcyRuntime(env?: NodeJS.ProcessEnv, packageName?: string): Promise<AgntcyRuntimeStatus>;
|
|
90
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V3 CLI AGNTCY/SLIM Runtime Presence Check — ADR-380 §1.
|
|
3
|
+
*
|
|
4
|
+
* ADR-380 introduces three new `ruflo` CLI verbs (`transport use slim`,
|
|
5
|
+
* `agent publish`, `swarm join <namespace>`) that talk to Cisco Outshift's
|
|
6
|
+
* AGNTCY ecosystem (SLIM transport, Directory publish, group membership).
|
|
7
|
+
*
|
|
8
|
+
* CORRECTED (2026-07-31): the original scaffold guessed at a package name
|
|
9
|
+
* (`@claude-flow/agntcy`) and concluded no real SLIM SDK existed anywhere.
|
|
10
|
+
* That check only tried guessed names — the real package is
|
|
11
|
+
* `@agntcy/slim-bindings` (npm, real, published, documented for plain
|
|
12
|
+
* Node.js use).
|
|
13
|
+
*
|
|
14
|
+
* `@agntcy/slim-bindings@1.4.1` (npm `latest`) fails to load in plain Node —
|
|
15
|
+
* a transitive dependency (`uniffi-bindgen-react-native`) ships raw,
|
|
16
|
+
* uncompiled TypeScript as its package.json `main`, which only works inside
|
|
17
|
+
* a bundler (Metro, for its React Native use case). Filed upstream:
|
|
18
|
+
* agntcy/slim#1916 and jhugman/uniffi-bindgen-react-native#422 (root cause).
|
|
19
|
+
*
|
|
20
|
+
* UPDATE (2026-07-31, later): the SLIM maintainers confirmed they've moved
|
|
21
|
+
* off `uniffi-bindgen-react-native` onto `@ubjs/core`/`@ubjs/node` (compiled
|
|
22
|
+
* output, not raw TS) in the `alpha` dist-tag (`2.0.0-alpha.4+`), not yet
|
|
23
|
+
* promoted to `latest`. Verified live: a real server-bring-up + client-
|
|
24
|
+
* connect + graceful-shutdown smoke test against `@agntcy/slim-bindings@
|
|
25
|
+
* 2.0.0-alpha.5` succeeds under plain Node with zero errors. `package.json`
|
|
26
|
+
* now pins that exact alpha version (not a caret range — this is a
|
|
27
|
+
* pre-release channel, pin deliberately rather than floating) until the fix
|
|
28
|
+
* is promoted to `latest`, tracked by the same issue.
|
|
29
|
+
*
|
|
30
|
+
* This module's existing graceful-degradation design already handled this
|
|
31
|
+
* correctly without any change to its logic: `detectAgntcyRuntime()`'s
|
|
32
|
+
* catch-all branch (anything other than MODULE_NOT_FOUND) reports the real
|
|
33
|
+
* underlying error and falls back to local transport when the import fails.
|
|
34
|
+
* Now that the pinned version actually loads, the happy path
|
|
35
|
+
* (`configured: true`) is real and verified, not aspirational — no change
|
|
36
|
+
* to this function was needed either way.
|
|
37
|
+
*
|
|
38
|
+
* Per ADR-150's precedent (which ADR-380 §1 explicitly follows, not
|
|
39
|
+
* ADR-321's hard-dependency exception):
|
|
40
|
+
* - removable: deleting this whole directory changes nothing
|
|
41
|
+
* about the rest of the CLI working.
|
|
42
|
+
* - optional-only: `@agntcy/slim-bindings` MUST live in
|
|
43
|
+
* optionalDependencies, never `dependencies`.
|
|
44
|
+
* - graceful degradation: every caller of `detectAgntcyRuntime()` falls
|
|
45
|
+
* back to the local transport / existing
|
|
46
|
+
* authorization model on `configured: false`.
|
|
47
|
+
* - CI-gated: a "works without AGNTCY installed" smoke test
|
|
48
|
+
* is exercised by __tests__/agntcy-commands.test.ts.
|
|
49
|
+
*/
|
|
50
|
+
/** Env var an operator sets to point ruflo at a SLIM endpoint. */
|
|
51
|
+
export const AGNTCY_ENDPOINT_ENV = 'RUFLO_AGNTCY_SLIM_ENDPOINT';
|
|
52
|
+
/**
|
|
53
|
+
* The real SLIM Node.js bindings package (npm, published, real). Kept as a
|
|
54
|
+
* named constant (not a string literal scattered through the module) so a
|
|
55
|
+
* single edit repoints every dynamic-import call site if that ever changes.
|
|
56
|
+
* Currently fails to load due to an upstream packaging bug — see this
|
|
57
|
+
* file's header comment — which `detectAgntcyRuntime()`'s catch-all branch
|
|
58
|
+
* already handles gracefully.
|
|
59
|
+
*/
|
|
60
|
+
export const AGNTCY_PACKAGE_NAME = '@agntcy/slim-bindings';
|
|
61
|
+
/** Pointer to the ADR every "not configured" message should send users to. */
|
|
62
|
+
export const AGNTCY_ADR_PATH = 'v3/docs/adr/ADR-380-agntcy-outshift-runtime-integration.md';
|
|
63
|
+
export const AGNTCY_NOT_CONFIGURED_MESSAGE = `AGNTCY/SLIM transport is not configured — see ADR-380 (${AGNTCY_ADR_PATH}) for setup. ` +
|
|
64
|
+
'Falling back to local transport.';
|
|
65
|
+
/**
|
|
66
|
+
* Detect whether the optional AGNTCY/SLIM runtime is available.
|
|
67
|
+
*
|
|
68
|
+
* This function never throws and never makes a network call. It performs,
|
|
69
|
+
* in order:
|
|
70
|
+
* 1. An env var presence check for {@link AGNTCY_ENDPOINT_ENV}. Absent →
|
|
71
|
+
* not configured, no further work.
|
|
72
|
+
* 2. A dynamic `import()` of {@link AGNTCY_PACKAGE_NAME} (or `packageName`
|
|
73
|
+
* if overridden), wrapped in try/catch. Verified live: the pinned
|
|
74
|
+
* `2.0.0-alpha.5` resolves cleanly — `configured: true` is a real,
|
|
75
|
+
* exercised path today, not just a theoretical one.
|
|
76
|
+
*
|
|
77
|
+
* @param env Injectable for tests; defaults to `process.env`.
|
|
78
|
+
* @param packageName Injectable for tests (to simulate "package not
|
|
79
|
+
* installed" without needing to actually uninstall the real optional
|
|
80
|
+
* dependency); defaults to {@link AGNTCY_PACKAGE_NAME}.
|
|
81
|
+
*/
|
|
82
|
+
export async function detectAgntcyRuntime(env = process.env, packageName = AGNTCY_PACKAGE_NAME) {
|
|
83
|
+
const endpoint = env[AGNTCY_ENDPOINT_ENV];
|
|
84
|
+
if (!endpoint) {
|
|
85
|
+
return { configured: false, reason: `${AGNTCY_ENDPOINT_ENV} is not set` };
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
// Dynamic import of an optional dependency, exactly the pattern this
|
|
89
|
+
// repo already uses for other optional runtimes (see status.ts's
|
|
90
|
+
// `await import('pg')`). Never a static `import` — a static import
|
|
91
|
+
// would make @claude-flow/cli fail to build/run when the package is
|
|
92
|
+
// absent, which is the one thing ADR-150/ADR-380 forbid.
|
|
93
|
+
await import(packageName);
|
|
94
|
+
return { configured: true, reason: `${packageName} resolved`, endpoint };
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
const code = error?.code;
|
|
98
|
+
if (code === 'ERR_MODULE_NOT_FOUND' || code === 'MODULE_NOT_FOUND') {
|
|
99
|
+
return {
|
|
100
|
+
configured: false,
|
|
101
|
+
reason: `${AGNTCY_ENDPOINT_ENV} is set but the optional "${packageName}" runtime package is not installed`,
|
|
102
|
+
endpoint,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
// Any other error importing the module (syntax error in a real
|
|
106
|
+
// install, permission issue, etc.) — still degrade gracefully rather
|
|
107
|
+
// than propagate, but keep the real reason for diagnostics.
|
|
108
|
+
return {
|
|
109
|
+
configured: false,
|
|
110
|
+
reason: `error probing "${packageName}": ${error instanceof Error ? error.message : String(error)}`,
|
|
111
|
+
endpoint,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V3 CLI `ruflo swarm join <namespace>` — ADR-380 §2.
|
|
3
|
+
*
|
|
4
|
+
* Joins a SLIM group-membership channel scoped to a Cognitum tenant/project
|
|
5
|
+
* namespace (e.g. `cognitum/research/security`). This is an AGNTCY/SLIM
|
|
6
|
+
* concept layered on top of — never a replacement for — this repo's own
|
|
7
|
+
* `swarm_init`/`hive-mind_*` MCP-tool coordination, which remains the
|
|
8
|
+
* default for single-host swarms per ADR-380 §2.
|
|
9
|
+
*
|
|
10
|
+
* NOT WIRED INTO THE MAIN CLI ROUTER YET. This file is exported for a
|
|
11
|
+
* later integration pass to attach as a new subcommand of the existing
|
|
12
|
+
* `swarm` command (`v3/@claude-flow/cli/src/commands/swarm.ts`).
|
|
13
|
+
*/
|
|
14
|
+
import type { Command } from '../../types.js';
|
|
15
|
+
/**
|
|
16
|
+
* SLIM group-membership namespaces are slash-delimited (e.g.
|
|
17
|
+
* `cognitum/research/security`), matching the ADR-380 §2 example. Validate
|
|
18
|
+
* the shape locally — deterministic, no SDK required — before ever
|
|
19
|
+
* attempting a network join.
|
|
20
|
+
*/
|
|
21
|
+
export declare function validateNamespace(namespace: string): {
|
|
22
|
+
valid: boolean;
|
|
23
|
+
error?: string;
|
|
24
|
+
};
|
|
25
|
+
declare const joinCommand: Command;
|
|
26
|
+
export { joinCommand as swarmJoinCommand };
|
|
27
|
+
export default joinCommand;
|
|
28
|
+
//# sourceMappingURL=swarm-join.d.ts.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V3 CLI `ruflo swarm join <namespace>` — ADR-380 §2.
|
|
3
|
+
*
|
|
4
|
+
* Joins a SLIM group-membership channel scoped to a Cognitum tenant/project
|
|
5
|
+
* namespace (e.g. `cognitum/research/security`). This is an AGNTCY/SLIM
|
|
6
|
+
* concept layered on top of — never a replacement for — this repo's own
|
|
7
|
+
* `swarm_init`/`hive-mind_*` MCP-tool coordination, which remains the
|
|
8
|
+
* default for single-host swarms per ADR-380 §2.
|
|
9
|
+
*
|
|
10
|
+
* NOT WIRED INTO THE MAIN CLI ROUTER YET. This file is exported for a
|
|
11
|
+
* later integration pass to attach as a new subcommand of the existing
|
|
12
|
+
* `swarm` command (`v3/@claude-flow/cli/src/commands/swarm.ts`).
|
|
13
|
+
*/
|
|
14
|
+
import { output } from '../../output.js';
|
|
15
|
+
import { AGNTCY_NOT_CONFIGURED_MESSAGE, AGNTCY_PACKAGE_NAME, detectAgntcyRuntime, } from './runtime.js';
|
|
16
|
+
/**
|
|
17
|
+
* SLIM group-membership namespaces are slash-delimited (e.g.
|
|
18
|
+
* `cognitum/research/security`), matching the ADR-380 §2 example. Validate
|
|
19
|
+
* the shape locally — deterministic, no SDK required — before ever
|
|
20
|
+
* attempting a network join.
|
|
21
|
+
*/
|
|
22
|
+
export function validateNamespace(namespace) {
|
|
23
|
+
if (!namespace || namespace.trim().length === 0) {
|
|
24
|
+
return { valid: false, error: 'namespace must be a non-empty string' };
|
|
25
|
+
}
|
|
26
|
+
// Deliberately NOT filtering empty segments — a leading/trailing/double
|
|
27
|
+
// slash (e.g. "cognitum//security") is a malformed namespace, not a
|
|
28
|
+
// cosmetic one, and should be rejected rather than silently repaired.
|
|
29
|
+
const segments = namespace.split('/');
|
|
30
|
+
if (segments.length === 0) {
|
|
31
|
+
return { valid: false, error: 'namespace must contain at least one segment' };
|
|
32
|
+
}
|
|
33
|
+
const validSegment = /^[a-zA-Z0-9_-]+$/;
|
|
34
|
+
const bad = segments.find((s) => !validSegment.test(s));
|
|
35
|
+
if (bad !== undefined) {
|
|
36
|
+
return { valid: false, error: `invalid namespace segment "${bad}" — only [a-zA-Z0-9_-] allowed per segment` };
|
|
37
|
+
}
|
|
38
|
+
return { valid: true };
|
|
39
|
+
}
|
|
40
|
+
const joinCommand = {
|
|
41
|
+
name: 'join',
|
|
42
|
+
description: 'Join a SLIM group-membership channel scoped to a namespace (ADR-380 §2)',
|
|
43
|
+
examples: [
|
|
44
|
+
{ command: 'ruflo swarm join cognitum/research/security', description: 'Join the SLIM group-membership channel for a tenant namespace' },
|
|
45
|
+
],
|
|
46
|
+
action: async (ctx) => {
|
|
47
|
+
const namespace = (ctx.args[0] || ctx.flags.namespace || '').trim();
|
|
48
|
+
if (!namespace) {
|
|
49
|
+
output.printError('Namespace is required. Usage: ruflo swarm join <namespace> (e.g. cognitum/research/security)');
|
|
50
|
+
return { success: false, exitCode: 1 };
|
|
51
|
+
}
|
|
52
|
+
const nsCheck = validateNamespace(namespace);
|
|
53
|
+
if (!nsCheck.valid) {
|
|
54
|
+
output.printError(`Invalid namespace "${namespace}": ${nsCheck.error}`);
|
|
55
|
+
return { success: false, exitCode: 1 };
|
|
56
|
+
}
|
|
57
|
+
const status = await detectAgntcyRuntime();
|
|
58
|
+
if (!status.configured) {
|
|
59
|
+
output.printInfo(AGNTCY_NOT_CONFIGURED_MESSAGE);
|
|
60
|
+
output.printInfo(`Namespace "${namespace}" was not joined via SLIM. Local swarm/hive-mind coordination ` +
|
|
61
|
+
'(swarm_init / hive-mind_* MCP tools) remains available and unaffected.');
|
|
62
|
+
return {
|
|
63
|
+
success: true,
|
|
64
|
+
data: { joined: false, namespace, configured: false, reason: status.reason },
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
const mod = (await import(AGNTCY_PACKAGE_NAME));
|
|
69
|
+
if (typeof mod.joinGroup !== 'function') {
|
|
70
|
+
throw new Error(`"${AGNTCY_PACKAGE_NAME}" is installed but does not export joinGroup()`);
|
|
71
|
+
}
|
|
72
|
+
const result = await mod.joinGroup({ endpoint: status.endpoint, namespace });
|
|
73
|
+
output.printSuccess(`Joined SLIM group "${namespace}"${typeof result?.members === 'number' ? ` (${result.members} members)` : ''}.`);
|
|
74
|
+
return { success: true, data: { joined: true, namespace, members: result?.members } };
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
78
|
+
output.printError(`SLIM group join failed: ${message}`);
|
|
79
|
+
return { success: true, data: { joined: false, namespace, error: message } };
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
export { joinCommand as swarmJoinCommand };
|
|
84
|
+
export default joinCommand;
|
|
85
|
+
//# sourceMappingURL=swarm-join.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V3 CLI `ruflo transport use slim` — ADR-380 §2.
|
|
3
|
+
*
|
|
4
|
+
* Switches the active swarm/hive-mind coordination transport from today's
|
|
5
|
+
* in-process/local-hooks routing to SLIM (secure messaging for MCP/A2A,
|
|
6
|
+
* hierarchical routing, group membership, MLS encryption) for agents
|
|
7
|
+
* coordinating across hosts or across a tenant boundary.
|
|
8
|
+
*
|
|
9
|
+
* Local transport stays the default. This command is a NO-OP on the local
|
|
10
|
+
* path unless an operator has both set {@link AGNTCY_ENDPOINT_ENV} AND
|
|
11
|
+
* installed the (not-yet-published) optional runtime package — see
|
|
12
|
+
* runtime.ts for the full graceful-degradation contract.
|
|
13
|
+
*
|
|
14
|
+
* NOT WIRED INTO THE MAIN CLI ROUTER YET. This file is exported for a
|
|
15
|
+
* later integration pass to attach as a new top-level `transport` command
|
|
16
|
+
* (or a subcommand of one, per the open question in ADR-380 §"Open
|
|
17
|
+
* Questions" about per-swarm vs. global scope).
|
|
18
|
+
*/
|
|
19
|
+
import type { Command } from '../../types.js';
|
|
20
|
+
declare const useCommand: Command;
|
|
21
|
+
export declare const transportCommand: Command;
|
|
22
|
+
export { useCommand };
|
|
23
|
+
export default transportCommand;
|
|
24
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V3 CLI `ruflo transport use slim` — ADR-380 §2.
|
|
3
|
+
*
|
|
4
|
+
* Switches the active swarm/hive-mind coordination transport from today's
|
|
5
|
+
* in-process/local-hooks routing to SLIM (secure messaging for MCP/A2A,
|
|
6
|
+
* hierarchical routing, group membership, MLS encryption) for agents
|
|
7
|
+
* coordinating across hosts or across a tenant boundary.
|
|
8
|
+
*
|
|
9
|
+
* Local transport stays the default. This command is a NO-OP on the local
|
|
10
|
+
* path unless an operator has both set {@link AGNTCY_ENDPOINT_ENV} AND
|
|
11
|
+
* installed the (not-yet-published) optional runtime package — see
|
|
12
|
+
* runtime.ts for the full graceful-degradation contract.
|
|
13
|
+
*
|
|
14
|
+
* NOT WIRED INTO THE MAIN CLI ROUTER YET. This file is exported for a
|
|
15
|
+
* later integration pass to attach as a new top-level `transport` command
|
|
16
|
+
* (or a subcommand of one, per the open question in ADR-380 §"Open
|
|
17
|
+
* Questions" about per-swarm vs. global scope).
|
|
18
|
+
*/
|
|
19
|
+
import { output } from '../../output.js';
|
|
20
|
+
import { AGNTCY_NOT_CONFIGURED_MESSAGE, AGNTCY_PACKAGE_NAME, detectAgntcyRuntime, } from './runtime.js';
|
|
21
|
+
/** Transport names this command currently recognizes. Only 'slim' per ADR-380 §2. */
|
|
22
|
+
const SUPPORTED_TRANSPORTS = new Set(['slim']);
|
|
23
|
+
const useCommand = {
|
|
24
|
+
name: 'use',
|
|
25
|
+
description: 'Switch the active swarm/hive-mind transport (e.g. slim) — ADR-380 §2',
|
|
26
|
+
examples: [
|
|
27
|
+
{ command: 'ruflo transport use slim', description: 'Switch coordination transport to SLIM (opt-in, degrades to local)' },
|
|
28
|
+
],
|
|
29
|
+
action: async (ctx) => {
|
|
30
|
+
const requested = (ctx.args[0] || ctx.flags.transport || '').trim().toLowerCase();
|
|
31
|
+
if (!requested) {
|
|
32
|
+
output.printError('Transport name required. Usage: ruflo transport use <name> (e.g. slim)');
|
|
33
|
+
return { success: false, exitCode: 1 };
|
|
34
|
+
}
|
|
35
|
+
if (!SUPPORTED_TRANSPORTS.has(requested)) {
|
|
36
|
+
output.printError(`Unknown transport "${requested}". Supported: ${Array.from(SUPPORTED_TRANSPORTS).join(', ')}.`);
|
|
37
|
+
output.printInfo('Local transport remains the default and needs no explicit "use".');
|
|
38
|
+
return { success: false, exitCode: 1 };
|
|
39
|
+
}
|
|
40
|
+
const status = await detectAgntcyRuntime();
|
|
41
|
+
if (!status.configured) {
|
|
42
|
+
output.printInfo(AGNTCY_NOT_CONFIGURED_MESSAGE);
|
|
43
|
+
output.printInfo('Active transport remains: local (in-process hooks routing).');
|
|
44
|
+
return {
|
|
45
|
+
success: true,
|
|
46
|
+
data: { transport: 'local', requested, configured: false, reason: status.reason },
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
// Reachable only once the optional package is actually installed AND
|
|
50
|
+
// an endpoint is configured — not possible today (package unpublished).
|
|
51
|
+
try {
|
|
52
|
+
const mod = (await import(AGNTCY_PACKAGE_NAME));
|
|
53
|
+
if (typeof mod.createSlimTransport !== 'function') {
|
|
54
|
+
throw new Error(`"${AGNTCY_PACKAGE_NAME}" is installed but does not export createSlimTransport()`);
|
|
55
|
+
}
|
|
56
|
+
await mod.createSlimTransport({ endpoint: status.endpoint });
|
|
57
|
+
output.printSuccess(`Active transport switched to: slim (${status.endpoint})`);
|
|
58
|
+
return { success: true, data: { transport: 'slim', endpoint: status.endpoint, configured: true } };
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
62
|
+
output.printError(`Failed to activate SLIM transport: ${message}`);
|
|
63
|
+
output.printInfo('Falling back to local transport.');
|
|
64
|
+
return { success: true, data: { transport: 'local', requested, configured: false, error: message } };
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
export const transportCommand = {
|
|
69
|
+
name: 'transport',
|
|
70
|
+
description: 'Manage the active swarm/hive-mind coordination transport (ADR-380 §2)',
|
|
71
|
+
subcommands: [useCommand],
|
|
72
|
+
examples: [
|
|
73
|
+
{ command: 'ruflo transport use slim', description: 'Switch coordination transport to SLIM' },
|
|
74
|
+
],
|
|
75
|
+
action: async () => {
|
|
76
|
+
output.writeln();
|
|
77
|
+
output.writeln(output.bold('AGNTCY/SLIM Transport'));
|
|
78
|
+
output.writeln(output.dim('='.repeat(60)));
|
|
79
|
+
output.writeln();
|
|
80
|
+
output.printBox([
|
|
81
|
+
'Local transport (in-process hooks routing) is the default.',
|
|
82
|
+
'',
|
|
83
|
+
'Subcommands:',
|
|
84
|
+
'',
|
|
85
|
+
' use <name> Switch the active transport (currently: slim)',
|
|
86
|
+
'',
|
|
87
|
+
`See ADR-380 for setup: v3/docs/adr/ADR-380-agntcy-outshift-runtime-integration.md`,
|
|
88
|
+
].join('\n'), 'AGNTCY/SLIM Transport');
|
|
89
|
+
output.writeln();
|
|
90
|
+
return { success: true };
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
export { useCommand };
|
|
94
|
+
export default transportCommand;
|
|
95
|
+
//# sourceMappingURL=transport.js.map
|
|
@@ -45,6 +45,7 @@ export declare function getGuidanceCommand(): Promise<Command | undefined>;
|
|
|
45
45
|
export declare function getApplianceCommand(): Promise<Command | undefined>;
|
|
46
46
|
export declare function getCleanupCommand(): Promise<Command | undefined>;
|
|
47
47
|
export declare function getAutopilotCommand(): Promise<Command | undefined>;
|
|
48
|
+
export declare function getTransportCommand(): Promise<Command | undefined>;
|
|
48
49
|
/**
|
|
49
50
|
* Core commands loaded synchronously (available immediately)
|
|
50
51
|
* Advanced commands loaded on-demand for faster startup
|
|
@@ -90,6 +90,10 @@ const commandLoaders = {
|
|
|
90
90
|
spinner: () => import('./spinner.js'),
|
|
91
91
|
// Ruflo entries in Claude Code's companyAnnouncements startup rotation (ADR-319)
|
|
92
92
|
announcements: () => import('./announcements.js'),
|
|
93
|
+
// AGNTCY/Outshift runtime transport selection (ADR-324 §2) — optional,
|
|
94
|
+
// removable augmentation; no-ops to local transport when AGNTCY/SLIM is
|
|
95
|
+
// not configured (RUFLO_AGNTCY_SLIM_ENDPOINT unset).
|
|
96
|
+
transport: () => import('./agntcy/transport.js'),
|
|
93
97
|
};
|
|
94
98
|
// Cache for loaded commands
|
|
95
99
|
const loadedCommands = new Map();
|
|
@@ -188,6 +192,7 @@ export async function getGuidanceCommand() { return loadCommand('guidance'); }
|
|
|
188
192
|
export async function getApplianceCommand() { return loadCommand('appliance'); }
|
|
189
193
|
export async function getCleanupCommand() { return loadCommand('cleanup'); }
|
|
190
194
|
export async function getAutopilotCommand() { return loadCommand('autopilot'); }
|
|
195
|
+
export async function getTransportCommand() { return loadCommand('transport'); }
|
|
191
196
|
/**
|
|
192
197
|
* Core commands loaded synchronously (available immediately)
|
|
193
198
|
* Advanced commands loaded on-demand for faster startup
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { output } from '../output.js';
|
|
6
6
|
import { select, confirm } from '../prompt.js';
|
|
7
7
|
import { callMCPTool, MCPClientError } from '../mcp-client.js';
|
|
8
|
+
import { swarmJoinCommand } from './agntcy/swarm-join.js';
|
|
8
9
|
import * as fs from 'fs';
|
|
9
10
|
import * as path from 'path';
|
|
10
11
|
// Get dynamic swarm status from memory/session files
|
|
@@ -1009,7 +1010,7 @@ const pheromoneCommand = {
|
|
|
1009
1010
|
export const swarmCommand = {
|
|
1010
1011
|
name: 'swarm',
|
|
1011
1012
|
description: 'Swarm coordination commands',
|
|
1012
|
-
subcommands: [initCommand, startCommand, statusCommand, stopCommand, scaleCommand, coordinateCommand, compressMessageCommand, pheromoneCommand],
|
|
1013
|
+
subcommands: [initCommand, startCommand, statusCommand, stopCommand, scaleCommand, coordinateCommand, compressMessageCommand, pheromoneCommand, swarmJoinCommand],
|
|
1013
1014
|
options: [],
|
|
1014
1015
|
examples: [
|
|
1015
1016
|
{ command: 'claude-flow swarm init --v3-mode', description: 'Initialize V3 swarm' },
|
|
@@ -21,6 +21,7 @@ export { InputValidator, sanitizeString, sanitizeHtml, sanitizePath, SafeStringS
|
|
|
21
21
|
export { TokenGenerator, TokenGeneratorError, createTokenGenerator, getDefaultGenerator, quickGenerate, type TokenConfig, type Token, type SignedToken, type VerificationCode, } from './token-generator.js';
|
|
22
22
|
export { ToolOutputGuardrail, createToolOutputGuardrail, isToolOutputSafe, type GuardrailConfig, type GuardrailResult, type GuardrailAction, type InjectionFinding, type InjectionSeverity, type InjectionCategory, } from './tool-output-guardrail.js';
|
|
23
23
|
export { AgentAuthorizationPropagator, AuthorizationPropagationError, makeLegacyPermissiveScope, type AuthScope, type SendMessageEnvelope, type ToolCallDecision, } from './authorization/propagator.js';
|
|
24
|
+
export { generateCallerIdentityKey, loadCallerIdentityKey, issueInvocationToken, verifyInvocationToken, isMcpCallerAuthEnabled, type CallerIdentityKey, type InvocationToken, type TokenVerificationResult, } from './mcp-caller-identity.js';
|
|
24
25
|
export * from './policy/index.js';
|
|
25
26
|
export { CLIENT_ID as OAUTH_CLIENT_ID, SCOPE as OAUTH_SCOPE, OOB_REDIRECT_URI, OAuthError, authorizeUrl, exchangeCode, refreshToken, exchangeManualCode, type TokenResponse as OAuthTokenResponse, } from './oauth/client.js';
|
|
26
27
|
export { generate as generatePkce, challengeFromVerifier, type PkceRequest } from './oauth/pkce.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,GAC9B,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,EACnB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,GACtB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,yBAAyB,EACzB,sBAAsB,EACtB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,0BAA0B,EAC1B,8BAA8B,EAC9B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,GAC1B,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,cAAc,EACd,cAAc,EACd,YAAY,EACZ,YAAY,EAEZ,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,cAAc,EACd,UAAU,EACV,cAAc,EACd,SAAS,EACT,YAAY,EACZ,UAAU,EACV,UAAU,EACV,QAAQ,EAER,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAElB,eAAe,EACf,gBAAgB,EAChB,eAAe,EAEf,qBAAqB,EACrB,UAAU,EAEV,oBAAoB,EACpB,oBAAoB,EAEpB,QAAQ,EACR,MAAM,EACN,CAAC,G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cAAc,EAAE,cAAc,CAAC;IAC/B,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,YAAY,EAAE,YAAY,CAAC;IAC3B,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,cAAc,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG,cAAc,CAiBjF;AAMD;;GAEG;AACH,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC;;GAEG;AACH,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,0BAA0B,QAAQ,CAAC;AAMhD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,MAAM,EAAE,CAoBnF;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,kBAAkB,CAAC"}
|
|
@@ -43,6 +43,11 @@ export { ToolOutputGuardrail, createToolOutputGuardrail, isToolOutputSafe, } fro
|
|
|
43
43
|
// Action-layer: SendMessage envelope + per-action scope check + MCP server
|
|
44
44
|
// identity probe. Wraps the comms layer in P2; wraps the dispatcher in P3.
|
|
45
45
|
export { AgentAuthorizationPropagator, AuthorizationPropagationError, makeLegacyPermissiveScope, } from './authorization/propagator.js';
|
|
46
|
+
// MCP Caller-Identity Binding (ADR-377 Phase 3 — ruvnet/ruflo#2516, #2873)
|
|
47
|
+
// Per-invocation Ed25519-signed capability tokens. Off by default
|
|
48
|
+
// (CLAUDE_FLOW_MCP_CALLER_AUTH) pending a follow-on ADR for key
|
|
49
|
+
// distribution; see mcp-caller-identity.ts's file header for scope notes.
|
|
50
|
+
export { generateCallerIdentityKey, loadCallerIdentityKey, issueInvocationToken, verifyInvocationToken, isMcpCallerAuthEnabled, } from './mcp-caller-identity.js';
|
|
46
51
|
// Agentic Policy Engine (ADR-324)
|
|
47
52
|
// Deterministic policy evaluation, monotonic capability envelopes, approvals,
|
|
48
53
|
// budgets, and tamper-evident decision receipts. Legacy mode preserves the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,+BAA+B;AAC/B,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,oBAAoB,GAGrB,MAAM,sBAAsB,CAAC;AAE9B,oCAAoC;AACpC,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,GAIpB,MAAM,2BAA2B,CAAC;AAEnC,sCAAsC;AACtC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,yBAAyB,EACzB,sBAAsB,GAIvB,MAAM,oBAAoB,CAAC;AAE5B,+BAA+B;AAC/B,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,0BAA0B,EAC1B,8BAA8B,GAG/B,MAAM,qBAAqB,CAAC;AAE7B,mBAAmB;AACnB,OAAO,EACL,cAAc,EACd,cAAc,EACd,YAAY,EACZ,YAAY;AACZ,eAAe;AACf,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,cAAc,EACd,UAAU,EACV,cAAc,EACd,SAAS,EACT,YAAY,EACZ,UAAU,EACV,UAAU,EACV,QAAQ;AACR,eAAe;AACf,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB;AAClB,uBAAuB;AACvB,eAAe,EACf,gBAAgB,EAChB,eAAe;AACf,yBAAyB;AACzB,qBAAqB,EACrB,UAAU;AACV,iBAAiB;AACjB,oBAAoB,EACpB,oBAAoB;AACpB,YAAY;AACZ,QAAQ,EACR,MAAM,EACN,CA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AAE,CAAC;IAE9B,IAAI,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,YAAY,GAAG,iBAAiB,EAAE,CAAC;QACnE,QAAQ,CAAC,IAAI,CAAC,iBAAiB,MAAM,CAAC,YAAY,gCAAgC,iBAAiB,GAAG,CAAC,CAAC;IAC1G,CAAC;IAED,IAAI,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;QACvD,QAAQ,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;IAC/D,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QACxB,QAAQ,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;IAChF,CAAC;IAED,IAAI,MAAM,CAAC,eAAe,IAAI,MAAM,CAAC,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClE,QAAQ,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* McpCallerIdentity — ADR-377 Phase 3 (ruvnet/ruflo#2516, #2873).
|
|
3
|
+
*
|
|
4
|
+
* Per-invocation, Ed25519-signed capability tokens binding an MCP tool call
|
|
5
|
+
* to a specific caller. Closes the gap identified in arXiv:2603.07473
|
|
6
|
+
* (Caller Identity Confusion in MCP): authorization state today persists
|
|
7
|
+
* across callers with no re-verification, and `AgentAuthorizationPropagator`
|
|
8
|
+
* (ADR-144)'s `checkToolCall` validates a *scope* but not that the caller
|
|
9
|
+
* presenting it is who they claim to be for *this* call.
|
|
10
|
+
*
|
|
11
|
+
* Signing implementation follows the same pattern already used in this repo
|
|
12
|
+
* for Ed25519 signing (`@claude-flow/browser`'s `witness-signer.ts`): native
|
|
13
|
+
* `node:crypto`, zero new dependencies, sign+verify both supported (unlike
|
|
14
|
+
* `@claude-flow/security`'s own `plugins/integrity-verifier.ts`, which uses
|
|
15
|
+
* `@noble/ed25519` for verify-only). Reimplemented here rather than imported
|
|
16
|
+
* from `@claude-flow/browser` because a security-primitives module
|
|
17
|
+
* depending on the browser package would be a backwards layering
|
|
18
|
+
* dependency; the pattern is ~15 lines and not worth a cross-package import
|
|
19
|
+
* for that.
|
|
20
|
+
*
|
|
21
|
+
* Scope and honest limitations (per the ADR's own text)
|
|
22
|
+
* --------------------------------------------------------
|
|
23
|
+
* This module implements token issuance/verification only. It does NOT
|
|
24
|
+
* wire itself into any MCP tool dispatcher — this repo currently has at
|
|
25
|
+
* least two distinct `ToolRegistry` implementations
|
|
26
|
+
* (`v3/mcp/tool-registry.ts`, `v3/@claude-flow/mcp/src/tool-registry.ts`)
|
|
27
|
+
* plus a third under `@claude-flow/shared`, and it was not safe to guess
|
|
28
|
+
* which one is authoritative without risking silently wiring the wrong
|
|
29
|
+
* dispatch path. `AgentAuthorizationPropagator.checkToolCall` (ADR-144) is
|
|
30
|
+
* the natural composition point — call `verifyInvocationToken` first and
|
|
31
|
+
* only proceed to `checkToolCall` if it passes — but that composition is
|
|
32
|
+
* left to the caller rather than baked into `checkToolCall` itself, to
|
|
33
|
+
* avoid changing ADR-144's already-shipped, already-tested behavior.
|
|
34
|
+
*
|
|
35
|
+
* Key distribution (how callers obtain a private key to sign with in the
|
|
36
|
+
* first place) is explicitly out of scope — the ADR calls for "a follow-on
|
|
37
|
+
* ADR for key distribution" before this ships enabled by default, which is
|
|
38
|
+
* why `CLAUDE_FLOW_MCP_CALLER_AUTH` defaults to disabled.
|
|
39
|
+
*/
|
|
40
|
+
import type { KeyObject } from 'node:crypto';
|
|
41
|
+
export interface CallerIdentityKey {
|
|
42
|
+
privateKey: KeyObject;
|
|
43
|
+
publicKey: KeyObject;
|
|
44
|
+
publicKeyHex: string;
|
|
45
|
+
}
|
|
46
|
+
export interface InvocationToken {
|
|
47
|
+
/** Agent/principal id of the caller this token was issued to. */
|
|
48
|
+
callerId: string;
|
|
49
|
+
/** Tool this token authorizes — a token issued for one tool cannot be
|
|
50
|
+
* replayed against another. */
|
|
51
|
+
toolName: string;
|
|
52
|
+
/** Unix ms the token was issued. */
|
|
53
|
+
issuedAt: number;
|
|
54
|
+
/** Unix ms after which the token is no longer valid. */
|
|
55
|
+
expiresAt: number;
|
|
56
|
+
/** Random per-token value; prevents replay of an otherwise-identical
|
|
57
|
+
* token issued in the same millisecond. */
|
|
58
|
+
nonce: string;
|
|
59
|
+
/** Hex-encoded Ed25519 signature over the canonicalized fields above. */
|
|
60
|
+
signature: string;
|
|
61
|
+
}
|
|
62
|
+
export interface TokenVerificationResult {
|
|
63
|
+
valid: boolean;
|
|
64
|
+
reason?: 'expired' | 'bad-signature' | 'tool-mismatch';
|
|
65
|
+
}
|
|
66
|
+
/** Generate a fresh Ed25519 keypair. */
|
|
67
|
+
export declare function generateCallerIdentityKey(): CallerIdentityKey;
|
|
68
|
+
/** Load a caller-identity key from a PEM-encoded private key string. */
|
|
69
|
+
export declare function loadCallerIdentityKey(privateKeyPem: string): CallerIdentityKey;
|
|
70
|
+
/**
|
|
71
|
+
* Issue a fresh, signed `InvocationToken` for `callerId` to call `toolName`.
|
|
72
|
+
* Callers must present a *new* token per invocation — tokens are
|
|
73
|
+
* single-tool-bound and short-lived (`ttlMs`, default 30s) by design; there
|
|
74
|
+
* is no renewal API on purpose.
|
|
75
|
+
*/
|
|
76
|
+
export declare function issueInvocationToken(callerId: string, toolName: string, key: CallerIdentityKey, opts?: {
|
|
77
|
+
ttlMs?: number;
|
|
78
|
+
now?: number;
|
|
79
|
+
}): InvocationToken;
|
|
80
|
+
/**
|
|
81
|
+
* Verify an `InvocationToken` against the issuing caller's public key and
|
|
82
|
+
* (if provided) the tool the caller is about to invoke. Never throws.
|
|
83
|
+
*/
|
|
84
|
+
export declare function verifyInvocationToken(token: InvocationToken, publicKey: KeyObject, opts?: {
|
|
85
|
+
toolName?: string;
|
|
86
|
+
now?: number;
|
|
87
|
+
}): TokenVerificationResult;
|
|
88
|
+
/** Off by default — see the file header re: key distribution being out of scope pending a follow-on ADR. Only the literal `'true'` enables enforcement. */
|
|
89
|
+
export declare function isMcpCallerAuthEnabled(): boolean;
|
|
90
|
+
//# sourceMappingURL=mcp-caller-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-caller-identity.d.ts","sourceRoot":"","sources":["../src/mcp-caller-identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,SAAS,CAAC;IACtB,SAAS,EAAE,SAAS,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB;mCAC+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB;+CAC2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,SAAS,GAAG,eAAe,GAAG,eAAe,CAAC;CACxD;AAeD,wCAAwC;AACxC,wBAAgB,yBAAyB,IAAI,iBAAiB,CAG7D;AAED,wEAAwE;AACxE,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,iBAAiB,CAI9E;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,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1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claude-flow/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.34.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Ruflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -120,6 +120,7 @@
|
|
|
120
120
|
"zod": "^3.22.0"
|
|
121
121
|
},
|
|
122
122
|
"optionalDependencies": {
|
|
123
|
+
"@agntcy/slim-bindings": "2.0.0-alpha.5",
|
|
123
124
|
"@napi-rs/keyring": "1.3.0",
|
|
124
125
|
"@claude-flow/memory": "^3.0.0-alpha.21",
|
|
125
126
|
"agentdb": "^3.0.0-alpha.17",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
sha256:6141a8ea990c5063b77e090ae8f37f9c539d8aa8f58dcceb30f3a82f97e57319
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"adoptedAt": 1785428938153,
|
|
3
|
-
"championId": "sha256:6141a8ea990c5063b77e090ae8f37f9c539d8aa8f58dcceb30f3a82f97e57319",
|
|
4
|
-
"manifest": {
|
|
5
|
-
"schema": "ruflo.proven-config/v1",
|
|
6
|
-
"policy": {
|
|
7
|
-
"ref": "sha256:6141a8ea990c5063b77e090ae8f37f9c539d8aa8f58dcceb30f3a82f97e57319",
|
|
8
|
-
"value": {
|
|
9
|
-
"alpha": 0.3,
|
|
10
|
-
"subjectWeight": 1,
|
|
11
|
-
"mmrLambda": 0.5,
|
|
12
|
-
"bodyWeight": 1.5,
|
|
13
|
-
"typePenaltyFactor": 0.5
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
"layer": "framework/node-cli",
|
|
17
|
-
"compatibility": {
|
|
18
|
-
"ruflo": ">=3.24.0"
|
|
19
|
-
},
|
|
20
|
-
"benchmark": {
|
|
21
|
-
"corpus": "ADR-081-labelled-v1",
|
|
22
|
-
"corpusHash": "sha256:2f700b5c363e20a3bd88ce2bc9b87bbbbaa61732c6177894c6ec37890f888982"
|
|
23
|
-
},
|
|
24
|
-
"receipt": {
|
|
25
|
-
"heldOutDelta": 0.07381404928570845,
|
|
26
|
-
"redblue": "PASS",
|
|
27
|
-
"drift": 0,
|
|
28
|
-
"canary": {
|
|
29
|
-
"rollbackRate": 0,
|
|
30
|
-
"latencyP95": 244.612458000076,
|
|
31
|
-
"costPerTask": 0
|
|
32
|
-
},
|
|
33
|
-
"receiptCoverage": 1
|
|
34
|
-
},
|
|
35
|
-
"platform": [
|
|
36
|
-
"linux",
|
|
37
|
-
"macOS",
|
|
38
|
-
"windows"
|
|
39
|
-
]
|
|
40
|
-
},
|
|
41
|
-
"previous": ""
|
|
42
|
-
}
|