deepline 0.3.72 → 0.3.74
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/bundling-sources/sdk/src/monitor-fleet-contract.ts +1 -1
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/monitors/monitor-fleet-limits.ts +5 -3
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +617 -623
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +10 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +40 -10
- package/dist/bundling-sources/shared_libs/play-runtime/play-artifact-runtime-contract.ts +62 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts +122 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-call/index.ts +2 -14
- package/dist/bundling-sources/shared_libs/play-runtime/tool-call/native-batch.ts +9 -92
- package/dist/bundling-sources/shared_libs/play-runtime/tool-call/receipt-cohort.ts +159 -621
- package/dist/bundling-sources/shared_libs/play-runtime/tool-call/runtime-step-receipts-adapter.ts +19 -13
- package/dist/bundling-sources/shared_libs/plays/contracts.ts +1 -4
- package/dist/bundling-sources/shared_libs/plays/tool-response-contract.ts +2 -4
- package/dist/cli/index.js +2 -2
- package/dist/cli/index.mjs +2 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/install-integrity.json +2 -0
- package/package.json +1 -1
package/dist/bundling-sources/shared_libs/play-runtime/tool-call/runtime-step-receipts-adapter.ts
CHANGED
|
@@ -48,6 +48,8 @@ export type RuntimeStepToolResultReceiptsInput = {
|
|
|
48
48
|
*/
|
|
49
49
|
executionLock?: {
|
|
50
50
|
required?: boolean;
|
|
51
|
+
/** Provider-operation identity; defaults to the result-cache receipt. */
|
|
52
|
+
key?: string;
|
|
51
53
|
ttlMs?: number;
|
|
52
54
|
waitMs?: number;
|
|
53
55
|
pollMs?: number;
|
|
@@ -88,6 +90,7 @@ type OwnedReceipt = {
|
|
|
88
90
|
ownerRunId: string;
|
|
89
91
|
force: boolean;
|
|
90
92
|
executionLockOwnerId: string | null;
|
|
93
|
+
executionLockKey: string | null;
|
|
91
94
|
lockLost: boolean;
|
|
92
95
|
completedByAnotherOwner: ToolExecuteResult | null;
|
|
93
96
|
heartbeatTimer: ReturnType<typeof setTimeout> | null;
|
|
@@ -99,9 +102,9 @@ type OwnedReceipt = {
|
|
|
99
102
|
*
|
|
100
103
|
* Tool results deliberately use the store's immutable completed-cache mode:
|
|
101
104
|
* a cache hit is reused, execution does not publish a `running` row, and the
|
|
102
|
-
* winner inserts one serialized ToolExecuteResult.
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
+
* winner inserts one canonical serialized ToolExecuteResult. Response
|
|
106
|
+
* presentation is materialized after cache recovery; only actions that
|
|
107
|
+
* explicitly require an execution fence acquire the optional lock below.
|
|
105
108
|
*/
|
|
106
109
|
export function createRuntimeStepToolResultReceipts(
|
|
107
110
|
input: RuntimeStepToolResultReceiptsInput,
|
|
@@ -164,7 +167,7 @@ export function createRuntimeStepToolResultReceipts(
|
|
|
164
167
|
return;
|
|
165
168
|
}
|
|
166
169
|
await input.store.releaseExecutionLock({
|
|
167
|
-
receiptKey: record.resultReceiptKey,
|
|
170
|
+
receiptKey: record.executionLockKey ?? record.resultReceiptKey,
|
|
168
171
|
ownerExecutionId: record.executionLockOwnerId,
|
|
169
172
|
});
|
|
170
173
|
record.executionLockOwnerId = null;
|
|
@@ -177,7 +180,7 @@ export function createRuntimeStepToolResultReceipts(
|
|
|
177
180
|
return 'active';
|
|
178
181
|
}
|
|
179
182
|
const renewed = await input.store.acquireExecutionLock({
|
|
180
|
-
receiptKey: record.resultReceiptKey,
|
|
183
|
+
receiptKey: record.executionLockKey ?? record.resultReceiptKey,
|
|
181
184
|
ownerExecutionId: record.executionLockOwnerId,
|
|
182
185
|
ttlMs: lock.ttlMs,
|
|
183
186
|
});
|
|
@@ -238,7 +241,7 @@ export function createRuntimeStepToolResultReceipts(
|
|
|
238
241
|
const acquireExecutionLock = async (
|
|
239
242
|
resultReceiptKey: string,
|
|
240
243
|
force: boolean,
|
|
241
|
-
): Promise<string | null> => {
|
|
244
|
+
): Promise<{ ownerId: string; key: string } | null> => {
|
|
242
245
|
if (!lock.required || !input.store.enabled) return null;
|
|
243
246
|
if (
|
|
244
247
|
!input.store.acquireExecutionLock ||
|
|
@@ -249,11 +252,12 @@ export function createRuntimeStepToolResultReceipts(
|
|
|
249
252
|
);
|
|
250
253
|
}
|
|
251
254
|
|
|
255
|
+
const executionLockKey = lock.key || resultReceiptKey;
|
|
252
256
|
const ownerExecutionId = `tool-result:${crypto.randomUUID()}`;
|
|
253
257
|
const deadline = Date.now() + lock.waitMs;
|
|
254
258
|
while (true) {
|
|
255
259
|
const acquired = await input.store.acquireExecutionLock({
|
|
256
|
-
receiptKey:
|
|
260
|
+
receiptKey: executionLockKey,
|
|
257
261
|
ownerExecutionId,
|
|
258
262
|
ttlMs: lock.ttlMs,
|
|
259
263
|
});
|
|
@@ -265,13 +269,13 @@ export function createRuntimeStepToolResultReceipts(
|
|
|
265
269
|
const cached = await readCompleted(resultReceiptKey, 'in_flight');
|
|
266
270
|
if (cached) {
|
|
267
271
|
await input.store.releaseExecutionLock({
|
|
268
|
-
receiptKey:
|
|
272
|
+
receiptKey: executionLockKey,
|
|
269
273
|
ownerExecutionId,
|
|
270
274
|
});
|
|
271
275
|
return null;
|
|
272
276
|
}
|
|
273
277
|
}
|
|
274
|
-
return ownerExecutionId;
|
|
278
|
+
return { ownerId: ownerExecutionId, key: executionLockKey };
|
|
275
279
|
}
|
|
276
280
|
|
|
277
281
|
if (!force) {
|
|
@@ -299,11 +303,11 @@ export function createRuntimeStepToolResultReceipts(
|
|
|
299
303
|
if (cached) return { kind: 'completed', result: cached };
|
|
300
304
|
}
|
|
301
305
|
|
|
302
|
-
const
|
|
306
|
+
const executionLock = await acquireExecutionLock(
|
|
303
307
|
resultReceiptKey,
|
|
304
308
|
candidate.force,
|
|
305
309
|
);
|
|
306
|
-
if (input.store.enabled && !candidate.force && !
|
|
310
|
+
if (input.store.enabled && !candidate.force && !executionLock) {
|
|
307
311
|
const cached = await readCompleted(resultReceiptKey, 'cache');
|
|
308
312
|
if (cached) return { kind: 'completed', result: cached };
|
|
309
313
|
// The only non-lock reason to get here is a store without a lock
|
|
@@ -311,12 +315,13 @@ export function createRuntimeStepToolResultReceipts(
|
|
|
311
315
|
}
|
|
312
316
|
|
|
313
317
|
const leaseId =
|
|
314
|
-
|
|
318
|
+
executionLock?.ownerId ?? `tool-result:${crypto.randomUUID()}`;
|
|
315
319
|
owned.set(leaseId, {
|
|
316
320
|
resultReceiptKey,
|
|
317
321
|
ownerRunId,
|
|
318
322
|
force: candidate.force,
|
|
319
|
-
executionLockOwnerId,
|
|
323
|
+
executionLockOwnerId: executionLock?.ownerId ?? null,
|
|
324
|
+
executionLockKey: executionLock?.key ?? null,
|
|
320
325
|
lockLost: false,
|
|
321
326
|
completedByAnotherOwner: null,
|
|
322
327
|
heartbeatTimer: null,
|
|
@@ -505,6 +510,7 @@ function normalizeExecutionLock(
|
|
|
505
510
|
}
|
|
506
511
|
return {
|
|
507
512
|
required: input?.required === true,
|
|
513
|
+
key: input?.key?.trim() ?? '',
|
|
508
514
|
ttlMs: Math.floor(ttlMs),
|
|
509
515
|
waitMs: Math.floor(waitMs),
|
|
510
516
|
pollMs: Math.floor(pollMs),
|
|
@@ -50,10 +50,7 @@ export type PlayContractCompatibilitySnapshot = {
|
|
|
50
50
|
authoringContractEdition?: PlayAuthoringContractEdition;
|
|
51
51
|
/** Immutable execute-result transport selected when the artifact is built. */
|
|
52
52
|
toolResponseContract?: ToolResponseContract;
|
|
53
|
-
/**
|
|
54
|
-
* Deliberate receipt-cache boundary for a response transformation. Missing
|
|
55
|
-
* preserves the original namespace of artifacts written before this field.
|
|
56
|
-
*/
|
|
53
|
+
/** Legacy response metadata; it does not change completed-result caching. */
|
|
57
54
|
toolResponseReceiptRevision?: string;
|
|
58
55
|
};
|
|
59
56
|
|
|
@@ -10,9 +10,8 @@ export const V2_TOOL_RESPONSE_CONTRACT = 'v2-tool-response' as const;
|
|
|
10
10
|
export const RAW_V2_TOOL_RESPONSE_CONTRACT = 'raw-v2' as const;
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* bump for ordinary protocol, authoring, or transport contract changes.
|
|
13
|
+
* Legacy artifact compatibility metadata. It is carried through published
|
|
14
|
+
* artifacts but does not partition completed-result cache entries.
|
|
16
15
|
*/
|
|
17
16
|
export const RAW_V2_TOOL_RESPONSE_RECEIPT_REVISION = 'raw-v2-receipt-v1';
|
|
18
17
|
const TOOL_RESPONSE_RECEIPT_REVISION_PATTERN =
|
|
@@ -36,7 +35,6 @@ export function isToolResponseContract(
|
|
|
36
35
|
/**
|
|
37
36
|
* Preserves the distinction between an old artifact with no declared response
|
|
38
37
|
* contract and an artifact that explicitly selected the legacy V2 contract.
|
|
39
|
-
* Receipt reuse is controlled separately by `toolResponseReceiptRevision`.
|
|
40
38
|
*/
|
|
41
39
|
export function declaredToolResponseContract(
|
|
42
40
|
value: unknown,
|
package/dist/cli/index.js
CHANGED
|
@@ -1214,7 +1214,7 @@ var SDK_RELEASE = {
|
|
|
1214
1214
|
// available at toolResponse.rawV2 while toolResponse.raw and all declared
|
|
1215
1215
|
// getters keep their established compatibility behavior.
|
|
1216
1216
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
1217
|
-
version: "0.3.
|
|
1217
|
+
version: "0.3.74",
|
|
1218
1218
|
updateSummary: "Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.",
|
|
1219
1219
|
packageCapabilities: {
|
|
1220
1220
|
updatePreferences: 1
|
|
@@ -31595,7 +31595,7 @@ var MONITOR_FLEET_REMOVAL_GRACE_MS = 7 * 24 * 60 * 6e4;
|
|
|
31595
31595
|
var MONITOR_FLEET_DOCUMENTATION = {
|
|
31596
31596
|
summary: "A Monitor Fleet keeps one bounded, sticky set of ordinary monitors aligned with Customer DB rows.",
|
|
31597
31597
|
authoredFields: {
|
|
31598
|
-
id: "Stable lowercase fleet id used by sync,
|
|
31598
|
+
id: "Stable lowercase fleet id used by sync, get, and deactivate.",
|
|
31599
31599
|
source: "Customer DB table, unique row key, and optional equality filters that select candidate rows.",
|
|
31600
31600
|
member: "Ordinary monitor tool, stable key template, and payload evaluated for each selected source row.",
|
|
31601
31601
|
selection: "Deterministic ranking and an active-member limit between 1 and 1,000."
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1199,7 +1199,7 @@ var SDK_RELEASE = {
|
|
|
1199
1199
|
// available at toolResponse.rawV2 while toolResponse.raw and all declared
|
|
1200
1200
|
// getters keep their established compatibility behavior.
|
|
1201
1201
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
1202
|
-
version: "0.3.
|
|
1202
|
+
version: "0.3.74",
|
|
1203
1203
|
updateSummary: "Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.",
|
|
1204
1204
|
packageCapabilities: {
|
|
1205
1205
|
updatePreferences: 1
|
|
@@ -31664,7 +31664,7 @@ var MONITOR_FLEET_REMOVAL_GRACE_MS = 7 * 24 * 60 * 6e4;
|
|
|
31664
31664
|
var MONITOR_FLEET_DOCUMENTATION = {
|
|
31665
31665
|
summary: "A Monitor Fleet keeps one bounded, sticky set of ordinary monitors aligned with Customer DB rows.",
|
|
31666
31666
|
authoredFields: {
|
|
31667
|
-
id: "Stable lowercase fleet id used by sync,
|
|
31667
|
+
id: "Stable lowercase fleet id used by sync, get, and deactivate.",
|
|
31668
31668
|
source: "Customer DB table, unique row key, and optional equality filters that select candidate rows.",
|
|
31669
31669
|
member: "Ordinary monitor tool, stable key template, and payload evaluated for each selected source row.",
|
|
31670
31670
|
selection: "Deterministic ranking and an active-member limit between 1 and 1,000."
|
package/dist/index.d.mts
CHANGED
|
@@ -1956,7 +1956,7 @@ declare const MONITOR_FLEET_AUTHORING_CONTRACT_CHANGELOG: readonly [{
|
|
|
1956
1956
|
declare const MONITOR_FLEET_DOCUMENTATION: {
|
|
1957
1957
|
readonly summary: "A Monitor Fleet keeps one bounded, sticky set of ordinary monitors aligned with Customer DB rows.";
|
|
1958
1958
|
readonly authoredFields: {
|
|
1959
|
-
readonly id: "Stable lowercase fleet id used by sync,
|
|
1959
|
+
readonly id: "Stable lowercase fleet id used by sync, get, and deactivate.";
|
|
1960
1960
|
readonly source: "Customer DB table, unique row key, and optional equality filters that select candidate rows.";
|
|
1961
1961
|
readonly member: "Ordinary monitor tool, stable key template, and payload evaluated for each selected source row.";
|
|
1962
1962
|
readonly selection: "Deterministic ranking and an active-member limit between 1 and 1,000.";
|
package/dist/index.d.ts
CHANGED
|
@@ -1956,7 +1956,7 @@ declare const MONITOR_FLEET_AUTHORING_CONTRACT_CHANGELOG: readonly [{
|
|
|
1956
1956
|
declare const MONITOR_FLEET_DOCUMENTATION: {
|
|
1957
1957
|
readonly summary: "A Monitor Fleet keeps one bounded, sticky set of ordinary monitors aligned with Customer DB rows.";
|
|
1958
1958
|
readonly authoredFields: {
|
|
1959
|
-
readonly id: "Stable lowercase fleet id used by sync,
|
|
1959
|
+
readonly id: "Stable lowercase fleet id used by sync, get, and deactivate.";
|
|
1960
1960
|
readonly source: "Customer DB table, unique row key, and optional equality filters that select candidate rows.";
|
|
1961
1961
|
readonly member: "Ordinary monitor tool, stable key template, and payload evaluated for each selected source row.";
|
|
1962
1962
|
readonly selection: "Deterministic ranking and an active-member limit between 1 and 1,000.";
|
package/dist/index.js
CHANGED
|
@@ -832,7 +832,7 @@ var SDK_RELEASE = {
|
|
|
832
832
|
// available at toolResponse.rawV2 while toolResponse.raw and all declared
|
|
833
833
|
// getters keep their established compatibility behavior.
|
|
834
834
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
835
|
-
version: "0.3.
|
|
835
|
+
version: "0.3.74",
|
|
836
836
|
updateSummary: "Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.",
|
|
837
837
|
packageCapabilities: {
|
|
838
838
|
updatePreferences: 1
|
|
@@ -10629,7 +10629,7 @@ var MONITOR_FLEET_REMOVAL_GRACE_MS = 7 * 24 * 60 * 6e4;
|
|
|
10629
10629
|
var MONITOR_FLEET_DOCUMENTATION = {
|
|
10630
10630
|
summary: "A Monitor Fleet keeps one bounded, sticky set of ordinary monitors aligned with Customer DB rows.",
|
|
10631
10631
|
authoredFields: {
|
|
10632
|
-
id: "Stable lowercase fleet id used by sync,
|
|
10632
|
+
id: "Stable lowercase fleet id used by sync, get, and deactivate.",
|
|
10633
10633
|
source: "Customer DB table, unique row key, and optional equality filters that select candidate rows.",
|
|
10634
10634
|
member: "Ordinary monitor tool, stable key template, and payload evaluated for each selected source row.",
|
|
10635
10635
|
selection: "Deterministic ranking and an active-member limit between 1 and 1,000."
|
package/dist/index.mjs
CHANGED
|
@@ -744,7 +744,7 @@ var SDK_RELEASE = {
|
|
|
744
744
|
// available at toolResponse.rawV2 while toolResponse.raw and all declared
|
|
745
745
|
// getters keep their established compatibility behavior.
|
|
746
746
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
747
|
-
version: "0.3.
|
|
747
|
+
version: "0.3.74",
|
|
748
748
|
updateSummary: "Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.",
|
|
749
749
|
packageCapabilities: {
|
|
750
750
|
updatePreferences: 1
|
|
@@ -10541,7 +10541,7 @@ var MONITOR_FLEET_REMOVAL_GRACE_MS = 7 * 24 * 60 * 6e4;
|
|
|
10541
10541
|
var MONITOR_FLEET_DOCUMENTATION = {
|
|
10542
10542
|
summary: "A Monitor Fleet keeps one bounded, sticky set of ordinary monitors aligned with Customer DB rows.",
|
|
10543
10543
|
authoredFields: {
|
|
10544
|
-
id: "Stable lowercase fleet id used by sync,
|
|
10544
|
+
id: "Stable lowercase fleet id used by sync, get, and deactivate.",
|
|
10545
10545
|
source: "Customer DB table, unique row key, and optional equality filters that select candidate rows.",
|
|
10546
10546
|
member: "Ordinary monitor tool, stable key template, and payload evaluated for each selected source row.",
|
|
10547
10547
|
selection: "Deterministic ranking and an active-member limit between 1 and 1,000."
|
|
@@ -106,12 +106,14 @@
|
|
|
106
106
|
"dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts",
|
|
107
107
|
"dist/bundling-sources/shared_libs/play-runtime/pacing.ts",
|
|
108
108
|
"dist/bundling-sources/shared_libs/play-runtime/persistence-latch.ts",
|
|
109
|
+
"dist/bundling-sources/shared_libs/play-runtime/play-artifact-runtime-contract.ts",
|
|
109
110
|
"dist/bundling-sources/shared_libs/play-runtime/play-call-execution.ts",
|
|
110
111
|
"dist/bundling-sources/shared_libs/play-runtime/play-input.ts",
|
|
111
112
|
"dist/bundling-sources/shared_libs/play-runtime/play-latency-trace.ts",
|
|
112
113
|
"dist/bundling-sources/shared_libs/play-runtime/play-node-scope.ts",
|
|
113
114
|
"dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts",
|
|
114
115
|
"dist/bundling-sources/shared_libs/play-runtime/play-runtime-batching-registry.ts",
|
|
116
|
+
"dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts",
|
|
115
117
|
"dist/bundling-sources/shared_libs/play-runtime/postgres-json.ts",
|
|
116
118
|
"dist/bundling-sources/shared_libs/play-runtime/profiles.ts",
|
|
117
119
|
"dist/bundling-sources/shared_libs/play-runtime/projection.ts",
|