@productbrain/mcp 0.0.1-beta.3377 → 0.0.1-beta.3391

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.
@@ -46,7 +46,7 @@ import {
46
46
  import { McpServer as McpServer2 } from "@modelcontextprotocol/sdk/server/mcp.js";
47
47
 
48
48
  // src/tools/entries.ts
49
- import { z as z8 } from "zod/v3";
49
+ import { z as z9 } from "zod/v3";
50
50
 
51
51
  // src/envelope.ts
52
52
  import { z } from "zod/v3";
@@ -540,7 +540,7 @@ async function dispatchDiscriminated(toolName, union2, flatData, actionSpecs, ha
540
540
  }
541
541
 
542
542
  // src/tools/knowledge.ts
543
- import { z as z5 } from "zod/v3";
543
+ import { z as z6 } from "zod/v3";
544
544
 
545
545
  // src/tools/smart-capture.ts
546
546
  import { z as z4 } from "zod/v3";
@@ -3696,6 +3696,38 @@ async function runConflictPreflight(name, description, collectionHint) {
3696
3696
  }
3697
3697
  }
3698
3698
 
3699
+ // src/tools/knowledge/getHistory.ts
3700
+ import { z as z5 } from "zod/v3";
3701
+ var getHistorySchema = z5.object({
3702
+ entryId: z5.string().describe("Entry ID, e.g. 'T-SUPPLIER', '<PREFIX>-<n>'")
3703
+ });
3704
+ async function handleGetHistory({ entryId }) {
3705
+ const history = await kernelQuery("chain.listEntryHistory", { entryId });
3706
+ if (history.length === 0) {
3707
+ return successResult(
3708
+ `No history found for ${entryId}.`,
3709
+ `No history events recorded for ${entryId}.`,
3710
+ { entryId, eventCount: 0, events: [] }
3711
+ );
3712
+ }
3713
+ const formatted = history.map((rawH) => {
3714
+ const h = rawH;
3715
+ const date = new Date(h.timestamp).toISOString();
3716
+ const changes = h.changes ? ` \u2014 ${JSON.stringify(h.changes)}` : "";
3717
+ const qualifier = h.legacyQualifier ? ` [${h.legacyQualifier}]` : "";
3718
+ return `- **${date}** ${h.event}${h.changedBy ? ` _(${h.changedBy})_` : ""}${changes}${qualifier}`;
3719
+ }).join("\n");
3720
+ return {
3721
+ content: [{ type: "text", text: `# History for \`${entryId}\` (${history.length} events)
3722
+
3723
+ ${formatted}` }],
3724
+ structuredContent: success(
3725
+ `Found ${history.length} history events for ${entryId}.`,
3726
+ { entryId, eventCount: history.length, events: history }
3727
+ )
3728
+ };
3729
+ }
3730
+
3699
3731
  // src/tools/knowledge.ts
