@qodeca/xezar 0.13.0 → 0.14.0
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/README.md +72 -39
- package/dist/agent-config/account-identity.d.ts +2 -8
- package/dist/agent-config/account-identity.js +54 -10
- package/dist/agent-config/account-identity.js.map +1 -1
- package/dist/agent-config/catalog.d.ts +49 -7
- package/dist/agent-config/catalog.js +107 -0
- package/dist/agent-config/catalog.js.map +1 -1
- package/dist/agent-config/model-settings/pi.d.ts +12 -6
- package/dist/agent-config/model-settings/pi.js +12 -6
- package/dist/agent-config/model-settings/pi.js.map +1 -1
- package/dist/agent-config/seed.js +10 -0
- package/dist/agent-config/seed.js.map +1 -1
- package/dist/contract/github.d.ts +15 -0
- package/dist/contract/index.d.ts +9 -0
- package/dist/contract/index.js +1527 -895
- package/dist/contract/mcp-api-reference.d.ts +174 -0
- package/dist/contract/mcp-audit.d.ts +103 -0
- package/dist/contract/mcp-discovery.d.ts +257 -0
- package/dist/contract/mcp-event-catalog.d.ts +121 -0
- package/dist/contract/mcp-event-catalog.test.d.ts +1 -0
- package/dist/contract/mcp-idempotency.d.ts +200 -0
- package/dist/contract/mcp-journal.d.ts +268 -0
- package/dist/contract/mcp-leader.d.ts +88 -0
- package/dist/contract/mcp-ownership.d.ts +78 -0
- package/dist/contract/mcp-versioning.d.ts +139 -0
- package/dist/contract/runs.d.ts +81 -0
- package/dist/core/agent-profiles.d.ts +15 -4
- package/dist/core/agent-profiles.js +22 -8
- package/dist/core/agent-profiles.js.map +1 -1
- package/dist/core/opencode-server-runner.js +71 -11
- package/dist/core/opencode-server-runner.js.map +1 -1
- package/dist/core/secret-redaction.d.ts +7 -1
- package/dist/core/secret-redaction.js +44 -10
- package/dist/core/secret-redaction.js.map +1 -1
- package/dist/index.js +138 -27
- package/dist/index.js.map +1 -1
- package/dist/machine-identity.d.ts +66 -0
- package/dist/machine-identity.js +96 -0
- package/dist/machine-identity.js.map +1 -0
- package/dist/mcp/adapters/claude-code.d.ts +41 -0
- package/dist/mcp/adapters/claude-code.js +40 -0
- package/dist/mcp/adapters/claude-code.js.map +1 -0
- package/dist/mcp/adapters/codex.d.ts +140 -0
- package/dist/mcp/adapters/codex.js +323 -0
- package/dist/mcp/adapters/codex.js.map +1 -0
- package/dist/mcp/adapters/opencode.d.ts +148 -0
- package/dist/mcp/adapters/opencode.js +528 -0
- package/dist/mcp/adapters/opencode.js.map +1 -0
- package/dist/mcp/adapters/pi-link.d.ts +102 -0
- package/dist/mcp/adapters/pi-link.js +235 -0
- package/dist/mcp/adapters/pi-link.js.map +1 -0
- package/dist/mcp/adapters/pi.d.ts +188 -0
- package/dist/mcp/adapters/pi.js +418 -0
- package/dist/mcp/adapters/pi.js.map +1 -0
- package/dist/mcp/api-reference.d.ts +26 -0
- package/dist/mcp/api-reference.js +133 -0
- package/dist/mcp/api-reference.js.map +1 -0
- package/dist/mcp/audit-trail.d.ts +162 -0
- package/dist/mcp/audit-trail.js +306 -0
- package/dist/mcp/audit-trail.js.map +1 -0
- package/dist/mcp/bridge.d.ts +81 -0
- package/dist/mcp/bridge.js +407 -0
- package/dist/mcp/bridge.js.map +1 -0
- package/dist/mcp/connection-file.d.ts +49 -0
- package/dist/mcp/connection-file.js +63 -0
- package/dist/mcp/connection-file.js.map +1 -0
- package/dist/mcp/echo-guard.d.ts +94 -0
- package/dist/mcp/echo-guard.js +160 -0
- package/dist/mcp/echo-guard.js.map +1 -0
- package/dist/mcp/event-catalog.d.ts +120 -0
- package/dist/mcp/event-catalog.js +306 -0
- package/dist/mcp/event-catalog.js.map +1 -0
- package/dist/mcp/event-controller.d.ts +230 -0
- package/dist/mcp/event-controller.js +596 -0
- package/dist/mcp/event-controller.js.map +1 -0
- package/dist/mcp/event-journal.d.ts +57 -0
- package/dist/mcp/event-journal.js +423 -0
- package/dist/mcp/event-journal.js.map +1 -0
- package/dist/mcp/index.d.ts +63 -0
- package/dist/mcp/index.js +386 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/ipc.d.ts +202 -0
- package/dist/mcp/ipc.js +206 -0
- package/dist/mcp/ipc.js.map +1 -0
- package/dist/mcp/leader-delivery.d.ts +119 -0
- package/dist/mcp/leader-delivery.js +450 -0
- package/dist/mcp/leader-delivery.js.map +1 -0
- package/dist/mcp/operation-receipts.d.ts +210 -0
- package/dist/mcp/operation-receipts.js +723 -0
- package/dist/mcp/operation-receipts.js.map +1 -0
- package/dist/mcp/project-catalogs.d.ts +23 -0
- package/dist/mcp/project-catalogs.js +25 -0
- package/dist/mcp/project-catalogs.js.map +1 -0
- package/dist/mcp/project-leaders.d.ts +26 -0
- package/dist/mcp/project-leaders.js +17 -0
- package/dist/mcp/project-leaders.js.map +1 -0
- package/dist/mcp/protocol.d.ts +50 -0
- package/dist/mcp/protocol.js +47 -0
- package/dist/mcp/protocol.js.map +1 -0
- package/dist/mcp/reconnect.d.ts +297 -0
- package/dist/mcp/reconnect.js +465 -0
- package/dist/mcp/reconnect.js.map +1 -0
- package/dist/mcp/resource-ownership.d.ts +228 -0
- package/dist/mcp/resource-ownership.js +390 -0
- package/dist/mcp/resource-ownership.js.map +1 -0
- package/dist/mcp/service-adapter.d.ts +16488 -0
- package/dist/mcp/service-adapter.js +148 -0
- package/dist/mcp/service-adapter.js.map +1 -0
- package/dist/mcp/service.d.ts +83 -0
- package/dist/mcp/service.js +233 -0
- package/dist/mcp/service.js.map +1 -0
- package/dist/mcp/session-binding.d.ts +105 -0
- package/dist/mcp/session-binding.js +163 -0
- package/dist/mcp/session-binding.js.map +1 -0
- package/dist/mcp/stale-write.d.ts +145 -0
- package/dist/mcp/stale-write.js +219 -0
- package/dist/mcp/stale-write.js.map +1 -0
- package/dist/mcp/tool.d.ts +48 -0
- package/dist/mcp/tool.js +24 -0
- package/dist/mcp/tool.js.map +1 -0
- package/dist/mcp/tools/discovery.d.ts +40 -0
- package/dist/mcp/tools/discovery.js +232 -0
- package/dist/mcp/tools/discovery.js.map +1 -0
- package/dist/mcp/tools/execution-control.d.ts +171 -0
- package/dist/mcp/tools/execution-control.js +513 -0
- package/dist/mcp/tools/execution-control.js.map +1 -0
- package/dist/mcp/tools/handoff-git.d.ts +26 -0
- package/dist/mcp/tools/handoff-git.js +544 -0
- package/dist/mcp/tools/handoff-git.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +2 -0
- package/dist/mcp/tools/index.js +23 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/leader-events.d.ts +46 -0
- package/dist/mcp/tools/leader-events.js +126 -0
- package/dist/mcp/tools/leader-events.js.map +1 -0
- package/dist/mcp/tools/local-handoff.d.ts +102 -0
- package/dist/mcp/tools/local-handoff.js +306 -0
- package/dist/mcp/tools/local-handoff.js.map +1 -0
- package/dist/mcp/tools/project-config.d.ts +340 -0
- package/dist/mcp/tools/project-config.js +1075 -0
- package/dist/mcp/tools/project-config.js.map +1 -0
- package/dist/mcp/tools/results-evidence.d.ts +112 -0
- package/dist/mcp/tools/results-evidence.js +1045 -0
- package/dist/mcp/tools/results-evidence.js.map +1 -0
- package/dist/mcp/tools/task-create.d.ts +70 -0
- package/dist/mcp/tools/task-create.js +473 -0
- package/dist/mcp/tools/task-create.js.map +1 -0
- package/dist/mcp/tools/task-reads.d.ts +102 -0
- package/dist/mcp/tools/task-reads.js +689 -0
- package/dist/mcp/tools/task-reads.js.map +1 -0
- package/dist/mcp/tools/work-organisation.d.ts +2 -0
- package/dist/mcp/tools/work-organisation.js +502 -0
- package/dist/mcp/tools/work-organisation.js.map +1 -0
- package/dist/paths.d.ts +17 -7
- package/dist/paths.js +18 -8
- package/dist/paths.js.map +1 -1
- package/dist/runs/project-writer.js +76 -11
- package/dist/runs/project-writer.js.map +1 -1
- package/dist/runs/retention.d.ts +25 -2
- package/dist/runs/retention.js +63 -2
- package/dist/runs/retention.js.map +1 -1
- package/dist/server/forge/github.js +44 -0
- package/dist/server/forge/github.js.map +1 -1
- package/dist/server/forge/types.d.ts +16 -0
- package/dist/server/project-context.d.ts +81 -8
- package/dist/server/project-context.js +143 -35
- package/dist/server/project-context.js.map +1 -1
- package/dist/server/server.d.ts +1050 -53
- package/dist/server/server.js +326 -120
- package/dist/server/server.js.map +1 -1
- package/dist/server/validators.d.ts +26 -6
- package/dist/server/validators.js +17 -0
- package/dist/server/validators.js.map +1 -1
- package/dist/skills-remote.js +64 -6
- package/dist/skills-remote.js.map +1 -1
- package/dist/workflows/run.d.ts +277 -12
- package/dist/workflows/run.js +599 -79
- package/dist/workflows/run.js.map +1 -1
- package/dist/workspace/agent-profiles.d.ts +30 -3
- package/dist/workspace/agent-profiles.js +39 -4
- package/dist/workspace/agent-profiles.js.map +1 -1
- package/dist/workspace/config.js +25 -4
- package/dist/workspace/config.js.map +1 -1
- package/dist/workspace/project-owner.d.ts +210 -0
- package/dist/workspace/project-owner.js +518 -0
- package/dist/workspace/project-owner.js.map +1 -0
- package/package.json +5 -3
- package/scripts/pi-leader-extension.ts +420 -0
- package/scripts/sync-readme.mjs +83 -2
- package/web/dist/assets/{alert-dialog-BVsVcbFy.js → alert-dialog-D6rP6d39.js} +1 -1
- package/web/dist/assets/arrow-down-DMOfFIzW.js +1 -0
- package/web/dist/assets/arrow-left-C4Ec2BUg.js +1 -0
- package/web/dist/assets/{centered-state-Djgly6Ni.js → centered-state-B0ZqrPaa.js} +12 -12
- package/web/dist/assets/chevron-right-mHJ-crvn.js +1 -0
- package/web/dist/assets/{collapsible-DZ4D-DHG.js → collapsible-DchEHgUM.js} +1 -1
- package/web/dist/assets/{commit-list-B-z1JL9G.js → commit-list-BpMim1Rv.js} +1 -1
- package/web/dist/assets/{compare-variants-CdS8r8E2.js → compare-variants-D5ItQbAq.js} +1 -1
- package/web/dist/assets/{diff-BKew9rQX.js → diff-HqqZ_WDR.js} +2 -2
- package/web/dist/assets/{diff-stat-D0mc5V6Z.js → diff-stat-NsU-3ecr.js} +1 -1
- package/web/dist/assets/{diff-view-xpIcuLIC.js → diff-view-B7c11Xux.js} +1 -1
- package/web/dist/assets/{dropdown-menu-CEQziH7X.js → dropdown-menu-CtTpnyod.js} +1 -1
- package/web/dist/assets/{editable-title-BCX3T2BY.js → editable-title-BXtuGQry.js} +1 -1
- package/web/dist/assets/{ellipsis-vertical-ByVdDc4z.js → ellipsis-vertical-MHtGZSH6.js} +1 -1
- package/web/dist/assets/{file-xBSB5hXO.js → file-DKLw5SOb.js} +1 -1
- package/web/dist/assets/{folder-CldgbZ5A.js → folder-Drw6-ufH.js} +1 -1
- package/web/dist/assets/{git-toolbar-BYlnf4qf.js → git-toolbar-BQH8bORV.js} +1 -1
- package/web/dist/assets/github-ynnpKFCJ.js +1 -0
- package/web/dist/assets/{image-preview-Cv5mZr0n.js → image-preview-DLhMN_R9.js} +1 -1
- package/web/dist/assets/index-BEsrNdXt.js +29 -0
- package/web/dist/assets/index-Da8DOBau.css +2 -0
- package/web/dist/assets/{markdown-CgEEE2ND.js → markdown-q365eN6Y.js} +1 -1
- package/web/dist/assets/{new-task-form-1r2bgsdD.js → new-task-form-CW-hNIWQ.js} +1 -1
- package/web/dist/assets/{pill-q-x22_ej.js → pill-B_TFulXa.js} +1 -1
- package/web/dist/assets/{project-router-VDN4jQM8.js → project-router-CLPc-ImZ.js} +1 -1
- package/web/dist/assets/{prompt-templates-BmZtCe-L.js → prompt-templates-CLc4RxyO.js} +1 -1
- package/web/dist/assets/{repo-git-C2On8SlI.js → repo-git-Is7R6-Tj.js} +1 -1
- package/web/dist/assets/{run-diff-vguEMJzh.js → run-diff-DHMvDlVo.js} +2 -2
- package/web/dist/assets/run-header-DvZJbQ8I.js +1 -0
- package/web/dist/assets/{search-x-QmhaAbg5.js → search-x-Ce2MMetu.js} +1 -1
- package/web/dist/assets/{skill-empty-hint-BrzUwByZ.js → skill-empty-hint-C_xCSvzB.js} +1 -1
- package/web/dist/assets/skills-CivqD4si.js +1 -0
- package/web/dist/assets/{sparkles-CP8QDOgX.js → sparkles-BCqPoj5g.js} +1 -1
- package/web/dist/assets/{square-terminal-CGypshSD.js → square-terminal-ikj5g-oK.js} +1 -1
- package/web/dist/assets/{tab-link-D4lFzzI1.js → tab-link-VsEjFV1Y.js} +1 -1
- package/web/dist/assets/{task-changes-6aopqAmV.js → task-changes-CH-E81-_.js} +1 -1
- package/web/dist/assets/{task-commits-u-dwaCyw.js → task-commits-DqfkMFxp.js} +1 -1
- package/web/dist/assets/{task-files-IMOZnIUK.js → task-files-D_nkHZ_a.js} +2 -2
- package/web/dist/assets/task-thread-bxQompxJ.js +9 -0
- package/web/dist/assets/{textarea-CyBCyKIk.js → textarea-xajuW1L_.js} +1 -1
- package/web/dist/assets/{thread-loading-Cuq2jchC.js → thread-loading-C3JQZbIE.js} +1 -1
- package/web/dist/assets/{trash-2-B6Dp3ZNs.js → trash-2-hJrBhpUD.js} +1 -1
- package/web/dist/assets/{triangle-alert-xBya8FUp.js → triangle-alert-D1u82y1a.js} +1 -1
- package/web/dist/assets/{upload-D6MXEB9p.js → upload-Bn6FBZ59.js} +1 -1
- package/web/dist/assets/{use-desktop-fLDKEJoB.js → use-desktop-DOIMfHfY.js} +1 -1
- package/web/dist/assets/{use-submit-shortcut-JTpNzU-u.js → use-submit-shortcut-Dj4DHTdE.js} +1 -1
- package/web/dist/assets/utils-YwBpOoRN.js +64 -0
- package/web/dist/assets/{workflows-BY3KTkFw.js → workflows-CTaAKz2m.js} +3 -3
- package/web/dist/assets/{zoomable-image-GTYwLtkS.js → zoomable-image-C1-6P3tg.js} +1 -1
- package/web/dist/index.html +23 -23
- package/web/dist/assets/arrow-down-CYgAlZtW.js +0 -1
- package/web/dist/assets/arrow-left-BOqE0a3k.js +0 -1
- package/web/dist/assets/chevron-right-Cc9BWnbN.js +0 -1
- package/web/dist/assets/github-CqGK62Lw.js +0 -1
- package/web/dist/assets/index-3nxVmdn5.css +0 -2
- package/web/dist/assets/index-qX7n11FX.js +0 -9
- package/web/dist/assets/refresh-cw-DcNCj2nu.js +0 -1
- package/web/dist/assets/run-header-DM7MiKj9.js +0 -1
- package/web/dist/assets/skills-Bj-uG_Hz.js +0 -1
- package/web/dist/assets/task-thread-CbMPmrWq.js +0 -9
- package/web/dist/assets/utils--z9hRtl3.js +0 -64
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* #284 — the MCP API reference the cockpit browses (`GET /api/v1/mcp/reference`), spec
|
|
4
|
+
* `docs/features/mcp-api-reference/mcp-api-reference-spec.md` § 11.
|
|
5
|
+
*
|
|
6
|
+
* READ-ONLY BY DESIGN. Nothing in this shape can run a tool, and nothing may be added that
|
|
7
|
+
* prepares one: executing a tool from the cockpit would make it a second leader on the project
|
|
8
|
+
* and forge the server-derived audit origin (spec § 13).
|
|
9
|
+
*/
|
|
10
|
+
/** The four hints MCP defines. A hint the tool omits is ABSENT, never defaulted here. */
|
|
11
|
+
export declare const mcpToolAnnotationsSchema: z.ZodObject<{
|
|
12
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
}, z.core.$strict>;
|
|
17
|
+
export type McpToolAnnotations = z.infer<typeof mcpToolAnnotationsSchema>;
|
|
18
|
+
/**
|
|
19
|
+
* One tool exactly as `tools/list` sends it — `toolListing()` in `packages/xezar/src/mcp/tool.ts`,
|
|
20
|
+
* key for key. Strict, so a key the wire gains that this contract does not describe fails loudly
|
|
21
|
+
* instead of being silently stripped from the page.
|
|
22
|
+
*
|
|
23
|
+
* `inputSchema` is JSON Schema and stays an opaque JSON object: describing JSON Schema in zod would
|
|
24
|
+
* be a second definition that can drift (spec § 11).
|
|
25
|
+
*/
|
|
26
|
+
export declare const mcpToolListingSchema: z.ZodObject<{
|
|
27
|
+
name: z.ZodString;
|
|
28
|
+
title: z.ZodOptional<z.ZodString>;
|
|
29
|
+
description: z.ZodString;
|
|
30
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
31
|
+
annotations: z.ZodOptional<z.ZodObject<{
|
|
32
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
36
|
+
}, z.core.$strict>>;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
export type McpToolListing = z.infer<typeof mcpToolListingSchema>;
|
|
39
|
+
/** An action the tool's schema accepts only to answer with a refusal that names its boundary. */
|
|
40
|
+
export declare const mcpRefusedActionSchema: z.ZodObject<{
|
|
41
|
+
tool: z.ZodString;
|
|
42
|
+
action: z.ZodString;
|
|
43
|
+
boundary: z.ZodString;
|
|
44
|
+
reason: z.ZodString;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
export type McpRefusedAction = z.infer<typeof mcpRefusedActionSchema>;
|
|
47
|
+
/** A listed argument that is never accepted: shown as a refusal, never as an optional input. */
|
|
48
|
+
export declare const mcpRefusedArgumentSchema: z.ZodObject<{
|
|
49
|
+
tool: z.ZodString;
|
|
50
|
+
argument: z.ZodString;
|
|
51
|
+
reason: z.ZodString;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
export type McpRefusedArgument = z.infer<typeof mcpRefusedArgumentSchema>;
|
|
54
|
+
/**
|
|
55
|
+
* How a tool takes one of the two MCP-only guards (`expectedVersion`, `operationId`) — #301.
|
|
56
|
+
*
|
|
57
|
+
* DERIVED, never declared: the server validates each performing action through the tool's OWN input
|
|
58
|
+
* schema without the guard and records the actions that validation refuses. A flat listing cannot
|
|
59
|
+
* say this (the guard is optional at its top level even where every changing action needs it), and
|
|
60
|
+
* a sentence written next to the listing is how the page once told a reviewer something false.
|
|
61
|
+
*
|
|
62
|
+
* `everyCall` is true when no call is accepted without it. `requiredBy` names the actions that need
|
|
63
|
+
* it; it is empty for a tool with no actions, which only `everyCall` describes.
|
|
64
|
+
*/
|
|
65
|
+
export declare const mcpGuardSchema: z.ZodObject<{
|
|
66
|
+
tool: z.ZodString;
|
|
67
|
+
argument: z.ZodString;
|
|
68
|
+
everyCall: z.ZodBoolean;
|
|
69
|
+
requiredBy: z.ZodArray<z.ZodString>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
export type McpGuard = z.infer<typeof mcpGuardSchema>;
|
|
72
|
+
/** Something the server deliberately does not expose, and the requirements that forbid it. */
|
|
73
|
+
export declare const mcpNotExposedSchema: z.ZodObject<{
|
|
74
|
+
what: z.ZodString;
|
|
75
|
+
detail: z.ZodString;
|
|
76
|
+
forbiddenBy: z.ZodArray<z.ZodString>;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
export type McpNotExposed = z.infer<typeof mcpNotExposedSchema>;
|
|
79
|
+
export declare const mcpApiReferenceAvailableSchema: z.ZodObject<{
|
|
80
|
+
available: z.ZodLiteral<true>;
|
|
81
|
+
xezarVersion: z.ZodString;
|
|
82
|
+
protocolVersions: z.ZodArray<z.ZodString>;
|
|
83
|
+
capabilities: z.ZodObject<{
|
|
84
|
+
tools: z.ZodObject<{
|
|
85
|
+
listChanged: z.ZodBoolean;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
89
|
+
name: z.ZodString;
|
|
90
|
+
title: z.ZodOptional<z.ZodString>;
|
|
91
|
+
description: z.ZodString;
|
|
92
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
93
|
+
annotations: z.ZodOptional<z.ZodObject<{
|
|
94
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
95
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
96
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
97
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
98
|
+
}, z.core.$strict>>;
|
|
99
|
+
}, z.core.$strict>>;
|
|
100
|
+
refusedActions: z.ZodArray<z.ZodObject<{
|
|
101
|
+
tool: z.ZodString;
|
|
102
|
+
action: z.ZodString;
|
|
103
|
+
boundary: z.ZodString;
|
|
104
|
+
reason: z.ZodString;
|
|
105
|
+
}, z.core.$strip>>;
|
|
106
|
+
refusedArguments: z.ZodArray<z.ZodObject<{
|
|
107
|
+
tool: z.ZodString;
|
|
108
|
+
argument: z.ZodString;
|
|
109
|
+
reason: z.ZodString;
|
|
110
|
+
}, z.core.$strip>>;
|
|
111
|
+
guards: z.ZodArray<z.ZodObject<{
|
|
112
|
+
tool: z.ZodString;
|
|
113
|
+
argument: z.ZodString;
|
|
114
|
+
everyCall: z.ZodBoolean;
|
|
115
|
+
requiredBy: z.ZodArray<z.ZodString>;
|
|
116
|
+
}, z.core.$strip>>;
|
|
117
|
+
notExposed: z.ZodArray<z.ZodObject<{
|
|
118
|
+
what: z.ZodString;
|
|
119
|
+
detail: z.ZodString;
|
|
120
|
+
forbiddenBy: z.ZodArray<z.ZodString>;
|
|
121
|
+
}, z.core.$strip>>;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
/**
|
|
124
|
+
* The route's answer. `available: false` carries one plain reason and is still a 200: the MCP
|
|
125
|
+
* module failing to load must never break the cockpit (N-07).
|
|
126
|
+
*/
|
|
127
|
+
export declare const mcpApiReferenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
128
|
+
available: z.ZodLiteral<true>;
|
|
129
|
+
xezarVersion: z.ZodString;
|
|
130
|
+
protocolVersions: z.ZodArray<z.ZodString>;
|
|
131
|
+
capabilities: z.ZodObject<{
|
|
132
|
+
tools: z.ZodObject<{
|
|
133
|
+
listChanged: z.ZodBoolean;
|
|
134
|
+
}, z.core.$strip>;
|
|
135
|
+
}, z.core.$strip>;
|
|
136
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
137
|
+
name: z.ZodString;
|
|
138
|
+
title: z.ZodOptional<z.ZodString>;
|
|
139
|
+
description: z.ZodString;
|
|
140
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
141
|
+
annotations: z.ZodOptional<z.ZodObject<{
|
|
142
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
143
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
144
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
145
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
146
|
+
}, z.core.$strict>>;
|
|
147
|
+
}, z.core.$strict>>;
|
|
148
|
+
refusedActions: z.ZodArray<z.ZodObject<{
|
|
149
|
+
tool: z.ZodString;
|
|
150
|
+
action: z.ZodString;
|
|
151
|
+
boundary: z.ZodString;
|
|
152
|
+
reason: z.ZodString;
|
|
153
|
+
}, z.core.$strip>>;
|
|
154
|
+
refusedArguments: z.ZodArray<z.ZodObject<{
|
|
155
|
+
tool: z.ZodString;
|
|
156
|
+
argument: z.ZodString;
|
|
157
|
+
reason: z.ZodString;
|
|
158
|
+
}, z.core.$strip>>;
|
|
159
|
+
guards: z.ZodArray<z.ZodObject<{
|
|
160
|
+
tool: z.ZodString;
|
|
161
|
+
argument: z.ZodString;
|
|
162
|
+
everyCall: z.ZodBoolean;
|
|
163
|
+
requiredBy: z.ZodArray<z.ZodString>;
|
|
164
|
+
}, z.core.$strip>>;
|
|
165
|
+
notExposed: z.ZodArray<z.ZodObject<{
|
|
166
|
+
what: z.ZodString;
|
|
167
|
+
detail: z.ZodString;
|
|
168
|
+
forbiddenBy: z.ZodArray<z.ZodString>;
|
|
169
|
+
}, z.core.$strip>>;
|
|
170
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
171
|
+
available: z.ZodLiteral<false>;
|
|
172
|
+
reason: z.ZodString;
|
|
173
|
+
}, z.core.$strip>], "available">;
|
|
174
|
+
export type McpApiReference = z.infer<typeof mcpApiReferenceSchema>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The MCP / cockpit audit record (#102) — decision D-06 § 10, requirement N-04.
|
|
4
|
+
*
|
|
5
|
+
* One line of `<project>/.local/xezar/mcp-audit.ndjson` is one `AuditEntry`. The shape is the
|
|
6
|
+
* § 10.2 field list and nothing else, and every field is an enum member, a digest or a
|
|
7
|
+
* charset-bounded identifier: there is **no free-text field at all**, so no prompt, message, diff,
|
|
8
|
+
* command output, path, email address, token or connection value has anywhere to land (§ 10.3,
|
|
9
|
+
* F-15, F-12). That is the construction D-06 chose over relying on the best-effort run-event
|
|
10
|
+
* scrubber; the service's writer adds a value check on top, it does not replace this.
|
|
11
|
+
*
|
|
12
|
+
* MUST vs SHOULD, as D-06 § 10.2 splits them and as this schema preserves them — N-04 itself only
|
|
13
|
+
* says history *should* identify these things, so nothing here upgrades a SHOULD:
|
|
14
|
+
* - MUST: `projectId` (from the trusted connection binding, never a parameter) and `origin`
|
|
15
|
+
* (server-derived from the door the request came through, never client-supplied — § 10.4).
|
|
16
|
+
* - MUST NOT: any secret, free text, absolute path or other project's identifier (§ 10.3).
|
|
17
|
+
* - SHOULD: every other field. They are required on the wire only where the writer can always
|
|
18
|
+
* supply them (`ts`, `action`, `outcome`); the rest are optional and absent when unknown.
|
|
19
|
+
* Audit RETENTION and the audit IDENTITY MODEL stay OPEN (N-04, D-06 § 10.5, D-09 U-2); nothing
|
|
20
|
+
* in this file implies either.
|
|
21
|
+
*
|
|
22
|
+
* An entry is a record of a decision, never an input to one (§ 10.4 rule 3): no field here grants
|
|
23
|
+
* anything, and no reader may consult an entry in place of a permission check.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Where an operation came from — written by the server, never read from the request (§ 10.4).
|
|
27
|
+
*
|
|
28
|
+
* **`mcp` is the only member emitted today; `ui`, `automation` and `cli` are RESERVED.** Production
|
|
29
|
+
* opens exactly one channel, `new AuditTrail({ projectId, dataDir }, { warn }).channel('mcp')`
|
|
30
|
+
* (`packages/xezar/src/mcp/index.ts:254`, the only non-test construction site at `87d9f0d` on
|
|
31
|
+
* 2026-09-12). The cockpit's HTTP routes, the automation scheduler and headless `xezar run` record
|
|
32
|
+
* nothing, so `<project>/.local/xezar/mcp-audit.ndjson` holds the leader's operations and no
|
|
33
|
+
* human's. Reading this enum as "four kinds of entry are written" is the mistake it exists to stop
|
|
34
|
+
* (#266).
|
|
35
|
+
*
|
|
36
|
+
* The enum is deliberately NOT narrowed to the one live member: the four are the intended eventual
|
|
37
|
+
* set, removing one would be a contract break, and the reserved members carry the shape the other
|
|
38
|
+
* doors will need (see `ownerGeneration` and `operationKey` below, which are already documented as
|
|
39
|
+
* absent for non-MCP origins). Wiring those three doors is
|
|
40
|
+
* [#364](https://github.com/qodeca/xezar/issues/364); D-06 § 10.6 records why it is not 0.14.0 work.
|
|
41
|
+
*/
|
|
42
|
+
export declare const auditOriginSchema: z.ZodEnum<{
|
|
43
|
+
automation: "automation";
|
|
44
|
+
cli: "cli";
|
|
45
|
+
mcp: "mcp";
|
|
46
|
+
ui: "ui";
|
|
47
|
+
}>;
|
|
48
|
+
export type AuditOrigin = z.infer<typeof auditOriginSchema>;
|
|
49
|
+
/** D-06 § 9.2's outcome vocabulary. `in-progress` is derived at lookup time and never stored. */
|
|
50
|
+
export declare const auditOutcomeSchema: z.ZodEnum<{
|
|
51
|
+
"not-applied": "not-applied";
|
|
52
|
+
ok: "ok";
|
|
53
|
+
rejected: "rejected";
|
|
54
|
+
unverified: "unverified";
|
|
55
|
+
}>;
|
|
56
|
+
export type AuditOutcome = z.infer<typeof auditOutcomeSchema>;
|
|
57
|
+
/** A dotted action id such as `runs.create` or `runs.archive`. */
|
|
58
|
+
export declare const AUDIT_ACTION_RE: RegExp;
|
|
59
|
+
/** A resource kind (`run`, `group`, `config`, `workflow`, `automation`, `worktree`, …). */
|
|
60
|
+
export declare const AUDIT_RESOURCE_KIND_RE: RegExp;
|
|
61
|
+
/**
|
|
62
|
+
* A resource id inside the bound project. The charset of D-06's `operationId` (§ 5.2): no `/`, no
|
|
63
|
+
* whitespace and no `@`, so a filesystem path, a sentence or an email address cannot be one.
|
|
64
|
+
*/
|
|
65
|
+
export declare const AUDIT_ID_RE: RegExp;
|
|
66
|
+
/** A short machine error code (`stale_version`, `operation_key_conflict`, …) — never a message. */
|
|
67
|
+
export declare const AUDIT_ERROR_CODE_RE: RegExp;
|
|
68
|
+
/** D-06 § 4.2's version token, `rev1:<kind>:<id>:<seq>:<digest12>`. Any other shape is not kept. */
|
|
69
|
+
export declare const AUDIT_VERSION_TOKEN_RE: RegExp;
|
|
70
|
+
/** `{ kind, id }` of the resource acted on — never a path, never content (§ 10.2). */
|
|
71
|
+
export declare const auditResourceSchema: z.ZodObject<{
|
|
72
|
+
kind: z.ZodString;
|
|
73
|
+
id: z.ZodString;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
export type AuditResource = z.infer<typeof auditResourceSchema>;
|
|
76
|
+
export declare const auditEntrySchema: z.ZodObject<{
|
|
77
|
+
v: z.ZodLiteral<1>;
|
|
78
|
+
ts: z.ZodISODateTime;
|
|
79
|
+
projectId: z.ZodString;
|
|
80
|
+
action: z.ZodString;
|
|
81
|
+
resource: z.ZodOptional<z.ZodObject<{
|
|
82
|
+
kind: z.ZodString;
|
|
83
|
+
id: z.ZodString;
|
|
84
|
+
}, z.core.$strip>>;
|
|
85
|
+
outcome: z.ZodEnum<{
|
|
86
|
+
"not-applied": "not-applied";
|
|
87
|
+
ok: "ok";
|
|
88
|
+
rejected: "rejected";
|
|
89
|
+
unverified: "unverified";
|
|
90
|
+
}>;
|
|
91
|
+
origin: z.ZodEnum<{
|
|
92
|
+
automation: "automation";
|
|
93
|
+
cli: "cli";
|
|
94
|
+
mcp: "mcp";
|
|
95
|
+
ui: "ui";
|
|
96
|
+
}>;
|
|
97
|
+
ownerGeneration: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
operationKey: z.ZodOptional<z.ZodString>;
|
|
99
|
+
versionToken: z.ZodOptional<z.ZodString>;
|
|
100
|
+
payloadDigest: z.ZodOptional<z.ZodString>;
|
|
101
|
+
errorCode: z.ZodOptional<z.ZodString>;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
export type AuditEntry = z.infer<typeof auditEntrySchema>;
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The MCP discovery result (#90, F-03, U-M06): what a project-bound leader may learn about the
|
|
4
|
+
* project it is bound to — its identity, its effective capabilities and limits, and which actions
|
|
5
|
+
* it can take, each unavailable one with a reason a person can act on.
|
|
6
|
+
*
|
|
7
|
+
* A FILTERED projection, never a pass-through. It is derived from the same facts `GET /health`
|
|
8
|
+
* and `GET /config` report, but `healthResponseSchema` also carries `projects` (every registered
|
|
9
|
+
* project) and `bootProject` (another project's id), and N-01 forbids revealing another project's
|
|
10
|
+
* name or existence. So this is its own schema rather than a widened or re-exported health shape,
|
|
11
|
+
* and every object in it is STRICT: a key the builder did not mean to send fails the parse
|
|
12
|
+
* instead of riding along to the model.
|
|
13
|
+
*
|
|
14
|
+
* Deliberately absent, per F-12/F-15 and the D-03 classification: account identity (email, login,
|
|
15
|
+
* organisation, plan, profile id), the git remote URL (it can embed a credential), install paths,
|
|
16
|
+
* raw CLI output, and every other project's limits or activity.
|
|
17
|
+
*/
|
|
18
|
+
/** The closed set of action areas discovery reports on. */
|
|
19
|
+
export declare const mcpDiscoveryActionIdSchema: z.ZodEnum<{
|
|
20
|
+
agent_config_write: "agent_config_write";
|
|
21
|
+
automations: "automations";
|
|
22
|
+
create_task: "create_task";
|
|
23
|
+
github: "github";
|
|
24
|
+
inbox: "inbox";
|
|
25
|
+
model_selection: "model_selection";
|
|
26
|
+
open_in_app: "open_in_app";
|
|
27
|
+
parallel_variants: "parallel_variants";
|
|
28
|
+
workspace_limits: "workspace_limits";
|
|
29
|
+
worktree_choice: "worktree_choice";
|
|
30
|
+
}>;
|
|
31
|
+
export type McpDiscoveryActionId = z.infer<typeof mcpDiscoveryActionIdSchema>;
|
|
32
|
+
/**
|
|
33
|
+
* U-M06: a usable project function, an unavailable dependency, or a read-only shared constraint.
|
|
34
|
+
* Only `available` may omit the reason — an action that cannot be taken always says why.
|
|
35
|
+
*/
|
|
36
|
+
export declare const mcpDiscoveryActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
37
|
+
id: z.ZodEnum<{
|
|
38
|
+
agent_config_write: "agent_config_write";
|
|
39
|
+
automations: "automations";
|
|
40
|
+
create_task: "create_task";
|
|
41
|
+
github: "github";
|
|
42
|
+
inbox: "inbox";
|
|
43
|
+
model_selection: "model_selection";
|
|
44
|
+
open_in_app: "open_in_app";
|
|
45
|
+
parallel_variants: "parallel_variants";
|
|
46
|
+
workspace_limits: "workspace_limits";
|
|
47
|
+
worktree_choice: "worktree_choice";
|
|
48
|
+
}>;
|
|
49
|
+
label: z.ZodString;
|
|
50
|
+
status: z.ZodLiteral<"available">;
|
|
51
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
52
|
+
id: z.ZodEnum<{
|
|
53
|
+
agent_config_write: "agent_config_write";
|
|
54
|
+
automations: "automations";
|
|
55
|
+
create_task: "create_task";
|
|
56
|
+
github: "github";
|
|
57
|
+
inbox: "inbox";
|
|
58
|
+
model_selection: "model_selection";
|
|
59
|
+
open_in_app: "open_in_app";
|
|
60
|
+
parallel_variants: "parallel_variants";
|
|
61
|
+
workspace_limits: "workspace_limits";
|
|
62
|
+
worktree_choice: "worktree_choice";
|
|
63
|
+
}>;
|
|
64
|
+
label: z.ZodString;
|
|
65
|
+
status: z.ZodLiteral<"unavailable">;
|
|
66
|
+
reason: z.ZodString;
|
|
67
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
68
|
+
id: z.ZodEnum<{
|
|
69
|
+
agent_config_write: "agent_config_write";
|
|
70
|
+
automations: "automations";
|
|
71
|
+
create_task: "create_task";
|
|
72
|
+
github: "github";
|
|
73
|
+
inbox: "inbox";
|
|
74
|
+
model_selection: "model_selection";
|
|
75
|
+
open_in_app: "open_in_app";
|
|
76
|
+
parallel_variants: "parallel_variants";
|
|
77
|
+
workspace_limits: "workspace_limits";
|
|
78
|
+
worktree_choice: "worktree_choice";
|
|
79
|
+
}>;
|
|
80
|
+
label: z.ZodString;
|
|
81
|
+
status: z.ZodLiteral<"read-only">;
|
|
82
|
+
reason: z.ZodString;
|
|
83
|
+
}, z.core.$strict>], "status">;
|
|
84
|
+
export type McpDiscoveryAction = z.infer<typeof mcpDiscoveryActionSchema>;
|
|
85
|
+
/** One coding agent: installed on this host, enabled, signed in — never WHO it is signed in as. */
|
|
86
|
+
export declare const mcpDiscoveryAgentSchema: z.ZodObject<{
|
|
87
|
+
runner: z.ZodEnum<{
|
|
88
|
+
claude: "claude";
|
|
89
|
+
codex: "codex";
|
|
90
|
+
opencode: "opencode";
|
|
91
|
+
pi: "pi";
|
|
92
|
+
}>;
|
|
93
|
+
installed: z.ZodBoolean;
|
|
94
|
+
version: z.ZodOptional<z.ZodString>;
|
|
95
|
+
enabled: z.ZodBoolean;
|
|
96
|
+
signIn: z.ZodEnum<{
|
|
97
|
+
connected: "connected";
|
|
98
|
+
disconnected: "disconnected";
|
|
99
|
+
"not-installed": "not-installed";
|
|
100
|
+
unknown: "unknown";
|
|
101
|
+
}>;
|
|
102
|
+
usable: z.ZodBoolean;
|
|
103
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
104
|
+
}, z.core.$strict>;
|
|
105
|
+
export type McpDiscoveryAgent = z.infer<typeof mcpDiscoveryAgentSchema>;
|
|
106
|
+
export declare const mcpDiscoveryToolCheckSchema: z.ZodObject<{
|
|
107
|
+
name: z.ZodEnum<{
|
|
108
|
+
gh: "gh";
|
|
109
|
+
git: "git";
|
|
110
|
+
}>;
|
|
111
|
+
available: z.ZodBoolean;
|
|
112
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
113
|
+
}, z.core.$strict>;
|
|
114
|
+
export type McpDiscoveryToolCheck = z.infer<typeof mcpDiscoveryToolCheckSchema>;
|
|
115
|
+
/**
|
|
116
|
+
* Effective limits. Workspace values are shared with every project and read-only here (D-03
|
|
117
|
+
* `safe-effective-read`); `project` is this project's own override, `null` when it inherits.
|
|
118
|
+
* Other projects' overrides and occupancy are never included.
|
|
119
|
+
*/
|
|
120
|
+
export declare const mcpDiscoveryLimitsSchema: z.ZodObject<{
|
|
121
|
+
maxParallel: z.ZodObject<{
|
|
122
|
+
effective: z.ZodNumber;
|
|
123
|
+
project: z.ZodNullable<z.ZodNumber>;
|
|
124
|
+
workspace: z.ZodNumber;
|
|
125
|
+
}, z.core.$strict>;
|
|
126
|
+
memoryLimitMb: z.ZodObject<{
|
|
127
|
+
effective: z.ZodNullable<z.ZodNumber>;
|
|
128
|
+
project: z.ZodNullable<z.ZodNumber>;
|
|
129
|
+
workspace: z.ZodNullable<z.ZodNumber>;
|
|
130
|
+
}, z.core.$strict>;
|
|
131
|
+
maxMonitoringSessions: z.ZodNumber;
|
|
132
|
+
monitoringWakeIntervalMinutes: z.ZodNullable<z.ZodNumber>;
|
|
133
|
+
autoResumeOnUsageLimit: z.ZodBoolean;
|
|
134
|
+
idleTimeoutMinutes: z.ZodNullable<z.ZodNumber>;
|
|
135
|
+
worktreeRetention: z.ZodNumber;
|
|
136
|
+
}, z.core.$strict>;
|
|
137
|
+
export type McpDiscoveryLimits = z.infer<typeof mcpDiscoveryLimitsSchema>;
|
|
138
|
+
export declare const mcpDiscoverySchema: z.ZodObject<{
|
|
139
|
+
project: z.ZodObject<{
|
|
140
|
+
id: z.ZodString;
|
|
141
|
+
name: z.ZodString;
|
|
142
|
+
root: z.ZodString;
|
|
143
|
+
}, z.core.$strict>;
|
|
144
|
+
xezarVersion: z.ZodString;
|
|
145
|
+
repository: z.ZodObject<{
|
|
146
|
+
git: z.ZodBoolean;
|
|
147
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
148
|
+
}, z.core.$strict>;
|
|
149
|
+
settings: z.ZodObject<{
|
|
150
|
+
defaultRunner: z.ZodEnum<{
|
|
151
|
+
claude: "claude";
|
|
152
|
+
codex: "codex";
|
|
153
|
+
opencode: "opencode";
|
|
154
|
+
pi: "pi";
|
|
155
|
+
}>;
|
|
156
|
+
baseBranch: z.ZodNullable<z.ZodString>;
|
|
157
|
+
modelsLocked: z.ZodBoolean;
|
|
158
|
+
}, z.core.$strict>;
|
|
159
|
+
capabilities: z.ZodObject<{
|
|
160
|
+
localHandoff: z.ZodBoolean;
|
|
161
|
+
followups: z.ZodBoolean;
|
|
162
|
+
automations: z.ZodBoolean;
|
|
163
|
+
}, z.core.$strict>;
|
|
164
|
+
agents: z.ZodArray<z.ZodObject<{
|
|
165
|
+
runner: z.ZodEnum<{
|
|
166
|
+
claude: "claude";
|
|
167
|
+
codex: "codex";
|
|
168
|
+
opencode: "opencode";
|
|
169
|
+
pi: "pi";
|
|
170
|
+
}>;
|
|
171
|
+
installed: z.ZodBoolean;
|
|
172
|
+
version: z.ZodOptional<z.ZodString>;
|
|
173
|
+
enabled: z.ZodBoolean;
|
|
174
|
+
signIn: z.ZodEnum<{
|
|
175
|
+
connected: "connected";
|
|
176
|
+
disconnected: "disconnected";
|
|
177
|
+
"not-installed": "not-installed";
|
|
178
|
+
unknown: "unknown";
|
|
179
|
+
}>;
|
|
180
|
+
usable: z.ZodBoolean;
|
|
181
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
182
|
+
}, z.core.$strict>>;
|
|
183
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
184
|
+
name: z.ZodEnum<{
|
|
185
|
+
gh: "gh";
|
|
186
|
+
git: "git";
|
|
187
|
+
}>;
|
|
188
|
+
available: z.ZodBoolean;
|
|
189
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
190
|
+
}, z.core.$strict>>;
|
|
191
|
+
limits: z.ZodObject<{
|
|
192
|
+
maxParallel: z.ZodObject<{
|
|
193
|
+
effective: z.ZodNumber;
|
|
194
|
+
project: z.ZodNullable<z.ZodNumber>;
|
|
195
|
+
workspace: z.ZodNumber;
|
|
196
|
+
}, z.core.$strict>;
|
|
197
|
+
memoryLimitMb: z.ZodObject<{
|
|
198
|
+
effective: z.ZodNullable<z.ZodNumber>;
|
|
199
|
+
project: z.ZodNullable<z.ZodNumber>;
|
|
200
|
+
workspace: z.ZodNullable<z.ZodNumber>;
|
|
201
|
+
}, z.core.$strict>;
|
|
202
|
+
maxMonitoringSessions: z.ZodNumber;
|
|
203
|
+
monitoringWakeIntervalMinutes: z.ZodNullable<z.ZodNumber>;
|
|
204
|
+
autoResumeOnUsageLimit: z.ZodBoolean;
|
|
205
|
+
idleTimeoutMinutes: z.ZodNullable<z.ZodNumber>;
|
|
206
|
+
worktreeRetention: z.ZodNumber;
|
|
207
|
+
}, z.core.$strict>;
|
|
208
|
+
actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
209
|
+
id: z.ZodEnum<{
|
|
210
|
+
agent_config_write: "agent_config_write";
|
|
211
|
+
automations: "automations";
|
|
212
|
+
create_task: "create_task";
|
|
213
|
+
github: "github";
|
|
214
|
+
inbox: "inbox";
|
|
215
|
+
model_selection: "model_selection";
|
|
216
|
+
open_in_app: "open_in_app";
|
|
217
|
+
parallel_variants: "parallel_variants";
|
|
218
|
+
workspace_limits: "workspace_limits";
|
|
219
|
+
worktree_choice: "worktree_choice";
|
|
220
|
+
}>;
|
|
221
|
+
label: z.ZodString;
|
|
222
|
+
status: z.ZodLiteral<"available">;
|
|
223
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
224
|
+
id: z.ZodEnum<{
|
|
225
|
+
agent_config_write: "agent_config_write";
|
|
226
|
+
automations: "automations";
|
|
227
|
+
create_task: "create_task";
|
|
228
|
+
github: "github";
|
|
229
|
+
inbox: "inbox";
|
|
230
|
+
model_selection: "model_selection";
|
|
231
|
+
open_in_app: "open_in_app";
|
|
232
|
+
parallel_variants: "parallel_variants";
|
|
233
|
+
workspace_limits: "workspace_limits";
|
|
234
|
+
worktree_choice: "worktree_choice";
|
|
235
|
+
}>;
|
|
236
|
+
label: z.ZodString;
|
|
237
|
+
status: z.ZodLiteral<"unavailable">;
|
|
238
|
+
reason: z.ZodString;
|
|
239
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
240
|
+
id: z.ZodEnum<{
|
|
241
|
+
agent_config_write: "agent_config_write";
|
|
242
|
+
automations: "automations";
|
|
243
|
+
create_task: "create_task";
|
|
244
|
+
github: "github";
|
|
245
|
+
inbox: "inbox";
|
|
246
|
+
model_selection: "model_selection";
|
|
247
|
+
open_in_app: "open_in_app";
|
|
248
|
+
parallel_variants: "parallel_variants";
|
|
249
|
+
workspace_limits: "workspace_limits";
|
|
250
|
+
worktree_choice: "worktree_choice";
|
|
251
|
+
}>;
|
|
252
|
+
label: z.ZodString;
|
|
253
|
+
status: z.ZodLiteral<"read-only">;
|
|
254
|
+
reason: z.ZodString;
|
|
255
|
+
}, z.core.$strict>], "status">>;
|
|
256
|
+
}, z.core.$strict>;
|
|
257
|
+
export type McpDiscovery = z.infer<typeof mcpDiscoverySchema>;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The significant-event catalog E-01–E-06 (#104) — the wire half: which `kind` a journal row may
|
|
4
|
+
* carry and which catalog `category` each kind belongs to. The emitter that derives the rows lives
|
|
5
|
+
* in `packages/xezar/src/mcp/event-catalog.ts`; the journal they land in is `mcp-journal.ts`.
|
|
6
|
+
*
|
|
7
|
+
* The catalog itself is AGREED and closed (requirements § 6, restated by D-05 § 1): this file adds,
|
|
8
|
+
* removes and reinterprets no category. `kind` is D-05 § 6.3's finer machine label under a
|
|
9
|
+
* category, open for additive growth, so a consumer that meets an unknown kind still has the
|
|
10
|
+
* category to route on.
|
|
11
|
+
*
|
|
12
|
+
* The exclusion is equally binding and is why this list is short: presentation-only changes, log
|
|
13
|
+
* lines and token counters never become a row (requirements § 6; D-05 § 6.3 names `item.*`,
|
|
14
|
+
* `tool-call`, `tool-result`, `text`, `token-usage` and `cost`).
|
|
15
|
+
*/
|
|
16
|
+
/** The agreed catalog, verbatim from the requirements contract § 6. */
|
|
17
|
+
export declare const MCP_EVENT_CATALOG: {
|
|
18
|
+
readonly 'E-01': 'Task completion, failure, cancellation or blocking.';
|
|
19
|
+
readonly 'E-02': 'A question requiring attention and a human answer to a question.';
|
|
20
|
+
readonly 'E-03': 'Quality-gate result or a completed result ready for assessment.';
|
|
21
|
+
readonly 'E-04': 'Human change to goal, acceptance criteria, instruction, plan or task state.';
|
|
22
|
+
readonly 'E-05': 'Configuration/workflow change affecting execution.';
|
|
23
|
+
readonly 'E-06': 'Executor availability change affecting execution.';
|
|
24
|
+
};
|
|
25
|
+
/** Every kind this server emits, and the category it belongs to. One table, so the two can never
|
|
26
|
+
* disagree. */
|
|
27
|
+
export declare const MCP_EVENT_KIND_CATEGORY: {
|
|
28
|
+
readonly 'task.done': 'E-01';
|
|
29
|
+
readonly 'task.failed': 'E-01';
|
|
30
|
+
readonly 'task.cancelled': 'E-01';
|
|
31
|
+
/** The run parked at `waiting` with no structured question: it cannot go on without input. */
|
|
32
|
+
readonly 'task.blocked': 'E-01';
|
|
33
|
+
/** The agent raised a structured question (`ask.requested`) and parked at `waiting`. */
|
|
34
|
+
readonly 'question.asked': 'E-02';
|
|
35
|
+
/** A human replied to a run that was waiting on one. */
|
|
36
|
+
readonly 'question.answered': 'E-02';
|
|
37
|
+
readonly 'gate.passed': 'E-03';
|
|
38
|
+
readonly 'gate.failed': 'E-03';
|
|
39
|
+
readonly 'result.ready': 'E-03';
|
|
40
|
+
readonly 'goal.changed': 'E-04';
|
|
41
|
+
readonly 'instruction.added': 'E-04';
|
|
42
|
+
readonly 'instruction.queued': 'E-04';
|
|
43
|
+
readonly 'instruction.edited': 'E-04';
|
|
44
|
+
readonly 'instruction.removed': 'E-04';
|
|
45
|
+
readonly 'config.changed': 'E-05';
|
|
46
|
+
readonly 'workflow.saved': 'E-05';
|
|
47
|
+
readonly 'workflow.deleted': 'E-05';
|
|
48
|
+
readonly 'agent-config.changed': 'E-05';
|
|
49
|
+
readonly 'executor.available': 'E-06';
|
|
50
|
+
readonly 'executor.unavailable': 'E-06';
|
|
51
|
+
};
|
|
52
|
+
export type McpEventKind = keyof typeof MCP_EVENT_KIND_CATEGORY;
|
|
53
|
+
export declare const mcpEventKindSchema: z.ZodEnum<{
|
|
54
|
+
"agent-config.changed": "agent-config.changed";
|
|
55
|
+
"config.changed": "config.changed";
|
|
56
|
+
"executor.available": "executor.available";
|
|
57
|
+
"executor.unavailable": "executor.unavailable";
|
|
58
|
+
"gate.failed": "gate.failed";
|
|
59
|
+
"gate.passed": "gate.passed";
|
|
60
|
+
"goal.changed": "goal.changed";
|
|
61
|
+
"instruction.added": "instruction.added";
|
|
62
|
+
"instruction.edited": "instruction.edited";
|
|
63
|
+
"instruction.queued": "instruction.queued";
|
|
64
|
+
"instruction.removed": "instruction.removed";
|
|
65
|
+
"question.answered": "question.answered";
|
|
66
|
+
"question.asked": "question.asked";
|
|
67
|
+
"result.ready": "result.ready";
|
|
68
|
+
"task.blocked": "task.blocked";
|
|
69
|
+
"task.cancelled": "task.cancelled";
|
|
70
|
+
"task.done": "task.done";
|
|
71
|
+
"task.failed": "task.failed";
|
|
72
|
+
"workflow.deleted": "workflow.deleted";
|
|
73
|
+
"workflow.saved": "workflow.saved";
|
|
74
|
+
}>;
|
|
75
|
+
/** What a catalog row is about. `version` is D-06's token for a run, `null` where none exists. */
|
|
76
|
+
export declare const MCP_EVENT_SUBJECT_TYPES: readonly ['run', 'config', 'workflow', 'agent-config', 'executor'];
|
|
77
|
+
export declare const mcpEventSubjectTypeSchema: z.ZodEnum<{
|
|
78
|
+
"agent-config": "agent-config";
|
|
79
|
+
config: "config";
|
|
80
|
+
executor: "executor";
|
|
81
|
+
run: "run";
|
|
82
|
+
workflow: "workflow";
|
|
83
|
+
}>;
|
|
84
|
+
export type McpEventSubjectType = z.infer<typeof mcpEventSubjectTypeSchema>;
|
|
85
|
+
/**
|
|
86
|
+
* A journal row this catalog wrote: an ordinary journal row whose `kind` is a catalog kind, whose
|
|
87
|
+
* `category` is that kind's category, and whose E-04 row names a human — a leader's own change is
|
|
88
|
+
* never an E-04 row, because the catalog entry is "human change".
|
|
89
|
+
*/
|
|
90
|
+
export declare const mcpCatalogEventSchema: z.ZodObject<{
|
|
91
|
+
category: z.ZodEnum<{
|
|
92
|
+
"E-01": "E-01";
|
|
93
|
+
"E-02": "E-02";
|
|
94
|
+
"E-03": "E-03";
|
|
95
|
+
"E-04": "E-04";
|
|
96
|
+
"E-05": "E-05";
|
|
97
|
+
"E-06": "E-06";
|
|
98
|
+
}>;
|
|
99
|
+
kind: z.ZodString;
|
|
100
|
+
subject: z.ZodObject<{
|
|
101
|
+
type: z.ZodString;
|
|
102
|
+
id: z.ZodString;
|
|
103
|
+
version: z.ZodNullable<z.ZodString>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
origin: z.ZodEnum<{
|
|
106
|
+
human: "human";
|
|
107
|
+
leader: "leader";
|
|
108
|
+
system: "system";
|
|
109
|
+
}>;
|
|
110
|
+
causedBy: z.ZodNullable<z.ZodString>;
|
|
111
|
+
summary: z.ZodString;
|
|
112
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
113
|
+
runId: z.ZodString;
|
|
114
|
+
runSeq: z.ZodNumber;
|
|
115
|
+
}, z.core.$strip>>;
|
|
116
|
+
eventId: z.ZodString;
|
|
117
|
+
journalSeq: z.ZodNumber;
|
|
118
|
+
ts: z.ZodString;
|
|
119
|
+
projectId: z.ZodString;
|
|
120
|
+
}, z.core.$strip>;
|
|
121
|
+
export type McpCatalogEvent = z.infer<typeof mcpCatalogEventSchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|