@h-rig/contracts 0.0.6-alpha.16 → 0.0.6-alpha.160
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/index.cjs +3280 -0
- package/dist/index.mjs +3239 -0
- package/dist/src/agent-roles.d.ts +8 -0
- package/dist/src/artifact.d.ts +13 -0
- package/dist/src/artifact.js +3 -0
- package/dist/src/baseSchemas.d.ts +63 -0
- package/dist/src/baseSchemas.js +6 -0
- package/dist/src/browser.d.ts +80 -0
- package/dist/src/browser.js +13 -0
- package/dist/src/capability-id.d.ts +22 -0
- package/dist/src/capability-id.js +8 -0
- package/dist/src/cli-output.d.ts +348 -0
- package/dist/src/cli-output.js +190 -0
- package/dist/src/cli-runner.d.ts +43 -0
- package/dist/src/cli-runner.js +13 -0
- package/dist/src/collab-session-viewer.d.ts +36 -0
- package/dist/src/collab-session-viewer.js +13 -0
- package/dist/src/config.d.ts +551 -0
- package/dist/src/config.js +765 -162
- package/dist/src/control-plane-types.d.ts +323 -0
- package/dist/src/control-plane-types.js +13 -0
- package/dist/src/conversation.d.ts +50 -0
- package/dist/src/conversation.js +3 -0
- package/dist/src/dependency-preflight.d.ts +43 -0
- package/dist/src/dependency-preflight.js +13 -0
- package/dist/src/doctor.d.ts +90 -0
- package/dist/src/doctor.js +13 -0
- package/dist/src/drift.d.ts +28 -0
- package/dist/src/drift.js +69 -0
- package/dist/src/editor.d.ts +25 -0
- package/dist/src/editor.js +3 -0
- package/dist/src/errors.d.ts +13 -0
- package/dist/src/errors.js +17 -0
- package/dist/src/git.d.ts +144 -0
- package/dist/src/git.js +3 -0
- package/dist/src/github.d.ts +146 -0
- package/dist/src/github.js +17 -0
- package/dist/src/graph.d.ts +360 -0
- package/dist/src/graph.js +137 -1
- package/dist/src/guard.d.ts +111 -0
- package/dist/src/guard.js +6 -0
- package/dist/src/harness-events.d.ts +8 -0
- package/dist/src/harness-events.js +1 -0
- package/dist/src/help-catalog.d.ts +41 -0
- package/dist/src/help-catalog.js +13 -0
- package/dist/src/host.d.ts +41 -0
- package/dist/src/host.js +13 -0
- package/dist/src/identity.d.ts +44 -0
- package/dist/src/identity.js +1 -0
- package/dist/src/index.d.ts +77 -0
- package/dist/src/index.js +2661 -3970
- package/dist/src/isolation.d.ts +213 -0
- package/dist/src/isolation.js +13 -0
- package/dist/src/kernel.d.ts +200 -0
- package/dist/src/kernel.js +261 -0
- package/dist/src/keybindings.d.ts +71 -0
- package/dist/src/keybindings.js +3 -0
- package/dist/src/layout.d.ts +49 -0
- package/dist/src/layout.js +10 -0
- package/dist/src/lifecycle-capabilities.d.ts +128 -0
- package/dist/src/lifecycle-capabilities.js +25 -0
- package/dist/src/managed-repos.d.ts +136 -0
- package/dist/src/managed-repos.js +17 -0
- package/dist/src/memory.d.ts +199 -0
- package/dist/src/memory.js +15 -0
- package/dist/src/model.d.ts +77 -0
- package/dist/src/notify.d.ts +46 -0
- package/dist/src/notify.js +13 -0
- package/dist/src/orchestration.d.ts +43 -0
- package/dist/src/orchestration.js +28 -961
- package/dist/src/panel-protocol.d.ts +17 -0
- package/dist/src/panel-protocol.js +10 -0
- package/dist/src/pi-session.d.ts +113 -0
- package/dist/src/pi-session.js +1 -0
- package/dist/src/planning.d.ts +64 -0
- package/dist/src/planning.js +90 -0
- package/dist/src/plugin-hooks.d.ts +51 -0
- package/dist/src/plugin-hooks.js +386 -0
- package/dist/src/plugin.d.ts +476 -0
- package/dist/src/plugin.js +346 -64
- package/dist/src/policy.d.ts +16 -0
- package/dist/src/policy.js +3 -0
- package/dist/src/project.d.ts +71 -0
- package/dist/src/project.js +3 -0
- package/dist/src/prompt.d.ts +29 -0
- package/dist/src/prompt.js +13 -0
- package/dist/src/protocol-version.d.ts +21 -0
- package/dist/src/protocol-version.js +6 -0
- package/dist/src/provider-instructions.d.ts +41 -0
- package/dist/src/provider-instructions.js +13 -0
- package/dist/src/provider.d.ts +105 -0
- package/dist/src/provider.js +4 -824
- package/dist/src/remote.d.ts +318 -0
- package/dist/src/remote.js +238 -1078
- package/dist/src/review.d.ts +18 -0
- package/dist/src/review.js +3 -0
- package/dist/src/rollups.d.ts +41 -0
- package/dist/src/rollups.js +70 -0
- package/dist/src/run-discovery.d.ts +79 -0
- package/dist/src/run-discovery.js +13 -0
- package/dist/src/run-dispatch.d.ts +34 -0
- package/dist/src/run-dispatch.js +13 -0
- package/dist/src/run-identity.d.ts +47 -0
- package/dist/src/run-identity.js +13 -0
- package/dist/src/run-journal.d.ts +694 -0
- package/dist/src/run-journal.js +569 -0
- package/dist/src/run-read-model.d.ts +234 -0
- package/dist/src/run-read-model.js +13 -0
- package/dist/src/run-record.d.ts +45 -0
- package/dist/src/run-record.js +1 -0
- package/dist/src/run-registry-backbone.d.ts +56 -0
- package/dist/src/run-registry-backbone.js +13 -0
- package/dist/src/run-session-journal.d.ts +69 -0
- package/dist/src/run-session-journal.js +78 -0
- package/dist/src/run-status.d.ts +10 -0
- package/dist/src/run-status.js +27 -0
- package/dist/src/run-timeline.d.ts +7 -0
- package/dist/src/run-timeline.js +1 -0
- package/dist/src/runtime-task-context.d.ts +82 -0
- package/dist/src/runtime-task-context.js +1 -0
- package/dist/src/runtime.d.ts +103 -0
- package/dist/src/runtime.js +73 -906
- package/dist/src/session-asset-materializer.d.ts +35 -0
- package/dist/src/session-asset-materializer.js +13 -0
- package/dist/src/setup.d.ts +47 -0
- package/dist/src/setup.js +13 -0
- package/dist/src/stage.d.ts +245 -0
- package/dist/src/stage.js +169 -0
- package/dist/src/supervisor-journal.d.ts +204 -0
- package/dist/src/supervisor-journal.js +334 -0
- package/dist/src/task-data.d.ts +239 -0
- package/dist/src/task-data.js +13 -0
- package/dist/src/task-graph-primitives.d.ts +47 -0
- package/dist/src/task-graph-primitives.js +1 -0
- package/dist/src/task-source.d.ts +102 -0
- package/dist/src/task-source.js +12 -0
- package/dist/src/task-state-metadata.d.ts +21 -0
- package/dist/src/task-state-metadata.js +1 -0
- package/dist/src/terminal.d.ts +130 -0
- package/dist/src/terminal.js +3 -0
- package/dist/src/tool-materializer.d.ts +36 -0
- package/dist/src/tool-materializer.js +13 -0
- package/dist/src/tool-registry.d.ts +3 -0
- package/dist/src/tool-registry.js +58 -0
- package/dist/src/toolchain-sources.d.ts +54 -0
- package/dist/src/toolchain-sources.js +17 -0
- package/dist/src/validation.d.ts +14 -0
- package/dist/src/validation.js +3 -0
- package/dist/src/workflow-journal.d.ts +92 -0
- package/dist/src/workflow-journal.js +18 -0
- package/dist/src/workspace-config.d.ts +18 -0
- package/dist/src/workspace-config.js +13 -0
- package/dist/src/workspace.d.ts +204 -0
- package/dist/src/workspace.js +76 -911
- package/package.json +51 -4
- package/dist/src/engine.js +0 -2278
- package/dist/src/providerRuntime.js +0 -1630
- package/dist/src/rig.js +0 -2374
- package/dist/src/server.js +0 -1053
- package/dist/src/serviceFabric.js +0 -1066
- package/dist/src/ws.js +0 -2968
- /package/dist/src/{ipc.js → agent-roles.js} +0 -0
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Control-plane shared types.
|
|
3
|
+
*
|
|
4
|
+
* These types previously lived inside the runtime native PR/merge/verify
|
|
5
|
+
* lifecycle modules (pr-automation.ts, pr-review-gate.ts, verifier.ts) and
|
|
6
|
+
* were imported across module boundaries, creating mutual coupling. They are
|
|
7
|
+
* hoisted here — the bottom contracts layer — so the lifecycle plugins
|
|
8
|
+
* (@rig/pr-review-plugin, @rig/bundle-default-lifecycle) and the dumb runtime
|
|
9
|
+
* substrate (git-ops, task-ops) all reference one canonical definition without
|
|
10
|
+
* importing each other.
|
|
11
|
+
*/
|
|
12
|
+
import type { CapabilityId } from "./capability-id";
|
|
13
|
+
export type GitHubCommandResult = {
|
|
14
|
+
readonly exitCode: number;
|
|
15
|
+
readonly stdout?: string;
|
|
16
|
+
readonly stderr?: string;
|
|
17
|
+
};
|
|
18
|
+
export type GitHubCommandRunner = (args: readonly string[], options?: {
|
|
19
|
+
readonly cwd?: string;
|
|
20
|
+
}) => Promise<GitHubCommandResult>;
|
|
21
|
+
export type GitCommandRunner = (args: readonly string[], options?: {
|
|
22
|
+
readonly cwd?: string;
|
|
23
|
+
}) => Promise<GitHubCommandResult>;
|
|
24
|
+
export type RigAutomationConfig = {
|
|
25
|
+
readonly automation?: {
|
|
26
|
+
readonly maxValidationAttempts?: number;
|
|
27
|
+
readonly maxPrFixIterations?: number;
|
|
28
|
+
};
|
|
29
|
+
readonly pr?: {
|
|
30
|
+
readonly mode?: "auto" | "ask" | "off";
|
|
31
|
+
readonly watchChecks?: boolean;
|
|
32
|
+
readonly autoFixChecks?: boolean;
|
|
33
|
+
readonly autoFixReview?: boolean;
|
|
34
|
+
readonly pendingTimeoutMs?: number;
|
|
35
|
+
readonly pendingPollMs?: number;
|
|
36
|
+
};
|
|
37
|
+
readonly merge?: {
|
|
38
|
+
readonly mode?: "auto" | "off" | "pr-ready";
|
|
39
|
+
readonly method?: "repo-default" | "squash" | "merge" | "rebase";
|
|
40
|
+
readonly deleteBranch?: "repo-default" | boolean;
|
|
41
|
+
readonly allowedFailures?: readonly string[];
|
|
42
|
+
readonly bypass?: boolean;
|
|
43
|
+
};
|
|
44
|
+
readonly review?: {
|
|
45
|
+
readonly mode?: "off" | "advisory" | "required";
|
|
46
|
+
readonly provider?: "greptile" | "github";
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export type PrAutomationResult = {
|
|
50
|
+
readonly status: "skipped" | "opened" | "merged" | "needs_attention";
|
|
51
|
+
readonly prUrl?: string;
|
|
52
|
+
readonly iterations: number;
|
|
53
|
+
readonly actionableFeedback: readonly string[];
|
|
54
|
+
readonly merged?: boolean;
|
|
55
|
+
};
|
|
56
|
+
export type PrAutomationLifecycle = {
|
|
57
|
+
readonly onPrOpened?: (input: {
|
|
58
|
+
readonly prUrl: string;
|
|
59
|
+
}) => Promise<void> | void;
|
|
60
|
+
readonly onReviewCiStarted?: (input: {
|
|
61
|
+
readonly prUrl: string;
|
|
62
|
+
readonly iteration: number;
|
|
63
|
+
}) => Promise<void> | void;
|
|
64
|
+
readonly onFeedback?: (input: {
|
|
65
|
+
readonly prUrl: string;
|
|
66
|
+
readonly iteration: number;
|
|
67
|
+
readonly feedback: readonly string[];
|
|
68
|
+
}) => Promise<void> | void;
|
|
69
|
+
readonly onMergeStarted?: (input: {
|
|
70
|
+
readonly prUrl: string;
|
|
71
|
+
}) => Promise<void> | void;
|
|
72
|
+
readonly onMerged?: (input: {
|
|
73
|
+
readonly prUrl: string;
|
|
74
|
+
}) => Promise<void> | void;
|
|
75
|
+
};
|
|
76
|
+
export type GithubUser = {
|
|
77
|
+
readonly login?: string | null;
|
|
78
|
+
} | null;
|
|
79
|
+
export type GithubPullRequestReview = {
|
|
80
|
+
readonly id?: string | null;
|
|
81
|
+
readonly state?: string | null;
|
|
82
|
+
readonly body?: string | null;
|
|
83
|
+
readonly commit_id?: string | null;
|
|
84
|
+
readonly html_url?: string | null;
|
|
85
|
+
readonly author?: GithubUser;
|
|
86
|
+
};
|
|
87
|
+
export type GithubReviewThreadComment = {
|
|
88
|
+
readonly author?: GithubUser;
|
|
89
|
+
readonly body?: string | null;
|
|
90
|
+
readonly path?: string | null;
|
|
91
|
+
readonly url?: string | null;
|
|
92
|
+
readonly createdAt?: string | null;
|
|
93
|
+
};
|
|
94
|
+
export type GithubReviewThread = {
|
|
95
|
+
readonly id?: string | null;
|
|
96
|
+
readonly isResolved?: boolean | null;
|
|
97
|
+
readonly isOutdated?: boolean | null;
|
|
98
|
+
readonly comments?: {
|
|
99
|
+
readonly nodes?: readonly GithubReviewThreadComment[] | null;
|
|
100
|
+
readonly pageInfo?: {
|
|
101
|
+
readonly hasNextPage?: boolean | null;
|
|
102
|
+
readonly endCursor?: string | null;
|
|
103
|
+
} | null;
|
|
104
|
+
} | null;
|
|
105
|
+
};
|
|
106
|
+
export type GithubReviewComment = {
|
|
107
|
+
readonly id?: number | string | null;
|
|
108
|
+
readonly user?: GithubUser;
|
|
109
|
+
readonly author?: GithubUser;
|
|
110
|
+
readonly body?: string | null;
|
|
111
|
+
readonly path?: string | null;
|
|
112
|
+
readonly html_url?: string | null;
|
|
113
|
+
readonly url?: string | null;
|
|
114
|
+
readonly commit_id?: string | null;
|
|
115
|
+
readonly original_commit_id?: string | null;
|
|
116
|
+
};
|
|
117
|
+
export type GithubIssueComment = {
|
|
118
|
+
readonly id?: number | string | null;
|
|
119
|
+
readonly user?: GithubUser;
|
|
120
|
+
readonly author?: GithubUser;
|
|
121
|
+
readonly body?: string | null;
|
|
122
|
+
readonly html_url?: string | null;
|
|
123
|
+
readonly url?: string | null;
|
|
124
|
+
readonly created_at?: string | null;
|
|
125
|
+
};
|
|
126
|
+
export type PrCheckSummary = {
|
|
127
|
+
readonly name: string;
|
|
128
|
+
readonly status?: string | null;
|
|
129
|
+
readonly state?: string | null;
|
|
130
|
+
readonly conclusion?: string | null;
|
|
131
|
+
readonly detailsUrl?: string | null;
|
|
132
|
+
};
|
|
133
|
+
export type GithubStatusCheckRollupItem = PrCheckSummary & {
|
|
134
|
+
readonly __typename?: string | null;
|
|
135
|
+
readonly context?: string | null;
|
|
136
|
+
readonly detailsUrl?: string | null;
|
|
137
|
+
readonly link?: string | null;
|
|
138
|
+
readonly headSha?: string | null;
|
|
139
|
+
readonly head_sha?: string | null;
|
|
140
|
+
readonly output?: {
|
|
141
|
+
readonly title?: string | null;
|
|
142
|
+
readonly summary?: string | null;
|
|
143
|
+
readonly text?: string | null;
|
|
144
|
+
} | null;
|
|
145
|
+
readonly app?: {
|
|
146
|
+
readonly slug?: string | null;
|
|
147
|
+
readonly name?: string | null;
|
|
148
|
+
readonly owner?: GithubUser;
|
|
149
|
+
} | null;
|
|
150
|
+
};
|
|
151
|
+
export type GreptileScore = {
|
|
152
|
+
readonly value: number;
|
|
153
|
+
readonly scale: number;
|
|
154
|
+
readonly raw: string;
|
|
155
|
+
};
|
|
156
|
+
export type GreptileSignalSource = "api" | "github-review" | "github-check" | "changed-file-comment" | "issue-comment" | "review-thread" | "pr-body" | "pr-title";
|
|
157
|
+
export type GreptileSignalVerdict = "approved" | "rejected" | "skipped" | "pending" | "failed" | "completed";
|
|
158
|
+
export type GreptileSignalEvidence = {
|
|
159
|
+
readonly source: GreptileSignalSource;
|
|
160
|
+
readonly trusted: boolean;
|
|
161
|
+
readonly authorLogin?: string | null;
|
|
162
|
+
readonly reviewedSha?: string | null;
|
|
163
|
+
readonly current: boolean | null;
|
|
164
|
+
readonly stale: boolean;
|
|
165
|
+
readonly score?: GreptileScore | null;
|
|
166
|
+
readonly scores?: readonly GreptileScore[];
|
|
167
|
+
readonly explicitApproval?: boolean;
|
|
168
|
+
readonly verdict?: GreptileSignalVerdict | null;
|
|
169
|
+
readonly blocker?: boolean;
|
|
170
|
+
readonly actionable?: boolean;
|
|
171
|
+
readonly bodyExcerpt?: string;
|
|
172
|
+
};
|
|
173
|
+
export type GreptileApiSignalInput = {
|
|
174
|
+
readonly id?: string | null;
|
|
175
|
+
readonly body?: string | null;
|
|
176
|
+
readonly reviewedSha?: string | null;
|
|
177
|
+
readonly status?: string | null;
|
|
178
|
+
};
|
|
179
|
+
export type GreptileEvidence = {
|
|
180
|
+
readonly source: "api" | "github-review" | "github-check" | "github-comment" | "pr-body" | "combined" | "missing";
|
|
181
|
+
readonly currentHeadSha: string;
|
|
182
|
+
readonly reviewedSha?: string | null;
|
|
183
|
+
readonly fresh: boolean;
|
|
184
|
+
readonly completed: boolean;
|
|
185
|
+
readonly approved: boolean;
|
|
186
|
+
readonly score?: GreptileScore | null;
|
|
187
|
+
readonly explicitApproval?: boolean;
|
|
188
|
+
readonly blockers: readonly string[];
|
|
189
|
+
readonly unresolvedComments: readonly string[];
|
|
190
|
+
readonly rawBodies: readonly string[];
|
|
191
|
+
readonly signals: readonly GreptileSignalEvidence[];
|
|
192
|
+
readonly mapping: "score-5-of-5" | "explicit-approved" | "unproven" | "missing" | "stale";
|
|
193
|
+
};
|
|
194
|
+
export type PrReviewEvidence = {
|
|
195
|
+
readonly prUrl: string;
|
|
196
|
+
readonly prNumber: number;
|
|
197
|
+
readonly repoName: string;
|
|
198
|
+
readonly title: string;
|
|
199
|
+
readonly body: string;
|
|
200
|
+
readonly bodyEditorLogin?: string | null;
|
|
201
|
+
readonly bodyLastEditedAt?: string | null;
|
|
202
|
+
readonly headCommittedDate?: string | null;
|
|
203
|
+
readonly headSha: string;
|
|
204
|
+
readonly headRefName?: string | null;
|
|
205
|
+
readonly baseRefName?: string | null;
|
|
206
|
+
readonly state?: string | null;
|
|
207
|
+
readonly isDraft?: boolean | null;
|
|
208
|
+
readonly mergeable?: string | null;
|
|
209
|
+
readonly mergeStateStatus?: string | null;
|
|
210
|
+
readonly reviewDecision?: string | null;
|
|
211
|
+
readonly reviews: readonly GithubPullRequestReview[];
|
|
212
|
+
readonly reviewThreads: readonly GithubReviewThread[];
|
|
213
|
+
readonly changedFileReviewComments: readonly GithubReviewComment[];
|
|
214
|
+
readonly relevantIssueComments: readonly GithubIssueComment[];
|
|
215
|
+
readonly statusCheckRollup: readonly GithubStatusCheckRollupItem[];
|
|
216
|
+
readonly checkFailures: readonly string[];
|
|
217
|
+
readonly pendingChecks: readonly string[];
|
|
218
|
+
readonly readErrors: readonly string[];
|
|
219
|
+
readonly greptile: GreptileEvidence;
|
|
220
|
+
};
|
|
221
|
+
export type PrReviewCycleArtifacts = {
|
|
222
|
+
readonly root: string;
|
|
223
|
+
readonly prTitlePath: string;
|
|
224
|
+
readonly prBodyPath: string;
|
|
225
|
+
readonly prCommentsPath: string;
|
|
226
|
+
readonly reviewThreadsPath: string;
|
|
227
|
+
readonly reviewCommentsPath: string;
|
|
228
|
+
readonly checkRollupPath: string;
|
|
229
|
+
readonly greptileEvidencePath: string;
|
|
230
|
+
readonly mergeGateResultPath: string;
|
|
231
|
+
readonly steeringPromptPath: string;
|
|
232
|
+
readonly finalMergeGateResultPath?: string;
|
|
233
|
+
};
|
|
234
|
+
export type StrictPrMergeGateReasonCode = "read_error" | "missing_head_sha" | "ci_failed" | "check_pending" | "review_decision_blocking" | "review_thread_unresolved" | "greptile_missing" | "greptile_stale" | "greptile_pending" | "greptile_api_status_unknown" | "greptile_not_current_head" | "greptile_score_not_5" | "greptile_score_missing" | "greptile_mapping_unproven" | "greptile_blocker_text" | "greptile_unresolved_comment";
|
|
235
|
+
export type StrictPrMergeGateReason = {
|
|
236
|
+
readonly code: StrictPrMergeGateReasonCode;
|
|
237
|
+
readonly reasonClass: "pending" | "reject";
|
|
238
|
+
readonly surface: "github" | "ci" | "review" | "greptile";
|
|
239
|
+
readonly suggestedAction: "wait" | "fix" | "ask_greptile" | "needs_attention";
|
|
240
|
+
readonly message: string;
|
|
241
|
+
readonly headSha?: string | null;
|
|
242
|
+
readonly reviewedSha?: string | null;
|
|
243
|
+
};
|
|
244
|
+
export type StrictPrMergeGateResult = {
|
|
245
|
+
readonly approved: boolean;
|
|
246
|
+
readonly pending: boolean;
|
|
247
|
+
readonly reasons: readonly string[];
|
|
248
|
+
readonly reasonDetails: readonly StrictPrMergeGateReason[];
|
|
249
|
+
readonly warnings: readonly string[];
|
|
250
|
+
readonly actionableFeedback: readonly string[];
|
|
251
|
+
readonly evidence: PrReviewEvidence;
|
|
252
|
+
readonly artifacts?: PrReviewCycleArtifacts;
|
|
253
|
+
readonly steeringPrompt: string;
|
|
254
|
+
};
|
|
255
|
+
export type StrictPrGreptileApiFetch = (input: Parameters<typeof fetch>[0], init?: Parameters<typeof fetch>[1]) => ReturnType<typeof fetch>;
|
|
256
|
+
export type StrictPrGreptileApiOptions = {
|
|
257
|
+
readonly enabled?: boolean;
|
|
258
|
+
readonly env?: Record<string, string | undefined>;
|
|
259
|
+
readonly fetch?: StrictPrGreptileApiFetch;
|
|
260
|
+
};
|
|
261
|
+
export type StrictPrMergeGateInput = {
|
|
262
|
+
readonly projectRoot: string;
|
|
263
|
+
readonly prUrl: string;
|
|
264
|
+
readonly taskId: string;
|
|
265
|
+
readonly runId: string;
|
|
266
|
+
readonly cycle: number;
|
|
267
|
+
readonly command: GitHubCommandRunner;
|
|
268
|
+
readonly artifactRoot?: string | null;
|
|
269
|
+
readonly allowedFailures?: readonly string[];
|
|
270
|
+
readonly apiSignals?: readonly GreptileApiSignalInput[];
|
|
271
|
+
readonly greptileApi?: StrictPrGreptileApiOptions;
|
|
272
|
+
readonly final?: boolean;
|
|
273
|
+
readonly requireGreptile?: boolean;
|
|
274
|
+
};
|
|
275
|
+
export type VerifyOutcome = {
|
|
276
|
+
approved: boolean;
|
|
277
|
+
localReasons: string[];
|
|
278
|
+
aiReasons: string[];
|
|
279
|
+
aiWarnings: string[];
|
|
280
|
+
aiVerdict: "APPROVE" | "REJECT" | "SKIP";
|
|
281
|
+
reviewFeedbackPath: string;
|
|
282
|
+
reviewStatePath: string;
|
|
283
|
+
};
|
|
284
|
+
/** Capability id the pr-review plugin registers its merge-head-SHA resolver under. */
|
|
285
|
+
export declare const PR_MERGE_GATE_CAPABILITY_ID = "rig.mergeGate.resolveHeadSha";
|
|
286
|
+
/** Pure input to the merge-head-SHA resolver: the gate result + target PR. */
|
|
287
|
+
export type ResolveMergeHeadShaInput = {
|
|
288
|
+
readonly result: StrictPrMergeGateResult;
|
|
289
|
+
readonly prUrl: string;
|
|
290
|
+
/** Defaults to true at the impl; gate enforces Greptile freshness when set. */
|
|
291
|
+
readonly requireGreptile?: boolean;
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* The cohesive merge-gate seam the default lifecycle bundle depends on. Owned +
|
|
295
|
+
* provided by `@rig/pr-review-plugin` under {@link PR_MERGE_GATE_CAPABILITY_ID};
|
|
296
|
+
* `@rig/bundle-default-lifecycle` resolves it off the host instead of importing
|
|
297
|
+
* `@rig/pr-review-plugin`. Surfaces exactly the merge-gate operations the bundle
|
|
298
|
+
* uses (gate run + head-SHA resolution + the evidence-collection/evaluation
|
|
299
|
+
* primitives the verifier composes). Types only here — VOCAB, no behaviour.
|
|
300
|
+
*/
|
|
301
|
+
export interface PrMergeGateService {
|
|
302
|
+
/**
|
|
303
|
+
* Given an approved gate result + PR url, return the raw 40-char head SHA it
|
|
304
|
+
* is safe to merge (throws when not approved / not tied to head). Pure.
|
|
305
|
+
*/
|
|
306
|
+
resolveHeadSha(input: ResolveMergeHeadShaInput): string;
|
|
307
|
+
/** Run the full strict merge gate (collect evidence + evaluate + artifacts). */
|
|
308
|
+
runGate(input: StrictPrMergeGateInput): Promise<StrictPrMergeGateResult>;
|
|
309
|
+
/** Collect the PR review evidence the gate evaluates (IO). */
|
|
310
|
+
collectEvidence(input: StrictPrMergeGateInput): Promise<PrReviewEvidence>;
|
|
311
|
+
/** Evaluate already-collected evidence into a gate decision (pure). */
|
|
312
|
+
evaluateGate(evidence: PrReviewEvidence, requireGreptile?: boolean): Omit<StrictPrMergeGateResult, "artifacts" | "steeringPrompt">;
|
|
313
|
+
/** Parse a Greptile review score from a review body (pure). */
|
|
314
|
+
parseGreptileScore(input: string): GreptileScore | null;
|
|
315
|
+
/** Strip HTML to plain text (pure). */
|
|
316
|
+
stripHtml(input: string): string;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Typed capability id, phantom-typed with {@link PrMergeGateService} so
|
|
320
|
+
* `defineCapability(PR_MERGE_GATE)` resolves with no cast leaking to callers.
|
|
321
|
+
* String value is {@link PR_MERGE_GATE_CAPABILITY_ID}.
|
|
322
|
+
*/
|
|
323
|
+
export declare const PR_MERGE_GATE: CapabilityId<PrMergeGateService>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/capability-id.ts
|
|
3
|
+
function makeCapabilityId(id) {
|
|
4
|
+
return id;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// packages/contracts/src/control-plane-types.ts
|
|
8
|
+
var PR_MERGE_GATE_CAPABILITY_ID = "rig.mergeGate.resolveHeadSha";
|
|
9
|
+
var PR_MERGE_GATE = makeCapabilityId(PR_MERGE_GATE_CAPABILITY_ID);
|
|
10
|
+
export {
|
|
11
|
+
PR_MERGE_GATE_CAPABILITY_ID,
|
|
12
|
+
PR_MERGE_GATE
|
|
13
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const EngineMessageRole: Schema.Literals<readonly ["user", "assistant", "system"]>;
|
|
3
|
+
export type EngineMessageRole = typeof EngineMessageRole.Type;
|
|
4
|
+
export declare const EngineMessageState: Schema.Literals<readonly ["streaming", "completed", "interrupted", "errored"]>;
|
|
5
|
+
export type EngineMessageState = typeof EngineMessageState.Type;
|
|
6
|
+
export declare const ConversationSummary: Schema.Struct<{
|
|
7
|
+
readonly id: Schema.brand<Schema.Trim, "ConversationId">;
|
|
8
|
+
readonly runId: Schema.brand<Schema.Trim, "RunId">;
|
|
9
|
+
readonly title: Schema.Trim;
|
|
10
|
+
readonly createdAt: Schema.String;
|
|
11
|
+
readonly updatedAt: Schema.String;
|
|
12
|
+
}>;
|
|
13
|
+
export type ConversationSummary = typeof ConversationSummary.Type;
|
|
14
|
+
export declare const EngineMessage: Schema.Struct<{
|
|
15
|
+
readonly id: Schema.brand<Schema.Trim, "MessageId">;
|
|
16
|
+
readonly conversationId: Schema.brand<Schema.Trim, "ConversationId">;
|
|
17
|
+
readonly role: Schema.Literals<readonly ["user", "assistant", "system"]>;
|
|
18
|
+
readonly text: Schema.String;
|
|
19
|
+
readonly attachments: Schema.$Array<Schema.Unknown>;
|
|
20
|
+
readonly state: Schema.Literals<readonly ["streaming", "completed", "interrupted", "errored"]>;
|
|
21
|
+
readonly createdAt: Schema.String;
|
|
22
|
+
readonly completedAt: Schema.NullOr<Schema.String>;
|
|
23
|
+
}>;
|
|
24
|
+
export type EngineMessage = typeof EngineMessage.Type;
|
|
25
|
+
export declare const EngineAction: Schema.Struct<{
|
|
26
|
+
readonly id: Schema.brand<Schema.Trim, "ActionId">;
|
|
27
|
+
readonly runId: Schema.brand<Schema.Trim, "RunId">;
|
|
28
|
+
readonly messageId: Schema.NullOr<Schema.brand<Schema.Trim, "MessageId">>;
|
|
29
|
+
readonly actionType: Schema.Trim;
|
|
30
|
+
readonly title: Schema.Trim;
|
|
31
|
+
readonly detail: Schema.NullOr<Schema.String>;
|
|
32
|
+
readonly state: Schema.Trim;
|
|
33
|
+
readonly payload: Schema.Unknown;
|
|
34
|
+
readonly startedAt: Schema.String;
|
|
35
|
+
readonly completedAt: Schema.NullOr<Schema.String>;
|
|
36
|
+
}>;
|
|
37
|
+
export type EngineAction = typeof EngineAction.Type;
|
|
38
|
+
export declare const EngineLogTone: Schema.Literals<readonly ["thinking", "tool", "info", "error"]>;
|
|
39
|
+
export type EngineLogTone = typeof EngineLogTone.Type;
|
|
40
|
+
export declare const EngineRunLog: Schema.Struct<{
|
|
41
|
+
readonly id: Schema.Trim;
|
|
42
|
+
readonly runId: Schema.brand<Schema.Trim, "RunId">;
|
|
43
|
+
readonly title: Schema.Trim;
|
|
44
|
+
readonly detail: Schema.NullOr<Schema.String>;
|
|
45
|
+
readonly tone: Schema.Literals<readonly ["thinking", "tool", "info", "error"]>;
|
|
46
|
+
readonly status: Schema.NullOr<Schema.Trim>;
|
|
47
|
+
readonly payload: Schema.Unknown;
|
|
48
|
+
readonly createdAt: Schema.String;
|
|
49
|
+
}>;
|
|
50
|
+
export type EngineRunLog = typeof EngineRunLog.Type;
|
package/dist/src/conversation.js
CHANGED
|
@@ -16,6 +16,9 @@ var WorkspaceId = makeEntityId("WorkspaceId");
|
|
|
16
16
|
var GraphId = makeEntityId("GraphId");
|
|
17
17
|
var TaskId = makeEntityId("TaskId");
|
|
18
18
|
var RunId = makeEntityId("RunId");
|
|
19
|
+
var SafePathSegment = TrimmedNonEmptyString.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)).pipe(Schema.brand("SafePathSegment"));
|
|
20
|
+
var SafeRunId = TrimmedNonEmptyString.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/)).pipe(Schema.brand("SafeRunId"));
|
|
21
|
+
var SafeGitRefComponent = TrimmedNonEmptyString.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)).pipe(Schema.brand("SafeGitRefComponent"));
|
|
19
22
|
var EngineRuntimeId = makeEntityId("EngineRuntimeId");
|
|
20
23
|
var ConversationId = makeEntityId("ConversationId");
|
|
21
24
|
var ActionId = makeEntityId("ActionId");
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `workspace.dependency-preflight` capability seam.
|
|
3
|
+
*
|
|
4
|
+
* Pure capability VOCAB (no impl). The init/setup plugin (@rig/init-plugin)
|
|
5
|
+
* PROVIDES the concrete service — it mutates `package.json` to pin the project's
|
|
6
|
+
* `@rig/*` config deps and runs the package manager's install — and the CLI seed
|
|
7
|
+
* (`packages/cli/bin/rig.ts`) RESOLVES it by id off a plugin host built from the
|
|
8
|
+
* embedded standard plugins, invoking it only on the rig.config.ts power-path
|
|
9
|
+
* fallback (a code config present that the project-binary build did not handle).
|
|
10
|
+
*
|
|
11
|
+
* The heavy install/mutate impl therefore lives in the setup plugin, NOT in a
|
|
12
|
+
* CLI seed module on the hot path: the seed neither imports nor bundles it
|
|
13
|
+
* eagerly — it is reached purely through this typed seam.
|
|
14
|
+
*/
|
|
15
|
+
import type { CapabilityId } from "./capability-id";
|
|
16
|
+
/** Inputs the CLI seed hands the preflight. The CLI owns version detection (it
|
|
17
|
+
* reads its OWN installed version), so it passes the resolved values in rather
|
|
18
|
+
* than the floor library reaching back into CLI-specific version resolution. */
|
|
19
|
+
export type RigConfigDependencyPreflightInput = {
|
|
20
|
+
/** Project root whose `package.json` / config deps are reconciled. */
|
|
21
|
+
readonly projectRoot: string;
|
|
22
|
+
/** The CLI's own resolved installed version (drives the `@rig/*` dep pin). */
|
|
23
|
+
readonly installedCliVersion: string;
|
|
24
|
+
/** Whether {@link installedCliVersion} is a published (non source/dev) version;
|
|
25
|
+
* when false the deps pin to `latest`. */
|
|
26
|
+
readonly isInstalledCliVersionPublished: boolean;
|
|
27
|
+
};
|
|
28
|
+
/** Outcome of a dependency preflight pass. */
|
|
29
|
+
export type RigConfigDependencyPreflightResult = {
|
|
30
|
+
readonly rewroteManifest: boolean;
|
|
31
|
+
readonly ranInstall: boolean;
|
|
32
|
+
readonly command: string | null;
|
|
33
|
+
readonly version: string;
|
|
34
|
+
};
|
|
35
|
+
/** The dependency-preflight service the setup plugin provides and the CLI seed
|
|
36
|
+
* resolves by id off a host. */
|
|
37
|
+
export interface RigConfigDependencyPreflightService {
|
|
38
|
+
ensureInstalled(input: RigConfigDependencyPreflightInput): RigConfigDependencyPreflightResult;
|
|
39
|
+
}
|
|
40
|
+
/** The capability id string the setup plugin provides and the CLI seed resolves. */
|
|
41
|
+
export declare const DEPENDENCY_PREFLIGHT_CAPABILITY_ID = "workspace.dependency-preflight";
|
|
42
|
+
/** The typed capability id, phantom-typed with {@link RigConfigDependencyPreflightService}. */
|
|
43
|
+
export declare const DEPENDENCY_PREFLIGHT_CAPABILITY: CapabilityId<RigConfigDependencyPreflightService>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/capability-id.ts
|
|
3
|
+
function makeCapabilityId(id) {
|
|
4
|
+
return id;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// packages/contracts/src/dependency-preflight.ts
|
|
8
|
+
var DEPENDENCY_PREFLIGHT_CAPABILITY_ID = "workspace.dependency-preflight";
|
|
9
|
+
var DEPENDENCY_PREFLIGHT_CAPABILITY = makeCapabilityId(DEPENDENCY_PREFLIGHT_CAPABILITY_ID);
|
|
10
|
+
export {
|
|
11
|
+
DEPENDENCY_PREFLIGHT_CAPABILITY_ID,
|
|
12
|
+
DEPENDENCY_PREFLIGHT_CAPABILITY
|
|
13
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* doctor.ts — pure diagnostic vocabulary for the doctor product domain.
|
|
3
|
+
*
|
|
4
|
+
* The diagnostic implementation (toolchain probes, rig.config loadability,
|
|
5
|
+
* GitHub auth/permission checks, Pi/run/relay discovery, remediation copy)
|
|
6
|
+
* lives in @rig/doctor-plugin and is resolved by substrate consumers (CLI
|
|
7
|
+
* surface, rig-extension) through the typed port in
|
|
8
|
+
* `@rig/runtime/control-plane/doctor-service-port` under
|
|
9
|
+
* {@link DOCTOR_RUNNER_CAPABILITY_ID}. This file holds ONLY the pure types and
|
|
10
|
+
* pure helpers shared by producer and consumers — no IO, no plugin imports.
|
|
11
|
+
*/
|
|
12
|
+
import type { CapabilityId } from "./capability-id";
|
|
13
|
+
/** The capability id the doctor plugin registers its runner under. */
|
|
14
|
+
export declare const DOCTOR_RUNNER_CAPABILITY_ID = "doctor.runner";
|
|
15
|
+
export type DoctorStatus = "pass" | "warn" | "fail";
|
|
16
|
+
export type DoctorLevel = "ok" | "warn" | "fail";
|
|
17
|
+
export type DoctorCheck = {
|
|
18
|
+
readonly id?: string;
|
|
19
|
+
readonly label: string;
|
|
20
|
+
readonly status?: DoctorStatus;
|
|
21
|
+
readonly level?: DoctorLevel;
|
|
22
|
+
readonly detail?: string;
|
|
23
|
+
readonly remediation?: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Structural mirror of the runtime's `RigIdentityContext` (in
|
|
27
|
+
* `@rig/runtime/control-plane/identity`). The diagnostic runner reads the
|
|
28
|
+
* GitHub/session identity off this context; the field references a runtime
|
|
29
|
+
* shape, so — exactly like memory's `MemoryCommandEventSink` — it is typed here
|
|
30
|
+
* as a minimal contracts-owned interface carrying only the structure the runner
|
|
31
|
+
* needs. The runtime's `RigIdentityContext` is structurally identical and so
|
|
32
|
+
* flows in/out without a cast, keeping the contract free of any runtime import.
|
|
33
|
+
*/
|
|
34
|
+
export interface DoctorIdentityContext {
|
|
35
|
+
readonly sessionManager: {
|
|
36
|
+
getCwd(): string;
|
|
37
|
+
getSessionId(): string;
|
|
38
|
+
getBranch(): readonly {
|
|
39
|
+
type: string;
|
|
40
|
+
customType?: string;
|
|
41
|
+
data?: unknown;
|
|
42
|
+
}[];
|
|
43
|
+
};
|
|
44
|
+
readonly modelRegistry?: {
|
|
45
|
+
readonly authStorage?: {
|
|
46
|
+
getOAuthAccountIdentity?: (provider: string, sessionId?: string) => unknown;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Options the substrate passes through to the diagnostic runner. The function
|
|
52
|
+
* fields are typed loosely (the consumers only read `.length`/labels); the
|
|
53
|
+
* plugin impl supplies concrete client-backed defaults. Keeping these signatures
|
|
54
|
+
* free of @rig/client types keeps the contract (and runtime) decoupled from
|
|
55
|
+
* client.
|
|
56
|
+
*/
|
|
57
|
+
export type RunDoctorChecksOptions = {
|
|
58
|
+
readonly projectRoot: string;
|
|
59
|
+
readonly requestJson?: (pathname: string, init?: RequestInit) => Promise<unknown>;
|
|
60
|
+
readonly piChecks?: () => Promise<readonly {
|
|
61
|
+
ok: boolean;
|
|
62
|
+
label: string;
|
|
63
|
+
detail?: string;
|
|
64
|
+
hint?: string;
|
|
65
|
+
}[]>;
|
|
66
|
+
readonly which?: (binary: string) => string | null;
|
|
67
|
+
readonly bunVersion?: string;
|
|
68
|
+
readonly loadConfig?: (projectRoot: string) => Promise<unknown>;
|
|
69
|
+
readonly onProgress?: (label: string) => void;
|
|
70
|
+
readonly identityContext?: DoctorIdentityContext;
|
|
71
|
+
readonly listRuns?: (projectRoot: string) => Promise<readonly unknown[]>;
|
|
72
|
+
readonly listPlacements?: (projectRoot: string) => readonly unknown[];
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* The cohesive diagnostic operation the substrate depends on. This is pure
|
|
76
|
+
* capability VOCAB: `@rig/doctor-plugin` provides a concrete impl (statically
|
|
77
|
+
* checked against this interface via `DoctorCap.provide`), and the substrate
|
|
78
|
+
* only ever sees this contract — resolved by id off a plugin host with no
|
|
79
|
+
* `as unknown as` at any call site.
|
|
80
|
+
*/
|
|
81
|
+
export interface DoctorService {
|
|
82
|
+
runDoctorChecks(options: RunDoctorChecksOptions): Promise<DoctorCheck[]>;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The typed capability id the doctor plugin provides and consumers require.
|
|
86
|
+
* Phantom-typed with {@link DoctorService} so `DoctorCap.require(host)` returns
|
|
87
|
+
* a `DoctorService` with no cast leaking to callers. Its string value is
|
|
88
|
+
* {@link DOCTOR_RUNNER_CAPABILITY_ID}, so it indexes the same host entry.
|
|
89
|
+
*/
|
|
90
|
+
export declare const DOCTOR: CapabilityId<DoctorService>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/capability-id.ts
|
|
3
|
+
function makeCapabilityId(id) {
|
|
4
|
+
return id;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// packages/contracts/src/doctor.ts
|
|
8
|
+
var DOCTOR_RUNNER_CAPABILITY_ID = "doctor.runner";
|
|
9
|
+
var DOCTOR = makeCapabilityId(DOCTOR_RUNNER_CAPABILITY_ID);
|
|
10
|
+
export {
|
|
11
|
+
DOCTOR_RUNNER_CAPABILITY_ID,
|
|
12
|
+
DOCTOR
|
|
13
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const DriftKind: Schema.Literals<readonly ["deleted-reference", "stale-anchor", "semantic-mismatch", "issue-mismatch"]>;
|
|
3
|
+
export type DriftKind = typeof DriftKind.Type;
|
|
4
|
+
export declare const DriftConfidence: Schema.Literals<readonly ["high", "medium", "low"]>;
|
|
5
|
+
export type DriftConfidence = typeof DriftConfidence.Type;
|
|
6
|
+
export declare const DriftFinding: Schema.Struct<{
|
|
7
|
+
readonly kind: Schema.Literals<readonly ["deleted-reference", "stale-anchor", "semantic-mismatch", "issue-mismatch"]>;
|
|
8
|
+
readonly docPath: Schema.Trim;
|
|
9
|
+
readonly line: Schema.NullOr<Schema.Int>;
|
|
10
|
+
readonly reference: Schema.NullOr<Schema.Trim>;
|
|
11
|
+
readonly detail: Schema.String;
|
|
12
|
+
readonly confidence: Schema.Literals<readonly ["high", "medium", "low"]>;
|
|
13
|
+
}>;
|
|
14
|
+
export type DriftFinding = typeof DriftFinding.Type;
|
|
15
|
+
export declare const DriftReport: Schema.Struct<{
|
|
16
|
+
readonly generatedAt: Schema.String;
|
|
17
|
+
readonly scanned: Schema.Int;
|
|
18
|
+
readonly degraded: Schema.Boolean;
|
|
19
|
+
readonly findings: Schema.$Array<Schema.Struct<{
|
|
20
|
+
readonly kind: Schema.Literals<readonly ["deleted-reference", "stale-anchor", "semantic-mismatch", "issue-mismatch"]>;
|
|
21
|
+
readonly docPath: Schema.Trim;
|
|
22
|
+
readonly line: Schema.NullOr<Schema.Int>;
|
|
23
|
+
readonly reference: Schema.NullOr<Schema.Trim>;
|
|
24
|
+
readonly detail: Schema.String;
|
|
25
|
+
readonly confidence: Schema.Literals<readonly ["high", "medium", "low"]>;
|
|
26
|
+
}>>;
|
|
27
|
+
}>;
|
|
28
|
+
export type DriftReport = typeof DriftReport.Type;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/drift.ts
|
|
3
|
+
import { Schema as Schema2 } from "effect";
|
|
4
|
+
|
|
5
|
+
// packages/contracts/src/baseSchemas.ts
|
|
6
|
+
import { Schema } from "effect";
|
|
7
|
+
var TrimmedString = Schema.Trim;
|
|
8
|
+
var TrimmedNonEmptyString = TrimmedString.check(Schema.isNonEmpty());
|
|
9
|
+
var NonNegativeInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
|
|
10
|
+
var PositiveInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1));
|
|
11
|
+
var IsoDateTime = Schema.String;
|
|
12
|
+
var makeEntityId = (brand) => TrimmedNonEmptyString.pipe(Schema.brand(brand));
|
|
13
|
+
var ThreadId = makeEntityId("ThreadId");
|
|
14
|
+
var ProjectId = makeEntityId("ProjectId");
|
|
15
|
+
var WorkspaceId = makeEntityId("WorkspaceId");
|
|
16
|
+
var GraphId = makeEntityId("GraphId");
|
|
17
|
+
var TaskId = makeEntityId("TaskId");
|
|
18
|
+
var RunId = makeEntityId("RunId");
|
|
19
|
+
var SafePathSegment = TrimmedNonEmptyString.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)).pipe(Schema.brand("SafePathSegment"));
|
|
20
|
+
var SafeRunId = TrimmedNonEmptyString.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/)).pipe(Schema.brand("SafeRunId"));
|
|
21
|
+
var SafeGitRefComponent = TrimmedNonEmptyString.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)).pipe(Schema.brand("SafeGitRefComponent"));
|
|
22
|
+
var EngineRuntimeId = makeEntityId("EngineRuntimeId");
|
|
23
|
+
var ConversationId = makeEntityId("ConversationId");
|
|
24
|
+
var ActionId = makeEntityId("ActionId");
|
|
25
|
+
var ArtifactId = makeEntityId("ArtifactId");
|
|
26
|
+
var WorktreeId = makeEntityId("WorktreeId");
|
|
27
|
+
var ValidationResultId = makeEntityId("ValidationResultId");
|
|
28
|
+
var ReviewResultId = makeEntityId("ReviewResultId");
|
|
29
|
+
var CommandId = makeEntityId("CommandId");
|
|
30
|
+
var EventId = makeEntityId("EventId");
|
|
31
|
+
var MessageId = makeEntityId("MessageId");
|
|
32
|
+
var TurnId = makeEntityId("TurnId");
|
|
33
|
+
var ProviderItemId = makeEntityId("ProviderItemId");
|
|
34
|
+
var RuntimeSessionId = makeEntityId("RuntimeSessionId");
|
|
35
|
+
var RuntimeItemId = makeEntityId("RuntimeItemId");
|
|
36
|
+
var RuntimeRequestId = makeEntityId("RuntimeRequestId");
|
|
37
|
+
var RuntimeTaskId = makeEntityId("RuntimeTaskId");
|
|
38
|
+
var ApprovalRequestId = makeEntityId("ApprovalRequestId");
|
|
39
|
+
var CheckpointRef = makeEntityId("CheckpointRef");
|
|
40
|
+
var RemoteEndpointId = makeEntityId("RemoteEndpointId");
|
|
41
|
+
|
|
42
|
+
// packages/contracts/src/drift.ts
|
|
43
|
+
var DriftKind = Schema2.Literals([
|
|
44
|
+
"deleted-reference",
|
|
45
|
+
"stale-anchor",
|
|
46
|
+
"semantic-mismatch",
|
|
47
|
+
"issue-mismatch"
|
|
48
|
+
]);
|
|
49
|
+
var DriftConfidence = Schema2.Literals(["high", "medium", "low"]);
|
|
50
|
+
var DriftFinding = Schema2.Struct({
|
|
51
|
+
kind: DriftKind,
|
|
52
|
+
docPath: TrimmedNonEmptyString,
|
|
53
|
+
line: Schema2.NullOr(PositiveInt),
|
|
54
|
+
reference: Schema2.NullOr(TrimmedNonEmptyString),
|
|
55
|
+
detail: Schema2.String,
|
|
56
|
+
confidence: DriftConfidence
|
|
57
|
+
});
|
|
58
|
+
var DriftReport = Schema2.Struct({
|
|
59
|
+
generatedAt: IsoDateTime,
|
|
60
|
+
scanned: NonNegativeInt,
|
|
61
|
+
degraded: Schema2.Boolean,
|
|
62
|
+
findings: Schema2.Array(DriftFinding)
|
|
63
|
+
});
|
|
64
|
+
export {
|
|
65
|
+
DriftReport,
|
|
66
|
+
DriftKind,
|
|
67
|
+
DriftFinding,
|
|
68
|
+
DriftConfidence
|
|
69
|
+
};
|