bazilion 0.18.0 → 0.19.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.
Files changed (96) hide show
  1. package/dist/cli.js +607 -96
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +3247 -741
  4. package/dist/daemon.js.map +1 -1
  5. package/dist/migrations/0001_init.sql +142 -3
  6. package/dist/web/client/assets/{ChatPane-CAYS_fIQ.js → ChatPane-DCyGcqdh.js} +1 -1
  7. package/dist/web/client/assets/ConfirmDialog-C908TxS5.js +1 -0
  8. package/dist/web/client/assets/{FieldRow-W_54rw5c.js → FieldRow-CELqI-1V.js} +1 -1
  9. package/dist/web/client/assets/{ProductionTeamPolicyEditor-DNXVX8Lz.js → ProductionTeamPolicyEditor-DnTcWhG8.js} +1 -1
  10. package/dist/web/client/assets/{ProfileCommunicationEditor-DN0fOzqn.js → ProfileCommunicationEditor-BVIEaW3s.js} +1 -1
  11. package/dist/web/client/assets/{ResultSourceConversation-DoU4tOWc.js → ResultSourceConversation-4gbZCh_s.js} +1 -1
  12. package/dist/web/client/assets/{TeamTabs-BmTZRI4T.js → TeamTabs-V17b45X5.js} +1 -1
  13. package/dist/web/client/assets/{TemplatesTabs-Bs_OXKwx.js → TemplatesTabs-BMK3Qok_.js} +1 -1
  14. package/dist/web/client/assets/{UnsavedChangesGuard-CPRtFReU.js → UnsavedChangesGuard-BaE-UzyS.js} +1 -1
  15. package/dist/web/client/assets/{_id-Dbmei5tg.js → _id-BU1l9gP7.js} +1 -1
  16. package/dist/web/client/assets/{_id-DL4tJFQB.js → _id-BVANQm00.js} +1 -1
  17. package/dist/web/client/assets/{_id-DR9eFC17.js → _id-Bvh5LyUv.js} +1 -1
  18. package/dist/web/client/assets/{_id-ybF-pqmr.js → _id-CArZR-IO.js} +1 -1
  19. package/dist/web/client/assets/{_id-CxAB4TDr.js → _id-tUkSe5li.js} +1 -1
  20. package/dist/web/client/assets/{activity-oUyy77jD.js → activity-CWCnqjqj.js} +1 -1
  21. package/dist/web/client/assets/{agents-DkjJp7JP.js → agents-CX4STmGK.js} +1 -1
  22. package/dist/web/client/assets/{agents-D_TrEqAg.js → agents-CdCnhH06.js} +1 -1
  23. package/dist/web/client/assets/{approvals-DhOerWdt.js → approvals-CnNpwG78.js} +1 -1
  24. package/dist/web/client/assets/{attention-DGwiF-Jy.js → attention-CEE-wWrx.js} +1 -1
  25. package/dist/web/client/assets/chevron-right-CvCEwfSl.js +1 -0
  26. package/dist/web/client/assets/{config-BJ2ZzHPR.js → config-CSEtI-dq.js} +1 -1
  27. package/dist/web/client/assets/{inbox-BUElnGep.js → inbox-MYnBtPdF.js} +1 -1
  28. package/dist/web/client/assets/index-Ct31TjS-.js +52 -0
  29. package/dist/web/client/assets/{learning-BiTHNwB3.js → learning-BIR5FTgQ.js} +1 -1
  30. package/dist/web/client/assets/{login-BmcZvAH2.js → login-DIeceuOs.js} +1 -1
  31. package/dist/web/client/assets/{mcp-Cwk9V82W.js → mcp-CX3kJpGu.js} +1 -1
  32. package/dist/web/client/assets/{members-CHDNabFh.js → members-DlhSjye1.js} +1 -1
  33. package/dist/web/client/assets/{memory-Cx_Fpd4e.js → memory-CsDd6b2l.js} +1 -1
  34. package/dist/web/client/assets/{policy-C0nMdwcG.js → policy-DkWDhG0x.js} +1 -1
  35. package/dist/web/client/assets/{results-Bz3jASs-.js → results-BHdhNHJJ.js} +1 -1
  36. package/dist/web/client/assets/review-Dyw47eM1.js +1 -0
  37. package/dist/web/client/assets/{routes-DsMY_6oy.js → routes-DtYD4WJL.js} +1 -1
  38. package/dist/web/client/assets/{services-DItA6fJ7.js → services-WUlW7oEo.js} +1 -1
  39. package/dist/web/client/assets/{skills-DbNV2vgL.js → skills-jNoUfUSZ.js} +1 -1
  40. package/dist/web/client/assets/styles-DCX6QTqJ.css +2 -0
  41. package/dist/web/client/assets/{teams-D83scDxw.js → teams-C1kYRrtP.js} +1 -1
  42. package/dist/web/client/assets/{teams-DAny1ypN.js → teams-D3FaSKE7.js} +1 -1
  43. package/dist/web/client/assets/{telegram-BOmf9vUh.js → telegram-D86AO6V9.js} +1 -1
  44. package/dist/web/client/assets/{tokens-DBGH6Bw5.js → tokens-B42KDisP.js} +1 -1
  45. package/dist/web/client/assets/{triggers-D1_pseI3.js → triggers-yEfWnQ_K.js} +1 -1
  46. package/dist/web/client/assets/{verifications-CBTo-FyV.js → verifications-DrHQEQFx.js} +2 -2
  47. package/dist/web/client/assets/{welcome-DAfPOm15.js → welcome-D8IbF_P0.js} +1 -1
  48. package/dist/web/client/assets/{x-CWY-gUaM.js → x-CXKABZ7C.js} +1 -1
  49. package/dist/web/server/assets/{_id--zoh1vv7.js → _id-D2bDA1iV.js} +1 -1
  50. package/dist/web/server/assets/{_id-6p-mDmI8.js → _id-DL-SnSnK.js} +1 -1
  51. package/dist/web/server/assets/{_id-dUnXL-My2.js → _id-Dab2CVtO2.js} +1 -1
  52. package/dist/web/server/assets/{_id-DptBl3X8.js → _id-bVispdh-.js} +1 -1
  53. package/dist/web/server/assets/{_tanstack-start-manifest_v-B3M-dfRO.js → _tanstack-start-manifest_v-BcTOb0oj.js} +84 -85
  54. package/dist/web/server/assets/{activity-C5jpoEQI.js → activity-CLDAy6rk.js} +1 -1
  55. package/dist/web/server/assets/{agents-RE6aYOb-.js → agents-CdB2kuNN.js} +1 -1
  56. package/dist/web/server/assets/{agents-nAOx_H7s.js → agents-DfHcb2H2.js} +1 -1
  57. package/dist/web/server/assets/{approvals-DhHxIDrL.js → approvals-Bq846WaP.js} +1 -1
  58. package/dist/web/server/assets/{attention-CBWzWRni.js → attention-Sm-U7s_0.js} +1 -1
  59. package/dist/web/server/assets/{auth-tB3i6cFd.js → auth-PB5dVyvX.js} +1 -1
  60. package/dist/web/server/assets/{config-D1k_tTAw.js → config-BNGTBu80.js} +1 -1
  61. package/dist/web/server/assets/{daemon-client-C7qjQ2iO.js → daemon-client-CWQvck6B.js} +35 -0
  62. package/dist/web/server/assets/{git-review-Bf5ABFJg.js → git-review-C_h_tezf.js} +1 -1
  63. package/dist/web/server/assets/{inbox-Dw4pTevh.js → inbox-DJoU-bla.js} +1 -1
  64. package/dist/web/server/assets/{learning-CF8ZzFVD.js → learning-DVb0I_3Z.js} +1 -1
  65. package/dist/web/server/assets/{mcp-D5dmBT82.js → mcp-CeZqOiDG.js} +1 -1
  66. package/dist/web/server/assets/{members-CvwEN9pm.js → members-CcYjuqxB.js} +1 -1
  67. package/dist/web/server/assets/{memory-CcPK7um7.js → memory-CH2yNT89.js} +1 -1
  68. package/dist/web/server/assets/{policy-Dh6wd2wN.js → policy-DrRKinMr.js} +1 -1
  69. package/dist/web/server/assets/{results-BWnu3gXP.js → results-fT2zyiJx.js} +1 -1
  70. package/dist/web/server/assets/review-CvUPk4HA.js +38 -0
  71. package/dist/web/server/assets/review-DYcYdUTv.js +859 -0
  72. package/dist/web/server/assets/review-packets-e36PsTSX.js +172 -0
  73. package/dist/web/server/assets/{router-Deq94UJQ.js → router-NYhuYQCd.js} +4 -4
  74. package/dist/web/server/assets/{routes-CVKkvFVv.js → routes-RdppWPiW.js} +1 -1
  75. package/dist/web/server/assets/{services-CEr61xb5.js → services-Dgu7dcTC.js} +1 -1
  76. package/dist/web/server/assets/{skills-BImC3LTO.js → skills-DL7UIWa8.js} +1 -1
  77. package/dist/web/server/assets/{teams-8zEIo08E.js → teams-Cmn7mdx9.js} +1 -1
  78. package/dist/web/server/assets/{teams-D-yaAWLV.js → teams-DiC-MBg4.js} +1 -1
  79. package/dist/web/server/assets/{telegram-CGl_LFtJ.js → telegram-CLOFnLjF.js} +1 -1
  80. package/dist/web/server/assets/{tokens-cB-uf7qm.js → tokens-BVva7GHu.js} +1 -1
  81. package/dist/web/server/assets/{triggers-CtSj79L0.js → triggers-D4orksJq.js} +1 -1
  82. package/dist/web/server/assets/{verification-B5QjcpIo.js → verification-C1SHMTX8.js} +1 -1
  83. package/dist/web/server/assets/{verifications-CUq_6ZqL.js → verifications-C_ycXrPK.js} +1 -1
  84. package/dist/web/server/assets/{verifications-BfQsfwSE.js → verifications-Ci49n2Km.js} +14 -1
  85. package/dist/web/server/server.js +75 -39
  86. package/dist/worker.js +544 -112
  87. package/dist/worker.js.map +1 -1
  88. package/package.json +3 -3
  89. package/dist/web/client/assets/ConfirmDialog-BzIiABOP.js +0 -1
  90. package/dist/web/client/assets/chevron-right-DSa4xPTs.js +0 -1
  91. package/dist/web/client/assets/createServerFn-Dzfjt7mA.js +0 -3
  92. package/dist/web/client/assets/index-Bi-HxcPG.js +0 -50
  93. package/dist/web/client/assets/review-AK9WGmpv.js +0 -1
  94. package/dist/web/client/assets/styles-C6br2xxl.css +0 -2
  95. package/dist/web/server/assets/review-DUe3vHPU.js +0 -393
  96. package/dist/web/server/assets/review-c_-cFi7H.js +0 -14
