deepline 0.3.432 → 0.3.434

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 (118) hide show
  1. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  2. package/dist/bundling-sources/shared_libs/monitors/billing/credit-recovery.ts +97 -6
  3. package/dist/bundling-sources/shared_libs/monitors/billing/state.ts +33 -0
  4. package/dist/bundling-sources/shared_libs/monitors/deactivation-reasons.ts +94 -10
  5. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +46 -2
  6. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-message.ts +4 -0
  7. package/dist/bundling-sources/shared_libs/observability/queue-health.ts +4 -4
  8. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +36 -0
  9. package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +8 -19
  10. package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +95 -8
  11. package/dist/bundling-sources/shared_libs/product-notifications/default-policy.ts +1 -1
  12. package/dist/bundling-sources/shared_libs/product-notifications/events.ts +5 -1
  13. package/dist/cli/auth-KFYDF5TS.js +40 -0
  14. package/dist/cli/{auth-J7PBL7MX.mjs → auth-ZWASM3JJ.mjs} +4 -4
  15. package/dist/cli/{billing-MQG6ZJVV.mjs → billing-BICK6R5J.mjs} +4 -4
  16. package/dist/cli/{billing-SJIZYLAY.js → billing-SQI72SQI.js} +73 -73
  17. package/dist/cli/{chunk-YBD74BIU.js → chunk-6AOEQVTN.js} +50 -50
  18. package/dist/cli/{chunk-XEZE25CL.mjs → chunk-6P3SCJZA.mjs} +1 -1
  19. package/dist/cli/{chunk-TWDC5S4Y.js → chunk-6ZGPHO5R.js} +1 -1
  20. package/dist/cli/{chunk-2LN26ID6.mjs → chunk-A4RM6SQK.mjs} +1 -1
  21. package/dist/cli/{chunk-T5H4QYFP.mjs → chunk-CYJJUUIT.mjs} +5 -5
  22. package/dist/cli/{chunk-BH3ZPOWQ.js → chunk-E5HBBE7F.js} +16 -16
  23. package/dist/cli/{chunk-VDPY5H2O.js → chunk-EAZGVI2H.js} +8 -8
  24. package/dist/cli/{chunk-ZM23AO4D.js → chunk-EEQEQRTO.js} +4 -4
  25. package/dist/cli/{chunk-6PGOKDU6.js → chunk-FECJ5LBK.js} +52 -52
  26. package/dist/cli/{chunk-LRBTRCUF.mjs → chunk-GDIZKSKB.mjs} +2 -2
  27. package/dist/cli/{chunk-A27LVC2E.js → chunk-GVMQS6G7.js} +10 -10
  28. package/dist/cli/{chunk-7EH5BMGH.mjs → chunk-HMJS4EP4.mjs} +3 -3
  29. package/dist/cli/{chunk-NVHT5QVI.mjs → chunk-ISU67CJA.mjs} +3 -3
  30. package/dist/cli/{chunk-6K6BT5BB.mjs → chunk-ISUKMN5B.mjs} +1 -1
  31. package/dist/cli/{chunk-7FEOBXCX.mjs → chunk-K324EUI2.mjs} +8 -8
  32. package/dist/cli/{chunk-4FE6NO56.mjs → chunk-KHR6V4CE.mjs} +1 -1
  33. package/dist/cli/{chunk-RP4IYLHA.js → chunk-KPPCM62O.js} +6 -6
  34. package/dist/cli/{chunk-TZ4TBQ2Z.js → chunk-KXB5UAFH.js} +2 -2
  35. package/dist/cli/{chunk-SH6USDDK.mjs → chunk-NBZGQRBQ.mjs} +3 -3
  36. package/dist/cli/{chunk-3PFDDZSK.mjs → chunk-NIRI3ILU.mjs} +1 -1
  37. package/dist/cli/{chunk-2ZU5KRRK.js → chunk-NLD7TUJ6.js} +8 -8
  38. package/dist/cli/{chunk-LUMGUYE2.mjs → chunk-NP5HEQAW.mjs} +2 -2
  39. package/dist/cli/{chunk-4UEGE3TL.js → chunk-OLWNESMO.js} +35 -35
  40. package/dist/cli/{chunk-GZRBC7HZ.js → chunk-Q7IWP5UM.js} +2 -2
  41. package/dist/cli/{chunk-HVDBBCAX.mjs → chunk-QY2DYCUJ.mjs} +2 -2
  42. package/dist/cli/{chunk-YX7MZDHZ.mjs → chunk-S57PLAGM.mjs} +1 -1
  43. package/dist/cli/{chunk-LNDWFZLO.js → chunk-SVRL42S7.js} +26 -26
  44. package/dist/cli/{chunk-DUFJ3BW3.js → chunk-TFOUACKF.js} +20 -20
  45. package/dist/cli/{chunk-IDFPNLVX.mjs → chunk-VFNLUKRT.mjs} +4 -4
  46. package/dist/cli/{chunk-MXCJJGKV.mjs → chunk-WB7HZOGR.mjs} +2 -2
  47. package/dist/cli/{chunk-WDXXERQH.js → chunk-XVDYAJ4B.js} +79 -79
  48. package/dist/cli/{chunk-WERGMZWN.js → chunk-XZBBTLIL.js} +6 -6
  49. package/dist/cli/{csv-2KJBPEMG.mjs → csv-4VNH4CNZ.mjs} +3 -3
  50. package/dist/cli/{csv-Q47QCDHB.js → csv-JDI6IB23.js} +12 -12
  51. package/dist/cli/{db-RKW225IP.mjs → db-2BT7CMVU.mjs} +4 -4
  52. package/dist/cli/{db-FRBOGK6B.js → db-RIXQ4WX5.js} +25 -25
  53. package/dist/cli/{describe-VEREOGGY.js → describe-ODFGJI7Q.js} +16 -16
  54. package/dist/cli/{describe-3Q7NYXXU.mjs → describe-SF4TKH2Y.mjs} +12 -12
  55. package/dist/cli/describe-core.d.mts +1 -1
  56. package/dist/cli/describe-core.d.ts +1 -1
  57. package/dist/cli/{executions-FL3NUICN.mjs → executions-DNPJRBW2.mjs} +4 -4
  58. package/dist/cli/{executions-I4L6VJZB.js → executions-HZTV7BRI.js} +6 -6
  59. package/dist/cli/{feedback-WTZLQVI3.js → feedback-OBODUERI.js} +7 -7
  60. package/dist/cli/{feedback-NAGE2PRW.mjs → feedback-SK5AKR7W.mjs} +3 -3
  61. package/dist/cli/{git-QNJZP2MW.mjs → git-7IE5J53C.mjs} +4 -4
  62. package/dist/cli/git-WMBBN7S7.js +24 -0
  63. package/dist/cli/index.js +131 -131
  64. package/dist/cli/index.mjs +36 -36
  65. package/dist/cli/{legacy-noops-2RXFVWWK.js → legacy-noops-CVHQS2Z4.js} +7 -7
  66. package/dist/cli/{legacy-noops-N5YDGZUF.mjs → legacy-noops-UIQWCOGF.mjs} +4 -4
  67. package/dist/cli/{monitors-CAZWVMZQ.js → monitors-37W655H5.js} +84 -84
  68. package/dist/cli/{monitors-ONRSWSUR.mjs → monitors-47U23SEH.mjs} +4 -4
  69. package/dist/cli/{org-VEDGZPM5.js → org-AS7BDCF2.js} +64 -64
  70. package/dist/cli/{org-XNOK4ER3.mjs → org-Z3WRCPPN.mjs} +4 -4
  71. package/dist/cli/{play-IGZ5BFVM.mjs → play-CQNGRFJX.mjs} +10 -10
  72. package/dist/cli/{play-HQVDEYK4.js → play-IDRYO2XG.js} +283 -283
  73. package/dist/cli/{providers-JQIY4LTO.js → providers-LXH4JT4W.js} +7 -7
  74. package/dist/cli/{providers-YCUFONNU.mjs → providers-XFGJTDA2.mjs} +4 -4
  75. package/dist/cli/{quickstart-2VOWSIUB.js → quickstart-AFPLY6AL.js} +5 -5
  76. package/dist/cli/{quickstart-TMYBEJO5.mjs → quickstart-I34EZG6K.mjs} +3 -3
  77. package/dist/cli/{search-KDSGVOKV.mjs → search-GV3H73R7.mjs} +5 -5
  78. package/dist/cli/search-HBEAM36R.js +30 -0
  79. package/dist/cli/{secrets-MOAG6VTW.js → secrets-ADPINHAV.js} +13 -13
  80. package/dist/cli/{secrets-727RQLRS.mjs → secrets-Z2RLL7MD.mjs} +4 -4
  81. package/dist/cli/{sessions-GTOWZM56.js → sessions-A635YVAT.js} +5 -5
  82. package/dist/cli/{sessions-FOJSYLPP.mjs → sessions-H7QVYCTY.mjs} +4 -4
  83. package/dist/cli/{settings-GH2LESJC.js → settings-G6FM442W.js} +75 -75
  84. package/dist/cli/{settings-PHQWG5PA.mjs → settings-LUYTVWTR.mjs} +8 -8
  85. package/dist/cli/{setup-K3QF5D4M.js → setup-7Y3JAMBT.js} +42 -42
  86. package/dist/cli/{setup-3MLWDT7O.mjs → setup-EPRBDJXZ.mjs} +7 -7
  87. package/dist/cli/{skills-O7LZQCX7.mjs → skills-2SNUHQC7.mjs} +5 -5
  88. package/dist/cli/skills-GV2L7QWT.js +29 -0
  89. package/dist/cli/{tools-JFR7OIWE.mjs → tools-PJPLF63I.mjs} +12 -12
  90. package/dist/cli/tools-PXECTR3C.js +44 -0
  91. package/dist/cli/{update-XAIGSL6B.mjs → update-JP7BOOIZ.mjs} +7 -7
  92. package/dist/cli/update-LKVWKWIV.js +31 -0
  93. package/dist/cli/{workflow-7MJHESH5.mjs → workflow-42ISZKK5.mjs} +5 -5
  94. package/dist/cli/{workflow-OBS3E5YV.js → workflow-L33RGJ4A.js} +15 -15
  95. package/dist/{client-C0VoQB5b.d.ts → client-CgmfMj_N.d.ts} +73 -4
  96. package/dist/{client-BuCrTjW6.d.mts → client-DIY1WpSW.d.mts} +73 -4
  97. package/dist/index.d.mts +2 -2
  98. package/dist/index.d.ts +2 -2
  99. package/dist/index.js +6 -6
  100. package/dist/index.mjs +3 -3
  101. package/dist/install-integrity.json +80 -80
  102. package/dist/plays/play-description.d.mts +1 -1
  103. package/dist/plays/play-description.d.ts +1 -1
  104. package/dist/plays/run-request.d.mts +1 -1
  105. package/dist/plays/run-request.d.ts +1 -1
  106. package/dist/release.d.mts +1 -1
  107. package/dist/release.d.ts +1 -1
  108. package/dist/release.js +2 -2
  109. package/dist/release.mjs +1 -1
  110. package/dist/viewer/viewer.css +4 -0
  111. package/dist/viewer/viewer.js +19 -3
  112. package/package.json +1 -1
  113. package/dist/cli/auth-CAEXNNLE.js +0 -40
  114. package/dist/cli/git-YVMBJSIX.js +0 -24
  115. package/dist/cli/search-OFXBZEHY.js +0 -30
  116. package/dist/cli/skills-4TXIFS73.js +0 -29
  117. package/dist/cli/tools-WXKOQ2KT.js +0 -44
  118. package/dist/cli/update-MNROQP5A.js +0 -31
