deepline 0.3.272 → 0.3.274

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/README.md CHANGED
@@ -38,6 +38,15 @@ with project-local skills automatically.
38
38
 
39
39
  ## Use it with an agent
40
40
 
41
+ For an existing run, start with `deepline runs logs --help`. It includes every
42
+ known event kind, what records it, available fields, filters, payload reads,
43
+ pagination and retention. `runs logs` reads text or structured events;
44
+ `runs get`, `runs watch`, `runs export` and `runs receipt` cover status, live
45
+ observation, dataset rows and retained tool results. These inspection commands
46
+ read existing evidence without starting provider work. TypeScript callers use
47
+ `client.runs.logs`, `client.runs.searchEvents` and `client.runs.getReceipts`;
48
+ their source JSDoc and the generated SDK/API references describe the same reads.
49
+
41
50
  Paste this into Claude Code, Codex, or another coding agent:
42
51
 
43
52
  ```text
@@ -740,25 +740,33 @@ export type RunsWatchOptions = {
740
740
  /** @deprecated Use `RunsWatchOptions`. */
741
741
  export type RunsTailOptions = RunsWatchOptions;
742
742
 
743
- /** Log fetch options for `client.runs.logs(...)`. */
743
+ /** Read retained text with `client.runs.logs(...)`; use `runs.searchEvents` for structured filters and payloads. */
744
744
  export type RunsLogsOptions = {
745
- /** Return the LAST `limit` stored log lines (default 200). */
745
+ /** Return the last `limit` retained lines in sequence order; default 200. Ignored when `all` is true. */
746
746
  limit?: number;
747
- /** Fetch every stored log line, paginating to the full totalCount. */
747
+ /** Page through every retained line. Cannot combine with `failed`; sampling or retention loss cannot be recovered. */
748
748
  all?: boolean;
749
- /** Select the bounded failure view; truncated runs degrade explicitly. */
749
+ /** Read a terminal-failed run's last 20 retained lines, or fewer with `limit`. Retention loss returns an explicit association and warning. */
750
750
  failed?: boolean;
751
751
  };
752
752
 
753
- /** Persisted log response for one play run. */
753
+ /** Retained text for one run. Counts and retention flags describe the stored stream, not every original console call. */
754
754
  export type RunsLogsResult = {
755
+ /** Public run identity. */
755
756
  runId: string;
757
+ /** Count tracked by the log stream; may exceed available bodies after retention truncation. */
756
758
  totalCount: number;
759
+ /** Number of line bodies returned in `entries`. */
757
760
  returnedCount: number;
761
+ /** First returned stored sequence, or null for an empty view. */
758
762
  firstSequence: number | null;
763
+ /** Last returned stored sequence, or null for an empty view. */
759
764
  lastSequence: number | null;
765
+ /** Tail/all: returned count is below total count. Failed: the stream lost bodies to retention. Check `logsTruncated` to distinguish retention loss from a selected tail. */
760
766
  truncated: boolean;
767
+ /** More retained lines exist after `lastSequence`; always false for the designed failure window. */
761
768
  hasMore: boolean;
769
+ /** Formatted text lines in stored sequence order; structured context is available through event search. */
762
770
  entries: string[];
763
771
  /** Selected public log view. */
764
772
  view?: 'tail' | 'failed' | 'all';
@@ -775,53 +783,77 @@ export type RunsLogsResult = {
775
783
  logsTruncated?: boolean;
776
784
  };
777
785
 
778
- /** Bounded org-scoped search over durable Play runtime observations. */
786
+ /** Read existing events in the authenticated organization/runtime scope, newest first by occurrence time and event ID. See the complete catalog and field contract in `deepline runs logs --help`. */
779
787
  export type RunsEventSearchOptions = {
780
788
  /** Inclusive UTC timestamp; defaults to one hour before the request. */
781
789
  since?: string;
782
- /** Exclusive UTC timestamp; defaults to the request time. */
790
+ /** Exclusive UTC timestamp; defaults to the request time. A window spans at most seven days; event retention is seven days. */
783
791
  until?: string;
784
792
  /** Optional run filter. Omit to search across the active organization. */
785
793
  runId?: string;
794
+ /** Exact Play name; HTTP query parameter `playName`, CLI `--play`. */
786
795
  playName?: string;
796
+ /** Exact dotted event kind, such as `step.failed`. The catalog is discoverable with `runs logs --help`; future stored kinds are accepted too. */
787
797
  kind?: string;
788
- /** Flat equality predicate in the supported PostgreSQL JSONPath subset. */
798
+ /** Equality joined with `&&`, at most eight predicates and 512 bytes. Fields: orgId, runId, playName, runtimeScope, producerAttempt, kind, status, source, stepId, stepKind, datasetId, phase, provider, operation and scalar `context.<key>`. Missing fields do not match; status is not inferred from kind. No body, message, level, nested payload, range or OR search. HTTP `jsonpath`, CLI `--where`. */
789
799
  jsonpath?: string;
790
- /** Include canonical event details and receipt-backed outputs, capped to ten events and 16 MiB total. */
800
+ /** Add stored canonical `eventPayload` and, for receipt matches, retained `payload`. At most ten events and 16 MiB; unavailable receipts return null. HTTP `payloads=true`, CLI `--payloads`. Does not execute tools. */
791
801
  includePayloads?: boolean;
802
+ /** Page size: default 100, maximum 200; with payloads, default and maximum ten. */
792
803
  limit?: number;
804
+ /** Opaque `nextCursor` from the preceding page. Reuse that page's returned since/until and the same filters and runtime scope. */
793
805
  cursor?: string;
794
806
  /** Explicit Preview selection requires the existing runtime credential. */
795
807
  runtime?: PlayRuntimeSelection;
796
808
  };
797
809
 
810
+ /** One indexed observation; optional indexed fields and payloads depend on what its producer recorded. */
798
811
  export type RunsEventSearchEntry = {
812
+ /** Stable event identity; also breaks ties in newest-first pagination. */
799
813
  eventId: string;
814
+ /** Producer occurrence time as a UTC timestamp string. */
800
815
  occurredAt: string;
816
+ /** Index ingestion time as a UTC timestamp string; may be later than occurrence. */
801
817
  ingestedAt: string;
818
+ /** Public run identity associated with this observation. */
802
819
  runId: string;
820
+ /** Recorded Play name. */
803
821
  playName: string;
822
+ /** Exact indexed kind; canonical payloads use `type` for this dotted name. */
804
823
  kind: string;
824
+ /** Recorded log severity, or null; not a JSONPath filter field. */
805
825
  level: string | null;
826
+ /** Log message preview of at most 2,048 characters, or null. Use text logs/export for the full retained line. */
806
827
  message: string | null;
828
+ /** Indexed identity and recorded scalar fields. SDK/API keep this nested; CLI search flattens it onto each event. Provider/operation describe typed activity observations, not every provider call. */
807
829
  searchDoc: Record<string, unknown>;
808
- /** Accepted Play event from PScale when this run uses the unified journal. */
830
+ /** Stored canonical event details, only when payloads are requested and available. Lifecycle/activity/dataset payloads are observations, not complete tool responses or dataset rows. */
809
831
  eventPayload?: Record<string, unknown>;
810
- /** Optional full result, included only when explicitly requested. */
832
+ /** Retained work result for a receipt match when payloads are requested; null if unavailable. Other events need not carry this field. */
811
833
  payload?: RunsEventPayload | null;
812
834
  };
813
835
 
836
+ /** One bounded search page. Continue using `nextCursor` and these exact time bounds; CLI-only counts and follow-up commands are not SDK/API fields. */
814
837
  export type RunsEventSearchResult = {
838
+ /** Matching observations in descending occurredAt/eventId order. */
815
839
  events: RunsEventSearchEntry[];
840
+ /** Opaque continuation token, or null when no further page exists. */
816
841
  nextCursor: string | null;
842
+ /** Resolved inclusive UTC bound, including a defaulted bound. */
817
843
  since: string;
844
+ /** Resolved exclusive UTC bound, including a defaulted bound. */
818
845
  until: string;
819
846
  };
820
847
 
848
+ /** Retained work outcome hydrated for a receipt event; not a new execution, billing receipt or guarantee of a raw HTTP response. */
821
849
  export type RunsEventPayload = {
850
+ /** Recorded terminal work outcome. */
822
851
  status: 'completed' | 'failed' | 'skipped';
852
+ /** Stored result data, or null when no output was retained. */
823
853
  output: unknown | null;
854
+ /** Stored failure message, or null when absent. */
824
855
  error: string | null;
856
+ /** Stored structured failure details, or null when absent. */
825
857
  errorPayload: unknown | null;
826
858
  };
827
859
 
@@ -902,7 +934,7 @@ export type PlaySecretCheck = {
902
934
  * @sdkReference client 020 client.runs
903
935
  */
904
936
  export type RunsNamespace = {
905
- /** Read retained tool results associated with a run, in supplied key order. Never executes tools. */
937
+ /** Read retained tool results in supplied key order. Use keys returned in exported evidence or execution metadata; search does not expose receipt keys. Never executes tools. */
906
938
  getReceipts: (
907
939
  runId: string,
908
940
  options: { keys: string[] },
@@ -937,9 +969,9 @@ export type RunsNamespace = {
937
969
  watch: (runId: string, options?: RunsWatchOptions) => Promise<PlayStatus>;
938
970
  /** @deprecated Use `watch`; retained as a source-compatible alias. */
939
971
  tail: (runId: string, options?: RunsTailOptions) => Promise<PlayStatus>;
940
- /** Fetch persisted log lines for a run. */
972
+ /** Read a run's retained text tail, full stream (`all`) or terminal failure window (`failed`). For structured filters and payloads, see [run logs and events](run-events.md). */
941
973
  logs: (runId: string, options?: RunsLogsOptions) => Promise<RunsLogsResult>;
942
- /** Search recent durable runtime events across runs in the active organization. */
974
+ /** Search existing events across the active organization; default last hour, up to 200 events per page (ten with payloads). See [run logs and events](run-events.md) for the catalog, query fields and response types. */
943
975
  searchEvents: (
944
976
  options?: RunsEventSearchOptions,
945
977
  ) => Promise<RunsEventSearchResult>;
@@ -2858,7 +2890,7 @@ export class DeeplineClient {
2858
2890
  play: Pick<PlayListItem, 'name' | 'reference' | 'inputSchema'>,
2859
2891
  ): string {
2860
2892
  const target = play.reference || play.name;
2861
- return `deepline plays run ${target}${playInputExampleArgs(play.inputSchema)} --watch`;
2893
+ return `deepline plays run ${target}${playInputExampleArgs(play.inputSchema)}`;
2862
2894
  }
2863
2895
 
2864
2896
  private starterPlayPath(
@@ -3657,7 +3689,7 @@ export class DeeplineClient {
3657
3689
  * Convenience wrapper around {@link registerPlayArtifact} plus
3658
3690
  * {@link startPlayRun}. This is the canonical file-backed path used by wrappers.
3659
3691
  * The returned id can be passed to {@link getPlayStatus} to retrieve the same
3660
- * durable `{ result }` object that the CLI prints after `--watch` completes.
3692
+ * durable `{ result }` object that the CLI prints after `plays run` completes.
3661
3693
  *
3662
3694
  * @param code - Source string fallback; the bundled artifact should be passed in `options.artifact`
3663
3695
  * @param csvPath - Path to input CSV file, or `null`
@@ -3839,7 +3871,7 @@ export class DeeplineClient {
3839
3871
  * Get the current status of a play execution.
3840
3872
  *
3841
3873
  * Internal/advanced primitive. Public callers should usually prefer
3842
- * {@link runPlay}, {@link PlayJob.get}, or `deepline plays run --watch`.
3874
+ * {@link runPlay}, {@link PlayJob.get}, or `deepline plays run`.
3843
3875
  *
3844
3876
  * @param workflowId - Play-run id from {@link startPlayRun}
3845
3877
  * @returns Current status with progress logs and partial results
@@ -4342,7 +4374,7 @@ export class DeeplineClient {
4342
4374
  return { ...response, runs: response.runs ?? [] };
4343
4375
  }
4344
4376
 
4345
- /** Read batches rather than silently truncating a long key list. */
4377
+ /** Read retained tool results without executing tools, preserving supplied key order and batching 100 keys per request. Obtain keys from exported evidence or execution metadata; each key must be nonempty, at most 2,048 characters and contain no CR, LF or NUL. Missing/expired results have an explicit per-key error. */
4346
4378
  async getRunReceipts(
4347
4379
  runId: string,
4348
4380
  options: { keys: string[] },
@@ -4426,7 +4458,7 @@ export class DeeplineClient {
4426
4458
  }
4427
4459
 
4428
4460
  /**
4429
- * Fetch persisted logs for a run using the public runs resource model.
4461
+ * Read a run's retained text tail (default 200), full retained stream (`all`), or terminal failure window (`failed`, at most 20). These are existing reads; sampling and retention loss cannot be recovered. See [run logs and events](run-events.md) for structured search and payload retrieval.
4430
4462
  *
4431
4463
  * This is the SDK equivalent of:
4432
4464
  *
@@ -4525,7 +4557,7 @@ export class DeeplineClient {
4525
4557
  };
4526
4558
  }
4527
4559
 
4528
- /** Search bounded, structured runtime history without requiring a run id. */
4560
+ /** Read structured history across the active organization without requiring a run ID. Defaults to the last hour, newest first; use the returned cursor and exact time bounds to continue. See [run logs and events](run-events.md) for all kinds, indexed fields, payloads and SDK/API response types. */
4529
4561
  async searchRunEvents(
4530
4562
  options: RunsEventSearchOptions = {},
4531
4563
  ): Promise<RunsEventSearchResult> {
@@ -50,7 +50,7 @@ export type {
50
50
  * });
51
51
  * ```
