@zaip-ai/cli 5.5.0 → 5.7.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 (84) hide show
  1. package/dist/services/adapter-hook-sources.d.ts +1 -0
  2. package/dist/services/adapter-hook-sources.d.ts.map +1 -1
  3. package/dist/services/adapter-hook-sources.js +1 -0
  4. package/dist/services/adapter-hook-sources.js.map +1 -1
  5. package/dist/services/adapters.d.ts +1 -1
  6. package/dist/services/adapters.d.ts.map +1 -1
  7. package/dist/services/adapters.js +3 -2
  8. package/dist/services/adapters.js.map +1 -1
  9. package/dist/services/codex-hook-activation.d.ts +1 -1
  10. package/dist/services/codex-hook-activation.d.ts.map +1 -1
  11. package/dist/services/codex-hook-activation.js +1 -0
  12. package/dist/services/codex-hook-activation.js.map +1 -1
  13. package/dist/services/codex-pre-tool-dependencies.test-support.d.ts.map +1 -1
  14. package/dist/services/codex-pre-tool-dependencies.test-support.js +2 -0
  15. package/dist/services/codex-pre-tool-dependencies.test-support.js.map +1 -1
  16. package/dist/services/codex-pre-tool-hook-template.d.ts.map +1 -1
  17. package/dist/services/codex-pre-tool-hook-template.js +5 -198
  18. package/dist/services/codex-pre-tool-hook-template.js.map +1 -1
  19. package/dist/services/codex-pre-tool-policy-template.d.ts +2 -0
  20. package/dist/services/codex-pre-tool-policy-template.d.ts.map +1 -0
  21. package/dist/services/codex-pre-tool-policy-template.js +136 -0
  22. package/dist/services/codex-pre-tool-policy-template.js.map +1 -0
  23. package/dist/services/codex-pre-tool-release-review-template.d.ts +2 -0
  24. package/dist/services/codex-pre-tool-release-review-template.d.ts.map +1 -0
  25. package/dist/services/codex-pre-tool-release-review-template.js +98 -0
  26. package/dist/services/codex-pre-tool-release-review-template.js.map +1 -0
  27. package/dist/services/codex-pre-tool-support-template.d.ts.map +1 -1
  28. package/dist/services/codex-pre-tool-support-template.js +52 -8
  29. package/dist/services/codex-pre-tool-support-template.js.map +1 -1
  30. package/package.json +1 -1
  31. package/templates/.agents/README-ENG.md +6 -2
  32. package/templates/.agents/README.md +5 -1
  33. package/templates/.agents/config/agents/discovery.json +1 -1
  34. package/templates/.agents/dashboard/.zaip-managed.json +28 -28
  35. package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-Crv8oLKH.js → DashboardHelpDialog-B4XMYP00.js} +6 -2
  36. package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-De3_oOUB.js → PricingSettingsDialog-DvMV9yit.js} +1 -1
  37. package/templates/.agents/dashboard/apps/frontend/dist/assets/{ProjectSettingsPage-HNZfT9Xo.js → ProjectSettingsPage-CFhFcZjW.js} +1 -1
  38. package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-D4tioTQ5.js → TraceabilityWorkspace-DkaJNHuG.js} +1 -1
  39. package/templates/.agents/dashboard/apps/frontend/dist/assets/{dashboard-localization-BbNU69xZ.js → dashboard-localization-CwQfHYWq.js} +6 -2
  40. package/templates/.agents/dashboard/apps/frontend/dist/assets/{index-oqGtXP7j.js → index-DB2s40tU.js} +2 -2
  41. package/templates/.agents/dashboard/apps/frontend/dist/index.html +1 -1
  42. package/templates/.agents/dashboard/apps/frontend/package.json +1 -1
  43. package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
  44. package/templates/.agents/dashboard/modules/operations/package.json +1 -1
  45. package/templates/.agents/dashboard/modules/traceability/package.json +1 -1
  46. package/templates/.agents/dashboard/packages/branding/package.json +1 -1
  47. package/templates/.agents/dashboard/packages/contracts/package.json +1 -1
  48. package/templates/.agents/dashboard/packages/data-export/package.json +1 -1
  49. package/templates/.agents/dashboard/packages/local-runtime/package.json +1 -1
  50. package/templates/.agents/dashboard/packages/ui/package.json +1 -1
  51. package/templates/.agents/dashboard/tests/e2e/package.json +1 -1
  52. package/templates/.agents/design/.zaip-managed.json +3 -3
  53. package/templates/.agents/design/apps/catalog/package.json +1 -1
  54. package/templates/.agents/design/packages/local-runtime/package.json +1 -1
  55. package/templates/.agents/requirements/autonomous-assurance.md +1 -1
  56. package/templates/.agents/requirements/cloud-hostinger-autonomy.md +1 -1
  57. package/templates/.agents/requirements/comparative-audit.md +1 -1
  58. package/templates/.agents/requirements/context-engine.md +1 -1
  59. package/templates/.agents/requirements/cost-observability.md +1 -1
  60. package/templates/.agents/requirements/dashboard-launch.md +1 -1
  61. package/templates/.agents/requirements/data-export.md +1 -1
  62. package/templates/.agents/requirements/design-system.md +1 -1
  63. package/templates/.agents/requirements/execution-engine.md +1 -1
  64. package/templates/.agents/requirements/kanban-dashboard.md +1 -1
  65. package/templates/.agents/requirements/model-orchestration.md +1 -1
  66. package/templates/.agents/requirements/public-distribution.md +1 -1
  67. package/templates/.agents/requirements/software-architecture.md +1 -1
  68. package/templates/.agents/requirements/strategic-improvements.md +1 -1
  69. package/templates/.agents/requirements/work-lifecycle.md +1 -1
  70. package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
  71. package/templates/.agents/runtime/VERSION +1 -1
  72. package/templates/.agents/runtime/bin/zaip.mjs +225 -145
  73. package/templates/.agents/runtime/checksums.sha256 +5 -5
  74. package/templates/.agents/runtime/manifest.json +1 -1
  75. package/templates/.agents/runtime/provenance.json +4 -4
  76. package/templates/.agents/runtime/sbom.cdx.json +1 -1
  77. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.mjs +2 -2
  78. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-publication-intent.test.mjs +16 -0
  79. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/framework-identity.mjs +30 -0
  80. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/github-deploy-contract.test.mjs +1 -0
  81. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/preflight.mjs +5 -12
  82. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/preflight.test.mjs +12 -1
  83. package/templates/.agents/zaip-aios/VERSION +1 -1
  84. package/templates/template-manifest.json +70 -66
