@h-rig/contracts 0.0.6-alpha.13 → 0.0.6-alpha.130
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 +6585 -0
- package/dist/index.mjs +6544 -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/cli-output.d.ts +324 -0
- package/dist/src/cli-output.js +190 -0
- package/dist/src/config.d.ts +368 -0
- package/dist/src/config.js +27 -5
- package/dist/src/conversation.d.ts +50 -0
- package/dist/src/conversation.js +3 -0
- package/dist/src/editor.d.ts +25 -0
- package/dist/src/editor.js +3 -0
- package/dist/src/engine.d.ts +2789 -0
- package/dist/src/engine.js +19 -13
- package/dist/src/git.d.ts +144 -0
- package/dist/src/git.js +3 -0
- package/dist/src/graph.d.ts +39 -0
- package/dist/src/graph.js +3 -0
- package/dist/src/help-catalog.d.ts +34 -0
- package/dist/src/help-catalog.js +577 -0
- package/dist/src/index.d.ts +40 -0
- package/dist/src/index.js +3223 -1226
- package/dist/src/ipc.d.ts +248 -0
- package/dist/src/keybindings.d.ts +71 -0
- package/dist/src/keybindings.js +3 -0
- package/dist/src/model.d.ts +77 -0
- package/dist/src/orchestration.d.ts +3695 -0
- package/dist/src/orchestration.js +3 -0
- package/dist/src/pi-session.d.ts +113 -0
- package/dist/src/pi-session.js +1 -0
- package/dist/src/plugin-hooks.d.ts +51 -0
- package/dist/src/plugin-hooks.js +112 -0
- package/dist/src/plugin.d.ts +230 -0
- 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/protocol-version.d.ts +21 -0
- package/dist/src/protocol-version.js +6 -0
- package/dist/src/provider.d.ts +105 -0
- package/dist/src/provider.js +3 -0
- package/dist/src/providerRuntime.d.ts +3949 -0
- package/dist/src/providerRuntime.js +3 -0
- package/dist/src/remote.d.ts +326 -0
- package/dist/src/remote.js +16 -10
- package/dist/src/review.d.ts +18 -0
- package/dist/src/review.js +3 -0
- package/dist/src/rig.d.ts +783 -0
- package/dist/src/rig.js +70 -15
- package/dist/src/run-journal.d.ts +763 -0
- package/dist/src/run-journal.js +1509 -0
- package/dist/src/run-record.d.ts +45 -0
- package/dist/src/run-record.js +1 -0
- package/dist/src/run-session-journal.d.ts +89 -0
- package/dist/src/run-session-journal.js +1671 -0
- package/dist/src/run-status.d.ts +12 -0
- package/dist/src/run-status.js +38 -0
- package/dist/src/run-timeline.d.ts +10 -0
- package/dist/src/run-timeline.js +1377 -0
- package/dist/src/runtime.d.ts +103 -0
- package/dist/src/runtime.js +9 -4
- package/dist/src/server.d.ts +106 -0
- package/dist/src/server.js +3 -0
- package/dist/src/serviceFabric.d.ts +62 -0
- package/dist/src/serviceFabric.js +5 -2
- package/dist/src/task-source.d.ts +28 -0
- package/dist/src/terminal.d.ts +130 -0
- package/dist/src/terminal.js +3 -0
- package/dist/src/validation.d.ts +14 -0
- package/dist/src/validation.js +3 -0
- package/dist/src/workflow-journal.d.ts +124 -0
- package/dist/src/workflow-journal.js +389 -0
- package/dist/src/workspace.d.ts +204 -0
- package/dist/src/workspace.js +5 -2
- package/dist/src/ws.d.ts +747 -0
- package/dist/src/ws.js +64 -14
- package/package.json +6 -3
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { RunJournalProjection } from "./run-journal";
|
|
2
|
+
import type { RigRunTimelineEntry } from "./run-timeline";
|
|
3
|
+
export type UnifiedInboxRequest = {
|
|
4
|
+
readonly requestId: string;
|
|
5
|
+
readonly kind: "approval" | "input";
|
|
6
|
+
readonly title: string;
|
|
7
|
+
readonly body?: string | null;
|
|
8
|
+
readonly options?: readonly string[];
|
|
9
|
+
readonly requestedAt: string | null;
|
|
10
|
+
readonly source: "run";
|
|
11
|
+
};
|
|
12
|
+
/** Unified operator-facing run record shared by CLI, cockpit, relay, and client projection logic. */
|
|
13
|
+
export interface RunRecord {
|
|
14
|
+
readonly runId: string;
|
|
15
|
+
readonly taskId: string | null;
|
|
16
|
+
readonly title: string;
|
|
17
|
+
/** RunStatus from the folded journal, or a liveness-derived fallback. */
|
|
18
|
+
readonly status: string;
|
|
19
|
+
readonly source: "local" | "remote";
|
|
20
|
+
/** True when the run is currently discoverable (registry heartbeat or local host). */
|
|
21
|
+
readonly live: boolean;
|
|
22
|
+
readonly stale: boolean;
|
|
23
|
+
readonly startedAt: string | null;
|
|
24
|
+
readonly updatedAt: string | null;
|
|
25
|
+
readonly completedAt: string | null;
|
|
26
|
+
readonly joinLink: string | null;
|
|
27
|
+
readonly webLink: string | null;
|
|
28
|
+
readonly relayUrl: string | null;
|
|
29
|
+
readonly sessionPath: string | null;
|
|
30
|
+
readonly prUrl: string | null;
|
|
31
|
+
readonly worktreePath: string | null;
|
|
32
|
+
readonly pendingApprovals: number;
|
|
33
|
+
readonly pendingInputs: number;
|
|
34
|
+
readonly steeringCount: number;
|
|
35
|
+
readonly stallCount: number;
|
|
36
|
+
readonly errorSummary?: string | null;
|
|
37
|
+
/** Timeline entries folded from the same OMP session custom entries as the journal. */
|
|
38
|
+
readonly timeline: RigRunTimelineEntry[];
|
|
39
|
+
/** Pending rig.run.* approvals/inputs only; rig.workflow.inbox.* is intentionally dead. */
|
|
40
|
+
readonly inbox: UnifiedInboxRequest[];
|
|
41
|
+
/** Live collab cwd when present in registry/discovery. */
|
|
42
|
+
readonly collabCwd: string | null;
|
|
43
|
+
/** The full folded journal (empty projection when no journal was readable). */
|
|
44
|
+
readonly projection: RunJournalProjection;
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// @bun
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { type RunJournalEvent, type RunJournalProjection } from "./run-journal";
|
|
2
|
+
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
3
|
+
export type RunJournalEventInit = DistributiveOmit<RunJournalEvent, "v" | "seq" | "at" | "runId">;
|
|
4
|
+
export declare const RIG_RUN_STATUS_CHANGED = "rig.run.status-changed";
|
|
5
|
+
export declare const RIG_RUN_RECORD_PATCH = "rig.run.record-patch";
|
|
6
|
+
export declare const RIG_RUN_TIMELINE_ENTRY = "rig.run.timeline-entry";
|
|
7
|
+
export declare const RIG_RUN_LOG_ENTRY = "rig.run.log-entry";
|
|
8
|
+
export declare const RIG_RUN_APPROVAL_REQUESTED = "rig.run.approval-requested";
|
|
9
|
+
export declare const RIG_RUN_APPROVAL_RESOLVED = "rig.run.approval-resolved";
|
|
10
|
+
export declare const RIG_RUN_INPUT_REQUESTED = "rig.run.input-requested";
|
|
11
|
+
export declare const RIG_RUN_INPUT_RESOLVED = "rig.run.input-resolved";
|
|
12
|
+
export declare const RIG_RUN_STEERING = "rig.run.steering";
|
|
13
|
+
export declare const RIG_RUN_ADOPTED = "rig.run.adopted";
|
|
14
|
+
export declare const RIG_RUN_STALL_DETECTED = "rig.run.stall-detected";
|
|
15
|
+
export declare const RIG_RUN_CLOSEOUT_PHASE = "rig.run.closeout-phase";
|
|
16
|
+
export declare const RIG_STOP_SENTINEL = "<<RIG_STOP";
|
|
17
|
+
export declare const RIG_STOP_SENTINEL_END = ">>";
|
|
18
|
+
export declare function buildStopSentinel(runId: string, reason?: string | null, requestedBy?: string): string;
|
|
19
|
+
export declare function parseStopSentinel(text: string, expectedRunId: string): {
|
|
20
|
+
reason: string | null;
|
|
21
|
+
} | null;
|
|
22
|
+
export declare const RIG_PAUSE_SENTINEL = "<<RIG_PAUSE";
|
|
23
|
+
export declare const RIG_RESUME_SENTINEL = "<<RIG_RESUME";
|
|
24
|
+
export declare const RIG_CONTROL_SENTINEL_END = ">>";
|
|
25
|
+
export declare function buildPauseSentinel(runId: string, requestedBy?: string): string;
|
|
26
|
+
export declare function parsePauseSentinel(text: string, expectedRunId: string): {
|
|
27
|
+
requestedBy: string | null;
|
|
28
|
+
} | null;
|
|
29
|
+
export declare function buildResumeSentinel(runId: string, requestedBy?: string): string;
|
|
30
|
+
export declare function parseResumeSentinel(text: string, expectedRunId: string): {
|
|
31
|
+
requestedBy: string | null;
|
|
32
|
+
} | null;
|
|
33
|
+
export type RunInboxResolutionSentinel = {
|
|
34
|
+
kind: "approval";
|
|
35
|
+
requestId: string;
|
|
36
|
+
decision: "approve" | "reject";
|
|
37
|
+
note?: string | null;
|
|
38
|
+
requestedBy: string | null;
|
|
39
|
+
} | {
|
|
40
|
+
kind: "input";
|
|
41
|
+
requestId: string;
|
|
42
|
+
answers: Record<string, string>;
|
|
43
|
+
requestedBy: string | null;
|
|
44
|
+
};
|
|
45
|
+
export declare const RIG_INBOX_RESOLUTION_SENTINEL = "<<RIG_INBOX_RESOLUTION";
|
|
46
|
+
export type RunInboxResolutionInit = {
|
|
47
|
+
kind: "approval";
|
|
48
|
+
requestId: string;
|
|
49
|
+
decision: "approve" | "reject";
|
|
50
|
+
note?: string | null;
|
|
51
|
+
} | {
|
|
52
|
+
kind: "input";
|
|
53
|
+
requestId: string;
|
|
54
|
+
answers: Record<string, string>;
|
|
55
|
+
};
|
|
56
|
+
export declare function buildInboxResolutionSentinel(runId: string, resolution: RunInboxResolutionInit, requestedBy?: string): string;
|
|
57
|
+
export declare function parseInboxResolutionSentinel(text: string, expectedRunId: string): RunInboxResolutionSentinel | null;
|
|
58
|
+
/**
|
|
59
|
+
* The OMP session id embedded in a session journal filename
|
|
60
|
+
* (`<ISO-timestamp>_<sessionId>.jsonl`). This is a run's CANONICAL id — the same
|
|
61
|
+
* id OMP hosts as the collab roomId and the relay registry + operator CLI key on.
|
|
62
|
+
* A run's dispatch/worktree id is different; this is what links them, so stop /
|
|
63
|
+
* steer / discovery all resolve a run by one id (the OMP session id).
|
|
64
|
+
*/
|
|
65
|
+
export declare function sessionIdFromSessionFile(sessionPath: string | null | undefined): string | null;
|
|
66
|
+
export declare const CUSTOM_TYPE_FOR: {
|
|
67
|
+
readonly "status-changed": "rig.run.status-changed";
|
|
68
|
+
readonly "record-patch": "rig.run.record-patch";
|
|
69
|
+
readonly "timeline-entry": "rig.run.timeline-entry";
|
|
70
|
+
readonly "log-entry": "rig.run.log-entry";
|
|
71
|
+
readonly "approval-requested": "rig.run.approval-requested";
|
|
72
|
+
readonly "approval-resolved": "rig.run.approval-resolved";
|
|
73
|
+
readonly "input-requested": "rig.run.input-requested";
|
|
74
|
+
readonly "input-resolved": "rig.run.input-resolved";
|
|
75
|
+
readonly steering: "rig.run.steering";
|
|
76
|
+
readonly adopted: "rig.run.adopted";
|
|
77
|
+
readonly "stall-detected": "rig.run.stall-detected";
|
|
78
|
+
readonly "closeout-phase": "rig.run.closeout-phase";
|
|
79
|
+
};
|
|
80
|
+
export type RunSessionCustomType = (typeof CUSTOM_TYPE_FOR)[RunJournalEvent["type"]];
|
|
81
|
+
export declare const TYPE_FOR_CUSTOM: Readonly<Record<RunSessionCustomType, RunJournalEvent["type"]>>;
|
|
82
|
+
export type RunSessionCustomEntry = {
|
|
83
|
+
type: string;
|
|
84
|
+
customType?: string;
|
|
85
|
+
data?: unknown;
|
|
86
|
+
};
|
|
87
|
+
export declare function isRunSessionCustomType(customType: string | undefined): customType is RunSessionCustomType;
|
|
88
|
+
export declare function foldRunSessionEntries(entries: ReadonlyArray<RunSessionCustomEntry>, runId: string): RunJournalProjection;
|
|
89
|
+
export {};
|