@productbrain/mcp 0.0.1-beta.7497 → 0.0.1-beta.7503
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-2VLHXRGB.js → chunk-NHVFNXUV.js} +754 -733
- package/dist/chunk-NHVFNXUV.js.map +1 -0
- package/dist/{chunk-FH2FDUVL.js → chunk-TIOTBIFL.js} +2 -1
- package/dist/chunk-TIOTBIFL.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-6TF45VXR.js → setup-CD5A5WZX.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-2VLHXRGB.js.map +0 -1
- package/dist/chunk-FH2FDUVL.js.map +0 -1
- /package/dist/{setup-6TF45VXR.js.map → setup-CD5A5WZX.js.map} +0 -0
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
trackSessionCaptureRate,
|
|
42
42
|
trackWriteBackHintServed,
|
|
43
43
|
trackZeroCaptureAuditFired
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-TIOTBIFL.js";
|
|
45
45
|
|
|
46
46
|
// src/server.ts
|
|
47
47
|
import { McpServer as McpServer2 } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -91,7 +91,7 @@ function resolveEffectiveCollection(result2, preview, fallbackCollection) {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
// src/tools/entries.ts
|
|
94
|
-
import { z as
|
|
94
|
+
import { z as z11 } from "zod/v3";
|
|
95
95
|
|
|
96
96
|
// src/envelope.ts
|
|
97
97
|
import { z } from "zod/v3";
|
|
@@ -3636,15 +3636,31 @@ async function handleVerifyEntry({ entryId }) {
|
|
|
3636
3636
|
return successResult(message, message, result2);
|
|
3637
3637
|
}
|
|
3638
3638
|
|
|
3639
|
-
// src/tools/
|
|
3639
|
+
// src/tools/stillTrue.ts
|
|
3640
3640
|
import { z as z8 } from "zod/v3";
|
|
3641
|
-
var
|
|
3642
|
-
entryId: z8.string().describe("
|
|
3643
|
-
|
|
3641
|
+
var stillTrueEntrySchema = z8.object({
|
|
3642
|
+
entryId: z8.string().max(200).describe("Human entry ID (e.g. '<PREFIX>-<n>') to confirm is still true.")
|
|
3643
|
+
});
|
|
3644
|
+
async function handleStillTrueEntry({ entryId }) {
|
|
3645
|
+
requireWriteAccess();
|
|
3646
|
+
const agentSessionId = getAgentSessionId();
|
|
3647
|
+
const result2 = await kernelMutation(
|
|
3648
|
+
"chain.confirmEntry",
|
|
3649
|
+
{ entryId, ...agentSessionId ? { sessionId: agentSessionId } : {} }
|
|
3650
|
+
);
|
|
3651
|
+
const message = `Entry ${entryId} confirmed still true.`;
|
|
3652
|
+
return successResult(message, message, result2);
|
|
3653
|
+
}
|
|
3654
|
+
|
|
3655
|
+
// src/tools/entry-move.ts
|
|
3656
|
+
import { z as z9 } from "zod/v3";
|
|
3657
|
+
var moveEntrySchema = z9.object({
|
|
3658
|
+
entryId: z9.string().describe("Entry ID to move, e.g. '<PREFIX>-<n>'"),
|
|
3659
|
+
toCollection: z9.string().describe("Target collection slug, e.g. 'decisions', 'architecture'"),
|
|
3644
3660
|
// WP-707 S2 (TASK-146): optional atomic move+RETYPE — validates and persists the entry's NEW
|
|
3645
3661
|
// canonicalKey and its destination collection in the SAME write (convex/agentKnowledge/
|
|
3646
3662
|
// moveToCollectionOperation.ts round 3, DEC-1622). Omit for a plain same-kind relocation.
|
|
3647
|
-
canonicalKey:
|
|
3663
|
+
canonicalKey: z9.string().optional().describe(
|
|
3648
3664
|
"Optional: also reclassify the entry to this canonical key atomically with the move (e.g. 'decision', 'objective'). Omit for a plain relocation."
|
|
3649
3665
|
)
|
|
3650
3666
|
});
|
|
@@ -3707,7 +3723,7 @@ ${recovery}`,
|
|
|
3707
3723
|
}
|
|
3708
3724
|
|
|
3709
3725
|
// src/tools/entriesContract.ts
|
|
3710
|
-
import { z as
|
|
3726
|
+
import { z as z10 } from "zod/v3";
|
|
3711
3727
|
var ENTRIES_ACTIONS = [
|
|
3712
3728
|
"list",
|
|
3713
3729
|
"get",
|
|
@@ -3718,99 +3734,101 @@ var ENTRIES_ACTIONS = [
|
|
|
3718
3734
|
"history",
|
|
3719
3735
|
"move",
|
|
3720
3736
|
"verify",
|
|
3721
|
-
"preflight"
|
|
3737
|
+
"preflight",
|
|
3738
|
+
"still-true"
|
|
3722
3739
|
];
|
|
3723
|
-
var entriesStatusFilterSchema =
|
|
3724
|
-
var coherencyAcknowledgementFlatSchema =
|
|
3725
|
-
response:
|
|
3726
|
-
entryId:
|
|
3727
|
-
reason:
|
|
3740
|
+
var entriesStatusFilterSchema = z10.union([z10.string().max(200), z10.array(z10.enum(["draft", "active", "accepted", "deprecated", "archived"])).max(5)]);
|
|
3741
|
+
var coherencyAcknowledgementFlatSchema = z10.object({
|
|
3742
|
+
response: z10.enum(["linked", "accepted-fix", "diverged"]).describe("Explicit response to an acknowledge-required coherency challenge."),
|
|
3743
|
+
entryId: z10.string().max(200).optional().describe("Authorizing entry being linked/accepted (required for 'linked' and 'accepted-fix')."),
|
|
3744
|
+
reason: z10.string().max(2e3).optional().describe("Divergence rationale (required for 'diverged', \u226512 chars).")
|
|
3728
3745
|
});
|
|
3729
|
-
var preflightLinks =
|
|
3730
|
-
var entriesSchema =
|
|
3746
|
+
var preflightLinks = z10.array(z10.object({ type: z10.string().max(200), entryId: z10.string().max(200) })).max(50).optional();
|
|
3747
|
+
var entriesSchema = z10.object({
|
|
3731
3748
|
links: preflightLinks.describe("For preflight: proposed context links; saves nothing."),
|
|
3732
|
-
action:
|
|
3733
|
-
"'preflight': inspect structural requirements before composing (requires collection). 'list': browse entries with filters. 'get': fetch one entry by ID. 'batch': fetch multiple entries. 'search': full-text search. 'update': change fields on an existing entry (draft by default). 'commit': accept a draft entry onto the Chain. 'history': audit trail for an entry. 'move': relocate an entry to a different collection (pass `canonicalKey` too for an atomic move+retype). 'verify': mark an entry as verified (lightweight \u2014 no codebase scan; see `quality action=verify-chain` for that)."
|
|
3749
|
+
action: z10.enum(ENTRIES_ACTIONS).describe(
|
|
3750
|
+
"'preflight': inspect structural requirements before composing (requires collection). 'list': browse entries with filters. 'get': fetch one entry by ID. 'batch': fetch multiple entries. 'search': full-text search. 'update': change fields on an existing entry (draft by default). 'commit': accept a draft entry onto the Chain. 'history': audit trail for an entry. 'move': relocate an entry to a different collection (pass `canonicalKey` too for an atomic move+retype). 'verify': mark an entry as verified (lightweight \u2014 no codebase scan; see `quality action=verify-chain` for that). 'still-true': confirm accuracy (owner/Team Lead only) \u2014 distinct from 'verify'; no content, version, or updatedAt change."
|
|
3734
3751
|
),
|
|
3735
|
-
entryId:
|
|
3736
|
-
"Entry ID, e.g. '<PREFIX>-<n>'. Required for: get, update, commit, history, move, verify."
|
|
3752
|
+
entryId: z10.string().max(200).optional().describe(
|
|
3753
|
+
"Entry ID, e.g. '<PREFIX>-<n>'. Required for: get, update, commit, history, move, verify, still-true."
|
|
3737
3754
|
),
|
|
3738
|
-
entryIds:
|
|
3739
|
-
collection:
|
|
3755
|
+
entryIds: z10.array(z10.string().max(200)).min(1).max(20).optional().describe("Entry IDs for 'batch', e.g. ['TYPE-strategy', 'STR-jljeg7']"),
|
|
3756
|
+
collection: z10.string().max(200).optional().describe("Collection slug \u2014 for 'list'/'search': scope filter, e.g. 'glossary', 'tracking-events'. For 'preflight': the collection the entry would be composed into (required)."),
|
|
3740
3757
|
status: entriesStatusFilterSchema.optional().describe(
|
|
3741
3758
|
"For 'list': defaults to accepted entries (active/accepted); use status='draft' to discover drafts. One lifecycle value (draft|active|accepted|deprecated|archived). For 'search': one value OR an array of up to 5 (e.g. ['active','accepted']). For 'update': draft|active|deprecated|archived ONLY \u2014 'accepted' is set via 'commit', never 'update'. Workflow values use `workflowStatus` instead."
|
|
3742
3759
|
),
|
|
3743
|
-
tag:
|
|
3744
|
-
label:
|
|
3745
|
-
query:
|
|
3746
|
-
name:
|
|
3747
|
-
workflowStatus:
|
|
3760
|
+
tag: z10.string().max(200).optional().describe("For 'list': filter by internal tag."),
|
|
3761
|
+
label: z10.string().max(200).optional().describe("For 'list': filter by label slug \u2014 matches entries across all collections."),
|
|
3762
|
+
query: z10.string().min(2).max(500).optional().describe("For 'search': search text (min 2 characters)."),
|
|
3763
|
+
name: z10.string().max(500).optional().describe("For 'update': new display name."),
|
|
3764
|
+
workflowStatus: z10.string().max(200).optional().describe(
|
|
3748
3765
|
"For 'update': collection workflow state. Valid values are collection-specific and server-owned \u2014 discover via `collections action=describe`. Invalid values are rejected with the valid set."
|
|
3749
3766
|
),
|
|
3750
|
-
data:
|
|
3751
|
-
order:
|
|
3752
|
-
canonicalKey:
|
|
3767
|
+
data: z10.record(z10.unknown()).optional().describe("For 'update': fields to update (merged with existing data)."),
|
|
3768
|
+
order: z10.number().optional().describe("For 'update': new sort order."),
|
|
3769
|
+
canonicalKey: z10.string().max(200).optional().describe(
|
|
3753
3770
|
"For 'update': semantic type (e.g. 'decision', 'tension'); only changeable on draft/uncommitted entries. For 'move': optional atomic move+retype target. For 'preflight': optional semantic type to check requirements for."
|
|
3754
3771
|
),
|
|
3755
3772
|
// DEC-1716: draft vs. published is decided by the entry's own accepted/active status, never this flag.
|
|
3756
|
-
autoPublish:
|
|
3773
|
+
autoPublish: z10.boolean().optional().default(false).describe(
|
|
3757
3774
|
"For 'update': accepted for backward compatibility but IGNORED \u2014 draft vs. published is decided by the entry's own accepted/active status, never by this flag."
|
|
3758
3775
|
),
|
|
3759
|
-
changeNote:
|
|
3776
|
+
changeNote: z10.string().max(2e3).optional().describe(
|
|
3760
3777
|
"For 'update': short human-readable rationale for WHY this change was made. Surfaces in activity feed."
|
|
3761
3778
|
),
|
|
3762
|
-
sourceRef:
|
|
3779
|
+
sourceRef: z10.string().max(2e3).optional().describe(
|
|
3763
3780
|
"For 'update': URI or path of the source document backing this entry. Write-once."
|
|
3764
3781
|
),
|
|
3765
|
-
sourceExcerpt:
|
|
3782
|
+
sourceExcerpt: z10.string().max(5e3).optional().describe(
|
|
3766
3783
|
"For 'update': verbatim excerpt from the source backing this entry's claims. Write-once."
|
|
3767
3784
|
),
|
|
3768
|
-
steeringOverrideReason:
|
|
3785
|
+
steeringOverrideReason: z10.string().max(2e3).optional().describe(
|
|
3769
3786
|
"For 'update'/'commit': typed override (\u226512 chars) that clears a steering coherency block."
|
|
3770
3787
|
),
|
|
3771
3788
|
coherencyAcknowledgement: coherencyAcknowledgementFlatSchema.optional().describe(
|
|
3772
3789
|
"For 'update'/'commit': explicit response to a coherency challenge (standard/strict workspace modes)."
|
|
3773
3790
|
),
|
|
3774
|
-
preview:
|
|
3791
|
+
preview: z10.boolean().optional().describe(
|
|
3775
3792
|
"For 'commit': if true, validates the accept without writing \u2014 returns what would happen."
|
|
3776
3793
|
),
|
|
3777
|
-
toCollection:
|
|
3794
|
+
toCollection: z10.string().max(200).optional().describe("For 'move': target collection slug, e.g. 'decisions', 'architecture'.")
|
|
3778
3795
|
});
|
|
3779
|
-
var entriesListVariant =
|
|
3780
|
-
action:
|
|
3781
|
-
collection:
|
|
3782
|
-
status:
|
|
3783
|
-
tag:
|
|
3784
|
-
label:
|
|
3796
|
+
var entriesListVariant = z10.object({
|
|
3797
|
+
action: z10.literal("list"),
|
|
3798
|
+
collection: z10.string().max(200).optional(),
|
|
3799
|
+
status: z10.string().max(200).optional(),
|
|
3800
|
+
tag: z10.string().max(200).optional(),
|
|
3801
|
+
label: z10.string().max(200).optional()
|
|
3785
3802
|
});
|
|
3786
|
-
var entriesGetVariant =
|
|
3787
|
-
action:
|
|
3788
|
-
entryId:
|
|
3803
|
+
var entriesGetVariant = z10.object({
|
|
3804
|
+
action: z10.literal("get"),
|
|
3805
|
+
entryId: z10.string().max(200)
|
|
3789
3806
|
});
|
|
3790
|
-
var entriesBatchVariant =
|
|
3791
|
-
action:
|
|
3792
|
-
entryIds:
|
|
3807
|
+
var entriesBatchVariant = z10.object({
|
|
3808
|
+
action: z10.literal("batch"),
|
|
3809
|
+
entryIds: z10.array(z10.string().max(200)).min(1).max(20)
|
|
3793
3810
|
});
|
|
3794
|
-
var entriesSearchVariant =
|
|
3795
|
-
action:
|
|
3796
|
-
query:
|
|
3797
|
-
collection:
|
|
3811
|
+
var entriesSearchVariant = z10.object({
|
|
3812
|
+
action: z10.literal("search"),
|
|
3813
|
+
query: z10.string().min(2).max(500),
|
|
3814
|
+
collection: z10.string().max(200).optional(),
|
|
3798
3815
|
status: entriesStatusFilterSchema.optional()
|
|
3799
3816
|
// PR #660 R1 Zqh1K: string|array.
|
|
3800
3817
|
});
|
|
3801
|
-
var entriesUpdateVariant = updateEntrySchema.extend({ action:
|
|
3802
|
-
var entriesCommitVariant = commitEntrySchema.extend({ action:
|
|
3803
|
-
var entriesHistoryVariant = getHistorySchema.extend({ action:
|
|
3804
|
-
var entriesMoveVariant =
|
|
3805
|
-
action:
|
|
3806
|
-
entryId:
|
|
3807
|
-
toCollection:
|
|
3808
|
-
canonicalKey:
|
|
3818
|
+
var entriesUpdateVariant = updateEntrySchema.extend({ action: z10.literal("update") });
|
|
3819
|
+
var entriesCommitVariant = commitEntrySchema.extend({ action: z10.literal("commit") });
|
|
3820
|
+
var entriesHistoryVariant = getHistorySchema.extend({ action: z10.literal("history") });
|
|
3821
|
+
var entriesMoveVariant = z10.object({
|
|
3822
|
+
action: z10.literal("move"),
|
|
3823
|
+
entryId: z10.string().max(200),
|
|
3824
|
+
toCollection: z10.string().max(200),
|
|
3825
|
+
canonicalKey: z10.string().max(200).optional()
|
|
3809
3826
|
// WP-707 S2: optional atomic move+RETYPE.
|
|
3810
3827
|
});
|
|
3811
|
-
var entriesVerifyVariant = verifyEntrySchema.extend({ action:
|
|
3812
|
-
var
|
|
3813
|
-
|
|
3828
|
+
var entriesVerifyVariant = verifyEntrySchema.extend({ action: z10.literal("verify") });
|
|
3829
|
+
var entriesStillTrueVariant = stillTrueEntrySchema.extend({ action: z10.literal("still-true") });
|
|
3830
|
+
var entriesActionUnion = z10.discriminatedUnion("action", [
|
|
3831
|
+
z10.object({ action: z10.literal("preflight"), collection: z10.string().max(200), canonicalKey: z10.string().max(200).optional(), links: preflightLinks }),
|
|
3814
3832
|
entriesListVariant,
|
|
3815
3833
|
entriesGetVariant,
|
|
3816
3834
|
entriesBatchVariant,
|
|
@@ -3819,7 +3837,8 @@ var entriesActionUnion = z9.discriminatedUnion("action", [
|
|
|
3819
3837
|
entriesCommitVariant,
|
|
3820
3838
|
entriesHistoryVariant,
|
|
3821
3839
|
entriesMoveVariant,
|
|
3822
|
-
entriesVerifyVariant
|
|
3840
|
+
entriesVerifyVariant,
|
|
3841
|
+
entriesStillTrueVariant
|
|
3823
3842
|
]);
|
|
3824
3843
|
var ENTRIES_ACTION_SPECS = {
|
|
3825
3844
|
preflight: { params: ["collection", "canonicalKey", "links"], description: "Inspect structure before composition; no writes or permission grant." },
|
|
@@ -3831,7 +3850,8 @@ var ENTRIES_ACTION_SPECS = {
|
|
|
3831
3850
|
commit: { params: ["entryId", "preview", "steeringOverrideReason", "coherencyAcknowledgement"], description: "entryId is required." },
|
|
3832
3851
|
history: { params: ["entryId"], description: "entryId is required." },
|
|
3833
3852
|
move: { params: ["entryId", "toCollection", "canonicalKey"], description: "entryId and toCollection are required; canonicalKey is optional (atomic move+retype)." },
|
|
3834
|
-
verify: { params: ["entryId"], description: "entryId is required." }
|
|
3853
|
+
verify: { params: ["entryId"], description: "entryId is required." },
|
|
3854
|
+
"still-true": { params: ["entryId"], description: "entryId is required. Owner or Team Lead only." }
|
|
3835
3855
|
};
|
|
3836
3856
|
|
|
3837
3857
|
// src/tools/entries.ts
|
|
@@ -3888,16 +3908,16 @@ function renderVerificationLine(e) {
|
|
|
3888
3908
|
}
|
|
3889
3909
|
return `**Verification:** ${String(e.verificationStatus)}${who}`;
|
|
3890
3910
|
}
|
|
3891
|
-
var wqSchema =
|
|
3892
|
-
var entriesGetOutputSchema =
|
|
3893
|
-
entryId:
|
|
3894
|
-
name:
|
|
3895
|
-
collection:
|
|
3896
|
-
status:
|
|
3897
|
-
capturedAt:
|
|
3898
|
-
origin:
|
|
3899
|
-
originDetail:
|
|
3900
|
-
verificationStatus:
|
|
3911
|
+
var wqSchema = z11.enum(["rationale", "missing", "restated"]);
|
|
3912
|
+
var entriesGetOutputSchema = z11.object({
|
|
3913
|
+
entryId: z11.string(),
|
|
3914
|
+
name: z11.string(),
|
|
3915
|
+
collection: z11.string(),
|
|
3916
|
+
status: z11.string(),
|
|
3917
|
+
capturedAt: z11.number().optional(),
|
|
3918
|
+
origin: z11.string().optional(),
|
|
3919
|
+
originDetail: z11.string().optional(),
|
|
3920
|
+
verificationStatus: z11.string().optional(),
|
|
3901
3921
|
// Attestation-model finding (PR #341 review): the server's honest verifier label and
|
|
3902
3922
|
// derived attestation strength/basis — connectors NEVER re-derive strength (spec §5),
|
|
3903
3923
|
// they only render what chain.getEntry ships. Mirrors packages/cli EntryFromApi.
|
|
@@ -3906,73 +3926,73 @@ var entriesGetOutputSchema = z10.object({
|
|
|
3906
3926
|
// attestation.ts's AttestationStrength SSOT (allowlisted in Check D —
|
|
3907
3927
|
// scripts/check-collection-ssot.mjs's CHECK_D_ALLOWLIST — with the full
|
|
3908
3928
|
// reasoning for why this can't just import that module). Update both together.
|
|
3909
|
-
verifiedBy:
|
|
3910
|
-
attestation:
|
|
3911
|
-
strength:
|
|
3912
|
-
basis:
|
|
3929
|
+
verifiedBy: z11.string().optional(),
|
|
3930
|
+
attestation: z11.object({
|
|
3931
|
+
strength: z11.enum(["human-direct", "delegated", "system", "unattested"]),
|
|
3932
|
+
basis: z11.string().optional()
|
|
3913
3933
|
}).optional(),
|
|
3914
|
-
sourceRef:
|
|
3915
|
-
sourceExcerpt:
|
|
3916
|
-
why:
|
|
3934
|
+
sourceRef: z11.string().optional(),
|
|
3935
|
+
sourceExcerpt: z11.string().optional(),
|
|
3936
|
+
why: z11.string().optional(),
|
|
3917
3937
|
whyQuality: wqSchema.optional(),
|
|
3918
|
-
data:
|
|
3919
|
-
relations:
|
|
3920
|
-
entryId:
|
|
3921
|
-
name:
|
|
3922
|
-
type:
|
|
3923
|
-
direction:
|
|
3924
|
-
status:
|
|
3938
|
+
data: z11.record(z11.unknown()).optional(),
|
|
3939
|
+
relations: z11.array(z11.object({
|
|
3940
|
+
entryId: z11.string().optional(),
|
|
3941
|
+
name: z11.string(),
|
|
3942
|
+
type: z11.string(),
|
|
3943
|
+
direction: z11.string(),
|
|
3944
|
+
status: z11.string().optional()
|
|
3925
3945
|
})).optional(),
|
|
3926
|
-
labels:
|
|
3946
|
+
labels: z11.array(z11.string()).optional(),
|
|
3927
3947
|
owner: ownerOutputShape.optional()
|
|
3928
3948
|
}).passthrough();
|
|
3929
|
-
var entriesListOutputSchema =
|
|
3930
|
-
entries:
|
|
3931
|
-
entryId:
|
|
3932
|
-
name:
|
|
3933
|
-
collection:
|
|
3934
|
-
status:
|
|
3949
|
+
var entriesListOutputSchema = z11.object({
|
|
3950
|
+
entries: z11.array(z11.object({
|
|
3951
|
+
entryId: z11.string(),
|
|
3952
|
+
name: z11.string(),
|
|
3953
|
+
collection: z11.string(),
|
|
3954
|
+
status: z11.string()
|
|
3935
3955
|
})),
|
|
3936
|
-
total:
|
|
3956
|
+
total: z11.number()
|
|
3937
3957
|
});
|
|
3938
|
-
var entriesSearchOutputSchema =
|
|
3939
|
-
results:
|
|
3940
|
-
entryId:
|
|
3941
|
-
name:
|
|
3942
|
-
collection:
|
|
3943
|
-
status:
|
|
3944
|
-
score:
|
|
3958
|
+
var entriesSearchOutputSchema = z11.object({
|
|
3959
|
+
results: z11.array(z11.object({
|
|
3960
|
+
entryId: z11.string(),
|
|
3961
|
+
name: z11.string(),
|
|
3962
|
+
collection: z11.string(),
|
|
3963
|
+
status: z11.string(),
|
|
3964
|
+
score: z11.number().optional()
|
|
3945
3965
|
})),
|
|
3946
|
-
total:
|
|
3947
|
-
query:
|
|
3966
|
+
total: z11.number(),
|
|
3967
|
+
query: z11.string()
|
|
3948
3968
|
});
|
|
3949
|
-
var entriesBatchOutputSchema =
|
|
3950
|
-
entries:
|
|
3951
|
-
entryId:
|
|
3952
|
-
name:
|
|
3953
|
-
collection:
|
|
3954
|
-
status:
|
|
3955
|
-
capturedAt:
|
|
3956
|
-
origin:
|
|
3957
|
-
originDetail:
|
|
3958
|
-
verificationStatus:
|
|
3969
|
+
var entriesBatchOutputSchema = z11.object({
|
|
3970
|
+
entries: z11.array(z11.object({
|
|
3971
|
+
entryId: z11.string(),
|
|
3972
|
+
name: z11.string(),
|
|
3973
|
+
collection: z11.string(),
|
|
3974
|
+
status: z11.string(),
|
|
3975
|
+
capturedAt: z11.number().optional(),
|
|
3976
|
+
origin: z11.string().optional(),
|
|
3977
|
+
originDetail: z11.string().optional(),
|
|
3978
|
+
verificationStatus: z11.string().optional(),
|
|
3959
3979
|
// Attestation-model finding (PR #341 review): mirror entriesGetOutputSchema — batch
|
|
3960
3980
|
// entries now carry the same honest verifiedBy/attestation fields. Literal set is
|
|
3961
3981
|
// the same hand-kept SSOT mirror — see entriesGetOutputSchema's attestation
|
|
3962
3982
|
// comment above for the full Check D / kernel-import reasoning.
|
|
3963
|
-
verifiedBy:
|
|
3964
|
-
attestation:
|
|
3965
|
-
strength:
|
|
3966
|
-
basis:
|
|
3983
|
+
verifiedBy: z11.string().optional(),
|
|
3984
|
+
attestation: z11.object({
|
|
3985
|
+
strength: z11.enum(["human-direct", "delegated", "system", "unattested"]),
|
|
3986
|
+
basis: z11.string().optional()
|
|
3967
3987
|
}).optional(),
|
|
3968
|
-
sourceRef:
|
|
3969
|
-
sourceExcerpt:
|
|
3970
|
-
why:
|
|
3988
|
+
sourceRef: z11.string().optional(),
|
|
3989
|
+
sourceExcerpt: z11.string().optional(),
|
|
3990
|
+
why: z11.string().optional(),
|
|
3971
3991
|
// TEN-2191: mirrors entriesGetOutputSchema
|
|
3972
3992
|
whyQuality: wqSchema.optional(),
|
|
3973
|
-
data:
|
|
3993
|
+
data: z11.record(z11.unknown()).optional()
|
|
3974
3994
|
}).passthrough()),
|
|
3975
|
-
total:
|
|
3995
|
+
total: z11.number()
|
|
3976
3996
|
});
|
|
3977
3997
|
function registerEntriesTools(server) {
|
|
3978
3998
|
const entriesHandlers = {
|
|
@@ -3990,13 +4010,14 @@ function registerEntriesTools(server) {
|
|
|
3990
4010
|
commit: (data) => handleCommitEntry(data, "entries"),
|
|
3991
4011
|
history: (data) => handleGetHistory(data),
|
|
3992
4012
|
move: (data) => handleMoveEntry(data.entryId, data.toCollection, data.canonicalKey),
|
|
3993
|
-
verify: (data) => handleVerifyEntry(data)
|
|
4013
|
+
verify: (data) => handleVerifyEntry(data),
|
|
4014
|
+
"still-true": (data) => handleStillTrueEntry(data)
|
|
3994
4015
|
};
|
|
3995
4016
|
server.registerTool(
|
|
3996
4017
|
"entries",
|
|
3997
4018
|
{
|
|
3998
4019
|
title: "Entries",
|
|
3999
|
-
description: 'Read and manage entries on the Chain. One tool for the entry lifecycle.\n\n- **preflight**: Inspect a type and selected context before composing. No writes, capacity reservation or authority grant.\n- **list**: Browse entries with optional filters (collection, status, tag, label). Use collections action=list first to discover slugs.\n- **get**: Fetch a single entry by ID \u2014 full record with data, labels, relations, history.\n- **batch**: Fetch multiple entries (max 20) in one call. Same shape as get per entry.\n- **search**: Full-text search across entries. Scope by collection or filter by status.\n- **update**: Change fields on an existing entry (publishes whenever the entry is not draft \u2014 includes archived, not just accepted/active; autoPublish is accepted but ignored).\n- **commit**: Accept a draft entry onto the Chain (SSOT). Runs the contradiction preflight first.\n- **history**: Audit trail for an entry.\n- **move**: Relocate an entry to a different collection; pass canonicalKey too for an atomic move+retype.\n- **verify**: Mark
|
|
4020
|
+
description: 'Read and manage entries on the Chain. One tool for the entry lifecycle.\n\n- **preflight**: Inspect a type and selected context before composing. No writes, capacity reservation or authority grant.\n- **list**: Browse entries with optional filters (collection, status, tag, label). Use collections action=list first to discover slugs.\n- **get**: Fetch a single entry by ID \u2014 full record with data, labels, relations, history.\n- **batch**: Fetch multiple entries (max 20) in one call. Same shape as get per entry.\n- **search**: Full-text search across entries. Scope by collection or filter by status.\n- **update**: Change fields on an existing entry (publishes whenever the entry is not draft \u2014 includes archived, not just accepted/active; autoPublish is accepted but ignored).\n- **commit**: Accept a draft entry onto the Chain (SSOT). Runs the contradiction preflight first.\n- **history**: Audit trail for an entry.\n- **move**: Relocate an entry to a different collection; pass canonicalKey too for an atomic move+retype.\n- **verify**: Mark verified (lightweight, no scan \u2014 see `quality action=verify-chain`).\n- **still-true**: owner/Team Lead confirms accuracy; no content change.\n\nUse `entries action=get entryId="..."` to fetch one. Use `entries action=search query="..."` to discover.',
|
|
4000
4021
|
inputSchema: entriesSchema,
|
|
4001
4022
|
// Mixed read/write noun (§3 R3): can't be marked read-only once update/commit/move
|
|
4002
4023
|
// live here too — accepted for the 11-tool default (§9 R3).
|
|
@@ -4354,41 +4375,41 @@ ${footer}` }],
|
|
|
4354
4375
|
}
|
|
4355
4376
|
|
|
4356
4377
|
// src/tools/relations.ts
|
|
4357
|
-
import { z as
|
|
4378
|
+
import { z as z13 } from "zod/v3";
|
|
4358
4379
|
|
|
4359
4380
|
// src/tools/graph.ts
|
|
4360
|
-
import { z as
|
|
4381
|
+
import { z as z12 } from "zod/v3";
|
|
4361
4382
|
var GRAPH_ACTIONS = ["find", "suggest"];
|
|
4362
|
-
var graphSchema =
|
|
4363
|
-
action:
|
|
4383
|
+
var graphSchema = z12.object({
|
|
4384
|
+
action: z12.enum(GRAPH_ACTIONS).describe(
|
|
4364
4385
|
"'find': traverse relations from an entry (graph walk). 'suggest': discover potential connections for an entry."
|
|
4365
4386
|
),
|
|
4366
|
-
entryId:
|
|
4367
|
-
direction:
|
|
4368
|
-
limit:
|
|
4369
|
-
depth:
|
|
4387
|
+
entryId: z12.string().max(200).describe("Entry ID, e.g. '<PREFIX>-<n>'"),
|
|
4388
|
+
direction: z12.enum(["incoming", "outgoing", "both"]).default("both").optional().describe("For find: 'incoming' = what references this, 'outgoing' = what this references"),
|
|
4389
|
+
limit: z12.number().min(1).max(20).default(10).optional().describe("For suggest: max suggestions to return"),
|
|
4390
|
+
depth: z12.number().min(1).max(3).default(2).optional().describe("For suggest: graph traversal depth")
|
|
4370
4391
|
});
|
|
4371
|
-
var graphFindOutputSchema =
|
|
4372
|
-
entryId:
|
|
4373
|
-
relations:
|
|
4374
|
-
entryId:
|
|
4375
|
-
name:
|
|
4376
|
-
type:
|
|
4377
|
-
direction:
|
|
4392
|
+
var graphFindOutputSchema = z12.object({
|
|
4393
|
+
entryId: z12.string(),
|
|
4394
|
+
relations: z12.array(z12.object({
|
|
4395
|
+
entryId: z12.string().optional(),
|
|
4396
|
+
name: z12.string(),
|
|
4397
|
+
type: z12.string(),
|
|
4398
|
+
direction: z12.enum(["outgoing", "incoming"])
|
|
4378
4399
|
})),
|
|
4379
|
-
total:
|
|
4400
|
+
total: z12.number()
|
|
4380
4401
|
});
|
|
4381
|
-
var graphSuggestOutputSchema =
|
|
4382
|
-
entryId:
|
|
4383
|
-
suggestions:
|
|
4384
|
-
targetEntryId:
|
|
4385
|
-
targetName:
|
|
4386
|
-
relationType:
|
|
4387
|
-
direction:
|
|
4388
|
-
confidence:
|
|
4389
|
-
reason:
|
|
4402
|
+
var graphSuggestOutputSchema = z12.object({
|
|
4403
|
+
entryId: z12.string(),
|
|
4404
|
+
suggestions: z12.array(z12.object({
|
|
4405
|
+
targetEntryId: z12.string().optional(),
|
|
4406
|
+
targetName: z12.string(),
|
|
4407
|
+
relationType: z12.string(),
|
|
4408
|
+
direction: z12.string(),
|
|
4409
|
+
confidence: z12.number(),
|
|
4410
|
+
reason: z12.string()
|
|
4390
4411
|
})),
|
|
4391
|
-
total:
|
|
4412
|
+
total: z12.number()
|
|
4392
4413
|
});
|
|
4393
4414
|
async function handleFind(entryId, direction) {
|
|
4394
4415
|
const relations = await kernelQuery("chain.listEntryRelations", { entryId });
|
|
@@ -4579,64 +4600,64 @@ async function handleSuggest(entryId, limit, depth) {
|
|
|
4579
4600
|
|
|
4580
4601
|
// src/tools/relations.ts
|
|
4581
4602
|
var RELATIONS_ACTIONS = ["create", "batch-create", "dismiss", "delete", "find", "suggest"];
|
|
4582
|
-
var relationItemSchema =
|
|
4583
|
-
from:
|
|
4584
|
-
to:
|
|
4585
|
-
type:
|
|
4603
|
+
var relationItemSchema = z13.object({
|
|
4604
|
+
from: z13.string().max(200),
|
|
4605
|
+
to: z13.string().max(200),
|
|
4606
|
+
type: z13.string().max(200)
|
|
4586
4607
|
});
|
|
4587
|
-
var relationsSchema =
|
|
4588
|
-
action:
|
|
4608
|
+
var relationsSchema = z13.object({
|
|
4609
|
+
action: z13.enum(RELATIONS_ACTIONS).describe(
|
|
4589
4610
|
"'create': link two entries. 'batch-create': create multiple relations (validates every item before writing any). 'dismiss': record that a suggestion was not relevant. 'delete': remove a relation. 'find': traverse relations from an entry (graph walk, absorbs graph action=find). 'suggest': discover potential connections for an entry (absorbs graph action=suggest)."
|
|
4590
4611
|
),
|
|
4591
|
-
from:
|
|
4592
|
-
to:
|
|
4593
|
-
type:
|
|
4594
|
-
score:
|
|
4595
|
-
relations:
|
|
4612
|
+
from: z13.string().max(200).optional().describe("For 'create'/'dismiss'/'delete': source entry ID."),
|
|
4613
|
+
to: z13.string().max(200).optional().describe("For 'create'/'dismiss'/'delete': target entry ID."),
|
|
4614
|
+
type: z13.string().max(200).optional().describe("For 'create'/'dismiss'/'delete': relation type."),
|
|
4615
|
+
score: z13.number().optional().describe("For 'dismiss': suggestion score from action=suggest."),
|
|
4616
|
+
relations: z13.array(relationItemSchema).min(1).max(20).optional().describe("For 'batch-create': array of {from, to, type}."),
|
|
4596
4617
|
// WP-316 S3: Preview gate — dry-run mode for action=create.
|
|
4597
|
-
preview:
|
|
4598
|
-
entryId:
|
|
4599
|
-
direction:
|
|
4600
|
-
limit:
|
|
4601
|
-
depth:
|
|
4618
|
+
preview: z13.boolean().optional().describe("For 'create': if true, validates the relation without writing. Returns what would happen. Default false."),
|
|
4619
|
+
entryId: z13.string().max(200).optional().describe("For 'find'/'suggest': entry ID, e.g. '<PREFIX>-<n>'."),
|
|
4620
|
+
direction: z13.enum(["incoming", "outgoing", "both"]).optional().describe("For 'find': 'incoming' = what references this, 'outgoing' = what this references. Default 'both'."),
|
|
4621
|
+
limit: z13.number().min(1).max(20).optional().describe("For 'suggest': max suggestions to return. Default 10."),
|
|
4622
|
+
depth: z13.number().min(1).max(3).optional().describe("For 'suggest': graph traversal depth. Default 2.")
|
|
4602
4623
|
});
|
|
4603
|
-
var relationsCreateVariant =
|
|
4604
|
-
action:
|
|
4605
|
-
from:
|
|
4606
|
-
to:
|
|
4607
|
-
type:
|
|
4608
|
-
score:
|
|
4609
|
-
preview:
|
|
4624
|
+
var relationsCreateVariant = z13.object({
|
|
4625
|
+
action: z13.literal("create"),
|
|
4626
|
+
from: z13.string().max(200),
|
|
4627
|
+
to: z13.string().max(200),
|
|
4628
|
+
type: z13.string().max(200),
|
|
4629
|
+
score: z13.number().optional(),
|
|
4630
|
+
preview: z13.boolean().optional()
|
|
4610
4631
|
});
|
|
4611
|
-
var relationsBatchCreateVariant =
|
|
4612
|
-
action:
|
|
4613
|
-
relations:
|
|
4632
|
+
var relationsBatchCreateVariant = z13.object({
|
|
4633
|
+
action: z13.literal("batch-create"),
|
|
4634
|
+
relations: z13.array(relationItemSchema).min(1).max(20)
|
|
4614
4635
|
});
|
|
4615
|
-
var relationsDismissVariant =
|
|
4616
|
-
action:
|
|
4617
|
-
from:
|
|
4618
|
-
to:
|
|
4619
|
-
type:
|
|
4620
|
-
score:
|
|
4636
|
+
var relationsDismissVariant = z13.object({
|
|
4637
|
+
action: z13.literal("dismiss"),
|
|
4638
|
+
from: z13.string().max(200),
|
|
4639
|
+
to: z13.string().max(200),
|
|
4640
|
+
type: z13.string().max(200).optional(),
|
|
4641
|
+
score: z13.number().optional()
|
|
4621
4642
|
});
|
|
4622
|
-
var relationsDeleteVariant =
|
|
4623
|
-
action:
|
|
4624
|
-
from:
|
|
4625
|
-
to:
|
|
4626
|
-
type:
|
|
4643
|
+
var relationsDeleteVariant = z13.object({
|
|
4644
|
+
action: z13.literal("delete"),
|
|
4645
|
+
from: z13.string().max(200),
|
|
4646
|
+
to: z13.string().max(200),
|
|
4647
|
+
type: z13.string().max(200)
|
|
4627
4648
|
});
|
|
4628
|
-
var relationsFindVariant =
|
|
4629
|
-
action:
|
|
4630
|
-
entryId:
|
|
4631
|
-
direction:
|
|
4649
|
+
var relationsFindVariant = z13.object({
|
|
4650
|
+
action: z13.literal("find"),
|
|
4651
|
+
entryId: z13.string().max(200),
|
|
4652
|
+
direction: z13.enum(["incoming", "outgoing", "both"]).optional().default("both")
|
|
4632
4653
|
});
|
|
4633
|
-
var relationsSuggestVariant =
|
|
4634
|
-
action:
|
|
4635
|
-
entryId:
|
|
4636
|
-
limit:
|
|
4637
|
-
depth:
|
|
4654
|
+
var relationsSuggestVariant = z13.object({
|
|
4655
|
+
action: z13.literal("suggest"),
|
|
4656
|
+
entryId: z13.string().max(200),
|
|
4657
|
+
limit: z13.number().min(1).max(20).optional().default(10),
|
|
4658
|
+
depth: z13.number().min(1).max(3).optional().default(2)
|
|
4638
4659
|
});
|
|
4639
|
-
var relationsActionUnion =
|
|
4660
|
+
var relationsActionUnion = z13.discriminatedUnion("action", [
|
|
4640
4661
|
relationsCreateVariant,
|
|
4641
4662
|
relationsBatchCreateVariant,
|
|
4642
4663
|
relationsDismissVariant,
|
|
@@ -4991,19 +5012,19 @@ async function handleDelete(from, to, type) {
|
|
|
4991
5012
|
}
|
|
4992
5013
|
|
|
4993
5014
|
// src/tools/context.ts
|
|
4994
|
-
import { z as
|
|
5015
|
+
import { z as z15 } from "zod/v3";
|
|
4995
5016
|
|
|
4996
5017
|
// src/tools/documents.ts
|
|
4997
|
-
import { z as
|
|
5018
|
+
import { z as z14 } from "zod/v3";
|
|
4998
5019
|
var DOCUMENTS_ACTIONS = ["get-last-verified-brief"];
|
|
4999
|
-
var documentsSchema =
|
|
5000
|
-
action:
|
|
5020
|
+
var documentsSchema = z14.object({
|
|
5021
|
+
action: z14.enum(DOCUMENTS_ACTIONS).describe(
|
|
5001
5022
|
"'get-last-verified-brief': fetch the most recent verified brief snapshot for a (templateId, scopeKey) pair. Returns the verified summary so agents can build delta narratives ('since you last verified, X workstreams advanced')."
|
|
5002
5023
|
),
|
|
5003
|
-
templateId:
|
|
5024
|
+
templateId: z14.string().max(200).describe(
|
|
5004
5025
|
"Brief template identifier \u2014 currently 'steering-brief' is the only registered template."
|
|
5005
5026
|
),
|
|
5006
|
-
scopeKey:
|
|
5027
|
+
scopeKey: z14.string().max(200).describe(
|
|
5007
5028
|
"Canonical scope key. Use 'workspace:<workspaceId>' for the full workspace brief, or 'initiative:<INI-ID>' for an initiative-scoped brief. The same formula is applied at write time (chainwork/docKernel/scopeKey.ts), so passing the wrong shape returns exists:false."
|
|
5008
5029
|
)
|
|
5009
5030
|
});
|
|
@@ -5083,89 +5104,89 @@ function epistemicCollectionHint(collectionName) {
|
|
|
5083
5104
|
return "";
|
|
5084
5105
|
}
|
|
5085
5106
|
var CONTEXT_ACTIONS = ["gather", "build", "neighborhood", "changes", "chain", "cross-cut", "incremental", "brief", "last-verified-brief"];
|
|
5086
|
-
var contextSchema =
|
|
5107
|
+
var contextSchema = z15.object({
|
|
5087
5108
|
// provenance: neighborhood BET-142; changes/chain/cross-cut/incremental/brief BET-239 (E4, E6)
|
|
5088
|
-
action:
|
|
5109
|
+
action: z15.enum(CONTEXT_ACTIONS).describe(
|
|
5089
5110
|
"'gather': assemble knowledge context (entry graph, task auto-load, journey mode, or graph mode). 'build': structured build spec for an entry. 'neighborhood': typed graph neighborhood for an entry \u2014 blocking chain, dependencies, parent context, tensions, staleness. 'changes': entries modified and relations created since a timestamp. Requires 'since' parameter. 'chain': directed traversal along one relation type to depth 4. Requires entryId. Optional: direction, relationType, maxHops (1-4). 'cross-cut': structural aggregation \u2014 all relations of a given type grouped by source collection. Requires 'relationType' parameter. 'incremental': delta since last brief run for a skill. Requires 'skill' parameter. Returns only entries changed since the skill's last brief. 'brief': compound intelligence query. Requires 'briefType' parameter: 'steering' (changes + structure + delta + readiness), 'confidence' (changes + active bets \u2014 use the pb CLI's `tensions list` for tensions), or 'delta' (changes + relations since timestamp). Optional 'since' for delta type. 'last-verified-brief': fetch the most recent verified brief snapshot for a (templateId, scopeKey) pair (absorbs documents action=get-last-verified-brief). Requires templateId and scopeKey."
|
|
5090
5111
|
),
|
|
5091
|
-
entryId:
|
|
5092
|
-
mapEntryId:
|
|
5112
|
+
entryId: z15.string().max(200).optional().describe("For 'build'/'neighborhood'/'chain': entry ID, e.g. '<PREFIX>-<n>'. For 'gather': optional entry ID for entry-graph mode."),
|
|
5113
|
+
mapEntryId: z15.string().max(200).optional().describe(
|
|
5093
5114
|
"For 'gather': journey map entry ID for journey-aware context. Returns context organised by journey stage. Takes precedence over entryId when both are supplied. Example: '<PREFIX>-<n>'."
|
|
5094
5115
|
),
|
|
5095
|
-
task:
|
|
5096
|
-
since:
|
|
5116
|
+
task: z15.string().max(2e3).optional().describe("For 'gather': natural-language task description for loading task-relevant governance, binding constraints, and supporting context."),
|
|
5117
|
+
since: z15.string().max(200).optional().describe(
|
|
5097
5118
|
"For 'changes': ISO 8601 timestamp \u2014 returns entries/relations modified since this time. For 'brief' briefType='delta': optional custom timestamp. Example: '2026-03-24T00:00:00Z'."
|
|
5098
5119
|
),
|
|
5099
|
-
direction:
|
|
5100
|
-
relationType:
|
|
5120
|
+
direction: z15.enum(["outgoing", "incoming"]).default("outgoing").optional().describe("For 'chain' action: traversal direction. 'outgoing' follows relations from source, 'incoming' follows relations to source. Default: outgoing."),
|
|
5121
|
+
relationType: z15.string().max(200).optional().describe(
|
|
5101
5122
|
"Relation type filter. For 'chain': optional filter to traverse only this relation type. For 'cross-cut': required \u2014 scans all relations of this type across the workspace. Examples: 'part_of', 'informs', 'governs', 'blocks', 'depends_on'."
|
|
5102
5123
|
),
|
|
5103
|
-
mode:
|
|
5104
|
-
maxHops:
|
|
5105
|
-
maxResults:
|
|
5106
|
-
strategy:
|
|
5107
|
-
skill:
|
|
5124
|
+
mode: z15.enum(["search", "graph"]).default("search").optional().describe("For gather: 'search' (default) or 'graph' (enhanced with provenance paths). Ignored when mapEntryId is provided."),
|
|
5125
|
+
maxHops: z15.number().min(1).max(4).default(2).describe("Relation traversal depth (1=direct only, 2=default, 3=wide net, 4=deep chain walk)"),
|
|
5126
|
+
maxResults: z15.number().min(1).max(25).default(10).optional().describe("Max entries to return in gather task mode (default 10)"),
|
|
5127
|
+
strategy: z15.enum(["hybrid", "keyword"]).default("keyword").optional().describe("Seed strategy for task-based gather: 'keyword' (FTS only, default) or 'hybrid' (vector + FTS). Only affects task mode."),
|
|
5128
|
+
skill: z15.string().max(200).optional().describe(
|
|
5108
5129
|
"Skill name for 'incremental' action \u2014 identifies which skill's brief history to compare against. Examples: 'preflight', 'shaping', 'review'. Required when action is 'incremental'."
|
|
5109
5130
|
),
|
|
5110
|
-
briefType:
|
|
5131
|
+
briefType: z15.enum(["steering", "confidence", "delta"]).optional().describe(
|
|
5111
5132
|
"Compound query type for 'brief' action. 'steering': 7d changes + structural aggregation (part_of, depends_on, constrains) + incremental delta + workspace readiness. 'confidence': 7d changes + active bets summary (tensions: use the pb CLI's `tensions list`, not this action). 'delta': changes + relations since a custom timestamp (use 'since' param). Required when action is 'brief'."
|
|
5112
5133
|
),
|
|
5113
|
-
templateId:
|
|
5134
|
+
templateId: z15.string().max(200).optional().describe(
|
|
5114
5135
|
"For 'last-verified-brief': brief template identifier \u2014 currently 'steering-brief' is the only registered template."
|
|
5115
5136
|
),
|
|
5116
|
-
scopeKey:
|
|
5137
|
+
scopeKey: z15.string().max(200).optional().describe(
|
|
5117
5138
|
"For 'last-verified-brief': canonical scope key \u2014 'workspace:<workspaceId>' or 'initiative:<INI-ID>'."
|
|
5118
5139
|
)
|
|
5119
5140
|
});
|
|
5120
|
-
var contextGatherVariant =
|
|
5121
|
-
action:
|
|
5122
|
-
entryId:
|
|
5123
|
-
mapEntryId:
|
|
5124
|
-
task:
|
|
5125
|
-
mode:
|
|
5126
|
-
maxHops:
|
|
5127
|
-
maxResults:
|
|
5128
|
-
strategy:
|
|
5141
|
+
var contextGatherVariant = z15.object({
|
|
5142
|
+
action: z15.literal("gather"),
|
|
5143
|
+
entryId: z15.string().max(200).optional(),
|
|
5144
|
+
mapEntryId: z15.string().max(200).optional(),
|
|
5145
|
+
task: z15.string().max(2e3).optional(),
|
|
5146
|
+
mode: z15.enum(["search", "graph"]).optional().default("search"),
|
|
5147
|
+
maxHops: z15.number().min(1).max(4).optional().default(2),
|
|
5148
|
+
maxResults: z15.number().min(1).max(25).optional().default(10),
|
|
5149
|
+
strategy: z15.enum(["hybrid", "keyword"]).optional().default("keyword")
|
|
5129
5150
|
});
|
|
5130
|
-
var contextBuildVariant =
|
|
5131
|
-
action:
|
|
5132
|
-
entryId:
|
|
5133
|
-
maxHops:
|
|
5151
|
+
var contextBuildVariant = z15.object({
|
|
5152
|
+
action: z15.literal("build"),
|
|
5153
|
+
entryId: z15.string().max(200),
|
|
5154
|
+
maxHops: z15.number().min(1).max(4).optional().default(2)
|
|
5134
5155
|
});
|
|
5135
|
-
var contextNeighborhoodVariant =
|
|
5136
|
-
action:
|
|
5137
|
-
entryId:
|
|
5156
|
+
var contextNeighborhoodVariant = z15.object({
|
|
5157
|
+
action: z15.literal("neighborhood"),
|
|
5158
|
+
entryId: z15.string().max(200)
|
|
5138
5159
|
});
|
|
5139
|
-
var contextChangesVariant =
|
|
5140
|
-
action:
|
|
5141
|
-
since:
|
|
5160
|
+
var contextChangesVariant = z15.object({
|
|
5161
|
+
action: z15.literal("changes"),
|
|
5162
|
+
since: z15.string().max(200)
|
|
5142
5163
|
});
|
|
5143
|
-
var contextChainVariant =
|
|
5144
|
-
action:
|
|
5145
|
-
entryId:
|
|
5146
|
-
direction:
|
|
5147
|
-
maxHops:
|
|
5148
|
-
relationType:
|
|
5164
|
+
var contextChainVariant = z15.object({
|
|
5165
|
+
action: z15.literal("chain"),
|
|
5166
|
+
entryId: z15.string().max(200),
|
|
5167
|
+
direction: z15.enum(["outgoing", "incoming"]).optional().default("outgoing"),
|
|
5168
|
+
maxHops: z15.number().min(1).max(4).optional().default(2),
|
|
5169
|
+
relationType: z15.string().max(200).optional()
|
|
5149
5170
|
});
|
|
5150
|
-
var contextCrossCutVariant =
|
|
5151
|
-
action:
|
|
5152
|
-
relationType:
|
|
5171
|
+
var contextCrossCutVariant = z15.object({
|
|
5172
|
+
action: z15.literal("cross-cut"),
|
|
5173
|
+
relationType: z15.string().max(200)
|
|
5153
5174
|
});
|
|
5154
|
-
var contextIncrementalVariant =
|
|
5155
|
-
action:
|
|
5156
|
-
skill:
|
|
5175
|
+
var contextIncrementalVariant = z15.object({
|
|
5176
|
+
action: z15.literal("incremental"),
|
|
5177
|
+
skill: z15.string().max(200)
|
|
5157
5178
|
});
|
|
5158
|
-
var contextBriefVariant =
|
|
5159
|
-
action:
|
|
5160
|
-
briefType:
|
|
5161
|
-
since:
|
|
5179
|
+
var contextBriefVariant = z15.object({
|
|
5180
|
+
action: z15.literal("brief"),
|
|
5181
|
+
briefType: z15.enum(["steering", "confidence", "delta"]),
|
|
5182
|
+
since: z15.string().max(200).optional()
|
|
5162
5183
|
});
|
|
5163
|
-
var contextLastVerifiedBriefVariant =
|
|
5164
|
-
action:
|
|
5165
|
-
templateId:
|
|
5166
|
-
scopeKey:
|
|
5184
|
+
var contextLastVerifiedBriefVariant = z15.object({
|
|
5185
|
+
action: z15.literal("last-verified-brief"),
|
|
5186
|
+
templateId: z15.string().max(200),
|
|
5187
|
+
scopeKey: z15.string().max(200)
|
|
5167
5188
|
});
|
|
5168
|
-
var contextActionUnion =
|
|
5189
|
+
var contextActionUnion = z15.discriminatedUnion("action", [
|
|
5169
5190
|
contextGatherVariant,
|
|
5170
5191
|
contextBuildVariant,
|
|
5171
5192
|
contextNeighborhoodVariant,
|
|
@@ -6200,20 +6221,20 @@ function formatTimeAgo(ms) {
|
|
|
6200
6221
|
}
|
|
6201
6222
|
|
|
6202
6223
|
// src/tools/collections.ts
|
|
6203
|
-
import { z as
|
|
6224
|
+
import { z as z17 } from "zod/v3";
|
|
6204
6225
|
|
|
6205
6226
|
// src/tools/labels.ts
|
|
6206
|
-
import { z as
|
|
6207
|
-
var labelsSchema =
|
|
6208
|
-
action:
|
|
6209
|
-
slug:
|
|
6210
|
-
name:
|
|
6211
|
-
color:
|
|
6212
|
-
description:
|
|
6213
|
-
parentSlug:
|
|
6214
|
-
isGroup:
|
|
6215
|
-
order:
|
|
6216
|
-
entryId:
|
|
6227
|
+
import { z as z16 } from "zod/v3";
|
|
6228
|
+
var labelsSchema = z16.object({
|
|
6229
|
+
action: z16.enum(["list", "create", "update", "delete", "apply", "remove"]).describe("Action: list all labels, create/update/delete a label, or apply/remove a label on an entry"),
|
|
6230
|
+
slug: z16.string().max(200).optional().describe("Label slug (required for create/update/delete/apply/remove)"),
|
|
6231
|
+
name: z16.string().max(500).optional().describe("Display name (required for create)"),
|
|
6232
|
+
color: z16.string().max(50).optional().describe("Hex color, e.g. '#ef4444'"),
|
|
6233
|
+
description: z16.string().max(2e3).optional().describe("What this label means"),
|
|
6234
|
+
parentSlug: z16.string().max(200).optional().describe("Parent group slug for label hierarchy"),
|
|
6235
|
+
isGroup: z16.boolean().optional().describe("True if this is a group container, not a taggable label"),
|
|
6236
|
+
order: z16.number().optional().describe("Sort order within its group"),
|
|
6237
|
+
entryId: z16.string().max(200).optional().describe("Entry ID for apply/remove actions")
|
|
6217
6238
|
});
|
|
6218
6239
|
async function handleLabelsList() {
|
|
6219
6240
|
const labels = await kernelQuery("chain.listLabels");
|
|
@@ -6318,110 +6339,110 @@ var COLLECTIONS_ACTIONS = [
|
|
|
6318
6339
|
"label-remove"
|
|
6319
6340
|
];
|
|
6320
6341
|
var STATUS_CATEGORIES = ["draft", "current", "past", "discarded"];
|
|
6321
|
-
var statusListEntrySchema =
|
|
6322
|
-
var qualityCriterionSchema =
|
|
6323
|
-
field:
|
|
6342
|
+
var statusListEntrySchema = z17.object({ label: z17.string().max(200), category: z17.enum(STATUS_CATEGORIES) });
|
|
6343
|
+
var qualityCriterionSchema = z17.object({
|
|
6344
|
+
field: z17.string().max(200).describe("Entry data field key this criterion applies to, e.g. 'description', 'owner'"),
|
|
6324
6345
|
// WP-480 S1: `max_length` — must mirror the Convex rule union, or the tool rejects a
|
|
6325
6346
|
// valid criterion before the request ever reaches the server.
|
|
6326
|
-
rule:
|
|
6327
|
-
value:
|
|
6347
|
+
rule: z17.enum(["required", "min_length", "max_length", "pattern"]).describe("'required': field must be non-empty (blocks accept). 'min_length': minimum string length (warns). 'max_length': maximum string length (warns). 'pattern': regex match (warns)."),
|
|
6348
|
+
value: z17.string().max(500).optional().describe("For min_length/max_length: the length bound as a string integer. For pattern: the regex string. Unused for 'required'.")
|
|
6328
6349
|
});
|
|
6329
|
-
var fieldSchema =
|
|
6330
|
-
key:
|
|
6331
|
-
label:
|
|
6332
|
-
type:
|
|
6333
|
-
required:
|
|
6334
|
-
options:
|
|
6335
|
-
searchable:
|
|
6336
|
-
displayHint:
|
|
6337
|
-
zone:
|
|
6338
|
-
colorMap:
|
|
6339
|
-
accentSource:
|
|
6340
|
-
iconMap:
|
|
6341
|
-
helpText:
|
|
6342
|
-
optionDescriptions:
|
|
6343
|
-
semanticRole:
|
|
6344
|
-
maxLength:
|
|
6345
|
-
minLength:
|
|
6350
|
+
var fieldSchema = z17.object({
|
|
6351
|
+
key: z17.string().max(200).describe("Field key, e.g. 'description', 'severity', 'status'"),
|
|
6352
|
+
label: z17.string().max(200).describe("Display label, e.g. 'Description', 'Severity'"),
|
|
6353
|
+
type: z17.string().max(50).describe("Field type: 'string', 'select', 'array', 'number', 'boolean'"),
|
|
6354
|
+
required: z17.boolean().optional().describe("Whether this field is required"),
|
|
6355
|
+
options: z17.array(z17.string().max(200)).max(200).optional().describe("Options for 'select' type fields"),
|
|
6356
|
+
searchable: z17.boolean().optional().describe("Whether this field is included in full-text search"),
|
|
6357
|
+
displayHint: z17.enum(["hero", "badge", "meta", "section", "hidden", "inline-meta"]).optional().describe("V2 rendering hint: how the field should be displayed in Cortex"),
|
|
6358
|
+
zone: z17.enum(["header", "body", "meta"]).optional().describe("V2 layout zone: where the field appears in the entry view"),
|
|
6359
|
+
colorMap: z17.record(z17.string().max(50)).optional().describe("V2 value-to-semantic-color mapping, e.g. { critical: 'danger', low: 'success' }"),
|
|
6360
|
+
accentSource: z17.boolean().optional().describe("When true, this field's colorMap value drives the card-level accent styling"),
|
|
6361
|
+
iconMap: z17.record(z17.string(), z17.string().max(50)).optional().describe("Maps field values to icons (emoji/symbol), prepended to badge text"),
|
|
6362
|
+
helpText: z17.string().max(2e3).optional().describe("Help text shown in editors and describe output"),
|
|
6363
|
+
optionDescriptions: z17.record(z17.string().max(500)).optional().describe("Per-option guidance for select fields"),
|
|
6364
|
+
semanticRole: z17.enum(["problem", "appetite", "elements", "architecture", "done_when", "risks", "exclusions"]).optional().describe("Semantic role for schema-driven consumers \u2014 enables field-key-independent validation and rendering"),
|
|
6365
|
+
maxLength: z17.number().optional().describe("Maximum character length for field values. Three-tier resolution: explicit > displayHint > type fallback."),
|
|
6366
|
+
minLength: z17.number().optional().describe("Minimum character length for field values. Only explicit \u2014 no defaults.")
|
|
6346
6367
|
});
|
|
6347
|
-
var collectionsSchema =
|
|
6348
|
-
action:
|
|
6368
|
+
var collectionsSchema = z17.object({
|
|
6369
|
+
action: z17.enum(COLLECTIONS_ACTIONS).describe(
|
|
6349
6370
|
"'list': browse all collections. 'update': update an existing collection. 'describe': full documentation for one collection \u2014 fields, option guides, usage guidance, examples. 'audit': health report for all collections \u2014 missing classification, icon, displayHint coverage, and field schema gaps. 'export': full system_collection_definitions export with classification metadata (thinkingLayer, classificationPriority, classificationCheck, classificationSignals, governanceRole, governanceFunction, timelineRole, canBeElementOf, descriptionFieldKey). Admin only. 'label-list'/'label-create'/'label-update'/'label-delete'/'label-apply'/'label-remove': manage workspace labels (absorbs the `labels` tool). Creating a new collection is not offered here \u2014 ask a platform admin to provision it, or enable the module ontology pack that owns the drawer."
|
|
6350
6371
|
),
|
|
6351
|
-
slug:
|
|
6352
|
-
name:
|
|
6353
|
-
description:
|
|
6354
|
-
purpose:
|
|
6355
|
-
icon:
|
|
6356
|
-
navGroup:
|
|
6357
|
-
fields:
|
|
6358
|
-
axis:
|
|
6359
|
-
stageLabelMap:
|
|
6360
|
-
defaultCanonicalKey:
|
|
6361
|
-
defaultWorkflowStatus:
|
|
6362
|
-
validWorkflowStatuses:
|
|
6372
|
+
slug: z17.string().max(200).optional().describe("URL-safe identifier for create/update, e.g. 'glossary', 'tech-debt'. For label-*: label slug."),
|
|
6373
|
+
name: z17.string().max(500).optional().describe("Display name for create, or new name for update. For label-create: label display name."),
|
|
6374
|
+
description: z17.string().max(2e4).optional().describe("What this collection is for. For label-create/label-update: what the label means."),
|
|
6375
|
+
purpose: z17.string().max(2e3).optional().describe("Why this collection exists \u2014 strategic reason"),
|
|
6376
|
+
icon: z17.string().max(50).optional().describe("Emoji icon for the collection"),
|
|
6377
|
+
navGroup: z17.enum(["daily", "strategic", "governance", "reference", "collections"]).optional().describe("Sidebar placement: 'daily', 'strategic', 'governance', 'reference', 'collections'"),
|
|
6378
|
+
fields: z17.array(fieldSchema).max(200).optional().describe("Field definitions for create, or replacement schema for update (replaces all fields)"),
|
|
6379
|
+
axis: z17.enum(["work", "none", "pending"]).optional().describe("REQUIRED for create: 'work' (needs stageLabelMap + validWorkflowStatuses), 'none', or 'pending'. For update: only settable on a non-system-stratum (custom) collection \u2014 the repair path for a legacy collection that predates the axis contract."),
|
|
6380
|
+
stageLabelMap: z17.record(z17.string(), z17.enum(["open", "in_progress", "done", "stopped", "tag"])).optional().describe("Required when axis is 'work': maps each valid workflowStatus to a canonical stage."),
|
|
6381
|
+
defaultCanonicalKey: z17.string().max(200).optional().describe("The canonical_key entries in this collection default to (e.g. 'decision', 'insight'). Consumers read from collection doc; code map is fallback."),
|
|
6382
|
+
defaultWorkflowStatus: z17.string().max(200).optional().describe("Default workflowStatus for new entries. Must be in validWorkflowStatuses when set (e.g. 'hypothesis' for insights)."),
|
|
6383
|
+
validWorkflowStatuses: z17.array(z17.string().max(200)).max(50).optional().describe("The allowed workflowStatus values for entries in this collection. New entries are validated against this list. Empty array means no constraint."),
|
|
6363
6384
|
// ENT-65, FEAT-200
|
|
6364
|
-
classificationCheck:
|
|
6365
|
-
classificationPriority:
|
|
6366
|
-
qualityCriteria:
|
|
6367
|
-
usageGuidance:
|
|
6368
|
-
statusList:
|
|
6385
|
+
classificationCheck: z17.string().max(500).optional().describe("LLM decision-tree check for this collection (3\u2013500 chars). Guides the classifier in routing entries here."),
|
|
6386
|
+
classificationPriority: z17.number().optional().describe("Classifier priority (1\u20139, lower = higher priority). Used with classificationCheck to order the decision tree."),
|
|
6387
|
+
qualityCriteria: z17.array(qualityCriterionSchema).max(50).optional().describe("Per-collection accept gate rules. 'required' rule hard-blocks accepts on empty fields; 'min_length'/'pattern' rules warn. Pass an empty array to clear all criteria."),
|
|
6388
|
+
usageGuidance: z17.string().max(2e4).optional().describe("Plain-text guidance shown to agents and users: when to use this collection, when not to, and what makes a good entry."),
|
|
6389
|
+
statusList: z17.array(statusListEntrySchema).max(50).optional().describe(`Ordered status vocabulary: {label, category}[] (draft/current/past/discarded); draft first, exactly one 'discarded' labeled "discarded", labels unique. Re-validated server-side.`),
|
|
6369
6390
|
// For label-*
|
|
6370
|
-
color:
|
|
6371
|
-
parentSlug:
|
|
6372
|
-
isGroup:
|
|
6373
|
-
order:
|
|
6374
|
-
entryId:
|
|
6391
|
+
color: z17.string().max(50).optional().describe("For label-create/label-update: hex color, e.g. '#ef4444'."),
|
|
6392
|
+
parentSlug: z17.string().max(200).optional().describe("For label-create: parent group slug for label hierarchy."),
|
|
6393
|
+
isGroup: z17.boolean().optional().describe("For label-create/label-update: true if this is a group container, not a taggable label."),
|
|
6394
|
+
order: z17.number().optional().describe("For label-create/label-update: sort order within its group."),
|
|
6395
|
+
entryId: z17.string().max(200).optional().describe("For label-apply/label-remove: entry ID.")
|
|
6375
6396
|
});
|
|
6376
|
-
var collectionsListVariant =
|
|
6377
|
-
var collectionsDescribeVariant =
|
|
6378
|
-
var collectionsUpdateVariant =
|
|
6379
|
-
action:
|
|
6380
|
-
slug:
|
|
6381
|
-
name:
|
|
6382
|
-
description:
|
|
6383
|
-
purpose:
|
|
6384
|
-
icon:
|
|
6385
|
-
navGroup:
|
|
6386
|
-
fields:
|
|
6387
|
-
axis:
|
|
6388
|
-
stageLabelMap:
|
|
6397
|
+
var collectionsListVariant = z17.object({ action: z17.literal("list") });
|
|
6398
|
+
var collectionsDescribeVariant = z17.object({ action: z17.literal("describe"), slug: z17.string().max(200) });
|
|
6399
|
+
var collectionsUpdateVariant = z17.object({
|
|
6400
|
+
action: z17.literal("update"),
|
|
6401
|
+
slug: z17.string().max(200),
|
|
6402
|
+
name: z17.string().max(500).optional(),
|
|
6403
|
+
description: z17.string().max(2e4).optional(),
|
|
6404
|
+
purpose: z17.string().max(2e3).optional(),
|
|
6405
|
+
icon: z17.string().max(50).optional(),
|
|
6406
|
+
navGroup: z17.enum(["daily", "strategic", "governance", "reference", "collections"]).optional(),
|
|
6407
|
+
fields: z17.array(fieldSchema).optional(),
|
|
6408
|
+
axis: z17.enum(["work", "none", "pending"]).optional(),
|
|
6409
|
+
stageLabelMap: z17.record(z17.string(), z17.enum(["open", "in_progress", "done", "stopped", "tag"])).optional(),
|
|
6389
6410
|
// WP-640 SWEEP (P1): axis/stageLabelMap repair legacy custom collections — see collections.ts's updateCollection.
|
|
6390
|
-
defaultCanonicalKey:
|
|
6391
|
-
defaultWorkflowStatus:
|
|
6392
|
-
validWorkflowStatuses:
|
|
6393
|
-
classificationCheck:
|
|
6394
|
-
classificationPriority:
|
|
6395
|
-
qualityCriteria:
|
|
6396
|
-
usageGuidance:
|
|
6397
|
-
statusList:
|
|
6411
|
+
defaultCanonicalKey: z17.string().max(200).optional(),
|
|
6412
|
+
defaultWorkflowStatus: z17.string().max(200).optional(),
|
|
6413
|
+
validWorkflowStatuses: z17.array(z17.string().max(200)).optional(),
|
|
6414
|
+
classificationCheck: z17.string().max(500).optional(),
|
|
6415
|
+
classificationPriority: z17.number().optional(),
|
|
6416
|
+
qualityCriteria: z17.array(qualityCriterionSchema).optional(),
|
|
6417
|
+
usageGuidance: z17.string().max(2e4).optional(),
|
|
6418
|
+
statusList: z17.array(statusListEntrySchema).optional()
|
|
6398
6419
|
});
|
|
6399
|
-
var collectionsAuditVariant =
|
|
6400
|
-
var collectionsExportVariant =
|
|
6401
|
-
var collectionsLabelListVariant =
|
|
6402
|
-
var collectionsLabelCreateVariant =
|
|
6403
|
-
action:
|
|
6404
|
-
slug:
|
|
6405
|
-
name:
|
|
6406
|
-
color:
|
|
6407
|
-
description:
|
|
6408
|
-
parentSlug:
|
|
6409
|
-
isGroup:
|
|
6410
|
-
order:
|
|
6420
|
+
var collectionsAuditVariant = z17.object({ action: z17.literal("audit") });
|
|
6421
|
+
var collectionsExportVariant = z17.object({ action: z17.literal("export") });
|
|
6422
|
+
var collectionsLabelListVariant = z17.object({ action: z17.literal("label-list") });
|
|
6423
|
+
var collectionsLabelCreateVariant = z17.object({
|
|
6424
|
+
action: z17.literal("label-create"),
|
|
6425
|
+
slug: z17.string().max(200),
|
|
6426
|
+
name: z17.string().max(500),
|
|
6427
|
+
color: z17.string().max(50).optional(),
|
|
6428
|
+
description: z17.string().max(2e3).optional(),
|
|
6429
|
+
parentSlug: z17.string().max(200).optional(),
|
|
6430
|
+
isGroup: z17.boolean().optional(),
|
|
6431
|
+
order: z17.number().optional()
|
|
6411
6432
|
});
|
|
6412
|
-
var collectionsLabelUpdateVariant =
|
|
6413
|
-
action:
|
|
6414
|
-
slug:
|
|
6415
|
-
name:
|
|
6416
|
-
color:
|
|
6417
|
-
description:
|
|
6418
|
-
isGroup:
|
|
6419
|
-
order:
|
|
6433
|
+
var collectionsLabelUpdateVariant = z17.object({
|
|
6434
|
+
action: z17.literal("label-update"),
|
|
6435
|
+
slug: z17.string().max(200),
|
|
6436
|
+
name: z17.string().max(500).optional(),
|
|
6437
|
+
color: z17.string().max(50).optional(),
|
|
6438
|
+
description: z17.string().max(2e3).optional(),
|
|
6439
|
+
isGroup: z17.boolean().optional(),
|
|
6440
|
+
order: z17.number().optional()
|
|
6420
6441
|
});
|
|
6421
|
-
var collectionsLabelDeleteVariant =
|
|
6422
|
-
var collectionsLabelApplyVariant =
|
|
6423
|
-
var collectionsLabelRemoveVariant =
|
|
6424
|
-
var collectionsActionUnion =
|
|
6442
|
+
var collectionsLabelDeleteVariant = z17.object({ action: z17.literal("label-delete"), slug: z17.string().max(200) });
|
|
6443
|
+
var collectionsLabelApplyVariant = z17.object({ action: z17.literal("label-apply"), slug: z17.string().max(200), entryId: z17.string().max(200) });
|
|
6444
|
+
var collectionsLabelRemoveVariant = z17.object({ action: z17.literal("label-remove"), slug: z17.string().max(200), entryId: z17.string().max(200) });
|
|
6445
|
+
var collectionsActionUnion = z17.discriminatedUnion("action", [
|
|
6425
6446
|
collectionsListVariant,
|
|
6426
6447
|
collectionsDescribeVariant,
|
|
6427
6448
|
collectionsUpdateVariant,
|
|
@@ -6731,7 +6752,7 @@ async function handleExport() {
|
|
|
6731
6752
|
}
|
|
6732
6753
|
|
|
6733
6754
|
// src/tools/orient.ts
|
|
6734
|
-
import { z as
|
|
6755
|
+
import { z as z19 } from "zod/v3";
|
|
6735
6756
|
|
|
6736
6757
|
// src/tools/planned-work.ts
|
|
6737
6758
|
function buildPlannedWork(allEntries) {
|
|
@@ -7862,7 +7883,7 @@ function formatRuleListsLines(ruleLists) {
|
|
|
7862
7883
|
}
|
|
7863
7884
|
|
|
7864
7885
|
// src/tools/start_pb.ts
|
|
7865
|
-
import { z as
|
|
7886
|
+
import { z as z18 } from "zod/v3";
|
|
7866
7887
|
|
|
7867
7888
|
// src/lib/sessionNotices.ts
|
|
7868
7889
|
var ANSI_AND_CONTROL_RE2 = /\x1b\[[0-9;]*[A-Za-z]|\x1b\][^\x07]*\x07|\x1b[^[\]0-9;A-Za-z]?|[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g;
|
|
@@ -7989,8 +8010,8 @@ function rankActiveBets(entries) {
|
|
|
7989
8010
|
}
|
|
7990
8011
|
|
|
7991
8012
|
// src/tools/start_pb.ts
|
|
7992
|
-
var startPbSchema =
|
|
7993
|
-
task:
|
|
8013
|
+
var startPbSchema = z18.object({
|
|
8014
|
+
task: z18.string().max(2e3).optional().describe(
|
|
7994
8015
|
"What you're about to work on (e.g. 'implementing auth middleware'). Filters governance to show relevant principles, standards, and business rules \u2014 for every workspace state, including a fresh one."
|
|
7995
8016
|
)
|
|
7996
8017
|
// TEN-2431: no `scope` param — start_pb's governance matches orient's scope-BLIND RENDERED
|
|
@@ -8301,46 +8322,46 @@ async function markOrientedWithSnapshotFallback(agentSessionId, coherenceSnapsho
|
|
|
8301
8322
|
}
|
|
8302
8323
|
}
|
|
8303
8324
|
var ORIENT_ACTIONS = ["start", "task"];
|
|
8304
|
-
var orientSchema =
|
|
8305
|
-
action:
|
|
8325
|
+
var orientSchema = z19.object({
|
|
8326
|
+
action: z19.enum(ORIENT_ACTIONS).optional().default("task").describe(
|
|
8306
8327
|
"'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."
|
|
8307
8328
|
),
|
|
8308
|
-
mode:
|
|
8309
|
-
tier:
|
|
8329
|
+
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."),
|
|
8330
|
+
tier: z19.enum(["summary", "standard", "full"]).optional().describe(
|
|
8310
8331
|
"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."
|
|
8311
8332
|
),
|
|
8312
|
-
task:
|
|
8333
|
+
task: z19.string().max(2e3).optional().describe(
|
|
8313
8334
|
"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."
|
|
8314
8335
|
),
|
|
8315
8336
|
// D1d (WP-754/TASK-204): matches the server's StartupResolutionSignals shape; domain resolution (original purpose) is deleted, sole survivor is `context.served` telemetry.
|
|
8316
|
-
startupSignals:
|
|
8317
|
-
changedPaths:
|
|
8318
|
-
reviewedArtifactRefs:
|
|
8319
|
-
branchName:
|
|
8320
|
-
worktreeName:
|
|
8337
|
+
startupSignals: z19.object({
|
|
8338
|
+
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)."),
|
|
8339
|
+
reviewedArtifactRefs: z19.array(z19.string()).max(25).optional().describe("Chain entry IDs the caller has already reviewed this session, if tracked."),
|
|
8340
|
+
branchName: z19.string().max(120).optional().describe("Current git branch name, if known."),
|
|
8341
|
+
worktreeName: z19.string().max(120).optional().describe("Current worktree/directory name, if known.")
|
|
8321
8342
|
}).optional().describe("For 'task': best-effort startup signals \u2014 changedPaths/reviewedArtifactRefs/branchName/worktreeName. All optional; omit fields you don't know."),
|
|
8322
|
-
invocationPath:
|
|
8343
|
+
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.")
|
|
8323
8344
|
});
|
|
8324
|
-
var orientStartVariant =
|
|
8325
|
-
action:
|
|
8326
|
-
task:
|
|
8345
|
+
var orientStartVariant = z19.object({
|
|
8346
|
+
action: z19.literal("start"),
|
|
8347
|
+
task: z19.string().max(2e3).optional()
|
|
8327
8348
|
});
|
|
8328
|
-
var orientTaskVariant =
|
|
8329
|
-
action:
|
|
8330
|
-
mode:
|
|
8331
|
-
tier:
|
|
8332
|
-
task:
|
|
8349
|
+
var orientTaskVariant = z19.object({
|
|
8350
|
+
action: z19.literal("task"),
|
|
8351
|
+
mode: z19.enum(["full", "brief"]).optional().default("full"),
|
|
8352
|
+
tier: z19.enum(["summary", "standard", "full"]).optional(),
|
|
8353
|
+
task: z19.string().max(2e3).optional(),
|
|
8333
8354
|
// WP-486 Slice 1 (FEAT-1371) — mirrors orientSchema's top-level declaration above; see its
|
|
8334
8355
|
// doc comment for the shape rationale.
|
|
8335
|
-
startupSignals:
|
|
8336
|
-
changedPaths:
|
|
8337
|
-
reviewedArtifactRefs:
|
|
8338
|
-
branchName:
|
|
8339
|
-
worktreeName:
|
|
8356
|
+
startupSignals: z19.object({
|
|
8357
|
+
changedPaths: z19.array(z19.string()).max(25).optional(),
|
|
8358
|
+
reviewedArtifactRefs: z19.array(z19.string()).max(25).optional(),
|
|
8359
|
+
branchName: z19.string().max(120).optional(),
|
|
8360
|
+
worktreeName: z19.string().max(120).optional()
|
|
8340
8361
|
}).optional(),
|
|
8341
|
-
invocationPath:
|
|
8362
|
+
invocationPath: z19.enum(["session-start", "session-close", "manual-orient", "handshake", "unknown"]).optional()
|
|
8342
8363
|
});
|
|
8343
|
-
var orientActionUnion =
|
|
8364
|
+
var orientActionUnion = z19.discriminatedUnion("action", [
|
|
8344
8365
|
orientStartVariant,
|
|
8345
8366
|
orientTaskVariant
|
|
8346
8367
|
]);
|
|
@@ -9120,7 +9141,7 @@ async function _handleOrient({ mode = "full", tier, task, startupSignals, invoca
|
|
|
9120
9141
|
}
|
|
9121
9142
|
|
|
9122
9143
|
// src/tools/workflows.ts
|
|
9123
|
-
import { z as
|
|
9144
|
+
import { z as z20 } from "zod/v3";
|
|
9124
9145
|
|
|
9125
9146
|
// src/workflows/descriptor.ts
|
|
9126
9147
|
function cloneWorkflowQuestion(question) {
|
|
@@ -9960,73 +9981,73 @@ function workflowRunOutputToText(output) {
|
|
|
9960
9981
|
|
|
9961
9982
|
// src/tools/workflows.ts
|
|
9962
9983
|
var WORKFLOWS_ACTIONS = ["list", "start", "checkpoint", "get-run"];
|
|
9963
|
-
var jsonValueSchema =
|
|
9964
|
-
() =>
|
|
9965
|
-
|
|
9966
|
-
|
|
9967
|
-
|
|
9968
|
-
|
|
9969
|
-
|
|
9970
|
-
|
|
9984
|
+
var jsonValueSchema = z20.lazy(
|
|
9985
|
+
() => z20.union([
|
|
9986
|
+
z20.string(),
|
|
9987
|
+
z20.number(),
|
|
9988
|
+
z20.boolean(),
|
|
9989
|
+
z20.null(),
|
|
9990
|
+
z20.array(jsonValueSchema),
|
|
9991
|
+
z20.record(jsonValueSchema)
|
|
9971
9992
|
])
|
|
9972
9993
|
);
|
|
9973
|
-
var workflowRunOutputInputSchema =
|
|
9974
|
-
|
|
9975
|
-
format:
|
|
9976
|
-
value:
|
|
9994
|
+
var workflowRunOutputInputSchema = z20.union([
|
|
9995
|
+
z20.object({
|
|
9996
|
+
format: z20.literal("freetext"),
|
|
9997
|
+
value: z20.string()
|
|
9977
9998
|
}),
|
|
9978
|
-
|
|
9979
|
-
format:
|
|
9980
|
-
value:
|
|
9999
|
+
z20.object({
|
|
10000
|
+
format: z20.literal("list"),
|
|
10001
|
+
value: z20.array(z20.string())
|
|
9981
10002
|
}),
|
|
9982
|
-
|
|
9983
|
-
format:
|
|
9984
|
-
value:
|
|
10003
|
+
z20.object({
|
|
10004
|
+
format: z20.literal("choice"),
|
|
10005
|
+
value: z20.union([z20.string(), z20.array(z20.string())])
|
|
9985
10006
|
}),
|
|
9986
|
-
|
|
9987
|
-
format:
|
|
10007
|
+
z20.object({
|
|
10008
|
+
format: z20.literal("structured"),
|
|
9988
10009
|
value: jsonValueSchema
|
|
9989
10010
|
})
|
|
9990
10011
|
]);
|
|
9991
|
-
var workflowsSchema =
|
|
9992
|
-
action:
|
|
10012
|
+
var workflowsSchema = z20.object({
|
|
10013
|
+
action: z20.enum(WORKFLOWS_ACTIONS).describe(
|
|
9993
10014
|
"'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."
|
|
9994
10015
|
),
|
|
9995
|
-
workflowId:
|
|
9996
|
-
runId:
|
|
9997
|
-
roundId:
|
|
9998
|
-
output:
|
|
9999
|
-
isFinal:
|
|
10000
|
-
restart:
|
|
10001
|
-
summaryName:
|
|
10002
|
-
summaryDescription:
|
|
10003
|
-
summaryEntryId:
|
|
10016
|
+
workflowId: z20.string().max(200).optional().describe("Workflow ID for start, checkpoint, or get-run, e.g. 'retro', 'implementation-review'"),
|
|
10017
|
+
runId: z20.string().max(200).optional().describe("Workflow run ID: for get-run, which run to load; for checkpoint, target this run (avoids session drift \u2014 pass runId from get-run)."),
|
|
10018
|
+
roundId: z20.string().max(200).optional().describe("Round ID for checkpoint, e.g. 'what-went-well'"),
|
|
10019
|
+
output: z20.union([z20.string(), workflowRunOutputInputSchema]).optional().describe("The round's output \u2014 either legacy synthesized text or a typed workflow run payload."),
|
|
10020
|
+
isFinal: z20.boolean().optional().describe("If true, finalize an existing durable workflow run from its terminal round and create the summary chain entry."),
|
|
10021
|
+
restart: z20.boolean().optional().describe("If true, start a new durable run from the workflow's first round in the current session."),
|
|
10022
|
+
summaryName: z20.string().max(500).optional().describe("Optional name for final chain entry. If omitted, the workflow summary template is used."),
|
|
10023
|
+
summaryDescription: z20.string().max(2e4).optional().describe("Optional override for the final chain entry description. Defaults to the final round output text."),
|
|
10024
|
+
summaryEntryId: z20.string().max(200).optional().describe("Link an existing entry as the run's summary instead of creating one. Used by facilitated workflows (e.g. shape) where the primary record is created by the specialized tool."),
|
|
10004
10025
|
// WP-513: team+role to create the finalize summary AS OWNER of (rung 2 only).
|
|
10005
|
-
ownerTeamEntryId:
|
|
10006
|
-
ownerRoleEntryId:
|
|
10026
|
+
ownerTeamEntryId: z20.string().max(200).optional().describe("For 'checkpoint' (isFinal): owning team (rung-2)."),
|
|
10027
|
+
ownerRoleEntryId: z20.string().max(200).optional().describe("For 'checkpoint' (isFinal): owning role (rung-2).")
|
|
10007
10028
|
});
|
|
10008
|
-
var workflowsListVariant =
|
|
10009
|
-
var workflowsGetRunVariant =
|
|
10010
|
-
action:
|
|
10011
|
-
runId:
|
|
10012
|
-
workflowId:
|
|
10029
|
+
var workflowsListVariant = z20.object({ action: z20.literal("list") });
|
|
10030
|
+
var workflowsGetRunVariant = z20.object({
|
|
10031
|
+
action: z20.literal("get-run"),
|
|
10032
|
+
runId: z20.string().max(200).optional(),
|
|
10033
|
+
workflowId: z20.string().max(200).optional()
|
|
10013
10034
|
});
|
|
10014
|
-
var workflowsStartVariant =
|
|
10015
|
-
var workflowsCheckpointVariant =
|
|
10016
|
-
action:
|
|
10017
|
-
workflowId:
|
|
10018
|
-
roundId:
|
|
10019
|
-
output:
|
|
10020
|
-
isFinal:
|
|
10021
|
-
restart:
|
|
10022
|
-
summaryName:
|
|
10023
|
-
summaryDescription:
|
|
10024
|
-
summaryEntryId:
|
|
10025
|
-
runId:
|
|
10026
|
-
ownerTeamEntryId:
|
|
10027
|
-
ownerRoleEntryId:
|
|
10035
|
+
var workflowsStartVariant = z20.object({ action: z20.literal("start"), workflowId: z20.string().max(200) });
|
|
10036
|
+
var workflowsCheckpointVariant = z20.object({
|
|
10037
|
+
action: z20.literal("checkpoint"),
|
|
10038
|
+
workflowId: z20.string().max(200),
|
|
10039
|
+
roundId: z20.string().max(200),
|
|
10040
|
+
output: z20.union([z20.string(), workflowRunOutputInputSchema]),
|
|
10041
|
+
isFinal: z20.boolean().optional(),
|
|
10042
|
+
restart: z20.boolean().optional(),
|
|
10043
|
+
summaryName: z20.string().max(500).optional(),
|
|
10044
|
+
summaryDescription: z20.string().max(2e4).optional(),
|
|
10045
|
+
summaryEntryId: z20.string().max(200).optional(),
|
|
10046
|
+
runId: z20.string().max(200).optional(),
|
|
10047
|
+
ownerTeamEntryId: z20.string().max(200).optional(),
|
|
10048
|
+
ownerRoleEntryId: z20.string().max(200).optional()
|
|
10028
10049
|
});
|
|
10029
|
-
var workflowsActionUnion =
|
|
10050
|
+
var workflowsActionUnion = z20.discriminatedUnion("action", [
|
|
10030
10051
|
workflowsListVariant,
|
|
10031
10052
|
workflowsGetRunVariant,
|
|
10032
10053
|
workflowsStartVariant,
|
|
@@ -10759,10 +10780,10 @@ function parseListOutput(output) {
|
|
|
10759
10780
|
}
|
|
10760
10781
|
|
|
10761
10782
|
// src/tools/quality.ts
|
|
10762
|
-
import { z as
|
|
10783
|
+
import { z as z22 } from "zod/v3";
|
|
10763
10784
|
|
|
10764
10785
|
// src/tools/audit.ts
|
|
10765
|
-
import { z as
|
|
10786
|
+
import { z as z21 } from "zod/v3";
|
|
10766
10787
|
var VOCAB_TTL_MS = 5 * 60 * 1e3;
|
|
10767
10788
|
var MAX_VOCAB_KEYS = 100;
|
|
10768
10789
|
var vocabCache = /* @__PURE__ */ new Map();
|
|
@@ -10792,12 +10813,12 @@ function evictVocabIfFull() {
|
|
|
10792
10813
|
}
|
|
10793
10814
|
}
|
|
10794
10815
|
var AUDIT_ACTIONS = ["run"];
|
|
10795
|
-
var auditSchema =
|
|
10796
|
-
action:
|
|
10816
|
+
var auditSchema = z21.object({
|
|
10817
|
+
action: z21.enum(AUDIT_ACTIONS).describe(
|
|
10797
10818
|
"'run': run the hygiene audit for a work package entry."
|
|
10798
10819
|
),
|
|
10799
|
-
entryId:
|
|
10800
|
-
phase:
|
|
10820
|
+
entryId: z21.string().describe("Work package entry ID to audit, e.g. '<PREFIX>-<n>'"),
|
|
10821
|
+
phase: z21.enum(["shaping", "handoff"]).default("shaping").optional().describe(
|
|
10801
10822
|
"'shaping': check shaping-phase fields only. 'handoff': check all required fields including buildContract/buildSequence/exclusions/risks. Default: shaping."
|
|
10802
10823
|
)
|
|
10803
10824
|
});
|
|
@@ -11074,44 +11095,44 @@ async function handleSpineCheck(story, refresh = false) {
|
|
|
11074
11095
|
|
|
11075
11096
|
// src/tools/quality.ts
|
|
11076
11097
|
var QUALITY_ACTIONS = ["check", "re-evaluate", "verify-chain", "audit", "spine-check"];
|
|
11077
|
-
var qualitySchema =
|
|
11078
|
-
action:
|
|
11098
|
+
var qualitySchema = z22.object({
|
|
11099
|
+
action: z22.enum(QUALITY_ACTIONS).describe(
|
|
11079
11100
|
"'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."
|
|
11080
11101
|
),
|
|
11081
|
-
entryId:
|
|
11082
|
-
context:
|
|
11083
|
-
collection:
|
|
11084
|
-
mode:
|
|
11085
|
-
phase:
|
|
11102
|
+
entryId: z22.string().max(200).optional().describe("For 'check'/'re-evaluate'/'audit': entry ID, e.g. 'TEN-graph-db', '<PREFIX>-<n>'."),
|
|
11103
|
+
context: z22.enum(["capture", "commit", "review"]).default("review").optional().describe("For re-evaluate: evaluation context"),
|
|
11104
|
+
collection: z22.string().max(200).optional().describe("For 'verify-chain': collection slug to verify (default: glossary)."),
|
|
11105
|
+
mode: z22.enum(["report", "fix"]).optional().describe("For 'verify-chain': 'report' = read-only trust report (default). 'fix' = also update drifted codeMapping statuses."),
|
|
11106
|
+
phase: z22.enum(["shaping", "handoff"]).optional().describe(
|
|
11086
11107
|
"For 'audit': 'shaping' checks shaping-phase fields only (default). 'handoff' checks all required fields including buildContract/buildSequence/exclusions/risks."
|
|
11087
11108
|
),
|
|
11088
|
-
story:
|
|
11089
|
-
refresh:
|
|
11109
|
+
story: z22.boolean().optional().describe("For 'spine-check': also run the on-demand one-story LLM judgment (never scheduled; result labelled [unvalidated])."),
|
|
11110
|
+
refresh: z22.boolean().optional().describe(
|
|
11090
11111
|
"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."
|
|
11091
11112
|
)
|
|
11092
11113
|
});
|
|
11093
|
-
var qualityCheckVariant =
|
|
11094
|
-
var qualityReEvaluateVariant =
|
|
11095
|
-
action:
|
|
11096
|
-
entryId:
|
|
11097
|
-
context:
|
|
11114
|
+
var qualityCheckVariant = z22.object({ action: z22.literal("check"), entryId: z22.string().max(200) });
|
|
11115
|
+
var qualityReEvaluateVariant = z22.object({
|
|
11116
|
+
action: z22.literal("re-evaluate"),
|
|
11117
|
+
entryId: z22.string().max(200),
|
|
11118
|
+
context: z22.enum(["capture", "commit", "review"]).optional().default("review")
|
|
11098
11119
|
});
|
|
11099
|
-
var qualityVerifyChainVariant =
|
|
11100
|
-
action:
|
|
11101
|
-
collection:
|
|
11102
|
-
mode:
|
|
11120
|
+
var qualityVerifyChainVariant = z22.object({
|
|
11121
|
+
action: z22.literal("verify-chain"),
|
|
11122
|
+
collection: z22.string().max(200).optional().default("glossary"),
|
|
11123
|
+
mode: z22.enum(["report", "fix"]).optional().default("report")
|
|
11103
11124
|
});
|
|
11104
|
-
var qualityAuditVariant =
|
|
11105
|
-
action:
|
|
11106
|
-
entryId:
|
|
11107
|
-
phase:
|
|
11125
|
+
var qualityAuditVariant = z22.object({
|
|
11126
|
+
action: z22.literal("audit"),
|
|
11127
|
+
entryId: z22.string().max(200),
|
|
11128
|
+
phase: z22.enum(["shaping", "handoff"]).optional().default("shaping")
|
|
11108
11129
|
});
|
|
11109
|
-
var qualitySpineCheckVariant =
|
|
11110
|
-
action:
|
|
11111
|
-
story:
|
|
11112
|
-
refresh:
|
|
11130
|
+
var qualitySpineCheckVariant = z22.object({
|
|
11131
|
+
action: z22.literal("spine-check"),
|
|
11132
|
+
story: z22.boolean().optional().default(false),
|
|
11133
|
+
refresh: z22.boolean().optional().default(false)
|
|
11113
11134
|
});
|
|
11114
|
-
var qualityActionUnion =
|
|
11135
|
+
var qualityActionUnion = z22.discriminatedUnion("action", [
|
|
11115
11136
|
qualityCheckVariant,
|
|
11116
11137
|
qualityReEvaluateVariant,
|
|
11117
11138
|
qualityVerifyChainVariant,
|
|
@@ -11125,43 +11146,43 @@ var QUALITY_ACTION_SPECS = {
|
|
|
11125
11146
|
audit: { params: ["entryId", "phase"], description: "entryId is required." },
|
|
11126
11147
|
"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)." }
|
|
11127
11148
|
};
|
|
11128
|
-
var qualityCheckOutputSchema =
|
|
11129
|
-
entryId:
|
|
11149
|
+
var qualityCheckOutputSchema = z22.object({
|
|
11150
|
+
entryId: z22.string(),
|
|
11130
11151
|
/** WP-480 S1: false = the ID does not resolve to an entry (typo/deleted) — distinct from "no verdict yet". */
|
|
11131
|
-
entryFound:
|
|
11132
|
-
hasVerdict:
|
|
11152
|
+
entryFound: z22.boolean().optional(),
|
|
11153
|
+
hasVerdict: z22.boolean(),
|
|
11133
11154
|
/** WP-480 S1: the verdict was judged against content the entry no longer has — re-evaluate for a current one. */
|
|
11134
|
-
stale:
|
|
11135
|
-
tier:
|
|
11136
|
-
passed:
|
|
11137
|
-
criteria:
|
|
11138
|
-
id:
|
|
11139
|
-
passed:
|
|
11140
|
-
hint:
|
|
11155
|
+
stale: z22.boolean().optional(),
|
|
11156
|
+
tier: z22.string().optional(),
|
|
11157
|
+
passed: z22.boolean().optional(),
|
|
11158
|
+
criteria: z22.array(z22.object({
|
|
11159
|
+
id: z22.string(),
|
|
11160
|
+
passed: z22.boolean(),
|
|
11161
|
+
hint: z22.string().optional()
|
|
11141
11162
|
}))
|
|
11142
11163
|
});
|
|
11143
|
-
var qualityReevaluateOutputSchema =
|
|
11144
|
-
entryId:
|
|
11145
|
-
context:
|
|
11146
|
-
score:
|
|
11147
|
-
maxScore:
|
|
11148
|
-
improved:
|
|
11164
|
+
var qualityReevaluateOutputSchema = z22.object({
|
|
11165
|
+
entryId: z22.string(),
|
|
11166
|
+
context: z22.string(),
|
|
11167
|
+
score: z22.number(),
|
|
11168
|
+
maxScore: z22.number(),
|
|
11169
|
+
improved: z22.boolean()
|
|
11149
11170
|
});
|
|
11150
|
-
var qualitySpineCheckOutputSchema =
|
|
11151
|
-
hasVerdict:
|
|
11152
|
-
noSpineEntries:
|
|
11153
|
-
structuralPassed:
|
|
11154
|
-
storyPassed:
|
|
11155
|
-
stale:
|
|
11171
|
+
var qualitySpineCheckOutputSchema = z22.object({
|
|
11172
|
+
hasVerdict: z22.boolean(),
|
|
11173
|
+
noSpineEntries: z22.boolean().optional(),
|
|
11174
|
+
structuralPassed: z22.boolean().optional(),
|
|
11175
|
+
storyPassed: z22.boolean().nullable().optional(),
|
|
11176
|
+
stale: z22.boolean().optional(),
|
|
11156
11177
|
// TASK-156: a capped membership scan must stay distinguishable from a complete one, and a
|
|
11157
11178
|
// malformed verdict needs its own discriminator — both were silently stripped before this.
|
|
11158
|
-
staleMemberIds:
|
|
11159
|
-
membershipTruncated:
|
|
11179
|
+
staleMemberIds: z22.array(z22.string()).optional(),
|
|
11180
|
+
membershipTruncated: z22.boolean().optional(),
|
|
11160
11181
|
// PRRT_kwDORS4ils6i_PVS: a KNOWN relations-fingerprint mismatch, distinct from "unknown" —
|
|
11161
11182
|
// without this, a detected topology change and an unverifiable legacy fingerprint were
|
|
11162
11183
|
// indistinguishable in structured output.
|
|
11163
|
-
relationsChanged:
|
|
11164
|
-
malformed:
|
|
11184
|
+
relationsChanged: z22.boolean().optional(),
|
|
11185
|
+
malformed: z22.boolean().optional()
|
|
11165
11186
|
});
|
|
11166
11187
|
function registerQualityTools(server) {
|
|
11167
11188
|
const qualityHandlers = {
|
|
@@ -11343,10 +11364,10 @@ async function handleReEvaluate(entryId, context) {
|
|
|
11343
11364
|
}
|
|
11344
11365
|
|
|
11345
11366
|
// src/tools/session.ts
|
|
11346
|
-
import { z as
|
|
11367
|
+
import { z as z25 } from "zod/v3";
|
|
11347
11368
|
|
|
11348
11369
|
// src/tools/wrapup.ts
|
|
11349
|
-
import { z as
|
|
11370
|
+
import { z as z23 } from "zod/v3";
|
|
11350
11371
|
|
|
11351
11372
|
// src/lib/compose-wrapup-view.ts
|
|
11352
11373
|
function toComposed(e) {
|
|
@@ -11800,8 +11821,8 @@ async function runWrapupCommitAll(data, cachedSuggestions) {
|
|
|
11800
11821
|
overflowUnscanned
|
|
11801
11822
|
};
|
|
11802
11823
|
}
|
|
11803
|
-
var wrapupSchema =
|
|
11804
|
-
action:
|
|
11824
|
+
var wrapupSchema = z23.object({
|
|
11825
|
+
action: z23.enum(["review", "commit-all"]).optional().describe(
|
|
11805
11826
|
"Action to perform. 'review' (default) shows the wrapup summary. 'commit-all' accepts all uncommitted drafts and creates suggested links."
|
|
11806
11827
|
)
|
|
11807
11828
|
});
|
|
@@ -11902,26 +11923,26 @@ ${text}` : text;
|
|
|
11902
11923
|
}
|
|
11903
11924
|
|
|
11904
11925
|
// src/tools/facilitate.ts
|
|
11905
|
-
import { z as
|
|
11926
|
+
import { z as z24 } from "zod/v3";
|
|
11906
11927
|
var FACILITATE_ACTIONS = ["resume", "commit-constellation"];
|
|
11907
|
-
var coherencyAcknowledgementSchema =
|
|
11908
|
-
response:
|
|
11909
|
-
entryId:
|
|
11910
|
-
reason:
|
|
11911
|
-
subjectEntryId:
|
|
11928
|
+
var coherencyAcknowledgementSchema = z24.object({
|
|
11929
|
+
response: z24.string().max(200).describe("Acknowledgement response per offender: 'linked' | 'accepted-fix' | 'diverged'."),
|
|
11930
|
+
entryId: z24.string().max(200).optional().describe("Entry the acknowledgement links to (e.g. the strategic spine entry)."),
|
|
11931
|
+
reason: z24.string().max(2e3).optional().describe("Free-text justification, required for a 'diverged' response."),
|
|
11932
|
+
subjectEntryId: z24.string().max(200).optional().describe("The refused entry this acknowledgement answers.")
|
|
11912
11933
|
});
|
|
11913
|
-
var facilitateSchema =
|
|
11914
|
-
action:
|
|
11934
|
+
var facilitateSchema = z24.object({
|
|
11935
|
+
action: z24.enum(FACILITATE_ACTIONS).describe(
|
|
11915
11936
|
"'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."
|
|
11916
11937
|
),
|
|
11917
|
-
betEntryId:
|
|
11918
|
-
operationId:
|
|
11938
|
+
betEntryId: z24.string().max(200).optional().describe("Bet entry ID. Required for both actions."),
|
|
11939
|
+
operationId: z24.string().max(200).optional().describe("Optional idempotency key for commit-constellation retries."),
|
|
11919
11940
|
// WP-465 slice ⑤: coherency retry controls for a COHERENCY_REFUSED constellation hold.
|
|
11920
11941
|
// Forwarded verbatim to agentKnowledge.facilitateEnvelope (validation lives at the gate).
|
|
11921
|
-
coherencyAcknowledgements:
|
|
11942
|
+
coherencyAcknowledgements: z24.array(coherencyAcknowledgementSchema).max(20).optional().describe(
|
|
11922
11943
|
"Per-offender acknowledgements to retry a constellation held under standard/strict coherency mode. Each: {subjectEntryId, response: 'linked' | 'accepted-fix' | 'diverged', entryId?, reason?}."
|
|
11923
11944
|
),
|
|
11924
|
-
steeringOverrideReason:
|
|
11945
|
+
steeringOverrideReason: z24.string().max(2e3).optional().describe(
|
|
11925
11946
|
"Typed override reason (>= 12 chars) to push a constellation past a coherency hold instead of acknowledging."
|
|
11926
11947
|
)
|
|
11927
11948
|
});
|
|
@@ -12174,42 +12195,42 @@ var SESSION_ACTIONS = [
|
|
|
12174
12195
|
"resume",
|
|
12175
12196
|
"commit-constellation"
|
|
12176
12197
|
];
|
|
12177
|
-
var coherencyAcknowledgementFlatSchema2 =
|
|
12178
|
-
response:
|
|
12179
|
-
entryId:
|
|
12180
|
-
reason:
|
|
12181
|
-
subjectEntryId:
|
|
12198
|
+
var coherencyAcknowledgementFlatSchema2 = z25.object({
|
|
12199
|
+
response: z25.string().max(200).describe("Acknowledgement response per offender: 'linked' | 'accepted-fix' | 'diverged'."),
|
|
12200
|
+
entryId: z25.string().max(200).optional().describe("Entry the acknowledgement links to."),
|
|
12201
|
+
reason: z25.string().max(2e3).optional().describe("Free-text justification, required for a 'diverged' response."),
|
|
12202
|
+
subjectEntryId: z25.string().max(200).optional().describe("The refused entry this acknowledgement answers.")
|
|
12182
12203
|
});
|
|
12183
|
-
var sessionSchema =
|
|
12184
|
-
action:
|
|
12204
|
+
var sessionSchema = z25.object({
|
|
12205
|
+
action: z25.enum(SESSION_ACTIONS).describe(
|
|
12185
12206
|
"'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)."
|
|
12186
12207
|
),
|
|
12187
|
-
betEntryId:
|
|
12188
|
-
operationId:
|
|
12189
|
-
coherencyAcknowledgements:
|
|
12208
|
+
betEntryId: z25.string().max(200).optional().describe("For 'resume'/'commit-constellation': bet entry ID. Required for both."),
|
|
12209
|
+
operationId: z25.string().max(200).optional().describe("For 'commit-constellation': optional idempotency key for retries."),
|
|
12210
|
+
coherencyAcknowledgements: z25.array(coherencyAcknowledgementFlatSchema2).max(20).optional().describe(
|
|
12190
12211
|
"For 'commit-constellation': per-offender acknowledgements to retry a constellation held under standard/strict coherency mode."
|
|
12191
12212
|
),
|
|
12192
|
-
steeringOverrideReason:
|
|
12213
|
+
steeringOverrideReason: z25.string().max(2e3).optional().describe(
|
|
12193
12214
|
"For 'commit-constellation': typed override reason (>= 12 chars) to push past a coherency hold instead of acknowledging."
|
|
12194
12215
|
),
|
|
12195
12216
|
// DEC-1715 (WP-753 O1a)
|
|
12196
|
-
role:
|
|
12217
|
+
role: z25.string().max(200).optional().describe(
|
|
12197
12218
|
"For 'start': role to act as this session \u2014 only needed if you hold more than one; the error lists your roles if omitted."
|
|
12198
12219
|
)
|
|
12199
12220
|
});
|
|
12200
|
-
var sessionStartVariant =
|
|
12201
|
-
action:
|
|
12221
|
+
var sessionStartVariant = z25.object({
|
|
12222
|
+
action: z25.literal("start"),
|
|
12202
12223
|
// DEC-1715 (WP-753 O1a): the role to act as this session — only needed when the person holds
|
|
12203
12224
|
// more than one role; the server refuses and lists the choices when it's required and omitted.
|
|
12204
|
-
role:
|
|
12225
|
+
role: z25.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.")
|
|
12205
12226
|
});
|
|
12206
|
-
var sessionCloseVariant =
|
|
12207
|
-
var sessionStatusVariant =
|
|
12208
|
-
var sessionWrapupReviewVariant =
|
|
12209
|
-
var sessionWrapupCommitVariant =
|
|
12210
|
-
var sessionResumeVariant = facilitateSchema.omit({ action: true }).extend({ action:
|
|
12211
|
-
var sessionCommitConstellationVariant = facilitateSchema.omit({ action: true }).extend({ action:
|
|
12212
|
-
var sessionActionUnion =
|
|
12227
|
+
var sessionCloseVariant = z25.object({ action: z25.literal("close") });
|
|
12228
|
+
var sessionStatusVariant = z25.object({ action: z25.literal("status") });
|
|
12229
|
+
var sessionWrapupReviewVariant = z25.object({ action: z25.literal("wrapup-review") });
|
|
12230
|
+
var sessionWrapupCommitVariant = z25.object({ action: z25.literal("wrapup-commit") });
|
|
12231
|
+
var sessionResumeVariant = facilitateSchema.omit({ action: true }).extend({ action: z25.literal("resume") });
|
|
12232
|
+
var sessionCommitConstellationVariant = facilitateSchema.omit({ action: true }).extend({ action: z25.literal("commit-constellation") });
|
|
12233
|
+
var sessionActionUnion = z25.discriminatedUnion("action", [
|
|
12213
12234
|
sessionStartVariant,
|
|
12214
12235
|
sessionCloseVariant,
|
|
12215
12236
|
sessionStatusVariant,
|
|
@@ -12453,10 +12474,10 @@ async function handleStatus() {
|
|
|
12453
12474
|
}
|
|
12454
12475
|
|
|
12455
12476
|
// src/tools/workspace.ts
|
|
12456
|
-
import { z as
|
|
12477
|
+
import { z as z28 } from "zod/v3";
|
|
12457
12478
|
|
|
12458
12479
|
// src/tools/health.ts
|
|
12459
|
-
import { z as
|
|
12480
|
+
import { z as z26 } from "zod/v3";
|
|
12460
12481
|
|
|
12461
12482
|
// src/lib/auditView.ts
|
|
12462
12483
|
async function buildTenantAuditView(limit) {
|
|
@@ -12801,61 +12822,61 @@ ${logLines.join("\n")}${seamSummaryText}` }],
|
|
|
12801
12822
|
};
|
|
12802
12823
|
}
|
|
12803
12824
|
var HEALTH_ACTIONS = ["check", "whoami", "status", "audit", "self-test"];
|
|
12804
|
-
var healthSchema =
|
|
12805
|
-
action:
|
|
12825
|
+
var healthSchema = z26.object({
|
|
12826
|
+
action: z26.enum(HEALTH_ACTIONS).describe(
|
|
12806
12827
|
"'check': connectivity and workspace stats. 'whoami': session identity. 'status': workspace readiness. 'audit': session audit log. 'self-test': validate all tool schemas."
|
|
12807
12828
|
),
|
|
12808
|
-
limit:
|
|
12829
|
+
limit: z26.number().min(1).max(50).default(20).optional().describe("For audit: how many recent calls to show (max 50)")
|
|
12809
12830
|
});
|
|
12810
|
-
var healthCheckOutputSchema =
|
|
12811
|
-
healthy:
|
|
12812
|
-
collections:
|
|
12813
|
-
entries:
|
|
12814
|
-
latencyMs:
|
|
12815
|
-
workspace:
|
|
12831
|
+
var healthCheckOutputSchema = z26.object({
|
|
12832
|
+
healthy: z26.boolean(),
|
|
12833
|
+
collections: z26.number(),
|
|
12834
|
+
entries: z26.number(),
|
|
12835
|
+
latencyMs: z26.number(),
|
|
12836
|
+
workspace: z26.string()
|
|
12816
12837
|
});
|
|
12817
|
-
var organisationHealthSchema =
|
|
12818
|
-
reviewed:
|
|
12819
|
-
agreements:
|
|
12820
|
-
disagreements:
|
|
12821
|
-
abstentions:
|
|
12822
|
-
agreementRate:
|
|
12823
|
-
flags:
|
|
12838
|
+
var organisationHealthSchema = z26.object({
|
|
12839
|
+
reviewed: z26.number(),
|
|
12840
|
+
agreements: z26.number(),
|
|
12841
|
+
disagreements: z26.number(),
|
|
12842
|
+
abstentions: z26.number(),
|
|
12843
|
+
agreementRate: z26.number(),
|
|
12844
|
+
flags: z26.array(z26.object({ collection: z26.string(), count: z26.number(), suggestedCollection: z26.string() }))
|
|
12824
12845
|
});
|
|
12825
|
-
var healthStatusOutputSchema =
|
|
12846
|
+
var healthStatusOutputSchema = z26.object({
|
|
12826
12847
|
// TASK-435 (C4c): `stage` deleted — the readiness stage label is no longer served.
|
|
12827
|
-
sampleTruncated:
|
|
12828
|
-
activeEntries:
|
|
12829
|
-
totalRelations:
|
|
12830
|
-
orphanedEntries:
|
|
12831
|
-
checks:
|
|
12832
|
-
gaps:
|
|
12848
|
+
sampleTruncated: z26.boolean().nullable().optional(),
|
|
12849
|
+
activeEntries: z26.number(),
|
|
12850
|
+
totalRelations: z26.number(),
|
|
12851
|
+
orphanedEntries: z26.number(),
|
|
12852
|
+
checks: z26.array(z26.object({ label: z26.string(), passed: z26.boolean(), current: z26.number(), required: z26.number() })),
|
|
12853
|
+
gaps: z26.array(z26.object({ id: z26.string(), label: z26.string(), guidance: z26.string() })),
|
|
12833
12854
|
organisationHealth: organisationHealthSchema.optional()
|
|
12834
12855
|
});
|
|
12835
|
-
var healthAuditOutputSchema =
|
|
12836
|
-
totalCalls:
|
|
12837
|
-
calls:
|
|
12838
|
-
tool:
|
|
12839
|
-
action:
|
|
12840
|
-
timestamp:
|
|
12841
|
-
durationMs:
|
|
12856
|
+
var healthAuditOutputSchema = z26.object({
|
|
12857
|
+
totalCalls: z26.number(),
|
|
12858
|
+
calls: z26.array(z26.object({
|
|
12859
|
+
tool: z26.string(),
|
|
12860
|
+
action: z26.string().optional(),
|
|
12861
|
+
timestamp: z26.string(),
|
|
12862
|
+
durationMs: z26.number().optional()
|
|
12842
12863
|
}))
|
|
12843
12864
|
});
|
|
12844
|
-
var healthWhoamiOutputSchema =
|
|
12845
|
-
workspaceId:
|
|
12846
|
-
workspaceName:
|
|
12847
|
-
scope:
|
|
12848
|
-
sessionId:
|
|
12849
|
-
oriented:
|
|
12865
|
+
var healthWhoamiOutputSchema = z26.object({
|
|
12866
|
+
workspaceId: z26.string(),
|
|
12867
|
+
workspaceName: z26.string(),
|
|
12868
|
+
scope: z26.string(),
|
|
12869
|
+
sessionId: z26.union([z26.string(), z26.null()]),
|
|
12870
|
+
oriented: z26.boolean()
|
|
12850
12871
|
});
|
|
12851
|
-
var selfTestOutputSchema =
|
|
12852
|
-
passed:
|
|
12853
|
-
failed:
|
|
12854
|
-
total:
|
|
12855
|
-
results:
|
|
12856
|
-
tool:
|
|
12857
|
-
valid:
|
|
12858
|
-
error:
|
|
12872
|
+
var selfTestOutputSchema = z26.object({
|
|
12873
|
+
passed: z26.number(),
|
|
12874
|
+
failed: z26.number(),
|
|
12875
|
+
total: z26.number(),
|
|
12876
|
+
results: z26.array(z26.object({
|
|
12877
|
+
tool: z26.string(),
|
|
12878
|
+
valid: z26.boolean(),
|
|
12879
|
+
error: z26.string().optional()
|
|
12859
12880
|
}))
|
|
12860
12881
|
});
|
|
12861
12882
|
function handleSelfTest(server) {
|
|
@@ -12906,9 +12927,9 @@ function handleSelfTest(server) {
|
|
|
12906
12927
|
}
|
|
12907
12928
|
|
|
12908
12929
|
// src/tools/usage.ts
|
|
12909
|
-
import { z as
|
|
12910
|
-
var usageSummarySchema =
|
|
12911
|
-
periodDays:
|
|
12930
|
+
import { z as z27 } from "zod/v3";
|
|
12931
|
+
var usageSummarySchema = z27.object({
|
|
12932
|
+
periodDays: z27.number().min(1).max(90).optional().describe("Number of days to look back (default 30, max 90)")
|
|
12912
12933
|
});
|
|
12913
12934
|
async function handleUsageSummary(periodDays) {
|
|
12914
12935
|
const ws = await getWorkspaceContext();
|
|
@@ -13080,35 +13101,35 @@ var WORKSPACE_ACTIONS = [
|
|
|
13080
13101
|
"proposals-respond",
|
|
13081
13102
|
"proposals-count"
|
|
13082
13103
|
];
|
|
13083
|
-
var workspaceSchema =
|
|
13084
|
-
action:
|
|
13104
|
+
var workspaceSchema = z28.object({
|
|
13105
|
+
action: z28.enum(WORKSPACE_ACTIONS).describe(
|
|
13085
13106
|
"'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)."
|
|
13086
13107
|
),
|
|
13087
|
-
limit:
|
|
13088
|
-
periodDays:
|
|
13089
|
-
status:
|
|
13090
|
-
proposalId:
|
|
13091
|
-
verdict:
|
|
13092
|
-
reason:
|
|
13108
|
+
limit: z28.number().min(1).max(50).optional().describe("For 'audit': how many recent calls to show (max 50, default 20)."),
|
|
13109
|
+
periodDays: z28.number().min(1).max(90).optional().describe("For 'usage': number of days to look back (default 30, max 90)."),
|
|
13110
|
+
status: z28.enum(["open", "approved", "objected", "expired"]).optional().describe("For 'proposals-list': filter by status (default: open)."),
|
|
13111
|
+
proposalId: z28.string().max(200).optional().describe("For 'proposals-respond': proposal ID."),
|
|
13112
|
+
verdict: z28.enum(["approve", "reject"]).optional().describe("For 'proposals-respond': approve or reject."),
|
|
13113
|
+
reason: z28.string().max(2e3).optional().describe("For 'proposals-respond': reason for the verdict (required when rejecting).")
|
|
13093
13114
|
});
|
|
13094
|
-
var workspaceCheckVariant =
|
|
13095
|
-
var workspaceWhoamiVariant =
|
|
13096
|
-
var workspaceStatusVariant =
|
|
13097
|
-
var workspaceAuditVariant =
|
|
13098
|
-
var workspaceSelfTestVariant =
|
|
13099
|
-
var workspaceUsageVariant =
|
|
13100
|
-
var workspaceProposalsListVariant =
|
|
13101
|
-
action:
|
|
13102
|
-
status:
|
|
13115
|
+
var workspaceCheckVariant = z28.object({ action: z28.literal("check") });
|
|
13116
|
+
var workspaceWhoamiVariant = z28.object({ action: z28.literal("whoami") });
|
|
13117
|
+
var workspaceStatusVariant = z28.object({ action: z28.literal("status") });
|
|
13118
|
+
var workspaceAuditVariant = z28.object({ action: z28.literal("audit"), limit: z28.number().min(1).max(50).optional().default(20) });
|
|
13119
|
+
var workspaceSelfTestVariant = z28.object({ action: z28.literal("self-test") });
|
|
13120
|
+
var workspaceUsageVariant = z28.object({ action: z28.literal("usage"), periodDays: z28.number().min(1).max(90).optional() });
|
|
13121
|
+
var workspaceProposalsListVariant = z28.object({
|
|
13122
|
+
action: z28.literal("proposals-list"),
|
|
13123
|
+
status: z28.enum(["open", "approved", "objected", "expired"]).optional()
|
|
13103
13124
|
});
|
|
13104
|
-
var workspaceProposalsRespondVariant =
|
|
13105
|
-
action:
|
|
13106
|
-
proposalId:
|
|
13107
|
-
verdict:
|
|
13108
|
-
reason:
|
|
13125
|
+
var workspaceProposalsRespondVariant = z28.object({
|
|
13126
|
+
action: z28.literal("proposals-respond"),
|
|
13127
|
+
proposalId: z28.string().max(200),
|
|
13128
|
+
verdict: z28.enum(["approve", "reject"]),
|
|
13129
|
+
reason: z28.string().max(2e3).optional()
|
|
13109
13130
|
});
|
|
13110
|
-
var workspaceProposalsCountVariant =
|
|
13111
|
-
var workspaceActionUnion =
|
|
13131
|
+
var workspaceProposalsCountVariant = z28.object({ action: z28.literal("proposals-count") });
|
|
13132
|
+
var workspaceActionUnion = z28.discriminatedUnion("action", [
|
|
13112
13133
|
workspaceCheckVariant,
|
|
13113
13134
|
workspaceWhoamiVariant,
|
|
13114
13135
|
workspaceStatusVariant,
|
|
@@ -13164,7 +13185,7 @@ function registerWorkspaceTools(server) {
|
|
|
13164
13185
|
}
|
|
13165
13186
|
|
|
13166
13187
|
// src/tools/feedback.ts
|
|
13167
|
-
import { z as
|
|
13188
|
+
import { z as z29 } from "zod/v3";
|
|
13168
13189
|
|
|
13169
13190
|
// src/lib/productFeedbackConstants.ts
|
|
13170
13191
|
var PRODUCT_FEEDBACK_CATEGORIES = ["bug", "friction", "idea", "praise", "other"];
|
|
@@ -13175,9 +13196,9 @@ var VENDOR_SETTABLE_STATUSES = PRODUCT_FEEDBACK_STATUSES.filter(
|
|
|
13175
13196
|
|
|
13176
13197
|
// src/tools/feedback.ts
|
|
13177
13198
|
var actions = ["submit", "list", "queue", "note", "group", "status"];
|
|
13178
|
-
var category =
|
|
13179
|
-
var status =
|
|
13180
|
-
var vendorStatus =
|
|
13199
|
+
var category = z29.enum(PRODUCT_FEEDBACK_CATEGORIES);
|
|
13200
|
+
var status = z29.enum(PRODUCT_FEEDBACK_STATUSES);
|
|
13201
|
+
var vendorStatus = z29.enum(VENDOR_SETTABLE_STATUSES);
|
|
13181
13202
|
var GATEWAY_MAX_STRING_BYTES = 10240;
|
|
13182
13203
|
var utf8Bytes = (value) => new TextEncoder().encode(value).length;
|
|
13183
13204
|
var fitsGatewayBytes = (value) => utf8Bytes(value) <= GATEWAY_MAX_STRING_BYTES;
|
|
@@ -13186,32 +13207,32 @@ var byteLimitMessage = (field) => ({
|
|
|
13186
13207
|
});
|
|
13187
13208
|
var MESSAGE_DISPLAY_LIMIT = 1e3;
|
|
13188
13209
|
var FULL_MESSAGE_MAX_LIMIT = 5;
|
|
13189
|
-
var feedbackSchema =
|
|
13190
|
-
action:
|
|
13191
|
-
message:
|
|
13210
|
+
var feedbackSchema = z29.object({
|
|
13211
|
+
action: z29.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."),
|
|
13212
|
+
message: z29.string().max(1e4).optional().describe("Required for submit: the product feedback text (max 10,000 chars and 10,240 UTF-8 bytes)."),
|
|
13192
13213
|
category: category.optional().describe("Submit/queue category; submit defaults to other."),
|
|
13193
|
-
command:
|
|
13194
|
-
route:
|
|
13195
|
-
client:
|
|
13196
|
-
feedbackId:
|
|
13197
|
-
feedbackIds:
|
|
13198
|
-
note:
|
|
13214
|
+
command: z29.string().max(1e3).optional().describe("Optional submit command context; argument values are scrubbed server-side."),
|
|
13215
|
+
route: z29.string().max(500).optional().describe("Optional submit route context."),
|
|
13216
|
+
client: z29.string().max(100).optional().describe("Optional submit client label."),
|
|
13217
|
+
feedbackId: z29.string().max(200).optional().describe("Required for note/status: target feedback ID."),
|
|
13218
|
+
feedbackIds: z29.array(z29.string().max(200)).max(100).optional().describe("Required for group: 1\u2013100 target feedback IDs."),
|
|
13219
|
+
note: z29.string().max(4e3).optional().describe("Required for note: replacement triage note (max 10,240 UTF-8 bytes)."),
|
|
13199
13220
|
status: status.optional().describe("list/queue filter (any status, including 'screening'); the status action's required target value excludes 'screening' (system-only)."),
|
|
13200
|
-
groupId:
|
|
13201
|
-
workspaceId:
|
|
13202
|
-
since:
|
|
13203
|
-
before:
|
|
13204
|
-
limit:
|
|
13205
|
-
cursor:
|
|
13206
|
-
full:
|
|
13221
|
+
groupId: z29.string().min(1).max(200).nullable().optional().describe("Group filter, or required group destination; null explicitly clears grouping."),
|
|
13222
|
+
workspaceId: z29.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."),
|
|
13223
|
+
since: z29.number().optional().describe("Queue-only lower createdAt window bound (inclusive) in epoch milliseconds."),
|
|
13224
|
+
before: z29.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."),
|
|
13225
|
+
limit: z29.number().int().min(1).max(100).optional().describe("list/queue row limit, default 50, maximum 100."),
|
|
13226
|
+
cursor: z29.string().max(2e3).optional().describe("Opaque pagination cursor from a previous list/queue response (continueCursor); omit for the first page."),
|
|
13227
|
+
full: z29.boolean().optional().describe(`list/queue only: return untruncated messages; allowed only when limit <= ${FULL_MESSAGE_MAX_LIMIT}.`)
|
|
13207
13228
|
});
|
|
13208
|
-
var union =
|
|
13209
|
-
|
|
13210
|
-
|
|
13211
|
-
|
|
13212
|
-
|
|
13213
|
-
|
|
13214
|
-
|
|
13229
|
+
var union = z29.discriminatedUnion("action", [
|
|
13230
|
+
z29.object({ action: z29.literal("submit"), message: z29.string().min(1).max(1e4).refine(fitsGatewayBytes, byteLimitMessage("message")), category: category.optional(), command: z29.string().max(1e3).optional(), route: z29.string().max(500).optional(), client: z29.string().max(100).optional() }),
|
|
13231
|
+
z29.object({ action: z29.literal("list"), status: status.optional(), limit: z29.number().int().min(1).max(100).optional(), cursor: z29.string().max(2e3).optional(), full: z29.boolean().optional() }),
|
|
13232
|
+
z29.object({ action: z29.literal("queue"), status: status.optional(), category: category.optional(), groupId: z29.string().min(1).max(200).optional(), workspaceId: z29.string().max(200).optional(), since: z29.number().optional(), before: z29.number().optional(), limit: z29.number().int().min(1).max(100).optional(), cursor: z29.string().max(2e3).optional(), full: z29.boolean().optional() }),
|
|
13233
|
+
z29.object({ action: z29.literal("note"), feedbackId: z29.string().min(1).max(200), note: z29.string().max(4e3).refine(fitsGatewayBytes, byteLimitMessage("note")) }),
|
|
13234
|
+
z29.object({ action: z29.literal("group"), feedbackIds: z29.array(z29.string().min(1).max(200)).min(1).max(100), groupId: z29.string().min(1).max(200).nullable() }),
|
|
13235
|
+
z29.object({ action: z29.literal("status"), feedbackId: z29.string().min(1).max(200), status: vendorStatus })
|
|
13215
13236
|
]);
|
|
13216
13237
|
var specs = {
|
|
13217
13238
|
submit: { params: ["message", "category", "command", "route", "client"], description: "message is required; category defaults to other." },
|
|
@@ -13338,34 +13359,34 @@ function registerFeedbackTool(server) {
|
|
|
13338
13359
|
}
|
|
13339
13360
|
|
|
13340
13361
|
// src/tools/shape.ts
|
|
13341
|
-
import { z as
|
|
13362
|
+
import { z as z30 } from "zod/v3";
|
|
13342
13363
|
var SHAPE_ACTIONS = ["list", "show", "agree", "dismiss"];
|
|
13343
13364
|
var LIST_DISPOSITIONS = ["pending", "agreed", "dismissed", "expired"];
|
|
13344
13365
|
var LIST_OUTCOMES = ["not_candidate", "atomic", "compound", "unavailable"];
|
|
13345
|
-
var shapeSchema =
|
|
13346
|
-
action:
|
|
13366
|
+
var shapeSchema = z30.object({
|
|
13367
|
+
action: z30.enum(SHAPE_ACTIONS).describe(
|
|
13347
13368
|
"'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."
|
|
13348
13369
|
),
|
|
13349
|
-
disposition:
|
|
13370
|
+
disposition: z30.enum(LIST_DISPOSITIONS).optional().describe(
|
|
13350
13371
|
"For 'list': filter by disposition. Omitting both disposition and outcome defaults to the actionable set (disposition:pending, outcome:compound)."
|
|
13351
13372
|
),
|
|
13352
|
-
outcome:
|
|
13373
|
+
outcome: z30.enum(LIST_OUTCOMES).optional().describe(
|
|
13353
13374
|
"For 'list': filter by outcome. Omitting both disposition and outcome defaults to the actionable set (disposition:pending, outcome:compound)."
|
|
13354
13375
|
),
|
|
13355
|
-
limit:
|
|
13356
|
-
rowId:
|
|
13357
|
-
reason:
|
|
13376
|
+
limit: z30.number().min(1).max(200).optional().describe("For 'list': max rows (default 50, max 200)."),
|
|
13377
|
+
rowId: z30.string().max(200).optional().describe("For 'show'/'agree'/'dismiss': the advisory row id."),
|
|
13378
|
+
reason: z30.string().max(1e3).optional().describe("For 'agree'/'dismiss': optional reason (capped at 1000 chars).")
|
|
13358
13379
|
});
|
|
13359
|
-
var shapeListVariant =
|
|
13360
|
-
action:
|
|
13361
|
-
disposition:
|
|
13362
|
-
outcome:
|
|
13363
|
-
limit:
|
|
13380
|
+
var shapeListVariant = z30.object({
|
|
13381
|
+
action: z30.literal("list"),
|
|
13382
|
+
disposition: z30.enum(LIST_DISPOSITIONS).optional(),
|
|
13383
|
+
outcome: z30.enum(LIST_OUTCOMES).optional(),
|
|
13384
|
+
limit: z30.number().min(1).max(200).optional()
|
|
13364
13385
|
});
|
|
13365
|
-
var shapeShowVariant =
|
|
13366
|
-
var shapeAgreeVariant =
|
|
13367
|
-
var shapeDismissVariant =
|
|
13368
|
-
var shapeActionUnion =
|
|
13386
|
+
var shapeShowVariant = z30.object({ action: z30.literal("show"), rowId: z30.string().max(200) });
|
|
13387
|
+
var shapeAgreeVariant = z30.object({ action: z30.literal("agree"), rowId: z30.string().max(200), reason: z30.string().max(1e3).optional() });
|
|
13388
|
+
var shapeDismissVariant = z30.object({ action: z30.literal("dismiss"), rowId: z30.string().max(200), reason: z30.string().max(1e3).optional() });
|
|
13389
|
+
var shapeActionUnion = z30.discriminatedUnion("action", [
|
|
13369
13390
|
shapeListVariant,
|
|
13370
13391
|
shapeShowVariant,
|
|
13371
13392
|
shapeAgreeVariant,
|
|
@@ -13512,26 +13533,26 @@ function registerShapeTools(server) {
|
|
|
13512
13533
|
}
|
|
13513
13534
|
|
|
13514
13535
|
// src/tools/question.ts
|
|
13515
|
-
import { z as
|
|
13536
|
+
import { z as z31 } from "zod/v3";
|
|
13516
13537
|
var QUESTION_ACTIONS = ["create", "assign", "answer", "force-close", "list"];
|
|
13517
|
-
var questionSchema =
|
|
13518
|
-
action:
|
|
13538
|
+
var questionSchema = z31.object({
|
|
13539
|
+
action: z31.enum(QUESTION_ACTIONS).describe(
|
|
13519
13540
|
"'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)."
|
|
13520
13541
|
),
|
|
13521
|
-
entryId:
|
|
13522
|
-
text:
|
|
13523
|
-
blocks:
|
|
13524
|
-
toRole:
|
|
13525
|
-
reason:
|
|
13526
|
-
answerEntryId:
|
|
13527
|
-
mine:
|
|
13542
|
+
entryId: z31.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'."),
|
|
13543
|
+
text: z31.string().max(5e3).optional().describe("'create': the question text. 'answer': the answer text (mutually exclusive with answerEntryId, max 2000 chars)."),
|
|
13544
|
+
blocks: z31.array(z31.string().max(200)).max(50).optional().describe("'create': entry ids this question is blocking (repeatable)."),
|
|
13545
|
+
toRole: z31.string().max(200).optional().describe("'assign': reassign to this role (human ROL-nnn form or a raw entry id) \u2014 required."),
|
|
13546
|
+
reason: z31.string().max(2e3).optional().describe("'force-close': required reason."),
|
|
13547
|
+
answerEntryId: z31.string().max(200).optional().describe("'answer': point at an already-written entry instead of supplying text (mutually exclusive with text)."),
|
|
13548
|
+
mine: z31.boolean().optional().describe("'list': true for arm C (every question YOU asked, every status). Omit/false for the ack-gate view (what you owe).")
|
|
13528
13549
|
});
|
|
13529
|
-
var createVariant =
|
|
13530
|
-
var assignVariant =
|
|
13531
|
-
var answerVariant =
|
|
13532
|
-
var forceCloseVariant =
|
|
13533
|
-
var listVariant =
|
|
13534
|
-
var questionActionUnion =
|
|
13550
|
+
var createVariant = z31.object({ action: z31.literal("create"), text: z31.string().min(1).max(5e3), blocks: z31.array(z31.string().max(200)).max(50).optional() });
|
|
13551
|
+
var assignVariant = z31.object({ action: z31.literal("assign"), entryId: z31.string().max(200), toRole: z31.string().max(200).min(1) });
|
|
13552
|
+
var answerVariant = z31.object({ action: z31.literal("answer"), entryId: z31.string().max(200), text: z31.string().max(2e3).optional(), answerEntryId: z31.string().max(200).optional() });
|
|
13553
|
+
var forceCloseVariant = z31.object({ action: z31.literal("force-close"), entryId: z31.string().max(200), reason: z31.string().min(1).max(2e3) });
|
|
13554
|
+
var listVariant = z31.object({ action: z31.literal("list"), mine: z31.boolean().optional() });
|
|
13555
|
+
var questionActionUnion = z31.discriminatedUnion("action", [
|
|
13535
13556
|
createVariant,
|
|
13536
13557
|
assignVariant,
|
|
13537
13558
|
answerVariant,
|
|
@@ -13686,23 +13707,23 @@ function registerQuestionTools(server) {
|
|
|
13686
13707
|
}
|
|
13687
13708
|
|
|
13688
13709
|
// src/tools/role.ts
|
|
13689
|
-
import { z as
|
|
13710
|
+
import { z as z32 } from "zod/v3";
|
|
13690
13711
|
var ROLE_ACTIONS = ["accountable"];
|
|
13691
|
-
var roleSchema =
|
|
13692
|
-
action:
|
|
13693
|
-
roleId:
|
|
13694
|
-
canonicalKey:
|
|
13695
|
-
limit:
|
|
13696
|
-
cursor:
|
|
13712
|
+
var roleSchema = z32.object({
|
|
13713
|
+
action: z32.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."),
|
|
13714
|
+
roleId: z32.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'."),
|
|
13715
|
+
canonicalKey: z32.string().max(200).optional().describe("'accountable': narrow to one kind (e.g. objective, key_result, tension)."),
|
|
13716
|
+
limit: z32.number().int().positive().max(200).optional().describe("'accountable': max explicit-list rows per page (default and maximum 200)."),
|
|
13717
|
+
cursor: z32.number().optional().describe("'accountable': continue the explicit list from an earlier truncated page's nextCursor.")
|
|
13697
13718
|
});
|
|
13698
|
-
var accountableVariant =
|
|
13699
|
-
action:
|
|
13700
|
-
roleId:
|
|
13701
|
-
canonicalKey:
|
|
13702
|
-
limit:
|
|
13703
|
-
cursor:
|
|
13719
|
+
var accountableVariant = z32.object({
|
|
13720
|
+
action: z32.literal("accountable"),
|
|
13721
|
+
roleId: z32.string().max(200),
|
|
13722
|
+
canonicalKey: z32.string().max(200).optional(),
|
|
13723
|
+
limit: z32.number().int().positive().max(200).optional(),
|
|
13724
|
+
cursor: z32.number().optional()
|
|
13704
13725
|
});
|
|
13705
|
-
var roleActionUnion =
|
|
13726
|
+
var roleActionUnion = z32.discriminatedUnion("action", [accountableVariant]);
|
|
13706
13727
|
var ROLE_ACTION_SPECS = {
|
|
13707
13728
|
accountable: { params: ["roleId", "canonicalKey", "limit", "cursor"], description: "roleId is required; canonicalKey/limit/cursor are optional." }
|
|
13708
13729
|
};
|
|
@@ -13776,49 +13797,49 @@ function registerRoleTools(server) {
|
|
|
13776
13797
|
}
|
|
13777
13798
|
|
|
13778
13799
|
// src/tools/outcome.ts
|
|
13779
|
-
import { z as
|
|
13800
|
+
import { z as z33 } from "zod/v3";
|
|
13780
13801
|
var OUTCOME_ACTIONS = ["record", "list", "show"];
|
|
13781
13802
|
var READING_KINDS = ["measurement", "estimate", "correction"];
|
|
13782
|
-
var outcomeSchema =
|
|
13783
|
-
action:
|
|
13803
|
+
var outcomeSchema = z33.object({
|
|
13804
|
+
action: z33.enum(OUTCOME_ACTIONS).describe(
|
|
13784
13805
|
"'record': record a reading (evidence, not a verdict). 'list': list readings, newest first. 'show': the derived view \u2014 current, progress, pace, staleness, recorded completion."
|
|
13785
13806
|
),
|
|
13786
|
-
entryId:
|
|
13807
|
+
entryId: z33.string().max(200).optional().describe("The key result (or other outcome-bearing) entry, by its chain id. Required for all three actions."),
|
|
13787
13808
|
// PR #858 review round 3 (Codex P2, PRRT_kwDORS4ils6gXHj9): a JSON number that overflows to
|
|
13788
13809
|
// `Infinity` (e.g. `1e400`) parses fine in JS and passes a plain `z.number()`, but
|
|
13789
13810
|
// `callGateway()` serializes it with `JSON.stringify`, which turns `Infinity` into `null` —
|
|
13790
13811
|
// the backend's `v.number()` validator then rejects a call this tool's own schema accepted.
|
|
13791
13812
|
// `.finite()` rejects it here, matching the explicit finite-value checks the CLI/other outcome
|
|
13792
13813
|
// entry surfaces already use.
|
|
13793
|
-
value:
|
|
13794
|
-
valueText:
|
|
13795
|
-
asOf:
|
|
13796
|
-
kind:
|
|
13797
|
-
correctsReadingId:
|
|
13798
|
-
recordedByRoleId:
|
|
13799
|
-
note:
|
|
13800
|
-
source:
|
|
13801
|
-
limit:
|
|
13814
|
+
value: z33.number().finite().optional().describe("'record': the measured value. Required for 'record'."),
|
|
13815
|
+
valueText: z33.string().max(500).optional().describe("'record': verbatim as-reported form when the source was not clean, e.g. '~62%'. Display only."),
|
|
13816
|
+
asOf: z33.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."),
|
|
13817
|
+
kind: z33.enum(READING_KINDS).optional().describe("'record': measurement | estimate | correction (default: measurement)."),
|
|
13818
|
+
correctsReadingId: z33.string().max(200).optional().describe("'record': required with kind='correction' \u2014 the reading id this replaces. Refused if that row is already superseded."),
|
|
13819
|
+
recordedByRoleId: z33.string().max(200).optional().describe("'record': the accountable role (default: the entry's reporterRoleId, then its owning role)."),
|
|
13820
|
+
note: z33.string().max(2e3).optional().describe("'record': free-text note recorded with the reading."),
|
|
13821
|
+
source: z33.string().max(500).optional().describe("'record': where the number came from \u2014 a dashboard name, a query, a URL."),
|
|
13822
|
+
limit: z33.number().int().positive().max(200).optional().describe("'list': max rows to return (default and maximum 200).")
|
|
13802
13823
|
});
|
|
13803
|
-
var recordVariant =
|
|
13804
|
-
action:
|
|
13805
|
-
entryId:
|
|
13806
|
-
value:
|
|
13807
|
-
valueText:
|
|
13808
|
-
asOf:
|
|
13809
|
-
kind:
|
|
13810
|
-
correctsReadingId:
|
|
13811
|
-
recordedByRoleId:
|
|
13812
|
-
note:
|
|
13813
|
-
source:
|
|
13824
|
+
var recordVariant = z33.object({
|
|
13825
|
+
action: z33.literal("record"),
|
|
13826
|
+
entryId: z33.string().max(200),
|
|
13827
|
+
value: z33.number().finite(),
|
|
13828
|
+
valueText: z33.string().max(500).optional(),
|
|
13829
|
+
asOf: z33.string().max(64).optional(),
|
|
13830
|
+
kind: z33.enum(READING_KINDS).optional(),
|
|
13831
|
+
correctsReadingId: z33.string().max(200).optional(),
|
|
13832
|
+
recordedByRoleId: z33.string().max(200).optional(),
|
|
13833
|
+
note: z33.string().max(2e3).optional(),
|
|
13834
|
+
source: z33.string().max(500).optional()
|
|
13814
13835
|
});
|
|
13815
|
-
var listVariant2 =
|
|
13816
|
-
action:
|
|
13817
|
-
entryId:
|
|
13818
|
-
limit:
|
|
13836
|
+
var listVariant2 = z33.object({
|
|
13837
|
+
action: z33.literal("list"),
|
|
13838
|
+
entryId: z33.string().max(200),
|
|
13839
|
+
limit: z33.number().int().positive().max(200).optional()
|
|
13819
13840
|
});
|
|
13820
|
-
var showVariant =
|
|
13821
|
-
var outcomeActionUnion =
|
|
13841
|
+
var showVariant = z33.object({ action: z33.literal("show"), entryId: z33.string().max(200) });
|
|
13842
|
+
var outcomeActionUnion = z33.discriminatedUnion("action", [recordVariant, listVariant2, showVariant]);
|
|
13822
13843
|
var OUTCOME_ACTION_SPECS = {
|
|
13823
13844
|
record: {
|
|
13824
13845
|
params: ["entryId", "value", "valueText", "asOf", "kind", "correctsReadingId", "recordedByRoleId", "note", "source"],
|
|
@@ -14029,7 +14050,7 @@ var AGENT_CHEATSHEET = `# Product Brain \u2014 Agent Cheatsheet
|
|
|
14029
14050
|
|---|---|---|
|
|
14030
14051
|
| \`orient\` | Workspace context, governance, active work packages, session start | \`action\`: start, task |
|
|
14031
14052
|
| \`capture\` | Create entry | \`action\`: capture |
|
|
14032
|
-
| \`entries\` | Read and write entries | \`action\`: list, get, batch, search, update, commit, history, move, verify, preflight |
|
|
14053
|
+
| \`entries\` | Read and write entries | \`action\`: list, get, batch, search, update, commit, history, move, verify, preflight, still-true |
|
|
14033
14054
|
| \`relations\` | Link entries, dismiss suggestions and delete links, find and suggest | \`action\`: create, batch-create, dismiss, delete, find, suggest |
|
|
14034
14055
|
| \`context\` | Gather related knowledge, last-verified brief | \`action\`: gather, build, neighborhood, changes, chain, cross-cut, incremental, brief, last-verified-brief |
|
|
14035
14056
|
| \`collections\` | Browse, describe, audit and export collections; manage labels | \`action\`: list, update, describe, audit, export, label-* |
|
|
@@ -14554,12 +14575,12 @@ ${entry.labels.map((l) => `- ${l.name ?? l.slug}`).join("\n")}`);
|
|
|
14554
14575
|
}
|
|
14555
14576
|
|
|
14556
14577
|
// src/prompts/index.ts
|
|
14557
|
-
import { z as
|
|
14578
|
+
import { z as z34 } from "zod/v3";
|
|
14558
14579
|
function registerPrompts(server) {
|
|
14559
14580
|
server.prompt(
|
|
14560
14581
|
"review-against-rules",
|
|
14561
14582
|
"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.",
|
|
14562
|
-
{ domain:
|
|
14583
|
+
{ domain: z34.string().describe("Business rule domain (e.g. 'Identity & Access', 'Governance & Decision-Making')") },
|
|
14563
14584
|
async ({ domain }) => {
|
|
14564
14585
|
const entries = await kernelQuery("chain.listEntries", { collectionSlug: "business-rules" });
|
|
14565
14586
|
const rules = entries.filter((e) => e.data?.domain === domain);
|
|
@@ -14612,7 +14633,7 @@ Provide a structured review with a compliance status for each rule (COMPLIANT /
|
|
|
14612
14633
|
server.prompt(
|
|
14613
14634
|
"name-check",
|
|
14614
14635
|
"Check variable names, field names, or API names against the glossary for terminology alignment. Flags drift from canonical terms.",
|
|
14615
|
-
{ names:
|
|
14636
|
+
{ names: z34.string().describe("Comma-separated list of names to check (e.g. 'vendor_id, compliance_level, formulator_type')") },
|
|
14616
14637
|
async ({ names }) => {
|
|
14617
14638
|
const terms = await kernelQuery("chain.listEntries", { collectionSlug: "glossary" });
|
|
14618
14639
|
const glossaryContext = terms.map(
|
|
@@ -14648,7 +14669,7 @@ Format as a table: Name | Status | Canonical Form | Action Needed`
|
|
|
14648
14669
|
server.prompt(
|
|
14649
14670
|
"draft-decision-record",
|
|
14650
14671
|
"Draft a structured decision record from a description of what was decided. Includes context from recent decisions and relevant rules.",
|
|
14651
|
-
{ context:
|
|
14672
|
+
{ context: z34.string().describe("Description of the decision (e.g. 'We decided to use MRSL v3.1 as the conformance baseline because...')") },
|
|
14652
14673
|
async ({ context }) => {
|
|
14653
14674
|
const recentDecisions = await kernelQuery("chain.listEntries", { collectionSlug: "decisions" });
|
|
14654
14675
|
const sorted = [...recentDecisions].sort((a, b) => (b.data?.date ?? "") > (a.data?.date ?? "") ? 1 : -1).slice(0, 5);
|
|
@@ -14686,8 +14707,8 @@ After drafting, I can log it using the capture tool with collection "decisions".
|
|
|
14686
14707
|
"draft-rule-from-context",
|
|
14687
14708
|
"Draft a new business rule from an observation or discovery made while coding. Fetches existing rules for the domain to ensure consistency.",
|
|
14688
14709
|
{
|
|
14689
|
-
observation:
|
|
14690
|
-
domain:
|
|
14710
|
+
observation: z34.string().describe("What you observed or discovered (e.g. 'Suppliers can have multiple org types in Gateway')"),
|
|
14711
|
+
domain: z34.string().describe("Which domain this rule belongs to (e.g. 'Governance & Decision-Making')")
|
|
14691
14712
|
},
|
|
14692
14713
|
async ({ observation, domain }) => {
|
|
14693
14714
|
const allRules = await kernelQuery("chain.listEntries", { collectionSlug: "business-rules" });
|
|
@@ -14846,4 +14867,4 @@ export {
|
|
|
14846
14867
|
createProductBrainServer,
|
|
14847
14868
|
initFeatureFlags
|
|
14848
14869
|
};
|
|
14849
|
-
//# sourceMappingURL=chunk-
|
|
14870
|
+
//# sourceMappingURL=chunk-NHVFNXUV.js.map
|