deepline 0.3.452 → 0.3.453

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +65 -0
  2. package/dist/bundling-sources/sdk/src/http.ts +2 -1
  3. package/dist/bundling-sources/sdk/src/index.ts +2 -0
  4. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  5. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-capability.ts +63 -0
  6. package/dist/cli/{auth-DKZLB6GN.mjs → auth-6CXS55CN.mjs} +4 -4
  7. package/dist/cli/auth-AICIA232.js +40 -0
  8. package/dist/cli/{billing-CN3XSVER.js → billing-QC52XTAD.js} +87 -74
  9. package/dist/cli/{billing-DOFXWAZR.mjs → billing-SWLTV6PV.mjs} +18 -5
  10. package/dist/cli/{chunk-R7YZKHN5.mjs → chunk-2LDU5BMG.mjs} +3 -3
  11. package/dist/cli/{chunk-ELULDUX3.mjs → chunk-43HOSM2F.mjs} +1 -1
  12. package/dist/cli/{chunk-QK65KBWN.mjs → chunk-6CTVXF6X.mjs} +8 -8
  13. package/dist/cli/{chunk-KQUDU3ZE.mjs → chunk-7557D4FM.mjs} +2 -2
  14. package/dist/cli/chunk-BX343KU7.mjs +155 -0
  15. package/dist/cli/{chunk-J5O4AXSO.js → chunk-DMTAFWMS.js} +84 -50
  16. package/dist/cli/{chunk-PBQSX6ES.mjs → chunk-FS2RMEJ7.mjs} +1 -1
  17. package/dist/cli/{chunk-7OI33KE5.js → chunk-HUDUN4AR.js} +2 -2
  18. package/dist/cli/{chunk-2GMAPSJU.mjs → chunk-IFBLLSGH.mjs} +5 -5
  19. package/dist/cli/{chunk-UGPGB4C6.mjs → chunk-IWFI6FTJ.mjs} +4 -153
  20. package/dist/cli/{chunk-RFDIXLRX.mjs → chunk-IXVABCNA.mjs} +1 -1
  21. package/dist/cli/{chunk-L2GATUZK.js → chunk-JOF3B22H.js} +20 -20
  22. package/dist/cli/{chunk-2VERHTKO.js → chunk-KFKM5J2N.js} +2 -2
  23. package/dist/cli/{chunk-FIQ2F5LA.mjs → chunk-KQD6EFPD.mjs} +2 -2
  24. package/dist/cli/{chunk-5DRGDSJL.js → chunk-MP35NE55.js} +26 -26
  25. package/dist/cli/chunk-NOHA3SZJ.js +155 -0
  26. package/dist/cli/{chunk-G5BMPTZD.js → chunk-NSQZUUYB.js} +81 -81
  27. package/dist/cli/{chunk-X4IMX5AO.mjs → chunk-P4UQCYKH.mjs} +4 -4
  28. package/dist/cli/{chunk-ZH6HFV7Y.js → chunk-PJWXEUUH.js} +8 -8
  29. package/dist/cli/{chunk-7JSZOUNU.js → chunk-RG644LJU.js} +1 -1
  30. package/dist/cli/{chunk-M4FFNUF4.js → chunk-RNCIPLU5.js} +50 -50
  31. package/dist/cli/{chunk-ETFVH7PO.js → chunk-RTR2KUU6.js} +10 -10
  32. package/dist/cli/{chunk-JJOSUZMS.mjs → chunk-SQUJHT7O.mjs} +1 -1
  33. package/dist/cli/{chunk-JT4ZSWBK.js → chunk-V6AZQ4JH.js} +16 -16
  34. package/dist/cli/{chunk-74BPYDDG.js → chunk-V7S2RUVE.js} +8 -8
  35. package/dist/cli/{chunk-YWL4ULLT.js → chunk-VG6WESY7.js} +73 -222
  36. package/dist/cli/{chunk-ZKGK2JU3.js → chunk-WTTHH2K3.js} +6 -6
  37. package/dist/cli/{chunk-L6YCGSL4.js → chunk-WWZ4YJ6J.js} +35 -35
  38. package/dist/cli/{chunk-SM5RZ5JC.mjs → chunk-X2LUT22I.mjs} +2 -2
  39. package/dist/cli/{chunk-POSAVPQZ.mjs → chunk-XH4QC5ZX.mjs} +2 -2
  40. package/dist/cli/{chunk-TXN27XQQ.mjs → chunk-XNN3OTGT.mjs} +2 -2
  41. package/dist/cli/{chunk-2SICEJBN.mjs → chunk-XV4463XW.mjs} +35 -1
  42. package/dist/cli/{chunk-WW63S4RC.js → chunk-YU6IE234.js} +6 -6
  43. package/dist/cli/{chunk-RNM4HG3W.mjs → chunk-ZVBLECZX.mjs} +3 -3
  44. package/dist/cli/{csv-QUNUQZYC.mjs → csv-FON4ZQKC.mjs} +3 -3
  45. package/dist/cli/{csv-N25FMDZQ.js → csv-WIQB5XWZ.js} +12 -12
  46. package/dist/cli/{db-WYWDUYXS.mjs → db-3KA62DOQ.mjs} +4 -4
  47. package/dist/cli/{db-2SGG56WR.js → db-VMDDODCN.js} +25 -25
  48. package/dist/cli/{describe-4RBUIHR7.mjs → describe-LGDK77QI.mjs} +13 -12
  49. package/dist/cli/{describe-QQ2XL6PV.js → describe-NTAAHCCX.js} +17 -16
  50. package/dist/cli/describe-core.d.mts +1 -1
  51. package/dist/cli/describe-core.d.ts +1 -1
  52. package/dist/cli/{executions-YLJHAHHX.js → executions-OT2KNJDO.js} +6 -6
  53. package/dist/cli/{executions-WOBIMQ7H.mjs → executions-TM6AMTQ7.mjs} +4 -4
  54. package/dist/cli/{feedback-D653FAXY.js → feedback-4HQGY3TO.js} +7 -7
  55. package/dist/cli/{feedback-VCGVROTY.mjs → feedback-HWLUVFE2.mjs} +3 -3
  56. package/dist/cli/git-QIZWO5BA.js +24 -0
  57. package/dist/cli/{git-SZ6RSLFN.mjs → git-TDJVSPE6.mjs} +4 -4
  58. package/dist/cli/index.js +133 -131
  59. package/dist/cli/index.mjs +39 -37
  60. package/dist/cli/{legacy-noops-TXZ75CWS.js → legacy-noops-XH3FDLWT.js} +7 -7
  61. package/dist/cli/{legacy-noops-UGLTI2ZY.mjs → legacy-noops-YB2PES43.mjs} +4 -4
  62. package/dist/cli/{monitors-VC6YSBYX.js → monitors-E3QFEJKF.js} +276 -124
  63. package/dist/cli/{monitors-HLIW4AIL.mjs → monitors-KQDDMSDR.mjs} +156 -4
  64. package/dist/cli/{org-X4MVTSKM.mjs → org-7X2C7YKA.mjs} +4 -4
  65. package/dist/cli/{org-I3VQDIGZ.js → org-PMTLR7VP.js} +66 -66
  66. package/dist/cli/{play-EAYGEAMI.mjs → play-7FNEPSVR.mjs} +11 -10
  67. package/dist/cli/{play-7TLGGN66.js → play-RH22Z3D6.js} +284 -283
  68. package/dist/cli/{providers-MBTMUEGX.mjs → providers-HOEDJNUK.mjs} +4 -4
  69. package/dist/cli/{providers-IZ3YWZ4E.js → providers-X5NY5IQH.js} +7 -7
  70. package/dist/cli/{quickstart-MBDEV4RJ.js → quickstart-FI4A6VTV.js} +5 -5
  71. package/dist/cli/{quickstart-MDW2NMAS.mjs → quickstart-NCL7P2US.mjs} +3 -3
  72. package/dist/cli/search-6FUMJBIY.js +30 -0
  73. package/dist/cli/{search-4PQZYRQO.mjs → search-UHT7ZNPO.mjs} +5 -5
  74. package/dist/cli/{secrets-S55UCYYR.mjs → secrets-D4ZB5RKB.mjs} +4 -4
  75. package/dist/cli/{secrets-3S7KUS2H.js → secrets-TT6J3SZJ.js} +13 -13
  76. package/dist/cli/{sessions-T6XVN737.mjs → sessions-HRLJ6SLL.mjs} +4 -4
  77. package/dist/cli/{sessions-UEHVIB6W.js → sessions-SRQQZMM7.js} +5 -5
  78. package/dist/cli/{settings-MYAUWNTF.js → settings-EJIKXLC7.js} +76 -75
  79. package/dist/cli/{settings-CGP7XMJZ.mjs → settings-PJJYPWU3.mjs} +9 -8
  80. package/dist/cli/{setup-5Z5HAWEG.js → setup-3FL77Z33.js} +43 -42
  81. package/dist/cli/{setup-U66NZQXB.mjs → setup-DNI6ENFD.mjs} +8 -7
  82. package/dist/cli/skills-DEKOSL7F.js +30 -0
  83. package/dist/cli/{skills-2JS3SNFA.mjs → skills-FO7MY2OE.mjs} +6 -5
  84. package/dist/cli/tools-E6XRW6PW.js +45 -0
  85. package/dist/cli/{tools-G3VYZKTO.mjs → tools-F72WONN3.mjs} +13 -12
  86. package/dist/cli/update-6M3CAS4T.js +32 -0
  87. package/dist/cli/{update-C7CLWWIW.mjs → update-JZU33TC5.mjs} +8 -7
  88. package/dist/cli/{workflow-TBKVIN4S.js → workflow-BGKC73V2.js} +15 -15
  89. package/dist/cli/{workflow-EUMRVXU7.mjs → workflow-PQYQXQPH.mjs} +5 -5
  90. package/dist/{client-CPRaigLC.d.ts → client-D6XhrO0f.d.ts} +26 -1
  91. package/dist/{client-DstDI5TV.d.mts → client-mRA_esYI.d.mts} +26 -1
  92. package/dist/index.d.mts +2 -2
  93. package/dist/index.d.ts +2 -2
  94. package/dist/index.js +6 -6
  95. package/dist/index.mjs +3 -3
  96. package/dist/install-integrity.json +82 -80
  97. package/dist/plays/play-description.d.mts +1 -1
  98. package/dist/plays/play-description.d.ts +1 -1
  99. package/dist/plays/run-request.d.mts +1 -1
  100. package/dist/plays/run-request.d.ts +1 -1
  101. package/dist/release.d.mts +1 -1
  102. package/dist/release.d.ts +1 -1
  103. package/dist/release.js +2 -2
  104. package/dist/release.mjs +1 -1
  105. package/package.json +1 -1
  106. package/dist/cli/auth-36DQP46D.js +0 -40
  107. package/dist/cli/git-T6LBJEY6.js +0 -24
  108. package/dist/cli/search-5B4ZM7VS.js +0 -30
  109. package/dist/cli/skills-JXPQFJAJ.js +0 -29
  110. package/dist/cli/tools-RHRJ4SLY.js +0 -44
  111. package/dist/cli/update-5YBPJ3EQ.js +0 -31