3700
3732
  var WORKFLOW_STATUS_VALUES = [
3701
3733
  // Generic / governed collections
@@ -3726,44 +3758,41 @@ var WORKFLOW_STATUS_VALUES = [
3726
3758
  "evidenced"
3727
3759
  ];
3728
3760
  var LEGACY_WORKFLOW_STATUSES = new Set(WORKFLOW_STATUS_VALUES);
3729
- var updateEntrySchema = z5.object({
3730
- entryId: z5.string().describe("Entry ID to update, e.g. 'T-SUPPLIER', '<PREFIX>-<n>'"),
3731
- name: z5.string().optional().describe("New display name"),
3732
- status: z5.union([
3733
- z5.enum(["draft", "active", "deprecated", "archived"]),
3761
+ var updateEntrySchema = z6.object({
3762
+ entryId: z6.string().describe("Entry ID to update, e.g. 'T-SUPPLIER', '<PREFIX>-<n>'"),
3763
+ name: z6.string().optional().describe("New display name"),
3764
+ status: z6.union([
3765
+ z6.enum(["draft", "active", "deprecated", "archived"]),
3734
3766
  // BET-68 legacy shim: frozen historical workflow values still pass through
3735
3767
  // `status` (auto-routed with a warning) until the ~2026-09-03 sunset.
3736
- z5.enum(WORKFLOW_STATUS_VALUES)
3768
+ z6.enum(WORKFLOW_STATUS_VALUES)
3737
3769
  ]).optional().describe("Lifecycle status: draft | active | deprecated | archived. **Workflow values are deprecated here \u2014 use `workflowStatus` instead. Passing a workflow value as `status` will be auto-routed with a warning until 2026-09-03, then hard-errored.**"),
3738
- workflowStatus: z5.string().optional().describe("Collection workflow state. Valid values are collection-specific and server-owned \u2014 discover them via `collections action=describe` for the target collection. The server rejects invalid values and returns the valid set in the error."),
3739
- data: z5.record(z5.unknown()).optional().describe("Fields to update (merged with existing data)"),
3740
- order: z5.number().optional().describe("New sort order"),
3741
- canonicalKey: z5.string().optional().describe("Semantic type (e.g. 'decision', 'tension'). Only changeable on draft/uncommitted entries."),
3742
- autoPublish: z5.boolean().optional().default(false).describe("Only true when user explicitly asks to publish. Default false = draft. Never auto-publish without user confirmation."),
3743
- changeNote: z5.string().optional().describe("Strongly recommended: short human-readable rationale for WHY this change was made (e.g. 'Aligned description with F1-themed copy'). Surfaces in activity feed and pb get. If omitted, falls back to session purpose or auto-generated field summary."),
3744
- sourceRef: z5.string().optional().describe("URI or path of the source document backing this entry. Write-once: can only be set if currently empty."),
3745
- sourceExcerpt: z5.string().optional().describe("Verbatim excerpt from the source that backs this entry's claims. Write-once: can only be set if currently empty."),
3770
+ workflowStatus: z6.string().optional().describe("Collection workflow state. Valid values are collection-specific and server-owned \u2014 discover them via `collections action=describe` for the target collection. The server rejects invalid values and returns the valid set in the error."),
3771
+ data: z6.record(z6.unknown()).optional().describe("Fields to update (merged with existing data)"),
3772
+ order: z6.number().optional().describe("New sort order"),
3773
+ canonicalKey: z6.string().optional().describe("Semantic type (e.g. 'decision', 'tension'). Only changeable on draft/uncommitted entries."),
3774
+ autoPublish: z6.boolean().optional().default(false).describe("Only true when user explicitly asks to publish. Default false = draft. Never auto-publish without user confirmation."),
3775
+ changeNote: z6.string().optional().describe("Strongly recommended: short human-readable rationale for WHY this change was made (e.g. 'Aligned description with F1-themed copy'). Surfaces in activity feed and pb get. If omitted, falls back to session purpose or auto-generated field summary."),
3776
+ sourceRef: z6.string().optional().describe("URI or path of the source document backing this entry. Write-once: can only be set if currently empty."),
3777
+ sourceExcerpt: z6.string().optional().describe("Verbatim excerpt from the source that backs this entry's claims. Write-once: can only be set if currently empty."),
3746
3778
  // WP-465 slice ⑤ — relay-only (TEN-2233): validation/min-length/recording live in Convex.
3747
- steeringOverrideReason: z5.string().optional().describe("Typed override (\u226512 chars) that clears a steering coherency block on a misaligned governance write \u2014 always recorded with author attribution."),
3748
- coherencyAcknowledgement: z5.object({
3749
- response: z5.enum(["linked", "accepted-fix", "diverged"]).describe("Explicit response to an acknowledge-required coherency challenge."),
3750
- entryId: z5.string().optional().describe("Authorizing entry being linked/accepted (required for 'linked' and 'accepted-fix')."),
3751
- reason: z5.string().optional().describe("Divergence rationale (required for 'diverged', \u226512 chars).")
3779
+ steeringOverrideReason: z6.string().optional().describe("Typed override (\u226512 chars) that clears a steering coherency block on a misaligned governance write \u2014 always recorded with author attribution."),
3780
+ coherencyAcknowledgement: z6.object({
3781
+ response: z6.enum(["linked", "accepted-fix", "diverged"]).describe("Explicit response to an acknowledge-required coherency challenge."),
3782
+ entryId: z6.string().optional().describe("Authorizing entry being linked/accepted (required for 'linked' and 'accepted-fix')."),
3783
+ reason: z6.string().optional().describe("Divergence rationale (required for 'diverged', \u226512 chars).")
3752
3784
  }).optional().describe("Explicit response to a coherency challenge (standard/strict workspace modes). One acknowledgement per challenge per entry per session.")
3753
3785
  });
3754
- var getHistorySchema = z5.object({
3755
- entryId: z5.string().describe("Entry ID, e.g. 'T-SUPPLIER', '<PREFIX>-<n>'")
3756
- });
3757
- var commitEntrySchema = z5.object({
3758
- entryId: z5.string().describe("Entry ID to accept, e.g. 'TEN-abc123', '<PREFIX>-<n>'"),
3786
+ var commitEntrySchema = z6.object({
3787
+ entryId: z6.string().describe("Entry ID to accept, e.g. 'TEN-abc123', '<PREFIX>-<n>'"),
3759
3788
  // WP-316 S3: Preview gate — dry-run mode. Returns would-succeed result, no DB writes.
3760
- preview: z5.boolean().optional().describe("If true, validates the accept without writing. Returns what would happen. Default false."),
3789
+ preview: z6.boolean().optional().describe("If true, validates the accept without writing. Returns what would happen. Default false."),
3761
3790
  // WP-465 slice ⑤ — relay-only (TEN-2233): validation/recording live in Convex.
3762
- steeringOverrideReason: z5.string().optional().describe("Typed override (\u226512 chars) that clears a steering coherency block at the publish chokepoint \u2014 always recorded with author attribution."),
3763
- coherencyAcknowledgement: z5.object({
3764
- response: z5.enum(["linked", "accepted-fix", "diverged"]).describe("Explicit response to an acknowledge-required coherency challenge."),
3765
- entryId: z5.string().optional().describe("Authorizing entry being linked/accepted (required for 'linked' and 'accepted-fix')."),
3766
- reason: z5.string().optional().describe("Divergence rationale (required for 'diverged', \u226512 chars).")
3791
+ steeringOverrideReason: z6.string().optional().describe("Typed override (\u226512 chars) that clears a steering coherency block at the publish chokepoint \u2014 always recorded with author attribution."),
3792
+ coherencyAcknowledgement: z6.object({
3793
+ response: z6.enum(["linked", "accepted-fix", "diverged"]).describe("Explicit response to an acknowledge-required coherency challenge."),
3794
+ entryId: z6.string().optional().describe("Authorizing entry being linked/accepted (required for 'linked' and 'accepted-fix')."),
3795
+ reason: z6.string().optional().describe("Divergence rationale (required for 'diverged', \u226512 chars).")
3767
3796
  }).optional().describe("Explicit response to a coherency challenge (standard/strict workspace modes).")
3768
3797
  });
3769
3798
  async function handleUpdateEntry({ entryId, name, status: rawStatus, workflowStatus: rawWorkflowStatus, data, order, canonicalKey, autoPublish, changeNote, sourceRef, sourceExcerpt, steeringOverrideReason, coherencyAcknowledgement }, toolName = "entries") {
@@ -3870,32 +3899,6 @@ async function handleUpdateEntry({ entryId, name, status: rawStatus, workflowSta
3870
3899
  }, next)
3871
3900
  };
3872
3901
  }
3873
- async function handleGetHistory({ entryId }) {
3874
- const history = await kernelQuery("chain.listEntryHistory", { entryId });
3875
- if (history.length === 0) {
3876
- return successResult(
3877
- `No history found for ${entryId}.`,
3878
- `No history events recorded for ${entryId}.`,
3879
- { entryId, eventCount: 0, events: [] }
3880
- );
3881
- }
3882
- const formatted = history.map((rawH) => {
3883
- const h = rawH;
3884
- const date = new Date(h.timestamp).toISOString();
3885
- const changes = h.changes ? ` \u2014 ${JSON.stringify(h.changes)}` : "";
3886
- const qualifier = h.legacyQualifier ? ` [${h.legacyQualifier}]` : "";
3887
- return `- **${date}** ${h.event}${h.changedBy ? ` _(${h.changedBy})_` : ""}${changes}${qualifier}`;
3888
- }).join("\n");
3889
- return {
3890
- content: [{ type: "text", text: `# History for \`${entryId}\` (${history.length} events)
3891
-
3892
- ${formatted}` }],
3893
- structuredContent: success(
3894
- `Found ${history.length} history events for ${entryId}.`,
3895
- { entryId, eventCount: history.length, events: history }
3896
- )
3897
- };
3898
- }
3899
3902
  async function handleCommitEntry({ entryId, preview, steeringOverrideReason, coherencyAcknowledgement }, toolName = "entries") {
3900
3903
  requireWriteAccess();
3901
3904
  const entry = await kernelQuery("chain.getEntry", { entryId });
@@ -4110,6 +4113,14 @@ No DB writes \u2014 call without \`preview:true\` to accept for real.` }],
4110
4113
  lines.push(`- \`${c.chainEntryId}\` ${c.chainEntryName}: ${c.explanation}`);
4111
4114
  }
4112
4115
  }
4116
+ const publishAdvisories = Array.isArray(result2?.publishAdvisories) ? result2.publishAdvisories.filter((a) => typeof a === "string") : void 0;
4117
+ if (publishAdvisories && publishAdvisories.length > 0) {
4118
+ lines.push("");
4119
+ lines.push("\u26A0 Direction advisory (entry committed):");
4120
+ for (const advisory of publishAdvisories) {
4121
+ lines.push(`- ${advisory}`);
4122
+ }
4123
+ }
4113
4124
  const epistemic = deriveEpistemicStatus(toEpistemicInput(entry));
4114
4125
  if (epistemic && (epistemic.level === "hypothesis" || epistemic.level === "untested")) {
4115
4126
  lines.push("");
@@ -4150,6 +4161,8 @@ No DB writes \u2014 call without \`preview:true\` to accept for real.` }],
4150
4161
  // WP-485 Slice 2b round 2 (Codex P1, FEAT-1370): mirror the server's contradiction
4151
4162
  // advisory into the structured payload so --json/agent consumers see it too.
4152
4163
  ...contradictionAdvisory ? { contradictionAdvisory } : {},
4164
+ // WP-582 B1 (FEAT-1403): mirror the direction-trace advisory into the structured payload.
4165
+ ...publishAdvisories && publishAdvisories.length > 0 ? { publishAdvisories } : {},
4153
4166
  // WP-B (attestation spec §4.3): mirror the auto-verify receipt into the
4154
4167
  // structured payload so --json/agent consumers see it too.
4155
4168
  ...result2?.autoVerified ? { autoVerified: result2.autoVerified } : {}
@@ -4168,7 +4181,7 @@ No DB writes \u2014 call without \`preview:true\` to accept for real.` }],
4168
4181
  // src/tools/verify.ts
4169
4182
  import { existsSync as existsSync2, readFileSync } from "fs";
4170
4183
  import { resolve as resolve2 } from "path";
4171
- import { z as z6 } from "zod/v3";
4184
+ import { z as z7 } from "zod/v3";
4172
4185
 
4173
4186
  // src/lib/resolve-project-root.ts
4174
4187
  import { existsSync } from "fs";
@@ -4320,12 +4333,12 @@ function formatTrustReport(collection, entryCount, mappings, refs, fixes, mode,
4320
4333
  lines.push("", "---", `_Schema: ${schemaTableCount} tables parsed from convex/schema.ts. Project root: ${projectRoot}_`);
4321
4334
  return lines.join("\n");
4322
4335
  }
4323
- var verifySchema = z6.object({
4324
- collection: z6.string().max(200).default("glossary").describe("Collection slug to verify (default: glossary)"),
4325
- mode: z6.enum(["report", "fix"]).default("report").describe("'report' = read-only trust report. 'fix' = also update drifted codeMapping statuses.")
4336
+ var verifySchema = z7.object({
4337
+ collection: z7.string().max(200).default("glossary").describe("Collection slug to verify (default: glossary)"),
4338
+ mode: z7.enum(["report", "fix"]).default("report").describe("'report' = read-only trust report. 'fix' = also update drifted codeMapping statuses.")
4326
4339
  });
4327
- var verifyEntrySchema = z6.object({
4328
- entryId: z6.string().max(200).describe("Human entry ID (e.g. '<PREFIX>-<n>') to mark as verified")
4340
+ var verifyEntrySchema = z7.object({
4341
+ entryId: z7.string().max(200).describe("Human entry ID (e.g. '<PREFIX>-<n>') to mark as verified")
4329
4342
  });
4330
4343
  async function handleVerifyChain(server, { collection, mode }) {
4331
4344
  const projectRoot = resolveProjectRoot();
@@ -4542,10 +4555,10 @@ async function handleVerifyEntry({ entryId }) {
4542
4555
  }
4543
4556
 
4544
4557
  // src/tools/entry-move.ts
4545
- import { z as z7 } from "zod/v3";
4546
- var moveEntrySchema = z7.object({
4547
- entryId: z7.string().describe("Entry ID to move, e.g. '<PREFIX>-<n>'"),
4548
- toCollection: z7.string().describe("Target collection slug, e.g. 'decisions', 'architecture'")
4558
+ import { z as z8 } from "zod/v3";
4559
+ var moveEntrySchema = z8.object({
4560
+ entryId: z8.string().describe("Entry ID to move, e.g. '<PREFIX>-<n>'"),
4561
+ toCollection: z8.string().describe("Target collection slug, e.g. 'decisions', 'architecture'")
4549
4562
  });
4550
4563
  async function handleMoveEntry(entryId, toCollection) {
4551
4564
  try {
@@ -4656,89 +4669,89 @@ var ENTRIES_ACTIONS = [
4656
4669
  "move",
4657
4670
  "verify"
4658
4671
  ];
4659
- var coherencyAcknowledgementFlatSchema = z8.object({
4660
- response: z8.enum(["linked", "accepted-fix", "diverged"]).describe("Explicit response to an acknowledge-required coherency challenge."),
4661
- entryId: z8.string().max(200).optional().describe("Authorizing entry being linked/accepted (required for 'linked' and 'accepted-fix')."),
4662
- reason: z8.string().max(2e3).optional().describe("Divergence rationale (required for 'diverged', \u226512 chars).")
4672
+ var coherencyAcknowledgementFlatSchema = z9.object({
4673
+ response: z9.enum(["linked", "accepted-fix", "diverged"]).describe("Explicit response to an acknowledge-required coherency challenge."),
4674
+ entryId: z9.string().max(200).optional().describe("Authorizing entry being linked/accepted (required for 'linked' and 'accepted-fix')."),
4675
+ reason: z9.string().max(2e3).optional().describe("Divergence rationale (required for 'diverged', \u226512 chars).")
4663
4676
  });
4664
- var entriesSchema = z8.object({
4665
- action: z8.enum(ENTRIES_ACTIONS).describe(
4677
+ var entriesSchema = z9.object({
4678
+ action: z9.enum(ENTRIES_ACTIONS).describe(
4666
4679
  "'list': browse entries with filters. 'get': fetch one entry by ID. 'batch': fetch multiple entries. 'search': full-text search. 'update': change fields on an existing entry (draft by default). 'commit': accept a draft entry onto the Chain. 'history': audit trail for an entry. 'move': reclassify an entry to a different collection. 'verify': mark an entry as verified (lightweight \u2014 no codebase scan; see `quality action=verify-chain` for the codebase-scanning check)."
4667
4680
  ),
4668
- entryId: z8.string().max(200).optional().describe(
4681
+ entryId: z9.string().max(200).optional().describe(
4669
4682
  "Entry ID, e.g. '<PREFIX>-<n>'. Required for: get, update, commit, history, move, verify."
4670
4683
  ),
4671
- entryIds: z8.array(z8.string().max(200)).min(1).max(20).optional().describe("Entry IDs for 'batch', e.g. ['TYPE-strategy', 'STR-jljeg7']"),
4672
- collection: z8.string().max(200).optional().describe("Collection slug \u2014 for 'list'/'search': scope filter, e.g. 'glossary', 'tracking-events'."),
4673
- status: z8.string().max(200).optional().describe(
4684
+ entryIds: z9.array(z9.string().max(200)).min(1).max(20).optional().describe("Entry IDs for 'batch', e.g. ['TYPE-strategy', 'STR-jljeg7']"),
4685
+ collection: z9.string().max(200).optional().describe("Collection slug \u2014 for 'list'/'search': scope filter, e.g. 'glossary', 'tracking-events'."),
4686
+ status: z9.string().max(200).optional().describe(
4674
4687
  "For 'list'/'search': filter string (draft | active | deprecated | archived). For 'update': lifecycle value to set (draft | active | deprecated | archived \u2014 legacy workflow values still route through here with a deprecation warning until 2026-09-03; use `workflowStatus` instead)."
4675
4688
  ),
4676
- tag: z8.string().max(200).optional().describe("For 'list': filter by internal tag."),
4677
- label: z8.string().max(200).optional().describe("For 'list': filter by label slug \u2014 matches entries across all collections."),
4678
- query: z8.string().min(2).max(500).optional().describe("For 'search': search text (min 2 characters)."),
4679
- name: z8.string().max(500).optional().describe("For 'update': new display name."),
4680
- workflowStatus: z8.string().max(200).optional().describe(
4689
+ tag: z9.string().max(200).optional().describe("For 'list': filter by internal tag."),
4690
+ label: z9.string().max(200).optional().describe("For 'list': filter by label slug \u2014 matches entries across all collections."),
4691
+ query: z9.string().min(2).max(500).optional().describe("For 'search': search text (min 2 characters)."),
4692
+ name: z9.string().max(500).optional().describe("For 'update': new display name."),
4693
+ workflowStatus: z9.string().max(200).optional().describe(
4681
4694
  "For 'update': collection workflow state. Valid values are collection-specific and server-owned \u2014 discover via `collections action=describe`. Invalid values are rejected with the valid set."
4682
4695
  ),
4683
- data: z8.record(z8.unknown()).optional().describe("For 'update': fields to update (merged with existing data)."),
4684
- order: z8.number().optional().describe("For 'update': new sort order."),
4685
- canonicalKey: z8.string().max(200).optional().describe(
4696
+ data: z9.record(z9.unknown()).optional().describe("For 'update': fields to update (merged with existing data)."),
4697
+ order: z9.number().optional().describe("For 'update': new sort order."),
4698
+ canonicalKey: z9.string().max(200).optional().describe(
4686
4699
  "For 'update': semantic type (e.g. 'decision', 'tension'). Only changeable on draft/uncommitted entries."
4687
4700
  ),
4688
- autoPublish: z8.boolean().optional().default(false).describe(
4701
+ autoPublish: z9.boolean().optional().default(false).describe(
4689
4702
  "For 'update': only true when the user explicitly asks to publish. Default false = draft."
4690
4703
  ),
4691
- changeNote: z8.string().max(2e3).optional().describe(
4704
+ changeNote: z9.string().max(2e3).optional().describe(
4692
4705
  "For 'update': short human-readable rationale for WHY this change was made. Surfaces in activity feed."
4693
4706
  ),
4694
- sourceRef: z8.string().max(2e3).optional().describe(
4707
+ sourceRef: z9.string().max(2e3).optional().describe(
4695
4708
  "For 'update': URI or path of the source document backing this entry. Write-once."
4696
4709
  ),
4697
- sourceExcerpt: z8.string().max(5e3).optional().describe(
4710
+ sourceExcerpt: z9.string().max(5e3).optional().describe(
4698
4711
  "For 'update': verbatim excerpt from the source backing this entry's claims. Write-once."
4699
4712
  ),
4700
- steeringOverrideReason: z8.string().max(2e3).optional().describe(
4713
+ steeringOverrideReason: z9.string().max(2e3).optional().describe(
4701
4714
  "For 'update'/'commit': typed override (\u226512 chars) that clears a steering coherency block."
4702
4715
  ),
4703
4716
  coherencyAcknowledgement: coherencyAcknowledgementFlatSchema.optional().describe(
4704
4717
  "For 'update'/'commit': explicit response to a coherency challenge (standard/strict workspace modes)."
4705
4718
  ),
4706
- preview: z8.boolean().optional().describe(
4719
+ preview: z9.boolean().optional().describe(
4707
4720
  "For 'commit': if true, validates the accept without writing \u2014 returns what would happen."
4708
4721
  ),
4709
- toCollection: z8.string().max(200).optional().describe("For 'move': target collection slug, e.g. 'decisions', 'architecture'.")
4722
+ toCollection: z9.string().max(200).optional().describe("For 'move': target collection slug, e.g. 'decisions', 'architecture'.")
4710
4723
  });
4711
- var entriesListVariant = z8.object({
4712
- action: z8.literal("list"),
4713
- collection: z8.string().max(200).optional(),
4714
- status: z8.string().max(200).optional(),
4715
- tag: z8.string().max(200).optional(),
4716
- label: z8.string().max(200).optional()
4724
+ var entriesListVariant = z9.object({
4725
+ action: z9.literal("list"),
4726
+ collection: z9.string().max(200).optional(),
4727
+ status: z9.string().max(200).optional(),
4728
+ tag: z9.string().max(200).optional(),
4729
+ label: z9.string().max(200).optional()
4717
4730
  });
4718
- var entriesGetVariant = z8.object({
4719
- action: z8.literal("get"),
4720
- entryId: z8.string().max(200)
4731
+ var entriesGetVariant = z9.object({
4732
+ action: z9.literal("get"),
4733
+ entryId: z9.string().max(200)
4721
4734
  });
4722
- var entriesBatchVariant = z8.object({
4723
- action: z8.literal("batch"),
4724
- entryIds: z8.array(z8.string().max(200)).min(1).max(20)
4735
+ var entriesBatchVariant = z9.object({
4736
+ action: z9.literal("batch"),
4737
+ entryIds: z9.array(z9.string().max(200)).min(1).max(20)
4725
4738
  });
4726
- var entriesSearchVariant = z8.object({
4727
- action: z8.literal("search"),
4728
- query: z8.string().min(2).max(500),
4729
- collection: z8.string().max(200).optional(),
4730
- status: z8.string().max(200).optional()
4739
+ var entriesSearchVariant = z9.object({
4740
+ action: z9.literal("search"),
4741
+ query: z9.string().min(2).max(500),
4742
+ collection: z9.string().max(200).optional(),
4743
+ status: z9.string().max(200).optional()
4731
4744
  });
4732
- var entriesUpdateVariant = updateEntrySchema.extend({ action: z8.literal("update") });
4733
- var entriesCommitVariant = commitEntrySchema.extend({ action: z8.literal("commit") });
4734
- var entriesHistoryVariant = getHistorySchema.extend({ action: z8.literal("history") });
4735
- var entriesMoveVariant = z8.object({
4736
- action: z8.literal("move"),
4737
- entryId: z8.string().max(200),
4738
- toCollection: z8.string().max(200)
4745
+ var entriesUpdateVariant = updateEntrySchema.extend({ action: z9.literal("update") });
4746
+ var entriesCommitVariant = commitEntrySchema.extend({ action: z9.literal("commit") });
4747
+ var entriesHistoryVariant = getHistorySchema.extend({ action: z9.literal("history") });
4748
+ var entriesMoveVariant = z9.object({
4749
+ action: z9.literal("move"),
4750
+ entryId: z9.string().max(200),
4751
+ toCollection: z9.string().max(200)
4739
4752
  });
4740
- var entriesVerifyVariant = verifyEntrySchema.extend({ action: z8.literal("verify") });
4741
- var entriesActionUnion = z8.discriminatedUnion("action", [
4753
+ var entriesVerifyVariant = verifyEntrySchema.extend({ action: z9.literal("verify") });
4754
+ var entriesActionUnion = z9.discriminatedUnion("action", [
4742
4755
  entriesListVariant,
4743
4756
  entriesGetVariant,
4744
4757
  entriesBatchVariant,
@@ -4760,15 +4773,15 @@ var ENTRIES_ACTION_SPECS = {
4760
4773
  move: { params: ["entryId", "toCollection"], description: "Both entryId and toCollection are required." },
4761
4774
  verify: { params: ["entryId"], description: "entryId is required." }
4762
4775
  };
4763
- var entriesGetOutputSchema = z8.object({
4764
- entryId: z8.string(),
4765
- name: z8.string(),
4766
- collection: z8.string(),
4767
- status: z8.string(),
4768
- capturedAt: z8.number().optional(),
4769
- origin: z8.string().optional(),
4770
- originDetail: z8.string().optional(),
4771
- verificationStatus: z8.string().optional(),
4776
+ var entriesGetOutputSchema = z9.object({
4777
+ entryId: z9.string(),
4778
+ name: z9.string(),
4779
+ collection: z9.string(),
4780
+ status: z9.string(),
4781
+ capturedAt: z9.number().optional(),
4782
+ origin: z9.string().optional(),
4783
+ originDetail: z9.string().optional(),
4784
+ verificationStatus: z9.string().optional(),
4772
4785
  // Attestation-model finding (PR #341 review): the server's honest verifier label and
4773
4786
  // derived attestation strength/basis — connectors NEVER re-derive strength (spec §5),
4774
4787
  // they only render what chain.getEntry ships. Mirrors packages/cli EntryFromApi.
@@ -4777,72 +4790,72 @@ var entriesGetOutputSchema = z8.object({
4777
4790
  // attestation.ts's AttestationStrength SSOT (allowlisted in Check D —
4778
4791
  // scripts/check-collection-ssot.mjs's CHECK_D_ALLOWLIST — with the full
4779
4792
  // reasoning for why this can't just import that module). Update both together.
4780
- verifiedBy: z8.string().optional(),
4781
- attestation: z8.object({
4782
- strength: z8.enum(["human-direct", "delegated", "system", "unattested"]),
4783
- basis: z8.string().optional()
4793
+ verifiedBy: z9.string().optional(),
4794
+ attestation: z9.object({
4795
+ strength: z9.enum(["human-direct", "delegated", "system", "unattested"]),
4796
+ basis: z9.string().optional()
4784
4797
  }).optional(),
4785
- sourceRef: z8.string().optional(),
4786
- sourceExcerpt: z8.string().optional(),
4787
- why: z8.string().optional(),
4798
+ sourceRef: z9.string().optional(),
4799
+ sourceExcerpt: z9.string().optional(),
4800
+ why: z9.string().optional(),
4788
4801
  // TEN-2191: quality of the captured WHY — 'rationale' | 'missing' | 'restated'.
4789
- whyQuality: z8.enum(["rationale", "missing", "restated"]).optional(),
4790
- data: z8.record(z8.unknown()).optional(),
4791
- relations: z8.array(z8.object({
4792
- entryId: z8.string().optional(),
4793
- name: z8.string(),
4794
- type: z8.string(),
4795
- direction: z8.string()
4802
+ whyQuality: z9.enum(["rationale", "missing", "restated"]).optional(),
4803
+ data: z9.record(z9.unknown()).optional(),
4804
+ relations: z9.array(z9.object({
4805
+ entryId: z9.string().optional(),
4806
+ name: z9.string(),
4807
+ type: z9.string(),
4808
+ direction: z9.string()
4796
4809
  })).optional(),
4797
- labels: z8.array(z8.string()).optional()
4810
+ labels: z9.array(z9.string()).optional()
4798
4811
  }).passthrough();
4799
- var entriesListOutputSchema = z8.object({
4800
- entries: z8.array(z8.object({
4801
- entryId: z8.string(),
4802
- name: z8.string(),
4803
- collection: z8.string(),
4804
- status: z8.string()
4812
+ var entriesListOutputSchema = z9.object({
4813
+ entries: z9.array(z9.object({
4814
+ entryId: z9.string(),
4815
+ name: z9.string(),
4816
+ collection: z9.string(),
4817
+ status: z9.string()
4805
4818
  })),
4806
- total: z8.number()
4819
+ total: z9.number()
4807
4820
  });
4808
- var entriesSearchOutputSchema = z8.object({
4809
- results: z8.array(z8.object({
4810
- entryId: z8.string(),
4811
- name: z8.string(),
4812
- collection: z8.string(),
4813
- status: z8.string(),
4814
- score: z8.number().optional()
4821
+ var entriesSearchOutputSchema = z9.object({
4822
+ results: z9.array(z9.object({
4823
+ entryId: z9.string(),
4824
+ name: z9.string(),
4825
+ collection: z9.string(),
4826
+ status: z9.string(),
4827
+ score: z9.number().optional()
4815
4828
  })),
4816
- total: z8.number(),
4817
- query: z8.string()
4829
+ total: z9.number(),
4830
+ query: z9.string()
4818
4831
  });
4819
- var entriesBatchOutputSchema = z8.object({
4820
- entries: z8.array(z8.object({
4821
- entryId: z8.string(),
4822
- name: z8.string(),
4823
- collection: z8.string(),
4824
- status: z8.string(),
4825
- capturedAt: z8.number().optional(),
4826
- origin: z8.string().optional(),
4827
- originDetail: z8.string().optional(),
4828
- verificationStatus: z8.string().optional(),
4832
+ var entriesBatchOutputSchema = z9.object({
4833
+ entries: z9.array(z9.object({
4834
+ entryId: z9.string(),
4835
+ name: z9.string(),
4836
+ collection: z9.string(),
4837
+ status: z9.string(),
4838
+ capturedAt: z9.number().optional(),
4839
+ origin: z9.string().optional(),
4840
+ originDetail: z9.string().optional(),
4841
+ verificationStatus: z9.string().optional(),
4829
4842
  // Attestation-model finding (PR #341 review): mirror entriesGetOutputSchema — batch
4830
4843
  // entries now carry the same honest verifiedBy/attestation fields. Literal set is
4831
4844
  // the same hand-kept SSOT mirror — see entriesGetOutputSchema's attestation
4832
4845
  // comment above for the full Check D / kernel-import reasoning.
4833
- verifiedBy: z8.string().optional(),
4834
- attestation: z8.object({
4835
- strength: z8.enum(["human-direct", "delegated", "system", "unattested"]),
4836
- basis: z8.string().optional()
4846
+ verifiedBy: z9.string().optional(),
4847
+ attestation: z9.object({
4848
+ strength: z9.enum(["human-direct", "delegated", "system", "unattested"]),
4849
+ basis: z9.string().optional()
4837
4850
  }).optional(),
4838
- sourceRef: z8.string().optional(),
4839
- sourceExcerpt: z8.string().optional(),
4851
+ sourceRef: z9.string().optional(),
4852
+ sourceExcerpt: z9.string().optional(),
4840
4853
  // TEN-2191: mirror entriesGetOutputSchema — batch entries now carry why/whyQuality.
4841
- why: z8.string().optional(),
4842
- whyQuality: z8.enum(["rationale", "missing", "restated"]).optional(),
4843
- data: z8.record(z8.unknown()).optional()
4854
+ why: z9.string().optional(),
4855
+ whyQuality: z9.enum(["rationale", "missing", "restated"]).optional(),
4856
+ data: z9.record(z9.unknown()).optional()
4844
4857
  }).passthrough()),
4845
- total: z8.number()
4858
+ total: z9.number()
4846
4859
  });
4847
4860
  function registerEntriesTools(server) {
4848
4861
  const entriesHandlers = {
@@ -5234,41 +5247,41 @@ ${footer}` }],
5234
5247
  }
5235
5248
 
5236
5249
  // src/tools/relations.ts
5237
- import { z as z10 } from "zod/v3";
5250
+ import { z as z11 } from "zod/v3";
5238
5251
 
5239
5252
  // src/tools/graph.ts
5240
- import { z as z9 } from "zod/v3";
5253
+ import { z as z10 } from "zod/v3";
5241
5254
  var GRAPH_ACTIONS = ["find", "suggest"];
5242
- var graphSchema = z9.object({
5243
- action: z9.enum(GRAPH_ACTIONS).describe(
5255
+ var graphSchema = z10.object({
5256
+ action: z10.enum(GRAPH_ACTIONS).describe(
5244
5257
  "'find': traverse relations from an entry (graph walk). 'suggest': discover potential connections for an entry."
5245
5258
  ),
5246
- entryId: z9.string().max(200).describe("Entry ID, e.g. '<PREFIX>-<n>'"),
5247
- direction: z9.enum(["incoming", "outgoing", "both"]).default("both").optional().describe("For find: 'incoming' = what references this, 'outgoing' = what this references"),
5248
- limit: z9.number().min(1).max(20).default(10).optional().describe("For suggest: max suggestions to return"),
5249
- depth: z9.number().min(1).max(3).default(2).optional().describe("For suggest: graph traversal depth")
5259
+ entryId: z10.string().max(200).describe("Entry ID, e.g. '<PREFIX>-<n>'"),
5260
+ direction: z10.enum(["incoming", "outgoing", "both"]).default("both").optional().describe("For find: 'incoming' = what references this, 'outgoing' = what this references"),
5261
+ limit: z10.number().min(1).max(20).default(10).optional().describe("For suggest: max suggestions to return"),
5262
+ depth: z10.number().min(1).max(3).default(2).optional().describe("For suggest: graph traversal depth")
5250
5263
  });
5251
- var graphFindOutputSchema = z9.object({
5252
- entryId: z9.string(),
5253
- relations: z9.array(z9.object({
5254
- entryId: z9.string().optional(),
5255
- name: z9.string(),
5256
- type: z9.string(),
5257
- direction: z9.enum(["outgoing", "incoming"])
5264
+ var graphFindOutputSchema = z10.object({
5265
+ entryId: z10.string(),
5266
+ relations: z10.array(z10.object({
5267
+ entryId: z10.string().optional(),
5268
+ name: z10.string(),
5269
+ type: z10.string(),
5270
+ direction: z10.enum(["outgoing", "incoming"])
5258
5271
  })),
5259
- total: z9.number()
5272
+ total: z10.number()
5260
5273
  });
5261
- var graphSuggestOutputSchema = z9.object({
5262
- entryId: z9.string(),
5263
- suggestions: z9.array(z9.object({
5264
- targetEntryId: z9.string().optional(),
5265
- targetName: z9.string(),
5266
- relationType: z9.string(),
5267
- direction: z9.string(),
5268
- confidence: z9.number(),
5269
- reason: z9.string()
5274
+ var graphSuggestOutputSchema = z10.object({
5275
+ entryId: z10.string(),
5276
+ suggestions: z10.array(z10.object({
5277
+ targetEntryId: z10.string().optional(),
5278
+ targetName: z10.string(),
5279
+ relationType: z10.string(),
5280
+ direction: z10.string(),
5281
+ confidence: z10.number(),
5282
+ reason: z10.string()
5270
5283
  })),
5271
- total: z9.number()
5284
+ total: z10.number()
5272
5285
  });
5273
5286
  async function handleFind(entryId, direction) {
5274
5287
  const relations = await kernelQuery("chain.listEntryRelations", { entryId });
@@ -5459,64 +5472,64 @@ async function handleSuggest(entryId, limit, depth) {
5459
5472
 
5460
5473
  // src/tools/relations.ts
5461
5474
  var RELATIONS_ACTIONS = ["create", "batch-create", "dismiss", "delete", "find", "suggest"];
5462
- var relationItemSchema = z10.object({
5463
- from: z10.string().max(200),
5464
- to: z10.string().max(200),
5465
- type: z10.string().max(200)
5475
+ var relationItemSchema = z11.object({
5476
+ from: z11.string().max(200),
5477
+ to: z11.string().max(200),
5478
+ type: z11.string().max(200)
5466
5479
  });
5467
- var relationsSchema = z10.object({
5468
- action: z10.enum(RELATIONS_ACTIONS).describe(
5480
+ var relationsSchema = z11.object({
5481
+ action: z11.enum(RELATIONS_ACTIONS).describe(
5469
5482
  "'create': link two entries. 'batch-create': create multiple relations (validates every item before writing any). 'dismiss': record that a suggestion was not relevant. 'delete': remove a relation. 'find': traverse relations from an entry (graph walk, absorbs graph action=find). 'suggest': discover potential connections for an entry (absorbs graph action=suggest)."
5470
5483
  ),
5471
- from: z10.string().max(200).optional().describe("For 'create'/'dismiss'/'delete': source entry ID."),
5472
- to: z10.string().max(200).optional().describe("For 'create'/'dismiss'/'delete': target entry ID."),
5473
- type: z10.string().max(200).optional().describe("For 'create'/'dismiss'/'delete': relation type."),
5474
- score: z10.number().optional().describe("For 'dismiss': suggestion score from action=suggest."),
5475
- relations: z10.array(relationItemSchema).min(1).max(20).optional().describe("For 'batch-create': array of {from, to, type}."),
5484
+ from: z11.string().max(200).optional().describe("For 'create'/'dismiss'/'delete': source entry ID."),
5485
+ to: z11.string().max(200).optional().describe("For 'create'/'dismiss'/'delete': target entry ID."),
5486
+ type: z11.string().max(200).optional().describe("For 'create'/'dismiss'/'delete': relation type."),
5487
+ score: z11.number().optional().describe("For 'dismiss': suggestion score from action=suggest."),
5488
+ relations: z11.array(relationItemSchema).min(1).max(20).optional().describe("For 'batch-create': array of {from, to, type}."),
5476
5489
  // WP-316 S3: Preview gate — dry-run mode for action=create.
5477
- preview: z10.boolean().optional().describe("For 'create': if true, validates the relation without writing. Returns what would happen. Default false."),
5478
- entryId: z10.string().max(200).optional().describe("For 'find'/'suggest': entry ID, e.g. '<PREFIX>-<n>'."),
5479
- direction: z10.enum(["incoming", "outgoing", "both"]).optional().describe("For 'find': 'incoming' = what references this, 'outgoing' = what this references. Default 'both'."),
5480
- limit: z10.number().min(1).max(20).optional().describe("For 'suggest': max suggestions to return. Default 10."),
5481
- depth: z10.number().min(1).max(3).optional().describe("For 'suggest': graph traversal depth. Default 2.")
5490
+ preview: z11.boolean().optional().describe("For 'create': if true, validates the relation without writing. Returns what would happen. Default false."),
5491
+ entryId: z11.string().max(200).optional().describe("For 'find'/'suggest': entry ID, e.g. '<PREFIX>-<n>'."),
5492
+ direction: z11.enum(["incoming", "outgoing", "both"]).optional().describe("For 'find': 'incoming' = what references this, 'outgoing' = what this references. Default 'both'."),
5493
+ limit: z11.number().min(1).max(20).optional().describe("For 'suggest': max suggestions to return. Default 10."),
5494
+ depth: z11.number().min(1).max(3).optional().describe("For 'suggest': graph traversal depth. Default 2.")
5482
5495
  });
5483
- var relationsCreateVariant = z10.object({
5484
- action: z10.literal("create"),
5485
- from: z10.string().max(200),
5486
- to: z10.string().max(200),
5487
- type: z10.string().max(200),
5488
- score: z10.number().optional(),
5489
- preview: z10.boolean().optional()
5496
+ var relationsCreateVariant = z11.object({
5497
+ action: z11.literal("create"),
5498
+ from: z11.string().max(200),
5499
+ to: z11.string().max(200),
5500
+ type: z11.string().max(200),
5501
+ score: z11.number().optional(),
5502
+ preview: z11.boolean().optional()
5490
5503
  });
5491
- var relationsBatchCreateVariant = z10.object({
5492
- action: z10.literal("batch-create"),
5493
- relations: z10.array(relationItemSchema).min(1).max(20)
5504
+ var relationsBatchCreateVariant = z11.object({
5505
+ action: z11.literal("batch-create"),
5506
+ relations: z11.array(relationItemSchema).min(1).max(20)
5494
5507
  });
5495
- var relationsDismissVariant = z10.object({
5496
- action: z10.literal("dismiss"),
5497
- from: z10.string().max(200),
5498
- to: z10.string().max(200),
5499
- type: z10.string().max(200).optional(),
5500
- score: z10.number().optional()
5508
+ var relationsDismissVariant = z11.object({
5509
+ action: z11.literal("dismiss"),
5510
+ from: z11.string().max(200),
5511
+ to: z11.string().max(200),
5512
+ type: z11.string().max(200).optional(),
5513
+ score: z11.number().optional()
5501
5514
  });
5502
- var relationsDeleteVariant = z10.object({
5503
- action: z10.literal("delete"),
5504
- from: z10.string().max(200),
5505
- to: z10.string().max(200),
5506
- type: z10.string().max(200)
5515
+ var relationsDeleteVariant = z11.object({
5516
+ action: z11.literal("delete"),
5517
+ from: z11.string().max(200),
5518
+ to: z11.string().max(200),
5519
+ type: z11.string().max(200)
5507
5520
  });
5508
- var relationsFindVariant = z10.object({
5509
- action: z10.literal("find"),
5510
- entryId: z10.string().max(200),
5511
- direction: z10.enum(["incoming", "outgoing", "both"]).optional().default("both")
5521
+ var relationsFindVariant = z11.object({
5522
+ action: z11.literal("find"),
5523
+ entryId: z11.string().max(200),
5524
+ direction: z11.enum(["incoming", "outgoing", "both"]).optional().default("both")
5512
5525
  });
5513
- var relationsSuggestVariant = z10.object({
5514
- action: z10.literal("suggest"),
5515
- entryId: z10.string().max(200),
5516
- limit: z10.number().min(1).max(20).optional().default(10),
5517
- depth: z10.number().min(1).max(3).optional().default(2)
5526
+ var relationsSuggestVariant = z11.object({
5527
+ action: z11.literal("suggest"),
5528
+ entryId: z11.string().max(200),
5529
+ limit: z11.number().min(1).max(20).optional().default(10),
5530
+ depth: z11.number().min(1).max(3).optional().default(2)
5518
5531
  });
5519
- var relationsActionUnion = z10.discriminatedUnion("action", [
5532
+ var relationsActionUnion = z11.discriminatedUnion("action", [
5520
5533
  relationsCreateVariant,
5521
5534
  relationsBatchCreateVariant,
5522
5535
  relationsDismissVariant,
@@ -5800,19 +5813,19 @@ async function handleDelete(from, to, type) {
5800
5813
  }
5801
5814
 
5802
5815
  // src/tools/context.ts
5803
- import { z as z12 } from "zod/v3";
5816
+ import { z as z13 } from "zod/v3";
5804
5817
 
5805
5818
  // src/tools/documents.ts
5806
- import { z as z11 } from "zod/v3";
5819
+ import { z as z12 } from "zod/v3";
5807
5820
  var DOCUMENTS_ACTIONS = ["get-last-verified-brief"];
5808
- var documentsSchema = z11.object({
5809
- action: z11.enum(DOCUMENTS_ACTIONS).describe(
5821
+ var documentsSchema = z12.object({
5822
+ action: z12.enum(DOCUMENTS_ACTIONS).describe(
5810
5823
  "'get-last-verified-brief': fetch the most recent verified brief snapshot for a (templateId, scopeKey) pair. Returns the verified summary so agents can build delta narratives ('since you last verified, X workstreams advanced')."
5811
5824
  ),
5812
- templateId: z11.string().max(200).describe(
5825
+ templateId: z12.string().max(200).describe(
5813
5826
  "Brief template identifier \u2014 currently 'steering-brief' is the only registered template."
5814
5827
  ),
5815
- scopeKey: z11.string().max(200).describe(
5828
+ scopeKey: z12.string().max(200).describe(
5816
5829
  "Canonical scope key. Use 'workspace:<workspaceId>' for the full workspace brief, or 'initiative:<INI-ID>' for an initiative-scoped brief. The same formula is applied at write time (chainwork/docKernel/scopeKey.ts), so passing the wrong shape returns exists:false."
5817
5830
  )
5818
5831
  });
@@ -5892,89 +5905,89 @@ function epistemicCollectionHint(collectionName) {
5892
5905
  return "";
5893
5906
  }
5894
5907
  var CONTEXT_ACTIONS = ["gather", "build", "neighborhood", "changes", "chain", "cross-cut", "incremental", "brief", "last-verified-brief"];
5895
- var contextSchema = z12.object({
5908
+ var contextSchema = z13.object({
5896
5909
  // provenance: neighborhood BET-142; changes/chain/cross-cut/incremental/brief BET-239 (E4, E6)
5897
- action: z12.enum(CONTEXT_ACTIONS).describe(
5910
+ action: z13.enum(CONTEXT_ACTIONS).describe(
5898
5911
  "'gather': assemble knowledge context (entry graph, task auto-load, journey mode, or graph mode). 'build': structured build spec for an entry. 'neighborhood': typed graph neighborhood for an entry \u2014 blocking chain, dependencies, parent context, tensions, staleness. 'changes': entries modified and relations created since a timestamp. Requires 'since' parameter. 'chain': directed traversal along one relation type to depth 4. Requires entryId. Optional: direction, relationType, maxHops (1-4). 'cross-cut': structural aggregation \u2014 all relations of a given type grouped by source collection. Requires 'relationType' parameter. 'incremental': delta since last brief run for a skill. Requires 'skill' parameter. Returns only entries changed since the skill's last brief. 'brief': compound intelligence query. Requires 'briefType' parameter: 'steering' (changes + structure + delta + readiness), 'confidence' (changes + active bets + tensions), or 'delta' (changes + relations since timestamp). Optional 'since' for delta type. 'last-verified-brief': fetch the most recent verified brief snapshot for a (templateId, scopeKey) pair (absorbs documents action=get-last-verified-brief). Requires templateId and scopeKey."
5899
5912
  ),
5900
- entryId: z12.string().max(200).optional().describe("For 'build'/'neighborhood'/'chain': entry ID, e.g. '<PREFIX>-<n>'. For 'gather': optional entry ID for entry-graph mode."),
5901
- mapEntryId: z12.string().max(200).optional().describe(
5913
+ entryId: z13.string().max(200).optional().describe("For 'build'/'neighborhood'/'chain': entry ID, e.g. '<PREFIX>-<n>'. For 'gather': optional entry ID for entry-graph mode."),
5914
+ mapEntryId: z13.string().max(200).optional().describe(
5902
5915
  "For 'gather': journey map entry ID for journey-aware context. Returns context organised by journey stage. Takes precedence over entryId when both are supplied. Example: '<PREFIX>-<n>'."
5903
5916
  ),
5904
- task: z12.string().max(2e3).optional().describe("For 'gather': natural-language task description for loading task-relevant governance, binding constraints, and supporting context."),
5905
- since: z12.string().max(200).optional().describe(
5917
+ task: z13.string().max(2e3).optional().describe("For 'gather': natural-language task description for loading task-relevant governance, binding constraints, and supporting context."),
5918
+ since: z13.string().max(200).optional().describe(
5906
5919
  "For 'changes': ISO 8601 timestamp \u2014 returns entries/relations modified since this time. For 'brief' briefType='delta': optional custom timestamp. Example: '2026-03-24T00:00:00Z'."
5907
5920
  ),
5908
- direction: z12.enum(["outgoing", "incoming"]).default("outgoing").optional().describe("For 'chain' action: traversal direction. 'outgoing' follows relations from source, 'incoming' follows relations to source. Default: outgoing."),
5909
- relationType: z12.string().max(200).optional().describe(
5921
+ direction: z13.enum(["outgoing", "incoming"]).default("outgoing").optional().describe("For 'chain' action: traversal direction. 'outgoing' follows relations from source, 'incoming' follows relations to source. Default: outgoing."),
5922
+ relationType: z13.string().max(200).optional().describe(
5910
5923
  "Relation type filter. For 'chain': optional filter to traverse only this relation type. For 'cross-cut': required \u2014 scans all relations of this type across the workspace. Examples: 'part_of', 'informs', 'governs', 'blocks', 'depends_on'."
5911
5924
  ),
5912
- mode: z12.enum(["search", "graph"]).default("search").optional().describe("For gather: 'search' (default) or 'graph' (enhanced with provenance paths). Ignored when mapEntryId is provided."),
5913
- maxHops: z12.number().min(1).max(4).default(2).describe("Relation traversal depth (1=direct only, 2=default, 3=wide net, 4=deep chain walk)"),
5914
- maxResults: z12.number().min(1).max(25).default(10).optional().describe("Max entries to return in gather task mode (default 10)"),
5915
- strategy: z12.enum(["hybrid", "keyword"]).default("keyword").optional().describe("Seed strategy for task-based gather: 'keyword' (FTS only, default) or 'hybrid' (vector + FTS). Only affects task mode."),
5916
- skill: z12.string().max(200).optional().describe(
5925
+ mode: z13.enum(["search", "graph"]).default("search").optional().describe("For gather: 'search' (default) or 'graph' (enhanced with provenance paths). Ignored when mapEntryId is provided."),
5926
+ maxHops: z13.number().min(1).max(4).default(2).describe("Relation traversal depth (1=direct only, 2=default, 3=wide net, 4=deep chain walk)"),
5927
+ maxResults: z13.number().min(1).max(25).default(10).optional().describe("Max entries to return in gather task mode (default 10)"),
5928
+ strategy: z13.enum(["hybrid", "keyword"]).default("keyword").optional().describe("Seed strategy for task-based gather: 'keyword' (FTS only, default) or 'hybrid' (vector + FTS). Only affects task mode."),
5929
+ skill: z13.string().max(200).optional().describe(
5917
5930
  "Skill name for 'incremental' action \u2014 identifies which skill's brief history to compare against. Examples: 'preflight', 'shaping', 'review'. Required when action is 'incremental'."
5918
5931
  ),
5919
- briefType: z12.enum(["steering", "confidence", "delta"]).optional().describe(
5932
+ briefType: z13.enum(["steering", "confidence", "delta"]).optional().describe(
5920
5933
  "Compound query type for 'brief' action. 'steering': 7d changes + structural aggregation (part_of, depends_on, constrains) + incremental delta + workspace readiness. 'confidence': 7d changes + active bets summary + active tensions breakdown. 'delta': changes + relations since a custom timestamp (use 'since' param). Required when action is 'brief'."
5921
5934
  ),
5922
- templateId: z12.string().max(200).optional().describe(
5935
+ templateId: z13.string().max(200).optional().describe(
5923
5936
  "For 'last-verified-brief': brief template identifier \u2014 currently 'steering-brief' is the only registered template."
5924
5937
  ),
5925
- scopeKey: z12.string().max(200).optional().describe(
5938
+ scopeKey: z13.string().max(200).optional().describe(
5926
5939
  "For 'last-verified-brief': canonical scope key \u2014 'workspace:<workspaceId>' or 'initiative:<INI-ID>'."
5927
5940
  )
5928
5941
  });
5929
- var contextGatherVariant = z12.object({
5930
- action: z12.literal("gather"),
5931
- entryId: z12.string().max(200).optional(),
5932
- mapEntryId: z12.string().max(200).optional(),
5933
- task: z12.string().max(2e3).optional(),
5934
- mode: z12.enum(["search", "graph"]).optional().default("search"),
5935
- maxHops: z12.number().min(1).max(4).optional().default(2),
5936
- maxResults: z12.number().min(1).max(25).optional().default(10),
5937
- strategy: z12.enum(["hybrid", "keyword"]).optional().default("keyword")
5942
+ var contextGatherVariant = z13.object({
5943
+ action: z13.literal("gather"),
5944
+ entryId: z13.string().max(200).optional(),
5945
+ mapEntryId: z13.string().max(200).optional(),
5946
+ task: z13.string().max(2e3).optional(),
5947
+ mode: z13.enum(["search", "graph"]).optional().default("search"),
5948
+ maxHops: z13.number().min(1).max(4).optional().default(2),
5949
+ maxResults: z13.number().min(1).max(25).optional().default(10),
5950
+ strategy: z13.enum(["hybrid", "keyword"]).optional().default("keyword")
5938
5951
  });
5939
- var contextBuildVariant = z12.object({
5940
- action: z12.literal("build"),
5941
- entryId: z12.string().max(200),
5942
- maxHops: z12.number().min(1).max(4).optional().default(2)
5952
+ var contextBuildVariant = z13.object({
5953
+ action: z13.literal("build"),
5954
+ entryId: z13.string().max(200),
5955
+ maxHops: z13.number().min(1).max(4).optional().default(2)
5943
5956
  });
5944
- var contextNeighborhoodVariant = z12.object({
5945
- action: z12.literal("neighborhood"),
5946
- entryId: z12.string().max(200)
5957
+ var contextNeighborhoodVariant = z13.object({
5958
+ action: z13.literal("neighborhood"),
5959
+ entryId: z13.string().max(200)
5947
5960
  });
5948
- var contextChangesVariant = z12.object({
5949
- action: z12.literal("changes"),
5950
- since: z12.string().max(200)
5961
+ var contextChangesVariant = z13.object({
5962
+ action: z13.literal("changes"),
5963
+ since: z13.string().max(200)
5951
5964
  });
5952
- var contextChainVariant = z12.object({
5953
- action: z12.literal("chain"),
5954
- entryId: z12.string().max(200),
5955
- direction: z12.enum(["outgoing", "incoming"]).optional().default("outgoing"),
5956
- maxHops: z12.number().min(1).max(4).optional().default(2),
5957
- relationType: z12.string().max(200).optional()
5965
+ var contextChainVariant = z13.object({
5966
+ action: z13.literal("chain"),
5967
+ entryId: z13.string().max(200),
5968
+ direction: z13.enum(["outgoing", "incoming"]).optional().default("outgoing"),
5969
+ maxHops: z13.number().min(1).max(4).optional().default(2),
5970
+ relationType: z13.string().max(200).optional()
5958
5971
  });
5959
- var contextCrossCutVariant = z12.object({
5960
- action: z12.literal("cross-cut"),
5961
- relationType: z12.string().max(200)
5972
+ var contextCrossCutVariant = z13.object({
5973
+ action: z13.literal("cross-cut"),
5974
+ relationType: z13.string().max(200)
5962
5975
  });
5963
- var contextIncrementalVariant = z12.object({
5964
- action: z12.literal("incremental"),
5965
- skill: z12.string().max(200)
5976
+ var contextIncrementalVariant = z13.object({
5977
+ action: z13.literal("incremental"),
5978
+ skill: z13.string().max(200)
5966
5979
  });
5967
- var contextBriefVariant = z12.object({
5968
- action: z12.literal("brief"),
5969
- briefType: z12.enum(["steering", "confidence", "delta"]),
5970
- since: z12.string().max(200).optional()
5980
+ var contextBriefVariant = z13.object({
5981
+ action: z13.literal("brief"),
5982
+ briefType: z13.enum(["steering", "confidence", "delta"]),
5983
+ since: z13.string().max(200).optional()
5971
5984
  });
5972
- var contextLastVerifiedBriefVariant = z12.object({
5973
- action: z12.literal("last-verified-brief"),
5974
- templateId: z12.string().max(200),
5975
- scopeKey: z12.string().max(200)
5985
+ var contextLastVerifiedBriefVariant = z13.object({
5986
+ action: z13.literal("last-verified-brief"),
5987
+ templateId: z13.string().max(200),
5988
+ scopeKey: z13.string().max(200)
5976
5989
  });
5977
- var contextActionUnion = z12.discriminatedUnion("action", [
5990
+ var contextActionUnion = z13.discriminatedUnion("action", [
5978
5991
  contextGatherVariant,
5979
5992
  contextBuildVariant,
5980
5993
  contextNeighborhoodVariant,
@@ -7015,20 +7028,20 @@ function formatTimeAgo(ms) {
7015
7028
  }
7016
7029
 
7017
7030
  // src/tools/collections.ts
7018
- import { z as z14 } from "zod/v3";
7031
+ import { z as z15 } from "zod/v3";
7019
7032
 
7020
7033
  // src/tools/labels.ts
7021
- import { z as z13 } from "zod/v3";
7022
- var labelsSchema = z13.object({
7023
- action: z13.enum(["list", "create", "update", "delete", "apply", "remove"]).describe("Action: list all labels, create/update/delete a label, or apply/remove a label on an entry"),
7024
- slug: z13.string().max(200).optional().describe("Label slug (required for create/update/delete/apply/remove)"),
7025
- name: z13.string().max(500).optional().describe("Display name (required for create)"),
7026
- color: z13.string().max(50).optional().describe("Hex color, e.g. '#ef4444'"),
7027
- description: z13.string().max(2e3).optional().describe("What this label means"),
7028
- parentSlug: z13.string().max(200).optional().describe("Parent group slug for label hierarchy"),
7029
- isGroup: z13.boolean().optional().describe("True if this is a group container, not a taggable label"),
7030
- order: z13.number().optional().describe("Sort order within its group"),
7031
- entryId: z13.string().max(200).optional().describe("Entry ID for apply/remove actions")
7034
+ import { z as z14 } from "zod/v3";
7035
+ var labelsSchema = z14.object({
7036
+ action: z14.enum(["list", "create", "update", "delete", "apply", "remove"]).describe("Action: list all labels, create/update/delete a label, or apply/remove a label on an entry"),
7037
+ slug: z14.string().max(200).optional().describe("Label slug (required for create/update/delete/apply/remove)"),
7038
+ name: z14.string().max(500).optional().describe("Display name (required for create)"),
7039
+ color: z14.string().max(50).optional().describe("Hex color, e.g. '#ef4444'"),
7040
+ description: z14.string().max(2e3).optional().describe("What this label means"),
7041
+ parentSlug: z14.string().max(200).optional().describe("Parent group slug for label hierarchy"),
7042
+ isGroup: z14.boolean().optional().describe("True if this is a group container, not a taggable label"),
7043
+ order: z14.number().optional().describe("Sort order within its group"),
7044
+ entryId: z14.string().max(200).optional().describe("Entry ID for apply/remove actions")
7032
7045
  });
7033
7046
  async function handleLabelsList() {
7034
7047
  const labels = await kernelQuery("chain.listLabels");
@@ -7133,128 +7146,128 @@ var COLLECTIONS_ACTIONS = [
7133
7146
  "label-apply",
7134
7147
  "label-remove"
7135
7148
  ];
7136
- var qualityCriterionSchema = z14.object({
7137
- field: z14.string().max(200).describe("Entry data field key this criterion applies to, e.g. 'description', 'owner'"),
7149
+ var qualityCriterionSchema = z15.object({
7150
+ field: z15.string().max(200).describe("Entry data field key this criterion applies to, e.g. 'description', 'owner'"),
7138
7151
  // WP-480 S1: `max_length` — must mirror the Convex rule union, or the tool rejects a
7139
7152
  // valid criterion before the request ever reaches the server.
7140
- rule: z14.enum(["required", "min_length", "max_length", "pattern"]).describe("'required': field must be non-empty (blocks accept). 'min_length': minimum string length (warns). 'max_length': maximum string length (warns). 'pattern': regex match (warns)."),
7141
- value: z14.string().max(500).optional().describe("For min_length/max_length: the length bound as a string integer. For pattern: the regex string. Unused for 'required'.")
7153
+ rule: z15.enum(["required", "min_length", "max_length", "pattern"]).describe("'required': field must be non-empty (blocks accept). 'min_length': minimum string length (warns). 'max_length': maximum string length (warns). 'pattern': regex match (warns)."),
7154
+ value: z15.string().max(500).optional().describe("For min_length/max_length: the length bound as a string integer. For pattern: the regex string. Unused for 'required'.")
7142
7155
  });
7143
- var fieldSchema = z14.object({
7144
- key: z14.string().max(200).describe("Field key, e.g. 'description', 'severity', 'status'"),
7145
- label: z14.string().max(200).describe("Display label, e.g. 'Description', 'Severity'"),
7146
- type: z14.string().max(50).describe("Field type: 'string', 'select', 'array', 'number', 'boolean'"),
7147
- required: z14.boolean().optional().describe("Whether this field is required"),
7148
- options: z14.array(z14.string().max(200)).max(200).optional().describe("Options for 'select' type fields"),
7149
- searchable: z14.boolean().optional().describe("Whether this field is included in full-text search"),
7150
- displayHint: z14.enum(["hero", "badge", "meta", "section", "hidden", "inline-meta"]).optional().describe("V2 rendering hint: how the field should be displayed in Cortex"),
7151
- zone: z14.enum(["header", "body", "meta"]).optional().describe("V2 layout zone: where the field appears in the entry view"),
7152
- colorMap: z14.record(z14.string().max(50)).optional().describe("V2 value-to-semantic-color mapping, e.g. { critical: 'danger', low: 'success' }"),
7156
+ var fieldSchema = z15.object({
7157
+ key: z15.string().max(200).describe("Field key, e.g. 'description', 'severity', 'status'"),
7158
+ label: z15.string().max(200).describe("Display label, e.g. 'Description', 'Severity'"),
7159
+ type: z15.string().max(50).describe("Field type: 'string', 'select', 'array', 'number', 'boolean'"),
7160
+ required: z15.boolean().optional().describe("Whether this field is required"),
7161
+ options: z15.array(z15.string().max(200)).max(200).optional().describe("Options for 'select' type fields"),
7162
+ searchable: z15.boolean().optional().describe("Whether this field is included in full-text search"),
7163
+ displayHint: z15.enum(["hero", "badge", "meta", "section", "hidden", "inline-meta"]).optional().describe("V2 rendering hint: how the field should be displayed in Cortex"),
7164
+ zone: z15.enum(["header", "body", "meta"]).optional().describe("V2 layout zone: where the field appears in the entry view"),
7165
+ colorMap: z15.record(z15.string().max(50)).optional().describe("V2 value-to-semantic-color mapping, e.g. { critical: 'danger', low: 'success' }"),
7153
7166
  // ENT-61
7154
- accentSource: z14.boolean().optional().describe("When true, this field's colorMap value drives the card-level accent styling"),
7167
+ accentSource: z15.boolean().optional().describe("When true, this field's colorMap value drives the card-level accent styling"),
7155
7168
  // ENT-61
7156
- iconMap: z14.record(z14.string(), z14.string().max(50)).optional().describe("Maps field values to icons (emoji/symbol), prepended to badge text"),
7157
- helpText: z14.string().max(2e3).optional().describe("Help text shown in editors and describe output"),
7158
- optionDescriptions: z14.record(z14.string().max(500)).optional().describe("Per-option guidance for select fields"),
7169
+ iconMap: z15.record(z15.string(), z15.string().max(50)).optional().describe("Maps field values to icons (emoji/symbol), prepended to badge text"),
7170
+ helpText: z15.string().max(2e3).optional().describe("Help text shown in editors and describe output"),
7171
+ optionDescriptions: z15.record(z15.string().max(500)).optional().describe("Per-option guidance for select fields"),
7159
7172
  // BET-136
7160
- semanticRole: z14.enum(["problem", "appetite", "elements", "architecture", "done_when", "risks", "exclusions"]).optional().describe("Semantic role for schema-driven consumers \u2014 enables field-key-independent validation and rendering"),
7173
+ semanticRole: z15.enum(["problem", "appetite", "elements", "architecture", "done_when", "risks", "exclusions"]).optional().describe("Semantic role for schema-driven consumers \u2014 enables field-key-independent validation and rendering"),
7161
7174
  // BET-196
7162
- maxLength: z14.number().optional().describe("Maximum character length for field values. Three-tier resolution: explicit > displayHint > type fallback."),
7175
+ maxLength: z15.number().optional().describe("Maximum character length for field values. Three-tier resolution: explicit > displayHint > type fallback."),
7163
7176
  // BET-196
7164
- minLength: z14.number().optional().describe("Minimum character length for field values. Only explicit \u2014 no defaults.")
7177
+ minLength: z15.number().optional().describe("Minimum character length for field values. Only explicit \u2014 no defaults.")
7165
7178
  });
7166
- var collectionsSchema = z14.object({
7167
- action: z14.enum(COLLECTIONS_ACTIONS).describe(
7179
+ var collectionsSchema = z15.object({
7180
+ action: z15.enum(COLLECTIONS_ACTIONS).describe(
7168
7181
  "'list': browse all collections. 'create': create a new collection. 'update': update an existing collection. 'describe': full documentation for one collection \u2014 fields, option guides, usage guidance, examples. 'audit': health report for all collections \u2014 missing classification, icon, displayHint coverage, and field schema gaps. 'export': full system_collection_definitions export with classification metadata (thinkingLayer, classificationPriority, classificationCheck, classificationSignals, governanceRole, governanceFunction, timelineRole, canBeElementOf, descriptionFieldKey). Admin only. 'label-list'/'label-create'/'label-update'/'label-delete'/'label-apply'/'label-remove': manage workspace labels (absorbs the `labels` tool)."
7169
7182
  ),
7170
- slug: z14.string().max(200).optional().describe("URL-safe identifier for create/update, e.g. 'glossary', 'tech-debt'. For label-*: label slug."),
7171
- name: z14.string().max(500).optional().describe("Display name for create, or new name for update. For label-create: label display name."),
7172
- description: z14.string().max(2e4).optional().describe("What this collection is for. For label-create/label-update: what the label means."),
7173
- purpose: z14.string().max(2e3).optional().describe("Why this collection exists \u2014 strategic reason"),
7174
- icon: z14.string().max(50).optional().describe("Emoji icon for the collection"),
7175
- navGroup: z14.enum(["daily", "strategic", "governance", "reference", "collections"]).optional().describe("Sidebar placement: 'daily', 'strategic', 'governance', 'reference', 'collections'"),
7176
- fields: z14.array(fieldSchema).max(200).optional().describe("Field definitions for create, or replacement schema for update (replaces all fields)"),
7183
+ slug: z15.string().max(200).optional().describe("URL-safe identifier for create/update, e.g. 'glossary', 'tech-debt'. For label-*: label slug."),
7184
+ name: z15.string().max(500).optional().describe("Display name for create, or new name for update. For label-create: label display name."),
7185
+ description: z15.string().max(2e4).optional().describe("What this collection is for. For label-create/label-update: what the label means."),
7186
+ purpose: z15.string().max(2e3).optional().describe("Why this collection exists \u2014 strategic reason"),
7187
+ icon: z15.string().max(50).optional().describe("Emoji icon for the collection"),
7188
+ navGroup: z15.enum(["daily", "strategic", "governance", "reference", "collections"]).optional().describe("Sidebar placement: 'daily', 'strategic', 'governance', 'reference', 'collections'"),
7189
+ fields: z15.array(fieldSchema).max(200).optional().describe("Field definitions for create, or replacement schema for update (replaces all fields)"),
7177
7190
  // ENT-62
7178
- defaultCanonicalKey: z14.string().max(200).optional().describe("The canonical_key entries in this collection default to (e.g. 'decision', 'insight'). Consumers read from collection doc; code map is fallback."),
7191
+ defaultCanonicalKey: z15.string().max(200).optional().describe("The canonical_key entries in this collection default to (e.g. 'decision', 'insight'). Consumers read from collection doc; code map is fallback."),
7179
7192
  // ENT-67
7180
- defaultWorkflowStatus: z14.string().max(200).optional().describe("Default workflowStatus for new entries. Must be in validWorkflowStatuses when set (e.g. 'hypothesis' for insights)."),
7193
+ defaultWorkflowStatus: z15.string().max(200).optional().describe("Default workflowStatus for new entries. Must be in validWorkflowStatuses when set (e.g. 'hypothesis' for insights)."),
7181
7194
  // ENT-65
7182
- validWorkflowStatuses: z14.array(z14.string().max(200)).max(50).optional().describe("The allowed workflowStatus values for entries in this collection. New entries are validated against this list. Empty array means no constraint."),
7195
+ validWorkflowStatuses: z15.array(z15.string().max(200)).max(50).optional().describe("The allowed workflowStatus values for entries in this collection. New entries are validated against this list. Empty array means no constraint."),
7183
7196
  // ENT-65, FEAT-200
7184
- classificationCheck: z14.string().max(500).optional().describe("LLM decision-tree check for this collection (3\u2013500 chars). Guides the classifier in routing entries here."),
7197
+ classificationCheck: z15.string().max(500).optional().describe("LLM decision-tree check for this collection (3\u2013500 chars). Guides the classifier in routing entries here."),
7185
7198
  // ENT-65, FEAT-200
7186
- classificationPriority: z14.number().optional().describe("Classifier priority (1\u20139, lower = higher priority). Used with classificationCheck to order the decision tree."),
7199
+ classificationPriority: z15.number().optional().describe("Classifier priority (1\u20139, lower = higher priority). Used with classificationCheck to order the decision tree."),
7187
7200
  // FEAT-301 Slice 2: quality gate criteria and usage guidance.
7188
7201
  // FEAT-257
7189
- qualityCriteria: z14.array(qualityCriterionSchema).max(50).optional().describe("Per-collection accept gate rules. 'required' rule hard-blocks accepts on empty fields; 'min_length'/'pattern' rules warn. Pass an empty array to clear all criteria."),
7190
- usageGuidance: z14.string().max(2e4).optional().describe("Plain-text guidance shown to agents and users: when to use this collection, when not to, and what makes a good entry."),
7202
+ qualityCriteria: z15.array(qualityCriterionSchema).max(50).optional().describe("Per-collection accept gate rules. 'required' rule hard-blocks accepts on empty fields; 'min_length'/'pattern' rules warn. Pass an empty array to clear all criteria."),
7203
+ usageGuidance: z15.string().max(2e4).optional().describe("Plain-text guidance shown to agents and users: when to use this collection, when not to, and what makes a good entry."),
7191
7204
  // For label-*
7192
- color: z14.string().max(50).optional().describe("For label-create/label-update: hex color, e.g. '#ef4444'."),
7193
- parentSlug: z14.string().max(200).optional().describe("For label-create: parent group slug for label hierarchy."),
7194
- isGroup: z14.boolean().optional().describe("For label-create/label-update: true if this is a group container, not a taggable label."),
7195
- order: z14.number().optional().describe("For label-create/label-update: sort order within its group."),
7196
- entryId: z14.string().max(200).optional().describe("For label-apply/label-remove: entry ID.")
7205
+ color: z15.string().max(50).optional().describe("For label-create/label-update: hex color, e.g. '#ef4444'."),
7206
+ parentSlug: z15.string().max(200).optional().describe("For label-create: parent group slug for label hierarchy."),
7207
+ isGroup: z15.boolean().optional().describe("For label-create/label-update: true if this is a group container, not a taggable label."),
7208
+ order: z15.number().optional().describe("For label-create/label-update: sort order within its group."),
7209
+ entryId: z15.string().max(200).optional().describe("For label-apply/label-remove: entry ID.")
7197
7210
  });
7198
- var collectionsListVariant = z14.object({ action: z14.literal("list") });
7199
- var collectionsDescribeVariant = z14.object({ action: z14.literal("describe"), slug: z14.string().max(200) });
7200
- var collectionsCreateVariant = z14.object({
7201
- action: z14.literal("create"),
7202
- slug: z14.string().max(200),
7203
- name: z14.string().max(500),
7204
- description: z14.string().max(2e4).optional(),
7205
- purpose: z14.string().max(2e3).optional(),
7206
- icon: z14.string().max(50).optional(),
7207
- navGroup: z14.enum(["daily", "strategic", "governance", "reference", "collections"]).optional(),
7208
- fields: z14.array(fieldSchema).min(1),
7209
- defaultCanonicalKey: z14.string().max(200).optional(),
7210
- defaultWorkflowStatus: z14.string().max(200).optional(),
7211
- validWorkflowStatuses: z14.array(z14.string().max(200)).optional(),
7212
- classificationCheck: z14.string().max(500).optional(),
7213
- classificationPriority: z14.number().optional()
7211
+ var collectionsListVariant = z15.object({ action: z15.literal("list") });
7212
+ var collectionsDescribeVariant = z15.object({ action: z15.literal("describe"), slug: z15.string().max(200) });
7213
+ var collectionsCreateVariant = z15.object({
7214
+ action: z15.literal("create"),
7215
+ slug: z15.string().max(200),
7216
+ name: z15.string().max(500),
7217
+ description: z15.string().max(2e4).optional(),
7218
+ purpose: z15.string().max(2e3).optional(),
7219
+ icon: z15.string().max(50).optional(),
7220
+ navGroup: z15.enum(["daily", "strategic", "governance", "reference", "collections"]).optional(),
7221
+ fields: z15.array(fieldSchema).min(1),
7222
+ defaultCanonicalKey: z15.string().max(200).optional(),
7223
+ defaultWorkflowStatus: z15.string().max(200).optional(),
7224
+ validWorkflowStatuses: z15.array(z15.string().max(200)).optional(),
7225
+ classificationCheck: z15.string().max(500).optional(),
7226
+ classificationPriority: z15.number().optional()
7214
7227
  });
7215
- var collectionsUpdateVariant = z14.object({
7216
- action: z14.literal("update"),
7217
- slug: z14.string().max(200),
7218
- name: z14.string().max(500).optional(),
7219
- description: z14.string().max(2e4).optional(),
7220
- purpose: z14.string().max(2e3).optional(),
7221
- icon: z14.string().max(50).optional(),
7222
- navGroup: z14.enum(["daily", "strategic", "governance", "reference", "collections"]).optional(),
7223
- fields: z14.array(fieldSchema).optional(),
7224
- defaultCanonicalKey: z14.string().max(200).optional(),
7225
- defaultWorkflowStatus: z14.string().max(200).optional(),
7226
- validWorkflowStatuses: z14.array(z14.string().max(200)).optional(),
7227
- classificationCheck: z14.string().max(500).optional(),
7228
- classificationPriority: z14.number().optional(),
7229
- qualityCriteria: z14.array(qualityCriterionSchema).optional(),
7230
- usageGuidance: z14.string().max(2e4).optional()
7228
+ var collectionsUpdateVariant = z15.object({
7229
+ action: z15.literal("update"),
7230
+ slug: z15.string().max(200),
7231
+ name: z15.string().max(500).optional(),
7232
+ description: z15.string().max(2e4).optional(),
7233
+ purpose: z15.string().max(2e3).optional(),
7234
+ icon: z15.string().max(50).optional(),
7235
+ navGroup: z15.enum(["daily", "strategic", "governance", "reference", "collections"]).optional(),
7236
+ fields: z15.array(fieldSchema).optional(),
7237
+ defaultCanonicalKey: z15.string().max(200).optional(),
7238
+ defaultWorkflowStatus: z15.string().max(200).optional(),
7239
+ validWorkflowStatuses: z15.array(z15.string().max(200)).optional(),
7240
+ classificationCheck: z15.string().max(500).optional(),
7241
+ classificationPriority: z15.number().optional(),
7242
+ qualityCriteria: z15.array(qualityCriterionSchema).optional(),
7243
+ usageGuidance: z15.string().max(2e4).optional()
7231
7244
  });
7232
- var collectionsAuditVariant = z14.object({ action: z14.literal("audit") });
7233
- var collectionsExportVariant = z14.object({ action: z14.literal("export") });
7234
- var collectionsLabelListVariant = z14.object({ action: z14.literal("label-list") });
7235
- var collectionsLabelCreateVariant = z14.object({
7236
- action: z14.literal("label-create"),
7237
- slug: z14.string().max(200),
7238
- name: z14.string().max(500),
7239
- color: z14.string().max(50).optional(),
7240
- description: z14.string().max(2e3).optional(),
7241
- parentSlug: z14.string().max(200).optional(),
7242
- isGroup: z14.boolean().optional(),
7243
- order: z14.number().optional()
7245
+ var collectionsAuditVariant = z15.object({ action: z15.literal("audit") });
7246
+ var collectionsExportVariant = z15.object({ action: z15.literal("export") });
7247
+ var collectionsLabelListVariant = z15.object({ action: z15.literal("label-list") });
7248
+ var collectionsLabelCreateVariant = z15.object({
7249
+ action: z15.literal("label-create"),
7250
+ slug: z15.string().max(200),
7251
+ name: z15.string().max(500),
7252
+ color: z15.string().max(50).optional(),
7253
+ description: z15.string().max(2e3).optional(),
7254
+ parentSlug: z15.string().max(200).optional(),
7255
+ isGroup: z15.boolean().optional(),
7256
+ order: z15.number().optional()
7244
7257
  });
7245
- var collectionsLabelUpdateVariant = z14.object({
7246
- action: z14.literal("label-update"),
7247
- slug: z14.string().max(200),
7248
- name: z14.string().max(500).optional(),
7249
- color: z14.string().max(50).optional(),
7250
- description: z14.string().max(2e3).optional(),
7251
- isGroup: z14.boolean().optional(),
7252
- order: z14.number().optional()
7258
+ var collectionsLabelUpdateVariant = z15.object({
7259
+ action: z15.literal("label-update"),
7260
+ slug: z15.string().max(200),
7261
+ name: z15.string().max(500).optional(),
7262
+ color: z15.string().max(50).optional(),
7263
+ description: z15.string().max(2e3).optional(),
7264
+ isGroup: z15.boolean().optional(),
7265
+ order: z15.number().optional()
7253
7266
  });
7254
- var collectionsLabelDeleteVariant = z14.object({ action: z14.literal("label-delete"), slug: z14.string().max(200) });
7255
- var collectionsLabelApplyVariant = z14.object({ action: z14.literal("label-apply"), slug: z14.string().max(200), entryId: z14.string().max(200) });
7256
- var collectionsLabelRemoveVariant = z14.object({ action: z14.literal("label-remove"), slug: z14.string().max(200), entryId: z14.string().max(200) });
7257
- var collectionsActionUnion = z14.discriminatedUnion("action", [
7267
+ var collectionsLabelDeleteVariant = z15.object({ action: z15.literal("label-delete"), slug: z15.string().max(200) });
7268
+ var collectionsLabelApplyVariant = z15.object({ action: z15.literal("label-apply"), slug: z15.string().max(200), entryId: z15.string().max(200) });
7269
+ var collectionsLabelRemoveVariant = z15.object({ action: z15.literal("label-remove"), slug: z15.string().max(200), entryId: z15.string().max(200) });
7270
+ var collectionsActionUnion = z15.discriminatedUnion("action", [
7258
7271
  collectionsListVariant,
7259
7272
  collectionsDescribeVariant,
7260
7273
  collectionsCreateVariant,
@@ -7639,7 +7652,7 @@ async function handleExport() {
7639
7652
  }
7640
7653
 
7641
7654
  // src/tools/orient.ts
7642
- import { z as z18 } from "zod/v3";
7655
+ import { z as z19 } from "zod/v3";
7643
7656
 
7644
7657
  // src/tools/planned-work.ts
7645
7658
  function buildPlannedWork(allEntries) {
@@ -8567,12 +8580,12 @@ function replaceVocabTokens(body, workspaceCtx, collectionCtxMap) {
8567
8580
  }
8568
8581
 
8569
8582
  // src/tools/start_pb.ts
8570
- import { z as z16 } from "zod/v3";
8583
+ import { z as z17 } from "zod/v3";
8571
8584
 
8572
8585
  // src/tools/skills.ts
8573
- import { z as z15 } from "zod/v3";
8574
- var skillsSchema = z15.object({
8575
- entryId: z15.string().min(1).describe(
8586
+ import { z as z16 } from "zod/v3";
8587
+ var skillsSchema = z16.object({
8588
+ entryId: z16.string().min(1).describe(
8576
8589
  "Workspace-scoped skill entry id (e.g. 'SKILL-pb-setup'). The tool refuses non-skill entries (canonicalKey !== 'skill') with INVALID_KIND."
8577
8590
  )
8578
8591
  });
@@ -8585,8 +8598,8 @@ async function loadSkillBody(entryId) {
8585
8598
  }
8586
8599
 
8587
8600
  // src/tools/start_pb.ts
8588
- var startPbSchema = z16.object({
8589
- task: z16.string().max(2e3).optional().describe(
8601
+ var startPbSchema = z17.object({
8602
+ task: z17.string().max(2e3).optional().describe(
8590
8603
  "What you're about to work on (e.g. 'implementing auth middleware'). Grounded/connected workspaces: filters governance to show relevant principles, standards, and business rules. Blank/seeded workspaces: ignored (setup flow takes over)."
8591
8604
  )
8592
8605
  // TEN-2431: no `scope` param — start_pb's governance matches orient's scope-BLIND RENDERED
@@ -8945,15 +8958,15 @@ ${FEEDBACK_HINT}` }],
8945
8958
  }
8946
8959
 
8947
8960
  // src/tools/record_activation.ts
8948
- import { z as z17 } from "zod/v3";
8949
- var recordActivationSchema = z17.object({
8950
- confirmedEntryCount: z17.number().int().min(0).describe(
8961
+ import { z as z18 } from "zod/v3";
8962
+ var recordActivationSchema = z18.object({
8963
+ confirmedEntryCount: z18.number().int().min(0).describe(
8951
8964
  "Confirmed-entry count from the Phase 4 capture loop. The mutation enforces >=10."
8952
8965
  ),
8953
- entriesAcrossCollections: z17.number().int().min(0).describe(
8966
+ entriesAcrossCollections: z18.number().int().min(0).describe(
8954
8967
  "Number of distinct collections those entries span. The mutation enforces >=2 (diversity soft-gate)."
8955
8968
  ),
8956
- retrievalDemoConfirmed: z17.boolean().describe(
8969
+ retrievalDemoConfirmed: z18.boolean().describe(
8957
8970
  "True if the retrieval round-trip ran successfully in Phase 4. The mutation rejects false."
8958
8971
  )
8959
8972
  });
@@ -9044,65 +9057,65 @@ async function markOrientedWithSnapshotFallback(agentSessionId, coherenceSnapsho
9044
9057
  }
9045
9058
  }
9046
9059
  var ORIENT_ACTIONS = ["start", "task", "record-activation"];
9047
- var orientSchema = z18.object({
9048
- action: z18.enum(ORIENT_ACTIONS).optional().default("task").describe(
9060
+ var orientSchema = z19.object({
9061
+ action: z19.enum(ORIENT_ACTIONS).optional().default("task").describe(
9049
9062
  "'start': universal session opener (absorbs start_pb) \u2014 stage-aware setup skill or standup briefing. 'task': task-grounded context loader \u2014 the original orient behavior. 'record-activation': chat-only activation receipt writer (absorbs record_activation)."
9050
9063
  ),
9051
- mode: z18.enum(["full", "brief"]).optional().default("full").describe("For 'task': full = full context (default). brief = compact summary for mid-session re-orientation. Prefer using the `tier` param for depth control."),
9052
- tier: z18.enum(["summary", "standard", "full"]).optional().describe(
9064
+ mode: z19.enum(["full", "brief"]).optional().default("full").describe("For 'task': full = full context (default). brief = compact summary for mid-session re-orientation. Prefer using the `tier` param for depth control."),
9065
+ tier: z19.enum(["summary", "standard", "full"]).optional().describe(
9053
9066
  "For 'task': payload depth. Defaults to summary (~10 KB) when task is provided; standard (~256 KB) when task is absent. Pass summary, standard, or full to override."
9054
9067
  ),
9055
- task: z18.string().max(2e3).optional().describe(
9068
+ task: z19.string().max(2e3).optional().describe(
9056
9069
  "For 'task': natural-language task description for task-scoped context. For 'start': what you're about to work on. When provided to 'task', orient returns scored, relevant entries for the task."
9057
9070
  ),
9058
- scope: z18.string().max(200).optional().describe("For 'task': optional domain scope to filter governance to entries relevant for this domain. Forwarded to Convex for workspace-specific validation."),
9071
+ scope: z19.string().max(200).optional().describe("For 'task': optional domain scope to filter governance to entries relevant for this domain. Forwarded to Convex for workspace-specific validation."),
9059
9072
  // WP-486 Slice 1 (FEAT-1371, TEN-2724): the startup-signal envelope `resolveStartupDomain` already
9060
9073
  // consumes (`startupResolver.ts:344-379`) but this tool never sent. Nested to match the server's
9061
9074
  // `StartupResolutionSignals` shape exactly — every field optional, sanitized server-side.
9062
- startupSignals: z18.object({
9063
- changedPaths: z18.array(z18.string()).max(25).optional().describe("Paths changed in the current working tree, if known (e.g. from a prior git status/diff tool call)."),
9064
- reviewedArtifactRefs: z18.array(z18.string()).max(25).optional().describe("Chain entry IDs the caller has already reviewed this session, if tracked."),
9065
- branchName: z18.string().max(120).optional().describe("Current git branch name, if known."),
9066
- worktreeName: z18.string().max(120).optional().describe("Current worktree/directory name, if known.")
9075
+ startupSignals: z19.object({
9076
+ changedPaths: z19.array(z19.string()).max(25).optional().describe("Paths changed in the current working tree, if known (e.g. from a prior git status/diff tool call)."),
9077
+ reviewedArtifactRefs: z19.array(z19.string()).max(25).optional().describe("Chain entry IDs the caller has already reviewed this session, if tracked."),
9078
+ branchName: z19.string().max(120).optional().describe("Current git branch name, if known."),
9079
+ worktreeName: z19.string().max(120).optional().describe("Current worktree/directory name, if known.")
9067
9080
  }).optional().describe("For 'task': best-effort startup signals for domain resolution \u2014 changedPaths/reviewedArtifactRefs/branchName/worktreeName. All optional; omit fields you don't know."),
9068
- invocationPath: z18.enum(["session-start", "session-close", "manual-orient", "handshake", "unknown"]).optional().describe("For 'task': how this orient was invoked. Defaults to 'manual-orient' (the direct `orient task=...` call shape) when omitted."),
9069
- confirmedEntryCount: z18.number().int().min(0).optional().describe(
9081
+ invocationPath: z19.enum(["session-start", "session-close", "manual-orient", "handshake", "unknown"]).optional().describe("For 'task': how this orient was invoked. Defaults to 'manual-orient' (the direct `orient task=...` call shape) when omitted."),
9082
+ confirmedEntryCount: z19.number().int().min(0).optional().describe(
9070
9083
  "For 'record-activation': confirmed-entry count from the Phase 4 capture loop. The mutation enforces >=10."
9071
9084
  ),
9072
- entriesAcrossCollections: z18.number().int().min(0).optional().describe(
9085
+ entriesAcrossCollections: z19.number().int().min(0).optional().describe(
9073
9086
  "For 'record-activation': number of distinct collections those entries span. The mutation enforces >=2 (diversity soft-gate)."
9074
9087
  ),
9075
- retrievalDemoConfirmed: z18.boolean().optional().describe(
9088
+ retrievalDemoConfirmed: z19.boolean().optional().describe(
9076
9089
  "For 'record-activation': true if the retrieval round-trip ran successfully in Phase 4. The mutation rejects false."
9077
9090
  )
9078
9091
  });
9079
- var orientStartVariant = z18.object({
9080
- action: z18.literal("start"),
9081
- task: z18.string().max(2e3).optional()
9092
+ var orientStartVariant = z19.object({
9093
+ action: z19.literal("start"),
9094
+ task: z19.string().max(2e3).optional()
9082
9095
  });
9083
- var orientTaskVariant = z18.object({
9084
- action: z18.literal("task"),
9085
- mode: z18.enum(["full", "brief"]).optional().default("full"),
9086
- tier: z18.enum(["summary", "standard", "full"]).optional(),
9087
- task: z18.string().max(2e3).optional(),
9088
- scope: z18.string().max(200).optional(),
9096
+ var orientTaskVariant = z19.object({
9097
+ action: z19.literal("task"),
9098
+ mode: z19.enum(["full", "brief"]).optional().default("full"),
9099
+ tier: z19.enum(["summary", "standard", "full"]).optional(),
9100
+ task: z19.string().max(2e3).optional(),
9101
+ scope: z19.string().max(200).optional(),
9089
9102
  // WP-486 Slice 1 (FEAT-1371) — mirrors orientSchema's top-level declaration above; see its
9090
9103
  // doc comment for the shape rationale.
9091
- startupSignals: z18.object({
9092
- changedPaths: z18.array(z18.string()).max(25).optional(),
9093
- reviewedArtifactRefs: z18.array(z18.string()).max(25).optional(),
9094
- branchName: z18.string().max(120).optional(),
9095
- worktreeName: z18.string().max(120).optional()
9104
+ startupSignals: z19.object({
9105
+ changedPaths: z19.array(z19.string()).max(25).optional(),
9106
+ reviewedArtifactRefs: z19.array(z19.string()).max(25).optional(),
9107
+ branchName: z19.string().max(120).optional(),
9108
+ worktreeName: z19.string().max(120).optional()
9096
9109
  }).optional(),
9097
- invocationPath: z18.enum(["session-start", "session-close", "manual-orient", "handshake", "unknown"]).optional()
9110
+ invocationPath: z19.enum(["session-start", "session-close", "manual-orient", "handshake", "unknown"]).optional()
9098
9111
  });
9099
- var orientRecordActivationVariant = z18.object({
9100
- action: z18.literal("record-activation"),
9101
- confirmedEntryCount: z18.number().int().min(0),
9102
- entriesAcrossCollections: z18.number().int().min(0),
9103
- retrievalDemoConfirmed: z18.boolean()
9112
+ var orientRecordActivationVariant = z19.object({
9113
+ action: z19.literal("record-activation"),
9114
+ confirmedEntryCount: z19.number().int().min(0),
9115
+ entriesAcrossCollections: z19.number().int().min(0),
9116
+ retrievalDemoConfirmed: z19.boolean()
9104
9117
  });
9105
- var orientActionUnion = z18.discriminatedUnion("action", [
9118
+ var orientActionUnion = z19.discriminatedUnion("action", [
9106
9119
  orientStartVariant,
9107
9120
  orientTaskVariant,
9108
9121
  orientRecordActivationVariant
@@ -9943,7 +9956,7 @@ async function _handleOrient({ mode = "full", tier, task, scope, startupSignals,
9943
9956
  }
9944
9957
 
9945
9958
  // src/tools/workflows.ts
9946
- import { z as z19 } from "zod/v3";
9959
+ import { z as z20 } from "zod/v3";
9947
9960
 
9948
9961
  // src/workflows/descriptor.ts
9949
9962
  function cloneWorkflowQuestion(question) {
@@ -10783,75 +10796,75 @@ function workflowRunOutputToText(output) {
10783
10796
 
10784
10797
  // src/tools/workflows.ts
10785
10798
  var WORKFLOWS_ACTIONS = ["list", "start", "checkpoint", "get-run", "load-skill"];
10786
- var jsonValueSchema = z19.lazy(
10787
- () => z19.union([
10788
- z19.string(),
10789
- z19.number(),
10790
- z19.boolean(),
10791
- z19.null(),
10792
- z19.array(jsonValueSchema),
10793
- z19.record(jsonValueSchema)
10799
+ var jsonValueSchema = z20.lazy(
10800
+ () => z20.union([
10801
+ z20.string(),
10802
+ z20.number(),
10803
+ z20.boolean(),
10804
+ z20.null(),
10805
+ z20.array(jsonValueSchema),
10806
+ z20.record(jsonValueSchema)
10794
10807
  ])
10795
10808
  );
10796
- var workflowRunOutputInputSchema = z19.union([
10797
- z19.object({
10798
- format: z19.literal("freetext"),
10799
- value: z19.string()
10809
+ var workflowRunOutputInputSchema = z20.union([
10810
+ z20.object({
10811
+ format: z20.literal("freetext"),
10812
+ value: z20.string()
10800
10813
  }),
10801
- z19.object({
10802
- format: z19.literal("list"),
10803
- value: z19.array(z19.string())
10814
+ z20.object({
10815
+ format: z20.literal("list"),
10816
+ value: z20.array(z20.string())
10804
10817
  }),
10805
- z19.object({
10806
- format: z19.literal("choice"),
10807
- value: z19.union([z19.string(), z19.array(z19.string())])
10818
+ z20.object({
10819
+ format: z20.literal("choice"),
10820
+ value: z20.union([z20.string(), z20.array(z20.string())])
10808
10821
  }),
10809
- z19.object({
10810
- format: z19.literal("structured"),
10822
+ z20.object({
10823
+ format: z20.literal("structured"),
10811
10824
  value: jsonValueSchema
10812
10825
  })
10813
10826
  ]);
10814
- var workflowsSchema = z19.object({
10815
- action: z19.enum(WORKFLOWS_ACTIONS).describe(
10827
+ var workflowsSchema = z20.object({
10828
+ action: z20.enum(WORKFLOWS_ACTIONS).describe(
10816
10829
  "'list': browse available workflows. 'start': start or resume a workflow \u2014 returns first (or current) round and next-step checkpoint call. 'checkpoint': record round output or final summary. 'get-run': inspect a persisted workflow run. 'load-skill': load the markdown body of a SKILL-* entry from the workspace (absorbs the `skills` tool). Requires entryId."
10817
10830
  ),
10818
- workflowId: z19.string().max(200).optional().describe("Workflow ID for start, checkpoint, or get-run, e.g. 'retro', 'implementation-review'"),
10819
- runId: z19.string().max(200).optional().describe("Workflow run ID: for get-run, which run to load; for checkpoint, target this run (avoids session drift \u2014 pass runId from get-run)."),
10820
- roundId: z19.string().max(200).optional().describe("Round ID for checkpoint, e.g. 'what-went-well'"),
10821
- output: z19.union([z19.string(), workflowRunOutputInputSchema]).optional().describe("The round's output \u2014 either legacy synthesized text or a typed workflow run payload."),
10822
- isFinal: z19.boolean().optional().describe("If true, finalize an existing durable workflow run from its terminal round and create the summary chain entry."),
10823
- restart: z19.boolean().optional().describe("If true, start a new durable run from the workflow's first round in the current session."),
10824
- summaryName: z19.string().max(500).optional().describe("Optional name for final chain entry. If omitted, the workflow summary template is used."),
10825
- summaryDescription: z19.string().max(2e4).optional().describe("Optional override for the final chain entry description. Defaults to the final round output text."),
10826
- summaryEntryId: z19.string().max(200).optional().describe("Link an existing entry as the run's summary instead of creating one. Used by facilitated workflows (e.g. shape) where the primary record is created by the specialized tool."),
10827
- entryId: z19.string().max(200).optional().describe("For 'load-skill': workspace-scoped skill entry id (e.g. 'SKILL-pb-setup'). Refuses non-skill entries (canonicalKey !== 'skill') with INVALID_KIND."),
10831
+ workflowId: z20.string().max(200).optional().describe("Workflow ID for start, checkpoint, or get-run, e.g. 'retro', 'implementation-review'"),
10832
+ runId: z20.string().max(200).optional().describe("Workflow run ID: for get-run, which run to load; for checkpoint, target this run (avoids session drift \u2014 pass runId from get-run)."),
10833
+ roundId: z20.string().max(200).optional().describe("Round ID for checkpoint, e.g. 'what-went-well'"),
10834
+ output: z20.union([z20.string(), workflowRunOutputInputSchema]).optional().describe("The round's output \u2014 either legacy synthesized text or a typed workflow run payload."),
10835
+ isFinal: z20.boolean().optional().describe("If true, finalize an existing durable workflow run from its terminal round and create the summary chain entry."),
10836
+ restart: z20.boolean().optional().describe("If true, start a new durable run from the workflow's first round in the current session."),
10837
+ summaryName: z20.string().max(500).optional().describe("Optional name for final chain entry. If omitted, the workflow summary template is used."),
10838
+ summaryDescription: z20.string().max(2e4).optional().describe("Optional override for the final chain entry description. Defaults to the final round output text."),
10839
+ summaryEntryId: z20.string().max(200).optional().describe("Link an existing entry as the run's summary instead of creating one. Used by facilitated workflows (e.g. shape) where the primary record is created by the specialized tool."),
10840
+ entryId: z20.string().max(200).optional().describe("For 'load-skill': workspace-scoped skill entry id (e.g. 'SKILL-pb-setup'). Refuses non-skill entries (canonicalKey !== 'skill') with INVALID_KIND."),
10828
10841
  // WP-513: team+role to create the finalize summary AS OWNER of (rung 2 only).
10829
- ownerTeamEntryId: z19.string().max(200).optional().describe("For 'checkpoint' (isFinal): owning team (rung-2)."),
10830
- ownerRoleEntryId: z19.string().max(200).optional().describe("For 'checkpoint' (isFinal): owning role (rung-2).")
10842
+ ownerTeamEntryId: z20.string().max(200).optional().describe("For 'checkpoint' (isFinal): owning team (rung-2)."),
10843
+ ownerRoleEntryId: z20.string().max(200).optional().describe("For 'checkpoint' (isFinal): owning role (rung-2).")
10831
10844
  });
10832
- var workflowsListVariant = z19.object({ action: z19.literal("list") });
10833
- var workflowsGetRunVariant = z19.object({
10834
- action: z19.literal("get-run"),
10835
- runId: z19.string().max(200).optional(),
10836
- workflowId: z19.string().max(200).optional()
10845
+ var workflowsListVariant = z20.object({ action: z20.literal("list") });
10846
+ var workflowsGetRunVariant = z20.object({
10847
+ action: z20.literal("get-run"),
10848
+ runId: z20.string().max(200).optional(),
10849
+ workflowId: z20.string().max(200).optional()
10837
10850
  });
10838
- var workflowsStartVariant = z19.object({ action: z19.literal("start"), workflowId: z19.string().max(200) });
10839
- var workflowsCheckpointVariant = z19.object({
10840
- action: z19.literal("checkpoint"),
10841
- workflowId: z19.string().max(200),
10842
- roundId: z19.string().max(200),
10843
- output: z19.union([z19.string(), workflowRunOutputInputSchema]),
10844
- isFinal: z19.boolean().optional(),
10845
- restart: z19.boolean().optional(),
10846
- summaryName: z19.string().max(500).optional(),
10847
- summaryDescription: z19.string().max(2e4).optional(),
10848
- summaryEntryId: z19.string().max(200).optional(),
10849
- runId: z19.string().max(200).optional(),
10850
- ownerTeamEntryId: z19.string().max(200).optional(),
10851
- ownerRoleEntryId: z19.string().max(200).optional()
10851
+ var workflowsStartVariant = z20.object({ action: z20.literal("start"), workflowId: z20.string().max(200) });
10852
+ var workflowsCheckpointVariant = z20.object({
10853
+ action: z20.literal("checkpoint"),
10854
+ workflowId: z20.string().max(200),
10855
+ roundId: z20.string().max(200),
10856
+ output: z20.union([z20.string(), workflowRunOutputInputSchema]),
10857
+ isFinal: z20.boolean().optional(),
10858
+ restart: z20.boolean().optional(),
10859
+ summaryName: z20.string().max(500).optional(),
10860
+ summaryDescription: z20.string().max(2e4).optional(),
10861
+ summaryEntryId: z20.string().max(200).optional(),
10862
+ runId: z20.string().max(200).optional(),
10863
+ ownerTeamEntryId: z20.string().max(200).optional(),
10864
+ ownerRoleEntryId: z20.string().max(200).optional()
10852
10865
  });
10853
- var workflowsLoadSkillVariant = z19.object({ action: z19.literal("load-skill"), entryId: z19.string().max(200).min(1) });
10854
- var workflowsActionUnion = z19.discriminatedUnion("action", [
10866
+ var workflowsLoadSkillVariant = z20.object({ action: z20.literal("load-skill"), entryId: z20.string().max(200).min(1) });
10867
+ var workflowsActionUnion = z20.discriminatedUnion("action", [
10855
10868
  workflowsListVariant,
10856
10869
  workflowsGetRunVariant,
10857
10870
  workflowsStartVariant,
@@ -11591,10 +11604,10 @@ function parseListOutput(output) {
11591
11604
  }
11592
11605
 
11593
11606
  // src/tools/quality.ts
11594
- import { z as z21 } from "zod/v3";
11607
+ import { z as z22 } from "zod/v3";
11595
11608
 
11596
11609
  // src/tools/audit.ts
11597
- import { z as z20 } from "zod/v3";
11610
+ import { z as z21 } from "zod/v3";
11598
11611
  var VOCAB_TTL_MS = 5 * 60 * 1e3;
11599
11612
  var MAX_VOCAB_KEYS = 100;
11600
11613
  var vocabCache = /* @__PURE__ */ new Map();
@@ -11624,12 +11637,12 @@ function evictVocabIfFull() {
11624
11637
  }
11625
11638
  }
11626
11639
  var AUDIT_ACTIONS = ["run"];
11627
- var auditSchema = z20.object({
11628
- action: z20.enum(AUDIT_ACTIONS).describe(
11640
+ var auditSchema = z21.object({
11641
+ action: z21.enum(AUDIT_ACTIONS).describe(
11629
11642
  "'run': run the hygiene audit for a bet entry."
11630
11643
  ),
11631
- entryId: z20.string().describe("Bet entry ID to audit, e.g. '<PREFIX>-<n>'"),
11632
- phase: z20.enum(["shaping", "handoff"]).default("shaping").optional().describe(
11644
+ entryId: z21.string().describe("Bet entry ID to audit, e.g. '<PREFIX>-<n>'"),
11645
+ phase: z21.enum(["shaping", "handoff"]).default("shaping").optional().describe(
11633
11646
  "'shaping': check shaping-phase fields only. 'handoff': check all required fields including buildContract/buildSequence/exclusions/risks. Default: shaping."
11634
11647
  )
11635
11648
  });
@@ -11745,35 +11758,35 @@ async function handleAuditRun(entryId, phase) {
11745
11758
 
11746
11759
  // src/tools/quality.ts
11747
11760
  var QUALITY_ACTIONS = ["check", "re-evaluate", "verify-chain", "audit"];
11748
- var qualitySchema = z21.object({
11749
- action: z21.enum(QUALITY_ACTIONS).describe(
11761
+ var qualitySchema = z22.object({
11762
+ action: z22.enum(QUALITY_ACTIONS).describe(
11750
11763
  "'check': read the entry's server quality verdict (tier + criteria). 're-evaluate': trigger fresh evaluation. 'verify-chain': verify entries against the codebase (codeMapping drift, cross-references) \u2014 absorbs `verify`. 'audit': hygiene audit for a bet entry \u2014 absorbs `audit`."
11751
11764
  ),
11752
- entryId: z21.string().max(200).optional().describe("For 'check'/'re-evaluate'/'audit': entry ID, e.g. 'TEN-graph-db', '<PREFIX>-<n>'."),
11753
- context: z21.enum(["capture", "commit", "review"]).default("review").optional().describe("For re-evaluate: evaluation context"),
11754
- collection: z21.string().max(200).optional().describe("For 'verify-chain': collection slug to verify (default: glossary)."),
11755
- mode: z21.enum(["report", "fix"]).optional().describe("For 'verify-chain': 'report' = read-only trust report (default). 'fix' = also update drifted codeMapping statuses."),
11756
- phase: z21.enum(["shaping", "handoff"]).optional().describe(
11765
+ entryId: z22.string().max(200).optional().describe("For 'check'/'re-evaluate'/'audit': entry ID, e.g. 'TEN-graph-db', '<PREFIX>-<n>'."),
11766
+ context: z22.enum(["capture", "commit", "review"]).default("review").optional().describe("For re-evaluate: evaluation context"),
11767
+ collection: z22.string().max(200).optional().describe("For 'verify-chain': collection slug to verify (default: glossary)."),
11768
+ mode: z22.enum(["report", "fix"]).optional().describe("For 'verify-chain': 'report' = read-only trust report (default). 'fix' = also update drifted codeMapping statuses."),
11769
+ phase: z22.enum(["shaping", "handoff"]).optional().describe(
11757
11770
  "For 'audit': 'shaping' checks shaping-phase fields only (default). 'handoff' checks all required fields including buildContract/buildSequence/exclusions/risks."
11758
11771
  )
11759
11772
  });
11760
- var qualityCheckVariant = z21.object({ action: z21.literal("check"), entryId: z21.string().max(200) });
11761
- var qualityReEvaluateVariant = z21.object({
11762
- action: z21.literal("re-evaluate"),
11763
- entryId: z21.string().max(200),
11764
- context: z21.enum(["capture", "commit", "review"]).optional().default("review")
11773
+ var qualityCheckVariant = z22.object({ action: z22.literal("check"), entryId: z22.string().max(200) });
11774
+ var qualityReEvaluateVariant = z22.object({
11775
+ action: z22.literal("re-evaluate"),
11776
+ entryId: z22.string().max(200),
11777
+ context: z22.enum(["capture", "commit", "review"]).optional().default("review")
11765
11778
  });
11766
- var qualityVerifyChainVariant = z21.object({
11767
- action: z21.literal("verify-chain"),
11768
- collection: z21.string().max(200).optional().default("glossary"),
11769
- mode: z21.enum(["report", "fix"]).optional().default("report")
11779
+ var qualityVerifyChainVariant = z22.object({
11780
+ action: z22.literal("verify-chain"),
11781
+ collection: z22.string().max(200).optional().default("glossary"),
11782
+ mode: z22.enum(["report", "fix"]).optional().default("report")
11770
11783
  });
11771
- var qualityAuditVariant = z21.object({
11772
- action: z21.literal("audit"),
11773
- entryId: z21.string().max(200),
11774
- phase: z21.enum(["shaping", "handoff"]).optional().default("shaping")
11784
+ var qualityAuditVariant = z22.object({
11785
+ action: z22.literal("audit"),
11786
+ entryId: z22.string().max(200),
11787
+ phase: z22.enum(["shaping", "handoff"]).optional().default("shaping")
11775
11788
  });
11776
- var qualityActionUnion = z21.discriminatedUnion("action", [
11789
+ var qualityActionUnion = z22.discriminatedUnion("action", [
11777
11790
  qualityCheckVariant,
11778
11791
  qualityReEvaluateVariant,
11779
11792
  qualityVerifyChainVariant,
@@ -11785,27 +11798,27 @@ var QUALITY_ACTION_SPECS = {
11785
11798
  "verify-chain": { params: ["collection", "mode"], description: "All params optional; collection defaults to 'glossary'." },
11786
11799
  audit: { params: ["entryId", "phase"], description: "entryId is required." }
11787
11800
  };
11788
- var qualityCheckOutputSchema = z21.object({
11789
- entryId: z21.string(),
11801
+ var qualityCheckOutputSchema = z22.object({
11802
+ entryId: z22.string(),
11790
11803
  /** WP-480 S1: false = the ID does not resolve to an entry (typo/deleted) — distinct from "no verdict yet". */
11791
- entryFound: z21.boolean().optional(),
11792
- hasVerdict: z21.boolean(),
11804
+ entryFound: z22.boolean().optional(),
11805
+ hasVerdict: z22.boolean(),
11793
11806
  /** WP-480 S1: the verdict was judged against content the entry no longer has — re-evaluate for a current one. */
11794
- stale: z21.boolean().optional(),
11795
- tier: z21.string().optional(),
11796
- passed: z21.boolean().optional(),
11797
- criteria: z21.array(z21.object({
11798
- id: z21.string(),
11799
- passed: z21.boolean(),
11800
- hint: z21.string().optional()
11807
+ stale: z22.boolean().optional(),
11808
+ tier: z22.string().optional(),
11809
+ passed: z22.boolean().optional(),
11810
+ criteria: z22.array(z22.object({
11811
+ id: z22.string(),
11812
+ passed: z22.boolean(),
11813
+ hint: z22.string().optional()
11801
11814
  }))
11802
11815
  });
11803
- var qualityReevaluateOutputSchema = z21.object({
11804
- entryId: z21.string(),
11805
- context: z21.string(),
11806
- score: z21.number(),
11807
- maxScore: z21.number(),
11808
- improved: z21.boolean()
11816
+ var qualityReevaluateOutputSchema = z22.object({
11817
+ entryId: z22.string(),
11818
+ context: z22.string(),
11819
+ score: z22.number(),
11820
+ maxScore: z22.number(),
11821
+ improved: z22.boolean()
11809
11822
  });
11810
11823
  function registerQualityTools(server) {
11811
11824
  const qualityHandlers = {
@@ -11986,10 +11999,10 @@ async function handleReEvaluate(entryId, context) {
11986
11999
  }
11987
12000
 
11988
12001
  // src/tools/session.ts
11989
- import { z as z24 } from "zod/v3";
12002
+ import { z as z25 } from "zod/v3";
11990
12003
 
11991
12004
  // src/tools/wrapup.ts
11992
- import { z as z22 } from "zod/v3";
12005
+ import { z as z23 } from "zod/v3";
11993
12006
 
11994
12007
  // src/lib/compose-wrapup-view.ts
11995
12008
  function toComposed(e) {
@@ -12442,8 +12455,8 @@ async function runWrapupCommitAll(data, cachedSuggestions) {
12442
12455
  overflowUnscanned
12443
12456
  };
12444
12457
  }
12445
- var wrapupSchema = z22.object({
12446
- action: z22.enum(["review", "commit-all"]).optional().describe(
12458
+ var wrapupSchema = z23.object({
12459
+ action: z23.enum(["review", "commit-all"]).optional().describe(
12447
12460
  "Action to perform. 'review' (default) shows the wrapup summary. 'commit-all' accepts all uncommitted drafts and creates suggested links."
12448
12461
  )
12449
12462
  });
@@ -12544,26 +12557,26 @@ ${text}` : text;
12544
12557
  }
12545
12558
 
12546
12559
  // src/tools/facilitate.ts
12547
- import { z as z23 } from "zod/v3";
12560
+ import { z as z24 } from "zod/v3";
12548
12561
  var FACILITATE_ACTIONS = ["resume", "commit-constellation"];
12549
- var coherencyAcknowledgementSchema = z23.object({
12550
- response: z23.string().max(200).describe("Acknowledgement response per offender: 'linked' | 'accepted-fix' | 'diverged'."),
12551
- entryId: z23.string().max(200).optional().describe("Entry the acknowledgement links to (e.g. the strategic spine entry)."),
12552
- reason: z23.string().max(2e3).optional().describe("Free-text justification, required for a 'diverged' response."),
12553
- subjectEntryId: z23.string().max(200).optional().describe("The refused entry this acknowledgement answers.")
12562
+ var coherencyAcknowledgementSchema = z24.object({
12563
+ response: z24.string().max(200).describe("Acknowledgement response per offender: 'linked' | 'accepted-fix' | 'diverged'."),
12564
+ entryId: z24.string().max(200).optional().describe("Entry the acknowledgement links to (e.g. the strategic spine entry)."),
12565
+ reason: z24.string().max(2e3).optional().describe("Free-text justification, required for a 'diverged' response."),
12566
+ subjectEntryId: z24.string().max(200).optional().describe("The refused entry this acknowledgement answers.")
12554
12567
  });
12555
- var facilitateSchema = z23.object({
12556
- action: z23.enum(FACILITATE_ACTIONS).describe(
12568
+ var facilitateSchema = z24.object({
12569
+ action: z24.enum(FACILITATE_ACTIONS).describe(
12557
12570
  "'resume': load session state from an existing bet entry. 'commit-constellation': atomically accept a bet and all its linked draft entries in one call. Requires betEntryId."
12558
12571
  ),
12559
- betEntryId: z23.string().max(200).optional().describe("Bet entry ID. Required for both actions."),
12560
- operationId: z23.string().max(200).optional().describe("Optional idempotency key for commit-constellation retries."),
12572
+ betEntryId: z24.string().max(200).optional().describe("Bet entry ID. Required for both actions."),
12573
+ operationId: z24.string().max(200).optional().describe("Optional idempotency key for commit-constellation retries."),
12561
12574
  // WP-465 slice ⑤: coherency retry controls for a COHERENCY_REFUSED constellation hold.
12562
12575
  // Forwarded verbatim to agentKnowledge.facilitateEnvelope (validation lives at the gate).
12563
- coherencyAcknowledgements: z23.array(coherencyAcknowledgementSchema).max(20).optional().describe(
12576
+ coherencyAcknowledgements: z24.array(coherencyAcknowledgementSchema).max(20).optional().describe(
12564
12577
  "Per-offender acknowledgements to retry a constellation held under standard/strict coherency mode. Each: {subjectEntryId, response: 'linked' | 'accepted-fix' | 'diverged', entryId?, reason?}."
12565
12578
  ),
12566
- steeringOverrideReason: z23.string().max(2e3).optional().describe(
12579
+ steeringOverrideReason: z24.string().max(2e3).optional().describe(
12567
12580
  "Typed override reason (>= 12 chars) to push a constellation past a coherency hold instead of acknowledging."
12568
12581
  )
12569
12582
  });
@@ -12816,33 +12829,33 @@ var SESSION_ACTIONS = [
12816
12829
  "resume",
12817
12830
  "commit-constellation"
12818
12831
  ];
12819
- var coherencyAcknowledgementFlatSchema2 = z24.object({
12820
- response: z24.string().max(200).describe("Acknowledgement response per offender: 'linked' | 'accepted-fix' | 'diverged'."),
12821
- entryId: z24.string().max(200).optional().describe("Entry the acknowledgement links to."),
12822
- reason: z24.string().max(2e3).optional().describe("Free-text justification, required for a 'diverged' response."),
12823
- subjectEntryId: z24.string().max(200).optional().describe("The refused entry this acknowledgement answers.")
12832
+ var coherencyAcknowledgementFlatSchema2 = z25.object({
12833
+ response: z25.string().max(200).describe("Acknowledgement response per offender: 'linked' | 'accepted-fix' | 'diverged'."),
12834
+ entryId: z25.string().max(200).optional().describe("Entry the acknowledgement links to."),
12835
+ reason: z25.string().max(2e3).optional().describe("Free-text justification, required for a 'diverged' response."),
12836
+ subjectEntryId: z25.string().max(200).optional().describe("The refused entry this acknowledgement answers.")
12824
12837
  });
12825
- var sessionSchema = z24.object({
12826
- action: z24.enum(SESSION_ACTIONS).describe(
12838
+ var sessionSchema = z25.object({
12839
+ action: z25.enum(SESSION_ACTIONS).describe(
12827
12840
  "'start': begin a tracked session. 'close': end the session and record activity. 'status': check current session state. 'wrapup-review': review uncommitted drafts before closing (absorbs session-wrapup action=review). 'wrapup-commit': accept all uncommitted drafts (absorbs session-wrapup action=commit-all). 'resume': load session state from an existing bet entry (absorbs facilitate action=resume). 'commit-constellation': atomically accept a bet and its linked drafts (absorbs facilitate action=commit-constellation)."
12828
12841
  ),
12829
- betEntryId: z24.string().max(200).optional().describe("For 'resume'/'commit-constellation': bet entry ID. Required for both."),
12830
- operationId: z24.string().max(200).optional().describe("For 'commit-constellation': optional idempotency key for retries."),
12831
- coherencyAcknowledgements: z24.array(coherencyAcknowledgementFlatSchema2).max(20).optional().describe(
12842
+ betEntryId: z25.string().max(200).optional().describe("For 'resume'/'commit-constellation': bet entry ID. Required for both."),
12843
+ operationId: z25.string().max(200).optional().describe("For 'commit-constellation': optional idempotency key for retries."),
12844
+ coherencyAcknowledgements: z25.array(coherencyAcknowledgementFlatSchema2).max(20).optional().describe(
12832
12845
  "For 'commit-constellation': per-offender acknowledgements to retry a constellation held under standard/strict coherency mode."
12833
12846
  ),
12834
- steeringOverrideReason: z24.string().max(2e3).optional().describe(
12847
+ steeringOverrideReason: z25.string().max(2e3).optional().describe(
12835
12848
  "For 'commit-constellation': typed override reason (>= 12 chars) to push past a coherency hold instead of acknowledging."
12836
12849
  )
12837
12850
  });
12838
- var sessionStartVariant = z24.object({ action: z24.literal("start") });
12839
- var sessionCloseVariant = z24.object({ action: z24.literal("close") });
12840
- var sessionStatusVariant = z24.object({ action: z24.literal("status") });
12841
- var sessionWrapupReviewVariant = z24.object({ action: z24.literal("wrapup-review") });
12842
- var sessionWrapupCommitVariant = z24.object({ action: z24.literal("wrapup-commit") });
12843
- var sessionResumeVariant = facilitateSchema.omit({ action: true }).extend({ action: z24.literal("resume") });
12844
- var sessionCommitConstellationVariant = facilitateSchema.omit({ action: true }).extend({ action: z24.literal("commit-constellation") });
12845
- var sessionActionUnion = z24.discriminatedUnion("action", [
12851
+ var sessionStartVariant = z25.object({ action: z25.literal("start") });
12852
+ var sessionCloseVariant = z25.object({ action: z25.literal("close") });
12853
+ var sessionStatusVariant = z25.object({ action: z25.literal("status") });
12854
+ var sessionWrapupReviewVariant = z25.object({ action: z25.literal("wrapup-review") });
12855
+ var sessionWrapupCommitVariant = z25.object({ action: z25.literal("wrapup-commit") });
12856
+ var sessionResumeVariant = facilitateSchema.omit({ action: true }).extend({ action: z25.literal("resume") });
12857
+ var sessionCommitConstellationVariant = facilitateSchema.omit({ action: true }).extend({ action: z25.literal("commit-constellation") });
12858
+ var sessionActionUnion = z25.discriminatedUnion("action", [
12846
12859
  sessionStartVariant,
12847
12860
  sessionCloseVariant,
12848
12861
  sessionStatusVariant,
@@ -13066,7 +13079,7 @@ async function handleStatus() {
13066
13079
  }
13067
13080
 
13068
13081
  // src/tools/gitchain.ts
13069
- import { z as z25 } from "zod/v3";
13082
+ import { z as z26 } from "zod/v3";
13070
13083
 
13071
13084
  // src/lib/versionDisplay.ts
13072
13085
  function toVersionDisplay(version) {
@@ -13075,51 +13088,51 @@ function toVersionDisplay(version) {
13075
13088
  }
13076
13089
 
13077
13090
  // src/tools/gitchain.ts
13078
- var chainSchema = z25.object({
13079
- action: z25.enum(["create", "get", "list", "edit"]).describe("Action: create a process, get process details, list all processes, or edit a process link"),
13080
- chainEntryId: z25.string().max(200).optional().describe("Chain entry ID (required for get/edit)"),
13081
- title: z25.string().max(500).optional().describe("Process title (required for create)"),
13082
- chainTypeId: z25.string().max(200).optional().default("strategy-coherence").describe("Process template slug for create: 'strategy-coherence', 'idm-proposal', or any custom template slug"),
13083
- description: z25.string().max(2e4).optional().describe("Description (for create)"),
13084
- linkId: z25.string().max(200).optional().describe("Link to edit (for edit action): problem, insight, choice, action, outcome"),
13085
- content: z25.string().max(5e4).optional().describe("New content for the link (for edit action)"),
13086
- status: z25.string().max(200).optional().describe("Filter by status for list: 'draft' or 'active'"),
13087
- author: z25.string().max(200).optional().describe("Who is performing the action. Defaults to 'mcp'."),
13091
+ var chainSchema = z26.object({
13092
+ action: z26.enum(["create", "get", "list", "edit"]).describe("Action: create a process, get process details, list all processes, or edit a process link"),
13093
+ chainEntryId: z26.string().max(200).optional().describe("Chain entry ID (required for get/edit)"),
13094
+ title: z26.string().max(500).optional().describe("Process title (required for create)"),
13095
+ chainTypeId: z26.string().max(200).optional().default("strategy-coherence").describe("Process template slug for create: 'strategy-coherence', 'idm-proposal', or any custom template slug"),
13096
+ description: z26.string().max(2e4).optional().describe("Description (for create)"),
13097
+ linkId: z26.string().max(200).optional().describe("Link to edit (for edit action): problem, insight, choice, action, outcome"),
13098
+ content: z26.string().max(5e4).optional().describe("New content for the link (for edit action)"),
13099
+ status: z26.string().max(200).optional().describe("Filter by status for list: 'draft' or 'active'"),
13100
+ author: z26.string().max(200).optional().describe("Who is performing the action. Defaults to 'mcp'."),
13088
13101
  // WP-513 review round 3 (P1): team+role to create AS OWNER of (rung 2 only) — entry ID or entryId (e.g. "TEAM-1").
13089
- ownerTeamEntryId: z25.string().max(200).optional().describe("For 'create': owning team (rung-2 workspaces)."),
13090
- ownerRoleEntryId: z25.string().max(200).optional().describe("For 'create': owning role (rung-2 workspaces).")
13102
+ ownerTeamEntryId: z26.string().max(200).optional().describe("For 'create': owning team (rung-2 workspaces)."),
13103
+ ownerRoleEntryId: z26.string().max(200).optional().describe("For 'create': owning role (rung-2 workspaces).")
13091
13104
  });
13092
- var chainVersionSchema = z25.object({
13093
- action: z25.enum(["commit", "list", "diff", "revert", "history"]).describe("Action: commit a snapshot, list commits, diff two versions, revert to a version, or view history"),
13094
- chainEntryId: z25.string().max(200).describe("The chain's entry ID"),
13095
- commitMessage: z25.string().max(2e3).optional().describe("Commit message (required for commit). Convention: type(link): description"),
13096
- versionA: z25.number().optional().describe("Earlier version for diff"),
13097
- versionB: z25.number().optional().describe("Later version for diff"),
13098
- toVersion: z25.number().optional().describe("Version number to revert to"),
13099
- author: z25.string().max(200).optional().describe("Who is performing the action. Defaults to 'mcp'.")
13105
+ var chainVersionSchema = z26.object({
13106
+ action: z26.enum(["commit", "list", "diff", "revert", "history"]).describe("Action: commit a snapshot, list commits, diff two versions, revert to a version, or view history"),
13107
+ chainEntryId: z26.string().max(200).describe("The chain's entry ID"),
13108
+ commitMessage: z26.string().max(2e3).optional().describe("Commit message (required for commit). Convention: type(link): description"),
13109
+ versionA: z26.number().optional().describe("Earlier version for diff"),
13110
+ versionB: z26.number().optional().describe("Later version for diff"),
13111
+ toVersion: z26.number().optional().describe("Version number to revert to"),
13112
+ author: z26.string().max(200).optional().describe("Who is performing the action. Defaults to 'mcp'.")
13100
13113
  });
13101
- var chainBranchSchema = z25.object({
13102
- action: z25.enum(["create", "list", "merge", "conflicts"]).describe("Action: create a branch, list branches, merge a branch, or check for conflicts"),
13103
- chainEntryId: z25.string().max(200).describe("The chain's entry ID"),
13104
- branchName: z25.string().max(200).optional().describe("Branch name (required for merge/conflicts, optional for create)"),
13105
- strategy: z25.enum(["merge_commit", "squash"]).optional().describe("Merge strategy: 'merge_commit' (default) or 'squash'"),
13106
- author: z25.string().max(200).optional().describe("Who is performing the action. Defaults to 'mcp'.")
13114
+ var chainBranchSchema = z26.object({
13115
+ action: z26.enum(["create", "list", "merge", "conflicts"]).describe("Action: create a branch, list branches, merge a branch, or check for conflicts"),
13116
+ chainEntryId: z26.string().max(200).describe("The chain's entry ID"),
13117
+ branchName: z26.string().max(200).optional().describe("Branch name (required for merge/conflicts, optional for create)"),
13118
+ strategy: z26.enum(["merge_commit", "squash"]).optional().describe("Merge strategy: 'merge_commit' (default) or 'squash'"),
13119
+ author: z26.string().max(200).optional().describe("Who is performing the action. Defaults to 'mcp'.")
13107
13120
  });
13108
- var chainReviewSchema = z25.object({
13109
- action: z25.enum(["gate", "comment", "resolve-comment", "list-comments"]).describe("Action: run coherence gate, add a comment, resolve a comment, or list comments"),
13121
+ var chainReviewSchema = z26.object({
13122
+ action: z26.enum(["gate", "comment", "resolve-comment", "list-comments"]).describe("Action: run coherence gate, add a comment, resolve a comment, or list comments"),
13110
13123
  // Finding #12: optional at the base (mirrors chainSchema's chainEntryId pattern at
13111
13124
  // line ~690) — resolve-comment resolves purely by commentId (handleChainReview never
13112
13125
  // reads chainEntryId in that branch) and the compound-tool's advertised schema
13113
13126
  // (chainReviewCompoundSchema below) already documents it as optional for that action.
13114
13127
  // Per-action variants that DO need it (gate/comment/list-comments) re-require it below,
13115
13128
  // same pattern as chainGetVariant/chainEditVariant re-requiring over chainSchema's base.
13116
- chainEntryId: z25.string().max(200).optional().describe("The chain's entry ID. Required for every action except 'resolve-comment'."),
13117
- commitMessage: z25.string().max(2e3).optional().describe("Commit message to lint (for gate action)"),
13118
- versionNumber: z25.number().optional().describe("Version to comment on or list comments for"),
13119
- linkId: z25.string().max(200).optional().describe("Link this comment targets (optional for comment)"),
13120
- body: z25.string().max(2e4).optional().describe("Comment text (required for comment action)"),
13121
- commentId: z25.string().max(200).optional().describe("Comment ID (required for resolve-comment)"),
13122
- author: z25.string().max(200).optional().describe("Who is performing the action. Defaults to 'mcp'.")
13129
+ chainEntryId: z26.string().max(200).optional().describe("The chain's entry ID. Required for every action except 'resolve-comment'."),
13130
+ commitMessage: z26.string().max(2e3).optional().describe("Commit message to lint (for gate action)"),
13131
+ versionNumber: z26.number().optional().describe("Version to comment on or list comments for"),
13132
+ linkId: z26.string().max(200).optional().describe("Link this comment targets (optional for comment)"),
13133
+ body: z26.string().max(2e4).optional().describe("Comment text (required for comment action)"),
13134
+ commentId: z26.string().max(200).optional().describe("Comment ID (required for resolve-comment)"),
13135
+ author: z26.string().max(200).optional().describe("Who is performing the action. Defaults to 'mcp'.")
13123
13136
  });
13124
13137
  function linkSummary(links) {
13125
13138
  return Object.entries(links).map(([id, content]) => {
@@ -13624,57 +13637,57 @@ var CHAIN_REVIEW_ACTIONS = [
13624
13637
  "branch.merge",
13625
13638
  "branch.conflicts"
13626
13639
  ];
13627
- var chainCompoundSchema = z25.object({
13628
- action: z25.enum(CHAIN_ACTIONS).describe(
13640
+ var chainCompoundSchema = z26.object({
13641
+ action: z26.enum(CHAIN_ACTIONS).describe(
13629
13642
  "Unnamespaced: 'create'/'get'/'list'/'edit' \u2014 process CRUD (the original `chain` tool). 'version.*' (commit/list/diff/revert/history) \u2014 versioning, absorbs `chain-version`. Branching and review live on the sibling `chain-review` tool."
13630
13643
  ),
13631
- chainEntryId: z25.string().max(200).optional().describe("Chain entry ID. Required for get/edit and all version.* actions."),
13632
- title: z25.string().max(500).optional().describe("For 'create': process title (required)."),
13633
- chainTypeId: z25.string().max(200).optional().default("strategy-coherence").describe("For 'create'/'list': process template slug."),
13634
- description: z25.string().max(2e4).optional().describe("For 'create': description."),
13635
- linkId: z25.string().max(200).optional().describe("For 'edit': link to edit (required)."),
13636
- content: z25.string().max(5e4).optional().describe("For 'edit': new content for the link (required)."),
13637
- status: z25.string().max(200).optional().describe("For 'list': filter by status."),
13638
- author: z25.string().max(200).optional().describe("Who is performing the action. Defaults to 'mcp'."),
13639
- commitMessage: z25.string().max(2e3).optional().describe("For 'version.commit': commit message (required)."),
13640
- versionA: z25.number().optional().describe("For 'version.diff': earlier version (required)."),
13641
- versionB: z25.number().optional().describe("For 'version.diff': later version (required)."),
13642
- toVersion: z25.number().optional().describe("For 'version.revert': version number to revert to (required)."),
13644
+ chainEntryId: z26.string().max(200).optional().describe("Chain entry ID. Required for get/edit and all version.* actions."),
13645
+ title: z26.string().max(500).optional().describe("For 'create': process title (required)."),
13646
+ chainTypeId: z26.string().max(200).optional().default("strategy-coherence").describe("For 'create'/'list': process template slug."),
13647
+ description: z26.string().max(2e4).optional().describe("For 'create': description."),
13648
+ linkId: z26.string().max(200).optional().describe("For 'edit': link to edit (required)."),
13649
+ content: z26.string().max(5e4).optional().describe("For 'edit': new content for the link (required)."),
13650
+ status: z26.string().max(200).optional().describe("For 'list': filter by status."),
13651
+ author: z26.string().max(200).optional().describe("Who is performing the action. Defaults to 'mcp'."),
13652
+ commitMessage: z26.string().max(2e3).optional().describe("For 'version.commit': commit message (required)."),
13653
+ versionA: z26.number().optional().describe("For 'version.diff': earlier version (required)."),
13654
+ versionB: z26.number().optional().describe("For 'version.diff': later version (required)."),
13655
+ toVersion: z26.number().optional().describe("For 'version.revert': version number to revert to (required)."),
13643
13656
  // WP-513 review round 3 (P1): team+role to create AS OWNER of (rung 2 only).
13644
- ownerTeamEntryId: z25.string().max(200).optional().describe("For 'create': owning team (rung-2 workspaces)."),
13645
- ownerRoleEntryId: z25.string().max(200).optional().describe("For 'create': owning role (rung-2 workspaces).")
13657
+ ownerTeamEntryId: z26.string().max(200).optional().describe("For 'create': owning team (rung-2 workspaces)."),
13658
+ ownerRoleEntryId: z26.string().max(200).optional().describe("For 'create': owning role (rung-2 workspaces).")
13646
13659
  });
13647
- var chainReviewCompoundSchema = z25.object({
13648
- action: z25.enum(CHAIN_REVIEW_ACTIONS).describe(
13660
+ var chainReviewCompoundSchema = z26.object({
13661
+ action: z26.enum(CHAIN_REVIEW_ACTIONS).describe(
13649
13662
  "'gate'/'comment'/'resolve-comment'/'list-comments' \u2014 quality gate + comments (the original `chain-review` tool, unchanged call shape). 'branch.*' (create/list/merge/conflicts) \u2014 branching, absorbs `chain-branch`. Process CRUD and versioning live on the sibling `chain` tool."
13650
13663
  ),
13651
- chainEntryId: z25.string().max(200).optional().describe("Chain entry ID. Required for every action except 'resolve-comment'."),
13652
- commitMessage: z25.string().max(2e3).optional().describe("For 'gate': commit message to lint."),
13653
- versionNumber: z25.number().optional().describe("For 'comment'/'list-comments': version to comment on or list comments for."),
13654
- linkId: z25.string().max(200).optional().describe("For 'comment': optional link this comment targets."),
13655
- body: z25.string().max(2e4).optional().describe("For 'comment': comment text (required)."),
13656
- commentId: z25.string().max(200).optional().describe("For 'resolve-comment': comment ID (required)."),
13657
- branchName: z25.string().max(200).optional().describe("For 'branch.merge'/'branch.conflicts': required. For 'branch.create': optional."),
13658
- strategy: z25.enum(["merge_commit", "squash"]).optional().describe("For 'branch.merge': merge strategy. Default 'merge_commit'."),
13659
- author: z25.string().max(200).optional().describe("Who is performing the action. Defaults to 'mcp'.")
13664
+ chainEntryId: z26.string().max(200).optional().describe("Chain entry ID. Required for every action except 'resolve-comment'."),
13665
+ commitMessage: z26.string().max(2e3).optional().describe("For 'gate': commit message to lint."),
13666
+ versionNumber: z26.number().optional().describe("For 'comment'/'list-comments': version to comment on or list comments for."),
13667
+ linkId: z26.string().max(200).optional().describe("For 'comment': optional link this comment targets."),
13668
+ body: z26.string().max(2e4).optional().describe("For 'comment': comment text (required)."),
13669
+ commentId: z26.string().max(200).optional().describe("For 'resolve-comment': comment ID (required)."),
13670
+ branchName: z26.string().max(200).optional().describe("For 'branch.merge'/'branch.conflicts': required. For 'branch.create': optional."),
13671
+ strategy: z26.enum(["merge_commit", "squash"]).optional().describe("For 'branch.merge': merge strategy. Default 'merge_commit'."),
13672
+ author: z26.string().max(200).optional().describe("Who is performing the action. Defaults to 'mcp'.")
13660
13673
  });
13661
- var chainCreateVariant = chainSchema.omit({ action: true }).extend({ action: z25.literal("create") });
13662
- var chainGetVariant = z25.object({ action: z25.literal("get"), chainEntryId: z25.string().max(200) });
13663
- var chainListVariant = z25.object({ action: z25.literal("list"), chainTypeId: z25.string().max(200).optional(), status: z25.string().max(200).optional() });
13664
- var chainEditVariant = z25.object({
13665
- action: z25.literal("edit"),
13666
- chainEntryId: z25.string().max(200),
13667
- linkId: z25.string().max(200),
13668
- content: z25.string().max(5e4),
13669
- author: z25.string().max(200).optional()
13674
+ var chainCreateVariant = chainSchema.omit({ action: true }).extend({ action: z26.literal("create") });
13675
+ var chainGetVariant = z26.object({ action: z26.literal("get"), chainEntryId: z26.string().max(200) });
13676
+ var chainListVariant = z26.object({ action: z26.literal("list"), chainTypeId: z26.string().max(200).optional(), status: z26.string().max(200).optional() });
13677
+ var chainEditVariant = z26.object({
13678
+ action: z26.literal("edit"),
13679
+ chainEntryId: z26.string().max(200),
13680
+ linkId: z26.string().max(200),
13681
+ content: z26.string().max(5e4),
13682
+ author: z26.string().max(200).optional()
13670
13683
  });
13671
13684
  var versionBase = chainVersionSchema.omit({ action: true });
13672
- var chainVersionCommitVariant = versionBase.extend({ action: z25.literal("version.commit"), commitMessage: z25.string().max(2e3) });
13673
- var chainVersionListVariant = versionBase.extend({ action: z25.literal("version.list") });
13674
- var chainVersionDiffVariant = versionBase.extend({ action: z25.literal("version.diff"), versionA: z25.number(), versionB: z25.number() });
13675
- var chainVersionRevertVariant = versionBase.extend({ action: z25.literal("version.revert"), toVersion: z25.number() });
13676
- var chainVersionHistoryVariant = versionBase.extend({ action: z25.literal("version.history") });
13677
- var chainActionUnion = z25.discriminatedUnion("action", [
13685
+ var chainVersionCommitVariant = versionBase.extend({ action: z26.literal("version.commit"), commitMessage: z26.string().max(2e3) });
13686
+ var chainVersionListVariant = versionBase.extend({ action: z26.literal("version.list") });
13687
+ var chainVersionDiffVariant = versionBase.extend({ action: z26.literal("version.diff"), versionA: z26.number(), versionB: z26.number() });
13688
+ var chainVersionRevertVariant = versionBase.extend({ action: z26.literal("version.revert"), toVersion: z26.number() });
13689
+ var chainVersionHistoryVariant = versionBase.extend({ action: z26.literal("version.history") });
13690
+ var chainActionUnion = z26.discriminatedUnion("action", [
13678
13691
  chainCreateVariant,
13679
13692
  chainGetVariant,
13680
13693
  chainListVariant,
@@ -13686,16 +13699,16 @@ var chainActionUnion = z25.discriminatedUnion("action", [
13686
13699
  chainVersionHistoryVariant
13687
13700
  ]);
13688
13701
  var reviewBase = chainReviewSchema.omit({ action: true });
13689
- var chainReviewGateVariant = reviewBase.extend({ action: z25.literal("gate"), chainEntryId: z25.string().max(200) });
13690
- var chainReviewCommentVariant = reviewBase.extend({ action: z25.literal("comment"), chainEntryId: z25.string().max(200), versionNumber: z25.number(), body: z25.string().max(2e4) });
13691
- var chainReviewResolveCommentVariant = reviewBase.extend({ action: z25.literal("resolve-comment"), commentId: z25.string().max(200) });
13692
- var chainReviewListCommentsVariant = reviewBase.extend({ action: z25.literal("list-comments"), chainEntryId: z25.string().max(200) });
13702
+ var chainReviewGateVariant = reviewBase.extend({ action: z26.literal("gate"), chainEntryId: z26.string().max(200) });
13703
+ var chainReviewCommentVariant = reviewBase.extend({ action: z26.literal("comment"), chainEntryId: z26.string().max(200), versionNumber: z26.number(), body: z26.string().max(2e4) });
13704
+ var chainReviewResolveCommentVariant = reviewBase.extend({ action: z26.literal("resolve-comment"), commentId: z26.string().max(200) });
13705
+ var chainReviewListCommentsVariant = reviewBase.extend({ action: z26.literal("list-comments"), chainEntryId: z26.string().max(200) });
13693
13706
  var branchBase = chainBranchSchema.omit({ action: true });
13694
- var chainBranchCreateVariant = branchBase.extend({ action: z25.literal("branch.create") });
13695
- var chainBranchListVariant = branchBase.extend({ action: z25.literal("branch.list") });
13696
- var chainBranchMergeVariant = branchBase.extend({ action: z25.literal("branch.merge"), branchName: z25.string().max(200) });
13697
- var chainBranchConflictsVariant = branchBase.extend({ action: z25.literal("branch.conflicts"), branchName: z25.string().max(200) });
13698
- var chainReviewActionUnion = z25.discriminatedUnion("action", [
13707
+ var chainBranchCreateVariant = branchBase.extend({ action: z26.literal("branch.create") });
13708
+ var chainBranchListVariant = branchBase.extend({ action: z26.literal("branch.list") });
13709
+ var chainBranchMergeVariant = branchBase.extend({ action: z26.literal("branch.merge"), branchName: z26.string().max(200) });
13710
+ var chainBranchConflictsVariant = branchBase.extend({ action: z26.literal("branch.conflicts"), branchName: z26.string().max(200) });
13711
+ var chainReviewActionUnion = z26.discriminatedUnion("action", [
13699
13712
  chainReviewGateVariant,
13700
13713
  chainReviewCommentVariant,
13701
13714
  chainReviewResolveCommentVariant,
@@ -13787,44 +13800,44 @@ function registerGitChainTools(server) {
13787
13800
  }
13788
13801
 
13789
13802
  // src/tools/maps.ts
13790
- import { z as z26 } from "zod/v3";
13791
- var createAudienceMapSetSchema = z26.object({
13792
- audienceEntryId: z26.string().max(200).describe("Entry ID of the audience (e.g. STR-fb7hje)"),
13803
+ import { z as z27 } from "zod/v3";
13804
+ var createAudienceMapSetSchema = z27.object({
13805
+ audienceEntryId: z27.string().max(200).describe("Entry ID of the audience (e.g. STR-fb7hje)"),
13793
13806
  // WP-513: team+role to create AS OWNER of (rung 2); ID or entryId (e.g. "TEAM-1"); no-op pre-rung-2.
13794
- ownerTeamEntryId: z26.string().max(200).optional().describe("Team entry ID/ref to own the created maps (required once the workspace is on rung 2)"),
13795
- ownerRoleEntryId: z26.string().max(200).optional().describe("Role entry ID/ref to own the created maps (required once the workspace is on rung 2)")
13807
+ ownerTeamEntryId: z27.string().max(200).optional().describe("Team entry ID/ref to own the created maps (required once the workspace is on rung 2)"),
13808
+ ownerRoleEntryId: z27.string().max(200).optional().describe("Role entry ID/ref to own the created maps (required once the workspace is on rung 2)")
13796
13809
  });
13797
- var mapSchema = z26.object({
13798
- action: z26.enum(["create", "get", "list"]).describe("Action: create a map, get map details, or list all maps"),
13799
- mapEntryId: z26.string().max(200).optional().describe("Map entry ID (for get)"),
13800
- title: z26.string().max(500).optional().describe("Map title (for create)"),
13801
- templateId: z26.string().max(200).optional().default("lean-canvas").describe("Template slug for create: 'lean-canvas' or any composed template"),
13802
- description: z26.string().max(2e4).optional().describe("Description (for create)"),
13803
- slotIds: z26.array(z26.string().max(200)).max(200).optional().describe("Slot IDs to initialize (for create; auto-populated from template if omitted)"),
13804
- status: z26.string().max(200).optional().describe("Filter by status for list"),
13810
+ var mapSchema = z27.object({
13811
+ action: z27.enum(["create", "get", "list"]).describe("Action: create a map, get map details, or list all maps"),
13812
+ mapEntryId: z27.string().max(200).optional().describe("Map entry ID (for get)"),
13813
+ title: z27.string().max(500).optional().describe("Map title (for create)"),
13814
+ templateId: z27.string().max(200).optional().default("lean-canvas").describe("Template slug for create: 'lean-canvas' or any composed template"),
13815
+ description: z27.string().max(2e4).optional().describe("Description (for create)"),
13816
+ slotIds: z27.array(z27.string().max(200)).max(200).optional().describe("Slot IDs to initialize (for create; auto-populated from template if omitted)"),
13817
+ status: z27.string().max(200).optional().describe("Filter by status for list"),
13805
13818
  // WP-513: team+role to create AS OWNER of (rung 2, action "create" only); no-op pre-rung-2.
13806
- ownerTeamEntryId: z26.string().max(200).optional().describe("Team entry ID/ref to own the created map (required once the workspace is on rung 2)"),
13807
- ownerRoleEntryId: z26.string().max(200).optional().describe("Role entry ID/ref to own the created map (required once the workspace is on rung 2)")
13819
+ ownerTeamEntryId: z27.string().max(200).optional().describe("Team entry ID/ref to own the created map (required once the workspace is on rung 2)"),
13820
+ ownerRoleEntryId: z27.string().max(200).optional().describe("Role entry ID/ref to own the created map (required once the workspace is on rung 2)")
13808
13821
  });
13809
- var mapSlotSchema = z26.object({
13810
- action: z26.enum(["add", "remove", "replace", "list"]).describe("Action: add/remove/replace an ingredient in a slot, or list slot contents"),
13811
- mapEntryId: z26.string().max(200).describe("Map entry ID"),
13812
- slotId: z26.string().max(200).optional().describe("Slot ID (e.g. 'problem', 'customer-segments')"),
13813
- ingredientEntryId: z26.string().max(200).optional().describe("Ingredient entry ID to add/remove"),
13814
- newIngredientEntryId: z26.string().max(200).optional().describe("New ingredient entry ID (for replace)"),
13815
- label: z26.string().max(500).optional().describe("Display label override"),
13816
- author: z26.string().max(200).optional().describe("Who is performing the action")
13822
+ var mapSlotSchema = z27.object({
13823
+ action: z27.enum(["add", "remove", "replace", "list"]).describe("Action: add/remove/replace an ingredient in a slot, or list slot contents"),
13824
+ mapEntryId: z27.string().max(200).describe("Map entry ID"),
13825
+ slotId: z27.string().max(200).optional().describe("Slot ID (e.g. 'problem', 'customer-segments')"),
13826
+ ingredientEntryId: z27.string().max(200).optional().describe("Ingredient entry ID to add/remove"),
13827
+ newIngredientEntryId: z27.string().max(200).optional().describe("New ingredient entry ID (for replace)"),
13828
+ label: z27.string().max(500).optional().describe("Display label override"),
13829
+ author: z27.string().max(200).optional().describe("Who is performing the action")
13817
13830
  });
13818
- var mapVersionSchema = z26.object({
13819
- action: z26.enum(["commit", "list", "history"]).describe("Action: commit the map, list commits, or view commit history"),
13820
- mapEntryId: z26.string().max(200).describe("Map entry ID"),
13821
- commitMessage: z26.string().max(2e3).optional().describe("Commit message (for commit action)"),
13822
- author: z26.string().max(200).optional().describe("Who is committing")
13831
+ var mapVersionSchema = z27.object({
13832
+ action: z27.enum(["commit", "list", "history"]).describe("Action: commit the map, list commits, or view commit history"),
13833
+ mapEntryId: z27.string().max(200).describe("Map entry ID"),
13834
+ commitMessage: z27.string().max(2e3).optional().describe("Commit message (for commit action)"),
13835
+ author: z27.string().max(200).optional().describe("Who is committing")
13823
13836
  });
13824
- var mapSuggestSchema = z26.object({
13825
- mapEntryId: z26.string().max(200).describe("Map entry ID to suggest ingredients for"),
13826
- slotId: z26.string().max(200).optional().describe("Specific slot to find ingredients for (or all empty slots)"),
13827
- query: z26.string().max(500).optional().describe("Optional search query to narrow ingredient suggestions")
13837
+ var mapSuggestSchema = z27.object({
13838
+ mapEntryId: z27.string().max(200).describe("Map entry ID to suggest ingredients for"),
13839
+ slotId: z27.string().max(200).optional().describe("Specific slot to find ingredients for (or all empty slots)"),
13840
+ query: z27.string().max(500).optional().describe("Optional search query to narrow ingredient suggestions")
13828
13841
  });
13829
13842
  function slotSummary(slots) {
13830
13843
  return Object.entries(slots).map(([id, refs]) => {
@@ -14204,43 +14217,43 @@ var MAP_ACTIONS = [
14204
14217
  "suggest",
14205
14218
  "create-audience-set"
14206
14219
  ];
14207
- var mapCompoundSchema = z26.object({
14208
- action: z26.enum(MAP_ACTIONS).describe(
14220
+ var mapCompoundSchema = z27.object({
14221
+ action: z27.enum(MAP_ACTIONS).describe(
14209
14222
  "Unnamespaced: 'create'/'get'/'list' \u2014 map CRUD (the original `map` tool). 'slot.*' (add/remove/replace/list) \u2014 ingredient slot management, absorbs `map-slot`. 'version.*' (commit/list/history) \u2014 versioning, absorbs `map-version`. 'suggest' \u2014 find ingredients to fill empty slots, absorbs `map-suggest`. 'create-audience-set' \u2014 create all three audience intelligence maps at once, absorbs `create-audience-map-set`."
14210
14223
  ),
14211
- mapEntryId: z26.string().max(200).optional().describe("Map entry ID. Required for get and all slot.*/version.*/suggest actions."),
14212
- title: z26.string().max(500).optional().describe("For 'create': map title (required)."),
14213
- templateId: z26.string().max(200).optional().default("lean-canvas").describe("For 'create': template slug."),
14214
- description: z26.string().max(2e4).optional().describe("For 'create': description."),
14215
- slotIds: z26.array(z26.string().max(200)).max(200).optional().describe("For 'create': slot IDs to initialize."),
14216
- status: z26.string().max(200).optional().describe("For 'list': filter by status."),
14217
- slotId: z26.string().max(200).optional().describe("For 'slot.add'/'slot.remove'/'slot.replace': slot ID (required). For 'suggest': specific slot (optional)."),
14218
- ingredientEntryId: z26.string().max(200).optional().describe("For 'slot.add'/'slot.remove'/'slot.replace': ingredient entry ID to add/remove (required)."),
14219
- newIngredientEntryId: z26.string().max(200).optional().describe("For 'slot.replace': new ingredient entry ID (required)."),
14220
- label: z26.string().max(500).optional().describe("For 'slot.add'/'slot.replace': display label override."),
14221
- author: z26.string().max(200).optional().describe("Who is performing the action."),
14222
- commitMessage: z26.string().max(2e3).optional().describe("For 'version.commit': commit message."),
14223
- query: z26.string().max(500).optional().describe("For 'suggest': search query to narrow ingredient suggestions."),
14224
- audienceEntryId: z26.string().max(200).optional().describe("For 'create-audience-set': audience entry ID (required)."),
14224
+ mapEntryId: z27.string().max(200).optional().describe("Map entry ID. Required for get and all slot.*/version.*/suggest actions."),
14225
+ title: z27.string().max(500).optional().describe("For 'create': map title (required)."),
14226
+ templateId: z27.string().max(200).optional().default("lean-canvas").describe("For 'create': template slug."),
14227
+ description: z27.string().max(2e4).optional().describe("For 'create': description."),
14228
+ slotIds: z27.array(z27.string().max(200)).max(200).optional().describe("For 'create': slot IDs to initialize."),
14229
+ status: z27.string().max(200).optional().describe("For 'list': filter by status."),
14230
+ slotId: z27.string().max(200).optional().describe("For 'slot.add'/'slot.remove'/'slot.replace': slot ID (required). For 'suggest': specific slot (optional)."),
14231
+ ingredientEntryId: z27.string().max(200).optional().describe("For 'slot.add'/'slot.remove'/'slot.replace': ingredient entry ID to add/remove (required)."),
14232
+ newIngredientEntryId: z27.string().max(200).optional().describe("For 'slot.replace': new ingredient entry ID (required)."),
14233
+ label: z27.string().max(500).optional().describe("For 'slot.add'/'slot.replace': display label override."),
14234
+ author: z27.string().max(200).optional().describe("Who is performing the action."),
14235
+ commitMessage: z27.string().max(2e3).optional().describe("For 'version.commit': commit message."),
14236
+ query: z27.string().max(500).optional().describe("For 'suggest': search query to narrow ingredient suggestions."),
14237
+ audienceEntryId: z27.string().max(200).optional().describe("For 'create-audience-set': audience entry ID (required)."),
14225
14238
  // WP-513 review round 3 (P1): without these here, zod strips them before mapActionUnion ever sees them.
14226
- ownerTeamEntryId: z26.string().max(200).optional().describe("For 'create'/'create-audience-set': owning team (rung-2 workspaces)."),
14227
- ownerRoleEntryId: z26.string().max(200).optional().describe("For 'create'/'create-audience-set': owning role (rung-2 workspaces).")
14239
+ ownerTeamEntryId: z27.string().max(200).optional().describe("For 'create'/'create-audience-set': owning team (rung-2 workspaces)."),
14240
+ ownerRoleEntryId: z27.string().max(200).optional().describe("For 'create'/'create-audience-set': owning role (rung-2 workspaces).")
14228
14241
  });
14229
- var mapCreateVariant = mapSchema.omit({ action: true }).extend({ action: z26.literal("create") });
14230
- var mapGetVariant = z26.object({ action: z26.literal("get"), mapEntryId: z26.string().max(200) });
14231
- var mapListVariant = z26.object({ action: z26.literal("list"), templateId: z26.string().max(200).optional(), status: z26.string().max(200).optional() });
14242
+ var mapCreateVariant = mapSchema.omit({ action: true }).extend({ action: z27.literal("create") });
14243
+ var mapGetVariant = z27.object({ action: z27.literal("get"), mapEntryId: z27.string().max(200) });
14244
+ var mapListVariant = z27.object({ action: z27.literal("list"), templateId: z27.string().max(200).optional(), status: z27.string().max(200).optional() });
14232
14245
  var slotBase = mapSlotSchema.omit({ action: true });
14233
- var mapSlotAddVariant = slotBase.extend({ action: z26.literal("slot.add"), slotId: z26.string().max(200), ingredientEntryId: z26.string().max(200) });
14234
- var mapSlotRemoveVariant = slotBase.extend({ action: z26.literal("slot.remove"), slotId: z26.string().max(200), ingredientEntryId: z26.string().max(200) });
14235
- var mapSlotReplaceVariant = slotBase.extend({ action: z26.literal("slot.replace"), slotId: z26.string().max(200), ingredientEntryId: z26.string().max(200), newIngredientEntryId: z26.string().max(200) });
14236
- var mapSlotListVariant = slotBase.extend({ action: z26.literal("slot.list") });
14246
+ var mapSlotAddVariant = slotBase.extend({ action: z27.literal("slot.add"), slotId: z27.string().max(200), ingredientEntryId: z27.string().max(200) });
14247
+ var mapSlotRemoveVariant = slotBase.extend({ action: z27.literal("slot.remove"), slotId: z27.string().max(200), ingredientEntryId: z27.string().max(200) });
14248
+ var mapSlotReplaceVariant = slotBase.extend({ action: z27.literal("slot.replace"), slotId: z27.string().max(200), ingredientEntryId: z27.string().max(200), newIngredientEntryId: z27.string().max(200) });
14249
+ var mapSlotListVariant = slotBase.extend({ action: z27.literal("slot.list") });
14237
14250
  var versionBase2 = mapVersionSchema.omit({ action: true });
14238
- var mapVersionCommitVariant = versionBase2.extend({ action: z26.literal("version.commit") });
14239
- var mapVersionListVariant = versionBase2.extend({ action: z26.literal("version.list") });
14240
- var mapVersionHistoryVariant = versionBase2.extend({ action: z26.literal("version.history") });
14241
- var mapSuggestVariant = mapSuggestSchema.extend({ action: z26.literal("suggest") });
14242
- var mapCreateAudienceSetVariant = createAudienceMapSetSchema.extend({ action: z26.literal("create-audience-set") });
14243
- var mapActionUnion = z26.discriminatedUnion("action", [
14251
+ var mapVersionCommitVariant = versionBase2.extend({ action: z27.literal("version.commit") });
14252
+ var mapVersionListVariant = versionBase2.extend({ action: z27.literal("version.list") });
14253
+ var mapVersionHistoryVariant = versionBase2.extend({ action: z27.literal("version.history") });
14254
+ var mapSuggestVariant = mapSuggestSchema.extend({ action: z27.literal("suggest") });
14255
+ var mapCreateAudienceSetVariant = createAudienceMapSetSchema.extend({ action: z27.literal("create-audience-set") });
14256
+ var mapActionUnion = z27.discriminatedUnion("action", [
14244
14257
  mapCreateVariant,
14245
14258
  mapGetVariant,
14246
14259
  mapListVariant,
@@ -14304,10 +14317,10 @@ function registerMapTools(server) {
14304
14317
  }
14305
14318
 
14306
14319
  // src/tools/workspace.ts
14307
- import { z as z29 } from "zod/v3";
14320
+ import { z as z30 } from "zod/v3";
14308
14321
 
14309
14322
  // src/tools/health.ts
14310
- import { z as z27 } from "zod/v3";
14323
+ import { z as z28 } from "zod/v3";
14311
14324
  var CALL_CATEGORIES = {
14312
14325
  "chain.getEntry": "read",
14313
14326
  "chain.batchGetEntries": "read",
@@ -14652,65 +14665,65 @@ ${logLines.join("\n")}` }],
14652
14665
  };
14653
14666
  }
14654
14667
  var HEALTH_ACTIONS = ["check", "whoami", "status", "audit", "self-test"];
14655
- var healthSchema = z27.object({
14656
- action: z27.enum(HEALTH_ACTIONS).describe(
14668
+ var healthSchema = z28.object({
14669
+ action: z28.enum(HEALTH_ACTIONS).describe(
14657
14670
  "'check': connectivity and workspace stats. 'whoami': session identity. 'status': workspace readiness. 'audit': session audit log. 'self-test': validate all tool schemas."
14658
14671
  ),
14659
- limit: z27.number().min(1).max(50).default(20).optional().describe("For audit: how many recent calls to show (max 50)")
14672
+ limit: z28.number().min(1).max(50).default(20).optional().describe("For audit: how many recent calls to show (max 50)")
14660
14673
  });
14661
- var healthCheckOutputSchema = z27.object({
14662
- healthy: z27.boolean(),
14663
- collections: z27.number(),
14664
- entries: z27.number(),
14665
- latencyMs: z27.number(),
14666
- workspace: z27.string()
14674
+ var healthCheckOutputSchema = z28.object({
14675
+ healthy: z28.boolean(),
14676
+ collections: z28.number(),
14677
+ entries: z28.number(),
14678
+ latencyMs: z28.number(),
14679
+ workspace: z28.string()
14667
14680
  });
14668
- var organisationHealthSchema = z27.object({
14669
- reviewed: z27.number(),
14670
- agreements: z27.number(),
14671
- disagreements: z27.number(),
14672
- abstentions: z27.number(),
14673
- agreementRate: z27.number(),
14674
- flags: z27.array(z27.object({
14675
- collection: z27.string(),
14676
- count: z27.number(),
14677
- suggestedCollection: z27.string()
14681
+ var organisationHealthSchema = z28.object({
14682
+ reviewed: z28.number(),
14683
+ agreements: z28.number(),
14684
+ disagreements: z28.number(),
14685
+ abstentions: z28.number(),
14686
+ agreementRate: z28.number(),
14687
+ flags: z28.array(z28.object({
14688
+ collection: z28.string(),
14689
+ count: z28.number(),
14690
+ suggestedCollection: z28.string()
14678
14691
  }))
14679
14692
  });
14680
- var healthStatusOutputSchema = z27.object({
14681
- stage: z27.enum(["blank", "seeded", "grounded", "connected"]).optional().default("seeded"),
14682
- scoringVersion: z27.enum(["v1", "v2"]).optional().default("v1"),
14683
- readinessScore: z27.number(),
14684
- activeEntries: z27.number(),
14685
- totalRelations: z27.number(),
14686
- orphanedEntries: z27.number(),
14687
- gaps: z27.array(z27.object({ id: z27.string(), label: z27.string(), guidance: z27.string() })),
14693
+ var healthStatusOutputSchema = z28.object({
14694
+ stage: z28.enum(["blank", "seeded", "grounded", "connected"]).optional().default("seeded"),
14695
+ scoringVersion: z28.enum(["v1", "v2"]).optional().default("v1"),
14696
+ readinessScore: z28.number(),
14697
+ activeEntries: z28.number(),
14698
+ totalRelations: z28.number(),
14699
+ orphanedEntries: z28.number(),
14700
+ gaps: z28.array(z28.object({ id: z28.string(), label: z28.string(), guidance: z28.string() })),
14688
14701
  organisationHealth: organisationHealthSchema.optional()
14689
14702
  });
14690
- var healthAuditOutputSchema = z27.object({
14691
- totalCalls: z27.number(),
14692
- calls: z27.array(z27.object({
14693
- tool: z27.string(),
14694
- action: z27.string().optional(),
14695
- timestamp: z27.string(),
14696
- durationMs: z27.number().optional()
14703
+ var healthAuditOutputSchema = z28.object({
14704
+ totalCalls: z28.number(),
14705
+ calls: z28.array(z28.object({
14706
+ tool: z28.string(),
14707
+ action: z28.string().optional(),
14708
+ timestamp: z28.string(),
14709
+ durationMs: z28.number().optional()
14697
14710
  }))
14698
14711
  });
14699
- var healthWhoamiOutputSchema = z27.object({
14700
- workspaceId: z27.string(),
14701
- workspaceName: z27.string(),
14702
- scope: z27.string(),
14703
- sessionId: z27.union([z27.string(), z27.null()]),
14704
- oriented: z27.boolean()
14712
+ var healthWhoamiOutputSchema = z28.object({
14713
+ workspaceId: z28.string(),
14714
+ workspaceName: z28.string(),
14715
+ scope: z28.string(),
14716
+ sessionId: z28.union([z28.string(), z28.null()]),
14717
+ oriented: z28.boolean()
14705
14718
  });
14706
- var selfTestOutputSchema = z27.object({
14707
- passed: z27.number(),
14708
- failed: z27.number(),
14709
- total: z27.number(),
14710
- results: z27.array(z27.object({
14711
- tool: z27.string(),
14712
- valid: z27.boolean(),
14713
- error: z27.string().optional()
14719
+ var selfTestOutputSchema = z28.object({
14720
+ passed: z28.number(),
14721
+ failed: z28.number(),
14722
+ total: z28.number(),
14723
+ results: z28.array(z28.object({
14724
+ tool: z28.string(),
14725
+ valid: z28.boolean(),
14726
+ error: z28.string().optional()
14714
14727
  }))
14715
14728
  });
14716
14729
  function handleSelfTest(server) {
@@ -14761,9 +14774,9 @@ function handleSelfTest(server) {
14761
14774
  }
14762
14775
 
14763
14776
  // src/tools/usage.ts
14764
- import { z as z28 } from "zod/v3";
14765
- var usageSummarySchema = z28.object({
14766
- periodDays: z28.number().min(1).max(90).optional().describe("Number of days to look back (default 30, max 90)")
14777
+ import { z as z29 } from "zod/v3";
14778
+ var usageSummarySchema = z29.object({
14779
+ periodDays: z29.number().min(1).max(90).optional().describe("Number of days to look back (default 30, max 90)")
14767
14780
  });
14768
14781
  async function handleUsageSummary(periodDays) {
14769
14782
  const ws = await getWorkspaceContext();
@@ -14935,35 +14948,35 @@ var WORKSPACE_ACTIONS = [
14935
14948
  "proposals-respond",
14936
14949
  "proposals-count"
14937
14950
  ];
14938
- var workspaceSchema = z29.object({
14939
- action: z29.enum(WORKSPACE_ACTIONS).describe(
14951
+ var workspaceSchema = z30.object({
14952
+ action: z30.enum(WORKSPACE_ACTIONS).describe(
14940
14953
  "'check': connectivity and workspace stats (absorbs health action=check). 'whoami': session identity (absorbs health action=whoami). 'status': workspace readiness (absorbs health action=status). 'audit': session audit log (absorbs health action=audit). 'self-test': validate all tool schemas (absorbs health action=self-test). 'usage': LLM usage and cost summary (absorbs get-usage-summary). 'proposals-list': list open consent proposals (absorbs governance-proposals action=list). 'proposals-respond': approve/reject a consent proposal (absorbs governance-proposals action=respond). 'proposals-count': count open consent proposals (absorbs governance-proposals action=count)."
14941
14954
  ),
14942
- limit: z29.number().min(1).max(50).optional().describe("For 'audit': how many recent calls to show (max 50, default 20)."),
14943
- periodDays: z29.number().min(1).max(90).optional().describe("For 'usage': number of days to look back (default 30, max 90)."),
14944
- status: z29.enum(["open", "approved", "objected", "expired"]).optional().describe("For 'proposals-list': filter by status (default: open)."),
14945
- proposalId: z29.string().max(200).optional().describe("For 'proposals-respond': proposal ID."),
14946
- verdict: z29.enum(["approve", "reject"]).optional().describe("For 'proposals-respond': approve or reject."),
14947
- reason: z29.string().max(2e3).optional().describe("For 'proposals-respond': reason for the verdict (required when rejecting).")
14955
+ limit: z30.number().min(1).max(50).optional().describe("For 'audit': how many recent calls to show (max 50, default 20)."),
14956
+ periodDays: z30.number().min(1).max(90).optional().describe("For 'usage': number of days to look back (default 30, max 90)."),
14957
+ status: z30.enum(["open", "approved", "objected", "expired"]).optional().describe("For 'proposals-list': filter by status (default: open)."),
14958
+ proposalId: z30.string().max(200).optional().describe("For 'proposals-respond': proposal ID."),
14959
+ verdict: z30.enum(["approve", "reject"]).optional().describe("For 'proposals-respond': approve or reject."),
14960
+ reason: z30.string().max(2e3).optional().describe("For 'proposals-respond': reason for the verdict (required when rejecting).")
14948
14961
  });
14949
- var workspaceCheckVariant = z29.object({ action: z29.literal("check") });
14950
- var workspaceWhoamiVariant = z29.object({ action: z29.literal("whoami") });
14951
- var workspaceStatusVariant = z29.object({ action: z29.literal("status") });
14952
- var workspaceAuditVariant = z29.object({ action: z29.literal("audit"), limit: z29.number().min(1).max(50).optional().default(20) });
14953
- var workspaceSelfTestVariant = z29.object({ action: z29.literal("self-test") });
14954
- var workspaceUsageVariant = z29.object({ action: z29.literal("usage"), periodDays: z29.number().min(1).max(90).optional() });
14955
- var workspaceProposalsListVariant = z29.object({
14956
- action: z29.literal("proposals-list"),
14957
- status: z29.enum(["open", "approved", "objected", "expired"]).optional()
14962
+ var workspaceCheckVariant = z30.object({ action: z30.literal("check") });
14963
+ var workspaceWhoamiVariant = z30.object({ action: z30.literal("whoami") });
14964
+ var workspaceStatusVariant = z30.object({ action: z30.literal("status") });
14965
+ var workspaceAuditVariant = z30.object({ action: z30.literal("audit"), limit: z30.number().min(1).max(50).optional().default(20) });
14966
+ var workspaceSelfTestVariant = z30.object({ action: z30.literal("self-test") });
14967
+ var workspaceUsageVariant = z30.object({ action: z30.literal("usage"), periodDays: z30.number().min(1).max(90).optional() });
14968
+ var workspaceProposalsListVariant = z30.object({
14969
+ action: z30.literal("proposals-list"),
14970
+ status: z30.enum(["open", "approved", "objected", "expired"]).optional()
14958
14971
  });
14959
- var workspaceProposalsRespondVariant = z29.object({
14960
- action: z29.literal("proposals-respond"),
14961
- proposalId: z29.string().max(200),
14962
- verdict: z29.enum(["approve", "reject"]),
14963
- reason: z29.string().max(2e3).optional()
14972
+ var workspaceProposalsRespondVariant = z30.object({
14973
+ action: z30.literal("proposals-respond"),
14974
+ proposalId: z30.string().max(200),
14975
+ verdict: z30.enum(["approve", "reject"]),
14976
+ reason: z30.string().max(2e3).optional()
14964
14977
  });
14965
- var workspaceProposalsCountVariant = z29.object({ action: z29.literal("proposals-count") });
14966
- var workspaceActionUnion = z29.discriminatedUnion("action", [
14978
+ var workspaceProposalsCountVariant = z30.object({ action: z30.literal("proposals-count") });
14979
+ var workspaceActionUnion = z30.discriminatedUnion("action", [
14967
14980
  workspaceCheckVariant,
14968
14981
  workspaceWhoamiVariant,
14969
14982
  workspaceStatusVariant,
@@ -15019,7 +15032,7 @@ function registerWorkspaceTools(server) {
15019
15032
  }
15020
15033
 
15021
15034
  // src/tools/feedback.ts
15022
- import { z as z30 } from "zod/v3";
15035
+ import { z as z31 } from "zod/v3";
15023
15036
 
15024
15037
  // src/lib/productFeedbackConstants.ts
15025
15038
  var PRODUCT_FEEDBACK_CATEGORIES = ["bug", "friction", "idea", "praise", "other"];
@@ -15030,9 +15043,9 @@ var VENDOR_SETTABLE_STATUSES = PRODUCT_FEEDBACK_STATUSES.filter(
15030
15043
 
15031
15044
  // src/tools/feedback.ts
15032
15045
  var actions = ["submit", "list", "queue", "note", "group", "status"];
15033
- var category = z30.enum(PRODUCT_FEEDBACK_CATEGORIES);
15034
- var status = z30.enum(PRODUCT_FEEDBACK_STATUSES);
15035
- var vendorStatus = z30.enum(VENDOR_SETTABLE_STATUSES);
15046
+ var category = z31.enum(PRODUCT_FEEDBACK_CATEGORIES);
15047
+ var status = z31.enum(PRODUCT_FEEDBACK_STATUSES);
15048
+ var vendorStatus = z31.enum(VENDOR_SETTABLE_STATUSES);
15036
15049
  var GATEWAY_MAX_STRING_BYTES = 10240;
15037
15050
  var utf8Bytes = (value) => new TextEncoder().encode(value).length;
15038
15051
  var fitsGatewayBytes = (value) => utf8Bytes(value) <= GATEWAY_MAX_STRING_BYTES;
@@ -15041,32 +15054,32 @@ var byteLimitMessage = (field) => ({
15041
15054
  });
15042
15055
  var MESSAGE_DISPLAY_LIMIT = 1e3;
15043
15056
  var FULL_MESSAGE_MAX_LIMIT = 5;
15044
- var feedbackSchema = z30.object({
15045
- action: z30.enum(actions).describe("submit requires message; list returns your own workspace's feedback (all statuses); queue is the vendor triage queue (system admins only) and accepts filters; note requires feedbackId+note; group requires feedbackIds+groupId (null clears); status requires feedbackId+status."),
15046
- message: z30.string().max(1e4).optional().describe("Required for submit: the product feedback text (max 10,000 chars and 10,240 UTF-8 bytes)."),
15057
+ var feedbackSchema = z31.object({
15058
+ action: z31.enum(actions).describe("submit requires message; list returns your own workspace's feedback (all statuses); queue is the vendor triage queue (system admins only) and accepts filters; note requires feedbackId+note; group requires feedbackIds+groupId (null clears); status requires feedbackId+status."),
15059
+ message: z31.string().max(1e4).optional().describe("Required for submit: the product feedback text (max 10,000 chars and 10,240 UTF-8 bytes)."),
15047
15060
  category: category.optional().describe("Submit/queue category; submit defaults to other."),
15048
- command: z30.string().max(1e3).optional().describe("Optional submit command context; argument values are scrubbed server-side."),
15049
- route: z30.string().max(500).optional().describe("Optional submit route context."),
15050
- client: z30.string().max(100).optional().describe("Optional submit client label."),
15051
- feedbackId: z30.string().max(200).optional().describe("Required for note/status: target feedback ID."),
15052
- feedbackIds: z30.array(z30.string().max(200)).max(100).optional().describe("Required for group: 1\u2013100 target feedback IDs."),
15053
- note: z30.string().max(4e3).optional().describe("Required for note: replacement triage note (max 10,240 UTF-8 bytes)."),
15061
+ command: z31.string().max(1e3).optional().describe("Optional submit command context; argument values are scrubbed server-side."),
15062
+ route: z31.string().max(500).optional().describe("Optional submit route context."),
15063
+ client: z31.string().max(100).optional().describe("Optional submit client label."),
15064
+ feedbackId: z31.string().max(200).optional().describe("Required for note/status: target feedback ID."),
15065
+ feedbackIds: z31.array(z31.string().max(200)).max(100).optional().describe("Required for group: 1\u2013100 target feedback IDs."),
15066
+ note: z31.string().max(4e3).optional().describe("Required for note: replacement triage note (max 10,240 UTF-8 bytes)."),
15054
15067
  status: status.optional().describe("list/queue filter (any status, including 'screening'); the status action's required target value excludes 'screening' (system-only)."),
15055
- groupId: z30.string().min(1).max(200).nullable().optional().describe("Group filter, or required group destination; null explicitly clears grouping."),
15056
- workspaceId: z30.string().max(200).optional().describe("Queue-only filter (vendor cross-workspace triage); omitted means all workspaces. Has no effect on list \u2014 your own workspace is always injected server-side."),
15057
- since: z30.number().optional().describe("Queue-only lower createdAt window bound (inclusive) in epoch milliseconds."),
15058
- before: z30.number().optional().describe("Queue-only upper createdAt window bound (exclusive) in epoch milliseconds. A time-window FILTER, not the pager \u2014 use cursor to page."),
15059
- limit: z30.number().int().min(1).max(100).optional().describe("list/queue row limit, default 50, maximum 100."),
15060
- cursor: z30.string().max(2e3).optional().describe("Opaque pagination cursor from a previous list/queue response (continueCursor); omit for the first page."),
15061
- full: z30.boolean().optional().describe(`list/queue only: return untruncated messages; allowed only when limit <= ${FULL_MESSAGE_MAX_LIMIT}.`)
15068
+ groupId: z31.string().min(1).max(200).nullable().optional().describe("Group filter, or required group destination; null explicitly clears grouping."),
15069
+ workspaceId: z31.string().max(200).optional().describe("Queue-only filter (vendor cross-workspace triage); omitted means all workspaces. Has no effect on list \u2014 your own workspace is always injected server-side."),
15070
+ since: z31.number().optional().describe("Queue-only lower createdAt window bound (inclusive) in epoch milliseconds."),
15071
+ before: z31.number().optional().describe("Queue-only upper createdAt window bound (exclusive) in epoch milliseconds. A time-window FILTER, not the pager \u2014 use cursor to page."),
15072
+ limit: z31.number().int().min(1).max(100).optional().describe("list/queue row limit, default 50, maximum 100."),
15073
+ cursor: z31.string().max(2e3).optional().describe("Opaque pagination cursor from a previous list/queue response (continueCursor); omit for the first page."),
15074
+ full: z31.boolean().optional().describe(`list/queue only: return untruncated messages; allowed only when limit <= ${FULL_MESSAGE_MAX_LIMIT}.`)
15062
15075
  });
15063
- var union = z30.discriminatedUnion("action", [
15064
- z30.object({ action: z30.literal("submit"), message: z30.string().min(1).max(1e4).refine(fitsGatewayBytes, byteLimitMessage("message")), category: category.optional(), command: z30.string().max(1e3).optional(), route: z30.string().max(500).optional(), client: z30.string().max(100).optional() }),
15065
- z30.object({ action: z30.literal("list"), status: status.optional(), limit: z30.number().int().min(1).max(100).optional(), cursor: z30.string().max(2e3).optional(), full: z30.boolean().optional() }),
15066
- z30.object({ action: z30.literal("queue"), status: status.optional(), category: category.optional(), groupId: z30.string().min(1).max(200).optional(), workspaceId: z30.string().max(200).optional(), since: z30.number().optional(), before: z30.number().optional(), limit: z30.number().int().min(1).max(100).optional(), cursor: z30.string().max(2e3).optional(), full: z30.boolean().optional() }),
15067
- z30.object({ action: z30.literal("note"), feedbackId: z30.string().min(1).max(200), note: z30.string().max(4e3).refine(fitsGatewayBytes, byteLimitMessage("note")) }),
15068
- z30.object({ action: z30.literal("group"), feedbackIds: z30.array(z30.string().min(1).max(200)).min(1).max(100), groupId: z30.string().min(1).max(200).nullable() }),
15069
- z30.object({ action: z30.literal("status"), feedbackId: z30.string().min(1).max(200), status: vendorStatus })
15076
+ var union = z31.discriminatedUnion("action", [
15077
+ z31.object({ action: z31.literal("submit"), message: z31.string().min(1).max(1e4).refine(fitsGatewayBytes, byteLimitMessage("message")), category: category.optional(), command: z31.string().max(1e3).optional(), route: z31.string().max(500).optional(), client: z31.string().max(100).optional() }),
15078
+ z31.object({ action: z31.literal("list"), status: status.optional(), limit: z31.number().int().min(1).max(100).optional(), cursor: z31.string().max(2e3).optional(), full: z31.boolean().optional() }),
15079
+ z31.object({ action: z31.literal("queue"), status: status.optional(), category: category.optional(), groupId: z31.string().min(1).max(200).optional(), workspaceId: z31.string().max(200).optional(), since: z31.number().optional(), before: z31.number().optional(), limit: z31.number().int().min(1).max(100).optional(), cursor: z31.string().max(2e3).optional(), full: z31.boolean().optional() }),
15080
+ z31.object({ action: z31.literal("note"), feedbackId: z31.string().min(1).max(200), note: z31.string().max(4e3).refine(fitsGatewayBytes, byteLimitMessage("note")) }),
15081
+ z31.object({ action: z31.literal("group"), feedbackIds: z31.array(z31.string().min(1).max(200)).min(1).max(100), groupId: z31.string().min(1).max(200).nullable() }),
15082
+ z31.object({ action: z31.literal("status"), feedbackId: z31.string().min(1).max(200), status: vendorStatus })
15070
15083
  ]);
15071
15084
  var specs = {
15072
15085
  submit: { params: ["message", "category", "command", "route", "client"], description: "message is required; category defaults to other." },
@@ -15193,34 +15206,34 @@ function registerFeedbackTool(server) {
15193
15206
  }
15194
15207
 
15195
15208
  // src/tools/shape.ts
15196
- import { z as z31 } from "zod/v3";
15209
+ import { z as z32 } from "zod/v3";
15197
15210
  var SHAPE_ACTIONS = ["list", "show", "agree", "dismiss"];
15198
15211
  var LIST_DISPOSITIONS = ["pending", "agreed", "dismissed", "expired"];
15199
15212
  var LIST_OUTCOMES = ["not_candidate", "atomic", "compound", "unavailable"];
15200
- var shapeSchema = z31.object({
15201
- action: z31.enum(SHAPE_ACTIONS).describe(
15213
+ var shapeSchema = z32.object({
15214
+ action: z32.enum(SHAPE_ACTIONS).describe(
15202
15215
  "'list': list shape advisories for this workspace, latest per subject. 'show': show one shape advisory by id. 'agree': agree with a compound advisory's split verdict. 'dismiss': dismiss a compound advisory's split verdict."
15203
15216
  ),
15204
- disposition: z31.enum(LIST_DISPOSITIONS).optional().describe(
15217
+ disposition: z32.enum(LIST_DISPOSITIONS).optional().describe(
15205
15218
  "For 'list': filter by disposition. Omitting both disposition and outcome defaults to the actionable set (disposition:pending, outcome:compound)."
15206
15219
  ),
15207
- outcome: z31.enum(LIST_OUTCOMES).optional().describe(
15220
+ outcome: z32.enum(LIST_OUTCOMES).optional().describe(
15208
15221
  "For 'list': filter by outcome. Omitting both disposition and outcome defaults to the actionable set (disposition:pending, outcome:compound)."
15209
15222
  ),
15210
- limit: z31.number().min(1).max(200).optional().describe("For 'list': max rows (default 50, max 200)."),
15211
- rowId: z31.string().max(200).optional().describe("For 'show'/'agree'/'dismiss': the advisory row id."),
15212
- reason: z31.string().max(1e3).optional().describe("For 'agree'/'dismiss': optional reason (capped at 1000 chars).")
15223
+ limit: z32.number().min(1).max(200).optional().describe("For 'list': max rows (default 50, max 200)."),
15224
+ rowId: z32.string().max(200).optional().describe("For 'show'/'agree'/'dismiss': the advisory row id."),
15225
+ reason: z32.string().max(1e3).optional().describe("For 'agree'/'dismiss': optional reason (capped at 1000 chars).")
15213
15226
  });
15214
- var shapeListVariant = z31.object({
15215
- action: z31.literal("list"),
15216
- disposition: z31.enum(LIST_DISPOSITIONS).optional(),
15217
- outcome: z31.enum(LIST_OUTCOMES).optional(),
15218
- limit: z31.number().min(1).max(200).optional()
15227
+ var shapeListVariant = z32.object({
15228
+ action: z32.literal("list"),
15229
+ disposition: z32.enum(LIST_DISPOSITIONS).optional(),
15230
+ outcome: z32.enum(LIST_OUTCOMES).optional(),
15231
+ limit: z32.number().min(1).max(200).optional()
15219
15232
  });
15220
- var shapeShowVariant = z31.object({ action: z31.literal("show"), rowId: z31.string().max(200) });
15221
- var shapeAgreeVariant = z31.object({ action: z31.literal("agree"), rowId: z31.string().max(200), reason: z31.string().max(1e3).optional() });
15222
- var shapeDismissVariant = z31.object({ action: z31.literal("dismiss"), rowId: z31.string().max(200), reason: z31.string().max(1e3).optional() });
15223
- var shapeActionUnion = z31.discriminatedUnion("action", [
15233
+ var shapeShowVariant = z32.object({ action: z32.literal("show"), rowId: z32.string().max(200) });
15234
+ var shapeAgreeVariant = z32.object({ action: z32.literal("agree"), rowId: z32.string().max(200), reason: z32.string().max(1e3).optional() });
15235
+ var shapeDismissVariant = z32.object({ action: z32.literal("dismiss"), rowId: z32.string().max(200), reason: z32.string().max(1e3).optional() });
15236
+ var shapeActionUnion = z32.discriminatedUnion("action", [
15224
15237
  shapeListVariant,
15225
15238
  shapeShowVariant,
15226
15239
  shapeAgreeVariant,
@@ -15887,12 +15900,12 @@ ${entry.labels.map((l) => `- ${l.name ?? l.slug}`).join("\n")}`);
15887
15900
  }
15888
15901
 
15889
15902
  // src/prompts/index.ts
15890
- import { z as z32 } from "zod/v3";
15903
+ import { z as z33 } from "zod/v3";
15891
15904
  function registerPrompts(server) {
15892
15905
  server.prompt(
15893
15906
  "review-against-rules",
15894
15907
  "Review code or a design decision against all business rules for a given domain. Fetches the rules and asks you to do a structured compliance review.",
15895
- { domain: z32.string().describe("Business rule domain (e.g. 'Identity & Access', 'Governance & Decision-Making')") },
15908
+ { domain: z33.string().describe("Business rule domain (e.g. 'Identity & Access', 'Governance & Decision-Making')") },
15896
15909
  async ({ domain }) => {
15897
15910
  const entries = await kernelQuery("chain.listEntries", { collectionSlug: "business-rules" });
15898
15911
  const rules = entries.filter((e) => e.data?.domain === domain);
@@ -15945,7 +15958,7 @@ Provide a structured review with a compliance status for each rule (COMPLIANT /
15945
15958
  server.prompt(
15946
15959
  "name-check",
15947
15960
  "Check variable names, field names, or API names against the glossary for terminology alignment. Flags drift from canonical terms.",
15948
- { names: z32.string().describe("Comma-separated list of names to check (e.g. 'vendor_id, compliance_level, formulator_type')") },
15961
+ { names: z33.string().describe("Comma-separated list of names to check (e.g. 'vendor_id, compliance_level, formulator_type')") },
15949
15962
  async ({ names }) => {
15950
15963
  const terms = await kernelQuery("chain.listEntries", { collectionSlug: "glossary" });
15951
15964
  const glossaryContext = terms.map(
@@ -15981,7 +15994,7 @@ Format as a table: Name | Status | Canonical Form | Action Needed`
15981
15994
  server.prompt(
15982
15995
  "draft-decision-record",
15983
15996
  "Draft a structured decision record from a description of what was decided. Includes context from recent decisions and relevant rules.",
15984
- { context: z32.string().describe("Description of the decision (e.g. 'We decided to use MRSL v3.1 as the conformance baseline because...')") },
15997
+ { context: z33.string().describe("Description of the decision (e.g. 'We decided to use MRSL v3.1 as the conformance baseline because...')") },
15985
15998
  async ({ context }) => {
15986
15999
  const recentDecisions = await kernelQuery("chain.listEntries", { collectionSlug: "decisions" });
15987
16000
  const sorted = [...recentDecisions].sort((a, b) => (b.data?.date ?? "") > (a.data?.date ?? "") ? 1 : -1).slice(0, 5);
@@ -16019,8 +16032,8 @@ After drafting, I can log it using the capture tool with collection "decisions".
16019
16032
  "draft-rule-from-context",
16020
16033
  "Draft a new business rule from an observation or discovery made while coding. Fetches existing rules for the domain to ensure consistency.",
16021
16034
  {
16022
- observation: z32.string().describe("What you observed or discovered (e.g. 'Suppliers can have multiple org types in Gateway')"),
16023
- domain: z32.string().describe("Which domain this rule belongs to (e.g. 'Governance & Decision-Making')")
16035
+ observation: z33.string().describe("What you observed or discovered (e.g. 'Suppliers can have multiple org types in Gateway')"),
16036
+ domain: z33.string().describe("Which domain this rule belongs to (e.g. 'Governance & Decision-Making')")
16024
16037
  },
16025
16038
  async ({ observation, domain }) => {
16026
16039
  const allRules = await kernelQuery("chain.listEntries", { collectionSlug: "business-rules" });
@@ -16296,4 +16309,4 @@ export {
16296
16309
  createProductBrainServer,
16297
16310
  initFeatureFlags
16298
16311
  };
16299
- //# sourceMappingURL=chunk-KTRECBYJ.js.map
16312
+ //# sourceMappingURL=chunk-KFXZUDFK.js.map