52
52
  *
53
- * Then run with the CLI: `deepline plays run --file my-play.play.ts --watch`
53
+ * Then run with the CLI: `deepline plays run --file my-play.play.ts`
54
54
  * Installed npm CLIs can also run saved or prebuilt plays by name.
55
55
  *
56
56
  * ## Architecture
@@ -39,7 +39,7 @@
39
39
  * ```
40
40
  *
41
41
  * Then run via the CLI:
42
- * `deepline plays run --file my-play.play.ts --watch`.
42
+ * `deepline plays run --file my-play.play.ts`.
43
43
  * Installed npm CLIs can also run saved or prebuilt plays by name.
44
44
  *
45
45
  * ### Programmatic usage
@@ -486,7 +486,7 @@ export type DeeplinePlayRuntimeContext = PlayAuthoringRuntimeContext;
486
486
  * Provides methods to check status, stream logs, wait for completion,
487
487
  * or cancel the execution.
488
488
  *
489
- * This handle is the SDK-context equivalent of `deepline plays run --watch` and
489
+ * This handle is the SDK-context equivalent of `deepline plays run` and
490
490
  * `POST /api/v2/plays/run`: every surface returns a run id first, then exposes
491
491
  * the completed user output through `PlayJob.get()` or the status endpoint's
492
492
  * `result` field. Runtime logs are available from `status().progress.logs` and
@@ -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.272',
203
+ version: '0.3.274',
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,23 +1,39 @@
1
- /** A retained result, not a new tool execution or a billing receipt. */
1
+ /** Read-only retained tool evidence associated with a run. Each requested key returns either its stored result or an explicit error; this never executes tools or returns a billing receipt. */
2
2
  export type RunToolReceiptResult = {
3
+ /** Exact key supplied to the read, obtained from exported evidence or execution metadata. */
3
4
  receiptKey: string;
5
+ /** Recorded work status when available; an error does not imply a fresh provider failure. */
4
6
  status?: string;
5
7
  } & (
6
8
  | {
9
+ /** Retained result envelope; provider fields reflect stored evidence, not a guaranteed raw HTTP response. */
7
10
  result: {
11
+ /** Status recorded in the tool result. */
8
12
  status: string;
13
+ /** Provider job identity when recorded. */
9
14
  job_id?: string;
15
+ /** Stored tool response. */
10
16
  toolResponse: Record<string, unknown>;
17
+ /** Stored target values when the tool supplied them. */
11
18
  targetValues?: Record<string, unknown>;
19
+ /** Stored list dataset metadata when supplied. */
12
20
  listDatasets?: Record<string, unknown>;
21
+ /** Stored list row evidence when supplied. */
13
22
  listRows?: Record<string, unknown>;
14
23
  };
15
24
  error?: never;
16
25
  }
17
- | { result?: never; error: { code: string; message: string } }
26
+ | {
27
+ result?: never;
28
+ /** Explicit lookup/access/retention failure for this key. */
29
+ error: { code: string; message: string };
30
+ }
18
31
  );
19
32
 
33
+ /** Results in the exact requested key order, including errors for unavailable keys. */
20
34
  export type RunToolReceiptsResponse = {
35
+ /** Public run identity used to scope the read. */
21
36
  runId: string;
37
+ /** One result or error per requested key. */
22
38
  receipts: RunToolReceiptResult[];
23
39
  };
@@ -1607,13 +1607,14 @@ export interface PlayAuthoringRuntimeContext {
1607
1607
  ): Promise<AsyncPlayRunRef>;
1608
1608
 
1609
1609
  /**
1610
- * Write a customer-safe line to the durable Run Log Stream. Omitting level
1611
- * preserves the historical info-level behavior.
1610
+ * Write a customer-safe retained log line, searchable as `log.appended` in the unified event journal. Default severity is info; runtime sampling and retention limits apply. Use `runs.logs` for retained text and `runs.searchEvents` for indexed context; see `deepline runs logs --help` for the complete read contract.
1612
1611
  */
1613
1612
  log(
1614
1613
  message: string,
1615
1614
  options?: {
1615
+ /** Defaults to info. Warn/error lines are not subject to info/debug sampling. */
1616
1616
  level?: 'debug' | 'info' | 'warn' | 'error';
1617
+ /** At most eight flat scalar fields and 2,048 UTF-8 bytes total. Keys match [A-Za-z_][A-Za-z0-9_]{0,63}; __proto__, constructor and prototype are forbidden. String values are at most 256 UTF-8 bytes. Search with `$.context.<key> == literal`; context cannot override run/event identity. */
1617
1618
  context?: Readonly<Record<string, string | number | boolean>>;
1618
1619
  },
1619
1620
  ): void;