@@ -1285,6 +1285,18 @@ export type MonitorsListOptions = {
1285
1285
  * plans, dependents) and it must not require an SDK bump to evolve.
1286
1286
  */
1287
1287
  export type MonitorCheckResult = Record<string, unknown>;
1288
+
1289
+ export type MonitorPreviewOptions = {
1290
+ /** Sample size, 1-3. The server default is 3. */
1291
+ limit?: number;
1292
+ /** Reuse to recover one preview's result; a new key is a new, paid preview. */
1293
+ idempotencyKey?: string;
1294
+ };
1295
+
1296
+ /** A preview's sample and charge, plus the key that identifies it. */
1297
+ export type MonitorPreviewResult = Record<string, unknown> & {
1298
+ idempotency_key: string;
1299
+ };
1288
1300
  export type MonitorDeployResult = Record<string, unknown>;
1289
1301
  /** Field-level monitor capability spec returned by `client.monitors.get(...)`. */
1290
1302
  export type MonitorSpec = {
@@ -1868,6 +1880,15 @@ export type MonitorsNamespace = {
1868
1880
  ) => Promise<MonitorsAvailableResult>;
1869
1881
  /** Validate a monitor definition without deploying it (no spend). */
1870
1882
  check: (definition: MonitorDefinition) => Promise<MonitorCheckResult>;
1883
+ /**
1884
+ * Sample a few recent matches for a definition before deploying it. Spends
1885
+ * Deepline credits per returned update. Reuse `idempotencyKey` to recover a
1886
+ * lost result without paying again; omit it for a new preview.
1887
+ */
1888
+ preview: (
1889
+ definition: MonitorDefinition,
1890
+ options?: MonitorPreviewOptions,
1891
+ ) => Promise<MonitorPreviewResult>;
1871
1892
  /** Deploy a monitor from a definition. May spend Deepline credits. */
1872
1893
  deploy: (
1873
1894
  definition: MonitorDefinition,
@@ -2850,6 +2871,8 @@ export class DeeplineClient {
2850
2871
  available: (toolIdOrOptions, options) =>
2851
2872
  this.getMonitorsAvailable(toolIdOrOptions, options),
2852
2873
  check: (definition) => this.checkMonitor(definition),
2874
+ preview: (definition, options) =>
2875
+ this.previewMonitor(definition, options),
2853
2876
  deploy: (definition, options) => this.deployMonitor(definition, options),
2854
2877
  sync: (definition, options) =>
2855
2878
  options?.dryRun
@@ -6686,6 +6709,48 @@ export class DeeplineClient {
6686
6709
  });
6687
6710
  }
6688
6711
 
6712
+ /**
6713
+ * Run one paid preview. Prefer `client.monitors.preview(...)`.
6714
+ *
6715
+ * The key is fixed before the request is sent and returned on the result
6716
+ * and on any error (`error.idempotencyKey`), so a caller that loses the
6717
+ * response can repeat the call with it and get the original result without
6718
+ * a second charge. The submission is never replayed automatically.
6719
+ */
6720
+ async previewMonitor(
6721
+ definition: MonitorDefinition,
6722
+ options?: MonitorPreviewOptions,
6723
+ ): Promise<MonitorPreviewResult> {
6724
+ const idempotencyKey =
6725
+ options?.idempotencyKey ??
6726
+ `monitor-preview-${
6727
+ globalThis.crypto?.randomUUID?.() ??
6728
+ `${Date.now()}-${Math.random().toString(36).slice(2)}`
6729
+ }`;
6730
+ try {
6731
+ const result = await this.http.request<Record<string, unknown>>(
6732
+ '/api/v2/monitors/preview',
6733
+ {
6734
+ method: 'POST',
6735
+ body: {
6736
+ ...definition,
6737
+ ...(options?.limit === undefined ? {} : { limit: options.limit }),
6738
+ },
6739
+ headers: { 'Idempotency-Key': idempotencyKey },
6740
+ maxRetries: 0,
6741
+ exactUrlOnly: true,
6742
+ preserveRateLimitResponse: true,
6743
+ },
6744
+ );
6745
+ return { ...result, idempotency_key: idempotencyKey };
6746
+ } catch (error) {
6747
+ if (error && typeof error === 'object') {
6748
+ Object.assign(error, { idempotencyKey });
6749
+ }
6750
+ throw error;
6751
+ }
6752
+ }
6753
+
6689
6754
  /**
6690
6755
  * Deploy a monitor from a definition. `dryRun` validates via the check
6691
6756
  * endpoint and returns the plan without deploying. Prefer
@@ -1036,7 +1036,8 @@ function isMonitorRateLimitEnvelope(parsed: unknown): boolean {
1036
1036
  const response = asRecord(parsed);
1037
1037
  const error = asRecord(response?.error);
1038
1038
  return (
1039
- error?.code === 'monitor_upstream_rate_limited' &&
1039
+ (error?.code === 'monitor_upstream_rate_limited' ||
1040
+ error?.code === 'monitor_preview_rate_limited') &&
1040
1041
  typeof error.message === 'string'
1041
1042
  );
1042
1043
  }
@@ -140,6 +140,8 @@ export type {
140
140
  LegacyMonitorStatusFilter,
141
141
  MonitorListEntry,
142
142
  MonitorCheckResult,
143
+ MonitorPreviewOptions,
144
+ MonitorPreviewResult,
143
145
  MonitorDeployResult,
144
146
  MonitorDetail,
145
147
  MonitorSpec,
@@ -205,7 +205,7 @@ export const SDK_RELEASE = {
205
205
  // getters keep their established compatibility behavior.
206
206
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
207
207
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
208
- version: '0.3.452',
208
+ version: '0.3.453',
209
209
  updateSummary: {
210
210
  introducedIn: '0.3.90',
211
211
  summary:
@@ -286,6 +286,15 @@ export type ProviderMonitorCapabilityDefinition = {
286
286
  maxIds: number;
287
287
  rateLimitId: string;
288
288
  };
289
+ /**
290
+ * Optional paid sample: a few recent matches for the definition being
291
+ * considered, with nothing created. Only payloads whose `payloadField`
292
+ * value is listed can be previewed; every other payload of this capability,
293
+ * and every capability without this field, has no preview. `action` must
294
+ * also appear in `supportActions`, which is what registers it for
295
+ * execution.
296
+ */
297
+ preview?: ProviderMonitorPreviewDescriptor;
289
298
  // Declares that this monitor delivers data to Deepline via an inbound
290
299
  // webhook callback (handled by the provider-callbacks route). Webhook
291
300
  // subscription monitors are inherently inbound; native monitors must set
@@ -349,6 +358,43 @@ const UNLOCKED_ENTITLEMENT_STATUS: ProviderMonitorCapabilityEntitlementStatus =
349
358
  locked: false,
350
359
  };
