@h-rig/contracts 0.0.0-e2e-live.20260630085347
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 +14 -0
- package/dist/index.cjs +3442 -0
- package/dist/index.mjs +3401 -0
- package/dist/src/agent-roles.d.ts +8 -0
- package/dist/src/agent-roles.js +1 -0
- package/dist/src/artifact.d.ts +13 -0
- package/dist/src/artifact.js +56 -0
- package/dist/src/baseSchemas.d.ts +63 -0
- package/dist/src/baseSchemas.js +72 -0
- package/dist/src/blocker-classifier.d.ts +21 -0
- package/dist/src/blocker-classifier.js +13 -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/cockpit.d.ts +58 -0
- package/dist/src/cockpit.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 +553 -0
- package/dist/src/config.js +822 -0
- 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 +98 -0
- package/dist/src/dependency-preflight.d.ts +43 -0
- package/dist/src/dependency-preflight.js +13 -0
- package/dist/src/docs-drift.d.ts +10 -0
- package/dist/src/docs-drift.js +12 -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 +58 -0
- package/dist/src/errors.d.ts +13 -0
- package/dist/src/errors.js +17 -0
- package/dist/src/git.d.ts +152 -0
- package/dist/src/git.js +196 -0
- package/dist/src/github.d.ts +295 -0
- package/dist/src/github.js +17 -0
- package/dist/src/graph.d.ts +360 -0
- package/dist/src/graph.js +229 -0
- package/dist/src/guard.d.ts +118 -0
- package/dist/src/guard.js +15 -0
- package/dist/src/harness-events.d.ts +8 -0
- package/dist/src/harness-events.js +1 -0
- package/dist/src/harness-profile-state.d.ts +10 -0
- package/dist/src/harness-profile-state.js +13 -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 +98 -0
- package/dist/src/index.js +3401 -0
- 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 +122 -0
- package/dist/src/layout.d.ts +44 -0
- package/dist/src/layout.js +8 -0
- package/dist/src/lifecycle-capabilities.d.ts +224 -0
- package/dist/src/lifecycle-capabilities.js +45 -0
- package/dist/src/managed-repos.d.ts +339 -0
- package/dist/src/managed-repos.js +37 -0
- package/dist/src/memory.d.ts +199 -0
- package/dist/src/memory.js +15 -0
- package/dist/src/model.d.ts +13 -0
- package/dist/src/model.js +9 -0
- package/dist/src/native-toolchain.d.ts +46 -0
- package/dist/src/native-toolchain.js +13 -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 +98 -0
- 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/placement.d.ts +47 -0
- package/dist/src/placement.js +13 -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 +384 -0
- package/dist/src/policy.d.ts +16 -0
- package/dist/src/policy.js +59 -0
- package/dist/src/product-entrypoint.d.ts +22 -0
- package/dist/src/product-entrypoint.js +13 -0
- package/dist/src/project.d.ts +71 -0
- package/dist/src/project.js +110 -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 +194 -0
- package/dist/src/remote-control.d.ts +93 -0
- package/dist/src/remote-control.js +26 -0
- package/dist/src/remote.d.ts +318 -0
- package/dist/src/remote.js +634 -0
- package/dist/src/review.d.ts +18 -0
- package/dist/src/review.js +61 -0
- package/dist/src/rollups.d.ts +41 -0
- package/dist/src/rollups.js +70 -0
- package/dist/src/run-control.d.ts +164 -0
- package/dist/src/run-control.js +13 -0
- package/dist/src/run-discovery.d.ts +83 -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-queue.d.ts +36 -0
- package/dist/src/run-queue.js +13 -0
- package/dist/src/run-read-model.d.ts +200 -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 +154 -0
- package/dist/src/run-session-journal.js +87 -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-secrets.d.ts +10 -0
- package/dist/src/runtime-secrets.js +13 -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 +210 -0
- package/dist/src/session-asset-materializer.d.ts +35 -0
- package/dist/src/session-asset-materializer.js +13 -0
- package/dist/src/session-hook-materializer.d.ts +41 -0
- package/dist/src/session-hook-materializer.js +13 -0
- package/dist/src/setup.d.ts +154 -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 +336 -0
- package/dist/src/supervisor-loop.d.ts +40 -0
- package/dist/src/supervisor-loop.js +13 -0
- package/dist/src/task-artifacts.d.ts +53 -0
- package/dist/src/task-artifacts.js +13 -0
- package/dist/src/task-config.d.ts +22 -0
- package/dist/src/task-config.js +1 -0
- package/dist/src/task-context-renderer.d.ts +29 -0
- package/dist/src/task-context-renderer.js +13 -0
- package/dist/src/task-data.d.ts +196 -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 +167 -0
- package/dist/src/task-source.js +25 -0
- package/dist/src/task-state-metadata.d.ts +21 -0
- package/dist/src/task-state-metadata.js +1 -0
- package/dist/src/task-state-paths.d.ts +14 -0
- package/dist/src/task-state-paths.js +13 -0
- package/dist/src/task-state-store.d.ts +36 -0
- package/dist/src/task-state-store.js +17 -0
- package/dist/src/task-tracker-state.d.ts +101 -0
- package/dist/src/task-tracker-state.js +39 -0
- package/dist/src/terminal.d.ts +130 -0
- package/dist/src/terminal.js +161 -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/transport-config.d.ts +161 -0
- package/dist/src/transport-config.js +15 -0
- package/dist/src/validation.d.ts +14 -0
- package/dist/src/validation.js +63 -0
- package/dist/src/workflow-journal.d.ts +125 -0
- package/dist/src/workflow-journal.js +27 -0
- package/dist/src/workspace-config.d.ts +18 -0
- package/dist/src/workspace-config.js +13 -0
- package/dist/src/workspace-service.d.ts +16 -0
- package/dist/src/workspace-service.js +13 -0
- package/dist/src/workspace.d.ts +204 -0
- package/dist/src/workspace.js +195 -0
- package/package.json +79 -0
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure GitHub-provider contract types.
|
|
3
|
+
*
|
|
4
|
+
* This is the neutral home for the GitHub SCM-provider data model so that the
|
|
5
|
+
* @rig/github-provider-plugin (which owns the implementation), the
|
|
6
|
+
* @rig/task-sources-plugin (which consumes the credential-provider abstraction),
|
|
7
|
+
* and any future dumb runtime substrate can all reference the same vocabulary
|
|
8
|
+
* without a substrate->plugin import cycle. These types carry no behaviour and
|
|
9
|
+
* import nothing — exactly like `memory.ts` / `lifecycle-capabilities.ts`.
|
|
10
|
+
*
|
|
11
|
+
* The plugin registers its executable GitHub-provider service under
|
|
12
|
+
* {@link GITHUB_PROVIDER_CAPABILITY_ID} on `contributes.capabilities[].run`; a
|
|
13
|
+
* dumb substrate consumer would resolve it by id from a plugin host built from
|
|
14
|
+
* the project's rig.config via a typed port — the same seam shape proven by
|
|
15
|
+
* the memory/lifecycle capability ports. (Today the only substrate-facing
|
|
16
|
+
* GitHub primitive — reading a token from an env-pointed state file — stays in
|
|
17
|
+
* @rig/runtime/control-plane/github/token-env as a dumb reader; the policy that
|
|
18
|
+
* produces that token lives in this plugin.)
|
|
19
|
+
*/
|
|
20
|
+
import type { CapabilityId } from "./capability-id";
|
|
21
|
+
/** Capability id the GitHub-provider plugin registers its service factory under. */
|
|
22
|
+
export declare const GITHUB_PROVIDER_CAPABILITY_ID = "github.provider";
|
|
23
|
+
export type GitHubCredentialPurpose = "selected-repo" | "admin-fallback";
|
|
24
|
+
export type GitHubCredentialSource = "signed-in-user" | "host-admin-fallback";
|
|
25
|
+
export type GitHubCredentialProviderOptions = {
|
|
26
|
+
/**
|
|
27
|
+
* Session-scoped tokens keyed as:
|
|
28
|
+
* `user:<userId>|repo:<owner>/<repo>|workspace:<workspaceId>`.
|
|
29
|
+
* This intentionally models the app/session auth boundary; host tokens are
|
|
30
|
+
* not used for normal selected-repo operations.
|
|
31
|
+
*/
|
|
32
|
+
sessionTokens?: Readonly<Record<string, string>>;
|
|
33
|
+
hostToken?: string | null;
|
|
34
|
+
};
|
|
35
|
+
export type ResolveGitHubTokenInput = {
|
|
36
|
+
owner: string;
|
|
37
|
+
repo: string;
|
|
38
|
+
workspaceId: string;
|
|
39
|
+
userId?: string;
|
|
40
|
+
purpose: GitHubCredentialPurpose;
|
|
41
|
+
};
|
|
42
|
+
export type ResolvedGitHubToken = {
|
|
43
|
+
token: string;
|
|
44
|
+
source: GitHubCredentialSource;
|
|
45
|
+
};
|
|
46
|
+
export interface GitHubCredentialProvider {
|
|
47
|
+
resolveGitHubToken(input: ResolveGitHubTokenInput): Promise<ResolvedGitHubToken>;
|
|
48
|
+
}
|
|
49
|
+
/** Options the state-file-backed credential provider accepts. */
|
|
50
|
+
export type GitHubStateCredentialProviderOptions = {
|
|
51
|
+
stateFile?: string;
|
|
52
|
+
stateDir?: string;
|
|
53
|
+
};
|
|
54
|
+
export type GitHubAuthStatus = {
|
|
55
|
+
readonly signedIn: boolean;
|
|
56
|
+
readonly login: string | null;
|
|
57
|
+
readonly userId: string | null;
|
|
58
|
+
readonly scopes: readonly string[];
|
|
59
|
+
readonly selectedRepo: string | null;
|
|
60
|
+
readonly oauthConfigured: boolean;
|
|
61
|
+
readonly tokenSource: "oauth-device" | "manual-token" | "env" | null;
|
|
62
|
+
};
|
|
63
|
+
export type GitHubUserInfo = {
|
|
64
|
+
readonly login: string;
|
|
65
|
+
readonly id: string;
|
|
66
|
+
readonly scopes?: readonly string[];
|
|
67
|
+
};
|
|
68
|
+
export type GitHubRepositoryProbe = {
|
|
69
|
+
readonly ok: boolean;
|
|
70
|
+
readonly owner: string;
|
|
71
|
+
readonly repo: string;
|
|
72
|
+
readonly status: number;
|
|
73
|
+
readonly authenticated: boolean;
|
|
74
|
+
readonly authenticationRequired: boolean;
|
|
75
|
+
readonly fullName: string | null;
|
|
76
|
+
readonly private: boolean | null;
|
|
77
|
+
readonly message: string;
|
|
78
|
+
readonly scopes: readonly string[];
|
|
79
|
+
};
|
|
80
|
+
export interface GitHubProjectSummary {
|
|
81
|
+
id: string;
|
|
82
|
+
number: number;
|
|
83
|
+
title: string;
|
|
84
|
+
url?: string;
|
|
85
|
+
}
|
|
86
|
+
export interface GitHubProjectStatusField {
|
|
87
|
+
id: string;
|
|
88
|
+
name: string;
|
|
89
|
+
options: Array<{
|
|
90
|
+
id: string;
|
|
91
|
+
name: string;
|
|
92
|
+
}>;
|
|
93
|
+
}
|
|
94
|
+
export type GitHubDeviceFlowPending = {
|
|
95
|
+
readonly pollId: string;
|
|
96
|
+
readonly deviceCode: string;
|
|
97
|
+
readonly expiresAt: string;
|
|
98
|
+
readonly intervalSeconds: number;
|
|
99
|
+
};
|
|
100
|
+
export type GitHubAuthStore = {
|
|
101
|
+
readonly stateFile: string;
|
|
102
|
+
readonly status: (options?: {
|
|
103
|
+
oauthConfigured?: boolean;
|
|
104
|
+
}) => GitHubAuthStatus;
|
|
105
|
+
readonly readToken: () => string | null;
|
|
106
|
+
readonly saveToken: (input: {
|
|
107
|
+
readonly token: string;
|
|
108
|
+
readonly tokenSource: "oauth-device" | "manual-token";
|
|
109
|
+
readonly login?: string | null;
|
|
110
|
+
readonly userId?: string | null;
|
|
111
|
+
readonly scopes?: readonly string[];
|
|
112
|
+
readonly selectedRepo?: string | null;
|
|
113
|
+
}) => void;
|
|
114
|
+
readonly createApiSession: () => {
|
|
115
|
+
token: string;
|
|
116
|
+
login: string | null;
|
|
117
|
+
userId: string | null;
|
|
118
|
+
};
|
|
119
|
+
readonly readApiSession: (token: string) => {
|
|
120
|
+
login: string | null;
|
|
121
|
+
userId: string | null;
|
|
122
|
+
} | null;
|
|
123
|
+
readonly copyToProjectRoot: (projectRoot: string) => void;
|
|
124
|
+
readonly copyToLocalProjectRoot: (projectRoot: string) => void;
|
|
125
|
+
readonly savePendingDevice: (input: GitHubDeviceFlowPending) => void;
|
|
126
|
+
readonly saveSelectedRepo: (selectedRepo: string | null) => void;
|
|
127
|
+
readonly readPendingDevice: (pollId: string) => GitHubDeviceFlowPending | null;
|
|
128
|
+
readonly clearPendingDevice: (pollId?: string) => void;
|
|
129
|
+
};
|
|
130
|
+
export type GitHubFormPostResult = {
|
|
131
|
+
readonly status: number;
|
|
132
|
+
readonly payload: Record<string, unknown>;
|
|
133
|
+
};
|
|
134
|
+
export type GitHubFormPoster = (endpoint: string, body: Record<string, string>) => Promise<GitHubFormPostResult>;
|
|
135
|
+
export type GitHubUserFetcher = (token: string) => Promise<GitHubUserInfo>;
|
|
136
|
+
export type GitHubGraphQLFetch = (query: string, variables: Record<string, unknown>, token: string) => Promise<unknown>;
|
|
137
|
+
export type GitHubTokenSaveResult = {
|
|
138
|
+
readonly ok: true;
|
|
139
|
+
} & GitHubAuthStatus;
|
|
140
|
+
export type GitHubDeviceFlowStartResult = {
|
|
141
|
+
readonly ok: true;
|
|
142
|
+
readonly pollId: string;
|
|
143
|
+
readonly userCode: string | null;
|
|
144
|
+
readonly verificationUri: string | null;
|
|
145
|
+
readonly expiresIn: number;
|
|
146
|
+
readonly intervalSeconds: number;
|
|
147
|
+
};
|
|
148
|
+
export type GitHubDeviceFlowPollResult = ({
|
|
149
|
+
readonly ok: true;
|
|
150
|
+
readonly status: "signed-in";
|
|
151
|
+
} & GitHubAuthStatus) | {
|
|
152
|
+
readonly ok: false;
|
|
153
|
+
readonly status: "expired";
|
|
154
|
+
readonly error: string;
|
|
155
|
+
} | {
|
|
156
|
+
readonly ok: false;
|
|
157
|
+
readonly status: "pending";
|
|
158
|
+
readonly intervalSeconds: number;
|
|
159
|
+
} | {
|
|
160
|
+
readonly ok: false;
|
|
161
|
+
readonly status: "slow-down";
|
|
162
|
+
readonly intervalSeconds: number;
|
|
163
|
+
} | {
|
|
164
|
+
readonly ok: false;
|
|
165
|
+
readonly status: "error";
|
|
166
|
+
readonly error: string;
|
|
167
|
+
};
|
|
168
|
+
export type GitHubRepoPermissionsResult = {
|
|
169
|
+
readonly ok: false;
|
|
170
|
+
readonly signedIn: false;
|
|
171
|
+
readonly canOpenPullRequest: false;
|
|
172
|
+
readonly reason: "not-authenticated";
|
|
173
|
+
} | {
|
|
174
|
+
readonly ok: true;
|
|
175
|
+
readonly signedIn: true;
|
|
176
|
+
readonly login: string | null;
|
|
177
|
+
readonly scopes: readonly string[];
|
|
178
|
+
readonly canOpenPullRequest: boolean;
|
|
179
|
+
readonly pullRequests: boolean;
|
|
180
|
+
readonly push: boolean;
|
|
181
|
+
readonly reason: "stored-token" | "token-scope-unverified";
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* The executable surface the GitHub-provider capability `run()` returns. The
|
|
185
|
+
* provider owns the GitHub implementation; sibling plugins resolve this service
|
|
186
|
+
* from the configured project host instead of importing the provider package.
|
|
187
|
+
*/
|
|
188
|
+
export interface GitHubProviderService {
|
|
189
|
+
detectGhLogin(input?: {
|
|
190
|
+
readonly projectRoot?: string | undefined;
|
|
191
|
+
}): string | null;
|
|
192
|
+
readGhAuthToken(input?: {
|
|
193
|
+
readonly projectRoot?: string | undefined;
|
|
194
|
+
}): string;
|
|
195
|
+
refreshGhProjectScopesAndReadToken(input?: {
|
|
196
|
+
readonly projectRoot?: string | undefined;
|
|
197
|
+
readonly scopes?: readonly string[] | undefined;
|
|
198
|
+
}): string | null;
|
|
199
|
+
createCredentialProvider(options?: GitHubCredentialProviderOptions): GitHubCredentialProvider;
|
|
200
|
+
createEnvGitHubCredentialProvider(): GitHubCredentialProvider;
|
|
201
|
+
createStateGitHubCredentialProvider(options?: GitHubStateCredentialProviderOptions): GitHubCredentialProvider;
|
|
202
|
+
createGitHubAuthStore(projectRoot: string): GitHubAuthStore;
|
|
203
|
+
resolveGitHubAuthStatus(input: {
|
|
204
|
+
readonly projectRoot: string;
|
|
205
|
+
readonly oauthConfigured?: boolean;
|
|
206
|
+
}): GitHubAuthStatus;
|
|
207
|
+
saveGitHubTokenForProject(input: {
|
|
208
|
+
readonly projectRoot: string;
|
|
209
|
+
readonly token: string;
|
|
210
|
+
readonly tokenSource?: "oauth-device" | "manual-token";
|
|
211
|
+
readonly selectedRepo?: string | null;
|
|
212
|
+
readonly fetchUser?: GitHubUserFetcher;
|
|
213
|
+
}): Promise<GitHubTokenSaveResult>;
|
|
214
|
+
beginGitHubDeviceFlow(input: {
|
|
215
|
+
readonly projectRoot: string;
|
|
216
|
+
readonly clientId: string;
|
|
217
|
+
readonly scope?: string;
|
|
218
|
+
readonly selectedRepo?: string | null;
|
|
219
|
+
readonly postForm?: GitHubFormPoster;
|
|
220
|
+
}): Promise<GitHubDeviceFlowStartResult>;
|
|
221
|
+
pollGitHubDeviceFlow(input: {
|
|
222
|
+
readonly projectRoot: string;
|
|
223
|
+
readonly clientId: string;
|
|
224
|
+
readonly pollId: string;
|
|
225
|
+
readonly selectedRepo?: string | null;
|
|
226
|
+
readonly postForm?: GitHubFormPoster;
|
|
227
|
+
readonly fetchUser?: GitHubUserFetcher;
|
|
228
|
+
}): Promise<GitHubDeviceFlowPollResult>;
|
|
229
|
+
checkGitHubRepoPermissions(input: {
|
|
230
|
+
readonly projectRoot: string;
|
|
231
|
+
readonly oauthConfigured?: boolean;
|
|
232
|
+
}): GitHubRepoPermissionsResult;
|
|
233
|
+
probeGitHubRepository(input: {
|
|
234
|
+
readonly owner: string;
|
|
235
|
+
readonly repo: string;
|
|
236
|
+
readonly token: string | null;
|
|
237
|
+
readonly scopes: readonly string[];
|
|
238
|
+
readonly fetchRepository?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
239
|
+
}): Promise<GitHubRepositoryProbe>;
|
|
240
|
+
listGitHubProjects(input: {
|
|
241
|
+
readonly owner: string;
|
|
242
|
+
readonly token: string;
|
|
243
|
+
readonly first?: number;
|
|
244
|
+
readonly fetchGraphQL?: GitHubGraphQLFetch;
|
|
245
|
+
}): Promise<GitHubProjectSummary[]>;
|
|
246
|
+
resolveProjectStatusField(input: {
|
|
247
|
+
readonly projectId: string;
|
|
248
|
+
readonly token: string;
|
|
249
|
+
readonly fetchGraphQL?: GitHubGraphQLFetch;
|
|
250
|
+
}): Promise<GitHubProjectStatusField>;
|
|
251
|
+
}
|
|
252
|
+
/** The capability `run` shape the plugin registers: a zero-arg service factory. */
|
|
253
|
+
export type GitHubProviderServiceRun = () => GitHubProviderService;
|
|
254
|
+
/**
|
|
255
|
+
* Typed capability id, phantom-typed with {@link GitHubProviderService} so
|
|
256
|
+
* consumers (task-sources/doctor/init) resolve it off the host with no cast.
|
|
257
|
+
* String value is {@link GITHUB_PROVIDER_CAPABILITY_ID}.
|
|
258
|
+
*/
|
|
259
|
+
export declare const GITHUB_PROVIDER: CapabilityId<GitHubProviderService>;
|
|
260
|
+
/** Capability id the issue-triage provider registers its runner under. */
|
|
261
|
+
export declare const ISSUE_TRIAGE_CAPABILITY_ID = "cap:issue-triage";
|
|
262
|
+
/** Pure input to a triage pass: which project + an optional reason label. */
|
|
263
|
+
export type IssueTriageInput = {
|
|
264
|
+
readonly projectRoot: string;
|
|
265
|
+
readonly reason?: string;
|
|
266
|
+
};
|
|
267
|
+
/**
|
|
268
|
+
* Pure summary of a triage pass. Contracts-owned mirror of the plugin's
|
|
269
|
+
* `IssueAnalysisTriageRunResult` so substrate consumers read the outcome
|
|
270
|
+
* without importing the plugin. Structurally compatible with the impl result.
|
|
271
|
+
*/
|
|
272
|
+
export type IssueTriageResult = {
|
|
273
|
+
readonly ok: true;
|
|
274
|
+
readonly enabled: boolean;
|
|
275
|
+
readonly reason: string;
|
|
276
|
+
readonly sourceId: string | null;
|
|
277
|
+
readonly sourceKind: string | null;
|
|
278
|
+
readonly analyzedIssues: number;
|
|
279
|
+
readonly metadataPatches: number;
|
|
280
|
+
readonly labelsAdded: number;
|
|
281
|
+
readonly labelsRemoved: number;
|
|
282
|
+
readonly generatedIssues: number;
|
|
283
|
+
readonly writeBackRefreshes: number;
|
|
284
|
+
readonly refreshedIssueCount: number | null;
|
|
285
|
+
readonly skippedReason?: "no-config" | "disabled";
|
|
286
|
+
};
|
|
287
|
+
/** The cohesive triage operation the CLI surface depends on. Async (does IO). */
|
|
288
|
+
export interface IssueTriageService {
|
|
289
|
+
runTriage(input: IssueTriageInput): Promise<IssueTriageResult>;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Typed capability id, phantom-typed with {@link IssueTriageService}. String
|
|
293
|
+
* value is {@link ISSUE_TRIAGE_CAPABILITY_ID}.
|
|
294
|
+
*/
|
|
295
|
+
export declare const ISSUE_TRIAGE: CapabilityId<IssueTriageService>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/capability-id.ts
|
|
3
|
+
function makeCapabilityId(id) {
|
|
4
|
+
return id;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// packages/contracts/src/github.ts
|
|
8
|
+
var GITHUB_PROVIDER_CAPABILITY_ID = "github.provider";
|
|
9
|
+
var GITHUB_PROVIDER = makeCapabilityId(GITHUB_PROVIDER_CAPABILITY_ID);
|
|
10
|
+
var ISSUE_TRIAGE_CAPABILITY_ID = "cap:issue-triage";
|
|
11
|
+
var ISSUE_TRIAGE = makeCapabilityId(ISSUE_TRIAGE_CAPABILITY_ID);
|
|
12
|
+
export {
|
|
13
|
+
ISSUE_TRIAGE_CAPABILITY_ID,
|
|
14
|
+
ISSUE_TRIAGE,
|
|
15
|
+
GITHUB_PROVIDER_CAPABILITY_ID,
|
|
16
|
+
GITHUB_PROVIDER
|
|
17
|
+
};
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { CapabilityId } from "./capability-id";
|
|
3
|
+
export declare const TaskStatus: Schema.Literals<readonly ["draft", "open", "ready", "queued", "running", "in_progress", "under_review", "blocked", "unknown", "completed", "failed", "cancelled", "closed"]>;
|
|
4
|
+
export type TaskStatus = typeof TaskStatus.Type;
|
|
5
|
+
export declare const GraphSummary: Schema.Struct<{
|
|
6
|
+
readonly id: Schema.brand<Schema.Trim, "GraphId">;
|
|
7
|
+
readonly workspaceId: Schema.brand<Schema.Trim, "WorkspaceId">;
|
|
8
|
+
readonly title: Schema.Trim;
|
|
9
|
+
readonly description: Schema.NullOr<Schema.String>;
|
|
10
|
+
readonly createdAt: Schema.String;
|
|
11
|
+
readonly updatedAt: Schema.String;
|
|
12
|
+
}>;
|
|
13
|
+
export type GraphSummary = typeof GraphSummary.Type;
|
|
14
|
+
export declare const TaskSummary: Schema.Struct<{
|
|
15
|
+
readonly id: Schema.brand<Schema.Trim, "TaskId">;
|
|
16
|
+
readonly workspaceId: Schema.brand<Schema.Trim, "WorkspaceId">;
|
|
17
|
+
readonly graphId: Schema.NullOr<Schema.brand<Schema.Trim, "GraphId">>;
|
|
18
|
+
readonly externalId: Schema.NullOr<Schema.Trim>;
|
|
19
|
+
readonly title: Schema.Trim;
|
|
20
|
+
readonly description: Schema.String;
|
|
21
|
+
readonly status: Schema.Literals<readonly ["draft", "open", "ready", "queued", "running", "in_progress", "under_review", "blocked", "unknown", "completed", "failed", "cancelled", "closed"]>;
|
|
22
|
+
readonly priority: Schema.NullOr<Schema.Int>;
|
|
23
|
+
readonly role: Schema.NullOr<Schema.Trim>;
|
|
24
|
+
readonly scope: Schema.$Array<Schema.Trim>;
|
|
25
|
+
readonly validationKeys: Schema.$Array<Schema.Trim>;
|
|
26
|
+
readonly sourceIssueId: Schema.optional<Schema.NullOr<Schema.Trim>>;
|
|
27
|
+
readonly dependencies: Schema.optional<Schema.$Array<Schema.Trim>>;
|
|
28
|
+
readonly parentChildDeps: Schema.optional<Schema.$Array<Schema.Trim>>;
|
|
29
|
+
readonly metadata: Schema.Unknown;
|
|
30
|
+
readonly createdAt: Schema.String;
|
|
31
|
+
readonly updatedAt: Schema.String;
|
|
32
|
+
}>;
|
|
33
|
+
export type TaskSummary = typeof TaskSummary.Type;
|
|
34
|
+
export declare const QueueEntry: Schema.Struct<{
|
|
35
|
+
readonly taskId: Schema.brand<Schema.Trim, "TaskId">;
|
|
36
|
+
readonly score: Schema.Int;
|
|
37
|
+
readonly unblockCount: Schema.Int;
|
|
38
|
+
readonly position: Schema.Int;
|
|
39
|
+
}>;
|
|
40
|
+
export type QueueEntry = typeof QueueEntry.Type;
|
|
41
|
+
export declare const DependencyEdgeType: Schema.Literals<readonly ["blocks", "parent-child", "related"]>;
|
|
42
|
+
export type DependencyEdgeType = typeof DependencyEdgeType.Type;
|
|
43
|
+
export declare const DependencyEdge: Schema.Struct<{
|
|
44
|
+
readonly fromTaskId: Schema.brand<Schema.Trim, "TaskId">;
|
|
45
|
+
readonly toTaskId: Schema.brand<Schema.Trim, "TaskId">;
|
|
46
|
+
readonly type: Schema.Literals<readonly ["blocks", "parent-child", "related"]>;
|
|
47
|
+
}>;
|
|
48
|
+
export type DependencyEdge = typeof DependencyEdge.Type;
|
|
49
|
+
export declare const BlockerClass: Schema.Literals<readonly ["not-blocked", "task-blocked", "human-decision", "human-approval", "external-input", "unknown"]>;
|
|
50
|
+
export type BlockerClass = typeof BlockerClass.Type;
|
|
51
|
+
export declare const ActionRiskTier: Schema.Literals<readonly ["t1-read", "t2-reversible", "t3-external", "t4-irreversible"]>;
|
|
52
|
+
export type ActionRiskTier = typeof ActionRiskTier.Type;
|
|
53
|
+
export declare const BlockerClassification: Schema.Struct<{
|
|
54
|
+
readonly taskId: Schema.brand<Schema.Trim, "TaskId">;
|
|
55
|
+
readonly blockerClass: Schema.Literals<readonly ["not-blocked", "task-blocked", "human-decision", "human-approval", "external-input", "unknown"]>;
|
|
56
|
+
readonly actionRiskTier: Schema.NullOr<Schema.Literals<readonly ["t1-read", "t2-reversible", "t3-external", "t4-irreversible"]>>;
|
|
57
|
+
readonly rationale: Schema.String;
|
|
58
|
+
readonly source: Schema.Literals<readonly ["elimination", "label", "status", "llm"]>;
|
|
59
|
+
readonly autoApplied: Schema.Boolean;
|
|
60
|
+
}>;
|
|
61
|
+
export type BlockerClassification = typeof BlockerClassification.Type;
|
|
62
|
+
export declare const DependencyNode: Schema.Struct<{
|
|
63
|
+
readonly taskId: Schema.brand<Schema.Trim, "TaskId">;
|
|
64
|
+
readonly title: Schema.Trim;
|
|
65
|
+
readonly status: Schema.Literals<readonly ["draft", "open", "ready", "queued", "running", "in_progress", "under_review", "blocked", "unknown", "completed", "failed", "cancelled", "closed"]>;
|
|
66
|
+
readonly priority: Schema.NullOr<Schema.Int>;
|
|
67
|
+
readonly assignee: Schema.NullOr<Schema.Trim>;
|
|
68
|
+
readonly blockedBy: Schema.$Array<Schema.brand<Schema.Trim, "TaskId">>;
|
|
69
|
+
readonly blocks: Schema.$Array<Schema.brand<Schema.Trim, "TaskId">>;
|
|
70
|
+
readonly blockingDepth: Schema.Int;
|
|
71
|
+
readonly blockerClass: Schema.NullOr<Schema.Literals<readonly ["not-blocked", "task-blocked", "human-decision", "human-approval", "external-input", "unknown"]>>;
|
|
72
|
+
readonly actionRiskTier: Schema.NullOr<Schema.Literals<readonly ["t1-read", "t2-reversible", "t3-external", "t4-irreversible"]>>;
|
|
73
|
+
readonly epicKey: Schema.NullOr<Schema.Trim>;
|
|
74
|
+
readonly groupKey: Schema.optional<Schema.NullOr<Schema.Trim>>;
|
|
75
|
+
readonly externalId: Schema.optional<Schema.NullOr<Schema.Trim>>;
|
|
76
|
+
readonly sourceIssueId: Schema.optional<Schema.NullOr<Schema.Trim>>;
|
|
77
|
+
readonly scope: Schema.optional<Schema.$Array<Schema.Trim>>;
|
|
78
|
+
readonly validationKeys: Schema.optional<Schema.$Array<Schema.Trim>>;
|
|
79
|
+
}>;
|
|
80
|
+
export type DependencyNode = typeof DependencyNode.Type;
|
|
81
|
+
export declare const TaskGraphLane: Schema.Struct<{
|
|
82
|
+
readonly key: Schema.Trim;
|
|
83
|
+
readonly label: Schema.Trim;
|
|
84
|
+
readonly rowIndex: Schema.Int;
|
|
85
|
+
readonly x: Schema.Number;
|
|
86
|
+
readonly y: Schema.Number;
|
|
87
|
+
readonly width: Schema.Int;
|
|
88
|
+
readonly height: Schema.Int;
|
|
89
|
+
readonly color: Schema.String;
|
|
90
|
+
readonly taskCount: Schema.Int;
|
|
91
|
+
}>;
|
|
92
|
+
export type TaskGraphLane = typeof TaskGraphLane.Type;
|
|
93
|
+
export declare const TaskGraphStage: Schema.Struct<{
|
|
94
|
+
readonly index: Schema.Int;
|
|
95
|
+
readonly label: Schema.Trim;
|
|
96
|
+
readonly x: Schema.Number;
|
|
97
|
+
readonly width: Schema.Int;
|
|
98
|
+
}>;
|
|
99
|
+
export type TaskGraphStage = typeof TaskGraphStage.Type;
|
|
100
|
+
export declare const TaskGraphNode: Schema.Struct<{
|
|
101
|
+
readonly id: Schema.Trim;
|
|
102
|
+
readonly taskId: Schema.brand<Schema.Trim, "TaskId">;
|
|
103
|
+
readonly task: Schema.optional<Schema.Struct<{
|
|
104
|
+
readonly id: Schema.brand<Schema.Trim, "TaskId">;
|
|
105
|
+
readonly workspaceId: Schema.brand<Schema.Trim, "WorkspaceId">;
|
|
106
|
+
readonly graphId: Schema.NullOr<Schema.brand<Schema.Trim, "GraphId">>;
|
|
107
|
+
readonly externalId: Schema.NullOr<Schema.Trim>;
|
|
108
|
+
readonly title: Schema.Trim;
|
|
109
|
+
readonly description: Schema.String;
|
|
110
|
+
readonly status: Schema.Literals<readonly ["draft", "open", "ready", "queued", "running", "in_progress", "under_review", "blocked", "unknown", "completed", "failed", "cancelled", "closed"]>;
|
|
111
|
+
readonly priority: Schema.NullOr<Schema.Int>;
|
|
112
|
+
readonly role: Schema.NullOr<Schema.Trim>;
|
|
113
|
+
readonly scope: Schema.$Array<Schema.Trim>;
|
|
114
|
+
readonly validationKeys: Schema.$Array<Schema.Trim>;
|
|
115
|
+
readonly sourceIssueId: Schema.optional<Schema.NullOr<Schema.Trim>>;
|
|
116
|
+
readonly dependencies: Schema.optional<Schema.$Array<Schema.Trim>>;
|
|
117
|
+
readonly parentChildDeps: Schema.optional<Schema.$Array<Schema.Trim>>;
|
|
118
|
+
readonly metadata: Schema.Unknown;
|
|
119
|
+
readonly createdAt: Schema.String;
|
|
120
|
+
readonly updatedAt: Schema.String;
|
|
121
|
+
}>>;
|
|
122
|
+
readonly rowKey: Schema.Trim;
|
|
123
|
+
readonly rowLabel: Schema.Trim;
|
|
124
|
+
readonly rowIndex: Schema.Int;
|
|
125
|
+
readonly stage: Schema.Int;
|
|
126
|
+
readonly x: Schema.Number;
|
|
127
|
+
readonly y: Schema.Number;
|
|
128
|
+
readonly width: Schema.Int;
|
|
129
|
+
readonly height: Schema.Int;
|
|
130
|
+
readonly color: Schema.optional<Schema.String>;
|
|
131
|
+
readonly taskCode: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
132
|
+
readonly strippedTitle: Schema.optional<Schema.String>;
|
|
133
|
+
readonly depsIn: Schema.optional<Schema.Int>;
|
|
134
|
+
readonly depsOut: Schema.optional<Schema.Int>;
|
|
135
|
+
readonly runCount: Schema.optional<Schema.Int>;
|
|
136
|
+
readonly hasApprovals: Schema.optional<Schema.Boolean>;
|
|
137
|
+
readonly hasPendingUserInput: Schema.optional<Schema.Boolean>;
|
|
138
|
+
readonly hasRejectedReview: Schema.optional<Schema.Boolean>;
|
|
139
|
+
readonly hasFailedValidations: Schema.optional<Schema.Boolean>;
|
|
140
|
+
readonly artifactCount: Schema.optional<Schema.Int>;
|
|
141
|
+
}>;
|
|
142
|
+
export type TaskGraphNode = typeof TaskGraphNode.Type;
|
|
143
|
+
export declare const TaskGraphEdge: Schema.Struct<{
|
|
144
|
+
readonly id: Schema.Trim;
|
|
145
|
+
readonly sourceId: Schema.Trim;
|
|
146
|
+
readonly targetId: Schema.Trim;
|
|
147
|
+
readonly color: Schema.String;
|
|
148
|
+
readonly kind: Schema.Literals<readonly ["blocking", "parent-child"]>;
|
|
149
|
+
}>;
|
|
150
|
+
export type TaskGraphEdge = typeof TaskGraphEdge.Type;
|
|
151
|
+
export declare const TaskGraphLayout: Schema.Struct<{
|
|
152
|
+
readonly lanes: Schema.$Array<Schema.Struct<{
|
|
153
|
+
readonly key: Schema.Trim;
|
|
154
|
+
readonly label: Schema.Trim;
|
|
155
|
+
readonly rowIndex: Schema.Int;
|
|
156
|
+
readonly x: Schema.Number;
|
|
157
|
+
readonly y: Schema.Number;
|
|
158
|
+
readonly width: Schema.Int;
|
|
159
|
+
readonly height: Schema.Int;
|
|
160
|
+
readonly color: Schema.String;
|
|
161
|
+
readonly taskCount: Schema.Int;
|
|
162
|
+
}>>;
|
|
163
|
+
readonly stages: Schema.$Array<Schema.Struct<{
|
|
164
|
+
readonly index: Schema.Int;
|
|
165
|
+
readonly label: Schema.Trim;
|
|
166
|
+
readonly x: Schema.Number;
|
|
167
|
+
readonly width: Schema.Int;
|
|
168
|
+
}>>;
|
|
169
|
+
readonly nodes: Schema.$Array<Schema.Struct<{
|
|
170
|
+
readonly id: Schema.Trim;
|
|
171
|
+
readonly taskId: Schema.brand<Schema.Trim, "TaskId">;
|
|
172
|
+
readonly task: Schema.optional<Schema.Struct<{
|
|
173
|
+
readonly id: Schema.brand<Schema.Trim, "TaskId">;
|
|
174
|
+
readonly workspaceId: Schema.brand<Schema.Trim, "WorkspaceId">;
|
|
175
|
+
readonly graphId: Schema.NullOr<Schema.brand<Schema.Trim, "GraphId">>;
|
|
176
|
+
readonly externalId: Schema.NullOr<Schema.Trim>;
|
|
177
|
+
readonly title: Schema.Trim;
|
|
178
|
+
readonly description: Schema.String;
|
|
179
|
+
readonly status: Schema.Literals<readonly ["draft", "open", "ready", "queued", "running", "in_progress", "under_review", "blocked", "unknown", "completed", "failed", "cancelled", "closed"]>;
|
|
180
|
+
readonly priority: Schema.NullOr<Schema.Int>;
|
|
181
|
+
readonly role: Schema.NullOr<Schema.Trim>;
|
|
182
|
+
readonly scope: Schema.$Array<Schema.Trim>;
|
|
183
|
+
readonly validationKeys: Schema.$Array<Schema.Trim>;
|
|
184
|
+
readonly sourceIssueId: Schema.optional<Schema.NullOr<Schema.Trim>>;
|
|
185
|
+
readonly dependencies: Schema.optional<Schema.$Array<Schema.Trim>>;
|
|
186
|
+
readonly parentChildDeps: Schema.optional<Schema.$Array<Schema.Trim>>;
|
|
187
|
+
readonly metadata: Schema.Unknown;
|
|
188
|
+
readonly createdAt: Schema.String;
|
|
189
|
+
readonly updatedAt: Schema.String;
|
|
190
|
+
}>>;
|
|
191
|
+
readonly rowKey: Schema.Trim;
|
|
192
|
+
readonly rowLabel: Schema.Trim;
|
|
193
|
+
readonly rowIndex: Schema.Int;
|
|
194
|
+
readonly stage: Schema.Int;
|
|
195
|
+
readonly x: Schema.Number;
|
|
196
|
+
readonly y: Schema.Number;
|
|
197
|
+
readonly width: Schema.Int;
|
|
198
|
+
readonly height: Schema.Int;
|
|
199
|
+
readonly color: Schema.optional<Schema.String>;
|
|
200
|
+
readonly taskCode: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
201
|
+
readonly strippedTitle: Schema.optional<Schema.String>;
|
|
202
|
+
readonly depsIn: Schema.optional<Schema.Int>;
|
|
203
|
+
readonly depsOut: Schema.optional<Schema.Int>;
|
|
204
|
+
readonly runCount: Schema.optional<Schema.Int>;
|
|
205
|
+
readonly hasApprovals: Schema.optional<Schema.Boolean>;
|
|
206
|
+
readonly hasPendingUserInput: Schema.optional<Schema.Boolean>;
|
|
207
|
+
readonly hasRejectedReview: Schema.optional<Schema.Boolean>;
|
|
208
|
+
readonly hasFailedValidations: Schema.optional<Schema.Boolean>;
|
|
209
|
+
readonly artifactCount: Schema.optional<Schema.Int>;
|
|
210
|
+
}>>;
|
|
211
|
+
readonly edges: Schema.$Array<Schema.Struct<{
|
|
212
|
+
readonly id: Schema.Trim;
|
|
213
|
+
readonly sourceId: Schema.Trim;
|
|
214
|
+
readonly targetId: Schema.Trim;
|
|
215
|
+
readonly color: Schema.String;
|
|
216
|
+
readonly kind: Schema.Literals<readonly ["blocking", "parent-child"]>;
|
|
217
|
+
}>>;
|
|
218
|
+
readonly totalWidth: Schema.Int;
|
|
219
|
+
readonly totalHeight: Schema.Int;
|
|
220
|
+
readonly taskCount: Schema.Int;
|
|
221
|
+
}>;
|
|
222
|
+
export type TaskGraphLayout = typeof TaskGraphLayout.Type;
|
|
223
|
+
export declare const DependencyGraphModel: Schema.Struct<{
|
|
224
|
+
readonly graphId: Schema.brand<Schema.Trim, "GraphId">;
|
|
225
|
+
readonly nodes: Schema.$Array<Schema.Struct<{
|
|
226
|
+
readonly taskId: Schema.brand<Schema.Trim, "TaskId">;
|
|
227
|
+
readonly title: Schema.Trim;
|
|
228
|
+
readonly status: Schema.Literals<readonly ["draft", "open", "ready", "queued", "running", "in_progress", "under_review", "blocked", "unknown", "completed", "failed", "cancelled", "closed"]>;
|
|
229
|
+
readonly priority: Schema.NullOr<Schema.Int>;
|
|
230
|
+
readonly assignee: Schema.NullOr<Schema.Trim>;
|
|
231
|
+
readonly blockedBy: Schema.$Array<Schema.brand<Schema.Trim, "TaskId">>;
|
|
232
|
+
readonly blocks: Schema.$Array<Schema.brand<Schema.Trim, "TaskId">>;
|
|
233
|
+
readonly blockingDepth: Schema.Int;
|
|
234
|
+
readonly blockerClass: Schema.NullOr<Schema.Literals<readonly ["not-blocked", "task-blocked", "human-decision", "human-approval", "external-input", "unknown"]>>;
|
|
235
|
+
readonly actionRiskTier: Schema.NullOr<Schema.Literals<readonly ["t1-read", "t2-reversible", "t3-external", "t4-irreversible"]>>;
|
|
236
|
+
readonly epicKey: Schema.NullOr<Schema.Trim>;
|
|
237
|
+
readonly groupKey: Schema.optional<Schema.NullOr<Schema.Trim>>;
|
|
238
|
+
readonly externalId: Schema.optional<Schema.NullOr<Schema.Trim>>;
|
|
239
|
+
readonly sourceIssueId: Schema.optional<Schema.NullOr<Schema.Trim>>;
|
|
240
|
+
readonly scope: Schema.optional<Schema.$Array<Schema.Trim>>;
|
|
241
|
+
readonly validationKeys: Schema.optional<Schema.$Array<Schema.Trim>>;
|
|
242
|
+
}>>;
|
|
243
|
+
readonly edges: Schema.$Array<Schema.Struct<{
|
|
244
|
+
readonly fromTaskId: Schema.brand<Schema.Trim, "TaskId">;
|
|
245
|
+
readonly toTaskId: Schema.brand<Schema.Trim, "TaskId">;
|
|
246
|
+
readonly type: Schema.Literals<readonly ["blocks", "parent-child", "related"]>;
|
|
247
|
+
}>>;
|
|
248
|
+
readonly layout: Schema.Struct<{
|
|
249
|
+
readonly lanes: Schema.$Array<Schema.Struct<{
|
|
250
|
+
readonly key: Schema.Trim;
|
|
251
|
+
readonly label: Schema.Trim;
|
|
252
|
+
readonly rowIndex: Schema.Int;
|
|
253
|
+
readonly x: Schema.Number;
|
|
254
|
+
readonly y: Schema.Number;
|
|
255
|
+
readonly width: Schema.Int;
|
|
256
|
+
readonly height: Schema.Int;
|
|
257
|
+
readonly color: Schema.String;
|
|
258
|
+
readonly taskCount: Schema.Int;
|
|
259
|
+
}>>;
|
|
260
|
+
readonly stages: Schema.$Array<Schema.Struct<{
|
|
261
|
+
readonly index: Schema.Int;
|
|
262
|
+
readonly label: Schema.Trim;
|
|
263
|
+
readonly x: Schema.Number;
|
|
264
|
+
readonly width: Schema.Int;
|
|
265
|
+
}>>;
|
|
266
|
+
readonly nodes: Schema.$Array<Schema.Struct<{
|
|
267
|
+
readonly id: Schema.Trim;
|
|
268
|
+
readonly taskId: Schema.brand<Schema.Trim, "TaskId">;
|
|
269
|
+
readonly task: Schema.optional<Schema.Struct<{
|
|
270
|
+
readonly id: Schema.brand<Schema.Trim, "TaskId">;
|
|
271
|
+
readonly workspaceId: Schema.brand<Schema.Trim, "WorkspaceId">;
|
|
272
|
+
readonly graphId: Schema.NullOr<Schema.brand<Schema.Trim, "GraphId">>;
|
|
273
|
+
readonly externalId: Schema.NullOr<Schema.Trim>;
|
|
274
|
+
readonly title: Schema.Trim;
|
|
275
|
+
readonly description: Schema.String;
|
|
276
|
+
readonly status: Schema.Literals<readonly ["draft", "open", "ready", "queued", "running", "in_progress", "under_review", "blocked", "unknown", "completed", "failed", "cancelled", "closed"]>;
|
|
277
|
+
readonly priority: Schema.NullOr<Schema.Int>;
|
|
278
|
+
readonly role: Schema.NullOr<Schema.Trim>;
|
|
279
|
+
readonly scope: Schema.$Array<Schema.Trim>;
|
|
280
|
+
readonly validationKeys: Schema.$Array<Schema.Trim>;
|
|
281
|
+
readonly sourceIssueId: Schema.optional<Schema.NullOr<Schema.Trim>>;
|
|
282
|
+
readonly dependencies: Schema.optional<Schema.$Array<Schema.Trim>>;
|
|
283
|
+
readonly parentChildDeps: Schema.optional<Schema.$Array<Schema.Trim>>;
|
|
284
|
+
readonly metadata: Schema.Unknown;
|
|
285
|
+
readonly createdAt: Schema.String;
|
|
286
|
+
readonly updatedAt: Schema.String;
|
|
287
|
+
}>>;
|
|
288
|
+
readonly rowKey: Schema.Trim;
|
|
289
|
+
readonly rowLabel: Schema.Trim;
|
|
290
|
+
readonly rowIndex: Schema.Int;
|
|
291
|
+
readonly stage: Schema.Int;
|
|
292
|
+
readonly x: Schema.Number;
|
|
293
|
+
readonly y: Schema.Number;
|
|
294
|
+
readonly width: Schema.Int;
|
|
295
|
+
readonly height: Schema.Int;
|
|
296
|
+
readonly color: Schema.optional<Schema.String>;
|
|
297
|
+
readonly taskCode: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
298
|
+
readonly strippedTitle: Schema.optional<Schema.String>;
|
|
299
|
+
readonly depsIn: Schema.optional<Schema.Int>;
|
|
300
|
+
readonly depsOut: Schema.optional<Schema.Int>;
|
|
301
|
+
readonly runCount: Schema.optional<Schema.Int>;
|
|
302
|
+
readonly hasApprovals: Schema.optional<Schema.Boolean>;
|
|
303
|
+
readonly hasPendingUserInput: Schema.optional<Schema.Boolean>;
|
|
304
|
+
readonly hasRejectedReview: Schema.optional<Schema.Boolean>;
|
|
305
|
+
readonly hasFailedValidations: Schema.optional<Schema.Boolean>;
|
|
306
|
+
readonly artifactCount: Schema.optional<Schema.Int>;
|
|
307
|
+
}>>;
|
|
308
|
+
readonly edges: Schema.$Array<Schema.Struct<{
|
|
309
|
+
readonly id: Schema.Trim;
|
|
310
|
+
readonly sourceId: Schema.Trim;
|
|
311
|
+
readonly targetId: Schema.Trim;
|
|
312
|
+
readonly color: Schema.String;
|
|
313
|
+
readonly kind: Schema.Literals<readonly ["blocking", "parent-child"]>;
|
|
314
|
+
}>>;
|
|
315
|
+
readonly totalWidth: Schema.Int;
|
|
316
|
+
readonly totalHeight: Schema.Int;
|
|
317
|
+
readonly taskCount: Schema.Int;
|
|
318
|
+
}>;
|
|
319
|
+
readonly cycles: Schema.$Array<Schema.$Array<Schema.brand<Schema.Trim, "TaskId">>>;
|
|
320
|
+
readonly unresolvedRefs: Schema.$Array<Schema.Trim>;
|
|
321
|
+
readonly degraded: Schema.Boolean;
|
|
322
|
+
readonly generatedAt: Schema.String;
|
|
323
|
+
}>;
|
|
324
|
+
export type DependencyGraphModel = typeof DependencyGraphModel.Type;
|
|
325
|
+
/** Capability id the dependency-graph plugin registers its project-graph builder under. */
|
|
326
|
+
export declare const GRAPH_PROJECT_CAPABILITY_ID = "rig.graph.project";
|
|
327
|
+
/** Pure input to the project-graph builder: which workspace to analyze. */
|
|
328
|
+
export type GraphProjectInput = {
|
|
329
|
+
readonly projectRoot: string;
|
|
330
|
+
};
|
|
331
|
+
/** The cohesive project-graph operation the substrate depends on. Async (does IO). */
|
|
332
|
+
export interface GraphProjectService {
|
|
333
|
+
buildProjectGraph(input: GraphProjectInput): Promise<DependencyGraphModel>;
|
|
334
|
+
}
|
|
335
|
+
/** Typed capability id; string value is {@link GRAPH_PROJECT_CAPABILITY_ID}. */
|
|
336
|
+
export declare const GRAPH_PROJECT: CapabilityId<GraphProjectService>;
|
|
337
|
+
/** Capability id the dependency-graph plugin registers its task selector under. */
|
|
338
|
+
export declare const TASK_SELECTION_CAPABILITY_ID = "cap:task-selection";
|
|
339
|
+
/** Pure filters narrowing which tasks are eligible for selection. */
|
|
340
|
+
export type TaskSelectionFilters = {
|
|
341
|
+
readonly assignee?: string;
|
|
342
|
+
readonly state?: "open" | "closed";
|
|
343
|
+
readonly search?: string;
|
|
344
|
+
};
|
|
345
|
+
/** Pure input to task selection: which workspace + optional filters. */
|
|
346
|
+
export type TaskSelectionInput = {
|
|
347
|
+
readonly projectRoot: string;
|
|
348
|
+
readonly filters?: TaskSelectionFilters;
|
|
349
|
+
};
|
|
350
|
+
/** Pure result of task selection: the next ready task + the ready set it came from. */
|
|
351
|
+
export type TaskSelectionResult = {
|
|
352
|
+
readonly selected: TaskSummary | null;
|
|
353
|
+
readonly ready: readonly TaskSummary[];
|
|
354
|
+
};
|
|
355
|
+
/** The cohesive task-selection operation the CLI surface depends on. Async (does IO). */
|
|
356
|
+
export interface TaskSelectionService {
|
|
357
|
+
selectNextReadyTask(input: TaskSelectionInput): Promise<TaskSelectionResult>;
|
|
358
|
+
}
|
|
359
|
+
/** Typed capability id; string value is {@link TASK_SELECTION_CAPABILITY_ID}. */
|
|
360
|
+
export declare const TASK_SELECTION: CapabilityId<TaskSelectionService>;
|