@goah/cli 0.11.5 → 0.13.1
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/LICENSE +201 -0
- package/dist/THIRD-PARTY-NOTICES.md +2319 -0
- package/dist/anthropic-messages-WBFOHES5.js +7214 -0
- package/dist/azure-openai-responses-NZFH3PO6.js +253 -0
- package/dist/chunk-25XSBFX6.js +639 -0
- package/dist/chunk-2QBQZGXF.js +110 -0
- package/dist/chunk-2ZP2NBW3.js +345 -0
- package/dist/chunk-4KA63VNZ.js +2 -0
- package/dist/chunk-4M6TXTT5.js +86 -0
- package/dist/chunk-4US7ZHT3.js +20 -0
- package/dist/chunk-6M3OOCKO.js +11809 -0
- package/dist/chunk-7AXAFDPG.js +17 -0
- package/dist/chunk-BXA47DTF.js +548 -0
- package/dist/chunk-FSBUS2BI.js +26 -0
- package/dist/chunk-GKDRAHLI.js +4787 -0
- package/dist/chunk-H462EFJP.js +89 -0
- package/dist/chunk-IIJQ3DW4.js +35 -0
- package/dist/chunk-JQD5EWJY.js +34 -0
- package/dist/chunk-K26BVR6O.js +61 -0
- package/dist/chunk-KAO7WIXG.js +31 -0
- package/dist/chunk-LBKI23CC.js +9810 -0
- package/dist/chunk-LKBKZEHT.js +41 -0
- package/dist/chunk-MD7TLTXZ.js +18 -0
- package/dist/chunk-MPXK7QBL.js +868 -0
- package/dist/chunk-NRLGWZJC.js +11 -0
- package/dist/chunk-PFEV3HWI.js +1178 -0
- package/dist/chunk-QBD6EJ2Z.js +1746 -0
- package/dist/chunk-R6I3VKME.js +132 -0
- package/dist/chunk-TJON22J4.js +87 -0
- package/dist/chunk-ULY36ME4.js +33097 -0
- package/dist/chunk-VWEV4LTH.js +25 -0
- package/dist/chunk-X7UWW2PN.js +883 -0
- package/dist/chunk-XALZLRYK.js +9221 -0
- package/dist/chunk-XPQKM3L7.js +57 -0
- package/dist/chunk-YH6YJ2IB.js +1773 -0
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js +13148 -506
- package/dist/console/assets/index-3sYrDMmt.css +1 -0
- package/dist/console/assets/index-B1vGMXKr.js +52 -0
- package/dist/console/assets/index-B1vGMXKr.js.map +1 -0
- package/dist/console/index.html +2 -2
- package/dist/dist-65MDQA4Q.js +1126 -0
- package/dist/dist-KNR2XL6J.js +39 -0
- package/dist/execution.d.ts +557 -2
- package/dist/execution.js +37 -2
- package/dist/faux-runner-worker.js +128 -0
- package/dist/google-generative-ai-YMHXZSFE.js +422 -0
- package/dist/google-vertex-X6DB3ZQ6.js +471 -0
- package/dist/index.d.ts +855 -44
- package/dist/index.js +84 -257
- package/dist/kernel.d.ts +39 -2
- package/dist/kernel.js +21 -2
- package/dist/mistral-conversations-TY3MMD6G.js +718 -0
- package/dist/multipart-parser-F6M4NJZU.js +373 -0
- package/dist/openai-codex-responses-BRDUMLN5.js +1374 -0
- package/dist/openai-completions-CX634XN3.js +1139 -0
- package/dist/openai-responses-HMCXJIHT.js +300 -0
- package/dist/openrouter-images-KTWET2H2.js +148 -0
- package/dist/pi-messages-XL5OEC4K.js +307 -0
- package/dist/pi-worker.js +671 -0
- package/dist/runner-pi.d.ts +342 -2
- package/dist/runner-pi.js +46 -2
- package/dist/runner-registry-M776E3SE.js +22 -0
- package/dist/sqlite.d.ts +446 -2
- package/dist/sqlite.js +15 -2
- package/dist/src-F2KBSV4T.js +1398 -0
- package/dist/supervisor.d.ts +625 -2
- package/dist/supervisor.js +39 -2
- package/dist/testkit.d.ts +564 -2
- package/dist/testkit.js +127 -2
- package/dist/transcript.d.ts +84 -0
- package/dist/transcript.js +25 -0
- package/dist/verification-worker.js +72 -0
- package/package.json +3 -28
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/console/assets/index-BJTGvlCH.js +0 -52
- package/dist/console/assets/index-BJTGvlCH.js.map +0 -1
- package/dist/console/assets/index-msBn41Cl.css +0 -1
- package/dist/control.d.ts +0 -106
- package/dist/control.d.ts.map +0 -1
- package/dist/control.js +0 -215
- package/dist/control.js.map +0 -1
- package/dist/execution.d.ts.map +0 -1
- package/dist/execution.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/inspect.d.ts +0 -61
- package/dist/inspect.d.ts.map +0 -1
- package/dist/inspect.js +0 -110
- package/dist/inspect.js.map +0 -1
- package/dist/kernel.d.ts.map +0 -1
- package/dist/kernel.js.map +0 -1
- package/dist/live-config.d.ts +0 -10
- package/dist/live-config.d.ts.map +0 -1
- package/dist/live-config.js +0 -44
- package/dist/live-config.js.map +0 -1
- package/dist/metrics.d.ts +0 -2
- package/dist/metrics.d.ts.map +0 -1
- package/dist/metrics.js +0 -2
- package/dist/metrics.js.map +0 -1
- package/dist/prompt-queue.d.ts +0 -13
- package/dist/prompt-queue.d.ts.map +0 -1
- package/dist/prompt-queue.js +0 -30
- package/dist/prompt-queue.js.map +0 -1
- package/dist/runner-pi.d.ts.map +0 -1
- package/dist/runner-pi.js.map +0 -1
- package/dist/runner-registry.d.ts +0 -8
- package/dist/runner-registry.d.ts.map +0 -1
- package/dist/runner-registry.js +0 -12
- package/dist/runner-registry.js.map +0 -1
- package/dist/searchable-select.d.ts +0 -24
- package/dist/searchable-select.d.ts.map +0 -1
- package/dist/searchable-select.js +0 -61
- package/dist/searchable-select.js.map +0 -1
- package/dist/secret-input.d.ts +0 -8
- package/dist/secret-input.d.ts.map +0 -1
- package/dist/secret-input.js +0 -14
- package/dist/secret-input.js.map +0 -1
- package/dist/session.d.ts +0 -2
- package/dist/session.d.ts.map +0 -1
- package/dist/session.js +0 -2
- package/dist/session.js.map +0 -1
- package/dist/setup-wizard.d.ts +0 -11
- package/dist/setup-wizard.d.ts.map +0 -1
- package/dist/setup-wizard.js +0 -130
- package/dist/setup-wizard.js.map +0 -1
- package/dist/sqlite.d.ts.map +0 -1
- package/dist/sqlite.js.map +0 -1
- package/dist/supervisor.d.ts.map +0 -1
- package/dist/supervisor.js.map +0 -1
- package/dist/testkit.d.ts.map +0 -1
- package/dist/testkit.js.map +0 -1
- package/dist/tui-theme.d.ts +0 -16
- package/dist/tui-theme.d.ts.map +0 -1
- package/dist/tui-theme.js +0 -18
- package/dist/tui-theme.js.map +0 -1
- package/dist/tui.d.ts +0 -18
- package/dist/tui.d.ts.map +0 -1
- package/dist/tui.js +0 -583
- package/dist/tui.js.map +0 -1
- package/dist/update.d.ts +0 -15
- package/dist/update.d.ts.map +0 -1
- package/dist/update.js +0 -59
- package/dist/update.js.map +0 -1
- package/dist/web-console.d.ts +0 -33
- package/dist/web-console.d.ts.map +0 -1
- package/dist/web-console.js +0 -252
- package/dist/web-console.js.map +0 -1
- package/dist/welcome.d.ts +0 -30
- package/dist/welcome.d.ts.map +0 -1
- package/dist/welcome.js +0 -81
- package/dist/welcome.js.map +0 -1
- package/node_modules/goah-ledger-contract/dist/execution.d.ts +0 -402
- package/node_modules/goah-ledger-contract/dist/execution.d.ts.map +0 -1
- package/node_modules/goah-ledger-contract/dist/execution.js +0 -40
- package/node_modules/goah-ledger-contract/dist/execution.js.map +0 -1
- package/node_modules/goah-ledger-contract/dist/index.d.ts +0 -5
- package/node_modules/goah-ledger-contract/dist/index.d.ts.map +0 -1
- package/node_modules/goah-ledger-contract/dist/index.js +0 -5
- package/node_modules/goah-ledger-contract/dist/index.js.map +0 -1
- package/node_modules/goah-ledger-contract/dist/kernel.d.ts +0 -37
- package/node_modules/goah-ledger-contract/dist/kernel.d.ts.map +0 -1
- package/node_modules/goah-ledger-contract/dist/kernel.js +0 -8
- package/node_modules/goah-ledger-contract/dist/kernel.js.map +0 -1
- package/node_modules/goah-ledger-contract/dist/metrics.d.ts +0 -40
- package/node_modules/goah-ledger-contract/dist/metrics.d.ts.map +0 -1
- package/node_modules/goah-ledger-contract/dist/metrics.js +0 -25
- package/node_modules/goah-ledger-contract/dist/metrics.js.map +0 -1
- package/node_modules/goah-ledger-contract/dist/session.d.ts +0 -63
- package/node_modules/goah-ledger-contract/dist/session.d.ts.map +0 -1
- package/node_modules/goah-ledger-contract/dist/session.js +0 -115
- package/node_modules/goah-ledger-contract/dist/session.js.map +0 -1
- package/node_modules/goah-ledger-contract/package.json +0 -29
- package/node_modules/goah-ledger-sqlite/dist/index.d.ts +0 -77
- package/node_modules/goah-ledger-sqlite/dist/index.d.ts.map +0 -1
- package/node_modules/goah-ledger-sqlite/dist/index.js +0 -884
- package/node_modules/goah-ledger-sqlite/dist/index.js.map +0 -1
- package/node_modules/goah-ledger-sqlite/package.json +0 -26
- package/node_modules/goah-runner-pi/dist/configurator.d.ts +0 -20
- package/node_modules/goah-runner-pi/dist/configurator.d.ts.map +0 -1
- package/node_modules/goah-runner-pi/dist/configurator.js +0 -267
- package/node_modules/goah-runner-pi/dist/configurator.js.map +0 -1
- package/node_modules/goah-runner-pi/dist/credential-store.d.ts +0 -12
- package/node_modules/goah-runner-pi/dist/credential-store.d.ts.map +0 -1
- package/node_modules/goah-runner-pi/dist/credential-store.js +0 -69
- package/node_modules/goah-runner-pi/dist/credential-store.js.map +0 -1
- package/node_modules/goah-runner-pi/dist/env-spec.d.ts +0 -17
- package/node_modules/goah-runner-pi/dist/env-spec.d.ts.map +0 -1
- package/node_modules/goah-runner-pi/dist/env-spec.js +0 -95
- package/node_modules/goah-runner-pi/dist/env-spec.js.map +0 -1
- package/node_modules/goah-runner-pi/dist/index.d.ts +0 -64
- package/node_modules/goah-runner-pi/dist/index.d.ts.map +0 -1
- package/node_modules/goah-runner-pi/dist/index.js +0 -241
- package/node_modules/goah-runner-pi/dist/index.js.map +0 -1
- package/node_modules/goah-runner-pi/dist/model-provider.d.ts +0 -30
- package/node_modules/goah-runner-pi/dist/model-provider.d.ts.map +0 -1
- package/node_modules/goah-runner-pi/dist/model-provider.js +0 -96
- package/node_modules/goah-runner-pi/dist/model-provider.js.map +0 -1
- package/node_modules/goah-runner-pi/dist/pi-worker.d.ts +0 -29
- package/node_modules/goah-runner-pi/dist/pi-worker.d.ts.map +0 -1
- package/node_modules/goah-runner-pi/dist/pi-worker.js +0 -428
- package/node_modules/goah-runner-pi/dist/pi-worker.js.map +0 -1
- package/node_modules/goah-runner-pi/dist/test-helpers.d.ts +0 -4
- package/node_modules/goah-runner-pi/dist/test-helpers.d.ts.map +0 -1
- package/node_modules/goah-runner-pi/dist/test-helpers.js +0 -11
- package/node_modules/goah-runner-pi/dist/test-helpers.js.map +0 -1
- package/node_modules/goah-runner-pi/dist/verification-worker.d.ts +0 -2
- package/node_modules/goah-runner-pi/dist/verification-worker.d.ts.map +0 -1
- package/node_modules/goah-runner-pi/dist/verification-worker.js +0 -48
- package/node_modules/goah-runner-pi/dist/verification-worker.js.map +0 -1
- package/node_modules/goah-runner-pi/package.json +0 -28
- package/node_modules/goah-supervisor/dist/context-view.d.ts +0 -31
- package/node_modules/goah-supervisor/dist/context-view.d.ts.map +0 -1
- package/node_modules/goah-supervisor/dist/context-view.js +0 -71
- package/node_modules/goah-supervisor/dist/context-view.js.map +0 -1
- package/node_modules/goah-supervisor/dist/index.d.ts +0 -94
- package/node_modules/goah-supervisor/dist/index.d.ts.map +0 -1
- package/node_modules/goah-supervisor/dist/index.js +0 -888
- package/node_modules/goah-supervisor/dist/index.js.map +0 -1
- package/node_modules/goah-supervisor/dist/roles.d.ts +0 -3
- package/node_modules/goah-supervisor/dist/roles.d.ts.map +0 -1
- package/node_modules/goah-supervisor/dist/roles.js +0 -14
- package/node_modules/goah-supervisor/dist/roles.js.map +0 -1
- package/node_modules/goah-supervisor/dist/verification.d.ts +0 -82
- package/node_modules/goah-supervisor/dist/verification.d.ts.map +0 -1
- package/node_modules/goah-supervisor/dist/verification.js +0 -110
- package/node_modules/goah-supervisor/dist/verification.js.map +0 -1
- package/node_modules/goah-supervisor/package.json +0 -26
- package/node_modules/goah-testkit/dist/faux-runner-worker.d.ts +0 -2
- package/node_modules/goah-testkit/dist/faux-runner-worker.d.ts.map +0 -1
- package/node_modules/goah-testkit/dist/faux-runner-worker.js +0 -75
- package/node_modules/goah-testkit/dist/faux-runner-worker.js.map +0 -1
- package/node_modules/goah-testkit/dist/index.d.ts +0 -52
- package/node_modules/goah-testkit/dist/index.d.ts.map +0 -1
- package/node_modules/goah-testkit/dist/index.js +0 -113
- package/node_modules/goah-testkit/dist/index.js.map +0 -1
- package/node_modules/goah-testkit/dist/mock-connector-worker.d.ts +0 -2
- package/node_modules/goah-testkit/dist/mock-connector-worker.d.ts.map +0 -1
- package/node_modules/goah-testkit/dist/mock-connector-worker.js +0 -29
- package/node_modules/goah-testkit/dist/mock-connector-worker.js.map +0 -1
- package/node_modules/goah-testkit/package.json +0 -29
package/dist/sqlite.d.ts
CHANGED
|
@@ -1,2 +1,446 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { DatabaseSync } from 'node:sqlite';
|
|
2
|
+
|
|
3
|
+
type JsonPrimitive = string | number | boolean | null;
|
|
4
|
+
type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
5
|
+
[key: string]: JsonValue;
|
|
6
|
+
};
|
|
7
|
+
/** One append request. Sequence numbers are assigned by the ledger. */
|
|
8
|
+
interface EventInput {
|
|
9
|
+
streamId: string;
|
|
10
|
+
ts: string;
|
|
11
|
+
actor: string;
|
|
12
|
+
type: string;
|
|
13
|
+
data: JsonValue;
|
|
14
|
+
/** An unfamiliar reader may skip this event without changing replay semantics. */
|
|
15
|
+
ignorable?: true;
|
|
16
|
+
}
|
|
17
|
+
/** One immutable fact in the global ledger and in one logical stream. */
|
|
18
|
+
interface EventRecord extends EventInput {
|
|
19
|
+
seq: number;
|
|
20
|
+
streamSeq: number;
|
|
21
|
+
}
|
|
22
|
+
interface EventStore {
|
|
23
|
+
appendEvent(input: EventInput): EventRecord;
|
|
24
|
+
appendEvents(inputs: EventInput[]): EventRecord[];
|
|
25
|
+
readStream(streamId: string, fromStreamSeq?: number): EventRecord[];
|
|
26
|
+
eventsSince(seq: number, types?: string[]): EventRecord[];
|
|
27
|
+
events(): EventRecord[];
|
|
28
|
+
}
|
|
29
|
+
interface Clock {
|
|
30
|
+
now(): Date;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
type WakeStatus = "queued" | "claimed" | "consumed" | "cancelled";
|
|
34
|
+
type WakeTriggerStatus = "pending" | "resolved";
|
|
35
|
+
type ScheduleStatus = "pending" | "consumed" | "cancelled" | "superseded";
|
|
36
|
+
type GoalPhase = "active" | "paused" | "blocked" | "complete";
|
|
37
|
+
type TurnStatus = "in_progress" | "completed" | "failed" | "interrupted";
|
|
38
|
+
type TurnTriggerKind = "user_message" | "wake";
|
|
39
|
+
type SpecialistRole = "verifier" | "audit";
|
|
40
|
+
type AgentRole = "child" | "ceo" | "verifier" | "audit";
|
|
41
|
+
type AutomaticTarget = {
|
|
42
|
+
targetKind: "goal";
|
|
43
|
+
agent: string;
|
|
44
|
+
goalId: string;
|
|
45
|
+
specialistRole: null;
|
|
46
|
+
} | {
|
|
47
|
+
targetKind: "specialist";
|
|
48
|
+
agent: string;
|
|
49
|
+
goalId: null;
|
|
50
|
+
specialistRole: SpecialistRole;
|
|
51
|
+
};
|
|
52
|
+
type MailRoute = {
|
|
53
|
+
routeKind: "goal";
|
|
54
|
+
goalId: string;
|
|
55
|
+
specialistRole: null;
|
|
56
|
+
} | {
|
|
57
|
+
routeKind: "human_inbox";
|
|
58
|
+
goalId: null;
|
|
59
|
+
specialistRole: null;
|
|
60
|
+
} | {
|
|
61
|
+
routeKind: "human_request";
|
|
62
|
+
goalId: null;
|
|
63
|
+
specialistRole: null;
|
|
64
|
+
} | {
|
|
65
|
+
routeKind: "specialist_inbox";
|
|
66
|
+
goalId: null;
|
|
67
|
+
specialistRole: SpecialistRole;
|
|
68
|
+
};
|
|
69
|
+
type TurnItemType = "user_message" | "assistant_message" | "reasoning" | "tool_call" | "tool_result" | "plan" | "handoff";
|
|
70
|
+
type TurnItemStatus = "in_progress" | "completed" | "failed";
|
|
71
|
+
interface ThreadSnapshot {
|
|
72
|
+
id: string;
|
|
73
|
+
agent: string;
|
|
74
|
+
role: AgentRole;
|
|
75
|
+
parentThreadId: string | null;
|
|
76
|
+
createdAt: string;
|
|
77
|
+
updatedAt: string;
|
|
78
|
+
}
|
|
79
|
+
interface GoalCommitment {
|
|
80
|
+
goalId: string;
|
|
81
|
+
goalRevision: number;
|
|
82
|
+
}
|
|
83
|
+
type TurnSnapshot = {
|
|
84
|
+
id: string;
|
|
85
|
+
threadId: string;
|
|
86
|
+
triggerKind: TurnTriggerKind;
|
|
87
|
+
goalId: string | null;
|
|
88
|
+
goalRevision: number | null;
|
|
89
|
+
status: TurnStatus;
|
|
90
|
+
attempt: number;
|
|
91
|
+
error: JsonValue | null;
|
|
92
|
+
startedAt: string;
|
|
93
|
+
endedAt: string | null;
|
|
94
|
+
leaseUntil: string | null;
|
|
95
|
+
leaseToken: string | null;
|
|
96
|
+
runnerPid: number | null;
|
|
97
|
+
runnerProfileId?: string;
|
|
98
|
+
};
|
|
99
|
+
interface TurnItemSnapshot {
|
|
100
|
+
id: string;
|
|
101
|
+
turnId: string;
|
|
102
|
+
ordinal: number;
|
|
103
|
+
type: TurnItemType;
|
|
104
|
+
status: TurnItemStatus;
|
|
105
|
+
data: JsonValue;
|
|
106
|
+
createdAt: string;
|
|
107
|
+
completedAt: string | null;
|
|
108
|
+
}
|
|
109
|
+
interface GoalSnapshot {
|
|
110
|
+
id: string;
|
|
111
|
+
parentId: string | null;
|
|
112
|
+
objective: string;
|
|
113
|
+
observationMethod: string | null;
|
|
114
|
+
verificationMethod: string | null;
|
|
115
|
+
owner: string;
|
|
116
|
+
phase: GoalPhase;
|
|
117
|
+
revision: number;
|
|
118
|
+
}
|
|
119
|
+
type GoalChangeOperation = "create" | "revise" | "pause" | "resume" | "block" | "complete" | "reassign";
|
|
120
|
+
type GoalChangeAuthority = {
|
|
121
|
+
kind: "human";
|
|
122
|
+
} | {
|
|
123
|
+
kind: "parent_goal";
|
|
124
|
+
goalId: string;
|
|
125
|
+
goalRevision: number;
|
|
126
|
+
} | {
|
|
127
|
+
kind: "system";
|
|
128
|
+
reason: string;
|
|
129
|
+
};
|
|
130
|
+
interface GoalChangeMetadata {
|
|
131
|
+
operation: GoalChangeOperation;
|
|
132
|
+
reason: string;
|
|
133
|
+
evidence: number[];
|
|
134
|
+
authority?: GoalChangeAuthority;
|
|
135
|
+
sourceTurnId?: string;
|
|
136
|
+
sourceWakeId?: string;
|
|
137
|
+
idempotencyKey?: string;
|
|
138
|
+
}
|
|
139
|
+
interface WorkRecordSnapshot {
|
|
140
|
+
goalId: string;
|
|
141
|
+
recordRevision: number;
|
|
142
|
+
goalRevision: number;
|
|
143
|
+
content: string;
|
|
144
|
+
updatedBy: string;
|
|
145
|
+
updatedInTurn: string;
|
|
146
|
+
sourceWakeId: string | null;
|
|
147
|
+
updatedAt: string;
|
|
148
|
+
reason: string;
|
|
149
|
+
evidence: number[];
|
|
150
|
+
lastEventSeq: number;
|
|
151
|
+
}
|
|
152
|
+
interface WorkRecordUpdateRequest {
|
|
153
|
+
goalId: string;
|
|
154
|
+
expectedRevision: number;
|
|
155
|
+
goalRevision: number;
|
|
156
|
+
content: string;
|
|
157
|
+
reason: string;
|
|
158
|
+
evidence: number[];
|
|
159
|
+
turnId: string;
|
|
160
|
+
sourceWakeId?: string;
|
|
161
|
+
}
|
|
162
|
+
interface WorkRecordDiff {
|
|
163
|
+
goalId: string;
|
|
164
|
+
fromRevision: number;
|
|
165
|
+
toRevision: number;
|
|
166
|
+
text: string;
|
|
167
|
+
}
|
|
168
|
+
type ScheduleSnapshot = AutomaticTarget & {
|
|
169
|
+
id: string;
|
|
170
|
+
nextWakeAt: string;
|
|
171
|
+
reason: string;
|
|
172
|
+
setBy: string;
|
|
173
|
+
status: ScheduleStatus;
|
|
174
|
+
resolvedAt: string | null;
|
|
175
|
+
};
|
|
176
|
+
type WakeSnapshot = AutomaticTarget & {
|
|
177
|
+
id: string;
|
|
178
|
+
/** Initial trigger retained for display and provenance. Runtime decisions use WakeTriggerSnapshot. */
|
|
179
|
+
triggerRef: string;
|
|
180
|
+
status: WakeStatus;
|
|
181
|
+
attempt: number;
|
|
182
|
+
enqueuedSeq: number;
|
|
183
|
+
claimedAt: string | null;
|
|
184
|
+
consumedAt: string | null;
|
|
185
|
+
turnId: string | null;
|
|
186
|
+
};
|
|
187
|
+
interface WakeTriggerSnapshot {
|
|
188
|
+
wakeId: string;
|
|
189
|
+
agent: string;
|
|
190
|
+
triggerRef: string;
|
|
191
|
+
source: "goal" | "system";
|
|
192
|
+
status: WakeTriggerStatus;
|
|
193
|
+
addedAt: string;
|
|
194
|
+
resolvedAt: string | null;
|
|
195
|
+
}
|
|
196
|
+
type MailLevel = "fyi" | "decision" | "emergency";
|
|
197
|
+
type MailSnapshot = MailRoute & {
|
|
198
|
+
id: string;
|
|
199
|
+
to: string;
|
|
200
|
+
from: string;
|
|
201
|
+
level: MailLevel;
|
|
202
|
+
body: JsonValue;
|
|
203
|
+
readAt: string | null;
|
|
204
|
+
};
|
|
205
|
+
interface DelegationRequest {
|
|
206
|
+
id: string;
|
|
207
|
+
parentGoalId: string;
|
|
208
|
+
expectedParentRevision: number;
|
|
209
|
+
childGoal: {
|
|
210
|
+
id: string;
|
|
211
|
+
objective: string;
|
|
212
|
+
observationMethod: string;
|
|
213
|
+
verificationMethod: string;
|
|
214
|
+
owner: string;
|
|
215
|
+
};
|
|
216
|
+
brief: JsonValue;
|
|
217
|
+
reason: string;
|
|
218
|
+
evidence: number[];
|
|
219
|
+
sourceTurnId?: string;
|
|
220
|
+
}
|
|
221
|
+
interface DelegationResult {
|
|
222
|
+
delegationId: string;
|
|
223
|
+
goal: GoalSnapshot;
|
|
224
|
+
mail: MailSnapshot;
|
|
225
|
+
wake: WakeSnapshot;
|
|
226
|
+
}
|
|
227
|
+
interface ReassignmentRequest {
|
|
228
|
+
id: string;
|
|
229
|
+
goalId: string;
|
|
230
|
+
expectedGoalRevision: number;
|
|
231
|
+
newOwner: string;
|
|
232
|
+
brief: JsonValue;
|
|
233
|
+
reason: string;
|
|
234
|
+
evidence: number[];
|
|
235
|
+
sourceTurnId?: string;
|
|
236
|
+
}
|
|
237
|
+
interface ReassignmentResult {
|
|
238
|
+
reassignmentId: string;
|
|
239
|
+
goal: GoalSnapshot;
|
|
240
|
+
mail: MailSnapshot[];
|
|
241
|
+
wake: WakeSnapshot | null;
|
|
242
|
+
}
|
|
243
|
+
interface GoalCompletionRequest {
|
|
244
|
+
goalId: string;
|
|
245
|
+
revision: number;
|
|
246
|
+
reason: string;
|
|
247
|
+
evidence: number[];
|
|
248
|
+
sourceTurnId?: string;
|
|
249
|
+
}
|
|
250
|
+
type GoalOutcome = "progress" | "waiting" | "blocked" | "completion_proposed";
|
|
251
|
+
interface AgentHandoff {
|
|
252
|
+
outcome: GoalOutcome;
|
|
253
|
+
evidence: number[];
|
|
254
|
+
}
|
|
255
|
+
interface GoalHandoff extends AgentHandoff {
|
|
256
|
+
goalId: string;
|
|
257
|
+
goalRevision: number;
|
|
258
|
+
recordRevision: number;
|
|
259
|
+
}
|
|
260
|
+
interface CommittedTurnOutput {
|
|
261
|
+
handoff: GoalHandoff;
|
|
262
|
+
}
|
|
263
|
+
interface HandoffCommit {
|
|
264
|
+
agent: string;
|
|
265
|
+
turnId: string;
|
|
266
|
+
sourceWakeId: string | null;
|
|
267
|
+
mailIds: string[];
|
|
268
|
+
ts: string;
|
|
269
|
+
output: CommittedTurnOutput;
|
|
270
|
+
responseItemId: string;
|
|
271
|
+
item: TurnItemSnapshot;
|
|
272
|
+
}
|
|
273
|
+
interface HumanTurnAdmissionRequest {
|
|
274
|
+
thread: ThreadSnapshot;
|
|
275
|
+
turn: TurnSnapshot;
|
|
276
|
+
messageItem: TurnItemSnapshot;
|
|
277
|
+
replaceTurnId: string | null;
|
|
278
|
+
rootGoal?: GoalSnapshot;
|
|
279
|
+
}
|
|
280
|
+
interface HumanTurnAdmissionResult {
|
|
281
|
+
turn: TurnSnapshot;
|
|
282
|
+
replacedTurn: TurnSnapshot | null;
|
|
283
|
+
goal: GoalSnapshot | null;
|
|
284
|
+
}
|
|
285
|
+
/** Standard execution modules composed on top of the generic event store. */
|
|
286
|
+
interface Ledger extends EventStore {
|
|
287
|
+
putThread(thread: ThreadSnapshot, actor: string): EventRecord;
|
|
288
|
+
putTurn(turn: TurnSnapshot, actor: string): EventRecord;
|
|
289
|
+
admitHumanTurn(request: HumanTurnAdmissionRequest): HumanTurnAdmissionResult;
|
|
290
|
+
commitTurnToGoal(turnId: string, goal: GoalCommitment, actor: string): TurnSnapshot;
|
|
291
|
+
putTurnItem(item: TurnItemSnapshot, actor: string): EventRecord;
|
|
292
|
+
thread(id: string): ThreadSnapshot | null;
|
|
293
|
+
threads(): ThreadSnapshot[];
|
|
294
|
+
turn(id: string): TurnSnapshot | null;
|
|
295
|
+
turns(threadId?: string): TurnSnapshot[];
|
|
296
|
+
turnItems(turnId: string): TurnItemSnapshot[];
|
|
297
|
+
activeTurn(threadId: string): TurnSnapshot | null;
|
|
298
|
+
putGoal(goal: GoalSnapshot, actor: string, wakeId?: string, change?: GoalChangeMetadata): EventRecord;
|
|
299
|
+
updateWorkRecord(request: WorkRecordUpdateRequest, actor: string): WorkRecordSnapshot;
|
|
300
|
+
commitDelegation(request: DelegationRequest, actor: string, wakeId?: string): DelegationResult;
|
|
301
|
+
commitReassignment(request: ReassignmentRequest, actor: string, wakeId?: string): ReassignmentResult;
|
|
302
|
+
completeGoal(request: GoalCompletionRequest, actor: string, wakeId?: string): GoalSnapshot;
|
|
303
|
+
putSchedule(schedule: ScheduleSnapshot, actor: string, wakeId?: string): EventRecord;
|
|
304
|
+
consumeSchedule(id: string, wake: WakeSnapshot, now: string): {
|
|
305
|
+
schedule: ScheduleSnapshot;
|
|
306
|
+
wake: WakeSnapshot;
|
|
307
|
+
};
|
|
308
|
+
cancelSchedule(id: string, now: string): ScheduleSnapshot;
|
|
309
|
+
supersedeSchedule(id: string, now: string): ScheduleSnapshot;
|
|
310
|
+
enqueueWake(wake: WakeSnapshot, actor: string): {
|
|
311
|
+
event: EventRecord;
|
|
312
|
+
created: boolean;
|
|
313
|
+
};
|
|
314
|
+
addWakeTrigger(wakeId: string, triggerRef: string, actor: string): WakeTriggerSnapshot;
|
|
315
|
+
claimNextWake(now: string): WakeSnapshot | null;
|
|
316
|
+
startTurnFromWake(id: string, turn: TurnSnapshot, now: string): WakeSnapshot;
|
|
317
|
+
releaseWake(id: string, now: string): WakeSnapshot;
|
|
318
|
+
cancelWake(id: string, now: string): WakeSnapshot;
|
|
319
|
+
attachTurnProcess(id: string, leaseToken: string, pid: number): TurnSnapshot;
|
|
320
|
+
renewTurnLease(id: string, leaseToken: string, leaseUntil: string, now: string): TurnSnapshot;
|
|
321
|
+
appendTurnEvent(input: EventInput, leaseToken: string): EventRecord;
|
|
322
|
+
repairTurnAttempt(id: string, reason: string, now: string, actor: string): TurnItemSnapshot[];
|
|
323
|
+
finishTurn(id: string, status: "completed" | "failed" | "interrupted", error: JsonValue | null, now: string, actor: string, mailIds?: string[]): TurnSnapshot;
|
|
324
|
+
releaseTurnProcess(id: string, actor: string): TurnSnapshot;
|
|
325
|
+
putMail(mail: MailSnapshot, actor: string, wakeId?: string): EventRecord;
|
|
326
|
+
putMails(mail: MailSnapshot[], actor: string, wakeId?: string): EventRecord[];
|
|
327
|
+
commitHandoff(commit: HandoffCommit): EventRecord;
|
|
328
|
+
dueSchedules(now: string): ScheduleSnapshot[];
|
|
329
|
+
unreadMail(agent: string): MailSnapshot[];
|
|
330
|
+
lastEvent(actor: string, type: string): EventRecord | null;
|
|
331
|
+
lastGoalHandoff(goalId: string): EventRecord | null;
|
|
332
|
+
latestEvent(): EventRecord | null;
|
|
333
|
+
eventsForWake(wakeId: string): EventRecord[];
|
|
334
|
+
wake(id: string): WakeSnapshot | null;
|
|
335
|
+
wakeByTrigger(agent: string, triggerRef: string): WakeSnapshot | null;
|
|
336
|
+
wakeTriggers(wakeId: string): WakeTriggerSnapshot[];
|
|
337
|
+
wakeTriggersForAgent(agent: string): WakeTriggerSnapshot[];
|
|
338
|
+
queuedWakeForAgent(agent: string): WakeSnapshot | null;
|
|
339
|
+
goalsForOwner(owner: string): GoalSnapshot[];
|
|
340
|
+
goal(id: string): GoalSnapshot | null;
|
|
341
|
+
workRecord(goalId: string): WorkRecordSnapshot | null;
|
|
342
|
+
workRecordHistory(goalId: string): WorkRecordSnapshot[];
|
|
343
|
+
workRecordDiff(goalId: string, fromRevision: number, toRevision: number): WorkRecordDiff;
|
|
344
|
+
searchWorkRecords(query: string, limit?: number): WorkRecordSnapshot[];
|
|
345
|
+
triggeringMail(): MailSnapshot[];
|
|
346
|
+
searchEvents(query: string, limit?: number): EventRecord[];
|
|
347
|
+
goals(): GoalSnapshot[];
|
|
348
|
+
workRecords(): WorkRecordSnapshot[];
|
|
349
|
+
schedules(): ScheduleSnapshot[];
|
|
350
|
+
wakes(): WakeSnapshot[];
|
|
351
|
+
mailbox(): MailSnapshot[];
|
|
352
|
+
rebuildProjections(): void;
|
|
353
|
+
close(): void;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
type FaultPoint = "after_event_before_projection" | "after_delegation_event" | "after_reassignment_event" | "after_human_goal_before_turn" | "after_human_replacement_before_turn";
|
|
357
|
+
type FaultInjector = (point: FaultPoint) => void;
|
|
358
|
+
declare const SQLITE_SCHEMA_VERSION = 27;
|
|
359
|
+
interface SqliteLedgerOptions {
|
|
360
|
+
faultInjector?: FaultInjector;
|
|
361
|
+
clock?: Clock;
|
|
362
|
+
busyTimeoutMs?: number;
|
|
363
|
+
}
|
|
364
|
+
declare class SqliteLedger implements Ledger {
|
|
365
|
+
#private;
|
|
366
|
+
readonly db: DatabaseSync;
|
|
367
|
+
constructor(path?: string, options?: SqliteLedgerOptions);
|
|
368
|
+
close(): void;
|
|
369
|
+
appendEvent(input: EventInput): EventRecord;
|
|
370
|
+
appendEvents(inputs: EventInput[]): EventRecord[];
|
|
371
|
+
readStream(streamId: string, fromStreamSeq?: number): EventRecord[];
|
|
372
|
+
putThread(thread: ThreadSnapshot, actor: string): EventRecord;
|
|
373
|
+
putTurn(turn: TurnSnapshot, actor: string): EventRecord;
|
|
374
|
+
admitHumanTurn(request: HumanTurnAdmissionRequest): HumanTurnAdmissionResult;
|
|
375
|
+
commitTurnToGoal(turnId: string, binding: {
|
|
376
|
+
goalId: string;
|
|
377
|
+
goalRevision: number;
|
|
378
|
+
}, actor: string): TurnSnapshot;
|
|
379
|
+
putTurnItem(item: TurnItemSnapshot, actor: string): EventRecord;
|
|
380
|
+
thread(id: string): ThreadSnapshot | null;
|
|
381
|
+
threads(): ThreadSnapshot[];
|
|
382
|
+
turn(id: string): TurnSnapshot | null;
|
|
383
|
+
turns(threadId?: string): TurnSnapshot[];
|
|
384
|
+
turnItems(turnId: string): TurnItemSnapshot[];
|
|
385
|
+
activeTurn(threadId: string): TurnSnapshot | null;
|
|
386
|
+
putGoal(goal: GoalSnapshot, actor: string, wakeId?: string, change?: GoalChangeMetadata): EventRecord;
|
|
387
|
+
updateWorkRecord(request: WorkRecordUpdateRequest, actor: string): WorkRecordSnapshot;
|
|
388
|
+
commitDelegation(request: DelegationRequest, actor: string, wakeId?: string): DelegationResult;
|
|
389
|
+
commitReassignment(request: ReassignmentRequest, actor: string, wakeId?: string): ReassignmentResult;
|
|
390
|
+
completeGoal(request: GoalCompletionRequest, actor: string, wakeId?: string): GoalSnapshot;
|
|
391
|
+
putSchedule(value: ScheduleSnapshot, actor: string, wakeId?: string): EventRecord;
|
|
392
|
+
consumeSchedule(id: string, wake: WakeSnapshot, now: string): {
|
|
393
|
+
schedule: ScheduleSnapshot;
|
|
394
|
+
wake: WakeSnapshot;
|
|
395
|
+
};
|
|
396
|
+
cancelSchedule(id: string, now: string): ScheduleSnapshot;
|
|
397
|
+
supersedeSchedule(id: string, now: string): ScheduleSnapshot;
|
|
398
|
+
enqueueWake(input: WakeSnapshot, actor: string): {
|
|
399
|
+
event: EventRecord;
|
|
400
|
+
created: boolean;
|
|
401
|
+
};
|
|
402
|
+
addWakeTrigger(wakeId: string, triggerRef: string, actor: string): WakeTriggerSnapshot;
|
|
403
|
+
claimNextWake(now: string): WakeSnapshot | null;
|
|
404
|
+
startTurnFromWake(id: string, turn: TurnSnapshot, now: string): WakeSnapshot;
|
|
405
|
+
releaseWake(id: string, now: string): WakeSnapshot;
|
|
406
|
+
cancelWake(id: string, now: string): WakeSnapshot;
|
|
407
|
+
attachTurnProcess(id: string, leaseToken: string, pid: number): TurnSnapshot;
|
|
408
|
+
renewTurnLease(id: string, leaseToken: string, leaseUntil: string, now: string): TurnSnapshot;
|
|
409
|
+
appendTurnEvent(input: EventInput, leaseToken: string): EventRecord;
|
|
410
|
+
repairTurnAttempt(id: string, reason: string, now: string, actor: string): TurnItemSnapshot[];
|
|
411
|
+
finishTurn(id: string, status: "completed" | "failed" | "interrupted", error: JsonValue | null, now: string, actor: string, mailIds?: string[]): TurnSnapshot;
|
|
412
|
+
releaseTurnProcess(id: string, actor: string): TurnSnapshot;
|
|
413
|
+
putMail(mail: MailSnapshot, actor: string, wakeId?: string): EventRecord;
|
|
414
|
+
putMails(mails: MailSnapshot[], actor: string, wakeId?: string): EventRecord[];
|
|
415
|
+
commitHandoff(commit: HandoffCommit): EventRecord;
|
|
416
|
+
dueSchedules(now: string): ScheduleSnapshot[];
|
|
417
|
+
unreadMail(agent: string): MailSnapshot[];
|
|
418
|
+
lastEvent(actor: string, type: string): EventRecord | null;
|
|
419
|
+
lastGoalHandoff(goalId: string): EventRecord | null;
|
|
420
|
+
latestEvent(): EventRecord | null;
|
|
421
|
+
eventsForWake(wakeId: string): EventRecord[];
|
|
422
|
+
wake(id: string): WakeSnapshot | null;
|
|
423
|
+
wakeByTrigger(agent: string, triggerRef: string): WakeSnapshot | null;
|
|
424
|
+
wakeTriggers(wakeId: string): WakeTriggerSnapshot[];
|
|
425
|
+
wakeTriggersForAgent(agent: string): WakeTriggerSnapshot[];
|
|
426
|
+
queuedWakeForAgent(agent: string): WakeSnapshot | null;
|
|
427
|
+
goalsForOwner(owner: string): GoalSnapshot[];
|
|
428
|
+
goal(id: string): GoalSnapshot | null;
|
|
429
|
+
workRecord(goalId: string): WorkRecordSnapshot | null;
|
|
430
|
+
workRecordHistory(goalId: string): WorkRecordSnapshot[];
|
|
431
|
+
workRecordDiff(goalId: string, fromRevision: number, toRevision: number): WorkRecordDiff;
|
|
432
|
+
searchWorkRecords(query: string, limit?: number): WorkRecordSnapshot[];
|
|
433
|
+
triggeringMail(): MailSnapshot[];
|
|
434
|
+
eventsSince(seq: number, types?: string[]): EventRecord[];
|
|
435
|
+
searchEvents(query: string, limit?: number): EventRecord[];
|
|
436
|
+
events(): EventRecord[];
|
|
437
|
+
goals(): GoalSnapshot[];
|
|
438
|
+
workRecords(): WorkRecordSnapshot[];
|
|
439
|
+
schedules(): ScheduleSnapshot[];
|
|
440
|
+
wakes(): WakeSnapshot[];
|
|
441
|
+
mailbox(): MailSnapshot[];
|
|
442
|
+
rebuildProjections(): void;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
export { SQLITE_SCHEMA_VERSION, SqliteLedger };
|
|
446
|
+
export type { SqliteLedgerOptions };
|
package/dist/sqlite.js
CHANGED
|
@@ -1,2 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { createRequire as __goahCreateRequire } from "node:module";
|
|
2
|
+
const require = __goahCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
SQLITE_SCHEMA_VERSION,
|
|
5
|
+
SqliteLedger
|
|
6
|
+
} from "./chunk-YH6YJ2IB.js";
|
|
7
|
+
import "./chunk-4KA63VNZ.js";
|
|
8
|
+
import "./chunk-KAO7WIXG.js";
|
|
9
|
+
import "./chunk-R6I3VKME.js";
|
|
10
|
+
import "./chunk-TJON22J4.js";
|
|
11
|
+
import "./chunk-XPQKM3L7.js";
|
|
12
|
+
export {
|
|
13
|
+
SQLITE_SCHEMA_VERSION,
|
|
14
|
+
SqliteLedger
|
|
15
|
+
};
|