deepline 0.3.270 → 0.3.272

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.
Files changed (29) hide show
  1. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  2. package/dist/bundling-sources/shared_libs/play-runtime/activity-observation.ts +3 -2
  3. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +11 -9
  4. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +5 -4
  5. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +2 -1
  6. package/dist/bundling-sources/shared_libs/play-runtime/run-event-catalog.ts +610 -0
  7. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger-event-transport.ts +3 -1
  8. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger-projection-diagnostics.ts +3 -2
  9. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +80 -67
  10. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +5 -4
  11. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +59 -20
  12. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +3 -2
  13. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +19 -9
  14. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +205 -107
  15. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +125 -81
  16. package/dist/cli/getting-started.d.mts +13 -9
  17. package/dist/cli/getting-started.d.ts +13 -9
  18. package/dist/cli/getting-started.js +15 -3
  19. package/dist/cli/getting-started.mjs +13 -3
  20. package/dist/cli/index.js +447 -11
  21. package/dist/cli/index.mjs +447 -11
  22. package/dist/index.js +420 -1
  23. package/dist/index.mjs +420 -1
  24. package/dist/install-integrity.json +1 -0
  25. package/dist/release.d.mts +1 -1
  26. package/dist/release.d.ts +1 -1
  27. package/dist/release.js +1 -1
  28. package/dist/release.mjs +1 -1
  29. package/package.json +1 -1
