@flyingrobots/graft 0.7.0 → 0.7.1
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/CHANGELOG.md +13 -0
- package/README.md +0 -1
- package/bin/graft.js +26 -26
- package/dist/cli/init-client-config.d.ts.map +1 -1
- package/dist/cli/init-client-config.js +40 -4
- package/dist/cli/init-client-config.js.map +1 -1
- package/dist/cli/init-model.js +2 -2
- package/dist/cli/init-model.js.map +1 -1
- package/dist/cli/json-document.d.ts +1 -0
- package/dist/cli/json-document.d.ts.map +1 -1
- package/dist/cli/json-document.js +3 -0
- package/dist/cli/json-document.js.map +1 -1
- package/dist/hooks/posttooluse-read.js +1 -1
- package/dist/hooks/posttooluse-read.js.map +1 -1
- package/dist/hooks/pretooluse-read.js +1 -1
- package/dist/hooks/pretooluse-read.js.map +1 -1
- package/dist/mcp/daemon-worker-child-pool.d.ts +2 -0
- package/dist/mcp/daemon-worker-child-pool.d.ts.map +1 -1
- package/dist/mcp/daemon-worker-child-pool.js +10 -3
- package/dist/mcp/daemon-worker-child-pool.js.map +1 -1
- package/dist/mcp/daemon-worker-pool.d.ts +1 -1
- package/dist/mcp/daemon-worker-pool.d.ts.map +1 -1
- package/dist/mcp/daemon-worker-pool.js +1 -1
- package/dist/mcp/daemon-worker-pool.js.map +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +3 -1
- package/dist/version.js.map +1 -1
- package/docs/SETUP.md +11 -7
- package/package.json +9 -4
- package/src/adapters/canonical-json.ts +0 -56
- package/src/adapters/json-text-decoder.ts +0 -11
- package/src/adapters/node-fs.ts +0 -43
- package/src/adapters/node-git.ts +0 -47
- package/src/adapters/node-paths.ts +0 -35
- package/src/adapters/node-process-runner.ts +0 -27
- package/src/adapters/repo-paths.ts +0 -63
- package/src/adapters/rotating-ndjson-log.ts +0 -66
- package/src/api/index.ts +0 -107
- package/src/api/repo-local-graft.ts +0 -21
- package/src/api/repo-workspace.ts +0 -34
- package/src/api/tool-bridge.ts +0 -22
- package/src/cli/activity-render.ts +0 -112
- package/src/cli/cli-error.ts +0 -192
- package/src/cli/command-parser.ts +0 -484
- package/src/cli/daemon-status-model.ts +0 -238
- package/src/cli/daemon-status-render.ts +0 -102
- package/src/cli/daemon-status.ts +0 -100
- package/src/cli/entrypoint.ts +0 -18
- package/src/cli/git-graft-enhance-model.ts +0 -131
- package/src/cli/git-graft-enhance-render.ts +0 -33
- package/src/cli/git-graft-enhance.ts +0 -54
- package/src/cli/index-cmd.ts +0 -90
- package/src/cli/index-model.ts +0 -75
- package/src/cli/init-bootstrap.ts +0 -47
- package/src/cli/init-client-config.ts +0 -428
- package/src/cli/init-model.ts +0 -284
- package/src/cli/init-render.ts +0 -54
- package/src/cli/init-target-hooks.ts +0 -93
- package/src/cli/init.ts +0 -124
- package/src/cli/json-document.ts +0 -155
- package/src/cli/local-history-dag-model.ts +0 -437
- package/src/cli/local-history-dag-render.ts +0 -133
- package/src/cli/local-history-dag.ts +0 -103
- package/src/cli/main.ts +0 -197
- package/src/cli/migrate-local-history.ts +0 -119
- package/src/cli/peer-command.ts +0 -60
- package/src/contracts/capabilities.ts +0 -540
- package/src/contracts/causal-ontology.ts +0 -627
- package/src/contracts/causal-surface-next-action.ts +0 -18
- package/src/contracts/json-object.ts +0 -18
- package/src/contracts/mcp-runtime.ts +0 -16
- package/src/contracts/output-schema-cli.ts +0 -103
- package/src/contracts/output-schema-fragments.ts +0 -881
- package/src/contracts/output-schema-mcp.ts +0 -501
- package/src/contracts/output-schema-meta.ts +0 -119
- package/src/contracts/output-schemas.ts +0 -1524
- package/src/git/diff.ts +0 -161
- package/src/git/target-git-hook-bootstrap.ts +0 -56
- package/src/guards/stream-boundary.ts +0 -110
- package/src/hooks/posttooluse-read.ts +0 -54
- package/src/hooks/pretooluse-read.ts +0 -52
- package/src/hooks/read-governor.ts +0 -95
- package/src/hooks/read-messages.ts +0 -53
- package/src/hooks/shared.ts +0 -168
- package/src/index.ts +0 -1
- package/src/mcp/burden.ts +0 -132
- package/src/mcp/cache.ts +0 -7
- package/src/mcp/cached-file.ts +0 -1
- package/src/mcp/context.ts +0 -150
- package/src/mcp/control-plane/authz-storage.ts +0 -129
- package/src/mcp/control-plane/session-registry.ts +0 -115
- package/src/mcp/control-plane/status-projection.ts +0 -76
- package/src/mcp/control-plane/types.ts +0 -144
- package/src/mcp/daemon-bootstrap.ts +0 -100
- package/src/mcp/daemon-control-plane.ts +0 -310
- package/src/mcp/daemon-job-scheduler.ts +0 -279
- package/src/mcp/daemon-repos.ts +0 -99
- package/src/mcp/daemon-server.ts +0 -172
- package/src/mcp/daemon-session-host.ts +0 -234
- package/src/mcp/daemon-stdio-bridge.ts +0 -262
- package/src/mcp/daemon-worker-child-pool.ts +0 -213
- package/src/mcp/daemon-worker-inline-pool.ts +0 -46
- package/src/mcp/daemon-worker-pool.ts +0 -7
- package/src/mcp/daemon-worker-process.ts +0 -52
- package/src/mcp/daemon-worker-types.ts +0 -66
- package/src/mcp/metrics.ts +0 -176
- package/src/mcp/monitor-health.ts +0 -83
- package/src/mcp/monitor-persistence.ts +0 -54
- package/src/mcp/monitor-tick-job.ts +0 -153
- package/src/mcp/monitor-types.ts +0 -103
- package/src/mcp/persisted-local-history-graph.ts +0 -592
- package/src/mcp/persisted-local-history-policy.ts +0 -501
- package/src/mcp/persisted-local-history-views.ts +0 -250
- package/src/mcp/persisted-local-history.ts +0 -1621
- package/src/mcp/persistent-monitor-runtime.ts +0 -482
- package/src/mcp/policy.ts +0 -75
- package/src/mcp/receipt.ts +0 -201
- package/src/mcp/repo-concurrency.ts +0 -392
- package/src/mcp/repo-overview/filter.ts +0 -44
- package/src/mcp/repo-overview/types.ts +0 -63
- package/src/mcp/repo-overview/view-projection.ts +0 -90
- package/src/mcp/repo-state-git.ts +0 -247
- package/src/mcp/repo-state-observation.ts +0 -203
- package/src/mcp/repo-state-transition.ts +0 -151
- package/src/mcp/repo-state-types.ts +0 -107
- package/src/mcp/repo-state.ts +0 -146
- package/src/mcp/repo-tool-job.ts +0 -102
- package/src/mcp/repo-tool-worker-context.ts +0 -215
- package/src/mcp/repo-workspace.ts +0 -21
- package/src/mcp/run-capture-config.ts +0 -33
- package/src/mcp/runtime-causal-context.ts +0 -72
- package/src/mcp/runtime-observability.ts +0 -217
- package/src/mcp/runtime-staged-target.ts +0 -161
- package/src/mcp/runtime-workspace-overlay.ts +0 -255
- package/src/mcp/secret-scrub.ts +0 -89
- package/src/mcp/semantic-transition-guidance.ts +0 -60
- package/src/mcp/semantic-transition-summary.ts +0 -130
- package/src/mcp/server-context.ts +0 -236
- package/src/mcp/server-invocation.ts +0 -388
- package/src/mcp/server-tool-access.ts +0 -148
- package/src/mcp/server.ts +0 -270
- package/src/mcp/stdio-server.ts +0 -26
- package/src/mcp/stdio.ts +0 -3
- package/src/mcp/tool-registry.ts +0 -98
- package/src/mcp/tools/activity-view.ts +0 -325
- package/src/mcp/tools/budget.ts +0 -23
- package/src/mcp/tools/causal-attach.ts +0 -67
- package/src/mcp/tools/causal-status.ts +0 -58
- package/src/mcp/tools/changed-since.ts +0 -71
- package/src/mcp/tools/code-find.ts +0 -192
- package/src/mcp/tools/code-refs.ts +0 -470
- package/src/mcp/tools/code-show.ts +0 -289
- package/src/mcp/tools/daemon-monitors.ts +0 -14
- package/src/mcp/tools/daemon-repos.ts +0 -22
- package/src/mcp/tools/daemon-sessions.ts +0 -14
- package/src/mcp/tools/daemon-status.ts +0 -12
- package/src/mcp/tools/diagnostic-models.ts +0 -97
- package/src/mcp/tools/doctor.ts +0 -83
- package/src/mcp/tools/explain.ts +0 -84
- package/src/mcp/tools/export-surface-diff.ts +0 -26
- package/src/mcp/tools/file-outline.ts +0 -67
- package/src/mcp/tools/git-files.ts +0 -73
- package/src/mcp/tools/graft-diff.ts +0 -35
- package/src/mcp/tools/graft-edit.ts +0 -276
- package/src/mcp/tools/knowledge-map.ts +0 -34
- package/src/mcp/tools/map-collector.ts +0 -338
- package/src/mcp/tools/map.ts +0 -185
- package/src/mcp/tools/monitor-nudge.ts +0 -19
- package/src/mcp/tools/monitor-pause.ts +0 -18
- package/src/mcp/tools/monitor-resume.ts +0 -18
- package/src/mcp/tools/monitor-start.ts +0 -20
- package/src/mcp/tools/monitor-stop.ts +0 -18
- package/src/mcp/tools/precision-live.ts +0 -158
- package/src/mcp/tools/precision-match.ts +0 -54
- package/src/mcp/tools/precision-paths.ts +0 -59
- package/src/mcp/tools/precision-query.ts +0 -127
- package/src/mcp/tools/precision-show.ts +0 -86
- package/src/mcp/tools/precision-visibility.ts +0 -44
- package/src/mcp/tools/precision-warp.ts +0 -101
- package/src/mcp/tools/precision.ts +0 -21
- package/src/mcp/tools/read-range.ts +0 -28
- package/src/mcp/tools/refactor-difficulty.ts +0 -42
- package/src/mcp/tools/run-capture.ts +0 -149
- package/src/mcp/tools/safe-read.ts +0 -148
- package/src/mcp/tools/since.ts +0 -53
- package/src/mcp/tools/state.ts +0 -39
- package/src/mcp/tools/stats.ts +0 -24
- package/src/mcp/tools/structural-blame.ts +0 -55
- package/src/mcp/tools/structural-churn.ts +0 -28
- package/src/mcp/tools/structural-log.ts +0 -41
- package/src/mcp/tools/structural-review.ts +0 -63
- package/src/mcp/tools/workspace-authorizations.ts +0 -14
- package/src/mcp/tools/workspace-authorize.ts +0 -20
- package/src/mcp/tools/workspace-bind.ts +0 -25
- package/src/mcp/tools/workspace-rebind.ts +0 -25
- package/src/mcp/tools/workspace-revoke.ts +0 -18
- package/src/mcp/tools/workspace-status.ts +0 -12
- package/src/mcp/warp-pool.ts +0 -36
- package/src/mcp/workspace-read-observation-model.ts +0 -48
- package/src/mcp/workspace-read-observation.ts +0 -103
- package/src/mcp/workspace-router-capability.ts +0 -32
- package/src/mcp/workspace-router-history.ts +0 -233
- package/src/mcp/workspace-router-model.ts +0 -131
- package/src/mcp/workspace-router-resolution.ts +0 -71
- package/src/mcp/workspace-router-runtime.ts +0 -246
- package/src/mcp/workspace-router.ts +0 -688
- package/src/metrics/logger.ts +0 -40
- package/src/metrics/types.ts +0 -40
- package/src/operations/adaptive-projection.ts +0 -54
- package/src/operations/agent-handoff.ts +0 -59
- package/src/operations/cached-file.ts +0 -40
- package/src/operations/capture-range.ts +0 -64
- package/src/operations/conversation-primer.ts +0 -82
- package/src/operations/cross-session-resume.ts +0 -104
- package/src/operations/deterministic-replay.ts +0 -143
- package/src/operations/diff-identity.ts +0 -127
- package/src/operations/export-surface-diff.ts +0 -355
- package/src/operations/file-outline.ts +0 -48
- package/src/operations/footprint-parallelism.ts +0 -98
- package/src/operations/graft-diff.ts +0 -169
- package/src/operations/horizon-of-readability.ts +0 -60
- package/src/operations/import-reference-impact.ts +0 -143
- package/src/operations/knowledge-map.ts +0 -96
- package/src/operations/observation-cache.ts +0 -165
- package/src/operations/projection-safety.ts +0 -111
- package/src/operations/read-range.ts +0 -64
- package/src/operations/repo-workspace.ts +0 -339
- package/src/operations/result-dto.ts +0 -23
- package/src/operations/safe-read.ts +0 -118
- package/src/operations/semantic-drift.ts +0 -70
- package/src/operations/session-filtration.ts +0 -76
- package/src/operations/session-replay.ts +0 -73
- package/src/operations/sludge-detector.ts +0 -356
- package/src/operations/state.ts +0 -66
- package/src/operations/structural-blame.ts +0 -197
- package/src/operations/structural-review.ts +0 -317
- package/src/operations/structured-buffer-compare.ts +0 -429
- package/src/operations/structured-buffer-model.ts +0 -456
- package/src/operations/structured-buffer-query.ts +0 -794
- package/src/operations/structured-buffer.ts +0 -181
- package/src/operations/teaching-hints.ts +0 -52
- package/src/parser/diff.ts +0 -320
- package/src/parser/lang.ts +0 -71
- package/src/parser/markdown.ts +0 -197
- package/src/parser/outline.ts +0 -316
- package/src/parser/runtime.ts +0 -71
- package/src/parser/types.ts +0 -75
- package/src/policy/evaluate.ts +0 -178
- package/src/policy/graftignore.ts +0 -6
- package/src/policy/types.ts +0 -87
- package/src/ports/codec.ts +0 -13
- package/src/ports/filesystem.ts +0 -18
- package/src/ports/git.ts +0 -16
- package/src/ports/guards.ts +0 -68
- package/src/ports/paths.ts +0 -22
- package/src/ports/process-runner.ts +0 -22
- package/src/release/security-gate.ts +0 -102
- package/src/session/tracker.ts +0 -145
- package/src/session/types.ts +0 -23
- package/src/version.ts +0 -3
- package/src/warp/ast-emitter.ts +0 -133
- package/src/warp/ast-import-resolver.ts +0 -333
- package/src/warp/commit-meta.ts +0 -19
- package/src/warp/context.ts +0 -48
- package/src/warp/dead-symbols.ts +0 -174
- package/src/warp/drift-sentinel.ts +0 -101
- package/src/warp/index-head.ts +0 -348
- package/src/warp/observers.ts +0 -101
- package/src/warp/open.ts +0 -67
- package/src/warp/outline-diff-trailer.ts +0 -100
- package/src/warp/plumbing.d.ts +0 -24
- package/src/warp/refactor-difficulty.ts +0 -257
- package/src/warp/references.ts +0 -77
- package/src/warp/stale-docs.ts +0 -210
- package/src/warp/structural-drift-detection.ts +0 -97
- package/src/warp/structural-queries.ts +0 -258
- package/src/warp/symbol-timeline.ts +0 -209
- package/src/warp/traverse-hydrate.ts +0 -61
- package/src/warp/warp-reference-count.ts +0 -47
- package/src/warp/warp-structural-blame.ts +0 -65
- package/src/warp/warp-structural-churn.ts +0 -309
- package/src/warp/warp-structural-log.ts +0 -149
- package/src/warp/writer-id.ts +0 -30
|
@@ -1,501 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import {
|
|
3
|
-
attributionSummarySchema,
|
|
4
|
-
readEventSchema,
|
|
5
|
-
stageEventSchema,
|
|
6
|
-
transitionEventSchema,
|
|
7
|
-
} from "./causal-ontology.js";
|
|
8
|
-
import {
|
|
9
|
-
mcpFragmentSchemas,
|
|
10
|
-
} from "./output-schema-fragments.js";
|
|
11
|
-
import type { McpToolName } from "./capabilities.js";
|
|
12
|
-
|
|
13
|
-
const {
|
|
14
|
-
actualSchema,
|
|
15
|
-
thresholdsSchema,
|
|
16
|
-
budgetSchema,
|
|
17
|
-
outlineEntrySchema,
|
|
18
|
-
jumpEntrySchema,
|
|
19
|
-
outlineDiffSchema,
|
|
20
|
-
mapFileSchema,
|
|
21
|
-
mapDirectorySchema,
|
|
22
|
-
mapModeSchema,
|
|
23
|
-
fileDiffSchema,
|
|
24
|
-
burdenByKindSchema,
|
|
25
|
-
sludgeReportSchema,
|
|
26
|
-
burdenSummarySchema,
|
|
27
|
-
runtimeObservabilitySchema,
|
|
28
|
-
runtimeCausalContextSchema,
|
|
29
|
-
runtimeStagedTargetSchema,
|
|
30
|
-
persistedLocalHistorySummarySchema,
|
|
31
|
-
repoConcurrencySummarySchema,
|
|
32
|
-
precisionSymbolMatchSchema,
|
|
33
|
-
codeRefsMatchSchema,
|
|
34
|
-
codeRefsProvenanceSchema,
|
|
35
|
-
structuralRefusalSchema,
|
|
36
|
-
worldlineLayerSchema,
|
|
37
|
-
activityViewSchema,
|
|
38
|
-
causalStatusSchema,
|
|
39
|
-
causalAttachSchema,
|
|
40
|
-
workspaceAuthorizeSchema,
|
|
41
|
-
workspaceRevokeSchema,
|
|
42
|
-
workspaceStatusSchema,
|
|
43
|
-
workspaceActionSchema,
|
|
44
|
-
workspaceOverlaySummarySchema,
|
|
45
|
-
workspaceOverlayFootingSchema,
|
|
46
|
-
authorizedWorkspaceSchema,
|
|
47
|
-
policyBoundarySchema,
|
|
48
|
-
daemonStatusSchema,
|
|
49
|
-
daemonSessionSchema,
|
|
50
|
-
daemonRepoSchema,
|
|
51
|
-
monitorStatusSchema,
|
|
52
|
-
monitorActionSchema,
|
|
53
|
-
repoTransitionSchema,
|
|
54
|
-
repoSemanticTransitionSchema,
|
|
55
|
-
sessionDepthSchema,
|
|
56
|
-
} = mcpFragmentSchemas;
|
|
57
|
-
|
|
58
|
-
const graftEditReasonSchema = z.enum([
|
|
59
|
-
"NOT_FOUND",
|
|
60
|
-
"OLD_STRING_NOT_FOUND",
|
|
61
|
-
"OLD_STRING_AMBIGUOUS",
|
|
62
|
-
"BINARY",
|
|
63
|
-
"LOCKFILE",
|
|
64
|
-
"MINIFIED",
|
|
65
|
-
"BUILD_OUTPUT",
|
|
66
|
-
"SECRET",
|
|
67
|
-
"GRAFTIGNORE",
|
|
68
|
-
]);
|
|
69
|
-
|
|
70
|
-
const graftEditDriftWarningSchema = z.object({
|
|
71
|
-
kind: z.literal("structural_pattern_reintroduced"),
|
|
72
|
-
severity: z.literal("advisory"),
|
|
73
|
-
pattern: z.literal("jsdoc_typedef"),
|
|
74
|
-
basis: z.literal("session_local_graft_edit"),
|
|
75
|
-
message: z.string(),
|
|
76
|
-
current: z.object({
|
|
77
|
-
path: z.string(),
|
|
78
|
-
direction: z.literal("added"),
|
|
79
|
-
}).strict(),
|
|
80
|
-
previous: z.object({
|
|
81
|
-
path: z.string(),
|
|
82
|
-
direction: z.literal("removed"),
|
|
83
|
-
}).strict(),
|
|
84
|
-
}).strict();
|
|
85
|
-
|
|
86
|
-
export const mcpOutputBodySchemas = {
|
|
87
|
-
safe_read: z.object({
|
|
88
|
-
path: z.string(),
|
|
89
|
-
projection: z.enum(["content", "outline", "refused", "error", "cache_hit", "diff"]),
|
|
90
|
-
reason: z.string(),
|
|
91
|
-
actual: actualSchema.optional(),
|
|
92
|
-
thresholds: thresholdsSchema.optional(),
|
|
93
|
-
sessionDepth: sessionDepthSchema.optional(),
|
|
94
|
-
content: z.string().optional(),
|
|
95
|
-
outline: z.array(outlineEntrySchema).optional(),
|
|
96
|
-
jumpTable: z.array(jumpEntrySchema).optional(),
|
|
97
|
-
estimatedBytesAvoided: z.number().int().nonnegative().optional(),
|
|
98
|
-
next: z.array(z.string()).optional(),
|
|
99
|
-
reasonDetail: z.string().optional(),
|
|
100
|
-
readCount: z.number().int().nonnegative().optional(),
|
|
101
|
-
lastReadAt: z.string().optional(),
|
|
102
|
-
diff: outlineDiffSchema.optional(),
|
|
103
|
-
}).strict(),
|
|
104
|
-
graft_edit: z.object({
|
|
105
|
-
path: z.string(),
|
|
106
|
-
operation: z.literal("replace"),
|
|
107
|
-
projection: z.enum(["edited", "refused"]),
|
|
108
|
-
status: z.enum(["edited", "refused"]),
|
|
109
|
-
changed: z.boolean(),
|
|
110
|
-
matches: z.number().int().nonnegative(),
|
|
111
|
-
replacements: z.number().int().nonnegative(),
|
|
112
|
-
reason: graftEditReasonSchema.optional(),
|
|
113
|
-
reasonDetail: z.string().optional(),
|
|
114
|
-
next: z.array(z.string()).optional(),
|
|
115
|
-
actual: actualSchema.optional(),
|
|
116
|
-
driftWarnings: z.array(graftEditDriftWarningSchema).optional(),
|
|
117
|
-
}).strict(),
|
|
118
|
-
file_outline: z.union([
|
|
119
|
-
z.object({
|
|
120
|
-
path: z.string(),
|
|
121
|
-
outline: z.array(outlineEntrySchema),
|
|
122
|
-
jumpTable: z.array(jumpEntrySchema),
|
|
123
|
-
partial: z.boolean().optional(),
|
|
124
|
-
reason: z.string().optional(),
|
|
125
|
-
error: z.string().optional(),
|
|
126
|
-
cacheHit: z.boolean().optional(),
|
|
127
|
-
}).strict(),
|
|
128
|
-
z.object({
|
|
129
|
-
path: z.string(),
|
|
130
|
-
projection: z.literal("refused"),
|
|
131
|
-
reason: z.string(),
|
|
132
|
-
reasonDetail: z.string().optional(),
|
|
133
|
-
next: z.array(z.string()).optional(),
|
|
134
|
-
actual: actualSchema.optional(),
|
|
135
|
-
}).strict(),
|
|
136
|
-
]),
|
|
137
|
-
read_range: z.object({
|
|
138
|
-
path: z.string(),
|
|
139
|
-
content: z.string().optional(),
|
|
140
|
-
startLine: z.number().int().positive().optional(),
|
|
141
|
-
endLine: z.number().int().positive().optional(),
|
|
142
|
-
reason: z.string().optional(),
|
|
143
|
-
truncated: z.boolean().optional(),
|
|
144
|
-
clipped: z.boolean().optional(),
|
|
145
|
-
projection: z.literal("refused").optional(),
|
|
146
|
-
reasonDetail: z.string().optional(),
|
|
147
|
-
next: z.array(z.string()).optional(),
|
|
148
|
-
actual: actualSchema.optional(),
|
|
149
|
-
}).strict(),
|
|
150
|
-
changed_since: z.object({
|
|
151
|
-
status: z.enum(["file_not_found", "refused", "unsupported", "unchanged", "no_previous_observation"]).optional(),
|
|
152
|
-
reason: z.string().optional(),
|
|
153
|
-
diff: outlineDiffSchema.optional(),
|
|
154
|
-
consumed: z.boolean().optional(),
|
|
155
|
-
}).strict(),
|
|
156
|
-
graft_diff: z.object({
|
|
157
|
-
base: z.string(),
|
|
158
|
-
head: z.string(),
|
|
159
|
-
files: z.array(fileDiffSchema),
|
|
160
|
-
refused: z.array(structuralRefusalSchema).optional(),
|
|
161
|
-
layer: worldlineLayerSchema,
|
|
162
|
-
}).strict(),
|
|
163
|
-
graft_since: z.object({
|
|
164
|
-
base: z.string(),
|
|
165
|
-
head: z.string(),
|
|
166
|
-
files: z.array(fileDiffSchema),
|
|
167
|
-
refused: z.array(structuralRefusalSchema).optional(),
|
|
168
|
-
summary: z.string(),
|
|
169
|
-
layer: z.literal("ref_view"),
|
|
170
|
-
}).strict(),
|
|
171
|
-
graft_map: z.object({
|
|
172
|
-
directory: z.string(),
|
|
173
|
-
files: z.array(mapFileSchema),
|
|
174
|
-
directories: z.array(mapDirectorySchema).optional(),
|
|
175
|
-
refused: z.array(structuralRefusalSchema).optional(),
|
|
176
|
-
mode: mapModeSchema,
|
|
177
|
-
summary: z.string(),
|
|
178
|
-
}).strict(),
|
|
179
|
-
code_show: z.object({
|
|
180
|
-
symbol: z.string().optional(),
|
|
181
|
-
kind: z.string().optional(),
|
|
182
|
-
signature: z.string().optional(),
|
|
183
|
-
path: z.string().optional(),
|
|
184
|
-
identityId: z.string().optional(),
|
|
185
|
-
exported: z.boolean().optional(),
|
|
186
|
-
startLine: z.number().int().positive().optional(),
|
|
187
|
-
endLine: z.number().int().positive().optional(),
|
|
188
|
-
content: z.string().optional(),
|
|
189
|
-
truncated: z.boolean().optional(),
|
|
190
|
-
clipped: z.boolean().optional(),
|
|
191
|
-
source: z.enum(["warp", "live"]),
|
|
192
|
-
layer: worldlineLayerSchema,
|
|
193
|
-
ambiguous: z.boolean().optional(),
|
|
194
|
-
matches: z.array(precisionSymbolMatchSchema).optional(),
|
|
195
|
-
error: z.string().optional(),
|
|
196
|
-
projection: z.literal("refused").optional(),
|
|
197
|
-
reason: z.string().optional(),
|
|
198
|
-
reasonDetail: z.string().optional(),
|
|
199
|
-
next: z.array(z.string()).optional(),
|
|
200
|
-
actual: actualSchema.optional(),
|
|
201
|
-
}).strict(),
|
|
202
|
-
code_find: z.object({
|
|
203
|
-
query: z.string(),
|
|
204
|
-
kind: z.string().nullable(),
|
|
205
|
-
matches: z.array(precisionSymbolMatchSchema).optional(),
|
|
206
|
-
total: z.number().int().nonnegative().optional(),
|
|
207
|
-
path: z.string().optional(),
|
|
208
|
-
projection: z.literal("refused").optional(),
|
|
209
|
-
reason: z.string().optional(),
|
|
210
|
-
reasonDetail: z.string().optional(),
|
|
211
|
-
next: z.array(z.string()).optional(),
|
|
212
|
-
actual: actualSchema.optional(),
|
|
213
|
-
source: z.enum(["warp", "live"]),
|
|
214
|
-
layer: worldlineLayerSchema,
|
|
215
|
-
}).strict(),
|
|
216
|
-
code_refs: z.object({
|
|
217
|
-
query: z.string(),
|
|
218
|
-
mode: z.enum(["text", "import", "call", "property"]),
|
|
219
|
-
scope: z.string(),
|
|
220
|
-
matches: z.array(codeRefsMatchSchema).optional(),
|
|
221
|
-
total: z.number().int().nonnegative().optional(),
|
|
222
|
-
path: z.string().optional(),
|
|
223
|
-
projection: z.literal("refused").optional(),
|
|
224
|
-
reason: z.string().optional(),
|
|
225
|
-
reasonDetail: z.string().optional(),
|
|
226
|
-
next: z.array(z.string()).optional(),
|
|
227
|
-
actual: actualSchema.optional(),
|
|
228
|
-
source: z.literal("text_fallback"),
|
|
229
|
-
provenance: codeRefsProvenanceSchema,
|
|
230
|
-
layer: worldlineLayerSchema,
|
|
231
|
-
}).strict(),
|
|
232
|
-
daemon_repos: z.object({
|
|
233
|
-
repos: z.array(daemonRepoSchema),
|
|
234
|
-
filter: z.object({
|
|
235
|
-
repoId: z.string().optional(),
|
|
236
|
-
cwd: z.string().optional(),
|
|
237
|
-
}).strict().optional(),
|
|
238
|
-
}).strict(),
|
|
239
|
-
daemon_status: daemonStatusSchema,
|
|
240
|
-
daemon_sessions: z.object({
|
|
241
|
-
sessions: z.array(daemonSessionSchema),
|
|
242
|
-
}).strict(),
|
|
243
|
-
daemon_monitors: z.object({
|
|
244
|
-
monitors: z.array(monitorStatusSchema),
|
|
245
|
-
}).strict(),
|
|
246
|
-
monitor_start: monitorActionSchema,
|
|
247
|
-
monitor_pause: monitorActionSchema,
|
|
248
|
-
monitor_resume: monitorActionSchema,
|
|
249
|
-
monitor_nudge: monitorActionSchema,
|
|
250
|
-
monitor_stop: monitorActionSchema,
|
|
251
|
-
workspace_authorize: workspaceAuthorizeSchema,
|
|
252
|
-
workspace_authorizations: z.object({
|
|
253
|
-
workspaces: z.array(authorizedWorkspaceSchema),
|
|
254
|
-
}).strict(),
|
|
255
|
-
workspace_revoke: workspaceRevokeSchema,
|
|
256
|
-
workspace_bind: workspaceActionSchema.extend({ action: z.literal("bind") }).strict(),
|
|
257
|
-
workspace_status: workspaceStatusSchema,
|
|
258
|
-
activity_view: activityViewSchema,
|
|
259
|
-
causal_status: causalStatusSchema,
|
|
260
|
-
causal_attach: causalAttachSchema,
|
|
261
|
-
workspace_rebind: workspaceActionSchema.extend({ action: z.literal("rebind") }).strict(),
|
|
262
|
-
run_capture: z.object({
|
|
263
|
-
output: z.string(),
|
|
264
|
-
totalLines: z.number().int().nonnegative(),
|
|
265
|
-
tailedLines: z.number().int().nonnegative(),
|
|
266
|
-
logPath: z.string().nullable().optional(),
|
|
267
|
-
logRedactions: z.number().int().nonnegative().optional(),
|
|
268
|
-
logPersistenceEnabled: z.boolean().optional(),
|
|
269
|
-
truncated: z.boolean(),
|
|
270
|
-
disabled: z.boolean().optional(),
|
|
271
|
-
error: z.string().optional(),
|
|
272
|
-
stderr: z.string().optional(),
|
|
273
|
-
policyBoundary: policyBoundarySchema,
|
|
274
|
-
}).strict(),
|
|
275
|
-
state_save: z.object({
|
|
276
|
-
ok: z.boolean(),
|
|
277
|
-
reason: z.string().optional(),
|
|
278
|
-
}).strict(),
|
|
279
|
-
state_load: z.object({
|
|
280
|
-
content: z.string().nullable(),
|
|
281
|
-
}).strict(),
|
|
282
|
-
set_budget: z.object({
|
|
283
|
-
budget: budgetSchema.nullable(),
|
|
284
|
-
}).strict(),
|
|
285
|
-
explain: z.object({
|
|
286
|
-
code: z.string(),
|
|
287
|
-
meaning: z.string().optional(),
|
|
288
|
-
action: z.string().optional(),
|
|
289
|
-
error: z.string().optional(),
|
|
290
|
-
knownCodes: z.string().optional(),
|
|
291
|
-
}).strict(),
|
|
292
|
-
doctor: z.object({
|
|
293
|
-
projectRoot: z.string(),
|
|
294
|
-
parserHealthy: z.boolean(),
|
|
295
|
-
thresholds: thresholdsSchema,
|
|
296
|
-
sessionDepth: z.enum(["early", "mid", "late"]),
|
|
297
|
-
totalMessages: z.number().int().nonnegative(),
|
|
298
|
-
burdenSummary: burdenSummarySchema,
|
|
299
|
-
runtimeObservability: runtimeObservabilitySchema,
|
|
300
|
-
causalContext: runtimeCausalContextSchema,
|
|
301
|
-
latestReadEvent: readEventSchema.nullable(),
|
|
302
|
-
latestStageEvent: stageEventSchema.nullable(),
|
|
303
|
-
latestTransitionEvent: transitionEventSchema.nullable(),
|
|
304
|
-
repoConcurrency: repoConcurrencySummarySchema.nullable(),
|
|
305
|
-
checkoutEpoch: z.number().int().nonnegative(),
|
|
306
|
-
lastTransition: repoTransitionSchema.nullable(),
|
|
307
|
-
semanticTransition: repoSemanticTransitionSchema.nullable(),
|
|
308
|
-
workspaceOverlayId: z.string().nullable(),
|
|
309
|
-
workspaceOverlay: workspaceOverlaySummarySchema.nullable(),
|
|
310
|
-
workspaceOverlayFooting: workspaceOverlayFootingSchema,
|
|
311
|
-
stagedTarget: runtimeStagedTargetSchema,
|
|
312
|
-
attribution: attributionSummarySchema,
|
|
313
|
-
persistedLocalHistory: persistedLocalHistorySummarySchema,
|
|
314
|
-
recommendedNextAction: z.string(),
|
|
315
|
-
sludge: sludgeReportSchema.optional(),
|
|
316
|
-
}).strict(),
|
|
317
|
-
stats: z.object({
|
|
318
|
-
totalReads: z.number().int().nonnegative(),
|
|
319
|
-
totalOutlines: z.number().int().nonnegative(),
|
|
320
|
-
totalRefusals: z.number().int().nonnegative(),
|
|
321
|
-
totalCacheHits: z.number().int().nonnegative(),
|
|
322
|
-
totalBytesReturned: z.number().int().nonnegative(),
|
|
323
|
-
totalBytesAvoidedByCache: z.number().int().nonnegative(),
|
|
324
|
-
totalNonReadBytesReturned: z.number().int().nonnegative(),
|
|
325
|
-
burdenByKind: burdenByKindSchema,
|
|
326
|
-
}).strict(),
|
|
327
|
-
graft_churn: z.object({
|
|
328
|
-
entries: z.array(z.object({
|
|
329
|
-
symbol: z.string(),
|
|
330
|
-
filePath: z.string(),
|
|
331
|
-
kind: z.string(),
|
|
332
|
-
changeCount: z.number().int().positive(),
|
|
333
|
-
lastChangedSha: z.string(),
|
|
334
|
-
lastChangedDate: z.string(),
|
|
335
|
-
}).strict()),
|
|
336
|
-
totalSymbols: z.number().int().nonnegative(),
|
|
337
|
-
totalCommitsAnalyzed: z.number().int().nonnegative(),
|
|
338
|
-
summary: z.string(),
|
|
339
|
-
}).strict(),
|
|
340
|
-
graft_exports: z.object({
|
|
341
|
-
base: z.string(),
|
|
342
|
-
head: z.string(),
|
|
343
|
-
added: z.array(z.object({
|
|
344
|
-
symbol: z.string(),
|
|
345
|
-
filePath: z.string(),
|
|
346
|
-
kind: z.string(),
|
|
347
|
-
changeType: z.literal("added"),
|
|
348
|
-
signature: z.string().optional(),
|
|
349
|
-
}).strict()),
|
|
350
|
-
removed: z.array(z.object({
|
|
351
|
-
symbol: z.string(),
|
|
352
|
-
filePath: z.string(),
|
|
353
|
-
kind: z.string(),
|
|
354
|
-
changeType: z.literal("removed"),
|
|
355
|
-
signature: z.string().optional(),
|
|
356
|
-
}).strict()),
|
|
357
|
-
changed: z.array(z.object({
|
|
358
|
-
symbol: z.string(),
|
|
359
|
-
filePath: z.string(),
|
|
360
|
-
kind: z.string(),
|
|
361
|
-
changeType: z.literal("signature_changed"),
|
|
362
|
-
signature: z.string().optional(),
|
|
363
|
-
previousSignature: z.string().optional(),
|
|
364
|
-
}).strict()),
|
|
365
|
-
semverImpact: z.enum(["major", "minor", "patch", "none"]),
|
|
366
|
-
summary: z.string(),
|
|
367
|
-
}).strict(),
|
|
368
|
-
graft_log: z.object({
|
|
369
|
-
entries: z.array(z.object({
|
|
370
|
-
sha: z.string(),
|
|
371
|
-
message: z.string(),
|
|
372
|
-
author: z.string(),
|
|
373
|
-
date: z.string(),
|
|
374
|
-
symbols: z.object({
|
|
375
|
-
added: z.array(z.object({
|
|
376
|
-
name: z.string(),
|
|
377
|
-
kind: z.string(),
|
|
378
|
-
signature: z.string().optional(),
|
|
379
|
-
exported: z.boolean(),
|
|
380
|
-
filePath: z.string(),
|
|
381
|
-
}).strict()),
|
|
382
|
-
removed: z.array(z.object({
|
|
383
|
-
name: z.string(),
|
|
384
|
-
kind: z.string(),
|
|
385
|
-
signature: z.string().optional(),
|
|
386
|
-
exported: z.boolean(),
|
|
387
|
-
filePath: z.string(),
|
|
388
|
-
}).strict()),
|
|
389
|
-
changed: z.array(z.object({
|
|
390
|
-
name: z.string(),
|
|
391
|
-
kind: z.string(),
|
|
392
|
-
signature: z.string().optional(),
|
|
393
|
-
exported: z.boolean(),
|
|
394
|
-
filePath: z.string(),
|
|
395
|
-
}).strict()),
|
|
396
|
-
}).strict(),
|
|
397
|
-
summary: z.string(),
|
|
398
|
-
}).strict()),
|
|
399
|
-
count: z.number().int().nonnegative(),
|
|
400
|
-
layer: z.literal("commit_worldline"),
|
|
401
|
-
}).strict(),
|
|
402
|
-
graft_blame: z.object({
|
|
403
|
-
symbol: z.string(),
|
|
404
|
-
filePath: z.string().optional(),
|
|
405
|
-
currentSignature: z.string().optional(),
|
|
406
|
-
kind: z.string(),
|
|
407
|
-
exported: z.boolean(),
|
|
408
|
-
created: z.object({
|
|
409
|
-
sha: z.string(),
|
|
410
|
-
author: z.string(),
|
|
411
|
-
date: z.string(),
|
|
412
|
-
message: z.string(),
|
|
413
|
-
}).strict().optional(),
|
|
414
|
-
lastSignatureChange: z.object({
|
|
415
|
-
sha: z.string(),
|
|
416
|
-
author: z.string(),
|
|
417
|
-
date: z.string(),
|
|
418
|
-
message: z.string(),
|
|
419
|
-
previousSignature: z.string().optional(),
|
|
420
|
-
}).strict().optional(),
|
|
421
|
-
changeCount: z.number().int().nonnegative(),
|
|
422
|
-
referenceCount: z.number().int().nonnegative(),
|
|
423
|
-
referencingFiles: z.array(z.string()),
|
|
424
|
-
history: z.array(z.object({
|
|
425
|
-
sha: z.string(),
|
|
426
|
-
changeKind: z.string(),
|
|
427
|
-
date: z.string(),
|
|
428
|
-
author: z.string(),
|
|
429
|
-
signature: z.string().optional(),
|
|
430
|
-
}).strict()),
|
|
431
|
-
}).strict(),
|
|
432
|
-
graft_difficulty: z.object({
|
|
433
|
-
symbol: z.string(),
|
|
434
|
-
path: z.string().optional(),
|
|
435
|
-
entries: z.array(z.object({
|
|
436
|
-
symbol: z.string(),
|
|
437
|
-
filePath: z.string(),
|
|
438
|
-
kind: z.string(),
|
|
439
|
-
score: z.number().nonnegative(),
|
|
440
|
-
risk: z.enum(["low", "medium", "high"]),
|
|
441
|
-
recommendation: z.enum(["refactor_freely", "refactor_with_tests", "plan_before_refactor"]),
|
|
442
|
-
curvature: z.object({
|
|
443
|
-
changeCount: z.number().int().nonnegative(),
|
|
444
|
-
signatureChangeCount: z.number().int().nonnegative(),
|
|
445
|
-
score: z.number().nonnegative(),
|
|
446
|
-
}).strict(),
|
|
447
|
-
friction: z.object({
|
|
448
|
-
referenceCount: z.number().int().nonnegative(),
|
|
449
|
-
referencingFiles: z.array(z.string()),
|
|
450
|
-
score: z.number().nonnegative(),
|
|
451
|
-
}).strict(),
|
|
452
|
-
}).strict()),
|
|
453
|
-
total: z.number().int().nonnegative(),
|
|
454
|
-
summary: z.string(),
|
|
455
|
-
}).strict(),
|
|
456
|
-
graft_review: z.object({
|
|
457
|
-
base: z.string(),
|
|
458
|
-
head: z.string(),
|
|
459
|
-
totalFiles: z.number().int().nonnegative(),
|
|
460
|
-
categories: z.object({
|
|
461
|
-
structural: z.number().int().nonnegative(),
|
|
462
|
-
formatting: z.number().int().nonnegative(),
|
|
463
|
-
test: z.number().int().nonnegative(),
|
|
464
|
-
docs: z.number().int().nonnegative(),
|
|
465
|
-
config: z.number().int().nonnegative(),
|
|
466
|
-
}).strict(),
|
|
467
|
-
files: z.array(z.object({
|
|
468
|
-
path: z.string(),
|
|
469
|
-
category: z.enum(["structural", "formatting", "test", "docs", "config"]),
|
|
470
|
-
structuralChanges: z.object({
|
|
471
|
-
added: z.number().int().nonnegative(),
|
|
472
|
-
removed: z.number().int().nonnegative(),
|
|
473
|
-
changed: z.number().int().nonnegative(),
|
|
474
|
-
}).strict().optional(),
|
|
475
|
-
}).strict()),
|
|
476
|
-
breakingChanges: z.array(z.object({
|
|
477
|
-
symbol: z.string(),
|
|
478
|
-
kind: z.string(),
|
|
479
|
-
filePath: z.string(),
|
|
480
|
-
changeType: z.enum(["removed_export", "signature_changed", "type_changed"]),
|
|
481
|
-
previousSignature: z.string().optional(),
|
|
482
|
-
newSignature: z.string().optional(),
|
|
483
|
-
impactedFiles: z.number().int().nonnegative(),
|
|
484
|
-
impactedFilePaths: z.array(z.string()),
|
|
485
|
-
}).strict()),
|
|
486
|
-
summary: z.string(),
|
|
487
|
-
}).strict(),
|
|
488
|
-
knowledge_map: z.object({
|
|
489
|
-
totalFiles: z.number().int().nonnegative(),
|
|
490
|
-
totalSymbols: z.number().int().nonnegative(),
|
|
491
|
-
files: z.array(z.object({
|
|
492
|
-
path: z.string(),
|
|
493
|
-
symbols: z.array(z.string()),
|
|
494
|
-
readCount: z.number().int().positive(),
|
|
495
|
-
lastReadAt: z.string(),
|
|
496
|
-
stale: z.boolean(),
|
|
497
|
-
}).strict()),
|
|
498
|
-
staleFiles: z.array(z.string()),
|
|
499
|
-
directoryCoverage: z.record(z.string(), z.number().int().nonnegative()),
|
|
500
|
-
}).strict(),
|
|
501
|
-
} satisfies Record<McpToolName, z.ZodType>;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import {
|
|
3
|
-
CLI_COMMAND_NAMES,
|
|
4
|
-
type CliCommandName,
|
|
5
|
-
MCP_TOOL_NAMES,
|
|
6
|
-
type McpToolName,
|
|
7
|
-
} from "./capabilities.js";
|
|
8
|
-
|
|
9
|
-
export const OUTPUT_SCHEMA_VERSION = "1.0.0" as const;
|
|
10
|
-
|
|
11
|
-
export interface OutputSchemaMeta {
|
|
12
|
-
readonly id: string;
|
|
13
|
-
readonly version: typeof OUTPUT_SCHEMA_VERSION;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const mcpOutputSchemaMeta = Object.freeze(Object.fromEntries(
|
|
17
|
-
MCP_TOOL_NAMES.map((tool) => [tool, Object.freeze({
|
|
18
|
-
id: `graft.mcp.${tool}`,
|
|
19
|
-
version: OUTPUT_SCHEMA_VERSION,
|
|
20
|
-
})]),
|
|
21
|
-
) as Record<McpToolName, OutputSchemaMeta>);
|
|
22
|
-
|
|
23
|
-
export const cliOutputSchemaMeta = Object.freeze(Object.fromEntries(
|
|
24
|
-
CLI_COMMAND_NAMES.map((command) => [command, Object.freeze({
|
|
25
|
-
id: `graft.cli.${command}`,
|
|
26
|
-
version: OUTPUT_SCHEMA_VERSION,
|
|
27
|
-
})]),
|
|
28
|
-
) as Record<CliCommandName, OutputSchemaMeta>);
|
|
29
|
-
|
|
30
|
-
export function schemaMetaLiteral(meta: OutputSchemaMeta) {
|
|
31
|
-
return z.object({
|
|
32
|
-
id: z.literal(meta.id),
|
|
33
|
-
version: z.literal(meta.version),
|
|
34
|
-
}).strict();
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export type CliPeerCommandName =
|
|
38
|
-
| "read_safe"
|
|
39
|
-
| "read_outline"
|
|
40
|
-
| "read_range"
|
|
41
|
-
| "read_changed"
|
|
42
|
-
| "struct_diff"
|
|
43
|
-
| "struct_since"
|
|
44
|
-
| "struct_map"
|
|
45
|
-
| "symbol_show"
|
|
46
|
-
| "symbol_find"
|
|
47
|
-
| "diag_doctor"
|
|
48
|
-
| "diag_activity"
|
|
49
|
-
| "diag_explain"
|
|
50
|
-
| "diag_stats"
|
|
51
|
-
| "diag_capture";
|
|
52
|
-
|
|
53
|
-
export interface McpCommonFields {
|
|
54
|
-
readonly _schema: OutputSchemaMeta;
|
|
55
|
-
readonly _receipt: Record<string, unknown>;
|
|
56
|
-
readonly tripwire?: readonly Record<string, unknown>[] | undefined;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface CliCommonFields {
|
|
60
|
-
readonly _schema: OutputSchemaMeta;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface CliPeerCommonFields extends CliCommonFields {
|
|
64
|
-
readonly _receipt: Record<string, unknown>;
|
|
65
|
-
readonly tripwire?: readonly Record<string, unknown>[] | undefined;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function extendWithCommonFields(
|
|
69
|
-
schema: z.ZodType,
|
|
70
|
-
common: z.ZodRawShape,
|
|
71
|
-
): z.ZodType {
|
|
72
|
-
if (schema instanceof z.ZodObject) {
|
|
73
|
-
return schema.extend(common).strict();
|
|
74
|
-
}
|
|
75
|
-
if (schema instanceof z.ZodUnion) {
|
|
76
|
-
return z.union(schema.options.map((option) => {
|
|
77
|
-
if (!(option instanceof z.ZodObject)) {
|
|
78
|
-
throw new Error("Output schema unions must be composed of objects");
|
|
79
|
-
}
|
|
80
|
-
return option.extend(common).strict();
|
|
81
|
-
}) as [z.ZodObject, z.ZodObject, ...z.ZodObject[]]);
|
|
82
|
-
}
|
|
83
|
-
throw new Error("Output schemas must be objects or unions of objects");
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export function withMcpCommon(
|
|
87
|
-
tool: McpToolName,
|
|
88
|
-
schema: z.ZodType,
|
|
89
|
-
receiptSchema: z.ZodType,
|
|
90
|
-
tripwireSchema: z.ZodType,
|
|
91
|
-
): z.ZodType {
|
|
92
|
-
return extendWithCommonFields(schema, {
|
|
93
|
-
_schema: schemaMetaLiteral(mcpOutputSchemaMeta[tool]),
|
|
94
|
-
_receipt: receiptSchema,
|
|
95
|
-
tripwire: z.array(tripwireSchema).optional(),
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export function withCliCommon(
|
|
100
|
-
command: CliCommandName,
|
|
101
|
-
schema: z.ZodType,
|
|
102
|
-
): z.ZodType {
|
|
103
|
-
return extendWithCommonFields(schema, {
|
|
104
|
-
_schema: schemaMetaLiteral(cliOutputSchemaMeta[command]),
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export function withCliPeerCommon(
|
|
109
|
-
command: CliCommandName,
|
|
110
|
-
schema: z.ZodType,
|
|
111
|
-
receiptSchema: z.ZodType,
|
|
112
|
-
tripwireSchema: z.ZodType,
|
|
113
|
-
): z.ZodType {
|
|
114
|
-
return extendWithCommonFields(schema, {
|
|
115
|
-
_schema: schemaMetaLiteral(cliOutputSchemaMeta[command]),
|
|
116
|
-
_receipt: receiptSchema,
|
|
117
|
-
tripwire: z.array(tripwireSchema).optional(),
|
|
118
|
-
});
|
|
119
|
-
}
|