claude-flow 3.49.0 → 3.51.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/hook-handler.cjs +14 -1
- package/.claude/proven-config.json +1 -1
- package/.claude/settings.json +11 -2
- package/.claude-plugin/marketplace.json +15 -0
- package/package.json +1 -1
- package/v3/@claude-flow/cli/README.md +0 -2
- package/v3/@claude-flow/cli/catalog-manifest.json +4 -4
- package/v3/@claude-flow/cli/dist/src/commands/catalog.d.ts +18 -0
- package/v3/@claude-flow/cli/dist/src/commands/catalog.js +89 -0
- package/v3/@claude-flow/cli/dist/src/commands/doctor.js +24 -1
- package/v3/@claude-flow/cli/dist/src/commands/index.js +5 -0
- package/v3/@claude-flow/cli/dist/src/commands/init.js +60 -1
- package/v3/@claude-flow/cli/dist/src/commands/mission.d.ts +24 -0
- package/v3/@claude-flow/cli/dist/src/commands/mission.js +116 -0
- package/v3/@claude-flow/cli/dist/src/commands/mods.d.ts +13 -0
- package/v3/@claude-flow/cli/dist/src/commands/mods.js +170 -0
- package/v3/@claude-flow/cli/dist/src/init/helpers-generator.js +12 -0
- package/v3/@claude-flow/cli/dist/src/mcp-client.js +3 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/capability-brain.js +1 -1
- package/v3/@claude-flow/cli/dist/src/mcp-tools/index.d.ts +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/index.js +2 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/mission-tools.d.ts +22 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/mission-tools.js +75 -0
- package/v3/@claude-flow/cli/dist/src/missions/fold.d.ts +19 -0
- package/v3/@claude-flow/cli/dist/src/missions/fold.js +238 -0
- package/v3/@claude-flow/cli/dist/src/missions/index.d.ts +10 -0
- package/v3/@claude-flow/cli/dist/src/missions/index.js +10 -0
- package/v3/@claude-flow/cli/dist/src/missions/observation.d.ts +70 -0
- package/v3/@claude-flow/cli/dist/src/missions/observation.js +77 -0
- package/v3/@claude-flow/cli/dist/src/missions/schemas.d.ts +735 -0
- package/v3/@claude-flow/cli/dist/src/missions/schemas.js +150 -0
- package/v3/@claude-flow/cli/dist/src/missions/service.d.ts +88 -0
- package/v3/@claude-flow/cli/dist/src/missions/service.js +278 -0
- package/v3/@claude-flow/cli/dist/src/missions/store.d.ts +68 -0
- package/v3/@claude-flow/cli/dist/src/missions/store.js +209 -0
- package/v3/@claude-flow/cli/dist/src/missions/transitions.d.ts +81 -0
- package/v3/@claude-flow/cli/dist/src/missions/transitions.js +178 -0
- package/v3/@claude-flow/cli/dist/src/mods/apply.d.ts +50 -0
- package/v3/@claude-flow/cli/dist/src/mods/apply.js +186 -0
- package/v3/@claude-flow/cli/dist/src/mods/claude-installs.d.ts +29 -0
- package/v3/@claude-flow/cli/dist/src/mods/claude-installs.js +83 -0
- package/v3/@claude-flow/cli/dist/src/mods/command-registry/catalog.d.ts +45 -0
- package/v3/@claude-flow/cli/dist/src/mods/command-registry/catalog.js +234 -0
- package/v3/@claude-flow/cli/dist/src/mods/command-registry/engine-report.d.ts +66 -0
- package/v3/@claude-flow/cli/dist/src/mods/command-registry/engine-report.js +119 -0
- package/v3/@claude-flow/cli/dist/src/mods/command-registry/generate.d.ts +51 -0
- package/v3/@claude-flow/cli/dist/src/mods/command-registry/generate.js +166 -0
- package/v3/@claude-flow/cli/dist/src/mods/command-registry/index.d.ts +9 -0
- package/v3/@claude-flow/cli/dist/src/mods/command-registry/index.js +9 -0
- package/v3/@claude-flow/cli/dist/src/mods/command-registry/inventory.d.ts +63 -0
- package/v3/@claude-flow/cli/dist/src/mods/command-registry/inventory.js +230 -0
- package/v3/@claude-flow/cli/dist/src/mods/command-registry/schema.d.ts +836 -0
- package/v3/@claude-flow/cli/dist/src/mods/command-registry/schema.js +137 -0
- package/v3/@claude-flow/cli/dist/src/mods/install.d.ts +102 -0
- package/v3/@claude-flow/cli/dist/src/mods/install.js +185 -0
- package/v3/@claude-flow/cli/dist/src/mods/plugin-repair.d.ts +81 -0
- package/v3/@claude-flow/cli/dist/src/mods/plugin-repair.js +120 -0
- package/v3/@claude-flow/cli/dist/src/mods/plugin-resolve.d.ts +63 -0
- package/v3/@claude-flow/cli/dist/src/mods/plugin-resolve.js +182 -0
- package/v3/@claude-flow/cli/dist/src/mods/policy-projection.d.ts +39 -0
- package/v3/@claude-flow/cli/dist/src/mods/policy-projection.js +65 -0
- package/v3/@claude-flow/cli/dist/src/mods/probe.d.ts +33 -0
- package/v3/@claude-flow/cli/dist/src/mods/probe.js +143 -0
- package/v3/@claude-flow/cli/dist/src/services/policy-runtime.d.ts +5 -0
- package/v3/@claude-flow/cli/dist/src/services/policy-runtime.js +20 -1
- package/v3/@claude-flow/cli/package.json +1 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADR-406 M1 / §11 — the bounded mission observation file a workbench reads.
|
|
3
|
+
*
|
|
4
|
+
* `.claude-flow/missions/observation.json` is rewritten atomically after each
|
|
5
|
+
* committed mission event. It carries the source time (`observedAt`, the time
|
|
6
|
+
* of the newest committed event); readers stamp their own fetch time and derive
|
|
7
|
+
* freshness from `observedAt`, never from a redraw. Strings are stripped of
|
|
8
|
+
* control and bidi characters and truncated here, at write time, so a reader
|
|
9
|
+
* never sees unbounded or instruction-shaped text from a mission.
|
|
10
|
+
*
|
|
11
|
+
* It is observation only. Task status is recorded state; only
|
|
12
|
+
* `evidence.verified` counts as verified, and an executor marked disconnected
|
|
13
|
+
* is not a failed mission.
|
|
14
|
+
*/
|
|
15
|
+
import type { MissionView } from './transitions.js';
|
|
16
|
+
export declare const OBSERVATION_CONTRACT: "ruflo.mission-observation/1";
|
|
17
|
+
export declare const OBSERVATION_FILE = "observation.json";
|
|
18
|
+
export declare const OBSERVATION_LIMITS: Readonly<{
|
|
19
|
+
missions: 50;
|
|
20
|
+
tasks: 50;
|
|
21
|
+
string: 200;
|
|
22
|
+
objective: 400;
|
|
23
|
+
}>;
|
|
24
|
+
export interface MissionObservation {
|
|
25
|
+
readonly schemaVersion: 1;
|
|
26
|
+
readonly contract: typeof OBSERVATION_CONTRACT;
|
|
27
|
+
readonly source: 'ruflo-cli/missions';
|
|
28
|
+
readonly workspaceId: string;
|
|
29
|
+
readonly observedAt: string | null;
|
|
30
|
+
readonly truncated: boolean;
|
|
31
|
+
readonly missions: readonly ObservedMission[];
|
|
32
|
+
}
|
|
33
|
+
export interface ObservedMission {
|
|
34
|
+
readonly missionId: string;
|
|
35
|
+
readonly objective: string;
|
|
36
|
+
readonly state: string;
|
|
37
|
+
readonly revision: number;
|
|
38
|
+
readonly executionMode: string;
|
|
39
|
+
readonly plan: {
|
|
40
|
+
readonly revision: number;
|
|
41
|
+
readonly digest: string;
|
|
42
|
+
readonly taskCount: number;
|
|
43
|
+
readonly tasks: readonly {
|
|
44
|
+
readonly id: string;
|
|
45
|
+
readonly title: string;
|
|
46
|
+
readonly dependsOn: readonly string[];
|
|
47
|
+
readonly status: string;
|
|
48
|
+
}[];
|
|
49
|
+
};
|
|
50
|
+
readonly budget: MissionView['budget'];
|
|
51
|
+
readonly evidence: {
|
|
52
|
+
readonly count: number;
|
|
53
|
+
readonly verified: number;
|
|
54
|
+
};
|
|
55
|
+
readonly executor: {
|
|
56
|
+
readonly connection: string;
|
|
57
|
+
readonly observedAt: string;
|
|
58
|
+
readonly lastAckExecutionId: string | null;
|
|
59
|
+
} | null;
|
|
60
|
+
readonly unresolvedOperations: number;
|
|
61
|
+
readonly blockedReason: string | null;
|
|
62
|
+
readonly lastEventSequence: number;
|
|
63
|
+
readonly updatedAt: string;
|
|
64
|
+
}
|
|
65
|
+
/** Strip C0/C1 controls and bidi overrides, then bound the length. */
|
|
66
|
+
export declare function sanitize(value: string, max?: number): string;
|
|
67
|
+
export declare function observeMission(view: MissionView): ObservedMission;
|
|
68
|
+
/** Newest-updated first, capped; `observedAt` is the newest committed event time. */
|
|
69
|
+
export declare function buildObservation(workspaceId: string, views: readonly MissionView[]): MissionObservation;
|
|
70
|
+
//# sourceMappingURL=observation.d.ts.map
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADR-406 M1 / §11 — the bounded mission observation file a workbench reads.
|
|
3
|
+
*
|
|
4
|
+
* `.claude-flow/missions/observation.json` is rewritten atomically after each
|
|
5
|
+
* committed mission event. It carries the source time (`observedAt`, the time
|
|
6
|
+
* of the newest committed event); readers stamp their own fetch time and derive
|
|
7
|
+
* freshness from `observedAt`, never from a redraw. Strings are stripped of
|
|
8
|
+
* control and bidi characters and truncated here, at write time, so a reader
|
|
9
|
+
* never sees unbounded or instruction-shaped text from a mission.
|
|
10
|
+
*
|
|
11
|
+
* It is observation only. Task status is recorded state; only
|
|
12
|
+
* `evidence.verified` counts as verified, and an executor marked disconnected
|
|
13
|
+
* is not a failed mission.
|
|
14
|
+
*/
|
|
15
|
+
export const OBSERVATION_CONTRACT = 'ruflo.mission-observation/1';
|
|
16
|
+
export const OBSERVATION_FILE = 'observation.json';
|
|
17
|
+
export const OBSERVATION_LIMITS = Object.freeze({ missions: 50, tasks: 50, string: 200, objective: 400 });
|
|
18
|
+
/** Strip C0/C1 controls and bidi overrides, then bound the length. */
|
|
19
|
+
export function sanitize(value, max = OBSERVATION_LIMITS.string) {
|
|
20
|
+
let out = '';
|
|
21
|
+
for (const ch of value) {
|
|
22
|
+
const cp = ch.codePointAt(0);
|
|
23
|
+
if (cp < 0x20 || cp === 0x7f || (cp >= 0x80 && cp <= 0x9f)) {
|
|
24
|
+
out += ' ';
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
if ((cp >= 0x202a && cp <= 0x202e) || (cp >= 0x2066 && cp <= 0x2069) || cp === 0x200e || cp === 0x200f)
|
|
28
|
+
continue;
|
|
29
|
+
out += ch;
|
|
30
|
+
}
|
|
31
|
+
out = out.replace(/\s+/g, ' ').trim();
|
|
32
|
+
return out.length > max ? `${out.slice(0, max - 1)}…` : out;
|
|
33
|
+
}
|
|
34
|
+
export function observeMission(view) {
|
|
35
|
+
const plan = view.planBody;
|
|
36
|
+
return {
|
|
37
|
+
missionId: view.record.missionId,
|
|
38
|
+
objective: sanitize(view.record.objective, OBSERVATION_LIMITS.objective),
|
|
39
|
+
state: view.record.state,
|
|
40
|
+
revision: view.record.revision,
|
|
41
|
+
executionMode: view.record.executionMode,
|
|
42
|
+
plan: {
|
|
43
|
+
revision: view.record.plan.revision,
|
|
44
|
+
digest: view.record.plan.digest,
|
|
45
|
+
taskCount: plan?.tasks.length ?? 0,
|
|
46
|
+
tasks: (plan?.tasks ?? []).slice(0, OBSERVATION_LIMITS.tasks).map((t) => ({
|
|
47
|
+
id: sanitize(t.id, 64),
|
|
48
|
+
title: sanitize(t.title),
|
|
49
|
+
dependsOn: t.dependsOn.slice(0, 16).map((d) => sanitize(d, 64)),
|
|
50
|
+
status: view.tasks[t.id]?.status ?? 'pending',
|
|
51
|
+
})),
|
|
52
|
+
},
|
|
53
|
+
budget: view.budget,
|
|
54
|
+
evidence: { count: view.evidence.length, verified: view.evidence.filter((e) => e.verified).length },
|
|
55
|
+
executor: view.executor
|
|
56
|
+
? { connection: view.executor.connection, observedAt: view.executor.observedAt, lastAckExecutionId: view.executor.lastAckExecutionId }
|
|
57
|
+
: null,
|
|
58
|
+
unresolvedOperations: view.unresolvedOperations.length,
|
|
59
|
+
blockedReason: view.blockedReason ? sanitize(view.blockedReason) : null,
|
|
60
|
+
lastEventSequence: view.record.lastEventSequence,
|
|
61
|
+
updatedAt: view.record.updatedAt,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/** Newest-updated first, capped; `observedAt` is the newest committed event time. */
|
|
65
|
+
export function buildObservation(workspaceId, views) {
|
|
66
|
+
const sorted = [...views].sort((a, b) => (a.record.updatedAt < b.record.updatedAt ? 1 : a.record.updatedAt > b.record.updatedAt ? -1 : 0));
|
|
67
|
+
return {
|
|
68
|
+
schemaVersion: 1,
|
|
69
|
+
contract: OBSERVATION_CONTRACT,
|
|
70
|
+
source: 'ruflo-cli/missions',
|
|
71
|
+
workspaceId,
|
|
72
|
+
observedAt: sorted[0]?.record.updatedAt ?? null,
|
|
73
|
+
truncated: sorted.length > OBSERVATION_LIMITS.missions,
|
|
74
|
+
missions: sorted.slice(0, OBSERVATION_LIMITS.missions).map(observeMission),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=observation.js.map
|