@productbrain/mcp 0.0.1-beta.8509 → 0.0.1-beta.8518
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-BIHHHC2H.js → chunk-DN3E44ZV.js} +263 -437
- package/dist/chunk-DN3E44ZV.js.map +1 -0
- package/dist/{chunk-JRPTAOCM.js → chunk-UPQW54GN.js} +1 -3
- package/dist/chunk-UPQW54GN.js.map +1 -0
- package/dist/cli/index.js +1 -1
- package/dist/http.js +2 -2
- package/dist/index.js +2 -2
- package/dist/{setup-KZT763MJ.js → setup-2VG6YLVK.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-BIHHHC2H.js.map +0 -1
- package/dist/chunk-JRPTAOCM.js.map +0 -1
- /package/dist/{setup-KZT763MJ.js.map → setup-2VG6YLVK.js.map} +0 -0
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
getAuditLog,
|
|
9
9
|
getConversationId,
|
|
10
10
|
getMergedGatewaySeamCounters,
|
|
11
|
-
getRequestApiKey,
|
|
12
11
|
getWorkspaceContext,
|
|
13
12
|
getWorkspaceId,
|
|
14
13
|
isSessionOriented,
|
|
@@ -39,7 +38,7 @@ import {
|
|
|
39
38
|
trackQualityVerdict,
|
|
40
39
|
trackSessionCaptureRate,
|
|
41
40
|
trackZeroCaptureAuditFired
|
|
42
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-UPQW54GN.js";
|
|
43
42
|
|
|
44
43
|
// src/server.ts
|
|
45
44
|
import { McpServer as McpServer2 } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -563,7 +562,6 @@ var TOOL_NAME_MIGRATIONS = /* @__PURE__ */ new Map([
|
|
|
563
562
|
["start_pb", 'orient action="start"'],
|
|
564
563
|
["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."],
|
|
565
564
|
["get-usage-summary", 'workspace action="usage"'],
|
|
566
|
-
["audit", 'quality action="audit"'],
|
|
567
565
|
// WP-776 S2a (DEC-1771): the `workspace` tool's proposals-list/proposals-respond/proposals-count
|
|
568
566
|
// actions this row targeted are themselves deleted along with the relation-consent proposal
|
|
569
567
|
// system — retargeted to a NOTICE row, same shape as skills/record_activation above. #1270
|
|
@@ -7805,7 +7803,6 @@ function formatGapOneLiner(gap) {
|
|
|
7805
7803
|
}
|
|
7806
7804
|
|
|
7807
7805
|
// src/lib/canonicalRefs.ts
|
|
7808
|
-
var VOCAB_TOKEN_REGEX = /\{\{vocab:([a-z_]+)\.([a-z_]+)\}\}/g;
|
|
7809
7806
|
function getCollectionLabel(canonicalKey, form, workspaceCtx, collectionCtx) {
|
|
7810
7807
|
const wsLabels = workspaceCtx?.collectionLabels?.[canonicalKey];
|
|
7811
7808
|
if (wsLabels) {
|
|
@@ -7824,14 +7821,6 @@ function getCollectionLabel(canonicalKey, form, workspaceCtx, collectionCtx) {
|
|
|
7824
7821
|
}
|
|
7825
7822
|
return canonicalKey;
|
|
7826
7823
|
}
|
|
7827
|
-
function replaceVocabTokens(body, workspaceCtx, collectionCtxMap) {
|
|
7828
|
-
if (!body || body.length === 0) return body;
|
|
7829
|
-
const regex = new RegExp(VOCAB_TOKEN_REGEX.source, "g");
|
|
7830
|
-
return body.replace(regex, (_match, canonicalKey, form) => {
|
|
7831
|
-
const collectionCtx = collectionCtxMap?.get(canonicalKey);
|
|
7832
|
-
return getCollectionLabel(canonicalKey, form, workspaceCtx, collectionCtx);
|
|
7833
|
-
});
|
|
7834
|
-
}
|
|
7835
7824
|
|
|
7836
7825
|
// src/tools/start_pb.ts
|
|
7837
7826
|
import { z as z18 } from "zod/v3";
|
|
@@ -10688,158 +10677,7 @@ function parseListOutput(output) {
|
|
|
10688
10677
|
}
|
|
10689
10678
|
|
|
10690
10679
|
// src/tools/quality.ts
|
|
10691
|
-
import { z as z22 } from "zod/v3";
|
|
10692
|
-
|
|
10693
|
-
// src/tools/audit.ts
|
|
10694
10680
|
import { z as z21 } from "zod/v3";
|
|
10695
|
-
var VOCAB_TTL_MS = 5 * 60 * 1e3;
|
|
10696
|
-
var MAX_VOCAB_KEYS = 100;
|
|
10697
|
-
var vocabCache = /* @__PURE__ */ new Map();
|
|
10698
|
-
function getCachedVocab(key) {
|
|
10699
|
-
const entry = vocabCache.get(key);
|
|
10700
|
-
if (!entry) return "miss";
|
|
10701
|
-
if (Date.now() >= entry.expiresAt) {
|
|
10702
|
-
vocabCache.delete(key);
|
|
10703
|
-
return "miss";
|
|
10704
|
-
}
|
|
10705
|
-
return entry.ctx;
|
|
10706
|
-
}
|
|
10707
|
-
function setCachedVocab(key, ctx) {
|
|
10708
|
-
vocabCache.set(key, { ctx, expiresAt: Date.now() + VOCAB_TTL_MS });
|
|
10709
|
-
evictVocabIfFull();
|
|
10710
|
-
}
|
|
10711
|
-
function evictVocabIfFull() {
|
|
10712
|
-
if (vocabCache.size <= MAX_VOCAB_KEYS) return;
|
|
10713
|
-
const now = Date.now();
|
|
10714
|
-
for (const [k, v] of vocabCache) {
|
|
10715
|
-
if (now >= v.expiresAt) vocabCache.delete(k);
|
|
10716
|
-
}
|
|
10717
|
-
if (vocabCache.size > MAX_VOCAB_KEYS) {
|
|
10718
|
-
const sorted = [...vocabCache.entries()].sort((a, b) => a[1].expiresAt - b[1].expiresAt);
|
|
10719
|
-
const excess = vocabCache.size - MAX_VOCAB_KEYS;
|
|
10720
|
-
for (let i = 0; i < excess; i++) vocabCache.delete(sorted[i][0]);
|
|
10721
|
-
}
|
|
10722
|
-
}
|
|
10723
|
-
var AUDIT_ACTIONS = ["run"];
|
|
10724
|
-
var auditSchema = z21.object({
|
|
10725
|
-
action: z21.enum(AUDIT_ACTIONS).describe(
|
|
10726
|
-
"'run': run the hygiene audit for a work package entry."
|
|
10727
|
-
),
|
|
10728
|
-
entryId: z21.string().describe("Work package entry ID to audit, e.g. '<PREFIX>-<n>'"),
|
|
10729
|
-
// Chain: WP-770 K2, DEC-1796 — doneWhen runs unconditionally (DEC-1852) in both phases.
|
|
10730
|
-
phase: z21.enum(["shaping", "handoff"]).default("shaping").optional().describe(
|
|
10731
|
-
"'shaping': run the core hygiene gates only. 'handoff': also runs the outcome-coupling gates (KR linkage, verification window). doneWhen is checked unconditionally either way. Default: shaping."
|
|
10732
|
-
)
|
|
10733
|
-
});
|
|
10734
|
-
async function handleAuditRun(entryId, phase) {
|
|
10735
|
-
let result2;
|
|
10736
|
-
try {
|
|
10737
|
-
result2 = await kernelQuery("chain.auditBet", { entryId, phase });
|
|
10738
|
-
} catch (err) {
|
|
10739
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
10740
|
-
if (msg.includes("not found") || msg.includes("NOT_FOUND")) {
|
|
10741
|
-
return failureResult(
|
|
10742
|
-
`Entry '${entryId}' not found.`,
|
|
10743
|
-
"NOT_FOUND",
|
|
10744
|
-
`Entry '${entryId}' not found.`,
|
|
10745
|
-
"Use entries action=search to find the correct ID.",
|
|
10746
|
-
[{ tool: "entries", description: "Search entries", parameters: { action: "search", query: entryId } }]
|
|
10747
|
-
);
|
|
10748
|
-
}
|
|
10749
|
-
throw err;
|
|
10750
|
-
}
|
|
10751
|
-
let vocabCtx;
|
|
10752
|
-
const cacheKey = getRequestApiKey() ?? "__stdio_default__";
|
|
10753
|
-
const cached = getCachedVocab(cacheKey);
|
|
10754
|
-
if (cached !== "miss") {
|
|
10755
|
-
vocabCtx = cached;
|
|
10756
|
-
} else {
|
|
10757
|
-
try {
|
|
10758
|
-
const vocab = await kernelQuery("chain.getVocabulary", {});
|
|
10759
|
-
if (vocab?.collectionLabels || vocab?.collectionDefaults) {
|
|
10760
|
-
vocabCtx = {
|
|
10761
|
-
...vocab.collectionLabels ? { collectionLabels: vocab.collectionLabels } : {},
|
|
10762
|
-
...vocab.collectionDefaults ? { collectionDefaults: vocab.collectionDefaults } : {}
|
|
10763
|
-
};
|
|
10764
|
-
}
|
|
10765
|
-
setCachedVocab(cacheKey, vocabCtx);
|
|
10766
|
-
} catch {
|
|
10767
|
-
}
|
|
10768
|
-
}
|
|
10769
|
-
for (const gate of result2.gates) {
|
|
10770
|
-
if (gate.tokens?.detail) gate.detail = replaceVocabTokens(gate.detail, vocabCtx);
|
|
10771
|
-
if (gate.tokens?.fix && gate.fix) gate.fix = replaceVocabTokens(gate.fix, vocabCtx);
|
|
10772
|
-
if (gate.tokens?.hint && gate.hint) gate.hint = replaceVocabTokens(gate.hint, vocabCtx);
|
|
10773
|
-
}
|
|
10774
|
-
const { verdict, gates, summary, entryName, elapsed_ms } = result2;
|
|
10775
|
-
const verdictIcon = verdict === "pass" ? "\u2713" : verdict === "fail" ? "\u2717" : "\u26A0";
|
|
10776
|
-
const verdictLabel = verdict.toUpperCase();
|
|
10777
|
-
const lines = [
|
|
10778
|
-
`## Audit: ${entryId} \u2014 ${entryName}`,
|
|
10779
|
-
`Phase: ${phase} | Verdict: ${verdictIcon} ${verdictLabel} | ${elapsed_ms}ms`,
|
|
10780
|
-
`Gates: ${summary.passed}/${summary.total} passed \xB7 ${summary.failed} failed \xB7 ${summary.warned} warned`,
|
|
10781
|
-
""
|
|
10782
|
-
];
|
|
10783
|
-
const failed = gates.filter((g) => g.status === "fail");
|
|
10784
|
-
const warned = gates.filter((g) => g.status === "warn");
|
|
10785
|
-
const passed = gates.filter((g) => g.status === "pass");
|
|
10786
|
-
if (failed.length > 0) {
|
|
10787
|
-
lines.push("### \u2717 Failed Gates (blocking)");
|
|
10788
|
-
for (const gate of failed) {
|
|
10789
|
-
lines.push(`**${gate.gate}**: ${gate.detail}`);
|
|
10790
|
-
if (gate.fix) lines.push(` \u2192 Fix: ${gate.fix}`);
|
|
10791
|
-
if (gate.hint) lines.push(` \u2192 Note: ${gate.hint}`);
|
|
10792
|
-
}
|
|
10793
|
-
lines.push("");
|
|
10794
|
-
}
|
|
10795
|
-
if (warned.length > 0) {
|
|
10796
|
-
lines.push("### \u26A0 Warnings (non-blocking)");
|
|
10797
|
-
for (const gate of warned) {
|
|
10798
|
-
lines.push(`**${gate.gate}**: ${gate.detail}`);
|
|
10799
|
-
if (gate.fix) lines.push(` \u2192 Fix: ${gate.fix}`);
|
|
10800
|
-
if (gate.hint) lines.push(` \u2192 Note: ${gate.hint}`);
|
|
10801
|
-
}
|
|
10802
|
-
lines.push("");
|
|
10803
|
-
}
|
|
10804
|
-
if (passed.length > 0 && verdict === "pass") {
|
|
10805
|
-
lines.push("### \u2713 All Gates Passed");
|
|
10806
|
-
for (const gate of passed) {
|
|
10807
|
-
lines.push(` ${gate.gate}: ${gate.detail}`);
|
|
10808
|
-
}
|
|
10809
|
-
} else if (passed.length > 0) {
|
|
10810
|
-
lines.push(`### \u2713 Passed (${passed.length}): ${passed.map((g) => g.gate).join(", ")}`);
|
|
10811
|
-
}
|
|
10812
|
-
const nextActions = [];
|
|
10813
|
-
if (verdict !== "pass") {
|
|
10814
|
-
nextActions.push({
|
|
10815
|
-
tool: "entries",
|
|
10816
|
-
description: "View full entry details",
|
|
10817
|
-
parameters: { action: "get", entryId }
|
|
10818
|
-
});
|
|
10819
|
-
nextActions.push({
|
|
10820
|
-
tool: "relations",
|
|
10821
|
-
description: "Manage entry relations",
|
|
10822
|
-
parameters: { action: "list", entryId }
|
|
10823
|
-
});
|
|
10824
|
-
}
|
|
10825
|
-
return {
|
|
10826
|
-
content: [{ type: "text", text: lines.join("\n") }],
|
|
10827
|
-
structuredContent: success(
|
|
10828
|
-
`Audit ${entryId} (${phase}): ${verdictLabel} \u2014 ${summary.passed}/${summary.total} gates passed.`,
|
|
10829
|
-
{
|
|
10830
|
-
entryId: result2.entryId,
|
|
10831
|
-
entryName: result2.entryName,
|
|
10832
|
-
phase: result2.phase,
|
|
10833
|
-
clean: result2.clean,
|
|
10834
|
-
verdict: result2.verdict,
|
|
10835
|
-
gates: result2.gates,
|
|
10836
|
-
summary: result2.summary,
|
|
10837
|
-
elapsed_ms: result2.elapsed_ms
|
|
10838
|
-
},
|
|
10839
|
-
nextActions.length > 0 ? nextActions : void 0
|
|
10840
|
-
)
|
|
10841
|
-
};
|
|
10842
|
-
}
|
|
10843
10681
|
|
|
10844
10682
|
// src/lib/spineVerdictRead.ts
|
|
10845
10683
|
function isRecord(value) {
|
|
@@ -11003,110 +10841,98 @@ async function handleSpineCheck(story, refresh = false) {
|
|
|
11003
10841
|
}
|
|
11004
10842
|
|
|
11005
10843
|
// src/tools/quality.ts
|
|
11006
|
-
var QUALITY_ACTIONS = ["check", "re-evaluate", "verify-chain", "
|
|
11007
|
-
var qualitySchema =
|
|
11008
|
-
action:
|
|
11009
|
-
"'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`. '
|
|
11010
|
-
),
|
|
11011
|
-
entryId: z22.string().max(200).optional().describe("For 'check'/'re-evaluate'/'audit': entry ID, e.g. 'TEN-graph-db', '<PREFIX>-<n>'."),
|
|
11012
|
-
context: z22.enum(["capture", "commit", "review"]).default("review").optional().describe("For re-evaluate: evaluation context"),
|
|
11013
|
-
collection: z22.string().max(200).optional().describe("For 'verify-chain': collection slug to verify (default: glossary)."),
|
|
11014
|
-
mode: z22.enum(["report", "fix"]).optional().describe("For 'verify-chain': 'report' = read-only trust report (default). 'fix' = also update drifted codeMapping statuses."),
|
|
11015
|
-
// Chain: WP-770 K2, DEC-1796 — doneWhen runs unconditionally (DEC-1852) in both phases.
|
|
11016
|
-
phase: z22.enum(["shaping", "handoff"]).optional().describe(
|
|
11017
|
-
"For 'audit': 'shaping' runs the core hygiene gates only (default). 'handoff' also runs the outcome-coupling gates (KR linkage, verification window). doneWhen is checked unconditionally either way."
|
|
10844
|
+
var QUALITY_ACTIONS = ["check", "re-evaluate", "verify-chain", "spine-check"];
|
|
10845
|
+
var qualitySchema = z21.object({
|
|
10846
|
+
action: z21.enum(QUALITY_ACTIONS).describe(
|
|
10847
|
+
"'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`. 'spine-check': structural completeness of the purpose+vision+strategy spine \u2014 story:true also runs the on-demand one-story judgment."
|
|
11018
10848
|
),
|
|
11019
|
-
|
|
11020
|
-
|
|
10849
|
+
entryId: z21.string().max(200).optional().describe("For 'check'/'re-evaluate': entry ID, e.g. 'TEN-graph-db', '<PREFIX>-<n>'."),
|
|
10850
|
+
context: z21.enum(["capture", "commit", "review"]).default("review").optional().describe("For re-evaluate: evaluation context"),
|
|
10851
|
+
collection: z21.string().max(200).optional().describe("For 'verify-chain': collection slug to verify (default: glossary)."),
|
|
10852
|
+
mode: z21.enum(["report", "fix"]).optional().describe("For 'verify-chain': 'report' = read-only trust report (default). 'fix' = also update drifted codeMapping statuses."),
|
|
10853
|
+
story: z21.boolean().optional().describe("For 'spine-check': also run the on-demand one-story LLM judgment (never scheduled; result labelled [unvalidated])."),
|
|
10854
|
+
refresh: z21.boolean().optional().describe(
|
|
11021
10855
|
"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."
|
|
11022
10856
|
)
|
|
11023
10857
|
});
|
|
11024
|
-
var qualityCheckVariant =
|
|
11025
|
-
var qualityReEvaluateVariant =
|
|
11026
|
-
action:
|
|
11027
|
-
entryId:
|
|
11028
|
-
context:
|
|
10858
|
+
var qualityCheckVariant = z21.object({ action: z21.literal("check"), entryId: z21.string().max(200) });
|
|
10859
|
+
var qualityReEvaluateVariant = z21.object({
|
|
10860
|
+
action: z21.literal("re-evaluate"),
|
|
10861
|
+
entryId: z21.string().max(200),
|
|
10862
|
+
context: z21.enum(["capture", "commit", "review"]).optional().default("review")
|
|
11029
10863
|
});
|
|
11030
|
-
var qualityVerifyChainVariant =
|
|
11031
|
-
action:
|
|
11032
|
-
collection:
|
|
11033
|
-
mode:
|
|
10864
|
+
var qualityVerifyChainVariant = z21.object({
|
|
10865
|
+
action: z21.literal("verify-chain"),
|
|
10866
|
+
collection: z21.string().max(200).optional().default("glossary"),
|
|
10867
|
+
mode: z21.enum(["report", "fix"]).optional().default("report")
|
|
11034
10868
|
});
|
|
11035
|
-
var
|
|
11036
|
-
action:
|
|
11037
|
-
|
|
11038
|
-
|
|
10869
|
+
var qualitySpineCheckVariant = z21.object({
|
|
10870
|
+
action: z21.literal("spine-check"),
|
|
10871
|
+
story: z21.boolean().optional().default(false),
|
|
10872
|
+
refresh: z21.boolean().optional().default(false)
|
|
11039
10873
|
});
|
|
11040
|
-
var
|
|
11041
|
-
action: z22.literal("spine-check"),
|
|
11042
|
-
story: z22.boolean().optional().default(false),
|
|
11043
|
-
refresh: z22.boolean().optional().default(false)
|
|
11044
|
-
});
|
|
11045
|
-
var qualityActionUnion = z22.discriminatedUnion("action", [
|
|
10874
|
+
var qualityActionUnion = z21.discriminatedUnion("action", [
|
|
11046
10875
|
qualityCheckVariant,
|
|
11047
10876
|
qualityReEvaluateVariant,
|
|
11048
10877
|
qualityVerifyChainVariant,
|
|
11049
|
-
qualityAuditVariant,
|
|
11050
10878
|
qualitySpineCheckVariant
|
|
11051
10879
|
]);
|
|
11052
10880
|
var QUALITY_ACTION_SPECS = {
|
|
11053
10881
|
check: { params: ["entryId"], description: "entryId is required." },
|
|
11054
10882
|
"re-evaluate": { params: ["entryId", "context"], description: "entryId is required." },
|
|
11055
10883
|
"verify-chain": { params: ["collection", "mode"], description: "All params optional; collection defaults to 'glossary'." },
|
|
11056
|
-
audit: { params: ["entryId", "phase"], description: "entryId is required." },
|
|
11057
10884
|
"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)." }
|
|
11058
10885
|
};
|
|
11059
|
-
var qualityCheckOutputSchema =
|
|
11060
|
-
entryId:
|
|
10886
|
+
var qualityCheckOutputSchema = z21.object({
|
|
10887
|
+
entryId: z21.string(),
|
|
11061
10888
|
/** WP-480 S1: false = the ID does not resolve to an entry (typo/deleted) — distinct from "no verdict yet". */
|
|
11062
|
-
entryFound:
|
|
11063
|
-
hasVerdict:
|
|
10889
|
+
entryFound: z21.boolean().optional(),
|
|
10890
|
+
hasVerdict: z21.boolean(),
|
|
11064
10891
|
/** WP-480 S1: the verdict was judged against content the entry no longer has — re-evaluate for a current one. */
|
|
11065
|
-
stale:
|
|
11066
|
-
tier:
|
|
11067
|
-
passed:
|
|
11068
|
-
criteria:
|
|
11069
|
-
id:
|
|
11070
|
-
passed:
|
|
11071
|
-
hint:
|
|
10892
|
+
stale: z21.boolean().optional(),
|
|
10893
|
+
tier: z21.string().optional(),
|
|
10894
|
+
passed: z21.boolean().optional(),
|
|
10895
|
+
criteria: z21.array(z21.object({
|
|
10896
|
+
id: z21.string(),
|
|
10897
|
+
passed: z21.boolean(),
|
|
10898
|
+
hint: z21.string().optional()
|
|
11072
10899
|
}))
|
|
11073
10900
|
});
|
|
11074
|
-
var qualityReevaluateOutputSchema =
|
|
11075
|
-
entryId:
|
|
11076
|
-
context:
|
|
11077
|
-
score:
|
|
11078
|
-
maxScore:
|
|
11079
|
-
improved:
|
|
10901
|
+
var qualityReevaluateOutputSchema = z21.object({
|
|
10902
|
+
entryId: z21.string(),
|
|
10903
|
+
context: z21.string(),
|
|
10904
|
+
score: z21.number(),
|
|
10905
|
+
maxScore: z21.number(),
|
|
10906
|
+
improved: z21.boolean()
|
|
11080
10907
|
});
|
|
11081
|
-
var qualitySpineCheckOutputSchema =
|
|
11082
|
-
hasVerdict:
|
|
11083
|
-
noSpineEntries:
|
|
11084
|
-
structuralPassed:
|
|
11085
|
-
storyPassed:
|
|
11086
|
-
stale:
|
|
10908
|
+
var qualitySpineCheckOutputSchema = z21.object({
|
|
10909
|
+
hasVerdict: z21.boolean(),
|
|
10910
|
+
noSpineEntries: z21.boolean().optional(),
|
|
10911
|
+
structuralPassed: z21.boolean().optional(),
|
|
10912
|
+
storyPassed: z21.boolean().nullable().optional(),
|
|
10913
|
+
stale: z21.boolean().optional(),
|
|
11087
10914
|
// TASK-156: a capped membership scan must stay distinguishable from a complete one, and a
|
|
11088
10915
|
// malformed verdict needs its own discriminator — both were silently stripped before this.
|
|
11089
|
-
staleMemberIds:
|
|
11090
|
-
membershipTruncated:
|
|
10916
|
+
staleMemberIds: z21.array(z21.string()).optional(),
|
|
10917
|
+
membershipTruncated: z21.boolean().optional(),
|
|
11091
10918
|
// PRRT_kwDORS4ils6i_PVS: a KNOWN relations-fingerprint mismatch, distinct from "unknown" —
|
|
11092
10919
|
// without this, a detected topology change and an unverifiable legacy fingerprint were
|
|
11093
10920
|
// indistinguishable in structured output.
|
|
11094
|
-
relationsChanged:
|
|
11095
|
-
malformed:
|
|
10921
|
+
relationsChanged: z21.boolean().optional(),
|
|
10922
|
+
malformed: z21.boolean().optional()
|
|
11096
10923
|
});
|
|
11097
10924
|
function registerQualityTools(server) {
|
|
11098
10925
|
const qualityHandlers = {
|
|
11099
10926
|
check: (data) => handleCheck(data.entryId),
|
|
11100
10927
|
"re-evaluate": (data) => handleReEvaluate(data.entryId, data.context ?? "review"),
|
|
11101
10928
|
"verify-chain": (data) => handleVerifyChain(server, { collection: data.collection ?? "glossary", mode: data.mode ?? "report" }),
|
|
11102
|
-
audit: (data) => handleAuditRun(data.entryId, data.phase ?? "shaping"),
|
|
11103
10929
|
"spine-check": (data) => handleSpineCheck(data.story ?? false, data.refresh ?? false)
|
|
11104
10930
|
};
|
|
11105
10931
|
server.registerTool(
|
|
11106
10932
|
"quality",
|
|
11107
10933
|
{
|
|
11108
10934
|
title: "Quality",
|
|
11109
|
-
description: "Assess, re-evaluate, and verify entry/work package quality.
|
|
10935
|
+
description: "Assess, re-evaluate, and verify entry/work package quality. Four actions:\n\n- **check**: Read the entry's server quality verdict (tier + criteria) \u2014 it does not re-score. Suggests links when the entry has no relations.\n- **re-evaluate**: Trigger a fresh quality evaluation. Returns heuristic verdict immediately, schedules LLM evaluation in background.\n- **verify-chain**: Verify knowledge entries against the actual codebase (codeMapping drift, cross-references) \u2014 absorbs `verify`. Produces a trust report with a trust score.\n- **spine-check**: Structural completeness of the purpose+vision+strategy spine \u2014 duplicate singletons, connectedness, per-strategy refusal heuristic; story:true also runs the on-demand one-story LLM judgment (never scheduled, result labelled [unvalidated]). Async: a plain call reads back the latest stored verdict and auto-schedules a new run ONLY when none is already in flight AND the stored one is absent/stale/missing the requested story pass \u2014 repeated polling never re-triggers work. Pass refresh:true to force a fresh run regardless.",
|
|
11110
10936
|
inputSchema: qualitySchema,
|
|
11111
10937
|
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false }
|
|
11112
10938
|
},
|
|
@@ -11274,10 +11100,10 @@ async function handleReEvaluate(entryId, context) {
|
|
|
11274
11100
|
}
|
|
11275
11101
|
|
|
11276
11102
|
// src/tools/session.ts
|
|
11277
|
-
import { z as
|
|
11103
|
+
import { z as z24 } from "zod/v3";
|
|
11278
11104
|
|
|
11279
11105
|
// src/tools/wrapup.ts
|
|
11280
|
-
import { z as
|
|
11106
|
+
import { z as z22 } from "zod/v3";
|
|
11281
11107
|
|
|
11282
11108
|
// src/lib/compose-wrapup-view.ts
|
|
11283
11109
|
function toComposed(e) {
|
|
@@ -11690,8 +11516,8 @@ async function runWrapupCommitAll(data, cachedSuggestions) {
|
|
|
11690
11516
|
overflowUnscanned
|
|
11691
11517
|
};
|
|
11692
11518
|
}
|
|
11693
|
-
var wrapupSchema =
|
|
11694
|
-
action:
|
|
11519
|
+
var wrapupSchema = z22.object({
|
|
11520
|
+
action: z22.enum(["review", "commit-all"]).optional().describe(
|
|
11695
11521
|
"Action to perform. 'review' (default) shows the wrapup summary. 'commit-all' accepts all uncommitted drafts and creates suggested links."
|
|
11696
11522
|
)
|
|
11697
11523
|
});
|
|
@@ -11791,26 +11617,26 @@ ${text}` : text;
|
|
|
11791
11617
|
}
|
|
11792
11618
|
|
|
11793
11619
|
// src/tools/facilitate.ts
|
|
11794
|
-
import { z as
|
|
11620
|
+
import { z as z23 } from "zod/v3";
|
|
11795
11621
|
var FACILITATE_ACTIONS = ["resume", "commit-constellation"];
|
|
11796
|
-
var coherencyAcknowledgementSchema =
|
|
11797
|
-
response:
|
|
11798
|
-
entryId:
|
|
11799
|
-
reason:
|
|
11800
|
-
subjectEntryId:
|
|
11622
|
+
var coherencyAcknowledgementSchema = z23.object({
|
|
11623
|
+
response: z23.string().max(200).describe("Acknowledgement response per offender: 'linked' | 'accepted-fix' | 'diverged'."),
|
|
11624
|
+
entryId: z23.string().max(200).optional().describe("Entry the acknowledgement links to (e.g. the strategic spine entry)."),
|
|
11625
|
+
reason: z23.string().max(2e3).optional().describe("Free-text justification, required for a 'diverged' response."),
|
|
11626
|
+
subjectEntryId: z23.string().max(200).optional().describe("The refused entry this acknowledgement answers.")
|
|
11801
11627
|
});
|
|
11802
|
-
var facilitateSchema =
|
|
11803
|
-
action:
|
|
11628
|
+
var facilitateSchema = z23.object({
|
|
11629
|
+
action: z23.enum(FACILITATE_ACTIONS).describe(
|
|
11804
11630
|
"'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."
|
|
11805
11631
|
),
|
|
11806
|
-
betEntryId:
|
|
11807
|
-
operationId:
|
|
11632
|
+
betEntryId: z23.string().max(200).optional().describe("Bet entry ID. Required for both actions."),
|
|
11633
|
+
operationId: z23.string().max(200).optional().describe("Optional idempotency key for commit-constellation retries."),
|
|
11808
11634
|
// WP-465 slice ⑤: coherency retry controls for a COHERENCY_REFUSED constellation hold.
|
|
11809
11635
|
// Forwarded verbatim to agentKnowledge.facilitateEnvelope (validation lives at the gate).
|
|
11810
|
-
coherencyAcknowledgements:
|
|
11636
|
+
coherencyAcknowledgements: z23.array(coherencyAcknowledgementSchema).max(20).optional().describe(
|
|
11811
11637
|
"Per-offender acknowledgements to retry a constellation held under standard/strict coherency mode. Each: {subjectEntryId, response: 'linked' | 'accepted-fix' | 'diverged', entryId?, reason?}."
|
|
11812
11638
|
),
|
|
11813
|
-
steeringOverrideReason:
|
|
11639
|
+
steeringOverrideReason: z23.string().max(2e3).optional().describe(
|
|
11814
11640
|
"Typed override reason (>= 12 chars) to push a constellation past a coherency hold instead of acknowledging."
|
|
11815
11641
|
)
|
|
11816
11642
|
});
|
|
@@ -12077,42 +11903,42 @@ var SESSION_ACTIONS = [
|
|
|
12077
11903
|
"resume",
|
|
12078
11904
|
"commit-constellation"
|
|
12079
11905
|
];
|
|
12080
|
-
var coherencyAcknowledgementFlatSchema2 =
|
|
12081
|
-
response:
|
|
12082
|
-
entryId:
|
|
12083
|
-
reason:
|
|
12084
|
-
subjectEntryId:
|
|
11906
|
+
var coherencyAcknowledgementFlatSchema2 = z24.object({
|
|
11907
|
+
response: z24.string().max(200).describe("Acknowledgement response per offender: 'linked' | 'accepted-fix' | 'diverged'."),
|
|
11908
|
+
entryId: z24.string().max(200).optional().describe("Entry the acknowledgement links to."),
|
|
11909
|
+
reason: z24.string().max(2e3).optional().describe("Free-text justification, required for a 'diverged' response."),
|
|
11910
|
+
subjectEntryId: z24.string().max(200).optional().describe("The refused entry this acknowledgement answers.")
|
|
12085
11911
|
});
|
|
12086
|
-
var sessionSchema =
|
|
12087
|
-
action:
|
|
11912
|
+
var sessionSchema = z24.object({
|
|
11913
|
+
action: z24.enum(SESSION_ACTIONS).describe(
|
|
12088
11914
|
"'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)."
|
|
12089
11915
|
),
|
|
12090
|
-
betEntryId:
|
|
12091
|
-
operationId:
|
|
12092
|
-
coherencyAcknowledgements:
|
|
11916
|
+
betEntryId: z24.string().max(200).optional().describe("For 'resume'/'commit-constellation': bet entry ID. Required for both."),
|
|
11917
|
+
operationId: z24.string().max(200).optional().describe("For 'commit-constellation': optional idempotency key for retries."),
|
|
11918
|
+
coherencyAcknowledgements: z24.array(coherencyAcknowledgementFlatSchema2).max(20).optional().describe(
|
|
12093
11919
|
"For 'commit-constellation': per-offender acknowledgements to retry a constellation held under standard/strict coherency mode."
|
|
12094
11920
|
),
|
|
12095
|
-
steeringOverrideReason:
|
|
11921
|
+
steeringOverrideReason: z24.string().max(2e3).optional().describe(
|
|
12096
11922
|
"For 'commit-constellation': typed override reason (>= 12 chars) to push past a coherency hold instead of acknowledging."
|
|
12097
11923
|
),
|
|
12098
11924
|
// DEC-1715 (WP-753 O1a)
|
|
12099
|
-
role:
|
|
11925
|
+
role: z24.string().max(200).optional().describe(
|
|
12100
11926
|
"For 'start': role to act as this session \u2014 only needed if you hold more than one; the error lists your roles if omitted."
|
|
12101
11927
|
)
|
|
12102
11928
|
});
|
|
12103
|
-
var sessionStartVariant =
|
|
12104
|
-
action:
|
|
11929
|
+
var sessionStartVariant = z24.object({
|
|
11930
|
+
action: z24.literal("start"),
|
|
12105
11931
|
// DEC-1715 (WP-753 O1a): the role to act as this session — only needed when the person holds
|
|
12106
11932
|
// more than one role; the server refuses and lists the choices when it's required and omitted.
|
|
12107
|
-
role:
|
|
11933
|
+
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.")
|
|
12108
11934
|
});
|
|
12109
|
-
var sessionCloseVariant =
|
|
12110
|
-
var sessionStatusVariant =
|
|
12111
|
-
var sessionWrapupReviewVariant =
|
|
12112
|
-
var sessionWrapupCommitVariant =
|
|
12113
|
-
var sessionResumeVariant = facilitateSchema.omit({ action: true }).extend({ action:
|
|
12114
|
-
var sessionCommitConstellationVariant = facilitateSchema.omit({ action: true }).extend({ action:
|
|
12115
|
-
var sessionActionUnion =
|
|
11935
|
+
var sessionCloseVariant = z24.object({ action: z24.literal("close") });
|
|
11936
|
+
var sessionStatusVariant = z24.object({ action: z24.literal("status") });
|
|
11937
|
+
var sessionWrapupReviewVariant = z24.object({ action: z24.literal("wrapup-review") });
|
|
11938
|
+
var sessionWrapupCommitVariant = z24.object({ action: z24.literal("wrapup-commit") });
|
|
11939
|
+
var sessionResumeVariant = facilitateSchema.omit({ action: true }).extend({ action: z24.literal("resume") });
|
|
11940
|
+
var sessionCommitConstellationVariant = facilitateSchema.omit({ action: true }).extend({ action: z24.literal("commit-constellation") });
|
|
11941
|
+
var sessionActionUnion = z24.discriminatedUnion("action", [
|
|
12116
11942
|
sessionStartVariant,
|
|
12117
11943
|
sessionCloseVariant,
|
|
12118
11944
|
sessionStatusVariant,
|
|
@@ -12356,10 +12182,10 @@ async function handleStatus() {
|
|
|
12356
12182
|
}
|
|
12357
12183
|
|
|
12358
12184
|
// src/tools/workspace.ts
|
|
12359
|
-
import { z as
|
|
12185
|
+
import { z as z27 } from "zod/v3";
|
|
12360
12186
|
|
|
12361
12187
|
// src/tools/health.ts
|
|
12362
|
-
import { z as
|
|
12188
|
+
import { z as z25 } from "zod/v3";
|
|
12363
12189
|
|
|
12364
12190
|
// src/lib/auditView.ts
|
|
12365
12191
|
async function buildTenantAuditView(limit) {
|
|
@@ -12703,60 +12529,60 @@ ${logLines.join("\n")}${seamSummaryText}` }],
|
|
|
12703
12529
|
};
|
|
12704
12530
|
}
|
|
12705
12531
|
var HEALTH_ACTIONS = ["check", "whoami", "status", "audit", "self-test"];
|
|
12706
|
-
var healthSchema =
|
|
12707
|
-
action:
|
|
12532
|
+
var healthSchema = z25.object({
|
|
12533
|
+
action: z25.enum(HEALTH_ACTIONS).describe(
|
|
12708
12534
|
"'check': connectivity and workspace stats. 'whoami': session identity. 'status': workspace readiness. 'audit': session audit log. 'self-test': validate all tool schemas."
|
|
12709
12535
|
),
|
|
12710
|
-
limit:
|
|
12536
|
+
limit: z25.number().min(1).max(50).default(20).optional().describe("For audit: how many recent calls to show (max 50)")
|
|
12711
12537
|
});
|
|
12712
|
-
var healthCheckOutputSchema =
|
|
12713
|
-
healthy:
|
|
12714
|
-
collections:
|
|
12715
|
-
entries:
|
|
12716
|
-
latencyMs:
|
|
12717
|
-
workspace:
|
|
12538
|
+
var healthCheckOutputSchema = z25.object({
|
|
12539
|
+
healthy: z25.boolean(),
|
|
12540
|
+
collections: z25.number(),
|
|
12541
|
+
entries: z25.number(),
|
|
12542
|
+
latencyMs: z25.number(),
|
|
12543
|
+
workspace: z25.string()
|
|
12718
12544
|
});
|
|
12719
|
-
var organisationHealthSchema =
|
|
12720
|
-
reviewed:
|
|
12721
|
-
agreements:
|
|
12722
|
-
disagreements:
|
|
12723
|
-
abstentions:
|
|
12724
|
-
agreementRate:
|
|
12725
|
-
flags:
|
|
12545
|
+
var organisationHealthSchema = z25.object({
|
|
12546
|
+
reviewed: z25.number(),
|
|
12547
|
+
agreements: z25.number(),
|
|
12548
|
+
disagreements: z25.number(),
|
|
12549
|
+
abstentions: z25.number(),
|
|
12550
|
+
agreementRate: z25.number(),
|
|
12551
|
+
flags: z25.array(z25.object({ collection: z25.string(), count: z25.number(), suggestedCollection: z25.string() }))
|
|
12726
12552
|
});
|
|
12727
|
-
var healthStatusOutputSchema =
|
|
12728
|
-
sampleTruncated:
|
|
12729
|
-
activeEntries:
|
|
12730
|
-
totalRelations:
|
|
12731
|
-
orphanedEntries:
|
|
12732
|
-
checks:
|
|
12733
|
-
gaps:
|
|
12553
|
+
var healthStatusOutputSchema = z25.object({
|
|
12554
|
+
sampleTruncated: z25.boolean().nullable().optional(),
|
|
12555
|
+
activeEntries: z25.number(),
|
|
12556
|
+
totalRelations: z25.number(),
|
|
12557
|
+
orphanedEntries: z25.number(),
|
|
12558
|
+
checks: z25.array(z25.object({ label: z25.string(), passed: z25.boolean(), current: z25.number(), required: z25.number() })),
|
|
12559
|
+
gaps: z25.array(z25.object({ id: z25.string(), label: z25.string(), guidance: z25.string() })),
|
|
12734
12560
|
organisationHealth: organisationHealthSchema.optional()
|
|
12735
12561
|
});
|
|
12736
|
-
var healthAuditOutputSchema =
|
|
12737
|
-
totalCalls:
|
|
12738
|
-
calls:
|
|
12739
|
-
tool:
|
|
12740
|
-
action:
|
|
12741
|
-
timestamp:
|
|
12742
|
-
durationMs:
|
|
12562
|
+
var healthAuditOutputSchema = z25.object({
|
|
12563
|
+
totalCalls: z25.number(),
|
|
12564
|
+
calls: z25.array(z25.object({
|
|
12565
|
+
tool: z25.string(),
|
|
12566
|
+
action: z25.string().optional(),
|
|
12567
|
+
timestamp: z25.string(),
|
|
12568
|
+
durationMs: z25.number().optional()
|
|
12743
12569
|
}))
|
|
12744
12570
|
});
|
|
12745
|
-
var healthWhoamiOutputSchema =
|
|
12746
|
-
workspaceId:
|
|
12747
|
-
workspaceName:
|
|
12748
|
-
scope:
|
|
12749
|
-
sessionId:
|
|
12750
|
-
oriented:
|
|
12571
|
+
var healthWhoamiOutputSchema = z25.object({
|
|
12572
|
+
workspaceId: z25.string(),
|
|
12573
|
+
workspaceName: z25.string(),
|
|
12574
|
+
scope: z25.string(),
|
|
12575
|
+
sessionId: z25.union([z25.string(), z25.null()]),
|
|
12576
|
+
oriented: z25.boolean()
|
|
12751
12577
|
});
|
|
12752
|
-
var selfTestOutputSchema =
|
|
12753
|
-
passed:
|
|
12754
|
-
failed:
|
|
12755
|
-
total:
|
|
12756
|
-
results:
|
|
12757
|
-
tool:
|
|
12758
|
-
valid:
|
|
12759
|
-
error:
|
|
12578
|
+
var selfTestOutputSchema = z25.object({
|
|
12579
|
+
passed: z25.number(),
|
|
12580
|
+
failed: z25.number(),
|
|
12581
|
+
total: z25.number(),
|
|
12582
|
+
results: z25.array(z25.object({
|
|
12583
|
+
tool: z25.string(),
|
|
12584
|
+
valid: z25.boolean(),
|
|
12585
|
+
error: z25.string().optional()
|
|
12760
12586
|
}))
|
|
12761
12587
|
});
|
|
12762
12588
|
function handleSelfTest(server) {
|
|
@@ -12807,9 +12633,9 @@ function handleSelfTest(server) {
|
|
|
12807
12633
|
}
|
|
12808
12634
|
|
|
12809
12635
|
// src/tools/usage.ts
|
|
12810
|
-
import { z as
|
|
12811
|
-
var usageSummarySchema =
|
|
12812
|
-
periodDays:
|
|
12636
|
+
import { z as z26 } from "zod/v3";
|
|
12637
|
+
var usageSummarySchema = z26.object({
|
|
12638
|
+
periodDays: z26.number().min(1).max(90).optional().describe("Number of days to look back (default 30, max 90)")
|
|
12813
12639
|
});
|
|
12814
12640
|
async function handleUsageSummary(periodDays) {
|
|
12815
12641
|
const ws = await getWorkspaceContext();
|
|
@@ -12879,20 +12705,20 @@ var WORKSPACE_ACTIONS = [
|
|
|
12879
12705
|
"self-test",
|
|
12880
12706
|
"usage"
|
|
12881
12707
|
];
|
|
12882
|
-
var workspaceSchema =
|
|
12883
|
-
action:
|
|
12708
|
+
var workspaceSchema = z27.object({
|
|
12709
|
+
action: z27.enum(WORKSPACE_ACTIONS).describe(
|
|
12884
12710
|
"'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)."
|
|
12885
12711
|
),
|
|
12886
|
-
limit:
|
|
12887
|
-
periodDays:
|
|
12712
|
+
limit: z27.number().min(1).max(50).optional().describe("For 'audit': how many recent calls to show (max 50, default 20)."),
|
|
12713
|
+
periodDays: z27.number().min(1).max(90).optional().describe("For 'usage': number of days to look back (default 30, max 90).")
|
|
12888
12714
|
});
|
|
12889
|
-
var workspaceCheckVariant =
|
|
12890
|
-
var workspaceWhoamiVariant =
|
|
12891
|
-
var workspaceStatusVariant =
|
|
12892
|
-
var workspaceAuditVariant =
|
|
12893
|
-
var workspaceSelfTestVariant =
|
|
12894
|
-
var workspaceUsageVariant =
|
|
12895
|
-
var workspaceActionUnion =
|
|
12715
|
+
var workspaceCheckVariant = z27.object({ action: z27.literal("check") });
|
|
12716
|
+
var workspaceWhoamiVariant = z27.object({ action: z27.literal("whoami") });
|
|
12717
|
+
var workspaceStatusVariant = z27.object({ action: z27.literal("status") });
|
|
12718
|
+
var workspaceAuditVariant = z27.object({ action: z27.literal("audit"), limit: z27.number().min(1).max(50).optional().default(20) });
|
|
12719
|
+
var workspaceSelfTestVariant = z27.object({ action: z27.literal("self-test") });
|
|
12720
|
+
var workspaceUsageVariant = z27.object({ action: z27.literal("usage"), periodDays: z27.number().min(1).max(90).optional() });
|
|
12721
|
+
var workspaceActionUnion = z27.discriminatedUnion("action", [
|
|
12896
12722
|
workspaceCheckVariant,
|
|
12897
12723
|
workspaceWhoamiVariant,
|
|
12898
12724
|
workspaceStatusVariant,
|
|
@@ -12938,7 +12764,7 @@ function registerWorkspaceTools(server) {
|
|
|
12938
12764
|
}
|
|
12939
12765
|
|
|
12940
12766
|
// src/tools/feedback.ts
|
|
12941
|
-
import { z as
|
|
12767
|
+
import { z as z28 } from "zod/v3";
|
|
12942
12768
|
|
|
12943
12769
|
// src/lib/productFeedbackConstants.ts
|
|
12944
12770
|
var PRODUCT_FEEDBACK_CATEGORIES = ["bug", "friction", "idea", "praise", "other"];
|
|
@@ -12949,9 +12775,9 @@ var VENDOR_SETTABLE_STATUSES = PRODUCT_FEEDBACK_STATUSES.filter(
|
|
|
12949
12775
|
|
|
12950
12776
|
// src/tools/feedback.ts
|
|
12951
12777
|
var actions = ["submit", "list", "queue", "note", "group", "status"];
|
|
12952
|
-
var category =
|
|
12953
|
-
var status =
|
|
12954
|
-
var vendorStatus =
|
|
12778
|
+
var category = z28.enum(PRODUCT_FEEDBACK_CATEGORIES);
|
|
12779
|
+
var status = z28.enum(PRODUCT_FEEDBACK_STATUSES);
|
|
12780
|
+
var vendorStatus = z28.enum(VENDOR_SETTABLE_STATUSES);
|
|
12955
12781
|
var GATEWAY_MAX_STRING_BYTES = 10240;
|
|
12956
12782
|
var utf8Bytes = (value) => new TextEncoder().encode(value).length;
|
|
12957
12783
|
var fitsGatewayBytes = (value) => utf8Bytes(value) <= GATEWAY_MAX_STRING_BYTES;
|
|
@@ -12960,32 +12786,32 @@ var byteLimitMessage = (field) => ({
|
|
|
12960
12786
|
});
|
|
12961
12787
|
var MESSAGE_DISPLAY_LIMIT = 1e3;
|
|
12962
12788
|
var FULL_MESSAGE_MAX_LIMIT = 5;
|
|
12963
|
-
var feedbackSchema =
|
|
12964
|
-
action:
|
|
12965
|
-
message:
|
|
12789
|
+
var feedbackSchema = z28.object({
|
|
12790
|
+
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."),
|
|
12791
|
+
message: z28.string().max(1e4).optional().describe("Required for submit: the product feedback text (max 10,000 chars and 10,240 UTF-8 bytes)."),
|
|
12966
12792
|
category: category.optional().describe("Submit/queue category; submit defaults to other."),
|
|
12967
|
-
command:
|
|
12968
|
-
route:
|
|
12969
|
-
client:
|
|
12970
|
-
feedbackId:
|
|
12971
|
-
feedbackIds:
|
|
12972
|
-
note:
|
|
12793
|
+
command: z28.string().max(1e3).optional().describe("Optional submit command context; argument values are scrubbed server-side."),
|
|
12794
|
+
route: z28.string().max(500).optional().describe("Optional submit route context."),
|
|
12795
|
+
client: z28.string().max(100).optional().describe("Optional submit client label."),
|
|
12796
|
+
feedbackId: z28.string().max(200).optional().describe("Required for note/status: target feedback ID."),
|
|
12797
|
+
feedbackIds: z28.array(z28.string().max(200)).max(100).optional().describe("Required for group: 1\u2013100 target feedback IDs."),
|
|
12798
|
+
note: z28.string().max(4e3).optional().describe("Required for note: replacement triage note (max 10,240 UTF-8 bytes)."),
|
|
12973
12799
|
status: status.optional().describe("list/queue filter (any status, including 'screening'); the status action's required target value excludes 'screening' (system-only)."),
|
|
12974
|
-
groupId:
|
|
12975
|
-
workspaceId:
|
|
12976
|
-
since:
|
|
12977
|
-
before:
|
|
12978
|
-
limit:
|
|
12979
|
-
cursor:
|
|
12980
|
-
full:
|
|
12800
|
+
groupId: z28.string().min(1).max(200).nullable().optional().describe("Group filter, or required group destination; null explicitly clears grouping."),
|
|
12801
|
+
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."),
|
|
12802
|
+
since: z28.number().optional().describe("Queue-only lower createdAt window bound (inclusive) in epoch milliseconds."),
|
|
12803
|
+
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."),
|
|
12804
|
+
limit: z28.number().int().min(1).max(100).optional().describe("list/queue row limit, default 50, maximum 100."),
|
|
12805
|
+
cursor: z28.string().max(2e3).optional().describe("Opaque pagination cursor from a previous list/queue response (continueCursor); omit for the first page."),
|
|
12806
|
+
full: z28.boolean().optional().describe(`list/queue only: return untruncated messages; allowed only when limit <= ${FULL_MESSAGE_MAX_LIMIT}.`)
|
|
12981
12807
|
});
|
|
12982
|
-
var union =
|
|
12983
|
-
|
|
12984
|
-
|
|
12985
|
-
|
|
12986
|
-
|
|
12987
|
-
|
|
12988
|
-
|
|
12808
|
+
var union = z28.discriminatedUnion("action", [
|
|
12809
|
+
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() }),
|
|
12810
|
+
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() }),
|
|
12811
|
+
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() }),
|
|
12812
|
+
z28.object({ action: z28.literal("note"), feedbackId: z28.string().min(1).max(200), note: z28.string().max(4e3).refine(fitsGatewayBytes, byteLimitMessage("note")) }),
|
|
12813
|
+
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() }),
|
|
12814
|
+
z28.object({ action: z28.literal("status"), feedbackId: z28.string().min(1).max(200), status: vendorStatus })
|
|
12989
12815
|
]);
|
|
12990
12816
|
var specs = {
|
|
12991
12817
|
submit: { params: ["message", "category", "command", "route", "client"], description: "message is required; category defaults to other." },
|
|
@@ -13112,34 +12938,34 @@ function registerFeedbackTool(server) {
|
|
|
13112
12938
|
}
|
|
13113
12939
|
|
|
13114
12940
|
// src/tools/shape.ts
|
|
13115
|
-
import { z as
|
|
12941
|
+
import { z as z29 } from "zod/v3";
|
|
13116
12942
|
var SHAPE_ACTIONS = ["list", "show", "agree", "dismiss"];
|
|
13117
12943
|
var LIST_DISPOSITIONS = ["pending", "agreed", "dismissed", "expired"];
|
|
13118
12944
|
var LIST_OUTCOMES = ["not_candidate", "atomic", "compound", "unavailable"];
|
|
13119
|
-
var shapeSchema =
|
|
13120
|
-
action:
|
|
12945
|
+
var shapeSchema = z29.object({
|
|
12946
|
+
action: z29.enum(SHAPE_ACTIONS).describe(
|
|
13121
12947
|
"'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."
|
|
13122
12948
|
),
|
|
13123
|
-
disposition:
|
|
12949
|
+
disposition: z29.enum(LIST_DISPOSITIONS).optional().describe(
|
|
13124
12950
|
"For 'list': filter by disposition. Omitting both disposition and outcome defaults to the actionable set (disposition:pending, outcome:compound)."
|
|
13125
12951
|
),
|
|
13126
|
-
outcome:
|
|
12952
|
+
outcome: z29.enum(LIST_OUTCOMES).optional().describe(
|
|
13127
12953
|
"For 'list': filter by outcome. Omitting both disposition and outcome defaults to the actionable set (disposition:pending, outcome:compound)."
|
|
13128
12954
|
),
|
|
13129
|
-
limit:
|
|
13130
|
-
rowId:
|
|
13131
|
-
reason:
|
|
12955
|
+
limit: z29.number().min(1).max(200).optional().describe("For 'list': max rows (default 50, max 200)."),
|
|
12956
|
+
rowId: z29.string().max(200).optional().describe("For 'show'/'agree'/'dismiss': the advisory row id."),
|
|
12957
|
+
reason: z29.string().max(1e3).optional().describe("For 'agree'/'dismiss': optional reason (capped at 1000 chars).")
|
|
13132
12958
|
});
|
|
13133
|
-
var shapeListVariant =
|
|
13134
|
-
action:
|
|
13135
|
-
disposition:
|
|
13136
|
-
outcome:
|
|
13137
|
-
limit:
|
|
12959
|
+
var shapeListVariant = z29.object({
|
|
12960
|
+
action: z29.literal("list"),
|
|
12961
|
+
disposition: z29.enum(LIST_DISPOSITIONS).optional(),
|
|
12962
|
+
outcome: z29.enum(LIST_OUTCOMES).optional(),
|
|
12963
|
+
limit: z29.number().min(1).max(200).optional()
|
|
13138
12964
|
});
|
|
13139
|
-
var shapeShowVariant =
|
|
13140
|
-
var shapeAgreeVariant =
|
|
13141
|
-
var shapeDismissVariant =
|
|
13142
|
-
var shapeActionUnion =
|
|
12965
|
+
var shapeShowVariant = z29.object({ action: z29.literal("show"), rowId: z29.string().max(200) });
|
|
12966
|
+
var shapeAgreeVariant = z29.object({ action: z29.literal("agree"), rowId: z29.string().max(200), reason: z29.string().max(1e3).optional() });
|
|
12967
|
+
var shapeDismissVariant = z29.object({ action: z29.literal("dismiss"), rowId: z29.string().max(200), reason: z29.string().max(1e3).optional() });
|
|
12968
|
+
var shapeActionUnion = z29.discriminatedUnion("action", [
|
|
13143
12969
|
shapeListVariant,
|
|
13144
12970
|
shapeShowVariant,
|
|
13145
12971
|
shapeAgreeVariant,
|
|
@@ -13285,26 +13111,26 @@ function registerShapeTools(server) {
|
|
|
13285
13111
|
}
|
|
13286
13112
|
|
|
13287
13113
|
// src/tools/question.ts
|
|
13288
|
-
import { z as
|
|
13114
|
+
import { z as z30 } from "zod/v3";
|
|
13289
13115
|
var QUESTION_ACTIONS = ["create", "assign", "answer", "force-close", "list"];
|
|
13290
|
-
var questionSchema =
|
|
13291
|
-
action:
|
|
13116
|
+
var questionSchema = z30.object({
|
|
13117
|
+
action: z30.enum(QUESTION_ACTIONS).describe(
|
|
13292
13118
|
"'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)."
|
|
13293
13119
|
),
|
|
13294
|
-
entryId:
|
|
13295
|
-
text:
|
|
13296
|
-
blocks:
|
|
13297
|
-
toRole:
|
|
13298
|
-
reason:
|
|
13299
|
-
answerEntryId:
|
|
13300
|
-
mine:
|
|
13120
|
+
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'."),
|
|
13121
|
+
text: z30.string().max(5e3).optional().describe("'create': the question text. 'answer': the answer text (mutually exclusive with answerEntryId, max 2000 chars)."),
|
|
13122
|
+
blocks: z30.array(z30.string().max(200)).max(50).optional().describe("'create': entry ids this question is blocking (repeatable)."),
|
|
13123
|
+
toRole: z30.string().max(200).optional().describe("'assign': reassign to this role (human ROL-nnn form or a raw entry id) \u2014 required."),
|
|
13124
|
+
reason: z30.string().max(2e3).optional().describe("'force-close': required reason."),
|
|
13125
|
+
answerEntryId: z30.string().max(200).optional().describe("'answer': point at an already-written entry instead of supplying text (mutually exclusive with text)."),
|
|
13126
|
+
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).")
|
|
13301
13127
|
});
|
|
13302
|
-
var createVariant =
|
|
13303
|
-
var assignVariant =
|
|
13304
|
-
var answerVariant =
|
|
13305
|
-
var forceCloseVariant =
|
|
13306
|
-
var listVariant =
|
|
13307
|
-
var questionActionUnion =
|
|
13128
|
+
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() });
|
|
13129
|
+
var assignVariant = z30.object({ action: z30.literal("assign"), entryId: z30.string().max(200), toRole: z30.string().max(200).min(1) });
|
|
13130
|
+
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() });
|
|
13131
|
+
var forceCloseVariant = z30.object({ action: z30.literal("force-close"), entryId: z30.string().max(200), reason: z30.string().min(1).max(2e3) });
|
|
13132
|
+
var listVariant = z30.object({ action: z30.literal("list"), mine: z30.boolean().optional() });
|
|
13133
|
+
var questionActionUnion = z30.discriminatedUnion("action", [
|
|
13308
13134
|
createVariant,
|
|
13309
13135
|
assignVariant,
|
|
13310
13136
|
answerVariant,
|
|
@@ -13459,23 +13285,23 @@ function registerQuestionTools(server) {
|
|
|
13459
13285
|
}
|
|
13460
13286
|
|
|
13461
13287
|
// src/tools/role.ts
|
|
13462
|
-
import { z as
|
|
13288
|
+
import { z as z31 } from "zod/v3";
|
|
13463
13289
|
var ROLE_ACTIONS = ["accountable"];
|
|
13464
|
-
var roleSchema =
|
|
13465
|
-
action:
|
|
13466
|
-
roleId:
|
|
13467
|
-
canonicalKey:
|
|
13468
|
-
limit:
|
|
13469
|
-
cursor:
|
|
13290
|
+
var roleSchema = z31.object({
|
|
13291
|
+
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."),
|
|
13292
|
+
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'."),
|
|
13293
|
+
canonicalKey: z31.string().max(200).optional().describe("'accountable': narrow to one kind (e.g. objective, key_result, tension)."),
|
|
13294
|
+
limit: z31.number().int().positive().max(200).optional().describe("'accountable': max explicit-list rows per page (default and maximum 200)."),
|
|
13295
|
+
cursor: z31.number().optional().describe("'accountable': continue the explicit list from an earlier truncated page's nextCursor.")
|
|
13470
13296
|
});
|
|
13471
|
-
var accountableVariant =
|
|
13472
|
-
action:
|
|
13473
|
-
roleId:
|
|
13474
|
-
canonicalKey:
|
|
13475
|
-
limit:
|
|
13476
|
-
cursor:
|
|
13297
|
+
var accountableVariant = z31.object({
|
|
13298
|
+
action: z31.literal("accountable"),
|
|
13299
|
+
roleId: z31.string().max(200),
|
|
13300
|
+
canonicalKey: z31.string().max(200).optional(),
|
|
13301
|
+
limit: z31.number().int().positive().max(200).optional(),
|
|
13302
|
+
cursor: z31.number().optional()
|
|
13477
13303
|
});
|
|
13478
|
-
var roleActionUnion =
|
|
13304
|
+
var roleActionUnion = z31.discriminatedUnion("action", [accountableVariant]);
|
|
13479
13305
|
var ROLE_ACTION_SPECS = {
|
|
13480
13306
|
accountable: { params: ["roleId", "canonicalKey", "limit", "cursor"], description: "roleId is required; canonicalKey/limit/cursor are optional." }
|
|
13481
13307
|
};
|
|
@@ -13549,49 +13375,49 @@ function registerRoleTools(server) {
|
|
|
13549
13375
|
}
|
|
13550
13376
|
|
|
13551
13377
|
// src/tools/outcome.ts
|
|
13552
|
-
import { z as
|
|
13378
|
+
import { z as z32 } from "zod/v3";
|
|
13553
13379
|
var OUTCOME_ACTIONS = ["record", "list", "show"];
|
|
13554
13380
|
var READING_KINDS = ["measurement", "estimate", "correction"];
|
|
13555
|
-
var outcomeSchema =
|
|
13556
|
-
action:
|
|
13381
|
+
var outcomeSchema = z32.object({
|
|
13382
|
+
action: z32.enum(OUTCOME_ACTIONS).describe(
|
|
13557
13383
|
"'record': record a reading (evidence, not a verdict). 'list': list readings, newest first. 'show': the derived view \u2014 current, progress, pace, staleness, recorded completion."
|
|
13558
13384
|
),
|
|
13559
|
-
entryId:
|
|
13385
|
+
entryId: z32.string().max(200).optional().describe("The key result (or other outcome-bearing) entry, by its chain id. Required for all three actions."),
|
|
13560
13386
|
// PR #858 review round 3 (Codex P2, PRRT_kwDORS4ils6gXHj9): a JSON number that overflows to
|
|
13561
13387
|
// `Infinity` (e.g. `1e400`) parses fine in JS and passes a plain `z.number()`, but
|
|
13562
13388
|
// `callGateway()` serializes it with `JSON.stringify`, which turns `Infinity` into `null` —
|
|
13563
13389
|
// the backend's `v.number()` validator then rejects a call this tool's own schema accepted.
|
|
13564
13390
|
// `.finite()` rejects it here, matching the explicit finite-value checks the CLI/other outcome
|
|
13565
13391
|
// entry surfaces already use.
|
|
13566
|
-
value:
|
|
13567
|
-
valueText:
|
|
13568
|
-
asOf:
|
|
13569
|
-
kind:
|
|
13570
|
-
correctsReadingId:
|
|
13571
|
-
recordedByRoleId:
|
|
13572
|
-
note:
|
|
13573
|
-
source:
|
|
13574
|
-
limit:
|
|
13392
|
+
value: z32.number().finite().optional().describe("'record': the measured value. Required for 'record'."),
|
|
13393
|
+
valueText: z32.string().max(500).optional().describe("'record': verbatim as-reported form when the source was not clean, e.g. '~62%'. Display only."),
|
|
13394
|
+
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."),
|
|
13395
|
+
kind: z32.enum(READING_KINDS).optional().describe("'record': measurement | estimate | correction (default: measurement)."),
|
|
13396
|
+
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."),
|
|
13397
|
+
recordedByRoleId: z32.string().max(200).optional().describe("'record': the accountable role (default: the entry's reporterRoleId, then its owning role)."),
|
|
13398
|
+
note: z32.string().max(2e3).optional().describe("'record': free-text note recorded with the reading."),
|
|
13399
|
+
source: z32.string().max(500).optional().describe("'record': where the number came from \u2014 a dashboard name, a query, a URL."),
|
|
13400
|
+
limit: z32.number().int().positive().max(200).optional().describe("'list': max rows to return (default and maximum 200).")
|
|
13575
13401
|
});
|
|
13576
|
-
var recordVariant =
|
|
13577
|
-
action:
|
|
13578
|
-
entryId:
|
|
13579
|
-
value:
|
|
13580
|
-
valueText:
|
|
13581
|
-
asOf:
|
|
13582
|
-
kind:
|
|
13583
|
-
correctsReadingId:
|
|
13584
|
-
recordedByRoleId:
|
|
13585
|
-
note:
|
|
13586
|
-
source:
|
|
13402
|
+
var recordVariant = z32.object({
|
|
13403
|
+
action: z32.literal("record"),
|
|
13404
|
+
entryId: z32.string().max(200),
|
|
13405
|
+
value: z32.number().finite(),
|
|
13406
|
+
valueText: z32.string().max(500).optional(),
|
|
13407
|
+
asOf: z32.string().max(64).optional(),
|
|
13408
|
+
kind: z32.enum(READING_KINDS).optional(),
|
|
13409
|
+
correctsReadingId: z32.string().max(200).optional(),
|
|
13410
|
+
recordedByRoleId: z32.string().max(200).optional(),
|
|
13411
|
+
note: z32.string().max(2e3).optional(),
|
|
13412
|
+
source: z32.string().max(500).optional()
|
|
13587
13413
|
});
|
|
13588
|
-
var listVariant2 =
|
|
13589
|
-
action:
|
|
13590
|
-
entryId:
|
|
13591
|
-
limit:
|
|
13414
|
+
var listVariant2 = z32.object({
|
|
13415
|
+
action: z32.literal("list"),
|
|
13416
|
+
entryId: z32.string().max(200),
|
|
13417
|
+
limit: z32.number().int().positive().max(200).optional()
|
|
13592
13418
|
});
|
|
13593
|
-
var showVariant =
|
|
13594
|
-
var outcomeActionUnion =
|
|
13419
|
+
var showVariant = z32.object({ action: z32.literal("show"), entryId: z32.string().max(200) });
|
|
13420
|
+
var outcomeActionUnion = z32.discriminatedUnion("action", [recordVariant, listVariant2, showVariant]);
|
|
13595
13421
|
var OUTCOME_ACTION_SPECS = {
|
|
13596
13422
|
record: {
|
|
13597
13423
|
params: ["entryId", "value", "valueText", "asOf", "kind", "correctsReadingId", "recordedByRoleId", "note", "source"],
|
|
@@ -13884,7 +13710,7 @@ var AGENT_CHEATSHEET = `# Product Brain \u2014 Agent Cheatsheet
|
|
|
13884
13710
|
| \`relations\` | Link entries, dismiss suggestions and delete links, find and suggest | \`action\`: create, batch-create, dismiss, delete, find, suggest |
|
|
13885
13711
|
| \`context\` | Gather related knowledge, last-verified brief | \`action\`: gather, build, neighborhood, changes, chain, cross-cut, incremental, brief, last-verified-brief |
|
|
13886
13712
|
| \`collections\` | Browse, describe, audit and export collections; manage labels | \`action\`: list, update, describe, audit, export, label-* |
|
|
13887
|
-
| \`quality\` | Score an entry, verify the Chain,
|
|
13713
|
+
| \`quality\` | Score an entry, verify the Chain, spine check | \`action\`: check, re-evaluate, verify-chain, spine-check |
|
|
13888
13714
|
| \`session\` | Start / close, wrapup, resume, constellation accept | \`action\`: start, close, status, wrapup-review, wrapup-commit, resume, commit-constellation |
|
|
13889
13715
|
| \`workflows\` | Run workflows, checkpoint | \`action\`: list, start, checkpoint, get-run |
|
|
13890
13716
|
| \`workspace\` | Check / whoami / status / self-test, usage | \`action\`: check, whoami, status, audit, self-test, usage |
|
|
@@ -14413,7 +14239,7 @@ ${entry.labels.map((l) => `- ${l.name ?? l.slug}`).join("\n")}`);
|
|
|
14413
14239
|
}
|
|
14414
14240
|
|
|
14415
14241
|
// src/prompts/index.ts
|
|
14416
|
-
import { z as
|
|
14242
|
+
import { z as z33 } from "zod/v3";
|
|
14417
14243
|
async function buildReviewAgainstRulesPrompt(domain) {
|
|
14418
14244
|
const entries = await kernelQuery("chain.listEntries", { collectionSlug: "rules" });
|
|
14419
14245
|
const rules = entries.slice(0, 50);
|
|
@@ -14495,27 +14321,27 @@ function registerPrompts(server) {
|
|
|
14495
14321
|
server.prompt(
|
|
14496
14322
|
"review-against-rules",
|
|
14497
14323
|
"Review code or a design decision against the rules, focused on a given area. Fetches the rules and asks you to do a structured compliance review.",
|
|
14498
|
-
{ domain:
|
|
14324
|
+
{ domain: z33.string().describe("Business rule domain (e.g. 'Identity & Access', 'Governance & Decision-Making')") },
|
|
14499
14325
|
async ({ domain }) => buildReviewAgainstRulesPrompt(domain)
|
|
14500
14326
|
);
|
|
14501
14327
|
server.prompt(
|
|
14502
14328
|
"name-check",
|
|
14503
14329
|
"Check variable names, field names, or API names against the glossary for terminology alignment. Flags drift from canonical terms.",
|
|
14504
|
-
{ names:
|
|
14330
|
+
{ names: z33.string().describe("Comma-separated list of names to check (e.g. 'vendor_id, compliance_level, formulator_type')") },
|
|
14505
14331
|
async ({ names }) => buildNameCheckPrompt(names)
|
|
14506
14332
|
);
|
|
14507
14333
|
server.prompt(
|
|
14508
14334
|
"draft-decision-record",
|
|
14509
14335
|
"Draft a structured decision record from a description of what was decided. Includes context from recent decisions and relevant rules.",
|
|
14510
|
-
{ context:
|
|
14336
|
+
{ context: z33.string().describe("Description of the decision (e.g. 'We decided to use MRSL v3.1 as the conformance baseline because...')") },
|
|
14511
14337
|
async ({ context }) => buildDraftDecisionRecordPrompt(context)
|
|
14512
14338
|
);
|
|
14513
14339
|
server.prompt(
|
|
14514
14340
|
"draft-rule-from-context",
|
|
14515
14341
|
"Draft a new business rule from an observation or discovery made while coding. Fetches existing rules for the domain to ensure consistency.",
|
|
14516
14342
|
{
|
|
14517
|
-
observation:
|
|
14518
|
-
domain:
|
|
14343
|
+
observation: z33.string().describe("What you observed or discovered (e.g. 'Suppliers can have multiple org types in Gateway')"),
|
|
14344
|
+
domain: z33.string().describe("Which domain this rule belongs to (e.g. 'Governance & Decision-Making')")
|
|
14519
14345
|
},
|
|
14520
14346
|
async ({ observation, domain }) => buildDraftRuleFromContextPrompt(observation, domain)
|
|
14521
14347
|
);
|
|
@@ -14702,4 +14528,4 @@ export {
|
|
|
14702
14528
|
createProductBrainServer,
|
|
14703
14529
|
initFeatureFlags
|
|
14704
14530
|
};
|
|
14705
|
-
//# sourceMappingURL=chunk-
|
|
14531
|
+
//# sourceMappingURL=chunk-DN3E44ZV.js.map
|