@h-rig/contracts 0.0.6-alpha.157 → 0.0.6-alpha.159
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 +2340 -6832
- package/dist/index.mjs +2116 -6608
- package/dist/src/agent-roles.d.ts +8 -0
- package/dist/src/browser.d.ts +34 -4
- package/dist/src/browser.js +8 -1
- package/dist/src/capability-id.d.ts +22 -0
- package/dist/src/capability-id.js +8 -0
- package/dist/src/cli-output.d.ts +24 -0
- package/dist/src/cli-runner.d.ts +43 -0
- package/dist/src/cli-runner.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 +11 -0
- package/dist/src/config.js +279 -1098
- package/dist/src/control-plane-types.d.ts +41 -1
- package/dist/src/control-plane-types.js +9 -25
- package/dist/src/dependency-preflight.d.ts +43 -0
- package/dist/src/dependency-preflight.js +13 -0
- package/dist/src/doctor.d.ts +67 -4
- package/dist/src/doctor.js +8 -9
- package/dist/src/errors.d.ts +13 -0
- package/dist/src/errors.js +17 -0
- package/dist/src/github.d.ts +43 -0
- package/dist/src/github.js +12 -1
- package/dist/src/graph.d.ts +37 -0
- package/dist/src/graph.js +13 -0
- 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 +17 -10
- package/dist/src/help-catalog.js +9 -651
- 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 +27 -7
- package/dist/src/index.js +2116 -6608
- package/dist/src/isolation.d.ts +207 -15
- package/dist/src/isolation.js +8 -1
- package/dist/src/kernel.d.ts +11 -0
- package/dist/src/kernel.js +7 -0
- package/dist/src/layout.d.ts +49 -0
- package/dist/src/layout.js +10 -0
- package/dist/src/lifecycle-capabilities.d.ts +99 -0
- package/dist/src/lifecycle-capabilities.js +18 -1
- package/dist/src/managed-repos.d.ts +79 -16
- package/dist/src/managed-repos.js +12 -1
- package/dist/src/memory.d.ts +52 -4
- package/dist/src/memory.js +8 -1
- package/dist/src/notify.d.ts +46 -0
- package/dist/src/notify.js +13 -0
- package/dist/src/orchestration.d.ts +0 -3652
- package/dist/src/orchestration.js +28 -964
- package/dist/src/plugin-hooks.js +22 -3
- package/dist/src/plugin.d.ts +47 -0
- package/dist/src/plugin.js +24 -3
- package/dist/src/prompt.d.ts +29 -0
- package/dist/src/prompt.js +13 -0
- package/dist/src/provider-instructions.d.ts +26 -4
- package/dist/src/provider-instructions.js +8 -1
- package/dist/src/provider.js +1 -824
- package/dist/src/remote.d.ts +0 -8
- package/dist/src/remote.js +229 -1075
- 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 +0 -236
- package/dist/src/run-journal.js +249 -1321
- package/dist/src/run-read-model.d.ts +234 -0
- package/dist/src/run-read-model.js +13 -0
- package/dist/src/run-record.d.ts +0 -11
- package/dist/src/run-record.js +0 -16
- 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 +1 -25
- package/dist/src/run-session-journal.js +0 -1731
- package/dist/src/run-status.d.ts +0 -2
- package/dist/src/run-status.js +0 -11
- package/dist/src/run-timeline.d.ts +0 -3
- package/dist/src/run-timeline.js +0 -1498
- package/dist/src/runtime-task-context.d.ts +82 -0
- package/dist/src/runtime-task-context.js +1 -0
- package/dist/src/runtime.js +66 -904
- 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 +47 -0
- package/dist/src/setup.js +13 -0
- package/dist/src/supervisor-journal.js +117 -955
- package/dist/src/task-data.d.ts +239 -0
- package/dist/src/task-data.js +13 -0
- package/dist/src/task-graph-primitives.d.ts +0 -21
- package/dist/src/task-graph-primitives.js +0 -318
- package/dist/src/task-source.d.ts +65 -0
- package/dist/src/task-source.js +12 -0
- package/dist/src/task-state-metadata.d.ts +21 -0
- package/dist/src/task-state-metadata.js +1 -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/workflow-journal.d.ts +0 -32
- package/dist/src/workflow-journal.js +0 -371
- package/dist/src/workspace-config.d.ts +18 -0
- package/dist/src/workspace-config.js +13 -0
- package/dist/src/workspace.js +73 -911
- package/package.json +1 -1
- package/dist/src/engine.d.ts +0 -2789
- package/dist/src/engine.js +0 -2392
- package/dist/src/ipc.d.ts +0 -248
- package/dist/src/providerRuntime.d.ts +0 -3949
- package/dist/src/providerRuntime.js +0 -1633
- package/dist/src/rig.d.ts +0 -783
- package/dist/src/rig.js +0 -2537
- package/dist/src/server.d.ts +0 -106
- package/dist/src/server.js +0 -1056
- package/dist/src/serviceFabric.d.ts +0 -62
- package/dist/src/serviceFabric.js +0 -1069
- package/dist/src/ws.d.ts +0 -747
- package/dist/src/ws.js +0 -3126
- /package/dist/src/{ipc.js → agent-roles.js} +0 -0
package/dist/src/memory.d.ts
CHANGED
|
@@ -7,11 +7,15 @@
|
|
|
7
7
|
* without a substrate->plugin import cycle. They carry no behaviour and import
|
|
8
8
|
* nothing — exactly like `lifecycle-capabilities.ts`.
|
|
9
9
|
*
|
|
10
|
-
* The plugin registers its executable `MemoryService` impl under
|
|
11
|
-
* {@link
|
|
12
|
-
* runtime resolves it by id from
|
|
13
|
-
*
|
|
10
|
+
* The plugin registers its executable `MemoryService` impl under the typed
|
|
11
|
+
* capability id {@link MEMORY} (whose string value is
|
|
12
|
+
* {@link MEMORY_SERVICE_CAPABILITY_ID}); the runtime resolves it by id from
|
|
13
|
+
* `pluginHost.listExecutableCapabilities()` via the `defineCapability` seam
|
|
14
|
+
* (`@rig/core/capability`), re-exported from the thin
|
|
15
|
+
* `@rig/runtime/control-plane/memory-service-port`.
|
|
14
16
|
*/
|
|
17
|
+
import type { CapabilityId } from "./capability-id";
|
|
18
|
+
import type { RuntimeMemoryRetrievalConfig, RuntimeTaskContext } from "./runtime-task-context";
|
|
15
19
|
/** Capability id the memory plugin registers its `MemoryService` factory under. */
|
|
16
20
|
export declare const MEMORY_SERVICE_CAPABILITY_ID = "memory.service";
|
|
17
21
|
export declare const NO_MATCH_RETRIEVAL_CANONICAL_KEY = "__memory_recall__:none";
|
|
@@ -148,4 +152,48 @@ export type CanonicalMemorySnapshot = {
|
|
|
148
152
|
createdFresh: boolean;
|
|
149
153
|
cleanup(): Promise<void>;
|
|
150
154
|
};
|
|
155
|
+
/**
|
|
156
|
+
* Minimal telemetry sink the memory command emits run events through. The
|
|
157
|
+
* substrate's concrete event bus (`@rig/runtime` `EventBusLike`) is a superset
|
|
158
|
+
* and is structurally assignable to this; the memory contract only depends on
|
|
159
|
+
* `emit`, so the pure contract stays free of any runtime/behaviour import.
|
|
160
|
+
*/
|
|
161
|
+
export interface MemoryCommandEventSink {
|
|
162
|
+
emit<TPayload extends Record<string, unknown>>(type: string, payload: TPayload): Promise<unknown>;
|
|
163
|
+
}
|
|
164
|
+
/** Options for the agent-facing `rig-agent memory <verb>` command dispatch. */
|
|
165
|
+
export type ExecuteMemoryCommandOptions = {
|
|
166
|
+
projectRoot: string;
|
|
167
|
+
taskId: string;
|
|
168
|
+
runtimeContext: RuntimeTaskContext | null;
|
|
169
|
+
args: string[];
|
|
170
|
+
eventBus?: MemoryCommandEventSink;
|
|
171
|
+
};
|
|
172
|
+
/** The retrieval-query shape the substrate passes through to the impl. */
|
|
173
|
+
export type MemoryQueryPortInput = {
|
|
174
|
+
query: string;
|
|
175
|
+
limit?: number;
|
|
176
|
+
retrieval?: RuntimeMemoryRetrievalConfig;
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* The cohesive set of shared-memory operations the runtime consumers depend on.
|
|
180
|
+
* This is pure capability VOCAB: the `@rig/memory-plugin` provides a concrete
|
|
181
|
+
* impl (statically checked against this interface via `MemoryCap.provide`), and
|
|
182
|
+
* the substrate only ever sees this contract — resolved by id off a plugin host
|
|
183
|
+
* with no `as unknown as` at any call site.
|
|
184
|
+
*/
|
|
185
|
+
export interface MemoryService {
|
|
186
|
+
executeMemoryCommand(options: ExecuteMemoryCommandOptions): Promise<string>;
|
|
187
|
+
readCanonicalMemoryDb(projectRoot: string): Promise<CanonicalMemorySnapshot>;
|
|
188
|
+
openMemoryDb(dbPath: string): Promise<MemoryDb>;
|
|
189
|
+
queryRelevantMemory(db: MemoryDb, input: MemoryQueryPortInput): Promise<MemoryQueryResult[]>;
|
|
190
|
+
formatMemoryQueryResults(results: MemoryQueryResult[]): string;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* The typed capability id the memory plugin provides and consumers require.
|
|
194
|
+
* Phantom-typed with `MemoryService` so `MemoryCap.require(host)` returns a
|
|
195
|
+
* `MemoryService` with no cast leaking to callers. Its string value is
|
|
196
|
+
* {@link MEMORY_SERVICE_CAPABILITY_ID}, so it indexes the same host entry.
|
|
197
|
+
*/
|
|
198
|
+
export declare const MEMORY: CapabilityId<MemoryService>;
|
|
151
199
|
export {};
|
package/dist/src/memory.js
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
// packages/contracts/src/capability-id.ts
|
|
3
|
+
function makeCapabilityId(id) {
|
|
4
|
+
return id;
|
|
5
|
+
}
|
|
6
|
+
|
|
2
7
|
// packages/contracts/src/memory.ts
|
|
3
8
|
var MEMORY_SERVICE_CAPABILITY_ID = "memory.service";
|
|
4
9
|
var NO_MATCH_RETRIEVAL_CANONICAL_KEY = "__memory_recall__:none";
|
|
10
|
+
var MEMORY = makeCapabilityId(MEMORY_SERVICE_CAPABILITY_ID);
|
|
5
11
|
export {
|
|
6
12
|
NO_MATCH_RETRIEVAL_CANONICAL_KEY,
|
|
7
|
-
MEMORY_SERVICE_CAPABILITY_ID
|
|
13
|
+
MEMORY_SERVICE_CAPABILITY_ID,
|
|
14
|
+
MEMORY
|
|
8
15
|
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure NOTIFY capability vocab.
|
|
3
|
+
*
|
|
4
|
+
* The neutral home for the notification event/target data types and the typed
|
|
5
|
+
* capability seam so the floor (and any consumer) can resolve a notifier off a
|
|
6
|
+
* plugin host WITHOUT importing the provider package. Carries no behaviour —
|
|
7
|
+
* exactly like `browser.ts` / `memory.ts`.
|
|
8
|
+
*
|
|
9
|
+
* `@rig/notifications-plugin` provides the concrete `NotifyService` impl
|
|
10
|
+
* (config load + target selection = policy) under
|
|
11
|
+
* {@link NOTIFY_SERVICE_CAPABILITY} via the `defineCapability` seam.
|
|
12
|
+
*/
|
|
13
|
+
import type { CapabilityId } from "./capability-id";
|
|
14
|
+
/** A Rig lifecycle event eligible for outbound notification. */
|
|
15
|
+
export type RigEvent = {
|
|
16
|
+
id?: string;
|
|
17
|
+
runId?: string;
|
|
18
|
+
timestamp?: string;
|
|
19
|
+
type: string;
|
|
20
|
+
payload?: Record<string, unknown>;
|
|
21
|
+
};
|
|
22
|
+
/** A configured outbound notification channel. */
|
|
23
|
+
export type NotificationTarget = {
|
|
24
|
+
id: string;
|
|
25
|
+
type: "slack-webhook" | "linear-webhook" | "notion-webhook" | "generic-webhook";
|
|
26
|
+
url: string;
|
|
27
|
+
enabled?: boolean;
|
|
28
|
+
events?: string[];
|
|
29
|
+
headers?: Record<string, string>;
|
|
30
|
+
};
|
|
31
|
+
/** The on-disk notification policy (`.rig/notifications.json`). */
|
|
32
|
+
export type NotificationConfig = {
|
|
33
|
+
targets: NotificationTarget[];
|
|
34
|
+
};
|
|
35
|
+
/** Capability id the notifications plugin registers its `NotifyService` under. */
|
|
36
|
+
export declare const NOTIFY_SERVICE_CAPABILITY_ID = "notify.dispatch";
|
|
37
|
+
/**
|
|
38
|
+
* The cohesive notify operation consumers depend on. The impl owns the policy:
|
|
39
|
+
* which targets receive which events, loaded from the project's
|
|
40
|
+
* `.rig/notifications.json`. Returns the count of targets successfully notified.
|
|
41
|
+
*/
|
|
42
|
+
export interface NotifyService {
|
|
43
|
+
notify(event: RigEvent): Promise<number>;
|
|
44
|
+
}
|
|
45
|
+
/** Typed capability id the notifications plugin provides and consumers require. */
|
|
46
|
+
export declare const NOTIFY_SERVICE_CAPABILITY: CapabilityId<NotifyService>;
|
|
@@ -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/notify.ts
|
|
8
|
+
var NOTIFY_SERVICE_CAPABILITY_ID = "notify.dispatch";
|
|
9
|
+
var NOTIFY_SERVICE_CAPABILITY = makeCapabilityId(NOTIFY_SERVICE_CAPABILITY_ID);
|
|
10
|
+
export {
|
|
11
|
+
NOTIFY_SERVICE_CAPABILITY_ID,
|
|
12
|
+
NOTIFY_SERVICE_CAPABILITY
|
|
13
|
+
};
|