351
360
 
361
+ export type ProviderMonitorPreviewDescriptor = {
362
+ action: string;
363
+ payloadField: string;
364
+ supportedValues: readonly string[];
365
+ defaultLimit: number;
366
+ maxLimit: number;
367
+ };
368
+
369
+ export type ProviderMonitorPreviewResolution =
370
+ | { available: true; descriptor: ProviderMonitorPreviewDescriptor }
371
+ | { available: false; reason: string };
372
+
373
+ /**
374
+ * Whether this payload of this capability can be previewed. `null` means the
375
+ * capability declares no preview at all, so callers omit preview entirely
376
+ * rather than saying "unavailable" for every monitor.
377
+ */
378
+ export function resolveProviderMonitorPreview(input: {
379
+ capability: Pick<
380
+ ProviderMonitorCapabilityDefinition,
381
+ 'providerCapability' | 'runtime'
382
+ >;
383
+ payload: Record<string, unknown>;
384
+ }): ProviderMonitorPreviewResolution | null {
385
+ const descriptor = input.capability.runtime.preview;
386
+ if (!descriptor) return null;
387
+ const value = input.payload[descriptor.payloadField];
388
+ if (typeof value === 'string' && descriptor.supportedValues.includes(value)) {
389
+ return { available: true, descriptor };
390
+ }
391
+ const label = typeof value === 'string' && value ? value : 'this payload';
392
+ return {
393
+ available: false,
394
+ reason: `Preview isn't available for ${label} yet. Run monitors check, then deploy.`,
395
+ };
396
+ }
397
+
352
398
  export type ProviderMonitorCapabilitySerializable = {
353
399
  provider: string;
354
400
  tool: string;
@@ -381,6 +427,11 @@ export type ProviderMonitorCapabilitySerializable = {
381
427
  included_active_monitors?: number | null;
382
428
  reason?: string;
383
429
  };
430
+ /** Present only when the capability declares a paid preview. */
431
+ preview?: {
432
+ available_for: Record<string, string[]>;
433
+ max_limit: number;
434
+ };
384
435
  next_commands: string[];
385
436
  };
