@productbrain/mcp 0.0.1-beta.7395 → 0.0.1-beta.7400

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.
@@ -41,7 +41,7 @@ import {
41
41
  trackSessionCaptureRate,
42
42
  trackWriteBackHintServed,
43
43
  trackZeroCaptureAuditFired
44
- } from "./chunk-SU5XEDCF.js";
44
+ } from "./chunk-W3MMAXXC.js";
45
45
 
46
46
  // src/server.ts
47
47
  import { McpServer as McpServer2 } from "@modelcontextprotocol/sdk/server/mcp.js";
@@ -555,9 +555,13 @@ var TOOL_NAME_MIGRATIONS = /* @__PURE__ */ new Map([
555
555
  ["health", 'workspace action="check|whoami|status|audit|self-test" (same action names)'],
556
556
  ["verify", 'quality action="verify-chain"'],
557
557
  ["verify-entry", 'entries action="verify"'],
558
- ["skills", 'workflows action="load-skill"'],
558
+ // WP-776 S3f: the `skills` and `record_activation` legacy tool names had no replacement
559
+ // action left once the setup-assets system (and its telemetry) was deleted — retargeted
560
+ // from executable replacements to NOTICE rows, same shape as `chain-version`/`chain-branch`
561
+ // below, so the coach never points an agent at a dead action.
562
+ ["skills", "closed \u2014 the setup-assets system this tool loaded skill bodies from has been retired. There is no supported way to load a skill body by entry id through MCP."],
559
563
  ["start_pb", 'orient action="start"'],
560
- ["record_activation", 'orient action="record-activation"'],
564
+ ["record_activation", "closed \u2014 the setup-assets activation telemetry this tool wrote has been retired. There is no supported way to record an activation receipt through MCP."],
561
565
  ["get-usage-summary", 'workspace action="usage"'],
562
566
  ["audit", 'quality action="audit"'],
563
567
  ["governance-proposals", 'workspace action="proposals-list|proposals-respond|proposals-count" (list/respond/count \u2192 proposals-<same>)'],
@@ -6726,7 +6730,7 @@ async function handleExport() {
6726
6730
  }
6727
6731
 
6728
6732
  // src/tools/orient.ts
6729
- import { z as z19 } from "zod/v3";
6733
+ import { z as z18 } from "zod/v3";
6730
6734
 
6731
6735
  // src/tools/planned-work.ts
6732
6736
  function buildPlannedWork(allEntries) {
@@ -8220,45 +8224,6 @@ ${FEEDBACK_SUBMIT_HINT}` }],
8220
8224
  };
8221
8225
  }
8222
8226
 
8223
- // src/tools/record_activation.ts
8224
- import { z as z18 } from "zod/v3";
8225
- var recordActivationSchema = z18.object({
8226
- confirmedEntryCount: z18.number().int().min(0).describe(
8227
- "Confirmed-entry count from the Phase 4 capture loop. The mutation enforces >=10."
8228
- ),
8229
- entriesAcrossCollections: z18.number().int().min(0).describe(
8230
- "Number of distinct collections those entries span. The mutation enforces >=2 (diversity soft-gate)."
8231
- ),
8232
- retrievalDemoConfirmed: z18.boolean().describe(
8233
- "True if the retrieval round-trip ran successfully in Phase 4. The mutation rejects false."
8234
- )
8235
- });
8236
- async function handleRecordActivation({
8237
- confirmedEntryCount,
8238
- entriesAcrossCollections,
8239
- retrievalDemoConfirmed
8240
- }) {
8241
- const mutationResult = await kernelMutation(
8242
- "setup.recordActivationReceipt",
8243
- {
8244
- surfaceCapability: "chat-only",
8245
- confirmedEntryCount,
8246
- entriesAcrossCollections,
8247
- retrievalDemoConfirmed
8248
- }
8249
- );
8250
- const result2 = {
8251
- activated: true,
8252
- alreadyActivated: mutationResult.alreadyActivated,
8253
- receiptId: mutationResult.receiptId ?? null
8254
- };
8255
- const summary = mutationResult.alreadyActivated ? "Activation receipt already recorded \u2014 chat-only flow short-circuits." : "Activation recorded \u2014 chat-only flow complete.";
8256
- return {
8257
- content: textContent(summary),
8258
- structuredContent: success(summary, result2)
8259
- };
8260
- }
8261
-
8262
8227
  // src/tools/orient.ts
8263
8228
  var PURPOSE_GAP_PREFIX = "purpose-gap-";
8264
8229
  var READINESS_GAPS_MAX = 50;
@@ -8292,75 +8257,55 @@ async function markOrientedWithSnapshotFallback(agentSessionId, coherenceSnapsho
8292
8257
  }
8293
8258
  }
8294
8259
  }
8295
- var ORIENT_ACTIONS = ["start", "task", "record-activation"];
8296
- var orientSchema = z19.object({
8297
- action: z19.enum(ORIENT_ACTIONS).optional().default("task").describe(
8298
- "'start': universal session opener (absorbs start_pb) \u2014 a standup briefing for every workspace state, fresh or active. 'task': task-grounded context loader \u2014 the original orient behavior. 'record-activation': chat-only activation receipt writer (absorbs record_activation)."
8260
+ var ORIENT_ACTIONS = ["start", "task"];
8261
+ var orientSchema = z18.object({
8262
+ action: z18.enum(ORIENT_ACTIONS).optional().default("task").describe(
8263
+ "'start': universal session opener (absorbs start_pb) \u2014 a standup briefing for every workspace state, fresh or active. 'task': task-grounded context loader \u2014 the original orient behavior."
8299
8264
  ),
8300
- 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."),
8301
- tier: z19.enum(["summary", "standard", "full"]).optional().describe(
8265
+ 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."),
8266
+ tier: z18.enum(["summary", "standard", "full"]).optional().describe(
8302
8267
  "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."
8303
8268
  ),
8304
- task: z19.string().max(2e3).optional().describe(
8269
+ task: z18.string().max(2e3).optional().describe(
8305
8270
  "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."
8306
8271
  ),
8307
8272
  // D1d (WP-754/TASK-204): nested to match the server's StartupResolutionSignals shape, every
8308
8273
  // field optional, sanitized server-side. Domain resolution (this envelope's original purpose)
8309
8274
  // is deleted; the sole surviving consumer is `context.served` activation telemetry.
8310
- startupSignals: z19.object({
8311
- 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)."),
8312
- reviewedArtifactRefs: z19.array(z19.string()).max(25).optional().describe("Chain entry IDs the caller has already reviewed this session, if tracked."),
8313
- branchName: z19.string().max(120).optional().describe("Current git branch name, if known."),
8314
- worktreeName: z19.string().max(120).optional().describe("Current worktree/directory name, if known.")
8275
+ startupSignals: z18.object({
8276
+ 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)."),
8277
+ reviewedArtifactRefs: z18.array(z18.string()).max(25).optional().describe("Chain entry IDs the caller has already reviewed this session, if tracked."),
8278
+ branchName: z18.string().max(120).optional().describe("Current git branch name, if known."),
8279
+ worktreeName: z18.string().max(120).optional().describe("Current worktree/directory name, if known.")
8315
8280
  }).optional().describe("For 'task': best-effort startup signals \u2014 changedPaths/reviewedArtifactRefs/branchName/worktreeName. All optional; omit fields you don't know."),
8316
- 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."),
8317
- confirmedEntryCount: z19.number().int().min(0).optional().describe(
8318
- "For 'record-activation': confirmed-entry count from the Phase 4 capture loop. The mutation enforces >=10."
8319
- ),
8320
- entriesAcrossCollections: z19.number().int().min(0).optional().describe(
8321
- "For 'record-activation': number of distinct collections those entries span. The mutation enforces >=2 (diversity soft-gate)."
8322
- ),
8323
- retrievalDemoConfirmed: z19.boolean().optional().describe(
8324
- "For 'record-activation': true if the retrieval round-trip ran successfully in Phase 4. The mutation rejects false."
8325
- )
8281
+ 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.")
8326
8282
  });
8327
- var orientStartVariant = z19.object({
8328
- action: z19.literal("start"),
8329
- task: z19.string().max(2e3).optional()
8283
+ var orientStartVariant = z18.object({
8284
+ action: z18.literal("start"),
8285
+ task: z18.string().max(2e3).optional()
8330
8286
  });
8331
- var orientTaskVariant = z19.object({
8332
- action: z19.literal("task"),
8333
- mode: z19.enum(["full", "brief"]).optional().default("full"),
8334
- tier: z19.enum(["summary", "standard", "full"]).optional(),
8335
- task: z19.string().max(2e3).optional(),
8287
+ var orientTaskVariant = z18.object({
8288
+ action: z18.literal("task"),
8289
+ mode: z18.enum(["full", "brief"]).optional().default("full"),
8290
+ tier: z18.enum(["summary", "standard", "full"]).optional(),
8291
+ task: z18.string().max(2e3).optional(),
8336
8292
  // WP-486 Slice 1 (FEAT-1371) — mirrors orientSchema's top-level declaration above; see its
8337
8293
  // doc comment for the shape rationale.
8338
- startupSignals: z19.object({
8339
- changedPaths: z19.array(z19.string()).max(25).optional(),
8340
- reviewedArtifactRefs: z19.array(z19.string()).max(25).optional(),
8341
- branchName: z19.string().max(120).optional(),
8342
- worktreeName: z19.string().max(120).optional()
8294
+ startupSignals: z18.object({
8295
+ changedPaths: z18.array(z18.string()).max(25).optional(),
8296
+ reviewedArtifactRefs: z18.array(z18.string()).max(25).optional(),
8297
+ branchName: z18.string().max(120).optional(),
8298
+ worktreeName: z18.string().max(120).optional()
8343
8299
  }).optional(),
8344
- invocationPath: z19.enum(["session-start", "session-close", "manual-orient", "handshake", "unknown"]).optional()
8345
- });
8346
- var orientRecordActivationVariant = z19.object({
8347
- action: z19.literal("record-activation"),
8348
- confirmedEntryCount: z19.number().int().min(0),
8349
- entriesAcrossCollections: z19.number().int().min(0),
8350
- retrievalDemoConfirmed: z19.boolean()
8300
+ invocationPath: z18.enum(["session-start", "session-close", "manual-orient", "handshake", "unknown"]).optional()
8351
8301
  });
8352
- var orientActionUnion = z19.discriminatedUnion("action", [
8302
+ var orientActionUnion = z18.discriminatedUnion("action", [
8353
8303
  orientStartVariant,
8354
- orientTaskVariant,
8355
- orientRecordActivationVariant
8304
+ orientTaskVariant
8356
8305
  ]);
8357
8306
  var ORIENT_ACTION_SPECS = {
8358
8307
  start: { params: ["task"], description: "Universal session opener; task is optional." },
8359
- task: { params: ["mode", "tier", "task"], description: "Task-grounded context loader; all params optional." },
8360
- "record-activation": {
8361
- params: ["confirmedEntryCount", "entriesAcrossCollections", "retrievalDemoConfirmed"],
8362
- description: "All three fields are required."
8363
- }
8308
+ task: { params: ["mode", "tier", "task"], description: "Task-grounded context loader; all params optional." }
8364
8309
  };
8365
8310
  function taskGroundingWarningLines(task, hasTaskGrounding = false) {
8366
8311
  if (hasTaskGrounding) return [];
@@ -8390,20 +8335,15 @@ function registerOrientTool(server) {
8390
8335
  task: data.task,
8391
8336
  startupSignals: data.startupSignals,
8392
8337
  invocationPath: data.invocationPath
8393
- }),
8394
- "record-activation": (data) => handleRecordActivation({
8395
- confirmedEntryCount: data.confirmedEntryCount,
8396
- entriesAcrossCollections: data.entriesAcrossCollections,
8397
- retrievalDemoConfirmed: data.retrievalDemoConfirmed
8398
8338
  })
8399
8339
  };
8400
8340
  server.registerTool(
8401
8341
  "orient",
8402
8342
  {
8403
8343
  title: "Orient",
8404
- description: "Workspace orientation and session bootstrapping. Three actions:\n\n- **start**: Universal opener (absorbs `start_pb`) \u2014 say 'Start PB' to begin every session. Returns a standup briefing for every workspace state, fresh or active. Orients the CURRENT session \u2014 it does not create one; for writes, call `session action=start` first.\n- **task**: Task-grounded context loader (the original `orient` behavior). Use after `action=start` to load governance and context for a specific task. Completing orientation unlocks write tools.\n- **record-activation**: Chat-only activation receipt writer (absorbs `record_activation`) \u2014 closes the install-to-activation arc for chat-only surfaces.\n\n**tier** (action=task): Controls payload depth.\n- `summary` (~10 KB) \u2014 compact, calibrated for task-scoped retrieval.\n- `standard` (~256 KB) \u2014 rich, suited to workspace standups.\n- `full` \u2014 complete payload, no cap. Use with deliberation.\n\nThe spine (vision, purpose, strategy highlights) is served in full and a grounding status flags when context was reduced.\n\nDefaults: `summary` when `task` is provided; `standard` when `task` is absent. Explicit `tier` always wins.\n\n**mode** (action=task): `full` (default) returns full context. `brief` returns compact summary \u2014 mapped to tier=summary internally.",
8344
+ description: "Workspace orientation and session bootstrapping. Two actions:\n\n- **start**: Universal opener (absorbs `start_pb`) \u2014 say 'Start PB' to begin every session. Returns a standup briefing for every workspace state, fresh or active. Orients the CURRENT session \u2014 it does not create one; for writes, call `session action=start` first.\n- **task**: Task-grounded context loader (the original `orient` behavior). Use after `action=start` to load governance and context for a specific task. Completing orientation unlocks write tools.\n\n**tier** (action=task): Controls payload depth.\n- `summary` (~10 KB) \u2014 compact, calibrated for task-scoped retrieval.\n- `standard` (~256 KB) \u2014 rich, suited to workspace standups.\n- `full` \u2014 complete payload, no cap. Use with deliberation.\n\nThe spine (vision, purpose, strategy highlights) is served in full and a grounding status flags when context was reduced.\n\nDefaults: `summary` when `task` is provided; `standard` when `task` is absent. Explicit `tier` always wins.\n\n**mode** (action=task): `full` (default) returns full context. `brief` returns compact summary \u2014 mapped to tier=summary internally.",
8405
8345
  inputSchema: orientSchema,
8406
- // Mixed read/write noun (§3 R3): 'start'/'record-activation' write session state.
8346
+ // Mixed read/write noun (§3 R3): 'start' writes session state.
8407
8347
  annotations: { readOnlyHint: false, idempotentHint: true, openWorldHint: false }
8408
8348
  },
8409
8349
  thinWrapper(async (args) => {
@@ -9134,22 +9074,7 @@ async function _handleOrient({ mode = "full", tier, task, startupSignals, invoca
9134
9074
  }
9135
9075
 
9136
9076
  // src/tools/workflows.ts
9137
- import { z as z21 } from "zod/v3";
9138
-
9139
- // src/tools/skills.ts
9140
- import { z as z20 } from "zod/v3";
9141
- var skillsSchema = z20.object({
9142
- entryId: z20.string().min(1).describe(
9143
- "Workspace-scoped skill entry id (e.g. 'SKILL-pb-setup'). The tool refuses non-skill entries (canonicalKey !== 'skill') with INVALID_KIND."
9144
- )
9145
- });
9146
- async function loadSkillBody(entryId) {
9147
- const workspaceId = await getWorkspaceId();
9148
- return await kernelQuery("setup.getSkillBody", {
9149
- workspaceId,
9150
- entryId
9151
- });
9152
- }
9077
+ import { z as z19 } from "zod/v3";
9153
9078
 
9154
9079
  // src/workflows/descriptor.ts
9155
9080
  function cloneWorkflowQuestion(question) {
@@ -9988,88 +9913,84 @@ function workflowRunOutputToText(output) {
9988
9913
  }
9989
9914
 
9990
9915
  // src/tools/workflows.ts
9991
- var WORKFLOWS_ACTIONS = ["list", "start", "checkpoint", "get-run", "load-skill"];
9992
- var jsonValueSchema = z21.lazy(
9993
- () => z21.union([
9994
- z21.string(),
9995
- z21.number(),
9996
- z21.boolean(),
9997
- z21.null(),
9998
- z21.array(jsonValueSchema),
9999
- z21.record(jsonValueSchema)
9916
+ var WORKFLOWS_ACTIONS = ["list", "start", "checkpoint", "get-run"];
9917
+ var jsonValueSchema = z19.lazy(
9918
+ () => z19.union([
9919
+ z19.string(),
9920
+ z19.number(),
9921
+ z19.boolean(),
9922
+ z19.null(),
9923
+ z19.array(jsonValueSchema),
9924
+ z19.record(jsonValueSchema)
10000
9925
  ])
10001
9926
  );
10002
- var workflowRunOutputInputSchema = z21.union([
10003
- z21.object({
10004
- format: z21.literal("freetext"),
10005
- value: z21.string()
9927
+ var workflowRunOutputInputSchema = z19.union([
9928
+ z19.object({
9929
+ format: z19.literal("freetext"),
9930
+ value: z19.string()
10006
9931
  }),
10007
- z21.object({
10008
- format: z21.literal("list"),
10009
- value: z21.array(z21.string())
9932
+ z19.object({
9933
+ format: z19.literal("list"),
9934
+ value: z19.array(z19.string())
10010
9935
  }),
10011
- z21.object({
10012
- format: z21.literal("choice"),
10013
- value: z21.union([z21.string(), z21.array(z21.string())])
9936
+ z19.object({
9937
+ format: z19.literal("choice"),
9938
+ value: z19.union([z19.string(), z19.array(z19.string())])
10014
9939
  }),
10015
- z21.object({
10016
- format: z21.literal("structured"),
9940
+ z19.object({
9941
+ format: z19.literal("structured"),
10017
9942
  value: jsonValueSchema
10018
9943
  })
10019
9944
  ]);
10020
- var workflowsSchema = z21.object({
10021
- action: z21.enum(WORKFLOWS_ACTIONS).describe(
10022
- "'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."
9945
+ var workflowsSchema = z19.object({
9946
+ action: z19.enum(WORKFLOWS_ACTIONS).describe(
9947
+ "'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."
10023
9948
  ),
10024
- workflowId: z21.string().max(200).optional().describe("Workflow ID for start, checkpoint, or get-run, e.g. 'retro', 'implementation-review'"),
10025
- runId: z21.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)."),
10026
- roundId: z21.string().max(200).optional().describe("Round ID for checkpoint, e.g. 'what-went-well'"),
10027
- output: z21.union([z21.string(), workflowRunOutputInputSchema]).optional().describe("The round's output \u2014 either legacy synthesized text or a typed workflow run payload."),
10028
- isFinal: z21.boolean().optional().describe("If true, finalize an existing durable workflow run from its terminal round and create the summary chain entry."),
10029
- restart: z21.boolean().optional().describe("If true, start a new durable run from the workflow's first round in the current session."),
10030
- summaryName: z21.string().max(500).optional().describe("Optional name for final chain entry. If omitted, the workflow summary template is used."),
10031
- summaryDescription: z21.string().max(2e4).optional().describe("Optional override for the final chain entry description. Defaults to the final round output text."),
10032
- summaryEntryId: z21.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."),
10033
- entryId: z21.string().max(200).optional().describe("For 'load-skill': skill entry id (e.g. 'SETUP-SKILL-SHAPE'). Refuses non-skill entries (canonicalKey !== 'skill') with INVALID_KIND."),
9949
+ workflowId: z19.string().max(200).optional().describe("Workflow ID for start, checkpoint, or get-run, e.g. 'retro', 'implementation-review'"),
9950
+ 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)."),
9951
+ roundId: z19.string().max(200).optional().describe("Round ID for checkpoint, e.g. 'what-went-well'"),
9952
+ output: z19.union([z19.string(), workflowRunOutputInputSchema]).optional().describe("The round's output \u2014 either legacy synthesized text or a typed workflow run payload."),
9953
+ isFinal: z19.boolean().optional().describe("If true, finalize an existing durable workflow run from its terminal round and create the summary chain entry."),
9954
+ restart: z19.boolean().optional().describe("If true, start a new durable run from the workflow's first round in the current session."),
9955
+ summaryName: z19.string().max(500).optional().describe("Optional name for final chain entry. If omitted, the workflow summary template is used."),
9956
+ summaryDescription: z19.string().max(2e4).optional().describe("Optional override for the final chain entry description. Defaults to the final round output text."),
9957
+ 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."),
10034
9958
  // WP-513: team+role to create the finalize summary AS OWNER of (rung 2 only).
10035
- ownerTeamEntryId: z21.string().max(200).optional().describe("For 'checkpoint' (isFinal): owning team (rung-2)."),
10036
- ownerRoleEntryId: z21.string().max(200).optional().describe("For 'checkpoint' (isFinal): owning role (rung-2).")
9959
+ ownerTeamEntryId: z19.string().max(200).optional().describe("For 'checkpoint' (isFinal): owning team (rung-2)."),
9960
+ ownerRoleEntryId: z19.string().max(200).optional().describe("For 'checkpoint' (isFinal): owning role (rung-2).")
10037
9961
  });
10038
- var workflowsListVariant = z21.object({ action: z21.literal("list") });
10039
- var workflowsGetRunVariant = z21.object({
10040
- action: z21.literal("get-run"),
10041
- runId: z21.string().max(200).optional(),
10042
- workflowId: z21.string().max(200).optional()
9962
+ var workflowsListVariant = z19.object({ action: z19.literal("list") });
9963
+ var workflowsGetRunVariant = z19.object({
9964
+ action: z19.literal("get-run"),
9965
+ runId: z19.string().max(200).optional(),
9966
+ workflowId: z19.string().max(200).optional()
10043
9967
  });
10044
- var workflowsStartVariant = z21.object({ action: z21.literal("start"), workflowId: z21.string().max(200) });
10045
- var workflowsCheckpointVariant = z21.object({
10046
- action: z21.literal("checkpoint"),
10047
- workflowId: z21.string().max(200),
10048
- roundId: z21.string().max(200),
10049
- output: z21.union([z21.string(), workflowRunOutputInputSchema]),
10050
- isFinal: z21.boolean().optional(),
10051
- restart: z21.boolean().optional(),
10052
- summaryName: z21.string().max(500).optional(),
10053
- summaryDescription: z21.string().max(2e4).optional(),
10054
- summaryEntryId: z21.string().max(200).optional(),
10055
- runId: z21.string().max(200).optional(),
10056
- ownerTeamEntryId: z21.string().max(200).optional(),
10057
- ownerRoleEntryId: z21.string().max(200).optional()
9968
+ var workflowsStartVariant = z19.object({ action: z19.literal("start"), workflowId: z19.string().max(200) });
9969
+ var workflowsCheckpointVariant = z19.object({
9970
+ action: z19.literal("checkpoint"),
9971
+ workflowId: z19.string().max(200),
9972
+ roundId: z19.string().max(200),
9973
+ output: z19.union([z19.string(), workflowRunOutputInputSchema]),
9974
+ isFinal: z19.boolean().optional(),
9975
+ restart: z19.boolean().optional(),
9976
+ summaryName: z19.string().max(500).optional(),
9977
+ summaryDescription: z19.string().max(2e4).optional(),
9978
+ summaryEntryId: z19.string().max(200).optional(),
9979
+ runId: z19.string().max(200).optional(),
9980
+ ownerTeamEntryId: z19.string().max(200).optional(),
9981
+ ownerRoleEntryId: z19.string().max(200).optional()
10058
9982
  });
10059
- var workflowsLoadSkillVariant = z21.object({ action: z21.literal("load-skill"), entryId: z21.string().max(200).min(1) });
10060
- var workflowsActionUnion = z21.discriminatedUnion("action", [
9983
+ var workflowsActionUnion = z19.discriminatedUnion("action", [
10061
9984
  workflowsListVariant,
10062
9985
  workflowsGetRunVariant,
10063
9986
  workflowsStartVariant,
10064
- workflowsCheckpointVariant,
10065
- workflowsLoadSkillVariant
9987
+ workflowsCheckpointVariant
10066
9988
  ]);
10067
9989
  var WORKFLOWS_ACTION_SPECS = {
10068
9990
  list: { params: [], description: "Browse available workflows; no params." },
10069
9991
  "get-run": { params: ["runId", "workflowId"], description: "runId or workflowId is required." },
10070
9992
  start: { params: ["workflowId"], description: "workflowId is required." },
10071
- checkpoint: { params: ["workflowId", "roundId", "output", "isFinal", "restart", "summaryName", "summaryDescription", "summaryEntryId", "runId", "ownerTeamEntryId", "ownerRoleEntryId"], description: "workflowId, roundId, and output are required." },
10072
- "load-skill": { params: ["entryId"], description: "entryId is required." }
9993
+ checkpoint: { params: ["workflowId", "roundId", "output", "isFinal", "restart", "summaryName", "summaryDescription", "summaryEntryId", "runId", "ownerTeamEntryId", "ownerRoleEntryId"], description: "workflowId, roundId, and output are required." }
10073
9994
  };
10074
9995
  function formatWorkflowCard(wf) {
10075
9996
  const roundList = wf.rounds.map((r) => ` ${r.num}. ${r.label} (${r.type}, ~${r.maxDurationHint ?? "?"})`).join("\n");
@@ -10149,18 +10070,13 @@ function registerWorkflowTools(server) {
10149
10070
  data.runId,
10150
10071
  data.ownerTeamEntryId,
10151
10072
  data.ownerRoleEntryId
10152
- ),
10153
- "load-skill": async (data) => {
10154
- const result2 = await loadSkillBody(data.entryId);
10155
- const summary = `Loaded ${result2.entryId} (${result2.body.length} chars).`;
10156
- return { content: textContent(result2.body), structuredContent: success(summary, result2) };
10157
- }
10073
+ )
10158
10074
  };
10159
10075
  server.registerTool(
10160
10076
  "workflows",
10161
10077
  {
10162
10078
  title: "Workflows",
10163
- description: "Chainwork workflow discovery, start/resume, checkpointing, run inspection, and skill loading. Five actions:\n\n- **list**: Browse available workflows \u2014 retro, shape-a-bet, implementation-review, process-change.\n- **start**: Start or resume a workflow. Call with workflowId (e.g. 'implementation-review', 'retro', 'shape', 'process-change'). Returns the first (or current) round instructions and the exact checkpoint call to use when the round is complete. Use this when the user says 'run implementation review', 'run retro', 'shape this', or 'process change' \u2014 it is the tool entry point for running a workflow.\n- **checkpoint**: Record round output during Facilitator Mode. Persists progress. At completion, some workflows support isFinal=true to create the summary chain entry.\n- **get-run**: Inspect a persisted workflow run by run ID or by workflow ID in the current session.\n- **load-skill**: Load the markdown body of a SKILL-* entry from the current workspace (absorbs `skills`). Generic loader \u2014 works for any skill the workspace has, e.g. SETUP-SKILL-SHAPE, SETUP-SKILL-REVIEW. Returns a not-found error if the workspace has no matching skill entry.",
10079
+ description: "Chainwork workflow discovery, start/resume, checkpointing, and run inspection. Four actions:\n\n- **list**: Browse available workflows \u2014 retro, shape-a-bet, implementation-review, process-change.\n- **start**: Start or resume a workflow. Call with workflowId (e.g. 'implementation-review', 'retro', 'shape', 'process-change'). Returns the first (or current) round instructions and the exact checkpoint call to use when the round is complete. Use this when the user says 'run implementation review', 'run retro', 'shape this', or 'process change' \u2014 it is the tool entry point for running a workflow.\n- **checkpoint**: Record round output during Facilitator Mode. Persists progress. At completion, some workflows support isFinal=true to create the summary chain entry.\n- **get-run**: Inspect a persisted workflow run by run ID or by workflow ID in the current session.",
10164
10080
  inputSchema: workflowsSchema,
10165
10081
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false }
10166
10082
  },
@@ -10797,10 +10713,10 @@ function parseListOutput(output) {
10797
10713
  }
10798
10714
 
10799
10715
  // src/tools/quality.ts
10800
- import { z as z23 } from "zod/v3";
10716
+ import { z as z21 } from "zod/v3";
10801
10717
 
10802
10718
  // src/tools/audit.ts
10803
- import { z as z22 } from "zod/v3";
10719
+ import { z as z20 } from "zod/v3";
10804
10720
  var VOCAB_TTL_MS = 5 * 60 * 1e3;
10805
10721
  var MAX_VOCAB_KEYS = 100;
10806
10722
  var vocabCache = /* @__PURE__ */ new Map();
@@ -10830,12 +10746,12 @@ function evictVocabIfFull() {
10830
10746
  }
10831
10747
  }
10832
10748
  var AUDIT_ACTIONS = ["run"];
10833
- var auditSchema = z22.object({
10834
- action: z22.enum(AUDIT_ACTIONS).describe(
10749
+ var auditSchema = z20.object({
10750
+ action: z20.enum(AUDIT_ACTIONS).describe(
10835
10751
  "'run': run the hygiene audit for a work package entry."
10836
10752
  ),
10837
- entryId: z22.string().describe("Work package entry ID to audit, e.g. '<PREFIX>-<n>'"),
10838
- phase: z22.enum(["shaping", "handoff"]).default("shaping").optional().describe(
10753
+ entryId: z20.string().describe("Work package entry ID to audit, e.g. '<PREFIX>-<n>'"),
10754
+ phase: z20.enum(["shaping", "handoff"]).default("shaping").optional().describe(
10839
10755
  "'shaping': check shaping-phase fields only. 'handoff': check all required fields including buildContract/buildSequence/exclusions/risks. Default: shaping."
10840
10756
  )
10841
10757
  });
@@ -11112,44 +11028,44 @@ async function handleSpineCheck(story, refresh = false) {
11112
11028
 
11113
11029
  // src/tools/quality.ts
11114
11030
  var QUALITY_ACTIONS = ["check", "re-evaluate", "verify-chain", "audit", "spine-check"];
11115
- var qualitySchema = z23.object({
11116
- action: z23.enum(QUALITY_ACTIONS).describe(
11031
+ var qualitySchema = z21.object({
11032
+ action: z21.enum(QUALITY_ACTIONS).describe(
11117
11033
  "'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 work package entry \u2014 absorbs `audit`. 'spine-check': structural completeness of the purpose+vision+strategy spine \u2014 story:true also runs the on-demand one-story judgment."
11118
11034
  ),
11119
- entryId: z23.string().max(200).optional().describe("For 'check'/'re-evaluate'/'audit': entry ID, e.g. 'TEN-graph-db', '<PREFIX>-<n>'."),
11120
- context: z23.enum(["capture", "commit", "review"]).default("review").optional().describe("For re-evaluate: evaluation context"),
11121
- collection: z23.string().max(200).optional().describe("For 'verify-chain': collection slug to verify (default: glossary)."),
11122
- mode: z23.enum(["report", "fix"]).optional().describe("For 'verify-chain': 'report' = read-only trust report (default). 'fix' = also update drifted codeMapping statuses."),
11123
- phase: z23.enum(["shaping", "handoff"]).optional().describe(
11035
+ entryId: z21.string().max(200).optional().describe("For 'check'/'re-evaluate'/'audit': entry ID, e.g. 'TEN-graph-db', '<PREFIX>-<n>'."),
11036
+ context: z21.enum(["capture", "commit", "review"]).default("review").optional().describe("For re-evaluate: evaluation context"),
11037
+ collection: z21.string().max(200).optional().describe("For 'verify-chain': collection slug to verify (default: glossary)."),
11038
+ mode: z21.enum(["report", "fix"]).optional().describe("For 'verify-chain': 'report' = read-only trust report (default). 'fix' = also update drifted codeMapping statuses."),
11039
+ phase: z21.enum(["shaping", "handoff"]).optional().describe(
11124
11040
  "For 'audit': 'shaping' checks shaping-phase fields only (default). 'handoff' checks all required fields including buildContract/buildSequence/exclusions/risks."
11125
11041
  ),
11126
- story: z23.boolean().optional().describe("For 'spine-check': also run the on-demand one-story LLM judgment (never scheduled; result labelled [unvalidated])."),
11127
- refresh: z23.boolean().optional().describe(
11042
+ story: z21.boolean().optional().describe("For 'spine-check': also run the on-demand one-story LLM judgment (never scheduled; result labelled [unvalidated])."),
11043
+ refresh: z21.boolean().optional().describe(
11128
11044
  "For 'spine-check': force a new run even if a fresh verdict already exists. Default false \u2014 a plain call NEVER re-triggers work just to read the last result; it auto-schedules only when no run is already in flight AND the stored verdict is absent/stale/missing the requested story pass."
11129
11045
  )
11130
11046
  });
11131
- var qualityCheckVariant = z23.object({ action: z23.literal("check"), entryId: z23.string().max(200) });
11132
- var qualityReEvaluateVariant = z23.object({
11133
- action: z23.literal("re-evaluate"),
11134
- entryId: z23.string().max(200),
11135
- context: z23.enum(["capture", "commit", "review"]).optional().default("review")
11047
+ var qualityCheckVariant = z21.object({ action: z21.literal("check"), entryId: z21.string().max(200) });
11048
+ var qualityReEvaluateVariant = z21.object({
11049
+ action: z21.literal("re-evaluate"),
11050
+ entryId: z21.string().max(200),
11051
+ context: z21.enum(["capture", "commit", "review"]).optional().default("review")
11136
11052
  });
11137
- var qualityVerifyChainVariant = z23.object({
11138
- action: z23.literal("verify-chain"),
11139
- collection: z23.string().max(200).optional().default("glossary"),
11140
- mode: z23.enum(["report", "fix"]).optional().default("report")
11053
+ var qualityVerifyChainVariant = z21.object({
11054
+ action: z21.literal("verify-chain"),
11055
+ collection: z21.string().max(200).optional().default("glossary"),
11056
+ mode: z21.enum(["report", "fix"]).optional().default("report")
11141
11057
  });
11142
- var qualityAuditVariant = z23.object({
11143
- action: z23.literal("audit"),
11144
- entryId: z23.string().max(200),
11145
- phase: z23.enum(["shaping", "handoff"]).optional().default("shaping")
11058
+ var qualityAuditVariant = z21.object({
11059
+ action: z21.literal("audit"),
11060
+ entryId: z21.string().max(200),
11061
+ phase: z21.enum(["shaping", "handoff"]).optional().default("shaping")
11146
11062
  });
11147
- var qualitySpineCheckVariant = z23.object({
11148
- action: z23.literal("spine-check"),
11149
- story: z23.boolean().optional().default(false),
11150
- refresh: z23.boolean().optional().default(false)
11063
+ var qualitySpineCheckVariant = z21.object({
11064
+ action: z21.literal("spine-check"),
11065
+ story: z21.boolean().optional().default(false),
11066
+ refresh: z21.boolean().optional().default(false)
11151
11067
  });
11152
- var qualityActionUnion = z23.discriminatedUnion("action", [
11068
+ var qualityActionUnion = z21.discriminatedUnion("action", [
11153
11069
  qualityCheckVariant,
11154
11070
  qualityReEvaluateVariant,
11155
11071
  qualityVerifyChainVariant,
@@ -11163,43 +11079,43 @@ var QUALITY_ACTION_SPECS = {
11163
11079
  audit: { params: ["entryId", "phase"], description: "entryId is required." },
11164
11080
  "spine-check": { params: ["story", "refresh"], description: "All params optional; story and refresh default to false \u2014 a plain call never re-triggers work, it just reads back the latest verdict (auto-refreshing only when stale/absent)." }
11165
11081
  };
11166
- var qualityCheckOutputSchema = z23.object({
11167
- entryId: z23.string(),
11082
+ var qualityCheckOutputSchema = z21.object({
11083
+ entryId: z21.string(),
11168
11084
  /** WP-480 S1: false = the ID does not resolve to an entry (typo/deleted) — distinct from "no verdict yet". */
11169
- entryFound: z23.boolean().optional(),
11170
- hasVerdict: z23.boolean(),
11085
+ entryFound: z21.boolean().optional(),
11086
+ hasVerdict: z21.boolean(),
11171
11087
  /** WP-480 S1: the verdict was judged against content the entry no longer has — re-evaluate for a current one. */
11172
- stale: z23.boolean().optional(),
11173
- tier: z23.string().optional(),
11174
- passed: z23.boolean().optional(),
11175
- criteria: z23.array(z23.object({
11176
- id: z23.string(),
11177
- passed: z23.boolean(),
11178
- hint: z23.string().optional()
11088
+ stale: z21.boolean().optional(),
11089
+ tier: z21.string().optional(),
11090
+ passed: z21.boolean().optional(),
11091
+ criteria: z21.array(z21.object({
11092
+ id: z21.string(),
11093
+ passed: z21.boolean(),
11094
+ hint: z21.string().optional()
11179
11095
  }))
11180
11096
  });
11181
- var qualityReevaluateOutputSchema = z23.object({
11182
- entryId: z23.string(),
11183
- context: z23.string(),
11184
- score: z23.number(),
11185
- maxScore: z23.number(),
11186
- improved: z23.boolean()
11097
+ var qualityReevaluateOutputSchema = z21.object({
11098
+ entryId: z21.string(),
11099
+ context: z21.string(),
11100
+ score: z21.number(),
11101
+ maxScore: z21.number(),
11102
+ improved: z21.boolean()
11187
11103
  });
11188
- var qualitySpineCheckOutputSchema = z23.object({
11189
- hasVerdict: z23.boolean(),
11190
- noSpineEntries: z23.boolean().optional(),
11191
- structuralPassed: z23.boolean().optional(),
11192
- storyPassed: z23.boolean().nullable().optional(),
11193
- stale: z23.boolean().optional(),
11104
+ var qualitySpineCheckOutputSchema = z21.object({
11105
+ hasVerdict: z21.boolean(),
11106
+ noSpineEntries: z21.boolean().optional(),
11107
+ structuralPassed: z21.boolean().optional(),
11108
+ storyPassed: z21.boolean().nullable().optional(),
11109
+ stale: z21.boolean().optional(),
11194
11110
  // TASK-156: a capped membership scan must stay distinguishable from a complete one, and a
11195
11111
  // malformed verdict needs its own discriminator — both were silently stripped before this.
11196
- staleMemberIds: z23.array(z23.string()).optional(),
11197
- membershipTruncated: z23.boolean().optional(),
11112
+ staleMemberIds: z21.array(z21.string()).optional(),
11113
+ membershipTruncated: z21.boolean().optional(),
11198
11114
  // PRRT_kwDORS4ils6i_PVS: a KNOWN relations-fingerprint mismatch, distinct from "unknown" —
11199
11115
  // without this, a detected topology change and an unverifiable legacy fingerprint were
11200
11116
  // indistinguishable in structured output.
11201
- relationsChanged: z23.boolean().optional(),
11202
- malformed: z23.boolean().optional()
11117
+ relationsChanged: z21.boolean().optional(),
11118
+ malformed: z21.boolean().optional()
11203
11119
  });
11204
11120
  function registerQualityTools(server) {
11205
11121
  const qualityHandlers = {
@@ -11381,10 +11297,10 @@ async function handleReEvaluate(entryId, context) {
11381
11297
  }
11382
11298
 
11383
11299
  // src/tools/session.ts
11384
- import { z as z26 } from "zod/v3";
11300
+ import { z as z24 } from "zod/v3";
11385
11301
 
11386
11302
  // src/tools/wrapup.ts
11387
- import { z as z24 } from "zod/v3";
11303
+ import { z as z22 } from "zod/v3";
11388
11304
 
11389
11305
  // src/lib/compose-wrapup-view.ts
11390
11306
  function toComposed(e) {
@@ -11838,8 +11754,8 @@ async function runWrapupCommitAll(data, cachedSuggestions) {
11838
11754
  overflowUnscanned
11839
11755
  };
11840
11756
  }
11841
- var wrapupSchema = z24.object({
11842
- action: z24.enum(["review", "commit-all"]).optional().describe(
11757
+ var wrapupSchema = z22.object({
11758
+ action: z22.enum(["review", "commit-all"]).optional().describe(
11843
11759
  "Action to perform. 'review' (default) shows the wrapup summary. 'commit-all' accepts all uncommitted drafts and creates suggested links."
11844
11760
  )
11845
11761
  });
@@ -11940,26 +11856,26 @@ ${text}` : text;
11940
11856
  }
11941
11857
 
11942
11858
  // src/tools/facilitate.ts
11943
- import { z as z25 } from "zod/v3";
11859
+ import { z as z23 } from "zod/v3";
11944
11860
  var FACILITATE_ACTIONS = ["resume", "commit-constellation"];
11945
- var coherencyAcknowledgementSchema = z25.object({
11946
- response: z25.string().max(200).describe("Acknowledgement response per offender: 'linked' | 'accepted-fix' | 'diverged'."),
11947
- entryId: z25.string().max(200).optional().describe("Entry the acknowledgement links to (e.g. the strategic spine entry)."),
11948
- reason: z25.string().max(2e3).optional().describe("Free-text justification, required for a 'diverged' response."),
11949
- subjectEntryId: z25.string().max(200).optional().describe("The refused entry this acknowledgement answers.")
11861
+ var coherencyAcknowledgementSchema = z23.object({
11862
+ response: z23.string().max(200).describe("Acknowledgement response per offender: 'linked' | 'accepted-fix' | 'diverged'."),
11863
+ entryId: z23.string().max(200).optional().describe("Entry the acknowledgement links to (e.g. the strategic spine entry)."),
11864
+ reason: z23.string().max(2e3).optional().describe("Free-text justification, required for a 'diverged' response."),
11865
+ subjectEntryId: z23.string().max(200).optional().describe("The refused entry this acknowledgement answers.")
11950
11866
  });
11951
- var facilitateSchema = z25.object({
11952
- action: z25.enum(FACILITATE_ACTIONS).describe(
11867
+ var facilitateSchema = z23.object({
11868
+ action: z23.enum(FACILITATE_ACTIONS).describe(
11953
11869
  "'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."
11954
11870
  ),
11955
- betEntryId: z25.string().max(200).optional().describe("Bet entry ID. Required for both actions."),
11956
- operationId: z25.string().max(200).optional().describe("Optional idempotency key for commit-constellation retries."),
11871
+ betEntryId: z23.string().max(200).optional().describe("Bet entry ID. Required for both actions."),
11872
+ operationId: z23.string().max(200).optional().describe("Optional idempotency key for commit-constellation retries."),
11957
11873
  // WP-465 slice ⑤: coherency retry controls for a COHERENCY_REFUSED constellation hold.
11958
11874
  // Forwarded verbatim to agentKnowledge.facilitateEnvelope (validation lives at the gate).
11959
- coherencyAcknowledgements: z25.array(coherencyAcknowledgementSchema).max(20).optional().describe(
11875
+ coherencyAcknowledgements: z23.array(coherencyAcknowledgementSchema).max(20).optional().describe(
11960
11876
  "Per-offender acknowledgements to retry a constellation held under standard/strict coherency mode. Each: {subjectEntryId, response: 'linked' | 'accepted-fix' | 'diverged', entryId?, reason?}."
11961
11877
  ),
11962
- steeringOverrideReason: z25.string().max(2e3).optional().describe(
11878
+ steeringOverrideReason: z23.string().max(2e3).optional().describe(
11963
11879
  "Typed override reason (>= 12 chars) to push a constellation past a coherency hold instead of acknowledging."
11964
11880
  )
11965
11881
  });
@@ -12212,42 +12128,42 @@ var SESSION_ACTIONS = [
12212
12128
  "resume",
12213
12129
  "commit-constellation"
12214
12130
  ];
12215
- var coherencyAcknowledgementFlatSchema2 = z26.object({
12216
- response: z26.string().max(200).describe("Acknowledgement response per offender: 'linked' | 'accepted-fix' | 'diverged'."),
12217
- entryId: z26.string().max(200).optional().describe("Entry the acknowledgement links to."),
12218
- reason: z26.string().max(2e3).optional().describe("Free-text justification, required for a 'diverged' response."),
12219
- subjectEntryId: z26.string().max(200).optional().describe("The refused entry this acknowledgement answers.")
12131
+ var coherencyAcknowledgementFlatSchema2 = z24.object({
12132
+ response: z24.string().max(200).describe("Acknowledgement response per offender: 'linked' | 'accepted-fix' | 'diverged'."),
12133
+ entryId: z24.string().max(200).optional().describe("Entry the acknowledgement links to."),
12134
+ reason: z24.string().max(2e3).optional().describe("Free-text justification, required for a 'diverged' response."),
12135
+ subjectEntryId: z24.string().max(200).optional().describe("The refused entry this acknowledgement answers.")
12220
12136
  });
12221
- var sessionSchema = z26.object({
12222
- action: z26.enum(SESSION_ACTIONS).describe(
12137
+ var sessionSchema = z24.object({
12138
+ action: z24.enum(SESSION_ACTIONS).describe(
12223
12139
  "'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)."
12224
12140
  ),
12225
- betEntryId: z26.string().max(200).optional().describe("For 'resume'/'commit-constellation': bet entry ID. Required for both."),
12226
- operationId: z26.string().max(200).optional().describe("For 'commit-constellation': optional idempotency key for retries."),
12227
- coherencyAcknowledgements: z26.array(coherencyAcknowledgementFlatSchema2).max(20).optional().describe(
12141
+ betEntryId: z24.string().max(200).optional().describe("For 'resume'/'commit-constellation': bet entry ID. Required for both."),
12142
+ operationId: z24.string().max(200).optional().describe("For 'commit-constellation': optional idempotency key for retries."),
12143
+ coherencyAcknowledgements: z24.array(coherencyAcknowledgementFlatSchema2).max(20).optional().describe(
12228
12144
  "For 'commit-constellation': per-offender acknowledgements to retry a constellation held under standard/strict coherency mode."
12229
12145
  ),
12230
- steeringOverrideReason: z26.string().max(2e3).optional().describe(
12146
+ steeringOverrideReason: z24.string().max(2e3).optional().describe(
12231
12147
  "For 'commit-constellation': typed override reason (>= 12 chars) to push past a coherency hold instead of acknowledging."
12232
12148
  ),
12233
12149
  // DEC-1715 (WP-753 O1a)
12234
- role: z26.string().max(200).optional().describe(
12150
+ role: z24.string().max(200).optional().describe(
12235
12151
  "For 'start': role to act as this session \u2014 only needed if you hold more than one; the error lists your roles if omitted."
12236
12152
  )
12237
12153
  });
12238
- var sessionStartVariant = z26.object({
12239
- action: z26.literal("start"),
12154
+ var sessionStartVariant = z24.object({
12155
+ action: z24.literal("start"),
12240
12156
  // DEC-1715 (WP-753 O1a): the role to act as this session — only needed when the person holds
12241
12157
  // more than one role; the server refuses and lists the choices when it's required and omitted.
12242
- role: z26.string().max(200).optional().describe("Role to act as this session \u2014 only needed if you hold more than one; the error lists your roles if omitted.")
12158
+ role: z24.string().max(200).optional().describe("Role to act as this session \u2014 only needed if you hold more than one; the error lists your roles if omitted.")
12243
12159
  });
12244
- var sessionCloseVariant = z26.object({ action: z26.literal("close") });
12245
- var sessionStatusVariant = z26.object({ action: z26.literal("status") });
12246
- var sessionWrapupReviewVariant = z26.object({ action: z26.literal("wrapup-review") });
12247
- var sessionWrapupCommitVariant = z26.object({ action: z26.literal("wrapup-commit") });
12248
- var sessionResumeVariant = facilitateSchema.omit({ action: true }).extend({ action: z26.literal("resume") });
12249
- var sessionCommitConstellationVariant = facilitateSchema.omit({ action: true }).extend({ action: z26.literal("commit-constellation") });
12250
- var sessionActionUnion = z26.discriminatedUnion("action", [
12160
+ var sessionCloseVariant = z24.object({ action: z24.literal("close") });
12161
+ var sessionStatusVariant = z24.object({ action: z24.literal("status") });
12162
+ var sessionWrapupReviewVariant = z24.object({ action: z24.literal("wrapup-review") });
12163
+ var sessionWrapupCommitVariant = z24.object({ action: z24.literal("wrapup-commit") });
12164
+ var sessionResumeVariant = facilitateSchema.omit({ action: true }).extend({ action: z24.literal("resume") });
12165
+ var sessionCommitConstellationVariant = facilitateSchema.omit({ action: true }).extend({ action: z24.literal("commit-constellation") });
12166
+ var sessionActionUnion = z24.discriminatedUnion("action", [
12251
12167
  sessionStartVariant,
12252
12168
  sessionCloseVariant,
12253
12169
  sessionStatusVariant,
@@ -12487,10 +12403,10 @@ async function handleStatus() {
12487
12403
  }
12488
12404
 
12489
12405
  // src/tools/workspace.ts
12490
- import { z as z29 } from "zod/v3";
12406
+ import { z as z27 } from "zod/v3";
12491
12407
 
12492
12408
  // src/tools/health.ts
12493
- import { z as z27 } from "zod/v3";
12409
+ import { z as z25 } from "zod/v3";
12494
12410
 
12495
12411
  // src/lib/auditView.ts
12496
12412
  async function buildTenantAuditView(limit) {
@@ -12850,61 +12766,61 @@ ${logLines.join("\n")}${seamSummaryText}` }],
12850
12766
  };
12851
12767
  }
12852
12768
  var HEALTH_ACTIONS = ["check", "whoami", "status", "audit", "self-test"];
12853
- var healthSchema = z27.object({
12854
- action: z27.enum(HEALTH_ACTIONS).describe(
12769
+ var healthSchema = z25.object({
12770
+ action: z25.enum(HEALTH_ACTIONS).describe(
12855
12771
  "'check': connectivity and workspace stats. 'whoami': session identity. 'status': workspace readiness. 'audit': session audit log. 'self-test': validate all tool schemas."
12856
12772
  ),
12857
- limit: z27.number().min(1).max(50).default(20).optional().describe("For audit: how many recent calls to show (max 50)")
12773
+ limit: z25.number().min(1).max(50).default(20).optional().describe("For audit: how many recent calls to show (max 50)")
12858
12774
  });
12859
- var healthCheckOutputSchema = z27.object({
12860
- healthy: z27.boolean(),
12861
- collections: z27.number(),
12862
- entries: z27.number(),
12863
- latencyMs: z27.number(),
12864
- workspace: z27.string()
12775
+ var healthCheckOutputSchema = z25.object({
12776
+ healthy: z25.boolean(),
12777
+ collections: z25.number(),
12778
+ entries: z25.number(),
12779
+ latencyMs: z25.number(),
12780
+ workspace: z25.string()
12865
12781
  });
12866
- var organisationHealthSchema = z27.object({
12867
- reviewed: z27.number(),
12868
- agreements: z27.number(),
12869
- disagreements: z27.number(),
12870
- abstentions: z27.number(),
12871
- agreementRate: z27.number(),
12872
- flags: z27.array(z27.object({ collection: z27.string(), count: z27.number(), suggestedCollection: z27.string() }))
12782
+ var organisationHealthSchema = z25.object({
12783
+ reviewed: z25.number(),
12784
+ agreements: z25.number(),
12785
+ disagreements: z25.number(),
12786
+ abstentions: z25.number(),
12787
+ agreementRate: z25.number(),
12788
+ flags: z25.array(z25.object({ collection: z25.string(), count: z25.number(), suggestedCollection: z25.string() }))
12873
12789
  });
12874
- var healthStatusOutputSchema = z27.object({
12875
- stage: z27.enum(["blank", "seeded", "grounded", "connected"]).optional().default("seeded"),
12876
- sampleTruncated: z27.boolean().nullable().optional(),
12877
- activeEntries: z27.number(),
12878
- totalRelations: z27.number(),
12879
- orphanedEntries: z27.number(),
12880
- checks: z27.array(z27.object({ label: z27.string(), passed: z27.boolean(), current: z27.number(), required: z27.number() })),
12881
- gaps: z27.array(z27.object({ id: z27.string(), label: z27.string(), guidance: z27.string() })),
12790
+ var healthStatusOutputSchema = z25.object({
12791
+ stage: z25.enum(["blank", "seeded", "grounded", "connected"]).optional().default("seeded"),
12792
+ sampleTruncated: z25.boolean().nullable().optional(),
12793
+ activeEntries: z25.number(),
12794
+ totalRelations: z25.number(),
12795
+ orphanedEntries: z25.number(),
12796
+ checks: z25.array(z25.object({ label: z25.string(), passed: z25.boolean(), current: z25.number(), required: z25.number() })),
12797
+ gaps: z25.array(z25.object({ id: z25.string(), label: z25.string(), guidance: z25.string() })),
12882
12798
  organisationHealth: organisationHealthSchema.optional()
12883
12799
  });
12884
- var healthAuditOutputSchema = z27.object({
12885
- totalCalls: z27.number(),
12886
- calls: z27.array(z27.object({
12887
- tool: z27.string(),
12888
- action: z27.string().optional(),
12889
- timestamp: z27.string(),
12890
- durationMs: z27.number().optional()
12800
+ var healthAuditOutputSchema = z25.object({
12801
+ totalCalls: z25.number(),
12802
+ calls: z25.array(z25.object({
12803
+ tool: z25.string(),
12804
+ action: z25.string().optional(),
12805
+ timestamp: z25.string(),
12806
+ durationMs: z25.number().optional()
12891
12807
  }))
12892
12808
  });
12893
- var healthWhoamiOutputSchema = z27.object({
12894
- workspaceId: z27.string(),
12895
- workspaceName: z27.string(),
12896
- scope: z27.string(),
12897
- sessionId: z27.union([z27.string(), z27.null()]),
12898
- oriented: z27.boolean()
12809
+ var healthWhoamiOutputSchema = z25.object({
12810
+ workspaceId: z25.string(),
12811
+ workspaceName: z25.string(),
12812
+ scope: z25.string(),
12813
+ sessionId: z25.union([z25.string(), z25.null()]),
12814
+ oriented: z25.boolean()
12899
12815
  });
12900
- var selfTestOutputSchema = z27.object({
12901
- passed: z27.number(),
12902
- failed: z27.number(),
12903
- total: z27.number(),
12904
- results: z27.array(z27.object({
12905
- tool: z27.string(),
12906
- valid: z27.boolean(),
12907
- error: z27.string().optional()
12816
+ var selfTestOutputSchema = z25.object({
12817
+ passed: z25.number(),
12818
+ failed: z25.number(),
12819
+ total: z25.number(),
12820
+ results: z25.array(z25.object({
12821
+ tool: z25.string(),
12822
+ valid: z25.boolean(),
12823
+ error: z25.string().optional()
12908
12824
  }))
12909
12825
  });
12910
12826
  function handleSelfTest(server) {
@@ -12955,9 +12871,9 @@ function handleSelfTest(server) {
12955
12871
  }
12956
12872
 
12957
12873
  // src/tools/usage.ts
12958
- import { z as z28 } from "zod/v3";
12959
- var usageSummarySchema = z28.object({
12960
- periodDays: z28.number().min(1).max(90).optional().describe("Number of days to look back (default 30, max 90)")
12874
+ import { z as z26 } from "zod/v3";
12875
+ var usageSummarySchema = z26.object({
12876
+ periodDays: z26.number().min(1).max(90).optional().describe("Number of days to look back (default 30, max 90)")
12961
12877
  });
12962
12878
  async function handleUsageSummary(periodDays) {
12963
12879
  const ws = await getWorkspaceContext();
@@ -13129,35 +13045,35 @@ var WORKSPACE_ACTIONS = [
13129
13045
  "proposals-respond",
13130
13046
  "proposals-count"
13131
13047
  ];
13132
- var workspaceSchema = z29.object({
13133
- action: z29.enum(WORKSPACE_ACTIONS).describe(
13048
+ var workspaceSchema = z27.object({
13049
+ action: z27.enum(WORKSPACE_ACTIONS).describe(
13134
13050
  "'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)."
13135
13051
  ),
13136
- limit: z29.number().min(1).max(50).optional().describe("For 'audit': how many recent calls to show (max 50, default 20)."),
13137
- periodDays: z29.number().min(1).max(90).optional().describe("For 'usage': number of days to look back (default 30, max 90)."),
13138
- status: z29.enum(["open", "approved", "objected", "expired"]).optional().describe("For 'proposals-list': filter by status (default: open)."),
13139
- proposalId: z29.string().max(200).optional().describe("For 'proposals-respond': proposal ID."),
13140
- verdict: z29.enum(["approve", "reject"]).optional().describe("For 'proposals-respond': approve or reject."),
13141
- reason: z29.string().max(2e3).optional().describe("For 'proposals-respond': reason for the verdict (required when rejecting).")
13052
+ limit: z27.number().min(1).max(50).optional().describe("For 'audit': how many recent calls to show (max 50, default 20)."),
13053
+ periodDays: z27.number().min(1).max(90).optional().describe("For 'usage': number of days to look back (default 30, max 90)."),
13054
+ status: z27.enum(["open", "approved", "objected", "expired"]).optional().describe("For 'proposals-list': filter by status (default: open)."),
13055
+ proposalId: z27.string().max(200).optional().describe("For 'proposals-respond': proposal ID."),
13056
+ verdict: z27.enum(["approve", "reject"]).optional().describe("For 'proposals-respond': approve or reject."),
13057
+ reason: z27.string().max(2e3).optional().describe("For 'proposals-respond': reason for the verdict (required when rejecting).")
13142
13058
  });
13143
- var workspaceCheckVariant = z29.object({ action: z29.literal("check") });
13144
- var workspaceWhoamiVariant = z29.object({ action: z29.literal("whoami") });
13145
- var workspaceStatusVariant = z29.object({ action: z29.literal("status") });
13146
- var workspaceAuditVariant = z29.object({ action: z29.literal("audit"), limit: z29.number().min(1).max(50).optional().default(20) });
13147
- var workspaceSelfTestVariant = z29.object({ action: z29.literal("self-test") });
13148
- var workspaceUsageVariant = z29.object({ action: z29.literal("usage"), periodDays: z29.number().min(1).max(90).optional() });
13149
- var workspaceProposalsListVariant = z29.object({
13150
- action: z29.literal("proposals-list"),
13151
- status: z29.enum(["open", "approved", "objected", "expired"]).optional()
13059
+ var workspaceCheckVariant = z27.object({ action: z27.literal("check") });
13060
+ var workspaceWhoamiVariant = z27.object({ action: z27.literal("whoami") });
13061
+ var workspaceStatusVariant = z27.object({ action: z27.literal("status") });
13062
+ var workspaceAuditVariant = z27.object({ action: z27.literal("audit"), limit: z27.number().min(1).max(50).optional().default(20) });
13063
+ var workspaceSelfTestVariant = z27.object({ action: z27.literal("self-test") });
13064
+ var workspaceUsageVariant = z27.object({ action: z27.literal("usage"), periodDays: z27.number().min(1).max(90).optional() });
13065
+ var workspaceProposalsListVariant = z27.object({
13066
+ action: z27.literal("proposals-list"),
13067
+ status: z27.enum(["open", "approved", "objected", "expired"]).optional()
13152
13068
  });
13153
- var workspaceProposalsRespondVariant = z29.object({
13154
- action: z29.literal("proposals-respond"),
13155
- proposalId: z29.string().max(200),
13156
- verdict: z29.enum(["approve", "reject"]),
13157
- reason: z29.string().max(2e3).optional()
13069
+ var workspaceProposalsRespondVariant = z27.object({
13070
+ action: z27.literal("proposals-respond"),
13071
+ proposalId: z27.string().max(200),
13072
+ verdict: z27.enum(["approve", "reject"]),
13073
+ reason: z27.string().max(2e3).optional()
13158
13074
  });
13159
- var workspaceProposalsCountVariant = z29.object({ action: z29.literal("proposals-count") });
13160
- var workspaceActionUnion = z29.discriminatedUnion("action", [
13075
+ var workspaceProposalsCountVariant = z27.object({ action: z27.literal("proposals-count") });
13076
+ var workspaceActionUnion = z27.discriminatedUnion("action", [
13161
13077
  workspaceCheckVariant,
13162
13078
  workspaceWhoamiVariant,
13163
13079
  workspaceStatusVariant,
@@ -13213,7 +13129,7 @@ function registerWorkspaceTools(server) {
13213
13129
  }
13214
13130
 
13215
13131
  // src/tools/feedback.ts
13216
- import { z as z30 } from "zod/v3";
13132
+ import { z as z28 } from "zod/v3";
13217
13133
 
13218
13134
  // src/lib/productFeedbackConstants.ts
13219
13135
  var PRODUCT_FEEDBACK_CATEGORIES = ["bug", "friction", "idea", "praise", "other"];
@@ -13224,9 +13140,9 @@ var VENDOR_SETTABLE_STATUSES = PRODUCT_FEEDBACK_STATUSES.filter(
13224
13140
 
13225
13141
  // src/tools/feedback.ts
13226
13142
  var actions = ["submit", "list", "queue", "note", "group", "status"];
13227
- var category = z30.enum(PRODUCT_FEEDBACK_CATEGORIES);
13228
- var status = z30.enum(PRODUCT_FEEDBACK_STATUSES);
13229
- var vendorStatus = z30.enum(VENDOR_SETTABLE_STATUSES);
13143
+ var category = z28.enum(PRODUCT_FEEDBACK_CATEGORIES);
13144
+ var status = z28.enum(PRODUCT_FEEDBACK_STATUSES);
13145
+ var vendorStatus = z28.enum(VENDOR_SETTABLE_STATUSES);
13230
13146
  var GATEWAY_MAX_STRING_BYTES = 10240;
13231
13147
  var utf8Bytes = (value) => new TextEncoder().encode(value).length;
13232
13148
  var fitsGatewayBytes = (value) => utf8Bytes(value) <= GATEWAY_MAX_STRING_BYTES;
@@ -13235,32 +13151,32 @@ var byteLimitMessage = (field) => ({
13235
13151
  });
13236
13152
  var MESSAGE_DISPLAY_LIMIT = 1e3;
13237
13153
  var FULL_MESSAGE_MAX_LIMIT = 5;
13238
- var feedbackSchema = z30.object({
13239
- 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."),
13240
- message: z30.string().max(1e4).optional().describe("Required for submit: the product feedback text (max 10,000 chars and 10,240 UTF-8 bytes)."),
13154
+ var feedbackSchema = z28.object({
13155
+ action: z28.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."),
13156
+ message: z28.string().max(1e4).optional().describe("Required for submit: the product feedback text (max 10,000 chars and 10,240 UTF-8 bytes)."),
13241
13157
  category: category.optional().describe("Submit/queue category; submit defaults to other."),
13242
- command: z30.string().max(1e3).optional().describe("Optional submit command context; argument values are scrubbed server-side."),
13243
- route: z30.string().max(500).optional().describe("Optional submit route context."),
13244
- client: z30.string().max(100).optional().describe("Optional submit client label."),
13245
- feedbackId: z30.string().max(200).optional().describe("Required for note/status: target feedback ID."),
13246
- feedbackIds: z30.array(z30.string().max(200)).max(100).optional().describe("Required for group: 1\u2013100 target feedback IDs."),
13247
- note: z30.string().max(4e3).optional().describe("Required for note: replacement triage note (max 10,240 UTF-8 bytes)."),
13158
+ command: z28.string().max(1e3).optional().describe("Optional submit command context; argument values are scrubbed server-side."),
13159
+ route: z28.string().max(500).optional().describe("Optional submit route context."),
13160
+ client: z28.string().max(100).optional().describe("Optional submit client label."),
13161
+ feedbackId: z28.string().max(200).optional().describe("Required for note/status: target feedback ID."),
13162
+ feedbackIds: z28.array(z28.string().max(200)).max(100).optional().describe("Required for group: 1\u2013100 target feedback IDs."),
13163
+ note: z28.string().max(4e3).optional().describe("Required for note: replacement triage note (max 10,240 UTF-8 bytes)."),
13248
13164
  status: status.optional().describe("list/queue filter (any status, including 'screening'); the status action's required target value excludes 'screening' (system-only)."),
13249
- groupId: z30.string().min(1).max(200).nullable().optional().describe("Group filter, or required group destination; null explicitly clears grouping."),
13250
- 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."),
13251
- since: z30.number().optional().describe("Queue-only lower createdAt window bound (inclusive) in epoch milliseconds."),
13252
- 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."),
13253
- limit: z30.number().int().min(1).max(100).optional().describe("list/queue row limit, default 50, maximum 100."),
13254
- cursor: z30.string().max(2e3).optional().describe("Opaque pagination cursor from a previous list/queue response (continueCursor); omit for the first page."),
13255
- full: z30.boolean().optional().describe(`list/queue only: return untruncated messages; allowed only when limit <= ${FULL_MESSAGE_MAX_LIMIT}.`)
13165
+ groupId: z28.string().min(1).max(200).nullable().optional().describe("Group filter, or required group destination; null explicitly clears grouping."),
13166
+ workspaceId: z28.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."),
13167
+ since: z28.number().optional().describe("Queue-only lower createdAt window bound (inclusive) in epoch milliseconds."),
13168
+ before: z28.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."),
13169
+ limit: z28.number().int().min(1).max(100).optional().describe("list/queue row limit, default 50, maximum 100."),
13170
+ cursor: z28.string().max(2e3).optional().describe("Opaque pagination cursor from a previous list/queue response (continueCursor); omit for the first page."),
13171
+ full: z28.boolean().optional().describe(`list/queue only: return untruncated messages; allowed only when limit <= ${FULL_MESSAGE_MAX_LIMIT}.`)
13256
13172
  });
13257
- var union = z30.discriminatedUnion("action", [
13258
- 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() }),
13259
- 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() }),
13260
- 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() }),
13261
- z30.object({ action: z30.literal("note"), feedbackId: z30.string().min(1).max(200), note: z30.string().max(4e3).refine(fitsGatewayBytes, byteLimitMessage("note")) }),
13262
- 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() }),
13263
- z30.object({ action: z30.literal("status"), feedbackId: z30.string().min(1).max(200), status: vendorStatus })
13173
+ var union = z28.discriminatedUnion("action", [
13174
+ z28.object({ action: z28.literal("submit"), message: z28.string().min(1).max(1e4).refine(fitsGatewayBytes, byteLimitMessage("message")), category: category.optional(), command: z28.string().max(1e3).optional(), route: z28.string().max(500).optional(), client: z28.string().max(100).optional() }),
13175
+ z28.object({ action: z28.literal("list"), status: status.optional(), limit: z28.number().int().min(1).max(100).optional(), cursor: z28.string().max(2e3).optional(), full: z28.boolean().optional() }),
13176
+ z28.object({ action: z28.literal("queue"), status: status.optional(), category: category.optional(), groupId: z28.string().min(1).max(200).optional(), workspaceId: z28.string().max(200).optional(), since: z28.number().optional(), before: z28.number().optional(), limit: z28.number().int().min(1).max(100).optional(), cursor: z28.string().max(2e3).optional(), full: z28.boolean().optional() }),
13177
+ z28.object({ action: z28.literal("note"), feedbackId: z28.string().min(1).max(200), note: z28.string().max(4e3).refine(fitsGatewayBytes, byteLimitMessage("note")) }),
13178
+ z28.object({ action: z28.literal("group"), feedbackIds: z28.array(z28.string().min(1).max(200)).min(1).max(100), groupId: z28.string().min(1).max(200).nullable() }),
13179
+ z28.object({ action: z28.literal("status"), feedbackId: z28.string().min(1).max(200), status: vendorStatus })
13264
13180
  ]);
13265
13181
  var specs = {
13266
13182
  submit: { params: ["message", "category", "command", "route", "client"], description: "message is required; category defaults to other." },
@@ -13387,34 +13303,34 @@ function registerFeedbackTool(server) {
13387
13303
  }
13388
13304
 
13389
13305
  // src/tools/shape.ts
13390
- import { z as z31 } from "zod/v3";
13306
+ import { z as z29 } from "zod/v3";
13391
13307
  var SHAPE_ACTIONS = ["list", "show", "agree", "dismiss"];
13392
13308
  var LIST_DISPOSITIONS = ["pending", "agreed", "dismissed", "expired"];
13393
13309
  var LIST_OUTCOMES = ["not_candidate", "atomic", "compound", "unavailable"];
13394
- var shapeSchema = z31.object({
13395
- action: z31.enum(SHAPE_ACTIONS).describe(
13310
+ var shapeSchema = z29.object({
13311
+ action: z29.enum(SHAPE_ACTIONS).describe(
13396
13312
  "'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."
13397
13313
  ),
13398
- disposition: z31.enum(LIST_DISPOSITIONS).optional().describe(
13314
+ disposition: z29.enum(LIST_DISPOSITIONS).optional().describe(
13399
13315
  "For 'list': filter by disposition. Omitting both disposition and outcome defaults to the actionable set (disposition:pending, outcome:compound)."
13400
13316
  ),
13401
- outcome: z31.enum(LIST_OUTCOMES).optional().describe(
13317
+ outcome: z29.enum(LIST_OUTCOMES).optional().describe(
13402
13318
  "For 'list': filter by outcome. Omitting both disposition and outcome defaults to the actionable set (disposition:pending, outcome:compound)."
13403
13319
  ),
13404
- limit: z31.number().min(1).max(200).optional().describe("For 'list': max rows (default 50, max 200)."),
13405
- rowId: z31.string().max(200).optional().describe("For 'show'/'agree'/'dismiss': the advisory row id."),
13406
- reason: z31.string().max(1e3).optional().describe("For 'agree'/'dismiss': optional reason (capped at 1000 chars).")
13320
+ limit: z29.number().min(1).max(200).optional().describe("For 'list': max rows (default 50, max 200)."),
13321
+ rowId: z29.string().max(200).optional().describe("For 'show'/'agree'/'dismiss': the advisory row id."),
13322
+ reason: z29.string().max(1e3).optional().describe("For 'agree'/'dismiss': optional reason (capped at 1000 chars).")
13407
13323
  });
13408
- var shapeListVariant = z31.object({
13409
- action: z31.literal("list"),
13410
- disposition: z31.enum(LIST_DISPOSITIONS).optional(),
13411
- outcome: z31.enum(LIST_OUTCOMES).optional(),
13412
- limit: z31.number().min(1).max(200).optional()
13324
+ var shapeListVariant = z29.object({
13325
+ action: z29.literal("list"),
13326
+ disposition: z29.enum(LIST_DISPOSITIONS).optional(),
13327
+ outcome: z29.enum(LIST_OUTCOMES).optional(),
13328
+ limit: z29.number().min(1).max(200).optional()
13413
13329
  });
13414
- var shapeShowVariant = z31.object({ action: z31.literal("show"), rowId: z31.string().max(200) });
13415
- var shapeAgreeVariant = z31.object({ action: z31.literal("agree"), rowId: z31.string().max(200), reason: z31.string().max(1e3).optional() });
13416
- var shapeDismissVariant = z31.object({ action: z31.literal("dismiss"), rowId: z31.string().max(200), reason: z31.string().max(1e3).optional() });
13417
- var shapeActionUnion = z31.discriminatedUnion("action", [
13330
+ var shapeShowVariant = z29.object({ action: z29.literal("show"), rowId: z29.string().max(200) });
13331
+ var shapeAgreeVariant = z29.object({ action: z29.literal("agree"), rowId: z29.string().max(200), reason: z29.string().max(1e3).optional() });
13332
+ var shapeDismissVariant = z29.object({ action: z29.literal("dismiss"), rowId: z29.string().max(200), reason: z29.string().max(1e3).optional() });
13333
+ var shapeActionUnion = z29.discriminatedUnion("action", [
13418
13334
  shapeListVariant,
13419
13335
  shapeShowVariant,
13420
13336
  shapeAgreeVariant,
@@ -13561,26 +13477,26 @@ function registerShapeTools(server) {
13561
13477
  }
13562
13478
 
13563
13479
  // src/tools/question.ts
13564
- import { z as z32 } from "zod/v3";
13480
+ import { z as z30 } from "zod/v3";
13565
13481
  var QUESTION_ACTIONS = ["create", "assign", "answer", "force-close", "list"];
13566
- var questionSchema = z32.object({
13567
- action: z32.enum(QUESTION_ACTIONS).describe(
13482
+ var questionSchema = z30.object({
13483
+ action: z30.enum(QUESTION_ACTIONS).describe(
13568
13484
  "'create': create a new routed question from text \u2014 the dedicated birth action; every question is born escalated to the team lead (generic entry creation and move-and-retype also pair a routing facet). 'assign': reassign ownership to a role (toRole required \u2014 no bare self-confirm, no toPerson). 'answer': close the loop \u2014 creates the answering entry itself unless --entry is given. 'force-close': Team-Lead-only escape hatch \u2014 reason required. 'list': the ack-gate read model \u2014 what you owe (or, with mine:true, every question you asked, including closed ones)."
13569
13485
  ),
13570
- entryId: z32.string().max(200).optional().describe("Target question's id (human TEN-nnn form or a raw entry id). Required for every action except 'create'/'list'."),
13571
- text: z32.string().max(5e3).optional().describe("'create': the question text. 'answer': the answer text (mutually exclusive with answerEntryId, max 2000 chars)."),
13572
- blocks: z32.array(z32.string().max(200)).max(50).optional().describe("'create': entry ids this question is blocking (repeatable)."),
13573
- toRole: z32.string().max(200).optional().describe("'assign': reassign to this role (human ROL-nnn form or a raw entry id) \u2014 required."),
13574
- reason: z32.string().max(2e3).optional().describe("'force-close': required reason."),
13575
- answerEntryId: z32.string().max(200).optional().describe("'answer': point at an already-written entry instead of supplying text (mutually exclusive with text)."),
13576
- mine: z32.boolean().optional().describe("'list': true for arm C (every question YOU asked, every status). Omit/false for the ack-gate view (what you owe).")
13486
+ entryId: z30.string().max(200).optional().describe("Target question's id (human TEN-nnn form or a raw entry id). Required for every action except 'create'/'list'."),
13487
+ text: z30.string().max(5e3).optional().describe("'create': the question text. 'answer': the answer text (mutually exclusive with answerEntryId, max 2000 chars)."),
13488
+ blocks: z30.array(z30.string().max(200)).max(50).optional().describe("'create': entry ids this question is blocking (repeatable)."),
13489
+ toRole: z30.string().max(200).optional().describe("'assign': reassign to this role (human ROL-nnn form or a raw entry id) \u2014 required."),
13490
+ reason: z30.string().max(2e3).optional().describe("'force-close': required reason."),
13491
+ answerEntryId: z30.string().max(200).optional().describe("'answer': point at an already-written entry instead of supplying text (mutually exclusive with text)."),
13492
+ mine: z30.boolean().optional().describe("'list': true for arm C (every question YOU asked, every status). Omit/false for the ack-gate view (what you owe).")
13577
13493
  });
13578
- var createVariant = z32.object({ action: z32.literal("create"), text: z32.string().min(1).max(5e3), blocks: z32.array(z32.string().max(200)).max(50).optional() });
13579
- var assignVariant = z32.object({ action: z32.literal("assign"), entryId: z32.string().max(200), toRole: z32.string().max(200).min(1) });
13580
- var answerVariant = z32.object({ action: z32.literal("answer"), entryId: z32.string().max(200), text: z32.string().max(2e3).optional(), answerEntryId: z32.string().max(200).optional() });
13581
- var forceCloseVariant = z32.object({ action: z32.literal("force-close"), entryId: z32.string().max(200), reason: z32.string().min(1).max(2e3) });
13582
- var listVariant = z32.object({ action: z32.literal("list"), mine: z32.boolean().optional() });
13583
- var questionActionUnion = z32.discriminatedUnion("action", [
13494
+ var createVariant = z30.object({ action: z30.literal("create"), text: z30.string().min(1).max(5e3), blocks: z30.array(z30.string().max(200)).max(50).optional() });
13495
+ var assignVariant = z30.object({ action: z30.literal("assign"), entryId: z30.string().max(200), toRole: z30.string().max(200).min(1) });
13496
+ var answerVariant = z30.object({ action: z30.literal("answer"), entryId: z30.string().max(200), text: z30.string().max(2e3).optional(), answerEntryId: z30.string().max(200).optional() });
13497
+ var forceCloseVariant = z30.object({ action: z30.literal("force-close"), entryId: z30.string().max(200), reason: z30.string().min(1).max(2e3) });
13498
+ var listVariant = z30.object({ action: z30.literal("list"), mine: z30.boolean().optional() });
13499
+ var questionActionUnion = z30.discriminatedUnion("action", [
13584
13500
  createVariant,
13585
13501
  assignVariant,
13586
13502
  answerVariant,
@@ -13735,23 +13651,23 @@ function registerQuestionTools(server) {
13735
13651
  }
13736
13652
 
13737
13653
  // src/tools/role.ts
13738
- import { z as z33 } from "zod/v3";
13654
+ import { z as z31 } from "zod/v3";
13739
13655
  var ROLE_ACTIONS = ["accountable"];
13740
- var roleSchema = z33.object({
13741
- action: z33.enum(ROLE_ACTIONS).describe("'accountable': what this role owns (explicit), reports on (reporting), and \u2014 not yet computed \u2014 inherits via Team-Lead vacancy coverage."),
13742
- roleId: z33.string().max(200).optional().describe("The role, by the human chain id `chain.getEntry` or `pb get` would print for it, or a raw entry id. Required for 'accountable'."),
13743
- canonicalKey: z33.string().max(200).optional().describe("'accountable': narrow to one kind (e.g. objective, key_result, tension)."),
13744
- limit: z33.number().int().positive().max(200).optional().describe("'accountable': max explicit-list rows per page (default and maximum 200)."),
13745
- cursor: z33.number().optional().describe("'accountable': continue the explicit list from an earlier truncated page's nextCursor.")
13656
+ var roleSchema = z31.object({
13657
+ action: z31.enum(ROLE_ACTIONS).describe("'accountable': what this role owns (explicit), reports on (reporting), and \u2014 not yet computed \u2014 inherits via Team-Lead vacancy coverage."),
13658
+ roleId: z31.string().max(200).optional().describe("The role, by the human chain id `chain.getEntry` or `pb get` would print for it, or a raw entry id. Required for 'accountable'."),
13659
+ canonicalKey: z31.string().max(200).optional().describe("'accountable': narrow to one kind (e.g. objective, key_result, tension)."),
13660
+ limit: z31.number().int().positive().max(200).optional().describe("'accountable': max explicit-list rows per page (default and maximum 200)."),
13661
+ cursor: z31.number().optional().describe("'accountable': continue the explicit list from an earlier truncated page's nextCursor.")
13746
13662
  });
13747
- var accountableVariant = z33.object({
13748
- action: z33.literal("accountable"),
13749
- roleId: z33.string().max(200),
13750
- canonicalKey: z33.string().max(200).optional(),
13751
- limit: z33.number().int().positive().max(200).optional(),
13752
- cursor: z33.number().optional()
13663
+ var accountableVariant = z31.object({
13664
+ action: z31.literal("accountable"),
13665
+ roleId: z31.string().max(200),
13666
+ canonicalKey: z31.string().max(200).optional(),
13667
+ limit: z31.number().int().positive().max(200).optional(),
13668
+ cursor: z31.number().optional()
13753
13669
  });
13754
- var roleActionUnion = z33.discriminatedUnion("action", [accountableVariant]);
13670
+ var roleActionUnion = z31.discriminatedUnion("action", [accountableVariant]);
13755
13671
  var ROLE_ACTION_SPECS = {
13756
13672
  accountable: { params: ["roleId", "canonicalKey", "limit", "cursor"], description: "roleId is required; canonicalKey/limit/cursor are optional." }
13757
13673
  };
@@ -13825,49 +13741,49 @@ function registerRoleTools(server) {
13825
13741
  }
13826
13742
 
13827
13743
  // src/tools/outcome.ts
13828
- import { z as z34 } from "zod/v3";
13744
+ import { z as z32 } from "zod/v3";
13829
13745
  var OUTCOME_ACTIONS = ["record", "list", "show"];
13830
13746
  var READING_KINDS = ["measurement", "estimate", "correction"];
13831
- var outcomeSchema = z34.object({
13832
- action: z34.enum(OUTCOME_ACTIONS).describe(
13747
+ var outcomeSchema = z32.object({
13748
+ action: z32.enum(OUTCOME_ACTIONS).describe(
13833
13749
  "'record': record a reading (evidence, not a verdict). 'list': list readings, newest first. 'show': the derived view \u2014 current, progress, pace, staleness, recorded completion."
13834
13750
  ),
13835
- entryId: z34.string().max(200).optional().describe("The key result (or other outcome-bearing) entry, by its chain id. Required for all three actions."),
13751
+ entryId: z32.string().max(200).optional().describe("The key result (or other outcome-bearing) entry, by its chain id. Required for all three actions."),
13836
13752
  // PR #858 review round 3 (Codex P2, PRRT_kwDORS4ils6gXHj9): a JSON number that overflows to
13837
13753
  // `Infinity` (e.g. `1e400`) parses fine in JS and passes a plain `z.number()`, but
13838
13754
  // `callGateway()` serializes it with `JSON.stringify`, which turns `Infinity` into `null` —
13839
13755
  // the backend's `v.number()` validator then rejects a call this tool's own schema accepted.
13840
13756
  // `.finite()` rejects it here, matching the explicit finite-value checks the CLI/other outcome
13841
13757
  // entry surfaces already use.
13842
- value: z34.number().finite().optional().describe("'record': the measured value. Required for 'record'."),
13843
- valueText: z34.string().max(500).optional().describe("'record': verbatim as-reported form when the source was not clean, e.g. '~62%'. Display only."),
13844
- asOf: z34.string().max(64).optional().describe("'record': when the world was in this state, as a parseable date (default: now). Back-dating a backfill is legitimate \u2014 it shows up as asOf earlier than recordedAt."),
13845
- kind: z34.enum(READING_KINDS).optional().describe("'record': measurement | estimate | correction (default: measurement)."),
13846
- correctsReadingId: z34.string().max(200).optional().describe("'record': required with kind='correction' \u2014 the reading id this replaces. Refused if that row is already superseded."),
13847
- recordedByRoleId: z34.string().max(200).optional().describe("'record': the accountable role (default: the entry's reporterRoleId, then its owning role)."),
13848
- note: z34.string().max(2e3).optional().describe("'record': free-text note recorded with the reading."),
13849
- source: z34.string().max(500).optional().describe("'record': where the number came from \u2014 a dashboard name, a query, a URL."),
13850
- limit: z34.number().int().positive().max(200).optional().describe("'list': max rows to return (default and maximum 200).")
13758
+ value: z32.number().finite().optional().describe("'record': the measured value. Required for 'record'."),
13759
+ valueText: z32.string().max(500).optional().describe("'record': verbatim as-reported form when the source was not clean, e.g. '~62%'. Display only."),
13760
+ asOf: z32.string().max(64).optional().describe("'record': when the world was in this state, as a parseable date (default: now). Back-dating a backfill is legitimate \u2014 it shows up as asOf earlier than recordedAt."),
13761
+ kind: z32.enum(READING_KINDS).optional().describe("'record': measurement | estimate | correction (default: measurement)."),
13762
+ correctsReadingId: z32.string().max(200).optional().describe("'record': required with kind='correction' \u2014 the reading id this replaces. Refused if that row is already superseded."),
13763
+ recordedByRoleId: z32.string().max(200).optional().describe("'record': the accountable role (default: the entry's reporterRoleId, then its owning role)."),
13764
+ note: z32.string().max(2e3).optional().describe("'record': free-text note recorded with the reading."),
13765
+ source: z32.string().max(500).optional().describe("'record': where the number came from \u2014 a dashboard name, a query, a URL."),
13766
+ limit: z32.number().int().positive().max(200).optional().describe("'list': max rows to return (default and maximum 200).")
13851
13767
  });
13852
- var recordVariant = z34.object({
13853
- action: z34.literal("record"),
13854
- entryId: z34.string().max(200),
13855
- value: z34.number().finite(),
13856
- valueText: z34.string().max(500).optional(),
13857
- asOf: z34.string().max(64).optional(),
13858
- kind: z34.enum(READING_KINDS).optional(),
13859
- correctsReadingId: z34.string().max(200).optional(),
13860
- recordedByRoleId: z34.string().max(200).optional(),
13861
- note: z34.string().max(2e3).optional(),
13862
- source: z34.string().max(500).optional()
13768
+ var recordVariant = z32.object({
13769
+ action: z32.literal("record"),
13770
+ entryId: z32.string().max(200),
13771
+ value: z32.number().finite(),
13772
+ valueText: z32.string().max(500).optional(),
13773
+ asOf: z32.string().max(64).optional(),
13774
+ kind: z32.enum(READING_KINDS).optional(),
13775
+ correctsReadingId: z32.string().max(200).optional(),
13776
+ recordedByRoleId: z32.string().max(200).optional(),
13777
+ note: z32.string().max(2e3).optional(),
13778
+ source: z32.string().max(500).optional()
13863
13779
  });
13864
- var listVariant2 = z34.object({
13865
- action: z34.literal("list"),
13866
- entryId: z34.string().max(200),
13867
- limit: z34.number().int().positive().max(200).optional()
13780
+ var listVariant2 = z32.object({
13781
+ action: z32.literal("list"),
13782
+ entryId: z32.string().max(200),
13783
+ limit: z32.number().int().positive().max(200).optional()
13868
13784
  });
13869
- var showVariant = z34.object({ action: z34.literal("show"), entryId: z34.string().max(200) });
13870
- var outcomeActionUnion = z34.discriminatedUnion("action", [recordVariant, listVariant2, showVariant]);
13785
+ var showVariant = z32.object({ action: z32.literal("show"), entryId: z32.string().max(200) });
13786
+ var outcomeActionUnion = z32.discriminatedUnion("action", [recordVariant, listVariant2, showVariant]);
13871
13787
  var OUTCOME_ACTION_SPECS = {
13872
13788
  record: {
13873
13789
  params: ["entryId", "value", "valueText", "asOf", "kind", "correctsReadingId", "recordedByRoleId", "note", "source"],
@@ -14076,7 +13992,7 @@ var AGENT_CHEATSHEET = `# Product Brain \u2014 Agent Cheatsheet
14076
13992
  ## Core Tools (Serves 15 compound tools, always)
14077
13993
  | Tool | Purpose | Actions |
14078
13994
  |---|---|---|
14079
- | \`orient\` | Workspace context, governance, active work packages, session start | \`action\`: start, task, record-activation |
13995
+ | \`orient\` | Workspace context, governance, active work packages, session start | \`action\`: start, task |
14080
13996
  | \`capture\` | Create entry | \`action\`: capture |
14081
13997
  | \`entries\` | Read and write entries | \`action\`: list, get, batch, search, update, commit, history, move, verify, preflight |
14082
13998
  | \`relations\` | Link entries, dismiss suggestions and delete links, find and suggest | \`action\`: create, batch-create, dismiss, delete, find, suggest |
@@ -14084,7 +14000,7 @@ var AGENT_CHEATSHEET = `# Product Brain \u2014 Agent Cheatsheet
14084
14000
  | \`collections\` | Browse, describe, audit and export collections; manage labels | \`action\`: list, update, describe, audit, export, label-* |
14085
14001
  | \`quality\` | Score an entry, verify the Chain, audit a work package, spine check | \`action\`: check, re-evaluate, verify-chain, audit, spine-check |
14086
14002
  | \`session\` | Start / close, wrapup, resume, constellation accept | \`action\`: start, close, status, wrapup-review, wrapup-commit, resume, commit-constellation |
14087
- | \`workflows\` | Run workflows, checkpoint, load a skill | \`action\`: list, start, checkpoint, get-run, load-skill |
14003
+ | \`workflows\` | Run workflows, checkpoint | \`action\`: list, start, checkpoint, get-run |
14088
14004
  | \`workspace\` | Check / whoami / status / self-test, usage, governance proposals | \`action\`: check, whoami, status, audit, self-test, usage, proposals-* |
14089
14005
  | \`feedback\` | Submit product feedback (any key, no session required); \`list\` reads back your own workspace's feedback (no gate); vendor triage: queue / note / group / status | \`action\`: submit, list, queue, note, group, status |
14090
14006
  | \`shape\` | Review / disposition write-shape (single-concern split) advisories | \`action\`: list, show, agree, dismiss |
@@ -14603,12 +14519,12 @@ ${entry.labels.map((l) => `- ${l.name ?? l.slug}`).join("\n")}`);
14603
14519
  }
14604
14520
 
14605
14521
  // src/prompts/index.ts
14606
- import { z as z35 } from "zod/v3";
14522
+ import { z as z33 } from "zod/v3";
14607
14523
  function registerPrompts(server) {
14608
14524
  server.prompt(
14609
14525
  "review-against-rules",
14610
14526
  "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.",
14611
- { domain: z35.string().describe("Business rule domain (e.g. 'Identity & Access', 'Governance & Decision-Making')") },
14527
+ { domain: z33.string().describe("Business rule domain (e.g. 'Identity & Access', 'Governance & Decision-Making')") },
14612
14528
  async ({ domain }) => {
14613
14529
  const entries = await kernelQuery("chain.listEntries", { collectionSlug: "business-rules" });
14614
14530
  const rules = entries.filter((e) => e.data?.domain === domain);
@@ -14661,7 +14577,7 @@ Provide a structured review with a compliance status for each rule (COMPLIANT /
14661
14577
  server.prompt(
14662
14578
  "name-check",
14663
14579
  "Check variable names, field names, or API names against the glossary for terminology alignment. Flags drift from canonical terms.",
14664
- { names: z35.string().describe("Comma-separated list of names to check (e.g. 'vendor_id, compliance_level, formulator_type')") },
14580
+ { names: z33.string().describe("Comma-separated list of names to check (e.g. 'vendor_id, compliance_level, formulator_type')") },
14665
14581
  async ({ names }) => {
14666
14582
  const terms = await kernelQuery("chain.listEntries", { collectionSlug: "glossary" });
14667
14583
  const glossaryContext = terms.map(
@@ -14697,7 +14613,7 @@ Format as a table: Name | Status | Canonical Form | Action Needed`
14697
14613
  server.prompt(
14698
14614
  "draft-decision-record",
14699
14615
  "Draft a structured decision record from a description of what was decided. Includes context from recent decisions and relevant rules.",
14700
- { context: z35.string().describe("Description of the decision (e.g. 'We decided to use MRSL v3.1 as the conformance baseline because...')") },
14616
+ { context: z33.string().describe("Description of the decision (e.g. 'We decided to use MRSL v3.1 as the conformance baseline because...')") },
14701
14617
  async ({ context }) => {
14702
14618
  const recentDecisions = await kernelQuery("chain.listEntries", { collectionSlug: "decisions" });
14703
14619
  const sorted = [...recentDecisions].sort((a, b) => (b.data?.date ?? "") > (a.data?.date ?? "") ? 1 : -1).slice(0, 5);
@@ -14735,8 +14651,8 @@ After drafting, I can log it using the capture tool with collection "decisions".
14735
14651
  "draft-rule-from-context",
14736
14652
  "Draft a new business rule from an observation or discovery made while coding. Fetches existing rules for the domain to ensure consistency.",
14737
14653
  {
14738
- observation: z35.string().describe("What you observed or discovered (e.g. 'Suppliers can have multiple org types in Gateway')"),
14739
- domain: z35.string().describe("Which domain this rule belongs to (e.g. 'Governance & Decision-Making')")
14654
+ observation: z33.string().describe("What you observed or discovered (e.g. 'Suppliers can have multiple org types in Gateway')"),
14655
+ domain: z33.string().describe("Which domain this rule belongs to (e.g. 'Governance & Decision-Making')")
14740
14656
  },
14741
14657
  async ({ observation, domain }) => {
14742
14658
  const allRules = await kernelQuery("chain.listEntries", { collectionSlug: "business-rules" });
@@ -14895,4 +14811,4 @@ export {
14895
14811
  createProductBrainServer,
14896
14812
  initFeatureFlags
14897
14813
  };
14898
- //# sourceMappingURL=chunk-LG47FFGY.js.map
14814
+ //# sourceMappingURL=chunk-DEBGV6NZ.js.map