@@ -200,7 +200,7 @@ export const SDK_RELEASE = {
200
200
  // getters keep their established compatibility behavior.
201
201
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
202
202
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
203
- version: '0.3.270',
203
+ version: '0.3.272',
204
204
  updateSummary:
205
205
  'Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.',
206
206
  packageCapabilities: {
@@ -1,3 +1,4 @@
1
+ import { RUN_EVENT_KIND } from './run-event-catalog';
1
2
  /**
2
3
  * Canonical, producer-facing description of what a play is doing.
3
4
  *
@@ -117,7 +118,7 @@ export type PlayActivityObservation = {
117
118
  };
118
119
 
119
120
  export type PlayActivityEvent = {
120
- type: 'activity.observed';
121
+ type: typeof RUN_EVENT_KIND.activityObserved;
121
122
  observation: PlayActivityObservation;
122
123
  };
123
124
 
@@ -357,7 +358,7 @@ export function createPlayActivityReporter(input: {
357
358
  return {
358
359
  observe(observation) {
359
360
  input.emit({
360
- type: 'activity.observed',
361
+ type: RUN_EVENT_KIND.activityObserved,
361
362
  observation: {
362
363
  ...observation,
363
364
  observedAt: observation.observedAt ?? input.now?.() ?? Date.now(),
@@ -1,3 +1,7 @@
1
+ import {
2
+ RUN_EVENT_KIND,
3
+ RUN_EVENT_TERMINAL_KIND_VALUES,
4
+ } from './run-event-catalog';
1
5
  import { prepareRetainedPlayPipelinesForTransport } from '../plays/execution-pipeline';
2
6
  import { createWriteStream } from 'node:fs';
3
7
  import { createHash, randomUUID } from 'node:crypto';
@@ -2257,7 +2261,7 @@ async function updateRunStatusViaAppRuntimeUnlocked(
2257
2261
  });
2258
2262
  if (update.workCounters) {
2259
2263
  events.push({
2260
- type: 'work.counters',
2264
+ type: RUN_EVENT_KIND.workCounters,
2261
2265
  runId: update.playId,
2262
2266
  source: 'worker',
2263
2267
  occurredAt: update.lastCheckpointAt ?? Date.now(),
@@ -2283,7 +2287,7 @@ async function updateRunStatusViaAppRuntimeUnlocked(
2283
2287
  event.bornFrom.rowCountIn > current.bornFrom.rowCountIn));
2284
2288
  if (!changesSnapshot) continue;
2285
2289
  events.push({
2286
- type: 'dataset.lifecycle',
2290
+ type: RUN_EVENT_KIND.datasetLifecycle,
2287
2291
  runId: update.playId,
2288
2292
  source: 'worker',
2289
2293
  occurredAt: event.at,
@@ -2315,7 +2319,7 @@ async function updateRunStatusViaAppRuntimeUnlocked(
2315
2319
  });
2316
2320
  if (lane === 'drop' || lane === 'liveness') continue;
2317
2321
  events.push({
2318
- type: 'activity.observed',
2322
+ type: RUN_EVENT_KIND.activityObserved,
2319
2323
  runId: update.playId,
2320
2324
  source: 'worker',
2321
2325
  occurredAt: observation.observedAt,
@@ -2461,9 +2465,7 @@ function runLedgerReceiptBatchIndex(
2461
2465
  for (let index = batches.length - 1; index >= 0; index -= 1) {
2462
2466
  if (
2463
2467
  batches[index]!.some((event) =>
2464
- ['run.completed', 'run.failed', 'run.cancelled'].includes(
2465
- event.key ?? event.type ?? '',
2466
- ),
2468
+ RUN_EVENT_TERMINAL_KIND_VALUES.includes(event.key ?? event.type ?? ''),
2467
2469
  )
2468
2470
  )
2469
2471
  return index;
@@ -2500,9 +2502,9 @@ export async function appendRunEventsViaAppRuntime(
2500
2502
  batches[index]!.some((event) => {
2501
2503
  const key = event.key ?? event.type;
2502
2504
  return (
2503
- key === 'run.completed' ||
2504
- key === 'run.failed' ||
2505
- key === 'run.cancelled'
2505
+ key === RUN_EVENT_KIND.runCompleted ||
2506
+ key === RUN_EVENT_KIND.runFailed ||
2507
+ key === RUN_EVENT_KIND.runCancelled
2506
2508
  );
2507
2509
  })
2508
2510
  ) {
@@ -1,3 +1,4 @@
1
+ import { RUN_EVENT_KIND } from './run-event-catalog';
1
2
  /**
2
3
  * PlayContextImpl — the cloud execution engine.
3
4
  *
@@ -14728,7 +14729,7 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
14728
14729
  const observedAt = Date.now();
14729
14730
  const label = providerCapacityLabel(provider);
14730
14731
  this.emitExecutionEvent({
14731
- type: 'activity.observed',
14732
+ type: RUN_EVENT_KIND.activityObserved,
14732
14733
  observation: {
14733
14734
  activityId: `capacity:provider:${label}`,
14734
14735
  target: { kind: 'capacity', pool: 'provider', label },
@@ -20524,7 +20525,7 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
20524
20525
  );
20525
20526
  retryActivityEmitted = true;
20526
20527
  this.emitExecutionEvent({
20527
- type: 'activity.observed',
20528
+ type: RUN_EVENT_KIND.activityObserved,
20528
20529
  observation: {
20529
20530
  schemaVersion: 1,
20530
20531
  activityId,
@@ -20561,7 +20562,7 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
20561
20562
  deeplineRequestId = `ctx-tool-${stableDigest(`${executionRequestNonce}:provider-rate-limit-retry:${invocationAttempt}`).slice(0, 32)}`;
20562
20563
  }
20563
20564
  this.emitExecutionEvent({
20564
- type: 'activity.observed',
20565
+ type: RUN_EVENT_KIND.activityObserved,
20565
20566
  observation: {
20566
20567
  schemaVersion: 1,
20567
20568
  activityId,
@@ -20654,7 +20655,7 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
20654
20655
  toolInputSnapshotMemory.current?.release();
20655
20656
  if (retryActivityEmitted) {
20656
20657
  this.emitExecutionEvent({
20657
- type: 'activity.observed',
20658
+ type: RUN_EVENT_KIND.activityObserved,
20658
20659
  observation: {
20659
20660
  schemaVersion: 1,
20660
20661
  activityId,
@@ -1,3 +1,4 @@
1
+ import { RUN_EVENT_KIND } from './run-event-catalog';
1
2
  // Core types for PlayContext.
2
3
  import type {
3
4
  PlayCellReadRef,
@@ -572,7 +573,7 @@ export type PlayExecutionEvent =
572
573
  at: number;
573
574
  }
574
575
  | {
575
- type: 'dataset.lifecycle';
576
+ type: typeof RUN_EVENT_KIND.datasetLifecycle;
576
577
  datasetId: string;
577
578
  path: string;
578
579
  tableNamespace: string;