386
437
 
@@ -604,6 +655,18 @@ export function serializeProviderMonitorCapability(
604
655
  : {}),
605
656
  ...(entitlement.reason ? { reason: entitlement.reason } : {}),
606
657
  },
658
+ ...(capability.runtime.preview
659
+ ? {
660
+ preview: {
661
+ available_for: {
662
+ [capability.runtime.preview.payloadField]: [
663
+ ...capability.runtime.preview.supportedValues,
664
+ ],
665
+ },
666
+ max_limit: capability.runtime.preview.maxLimit,
667
+ },
668
+ }
669
+ : {}),
607
670
  next_commands: [],
608
671
  };
609
672
  }
@@ -13,13 +13,13 @@ import {
13
13
  reportSetupCompleted,
14
14
  resolvePendingAuthClaimForResume,
15
15
  statusBannerLine
16
- } from "./chunk-KQUDU3ZE.mjs";
17
- import "./chunk-PBQSX6ES.mjs";
18
- import "./chunk-SM5RZ5JC.mjs";
16
+ } from "./chunk-7557D4FM.mjs";
17
+ import "./chunk-FS2RMEJ7.mjs";
18
+ import "./chunk-X2LUT22I.mjs";
19
19
  import "./chunk-4QF2K7TM.mjs";
