agentic-workflow-manager 9.6.1 → 9.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/src/commands/doctor.js +4 -2
- package/dist/src/commands/export.js +3 -0
- package/dist/src/commands/init.js +10 -2
- package/dist/src/commands/registry/add.js +2 -2
- package/dist/src/commands/registry/index.js +7 -5
- package/dist/src/commands/registry/install-bundles.js +4 -4
- package/dist/src/commands/registry/status.js +4 -4
- package/dist/src/commands/sync.js +2 -1
- package/dist/src/commands/track/index.js +3 -7
- package/dist/src/commands/update.js +3 -1
- package/dist/src/commands/watch/apply.js +15 -0
- package/dist/src/commands/watch/tracks.js +56 -7
- package/dist/src/core/bundle-install.js +2 -2
- package/dist/src/core/bundles.js +92 -19
- package/dist/src/core/diagnostics/context.js +1 -1
- package/dist/src/core/export/index.js +1 -1
- package/dist/src/core/export/resolve.js +2 -2
- package/dist/src/core/journal/types.js +1 -0
- package/dist/src/core/reconciliation.js +1 -1
- package/dist/src/core/tracks/git.js +15 -3
- package/dist/src/core/tracks/protocol.js +26 -6
- package/dist/src/index.js +46 -39
- package/dist/src/utils/grouping.js +1 -1
- package/dist/src/utils/registry-view.js +1 -1
- package/dist/tests/commands/bundle-diagnostics.test.js +145 -0
- package/dist/tests/commands/export.test.js +28 -2
- package/dist/tests/commands/multi-agent-targeting.test.js +1 -1
- package/dist/tests/commands/track/verbs.test.js +6 -0
- package/dist/tests/commands/watch/apply.test.js +46 -9
- package/dist/tests/commands/watch/track-remove-request.test.js +165 -0
- package/dist/tests/commands/watch/track-teardown-crash.test.js +27 -0
- package/dist/tests/core/bundle-install.test.js +36 -0
- package/dist/tests/core/bundles-multiroot.test.js +24 -2
- package/dist/tests/core/bundles-overrides.test.js +10 -7
- package/dist/tests/core/bundles.test.js +75 -6
- package/dist/tests/core/diagnostics/context.test.js +2 -2
- package/dist/tests/core/export/engine.test.js +1 -1
- package/dist/tests/core/export/resolve.test.js +1 -1
- package/dist/tests/core/init/mutation-targets.test.js +1 -1
- package/dist/tests/core/init/orchestrator.test.js +1 -1
- package/dist/tests/core/init/steps.test.js +1 -1
- package/dist/tests/core/journal/types.test.js +11 -0
- package/dist/tests/core/reconciliation.test.js +1 -1
- package/dist/tests/core/sync-profile-atomicity.test.js +1 -1
- package/dist/tests/core/tracks/git.test.js +7 -0
- package/dist/tests/core/tracks/protocol.test.js +103 -0
- package/dist/tests/structural/bundle-skill-reference-contract.test.js +56 -0
- package/dist/tests/utils/grouping.test.js +2 -2
- package/dist/tests/utils/registry-view.test.js +7 -7
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/secure_fs.node +0 -0
- package/prebuilds/darwin-x64/secure_fs.node +0 -0
- package/prebuilds/win32-arm64/secure_fs.node +0 -0
- package/prebuilds/win32-x64/secure_fs.node +0 -0
|
@@ -34,6 +34,109 @@ describe('parallel-track protocol model', () => {
|
|
|
34
34
|
expect(() => (0, protocol_1.observeProtocolEffect)(s, { kind: 'enter-serial', reason: 'x' }, { kind: 'effect-applied', effect: { kind: 'enter-serial', reason: 'x' } }))
|
|
35
35
|
.toThrow(/SERIAL prohíbe recursos paralelos activos/);
|
|
36
36
|
});
|
|
37
|
+
test.each([
|
|
38
|
+
{
|
|
39
|
+
name: 'observación de ownership ajeno',
|
|
40
|
+
observation: { kind: 'teardown-observation', trackId: 'cli', foreignWorktree: true },
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'fallo de begin-teardown',
|
|
44
|
+
observation: {
|
|
45
|
+
kind: 'effect-failed', trackId: 'cli', effect: 'begin-teardown', detail: 'ownership indemostrable',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
])('teardown indemostrable bloquea track y cohorte: $name (TR-REQ-05)', ({ observation }) => {
|
|
49
|
+
const s = (0, protocol_1.initialCohort)('journal-1', ids);
|
|
50
|
+
s.cohortPhase = 'FALLBACK_PENDING';
|
|
51
|
+
s.fallbackReason = 'controller-requested:cli';
|
|
52
|
+
s.tracks.cli.phase = 'TEARDOWN_REQUESTED';
|
|
53
|
+
s.tracks.docs.phase = 'REMOVED';
|
|
54
|
+
const out = (0, protocol_1.reconcileProtocol)(s, observation);
|
|
55
|
+
expect(out.tracks.cli.phase).toBe('BLOCKED');
|
|
56
|
+
expect(out.cohortPhase).toBe('BLOCKED');
|
|
57
|
+
expect((0, protocol_1.nextProtocolEffect)(out)).toBeNull();
|
|
58
|
+
});
|
|
59
|
+
test('fallo de begin-teardown para track inexistente falla cerrado (TR-REQ-05)', () => {
|
|
60
|
+
const s = (0, protocol_1.initialCohort)('journal-1', ids);
|
|
61
|
+
s.cohortPhase = 'FALLBACK_PENDING';
|
|
62
|
+
expect(() => (0, protocol_1.reconcileProtocol)(s, {
|
|
63
|
+
kind: 'effect-failed', trackId: 'missing', effect: 'begin-teardown', detail: 'ownership indemostrable',
|
|
64
|
+
})).toThrow('track desconocido: missing');
|
|
65
|
+
});
|
|
66
|
+
test('remove cancela toda la cohorte activa y conserva DECLARED/BLOCKED (TR-REQ-03, TR-REQ-05)', () => {
|
|
67
|
+
const s = (0, protocol_1.initialCohort)('journal-1', ['active', 'declared', 'blocked']);
|
|
68
|
+
s.cohortPhase = 'ACTIVE';
|
|
69
|
+
s.tracks.active.phase = 'ACTIVE';
|
|
70
|
+
s.tracks.declared.phase = 'DECLARED';
|
|
71
|
+
s.tracks.blocked.phase = 'BLOCKED';
|
|
72
|
+
const out = (0, protocol_1.reconcileProtocol)(s, { kind: 'teardown-requested', trackId: 'active' });
|
|
73
|
+
expect(out.cohortPhase).toBe('FALLBACK_PENDING');
|
|
74
|
+
expect(out.fallbackReason).toBe('controller-requested:active');
|
|
75
|
+
expect(out.tracks.active.phase).toBe('TEARDOWN_REQUESTED');
|
|
76
|
+
expect(out.tracks.declared.phase).toBe('DECLARED');
|
|
77
|
+
expect(out.tracks.blocked.phase).toBe('BLOCKED');
|
|
78
|
+
expect((0, protocol_1.nextProtocolEffect)(out)).toBeNull();
|
|
79
|
+
});
|
|
80
|
+
test('remove durante FINAL_INTERLOCK invalida evidencia final antes de pedir teardown (issue #93)', () => {
|
|
81
|
+
const s = (0, protocol_1.initialCohort)('journal-1', ids);
|
|
82
|
+
s.cohortPhase = 'FINAL_INTERLOCK';
|
|
83
|
+
s.globalQaHeadSha = 'qa-head';
|
|
84
|
+
s.finalIntegrationJobId = 'integration-job';
|
|
85
|
+
for (const track of Object.values(s.tracks)) {
|
|
86
|
+
track.phase = 'MERGED_UNVERIFIED';
|
|
87
|
+
track.frozenHeadSha = `${track.trackId}-head`;
|
|
88
|
+
}
|
|
89
|
+
const out = (0, protocol_1.reconcileProtocol)(s, { kind: 'teardown-requested', trackId: 'cli' });
|
|
90
|
+
expect(out.cohortPhase).toBe('FALLBACK_PENDING');
|
|
91
|
+
expect(out.globalQaHeadSha).toBeUndefined();
|
|
92
|
+
expect(out.finalIntegrationJobId).toBeUndefined();
|
|
93
|
+
expect(Object.values(out.tracks).every((track) => track.phase === 'TEARDOWN_REQUESTED')).toBe(true);
|
|
94
|
+
});
|
|
95
|
+
test('remove repetido no rebobina teardown ni reemplaza la causa (TR-REQ-08)', () => {
|
|
96
|
+
const s = (0, protocol_1.initialCohort)('journal-1', ids);
|
|
97
|
+
s.cohortPhase = 'FALLBACK_PENDING';
|
|
98
|
+
s.fallbackReason = 'controller-requested:cli';
|
|
99
|
+
s.tracks.cli.phase = 'SUPERVISOR_STOPPED';
|
|
100
|
+
s.tracks.docs.phase = 'TEARDOWN_REQUESTED';
|
|
101
|
+
const out = (0, protocol_1.reconcileProtocol)(s, { kind: 'teardown-requested', trackId: 'docs' });
|
|
102
|
+
expect(out.fallbackReason).toBe('controller-requested:cli');
|
|
103
|
+
expect(out.tracks.cli.phase).toBe('SUPERVISOR_STOPPED');
|
|
104
|
+
expect(out.tracks.docs.phase).toBe('TEARDOWN_REQUESTED');
|
|
105
|
+
});
|
|
106
|
+
test.each(['SERIAL', 'COMPLETE'])('remove es no-op protocolar en cohorte terminal %s (TR-REQ-09)', (cohortPhase) => {
|
|
107
|
+
const s = (0, protocol_1.initialCohort)('journal-1', ids);
|
|
108
|
+
s.cohortPhase = cohortPhase;
|
|
109
|
+
for (const track of Object.values(s.tracks)) {
|
|
110
|
+
track.phase = cohortPhase === 'SERIAL' ? 'REMOVED' : 'JOINED';
|
|
111
|
+
if (cohortPhase === 'COMPLETE')
|
|
112
|
+
track.frozenHeadSha = `${track.trackId}-head`;
|
|
113
|
+
}
|
|
114
|
+
expect((0, protocol_1.reconcileProtocol)(s, { kind: 'teardown-requested', trackId: 'cli' })).toEqual(s);
|
|
115
|
+
});
|
|
116
|
+
test('remove es no-op protocolar en cohorte BLOCKED y no reanuda teardown (TR-REQ-10)', () => {
|
|
117
|
+
const s = (0, protocol_1.initialCohort)('journal-1', ids);
|
|
118
|
+
s.cohortPhase = 'BLOCKED';
|
|
119
|
+
s.tracks.cli.phase = 'BLOCKED';
|
|
120
|
+
s.tracks.cli.blockedReason = 'ownership indemostrable';
|
|
121
|
+
s.tracks.docs.phase = 'REMOVED';
|
|
122
|
+
const out = (0, protocol_1.reconcileProtocol)(s, { kind: 'teardown-requested', trackId: 'docs' });
|
|
123
|
+
expect(out).toEqual(s);
|
|
124
|
+
expect(out.cohortPhase).toBe('BLOCKED');
|
|
125
|
+
expect((0, protocol_1.nextProtocolEffect)(out)).toBeNull();
|
|
126
|
+
});
|
|
127
|
+
test('remove converge a serial solo después de desmontar la cohorte (TR-REQ-06)', () => {
|
|
128
|
+
let s = (0, protocol_1.initialCohort)('journal-1', ids);
|
|
129
|
+
for (const track of Object.values(s.tracks))
|
|
130
|
+
track.phase = 'ACTIVE';
|
|
131
|
+
s.cohortPhase = 'ACTIVE';
|
|
132
|
+
s = (0, protocol_1.reconcileProtocol)(s, { kind: 'teardown-requested', trackId: 'cli' });
|
|
133
|
+
expect((0, protocol_1.nextProtocolEffect)(s)).toEqual({ kind: 'begin-teardown', trackId: 'cli' });
|
|
134
|
+
s.tracks.cli.phase = 'REMOVED';
|
|
135
|
+
s.tracks.docs.phase = 'REMOVED';
|
|
136
|
+
expect((0, protocol_1.nextProtocolEffect)(s)).toEqual({
|
|
137
|
+
kind: 'enter-serial', reason: 'controller-requested:cli',
|
|
138
|
+
});
|
|
139
|
+
});
|
|
37
140
|
test('ningún merge empieza antes de que todos los tracks estén FROZEN (C3)', () => {
|
|
38
141
|
const s = (0, protocol_1.initialCohort)('journal-1', ids);
|
|
39
142
|
s.cohortPhase = 'JOINING';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const ROOT = path_1.default.resolve(__dirname, '../../..');
|
|
9
|
+
const BUNDLES_SOURCE = path_1.default.join(ROOT, 'cli/src/core/bundles.ts');
|
|
10
|
+
const GUIDE = path_1.default.join(ROOT, 'docs/guides/authoring-a-registry-with-an-orchestrator.md');
|
|
11
|
+
const read = (file) => fs_1.default.readFileSync(file, 'utf8');
|
|
12
|
+
function sourceFiles(dir) {
|
|
13
|
+
return fs_1.default.readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
|
|
14
|
+
const file = path_1.default.join(dir, entry.name);
|
|
15
|
+
if (entry.isDirectory())
|
|
16
|
+
return sourceFiles(file);
|
|
17
|
+
return entry.isFile() && file.endsWith('.ts') ? [file] : [];
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function jsonFences(markdown) {
|
|
21
|
+
return Array.from(markdown.matchAll(/```json\n([\s\S]*?)\n```/g), ([, json]) => json);
|
|
22
|
+
}
|
|
23
|
+
describe('bundle skill-reference contract', () => {
|
|
24
|
+
it('keeps active bundle consumers string-only, without BundleSkillRef', () => {
|
|
25
|
+
const source = read(BUNDLES_SOURCE);
|
|
26
|
+
const bundleSkillRefs = sourceFiles(path_1.default.join(ROOT, 'cli/src'))
|
|
27
|
+
.filter((file) => /\bBundleSkillRef\b/.test(read(file)));
|
|
28
|
+
expect(bundleSkillRefs).toEqual([]);
|
|
29
|
+
expect(source).toMatch(/interface BundleDefinition\s*\{[\s\S]*?\bskills:\s*string\[\];/);
|
|
30
|
+
});
|
|
31
|
+
it('uses canonical string skill references in the active authoring guide', () => {
|
|
32
|
+
const guide = read(GUIDE);
|
|
33
|
+
const bundleExample = jsonFences(guide).find((json) => JSON.parse(json).name === 'mi-proceso');
|
|
34
|
+
expect(bundleExample).toBeDefined();
|
|
35
|
+
const skills = JSON.parse(bundleExample).skills;
|
|
36
|
+
expect(skills).toEqual(['mi-proceso']);
|
|
37
|
+
expect(skills.every((skill) => typeof skill === 'string')).toBe(true);
|
|
38
|
+
});
|
|
39
|
+
it('places the CLI 9 migration boundary immediately after the bundle example', () => {
|
|
40
|
+
const guide = read(GUIDE);
|
|
41
|
+
const bundleFence = '```json\n{\n "name": "mi-proceso"';
|
|
42
|
+
const start = guide.indexOf(bundleFence);
|
|
43
|
+
const end = guide.indexOf('```', start) + 3;
|
|
44
|
+
const following = guide.slice(end, guide.indexOf('## 5.', end));
|
|
45
|
+
expect(start).toBeGreaterThanOrEqual(0);
|
|
46
|
+
expect(following).toMatch(/CLI 9[\s\S]*(?:legacy object|objeto legacy)[\s\S]*\{\s*name\s*,\s*onSignal:\s*true\s*\}/i);
|
|
47
|
+
expect(following).toMatch(/ignor(?:e|a)[\s\S]*boolean[\s\S]*onSignal/i);
|
|
48
|
+
expect(following).toMatch(/warning/i);
|
|
49
|
+
expect(following).toMatch(/CLI 10[\s\S]*(?:rejects?|rechaza)[\s\S]*(?:objects?|objetos?)/i);
|
|
50
|
+
});
|
|
51
|
+
it('keeps every JSON fence in the touched guide parseable', () => {
|
|
52
|
+
for (const json of jsonFences(read(GUIDE))) {
|
|
53
|
+
expect(() => JSON.parse(json)).not.toThrow();
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -7,10 +7,10 @@ const bundle = (over) => ({
|
|
|
7
7
|
});
|
|
8
8
|
const processes = [
|
|
9
9
|
bundle({ name: 'core-dev', description: 'Core development skills',
|
|
10
|
-
skills: [
|
|
10
|
+
skills: ['brainstorming', 'shared-skill'],
|
|
11
11
|
workflows: [], agents: [] }),
|
|
12
12
|
bundle({ name: 'docs', description: 'Documentation skills',
|
|
13
|
-
skills: [
|
|
13
|
+
skills: ['docs-assistant', 'shared-skill'],
|
|
14
14
|
workflows: [], agents: [] }),
|
|
15
15
|
];
|
|
16
16
|
const formatLabel = (c) => c.baseName;
|
|
@@ -10,10 +10,10 @@ const bundle = (over) => ({
|
|
|
10
10
|
});
|
|
11
11
|
const processes = [
|
|
12
12
|
bundle({ name: 'core-dev', description: 'Dev lifecycle', scope: 'baseline',
|
|
13
|
-
skills: [
|
|
13
|
+
skills: ['brainstorming', 'shared'],
|
|
14
14
|
workflows: ['exec'], agents: ['plan'] }),
|
|
15
15
|
bundle({ name: 'docs', description: 'Docs as code',
|
|
16
|
-
skills: [
|
|
16
|
+
skills: ['shared'] }),
|
|
17
17
|
];
|
|
18
18
|
describe('buildPackageView', () => {
|
|
19
19
|
it('groups artifacts under their package with correct counts and install names', () => {
|
|
@@ -108,7 +108,7 @@ describe('visibility', () => {
|
|
|
108
108
|
it('marks a private bundle on its PackageView', () => {
|
|
109
109
|
const priv = [
|
|
110
110
|
bundle({ name: 'secret', description: 'private', visibility: 'private',
|
|
111
|
-
skills: [
|
|
111
|
+
skills: ['a'] }),
|
|
112
112
|
];
|
|
113
113
|
const view = (0, registry_view_1.buildPackageView)([skill('a')], [], [], priv);
|
|
114
114
|
expect(view.find((p) => p.name === 'secret').visibility).toBe('private');
|
|
@@ -121,7 +121,7 @@ describe('visibility', () => {
|
|
|
121
121
|
describe('packageSummaryLines width-awareness', () => {
|
|
122
122
|
it('truncates the description column when a width is given', () => {
|
|
123
123
|
const view = (0, registry_view_1.buildPackageView)([skill('brainstorming', 'x'.repeat(200))], [], [], [
|
|
124
|
-
bundle({ name: 'core-dev', description: 'x'.repeat(200), skills: [
|
|
124
|
+
bundle({ name: 'core-dev', description: 'x'.repeat(200), skills: ['brainstorming'] }),
|
|
125
125
|
]);
|
|
126
126
|
const lines = (0, registry_view_1.packageSummaryLines)(view, 60);
|
|
127
127
|
for (const l of lines)
|
|
@@ -130,7 +130,7 @@ describe('packageSummaryLines width-awareness', () => {
|
|
|
130
130
|
});
|
|
131
131
|
it('does not truncate when no width is given (piped output)', () => {
|
|
132
132
|
const view = (0, registry_view_1.buildPackageView)([skill('brainstorming', 'y'.repeat(200))], [], [], [
|
|
133
|
-
bundle({ name: 'core-dev', description: 'z'.repeat(200), skills: [
|
|
133
|
+
bundle({ name: 'core-dev', description: 'z'.repeat(200), skills: ['brainstorming'] }),
|
|
134
134
|
]);
|
|
135
135
|
const lines = (0, registry_view_1.packageSummaryLines)(view); // no width
|
|
136
136
|
expect(lines.some((l) => l.includes('z'.repeat(200)))).toBe(true);
|
|
@@ -139,7 +139,7 @@ describe('packageSummaryLines width-awareness', () => {
|
|
|
139
139
|
describe('artifactPickerItems', () => {
|
|
140
140
|
it('prepends an "install entire package" sentinel item, then one per artifact', () => {
|
|
141
141
|
const view = (0, registry_view_1.buildPackageView)([skill('a', 'desc a'), skill('b', 'desc b')], [], [], [
|
|
142
|
-
bundle({ name: 'p', description: 'pkg', skills: [
|
|
142
|
+
bundle({ name: 'p', description: 'pkg', skills: ['a', 'b'] }),
|
|
143
143
|
]);
|
|
144
144
|
const items = (0, registry_view_1.artifactPickerItems)(view.find((p) => p.name === 'p'));
|
|
145
145
|
expect(items[0].value).toBe(registry_view_1.ALL_SENTINEL);
|
|
@@ -150,7 +150,7 @@ describe('artifactPickerItems', () => {
|
|
|
150
150
|
describe('packagePickerItems', () => {
|
|
151
151
|
it('builds one item per package with a count+description summary', () => {
|
|
152
152
|
const view = (0, registry_view_1.buildPackageView)([skill('a')], [], [], [
|
|
153
|
-
bundle({ name: 'p', description: 'pkg desc', skills: [
|
|
153
|
+
bundle({ name: 'p', description: 'pkg desc', skills: ['a'] }),
|
|
154
154
|
]);
|
|
155
155
|
const items = (0, registry_view_1.packagePickerItems)(view);
|
|
156
156
|
expect(items[0].value).toBe('p');
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|