@h-rig/contracts 0.0.6-alpha.18 → 0.0.6-alpha.180
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 +3442 -0
- package/dist/index.mjs +3401 -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/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 +767 -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/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 +3 -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 +3 -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 +137 -1
- 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 +2605 -3752
- 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 +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 +3 -58
- 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 +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/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 +346 -64
- package/dist/src/policy.d.ts +16 -0
- package/dist/src/policy.js +3 -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 +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 +16 -835
- 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 +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-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 +73 -906
- 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 +24 -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 +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/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 +3 -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 +76 -911
- package/package.json +55 -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,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
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const EDITORS: readonly [{
|
|
3
|
+
readonly id: "cursor";
|
|
4
|
+
readonly label: "Cursor";
|
|
5
|
+
readonly command: "cursor";
|
|
6
|
+
}, {
|
|
7
|
+
readonly id: "vscode";
|
|
8
|
+
readonly label: "VS Code";
|
|
9
|
+
readonly command: "code";
|
|
10
|
+
}, {
|
|
11
|
+
readonly id: "zed";
|
|
12
|
+
readonly label: "Zed";
|
|
13
|
+
readonly command: "zed";
|
|
14
|
+
}, {
|
|
15
|
+
readonly id: "file-manager";
|
|
16
|
+
readonly label: "File Manager";
|
|
17
|
+
readonly command: null;
|
|
18
|
+
}];
|
|
19
|
+
export declare const EditorId: Schema.Literals<("cursor" | "vscode" | "zed" | "file-manager")[]>;
|
|
20
|
+
export type EditorId = typeof EditorId.Type;
|
|
21
|
+
export declare const OpenInEditorInput: Schema.Struct<{
|
|
22
|
+
readonly cwd: Schema.Trim;
|
|
23
|
+
readonly editor: Schema.Literals<("cursor" | "vscode" | "zed" | "file-manager")[]>;
|
|
24
|
+
}>;
|
|
25
|
+
export type OpenInEditorInput = typeof OpenInEditorInput.Type;
|
package/dist/src/editor.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,13 @@
|
|
|
1
|
+
export declare class CliError extends Error {
|
|
2
|
+
readonly exitCode: number;
|
|
3
|
+
/**
|
|
4
|
+
* Optional remediation hint. Rendered on its own `Next: <hint>` line (and
|
|
5
|
+
* carried in the `--json` error payload) so a failure can name the next
|
|
6
|
+
* command to run. Pure vocab — the exec machinery (now in @rig/guard-plugin)
|
|
7
|
+
* throws this with a hint without importing a CLI-seed error class.
|
|
8
|
+
*/
|
|
9
|
+
readonly hint?: string;
|
|
10
|
+
constructor(message: string, exitCode?: number, options?: {
|
|
11
|
+
readonly hint?: string;
|
|
12
|
+
});
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/errors.ts
|
|
3
|
+
class CliError extends Error {
|
|
4
|
+
exitCode;
|
|
5
|
+
hint;
|
|
6
|
+
constructor(message, exitCode = 1, options = {}) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.name = "CliError";
|
|
9
|
+
this.exitCode = exitCode;
|
|
10
|
+
if (options.hint?.trim()) {
|
|
11
|
+
this.hint = options.hint.trim();
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
CliError
|
|
17
|
+
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const GitStackedAction: Schema.Literals<readonly ["commit", "commit_push", "commit_push_pr"]>;
|
|
3
|
+
export type GitStackedAction = typeof GitStackedAction.Type;
|
|
4
|
+
export type GitWorkingTreeFileStatus = "added" | "copied" | "deleted" | "modified" | "renamed" | "type_changed" | "untracked" | "conflicted" | "unknown";
|
|
5
|
+
export interface GitWorkingTreeFileChange {
|
|
6
|
+
readonly path: string;
|
|
7
|
+
readonly status: GitWorkingTreeFileStatus;
|
|
8
|
+
readonly staged: boolean;
|
|
9
|
+
readonly unstaged: boolean;
|
|
10
|
+
readonly previousPath?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const GitBranch: Schema.Struct<{
|
|
13
|
+
readonly name: Schema.Trim;
|
|
14
|
+
readonly isRemote: Schema.optional<Schema.Boolean>;
|
|
15
|
+
readonly remoteName: Schema.optional<Schema.Trim>;
|
|
16
|
+
readonly current: Schema.Boolean;
|
|
17
|
+
readonly isDefault: Schema.Boolean;
|
|
18
|
+
readonly worktreePath: Schema.NullOr<Schema.Trim>;
|
|
19
|
+
}>;
|
|
20
|
+
export type GitBranch = typeof GitBranch.Type;
|
|
21
|
+
export declare const GitStatusInput: Schema.Struct<{
|
|
22
|
+
readonly cwd: Schema.Trim;
|
|
23
|
+
}>;
|
|
24
|
+
export type GitStatusInput = typeof GitStatusInput.Type;
|
|
25
|
+
export declare const GitPullInput: Schema.Struct<{
|
|
26
|
+
readonly cwd: Schema.Trim;
|
|
27
|
+
}>;
|
|
28
|
+
export type GitPullInput = typeof GitPullInput.Type;
|
|
29
|
+
export declare const GitReadWorkingTreePatchInput: Schema.Struct<{
|
|
30
|
+
readonly cwd: Schema.Trim;
|
|
31
|
+
readonly relativePath: Schema.optional<Schema.Trim>;
|
|
32
|
+
}>;
|
|
33
|
+
export type GitReadWorkingTreePatchInput = typeof GitReadWorkingTreePatchInput.Type;
|
|
34
|
+
export declare const GitRunStackedActionInput: Schema.Struct<{
|
|
35
|
+
readonly cwd: Schema.Trim;
|
|
36
|
+
readonly action: Schema.Literals<readonly ["commit", "commit_push", "commit_push_pr"]>;
|
|
37
|
+
readonly commitMessage: Schema.optional<Schema.Trim>;
|
|
38
|
+
readonly featureBranch: Schema.optional<Schema.Boolean>;
|
|
39
|
+
}>;
|
|
40
|
+
export type GitRunStackedActionInput = typeof GitRunStackedActionInput.Type;
|
|
41
|
+
export declare const GitListBranchesInput: Schema.Struct<{
|
|
42
|
+
readonly cwd: Schema.Trim;
|
|
43
|
+
}>;
|
|
44
|
+
export type GitListBranchesInput = typeof GitListBranchesInput.Type;
|
|
45
|
+
export declare const GitCreateWorktreeInput: Schema.Struct<{
|
|
46
|
+
readonly cwd: Schema.Trim;
|
|
47
|
+
readonly branch: Schema.Trim;
|
|
48
|
+
readonly newBranch: Schema.Trim;
|
|
49
|
+
readonly path: Schema.NullOr<Schema.Trim>;
|
|
50
|
+
}>;
|
|
51
|
+
export type GitCreateWorktreeInput = typeof GitCreateWorktreeInput.Type;
|
|
52
|
+
export declare const GitRemoveWorktreeInput: Schema.Struct<{
|
|
53
|
+
readonly cwd: Schema.Trim;
|
|
54
|
+
readonly path: Schema.Trim;
|
|
55
|
+
readonly force: Schema.optional<Schema.Boolean>;
|
|
56
|
+
}>;
|
|
57
|
+
export type GitRemoveWorktreeInput = typeof GitRemoveWorktreeInput.Type;
|
|
58
|
+
export declare const GitCreateBranchInput: Schema.Struct<{
|
|
59
|
+
readonly cwd: Schema.Trim;
|
|
60
|
+
readonly branch: Schema.Trim;
|
|
61
|
+
}>;
|
|
62
|
+
export type GitCreateBranchInput = typeof GitCreateBranchInput.Type;
|
|
63
|
+
export declare const GitCheckoutInput: Schema.Struct<{
|
|
64
|
+
readonly cwd: Schema.Trim;
|
|
65
|
+
readonly branch: Schema.Trim;
|
|
66
|
+
}>;
|
|
67
|
+
export type GitCheckoutInput = typeof GitCheckoutInput.Type;
|
|
68
|
+
export declare const GitInitInput: Schema.Struct<{
|
|
69
|
+
readonly cwd: Schema.Trim;
|
|
70
|
+
}>;
|
|
71
|
+
export type GitInitInput = typeof GitInitInput.Type;
|
|
72
|
+
export declare const GitStatusResult: Schema.Struct<{
|
|
73
|
+
readonly branch: Schema.NullOr<Schema.Trim>;
|
|
74
|
+
readonly hasWorkingTreeChanges: Schema.Boolean;
|
|
75
|
+
readonly workingTree: Schema.Struct<{
|
|
76
|
+
readonly files: Schema.$Array<Schema.Struct<{
|
|
77
|
+
readonly path: Schema.Trim;
|
|
78
|
+
readonly insertions: Schema.Int;
|
|
79
|
+
readonly deletions: Schema.Int;
|
|
80
|
+
}>>;
|
|
81
|
+
readonly insertions: Schema.Int;
|
|
82
|
+
readonly deletions: Schema.Int;
|
|
83
|
+
}>;
|
|
84
|
+
readonly hasUpstream: Schema.Boolean;
|
|
85
|
+
readonly aheadCount: Schema.Int;
|
|
86
|
+
readonly behindCount: Schema.Int;
|
|
87
|
+
readonly pr: Schema.NullOr<Schema.Struct<{
|
|
88
|
+
readonly number: Schema.Int;
|
|
89
|
+
readonly title: Schema.Trim;
|
|
90
|
+
readonly url: Schema.String;
|
|
91
|
+
readonly baseBranch: Schema.Trim;
|
|
92
|
+
readonly headBranch: Schema.Trim;
|
|
93
|
+
readonly state: Schema.Literals<readonly ["open", "closed", "merged"]>;
|
|
94
|
+
}>>;
|
|
95
|
+
}>;
|
|
96
|
+
export type GitStatusResult = typeof GitStatusResult.Type;
|
|
97
|
+
export declare const GitListBranchesResult: Schema.Struct<{
|
|
98
|
+
readonly branches: Schema.$Array<Schema.Struct<{
|
|
99
|
+
readonly name: Schema.Trim;
|
|
100
|
+
readonly isRemote: Schema.optional<Schema.Boolean>;
|
|
101
|
+
readonly remoteName: Schema.optional<Schema.Trim>;
|
|
102
|
+
readonly current: Schema.Boolean;
|
|
103
|
+
readonly isDefault: Schema.Boolean;
|
|
104
|
+
readonly worktreePath: Schema.NullOr<Schema.Trim>;
|
|
105
|
+
}>>;
|
|
106
|
+
readonly isRepo: Schema.Boolean;
|
|
107
|
+
}>;
|
|
108
|
+
export type GitListBranchesResult = typeof GitListBranchesResult.Type;
|
|
109
|
+
export declare const GitCreateWorktreeResult: Schema.Struct<{
|
|
110
|
+
readonly worktree: Schema.Struct<{
|
|
111
|
+
readonly path: Schema.Trim;
|
|
112
|
+
readonly branch: Schema.Trim;
|
|
113
|
+
}>;
|
|
114
|
+
}>;
|
|
115
|
+
export type GitCreateWorktreeResult = typeof GitCreateWorktreeResult.Type;
|
|
116
|
+
export declare const GitRunStackedActionResult: Schema.Struct<{
|
|
117
|
+
readonly action: Schema.Literals<readonly ["commit", "commit_push", "commit_push_pr"]>;
|
|
118
|
+
readonly branch: Schema.Struct<{
|
|
119
|
+
readonly status: Schema.Literals<readonly ["created", "skipped_not_requested"]>;
|
|
120
|
+
readonly name: Schema.optional<Schema.Trim>;
|
|
121
|
+
}>;
|
|
122
|
+
readonly commit: Schema.Struct<{
|
|
123
|
+
readonly status: Schema.Literals<readonly ["created", "skipped_no_changes"]>;
|
|
124
|
+
readonly commitSha: Schema.optional<Schema.Trim>;
|
|
125
|
+
readonly subject: Schema.optional<Schema.Trim>;
|
|
126
|
+
}>;
|
|
127
|
+
readonly push: Schema.Struct<{
|
|
128
|
+
readonly status: Schema.Literals<readonly ["pushed", "skipped_not_requested", "skipped_up_to_date"]>;
|
|
129
|
+
readonly branch: Schema.optional<Schema.Trim>;
|
|
130
|
+
readonly upstreamBranch: Schema.optional<Schema.Trim>;
|
|
131
|
+
readonly setUpstream: Schema.optional<Schema.Boolean>;
|
|
132
|
+
}>;
|
|
133
|
+
readonly pr: Schema.Struct<{
|
|
134
|
+
readonly status: Schema.Literals<readonly ["created", "opened_existing", "skipped_not_requested"]>;
|
|
135
|
+
readonly url: Schema.optional<Schema.String>;
|
|
136
|
+
readonly number: Schema.optional<Schema.Int>;
|
|
137
|
+
readonly baseBranch: Schema.optional<Schema.Trim>;
|
|
138
|
+
readonly headBranch: Schema.optional<Schema.Trim>;
|
|
139
|
+
readonly title: Schema.optional<Schema.Trim>;
|
|
140
|
+
}>;
|
|
141
|
+
}>;
|
|
142
|
+
export type GitRunStackedActionResult = typeof GitRunStackedActionResult.Type;
|
|
143
|
+
export declare const GitPullResult: Schema.Struct<{
|
|
144
|
+
readonly status: Schema.Literals<readonly ["pulled", "skipped_up_to_date"]>;
|
|
145
|
+
readonly branch: Schema.Trim;
|
|
146
|
+
readonly upstreamBranch: Schema.NullOr<Schema.Trim>;
|
|
147
|
+
}>;
|
|
148
|
+
export type GitPullResult = typeof GitPullResult.Type;
|
|
149
|
+
export declare const GitReadWorkingTreePatchResult: Schema.Struct<{
|
|
150
|
+
readonly diff: Schema.String;
|
|
151
|
+
}>;
|
|
152
|
+
export type GitReadWorkingTreePatchResult = typeof GitReadWorkingTreePatchResult.Type;
|
package/dist/src/git.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,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
|
+
};
|