@@ -0,0 +1,98 @@
1
+ export const CODEX_PRE_TOOL_RELEASE_REVIEW = String.raw `import { lstat, readFile, realpath } from "node:fs/promises";
2
+ import { homedir } from "node:os";
3
+ import { isAbsolute, resolve, toNamespacedPath } from "node:path";
4
+
5
+ export const pathIdentity = value => process.platform === "win32" ? toNamespacedPath(resolve(value)).toLowerCase() : resolve(value);
6
+ export function hasTraversalSegment(path) {
7
+ return path.split(/[\\/]/).includes("..");
8
+ }
9
+
10
+ export async function reviewedReleaseNodeExecutable(value, repositoryRoot) {
11
+ if (typeof value !== "string") return false;
12
+ if (value === "node") return true;
13
+ if (process.platform !== "win32" || !isAbsolute(value)) return false;
14
+ const expected = resolve(homedir(), ".cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin/node.exe");
15
+ const policyPath = resolve(repositoryRoot, ".local/validation-runtime.json");
16
+ const identity = path => resolve(path).replaceAll("/", "\\").toLowerCase();
17
+ try {
18
+ const policyInfo = await lstat(policyPath);
19
+ if (!policyInfo.isFile() || policyInfo.isSymbolicLink() || policyInfo.size > 4096 ||
20
+ identity(await realpath(policyPath)) !== identity(policyPath)) return false;
21
+ const configured = JSON.parse(await readFile(policyPath, "utf8"));
22
+ if (configured?.schema_version !== 1 ||
23
+ Object.keys(configured).sort().join(",") !== "executable,schema_version" ||
24
+ typeof configured.executable !== "string" || !isAbsolute(configured.executable) ||
25
+ identity(value) !== identity(configured.executable) ||
26
+ identity(configured.executable) !== identity(expected)) return false;
27
+ const executableInfo = await lstat(expected);
28
+ return executableInfo.isFile() && !executableInfo.isSymbolicLink() &&
29
+ identity(await realpath(expected)) === identity(expected);
30
+ } catch { return false; }
31
+ }
32
+
33
+ export function createReleaseReadReview({ shellSyntax, tokenizeLiteralCommand, isLiteralReadSequence }) {
34
+ function inertGhRunLogSearch(command) {
35
+ if (shellSyntax(command).interpolation || shellSyntax(command).redirection) return null;
36
+ const parts = [];
37
+ let start = 0, quote = null;
38
+ for (let index = 0; index < command.length; index++) {
39
+ const character = command[index];
40
+ if (quote !== null) {
41
+ if (character === quote) {
42
+ if (quote === "'" && command[index + 1] === "'" && process.platform === "win32") index++;
43
+ else quote = null;
44
+ }
45
+ } else if (character === "'" || character === '"') quote = character;
46
+ else if (character === "|") { parts.push(command.slice(start, index)); start = index + 1; }
47
+ }
48
+ if (quote !== null) return null;
49
+ parts.push(command.slice(start));
50
+ if (parts.length !== 2 || !/^\s*Select-String\s+-Pattern\s+'(?:[^']|'')*'\s*$/i.test(parts[1])) return null;
51
+ const left = tokenizeLiteralCommand(parts[0]);
52
+ const right = tokenizeLiteralCommand(parts[1]);
53
+ if (!left || !right || right.length !== 3 ||
54
+ !/^(?:gh|gh\.exe)$/i.test(left[0]) || left[1] !== "run" || left[2] !== "view") return null;
55
+ let index = 3;
56
+ if (/^\d+$/.test(left[index] ?? "")) index++;
57
+ let log = false, repository = false;
58
+ for (; index < left.length; index++) {
59
+ if (["--log", "--log-failed"].includes(left[index]) && !log) { log = true; continue; }
60
+ if (left[index] === "--repo" && !repository &&
61
+ /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(left[++index] ?? "")) {
62
+ repository = true; continue;
63
+ }
64
+ return null;
65
+ }
66
+ return log && repository ? parts[0] : null;
67
+ }
68
+
69
+ function boundedGhRunLogRead(tokens) {
70
+ return /^(?:gh|gh\.exe)$/i.test(tokens[0] ?? "") && tokens[1] === "run" && tokens[2] === "view" &&
71
+ ((tokens.length === 4 && ["--log", "--log-failed"].includes(tokens[3])) ||
72
+ (tokens.length === 5 && /^\d+$/.test(tokens[3]) && ["--log", "--log-failed"].includes(tokens[4])));
73
+ }
74
+
75
+ async function isCurrentRepositoryRead(command, repositoryRoot, execute) {
76
+ const tokens = tokenizeLiteralCommand(command);
77
+ if (!tokens || !/^gh(?:\.exe)?$/i.test(tokens[0] ?? "")) return false;
78
+ const rest = [], repositories = [];
79
+ for (let index = 0; index < tokens.length; index++) {
80
+ const token = tokens[index];
81
+ if (token === "--repo" || token === "-R") repositories.push(tokens[++index]);
82
+ else if (token.startsWith("--repo=")) repositories.push(token.slice(7));
83
+ else if (token.startsWith("-R") && token.length > 2) repositories.push(token.slice(2));
84
+ else rest.push(token);
85
+ }
86
+ if (repositories.length !== 1 || !/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(repositories[0] ?? "") ||
87
+ rest.some(token => token.includes("'")) ||
88
+ !(boundedGhRunLogRead(rest) || isLiteralReadSequence(rest.map(token => "'" + token + "'").join(" ")))) return false;
89
+ try {
90
+ const origin = (await execute("git", ["remote", "get-url", "origin"], { cwd: repositoryRoot, encoding: "utf8", windowsHide: true })).stdout.trim();
91
+ const match = /^(?:git@github\.com:|https:\/\/github\.com\/|ssh:\/\/git@github\.com\/)([^/]+\/[^/]+?)\.git$|^(?:git@github\.com:|https:\/\/github\.com\/|ssh:\/\/git@github\.com\/)([^/]+\/[^/]+?)\/?$/.exec(origin);
92
+ return !!match && (match[1] ?? match[2]).toLowerCase() === repositories[0].toLowerCase();
93
+ } catch { return false; }
94
+ }
95
+ return { inertGhRunLogSearch, isCurrentRepositoryRead };
96
+ }
97
+ `;
98
+ //# sourceMappingURL=codex-pre-tool-release-review-template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-pre-tool-release-review-template.js","sourceRoot":"","sources":["../../src/services/codex-pre-tool-release-review-template.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgGtD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"codex-pre-tool-support-template.d.ts","sourceRoot":"","sources":["../../src/services/codex-pre-tool-support-template.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,QA8UvC,CAAC"}
1
+ {"version":3,"file":"codex-pre-tool-support-template.d.ts","sourceRoot":"","sources":["../../src/services/codex-pre-tool-support-template.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,QA0XvC,CAAC"}
@@ -1,10 +1,10 @@
1
1
  export const CODEX_PRE_TOOL_SUPPORT_HOOK = String.raw `import { lstat, readFile, realpath } from "node:fs/promises";
2
- import { dirname, isAbsolute, relative, resolve, toNamespacedPath } from "node:path";
2
+ import { dirname, isAbsolute, relative, resolve } from "node:path";
3
3
  import { homedir } from "node:os";
4
4
  import { createHostContext, createLiteralReadSequence } from "./zaip-pre-tool-host-context.mjs";
5
5
  import { createCliTurnCapture } from "./zaip-pre-tool-cli-capture.mjs";
6
+ import { createReleaseReadReview, hasTraversalSegment, pathIdentity, reviewedReleaseNodeExecutable } from "./zaip-pre-tool-release-review.mjs";
6
7
  export { readAuthorityRunRecords, checkDestructivePatterns, configuredDeploymentBranches } from "./zaip-native-tool-authority.mjs";
7
- const pathIdentity = value => process.platform === "win32" ? toNamespacedPath(resolve(value)).toLowerCase() : resolve(value);
8
8
  export const inside = (path, root) => {
9
9
  const scoped = relative(root, resolve(path));
10
10
  return scoped === "" || (!scoped.startsWith("..") && !isAbsolute(scoped));
@@ -100,6 +100,8 @@ export function requiresShellMutationRun(command, tokens, cwd, repositoryRoot) {
100
100
  }
101
101
 
102
102
  export const isLiteralReadSequence = createLiteralReadSequence({ shellSyntax, tokenizeLiteralCommand });
103
+ const { inertGhRunLogSearch, isCurrentRepositoryRead } = createReleaseReadReview({ shellSyntax, tokenizeLiteralCommand, isLiteralReadSequence });
104
+ export { isCurrentRepositoryRead };
103
105
  function isSedMutation(tokens) {
104
106
  const executable = ((tokens[0] ?? "").split(/[\\/]/).pop() ?? "").replace(/\.(?:exe|cmd|bat)$/i, "");
105
107
  return /^sed$/i.test(executable) && tokens.slice(1).some((token) =>
@@ -134,7 +136,7 @@ export function gitInvocation(tokens, deny) {
134
136
 
135
137
  export async function reviewedReleasePaths(command, cwd, repositoryRoot, credentialReferencePattern, deny) {
136
138
  const tokens = tokenizeLiteralCommand(command);
137
- if (!tokens || tokens[0] !== "node" || ![
139
+ if (!tokens || !(await reviewedReleaseNodeExecutable(tokens[0], repositoryRoot)) || ![
138
140
  "scripts/local-release-preparation.mjs", "scripts/local-release-deploy.mjs",
139
141
  ].includes(tokens[1])) return [];
140
142
  if (resolve(cwd) !== repositoryRoot) return [];
@@ -194,7 +196,10 @@ export async function reviewedReleasePaths(command, cwd, repositoryRoot, credent
194
196
  const candidateRoot = resolve(homedir(), ".codex/release-candidates/zaip-aios");
195
197
  const profile = values.get("--profile") ?? "essential";
196
198
  const candidateName = new RegExp("^v" + values.get("--version").replace(".", "\\.") + "-" + profile + "-" + values.get("--sha").slice(0, 8) + "-[0-9]{8}$", "i");
197
- const external = releaseRoot !== repositoryRoot ? [repository] : [];
199
+ const external = [
200
+ ...(isAbsolute(tokens[0]) ? [tokens[0]] : []),
201
+ ...(releaseRoot !== repositoryRoot ? [repository] : []),
202
+ ];
198
203
  let selectedCandidate = null;
199
204
  let selectedKey = values.get("--key-id") ?? null;
200
205
  for (const flag of ["--receipt", "--tarball", "--policy", "--trust-store", "--private-key", "--output-dir", "--notes-file", "--inventory-file"]) {
@@ -288,10 +293,6 @@ export async function reviewedContextReadPaths(command, credentialPattern, repos
288
293
  return paths;
289
294
  }
290
295
 
291
- function hasTraversalSegment(path) {
292
- return path.split(/[\\/]/).includes("..");
293
- }
294
-
295
296
  export const captureCliTurn = createCliTurnCapture({ inside, tokenizeLiteralCommand });
296
297
 
297
298
  export function validateInlineExecution(command, deny) {
@@ -326,6 +327,49 @@ export function validateInlineExecution(command, deny) {
326
327
  }
327
328
  }
328
329
 
330
+ // These CLI values are data, never shell programs. Only one literal invocation of
331
+ // the canonical runtime qualifies; interpolation, pipelines and other scripts do not.
332
+ export async function executionPolicyCommand(command, cwd, repositoryRoot, execute) {
333
+ const inertSearch = inertGhRunLogSearch(command);
334
+ if (inertSearch !== null && await isCurrentRepositoryRead(inertSearch, repositoryRoot, execute)) return inertSearch;
335
+ const tokens = tokenizeLiteralCommand(command);
336
+ if (!tokens || !/^(?:.*[\\/])?node(?:\.exe)?$/i.test(tokens[0] ?? "") ||
337
+ resolve(cwd, tokens[1] ?? "") !== resolve(repositoryRoot, ".agents/runtime/bin/zaip.mjs") ||
338
+ tokens[2] !== "conversation" || tokens[3] !== "finish") return command;
339
+ const result = [...tokens];
340
+ for (let index = 4; index < result.length; index++) {
341
+ if (result[index] === "--summary" && index + 1 < result.length) result[++index] = "literal-summary";
342
+ else if (result[index].startsWith("--summary=")) result[index] = "--summary=literal-summary";
343
+ }
344
+ return result.map(token => JSON.stringify(token)).join(" ");
345
+ }
346
+ export function validateHashicorpRead(command, deny) {
347
+ const tokens = tokenizeLiteralCommand(command);
348
+ if (!tokens || !/^(?:curl(?:\.exe)?|Invoke-WebRequest|Invoke-RestMethod|iwr|irm)$/i.test(tokens[0]))
349
+ deny("HashiCorp releases require a literal supported read command.");
350
+ let urlCount = 0;
351
+ for (let i = 1; i < tokens.length; i++) {
352
+ const token = tokens[i];
353
+ if (/^https:\/\//i.test(token)) {
354
+ const url = new URL(token);
355
+ if (url.hostname !== "releases.hashicorp.com" || url.username || url.password || url.port)
356
+ deny("HashiCorp reads require one exact HTTPS destination.");
357
+ urlCount++; continue;
358
+ }
359
+ if (["-I", "--head", "-s", "-S", "-sS", "--silent", "--show-error", "--fail", "-q", "--disable"].includes(token)) continue;
360
+ const namedMethod = /^(?:--request|--method|-Method)(?:=(.*))?$/i.exec(token);
361
+ const curlMethod = /^-X(.*)$/.exec(token);
362
+ if (namedMethod || curlMethod) {
363
+ const value = namedMethod ? (namedMethod[1] ?? tokens[++i]) : (curlMethod[1] || tokens[++i]);
364
+ if (!/^(?:GET|HEAD)$/i.test(value ?? "")) deny("HashiCorp releases permit only GET or HEAD requests.");
365
+ continue;
366
+ }
367
+ if (/^(?:-Uri|--url)$/i.test(token) && /^https:\/\//i.test(tokens[i + 1] ?? "")) continue;
368
+ deny("Unsupported option in the bounded HashiCorp read command.");
369
+ }
370
+ if (urlCount !== 1) deny("HashiCorp reads require exactly one HTTPS URL.");
371
+ }
372
+
329
373
  export function rewriteCliInput(toolInput, command, commandFromCmd) {
330
374
  return { hookSpecificOutput: {
331
375
  hookEventName: "PreToolUse", permissionDecision: "allow",
@@ -1 +1 @@
1
- {"version":3,"file":"codex-pre-tool-support-template.js","sourceRoot":"","sources":["../../src/services/codex-pre-tool-support-template.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8UpD,CAAC"}
1
+ {"version":3,"file":"codex-pre-tool-support-template.js","sourceRoot":"","sources":["../../src/services/codex-pre-tool-support-template.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0XpD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/cli",
3
- "version": "5.5.0",
3
+ "version": "5.7.0",
4
4
  "description": "CLI oficial para instalar e configurar o ZAIP-AIOS em qualquer repositório",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -6,6 +6,10 @@ English | [Português](README.md)
6
6
 
7
7
  ## Quick overview
8
8
 
9
+ The [v5.7 guide](https://github.com/zaip-ai/zaip-aios/blob/main/docs/quality/v57-eficiencia-publicacao.md) documents preflight before long-running gates, every test-selection cause, caching by verified static dependencies, and sanitized progress. Hooks recognize the configured Node executable and literal log searches while preserving authority controls.
10
+
11
+ The [v5.6 guide](https://github.com/zaip-ai/zaip-aios/blob/main/docs/quality/v56-publicacao-reproduzivel.md) describes the reproducible release runtime, immutable candidate review, and early impact-based validation. Reused coverage requires proof for the same candidate; functional changes and missing evidence retain the applicable gates.
12
+
9
13
  The [v5.5 guide](https://github.com/zaip-ai/zaip-aios/blob/main/docs/quality/v55-eficiencia-operacional.md) describes evidence
10
14
  obligations exposed at intake, direct replay of completed lifecycle closure,
11
15
  bounded journal segments, and impact-based test selection. Timing diagnostics
@@ -632,10 +636,10 @@ already-terminal Gui while the responsible Run is open. No decision means no
632
636
  approval. A trusted fallback must persist `blocked` with a reason when the
633
637
  finalizer cannot run; the current CLI does not yet prove that path for every
634
638
  native Stop or interruption. Direct standalone work with explicit direct
635
- authorization is a legacy route, not the v4 default. See
639
+ authorization is a legacy compatibility route, not the default for new installations. See
636
640
  [closure and recovery](zaip-aios/guides/16-lifecycle-e-reconciliacao.md).
637
641
 
638
- Proof depth is adaptive: a standalone `lite` Task requires at least one typed validation and one Evidence, normally one of each, but accepts legitimate additional proof. `standard` requires two or three validations according to `verification_scope` and at least one consolidated Evidence; `critical` requires three or more, independent review, and persisted risk signals determining additional controls. SPEC and PRD deliveries add a parent matrix, at least three validations and three Evidences, real integration, and independent review. Current templates use managed PRDs/SPECs and direct standalone Tasks; after implementation and installer qualification, v4 targets Codex-native as the operational default. Worktrees, write scopes, budgets, commits, and typed gates still apply where relevant. See [Adaptive assurance and opt-in autonomy](zaip-aios/guides/19-assurance-e-autonomia.md).
642
+ Proof depth is adaptive: a standalone `lite` Task requires at least one typed validation and one Evidence, normally one of each, but accepts legitimate additional proof. `standard` requires two or three validations according to `verification_scope` and at least one consolidated Evidence; `critical` requires three or more, independent review, and persisted risk signals determining additional controls. SPEC and PRD deliveries add a parent matrix, at least three validations and three Evidences, real integration, and independent review. New installations use Codex-native by default. Existing installations retain their effective configuration and must be checked against the installed version; publication does not prove client hook activation. Worktrees, write scopes, budgets, commits, and typed gates still apply where relevant. See [Adaptive assurance and opt-in autonomy](zaip-aios/guides/19-assurance-e-autonomia.md).
639
643
 
640
644
  ## Autonomous engineering principles
641
645
 
@@ -6,6 +6,10 @@
6
6
 
7
7
  ## Visão rápida
8
8
 
9
+ O [guia da v5.7](https://github.com/zaip-ai/zaip-aios/blob/main/docs/quality/v57-eficiencia-publicacao.md) documenta o preflight antes dos gates longos, todas as causas da seleção de testes, o cache por dependências estáticas verificadas e o progresso sanitizado. Os hooks reconhecem o Node configurado e pesquisas literais em logs sem dispensar controles de autoridade.
10
+
11
+ O [guia da v5.6](https://github.com/zaip-ai/zaip-aios/blob/main/docs/quality/v56-publicacao-reproduzivel.md) apresenta o runtime reproduzível de publicação, a revisão do candidato imutável e a validação antecipada por impacto. Cobertura reutilizada exige prova do mesmo candidato; alterações funcionais e provas ausentes mantêm os gates aplicáveis.
12
+
9
13
  O [guia da v5.5](https://github.com/zaip-ai/zaip-aios/blob/main/docs/quality/v55-eficiencia-operacional.md) descreve as obrigações
10
14
  de prova apresentadas no início da entrega, o replay direto de fechamento já
11
15
  concluído, os segmentos limitados dos journals e a seleção de testes por impacto.
@@ -636,7 +640,7 @@ avulsa direta antiga usa uma raiz observada com `--direct-authorization REFERÊN
636
640
  explícita; não é o caminho padrão novo, não cria executor fictício nem dispensa Evidence e Gui. Veja
637
641
  [fechamento e recuperação](zaip-aios/guides/16-lifecycle-e-reconciliacao.md).
638
642
 
639
- A profundidade de prova é adaptativa: Task standalone `lite` exige no mínimo uma validação tipada e uma Evidence, normalmente uma de cada, mas aceita provas adicionais legítimas. `standard` exige duas ou três validações conforme `verification_scope` e pelo menos uma Evidence consolidada; `critical` exige três ou mais, revisão independente e os sinais de risco persistidos que determinam controles adicionais. Entregas de SPEC e PRD acrescentam matriz parental, pelo menos três validações e três Evidences, integração real e revisão independente. O candidato local v4 usa Codex-native como modo padrão; o npm publicado anteriormente mantém o contrato da sua versão e exige validação separada. Worktrees, write scopes, commits, budgets e gates tipados continuam exigidos onde aplicáveis. Compatibilidade de outros hosts não equivale à garantia Codex-native. Consulte [Assurance adaptativa e autonomia opt-in](zaip-aios/guides/19-assurance-e-autonomia.md).
643
+ A profundidade de prova é adaptativa: Task standalone `lite` exige no mínimo uma validação tipada e uma Evidence, normalmente uma de cada, mas aceita provas adicionais legítimas. `standard` exige duas ou três validações conforme `verification_scope` e pelo menos uma Evidence consolidada; `critical` exige três ou mais, revisão independente e os sinais de risco persistidos que determinam controles adicionais. Entregas de SPEC e PRD acrescentam matriz parental, pelo menos três validações e três Evidences, integração real e revisão independente. Novas instalações usam Codex-native como modo padrão. Instalações existentes conservam sua configuração efetiva e devem ser verificadas na versão instalada; publicação não comprova ativação dos hooks no cliente. Worktrees, write scopes, commits, budgets e gates tipados continuam exigidos onde aplicáveis. Compatibilidade de outros hosts não equivale à garantia Codex-native. Consulte [Assurance adaptativa e autonomia opt-in](zaip-aios/guides/19-assurance-e-autonomia.md).
640
644
 
641
645
 
642
646
  ## Princípios de engenharia autônoma
@@ -1,5 +1,5 @@
1
1
  {
2
- "_zaip_managed": "zaip-managed generated-do-not-edit source=agent-discovery version=5.5.0 sha256=3def7a2b43c1a751f8e68754ef94cb107a80b5d26e11f065af2b4cc145fc8897",
2
+ "_zaip_managed": "zaip-managed generated-do-not-edit source=agent-discovery version=5.7.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": "5.5.0",
3
+ "version": "5.7.0",
4
4
  "files": [
5
5
  {
6
6
  "path": "DATA-DICTIONARY.md",
@@ -15,28 +15,28 @@
15
15
  "sha256": "d0366ee0d847fe681de0971a14c80ee3a6af1430c0e9c5eb4f84f14a4b734b82"
16
16
  },
17
17
  {
18
- "path": "apps/frontend/dist/assets/DashboardHelpDialog-Crv8oLKH.js",
19
- "sha256": "7659e8de0884a357f0ea31474a41bba0067a69ec88c2ad20c852f68da67da731"
18
+ "path": "apps/frontend/dist/assets/DashboardHelpDialog-B4XMYP00.js",
19
+ "sha256": "398d15acb212aa40d9c30bece49a30ca4d11e969141e5b23bc10e21856e77b82"
20
20
  },
21
21
  {
22
22
  "path": "apps/frontend/dist/assets/DashboardHelpDialog-DRI_XwUf.css",
23
23
  "sha256": "95dbb5c26ad73831f36f2a51d5e08ef5eee7ca85190764a3e63bf1e700fbadf8"
24
24
  },
25
25
  {
26
- "path": "apps/frontend/dist/assets/PricingSettingsDialog-De3_oOUB.js",
27
- "sha256": "386c55a54cfdf937ca0d99164c7f62e7d2a36aa3b30b29df00b24bd276b1b8e1"
26
+ "path": "apps/frontend/dist/assets/PricingSettingsDialog-DvMV9yit.js",
27
+ "sha256": "83af678b2d9d34bd878c11ccd0807e8a589263403815b8a9aa53c88382d16e1d"
28
28
  },
29
29
  {
30
- "path": "apps/frontend/dist/assets/ProjectSettingsPage-CQMhvzvJ.css",
31
- "sha256": "10e875c4e3ab6c252983822e25a85db3d707d903c0fcf39812909fdd1d013f48"
30
+ "path": "apps/frontend/dist/assets/ProjectSettingsPage-CFhFcZjW.js",
31
+ "sha256": "e8ec270b89b54c4d88d9841f2b67f0f1b911d2e2ee03d56c1fb75f49850ed0cd"
32
32
  },
33
33
  {
34
- "path": "apps/frontend/dist/assets/ProjectSettingsPage-HNZfT9Xo.js",
35
- "sha256": "13172e64f534881f70b8a62d70c34caaa6fb175c3a8754e441efe3d32946bc9f"
34
+ "path": "apps/frontend/dist/assets/ProjectSettingsPage-CQMhvzvJ.css",
35
+ "sha256": "10e875c4e3ab6c252983822e25a85db3d707d903c0fcf39812909fdd1d013f48"
36
36
  },
37
37
  {
38
- "path": "apps/frontend/dist/assets/TraceabilityWorkspace-D4tioTQ5.js",
39
- "sha256": "c5c0adfde02160404f6ff15b28f2ee13d9cad59c7b341e734ef2a1c0a8ca87de"
38
+ "path": "apps/frontend/dist/assets/TraceabilityWorkspace-DkaJNHuG.js",
39
+ "sha256": "4f4dc230651f358c9279c6c45b624b4904fd431a5da076c7804caf2142c3f413"
40
40
  },
41
41
  {
42
42
  "path": "apps/frontend/dist/assets/TraceabilityWorkspace-DvvavDLY.css",
@@ -51,20 +51,20 @@
51
51
  "sha256": "90be9550e3b6719ffc7a029ac35a93a4f14e95263b3996ad6c06dbfc0490f307"
52
52
  },
53
53
  {
54
- "path": "apps/frontend/dist/assets/dashboard-localization-BbNU69xZ.js",
55
- "sha256": "a4a3bcd640bc3f79bd4320a87031a33b8d74c4a4ed2183ba0ba6a0f97f77c437"
54
+ "path": "apps/frontend/dist/assets/dashboard-localization-CwQfHYWq.js",
55
+ "sha256": "4c949cdac87cfec3507308eac9d7ffa11b72a6375cadb437d74051061e694b5a"
56
56
  },
57
57
  {
58
58
  "path": "apps/frontend/dist/assets/icons-vendor-CjGGux6h.js",
59
59
  "sha256": "0f615bc6eaeb21d12fc0457867d6acbfe9434ebae0ebecea9444262e46b972e9"
60
60
  },
61
61
  {
62
- "path": "apps/frontend/dist/assets/index-DZhppOIk.css",
63
- "sha256": "cd290085a95d9108f11e94406b2253bfd2109e116d5d7e82460a2f4aecdaba04"
62
+ "path": "apps/frontend/dist/assets/index-DB2s40tU.js",
63
+ "sha256": "3cf69156017738b9520e93db0129775fecf89c8ed1139fc6df959daf7fc1c860"
64
64
  },
65
65
  {
66
- "path": "apps/frontend/dist/assets/index-oqGtXP7j.js",
67
- "sha256": "6fba043547a996582931e1bbf265fe096ec141008e4efe87a3d2305da3984117"
66
+ "path": "apps/frontend/dist/assets/index-DZhppOIk.css",
67
+ "sha256": "cd290085a95d9108f11e94406b2253bfd2109e116d5d7e82460a2f4aecdaba04"
68
68
  },
69
69
  {
70
70
  "path": "apps/frontend/dist/assets/logo_novo_azul-BBx5pA2B.png",
@@ -92,7 +92,7 @@
92
92
  },
93
93
  {
94
94
  "path": "apps/frontend/dist/index.html",
95
- "sha256": "b89b431b8e411962f04efce2290d37c2c6d5b68b3c90d5d70ec54b6c1469ba8c"
95
+ "sha256": "e63c763258aee77756e8bae671e24cee7b4c9d61c5dde243ce520451d9883dcd"
96
96
  },
97
97
  {
98
98
  "path": "apps/frontend/dist/logo_novo_azul.png",
@@ -104,7 +104,7 @@
104
104
  },
105
105
  {
106
106
  "path": "apps/frontend/package.json",
107
- "sha256": "ca27f6ad95fbf44fef4aa177061c309bd2cd6bc8fafc58140cefc5693d0457f6"
107
+ "sha256": "431336aa01de6bf01c0e79b8ec665e211e5aaeb1f4a9029f24c0c4586cff5f92"
108
108
  },
109
109
  {
110
110
  "path": "apps/frontend/playwright.dom.config.ts",
@@ -600,7 +600,7 @@
600
600
  },
601
601
  {
602
602
  "path": "modules/cost-monitor/package.json",
603
- "sha256": "f8c7d71e3eec1be18387a0d86ce280cab1f81060ae0bd0168289a7a4b16c3e73"
603
+ "sha256": "5c6cdf54d3367a6b7fbc266226d96ea0400257016fd630555da488c1690b6a6d"
604
604
  },
605
605
  {
606
606
  "path": "modules/cost-monitor/src/agent-groups.test.ts",
@@ -1012,7 +1012,7 @@
1012
1012
  },
1013
1013
  {
1014
1014
  "path": "modules/operations/package.json",
1015
- "sha256": "3cc06ed175ef335e50163416f30a9f84e536c3c1c4257ca8011a4b87d5ecb6c7"
1015
+ "sha256": "c8e0b51940c6bc669c5bd8502cebeb8092d9f458465fe91a391eb12f7ed965d2"
1016
1016
  },
1017
1017
  {
1018
1018
  "path": "modules/operations/src/contracts.ts",
@@ -1752,7 +1752,7 @@
1752
1752
  },
1753
1753
  {
1754
1754
  "path": "modules/traceability/package.json",
1755
- "sha256": "291dea5ec338dc2f950aed2d1d1d22e082393b68322a38a979697cf784a2b3e8"
1755
+ "sha256": "0dc8a19bbca6313938bfed33bcb37d9eec85abee2baadc67165d58d592477c28"
1756
1756
  },
1757
1757
  {
1758
1758
  "path": "modules/traceability/src/contracts.ts",
@@ -1824,7 +1824,7 @@
1824
1824
  },
1825
1825
  {
1826
1826
  "path": "packages/branding/package.json",
1827
- "sha256": "f72991e92473a700cae46fbe835dc63c15d3542c37f4510aebfbdce1111df6d7"
1827
+ "sha256": "31b31853d0855b34762953ee1577ebcab6ba9f1dc7b3e31cc292cf5e516982ec"
1828
1828
  },
1829
1829
  {
1830
1830
  "path": "packages/branding/src/index.ts",
@@ -1836,7 +1836,7 @@
1836
1836
  },
1837
1837
  {
1838
1838
  "path": "packages/contracts/package.json",
1839
- "sha256": "6af0748d267fe678ddbb2ab5e77ce7690a64bec096a8a03dfc5071d4a404b79a"
1839
+ "sha256": "3c0dfed50f43e20b0fa803a805361eb19430a19c4a0697c3190b7305450d2669"
1840
1840
  },
1841
1841
  {
1842
1842
  "path": "packages/contracts/src/export.ts",
@@ -1856,7 +1856,7 @@
1856
1856
  },
1857
1857
  {
1858
1858
  "path": "packages/data-export/package.json",
1859
- "sha256": "1a2f264860d1e1b05ee3dbcc5a5032e3bc77be201c1c74e85f8b47829e26246a"
1859
+ "sha256": "77effb1a003eb5bd43fe48b72d13b449f6ff9ed5a029236f4e55f0dc5b476a51"
1860
1860
  },
1861
1861
  {
1862
1862
  "path": "packages/data-export/src/index.test.ts",
@@ -1912,7 +1912,7 @@
1912
1912
  },
1913
1913
  {
1914
1914
  "path": "packages/local-runtime/package.json",
1915
- "sha256": "49c2f69495f0526ed894420b1c3c1d271172c50f32eeff37e2f0a35ee2a0023f"
1915
+ "sha256": "06c5d57081e95887281d6bdba6189707213aae4d6886fb0af3afce146e9ba1e0"
1916
1916
  },
1917
1917
  {
1918
1918
  "path": "packages/local-runtime/scripts/build-frontend.mjs",
@@ -2848,7 +2848,7 @@
2848
2848
  },
2849
2849
  {
2850
2850
  "path": "packages/ui/package.json",
2851
- "sha256": "ae40db63972e48f5fe95a7a23383d6acd0299561d27afa2acf48753c4194b557"
2851
+ "sha256": "e00b503ecdb09a1c42724aed19f98a0615fb246c0ca9a3d4ca8a8300edb4d974"
2852
2852
  },
2853
2853
  {
2854
2854
  "path": "packages/ui/src/DashboardHeader.test.mjs",
@@ -2956,7 +2956,7 @@
2956
2956
  },
2957
2957
  {
2958
2958
  "path": "tests/e2e/package.json",
2959
- "sha256": "72485ec4b52ced94fafef3b3f0f3d8894415c0c1f6cdf629c89ceb74c431cd0f"
2959
+ "sha256": "1402a0923dd5629f86cb86efccdc5b8171d7c4f0903527349649b46bb5a5d76c"
2960
2960
  },
2961
2961
  {
2962
2962
  "path": "tests/e2e/playwright.config.ts",
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-Bh1tDfsg.js";import{E as t,w as n}from"./cost-monitor-B0Jwz_rk.js";import{t as r}from"./dashboard-localization-BbNU69xZ.js";var i=`# Primeiros passos
1
+ import{n as e}from"./rolldown-runtime-Bh1tDfsg.js";import{E as t,w as n}from"./cost-monitor-B0Jwz_rk.js";import{t as r}from"./dashboard-localization-CwQfHYWq.js";var i=`# Primeiros passos
2
2
 
3
3
  1. Leia \`.agents/config/project.yaml\` e \`.agents/rules/core.md\`.
4
4
  2. Consulte \`.agents/records/lifecycle/\` para descobrir o estado atual pelos manifests canônicos.
@@ -2343,6 +2343,10 @@ matriz de performance aprovada apenas porque consultas focadas passaram.
2343
2343
 
2344
2344
  ## Visão rápida
2345
2345
 
2346
+ O [guia da v5.7](docs/quality/v57-eficiencia-publicacao.md) documenta o preflight antes dos gates longos, todas as causas da seleção de testes, o cache por dependências estáticas verificadas e o progresso sanitizado. Os hooks reconhecem o Node configurado e pesquisas literais em logs sem dispensar controles de autoridade.
2347
+
2348
+ O [guia da v5.6](docs/quality/v56-publicacao-reproduzivel.md) apresenta o runtime reproduzível de publicação, a revisão do candidato imutável e a validação antecipada por impacto. Cobertura reutilizada exige prova do mesmo candidato; alterações funcionais e provas ausentes mantêm os gates aplicáveis.
2349
+
2346
2350
  O [guia da v5.5](docs/quality/v55-eficiencia-operacional.md) descreve as obrigações
2347
2351
  de prova apresentadas no início da entrega, o replay direto de fechamento já
2348
2352
  concluído, os segmentos limitados dos journals e a seleção de testes por impacto.
@@ -2973,7 +2977,7 @@ avulsa direta antiga usa uma raiz observada com \`--direct-authorization REFERÊ
2973
2977
  explícita; não é o caminho padrão novo, não cria executor fictício nem dispensa Evidence e Gui. Veja
2974
2978
  [fechamento e recuperação](.agents/zaip-aios/guides/16-lifecycle-e-reconciliacao.md).
2975
2979
 
2976
- A profundidade de prova é adaptativa: Task standalone \`lite\` exige no mínimo uma validação tipada e uma Evidence, normalmente uma de cada, mas aceita provas adicionais legítimas. \`standard\` exige duas ou três validações conforme \`verification_scope\` e pelo menos uma Evidence consolidada; \`critical\` exige três ou mais, revisão independente e os sinais de risco persistidos que determinam controles adicionais. Entregas de SPEC e PRD acrescentam matriz parental, pelo menos três validações e três Evidences, integração real e revisão independente. O candidato local v4 usa Codex-native como modo padrão; o npm publicado anteriormente mantém o contrato da sua versão e exige validação separada. Worktrees, write scopes, commits, budgets e gates tipados continuam exigidos onde aplicáveis. Compatibilidade de outros hosts não equivale à garantia Codex-native. Consulte [Assurance adaptativa e autonomia opt-in](.agents/zaip-aios/guides/19-assurance-e-autonomia.md).
2980
+ A profundidade de prova é adaptativa: Task standalone \`lite\` exige no mínimo uma validação tipada e uma Evidence, normalmente uma de cada, mas aceita provas adicionais legítimas. \`standard\` exige duas ou três validações conforme \`verification_scope\` e pelo menos uma Evidence consolidada; \`critical\` exige três ou mais, revisão independente e os sinais de risco persistidos que determinam controles adicionais. Entregas de SPEC e PRD acrescentam matriz parental, pelo menos três validações e três Evidences, integração real e revisão independente. Novas instalações usam Codex-native como modo padrão. Instalações existentes conservam sua configuração efetiva e devem ser verificadas na versão instalada; publicação não comprova ativação dos hooks no cliente. Worktrees, write scopes, commits, budgets e gates tipados continuam exigidos onde aplicáveis. Compatibilidade de outros hosts não equivale à garantia Codex-native. Consulte [Assurance adaptativa e autonomia opt-in](.agents/zaip-aios/guides/19-assurance-e-autonomia.md).
2977
2981
 
2978
2982
 
2979
2983
  ## Princípios de engenharia autônoma
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-Bh1tDfsg.js";import{E as t,w as n}from"./cost-monitor-B0Jwz_rk.js";import{n as r}from"./dashboard-localization-BbNU69xZ.js";var i=e(t(),1),a=n();function o({catalog:e,fxRate:t,locale:n,onClose:o,onSave:c,onSaveFxRate:l}){let u=r[n],[d,f]=(0,i.useState)(e),[p,m]=(0,i.useState)(t?.rate??0),[h,g]=(0,i.useState)(!1),_=(e,t)=>f(n=>({...n,models:n.models.map((n,r)=>r===e?{...n,...t}:n)})),v=e=>Math.max(0,Number(e)||0);return(0,a.jsx)(`main`,{className:`pricing-backdrop`,children:(0,a.jsxs)(`section`,{"aria-labelledby":`pricing-page-title`,className:`pricing-dialog`,children:[(0,a.jsxs)(`header`,{children:[(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`small`,{children:u.eyebrow}),(0,a.jsx)(`h1`,{id:`pricing-page-title`,children:u.title}),(0,a.jsx)(`p`,{children:u.description})]}),(0,a.jsxs)(`button`,{className:`pricing-back-button`,onClick:o,type:`button`,children:[(0,a.jsx)(`span`,{"aria-hidden":`true`,children:`←`}),` `,u.back]})]}),(0,a.jsxs)(`div`,{className:`pricing-fx-settings`,children:[(0,a.jsxs)(`div`,{className:`pricing-fx-copy`,children:[(0,a.jsx)(`strong`,{children:u.fxTitle}),(0,a.jsx)(`p`,{children:u.fxDescription})]}),(0,a.jsxs)(`label`,{children:[(0,a.jsx)(`span`,{children:u.fxLabel}),(0,a.jsxs)(`div`,{className:`pricing-fx-input`,children:[(0,a.jsx)(`span`,{children:`R$`}),(0,a.jsx)(`input`,{"aria-label":u.fxAriaLabel,min:`0.0001`,onChange:e=>m(Math.max(1e-4,Number(e.target.value)||0)),step:`0.0001`,type:`number`,value:p})]})]})]}),(0,a.jsxs)(`div`,{className:`pricing-table-heading`,children:[(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`strong`,{children:u.catalog}),(0,a.jsx)(`p`,{children:u.pricesPerMillion})]}),(0,a.jsxs)(`span`,{children:[d.models.length,` `,u.models]})]}),(0,a.jsx)(`div`,{className:`pricing-table-wrap`,children:(0,a.jsxs)(`table`,{children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:u.model}),(0,a.jsx)(`th`,{children:u.provider}),(0,a.jsx)(`th`,{children:u.input}),(0,a.jsx)(`th`,{children:u.cache}),(0,a.jsx)(`th`,{children:u.output}),(0,a.jsx)(`th`,{children:u.reasoning}),(0,a.jsx)(`th`,{children:u.priorityInput}),(0,a.jsx)(`th`,{children:u.priorityCache}),(0,a.jsx)(`th`,{children:u.priorityOutput}),(0,a.jsx)(`th`,{children:u.priorityReasoning}),(0,a.jsx)(`th`,{children:u.contextLimit}),(0,a.jsx)(`th`,{children:u.inputMultiplier}),(0,a.jsx)(`th`,{children:u.outputMultiplier}),(0,a.jsx)(`th`,{})]})}),(0,a.jsx)(`tbody`,{children:d.models.map((e,t)=>(0,a.jsxs)(`tr`,{children:[(0,a.jsxs)(`td`,{children:[(0,a.jsx)(`input`,{"aria-label":u.model,onChange:e=>_(t,{id:e.target.value}),value:e.id}),(0,a.jsx)(`small`,{children:e.aliases.join(`, `)||u.noAliases})]}),(0,a.jsx)(`td`,{children:(0,a.jsxs)(`select`,{onChange:e=>_(t,{provider:e.target.value}),value:e.provider,children:[(0,a.jsx)(`option`,{value:`openai`,children:`OpenAI`}),(0,a.jsx)(`option`,{value:`anthropic`,children:`Anthropic`})]})}),(0,a.jsx)(`td`,{children:(0,a.jsx)(`input`,{min:`0`,onChange:e=>_(t,{input_per_million_usd:v(e.target.value)}),step:`0.001`,type:`number`,value:e.input_per_million_usd})}),(0,a.jsx)(`td`,{children:(0,a.jsx)(`input`,{min:`0`,onChange:e=>_(t,{cached_input_per_million_usd:v(e.target.value)}),step:`0.001`,type:`number`,value:e.cached_input_per_million_usd??0})}),(0,a.jsx)(`td`,{children:(0,a.jsx)(`input`,{min:`0`,onChange:e=>_(t,{output_per_million_usd:v(e.target.value)}),step:`0.001`,type:`number`,value:e.output_per_million_usd})}),(0,a.jsx)(`td`,{children:(0,a.jsx)(`input`,{min:`0`,onChange:e=>_(t,{reasoning_per_million_usd:v(e.target.value)}),step:`0.001`,type:`number`,value:e.reasoning_per_million_usd??0})}),[`priority_input_per_million_usd`,`priority_cached_input_per_million_usd`,`priority_output_per_million_usd`,`priority_reasoning_per_million_usd`].map(n=>(0,a.jsx)(`td`,{children:(0,a.jsx)(`input`,{min:`0`,onChange:e=>_(t,{[n]:v(e.target.value)}),step:`0.001`,type:`number`,value:e[n]??0})},n)),(0,a.jsx)(`td`,{children:(0,a.jsx)(`input`,{min:`0`,onChange:e=>_(t,{long_context_threshold_tokens:v(e.target.value)||null}),step:`1`,type:`number`,value:e.long_context_threshold_tokens??0})}),(0,a.jsx)(`td`,{children:(0,a.jsx)(`input`,{min:`0.001`,onChange:e=>_(t,{long_context_input_multiplier:Math.max(.001,Number(e.target.value)||1)}),step:`0.1`,type:`number`,value:e.long_context_input_multiplier})}),(0,a.jsx)(`td`,{children:(0,a.jsx)(`input`,{min:`0.001`,onChange:e=>_(t,{long_context_output_multiplier:Math.max(.001,Number(e.target.value)||1)}),step:`0.1`,type:`number`,value:e.long_context_output_multiplier})}),(0,a.jsx)(`td`,{children:(0,a.jsx)(`button`,{"aria-label":u.removeModel,onClick:()=>f(e=>({...e,models:e.models.filter((e,n)=>n!==t)})),type:`button`,children:`×`})})]},e.id))})]})}),(0,a.jsxs)(`footer`,{children:[(0,a.jsxs)(`button`,{onClick:()=>f(e=>({...e,models:[...e.models,s(n)]})),type:`button`,children:[`+ `,u.addModel]}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`button`,{onClick:o,type:`button`,children:u.cancel}),(0,a.jsx)(`button`,{disabled:h,onClick:async()=>{g(!0);try{await c(d),await l(p),o()}finally{g(!1)}},type:`button`,children:h?u.saving:u.save})]})]})]})})}function s(e=`pt-BR`){let t=r[e];return{id:t.newModel,provider:`openai`,aliases:[],input_per_million_usd:0,cached_input_per_million_usd:0,output_per_million_usd:0,reasoning_per_million_usd:0,priority_input_per_million_usd:null,priority_cached_input_per_million_usd:null,priority_output_per_million_usd:null,priority_reasoning_per_million_usd:null,reasoning_billed_separately:!1,long_context_threshold_tokens:null,long_context_input_multiplier:1,long_context_output_multiplier:1,source_label:t.manualOverride,source_url:`https://developers.openai.com/api/docs/pricing`,notes:[t.editedNote]}}export{o as PricingSettingsPage};
1
+ import{n as e}from"./rolldown-runtime-Bh1tDfsg.js";import{E as t,w as n}from"./cost-monitor-B0Jwz_rk.js";import{n as r}from"./dashboard-localization-CwQfHYWq.js";var i=e(t(),1),a=n();function o({catalog:e,fxRate:t,locale:n,onClose:o,onSave:c,onSaveFxRate:l}){let u=r[n],[d,f]=(0,i.useState)(e),[p,m]=(0,i.useState)(t?.rate??0),[h,g]=(0,i.useState)(!1),_=(e,t)=>f(n=>({...n,models:n.models.map((n,r)=>r===e?{...n,...t}:n)})),v=e=>Math.max(0,Number(e)||0);return(0,a.jsx)(`main`,{className:`pricing-backdrop`,children:(0,a.jsxs)(`section`,{"aria-labelledby":`pricing-page-title`,className:`pricing-dialog`,children:[(0,a.jsxs)(`header`,{children:[(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`small`,{children:u.eyebrow}),(0,a.jsx)(`h1`,{id:`pricing-page-title`,children:u.title}),(0,a.jsx)(`p`,{children:u.description})]}),(0,a.jsxs)(`button`,{className:`pricing-back-button`,onClick:o,type:`button`,children:[(0,a.jsx)(`span`,{"aria-hidden":`true`,children:`←`}),` `,u.back]})]}),(0,a.jsxs)(`div`,{className:`pricing-fx-settings`,children:[(0,a.jsxs)(`div`,{className:`pricing-fx-copy`,children:[(0,a.jsx)(`strong`,{children:u.fxTitle}),(0,a.jsx)(`p`,{children:u.fxDescription})]}),(0,a.jsxs)(`label`,{children:[(0,a.jsx)(`span`,{children:u.fxLabel}),(0,a.jsxs)(`div`,{className:`pricing-fx-input`,children:[(0,a.jsx)(`span`,{children:`R$`}),(0,a.jsx)(`input`,{"aria-label":u.fxAriaLabel,min:`0.0001`,onChange:e=>m(Math.max(1e-4,Number(e.target.value)||0)),step:`0.0001`,type:`number`,value:p})]})]})]}),(0,a.jsxs)(`div`,{className:`pricing-table-heading`,children:[(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`strong`,{children:u.catalog}),(0,a.jsx)(`p`,{children:u.pricesPerMillion})]}),(0,a.jsxs)(`span`,{children:[d.models.length,` `,u.models]})]}),(0,a.jsx)(`div`,{className:`pricing-table-wrap`,children:(0,a.jsxs)(`table`,{children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:u.model}),(0,a.jsx)(`th`,{children:u.provider}),(0,a.jsx)(`th`,{children:u.input}),(0,a.jsx)(`th`,{children:u.cache}),(0,a.jsx)(`th`,{children:u.output}),(0,a.jsx)(`th`,{children:u.reasoning}),(0,a.jsx)(`th`,{children:u.priorityInput}),(0,a.jsx)(`th`,{children:u.priorityCache}),(0,a.jsx)(`th`,{children:u.priorityOutput}),(0,a.jsx)(`th`,{children:u.priorityReasoning}),(0,a.jsx)(`th`,{children:u.contextLimit}),(0,a.jsx)(`th`,{children:u.inputMultiplier}),(0,a.jsx)(`th`,{children:u.outputMultiplier}),(0,a.jsx)(`th`,{})]})}),(0,a.jsx)(`tbody`,{children:d.models.map((e,t)=>(0,a.jsxs)(`tr`,{children:[(0,a.jsxs)(`td`,{children:[(0,a.jsx)(`input`,{"aria-label":u.model,onChange:e=>_(t,{id:e.target.value}),value:e.id}),(0,a.jsx)(`small`,{children:e.aliases.join(`, `)||u.noAliases})]}),(0,a.jsx)(`td`,{children:(0,a.jsxs)(`select`,{onChange:e=>_(t,{provider:e.target.value}),value:e.provider,children:[(0,a.jsx)(`option`,{value:`openai`,children:`OpenAI`}),(0,a.jsx)(`option`,{value:`anthropic`,children:`Anthropic`})]})}),(0,a.jsx)(`td`,{children:(0,a.jsx)(`input`,{min:`0`,onChange:e=>_(t,{input_per_million_usd:v(e.target.value)}),step:`0.001`,type:`number`,value:e.input_per_million_usd})}),(0,a.jsx)(`td`,{children:(0,a.jsx)(`input`,{min:`0`,onChange:e=>_(t,{cached_input_per_million_usd:v(e.target.value)}),step:`0.001`,type:`number`,value:e.cached_input_per_million_usd??0})}),(0,a.jsx)(`td`,{children:(0,a.jsx)(`input`,{min:`0`,onChange:e=>_(t,{output_per_million_usd:v(e.target.value)}),step:`0.001`,type:`number`,value:e.output_per_million_usd})}),(0,a.jsx)(`td`,{children:(0,a.jsx)(`input`,{min:`0`,onChange:e=>_(t,{reasoning_per_million_usd:v(e.target.value)}),step:`0.001`,type:`number`,value:e.reasoning_per_million_usd??0})}),[`priority_input_per_million_usd`,`priority_cached_input_per_million_usd`,`priority_output_per_million_usd`,`priority_reasoning_per_million_usd`].map(n=>(0,a.jsx)(`td`,{children:(0,a.jsx)(`input`,{min:`0`,onChange:e=>_(t,{[n]:v(e.target.value)}),step:`0.001`,type:`number`,value:e[n]??0})},n)),(0,a.jsx)(`td`,{children:(0,a.jsx)(`input`,{min:`0`,onChange:e=>_(t,{long_context_threshold_tokens:v(e.target.value)||null}),step:`1`,type:`number`,value:e.long_context_threshold_tokens??0})}),(0,a.jsx)(`td`,{children:(0,a.jsx)(`input`,{min:`0.001`,onChange:e=>_(t,{long_context_input_multiplier:Math.max(.001,Number(e.target.value)||1)}),step:`0.1`,type:`number`,value:e.long_context_input_multiplier})}),(0,a.jsx)(`td`,{children:(0,a.jsx)(`input`,{min:`0.001`,onChange:e=>_(t,{long_context_output_multiplier:Math.max(.001,Number(e.target.value)||1)}),step:`0.1`,type:`number`,value:e.long_context_output_multiplier})}),(0,a.jsx)(`td`,{children:(0,a.jsx)(`button`,{"aria-label":u.removeModel,onClick:()=>f(e=>({...e,models:e.models.filter((e,n)=>n!==t)})),type:`button`,children:`×`})})]},e.id))})]})}),(0,a.jsxs)(`footer`,{children:[(0,a.jsxs)(`button`,{onClick:()=>f(e=>({...e,models:[...e.models,s(n)]})),type:`button`,children:[`+ `,u.addModel]}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`button`,{onClick:o,type:`button`,children:u.cancel}),(0,a.jsx)(`button`,{disabled:h,onClick:async()=>{g(!0);try{await c(d),await l(p),o()}finally{g(!1)}},type:`button`,children:h?u.saving:u.save})]})]})]})})}function s(e=`pt-BR`){let t=r[e];return{id:t.newModel,provider:`openai`,aliases:[],input_per_million_usd:0,cached_input_per_million_usd:0,output_per_million_usd:0,reasoning_per_million_usd:0,priority_input_per_million_usd:null,priority_cached_input_per_million_usd:null,priority_output_per_million_usd:null,priority_reasoning_per_million_usd:null,reasoning_billed_separately:!1,long_context_threshold_tokens:null,long_context_input_multiplier:1,long_context_output_multiplier:1,source_label:t.manualOverride,source_url:`https://developers.openai.com/api/docs/pricing`,notes:[t.editedNote]}}export{o as PricingSettingsPage};