@plurnk/plurnk-service 1.5.0 → 1.6.0
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/.env.defaults +21 -12
- package/INSTALL.md +11 -7
- package/SPEC.md +437 -304
- package/dist/build-info.json +1 -1
- package/dist/content/edit-collision.d.ts +5 -0
- package/dist/content/edit-collision.d.ts.map +1 -0
- package/dist/content/edit-collision.js +14 -0
- package/dist/content/edit-collision.js.map +1 -0
- package/dist/content/edit-receipt.d.ts +3 -2
- package/dist/content/edit-receipt.d.ts.map +1 -1
- package/dist/content/edit-receipt.js +58 -13
- package/dist/content/edit-receipt.js.map +1 -1
- package/dist/content/index.d.ts +4 -1
- package/dist/content/index.d.ts.map +1 -1
- package/dist/content/index.js +3 -1
- package/dist/content/index.js.map +1 -1
- package/dist/content/line-anchors.d.ts +41 -0
- package/dist/content/line-anchors.d.ts.map +1 -0
- package/dist/content/line-anchors.js +191 -0
- package/dist/content/line-anchors.js.map +1 -0
- package/dist/content/read-projector.d.ts +7 -1
- package/dist/content/read-projector.d.ts.map +1 -1
- package/dist/content/read-projector.js +46 -10
- package/dist/content/read-projector.js.map +1 -1
- package/dist/content/read-resolve.js +3 -3
- package/dist/content/read-resolve.js.map +1 -1
- package/dist/core/BudgetReadout.d.ts.map +1 -1
- package/dist/core/BudgetReadout.js +9 -2
- package/dist/core/BudgetReadout.js.map +1 -1
- package/dist/core/ChannelWrite.js +1 -1
- package/dist/core/ChannelWrite.js.map +1 -1
- package/dist/core/Dispatcher.d.ts +13 -3
- package/dist/core/Dispatcher.d.ts.map +1 -1
- package/dist/core/Dispatcher.js +391 -113
- package/dist/core/Dispatcher.js.map +1 -1
- package/dist/core/DurableStatement.d.ts.map +1 -1
- package/dist/core/DurableStatement.js +2 -0
- package/dist/core/DurableStatement.js.map +1 -1
- package/dist/core/Engine.d.ts +13 -14
- package/dist/core/Engine.d.ts.map +1 -1
- package/dist/core/Engine.js +434 -300
- package/dist/core/Engine.js.map +1 -1
- package/dist/core/Engine.sql +156 -90
- package/dist/core/ExecutableTools.d.ts +10 -0
- package/dist/core/ExecutableTools.d.ts.map +1 -0
- package/dist/core/ExecutableTools.js +41 -0
- package/dist/core/ExecutableTools.js.map +1 -0
- package/dist/core/ExecutorRegistry.d.ts +3 -3
- package/dist/core/ExecutorRegistry.d.ts.map +1 -1
- package/dist/core/ExecutorRegistry.js +2 -2
- package/dist/core/ExecutorRegistry.js.map +1 -1
- package/dist/core/LogBody.d.ts +2 -0
- package/dist/core/LogBody.d.ts.map +1 -1
- package/dist/core/LogBody.js +17 -5
- package/dist/core/LogBody.js.map +1 -1
- package/dist/core/LogEntryProjection.d.ts +14 -0
- package/dist/core/LogEntryProjection.d.ts.map +1 -0
- package/dist/core/LogEntryProjection.js +38 -0
- package/dist/core/LogEntryProjection.js.map +1 -0
- package/dist/core/ModelCall.d.ts +27 -0
- package/dist/core/ModelCall.d.ts.map +1 -0
- package/dist/core/ModelCall.js +125 -0
- package/dist/core/ModelCall.js.map +1 -0
- package/dist/core/PacketBuilder.d.ts +10 -10
- package/dist/core/PacketBuilder.d.ts.map +1 -1
- package/dist/core/PacketBuilder.js +131 -103
- package/dist/core/PacketBuilder.js.map +1 -1
- package/dist/core/ProblemLog.d.ts.map +1 -1
- package/dist/core/ProblemLog.js +1 -0
- package/dist/core/ProblemLog.js.map +1 -1
- package/dist/core/ProposalLifecycle.d.ts.map +1 -1
- package/dist/core/ProposalLifecycle.js +3 -4
- package/dist/core/ProposalLifecycle.js.map +1 -1
- package/dist/core/ProviderInstantiate.d.ts.map +1 -1
- package/dist/core/ProviderInstantiate.js +23 -6
- package/dist/core/ProviderInstantiate.js.map +1 -1
- package/dist/core/SchemeRegistry.js +7 -7
- package/dist/core/SchemeRegistry.js.map +1 -1
- package/dist/core/StrikeRail.d.ts +0 -1
- package/dist/core/StrikeRail.d.ts.map +1 -1
- package/dist/core/StrikeRail.js +6 -4
- package/dist/core/StrikeRail.js.map +1 -1
- package/dist/core/caps/CapsResolve.js +1 -1
- package/dist/core/caps/CapsResolve.js.map +1 -1
- package/dist/core/caps/DbEntryCaps.d.ts +2 -1
- package/dist/core/caps/DbEntryCaps.d.ts.map +1 -1
- package/dist/core/caps/DbEntryCaps.js +8 -5
- package/dist/core/caps/DbEntryCaps.js.map +1 -1
- package/dist/core/caps/DbProjectionCaps.d.ts +1 -0
- package/dist/core/caps/DbProjectionCaps.d.ts.map +1 -1
- package/dist/core/caps/DbProjectionCaps.js +29 -0
- package/dist/core/caps/DbProjectionCaps.js.map +1 -1
- package/dist/core/caps/SchemeCtxImpl.d.ts +5 -2
- package/dist/core/caps/SchemeCtxImpl.d.ts.map +1 -1
- package/dist/core/caps/SchemeCtxImpl.js +6 -4
- package/dist/core/caps/SchemeCtxImpl.js.map +1 -1
- package/dist/core/fork.d.ts.map +1 -1
- package/dist/core/fork.js +23 -7
- package/dist/core/fork.js.map +1 -1
- package/dist/core/fork.sql +33 -12
- package/dist/core/git-membership.d.ts.map +1 -1
- package/dist/core/git-membership.js +1 -2
- package/dist/core/git-membership.js.map +1 -1
- package/dist/core/git-state.js +1 -1
- package/dist/core/git-state.js.map +1 -1
- package/dist/core/packet-wire.d.ts +4 -1
- package/dist/core/packet-wire.d.ts.map +1 -1
- package/dist/core/packet-wire.js +248 -90
- package/dist/core/packet-wire.js.map +1 -1
- package/dist/core/provider-accounting.d.ts +24 -0
- package/dist/core/provider-accounting.d.ts.map +1 -0
- package/dist/core/provider-accounting.js +76 -0
- package/dist/core/provider-accounting.js.map +1 -0
- package/dist/core/search-gate.d.ts +2 -2
- package/dist/core/search-gate.d.ts.map +1 -1
- package/dist/core/search-gate.js +8 -8
- package/dist/core/search-gate.js.map +1 -1
- package/dist/core/token-ruler.js +1 -1
- package/dist/core/token-ruler.js.map +1 -1
- package/dist/core/turn-scheduler.js +1 -1
- package/dist/core/turn-scheduler.js.map +1 -1
- package/dist/digest/Digest.d.ts.map +1 -1
- package/dist/digest/Digest.js +220 -109
- package/dist/digest/Digest.js.map +1 -1
- package/dist/digest/digest.sql +40 -18
- package/dist/schemes/Exec.d.ts.map +1 -1
- package/dist/schemes/Exec.js +111 -101
- package/dist/schemes/Exec.js.map +1 -1
- package/dist/schemes/File.d.ts +5 -4
- package/dist/schemes/File.d.ts.map +1 -1
- package/dist/schemes/File.js +24 -22
- package/dist/schemes/File.js.map +1 -1
- package/dist/schemes/Log.d.ts +11 -0
- package/dist/schemes/Log.d.ts.map +1 -1
- package/dist/schemes/Log.js +171 -106
- package/dist/schemes/Log.js.map +1 -1
- package/dist/schemes/Log.sql +48 -32
- package/dist/schemes/Prompt.d.ts +3 -3
- package/dist/schemes/Prompt.d.ts.map +1 -1
- package/dist/schemes/Prompt.js +4 -1
- package/dist/schemes/Prompt.js.map +1 -1
- package/dist/schemes/Skill.d.ts +4 -4
- package/dist/schemes/Skill.d.ts.map +1 -1
- package/dist/schemes/Skill.js +3 -0
- package/dist/schemes/Skill.js.map +1 -1
- package/dist/schemes/Worker.d.ts +4 -4
- package/dist/schemes/Worker.d.ts.map +1 -1
- package/dist/schemes/Worker.js +9 -5
- package/dist/schemes/Worker.js.map +1 -1
- package/dist/schemes/_entry-crud.d.ts +0 -1
- package/dist/schemes/_entry-crud.d.ts.map +1 -1
- package/dist/schemes/_entry-crud.js +15 -9
- package/dist/schemes/_entry-crud.js.map +1 -1
- package/dist/schemes/_entry-crud.sql +2 -14
- package/dist/schemes/_entry-find.d.ts +13 -12
- package/dist/schemes/_entry-find.d.ts.map +1 -1
- package/dist/schemes/_entry-find.js +33 -28
- package/dist/schemes/_entry-find.js.map +1 -1
- package/dist/schemes/_entry-find.sql +2 -21
- package/dist/schemes/_entry-graph.sql +1 -1
- package/dist/schemes/_entry-manifest.d.ts +5 -17
- package/dist/schemes/_entry-manifest.d.ts.map +1 -1
- package/dist/schemes/_entry-manifest.js +28 -24
- package/dist/schemes/_entry-manifest.js.map +1 -1
- package/dist/schemes/_entry-ops.d.ts +5 -4
- package/dist/schemes/_entry-ops.d.ts.map +1 -1
- package/dist/schemes/_entry-ops.js +87 -47
- package/dist/schemes/_entry-ops.js.map +1 -1
- package/dist/schemes/_entry-ops.sql +30 -4
- package/dist/schemes/_entry-send.js +4 -4
- package/dist/schemes/_entry-send.js.map +1 -1
- package/dist/schemes/_search-index.d.ts.map +1 -1
- package/dist/schemes/_search-index.js +10 -2
- package/dist/schemes/_search-index.js.map +1 -1
- package/dist/schemes/exec-abort.js +2 -2
- package/dist/schemes/exec-abort.js.map +1 -1
- package/dist/server/Daemon.d.ts +1 -1
- package/dist/server/Daemon.d.ts.map +1 -1
- package/dist/server/Daemon.js +25 -23
- package/dist/server/Daemon.js.map +1 -1
- package/dist/server/drain.sql +2 -2
- package/dist/server/envelope.d.ts +0 -2
- package/dist/server/envelope.d.ts.map +1 -1
- package/dist/server/envelope.js.map +1 -1
- package/dist/server/envelope.sql +2 -2
- package/dist/server/lifecycle-recovery.sql +25 -15
- package/dist/server/logEntry.d.ts +1 -0
- package/dist/server/logEntry.d.ts.map +1 -1
- package/dist/server/logEntry.js +13 -1
- package/dist/server/logEntry.js.map +1 -1
- package/dist/server/logEntry.sql +5 -1
- package/migrations/001_schema.sql +603 -207
- package/package.json +39 -34
- package/dist/core/BudgetOverflow.d.ts +0 -20
- package/dist/core/BudgetOverflow.d.ts.map +0 -1
- package/dist/core/BudgetOverflow.js +0 -49
- package/dist/core/BudgetOverflow.js.map +0 -1
- package/dist/core/caps/DbTagCaps.d.ts +0 -10
- package/dist/core/caps/DbTagCaps.d.ts.map +0 -1
- package/dist/core/caps/DbTagCaps.js +0 -46
- package/dist/core/caps/DbTagCaps.js.map +0 -1
package/dist/core/Engine.sql
CHANGED
|
@@ -5,7 +5,7 @@ SELECT status FROM loops WHERE id = $loop_id;
|
|
|
5
5
|
|
|
6
6
|
-- PREP: engine_worker_has_live_child
|
|
7
7
|
-- A non-terminal child worker (worker:// spawn/fork set parent_worker_id) — a "live thing the worker holds",
|
|
8
|
-
-- like an open stream. A SEND
|
|
8
|
+
-- like an open stream. A SEND signal 200 while one exists is a premature-terminate ({§send-premature-terminate}).
|
|
9
9
|
-- Live = a child whose LATEST loop is still pending/running/parked (100/102/202) — the SAME definition
|
|
10
10
|
-- engine_child_workers_live uses for the Active Child Workers orientation, so the 409 gate and the section the model
|
|
11
11
|
-- reads NEVER disagree: a refused termination is always backed by a child the model can SEE and KILL
|
|
@@ -67,6 +67,7 @@ LIMIT 1;
|
|
|
67
67
|
-- {§entry-owner} — one principal's entries (catalogRowsFor source for an owner-scoped FIND/foist):
|
|
68
68
|
-- the commons, a worker's own space, or a named space — exactly one owner's rows, its perspective.
|
|
69
69
|
SELECT e.id AS entry_id, e.scheme, e.pathname, ec.name AS channel, ec.content, ec.mimetype, ec.tokens AS tokens, e.deep_hash,
|
|
70
|
+
d.parse_issues,
|
|
70
71
|
s.id AS subscription_id,
|
|
71
72
|
CASE WHEN s.closed_at IS NULL
|
|
72
73
|
THEN CAST(unixepoch('now') - unixepoch(s.opened_at) AS INTEGER)
|
|
@@ -75,6 +76,7 @@ SELECT e.id AS entry_id, e.scheme, e.pathname, ec.name AS channel, ec.content, e
|
|
|
75
76
|
s.close_status
|
|
76
77
|
FROM entries e
|
|
77
78
|
JOIN entry_channels ec ON ec.entry_id = e.id
|
|
79
|
+
LEFT JOIN derivations d ON d.deep_hash = e.deep_hash
|
|
78
80
|
LEFT JOIN subscriptions s ON s.id = (
|
|
79
81
|
SELECT latest.id
|
|
80
82
|
FROM subscriptions latest
|
|
@@ -85,43 +87,28 @@ LEFT JOIN subscriptions s ON s.id = (
|
|
|
85
87
|
WHERE e.workspace_id = $workspace_id AND e.owner_id = $owner_id
|
|
86
88
|
ORDER BY e.updated_at ASC, e.id ASC, ec.name;
|
|
87
89
|
|
|
88
|
-
-- PREP: engine_list_owner_entry_tags
|
|
89
|
-
-- {§entry-owner} — (entry, tag) for one principal's entries (the owner-scoped catalog's tags field).
|
|
90
|
-
SELECT et.entry_id, et.tag
|
|
91
|
-
FROM entry_tags et
|
|
92
|
-
JOIN entries e ON e.id = et.entry_id
|
|
93
|
-
WHERE e.workspace_id = $workspace_id AND e.owner_id = $owner_id
|
|
94
|
-
ORDER BY et.entry_id, et.tag;
|
|
95
|
-
|
|
96
90
|
-- PREP: engine_next_turn_sequence
|
|
97
91
|
SELECT COALESCE(MAX(sequence), 0) + 1 AS next FROM turns WHERE loop_id = $loop_id;
|
|
98
92
|
|
|
99
93
|
-- PREP: engine_loop_usage
|
|
100
|
-
--
|
|
101
|
-
--
|
|
102
|
-
--
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
SELECT json_group_array(json(cost.value))
|
|
110
|
-
FROM turns charged, json_each(charged.usage_cost) AS cost
|
|
111
|
-
WHERE charged.loop_id = $loop_id
|
|
112
|
-
), '[]') AS costs,
|
|
113
|
-
(
|
|
114
|
-
SELECT a.usage_prompt
|
|
115
|
-
FROM turn_attempts a
|
|
116
|
-
WHERE a.turn_id = (
|
|
94
|
+
-- Latest-turn gauge ({§tokenomics-client-gauge}), surfaced beside the derived
|
|
95
|
+
-- accounting projection on {§notifications-loop-terminated}. `context` is the
|
|
96
|
+
-- latest settled physical request on the latest turn; an absent input count is
|
|
97
|
+
-- unknown and does not fall back to older evidence.
|
|
98
|
+
SELECT (
|
|
99
|
+
SELECT pr.usage_input
|
|
100
|
+
FROM provider_requests pr
|
|
101
|
+
JOIN model_calls mc ON mc.id = pr.model_call_id
|
|
102
|
+
WHERE mc.turn_id = (
|
|
117
103
|
SELECT latest.id
|
|
118
104
|
FROM turns latest
|
|
119
105
|
WHERE latest.loop_id = $loop_id
|
|
120
106
|
ORDER BY latest.sequence DESC
|
|
121
107
|
LIMIT 1
|
|
122
108
|
)
|
|
123
|
-
AND
|
|
124
|
-
|
|
109
|
+
AND mc.kind = 'emission'
|
|
110
|
+
AND pr.state = 'settled'
|
|
111
|
+
ORDER BY mc.sequence DESC, pr.sequence DESC
|
|
125
112
|
LIMIT 1
|
|
126
113
|
) AS context,
|
|
127
114
|
-- Latest turn's effective packet allowance; NULL when uncapped or unknown.
|
|
@@ -129,7 +116,23 @@ SELECT COALESCE(SUM(usage_prompt), 0) AS prompt,
|
|
|
129
116
|
(SELECT usage_prompt_budget FROM turns WHERE loop_id = $loop_id ORDER BY sequence DESC LIMIT 1) AS context_size,
|
|
130
117
|
-- Latest turn's opaque provider metadata. {§meta-passthrough}
|
|
131
118
|
(SELECT meta FROM turns WHERE loop_id = $loop_id ORDER BY sequence DESC LIMIT 1) AS meta
|
|
132
|
-
FROM
|
|
119
|
+
FROM loops
|
|
120
|
+
WHERE id = $loop_id;
|
|
121
|
+
|
|
122
|
+
-- PREP: engine_loop_provider_requests
|
|
123
|
+
-- Ordered cardinal accounting evidence. Aggregation belongs to the shared
|
|
124
|
+
-- provider accounting contract, not SQLite arithmetic or denormalized rows.
|
|
125
|
+
SELECT pr.provider, pr.model, pr.outcome, pr.status,
|
|
126
|
+
pr.usage_input, pr.usage_output, pr.usage_total,
|
|
127
|
+
pr.usage_input_no_cache, pr.usage_input_cache_read, pr.usage_input_cache_write,
|
|
128
|
+
pr.usage_output_text, pr.usage_output_reasoning,
|
|
129
|
+
pr.cost_kind, pr.cost_amount, pr.cost_currency, pr.cost_usd_equivalent,
|
|
130
|
+
pr.cost_source, pr.cost_reason
|
|
131
|
+
FROM provider_requests pr
|
|
132
|
+
JOIN model_calls mc ON mc.id = pr.model_call_id
|
|
133
|
+
JOIN turns t ON t.id = mc.turn_id
|
|
134
|
+
WHERE t.loop_id = $loop_id AND pr.state = 'settled'
|
|
135
|
+
ORDER BY t.sequence, mc.sequence, pr.sequence;
|
|
133
136
|
|
|
134
137
|
-- PREP: engine_loop_attributions
|
|
135
138
|
-- {§attribution} — derive the loop projection from exact response-attempt
|
|
@@ -142,9 +145,9 @@ FROM (
|
|
|
142
145
|
WHERE t.loop_id = $loop_id
|
|
143
146
|
UNION
|
|
144
147
|
SELECT value AS attribution
|
|
145
|
-
FROM
|
|
146
|
-
JOIN turns t ON t.id =
|
|
147
|
-
json_each(
|
|
148
|
+
FROM model_calls mc
|
|
149
|
+
JOIN turns t ON t.id = mc.turn_id,
|
|
150
|
+
json_each(mc.attributions)
|
|
148
151
|
WHERE t.loop_id = $loop_id
|
|
149
152
|
)
|
|
150
153
|
ORDER BY attribution;
|
|
@@ -180,48 +183,67 @@ UPDATE turns SET
|
|
|
180
183
|
meta = $meta
|
|
181
184
|
WHERE id = $id;
|
|
182
185
|
|
|
183
|
-
-- PREP:
|
|
184
|
-
--
|
|
185
|
-
INSERT INTO
|
|
186
|
-
VALUES ($turn_id, $sequence, $attributions, $model)
|
|
186
|
+
-- PREP: engine_open_model_call
|
|
187
|
+
-- Logical identity and request attribution become durable before provider I/O.
|
|
188
|
+
INSERT INTO model_calls (turn_id, sequence, kind, attributions, model)
|
|
189
|
+
VALUES ($turn_id, $sequence, $kind, $attributions, $model)
|
|
187
190
|
RETURNING id;
|
|
188
191
|
|
|
189
|
-
-- PREP:
|
|
190
|
-
-- Preserve the response
|
|
191
|
-
--
|
|
192
|
-
UPDATE
|
|
192
|
+
-- PREP: engine_observe_model_call_response
|
|
193
|
+
-- Preserve the logical response before call-specific interpretation. Physical
|
|
194
|
+
-- request accounting has already settled through its cardinal observer path.
|
|
195
|
+
UPDATE model_calls SET
|
|
193
196
|
state = 'response',
|
|
194
197
|
response = $response,
|
|
195
|
-
|
|
196
|
-
usage_completion = $usage_completion,
|
|
197
|
-
usage_reasoning = $usage_reasoning,
|
|
198
|
-
usage_cached = $usage_cached,
|
|
199
|
-
usage_cost = $usage_cost,
|
|
200
|
-
usage_cost_usd = NULL,
|
|
198
|
+
failure = $failure,
|
|
201
199
|
finish_reason = $finish_reason,
|
|
202
200
|
model = $model,
|
|
203
201
|
completed_at = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
|
|
204
202
|
WHERE id = $id AND state = 'pending';
|
|
205
203
|
|
|
204
|
+
-- PREP: engine_fail_model_call
|
|
205
|
+
UPDATE model_calls SET
|
|
206
|
+
state = 'error',
|
|
207
|
+
failure = $failure,
|
|
208
|
+
completed_at = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
|
|
209
|
+
WHERE id = $id AND state = 'pending';
|
|
210
|
+
|
|
211
|
+
-- PREP: engine_open_turn_attempt
|
|
212
|
+
INSERT INTO turn_attempts (model_call_id)
|
|
213
|
+
VALUES ($model_call_id)
|
|
214
|
+
RETURNING id;
|
|
215
|
+
|
|
206
216
|
-- PREP: engine_classify_turn_attempt_response
|
|
207
217
|
UPDATE turn_attempts SET
|
|
208
218
|
accepted = $accepted,
|
|
209
|
-
parse_errors = $parse_errors
|
|
210
|
-
|
|
211
|
-
usage_cost = $usage_cost,
|
|
212
|
-
usage_cost_usd = $usage_cost_usd
|
|
213
|
-
WHERE id = $id AND state = 'response';
|
|
219
|
+
parse_errors = $parse_errors
|
|
220
|
+
WHERE id = $id AND accepted IS NULL;
|
|
214
221
|
|
|
215
|
-
-- PREP:
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
222
|
+
-- PREP: engine_open_provider_request
|
|
223
|
+
-- The provider calls this immediately before physical I/O.
|
|
224
|
+
INSERT INTO provider_requests (model_call_id, sequence, provider, model)
|
|
225
|
+
VALUES ($model_call_id, $sequence, $provider, $model)
|
|
226
|
+
RETURNING id;
|
|
227
|
+
|
|
228
|
+
-- PREP: engine_settle_provider_request
|
|
229
|
+
UPDATE provider_requests SET
|
|
230
|
+
state = 'settled',
|
|
231
|
+
outcome = $outcome,
|
|
232
|
+
status = $status,
|
|
233
|
+
usage_input = $usage_input,
|
|
234
|
+
usage_output = $usage_output,
|
|
235
|
+
usage_total = $usage_total,
|
|
236
|
+
usage_input_no_cache = $usage_input_no_cache,
|
|
237
|
+
usage_input_cache_read = $usage_input_cache_read,
|
|
238
|
+
usage_input_cache_write = $usage_input_cache_write,
|
|
239
|
+
usage_output_text = $usage_output_text,
|
|
240
|
+
usage_output_reasoning = $usage_output_reasoning,
|
|
241
|
+
cost_kind = $cost_kind,
|
|
242
|
+
cost_amount = $cost_amount,
|
|
243
|
+
cost_currency = $cost_currency,
|
|
244
|
+
cost_usd_equivalent = $cost_usd_equivalent,
|
|
245
|
+
cost_source = $cost_source,
|
|
246
|
+
cost_reason = $cost_reason,
|
|
225
247
|
completed_at = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
|
|
226
248
|
WHERE id = $id AND state = 'pending';
|
|
227
249
|
|
|
@@ -299,7 +321,7 @@ WITH observation AS (
|
|
|
299
321
|
SELECT o.cursor, o.boundary,
|
|
300
322
|
ae.id AS event_id, ae.producer_worker_id, producer.name AS producer_worker_name,
|
|
301
323
|
ae.kind, ae.source,
|
|
302
|
-
ae.op, ae.scheme, ae.hostname, ae.pathname, ae.rx, ae.attrs,
|
|
324
|
+
ae.op, ae.scheme, ae.hostname, ae.pathname, ae.rx, ae.attrs, ae.tags,
|
|
303
325
|
ae.status_rx, ae.terminated_by
|
|
304
326
|
FROM observation o
|
|
305
327
|
LEFT JOIN ambient_events ae
|
|
@@ -326,6 +348,11 @@ INSERT INTO log_entries (
|
|
|
326
348
|
ON CONFLICT(worker_id, ambient_event_id) WHERE ambient_event_id IS NOT NULL DO NOTHING
|
|
327
349
|
RETURNING id;
|
|
328
350
|
|
|
351
|
+
-- PREP: engine_ambient_delta_id
|
|
352
|
+
-- Crash replay may find the observation row already inserted but its copied
|
|
353
|
+
-- classifications incomplete. Resolve that row so idempotent tag writes can finish.
|
|
354
|
+
SELECT id FROM log_entries WHERE worker_id = $worker_id AND ambient_event_id = $event_id;
|
|
355
|
+
|
|
329
356
|
-- PREP: engine_advance_ambient_cursor
|
|
330
357
|
-- Advance only from the snapshot that was actually materialized. A concurrent
|
|
331
358
|
-- pull winning the CAS is safe; a loser replays idempotently on its next turn.
|
|
@@ -367,16 +394,13 @@ ORDER BY id DESC LIMIT 1;
|
|
|
367
394
|
-- the channel; attrs.streamEnd is the next turn's cursor; expanded=1 for a terminal
|
|
368
395
|
-- observation, 0 for an ongoing observation. {§exec-stream}
|
|
369
396
|
INSERT INTO log_entries (
|
|
370
|
-
worker_id, loop_id, turn_id, sequence, origin, source,
|
|
397
|
+
worker_id, loop_id, turn_id, sequence, origin, source, model_call_id,
|
|
371
398
|
op, scheme, pathname, fragment, tx, mimetype_tx, rx, mimetype_rx, status_rx, attrs, expanded
|
|
372
399
|
) VALUES (
|
|
373
|
-
$worker_id, $loop_id, $turn_id, $sequence, 'plurnk', NULL,
|
|
400
|
+
$worker_id, $loop_id, $turn_id, $sequence, 'plurnk', NULL, NULL,
|
|
374
401
|
'READ', $scheme, $pathname, $fragment, '', 'text/plain', $rx, 'application/json', $status, $attrs, $expanded
|
|
375
402
|
);
|
|
376
403
|
|
|
377
|
-
-- PREP: engine_entry_tags
|
|
378
|
-
SELECT tag FROM entry_tags WHERE entry_id = $entry_id ORDER BY tag;
|
|
379
|
-
|
|
380
404
|
-- PREP: engine_child_workers_live
|
|
381
405
|
-- The worker's LIVE child workers — latest loop non-terminal (100 pending / 102 processing / 202 parked).
|
|
382
406
|
-- Powers the Active Child Workers orienting section ({§child-orientation}): terse `* <status> worker://<name>`
|
|
@@ -403,11 +427,10 @@ ORDER BY e.pathname;
|
|
|
403
427
|
-- LogCoordinate pointers, forcing the model to confront failures instead of letting
|
|
404
428
|
-- them rot in log:///. Window = the current turn AND the immediately-prior one
|
|
405
429
|
-- (>= current_turn_seq - 1): prior-turn for action failures the model just caused,
|
|
406
|
-
-- current-turn so a
|
|
407
|
-
-- pre-generate then re-derived) surfaces THIS turn rather than a turn late.
|
|
430
|
+
-- current-turn so a pre-generate engine error surfaces THIS turn rather than a turn late.
|
|
408
431
|
-- {§operation-result-uniform-error-channel}
|
|
409
432
|
SELECT
|
|
410
|
-
le.op, le.sequence, le.status_rx, le.rx, le.mimetype_rx,
|
|
433
|
+
le.origin, le.op, le.attrs, le.sequence, le.status_rx, le.rx, le.mimetype_rx,
|
|
411
434
|
le.scheme, le.pathname,
|
|
412
435
|
t.sequence AS turn_seq, l.sequence AS loop_seq
|
|
413
436
|
FROM log_entries le
|
|
@@ -422,21 +445,39 @@ ORDER BY t.sequence, le.sequence;
|
|
|
422
445
|
|
|
423
446
|
-- TX: engine_grinder_fold_newest_turn
|
|
424
447
|
-- {§grinder-layer1-rollback} — THE DOCTRINE: the log is the model's memory and the model ALONE
|
|
425
|
-
-- curates it (FOLD/KILL). The grinder
|
|
426
|
-
--
|
|
427
|
-
--
|
|
428
|
-
--
|
|
448
|
+
-- curates it (FOLD/KILL). The grinder rolls back only context introduced by the newest turn
|
|
449
|
+
-- boundary: rows born in the immediately-prior/current turn plus exact older rows that a successful
|
|
450
|
+
-- OPEN in the immediately-prior turn transitioned from folded to open. The durable effect relation
|
|
451
|
+
-- owns that landed set; never re-run an authored glob/tag/matcher against later state. An OPEN no-op
|
|
452
|
+
-- contributes no older row. Turn 1 is the same rule (no prior turn; its foists are the newest).
|
|
429
453
|
-- Folded, never deleted; THREE exemptions ({§grinder-errors-exempt}): op='error',
|
|
430
454
|
-- the user prompt, and PLAN. The temporary set captures the
|
|
431
455
|
-- selection once so folding and additive `overflow` tagging cannot diverge.
|
|
432
456
|
CREATE TEMP TABLE IF NOT EXISTS engine_grinder_fold_set (id INTEGER PRIMARY KEY);
|
|
433
457
|
DELETE FROM engine_grinder_fold_set;
|
|
458
|
+
WITH previous_turn AS (
|
|
459
|
+
SELECT MAX(id) AS id FROM turns WHERE loop_id = $loop_id AND id < $turn_id
|
|
460
|
+
)
|
|
434
461
|
INSERT INTO engine_grinder_fold_set (id)
|
|
435
|
-
SELECT id
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
AND
|
|
439
|
-
|
|
462
|
+
SELECT boundary.id
|
|
463
|
+
FROM log_entries boundary
|
|
464
|
+
WHERE boundary.loop_id = $loop_id
|
|
465
|
+
AND boundary.expanded = 1
|
|
466
|
+
AND COALESCE(boundary.op, '') NOT IN ('error', 'PLAN')
|
|
467
|
+
AND COALESCE(boundary.scheme, '') != 'prompt' -- the task frame ({§prompt-self-only}); NULL-safe: a model-emission row's scheme is NULL
|
|
468
|
+
AND (boundary.turn_id = $turn_id OR boundary.turn_id = (SELECT id FROM previous_turn))
|
|
469
|
+
UNION
|
|
470
|
+
SELECT target.id
|
|
471
|
+
FROM log_curation_effects effect
|
|
472
|
+
JOIN log_entries operation ON operation.id = effect.operation_log_entry_id
|
|
473
|
+
JOIN log_entries target ON target.id = effect.target_log_entry_id
|
|
474
|
+
WHERE operation.turn_id = (SELECT id FROM previous_turn)
|
|
475
|
+
AND operation.op = 'OPEN'
|
|
476
|
+
AND operation.status_rx < 400
|
|
477
|
+
AND effect.expanded_before = 0
|
|
478
|
+
AND target.expanded = 1
|
|
479
|
+
AND COALESCE(target.op, '') NOT IN ('error', 'PLAN')
|
|
480
|
+
AND COALESCE(target.scheme, '') != 'prompt';
|
|
440
481
|
|
|
441
482
|
UPDATE log_entries SET expanded = 0
|
|
442
483
|
WHERE id IN (SELECT id FROM engine_grinder_fold_set);
|
|
@@ -472,7 +513,13 @@ SELECT
|
|
|
472
513
|
le.query, le.fragment,
|
|
473
514
|
le.status_rx, le.rx, le.mimetype_rx,
|
|
474
515
|
le.tx, le.mimetype_tx,
|
|
475
|
-
le.state, le.outcome, le.expanded, le.source, le.attrs
|
|
516
|
+
le.state, le.outcome, le.expanded, le.source, le.attrs,
|
|
517
|
+
COALESCE((
|
|
518
|
+
SELECT json_group_array(ordered.tag)
|
|
519
|
+
FROM (
|
|
520
|
+
SELECT tag FROM log_tags WHERE log_entry_id = le.id ORDER BY tag
|
|
521
|
+
) ordered
|
|
522
|
+
), '[]') AS tags
|
|
476
523
|
FROM log_entries le
|
|
477
524
|
JOIN turns t ON t.id = le.turn_id
|
|
478
525
|
JOIN loops l ON l.id = le.loop_id
|
|
@@ -494,14 +541,14 @@ ORDER BY l.sequence, t.sequence, le.sequence;
|
|
|
494
541
|
-- triggers the proposal lifecycle (engine pauses dispatch; client resolves
|
|
495
542
|
-- via proposal resolution; entry transitions through engine_resolve_log_entry).
|
|
496
543
|
INSERT INTO log_entries (
|
|
497
|
-
worker_id, loop_id, turn_id, sequence, origin, source,
|
|
544
|
+
worker_id, loop_id, turn_id, sequence, origin, source, model_call_id,
|
|
498
545
|
op, suffix, signal,
|
|
499
546
|
scheme, username, password, hostname, port,
|
|
500
547
|
pathname, query, fragment, lineMarker,
|
|
501
548
|
tx, mimetype_tx, rx, mimetype_rx, status_rx, tokens,
|
|
502
549
|
state, outcome, attrs
|
|
503
550
|
) VALUES (
|
|
504
|
-
$worker_id, $loop_id, $turn_id, $sequence, $origin, $source,
|
|
551
|
+
$worker_id, $loop_id, $turn_id, $sequence, $origin, $source, $model_call_id,
|
|
505
552
|
$op, $suffix, $signal,
|
|
506
553
|
$scheme, $username, $password, $hostname, $port,
|
|
507
554
|
$pathname, $query, $fragment, $lineMarker,
|
|
@@ -536,12 +583,15 @@ SELECT l.sequence AS loop_seq,
|
|
|
536
583
|
JOIN loops l ON l.id = le.loop_id
|
|
537
584
|
WHERE le.id = $id;
|
|
538
585
|
|
|
539
|
-
-- PREP:
|
|
540
|
-
-- {§send-premature-terminate} —
|
|
541
|
-
--
|
|
542
|
-
--
|
|
543
|
-
|
|
544
|
-
|
|
586
|
+
-- PREP: engine_turn_packet_boundaries
|
|
587
|
+
-- {§send-premature-terminate}/{§wait-obligation-matrix} — operations whose useful effect crosses
|
|
588
|
+
-- into the next packet: READ/FIND/OPEN/BARE results, plus successful FOLD context curation. Retrievals
|
|
589
|
+
-- block an explicit [200]; FOLD blocks only the empty-[202] inference because explicit final
|
|
590
|
+
-- housekeeping remains valid.
|
|
591
|
+
SELECT id, op FROM log_entries
|
|
592
|
+
WHERE turn_id = $turn_id
|
|
593
|
+
AND origin = 'model'
|
|
594
|
+
AND (op IN ('READ', 'FIND', 'OPEN', 'BARE') OR (op = 'FOLD' AND status_rx < 400));
|
|
545
595
|
|
|
546
596
|
-- PREP: engine_worker_has_undelivered_stream_term
|
|
547
597
|
-- A stream may finish between its EXEC and a same-turn SEND. It is then no longer
|
|
@@ -571,8 +621,8 @@ LIMIT 1;
|
|
|
571
621
|
-- errors the model cannot have seen (they land next packet). A [200] or already-drained [202] over
|
|
572
622
|
-- them concludes blind past a failure — refused 409; [499] abandons regardless (declaring failure
|
|
573
623
|
-- IS weighing it).
|
|
574
|
-
-- Actionless engine errors are excluded
|
|
575
|
-
--
|
|
624
|
+
-- Actionless engine errors are excluded because only model-authored failures can make
|
|
625
|
+
-- the model's concluding disposition blind. A model-authored statement that
|
|
576
626
|
-- failed grammar parsing is different: source='grammar' records a bounded operation failure
|
|
577
627
|
-- from the accepted emission, unseen until the next packet, so it gates completion like every
|
|
578
628
|
-- other failed model operation.
|
|
@@ -606,6 +656,22 @@ WITH RECURSIVE lineage(id, parent_worker_id) AS (
|
|
|
606
656
|
)
|
|
607
657
|
SELECT id FROM lineage WHERE parent_worker_id IS NULL;
|
|
608
658
|
|
|
659
|
+
-- PREP: engine_worker_provider_identity
|
|
660
|
+
-- Provider routing uses globally unique opaque identities, while all relational
|
|
661
|
+
-- ownership and client coordinates retain the local integer worker id.
|
|
662
|
+
-- {§worker-provider-identity} {§worker-primary}
|
|
663
|
+
WITH RECURSIVE lineage(id, parent_worker_id, provider_identity) AS (
|
|
664
|
+
SELECT id, parent_worker_id, provider_identity FROM workers WHERE id = $worker_id
|
|
665
|
+
UNION ALL
|
|
666
|
+
SELECT w.id, w.parent_worker_id, w.provider_identity
|
|
667
|
+
FROM workers w JOIN lineage l ON w.id = l.parent_worker_id
|
|
668
|
+
)
|
|
669
|
+
SELECT current.provider_identity AS worker_id,
|
|
670
|
+
root.provider_identity AS primary_worker_id
|
|
671
|
+
FROM workers current
|
|
672
|
+
JOIN lineage root ON root.parent_worker_id IS NULL
|
|
673
|
+
WHERE current.id = $worker_id;
|
|
674
|
+
|
|
609
675
|
-- PREP: engine_worker_has_undelivered_child_term
|
|
610
676
|
-- A child conclusion newer than the parent's observation cursor is complete but
|
|
611
677
|
-- not delivered. This is the same durable boundary the next packet consumes,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RuntimeInvocationDecl } from "@plurnk/plurnk-execs";
|
|
2
|
+
interface ExecutableTool {
|
|
3
|
+
readonly runtime: string;
|
|
4
|
+
readonly invocation: RuntimeInvocationDecl;
|
|
5
|
+
}
|
|
6
|
+
export default class ExecutableTools {
|
|
7
|
+
static render(tools: readonly ExecutableTool[]): string;
|
|
8
|
+
}
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=ExecutableTools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExecutableTools.d.ts","sourceRoot":"","sources":["../../src/core/ExecutableTools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAElE,UAAU,cAAc;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,qBAAqB,CAAC;CAC9C;AAqBD,MAAM,CAAC,OAAO,OAAO,eAAe;IAChC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,GAAG,MAAM,CAyBtD;CACJ"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const escapeCell = (value) => value.replaceAll("|", "\\|");
|
|
2
|
+
const bucket = (role, required, exclusive) => {
|
|
3
|
+
const marker = exclusive ? " ↔" : required ? "" : " ?";
|
|
4
|
+
return `${escapeCell(role)}${marker}`;
|
|
5
|
+
};
|
|
6
|
+
const code = (value) => {
|
|
7
|
+
const longest = Math.max(0, ...[...value.matchAll(/`+/g)].map((match) => match[0].length));
|
|
8
|
+
const fence = "`".repeat(longest + 1);
|
|
9
|
+
const padding = value.startsWith("`") || value.endsWith("`") ? " " : "";
|
|
10
|
+
return `${fence}${padding}${escapeCell(value)}${padding}${fence}`;
|
|
11
|
+
};
|
|
12
|
+
const example = (runtime, invocation) => {
|
|
13
|
+
const heading = `## EXEC0 [${runtime}]${invocation.example.target === undefined ? "" : ` (${invocation.example.target})`}`;
|
|
14
|
+
return [heading, invocation.example.body].filter((line) => line !== undefined).map((line) => code(line)).join("<br>");
|
|
15
|
+
};
|
|
16
|
+
export default class ExecutableTools {
|
|
17
|
+
static render(tools) {
|
|
18
|
+
if (tools.length === 0)
|
|
19
|
+
return "";
|
|
20
|
+
const rows = tools
|
|
21
|
+
.toSorted((left, right) => left.runtime.localeCompare(right.runtime))
|
|
22
|
+
.map(({ runtime, invocation }) => {
|
|
23
|
+
const exclusive = invocation.exclusive === true;
|
|
24
|
+
const target = invocation.target === undefined
|
|
25
|
+
? "—"
|
|
26
|
+
: bucket(`${invocation.target.role}${invocation.target.directory === "cwd" ? " or local directory with body" : ""}`, invocation.target.required, exclusive);
|
|
27
|
+
const body = bucket(invocation.body.role, invocation.body.required, exclusive);
|
|
28
|
+
return `| \`[${runtime}]\` | ${target} | ${body} | ${example(runtime, invocation)} |`;
|
|
29
|
+
});
|
|
30
|
+
return [
|
|
31
|
+
"YOU SHOULD use purpose-built Plurnk OPs when possible; use EXEC for scripts only when necessary.",
|
|
32
|
+
"",
|
|
33
|
+
"`?` optional · `↔` choose one · `—` unavailable · `<timeout,poll>` optional",
|
|
34
|
+
"",
|
|
35
|
+
"| `[executor]` | `(target)` | body | example |",
|
|
36
|
+
"| --- | --- | --- | --- |",
|
|
37
|
+
...rows,
|
|
38
|
+
].join("\n");
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=ExecutableTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExecutableTools.js","sourceRoot":"","sources":["../../src/core/ExecutableTools.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,EA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OAAO;YACH,kGAAkG;YAClG,EAAE;YACF,6EAA6E;YAC7E,EAAE;YACF,gDAAgD;YAChD,2BAA2B;YAC3B,GAAG,IAAI;SACV,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;CACJ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChannelDecl, ExecArgs, ExecResult, Effect, RuntimeAvailability } from "@plurnk/plurnk-execs";
|
|
1
|
+
import type { ChannelDecl, ExecArgs, ExecResult, Effect, RuntimeAvailability, RuntimeInvocationDecl } from "@plurnk/plurnk-execs";
|
|
2
2
|
import { type PackageAttributions, type PluginAttribution, type PluginAttributionContext } from "@plurnk/plurnk-meta";
|
|
3
3
|
import type { SchemeManifest } from "./types.ts";
|
|
4
4
|
export interface Executor {
|
|
@@ -22,7 +22,7 @@ export interface RegistryEntry {
|
|
|
22
22
|
readonly executor: Executor;
|
|
23
23
|
readonly namespaceOwner: RuntimeNamespaceOwner;
|
|
24
24
|
readonly glyph: string;
|
|
25
|
-
readonly
|
|
25
|
+
readonly invocation: RuntimeInvocationDecl;
|
|
26
26
|
readonly documentation: string;
|
|
27
27
|
readonly available: boolean;
|
|
28
28
|
readonly detail: string | undefined;
|
|
@@ -41,7 +41,7 @@ export default class ExecutorRegistry {
|
|
|
41
41
|
registry: ReadonlyMap<string, {
|
|
42
42
|
runtime: string;
|
|
43
43
|
glyph: string;
|
|
44
|
-
|
|
44
|
+
invocation: RuntimeInvocationDecl;
|
|
45
45
|
documentation?: string;
|
|
46
46
|
packageName: string;
|
|
47
47
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExecutorRegistry.d.ts","sourceRoot":"","sources":["../../src/core/ExecutorRegistry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ExecutorRegistry.d.ts","sourceRoot":"","sources":["../../src/core/ExecutorRegistry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACR,WAAW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GAAG,aAAa,GAAG,SAAS,CAE5C;IAKD,iBAAiB,IAAI,SAAS,MAAM,EAAE,CAIrC;CACJ"}
|
|
@@ -76,7 +76,7 @@ export default class ExecutorRegistry {
|
|
|
76
76
|
}
|
|
77
77
|
// {§operator-config-git-ceiling} PLURNK_SERVICE_GIT_ALLOWED=0 must drop every
|
|
78
78
|
// Git-capability executor entirely: a denied host neither dispatches
|
|
79
|
-
//
|
|
79
|
+
// the Git/isogit EXEC runtimes nor teaches them through the tools sheet.
|
|
80
80
|
const gitDenied = process.env.PLURNK_SERVICE_GIT_ALLOWED !== "1";
|
|
81
81
|
const gitRuntimes = new Set(["git", "isogit"]);
|
|
82
82
|
const infos = [...discovered.values()].filter((info) => !(gitDenied && gitRuntimes.has(info.runtime)));
|
|
@@ -95,7 +95,7 @@ export default class ExecutorRegistry {
|
|
|
95
95
|
executor,
|
|
96
96
|
namespaceOwner: { kind: "package", name: info.packageName },
|
|
97
97
|
glyph: info.glyph,
|
|
98
|
-
|
|
98
|
+
invocation: info.invocation,
|
|
99
99
|
documentation: info.documentation ?? "",
|
|
100
100
|
available: availability.available,
|
|
101
101
|
detail: availability.detail,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExecutorRegistry.js","sourceRoot":"","sources":["../../src/core/ExecutorRegistry.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"ExecutorRegistry.js","sourceRoot":"","sources":["../../src/core/ExecutorRegistry.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAUhD,OAAO,IAIN,MAAM,qBAAqB,CAAC;AAyC7B,yEAAyE;AACzE,4EAA4E;AAC5E,yEAAyE;AACzE,kEAAkE;AAClE,0EAA0E;AAC1E,8EAA8E;AAC9E,wEAAwE;AACxE,sFAAsF;AACtF,MAAM,CAAC,OAAO,OA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AC,GAAG,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM;YAAE,IAAI,KAAK,CAAC,SAAS;gBAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC5E,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;IACrE,CAAC;CACJ"}
|
package/dist/core/LogBody.d.ts
CHANGED
|
@@ -11,8 +11,10 @@ export interface ResolvedLogBody {
|
|
|
11
11
|
readonly mimetype: string;
|
|
12
12
|
readonly startLine: number | null;
|
|
13
13
|
}
|
|
14
|
+
export type ActionlessLogKind = "initialization" | "model_emission";
|
|
14
15
|
export default class LogBody {
|
|
15
16
|
#private;
|
|
17
|
+
static actionlessKind(row: Pick<LogBodyRow, "op" | "attrs">): ActionlessLogKind | null;
|
|
16
18
|
static resolve(row: LogBodyRow): ResolvedLogBody;
|
|
17
19
|
}
|
|
18
20
|
//# sourceMappingURL=LogBody.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogBody.d.ts","sourceRoot":"","sources":["../../src/core/LogBody.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,UAAU;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;
|
|
1
|
+
{"version":3,"file":"LogBody.d.ts","sourceRoot":"","sources":["../../src/core/LogBody.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,UAAU;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAYpE,MAAM,CAAC,OAAO,OAAO,OAAO;;IAqCxB,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,OAAO,CAAC,GAAG,iBAAiB,GAAG,IAAI,CAYrF;IAED,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,UAAU,GAAG,eAAe,CAuI/C;CACJ"}
|
package/dist/core/LogBody.js
CHANGED
|
@@ -6,7 +6,7 @@ const EMPTY_BODY = Object.freeze({
|
|
|
6
6
|
startLine: 1,
|
|
7
7
|
});
|
|
8
8
|
// The durable log row has one canonical body regardless of how it is consumed.
|
|
9
|
-
// Packet rendering projects this body, while READ
|
|
9
|
+
// Packet rendering projects this body, while log READ, log FIND, and
|
|
10
10
|
// search derivation consume it complete. Storage envelopes and tx/rx placement
|
|
11
11
|
// are persistence details and must not change what the row means.
|
|
12
12
|
export default class LogBody {
|
|
@@ -48,6 +48,20 @@ export default class LogBody {
|
|
|
48
48
|
startLine: null,
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
+
static actionlessKind(row) {
|
|
52
|
+
if (row.op !== null)
|
|
53
|
+
return null;
|
|
54
|
+
const attrs = typeof row.attrs === "string"
|
|
55
|
+
? LogBody.#decode(row.attrs, "application/json")
|
|
56
|
+
: row.attrs;
|
|
57
|
+
const kind = attrs !== null && typeof attrs === "object"
|
|
58
|
+
? attrs.kind
|
|
59
|
+
: undefined;
|
|
60
|
+
if (kind !== "initialization" && kind !== "model_emission") {
|
|
61
|
+
throw new TypeError("An actionless log body must carry attrs.kind=initialization or attrs.kind=model_emission.");
|
|
62
|
+
}
|
|
63
|
+
return kind;
|
|
64
|
+
}
|
|
51
65
|
static resolve(row) {
|
|
52
66
|
const attrs = typeof row.attrs === "string"
|
|
53
67
|
? LogBody.#decode(row.attrs, "application/json")
|
|
@@ -56,12 +70,10 @@ export default class LogBody {
|
|
|
56
70
|
const rx = LogBody.#decode(row.rx, row.mimetypeRx);
|
|
57
71
|
const contentBody = LogBody.#contentBody(rx, row.mimetypeRx);
|
|
58
72
|
if (row.op === null) {
|
|
59
|
-
|
|
60
|
-
throw new TypeError("An actionless log body must carry attrs.kind=model_emission.");
|
|
61
|
-
}
|
|
73
|
+
LogBody.actionlessKind({ op: row.op, attrs });
|
|
62
74
|
return contentBody ?? EMPTY_BODY;
|
|
63
75
|
}
|
|
64
|
-
if (row.op === "READ" || row.op === "FIND" || row.op === "prompt") {
|
|
76
|
+
if (row.op === "READ" || row.op === "FIND" || row.op === "BARE" || row.op === "prompt") {
|
|
65
77
|
return contentBody ?? EMPTY_BODY;
|
|
66
78
|
}
|
|
67
79
|
if (row.op === "EDIT") {
|