@@ -7,6 +7,7 @@ import type {
7
7
  import { PRODUCT_NOTIFICATION_EVENT_CATALOG } from './contract';
8
8
  import {
9
9
  ProductNotificationEvent,
10
+ ProductNotificationTargetPath,
10
11
  getProductNotificationEventDefinition,
11
12
  productNotificationTriggerIsAllowed,
12
13
  type ProductNotificationEventName,
@@ -136,6 +137,30 @@ function validateInsufficientCreditDisable(
136
137
  }
137
138
  }
138
139
 
140
+ function validateMonthlyCapMonitorDisable(trigger: ProductNotificationTrigger) {
141
+ if (
142
+ trigger.kind !== 'state_transition' ||
143
+ trigger.targetState !== 'disabled' ||
144
+ trigger.reasonCode !== 'monthly_cap_exceeded'
145
+ ) {
146
+ throw new Error(
147
+ 'Spending-cap Monitor rules must enter disabled for monthly_cap_exceeded.',
148
+ );
149
+ }
150
+ }
151
+
152
+ /**
153
+ * KAR-43 decision 7: a shutdown notification goes only to a workspace that
154
+ * has at least one Monitor. A workspace-wide shutdown event names how many
155
+ * Monitors it switched off; a per-Monitor event is itself a Monitor.
156
+ */
157
+ function switchedOffAMonitor(payload: ProductNotificationFacts): boolean {
158
+ return (
159
+ payload.affectedMonitorCount === undefined ||
160
+ Number(payload.affectedMonitorCount) >= 1
161
+ );
162
+ }
163
+
139
164
  function validateFailedOutcome(trigger: ProductNotificationTrigger) {
140
165
  if (trigger.kind === 'consecutive_outcomes' && trigger.outcome !== 'failed') {
141
166
  throw new Error('Failure rules require failed consecutive outcomes.');
@@ -321,14 +346,19 @@ const PRODUCT_NOTIFICATION_TYPE_REGISTRY = [
321
346
  requiredFilter: {},
322
347
  allowedTriggers: ['state_transition'],
323
348
  catalog: {
324
- name: 'Monitor disabled due to insufficient credits',
349
+ name: 'Monitors turned off due to insufficient credits',
325
350
  category: 'credits',
326
351
  description:
327
- 'Notify when Deepline disables a Monitor because the workspace ran out of credits.',
352
+ "Notify when Deepline turns off the workspace's Monitors because it ran out of credits. Adding credits turns them back on.",
328
353
  allowMultiple: false,
329
354
  editor: { kind: 'none' },
330
355
  },
331
356
  rule: {
357
+ // KAR-43: on by default for workspace owners, once per shutdown. The
358
+ // workspace condition fires on the first Monitor switched off and
359
+ // rearms when the balance rises.
360
+ default: { ruleKey: 'default.monitor_disabled', groupKey: 'default' },
361
+ eligible: switchedOffAMonitor,
332
362
  conditionSubject: 'workspace',
333
363
  rearm: {
334
364
  eventName: ProductNotificationEvent.CreditsBalanceChanged,
@@ -345,15 +375,72 @@ const PRODUCT_NOTIFICATION_TYPE_REGISTRY = [
345
375
  }),
346
376
  validate: validateInsufficientCreditDisable,
347
377
  present: ({ payload }) => ({
348
- title: 'Monitor disabled due to insufficient credits',
378
+ title: 'Monitors turned off: out of credits',
349
379
  summary: [
350
- `${payload.monitorName} was disabled because your `,
380
+ 'Deepline turned off the Monitors in your ',
351
381
  { workspace: true },
352
- ' ran out of credits.',
382
+ ' because it ran out of credits.',
353
383
  ],
354
- details: [],
355
- targetUrl: String(payload.targetUrl),
356
- subjectKind: 'monitor',
384
+ details: [
385
+ 'Add credits to turn them back on. Monitors resume automatically once the balance is above zero.',
386
+ 'Events that arrive while Monitors are off are not delivered later.',
387
+ ],
388
+ targetUrl: ProductNotificationTargetPath.Billing,
389
+ subjectKind: 'workspace_monitors',
390
+ subjectId: String(payload.monitorId),
391
+ severity: 'error',
392
+ }),
393
+ },
394
+ },
395
+ {
396
+ id: 'monitor.disabled.monthly_cap_exceeded',
397
+ eventName: ProductNotificationEvent.MonitorLifecycleChanged,
398
+ requiredFilter: {},
399
+ allowedTriggers: ['state_transition'],
400
+ catalog: {
401
+ name: 'Monitors turned off at the spending cap',
402
+ category: 'credits',
403
+ description:
404
+ "Notify when Deepline turns off the workspace's Monitors because it reached its monthly spending cap. Raising the cap, or the next billing period, turns them back on.",
405
+ allowMultiple: false,
406
+ editor: { kind: 'none' },
407
+ },
408
+ rule: {
409
+ default: {
410
+ ruleKey: 'default.monitor_disabled_monthly_cap',
411
+ groupKey: 'default',
412
+ },
413
+ eligible: switchedOffAMonitor,
414
+ conditionSubject: 'workspace',
415
+ // Monitors coming back under the cap rearm it for the next shutdown.
416
+ rearm: {
417
+ eventName: ProductNotificationEvent.MonitorLifecycleChanged,
418
+ matches: (payload) =>
419
+ payload.currentState === 'active' &&
420
+ payload.reasonCode === 'monthly_cap_exceeded',
421
+ },
422
+ create: (_input, base) => ({
423
+ ...base,
424
+ trigger: {
425
+ kind: 'state_transition',
426
+ targetState: 'disabled',
427
+ reasonCode: 'monthly_cap_exceeded',
428
+ },
429
+ }),
430
+ validate: validateMonthlyCapMonitorDisable,
431
+ present: ({ payload }) => ({
432
+ title: 'Monitors turned off: spending cap reached',
433
+ summary: [
434
+ 'Deepline turned off the Monitors in your ',
435
+ { workspace: true },
436
+ ' because it reached its monthly spending cap.',
437
+ ],
438
+ details: [
439
+ 'Raise the cap to turn them back on. Otherwise they resume automatically when the next billing period begins.',
440
+ 'Events that arrive while Monitors are off are not delivered later.',
441
+ ],
442
+ targetUrl: ProductNotificationTargetPath.Billing,
443
+ subjectKind: 'workspace_monitors',
357
444
  subjectId: String(payload.monitorId),
358
445
  severity: 'error',
359
446
  }),
@@ -20,7 +20,7 @@ import {
20
20
  * they create sparse copy-on-write overrides.
21
21
  */
22
22
  export const CURRENT_PRODUCT_NOTIFICATION_DEFAULT_POLICY = {
23
- version: 10,
23
+ version: 11,
24
24
  groups: [
25
25
  {
26
26
  groupKey: 'default',
@@ -128,7 +128,11 @@ export const PRODUCT_NOTIFICATION_EVENT_DEFINITIONS: readonly ProductNotificatio
128
128
  targetUrl: 'string',
129
129
  },
130
130
  orderingSubjectFact: 'monitorId',
131
- optionalFacts: { previousReasonCode: 'string' },
131
+ optionalFacts: {
132
+ previousReasonCode: 'string',
133
+ /** A workspace-wide shutdown names how many Monitors it switched off. */
134
+ affectedMonitorCount: 'number',
135
+ },
132
136
  allowedTriggers: ['state_transition'],
133
137
  },
134
138
  {
@@ -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 _chunk6AOEQVTNjs = require('./chunk-6AOEQVTN.js');
17
+ require('./chunk-XZBBTLIL.js');
18
+ require('./chunk-EEQEQRTO.js');
19
+ require('./chunk-NPBJI7RE.js');
20
+ require('./chunk-XNYIZMNQ.js');
21
+ require('./chunk-PPDBRJRW.js');
22
+ require('./chunk-6ZGPHO5R.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 = _chunk6AOEQVTNjs.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunk6AOEQVTNjs.authStatusLine; exports.clearPendingClaim = _chunk6AOEQVTNjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunk6AOEQVTNjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunk6AOEQVTNjs.handleRegister; exports.handleStatus = _chunk6AOEQVTNjs.handleStatus; exports.handleWait = _chunk6AOEQVTNjs.handleWait; exports.httpJson = _chunk6AOEQVTNjs.httpJson; exports.readPendingAuthClaim = _chunk6AOEQVTNjs.readPendingAuthClaim; exports.readStatusBanner = _chunk6AOEQVTNjs.readStatusBanner; exports.registerAuthCommands = _chunk6AOEQVTNjs.registerAuthCommands; exports.reportSetupCompleted = _chunk6AOEQVTNjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunk6AOEQVTNjs.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunk6AOEQVTNjs.statusBannerLine;
@@ -13,13 +13,13 @@ import {
13
13
  reportSetupCompleted,
14
14
  resolvePendingAuthClaimForResume,
15
15
  statusBannerLine
16
- } from "./chunk-MXCJJGKV.mjs";
17
- import "./chunk-4FE6NO56.mjs";
18
- import "./chunk-6K6BT5BB.mjs";
16
+ } from "./chunk-WB7HZOGR.mjs";
17
+ import "./chunk-KHR6V4CE.mjs";
18
+ import "./chunk-ISUKMN5B.mjs";
19
19
  import "./chunk-MAMVGOSC.mjs";
20
20
  import "./chunk-DLIRSHV6.mjs";
21
21
  import "./chunk-E4IXDAZI.mjs";
22
- import "./chunk-XEZE25CL.mjs";
22
+ import "./chunk-6P3SCJZA.mjs";
23
23
  import "./chunk-WZYKRD7T.mjs";
24
24
  import "./chunk-KRD6H754.mjs";
25
25
  export {
@@ -2,7 +2,7 @@ import {
2
2
  DeeplineClient,
3
3
  iterateCursorPages,
4
4
  requireBillingIdempotencyKey
5
- } from "./chunk-2LN26ID6.mjs";
5
+ } from "./chunk-A4RM6SQK.mjs";
6
6
  import "./chunk-L2VKAASU.mjs";
7
7
  import "./chunk-KCC3FKIW.mjs";
8
8
  import "./chunk-EIMG75BT.mjs";
@@ -13,8 +13,8 @@ import {
13
13
  openInBrowser,
14
14
  printCommandEnvelope,
15
15
  shouldEmitJson
16
- } from "./chunk-4FE6NO56.mjs";
17
- import "./chunk-6K6BT5BB.mjs";
16
+ } from "./chunk-KHR6V4CE.mjs";
17
+ import "./chunk-ISUKMN5B.mjs";
18
18
  import {
19
19
  AuthError,
20
20
  ConfigError
@@ -23,7 +23,7 @@ import "./chunk-DLIRSHV6.mjs";
23
23
  import {
24
24
  DeeplineError
25
25
  } from "./chunk-E4IXDAZI.mjs";
26
- import "./chunk-XEZE25CL.mjs";
26
+ import "./chunk-6P3SCJZA.mjs";
27
27
  import "./chunk-WZYKRD7T.mjs";
28
28
  import "./chunk-KRD6H754.mjs";
29
29