@h-rig/contracts 0.0.6-alpha.18 → 0.0.6-alpha.181
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,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure session-asset-materializer contract.
|
|
3
|
+
*
|
|
4
|
+
* Neutral home for the "materialize plugin-contributed session assets into the
|
|
5
|
+
* workspace" seam so the plugin-host assembler (@rig/core/plugin-host-context)
|
|
6
|
+
* can trigger Pi skill + package materialization without importing
|
|
7
|
+
* @rig/provider-plugin (a floor->plugin cycle). The provider plugin owns the
|
|
8
|
+
* concrete impl (it knows the `.pi/skills` + `.pi/settings.json` layout) and
|
|
9
|
+
* registers it under {@link SESSION_ASSET_MATERIALIZER}; the assembler resolves
|
|
10
|
+
* it by id off the project plugin host and calls it. When no provider plugin is
|
|
11
|
+
* loaded the capability is simply absent and materialization is skipped — the
|
|
12
|
+
* same non-fatal default the inline implementation had.
|
|
13
|
+
*
|
|
14
|
+
* Carries no behaviour and imports only sibling contract types.
|
|
15
|
+
*/
|
|
16
|
+
import type { CapabilityId } from "./capability-id";
|
|
17
|
+
import type { RigConfig } from "./config";
|
|
18
|
+
/** Capability id the provider plugin registers its session-asset materializer under. */
|
|
19
|
+
export declare const SESSION_ASSET_MATERIALIZER_CAPABILITY_ID = "provider.session-asset-materializer";
|
|
20
|
+
/**
|
|
21
|
+
* Materializes the plugin-contributed session assets (Pi skills declared via
|
|
22
|
+
* `contributes.skills`, and the config-declared Pi extension packages in
|
|
23
|
+
* `runtime.pi.packages`) into the project workspace. Idempotent and non-fatal:
|
|
24
|
+
* implementations log-and-continue on individual write failures so a
|
|
25
|
+
* materialization error can never deadlock harness boot.
|
|
26
|
+
*/
|
|
27
|
+
export interface SessionAssetMaterializerService {
|
|
28
|
+
materializeSessionAssets(projectRoot: string, config: RigConfig): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Typed capability id the provider plugin provides and the plugin-host assembler
|
|
32
|
+
* requires. Phantom-typed with `SessionAssetMaterializerService` so `resolve(host)`
|
|
33
|
+
* returns the service with no cast leaking to callers.
|
|
34
|
+
*/
|
|
35
|
+
export declare const SESSION_ASSET_MATERIALIZER: CapabilityId<SessionAssetMaterializerService>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/capability-id.ts
|
|
3
|
+
function makeCapabilityId(id) {
|
|
4
|
+
return id;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// packages/contracts/src/session-asset-materializer.ts
|
|
8
|
+
var SESSION_ASSET_MATERIALIZER_CAPABILITY_ID = "provider.session-asset-materializer";
|
|
9
|
+
var SESSION_ASSET_MATERIALIZER = makeCapabilityId(SESSION_ASSET_MATERIALIZER_CAPABILITY_ID);
|
|
10
|
+
export {
|
|
11
|
+
SESSION_ASSET_MATERIALIZER_CAPABILITY_ID,
|
|
12
|
+
SESSION_ASSET_MATERIALIZER
|
|
13
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { CapabilityId } from "./capability-id";
|
|
2
|
+
import type { HookEvent, HookRegistration } from "./plugin";
|
|
3
|
+
/** Stable id string for provider/runtime-owned session hook materialization. */
|
|
4
|
+
export declare const SESSION_HOOK_MATERIALIZER_CAPABILITY_ID = "provider.session-hook-materializer";
|
|
5
|
+
/**
|
|
6
|
+
* A plugin hook contribution prepared for the active session host.
|
|
7
|
+
*
|
|
8
|
+
* `typed` means the hook has a runtime implementation attached to the authored
|
|
9
|
+
* plugin object. Concrete materializers decide how their session host invokes
|
|
10
|
+
* that implementation; metadata-only hooks (no command and not typed) can be
|
|
11
|
+
* skipped by implementations.
|
|
12
|
+
*/
|
|
13
|
+
export interface PluginHookEntry {
|
|
14
|
+
readonly pluginName: string;
|
|
15
|
+
readonly hook: HookRegistration;
|
|
16
|
+
readonly typed?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** Alias naming the entries by the capability they are handed to. */
|
|
19
|
+
export type SessionHookEntry = PluginHookEntry;
|
|
20
|
+
/** Provider-owned materialization result; adapter ids are intentionally open. */
|
|
21
|
+
export type SessionHookMaterializerResult = {
|
|
22
|
+
readonly adapterId: string;
|
|
23
|
+
readonly status: "materialized";
|
|
24
|
+
readonly path?: string;
|
|
25
|
+
readonly events?: readonly HookEvent[];
|
|
26
|
+
} | {
|
|
27
|
+
readonly adapterId: string;
|
|
28
|
+
readonly status: "skipped";
|
|
29
|
+
readonly reason: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Materializes plugin-contributed hooks into whatever session host is active
|
|
33
|
+
* (Claude Code settings, Pi/OMP session integration, or another provider-owned
|
|
34
|
+
* substrate). The floor runtime resolves this capability and invokes it; it
|
|
35
|
+
* does not know adapter names, settings paths, or provider/session policy.
|
|
36
|
+
*/
|
|
37
|
+
export interface SessionHookMaterializerService {
|
|
38
|
+
materializeSessionHooks(projectRoot: string, entries: readonly PluginHookEntry[]): Promise<readonly SessionHookMaterializerResult[]> | readonly SessionHookMaterializerResult[];
|
|
39
|
+
}
|
|
40
|
+
/** Branded capability id for the session-hook materializer service. */
|
|
41
|
+
export declare const SESSION_HOOK_MATERIALIZER: CapabilityId<SessionHookMaterializerService>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/capability-id.ts
|
|
3
|
+
function makeCapabilityId(id) {
|
|
4
|
+
return id;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// packages/contracts/src/session-hook-materializer.ts
|
|
8
|
+
var SESSION_HOOK_MATERIALIZER_CAPABILITY_ID = "provider.session-hook-materializer";
|
|
9
|
+
var SESSION_HOOK_MATERIALIZER = makeCapabilityId(SESSION_HOOK_MATERIALIZER_CAPABILITY_ID);
|
|
10
|
+
export {
|
|
11
|
+
SESSION_HOOK_MATERIALIZER_CAPABILITY_ID,
|
|
12
|
+
SESSION_HOOK_MATERIALIZER
|
|
13
|
+
};
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cap:project-setup — cross-plugin seam.
|
|
3
|
+
*
|
|
4
|
+
* `@rig/cli-surface-plugin` (the `rig setup`/onboarding surface) runs project
|
|
5
|
+
* setup WITHOUT importing `@rig/init-plugin`: it requires this capability by id
|
|
6
|
+
* off the host. `@rig/init-plugin` OWNS the impl (`runSetup`) and registers it
|
|
7
|
+
* under this id. This file holds ONLY the pure seam vocabulary — no IO, no
|
|
8
|
+
* function-laden deps (those are the impl's concern, not the cross-plugin seam).
|
|
9
|
+
*/
|
|
10
|
+
import type { CapabilityId } from "./capability-id";
|
|
11
|
+
import type { GitHubAuthStatus, GitHubProjectStatusField, GitHubProjectSummary } from "./github";
|
|
12
|
+
/** Capability id the init/setup plugin registers its setup runner under. */
|
|
13
|
+
export declare const PROJECT_SETUP_CAPABILITY_ID = "cap:project-setup";
|
|
14
|
+
/**
|
|
15
|
+
* Where runs execute for this project. `kind` is the placement discriminator
|
|
16
|
+
* (e.g. "local" | "remote"); kept as a plain string so contracts stays free of
|
|
17
|
+
* the placement-domain enum.
|
|
18
|
+
*/
|
|
19
|
+
export type ProjectSetupPlacement = {
|
|
20
|
+
readonly alias: string;
|
|
21
|
+
readonly kind: "local" | "remote";
|
|
22
|
+
readonly host?: string;
|
|
23
|
+
readonly port?: number;
|
|
24
|
+
readonly token?: string | null;
|
|
25
|
+
};
|
|
26
|
+
/** Pure input to a project-setup pass. */
|
|
27
|
+
export type ProjectSetupInput = {
|
|
28
|
+
readonly projectRoot: string;
|
|
29
|
+
readonly slug: string;
|
|
30
|
+
readonly placement: ProjectSetupPlacement;
|
|
31
|
+
readonly rewriteConfig?: boolean;
|
|
32
|
+
readonly ensurePi?: boolean;
|
|
33
|
+
readonly ensureLabels?: boolean;
|
|
34
|
+
readonly githubToken?: string | null;
|
|
35
|
+
readonly importGhToken?: boolean;
|
|
36
|
+
};
|
|
37
|
+
export type ProjectInitAuthMethod = "gh" | "token" | "device" | "skip";
|
|
38
|
+
export type ProjectInitTaskSource = {
|
|
39
|
+
readonly kind: "github-issues";
|
|
40
|
+
readonly owner: string;
|
|
41
|
+
readonly repo: string;
|
|
42
|
+
readonly assignee?: string | undefined;
|
|
43
|
+
} | {
|
|
44
|
+
readonly kind: "files";
|
|
45
|
+
readonly path: string;
|
|
46
|
+
};
|
|
47
|
+
export type ProjectInitInput = {
|
|
48
|
+
readonly projectRoot: string;
|
|
49
|
+
readonly demo?: boolean | undefined;
|
|
50
|
+
readonly repoSlug?: string | undefined;
|
|
51
|
+
readonly taskSource?: ProjectInitTaskSource | undefined;
|
|
52
|
+
readonly githubToken?: string | undefined;
|
|
53
|
+
readonly githubAuthMethod?: ProjectInitAuthMethod | undefined;
|
|
54
|
+
readonly githubProject?: "off" | string | undefined;
|
|
55
|
+
readonly githubProjectStatusField?: string | undefined;
|
|
56
|
+
readonly githubProjectStatuses?: Readonly<Record<string, string>> | undefined;
|
|
57
|
+
readonly yes?: boolean | undefined;
|
|
58
|
+
readonly repair?: boolean | undefined;
|
|
59
|
+
readonly privateStateOnly?: boolean | undefined;
|
|
60
|
+
readonly server?: "local" | "remote" | undefined;
|
|
61
|
+
readonly remoteAlias?: string | undefined;
|
|
62
|
+
readonly remoteHost?: string | undefined;
|
|
63
|
+
readonly remotePort?: number | undefined;
|
|
64
|
+
readonly remoteCheckout?: string | undefined;
|
|
65
|
+
};
|
|
66
|
+
export type ProjectInitResult = {
|
|
67
|
+
readonly mode: "control-plane" | "local-files" | "demo" | "task-source";
|
|
68
|
+
readonly projectRoot: string;
|
|
69
|
+
readonly messages: readonly string[];
|
|
70
|
+
readonly details: Record<string, unknown>;
|
|
71
|
+
};
|
|
72
|
+
export type ProjectInitGitHubProjectsInput = {
|
|
73
|
+
readonly projectRoot: string;
|
|
74
|
+
readonly owner: string;
|
|
75
|
+
readonly token?: string | null | undefined;
|
|
76
|
+
};
|
|
77
|
+
export type ProjectInitGitHubProjectsResult = {
|
|
78
|
+
readonly ok: true;
|
|
79
|
+
readonly projects: readonly GitHubProjectSummary[];
|
|
80
|
+
} | {
|
|
81
|
+
readonly ok: false;
|
|
82
|
+
readonly error: string;
|
|
83
|
+
readonly projects: readonly [];
|
|
84
|
+
};
|
|
85
|
+
export type ProjectInitProjectStatusFieldInput = {
|
|
86
|
+
readonly projectRoot: string;
|
|
87
|
+
readonly projectId: string;
|
|
88
|
+
readonly token?: string | null | undefined;
|
|
89
|
+
};
|
|
90
|
+
export type ProjectInitProjectStatusFieldResult = {
|
|
91
|
+
readonly ok: true;
|
|
92
|
+
readonly field: GitHubProjectStatusField;
|
|
93
|
+
} | {
|
|
94
|
+
readonly ok: false;
|
|
95
|
+
readonly error: string;
|
|
96
|
+
};
|
|
97
|
+
export type ProjectRepoSlug = {
|
|
98
|
+
readonly owner: string;
|
|
99
|
+
readonly repo: string;
|
|
100
|
+
readonly slug: string;
|
|
101
|
+
};
|
|
102
|
+
export type RigConfigStatus = {
|
|
103
|
+
readonly exists: boolean;
|
|
104
|
+
readonly valid: boolean;
|
|
105
|
+
readonly path: string;
|
|
106
|
+
readonly slug: string | null;
|
|
107
|
+
readonly reason?: string;
|
|
108
|
+
};
|
|
109
|
+
export type RigStateStatus = {
|
|
110
|
+
readonly valid: boolean;
|
|
111
|
+
readonly selected: string | null;
|
|
112
|
+
readonly project: string | null;
|
|
113
|
+
readonly reason?: string;
|
|
114
|
+
};
|
|
115
|
+
export type RigAuthValidation = {
|
|
116
|
+
readonly ok: boolean;
|
|
117
|
+
readonly source: "stored-token" | "gh" | "missing";
|
|
118
|
+
readonly login?: string | null;
|
|
119
|
+
readonly detail: string;
|
|
120
|
+
readonly status?: GitHubAuthStatus;
|
|
121
|
+
};
|
|
122
|
+
export type RigSetupStatus = {
|
|
123
|
+
readonly configured: boolean;
|
|
124
|
+
readonly projectRoot: string;
|
|
125
|
+
readonly slug: string | null;
|
|
126
|
+
readonly config: RigConfigStatus;
|
|
127
|
+
readonly state: RigStateStatus;
|
|
128
|
+
readonly auth: RigAuthValidation;
|
|
129
|
+
readonly reasons: readonly string[];
|
|
130
|
+
};
|
|
131
|
+
export type ProjectSetupResult = {
|
|
132
|
+
readonly repoSlug: string;
|
|
133
|
+
readonly placement: string;
|
|
134
|
+
readonly configWritten: boolean;
|
|
135
|
+
readonly labels: unknown;
|
|
136
|
+
readonly pi: unknown;
|
|
137
|
+
readonly status: RigSetupStatus;
|
|
138
|
+
};
|
|
139
|
+
/** The cohesive project-setup operation the CLI surface depends on. Async methods do IO. */
|
|
140
|
+
export interface ProjectSetupService {
|
|
141
|
+
parseRepoSlug(value: string): ProjectRepoSlug;
|
|
142
|
+
detectOriginRepoSlug(input: {
|
|
143
|
+
readonly projectRoot: string;
|
|
144
|
+
}): string | null;
|
|
145
|
+
detectStartupStatus(input: {
|
|
146
|
+
readonly projectRoot: string;
|
|
147
|
+
}): Promise<RigSetupStatus>;
|
|
148
|
+
runSetup(input: ProjectSetupInput): Promise<ProjectSetupResult>;
|
|
149
|
+
listGitHubProjectsForInit(input: ProjectInitGitHubProjectsInput): Promise<ProjectInitGitHubProjectsResult>;
|
|
150
|
+
getGitHubProjectStatusFieldForInit(input: ProjectInitProjectStatusFieldInput): Promise<ProjectInitProjectStatusFieldResult>;
|
|
151
|
+
runInit(input: ProjectInitInput): Promise<ProjectInitResult>;
|
|
152
|
+
}
|
|
153
|
+
/** Typed capability id; string value is {@link PROJECT_SETUP_CAPABILITY_ID}. */
|
|
154
|
+
export declare const PROJECT_SETUP: CapabilityId<ProjectSetupService>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/capability-id.ts
|
|
3
|
+
function makeCapabilityId(id) {
|
|
4
|
+
return id;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// packages/contracts/src/setup.ts
|
|
8
|
+
var PROJECT_SETUP_CAPABILITY_ID = "cap:project-setup";
|
|
9
|
+
var PROJECT_SETUP = makeCapabilityId(PROJECT_SETUP_CAPABILITY_ID);
|
|
10
|
+
export {
|
|
11
|
+
PROJECT_SETUP_CAPABILITY_ID,
|
|
12
|
+
PROJECT_SETUP
|
|
13
|
+
};
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const StageKind: Schema.Literals<readonly ["transform", "gate", "observe"]>;
|
|
3
|
+
export type StageKind = typeof StageKind.Type;
|
|
4
|
+
export declare const StageId: Schema.brand<Schema.Trim, "StageId">;
|
|
5
|
+
export type StageId = typeof StageId.Type;
|
|
6
|
+
export declare const StageContext: Schema.Struct<{
|
|
7
|
+
readonly runId: Schema.brand<Schema.Trim, "RunId">;
|
|
8
|
+
readonly taskId: Schema.optional<Schema.NullOr<Schema.brand<Schema.Trim, "TaskId">>>;
|
|
9
|
+
readonly state: Schema.Unknown;
|
|
10
|
+
readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
11
|
+
}>;
|
|
12
|
+
export type StageContext = typeof StageContext.Type;
|
|
13
|
+
export declare const StageDescriptor: Schema.Struct<{
|
|
14
|
+
readonly id: Schema.brand<Schema.Trim, "StageId">;
|
|
15
|
+
readonly kind: Schema.Literals<readonly ["transform", "gate", "observe"]>;
|
|
16
|
+
readonly before: Schema.optional<Schema.$Array<Schema.brand<Schema.Trim, "StageId">>>;
|
|
17
|
+
readonly after: Schema.optional<Schema.$Array<Schema.brand<Schema.Trim, "StageId">>>;
|
|
18
|
+
readonly priority: Schema.withDecodingDefault<Schema.Number>;
|
|
19
|
+
readonly protected: Schema.withDecodingDefault<Schema.Boolean>;
|
|
20
|
+
}>;
|
|
21
|
+
export type StageDescriptor = typeof StageDescriptor.Type;
|
|
22
|
+
export declare const Stage: Schema.Struct<{
|
|
23
|
+
readonly id: Schema.brand<Schema.Trim, "StageId">;
|
|
24
|
+
readonly kind: Schema.Literals<readonly ["transform", "gate", "observe"]>;
|
|
25
|
+
readonly before: Schema.optional<Schema.$Array<Schema.brand<Schema.Trim, "StageId">>>;
|
|
26
|
+
readonly after: Schema.optional<Schema.$Array<Schema.brand<Schema.Trim, "StageId">>>;
|
|
27
|
+
readonly priority: Schema.withDecodingDefault<Schema.Number>;
|
|
28
|
+
readonly protected: Schema.withDecodingDefault<Schema.Boolean>;
|
|
29
|
+
}>;
|
|
30
|
+
export type Stage = typeof Stage.Type;
|
|
31
|
+
export declare const StageContinueResult: Schema.Struct<{
|
|
32
|
+
readonly kind: Schema.Literal<"continue">;
|
|
33
|
+
readonly ctx: Schema.Struct<{
|
|
34
|
+
readonly runId: Schema.brand<Schema.Trim, "RunId">;
|
|
35
|
+
readonly taskId: Schema.optional<Schema.NullOr<Schema.brand<Schema.Trim, "TaskId">>>;
|
|
36
|
+
readonly state: Schema.Unknown;
|
|
37
|
+
readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
38
|
+
}>;
|
|
39
|
+
}>;
|
|
40
|
+
export type StageContinueResult = typeof StageContinueResult.Type;
|
|
41
|
+
export declare const StageAllowResult: Schema.Struct<{
|
|
42
|
+
readonly kind: Schema.Literal<"allow">;
|
|
43
|
+
}>;
|
|
44
|
+
export type StageAllowResult = typeof StageAllowResult.Type;
|
|
45
|
+
export declare const StageBlockResult: Schema.Struct<{
|
|
46
|
+
readonly kind: Schema.Literal<"block">;
|
|
47
|
+
readonly reason: Schema.Trim;
|
|
48
|
+
}>;
|
|
49
|
+
export type StageBlockResult = typeof StageBlockResult.Type;
|
|
50
|
+
export declare const StageResult: Schema.Union<readonly [Schema.Struct<{
|
|
51
|
+
readonly kind: Schema.Literal<"continue">;
|
|
52
|
+
readonly ctx: Schema.Struct<{
|
|
53
|
+
readonly runId: Schema.brand<Schema.Trim, "RunId">;
|
|
54
|
+
readonly taskId: Schema.optional<Schema.NullOr<Schema.brand<Schema.Trim, "TaskId">>>;
|
|
55
|
+
readonly state: Schema.Unknown;
|
|
56
|
+
readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
57
|
+
}>;
|
|
58
|
+
}>, Schema.Struct<{
|
|
59
|
+
readonly kind: Schema.Literal<"allow">;
|
|
60
|
+
}>, Schema.Struct<{
|
|
61
|
+
readonly kind: Schema.Literal<"block">;
|
|
62
|
+
readonly reason: Schema.Trim;
|
|
63
|
+
}>]>;
|
|
64
|
+
export type StageResult = typeof StageResult.Type;
|
|
65
|
+
export type StageRun = (ctx: StageContext) => Promise<StageResult> | StageResult;
|
|
66
|
+
export declare const StageWrapperDescriptor: Schema.Struct<{
|
|
67
|
+
readonly id: Schema.Trim;
|
|
68
|
+
readonly priority: Schema.withDecodingDefault<Schema.Number>;
|
|
69
|
+
}>;
|
|
70
|
+
export type StageWrapperDescriptor = typeof StageWrapperDescriptor.Type;
|
|
71
|
+
export type StageWrapper = (next: StageRun, ctx: StageContext) => Promise<StageResult> | StageResult;
|
|
72
|
+
export declare const StageMutationOp: Schema.Literals<readonly ["insert", "remove", "replace", "wrap", "reorder"]>;
|
|
73
|
+
export type StageMutationOp = typeof StageMutationOp.Type;
|
|
74
|
+
export declare const InsertStageMutation: Schema.Struct<{
|
|
75
|
+
readonly op: Schema.Literal<"insert">;
|
|
76
|
+
readonly stage: Schema.Struct<{
|
|
77
|
+
readonly id: Schema.brand<Schema.Trim, "StageId">;
|
|
78
|
+
readonly kind: Schema.Literals<readonly ["transform", "gate", "observe"]>;
|
|
79
|
+
readonly before: Schema.optional<Schema.$Array<Schema.brand<Schema.Trim, "StageId">>>;
|
|
80
|
+
readonly after: Schema.optional<Schema.$Array<Schema.brand<Schema.Trim, "StageId">>>;
|
|
81
|
+
readonly priority: Schema.withDecodingDefault<Schema.Number>;
|
|
82
|
+
readonly protected: Schema.withDecodingDefault<Schema.Boolean>;
|
|
83
|
+
}>;
|
|
84
|
+
readonly contributedBy: Schema.optional<Schema.Trim>;
|
|
85
|
+
}>;
|
|
86
|
+
export type InsertStageMutation = typeof InsertStageMutation.Type;
|
|
87
|
+
export declare const RemoveStageMutation: Schema.Struct<{
|
|
88
|
+
readonly op: Schema.Literal<"remove">;
|
|
89
|
+
readonly id: Schema.brand<Schema.Trim, "StageId">;
|
|
90
|
+
readonly contributedBy: Schema.optional<Schema.Trim>;
|
|
91
|
+
}>;
|
|
92
|
+
export type RemoveStageMutation = typeof RemoveStageMutation.Type;
|
|
93
|
+
export declare const ReplaceStageMutation: Schema.Struct<{
|
|
94
|
+
readonly op: Schema.Literal<"replace">;
|
|
95
|
+
readonly id: Schema.brand<Schema.Trim, "StageId">;
|
|
96
|
+
readonly stage: Schema.Struct<{
|
|
97
|
+
readonly id: Schema.brand<Schema.Trim, "StageId">;
|
|
98
|
+
readonly kind: Schema.Literals<readonly ["transform", "gate", "observe"]>;
|
|
99
|
+
readonly before: Schema.optional<Schema.$Array<Schema.brand<Schema.Trim, "StageId">>>;
|
|
100
|
+
readonly after: Schema.optional<Schema.$Array<Schema.brand<Schema.Trim, "StageId">>>;
|
|
101
|
+
readonly priority: Schema.withDecodingDefault<Schema.Number>;
|
|
102
|
+
readonly protected: Schema.withDecodingDefault<Schema.Boolean>;
|
|
103
|
+
}>;
|
|
104
|
+
readonly contributedBy: Schema.optional<Schema.Trim>;
|
|
105
|
+
}>;
|
|
106
|
+
export type ReplaceStageMutation = typeof ReplaceStageMutation.Type;
|
|
107
|
+
export declare const WrapStageMutation: Schema.Struct<{
|
|
108
|
+
readonly op: Schema.Literal<"wrap">;
|
|
109
|
+
readonly id: Schema.brand<Schema.Trim, "StageId">;
|
|
110
|
+
readonly around: Schema.Struct<{
|
|
111
|
+
readonly id: Schema.Trim;
|
|
112
|
+
readonly priority: Schema.withDecodingDefault<Schema.Number>;
|
|
113
|
+
}>;
|
|
114
|
+
readonly contributedBy: Schema.optional<Schema.Trim>;
|
|
115
|
+
}>;
|
|
116
|
+
export type WrapStageMutation = typeof WrapStageMutation.Type;
|
|
117
|
+
export declare const ReorderStageMutation: Schema.Struct<{
|
|
118
|
+
readonly op: Schema.Literal<"reorder">;
|
|
119
|
+
readonly id: Schema.brand<Schema.Trim, "StageId">;
|
|
120
|
+
readonly before: Schema.optional<Schema.$Array<Schema.brand<Schema.Trim, "StageId">>>;
|
|
121
|
+
readonly after: Schema.optional<Schema.$Array<Schema.brand<Schema.Trim, "StageId">>>;
|
|
122
|
+
readonly contributedBy: Schema.optional<Schema.Trim>;
|
|
123
|
+
}>;
|
|
124
|
+
export type ReorderStageMutation = typeof ReorderStageMutation.Type;
|
|
125
|
+
export declare const StageMutation: Schema.Union<readonly [Schema.Struct<{
|
|
126
|
+
readonly op: Schema.Literal<"insert">;
|
|
127
|
+
readonly stage: Schema.Struct<{
|
|
128
|
+
readonly id: Schema.brand<Schema.Trim, "StageId">;
|
|
129
|
+
readonly kind: Schema.Literals<readonly ["transform", "gate", "observe"]>;
|
|
130
|
+
readonly before: Schema.optional<Schema.$Array<Schema.brand<Schema.Trim, "StageId">>>;
|
|
131
|
+
readonly after: Schema.optional<Schema.$Array<Schema.brand<Schema.Trim, "StageId">>>;
|
|
132
|
+
readonly priority: Schema.withDecodingDefault<Schema.Number>;
|
|
133
|
+
readonly protected: Schema.withDecodingDefault<Schema.Boolean>;
|
|
134
|
+
}>;
|
|
135
|
+
readonly contributedBy: Schema.optional<Schema.Trim>;
|
|
136
|
+
}>, Schema.Struct<{
|
|
137
|
+
readonly op: Schema.Literal<"remove">;
|
|
138
|
+
readonly id: Schema.brand<Schema.Trim, "StageId">;
|
|
139
|
+
readonly contributedBy: Schema.optional<Schema.Trim>;
|
|
140
|
+
}>, Schema.Struct<{
|
|
141
|
+
readonly op: Schema.Literal<"replace">;
|
|
142
|
+
readonly id: Schema.brand<Schema.Trim, "StageId">;
|
|
143
|
+
readonly stage: Schema.Struct<{
|
|
144
|
+
readonly id: Schema.brand<Schema.Trim, "StageId">;
|
|
145
|
+
readonly kind: Schema.Literals<readonly ["transform", "gate", "observe"]>;
|
|
146
|
+
readonly before: Schema.optional<Schema.$Array<Schema.brand<Schema.Trim, "StageId">>>;
|
|
147
|
+
readonly after: Schema.optional<Schema.$Array<Schema.brand<Schema.Trim, "StageId">>>;
|
|
148
|
+
readonly priority: Schema.withDecodingDefault<Schema.Number>;
|
|
149
|
+
readonly protected: Schema.withDecodingDefault<Schema.Boolean>;
|
|
150
|
+
}>;
|
|
151
|
+
readonly contributedBy: Schema.optional<Schema.Trim>;
|
|
152
|
+
}>, Schema.Struct<{
|
|
153
|
+
readonly op: Schema.Literal<"wrap">;
|
|
154
|
+
readonly id: Schema.brand<Schema.Trim, "StageId">;
|
|
155
|
+
readonly around: Schema.Struct<{
|
|
156
|
+
readonly id: Schema.Trim;
|
|
157
|
+
readonly priority: Schema.withDecodingDefault<Schema.Number>;
|
|
158
|
+
}>;
|
|
159
|
+
readonly contributedBy: Schema.optional<Schema.Trim>;
|
|
160
|
+
}>, Schema.Struct<{
|
|
161
|
+
readonly op: Schema.Literal<"reorder">;
|
|
162
|
+
readonly id: Schema.brand<Schema.Trim, "StageId">;
|
|
163
|
+
readonly before: Schema.optional<Schema.$Array<Schema.brand<Schema.Trim, "StageId">>>;
|
|
164
|
+
readonly after: Schema.optional<Schema.$Array<Schema.brand<Schema.Trim, "StageId">>>;
|
|
165
|
+
readonly contributedBy: Schema.optional<Schema.Trim>;
|
|
166
|
+
}>]>;
|
|
167
|
+
export type StageMutation = typeof StageMutation.Type;
|
|
168
|
+
export declare const ResolutionGrantUse: Schema.Struct<{
|
|
169
|
+
readonly kind: Schema.Literal<"kernel-replacement">;
|
|
170
|
+
readonly target: Schema.Trim;
|
|
171
|
+
readonly pluginId: Schema.Trim;
|
|
172
|
+
}>;
|
|
173
|
+
export type ResolutionGrantUse = typeof ResolutionGrantUse.Type;
|
|
174
|
+
export declare const ResolutionRecordEntry: Schema.Struct<{
|
|
175
|
+
readonly stageId: Schema.brand<Schema.Trim, "StageId">;
|
|
176
|
+
readonly contributedBy: Schema.Trim;
|
|
177
|
+
readonly removedBy: Schema.optional<Schema.Trim>;
|
|
178
|
+
readonly replacedBy: Schema.optional<Schema.Trim>;
|
|
179
|
+
readonly wrappedBy: Schema.optional<Schema.$Array<Schema.Trim>>;
|
|
180
|
+
readonly droppedAnchors: Schema.optional<Schema.$Array<Schema.brand<Schema.Trim, "StageId">>>;
|
|
181
|
+
readonly isProtected: Schema.Boolean;
|
|
182
|
+
}>;
|
|
183
|
+
export type ResolutionRecordEntry = typeof ResolutionRecordEntry.Type;
|
|
184
|
+
export declare const ResolvedPipeline: Schema.Struct<{
|
|
185
|
+
readonly runId: Schema.optional<Schema.brand<Schema.Trim, "RunId">>;
|
|
186
|
+
readonly order: Schema.$Array<Schema.brand<Schema.Trim, "StageId">>;
|
|
187
|
+
readonly record: Schema.$Array<Schema.Struct<{
|
|
188
|
+
readonly stageId: Schema.brand<Schema.Trim, "StageId">;
|
|
189
|
+
readonly contributedBy: Schema.Trim;
|
|
190
|
+
readonly removedBy: Schema.optional<Schema.Trim>;
|
|
191
|
+
readonly replacedBy: Schema.optional<Schema.Trim>;
|
|
192
|
+
readonly wrappedBy: Schema.optional<Schema.$Array<Schema.Trim>>;
|
|
193
|
+
readonly droppedAnchors: Schema.optional<Schema.$Array<Schema.brand<Schema.Trim, "StageId">>>;
|
|
194
|
+
readonly isProtected: Schema.Boolean;
|
|
195
|
+
}>>;
|
|
196
|
+
readonly cycles: Schema.$Array<Schema.$Array<Schema.brand<Schema.Trim, "StageId">>>;
|
|
197
|
+
readonly grantUses: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
198
|
+
readonly kind: Schema.Literal<"kernel-replacement">;
|
|
199
|
+
readonly target: Schema.Trim;
|
|
200
|
+
readonly pluginId: Schema.Trim;
|
|
201
|
+
}>>>;
|
|
202
|
+
readonly resolvedAt: Schema.optional<Schema.String>;
|
|
203
|
+
}>;
|
|
204
|
+
export type ResolvedPipeline = typeof ResolvedPipeline.Type;
|
|
205
|
+
export declare const ResolutionRecord: Schema.Struct<{
|
|
206
|
+
readonly runId: Schema.optional<Schema.brand<Schema.Trim, "RunId">>;
|
|
207
|
+
readonly order: Schema.$Array<Schema.brand<Schema.Trim, "StageId">>;
|
|
208
|
+
readonly record: Schema.$Array<Schema.Struct<{
|
|
209
|
+
readonly stageId: Schema.brand<Schema.Trim, "StageId">;
|
|
210
|
+
readonly contributedBy: Schema.Trim;
|
|
211
|
+
readonly removedBy: Schema.optional<Schema.Trim>;
|
|
212
|
+
readonly replacedBy: Schema.optional<Schema.Trim>;
|
|
213
|
+
readonly wrappedBy: Schema.optional<Schema.$Array<Schema.Trim>>;
|
|
214
|
+
readonly droppedAnchors: Schema.optional<Schema.$Array<Schema.brand<Schema.Trim, "StageId">>>;
|
|
215
|
+
readonly isProtected: Schema.Boolean;
|
|
216
|
+
}>>;
|
|
217
|
+
readonly cycles: Schema.$Array<Schema.$Array<Schema.brand<Schema.Trim, "StageId">>>;
|
|
218
|
+
readonly grantUses: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
219
|
+
readonly kind: Schema.Literal<"kernel-replacement">;
|
|
220
|
+
readonly target: Schema.Trim;
|
|
221
|
+
readonly pluginId: Schema.Trim;
|
|
222
|
+
}>>>;
|
|
223
|
+
readonly resolvedAt: Schema.optional<Schema.String>;
|
|
224
|
+
}>;
|
|
225
|
+
export type ResolutionRecord = typeof ResolutionRecord.Type;
|
|
226
|
+
export declare const StageRunOutcome: Schema.Struct<{
|
|
227
|
+
readonly stageId: Schema.brand<Schema.Trim, "StageId">;
|
|
228
|
+
readonly result: Schema.Union<readonly [Schema.Struct<{
|
|
229
|
+
readonly kind: Schema.Literal<"continue">;
|
|
230
|
+
readonly ctx: Schema.Struct<{
|
|
231
|
+
readonly runId: Schema.brand<Schema.Trim, "RunId">;
|
|
232
|
+
readonly taskId: Schema.optional<Schema.NullOr<Schema.brand<Schema.Trim, "TaskId">>>;
|
|
233
|
+
readonly state: Schema.Unknown;
|
|
234
|
+
readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
235
|
+
}>;
|
|
236
|
+
}>, Schema.Struct<{
|
|
237
|
+
readonly kind: Schema.Literal<"allow">;
|
|
238
|
+
}>, Schema.Struct<{
|
|
239
|
+
readonly kind: Schema.Literal<"block">;
|
|
240
|
+
readonly reason: Schema.Trim;
|
|
241
|
+
}>]>;
|
|
242
|
+
readonly startedAt: Schema.String;
|
|
243
|
+
readonly finishedAt: Schema.String;
|
|
244
|
+
}>;
|
|
245
|
+
export type StageRunOutcome = typeof StageRunOutcome.Type;
|