20
20
  import "./chunk-DLIRSHV6.mjs";
21
21
  import "./chunk-HBL4PM5Q.mjs";
22
- import "./chunk-RFDIXLRX.mjs";
22
+ import "./chunk-IXVABCNA.mjs";
23
23
  import "./chunk-WZYKRD7T.mjs";
24
24
  import "./chunk-KRD6H754.mjs";
25
25
  export {
@@ -0,0 +1,40 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+ var _chunkRNCIPLU5js = require('./chunk-RNCIPLU5.js');
17
+ require('./chunk-WTTHH2K3.js');
18
+ require('./chunk-RTR2KUU6.js');
19
+ require('./chunk-ALJJRZNJ.js');
20
+ require('./chunk-XNYIZMNQ.js');
21
+ require('./chunk-DIAWYWT5.js');
22
+ require('./chunk-RG644LJU.js');
23
+ require('./chunk-OG64RBAC.js');
24
+ require('./chunk-COGTRVWW.js');
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+ exports.EXIT_WORKSPACE_MISMATCH = _chunkRNCIPLU5js.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunkRNCIPLU5js.authStatusLine; exports.clearPendingClaim = _chunkRNCIPLU5js.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkRNCIPLU5js.clearSatisfiedPendingClaim; exports.handleRegister = _chunkRNCIPLU5js.handleRegister; exports.handleStatus = _chunkRNCIPLU5js.handleStatus; exports.handleWait = _chunkRNCIPLU5js.handleWait; exports.httpJson = _chunkRNCIPLU5js.httpJson; exports.readPendingAuthClaim = _chunkRNCIPLU5js.readPendingAuthClaim; exports.readStatusBanner = _chunkRNCIPLU5js.readStatusBanner; exports.registerAuthCommands = _chunkRNCIPLU5js.registerAuthCommands; exports.reportSetupCompleted = _chunkRNCIPLU5js.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkRNCIPLU5js.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunkRNCIPLU5js.statusBannerLine;