@h-rig/contracts 0.0.6-alpha.17 → 0.0.6-alpha.170
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 +3373 -0
- package/dist/index.mjs +3332 -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/cockpit.d.ts +28 -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 +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/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 +285 -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 +84 -0
- package/dist/src/index.js +2746 -3962
- 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 +186 -0
- package/dist/src/lifecycle-capabilities.js +33 -0
- package/dist/src/managed-repos.d.ts +239 -0
- package/dist/src/managed-repos.js +33 -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/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/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 +255 -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 +88 -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-artifacts.d.ts +33 -0
- package/dist/src/task-artifacts.js +13 -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 +198 -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 +136 -0
- package/dist/src/task-source.js +16 -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-store.d.ts +16 -0
- package/dist/src/task-state-store.js +13 -0
- package/dist/src/task-tracker-state.d.ts +106 -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/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,71 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const MAX_KEYBINDING_VALUE_LENGTH = 64;
|
|
3
|
+
export declare const MAX_WHEN_EXPRESSION_DEPTH = 64;
|
|
4
|
+
export declare const MAX_SCRIPT_ID_LENGTH = 24;
|
|
5
|
+
export declare const MAX_KEYBINDINGS_COUNT = 256;
|
|
6
|
+
export declare const SCRIPT_RUN_COMMAND_PATTERN: Schema.TemplateLiteral<readonly [Schema.Literal<"script.">, Schema.String, Schema.Literal<".run">]>;
|
|
7
|
+
export declare const KeybindingCommand: Schema.Union<readonly [Schema.Literals<readonly ["terminal.toggle", "terminal.split", "terminal.new", "terminal.close", "diff.toggle", "chat.new", "chat.newLocal", "editor.openFavorite"]>, Schema.TemplateLiteral<readonly [Schema.Literal<"script.">, Schema.String, Schema.Literal<".run">]>]>;
|
|
8
|
+
export type KeybindingCommand = typeof KeybindingCommand.Type;
|
|
9
|
+
export declare const KeybindingRule: Schema.Struct<{
|
|
10
|
+
readonly key: Schema.Trim;
|
|
11
|
+
readonly command: Schema.Union<readonly [Schema.Literals<readonly ["terminal.toggle", "terminal.split", "terminal.new", "terminal.close", "diff.toggle", "chat.new", "chat.newLocal", "editor.openFavorite"]>, Schema.TemplateLiteral<readonly [Schema.Literal<"script.">, Schema.String, Schema.Literal<".run">]>]>;
|
|
12
|
+
readonly when: Schema.optional<Schema.Trim>;
|
|
13
|
+
}>;
|
|
14
|
+
export type KeybindingRule = typeof KeybindingRule.Type;
|
|
15
|
+
export declare const KeybindingsConfig: Schema.$Array<Schema.Struct<{
|
|
16
|
+
readonly key: Schema.Trim;
|
|
17
|
+
readonly command: Schema.Union<readonly [Schema.Literals<readonly ["terminal.toggle", "terminal.split", "terminal.new", "terminal.close", "diff.toggle", "chat.new", "chat.newLocal", "editor.openFavorite"]>, Schema.TemplateLiteral<readonly [Schema.Literal<"script.">, Schema.String, Schema.Literal<".run">]>]>;
|
|
18
|
+
readonly when: Schema.optional<Schema.Trim>;
|
|
19
|
+
}>>;
|
|
20
|
+
export type KeybindingsConfig = typeof KeybindingsConfig.Type;
|
|
21
|
+
export declare const KeybindingShortcut: Schema.Struct<{
|
|
22
|
+
readonly key: Schema.Trim;
|
|
23
|
+
readonly metaKey: Schema.Boolean;
|
|
24
|
+
readonly ctrlKey: Schema.Boolean;
|
|
25
|
+
readonly shiftKey: Schema.Boolean;
|
|
26
|
+
readonly altKey: Schema.Boolean;
|
|
27
|
+
readonly modKey: Schema.Boolean;
|
|
28
|
+
}>;
|
|
29
|
+
export type KeybindingShortcut = typeof KeybindingShortcut.Type;
|
|
30
|
+
export declare const KeybindingWhenNode: Schema.Schema<KeybindingWhenNode>;
|
|
31
|
+
export type KeybindingWhenNode = {
|
|
32
|
+
type: "identifier";
|
|
33
|
+
name: string;
|
|
34
|
+
} | {
|
|
35
|
+
type: "not";
|
|
36
|
+
node: KeybindingWhenNode;
|
|
37
|
+
} | {
|
|
38
|
+
type: "and";
|
|
39
|
+
left: KeybindingWhenNode;
|
|
40
|
+
right: KeybindingWhenNode;
|
|
41
|
+
} | {
|
|
42
|
+
type: "or";
|
|
43
|
+
left: KeybindingWhenNode;
|
|
44
|
+
right: KeybindingWhenNode;
|
|
45
|
+
};
|
|
46
|
+
export declare const ResolvedKeybindingRule: Schema.Struct<{
|
|
47
|
+
readonly command: Schema.Union<readonly [Schema.Literals<readonly ["terminal.toggle", "terminal.split", "terminal.new", "terminal.close", "diff.toggle", "chat.new", "chat.newLocal", "editor.openFavorite"]>, Schema.TemplateLiteral<readonly [Schema.Literal<"script.">, Schema.String, Schema.Literal<".run">]>]>;
|
|
48
|
+
readonly shortcut: Schema.Struct<{
|
|
49
|
+
readonly key: Schema.Trim;
|
|
50
|
+
readonly metaKey: Schema.Boolean;
|
|
51
|
+
readonly ctrlKey: Schema.Boolean;
|
|
52
|
+
readonly shiftKey: Schema.Boolean;
|
|
53
|
+
readonly altKey: Schema.Boolean;
|
|
54
|
+
readonly modKey: Schema.Boolean;
|
|
55
|
+
}>;
|
|
56
|
+
readonly whenAst: Schema.optional<Schema.Schema<KeybindingWhenNode>>;
|
|
57
|
+
}>;
|
|
58
|
+
export type ResolvedKeybindingRule = typeof ResolvedKeybindingRule.Type;
|
|
59
|
+
export declare const ResolvedKeybindingsConfig: Schema.$Array<Schema.Struct<{
|
|
60
|
+
readonly command: Schema.Union<readonly [Schema.Literals<readonly ["terminal.toggle", "terminal.split", "terminal.new", "terminal.close", "diff.toggle", "chat.new", "chat.newLocal", "editor.openFavorite"]>, Schema.TemplateLiteral<readonly [Schema.Literal<"script.">, Schema.String, Schema.Literal<".run">]>]>;
|
|
61
|
+
readonly shortcut: Schema.Struct<{
|
|
62
|
+
readonly key: Schema.Trim;
|
|
63
|
+
readonly metaKey: Schema.Boolean;
|
|
64
|
+
readonly ctrlKey: Schema.Boolean;
|
|
65
|
+
readonly shiftKey: Schema.Boolean;
|
|
66
|
+
readonly altKey: Schema.Boolean;
|
|
67
|
+
readonly modKey: Schema.Boolean;
|
|
68
|
+
}>;
|
|
69
|
+
readonly whenAst: Schema.optional<Schema.Schema<KeybindingWhenNode>>;
|
|
70
|
+
}>>;
|
|
71
|
+
export type ResolvedKeybindingsConfig = typeof ResolvedKeybindingsConfig.Type;
|
package/dist/src/keybindings.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,49 @@
|
|
|
1
|
+
/** Directory name for a project's checked-in rig definition (`<root>/rig`). */
|
|
2
|
+
export declare const RIG_DEFINITION_DIRNAME = "rig";
|
|
3
|
+
/** Directory name for rig's per-project state (`<root>/.rig`). */
|
|
4
|
+
export declare const RIG_STATE_DIRNAME = ".rig";
|
|
5
|
+
/** Directory name for run artifacts (`<workspace>/artifacts`). */
|
|
6
|
+
export declare const RIG_ARTIFACTS_DIRNAME = "artifacts";
|
|
7
|
+
export type RigLayout = {
|
|
8
|
+
projectRoot: string;
|
|
9
|
+
monorepoRoot: string;
|
|
10
|
+
definitionRoot: string;
|
|
11
|
+
runtimeWorkspaceRoot: string;
|
|
12
|
+
stateRoot: string;
|
|
13
|
+
artifactsRoot: string;
|
|
14
|
+
configPath: string;
|
|
15
|
+
taskConfigPath: string;
|
|
16
|
+
policyDir: string;
|
|
17
|
+
policyFile: string;
|
|
18
|
+
pluginsDir: string;
|
|
19
|
+
hooksDir: string;
|
|
20
|
+
toolsDir: string;
|
|
21
|
+
templatesDir: string;
|
|
22
|
+
validationDir: string;
|
|
23
|
+
stateDir: string;
|
|
24
|
+
logsDir: string;
|
|
25
|
+
notificationsDir: string;
|
|
26
|
+
runtimeDir: string;
|
|
27
|
+
distDir: string;
|
|
28
|
+
binDir: string;
|
|
29
|
+
pluginBinDir: string;
|
|
30
|
+
keybindingsPath: string;
|
|
31
|
+
controlPlaneEventsFile: string;
|
|
32
|
+
};
|
|
33
|
+
export type RuntimeWorkspaceLayout = {
|
|
34
|
+
workspaceDir: string;
|
|
35
|
+
rigRoot: string;
|
|
36
|
+
stateDir: string;
|
|
37
|
+
logsDir: string;
|
|
38
|
+
artifactsRoot: string;
|
|
39
|
+
runtimeDir: string;
|
|
40
|
+
homeDir: string;
|
|
41
|
+
tmpDir: string;
|
|
42
|
+
cacheDir: string;
|
|
43
|
+
sessionDir: string;
|
|
44
|
+
binDir: string;
|
|
45
|
+
distDir: string;
|
|
46
|
+
pluginBinDir: string;
|
|
47
|
+
contextPath: string;
|
|
48
|
+
controlPlaneEventsFile: string;
|
|
49
|
+
};
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed ports for the default-lifecycle bundle's verification services.
|
|
3
|
+
*
|
|
4
|
+
* The dumb runtime substrate (rig-agent, harness-cli) must NOT import the
|
|
5
|
+
* lifecycle bundle (substrate->plugin cycle). Instead the bundle plugin
|
|
6
|
+
* registers executable impls under these ids on its
|
|
7
|
+
* `contributes.capabilities[].run`, and the runtime resolves them by id from
|
|
8
|
+
* `pluginHost.listExecutableCapabilities()`. These pure types are the shared
|
|
9
|
+
* contract for that seam — they carry no behaviour and import nothing.
|
|
10
|
+
*/
|
|
11
|
+
import type { CapabilityId } from "./capability-id";
|
|
12
|
+
import type { JournalCapability } from "./kernel";
|
|
13
|
+
import type { RigAutomationConfig, StrictPrGreptileApiOptions } from "./control-plane-types";
|
|
14
|
+
import type { RunCloseoutPhase, RunCloseoutPhaseOutcome } from "./run-journal";
|
|
15
|
+
import type { TaskSourceUpdateResult } from "./task-source";
|
|
16
|
+
/** Capability id the bundle registers its `taskVerify` orchestration under. */
|
|
17
|
+
export declare const TASK_VERIFY_CAPABILITY_ID = "default-lifecycle.task-verify";
|
|
18
|
+
/** Capability id the bundle registers its task validation runner under. */
|
|
19
|
+
export declare const TASK_VALIDATION_CAPABILITY_ID = "default-lifecycle.task-validation";
|
|
20
|
+
/** Capability id the bundle registers the completion-verification gate under. */
|
|
21
|
+
export declare const COMPLETION_VERIFICATION_CAPABILITY_ID = "default-lifecycle.completion-verification";
|
|
22
|
+
/** Capability id the bundle registers its run-worker closeout driver under. */
|
|
23
|
+
export declare const RUN_CLOSEOUT_CAPABILITY_ID = "default-lifecycle.run-closeout";
|
|
24
|
+
/** Capability id the bundle registers its lifecycle-owned task-source reflection under. */
|
|
25
|
+
export declare const TASK_SOURCE_REFLECTION_CAPABILITY_ID = "default-lifecycle.task-source-reflection";
|
|
26
|
+
/** Capability id the bundle registers its agent-facing git helper surface under. */
|
|
27
|
+
export declare const LIFECYCLE_GIT_AGENT_CAPABILITY_ID = "default-lifecycle.git-agent";
|
|
28
|
+
export interface TaskVerifyCapabilityInput {
|
|
29
|
+
readonly projectRoot: string;
|
|
30
|
+
readonly taskId?: string;
|
|
31
|
+
}
|
|
32
|
+
/** Resolves true when the task is approved, false when verification rejects. */
|
|
33
|
+
export type TaskVerifyCapabilityRun = (input: TaskVerifyCapabilityInput) => Promise<boolean>;
|
|
34
|
+
/**
|
|
35
|
+
* The typed capability id the bundle provides its task-verify run under, phantom-
|
|
36
|
+
* typed with {@link TaskVerifyCapabilityRun} so `defineCapability(TASK_VERIFY_CAPABILITY)`
|
|
37
|
+
* resolves to the run function with no cast leaking to callers. Its string value
|
|
38
|
+
* is {@link TASK_VERIFY_CAPABILITY_ID}, so it indexes the same host entry.
|
|
39
|
+
*/
|
|
40
|
+
export declare const TASK_VERIFY_CAPABILITY: CapabilityId<TaskVerifyCapabilityRun>;
|
|
41
|
+
export interface TaskValidationCapabilityInput {
|
|
42
|
+
readonly projectRoot: string;
|
|
43
|
+
readonly taskId?: string;
|
|
44
|
+
readonly validatorRegistry?: unknown;
|
|
45
|
+
}
|
|
46
|
+
/** Resolves true when task validation passes or is skipped, false on validation failures. */
|
|
47
|
+
export type TaskValidationCapabilityRun = (input: TaskValidationCapabilityInput) => Promise<boolean>;
|
|
48
|
+
export declare const TASK_VALIDATION_CAPABILITY: CapabilityId<TaskValidationCapabilityRun>;
|
|
49
|
+
export interface CompletionVerificationCapabilityInput {
|
|
50
|
+
readonly projectRoot: string;
|
|
51
|
+
readonly taskId?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface CompletionVerificationCapabilityResult {
|
|
54
|
+
/** True when every completion gate passed; false when the gate blocks. */
|
|
55
|
+
readonly ok: boolean;
|
|
56
|
+
}
|
|
57
|
+
export type CompletionVerificationCapabilityRun = (input: CompletionVerificationCapabilityInput) => Promise<CompletionVerificationCapabilityResult>;
|
|
58
|
+
/**
|
|
59
|
+
* The typed capability id the bundle provides its completion-verification gate
|
|
60
|
+
* under, phantom-typed with {@link CompletionVerificationCapabilityRun}. Its
|
|
61
|
+
* string value is {@link COMPLETION_VERIFICATION_CAPABILITY_ID}, so it indexes
|
|
62
|
+
* the same host entry.
|
|
63
|
+
*/
|
|
64
|
+
export declare const COMPLETION_VERIFICATION_CAPABILITY: CapabilityId<CompletionVerificationCapabilityRun>;
|
|
65
|
+
export type LifecycleGitCommitOptions = {
|
|
66
|
+
projectRoot: string;
|
|
67
|
+
taskId?: string;
|
|
68
|
+
target: "monorepo" | "project" | "both";
|
|
69
|
+
message?: string;
|
|
70
|
+
allowEmpty: boolean;
|
|
71
|
+
scoped?: boolean;
|
|
72
|
+
};
|
|
73
|
+
export type LifecycleGitOpenPrOptions = {
|
|
74
|
+
projectRoot: string;
|
|
75
|
+
taskId?: string;
|
|
76
|
+
target?: "monorepo" | "project";
|
|
77
|
+
reviewer?: string;
|
|
78
|
+
base?: string;
|
|
79
|
+
title?: string;
|
|
80
|
+
body?: string;
|
|
81
|
+
draft?: boolean;
|
|
82
|
+
};
|
|
83
|
+
export type LifecycleGitOpenPrResult = {
|
|
84
|
+
url: string;
|
|
85
|
+
reviewer?: string;
|
|
86
|
+
reviewerSource?: "flag" | "task-config" | "changed-files" | "env";
|
|
87
|
+
target: "monorepo" | "project";
|
|
88
|
+
repoLabel: string;
|
|
89
|
+
branch: string;
|
|
90
|
+
base: string;
|
|
91
|
+
};
|
|
92
|
+
export type LifecycleGitAgentService = {
|
|
93
|
+
shouldScopeGitCommit(args: string[], hasTaskContext: boolean): boolean;
|
|
94
|
+
gitStatus(projectRoot: string, taskId?: string): void;
|
|
95
|
+
gitChanged(projectRoot: string, taskId: string | undefined, scoped: boolean): string[];
|
|
96
|
+
gitPreflight(projectRoot: string, taskId: string | undefined, strict: boolean): boolean;
|
|
97
|
+
gitSyncBranch(projectRoot: string, taskId?: string, targetRepo?: "monorepo" | "project"): void;
|
|
98
|
+
gitCommit(options: LifecycleGitCommitOptions): void;
|
|
99
|
+
gitSnapshot(projectRoot: string, taskId?: string, outputPath?: string): string;
|
|
100
|
+
gitOpenPr(options: LifecycleGitOpenPrOptions): LifecycleGitOpenPrResult;
|
|
101
|
+
};
|
|
102
|
+
export declare const LIFECYCLE_GIT_AGENT: CapabilityId<LifecycleGitAgentService>;
|
|
103
|
+
export type RunTaskSourceReflectStatus = "under_review" | "ci_fixing" | "merging" | "closed" | "needs_attention";
|
|
104
|
+
export type RunTaskSourceLifecycleStatus = "running" | RunTaskSourceReflectStatus | "cancelled";
|
|
105
|
+
export type RunTaskSourceLifecycleRun = {
|
|
106
|
+
runId?: string | null;
|
|
107
|
+
taskId?: string | null;
|
|
108
|
+
sourceTask?: unknown;
|
|
109
|
+
worktreePath?: string | null;
|
|
110
|
+
logRoot?: string | null;
|
|
111
|
+
sessionPath?: string | null;
|
|
112
|
+
errorText?: string | null;
|
|
113
|
+
};
|
|
114
|
+
export type RunTaskSourceLifecycleOptions = {
|
|
115
|
+
errorText?: string | null;
|
|
116
|
+
};
|
|
117
|
+
export type TaskSourceReflectionInput = {
|
|
118
|
+
readonly projectRoot: string;
|
|
119
|
+
readonly taskId: string;
|
|
120
|
+
readonly sourceTask?: unknown;
|
|
121
|
+
readonly runId?: string | null;
|
|
122
|
+
/** Generic source status to write. Omit/null for comment-only reflection. */
|
|
123
|
+
readonly status?: string | null;
|
|
124
|
+
/** Status text rendered in the lifecycle comment; defaults to `status`. */
|
|
125
|
+
readonly commentStatus?: string | null;
|
|
126
|
+
readonly summary: string;
|
|
127
|
+
readonly runtimeWorkspace?: string | null;
|
|
128
|
+
readonly logsDir?: string | null;
|
|
129
|
+
readonly sessionDir?: string | null;
|
|
130
|
+
readonly errorText?: string | null;
|
|
131
|
+
readonly prUrl?: string | null;
|
|
132
|
+
};
|
|
133
|
+
export type TaskSourceMergedPrReflectionInput = {
|
|
134
|
+
readonly projectRoot: string;
|
|
135
|
+
readonly taskId: string;
|
|
136
|
+
readonly runId: string;
|
|
137
|
+
readonly prUrl: string;
|
|
138
|
+
readonly sourceTask?: unknown;
|
|
139
|
+
};
|
|
140
|
+
export type TaskSourceReflectionResult = TaskSourceUpdateResult & {
|
|
141
|
+
readonly status?: unknown;
|
|
142
|
+
};
|
|
143
|
+
export interface TaskSourceReflectionService {
|
|
144
|
+
reflectTaskSourceStatus(input: TaskSourceReflectionInput): Promise<TaskSourceReflectionResult | null>;
|
|
145
|
+
updateRunTaskSourceLifecycle(projectRoot: string, run: RunTaskSourceLifecycleRun, status: RunTaskSourceLifecycleStatus, summary: string, options?: RunTaskSourceLifecycleOptions): Promise<TaskSourceReflectionResult | null>;
|
|
146
|
+
closeMergedPr(input: TaskSourceMergedPrReflectionInput): Promise<TaskSourceReflectionResult | null>;
|
|
147
|
+
}
|
|
148
|
+
export declare const TASK_SOURCE_REFLECTION: CapabilityId<TaskSourceReflectionService>;
|
|
149
|
+
export type RunCloseoutResultStatus = "merged" | "opened" | "skipped" | "needs-attention";
|
|
150
|
+
export type RunCloseoutResult = {
|
|
151
|
+
status: RunCloseoutResultStatus;
|
|
152
|
+
prUrl?: string;
|
|
153
|
+
iterations: number;
|
|
154
|
+
feedback: readonly string[];
|
|
155
|
+
};
|
|
156
|
+
export type RunCloseoutValidationInput = {
|
|
157
|
+
projectRoot: string;
|
|
158
|
+
taskId: string;
|
|
159
|
+
};
|
|
160
|
+
export type RunCloseoutValidationRunner = (input: RunCloseoutValidationInput) => Promise<boolean> | boolean;
|
|
161
|
+
export type RunCloseoutInput = {
|
|
162
|
+
projectRoot: string;
|
|
163
|
+
runId: string;
|
|
164
|
+
taskId: string;
|
|
165
|
+
branch: string;
|
|
166
|
+
workspace: string;
|
|
167
|
+
artifactRoot?: string | null;
|
|
168
|
+
config?: RigAutomationConfig | null;
|
|
169
|
+
sourceTask?: Record<string, unknown> | null;
|
|
170
|
+
steerPi: (message: string) => Promise<void>;
|
|
171
|
+
greptileApi?: StrictPrGreptileApiOptions;
|
|
172
|
+
runValidation?: RunCloseoutValidationRunner;
|
|
173
|
+
onValidationStart?: () => Promise<void> | void;
|
|
174
|
+
kernelJournal?: JournalCapability | null;
|
|
175
|
+
journalPhase: (phase: RunCloseoutPhase, outcome: RunCloseoutPhaseOutcome, detail?: string | null) => Promise<void> | void;
|
|
176
|
+
reflect: (status: RunTaskSourceReflectStatus, summary: string, options?: {
|
|
177
|
+
errorText?: string | null;
|
|
178
|
+
}) => Promise<void> | void;
|
|
179
|
+
};
|
|
180
|
+
export type RunCloseoutCapabilityRun = (input: RunCloseoutInput) => Promise<RunCloseoutResult>;
|
|
181
|
+
/**
|
|
182
|
+
* The typed capability id the bundle provides its run-worker closeout driver
|
|
183
|
+
* under, so @rig/run-worker can close out by resolving the lifecycle capability
|
|
184
|
+
* instead of importing the lifecycle plugin implementation.
|
|
185
|
+
*/
|
|
186
|
+
export declare const RUN_CLOSEOUT_CAPABILITY: CapabilityId<RunCloseoutCapabilityRun>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/capability-id.ts
|
|
3
|
+
function makeCapabilityId(id) {
|
|
4
|
+
return id;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// packages/contracts/src/lifecycle-capabilities.ts
|
|
8
|
+
var TASK_VERIFY_CAPABILITY_ID = "default-lifecycle.task-verify";
|
|
9
|
+
var TASK_VALIDATION_CAPABILITY_ID = "default-lifecycle.task-validation";
|
|
10
|
+
var COMPLETION_VERIFICATION_CAPABILITY_ID = "default-lifecycle.completion-verification";
|
|
11
|
+
var RUN_CLOSEOUT_CAPABILITY_ID = "default-lifecycle.run-closeout";
|
|
12
|
+
var TASK_SOURCE_REFLECTION_CAPABILITY_ID = "default-lifecycle.task-source-reflection";
|
|
13
|
+
var LIFECYCLE_GIT_AGENT_CAPABILITY_ID = "default-lifecycle.git-agent";
|
|
14
|
+
var TASK_VERIFY_CAPABILITY = makeCapabilityId(TASK_VERIFY_CAPABILITY_ID);
|
|
15
|
+
var TASK_VALIDATION_CAPABILITY = makeCapabilityId(TASK_VALIDATION_CAPABILITY_ID);
|
|
16
|
+
var COMPLETION_VERIFICATION_CAPABILITY = makeCapabilityId(COMPLETION_VERIFICATION_CAPABILITY_ID);
|
|
17
|
+
var LIFECYCLE_GIT_AGENT = makeCapabilityId(LIFECYCLE_GIT_AGENT_CAPABILITY_ID);
|
|
18
|
+
var TASK_SOURCE_REFLECTION = makeCapabilityId(TASK_SOURCE_REFLECTION_CAPABILITY_ID);
|
|
19
|
+
var RUN_CLOSEOUT_CAPABILITY = makeCapabilityId(RUN_CLOSEOUT_CAPABILITY_ID);
|
|
20
|
+
export {
|
|
21
|
+
TASK_VERIFY_CAPABILITY_ID,
|
|
22
|
+
TASK_VERIFY_CAPABILITY,
|
|
23
|
+
TASK_VALIDATION_CAPABILITY_ID,
|
|
24
|
+
TASK_VALIDATION_CAPABILITY,
|
|
25
|
+
TASK_SOURCE_REFLECTION_CAPABILITY_ID,
|
|
26
|
+
TASK_SOURCE_REFLECTION,
|
|
27
|
+
RUN_CLOSEOUT_CAPABILITY_ID,
|
|
28
|
+
RUN_CLOSEOUT_CAPABILITY,
|
|
29
|
+
LIFECYCLE_GIT_AGENT_CAPABILITY_ID,
|
|
30
|
+
LIFECYCLE_GIT_AGENT,
|
|
31
|
+
COMPLETION_VERIFICATION_CAPABILITY_ID,
|
|
32
|
+
COMPLETION_VERIFICATION_CAPABILITY
|
|
33
|
+
};
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure managed-repo, repo-operation, and repo-native git contract types + capability ids.
|
|
3
|
+
*
|
|
4
|
+
* `@rig/repos-plugin` owns the concrete implementations. It contributes:
|
|
5
|
+
* - `ManagedRepoService` under {@link MANAGED_REPO_SERVICE_CAPABILITY_ID} for
|
|
6
|
+
* registry/layout/mirror state,
|
|
7
|
+
* - `RepoOperationsService` under {@link REPO_OPERATIONS_CAPABILITY_ID} for
|
|
8
|
+
* task repo pinning, baseline reset, and project-main pre-run sync,
|
|
9
|
+
* - `RepoNativeGitService` under {@link REPO_NATIVE_GIT_CAPABILITY_ID} for
|
|
10
|
+
* repo-native git command wrappers, and
|
|
11
|
+
* - `RepoGitBinaryService` under {@link REPO_GIT_BINARY_CAPABILITY_ID} for
|
|
12
|
+
* the repo-owned rig-git helper binary.
|
|
13
|
+
*
|
|
14
|
+
* This module carries no behaviour and imports only pure sibling types, so
|
|
15
|
+
* consumers resolve typed ids through `@rig/core` without importing the provider
|
|
16
|
+
* plugin or the old kernel repo-ops facades.
|
|
17
|
+
*/
|
|
18
|
+
import type { CapabilityId } from "./capability-id";
|
|
19
|
+
import type { RepoSourceRegistration } from "./plugin";
|
|
20
|
+
import type { GitWorkingTreeFileChange } from "./git";
|
|
21
|
+
import type { NativeToolchainBinaryArtifact, NativeToolchainTarget } from "./native-toolchain";
|
|
22
|
+
export type ManagedRepoId = string;
|
|
23
|
+
export type ManagedRepoAlias = string;
|
|
24
|
+
export type ManagedRepoHealth = "missing" | "ready" | "stale" | "misconfigured";
|
|
25
|
+
export type ManagedRepoRegistryEntry = {
|
|
26
|
+
id: ManagedRepoId;
|
|
27
|
+
alias: ManagedRepoAlias;
|
|
28
|
+
defaultBranch: string;
|
|
29
|
+
defaultRemoteUrl: string;
|
|
30
|
+
remoteEnvVar?: string;
|
|
31
|
+
checkoutEnvVar?: string;
|
|
32
|
+
};
|
|
33
|
+
export type ManagedRepoLayout = {
|
|
34
|
+
projectRoot: string;
|
|
35
|
+
repoId: ManagedRepoId;
|
|
36
|
+
alias: ManagedRepoAlias;
|
|
37
|
+
defaultBranch: string;
|
|
38
|
+
remoteUrl: string;
|
|
39
|
+
checkoutRoot: string;
|
|
40
|
+
worktreesRoot: string;
|
|
41
|
+
stateDir: string;
|
|
42
|
+
metadataRoot: string;
|
|
43
|
+
metadataRelativePath: string;
|
|
44
|
+
mirrorRoot: string;
|
|
45
|
+
mirrorStatePath: string;
|
|
46
|
+
mirrorStateRelativePath: string;
|
|
47
|
+
};
|
|
48
|
+
export type ManagedRepoMirrorState = {
|
|
49
|
+
version: 1;
|
|
50
|
+
repoId: ManagedRepoId;
|
|
51
|
+
remoteUrl: string;
|
|
52
|
+
defaultBranch: string;
|
|
53
|
+
initializedAt?: string;
|
|
54
|
+
lastSyncedAt?: string;
|
|
55
|
+
headRef?: string;
|
|
56
|
+
headCommit?: string;
|
|
57
|
+
};
|
|
58
|
+
export type ManagedRepoSyncResult = {
|
|
59
|
+
layout: ManagedRepoLayout;
|
|
60
|
+
headCommit: string;
|
|
61
|
+
};
|
|
62
|
+
/** A repo registration plus an optional computed local checkout path. */
|
|
63
|
+
export interface RepoEntry extends RepoSourceRegistration {
|
|
64
|
+
/** Optional computed local checkout path (runtime-specific, may be set by caller). */
|
|
65
|
+
localPath?: string;
|
|
66
|
+
}
|
|
67
|
+
/** An immutable, id-indexed view over plugin-contributed repo sources. */
|
|
68
|
+
export interface RepoRegistry {
|
|
69
|
+
getById(id: string): RepoEntry | undefined;
|
|
70
|
+
list(): readonly RepoEntry[];
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The cohesive set of managed-repo operations the runtime substrate depends on.
|
|
74
|
+
* The plugin provides a concrete impl (statically checked against this interface
|
|
75
|
+
* via `defineCapability(MANAGED_REPO_SERVICE_CAPABILITY).provide`); the substrate
|
|
76
|
+
* only ever sees this port, resolved by id off a plugin host with no cast.
|
|
77
|
+
*/
|
|
78
|
+
export interface ManagedRepoService {
|
|
79
|
+
/** Replace the managed-repo singleton with the given entries (boot wiring). */
|
|
80
|
+
setManagedRepos(entries: readonly ManagedRepoRegistryEntry[]): void;
|
|
81
|
+
/** List the currently registered managed-repo entries. */
|
|
82
|
+
listManagedRepoEntries(): ManagedRepoRegistryEntry[];
|
|
83
|
+
/** Resolve a managed-repo id from its alias, or null when unknown. */
|
|
84
|
+
resolveManagedRepoIdByAlias(alias: string): ManagedRepoId | null;
|
|
85
|
+
/**
|
|
86
|
+
* Convert a plugin-contributed RepoSourceRegistration into the managed-repo
|
|
87
|
+
* entry shape; null for pure-listing registrations (no defaultBranch).
|
|
88
|
+
*/
|
|
89
|
+
repoRegistrationToManagedEntry(reg: RepoSourceRegistration): ManagedRepoRegistryEntry | null;
|
|
90
|
+
/** Build an immutable id-indexed registry from repo source registrations. */
|
|
91
|
+
createRepoRegistry(entries: readonly RepoSourceRegistration[]): RepoRegistry;
|
|
92
|
+
/** Resolve a managed repo's on-disk layout by alias, or null when unknown. */
|
|
93
|
+
resolveManagedRepoLayoutByAlias(projectRoot: string, alias: string): ManagedRepoLayout | null;
|
|
94
|
+
/** Resolve the primary monorepo layout; throws when no managed repos exist. */
|
|
95
|
+
resolveMonorepoRepoLayout(projectRoot: string): ManagedRepoLayout;
|
|
96
|
+
/** Refresh + sync a managed repo's mirror, returning the resulting head. */
|
|
97
|
+
syncManagedRepo(projectRoot: string, repoId: ManagedRepoId): ManagedRepoSyncResult;
|
|
98
|
+
}
|
|
99
|
+
export type RepoPins = Record<string, string>;
|
|
100
|
+
export type RepoNativeGitTreeCommitUpdate = {
|
|
101
|
+
readonly path: string;
|
|
102
|
+
readonly content: string;
|
|
103
|
+
readonly executable?: boolean;
|
|
104
|
+
} | {
|
|
105
|
+
readonly path: string;
|
|
106
|
+
readonly delete: true;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Repo-owned native git command seam. Implementations live in `@rig/repos-plugin`;
|
|
110
|
+
* native-toolchain only builds/materializes binaries and does not own repo or git
|
|
111
|
+
* workflow semantics.
|
|
112
|
+
*/
|
|
113
|
+
export interface RepoNativeGitService {
|
|
114
|
+
fetchRef(repoPath: string, remote: string, branch: string): string;
|
|
115
|
+
readBlobAtRef(repoPath: string, ref: string, path: string): string;
|
|
116
|
+
writeTreeCommit(repoPath: string, baseRef: string, updates: readonly RepoNativeGitTreeCommitUpdate[], message: string): string;
|
|
117
|
+
pushRefWithLease(repoPath: string, localOid: string, remoteRef: string, expectedOldOid: string, remote?: string): string;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Repo-native git is intentionally named from repos contracts. The capability id
|
|
121
|
+
* remains `native-toolchain.git` for compatibility with already published
|
|
122
|
+
* providers/consumers; treat that string as a legacy wire id, not ownership.
|
|
123
|
+
*/
|
|
124
|
+
export declare const REPO_NATIVE_GIT_CAPABILITY_ID = "native-toolchain.git";
|
|
125
|
+
export declare const REPO_NATIVE_GIT: CapabilityId<RepoNativeGitService>;
|
|
126
|
+
/** @deprecated Use RepoNativeGitTreeCommitUpdate. */
|
|
127
|
+
export type NativeGitTreeCommitUpdate = RepoNativeGitTreeCommitUpdate;
|
|
128
|
+
/** @deprecated Use RepoNativeGitService. */
|
|
129
|
+
export type NativeGitService = RepoNativeGitService;
|
|
130
|
+
/** @deprecated Use REPO_NATIVE_GIT_CAPABILITY_ID; this is the legacy wire id. */
|
|
131
|
+
export declare const NATIVE_TOOLCHAIN_GIT_CAPABILITY_ID = "native-toolchain.git";
|
|
132
|
+
/** @deprecated Use REPO_NATIVE_GIT. */
|
|
133
|
+
export declare const NATIVE_TOOLCHAIN_GIT: CapabilityId<RepoNativeGitService>;
|
|
134
|
+
export interface RepoGitBinaryResolveInput {
|
|
135
|
+
readonly projectRoot?: string;
|
|
136
|
+
readonly target?: NativeToolchainTarget;
|
|
137
|
+
}
|
|
138
|
+
export interface RepoGitBinaryMaterializeInput {
|
|
139
|
+
readonly projectRoot: string;
|
|
140
|
+
readonly targetDir: string;
|
|
141
|
+
readonly target?: NativeToolchainTarget;
|
|
142
|
+
}
|
|
143
|
+
export interface RepoGitBinaryArtifact extends NativeToolchainBinaryArtifact {
|
|
144
|
+
readonly name: "rig-git";
|
|
145
|
+
readonly kind: "executable";
|
|
146
|
+
readonly commandName: string;
|
|
147
|
+
}
|
|
148
|
+
export interface RepoGitBinaryService {
|
|
149
|
+
gitHelperBinaryName(input?: RepoGitBinaryResolveInput): string;
|
|
150
|
+
resolveGitHelperBinary(input?: RepoGitBinaryResolveInput): RepoGitBinaryArtifact | null | Promise<RepoGitBinaryArtifact | null>;
|
|
151
|
+
materializeGitHelperBinary(input: RepoGitBinaryMaterializeInput): Promise<RepoGitBinaryArtifact>;
|
|
152
|
+
}
|
|
153
|
+
export declare const REPO_GIT_BINARY_CAPABILITY_ID = "repos.git-binary";
|
|
154
|
+
export declare const REPO_GIT_BINARY: CapabilityId<RepoGitBinaryService>;
|
|
155
|
+
export type ProjectMainPreRunSyncResult = {
|
|
156
|
+
status: "disabled";
|
|
157
|
+
} | {
|
|
158
|
+
status: "skipped_not_main";
|
|
159
|
+
branch: string;
|
|
160
|
+
} | {
|
|
161
|
+
status: "up_to_date";
|
|
162
|
+
} | {
|
|
163
|
+
status: "local_ahead";
|
|
164
|
+
localAhead: number;
|
|
165
|
+
} | {
|
|
166
|
+
status: "updated";
|
|
167
|
+
remoteAhead: number;
|
|
168
|
+
};
|
|
169
|
+
export type ProjectMainPreRunSyncOptions = {
|
|
170
|
+
projectRoot: string;
|
|
171
|
+
disabled?: boolean;
|
|
172
|
+
runBootstrap: () => Promise<void>;
|
|
173
|
+
syncMonorepo?: (projectRoot: string) => void | Promise<void>;
|
|
174
|
+
};
|
|
175
|
+
export type RepoChangeSetSelector = {
|
|
176
|
+
readonly kind: "task";
|
|
177
|
+
readonly taskId: string;
|
|
178
|
+
readonly scoped: boolean;
|
|
179
|
+
} | {
|
|
180
|
+
readonly kind: "scope";
|
|
181
|
+
readonly paths: readonly string[];
|
|
182
|
+
} | {
|
|
183
|
+
readonly kind: "workspace";
|
|
184
|
+
};
|
|
185
|
+
export type RepoChangeSetTarget = {
|
|
186
|
+
readonly kind: "project";
|
|
187
|
+
readonly projectRoot: string;
|
|
188
|
+
} | {
|
|
189
|
+
readonly kind: "managed-repo";
|
|
190
|
+
readonly projectRoot: string;
|
|
191
|
+
readonly repoId: ManagedRepoId;
|
|
192
|
+
} | {
|
|
193
|
+
readonly kind: "repo-root";
|
|
194
|
+
readonly repoRoot: string;
|
|
195
|
+
readonly projectRoot?: string;
|
|
196
|
+
};
|
|
197
|
+
export interface RepoChangeSetInput {
|
|
198
|
+
readonly projectRoot: string;
|
|
199
|
+
readonly selector: RepoChangeSetSelector;
|
|
200
|
+
readonly target?: RepoChangeSetTarget;
|
|
201
|
+
}
|
|
202
|
+
export interface RepoChangeSetFile extends GitWorkingTreeFileChange {
|
|
203
|
+
readonly repoRoot: string;
|
|
204
|
+
readonly repoId?: ManagedRepoId;
|
|
205
|
+
}
|
|
206
|
+
export interface RepoChangeSet {
|
|
207
|
+
readonly changedFiles: readonly RepoChangeSetFile[];
|
|
208
|
+
readonly pendingFiles: readonly RepoChangeSetFile[];
|
|
209
|
+
}
|
|
210
|
+
export interface RepoChangeSetService {
|
|
211
|
+
collectChangeSet(input: RepoChangeSetInput): RepoChangeSet | Promise<RepoChangeSet>;
|
|
212
|
+
changedFiles(input: RepoChangeSetInput): readonly RepoChangeSetFile[] | Promise<readonly RepoChangeSetFile[]>;
|
|
213
|
+
pendingFiles(input: RepoChangeSetInput): readonly RepoChangeSetFile[] | Promise<readonly RepoChangeSetFile[]>;
|
|
214
|
+
}
|
|
215
|
+
export declare const REPO_CHANGE_SET_CAPABILITY_ID = "repos.change-set";
|
|
216
|
+
export declare const REPO_CHANGE_SET: CapabilityId<RepoChangeSetService>;
|
|
217
|
+
export interface RepoOperationsService {
|
|
218
|
+
repoEnsure(projectRoot: string, taskId?: string): void;
|
|
219
|
+
repoPins(projectRoot: string, taskId?: string): RepoPins;
|
|
220
|
+
repoVerify(projectRoot: string, taskId?: string): boolean;
|
|
221
|
+
repoDiscover(projectRoot: string, taskId?: string): RepoPins;
|
|
222
|
+
repoBaseline(projectRoot: string, refresh?: boolean): RepoPins;
|
|
223
|
+
resetBaseline(projectRoot: string, keepTaskStatus: boolean): void;
|
|
224
|
+
ensureProjectMainFreshBeforeRun(options: ProjectMainPreRunSyncOptions): Promise<ProjectMainPreRunSyncResult>;
|
|
225
|
+
}
|
|
226
|
+
export declare const REPO_OPERATIONS_CAPABILITY_ID = "repos.operations";
|
|
227
|
+
export declare const REPO_OPERATIONS_CAPABILITY: CapabilityId<RepoOperationsService>;
|
|
228
|
+
/** The capability `run` shape the plugin registers: a (lazy) service factory. */
|
|
229
|
+
export type ManagedRepoServiceCapabilityRun = () => ManagedRepoService | Promise<ManagedRepoService>;
|
|
230
|
+
/** Capability id the managed-repo service plugin registers its factory under. */
|
|
231
|
+
export declare const MANAGED_REPO_SERVICE_CAPABILITY_ID = "managed-repos.service";
|
|
232
|
+
/**
|
|
233
|
+
* The typed capability id the repos plugin provides and consumers require.
|
|
234
|
+
* Phantom-typed with {@link ManagedRepoService} so
|
|
235
|
+
* `defineCapability(MANAGED_REPO_SERVICE_CAPABILITY).resolve(host)` returns a
|
|
236
|
+
* `ManagedRepoService` with no cast leaking to callers. Its string value is
|
|
237
|
+
* {@link MANAGED_REPO_SERVICE_CAPABILITY_ID}, so it indexes the same host entry.
|
|
238
|
+
*/
|
|
239
|
+
export declare const MANAGED_REPO_SERVICE_CAPABILITY: CapabilityId<ManagedRepoService>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/capability-id.ts
|
|
3
|
+
function makeCapabilityId(id) {
|
|
4
|
+
return id;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// packages/contracts/src/managed-repos.ts
|
|
8
|
+
var REPO_NATIVE_GIT_CAPABILITY_ID = "native-toolchain.git";
|
|
9
|
+
var REPO_NATIVE_GIT = makeCapabilityId(REPO_NATIVE_GIT_CAPABILITY_ID);
|
|
10
|
+
var NATIVE_TOOLCHAIN_GIT_CAPABILITY_ID = REPO_NATIVE_GIT_CAPABILITY_ID;
|
|
11
|
+
var NATIVE_TOOLCHAIN_GIT = REPO_NATIVE_GIT;
|
|
12
|
+
var REPO_GIT_BINARY_CAPABILITY_ID = "repos.git-binary";
|
|
13
|
+
var REPO_GIT_BINARY = makeCapabilityId(REPO_GIT_BINARY_CAPABILITY_ID);
|
|
14
|
+
var REPO_CHANGE_SET_CAPABILITY_ID = "repos.change-set";
|
|
15
|
+
var REPO_CHANGE_SET = makeCapabilityId(REPO_CHANGE_SET_CAPABILITY_ID);
|
|
16
|
+
var REPO_OPERATIONS_CAPABILITY_ID = "repos.operations";
|
|
17
|
+
var REPO_OPERATIONS_CAPABILITY = makeCapabilityId(REPO_OPERATIONS_CAPABILITY_ID);
|
|
18
|
+
var MANAGED_REPO_SERVICE_CAPABILITY_ID = "managed-repos.service";
|
|
19
|
+
var MANAGED_REPO_SERVICE_CAPABILITY = makeCapabilityId(MANAGED_REPO_SERVICE_CAPABILITY_ID);
|
|
20
|
+
export {
|
|
21
|
+
REPO_OPERATIONS_CAPABILITY_ID,
|
|
22
|
+
REPO_OPERATIONS_CAPABILITY,
|
|
23
|
+
REPO_NATIVE_GIT_CAPABILITY_ID,
|
|
24
|
+
REPO_NATIVE_GIT,
|
|
25
|
+
REPO_GIT_BINARY_CAPABILITY_ID,
|
|
26
|
+
REPO_GIT_BINARY,
|
|
27
|
+
REPO_CHANGE_SET_CAPABILITY_ID,
|
|
28
|
+
REPO_CHANGE_SET,
|
|
29
|
+
NATIVE_TOOLCHAIN_GIT_CAPABILITY_ID,
|
|
30
|
+
NATIVE_TOOLCHAIN_GIT,
|
|
31
|
+
MANAGED_REPO_SERVICE_CAPABILITY_ID,
|
|
32
|
+
MANAGED_REPO_SERVICE_CAPABILITY
|
|
33
|
+
};
|