@zaip-ai/cli 4.4.0 → 4.5.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/dist/services/adapters.d.ts +1 -1
- package/dist/services/adapters.js +1 -1
- package/dist/services/codex-conversation-lifecycle-hook.d.ts.map +1 -1
- package/dist/services/codex-conversation-lifecycle-hook.js +24 -5
- package/dist/services/codex-conversation-lifecycle-hook.js.map +1 -1
- package/package.json +1 -1
- package/templates/.agents/config/agents/discovery.json +1 -1
- package/templates/.agents/dashboard/.zaip-managed.json +11 -11
- package/templates/.agents/dashboard/apps/frontend/package.json +1 -1
- package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
- package/templates/.agents/dashboard/modules/operations/package.json +1 -1
- package/templates/.agents/dashboard/modules/traceability/package.json +1 -1
- package/templates/.agents/dashboard/packages/branding/package.json +1 -1
- package/templates/.agents/dashboard/packages/contracts/package.json +1 -1
- package/templates/.agents/dashboard/packages/data-export/package.json +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/package.json +1 -1
- package/templates/.agents/dashboard/packages/ui/package.json +1 -1
- package/templates/.agents/dashboard/tests/e2e/package.json +1 -1
- package/templates/.agents/design/.zaip-managed.json +3 -3
- package/templates/.agents/design/apps/catalog/package.json +1 -1
- package/templates/.agents/design/packages/local-runtime/package.json +1 -1
- package/templates/.agents/requirements/autonomous-assurance.md +1 -1
- package/templates/.agents/requirements/cloud-hostinger-autonomy.md +1 -1
- package/templates/.agents/requirements/comparative-audit.md +1 -1
- package/templates/.agents/requirements/context-engine.md +1 -1
- package/templates/.agents/requirements/cost-observability.md +1 -1
- package/templates/.agents/requirements/dashboard-launch.md +1 -1
- package/templates/.agents/requirements/data-export.md +1 -1
- package/templates/.agents/requirements/design-system.md +1 -1
- package/templates/.agents/requirements/execution-engine.md +1 -1
- package/templates/.agents/requirements/kanban-dashboard.md +1 -1
- package/templates/.agents/requirements/model-orchestration.md +1 -1
- package/templates/.agents/requirements/public-distribution.md +1 -1
- package/templates/.agents/requirements/software-architecture.md +1 -1
- package/templates/.agents/requirements/strategic-improvements.md +1 -1
- package/templates/.agents/requirements/work-lifecycle.md +1 -1
- package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
- package/templates/.agents/runtime/VERSION +1 -1
- package/templates/.agents/runtime/bin/zaip.mjs +384 -365
- package/templates/.agents/runtime/checksums.sha256 +5 -5
- package/templates/.agents/runtime/manifest.json +1 -1
- package/templates/.agents/runtime/provenance.json +4 -4
- package/templates/.agents/runtime/sbom.cdx.json +1 -1
- package/templates/.agents/zaip-aios/VERSION +1 -1
- package/templates/template-manifest.json +42 -42
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type PublicAgentCatalog } from "./agent-adapters.js";
|
|
2
2
|
export { isManagedAdapter } from "./managed-adapter.js";
|
|
3
|
-
export declare const ADAPTERS_VERSION = "4.
|
|
3
|
+
export declare const ADAPTERS_VERSION = "4.5.0";
|
|
4
4
|
export interface AdapterFile {
|
|
5
5
|
path: string;
|
|
6
6
|
content: string;
|
|
@@ -11,7 +11,7 @@ export { isManagedAdapter } from "./managed-adapter.js";
|
|
|
11
11
|
import { CODEX_GITHUB_DEPLOY_RULES, CODEX_SECURITY_RULES } from "./codex-rules.js";
|
|
12
12
|
import { codexWindowsHookCommand } from "./codex-windows-hook-command.js";
|
|
13
13
|
import { applyTransactionalChanges, assertSafeDestination } from "./transactional-files.js";
|
|
14
|
-
export const ADAPTERS_VERSION = "4.
|
|
14
|
+
export const ADAPTERS_VERSION = "4.5.0";
|
|
15
15
|
const ROOT_GUIDANCE = `# ZAIP-AIOS
|
|
16
16
|
|
|
17
17
|
Read \`.agents/config/project.yaml\` first. Apply ZAIP only for literal boolean \`zaip.enabled: true\`, except framework maintenance or \`zaip enable\`. \`AGENTS.md\` is a bootstrap; canonical guidance lives in \`.agents/\`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-conversation-lifecycle-hook.d.ts","sourceRoot":"","sources":["../../src/services/codex-conversation-lifecycle-hook.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iCAAiC,
|
|
1
|
+
{"version":3,"file":"codex-conversation-lifecycle-hook.d.ts","sourceRoot":"","sources":["../../src/services/codex-conversation-lifecycle-hook.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iCAAiC,QAyP7C,CAAC"}
|
|
@@ -9,8 +9,9 @@ const activation = await import("./zaip-hook-activation.mjs").catch(() => null);
|
|
|
9
9
|
let root = hookRoot, local;
|
|
10
10
|
// The host hook stays below 10s. Explicit CLI recovery runs in the active Codex
|
|
11
11
|
// tool session and may finish expensive canonical closure within its own bound.
|
|
12
|
-
const
|
|
13
|
-
const
|
|
12
|
+
const automatic = process.argv.length === 3 && process.argv[2] === "--recover-previous-turn";
|
|
13
|
+
const replay = automatic || (process.argv.length === 3 && process.argv[2] === "--replay-receipt");
|
|
14
|
+
const deadline = Date.now() + (automatic ? 7000 : replay ? 45000 : 8000);
|
|
14
15
|
const readChunkBytes = 1024 * 1024, maxLineBytes = 8 * 1024 * 1024, maxReadBytes = 16 * 1024 * 1024;
|
|
15
16
|
const hash = value => createHash("sha256").update(value).digest("hex");
|
|
16
17
|
const parse = value => { try { return JSON.parse(value); } catch { return null; } };
|
|
@@ -163,10 +164,13 @@ async function selectWorkspace(correlationKey, worktrees) {
|
|
|
163
164
|
}
|
|
164
165
|
try {
|
|
165
166
|
if (event?.hook_event_name !== "Stop" || !session || !turn || !text(event.cwd)) { reply(); process.exit(0); }
|
|
166
|
-
|
|
167
|
+
// Automatic recovery is already bound to one canonical workspace by intake.
|
|
168
|
+
// Never discover another worktree or manufacture a historical Conversation.
|
|
169
|
+
const worktrees = automatic ? [hookRoot] : await gitWorktrees();
|
|
170
|
+
if (automatic && resolve(event.cwd) !== hookRoot) throw new Error("recovery_workspace_mismatch");
|
|
167
171
|
if (!worktrees.some(candidate => inside(event.cwd, candidate))) { reply(); process.exit(0); }
|
|
168
172
|
const correlationKey = hash(JSON.stringify(["codex", session, turn, null, null]));
|
|
169
|
-
root = await selectWorkspace(correlationKey, worktrees);
|
|
173
|
+
root = automatic ? hookRoot : await selectWorkspace(correlationKey, worktrees);
|
|
170
174
|
local = resolve(root, ".local/hooks");
|
|
171
175
|
const config = await readFile(resolve(root, ".agents/config/project.yaml"), "utf8");
|
|
172
176
|
if (!/zaip:\s*\r?\n\s*enabled:\s*true\s*(?:\r?\n|$)/.test(config)) { reply(); process.exit(0); }
|
|
@@ -175,13 +179,23 @@ try {
|
|
|
175
179
|
lease = await acquire(receiptPath + ".lock");
|
|
176
180
|
if (!lease) { await note("stop_worker_busy"); reply(true); process.exit(0); }
|
|
177
181
|
const old = parse(await readFile(receiptPath, "utf8").catch(() => ""));
|
|
182
|
+
if (automatic) {
|
|
183
|
+
const info = await lstat(receiptPath);
|
|
184
|
+
const identity = value => process.platform === "win32" ? toNamespacedPath(resolve(value)).toLowerCase() : resolve(value);
|
|
185
|
+
if (!info.isFile() || info.isSymbolicLink() || identity(await realpath(receiptPath)) !== identity(receiptPath) ||
|
|
186
|
+
old?.schema_version !== 1 || old.session_id !== session || old.turn_id !== turn ||
|
|
187
|
+
old.event?.hook_event_name !== "Stop" || old.event.session_id !== session || old.event.turn_id !== turn ||
|
|
188
|
+
typeof old.event.cwd !== "string" || identity(old.event.cwd) !== identity(root) ||
|
|
189
|
+
typeof old.event.transcript_path !== "string" || identity(old.event.transcript_path) !== identity(event.transcript_path) ||
|
|
190
|
+
!["pending", "persisted"].includes(old.state)) throw new Error("recovery_receipt_invalid");
|
|
191
|
+
}
|
|
178
192
|
receipt = old?.schema_version === 1 && old.session_id === session && old.turn_id === turn ? old : { schema_version: 1, session_id: session, turn_id: turn, state: "pending", attempts: 0 };
|
|
179
193
|
const transcriptPath = text(event.transcript_path) ?? text(receipt.event?.transcript_path);
|
|
180
194
|
receipt.event = { hook_event_name: "Stop", cwd: root, session_id: session, turn_id: turn, transcript_path: transcriptPath, stop_hook_active: true };
|
|
181
195
|
if (receipt.state === "persisted") { reply(); } else {
|
|
182
196
|
receipt.attempts += 1; receipt.state = "pending"; await save(receiptPath, receipt);
|
|
183
197
|
let status = null;
|
|
184
|
-
for (const delay of [0, 250, 750]) { if (delay) await new Promise(r => setTimeout(r, delay)); status = await terminal(transcriptPath); if (status) break; }
|
|
198
|
+
for (const delay of automatic ? [0] : [0, 250, 750]) { if (delay) await new Promise(r => setTimeout(r, delay)); status = await terminal(transcriptPath); if (status) break; }
|
|
185
199
|
if (!status) throw new Error("transcript_pending");
|
|
186
200
|
const cli = resolve(root, ".agents/runtime/bin/zaip.mjs");
|
|
187
201
|
const correlation = parse(await readFile(resolve(root, ".local/codex-telemetry-spool/v1/correlations", correlationKey + ".json"), "utf8").catch(() => ""));
|
|
@@ -189,11 +203,13 @@ try {
|
|
|
189
203
|
if (correlation?.schema_version === 1 && correlation.thread_id === session && correlation.turn_id === turn && correlation.agent_path === null && typeof correlation.run_id === "string") {
|
|
190
204
|
intake = { run: { run_id: correlation.run_id }, task: correlation.task_id === null ? null : { id: correlation.task_id } };
|
|
191
205
|
} else {
|
|
206
|
+
if (automatic) throw new Error("recovery_correlation_missing");
|
|
192
207
|
const started = await call(cli, ["conversation", "start", "--intent", "conversation"], transcriptPath);
|
|
193
208
|
if (started.code !== 0) throw new Error("start_pending");
|
|
194
209
|
intake = parse(started.out);
|
|
195
210
|
}
|
|
196
211
|
const run = intake?.run?.run_id;
|
|
212
|
+
if (automatic && receipt.run_id !== undefined && receipt.run_id !== run) throw new Error("recovery_run_mismatch");
|
|
197
213
|
if (typeof run !== "string" || (intake.task !== null && typeof intake.task?.id !== "string")) throw new Error("start_pending");
|
|
198
214
|
receipt.run_id = run; await save(receiptPath, receipt);
|
|
199
215
|
const result = await call(cli, ["subagent", "reconcile-stop", "--session", session, "--turn", turn], transcriptPath);
|
|
@@ -203,6 +219,9 @@ try {
|
|
|
203
219
|
? outcome?.run?.id === run && terminalStates.includes(outcome.run.status) && typeof outcome.run.finished_at === "string"
|
|
204
220
|
: outcome?.status === "closed" && outcome.parent_run_id === run && outcome.reconciliation?.tasks?.some(task => task.id === intake.task.id && terminalStates.includes(task.status));
|
|
205
221
|
if (result.code !== 0 || !closed) throw new Error("closure_pending");
|
|
222
|
+
if (automatic && intake.task !== null &&
|
|
223
|
+
(!outcome.finalization_decision || (outcome.finalization_decision.outcome === "completed" && outcome.finalization_barrier?.satisfied !== true)))
|
|
224
|
+
throw new Error("closure_gates_pending");
|
|
206
225
|
if (intake.task !== null && status === "completed") {
|
|
207
226
|
const shown = await call(cli, ["task", "recovery-status", intake.task.id], transcriptPath);
|
|
208
227
|
const recovery = parse(shown.out);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-conversation-lifecycle-hook.js","sourceRoot":"","sources":["../../src/services/codex-conversation-lifecycle-hook.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iCAAiC,GAAG,MAAM,CAAC,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"codex-conversation-lifecycle-hook.js","sourceRoot":"","sources":["../../src/services/codex-conversation-lifecycle-hook.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iCAAiC,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyP1D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_zaip_managed": "zaip-managed generated-do-not-edit source=agent-discovery version=4.
|
|
2
|
+
"_zaip_managed": "zaip-managed generated-do-not-edit source=agent-discovery version=4.5.0 sha256=3def7a2b43c1a751f8e68754ef94cb107a80b5d26e11f065af2b4cc145fc8897",
|
|
3
3
|
"schema_version": 1,
|
|
4
4
|
"source": {
|
|
5
5
|
"path": ".agents/config/agents/catalog.yaml",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"files": [
|
|
5
5
|
{
|
|
6
6
|
"path": "DATA-DICTIONARY.md",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
106
|
"path": "apps/frontend/package.json",
|
|
107
|
-
"sha256": "
|
|
107
|
+
"sha256": "7a401ef1af8352bf66ef2f1e4a01ecbcd86a31b00474ebf73ca9cc5fb032d8d4"
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
110
|
"path": "apps/frontend/playwright.dom.config.ts",
|
|
@@ -564,7 +564,7 @@
|
|
|
564
564
|
},
|
|
565
565
|
{
|
|
566
566
|
"path": "modules/cost-monitor/package.json",
|
|
567
|
-
"sha256": "
|
|
567
|
+
"sha256": "9c49b6bcded8f74ad1811298e9a7e4132cdb073f05e96bc0ca2447e566a61080"
|
|
568
568
|
},
|
|
569
569
|
{
|
|
570
570
|
"path": "modules/cost-monitor/src/agent-groups.test.ts",
|
|
@@ -972,7 +972,7 @@
|
|
|
972
972
|
},
|
|
973
973
|
{
|
|
974
974
|
"path": "modules/operations/package.json",
|
|
975
|
-
"sha256": "
|
|
975
|
+
"sha256": "5ecd5825a7fe9cb98ee530289038075d7ddfd86fe8eda3e3bc90e52288ef4514"
|
|
976
976
|
},
|
|
977
977
|
{
|
|
978
978
|
"path": "modules/operations/src/contracts.ts",
|
|
@@ -1680,7 +1680,7 @@
|
|
|
1680
1680
|
},
|
|
1681
1681
|
{
|
|
1682
1682
|
"path": "modules/traceability/package.json",
|
|
1683
|
-
"sha256": "
|
|
1683
|
+
"sha256": "5181e53d15a912237275db543d7fd7559c6587f705b48dd55e7de619d51b739b"
|
|
1684
1684
|
},
|
|
1685
1685
|
{
|
|
1686
1686
|
"path": "modules/traceability/src/contracts.ts",
|
|
@@ -1752,7 +1752,7 @@
|
|
|
1752
1752
|
},
|
|
1753
1753
|
{
|
|
1754
1754
|
"path": "packages/branding/package.json",
|
|
1755
|
-
"sha256": "
|
|
1755
|
+
"sha256": "1ff99f7ce7c56a71349115a87ce118a751e0a5ac6ff61e585e7e7f3406dc4259"
|
|
1756
1756
|
},
|
|
1757
1757
|
{
|
|
1758
1758
|
"path": "packages/branding/src/index.ts",
|
|
@@ -1764,7 +1764,7 @@
|
|
|
1764
1764
|
},
|
|
1765
1765
|
{
|
|
1766
1766
|
"path": "packages/contracts/package.json",
|
|
1767
|
-
"sha256": "
|
|
1767
|
+
"sha256": "eaf3d6c57ef669dad29a4cecd36491e0d94bf9426d72486eed1902c883ec270c"
|
|
1768
1768
|
},
|
|
1769
1769
|
{
|
|
1770
1770
|
"path": "packages/contracts/src/export.ts",
|
|
@@ -1784,7 +1784,7 @@
|
|
|
1784
1784
|
},
|
|
1785
1785
|
{
|
|
1786
1786
|
"path": "packages/data-export/package.json",
|
|
1787
|
-
"sha256": "
|
|
1787
|
+
"sha256": "72234d3b7f9c09bc9d8b995283cf6f9cbce14270fba3ffd0202b316f5268bc48"
|
|
1788
1788
|
},
|
|
1789
1789
|
{
|
|
1790
1790
|
"path": "packages/data-export/src/index.test.ts",
|
|
@@ -1816,7 +1816,7 @@
|
|
|
1816
1816
|
},
|
|
1817
1817
|
{
|
|
1818
1818
|
"path": "packages/local-runtime/package.json",
|
|
1819
|
-
"sha256": "
|
|
1819
|
+
"sha256": "3c67db0e3d164e2ce5a9802ba8953afbc23fa7088b5dfae2fb1ada93cd069cc1"
|
|
1820
1820
|
},
|
|
1821
1821
|
{
|
|
1822
1822
|
"path": "packages/local-runtime/scripts/build-sqlite-dashboard.mjs",
|
|
@@ -2620,7 +2620,7 @@
|
|
|
2620
2620
|
},
|
|
2621
2621
|
{
|
|
2622
2622
|
"path": "packages/ui/package.json",
|
|
2623
|
-
"sha256": "
|
|
2623
|
+
"sha256": "537a3995d09b35821f0f688d49793186e3a29c11d58f50e7cfceb4626685f719"
|
|
2624
2624
|
},
|
|
2625
2625
|
{
|
|
2626
2626
|
"path": "packages/ui/src/DashboardHeader.test.mjs",
|
|
@@ -2728,7 +2728,7 @@
|
|
|
2728
2728
|
},
|
|
2729
2729
|
{
|
|
2730
2730
|
"path": "tests/e2e/package.json",
|
|
2731
|
-
"sha256": "
|
|
2731
|
+
"sha256": "39fa971c32659c514f9163c5128fec7412d239dbe4665c6f233eaa47b384dc4e"
|
|
2732
2732
|
},
|
|
2733
2733
|
{
|
|
2734
2734
|
"path": "tests/e2e/playwright.config.ts",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"files": [
|
|
5
5
|
{
|
|
6
6
|
"path": "DESIGN.md",
|
|
@@ -272,7 +272,7 @@
|
|
|
272
272
|
},
|
|
273
273
|
{
|
|
274
274
|
"path": "apps/catalog/package.json",
|
|
275
|
-
"sha256": "
|
|
275
|
+
"sha256": "39479373c31a1bc348ce2d6b45060c927543f835e43f80ed329bb763ed1a8e40"
|
|
276
276
|
},
|
|
277
277
|
{
|
|
278
278
|
"path": "apps/catalog/public/logo_novo_azul.png",
|
|
@@ -396,7 +396,7 @@
|
|
|
396
396
|
},
|
|
397
397
|
{
|
|
398
398
|
"path": "packages/local-runtime/package.json",
|
|
399
|
-
"sha256": "
|
|
399
|
+
"sha256": "bc1c8fc538d8198a9a9fa8cb644ec4ecd2a8f3ac1b1529f00aa532f65c2226a7"
|
|
400
400
|
},
|
|
401
401
|
{
|
|
402
402
|
"path": "packages/local-runtime/runtime.mjs",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
4.
|
|
1
|
+
4.5.0
|