@claude-flow/cli 3.33.0 → 3.35.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.
Files changed (49) hide show
  1. package/.claude/.proven-config-version +1 -0
  2. package/.claude/helpers/.helpers-version +1 -1
  3. package/.claude/helpers/helpers.manifest.json +2 -2
  4. package/.claude/helpers/statusline.cjs +0 -0
  5. package/.claude/proven-config.json +42 -0
  6. package/catalog-manifest.json +2 -2
  7. package/dist/src/commands/agent.js +2 -1
  8. package/dist/src/commands/agntcy/index.d.ts +64 -0
  9. package/dist/src/commands/agntcy/index.js +64 -0
  10. package/dist/src/commands/agntcy/publish.d.ts +43 -0
  11. package/dist/src/commands/agntcy/publish.js +121 -0
  12. package/dist/src/commands/agntcy/runtime.d.ts +90 -0
  13. package/dist/src/commands/agntcy/runtime.js +115 -0
  14. package/dist/src/commands/agntcy/swarm-join.d.ts +28 -0
  15. package/dist/src/commands/agntcy/swarm-join.js +85 -0
  16. package/dist/src/commands/agntcy/transport.d.ts +24 -0
  17. package/dist/src/commands/agntcy/transport.js +95 -0
  18. package/dist/src/commands/daemon.js +12 -7
  19. package/dist/src/commands/doctor.js +72 -1
  20. package/dist/src/commands/index.d.ts +1 -0
  21. package/dist/src/commands/index.js +5 -0
  22. package/dist/src/commands/metaharness.js +37 -2
  23. package/dist/src/commands/swarm.js +2 -1
  24. package/dist/src/log-filters.d.ts +3 -3
  25. package/dist/src/mcp-tools/metaharness-tools.js +35 -2
  26. package/dist/src/memory/memory-bridge.d.ts +25 -0
  27. package/dist/src/memory/memory-bridge.js +61 -8
  28. package/dist/src/memory/memory-initializer.d.ts +9 -3
  29. package/dist/src/memory/memory-initializer.js +344 -277
  30. package/dist/src/services/daemon-autostart.d.ts +31 -3
  31. package/dist/src/services/daemon-autostart.js +45 -3
  32. package/dist/src/services/distill-oracle.d.ts +1 -1
  33. package/dist/src/services/distill-oracle.js +2 -2
  34. package/dist/src/services/evolve-proof.d.ts +40 -1
  35. package/dist/src/services/evolve-proof.js +76 -14
  36. package/dist/src/services/flywheel-receipt.d.ts +15 -0
  37. package/dist/src/services/flywheel-receipt.js +22 -0
  38. package/dist/src/services/flywheel-sequential-evidence.d.ts +102 -0
  39. package/dist/src/services/flywheel-sequential-evidence.js +148 -0
  40. package/dist/src/services/flywheel-transaction.d.ts +71 -0
  41. package/dist/src/services/flywheel-transaction.js +121 -0
  42. package/dist/src/services/harness-flywheel-generations.d.ts +14 -0
  43. package/dist/src/services/harness-flywheel-generations.js +76 -4
  44. package/dist/src/services/harness-flywheel.d.ts +13 -0
  45. package/dist/src/services/harness-flywheel.js +31 -1
  46. package/node_modules/@claude-flow/codex/dist/cli.js +0 -0
  47. package/node_modules/@claude-flow/plugin-agent-federation/dist/bin.js +0 -0
  48. package/package.json +5 -9
  49. package/plugins/ruflo-metaharness/scripts/smoke.sh +4 -2
@@ -0,0 +1 @@
1
+ sha256:6141a8ea990c5063b77e090ae8f37f9c539d8aa8f58dcceb30f3a82f97e57319
@@ -1 +1 @@
1
- 3.32.29
1
+ 3.35.0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": {
3
- "version": "3.33.0",
3
+ "version": "3.35.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": "J0E/yeJoSS9oIfHsfle9CjlnSLNeSO6dcXPkuhzDx/2lddDeddDXMDXF3XO0GnQbpZWTduBKx5+cN0ip89fJDw==",
11
+ "signature": "tnK2I0enYGI5ql364QJqnAUHMo+pIh0AZK4y/Rad9H+WuPo/KzzG4jqL8/083EbEKWLPEneN6n9s0pEQcGzVCw==",
12
12
  "algorithm": "ed25519"
13
13
  }
File without changes
@@ -0,0 +1,42 @@
1
+ {
2
+ "adoptedAt": 1785208363552,
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
+ }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "generation": 4,
4
- "generatedAt": "2026-07-30T19:39:04.992Z",
5
- "gitSha": "6e6c7347",
4
+ "generatedAt": "2026-08-10T14:19:13.896Z",
5
+ "gitSha": "4af1cfdd",
6
6
  "catalog": {
7
7
  "agents": 164,
8
8
  "tools": 397,
@@ -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