package/dist/worker.js CHANGED
@@ -3515,6 +3515,8 @@ function providerBaseUrl(providerName, env) {
3515
3515
  return env.LLAMACPP_URL ?? LOCAL_PROVIDERS.llamacpp?.baseUrl;
3516
3516
  case "vercel-ai-gateway":
3517
3517
  return env.AI_GATEWAY_BASE_URL;
3518
+ case "fireworks":
3519
+ return env.FIREWORKS_BASE_URL ?? "https://api.fireworks.ai/inference";
3518
3520
  default:
3519
3521
  return void 0;
3520
3522
  }
@@ -3627,11 +3629,26 @@ async function createProtectedPiRuntime(options) {
3627
3629
  baseUrl: options.baseUrl
3628
3630
  });
3629
3631
  }
3632
+ var OPENAI_COMPATIBLE_VERSION_SEGMENT = { fireworks: "/v1" };
3633
+ function fallbackBaseUrl(providerName, baseUrl) {
3634
+ const segment = OPENAI_COMPATIBLE_VERSION_SEGMENT[providerName];
3635
+ if (!segment || !baseUrl) return baseUrl;
3636
+ let url;
3637
+ try {
3638
+ url = new URL(baseUrl);
3639
+ } catch {
3640
+ return baseUrl;
3641
+ }
3642
+ const path = url.pathname.replace(/\/+$/, "");
3643
+ if (path.endsWith(segment)) return baseUrl;
3644
+ url.pathname = `${path}${segment}`;
3645
+ return url.toString();
3646
+ }
3630
3647
  function resolvePiModel(runtime, providerName, modelId, baseUrl) {
3631
3648
  const known = runtime.getModel(piProviderName(providerName), modelId);
3632
3649
  if (known) return baseUrl ? { ...known, baseUrl } : known;
3633
3650
  if (!baseUrl) throw new UnknownModelError(providerName, modelId);
3634
- return fallbackPiModel(providerName, modelId, baseUrl);
3651
+ return fallbackPiModel(providerName, modelId, fallbackBaseUrl(providerName, baseUrl));
3635
3652
  }
3636
3653
 
3637
3654
  // ../daemon/src/runtime/auth/openai-codex.ts
@@ -4046,6 +4063,16 @@ var PROTECTED_REQUIRED_KEYS = new Set(
4046
4063
  (key) => key !== "images" && key !== "questionEnabled" && key !== "containerNamespace"
4047
4064
  )
