deepline 0.3.12 → 0.3.14

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.
@@ -878,13 +878,10 @@ export type MonitorsNamespace = {
878
878
  key: string,
879
879
  patch: Record<string, unknown>,
880
880
  ) => Promise<MonitorUpdateResult>;
881
- /**
882
- * Delete a deployed monitor by public key. Deprovisions the upstream provider
883
- * resource unless `localOnly` is set. `dryRun` returns the delete plan.
884
- */
881
+ /** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. */
885
882
  delete: (
886
883
  key: string,
887
- options?: { localOnly?: boolean; dryRun?: boolean },
884
+ options?: { dryRun?: boolean },
888
885
  ) => Promise<MonitorDeleteResult>;
889
886
  /** Reactivate a disabled monitor. `dryRun` returns the reactivation cost. */
890
887
  reactivate: (
@@ -2838,8 +2835,7 @@ export class DeeplineClient {
2838
2835
  }
2839
2836
 
2840
2837
  type DirectStageResult =
2841
- | { ref: PlayStagedFileRef }
2842
- | { fallbackFile: (typeof files)[number] };
2838
+ { ref: PlayStagedFileRef } | { fallbackFile: (typeof files)[number] };
2843
2839
  const directResults: DirectStageResult[] = await Promise.all(
2844
2840
  files.map(async (file) => {
2845
2841
  const upload = uploadByIdentity.get(
@@ -4788,17 +4784,23 @@ export class DeeplineClient {
4788
4784
  );
4789
4785
  }
4790
4786
 
4791
- /**
4792
- * Delete a deployed monitor by public key. Deprovisions the upstream provider
4793
- * resource unless `localOnly`; `dryRun` returns the delete plan. Prefer
4794
- * `client.monitors.delete(...)`.
4795
- */
4787
+ /** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
4796
4788
  async deleteMonitor(
4797
4789
  key: string,
4798
- options?: { localOnly?: boolean; dryRun?: boolean },
4790
+ options?: { dryRun?: boolean },
4799
4791
  ): Promise<MonitorDeleteResult> {
4792
+ // The public type intentionally excludes `localOnly`, but JavaScript
4793
+ // callers (and compiled older SDK clients) can still pass it at runtime.
4794
+ // Never silently reinterpret an old local-only request as an upstream
4795
+ // deletion. The server applies the same guard for direct API callers.
4796
+ if ((options as { localOnly?: unknown } | undefined)?.localOnly === true) {
4797
+ throw new DeeplineError(
4798
+ 'localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.',
4799
+ undefined,
4800
+ 'MONITOR_LOCAL_ONLY_DELETE_NOT_SUPPORTED',
4801
+ );
4802
+ }
4800
4803
  const params = new URLSearchParams();
4801
- if (options?.localOnly) params.set('local_only', 'true');
4802
4804
  if (options?.dryRun) params.set('dry_run', 'true');
4803
4805
  const query = params.toString();
4804
4806
  return this.http.request<MonitorDeleteResult>(
@@ -52,6 +52,11 @@ const SOURCE_EXTENSIONS = [
52
52
  '.cjs',
53
53
  '.json',
54
54
  ];
55
+ const TEXT_IMPORT_EXTENSIONS = new Set(['.md', '.txt']);
56
+
57
+ function isTextImportFile(filePath: string): boolean {
58
+ return TEXT_IMPORT_EXTENSIONS.has(extname(filePath));
59
+ }
55
60
 
56
61
  function sha256(buffer: Buffer): string {
57
62
  return createHash('sha256').update(buffer).digest('hex');
@@ -349,6 +354,12 @@ export async function discoverPackagedLocalFiles(
349
354
  visitedFiles.add(absolutePath);
350
355
 
351
356
  const sourceCode = await readFile(absolutePath, 'utf-8');
357
+ if (
358
+ extname(absolutePath).toLowerCase() === '.json' ||
359
+ isTextImportFile(absolutePath)
360
+ ) {
361
+ return;
362
+ }
352
363
  const scanSource = stripCommentsToSpaces(sourceCode);
353
364
  const constants = collectTopLevelStringConstants(sourceCode);
354
365
  const childVisits: Promise<void>[] = [];
@@ -192,7 +192,7 @@ export const SDK_RELEASE = {
192
192
  // 0.3.0 introduces raw-v2: complete scrubbed provider responses are
193
193
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
194
194
  // getters keep their established compatibility behavior.
195
- version: '0.3.12',
195
+ version: '0.3.14',
196
196
  updateSummary:
197
197
  'New raw-v2 tool responses preserve complete scrubbed provider envelopes at toolResponse.rawV2, including JSON:API included resources, links, cursors, and totals. Existing toolResponse.raw and declared getters keep working unchanged.',
198
198
  contracts: {
@@ -964,6 +964,10 @@ export interface PlayRevisionSummary {
964
964
  createdAt?: number;
965
965
  /** Unix timestamp (ms) of last update. */
966
966
  updatedAt?: number;
967
+ /** True when this is the revision currently serving live triggers. */
968
+ isLive?: boolean;
969
+ /** True when this is the newest saved working revision. */
970
+ isWorking?: boolean;
967
971
  }
968
972
 
969
973
  /**
@@ -14,7 +14,13 @@ import {
14
14
  } from 'node:path';
15
15
  import { builtinModules } from 'node:module';
16
16
  import { Parser } from 'acorn';
17
- import { build, transformSync, type Message, type Plugin } from 'esbuild';
17
+ import {
18
+ build,
19
+ transformSync,
20
+ type Loader,
21
+ type Message,
22
+ type Plugin,
23
+ } from 'esbuild';
18
24
  import {
19
25
  PLAY_ARTIFACT_KINDS,
20
26
  type PlayArtifactKind,
@@ -78,6 +84,7 @@ const SOURCE_EXTENSIONS = [
78
84
  '.json',
79
85
  ];
80
86
  const PLAY_SOURCE_FILE_PATTERN = /\.play\.(?:[cm]?[jt]sx?)$/i;
87
+ const TEXT_IMPORT_EXTENSIONS = new Set(['.md', '.txt']);
81
88
  const NODE_BUILTIN_SET = new Set(
82
89
  builtinModules.flatMap((name) =>
83
90
  name.startsWith('node:') ? [name, name.slice(5)] : [name, `node:${name}`],
@@ -1370,8 +1377,14 @@ function localSdkAliasPlugin(adapter: PlayBundlingAdapter): Plugin | null {
1370
1377
  };
1371
1378
  }
1372
1379
 
1373
- function sourceLoaderForPath(path: string): 'ts' | 'tsx' | 'js' | 'jsx' {
1374
- const extension = extname(path).toLowerCase();
1380
+ function isTextImportFile(path: string): boolean {
1381
+ return TEXT_IMPORT_EXTENSIONS.has(extname(path));
1382
+ }
1383
+
1384
+ function sourceLoaderForPath(path: string): Loader {
1385
+ const rawExtension = extname(path);
1386
+ if (TEXT_IMPORT_EXTENSIONS.has(rawExtension)) return 'text';
1387
+ const extension = rawExtension.toLowerCase();
1375
1388
  if (extension === '.tsx') return 'tsx';
1376
1389
  if (extension === '.jsx') return 'jsx';
1377
1390
  if (extension === '.js' || extension === '.mjs' || extension === '.cjs') {
@@ -1700,6 +1713,13 @@ function docflowRuntimeInstrumentationPlugin(
1700
1713
  setup(buildContext) {
1701
1714
  buildContext.onLoad({ filter: /./ }, (args) => {
1702
1715
  if (!customerSourceFiles.has(resolve(args.path))) return undefined;
1716
+ if (isTextImportFile(args.path)) {
1717
+ return {
1718
+ contents: readFileSync(args.path, 'utf8'),
1719
+ loader: 'text',
1720
+ resolveDir: dirname(args.path),
1721
+ };
1722
+ }
1703
1723
  return {
1704
1724
  contents: instrumentPlayDocflowRuntimeHits(
1705
1725
  readFileSync(args.path, 'utf8'),
@@ -1896,7 +1916,10 @@ async function analyzeSourceGraph(
1896
1916
  );
1897
1917
  localFiles.set(absolutePath, sourceCode);
1898
1918
 
1899
- if (extname(absolutePath).toLowerCase() === '.json') {
1919
+ if (
1920
+ extname(absolutePath).toLowerCase() === '.json' ||
1921
+ isTextImportFile(absolutePath)
1922
+ ) {
1900
1923
  return;
1901
1924
  }
1902
1925
 
@@ -1 +1,2 @@
1
1
  #!/usr/bin/env node
2
+ /// <reference path="./text-imports.d.ts" />
@@ -1 +1,2 @@
1
1
  #!/usr/bin/env node
2
+ /// <reference path="./text-imports.d.ts" />
package/dist/cli/index.js CHANGED
@@ -1047,7 +1047,7 @@ var SDK_RELEASE = {
1047
1047
  // 0.3.0 introduces raw-v2: complete scrubbed provider responses are
1048
1048
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
1049
1049
  // getters keep their established compatibility behavior.
1050
- version: "0.3.12",
1050
+ version: "0.3.14",
1051
1051
  updateSummary: "New raw-v2 tool responses preserve complete scrubbed provider envelopes at toolResponse.rawV2, including JSON:API included resources, links, cursors, and totals. Existing toolResponse.raw and declared getters keep working unchanged.",
1052
1052
  contracts: {
1053
1053
  api: {
@@ -6627,14 +6627,16 @@ var DeeplineClient = class {
6627
6627
  { method: "PATCH", body: patch }
6628
6628
  );
6629
6629
  }
6630
- /**
6631
- * Delete a deployed monitor by public key. Deprovisions the upstream provider
6632
- * resource unless `localOnly`; `dryRun` returns the delete plan. Prefer
6633
- * `client.monitors.delete(...)`.
6634
- */
6630
+ /** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
6635
6631
  async deleteMonitor(key, options) {
6632
+ if (options?.localOnly === true) {
6633
+ throw new DeeplineError(
6634
+ "localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
6635
+ void 0,
6636
+ "MONITOR_LOCAL_ONLY_DELETE_NOT_SUPPORTED"
6637
+ );
6638
+ }
6636
6639
  const params = new URLSearchParams();
6637
- if (options?.localOnly) params.set("local_only", "true");
6638
6640
  if (options?.dryRun) params.set("dry_run", "true");
6639
6641
  const query = params.toString();
6640
6642
  return this.http.request(
@@ -18557,11 +18559,13 @@ async function writePlayRunIdFile(destination, runId) {
18557
18559
  handle = null;
18558
18560
  try {
18559
18561
  await (0, import_promises6.link)(tempPath, destination);
18560
- const directory = await (0, import_promises6.open)((0, import_node_path14.dirname)(destination), "r");
18561
- try {
18562
- await directory.sync();
18563
- } finally {
18564
- await directory.close();
18562
+ if (process.platform !== "win32") {
18563
+ const directory = await (0, import_promises6.open)((0, import_node_path14.dirname)(destination), "r");
18564
+ try {
18565
+ await directory.sync();
18566
+ } finally {
18567
+ await directory.close();
18568
+ }
18565
18569
  }
18566
18570
  } catch (error) {
18567
18571
  if (error.code !== "EEXIST") throw error;
@@ -24425,7 +24429,11 @@ async function handlePlayGet(args) {
24425
24429
  }
24426
24430
  function formatVersionLine(version) {
24427
24431
  const revisionLabel = version.artifactHash?.slice(0, 12) ?? "unknown-revision";
24428
- return `v${version.version} ${revisionLabel} ${formatTimestamp(version.createdAt)}`;
24432
+ const state = [
24433
+ version.isLive ? "live" : null,
24434
+ version.isWorking ? "working" : null
24435
+ ].filter(Boolean).join(", ");
24436
+ return `v${version.version} ${revisionLabel} ${formatTimestamp(version.createdAt)}${state ? ` (${state})` : ""}`;
24429
24437
  }
24430
24438
  async function handlePlayVersions(args) {
24431
24439
  const nameIndex = args.indexOf("--name");
@@ -32978,13 +32986,12 @@ function assertMonitorDryRunAcknowledged(payload, context) {
32978
32986
  `${context.command} --dry-run: the server response did not acknowledge dry-run mode (missing "dry_run": true). This Deepline server may not support --dry-run for ${context.mutation}, so the response cannot be trusted as a plan. Nothing was rendered as a plan. Verify current state with \`deepline monitors get <key> --json\`, and re-run without --dry-run only when you intend the real ${context.mutation}.`
32979
32987
  );
32980
32988
  }
32981
- function monitorDeleteRequiresYesError(key, options = {}) {
32982
- const flags = options.localOnly ? " --local-only" : "";
32989
+ function monitorDeleteRequiresYesError(key) {
32983
32990
  return new MonitorsUsageError(
32984
- `monitors delete is destructive: it deletes monitor "${key}"${options.localOnly ? " (Deepline record only)" : " and deprovisions its upstream provider resource"}. Non-interactive runs must confirm with --yes:
32985
- deepline monitors delete ${key}${flags} --yes
32991
+ `monitors delete is destructive: it deletes monitor "${key}" and deprovisions its upstream provider resource. Non-interactive runs must confirm with --yes:
32992
+ deepline monitors delete ${key} --yes
32986
32993
  Preview the plan first with:
32987
- deepline monitors delete ${key}${flags} --dry-run`
32994
+ deepline monitors delete ${key} --dry-run`
32988
32995
  );
32989
32996
  }
32990
32997
  async function handleMonitorsStatus(options) {
@@ -33091,17 +33098,19 @@ function renderDeployedListText(payload, requestedStatus) {
33091
33098
  const name = asString(entry.name);
33092
33099
  const outputTable = asString(entry.output_table);
33093
33100
  const webhookState = asString(entry.webhook_state);
33101
+ const executionType = asString(entry.execution_type);
33094
33102
  const hasLastReceivedEvent = "last_received_event" in entry;
33095
33103
  const lastReceivedEvent = asString(entry.last_received_event);
33096
33104
  const boundPlays = Array.isArray(entry.bound_plays) ? entry.bound_plays.length : void 0;
33097
33105
  lines.push(
33098
33106
  ` ${key}${status ? ` ${status}` : ""}${tool ? ` ${tool}` : ""}${name ? ` (${name})` : ""}`
33099
33107
  );
33100
- if (outputTable || webhookState || boundPlays !== void 0) {
33108
+ if (outputTable || webhookState || executionType || boundPlays !== void 0) {
33101
33109
  lines.push(
33102
33110
  ` ${[
33103
33111
  outputTable ? `table: ${outputTable}` : null,
33104
33112
  webhookState ? `webhook: ${webhookState}` : null,
33113
+ executionType ? `execution: ${executionType}` : null,
33105
33114
  boundPlays !== void 0 ? `bound Plays: ${boundPlays}` : null
33106
33115
  ].filter(Boolean).join(" ")}`
33107
33116
  );
@@ -33364,15 +33373,14 @@ async function handleMonitorsValidate(key, options) {
33364
33373
  printCommandEnvelope(result, { json: options.json });
33365
33374
  if (result.valid === false) process.exitCode = 7;
33366
33375
  }
33367
- async function confirmMonitorDelete(key, options) {
33376
+ async function confirmMonitorDelete(key) {
33368
33377
  const rl = (0, import_promises8.createInterface)({
33369
33378
  input: process.stdin,
33370
33379
  output: process.stderr
33371
33380
  });
33372
33381
  try {
33373
- const consequence = options.localOnly ? "This removes the Deepline record only (the upstream provider resource is left in place)." : "This deprovisions the upstream provider resource.";
33374
33382
  const answer = await rl.question(
33375
- `Delete monitor "${key}"? ${consequence} [y/N] `
33383
+ `Delete monitor "${key}"? This deprovisions the upstream provider resource. [y/N] `
33376
33384
  );
33377
33385
  return /^y(es)?$/i.test(answer.trim());
33378
33386
  } finally {
@@ -33382,10 +33390,7 @@ async function confirmMonitorDelete(key, options) {
33382
33390
  async function handleMonitorsDelete(key, options) {
33383
33391
  const client2 = new DeeplineClient();
33384
33392
  if (options.dryRun) {
33385
- const payload2 = await client2.monitors.delete(key, {
33386
- ...options.localOnly ? { localOnly: true } : {},
33387
- dryRun: true
33388
- });
33393
+ const payload2 = await client2.monitors.delete(key, { dryRun: true });
33389
33394
  assertMonitorDryRunAcknowledged(payload2, {
33390
33395
  command: "deepline monitors delete",
33391
33396
  mutation: "delete"
@@ -33399,13 +33404,9 @@ async function handleMonitorsDelete(key, options) {
33399
33404
  if (!options.yes) {
33400
33405
  const interactive = process.stdout.isTTY === true && process.stdin.isTTY === true;
33401
33406
  if (!interactive) {
33402
- throw monitorDeleteRequiresYesError(key, {
33403
- localOnly: options.localOnly
33404
- });
33407
+ throw monitorDeleteRequiresYesError(key);
33405
33408
  }
33406
- const confirmed = await confirmMonitorDelete(key, {
33407
- localOnly: options.localOnly
33408
- });
33409
+ const confirmed = await confirmMonitorDelete(key);
33409
33410
  if (!confirmed) {
33410
33411
  process.stderr.write(`Aborted. Monitor "${key}" was not deleted.
33411
33412
  `);
@@ -33413,9 +33414,7 @@ async function handleMonitorsDelete(key, options) {
33413
33414
  return;
33414
33415
  }
33415
33416
  }
33416
- const payload = await client2.monitors.delete(key, {
33417
- ...options.localOnly ? { localOnly: true } : {}
33418
- });
33417
+ const payload = await client2.monitors.delete(key);
33419
33418
  printCommandEnvelope(payload, { json: options.json });
33420
33419
  }
33421
33420
  async function handleMonitorsUpdate(key, patch, options) {
@@ -33616,8 +33615,10 @@ Notes:
33616
33615
  \`deepline monitors available deepline_native.company_radar --json\`.
33617
33616
  For a bounded urgent Deepline Native preview, use
33618
33617
  controls.execution_type="priority". Deepline injects the upstream marker;
33619
- do not author custom_fields yourself. Priority is capped at ten active or
33620
- in-flight radars per org and is not for regular or bulk-scale monitoring.
33618
+ do not author custom_fields yourself. Priority is capped at ten upstream or
33619
+ reserved recovery, replacement, or reactivation slots per org. Use
33620
+ \`monitors list --status all\` to find priority holders; it is not for regular
33621
+ or bulk-scale monitoring.
33621
33622
 
33622
33623
  Examples:
33623
33624
  deepline monitors check '{"key":"job-openings","tool":"deepline_native.company_radar","payload":{"domain":"stripe.com","radar_type":"company_job_openings"}}'
@@ -33645,7 +33646,7 @@ Notes:
33645
33646
  for a patch-style change.
33646
33647
  For a bounded urgent Deepline Native preview, set
33647
33648
  controls.execution_type="priority". Deepline injects the provider custom
33648
- field and enforces a ten-radar per-org cap; do not use it for regular or bulk
33649
+ field and enforces a ten-slot per-org cap; do not use it for regular or bulk
33649
33650
  monitoring, and do not delete another radar automatically to make room.
33650
33651
 
33651
33652
  Examples:
@@ -33692,20 +33693,17 @@ Examples:
33692
33693
  "after",
33693
33694
  `
33694
33695
  Notes:
33695
- DESTRUCTIVE. By default deprovisions the upstream provider resource; pass
33696
- --local-only to remove only the Deepline-managed record.
33697
- --dry-run shows the delete plan without deleting anything.
33696
+ DESTRUCTIVE. Deprovisions the upstream provider resource and removes its
33697
+ Deepline-managed monitor. Retries are safe: a delete that already reached its requested terminal state
33698
+ returns already_deleted without making another upstream call.
33699
+ --dry-run shows the delete plan without deleting anything.
33698
33700
  Interactive terminals get a y/N confirmation; non-interactive runs (agents,
33699
33701
  scripts, pipes) must pass --yes.
33700
33702
 
33701
33703
  Examples:
33702
33704
  deepline monitors delete my-monitor --dry-run
33703
33705
  deepline monitors delete my-monitor --yes --json
33704
- deepline monitors delete my-monitor --local-only --yes --json
33705
33706
  `
33706
- ).option(
33707
- "--local-only",
33708
- "Remove only the Deepline-managed record, leaving the upstream resource"
33709
33707
  ).option("--dry-run", "Show the delete plan without deleting anything").option(
33710
33708
  "--yes",
33711
33709
  "Skip the confirmation prompt (required non-interactively)"
@@ -33748,10 +33746,7 @@ Examples:
33748
33746
  )
33749
33747
  ).action(monitorsAction(handleMonitorsUpdate));
33750
33748
  withJsonOption(
33751
- deployed.command("delete <key>").description("Alias of `monitors delete <key>`.").option(
33752
- "--local-only",
33753
- "Remove only the Deepline-managed record, leaving the upstream resource"
33754
- ).option("--dry-run", "Show the delete plan without deleting anything").option(
33749
+ deployed.command("delete <key>").description("Alias of `monitors delete <key>`.").option("--dry-run", "Show the delete plan without deleting anything").option(
33755
33750
  "--yes",
33756
33751
  "Skip the confirmation prompt (required non-interactively)"
33757
33752
  )
@@ -1033,7 +1033,7 @@ var SDK_RELEASE = {
1033
1033
  // 0.3.0 introduces raw-v2: complete scrubbed provider responses are
1034
1034
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
1035
1035
  // getters keep their established compatibility behavior.
1036
- version: "0.3.12",
1036
+ version: "0.3.14",
1037
1037
  updateSummary: "New raw-v2 tool responses preserve complete scrubbed provider envelopes at toolResponse.rawV2, including JSON:API included resources, links, cursors, and totals. Existing toolResponse.raw and declared getters keep working unchanged.",
1038
1038
  contracts: {
1039
1039
  api: {
@@ -6613,14 +6613,16 @@ var DeeplineClient = class {
6613
6613
  { method: "PATCH", body: patch }
6614
6614
  );
6615
6615
  }
6616
- /**
6617
- * Delete a deployed monitor by public key. Deprovisions the upstream provider
6618
- * resource unless `localOnly`; `dryRun` returns the delete plan. Prefer
6619
- * `client.monitors.delete(...)`.
6620
- */
6616
+ /** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
6621
6617
  async deleteMonitor(key, options) {
6618
+ if (options?.localOnly === true) {
6619
+ throw new DeeplineError(
6620
+ "localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
6621
+ void 0,
6622
+ "MONITOR_LOCAL_ONLY_DELETE_NOT_SUPPORTED"
6623
+ );
6624
+ }
6622
6625
  const params = new URLSearchParams();
6623
- if (options?.localOnly) params.set("local_only", "true");
6624
6626
  if (options?.dryRun) params.set("dry_run", "true");
6625
6627
  const query = params.toString();
6626
6628
  return this.http.request(
@@ -12893,7 +12895,10 @@ import {
12893
12895
  } from "path";
12894
12896
  import { builtinModules } from "module";
12895
12897
  import { Parser as Parser2 } from "acorn";
12896
- import { build, transformSync } from "esbuild";
12898
+ import {
12899
+ build,
12900
+ transformSync
12901
+ } from "esbuild";
12897
12902
 
12898
12903
  // ../node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
12899
12904
  var value_exports = {};
@@ -18617,11 +18622,13 @@ async function writePlayRunIdFile(destination, runId) {
18617
18622
  handle = null;
18618
18623
  try {
18619
18624
  await link(tempPath, destination);
18620
- const directory = await open(dirname9(destination), "r");
18621
- try {
18622
- await directory.sync();
18623
- } finally {
18624
- await directory.close();
18625
+ if (process.platform !== "win32") {
18626
+ const directory = await open(dirname9(destination), "r");
18627
+ try {
18628
+ await directory.sync();
18629
+ } finally {
18630
+ await directory.close();
18631
+ }
18625
18632
  }
18626
18633
  } catch (error) {
18627
18634
  if (error.code !== "EEXIST") throw error;
@@ -24485,7 +24492,11 @@ async function handlePlayGet(args) {
24485
24492
  }
24486
24493
  function formatVersionLine(version) {
24487
24494
  const revisionLabel = version.artifactHash?.slice(0, 12) ?? "unknown-revision";
24488
- return `v${version.version} ${revisionLabel} ${formatTimestamp(version.createdAt)}`;
24495
+ const state = [
24496
+ version.isLive ? "live" : null,
24497
+ version.isWorking ? "working" : null
24498
+ ].filter(Boolean).join(", ");
24499
+ return `v${version.version} ${revisionLabel} ${formatTimestamp(version.createdAt)}${state ? ` (${state})` : ""}`;
24489
24500
  }
24490
24501
  async function handlePlayVersions(args) {
24491
24502
  const nameIndex = args.indexOf("--name");
@@ -33045,13 +33056,12 @@ function assertMonitorDryRunAcknowledged(payload, context) {
33045
33056
  `${context.command} --dry-run: the server response did not acknowledge dry-run mode (missing "dry_run": true). This Deepline server may not support --dry-run for ${context.mutation}, so the response cannot be trusted as a plan. Nothing was rendered as a plan. Verify current state with \`deepline monitors get <key> --json\`, and re-run without --dry-run only when you intend the real ${context.mutation}.`
33046
33057
  );
33047
33058
  }
33048
- function monitorDeleteRequiresYesError(key, options = {}) {
33049
- const flags = options.localOnly ? " --local-only" : "";
33059
+ function monitorDeleteRequiresYesError(key) {
33050
33060
  return new MonitorsUsageError(
33051
- `monitors delete is destructive: it deletes monitor "${key}"${options.localOnly ? " (Deepline record only)" : " and deprovisions its upstream provider resource"}. Non-interactive runs must confirm with --yes:
33052
- deepline monitors delete ${key}${flags} --yes
33061
+ `monitors delete is destructive: it deletes monitor "${key}" and deprovisions its upstream provider resource. Non-interactive runs must confirm with --yes:
33062
+ deepline monitors delete ${key} --yes
33053
33063
  Preview the plan first with:
33054
- deepline monitors delete ${key}${flags} --dry-run`
33064
+ deepline monitors delete ${key} --dry-run`
33055
33065
  );
33056
33066
  }
33057
33067
  async function handleMonitorsStatus(options) {
@@ -33158,17 +33168,19 @@ function renderDeployedListText(payload, requestedStatus) {
33158
33168
  const name = asString(entry.name);
33159
33169
  const outputTable = asString(entry.output_table);
33160
33170
  const webhookState = asString(entry.webhook_state);
33171
+ const executionType = asString(entry.execution_type);
33161
33172
  const hasLastReceivedEvent = "last_received_event" in entry;
33162
33173
  const lastReceivedEvent = asString(entry.last_received_event);
33163
33174
  const boundPlays = Array.isArray(entry.bound_plays) ? entry.bound_plays.length : void 0;
33164
33175
  lines.push(
33165
33176
  ` ${key}${status ? ` ${status}` : ""}${tool ? ` ${tool}` : ""}${name ? ` (${name})` : ""}`
33166
33177
  );
33167
- if (outputTable || webhookState || boundPlays !== void 0) {
33178
+ if (outputTable || webhookState || executionType || boundPlays !== void 0) {
33168
33179
  lines.push(
33169
33180
  ` ${[
33170
33181
  outputTable ? `table: ${outputTable}` : null,
33171
33182
  webhookState ? `webhook: ${webhookState}` : null,
33183
+ executionType ? `execution: ${executionType}` : null,
33172
33184
  boundPlays !== void 0 ? `bound Plays: ${boundPlays}` : null
33173
33185
  ].filter(Boolean).join(" ")}`
33174
33186
  );
@@ -33431,15 +33443,14 @@ async function handleMonitorsValidate(key, options) {
33431
33443
  printCommandEnvelope(result, { json: options.json });
33432
33444
  if (result.valid === false) process.exitCode = 7;
33433
33445
  }
33434
- async function confirmMonitorDelete(key, options) {
33446
+ async function confirmMonitorDelete(key) {
33435
33447
  const rl = createInterface({
33436
33448
  input: process.stdin,
33437
33449
  output: process.stderr
33438
33450
  });
33439
33451
  try {
33440
- const consequence = options.localOnly ? "This removes the Deepline record only (the upstream provider resource is left in place)." : "This deprovisions the upstream provider resource.";
33441
33452
  const answer = await rl.question(
33442
- `Delete monitor "${key}"? ${consequence} [y/N] `
33453
+ `Delete monitor "${key}"? This deprovisions the upstream provider resource. [y/N] `
33443
33454
  );
33444
33455
  return /^y(es)?$/i.test(answer.trim());
33445
33456
  } finally {
@@ -33449,10 +33460,7 @@ async function confirmMonitorDelete(key, options) {
33449
33460
  async function handleMonitorsDelete(key, options) {
33450
33461
  const client2 = new DeeplineClient();
33451
33462
  if (options.dryRun) {
33452
- const payload2 = await client2.monitors.delete(key, {
33453
- ...options.localOnly ? { localOnly: true } : {},
33454
- dryRun: true
33455
- });
33463
+ const payload2 = await client2.monitors.delete(key, { dryRun: true });
33456
33464
  assertMonitorDryRunAcknowledged(payload2, {
33457
33465
  command: "deepline monitors delete",
33458
33466
  mutation: "delete"
@@ -33466,13 +33474,9 @@ async function handleMonitorsDelete(key, options) {
33466
33474
  if (!options.yes) {
33467
33475
  const interactive = process.stdout.isTTY === true && process.stdin.isTTY === true;
33468
33476
  if (!interactive) {
33469
- throw monitorDeleteRequiresYesError(key, {
33470
- localOnly: options.localOnly
33471
- });
33477
+ throw monitorDeleteRequiresYesError(key);
33472
33478
  }
33473
- const confirmed = await confirmMonitorDelete(key, {
33474
- localOnly: options.localOnly
33475
- });
33479
+ const confirmed = await confirmMonitorDelete(key);
33476
33480
  if (!confirmed) {
33477
33481
  process.stderr.write(`Aborted. Monitor "${key}" was not deleted.
33478
33482
  `);
@@ -33480,9 +33484,7 @@ async function handleMonitorsDelete(key, options) {
33480
33484
  return;
33481
33485
  }
33482
33486
  }
33483
- const payload = await client2.monitors.delete(key, {
33484
- ...options.localOnly ? { localOnly: true } : {}
33485
- });
33487
+ const payload = await client2.monitors.delete(key);
33486
33488
  printCommandEnvelope(payload, { json: options.json });
33487
33489
  }
33488
33490
  async function handleMonitorsUpdate(key, patch, options) {
@@ -33683,8 +33685,10 @@ Notes:
33683
33685
  \`deepline monitors available deepline_native.company_radar --json\`.
33684
33686
  For a bounded urgent Deepline Native preview, use
33685
33687
  controls.execution_type="priority". Deepline injects the upstream marker;
33686
- do not author custom_fields yourself. Priority is capped at ten active or
33687
- in-flight radars per org and is not for regular or bulk-scale monitoring.
33688
+ do not author custom_fields yourself. Priority is capped at ten upstream or
33689
+ reserved recovery, replacement, or reactivation slots per org. Use
33690
+ \`monitors list --status all\` to find priority holders; it is not for regular
33691
+ or bulk-scale monitoring.
33688
33692
 
33689
33693
  Examples:
33690
33694
  deepline monitors check '{"key":"job-openings","tool":"deepline_native.company_radar","payload":{"domain":"stripe.com","radar_type":"company_job_openings"}}'
@@ -33712,7 +33716,7 @@ Notes:
33712
33716
  for a patch-style change.
33713
33717
  For a bounded urgent Deepline Native preview, set
33714
33718
  controls.execution_type="priority". Deepline injects the provider custom
33715
- field and enforces a ten-radar per-org cap; do not use it for regular or bulk
33719
+ field and enforces a ten-slot per-org cap; do not use it for regular or bulk
33716
33720
  monitoring, and do not delete another radar automatically to make room.
33717
33721
 
33718
33722
  Examples:
@@ -33759,20 +33763,17 @@ Examples:
33759
33763
  "after",
33760
33764
  `
33761
33765
  Notes:
33762
- DESTRUCTIVE. By default deprovisions the upstream provider resource; pass
33763
- --local-only to remove only the Deepline-managed record.
33764
- --dry-run shows the delete plan without deleting anything.
33766
+ DESTRUCTIVE. Deprovisions the upstream provider resource and removes its
33767
+ Deepline-managed monitor. Retries are safe: a delete that already reached its requested terminal state
33768
+ returns already_deleted without making another upstream call.
33769
+ --dry-run shows the delete plan without deleting anything.
33765
33770
  Interactive terminals get a y/N confirmation; non-interactive runs (agents,
33766
33771
  scripts, pipes) must pass --yes.
33767
33772
 
33768
33773
  Examples:
33769
33774
  deepline monitors delete my-monitor --dry-run
33770
33775
  deepline monitors delete my-monitor --yes --json
33771
- deepline monitors delete my-monitor --local-only --yes --json
33772
33776
  `
33773
- ).option(
33774
- "--local-only",
33775
- "Remove only the Deepline-managed record, leaving the upstream resource"
33776
33777
  ).option("--dry-run", "Show the delete plan without deleting anything").option(
33777
33778
  "--yes",
33778
33779
  "Skip the confirmation prompt (required non-interactively)"
@@ -33815,10 +33816,7 @@ Examples:
33815
33816
  )
33816
33817
  ).action(monitorsAction(handleMonitorsUpdate));
33817
33818
  withJsonOption(
33818
- deployed.command("delete <key>").description("Alias of `monitors delete <key>`.").option(
33819
- "--local-only",
33820
- "Remove only the Deepline-managed record, leaving the upstream resource"
33821
- ).option("--dry-run", "Show the delete plan without deleting anything").option(
33819
+ deployed.command("delete <key>").description("Alias of `monitors delete <key>`.").option("--dry-run", "Show the delete plan without deleting anything").option(
33822
33820
  "--yes",
33823
33821
  "Skip the confirmation prompt (required non-interactively)"
33824
33822
  )
@@ -0,0 +1,9 @@
1
+ declare module '*.md' {
2
+ const content: string;
3
+ export default content;
4
+ }
5
+
6
+ declare module '*.txt' {
7
+ const content: string;
8
+ export default content;
9
+ }
@@ -1,3 +1,4 @@
1
+ /// <reference path="./text-imports.d.ts" />
1
2
  import * as _sinclair_typebox from '@sinclair/typebox';
2
3
  import { Static } from '@sinclair/typebox';
3
4
 
@@ -1,3 +1,4 @@
1
+ /// <reference path="./text-imports.d.ts" />
1
2
  import * as _sinclair_typebox from '@sinclair/typebox';
2
3
  import { Static } from '@sinclair/typebox';
3
4
 
@@ -1,3 +1,4 @@
1
+ /// <reference path="./text-imports.d.ts" />
1
2
  /**
2
3
  * GTM normalization primitives used by generated plays and user-authored
3
4
  * prospecting notebooks.
package/dist/helpers.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /// <reference path="./text-imports.d.ts" />
1
2
  /**
2
3
  * GTM normalization primitives used by generated plays and user-authored
3
4
  * prospecting notebooks.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
- import { e as PlayRuntimeBackendId, c as PlayCompilerManifest, D as DeeplineError, f as ToolExecutionError, g as ToolExecutionErrorOptions, h as PlayAuthoringColumnMap, i as PlayAuthoringColumnResolver, j as PlayAuthoringRuntimeContext, k as PlayAuthoringConditionalStepResolver, l as PlayAuthoringCsvInput, m as PlayAuthoringCsvOptions, n as PlayAuthoringDatasetBuilder, o as PlayAuthoringDatasetColumnDefinition, p as PlayAuthoringDatasetColumnRunInput, q as ToolExecuteResult, r as PlayAuthoringReferenceLike, s as PlayReturnObject$1, t as PlayAuthoringDefineConfig, u as PlayAuthoringDefinedPlay, v as PlayAuthoringFetchOptions, w as PlayAuthoringFileInput, x as PlayAuthoringBindings, y as PlayAuthoringCallExecution, z as PlayAuthoringCallOptions, A as PlayAuthoringFetchResponse, B as PlayAuthoringInputContract, C as PlayAuthoringStepProgramStep, E as PlayAuthoringRuntimeStepOptions, F as PlaySqlListenerDeclaration, G as PlaySqlListenerEvent, H as PlaySqlListenerOperation, I as PlaySqlQuery, J as PlayAuthoringStepOptions, K as PlayAuthoringStepProgram, L as PlayAuthoringStepProgramResolver, M as PlayAuthoringStepResolver, N as PlayToolExecutionRequest, O as PlayAuthoringStepProgramOptions } from './compiler-manifest-Bth3lcZ_.mjs';
2
- export { Q as DEEPLINE_EXTRACTOR_TARGETS, R as DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, S as DeeplineEmailStatusGetterValue, U as DeeplineExtractorTarget, V as DeeplineGetterValue, W as DeeplineGetterValueMap, X as JOB_CHANGE_STATUS_VALUES, Y as JobChangeStatus, Z as PHONE_STATUS_VALUES, _ as PhoneStatus, $ as PlayDataset, a0 as PlayDatasetInput, a1 as PreviousCell, a2 as ProviderTransientError, a3 as ProviderTransientErrorCategory, a4 as ProviderUnavailableError, a5 as ProviderUnavailableReason, a6 as ToolExecutionErrorCategory, a7 as ToolExecutionErrorOrigin, a8 as ToolExecutionFailureV1, a9 as ToolExecutionNetworkKind, aa as ToolExecutionNetworkScope, ab as getProviderUnavailableReason, ac as isDeeplineExtractorTarget, ad as isProviderUnavailable, ae as isProviderWaterfallUnavailableError } from './compiler-manifest-Bth3lcZ_.mjs';
1
+ /// <reference path="./text-imports.d.ts" />
2
+ import { e as PlayRuntimeBackendId, c as PlayCompilerManifest, D as DeeplineError, f as ToolExecutionError, g as ToolExecutionErrorOptions, h as PlayAuthoringColumnMap, i as PlayAuthoringColumnResolver, j as PlayAuthoringRuntimeContext, k as PlayAuthoringConditionalStepResolver, l as PlayAuthoringCsvInput, m as PlayAuthoringCsvOptions, n as PlayAuthoringDatasetBuilder, o as PlayAuthoringDatasetColumnDefinition, p as PlayAuthoringDatasetColumnRunInput, q as ToolExecuteResult, r as PlayAuthoringReferenceLike, s as PlayReturnObject$1, t as PlayAuthoringDefineConfig, u as PlayAuthoringDefinedPlay, v as PlayAuthoringFetchOptions, w as PlayAuthoringFileInput, x as PlayAuthoringBindings, y as PlayAuthoringCallExecution, z as PlayAuthoringCallOptions, A as PlayAuthoringFetchResponse, B as PlayAuthoringInputContract, C as PlayAuthoringStepProgramStep, E as PlayAuthoringRuntimeStepOptions, F as PlaySqlListenerDeclaration, G as PlaySqlListenerEvent, H as PlaySqlListenerOperation, I as PlaySqlQuery, J as PlayAuthoringStepOptions, K as PlayAuthoringStepProgram, L as PlayAuthoringStepProgramResolver, M as PlayAuthoringStepResolver, N as PlayToolExecutionRequest, O as PlayAuthoringStepProgramOptions } from './compiler-manifest-Bd0O94yZ.mjs';
3
+ export { Q as DEEPLINE_EXTRACTOR_TARGETS, R as DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, S as DeeplineEmailStatusGetterValue, U as DeeplineExtractorTarget, V as DeeplineGetterValue, W as DeeplineGetterValueMap, X as JOB_CHANGE_STATUS_VALUES, Y as JobChangeStatus, Z as PHONE_STATUS_VALUES, _ as PhoneStatus, $ as PlayDataset, a0 as PlayDatasetInput, a1 as PreviousCell, a2 as ProviderTransientError, a3 as ProviderTransientErrorCategory, a4 as ProviderUnavailableError, a5 as ProviderUnavailableReason, a6 as ToolExecutionErrorCategory, a7 as ToolExecutionErrorOrigin, a8 as ToolExecutionFailureV1, a9 as ToolExecutionNetworkKind, aa as ToolExecutionNetworkScope, ab as getProviderUnavailableReason, ac as isDeeplineExtractorTarget, ad as isProviderUnavailable, ae as isProviderWaterfallUnavailableError } from './compiler-manifest-Bd0O94yZ.mjs';
3
4
  import '@sinclair/typebox';
4
5
 
5
6
  declare const FIXTURE_BEHAVIOR_VERSION: 1;
@@ -1066,6 +1067,10 @@ interface PlayRevisionSummary {
1066
1067
  createdAt?: number;
1067
1068
  /** Unix timestamp (ms) of last update. */
1068
1069
  updatedAt?: number;
1070
+ /** True when this is the revision currently serving live triggers. */
1071
+ isLive?: boolean;
1072
+ /** True when this is the newest saved working revision. */
1073
+ isWorking?: boolean;
1069
1074
  }
1070
1075
  /**
1071
1076
  * Aggregate row-processing stats for a play's sheet.
@@ -2353,12 +2358,8 @@ type MonitorsNamespace = {
2353
2358
  dependents: (key: string) => Promise<MonitorDependents>;
2354
2359
  /** Update a deployed monitor by public key. */
2355
2360
  update: (key: string, patch: Record<string, unknown>) => Promise<MonitorUpdateResult>;
2356
- /**
2357
- * Delete a deployed monitor by public key. Deprovisions the upstream provider
2358
- * resource unless `localOnly` is set. `dryRun` returns the delete plan.
2359
- */
2361
+ /** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. */
2360
2362
  delete: (key: string, options?: {
2361
- localOnly?: boolean;
2362
2363
  dryRun?: boolean;
2363
2364
  }) => Promise<MonitorDeleteResult>;
2364
2365
  /** Reactivate a disabled monitor. `dryRun` returns the reactivation cost. */
@@ -3706,13 +3707,8 @@ declare class DeeplineClient {
3706
3707
  getMonitorDependents(key: string): Promise<MonitorDependents>;
3707
3708
  /** Update a deployed monitor by public key. Prefer `client.monitors.update(...)`. */
3708
3709
  updateMonitor(key: string, patch: Record<string, unknown>): Promise<MonitorUpdateResult>;
3709
- /**
3710
- * Delete a deployed monitor by public key. Deprovisions the upstream provider
3711
- * resource unless `localOnly`; `dryRun` returns the delete plan. Prefer
3712
- * `client.monitors.delete(...)`.
3713
- */
3710
+ /** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
3714
3711
  deleteMonitor(key: string, options?: {
3715
- localOnly?: boolean;
3716
3712
  dryRun?: boolean;
3717
3713
  }): Promise<MonitorDeleteResult>;
3718
3714
  /**
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { e as PlayRuntimeBackendId, c as PlayCompilerManifest, D as DeeplineError, f as ToolExecutionError, g as ToolExecutionErrorOptions, h as PlayAuthoringColumnMap, i as PlayAuthoringColumnResolver, j as PlayAuthoringRuntimeContext, k as PlayAuthoringConditionalStepResolver, l as PlayAuthoringCsvInput, m as PlayAuthoringCsvOptions, n as PlayAuthoringDatasetBuilder, o as PlayAuthoringDatasetColumnDefinition, p as PlayAuthoringDatasetColumnRunInput, q as ToolExecuteResult, r as PlayAuthoringReferenceLike, s as PlayReturnObject$1, t as PlayAuthoringDefineConfig, u as PlayAuthoringDefinedPlay, v as PlayAuthoringFetchOptions, w as PlayAuthoringFileInput, x as PlayAuthoringBindings, y as PlayAuthoringCallExecution, z as PlayAuthoringCallOptions, A as PlayAuthoringFetchResponse, B as PlayAuthoringInputContract, C as PlayAuthoringStepProgramStep, E as PlayAuthoringRuntimeStepOptions, F as PlaySqlListenerDeclaration, G as PlaySqlListenerEvent, H as PlaySqlListenerOperation, I as PlaySqlQuery, J as PlayAuthoringStepOptions, K as PlayAuthoringStepProgram, L as PlayAuthoringStepProgramResolver, M as PlayAuthoringStepResolver, N as PlayToolExecutionRequest, O as PlayAuthoringStepProgramOptions } from './compiler-manifest-Bth3lcZ_.js';
2
- export { Q as DEEPLINE_EXTRACTOR_TARGETS, R as DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, S as DeeplineEmailStatusGetterValue, U as DeeplineExtractorTarget, V as DeeplineGetterValue, W as DeeplineGetterValueMap, X as JOB_CHANGE_STATUS_VALUES, Y as JobChangeStatus, Z as PHONE_STATUS_VALUES, _ as PhoneStatus, $ as PlayDataset, a0 as PlayDatasetInput, a1 as PreviousCell, a2 as ProviderTransientError, a3 as ProviderTransientErrorCategory, a4 as ProviderUnavailableError, a5 as ProviderUnavailableReason, a6 as ToolExecutionErrorCategory, a7 as ToolExecutionErrorOrigin, a8 as ToolExecutionFailureV1, a9 as ToolExecutionNetworkKind, aa as ToolExecutionNetworkScope, ab as getProviderUnavailableReason, ac as isDeeplineExtractorTarget, ad as isProviderUnavailable, ae as isProviderWaterfallUnavailableError } from './compiler-manifest-Bth3lcZ_.js';
1
+ /// <reference path="./text-imports.d.ts" />
2
+ import { e as PlayRuntimeBackendId, c as PlayCompilerManifest, D as DeeplineError, f as ToolExecutionError, g as ToolExecutionErrorOptions, h as PlayAuthoringColumnMap, i as PlayAuthoringColumnResolver, j as PlayAuthoringRuntimeContext, k as PlayAuthoringConditionalStepResolver, l as PlayAuthoringCsvInput, m as PlayAuthoringCsvOptions, n as PlayAuthoringDatasetBuilder, o as PlayAuthoringDatasetColumnDefinition, p as PlayAuthoringDatasetColumnRunInput, q as ToolExecuteResult, r as PlayAuthoringReferenceLike, s as PlayReturnObject$1, t as PlayAuthoringDefineConfig, u as PlayAuthoringDefinedPlay, v as PlayAuthoringFetchOptions, w as PlayAuthoringFileInput, x as PlayAuthoringBindings, y as PlayAuthoringCallExecution, z as PlayAuthoringCallOptions, A as PlayAuthoringFetchResponse, B as PlayAuthoringInputContract, C as PlayAuthoringStepProgramStep, E as PlayAuthoringRuntimeStepOptions, F as PlaySqlListenerDeclaration, G as PlaySqlListenerEvent, H as PlaySqlListenerOperation, I as PlaySqlQuery, J as PlayAuthoringStepOptions, K as PlayAuthoringStepProgram, L as PlayAuthoringStepProgramResolver, M as PlayAuthoringStepResolver, N as PlayToolExecutionRequest, O as PlayAuthoringStepProgramOptions } from './compiler-manifest-Bd0O94yZ.js';
3
+ export { Q as DEEPLINE_EXTRACTOR_TARGETS, R as DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, S as DeeplineEmailStatusGetterValue, U as DeeplineExtractorTarget, V as DeeplineGetterValue, W as DeeplineGetterValueMap, X as JOB_CHANGE_STATUS_VALUES, Y as JobChangeStatus, Z as PHONE_STATUS_VALUES, _ as PhoneStatus, $ as PlayDataset, a0 as PlayDatasetInput, a1 as PreviousCell, a2 as ProviderTransientError, a3 as ProviderTransientErrorCategory, a4 as ProviderUnavailableError, a5 as ProviderUnavailableReason, a6 as ToolExecutionErrorCategory, a7 as ToolExecutionErrorOrigin, a8 as ToolExecutionFailureV1, a9 as ToolExecutionNetworkKind, aa as ToolExecutionNetworkScope, ab as getProviderUnavailableReason, ac as isDeeplineExtractorTarget, ad as isProviderUnavailable, ae as isProviderWaterfallUnavailableError } from './compiler-manifest-Bd0O94yZ.js';
3
4
  import '@sinclair/typebox';
4
5
 
5
6
  declare const FIXTURE_BEHAVIOR_VERSION: 1;
@@ -1066,6 +1067,10 @@ interface PlayRevisionSummary {
1066
1067
  createdAt?: number;
1067
1068
  /** Unix timestamp (ms) of last update. */
1068
1069
  updatedAt?: number;
1070
+ /** True when this is the revision currently serving live triggers. */
1071
+ isLive?: boolean;
1072
+ /** True when this is the newest saved working revision. */
1073
+ isWorking?: boolean;
1069
1074
  }
1070
1075
  /**
1071
1076
  * Aggregate row-processing stats for a play's sheet.
@@ -2353,12 +2358,8 @@ type MonitorsNamespace = {
2353
2358
  dependents: (key: string) => Promise<MonitorDependents>;
2354
2359
  /** Update a deployed monitor by public key. */
2355
2360
  update: (key: string, patch: Record<string, unknown>) => Promise<MonitorUpdateResult>;
2356
- /**
2357
- * Delete a deployed monitor by public key. Deprovisions the upstream provider
2358
- * resource unless `localOnly` is set. `dryRun` returns the delete plan.
2359
- */
2361
+ /** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. */
2360
2362
  delete: (key: string, options?: {
2361
- localOnly?: boolean;
2362
2363
  dryRun?: boolean;
2363
2364
  }) => Promise<MonitorDeleteResult>;
2364
2365
  /** Reactivate a disabled monitor. `dryRun` returns the reactivation cost. */
@@ -3706,13 +3707,8 @@ declare class DeeplineClient {
3706
3707
  getMonitorDependents(key: string): Promise<MonitorDependents>;
3707
3708
  /** Update a deployed monitor by public key. Prefer `client.monitors.update(...)`. */
3708
3709
  updateMonitor(key: string, patch: Record<string, unknown>): Promise<MonitorUpdateResult>;
3709
- /**
3710
- * Delete a deployed monitor by public key. Deprovisions the upstream provider
3711
- * resource unless `localOnly`; `dryRun` returns the delete plan. Prefer
3712
- * `client.monitors.delete(...)`.
3713
- */
3710
+ /** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
3714
3711
  deleteMonitor(key: string, options?: {
3715
- localOnly?: boolean;
3716
3712
  dryRun?: boolean;
3717
3713
  }): Promise<MonitorDeleteResult>;
3718
3714
  /**
package/dist/index.js CHANGED
@@ -783,7 +783,7 @@ var SDK_RELEASE = {
783
783
  // 0.3.0 introduces raw-v2: complete scrubbed provider responses are
784
784
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
785
785
  // getters keep their established compatibility behavior.
786
- version: "0.3.12",
786
+ version: "0.3.14",
787
787
  updateSummary: "New raw-v2 tool responses preserve complete scrubbed provider envelopes at toolResponse.rawV2, including JSON:API included resources, links, cursors, and totals. Existing toolResponse.raw and declared getters keep working unchanged.",
788
788
  contracts: {
789
789
  api: {
@@ -6363,14 +6363,16 @@ var DeeplineClient = class {
6363
6363
  { method: "PATCH", body: patch }
6364
6364
  );
6365
6365
  }
6366
- /**
6367
- * Delete a deployed monitor by public key. Deprovisions the upstream provider
6368
- * resource unless `localOnly`; `dryRun` returns the delete plan. Prefer
6369
- * `client.monitors.delete(...)`.
6370
- */
6366
+ /** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
6371
6367
  async deleteMonitor(key, options) {
6368
+ if (options?.localOnly === true) {
6369
+ throw new DeeplineError(
6370
+ "localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
6371
+ void 0,
6372
+ "MONITOR_LOCAL_ONLY_DELETE_NOT_SUPPORTED"
6373
+ );
6374
+ }
6372
6375
  const params = new URLSearchParams();
6373
- if (options?.localOnly) params.set("local_only", "true");
6374
6376
  if (options?.dryRun) params.set("dry_run", "true");
6375
6377
  const query = params.toString();
6376
6378
  return this.http.request(
package/dist/index.mjs CHANGED
@@ -706,7 +706,7 @@ var SDK_RELEASE = {
706
706
  // 0.3.0 introduces raw-v2: complete scrubbed provider responses are
707
707
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
708
708
  // getters keep their established compatibility behavior.
709
- version: "0.3.12",
709
+ version: "0.3.14",
710
710
  updateSummary: "New raw-v2 tool responses preserve complete scrubbed provider envelopes at toolResponse.rawV2, including JSON:API included resources, links, cursors, and totals. Existing toolResponse.raw and declared getters keep working unchanged.",
711
711
  contracts: {
712
712
  api: {
@@ -6286,14 +6286,16 @@ var DeeplineClient = class {
6286
6286
  { method: "PATCH", body: patch }
6287
6287
  );
6288
6288
  }
6289
- /**
6290
- * Delete a deployed monitor by public key. Deprovisions the upstream provider
6291
- * resource unless `localOnly`; `dryRun` returns the delete plan. Prefer
6292
- * `client.monitors.delete(...)`.
6293
- */
6289
+ /** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
6294
6290
  async deleteMonitor(key, options) {
6291
+ if (options?.localOnly === true) {
6292
+ throw new DeeplineError(
6293
+ "localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
6294
+ void 0,
6295
+ "MONITOR_LOCAL_ONLY_DELETE_NOT_SUPPORTED"
6296
+ );
6297
+ }
6295
6298
  const params = new URLSearchParams();
6296
- if (options?.localOnly) params.set("local_only", "true");
6297
6299
  if (options?.dryRun) params.set("dry_run", "true");
6298
6300
  const query = params.toString();
6299
6301
  return this.http.request(
@@ -226,8 +226,9 @@
226
226
  "dist/cli/index.d.ts",
227
227
  "dist/cli/index.js",
228
228
  "dist/cli/index.mjs",
229
- "dist/compiler-manifest-Bth3lcZ_.d.mts",
230
- "dist/compiler-manifest-Bth3lcZ_.d.ts",
229
+ "dist/cli/text-imports.d.ts",
230
+ "dist/compiler-manifest-Bd0O94yZ.d.mts",
231
+ "dist/compiler-manifest-Bd0O94yZ.d.ts",
231
232
  "dist/helpers.d.mts",
232
233
  "dist/helpers.d.ts",
233
234
  "dist/helpers.js",
@@ -239,6 +240,8 @@
239
240
  "dist/plays/bundle-play-file.d.mts",
240
241
  "dist/plays/bundle-play-file.d.ts",
241
242
  "dist/plays/bundle-play-file.mjs",
243
+ "dist/plays/text-imports.d.ts",
244
+ "dist/text-imports.d.ts",
242
245
  "dist/viewer/viewer.css",
243
246
  "dist/viewer/viewer.js"
244
247
  ],
@@ -1,5 +1,6 @@
1
- import { T as ToolExecutionErrorSchemaVersion, P as PlayAuthoringContractEdition, a as PlayArtifactKind$1, b as PlaySandboxRuntimeDeclaration, c as PlayCompilerManifest } from '../compiler-manifest-Bth3lcZ_.mjs';
2
- export { d as PLAY_ARTIFACT_KINDS } from '../compiler-manifest-Bth3lcZ_.mjs';
1
+ /// <reference path="./text-imports.d.ts" />
2
+ import { T as ToolExecutionErrorSchemaVersion, P as PlayAuthoringContractEdition, a as PlayArtifactKind$1, b as PlaySandboxRuntimeDeclaration, c as PlayCompilerManifest } from '../compiler-manifest-Bd0O94yZ.mjs';
3
+ export { d as PLAY_ARTIFACT_KINDS } from '../compiler-manifest-Bd0O94yZ.mjs';
3
4
  import '@sinclair/typebox';
4
5
 
5
6
  /**
@@ -1,5 +1,6 @@
1
- import { T as ToolExecutionErrorSchemaVersion, P as PlayAuthoringContractEdition, a as PlayArtifactKind$1, b as PlaySandboxRuntimeDeclaration, c as PlayCompilerManifest } from '../compiler-manifest-Bth3lcZ_.js';
2
- export { d as PLAY_ARTIFACT_KINDS } from '../compiler-manifest-Bth3lcZ_.js';
1
+ /// <reference path="./text-imports.d.ts" />
2
+ import { T as ToolExecutionErrorSchemaVersion, P as PlayAuthoringContractEdition, a as PlayArtifactKind$1, b as PlaySandboxRuntimeDeclaration, c as PlayCompilerManifest } from '../compiler-manifest-Bd0O94yZ.js';
3
+ export { d as PLAY_ARTIFACT_KINDS } from '../compiler-manifest-Bd0O94yZ.js';
3
4
  import '@sinclair/typebox';
4
5
 
5
6
  /**
@@ -28,7 +28,10 @@ import {
28
28
  } from "path";
29
29
  import { builtinModules } from "module";
30
30
  import { Parser as Parser2 } from "acorn";
31
- import { build, transformSync } from "esbuild";
31
+ import {
32
+ build,
33
+ transformSync
34
+ } from "esbuild";
32
35
 
33
36
  // ../shared_libs/play-runtime/backend.ts
34
37
  var PLAY_RUNTIME_BACKENDS = {
@@ -5354,6 +5357,7 @@ var SOURCE_EXTENSIONS = [
5354
5357
  ".json"
5355
5358
  ];
5356
5359
  var PLAY_SOURCE_FILE_PATTERN = /\.play\.(?:[cm]?[jt]sx?)$/i;
5360
+ var TEXT_IMPORT_EXTENSIONS = /* @__PURE__ */ new Set([".md", ".txt"]);
5357
5361
  var NODE_BUILTIN_SET = new Set(
5358
5362
  builtinModules.flatMap(
5359
5363
  (name) => name.startsWith("node:") ? [name, name.slice(5)] : [name, `node:${name}`]
@@ -6067,8 +6071,13 @@ function localSdkAliasPlugin(adapter) {
6067
6071
  }
6068
6072
  };
6069
6073
  }
6074
+ function isTextImportFile(path) {
6075
+ return TEXT_IMPORT_EXTENSIONS.has(extname(path));
6076
+ }
6070
6077
  function sourceLoaderForPath(path) {
6071
- const extension = extname(path).toLowerCase();
6078
+ const rawExtension = extname(path);
6079
+ if (TEXT_IMPORT_EXTENSIONS.has(rawExtension)) return "text";
6080
+ const extension = rawExtension.toLowerCase();
6072
6081
  if (extension === ".tsx") return "tsx";
6073
6082
  if (extension === ".jsx") return "jsx";
6074
6083
  if (extension === ".js" || extension === ".mjs" || extension === ".cjs") {
@@ -6251,6 +6260,13 @@ function docflowRuntimeInstrumentationPlugin(customerSourceFilePaths) {
6251
6260
  setup(buildContext) {
6252
6261
  buildContext.onLoad({ filter: /./ }, (args) => {
6253
6262
  if (!customerSourceFiles.has(resolve(args.path))) return void 0;
6263
+ if (isTextImportFile(args.path)) {
6264
+ return {
6265
+ contents: readFileSync(args.path, "utf8"),
6266
+ loader: "text",
6267
+ resolveDir: dirname(args.path)
6268
+ };
6269
+ }
6254
6270
  return {
6255
6271
  contents: instrumentPlayDocflowRuntimeHits(
6256
6272
  readFileSync(args.path, "utf8")
@@ -6411,7 +6427,7 @@ async function analyzeSourceGraph(entryFile, adapter, exportName) {
6411
6427
  "utf-8"
6412
6428
  );
6413
6429
  localFiles.set(absolutePath, sourceCode2);
6414
- if (extname(absolutePath).toLowerCase() === ".json") {
6430
+ if (extname(absolutePath).toLowerCase() === ".json" || isTextImportFile(absolutePath)) {
6415
6431
  return;
6416
6432
  }
6417
6433
  const handleSpecifier = async (specifier, line, column, kind) => {
@@ -6920,6 +6936,10 @@ var SOURCE_EXTENSIONS2 = [
6920
6936
  ".cjs",
6921
6937
  ".json"
6922
6938
  ];
6939
+ var TEXT_IMPORT_EXTENSIONS2 = /* @__PURE__ */ new Set([".md", ".txt"]);
6940
+ function isTextImportFile2(filePath) {
6941
+ return TEXT_IMPORT_EXTENSIONS2.has(extname2(filePath));
6942
+ }
6923
6943
  function sha2562(buffer) {
6924
6944
  return createHash2("sha256").update(buffer).digest("hex");
6925
6945
  }
@@ -7165,6 +7185,9 @@ async function discoverPackagedLocalFiles(entryFile) {
7165
7185
  }
7166
7186
  visitedFiles.add(absolutePath);
7167
7187
  const sourceCode = await readFile2(absolutePath, "utf-8");
7188
+ if (extname2(absolutePath).toLowerCase() === ".json" || isTextImportFile2(absolutePath)) {
7189
+ return;
7190
+ }
7168
7191
  const scanSource = stripCommentsToSpaces2(sourceCode);
7169
7192
  const constants = collectTopLevelStringConstants(sourceCode);
7170
7193
  const childVisits = [];
@@ -0,0 +1,9 @@
1
+ declare module '*.md' {
2
+ const content: string;
3
+ export default content;
4
+ }
5
+
6
+ declare module '*.txt' {
7
+ const content: string;
8
+ export default content;
9
+ }
@@ -0,0 +1,9 @@
1
+ declare module '*.md' {
2
+ const content: string;
3
+ export default content;
4
+ }
5
+
6
+ declare module '*.txt' {
7
+ const content: string;
8
+ export default content;
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.3.12",
3
+ "version": "0.3.14",
4
4
  "description": "GTM data CLI and TypeScript SDK for coding agents",
5
5
  "license": "MIT",
6
6
  "homepage": "https://code.deepline.com",
@@ -35,11 +35,11 @@
35
35
  },
36
36
  "scripts": {
37
37
  "sync-version": "bun ../scripts/sync-sdk-package-version.ts",
38
- "build": "bun ../scripts/sync-sdk-package-version.ts && tsup && bun ../scripts/write-sdk-install-integrity.ts",
39
- "dev": "bun ../scripts/sync-sdk-package-version.ts && tsup --watch",
38
+ "build": "bun ../scripts/sync-sdk-package-version.ts && tsup && bun ../scripts/finalize-sdk-text-import-types.ts && bun ../scripts/write-sdk-install-integrity.ts",
39
+ "dev": "bun ../scripts/sync-sdk-package-version.ts && bun ../scripts/watch-sdk-build.ts",
40
40
  "typecheck": "tsc --noEmit --declaration false --declarationMap false",
41
- "prepack": "bun ../scripts/sync-sdk-package-version.ts && tsup && bun ../scripts/write-sdk-install-integrity.ts",
42
- "prepublishOnly": "bun ../scripts/sync-sdk-package-version.ts && tsup && bun ../scripts/write-sdk-install-integrity.ts"
41
+ "prepack": "bun ../scripts/sync-sdk-package-version.ts && tsup && bun ../scripts/finalize-sdk-text-import-types.ts && bun ../scripts/write-sdk-install-integrity.ts",
42
+ "prepublishOnly": "bun ../scripts/sync-sdk-package-version.ts && tsup && bun ../scripts/finalize-sdk-text-import-types.ts && bun ../scripts/write-sdk-install-integrity.ts"
43
43
  },
44
44
  "dependencies": {
45
45
  "acorn": "^8.17.0",