deepline 0.3.275 → 0.3.277

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/cli/index.js CHANGED
@@ -3512,7 +3512,7 @@ var SDK_RELEASE = {
3512
3512
  // getters keep their established compatibility behavior.
3513
3513
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
3514
3514
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
3515
- version: "0.3.275",
3515
+ version: "0.3.277",
3516
3516
  updateSummary: "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.",
3517
3517
  packageCapabilities: {
3518
3518
  updatePreferences: 1
@@ -15743,205 +15743,73 @@ function registerPlayTriggerConfigCommands(plays) {
15743
15743
  var import_node_crypto7 = require("crypto");
15744
15744
 
15745
15745
  // src/cli/run-logs-help.ts
15746
- var EVENT_DETAILS = {
15747
- "run.created": {
15748
- emittedBy: "Run admission",
15749
- payloadFields: ["status", "playName", "runtimeBackend"]
15750
- },
15751
- "run.started": {
15752
- emittedBy: "Execution coordinator",
15753
- payloadFields: ["playName", "runtimeBackend"]
15754
- },
15755
- "run.waiting": {
15756
- emittedBy: "Durable wait handling",
15757
- payloadFields: ["waitKind", "waitUntil"]
15758
- },
15759
- "run.resumed": { emittedBy: "Durable wait handling", payloadFields: [] },
15760
- "run.completed": {
15761
- emittedBy: "Run finalization",
15762
- payloadFields: ["result", "resultSummary", "terminalWorkCounterSegment"]
15763
- },
15764
- "run.failed": {
15765
- emittedBy: "Run finalization",
15766
- payloadFields: [
15767
- "error",
15768
- "result",
15769
- "resultSummary",
15770
- "terminalWorkCounterSegment"
15771
- ]
15772
- },
15773
- "run.cancelled": {
15774
- emittedBy: "Run cancellation",
15775
- payloadFields: ["error", "result"]
15776
- },
15777
- "step.started": {
15778
- emittedBy: "Managed step execution",
15779
- payloadFields: ["stepId", "label", "kind", "artifactTableNamespace"]
15780
- },
15781
- "step.progress": {
15782
- emittedBy: "Managed step execution",
15783
- payloadFields: ["stepId", "label", "kind", "status", "progress"]
15784
- },
15785
- "step.completed": {
15786
- emittedBy: "Managed step execution",
15787
- payloadFields: ["stepId", "label", "kind", "artifactTableNamespace"]
15788
- },
15789
- "step.failed": {
15790
- emittedBy: "Managed step execution",
15791
- payloadFields: [
15792
- "stepId",
15793
- "label",
15794
- "kind",
15795
- "error",
15796
- "artifactTableNamespace"
15797
- ]
15798
- },
15799
- "step.skipped": {
15800
- emittedBy: "Managed step execution",
15801
- payloadFields: ["stepId", "label", "kind", "artifactTableNamespace"]
15802
- },
15803
- "log.appended": {
15804
- emittedBy: "ctx.log and runtime/coordinator messages",
15805
- payloadFields: [
15806
- "lines",
15807
- "lineContexts",
15808
- "producerAttempt",
15809
- "channelOffset",
15810
- "logsTruncated"
15811
- ]
15812
- },
15813
- "dataset.lifecycle": {
15814
- emittedBy: "Managed dataset storage",
15815
- payloadFields: [
15816
- "datasetId",
15817
- "path",
15818
- "tableNamespace",
15819
- "phase",
15820
- "persistedRows",
15821
- "succeededRows",
15822
- "failedRows",
15823
- "complete",
15824
- "bornFrom"
15825
- ]
15746
+ var KIND_DESCRIPTIONS = {
15747
+ "run.created": "Run accepted.",
15748
+ "run.started": "Execution started.",
15749
+ "run.waiting": "Run waiting.",
15750
+ "run.resumed": "Execution resumed.",
15751
+ "run.completed": "Run succeeded.",
15752
+ "run.failed": "Run failed.",
15753
+ "run.cancelled": "Run cancelled.",
15754
+ "step.started": "Step started.",
15755
+ "step.progress": "Progress update.",
15756
+ "step.completed": "Step succeeded.",
15757
+ "step.failed": "Step failed.",
15758
+ "step.skipped": "Step skipped.",
15759
+ "log.appended": "Text log line.",
15760
+ "dataset.lifecycle": "Dataset registered, available or failed.",
15761
+ "activity.observed": "Provider or workflow activity.",
15762
+ "work.counters": "Call, request and rate-limit totals.",
15763
+ "receipt.completed": "Saved work result: succeeded.",
15764
+ "receipt.failed": "Saved work result: failed.",
15765
+ "receipt.skipped": "Saved work result: skipped.",
15766
+ "runtime.event": "Other event."
15767
+ };
15768
+ var RUN_LOGS_KIND_HELP = RUN_EVENT_SEARCH_KIND_VALUES.map((kind) => ({
15769
+ kind,
15770
+ description: KIND_DESCRIPTIONS[kind]
15771
+ }));
15772
+ var READ_EXAMPLES = [
15773
+ "deepline runs logs '<run-id>'",
15774
+ "deepline runs logs '<run-id>' --out run.log"
15775
+ ];
15776
+ var FILTER_EXAMPLES = [
15777
+ {
15778
+ label: "Failed work with saved details",
15779
+ command: `deepline runs logs --kind receipt.failed --where '$.status == "failed"' --payloads --json`
15826
15780
  },
15827
- "activity.observed": {
15828
- emittedBy: "Managed provider/dataset/runner activity",
15829
- payloadFields: ["observation"]
15781
+ {
15782
+ label: "One failed step",
15783
+ command: `deepline runs logs --kind step.failed --where '$.stepId == "company-lookup"' --payloads --json`
15830
15784
  },
15831
- "work.counters": {
15832
- emittedBy: "Runtime work accounting",
15833
- payloadFields: [
15834
- "attempt",
15835
- "invocationSeq",
15836
- "segmentId",
15837
- "logicalCalls",
15838
- "providerRequests",
15839
- "provider429s",
15840
- "final"
15841
- ]
15842
- }
15843
- };
15844
- var RUN_LOGS_KIND_HELP = [
15845
- ...Object.entries(RUN_EVENT_KIND_CATALOG).map(([kind, descriptor]) => ({
15846
- kind,
15847
- description: descriptor.description,
15848
- ...EVENT_DETAILS[kind]
15849
- })),
15850
- ...Object.entries(RUN_RECEIPT_SEARCH_KIND_CATALOG).map(
15851
- ([kind, descriptor]) => ({
15852
- kind,
15853
- description: descriptor.description,
15854
- emittedBy: "Durable work receipt settlement",
15855
- payloadFields: ["status", "output", "error", "errorPayload"]
15856
- })
15857
- ),
15858
15785
  {
15859
- kind: RUN_EVENT_SEARCH_FALLBACK_KIND,
15860
- description: "Fallback for an observation without a recognized event type.",
15861
- emittedBy: "Event indexing",
15862
- payloadFields: []
15863
- }
15864
- ];
15865
- var SECTIONS = [
15786
+ label: "Provider and operation",
15787
+ command: `deepline runs logs --kind activity.observed --where '$.provider == "apollo" && $.operation == "company_lookup"' --json`
15788
+ },
15866
15789
  {
15867
- title: "Choose the read",
15868
- paragraphs: [
15869
- "These commands read existing evidence; they do not start a run or execute a provider. Replace <run-id>, <play-name> and other angle-bracket values with identifiers returned by the CLI.",
15870
- "Text logs: runs logs <run-id> returns the last 200 retained lines by default. When older lines exist, hasMore is true and nextCursor continues the next older page with --cursor. --out writes the full retained stream to a local file. --log-level filters text severity; debug includes all retained levels. --failed reads only a terminal-failed run\u2019s last 20 retained lines and reports retention limitations.",
15871
- "Event search: omit the run ID, or add any of --since, --until, --play, --kind, --where, --payloads, --runtime-namespace or --runtime-backend. A supplied run ID then narrows the search. --cursor continues event search unless it is a returned before:<sequence> text-log cursor. --limit and --json alone do not switch a run\u2019s text logs to event search. Text-only flags --out, --failed and --log-level cannot be combined with event search.",
15872
- "Current status and returned output selectors: runs get <run-id> --json. Live observation: runs watch <run-id>. Dataset rows: runs export <run-id> --dataset <returned-selector> --out rows.csv. A referenced tool response: runs receipt <run-id> --key <returned-receipt-key> --json. Read each command\u2019s --help for its options."
15873
- ],
15874
- commands: [
15875
- "deepline runs logs <run-id> --cursor before:1201 --json",
15876
- "deepline runs logs <run-id> --out run.log --json",
15877
- "deepline runs logs --kind run.failed --json",
15878
- "deepline runs logs --kind step.failed --payloads --json",
15879
- "deepline runs logs --kind receipt.failed --payloads --json"
15880
- ]
15790
+ label: "Failed dataset",
15791
+ command: `deepline runs logs --kind dataset.lifecycle --where '$.datasetId == "companies" && $.phase == "failed"' --payloads --json`
15881
15792
  },
15882
15793
  {
15883
- title: "Search window and pagination",
15884
- paragraphs: [
15885
- "Search defaults to the last hour, newest first. Use explicit ISO UTC --since and --until values for reproducible queries; the maximum lookback is seven days. Default page size is 100 events; --limit accepts 1\u2013200. With --payloads, default and maximum are 10 events, with 16 MiB total payload data.",
15886
- "JSON returns events[], returnedCount, since, until, nextCursor and next.logs. Run the returned next.logs command to continue with the same filters and UTC window; nextCursor is opaque. A bounded page or an empty result does not establish whole-run coverage or application health."
15887
- ],
15888
- commands: [
15889
- "deepline runs logs <run-id> --kind log.appended --json",
15890
- "deepline runs logs --play <play-name> --since <UTC-start> --until <UTC-end> --json"
15891
- ]
15794
+ label: "String log context",
15795
+ command: `deepline runs logs --kind log.appended --where '$.context.companyId == "acme_123"' --json`
15892
15796
  },
15893
15797
  {
15894
- title: "Fields you can filter with --where",
15895
- paragraphs: [
15896
- "Identity strings: orgId, runId, playName, runtimeScope. These come from authenticated execution state; filters only narrow your authorized organization/runtime. Preview reads require the existing runtime credential and an authorized --runtime-namespace; --runtime-backend selects daytona or modal.",
15897
- "Event string: kind. Optional strings: source, stepId, stepKind, status, datasetId, phase, provider, operation. Optional positive integer: producerAttempt. These fields exist only when recorded; inspect a returned event before filtering on an optional field.",
15898
- 'stepId/stepKind describe recorded step work; datasetId/phase describe dataset lifecycle (registered, available, failed). provider/operation appear on typed provider activity.observed events, not every receipt or provider call. status is the recorded status or activity state when present: run.completed and step.completed do not imply status == "completed". Select lifecycle outcomes with --kind.',
15899
- "context.<key> matches an authored flat scalar log field: string, number or boolean. Context cannot override event identity. Missing fields do not match. --where supports only $.field == literal predicates joined with &&, at most eight predicates and 512 bytes. No OR, ranges, wildcards, nested payload paths or text search. Time uses --since/--until; level and message are not --where fields.",
15900
- 'Wrap the entire predicate in single shell quotes so $ and && reach the CLI unchanged. Inside it, strings use double quotes; numbers and booleans are unquoted. Types must match: 2 differs from "2", false differs from "false". Examples use illustrative recorded values; use your own step IDs, dataset IDs, provider/operation names and authored context. The context examples assume ctx.log recorded companyId: "acme_123", attempt: 2 and cached: false.'
15901
- ],
15902
- commands: [
15903
- "# Failed retained work with its stored error/result",
15904
- `deepline runs logs --kind receipt.failed --where '$.status == "failed"' --payloads --json`,
15905
- "# Failure details for one named step",
15906
- `deepline runs logs --kind step.failed --where '$.stepId == "company-lookup"' --payloads --json`,
15907
- "# Typed provider observations matching both fields",
15908
- `deepline runs logs --kind activity.observed --where '$.provider == "apollo" && $.operation == "company_lookup"' --json`,
15909
- "# Failed lifecycle transitions for one dataset",
15910
- `deepline runs logs --kind dataset.lifecycle --where '$.datasetId == "companies" && $.phase == "failed"' --payloads --json`,
15911
- "# Authored string context on log lines",
15912
- `deepline runs logs --kind log.appended --where '$.context.companyId == "acme_123"' --json`,
15913
- "# Authored number and boolean context, both required to match",
15914
- "deepline runs logs --kind log.appended --where '$.context.attempt == 2 && $.context.cached == false' --json",
15915
- "# Known producer identity within one run",
15916
- `deepline runs logs <run-id> --where '$.source == "worker" && $.producerAttempt == 1' --json`
15917
- ]
15798
+ label: "Number and boolean log context",
15799
+ command: "deepline runs logs --kind log.appended --where '$.context.attempt == 2 && $.context.cached == false' --json"
15918
15800
  },
15919
15801
  {
15920
- title: "What you get back",
15921
- paragraphs: [
15922
- "Search events include eventId, occurredAt, ingestedAt, kind, runId, playName, level and message. The CLI puts indexed fields directly on each events[] entry; SDK/API responses keep them under searchDoc. Log search message is a preview (up to 2,048 characters); use text logs or --out for full retained lines.",
15923
- "--payloads adds eventPayload for stored canonical events: lifecycle, step details/errors, activity observations, dataset transitions and work counters. Receipt matches instead hydrate payload with status, output, error and errorPayload. An event without a receipt does not promise a tool response; retained payloads may be unavailable. Neither --where nor event search indexes request/response bodies.",
15924
- "Search does not expose a receipt key or storage reference. To retrieve a specific retained tool response with runs receipt, use the receipt key returned in the run\u2019s exported evidence or tool execution metadata. For full row data, follow runs get output/export actions; dataset.lifecycle contains metadata, not all dataset rows.",
15925
- "The catalog lists known searchable kinds, including receipt outcomes and the runtime.event fallback. Use the exact dotted name with --kind. Future stored kinds can also be queried; this list is not a CLI validation allowlist. Events are observations, not a count of billed provider calls.",
15926
- "Catalog payload fields are possible producer fields, not required fields or --where paths. Canonical eventPayload uses type for the dotted event kind; its kind field, when present on a step, becomes indexed stepKind. Indexed log entries describe individual lines rather than reproducing the original lines batch.",
15927
- "Canonical event envelopes carry runId, type, occurredAt (producer milliseconds), source, optional seq and optional producer-owned payload. Search occurredAt/ingestedAt are UTC timestamp strings. source identifies the recorded producer; producerAttempt is present only when known.",
15928
- "activity.observed stores observation with activityId, stepId, target, state and observedAt. Targets describe provider, dataset, lease, runner, step or capacity work. State kinds are active, queued, waiting, retrying, scheduled, completed or failed; retry/wait detail stays in the payload. work.counters contains aggregate logicalCalls, providerRequests and provider429s, not per-call responses."
15929
- ],
15930
- commands: []
15802
+ label: "One run and step",
15803
+ command: `deepline runs logs '<run-id>' --where '$.stepId == "company-lookup"' --json`
15931
15804
  }
15932
15805
  ];
15933
- var RETENTION = [
15934
- "Event/log/receipt search shares the PlanetScale index. New runs marked runEventStore=planet_scale retain accepted event/log history in PlanetScale; Convex keeps current run/control state and eligible saved-Play rollup facts. Older unmarked runs retain their existing readers. No backfill is implied.",
15935
- "Search retention is seven days; receipt payload retention is independent. Logs reflect accepted, retained lines: runtime sampling and truncation can omit original console output. Read returned retention/sampling warnings; an export contains the full retained stream, not suppressed lines."
15936
- ];
15937
- function wrapParagraph(text, indent2 = 2) {
15806
+ function wrapParagraph(text) {
15938
15807
  const lines = [];
15939
- const padding = " ".repeat(indent2);
15940
- let line = padding;
15808
+ let line = " ";
15941
15809
  for (const word of text.split(" ")) {
15942
15810
  if (line.length + word.length > 80 && line.trim()) {
15943
15811
  lines.push(line.trimEnd());
15944
- line = padding;
15812
+ line = " ";
15945
15813
  }
15946
15814
  line += `${word} `;
15947
15815
  }
@@ -15949,34 +15817,36 @@ function wrapParagraph(text, indent2 = 2) {
15949
15817
  return lines.join("\n");
15950
15818
  }
15951
15819
  function renderRunLogsHelp() {
15952
- const section = ({
15953
- title,
15954
- paragraphs,
15955
- commands
15956
- }) => [
15957
- `${title}:`,
15958
- ...paragraphs.flatMap((paragraph) => [wrapParagraph(paragraph), ""]),
15959
- ...commands.length ? [" Common commands:", ...commands.map((command) => ` ${command}`)] : [],
15960
- ""
15961
- ];
15962
15820
  return [
15963
15821
  "",
15964
- ...section(SECTIONS[0]),
15965
- "Known --kind values (complete catalog):",
15966
- ...RUN_LOGS_KIND_HELP.flatMap(
15967
- ({ kind, description, emittedBy, payloadFields }) => [
15968
- ` ${kind}`,
15969
- wrapParagraph(description, 4),
15970
- wrapParagraph(
15971
- `Recorded by: ${emittedBy}. Payload fields: ${kind === RUN_EVENT_SEARCH_FALLBACK_KIND ? "producer-specific fields; inspect the returned payload" : payloadFields.join(", ") || "event envelope only"}.`,
15972
- 4
15973
- )
15974
- ]
15822
+ "Examples:",
15823
+ ` ${READ_EXAMPLES[0]}`,
15824
+ " deepline runs logs --kind run.failed --json",
15825
+ ...[FILTER_EXAMPLES[1], FILTER_EXAMPLES[2], FILTER_EXAMPLES[5]].map(
15826
+ ({ command }) => ` ${command}`
15827
+ ),
15828
+ "",
15829
+ "Event kinds:",
15830
+ ...RUN_LOGS_KIND_HELP.map(
15831
+ ({ kind, description }) => ` ${kind.padEnd(20)} ${description}`
15975
15832
  ),
15976
15833
  "",
15977
- ...SECTIONS.slice(1).flatMap(section),
15978
- "Storage and retention:",
15979
- ...RETENTION.flatMap((paragraph) => [wrapParagraph(paragraph), ""])
15834
+ "Filters:",
15835
+ ...[
15836
+ "Use $.field == value; combine matches with &&.",
15837
+ "Quote the whole filter with single shell quotes. Strings use double quotes; numbers and booleans are unquoted.",
15838
+ "Missing fields do not match. Maximum eight matches and 512 bytes per filter."
15839
+ ].map((note) => wrapParagraph(note)),
15840
+ "",
15841
+ "Search:",
15842
+ ...[
15843
+ "A run ID alone reads text logs. Omit it or add a search flag to search events; a supplied run ID narrows the search.",
15844
+ "Defaults to the last hour; maximum lookback is seven days. Follow next.logs for events; use nextCursor with --cursor for older text logs.",
15845
+ "--payloads returns available details or saved results: up to 10 events and 16 MiB.",
15846
+ "--out, --failed and --log-level apply to text logs and cannot be combined with event search."
15847
+ ].map((note) => wrapParagraph(note)),
15848
+ "",
15849
+ "More examples: https://deepline.com/docs/sdk-v2/run-events"
15980
15850
  ].join("\n");
15981
15851
  }
15982
15852
 
@@ -37321,15 +37191,7 @@ Examples:
37321
37191
  ...options.logLevel ? ["--log-level", options.logLevel] : []
37322
37192
  ]);
37323
37193
  });
37324
- runs.command("logs [runId]").description(
37325
- "Fetch one run\u2019s logs or search recent runtime events across runs."
37326
- ).addHelpText("after", renderRunLogsHelp()).option(
37327
- "--limit <count>",
37328
- "Text tail: default 200; search: default 100, max 200 (10 with --payloads)"
37329
- ).option("--out <path>", "Write the full retained log stream to a file").option("--failed", "Show the bounded terminal-failure log window").option(
37330
- "--log-level <level>",
37331
- "Minimum severity: debug (default), info, warn, or error"
37332
- ).addOption(
37194
+ runs.command("logs [runId]").description("Read a run\u2019s logs or search recent events.").addHelpText("after", renderRunLogsHelp()).option("--limit <count>", "Maximum results: logs 200; events 100, max 200").option("--out <path>", "Save the full available text log").option("--failed", "Last 20 lines of a failed run").option("--log-level <level>", "debug (default), info, warn or error").addOption(
37333
37195
  new import_commander3.Option(
37334
37196
  "--logs",
37335
37197
  "Compatibility alias for --log-level debug"
@@ -37339,22 +37201,20 @@ Examples:
37339
37201
  "--debug",
37340
37202
  "Compatibility alias for --log-level debug"
37341
37203
  ).hideHelp()
37342
- ).option("--json", "Emit JSON output. Also automatic when stdout is piped").option("--since <timestamp>", "Search events since this UTC timestamp").option("--until <timestamp>", "Search events before this UTC timestamp").option("--play <name>", "Filter events by Play name").option(
37343
- "--kind <kind>",
37344
- "Search one exact event kind; complete catalog below"
37345
- ).option(
37346
- "--where <jsonpath>",
37347
- "Search indexed fields with == and &&; field types and availability below"
37348
- ).option(
37349
- "--payloads",
37350
- "Search with canonical eventPayload or receipt payload; max 10 events, 16 MiB"
37351
- ).option(
37204
+ ).option("--json", "JSON output; automatic when piped").option("--since <timestamp>", "Search from this UTC time").option("--until <timestamp>", "Search before this UTC time").option("--play <name>", "Filter by Play").option("--kind <kind>", "Filter by event kind").option("--where <filter>", "Match event fields; examples below").option("--payloads", "Include available details or saved results").option(
37352
37205
  "--cursor <token>",
37353
- "Continue paging: older run-log lines (nextCursor) or a bounded event search"
37354
- ).option(
37355
- "--runtime-namespace <name>",
37356
- "Search an explicitly authorized Preview namespace"
37357
- ).option("--runtime-backend <backend>", "Preview backend: daytona or modal").action(async (runId, options) => {
37206
+ "Continue to older logs or the next events page"
37207
+ ).addOption(
37208
+ new import_commander3.Option(
37209
+ "--runtime-namespace <name>",
37210
+ "Search an explicitly authorized Preview namespace"
37211
+ ).hideHelp()
37212
+ ).addOption(
37213
+ new import_commander3.Option(
37214
+ "--runtime-backend <backend>",
37215
+ "Preview backend: daytona or modal"
37216
+ ).hideHelp()
37217
+ ).action(async (runId, options) => {
37358
37218
  process.exitCode = await handleRunLogs([
37359
37219
  ...runId ? [runId] : [],
37360
37220
  ...options.limit ? ["--limit", options.limit] : [],