4048
4065
  );
4066
+ var STATIC_REVIEW_KEYS = /* @__PURE__ */ new Set([
4067
+ "kind",
4068
+ "agentId",
4069
+ "message",
4070
+ "turnId",
4071
+ "runtime",
4072
+ "review",
4073
+ "apiKeyRefreshEnabled",
4074
+ "scratch"
4075
+ ]);
4049
4076
  var VERIFICATION_KEYS = /* @__PURE__ */ new Set([
4050
4077
  "kind",
4051
4078
  "agentId",
@@ -4200,6 +4227,27 @@ function parseWorkerInput(value) {
4200
4227
  requireString(verification.attemptId, "attemptId");
4201
4228
  return value;
4202
4229
  }
4230
+ if (kind === "packet_review") {
4231
+ assertExactKeys(input, STATIC_REVIEW_KEYS, "static review worker input", STATIC_REVIEW_KEYS);
4232
+ requireString(input.agentId, "agentId");
4233
+ requireString(input.message, "message");
4234
+ requireString(input.turnId, "turnId");
4235
+ assertProtectedProviderRuntime(input.runtime);
4236
+ if (input.apiKeyRefreshEnabled !== true) {
4237
+ throw new Error("worker: static review requires bound API key refresh");
4238
+ }
4239
+ assertMinimalWorkerScratch(input.scratch);
4240
+ const review = objectRecord(input.review, "review metadata");
4241
+ assertExactKeys(
4242
+ review,
4243
+ /* @__PURE__ */ new Set(["packetId", "attemptId"]),
4244
+ "review metadata",
4245
+ /* @__PURE__ */ new Set(["packetId", "attemptId"])
4246
+ );
4247
+ requireString(review.packetId, "packetId");
4248
+ requireString(review.attemptId, "attemptId");
4249
+ return value;
4250
+ }
4203
4251
  if (kind === "restricted_review") {
4204
4252
  assertExactKeys(input, REVIEW_KEYS, "restricted review worker input", REVIEW_KEYS);
4205
4253
  requireString(input.agentId, "agentId");
@@ -5396,6 +5444,207 @@ function messagingTools(host, fromAgentId) {
5396
5444
  ];
5397
5445
  }
5398
5446
 
5447
+ // ../daemon/src/runtime/tools/review.ts
5448
+ var ReviewCapabilityError = class extends Error {
5449
+ };
5450
+ var SEVERITIES = ["blocker", "major", "minor", "info"];
5451
+ var CONCLUSIONS = ["changes_requested", "commented", "recommended"];
5452
+ function reviewTools(host) {
5453
+ const packetTool = {
5454
+ def: {
5455
+ name: "review_packet",
5456
+ description: "Read the captured revision you are reviewing: its changed paths, whether that revision\u2019s content can still be reproduced from the working tree, the findings recorded so far, and any conclusion already recorded. This is a static review of one captured revision \u2014 it is not the current repository, and nothing here runs code or changes files.",
5457
+ parameters: { type: "object", properties: {}, additionalProperties: false }
5458
+ },
5459
+ async invoke() {
5460
+ return renderBrief(await host.read());
5461
+ }
5462
+ };
5463
+ const pathTool = {
5464
+ def: {
5465
+ name: "review_path",
5466
+ description: "Read one changed path\u2019s patch from the reviewed revision. Only paths listed by review_packet exist in it. If the working tree has moved since the capture, the patch cannot be reproduced and this says so \u2014 a diff of different code is never returned as the reviewed change.",
5467
+ parameters: {
5468
+ type: "object",
5469
+ properties: {
5470
+ path: {
5471
+ type: "string",
5472
+ description: "Repository-relative path, exactly as review_packet listed it."
5473
+ }
5474
+ },
5475
+ required: ["path"],
5476
+ additionalProperties: false
5477
+ }
5478
+ },
5479
+ async invoke(args) {
5480
+ const path = typeof args.path === "string" ? args.path.trim() : "";
5481
+ if (path === "") throw new ReviewCapabilityError("review_path needs a path");
5482
+ return renderContent(await host.path(path));
5483
+ }
5484
+ };
5485
+ const findingTool = {
5486
+ def: {
5487
+ name: "review_finding",
5488
+ description: "Record one finding against the reviewed revision: a path that appears in review_packet, a severity, and what is wrong. The line range is context for a reader, not identity \u2014 do not attach a finding to a line you have not read. A finding is a statement with evidence, never an approval, and a finding that cannot be correlated to this revision is recorded as unverified rather than guessed at.",
5489
+ parameters: {
5490
+ type: "object",
5491
+ properties: {
5492
+ path: { type: "string", description: "Changed path in the reviewed revision." },
5493
+ severity: {
5494
+ type: "string",
5495
+ enum: [...SEVERITIES],
5496
+ description: "blocker | major | minor | info"
5497
+ },
5498
+ note: {
5499
+ type: "string",
5500
+ description: "What is wrong and what it would take to be satisfied. Be specific."
5501
+ },
5502
+ lineStart: {
5503
+ type: "integer",
5504
+ minimum: 1,
5505
+ description: "Optional first line of context."
5506
+ },
5507
+ lineEnd: { type: "integer", minimum: 1, description: "Optional last line of context." }
5508
+ },
5509
+ required: ["path", "severity", "note"],
5510
+ additionalProperties: false
5511
+ }
5512
+ },
5513
+ async invoke(args) {
5514
+ const path = typeof args.path === "string" ? args.path.trim() : "";
5515
+ const note = typeof args.note === "string" ? args.note.trim() : "";
5516
+ const severity = args.severity;
5517
+ if (path === "") throw new ReviewCapabilityError("review_finding needs a path");
5518
+ if (note === "") throw new ReviewCapabilityError("review_finding needs a note");
5519
+ if (!SEVERITIES.includes(severity)) {
5520
+ throw new ReviewCapabilityError(`severity must be one of: ${SEVERITIES.join(", ")}`);
5521
+ }
5522
+ const result = await host.addFinding({
5523
+ path,
5524
+ severity,
5525
+ note,
5526
+ lineStart: readLine(args.lineStart),
5527
+ lineEnd: readLine(args.lineEnd)
5528
+ });
5529
+ return `Finding ${result.findingId} recorded as [${String(severity)}] on ${path} (finding ${result.ordinal}). Nothing was executed and nothing was changed.`;
5530
+ }
5531
+ };
5532
+ const conclusionTool = {
5533
+ def: {
5534
+ name: "review_conclusion",
5535
+ description: "Record your conclusion for this revision and finish. changes_requested | commented | recommended. A conclusion is your statement about this revision: it is not operator acceptance, not a passing test, and not permission to publish, merge or deploy. Unresolved findings stay visible whatever you conclude, so conclude on the evidence you actually have.",
5536
+ parameters: {
5537
+ type: "object",
5538
+ properties: {
5539
+ conclusion: {
5540
+ type: "string",
5541
+ enum: [...CONCLUSIONS],
5542
+ description: "changes_requested | commented | recommended"
5543
+ },
5544
+ note: { type: "string", description: "A short justification, in evidence terms." }
5545
+ },
5546
+ required: ["conclusion"],
5547
+ additionalProperties: false
5548
+ }
5549
+ },
5550
+ async invoke(args) {
5551
+ const conclusion = args.conclusion;
5552
+ if (!CONCLUSIONS.includes(conclusion)) {
5553
+ throw new ReviewCapabilityError(`conclusion must be one of: ${CONCLUSIONS.join(", ")}`);
5554
+ }
5555
+ const result = await host.conclude({
5556
+ conclusion,
5557
+ note: typeof args.note === "string" ? args.note : null
5558
+ });
5559
+ return `Conclusion recorded: ${result.conclusion}. The review is complete; the requester learns the outcome.`;
5560
+ }
5561
+ };
5562
+ return [packetTool, pathTool, findingTool, conclusionTool];
5563
+ }
5564
+ function reviewRequestTool(host) {
5565
+ return {
5566
+ def: {
5567
+ name: "request_review",
5568
+ description: "Ask one existing member of this Team to read the change as it is right now and say what they think of it. The daemon captures the change, so later edits are not covered. Use it when a second pair of eyes is worth more than your own summary; then end your turn and wait \u2014 you will be told what they found. This is a static reading: the reviewer runs nothing and changes nothing, and this is not an approval to publish, merge or deploy.",
5569
+ parameters: {
5570
+ type: "object",
5571
+ properties: {
5572
+ reviewer: {
5573
+ type: "string",
5574
+ description: "The same-Team member who should review \u2014 their name or their agent id. A name that matches nobody comes back with the members you can ask."
5575
+ },
5576
+ summary: {
5577
+ type: "string",
5578
+ description: "What the change is for and what to look at, in your words. It is commentary; it is not evidence."
5579
+ }
5580
+ },
5581
+ required: ["reviewer"],
5582
+ additionalProperties: false
5583
+ }
5584
+ },
5585
+ async invoke(args) {
5586
+ const reviewer = typeof args.reviewer === "string" ? args.reviewer.trim() : "";
5587
+ if (reviewer === "") throw new ReviewCapabilityError("request_review needs a reviewer");
5588
+ const receipt = await host.capture({
5589
+ reviewer,
5590
+ ...typeof args.summary === "string" ? { summary: args.summary } : {}
5591
+ });
5592
+ return [
5593
+ `Review packet ${receipt.packetId} is ${receipt.state}, against revision ${receipt.snapshotId}.`,
5594
+ `Reviewer: ${receipt.reviewer}.`,
5595
+ "",
5596
+ "The change is captured as it was at this moment; editing it now does not change what will be",
5597
+ "reviewed. End your turn and wait \u2014 the findings are delivered back to you. A reviewer\u2019s conclusion",
5598
+ "is their statement about this revision, not an approval and not a test result."
5599
+ ].join("\n");
5600
+ }
5601
+ };
5602
+ }
5603
+ function readLine(value) {
5604
+ return typeof value === "number" && Number.isInteger(value) && value >= 1 ? value : null;
5605
+ }
5606
+ function renderBrief(brief) {
5607
+ const lines = [
5608
+ `Review packet ${brief.packetId}`,
5609
+ `Change: revision ${brief.snapshot.id} (base ${brief.snapshot.baseOid.slice(0, 12)}${brief.snapshot.complete ? "" : ", INCOMPLETE COVERAGE"})`
5610
+ ];
5611
+ if (brief.summary) lines.push(`Requested by the requester: ${brief.summary}`);
5612
+ lines.push(
5613
+ "",
5614
+ `Changed paths (${brief.changes.length}):`,
5615
+ ...brief.changes.map(
5616
+ (change) => ` ${change.status.padEnd(9)} ${change.path}${change.previousPath ? ` (was ${change.previousPath})` : ""}`
5617
+ )
5618
+ );
5619
+ lines.push(
5620
+ "",
5621
+ brief.contentAvailable ? "Content: the working tree still matches this revision, so review_path can show a patch." : `Content: NOT reproducible \u2014 ${brief.contentUnavailableReason ?? "the reviewed revision has moved"}. Review from the change list, the requester\u2019s summary and your own reading of the paths; do not describe lines you could not read.`
5622
+ );
5623
+ if (brief.findings.length > 0) {
5624
+ lines.push("", "Findings so far:");
5625
+ for (const finding of brief.findings) {
5626
+ lines.push(
5627
+ ` [${finding.severity}] ${finding.path} (${finding.authorKind}) \u2014 ${finding.note}`
5628
+ );
5629
+ }
5630
+ } else {
5631
+ lines.push("", "Findings so far: none.");
5632
+ }
5633
+ if (brief.conclusion) lines.push("", `A conclusion is already recorded: ${brief.conclusion}.`);
5634
+ lines.push(
5635
+ "",
5636
+ "You cannot run commands, change files or publish anything. Record findings with review_finding and finish with review_conclusion."
5637
+ );
5638
+ return lines.join("\n");
5639
+ }
5640
+ function renderContent(content) {
5641
+ if (content.reason) return `No patch for ${content.path}: ${content.reason}`;
5642
+ if (!content.patch) return `No patch for ${content.path}: the change recorded no content.`;
5643
+ return `Patch for ${content.path}${content.truncated ? " (truncated)" : ""}:
5644
+
5645
+ ${content.patch}`;
5646
+ }
5647
+
5399
5648
  // ../daemon/src/runtime/tools/user-md.ts
5400
5649
  function userMdTools(host, teamId) {
5401
5650
  return [
@@ -5451,6 +5700,227 @@ etag: ${etag}`;
5451
5700
  ];
5452
5701
  }
5453
5702
 
5703
+ // ../daemon/src/runtime/tools/verification.ts
5704
+ var VerificationCapabilityError = class extends Error {
5705
+ constructor(message) {
5706
+ super(message);
5707
+ this.name = "VerificationCapabilityError";
5708
+ }
5709
+ };
5710
+ function verificationTools(host) {
5711
+ const attempted = /* @__PURE__ */ new Set();
5712
+ const request = {
5713
+ def: {
5714
+ name: "verification_request",
5715
+ description: "Read the captured verification request: the exact change under verification, the environment the checks were admitted into, and every declared check with its timeout and any outcome so far. A check you were not asked to run cannot be added here \u2014 a different or additional command needs a new request.",
5716
+ parameters: { type: "object", properties: {}, additionalProperties: false }
5717
+ },
5718
+ async invoke() {
5719
+ return renderBrief2(await host.read());
5720
+ }
5721
+ };
5722
+ const check = {
5723
+ def: {
5724
+ name: "verification_check",
5725
+ description: "Invoke exactly one declared check, identified by its ordinal from verification_request. Each check runs at most once: a check that already reported its outcome cannot be run again, and you cannot change its command, cwd, timeout or environment. Report what actually happened, including failures, skips and blockers. A successful exit is evidence about the commands that ran, never proof about later code.",
5726
+ parameters: {
5727
+ type: "object",
5728
+ properties: {
5729
+ ordinal: {
5730
+ type: "integer",
5731
+ minimum: 0,
5732
+ description: "Ordinal of a declared check, as listed by verification_request."
5733
+ }
5734
+ },
5735
+ required: ["ordinal"],
5736
+ additionalProperties: false
5737
+ }
5738
+ },
5739
+ async invoke(args, context) {
5740
+ const ordinal = readOrdinal(args);
5741
+ const brief = await host.read();
5742
+ const declared = brief.checks.find((entry) => entry.ordinal === ordinal);
5743
+ if (!declared) {
5744
+ throw new VerificationCapabilityError(
5745
+ `check ${ordinal} was not captured with this request; only ${brief.checks.map((entry) => entry.ordinal).join(", ")} exist`
5746
+ );
5747
+ }
5748
+ if (declared.state !== "not_executed") {
5749
+ throw new VerificationCapabilityError(
5750
+ `check ${ordinal} already reported '${declared.state}' and cannot be run again`
5751
+ );
5752
+ }
5753
+ if (attempted.has(ordinal)) {
5754
+ throw new VerificationCapabilityError(`check ${ordinal} is already running`);
5755
+ }
5756
+ attempted.add(ordinal);
5757
+ try {
5758
+ const run = await host.invoke(ordinal, { toolCallId: context?.toolCallId ?? "" });
5759
+ return renderRun(run);
5760
+ } catch (error) {
5761
+ attempted.delete(ordinal);
5762
+ throw error;
5763
+ }
5764
+ }
5765
+ };
5766
+ return [request, check];
5767
+ }
5768
+ function readOrdinal(args) {
5769
+ const keys2 = Object.keys(args).sort();
5770
+ if (keys2.length !== 1 || keys2[0] !== "ordinal") {
5771
+ throw new VerificationCapabilityError("verification_check takes only a declared ordinal");
5772
+ }
5773
+ const ordinal = args.ordinal;
5774
+ if (!Number.isInteger(ordinal) || ordinal < 0) {
5775
+ throw new VerificationCapabilityError("ordinal must be a non-negative integer");
5776
+ }
5777
+ return ordinal;
5778
+ }
5779
+ function verificationRequestTool(host) {
5780
+ return {
5781
+ def: {
5782
+ name: "request_verification",
5783
+ description: "Hand the current change to one existing member of this Team and ask them to run specific checks against it. The daemon captures the change as it is right now \u2014 you do not capture one yourself \u2014 so later edits are not covered. Use it when a task is finished and an independent check is worth more than your own report; then end your turn and wait. You will be told the outcome. This asks for verification \u2014 it never approves, publishes, merges or deploys anything.",
5784
+ parameters: {
5785
+ type: "object",
5786
+ properties: {
5787
+ specialist: {
5788
+ type: "string",
5789
+ description: "Agent id of the same-Team member who should verify. They must already exist."
5790
+ },
5791
+ checks: {
5792
+ type: "array",
5793
+ maxItems: 8,
5794
+ description: "The exact commands to run against the captured change. Each runs once, as written.",
5795
+ items: {
5796
+ type: "object",
5797
+ properties: {
5798
+ command: {
5799
+ type: "string",
5800
+ description: "Shell command, run in the captured tree."
5801
+ },
5802
+ purpose: { type: "string", description: "What this command establishes." },
5803
+ cwd: {
5804
+ type: "string",
5805
+ description: "Team-relative directory. Defaults to the root."
5806
+ },
5807
+ timeoutSeconds: {
5808
+ type: "integer",
5809
+ minimum: 1,
5810
+ maximum: 300,
5811
+ description: "Timeout. Defaults to 120 seconds."
5812
+ }
5813
+ },
5814
+ required: ["command", "purpose"],
5815
+ additionalProperties: false
5816
+ }
5817
+ },
5818
+ summary: {
5819
+ type: "string",
5820
+ description: "Short acceptance summary: what the change should do, and what to look for."
5821
+ },
5822
+ writablePaths: {
5823
+ type: "array",
5824
+ maxItems: 16,
5825
+ items: { type: "string" },
5826
+ description: "Team-relative paths where checks are expected to write generated output. Advisory: it is recorded and reported, but it does not confine writes."
5827
+ }
5828
+ },
5829
+ required: ["specialist", "checks"],
5830
+ additionalProperties: false
5831
+ }
5832
+ },
5833
+ async invoke(args) {
5834
+ const intent = readIntent(args);
5835
+ const receipt = await host.capture(intent);
5836
+ return renderRequestReceipt(receipt);
5837
+ }
5838
+ };
5839
+ }
5840
+ function readIntent(args) {
5841
+ const specialist = args.specialist;
5842
+ if (typeof specialist !== "string" || specialist.trim() === "") {
5843
+ throw new Error("request_verification needs the id of an existing same-Team specialist");
5844
+ }
5845
+ if (!Array.isArray(args.checks) || args.checks.length === 0) {
5846
+ throw new Error("request_verification needs at least one check");
5847
+ }
5848
+ if (args.checks.length > 8) {
5849
+ throw new Error("request_verification accepts at most eight checks");
5850
+ }
5851
+ const checks = args.checks.map((entry, index) => {
5852
+ const check = entry;
5853
+ if (typeof check?.command !== "string" || check.command.trim() === "") {
5854
+ throw new Error(`check ${index} has no command`);
5855
+ }
5856
+ if (typeof check?.purpose !== "string" || check.purpose.trim() === "") {
5857
+ throw new Error(`check ${index} has no purpose`);
5858
+ }
5859
+ return {
5860
+ command: check.command,
5861
+ purpose: check.purpose,
5862
+ ...typeof check.cwd === "string" ? { cwd: check.cwd } : {},
5863
+ ...typeof check.timeoutSeconds === "number" ? { timeoutSeconds: check.timeoutSeconds } : {}
5864
+ };
5865
+ });
5866
+ return {
5867
+ specialist: specialist.trim(),
5868
+ checks,
5869
+ ...typeof args.summary === "string" ? { summary: args.summary } : {},
5870
+ ...Array.isArray(args.writablePaths) ? {
5871
+ writablePaths: args.writablePaths.filter(
5872
+ (path) => typeof path === "string"
5873
+ )
5874
+ } : {}
5875
+ };
5876
+ }
5877
+ function renderRequestReceipt(receipt) {
5878
+ const lines = [
5879
+ `Verification request ${receipt.requestId} is ${receipt.state}, against snapshot ${receipt.snapshotId}.`,
5880
+ `Specialist: ${receipt.specialist}.`,
5881
+ "",
5882
+ "Captured checks:"
5883
+ ];
5884
+ for (const check of receipt.checks) {
5885
+ lines.push(` [${check.ordinal}] ${check.command} (cwd ${check.cwd}, ${check.timeoutMs} ms)`);
5886
+ }
5887
+ lines.push(
5888
+ "",
5889
+ "The change is captured as it was at this moment; editing it now does not change what will be",
5890
+ "verified. End your turn and wait \u2014 the outcome is delivered back to you. This request is not an",
5891
+ "approval to publish, merge or deploy, and a passing check is evidence about these commands only."
5892
+ );
5893
+ return lines.join("\n");
5894
+ }
5895
+ function renderBrief2(brief) {
5896
+ const lines = [
5897
+ `Verification request ${brief.requestId}`,
5898
+ `Change: snapshot ${brief.snapshot.id} (base ${brief.snapshot.baseOid.slice(0, 12)}${brief.snapshot.complete ? "" : ", INCOMPLETE COVERAGE"})`,
5899
+ `Environment: image ${brief.environment.image}, shell ${brief.environment.sandbox}${brief.environment.cwd ? `, cwd ${brief.environment.cwd}` : ""}`,
5900
+ `Applicability: ${brief.applicability === "identical" ? "unchanged since capture" : brief.applicability}`
5901
+ ];
5902
+ if (brief.summary) lines.push(`Requested by the requester: ${brief.summary}`);
5903
+ if (brief.writablePaths.length > 0) {
5904
+ lines.push(
5905
+ `Declared generated-output paths (where a check is expected to write; this does not confine writes): ${brief.writablePaths.join(", ")}`
5906
+ );
5907
+ }
5908
+ lines.push("", "Captured checks:");
5909
+ for (const entry of brief.checks) {
5910
+ const outcome = entry.state === "not_executed" ? "not run yet" : `${entry.state}${entry.exitCode === null ? "" : ` (exit ${entry.exitCode})`}${entry.commandId ? ` receipt ${entry.commandId}` : ""}`;
5911
+ lines.push(
5912
+ ` [${entry.ordinal}] ${entry.command} (cwd ${entry.cwd}, ${entry.timeoutMs} ms, ${entry.purpose}) \u2014 ${outcome}`
5913
+ );
5914
+ }
5915
+ lines.push("", "Run each captured check with verification_check. Report failures as failures.");
5916
+ return lines.join("\n");
5917
+ }
5918
+ function renderRun(run) {
5919
+ const head = `Check ${run.ordinal}: ${run.state}${run.exitCode === null ? "" : ` (exit ${run.exitCode})`}${run.commandId ? ` \u2014 receipt ${run.commandId}` : ""}${run.truncated ? " [output truncated]" : ""}`;
5920
+ return run.output.trim() ? `${head}
5921
+ ${run.output}` : head;
5922
+ }
5923
+
5454
5924
  // ../daemon/src/runtime/tools/web.ts
5455
5925
  import { fetch as undiciFetch2 } from "undici";
5456
5926
 
@@ -6127,6 +6597,12 @@ function createBazilionCustomTools(opts) {
6127
6597
  if (opts.fileSink) {
6128
6598
  handlers.push(deliverFileTool(opts.agent.team.path, opts.fileSink, opts.sessionId));
6129
6599
  }
6600
+ if (opts.verificationRequestHost) {
6601
+ handlers.push(verificationRequestTool(opts.verificationRequestHost));
6602
+ }
6603
+ if (opts.reviewRequestHost) {
6604
+ handlers.push(reviewRequestTool(opts.reviewRequestHost));
6605
+ }
6130
6606
  if (opts.askUser) handlers.push(askUserTool(opts.askUser));
6131
6607
  return handlers.map(ourToolToPiTool);
6132
6608
  }
@@ -6140,6 +6616,12 @@ function createProtectedBazilionCustomTools(opts) {
6140
6616
  ...userMdTools(opts.userMdHost, opts.agent.team.id),
6141
6617
  deliverFileTool(opts.agent.team.path, opts.fileSink, opts.sessionId)
6142
6618
  ];
6619
+ if (opts.verificationRequestHost) {
6620
+ handlers.push(verificationRequestTool(opts.verificationRequestHost));
6621
+ }
6622
+ if (opts.reviewRequestHost) {
6623
+ handlers.push(reviewRequestTool(opts.reviewRequestHost));
6624
+ }
6143
6625
  if (opts.askUser) handlers.push(askUserTool(opts.askUser));
6144
6626
  return handlers.map(ourToolToPiTool);
6145
6627
  }
@@ -6243,7 +6725,9 @@ async function createBazilionSession(opts) {
6243
6725
  fileSink,
6244
6726
  askUser,
6245
6727
  sessionId: sessionManager.getSessionId(),
6246
- env
6728
+ env,
6729
+ verificationRequestHost: opts.verificationRequestHost,
6730
+ reviewRequestHost: opts.reviewRequestHost
6247
6731
  });
6248
6732
  if (repository) bazilionTools.push(repository.tool);
6249
6733
  if (repository && opts.codingHost && shellTools && shellTools.config.sandboxMode === "docker" && !opts.preparedDocker)
@@ -6365,7 +6849,9 @@ async function createProtectedBazilionSession(opts) {
6365
6849
  userMdHost: opts.userMdHost,
6366
6850
  fileSink: opts.fileSink,
6367
6851
  askUser: opts.askUser,
6368
- sessionId: sessionManager.getSessionId()
6852
+ sessionId: sessionManager.getSessionId(),
6853
+ verificationRequestHost: opts.verificationRequestHost,
6854
+ reviewRequestHost: opts.reviewRequestHost
6369
6855
  });
6370
6856
  if (repository) bazilionTools.push(repository.tool);
6371
6857
  const redactionSecrets = uniqueSecrets(protectedRuntimeSecrets(opts.runtime));
@@ -6607,111 +7093,6 @@ function explicitConversationFile(directory, target) {
6607
7093
  return file;
6608
7094
  }
6609
7095
 
6610
- // ../daemon/src/runtime/tools/verification.ts
6611
- var VerificationCapabilityError = class extends Error {
6612
- constructor(message) {
6613
- super(message);
6614
- this.name = "VerificationCapabilityError";
6615
- }
6616
- };
6617
- function verificationTools(host) {
6618
- const attempted = /* @__PURE__ */ new Set();
6619
- const request = {
6620
- def: {
6621
- name: "verification_request",
6622
- description: "Read the captured verification request: the exact change under verification, the environment the checks were admitted into, and every declared check with its timeout and any outcome so far. A check you were not asked to run cannot be added here \u2014 a different or additional command needs a new request.",
6623
- parameters: { type: "object", properties: {}, additionalProperties: false }
6624
- },
6625
- async invoke() {
6626
- return renderBrief(await host.read());
6627
- }
6628
- };
6629
- const check = {
6630
- def: {
6631
- name: "verification_check",
6632
- description: "Invoke exactly one declared check, identified by its ordinal from verification_request. Each check runs at most once: a check that already reported its outcome cannot be run again, and you cannot change its command, cwd, timeout or environment. Report what actually happened, including failures, skips and blockers. A successful exit is evidence about the commands that ran, never proof about later code.",
6633
- parameters: {
6634
- type: "object",
6635
- properties: {
6636
- ordinal: {
6637
- type: "integer",
6638
- minimum: 0,
6639
- description: "Ordinal of a declared check, as listed by verification_request."
6640
- }
6641
- },
6642
- required: ["ordinal"],
6643
- additionalProperties: false
6644
- }
6645
- },
6646
- async invoke(args, context) {
6647
- const ordinal = readOrdinal(args);
6648
- const brief = await host.read();
6649
- const declared = brief.checks.find((entry) => entry.ordinal === ordinal);
6650
- if (!declared) {
6651
- throw new VerificationCapabilityError(
6652
- `check ${ordinal} was not captured with this request; only ${brief.checks.map((entry) => entry.ordinal).join(", ")} exist`
6653
- );
6654
- }
6655
- if (declared.state !== "not_executed") {
6656
- throw new VerificationCapabilityError(
6657
- `check ${ordinal} already reported '${declared.state}' and cannot be run again`
6658
- );
6659
- }
6660
- if (attempted.has(ordinal)) {
6661
- throw new VerificationCapabilityError(`check ${ordinal} is already running`);
6662
- }
6663
- attempted.add(ordinal);
6664
- try {
6665
- const run = await host.invoke(ordinal, { toolCallId: context?.toolCallId ?? "" });
6666
- return renderRun(run);
6667
- } catch (error) {
6668
- attempted.delete(ordinal);
6669
- throw error;
6670
- }
6671
- }
6672
- };
6673
- return [request, check];
6674
- }
6675
- function readOrdinal(args) {
6676
- const keys2 = Object.keys(args).sort();
6677
- if (keys2.length !== 1 || keys2[0] !== "ordinal") {
6678
- throw new VerificationCapabilityError("verification_check takes only a declared ordinal");
6679
- }
6680
- const ordinal = args.ordinal;
6681
- if (!Number.isInteger(ordinal) || ordinal < 0) {
6682
- throw new VerificationCapabilityError("ordinal must be a non-negative integer");
6683
- }
6684
- return ordinal;
6685
- }
6686
- function renderBrief(brief) {
6687
- const lines = [
6688
- `Verification request ${brief.requestId}`,
6689
- `Change: snapshot ${brief.snapshot.id} (base ${brief.snapshot.baseOid.slice(0, 12)}${brief.snapshot.complete ? "" : ", INCOMPLETE COVERAGE"})`,
6690
- `Environment: image ${brief.environment.image}, shell ${brief.environment.sandbox}${brief.environment.cwd ? `, cwd ${brief.environment.cwd}` : ""}`,
6691
- `Applicability: ${brief.applicability === "identical" ? "unchanged since capture" : brief.applicability}`
6692
- ];
6693
- if (brief.summary) lines.push(`Requested by the requester: ${brief.summary}`);
6694
- if (brief.writablePaths.length > 0) {
6695
- lines.push(
6696
- `Declared generated-output paths (where a check is expected to write; this does not confine writes): ${brief.writablePaths.join(", ")}`
6697
- );
6698
- }
6699
- lines.push("", "Captured checks:");
6700
- for (const entry of brief.checks) {
6701
- const outcome = entry.state === "not_executed" ? "not run yet" : `${entry.state}${entry.exitCode === null ? "" : ` (exit ${entry.exitCode})`}${entry.commandId ? ` receipt ${entry.commandId}` : ""}`;
6702
- lines.push(
6703
- ` [${entry.ordinal}] ${entry.command} (cwd ${entry.cwd}, ${entry.timeoutMs} ms, ${entry.purpose}) \u2014 ${outcome}`
6704
- );
6705
- }
6706
- lines.push("", "Run each captured check with verification_check. Report failures as failures.");
6707
- return lines.join("\n");
6708
- }
6709
- function renderRun(run) {
6710
- const head = `Check ${run.ordinal}: ${run.state}${run.exitCode === null ? "" : ` (exit ${run.exitCode})`}${run.commandId ? ` \u2014 receipt ${run.commandId}` : ""}${run.truncated ? " [output truncated]" : ""}`;
6711
- return run.output.trim() ? `${head}
6712
- ${run.output}` : head;
6713
- }
6714
-
6715
7096
  // ../daemon/src/runtime/worker/api-key-refresh.ts
6716
7097
  function createIpcApiKeyRefresher(call, context) {
6717
7098
  return async (providerName) => {
@@ -6935,6 +7316,25 @@ function createReviewState(evidenceItems) {
6935
7316
  tools
6936
7317
  };
6937
7318
  }
7319
+ function createIpcVerificationRequestHost(ipcCall) {
7320
+ return {
7321
+ capture: (intent) => ipcCall("verificationCapture", intent)
7322
+ };
7323
+ }
7324
+ function createIpcReviewRequestHost(ipcCall) {
7325
+ return {
7326
+ capture: (intent) => ipcCall("reviewPacketCapture", intent)
7327
+ };
7328
+ }
7329
+ function createIpcChangeReviewHost(ipcCall, identity2) {
7330
+ const { packetId, attemptId } = identity2;
7331
+ return {
7332
+ read: () => ipcCall("reviewPacketRead", { packetId, attemptId }),
7333
+ path: (path) => ipcCall("reviewPathRead", { packetId, attemptId, path }),
7334
+ addFinding: (finding) => ipcCall("reviewFindingAdd", { packetId, attemptId, finding }),
7335
+ conclude: (conclusion) => ipcCall("reviewConclusion", { packetId, attemptId, conclusion })
7336
+ };
7337
+ }
6938
7338
  function createIpcVerificationHost(ipcCall, identity2) {
6939
7339
  return {
6940
7340
  // The request identity is bound here from the worker's own input, so a tool call cannot address
@@ -6944,7 +7344,7 @@ function createIpcVerificationHost(ipcCall, identity2) {
6944
7344
  };
6945
7345
  }
6946
7346
  async function createSessionForInput(input, ipcCall) {
6947
- if (input.kind !== "restricted_review" && input.kind !== "specialist_verification" && !input.repositoryContext)
7347
+ if (input.kind !== "restricted_review" && input.kind !== "specialist_verification" && input.kind !== "packet_review" && !input.repositoryContext)
6948
7348
  throw new Error("Coding turn requires daemon-prepared repository context");
6949
7349
  if (input.kind === "configured_operator_http") {
6950
7350
  const paths = resolvePaths();
@@ -6979,6 +7379,10 @@ async function createSessionForInput(input, ipcCall) {
6979
7379
  enabledProviders: new Set(input.enabledProviders),
6980
7380
  messagingHost: messagingHost2,
6981
7381
  userMdHost: userMdHost2,
7382
+ // The requester's halves of specialist verification and review. Only the configured/browser-enabled
7383
+ // worker kind reaches this builder, and it is an ordinary coding turn.
7384
+ verificationRequestHost: createIpcVerificationRequestHost(ipcCall),
7385
+ reviewRequestHost: createIpcReviewRequestHost(ipcCall),
6982
7386
  apiKey: input.apiKey,
6983
7387
  refreshApiKey: refreshApiKey2,
6984
7388
  browserHost,
@@ -7014,6 +7418,16 @@ async function createSessionForInput(input, ipcCall) {
7014
7418
  });
7015
7419
  return { handle: handle2 };
7016
7420
  }
7421
+ if (input.kind === "packet_review") {
7422
+ const handle2 = await createRestrictedReviewSession({
7423
+ runtime: input.runtime,
7424
+ scratch: input.scratch,
7425
+ systemPrompt: STATIC_REVIEW_SYSTEM_PROMPT,
7426
+ tools: reviewTools(createIpcChangeReviewHost(ipcCall, input.review)).map(ourToolToPiTool),
7427
+ refreshApiKey
7428
+ });
7429
+ return { handle: handle2 };
7430
+ }
7017
7431
  if (input.kind === "restricted_review") {
7018
7432
  const reviewState = createReviewState(input.review.evidence);
7019
7433
  const handle2 = await createRestrictedReviewSession({
@@ -7050,6 +7464,8 @@ async function createSessionForInput(input, ipcCall) {
7050
7464
  messagingHost,
7051
7465
  userMdHost,
7052
7466
  bashApprovalHost,
7467
+ verificationRequestHost: createIpcVerificationRequestHost(ipcCall),
7468
+ reviewRequestHost: createIpcReviewRequestHost(ipcCall),
7053
7469
  askUser: input.questionEnabled ? (toolCallId, question) => ipcCall("askUser", { toolCallId, question }) : void 0,
7054
7470
  refreshApiKey,
7055
7471
  fileSink: async (file, source) => {
@@ -7090,7 +7506,7 @@ async function main() {
7090
7506
  session = handle.session;
7091
7507
  const consumptionAcks = /* @__PURE__ */ new Set();
7092
7508
  const unsubscribe = session.subscribe((piEvent) => {
7093
- if (input.kind !== "restricted_review" && input.kind !== "specialist_verification" && input.questionEnabled && piEvent.type === "message_end" && piEvent.message.role === "toolResult" && piEvent.message.toolName === "ask_user" && !piEvent.message.isError) {
7509
+ if (input.kind !== "restricted_review" && input.kind !== "specialist_verification" && input.kind !== "packet_review" && input.questionEnabled && piEvent.type === "message_end" && piEvent.message.role === "toolResult" && piEvent.message.toolName === "ask_user" && !piEvent.message.isError) {
7094
7510
  const message = piEvent.message;
7095
7511
  const content = message.content[0];
7096
7512
  if (content?.type === "text") {
@@ -7120,8 +7536,9 @@ async function main() {
7120
7536
  });
7121
7537
  try {
7122
7538
  const promptMessage = redactJsonValue(input.message, activeAccessTokens);
7123
- const sanitizedImages = input.kind === "restricted_review" || input.kind === "specialist_verification" ? [] : redactJsonValue(input.images ?? [], activeAccessTokens);
7124
- const promptImages = input.kind === "restricted_review" || input.kind === "specialist_verification" ? [] : sanitizedImages.map((image) => ({
7539
+ const restricted = input.kind === "restricted_review" || input.kind === "specialist_verification" || input.kind === "packet_review";
7540
+ const sanitizedImages = restricted ? [] : redactJsonValue(input.images ?? [], activeAccessTokens);
7541
+ const promptImages = restricted ? [] : sanitizedImages.map((image) => ({
7125
7542
  type: "image",
7126
7543
  data: image.data,
7127
7544
  mimeType: image.mimeType
@@ -7164,6 +7581,21 @@ main().catch((error) => {
7164
7581
  }
7165
7582
  process.exit(1);
7166
7583
  });
7584
+ var STATIC_REVIEW_SYSTEM_PROMPT = `You are a restricted code reviewer. You review one captured
7585
+ revision and report what you find. Call review_packet to read the revision, review_path to read a patch,
7586
+ review_finding to record a finding, and finish with review_conclusion.
7587
+
7588
+ Boundaries you cannot cross, and must not try to:
7589
+ - You review the *captured revision*, not the current repository. If its content is not reproducible, say
7590
+ so and do not describe lines you could not read: the change list and the requester's summary are what
7591
+ you have.
7592
+ - You have no shell, no editor, no browser and no network tool. You cannot run a test, apply a fix, stage
7593
+ anything, commit, merge or deploy. If something would need running to be sure, say that it needs running.
7594
+ - You cannot publish, and your conclusion is not an approval. It is your statement about this revision.
7595
+
7596
+ Report what you actually found, with the path it concerns. Say when you are unsure, and say when you could
7597
+ not verify something rather than guessing. Do not repeat a finding that is already recorded.
7598
+ `;
7167
7599
  var VERIFICATION_SYSTEM_PROMPT = `You are a restricted verification specialist. You verify one
7168
7600
  captured change against the checks your requester selected. Call verification_request to read the
7169
7601
  request, then verification_check once per declared check, in order.