deepline 0.3.506 → 0.3.508

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 (147) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +27 -6
  2. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  3. package/dist/bundling-sources/shared_libs/monitors/deactivation-reasons.ts +38 -1
  4. package/dist/bundling-sources/shared_libs/monitors/fleets/verdict.ts +4 -2
  5. package/dist/bundling-sources/shared_libs/monitors/package.json +4 -0
  6. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-admission-codes.ts +11 -0
  7. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +2 -0
  8. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-errors.ts +15 -0
  9. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-state.ts +24 -4
  10. package/dist/bundling-sources/shared_libs/monitors/provider-resource-failure.ts +405 -0
  11. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +18 -0
  12. package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +1 -0
  13. package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +6 -1
  14. package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +3 -1
  15. package/dist/cli/{auth-ZHFONT2D.mjs → auth-2URIN52G.mjs} +5 -5
  16. package/dist/cli/auth-LFU77QDI.js +43 -0
  17. package/dist/cli/{billing-B2YEMNHE.mjs → billing-IW23GSR5.mjs} +6 -6
  18. package/dist/cli/{billing-3Z7N4WTL.js → billing-R2HY2ZVJ.js} +79 -79
  19. package/dist/cli/{chunk-TS4KFQKS.mjs → chunk-2LY42EZJ.mjs} +1 -1
  20. package/dist/cli/{chunk-ND4WPLTE.mjs → chunk-2PYFXXYA.mjs} +2 -2
  21. package/dist/cli/{chunk-N7G36GXB.js → chunk-2YOM5J3G.js} +26 -26
  22. package/dist/cli/{chunk-SUJIVF6L.js → chunk-3BZ74K27.js} +16 -16
  23. package/dist/cli/{chunk-Z7EHY2MF.mjs → chunk-3C6VBHNW.mjs} +2 -2
  24. package/dist/cli/{chunk-FFGQR5J3.mjs → chunk-3XBI4KZM.mjs} +2 -2
  25. package/dist/cli/{chunk-OHNMJ5XQ.js → chunk-3ZNPIJX6.js} +41 -41
  26. package/dist/cli/{chunk-6RYVIZRP.mjs → chunk-4DAR2GYV.mjs} +2 -2
  27. package/dist/cli/{chunk-E554XCJI.js → chunk-63BGKU3A.js} +96 -96
  28. package/dist/cli/{chunk-OUGJUM5X.mjs → chunk-63MCLOR2.mjs} +6 -6
  29. package/dist/cli/{chunk-FWSEGIT6.js → chunk-74UO7THC.js} +4 -4
  30. package/dist/cli/{chunk-ZZDTWVCQ.js → chunk-7PELFO3C.js} +21 -21
  31. package/dist/cli/{chunk-3F676QXJ.js → chunk-AYNO4VFW.js} +11 -11
  32. package/dist/cli/{chunk-D7OCORZ7.mjs → chunk-C6TP4DR3.mjs} +1 -1
  33. package/dist/cli/{chunk-F7IQQYKV.js → chunk-D73YB5NQ.js} +2 -2
  34. package/dist/cli/{chunk-QAY5AS2H.mjs → chunk-DWV7KM6H.mjs} +10 -10
  35. package/dist/cli/{chunk-2CFTDVEP.mjs → chunk-DZ7JCRAL.mjs} +2 -2
  36. package/dist/cli/{chunk-2OY5DXTC.js → chunk-ESVK4Z7S.js} +1 -1
  37. package/dist/cli/{chunk-YVOS5KSG.mjs → chunk-FRT5MFLF.mjs} +1 -1
  38. package/dist/cli/{chunk-PRIHD5XS.js → chunk-FXKKFM7J.js} +9 -9
  39. package/dist/cli/{chunk-GJNIC2CO.mjs → chunk-GRGZKXLL.mjs} +5 -5
  40. package/dist/cli/{chunk-CHGRURBN.mjs → chunk-IF242BIJ.mjs} +5 -5
  41. package/dist/cli/{chunk-HINTYT5H.js → chunk-IZZ7FFWP.js} +44 -44
  42. package/dist/cli/{chunk-MHRR47VQ.js → chunk-J3LJ37WD.js} +3 -3
  43. package/dist/cli/{chunk-O4DZG4VA.mjs → chunk-JEB6BNIU.mjs} +2 -2
  44. package/dist/cli/{chunk-AD2WJUZA.js → chunk-JRHMPZJX.js} +7 -7
  45. package/dist/cli/{chunk-75NAFY36.js → chunk-JUYW6TSU.js} +7 -7
  46. package/dist/cli/{chunk-2IXXB7OA.mjs → chunk-JXYVBF5L.mjs} +5 -5
  47. package/dist/cli/{chunk-QP333GFE.js → chunk-JYNHHO3J.js} +6 -6
  48. package/dist/cli/{chunk-3BFZEHBH.mjs → chunk-K4RME7AV.mjs} +1 -1
  49. package/dist/cli/{chunk-OPBXKB57.mjs → chunk-KSQO32L5.mjs} +1 -1
  50. package/dist/cli/{chunk-LRSRJJPD.js → chunk-M37I4A2Z.js} +16 -16
  51. package/dist/cli/{chunk-YJKKOSXS.js → chunk-N5HRBS4K.js} +3 -3
  52. package/dist/cli/{chunk-TEMORCEE.mjs → chunk-NC2FIUPX.mjs} +1 -1
  53. package/dist/cli/{chunk-YWZEBPXK.mjs → chunk-OWH7SSBO.mjs} +2 -2
  54. package/dist/cli/{chunk-GRESJ3H3.js → chunk-P7GOQTUN.js} +14 -14
  55. package/dist/cli/{chunk-ONBXTEFQ.mjs → chunk-Q4I5YKN4.mjs} +1 -1
  56. package/dist/cli/{chunk-BQBPVUFJ.mjs → chunk-QBZECLNG.mjs} +3 -3
  57. package/dist/cli/{chunk-ZM5BJ5MP.js → chunk-R4S2AK3Q.js} +53 -53
  58. package/dist/cli/{chunk-XUY7WQ2R.mjs → chunk-RNZQ7RDW.mjs} +2 -2
  59. package/dist/cli/{chunk-F53SGS3C.js → chunk-RUD77W2Y.js} +5 -5
  60. package/dist/cli/{chunk-OD6TASBP.js → chunk-RWXHMG6F.js} +8 -8
  61. package/dist/cli/{chunk-DB54ROPH.js → chunk-TVADI7K5.js} +5 -5
  62. package/dist/cli/{chunk-YEX6RPUO.mjs → chunk-UDH3YMBI.mjs} +1 -1
  63. package/dist/cli/{chunk-BJ5OX62J.mjs → chunk-VXNL4HLE.mjs} +5 -5
  64. package/dist/cli/{chunk-EN7GXLFX.mjs → chunk-XSOLA2ED.mjs} +4 -4
  65. package/dist/cli/{chunk-5ARG7J7A.js → chunk-ZL2ME3UT.js} +6 -6
  66. package/dist/cli/{chunk-26DJ4BDY.js → chunk-ZLIAUR2E.js} +2 -2
  67. package/dist/cli/{csv-ARHQ54HA.mjs → csv-CMJSMC2I.mjs} +4 -4
  68. package/dist/cli/{csv-7K7LK63Y.js → csv-DPDO6BU6.js} +13 -13
  69. package/dist/cli/{db-V4Z2I6DY.js → db-PPPKNTT5.js} +27 -27
  70. package/dist/cli/{db-JBX24NJY.mjs → db-SL3EFN6V.mjs} +6 -6
  71. package/dist/cli/describe-JKZ67X3E.js +50 -0
  72. package/dist/cli/{describe-RBDSGSZ7.mjs → describe-XLN33FJX.mjs} +18 -18
  73. package/dist/cli/describe-core.d.mts +2 -2
  74. package/dist/cli/describe-core.d.ts +2 -2
  75. package/dist/cli/{executions-XEZKV5QU.js → executions-6YDTV2J6.js} +8 -8
  76. package/dist/cli/{executions-BAZEU63W.mjs → executions-O6Z5B5NY.mjs} +6 -6
  77. package/dist/cli/{feedback-LOERESRU.js → feedback-BZ434BN4.js} +8 -8
  78. package/dist/cli/{feedback-YDSWBHCO.mjs → feedback-DP7LPWAD.mjs} +4 -4
  79. package/dist/cli/{git-4Z3W2CQU.mjs → git-MI7E5WGL.mjs} +5 -5
  80. package/dist/cli/git-U5N6CTML.js +25 -0
  81. package/dist/cli/index.js +138 -138
  82. package/dist/cli/index.mjs +41 -41
  83. package/dist/cli/{legacy-noops-4QIQPVE5.js → legacy-noops-65WNPQVZ.js} +8 -8
  84. package/dist/cli/{legacy-noops-E4HH7S5O.mjs → legacy-noops-6VYXF2MG.mjs} +5 -5
  85. package/dist/cli/{monitors-QBHDSDA7.js → monitors-BYUCTVSC.js} +127 -112
  86. package/dist/cli/{monitors-FPDW5DDM.mjs → monitors-Y7I5ZVCN.mjs} +34 -19
  87. package/dist/cli/{org-JO4GGSAH.js → org-F2ASWTFY.js} +72 -72
  88. package/dist/cli/{org-UCDHIHAD.mjs → org-IW3YD6JZ.mjs} +6 -6
  89. package/dist/cli/{pages-6V52IZXY.mjs → pages-H2CXNIDB.mjs} +6 -6
  90. package/dist/cli/{pages-FJAAXAWO.js → pages-X6HLRQNV.js} +18 -18
  91. package/dist/cli/{play-F3AENS6W.js → play-H2EM7DTI.js} +317 -317
  92. package/dist/cli/{play-MF4DWROJ.mjs → play-LLEEDXRX.mjs} +18 -18
  93. package/dist/cli/{providers-XXOQLPX7.js → providers-6R2SPOEV.js} +9 -9
  94. package/dist/cli/{providers-NJJLTECA.mjs → providers-BZR5JONN.mjs} +6 -6
  95. package/dist/cli/{quickstart-Z5MSMI7S.mjs → quickstart-KVES7R6D.mjs} +4 -4
  96. package/dist/cli/{quickstart-JCE3XGQG.js → quickstart-PW7ONQUH.js} +6 -6
  97. package/dist/cli/{run-X2DNIW3F.js → run-HVUQROBE.js} +41 -41
  98. package/dist/cli/{run-56UGPIRL.mjs → run-RDI3Q6GO.mjs} +23 -23
  99. package/dist/cli/{search-SZYI4NBB.mjs → search-3TJ24CUF.mjs} +8 -8
  100. package/dist/cli/search-NKEEGLY6.js +33 -0
  101. package/dist/cli/{search-output-7UNT6EMP.js → search-output-JHT553SL.js} +6 -6
  102. package/dist/cli/{search-output-T35QNZUF.mjs → search-output-Y57OBQXX.mjs} +4 -4
  103. package/dist/cli/{secrets-Q36VC35L.mjs → secrets-OZK7GRD5.mjs} +6 -6
  104. package/dist/cli/{secrets-JMUAVIVC.js → secrets-U5JHWAXU.js} +15 -15
  105. package/dist/cli/{sessions-HG6I3HMY.mjs → sessions-D6DSEQ2T.mjs} +5 -5
  106. package/dist/cli/{sessions-SUXU7OM7.js → sessions-PNMYAJNB.js} +6 -6
  107. package/dist/cli/{settings-UIELQ5CV.js → settings-DLPEHYGS.js} +82 -82
  108. package/dist/cli/{settings-Z76XW4KF.mjs → settings-ITLSLT2R.mjs} +12 -12
  109. package/dist/cli/{setup-OXNYAOQ4.mjs → setup-XTYLF2CF.mjs} +10 -10
  110. package/dist/cli/{setup-2L7H5P2O.js → setup-Y5ZYEC6U.js} +50 -50
  111. package/dist/cli/{skills-XSNLXJGI.mjs → skills-C4WCAVII.mjs} +8 -8
  112. package/dist/cli/skills-K6FVG3BX.js +37 -0
  113. package/dist/cli/tools-LSALTN7I.js +57 -0
  114. package/dist/cli/{tools-SUSFAYFH.mjs → tools-ZESAPVOW.mjs} +17 -17
  115. package/dist/cli/{update-ENSTG3QO.mjs → update-4PCKVDCS.mjs} +10 -10
  116. package/dist/cli/update-P5KGNFNL.js +35 -0
  117. package/dist/cli/{workflow-Z33QE6VT.mjs → workflow-42CL4TVR.mjs} +7 -7
  118. package/dist/cli/{workflow-FMBZNY4F.js → workflow-XXKXMPTI.js} +17 -17
  119. package/dist/{client-Cx0420fs.d.ts → client-BlwD-G4v.d.ts} +1 -1
  120. package/dist/{client-BDbouy3Y.d.mts → client-DMpsMNH9.d.mts} +1 -1
  121. package/dist/{client-core-CwiVaMZ5.d.mts → client-core-CITtRTbB.d.mts} +27 -8
  122. package/dist/{client-core-B4hq0-m2.d.ts → client-core-DwBLuEkm.d.ts} +27 -8
  123. package/dist/index.d.mts +3 -3
  124. package/dist/index.d.ts +3 -3
  125. package/dist/index.js +9 -9
  126. package/dist/index.mjs +6 -6
  127. package/dist/install-integrity.json +106 -104
  128. package/dist/plays/play-description.d.mts +1 -1
  129. package/dist/plays/play-description.d.ts +1 -1
  130. package/dist/plays/run-request.d.mts +1 -1
  131. package/dist/plays/run-request.d.ts +1 -1
  132. package/dist/release.d.mts +1 -1
  133. package/dist/release.d.ts +1 -1
  134. package/dist/release.js +2 -2
  135. package/dist/release.mjs +1 -1
  136. package/dist/server.d.mts +2 -2
  137. package/dist/server.d.ts +2 -2
  138. package/dist/server.js +5 -5
  139. package/dist/server.mjs +3 -3
  140. package/package.json +1 -1
  141. package/dist/cli/auth-MMHG2OFE.js +0 -43
  142. package/dist/cli/describe-AYXVS6DZ.js +0 -50
  143. package/dist/cli/git-T6WKO7EA.js +0 -25
  144. package/dist/cli/search-B753RTKC.js +0 -33
  145. package/dist/cli/skills-DEVXYGYH.js +0 -37
  146. package/dist/cli/tools-SCGHABDL.js +0 -57
  147. package/dist/cli/update-BSIILGO3.js +0 -35
@@ -1218,17 +1218,36 @@ export type MonitorsAvailableOptions = {
1218
1218
  *
1219
1219
  * `provisioning` is a monitor whose create was recorded but that the provider
1220
1220
  * has not confirmed yet; it delivers no events and does not bill until it
1221
- * becomes `active`. A Fleet is never `provisioning`. Provider cleanup,
1222
- * retries, and failures are Monitor Job progress and must never be added to
1223
- * this union. The `status` and `active` fields below are retained only as
1224
- * deprecated compatibility aliases for older API responses.
1221
+ * becomes `active`. A Fleet is never `provisioning`.
1222
+ *
1223
+ * `errored` is a monitor the provider stopped after it was created, in a way
1224
+ * that resubmitting the same definition cannot fix (for example its LinkedIn
1225
+ * URL no longer resolves). `failure` says why and what to do: update the
1226
+ * monitor's payload, which creates a fresh resource, or delete it. A Fleet is
1227
+ * never `errored`; its member monitors are.
1228
+ *
1229
+ * Provider cleanup and retries are Monitor Job progress and must never be
1230
+ * added to this union. The `status` and `active` fields below are retained
1231
+ * only as deprecated compatibility aliases for older API responses.
1225
1232
  */
1226
1233
  export type MonitorState =
1227
1234
  | 'active'
1228
1235
  | 'provisioning'
1229
1236
  | 'billing_suspended'
1237
+ | 'errored'
1230
1238
  | 'disabled';
1231
1239
 
1240
+ /** Why an `errored` monitor stopped, and what fixes it. */
1241
+ export type MonitorFailure = {
1242
+ /** The provider's reason code, e.g. `source_inaccessible`. */
1243
+ reason: string;
1244
+ /** What the customer does about it. */
1245
+ message: string;
1246
+ failed_at: string;
1247
+ /** Failures of resources created from the current payload. */
1248
+ failure_count: number;
1249
+ };
1250
+
1232
1251
  /** List filters accepted by the canonical state surface. */
1233
1252
  export type MonitorStateFilter = MonitorState | 'all';
1234
1253
 
@@ -1243,6 +1262,8 @@ export type MonitorListEntry = {
1243
1262
  state?: MonitorState;
1244
1263
  /** @deprecated Use state. `inactive` is projected as `disabled`. */
1245
1264
  status?: string;
1265
+ /** Present only while `state` is `errored`. */
1266
+ failure?: MonitorFailure;
1246
1267
  tool?: string;
1247
1268
  /** Generic provider-authored event category for this deployed monitor. */
1248
1269
  type?: string;
@@ -1997,8 +2018,8 @@ export type MonitorsNamespace = {
1997
2018
  options?: MonitorLifecycleOptions,
1998
2019
  ) => Promise<MonitorJobResult | MonitorDeployResult>;
1999
2020
  /** List deployed monitors (active by default). Use `state` to filter the
2000
- * four customer states (`active`, `provisioning`, `billing_suspended`,
2001
- * `disabled`); `status` is retained for older servers.
2021
+ * five customer states (`active`, `provisioning`, `billing_suspended`,
2022
+ * `errored`, `disabled`); `status` is retained for older servers.
2002
2023
  * `includeConsumers` requires a limit of 20 or fewer. */
2003
2024
  list: (options?: MonitorsListOptions) => Promise<MonitorsListResult>;
2004
2025
  /** Fetch one deployed monitor by public key with bounded current listener health. */
@@ -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.506',
208
+ version: '0.3.508',
209
209
  updateSummary: {
210
210
  introducedIn: '0.3.90',
211
211
  summary:
@@ -23,7 +23,17 @@ import {
23
23
  * this off" and "we did, and here is why" must not be the same state.
24
24
  */
25
25
 
26
- export type MonitorDeactivationOwner = 'policy' | 'fleet' | 'admin';
26
+ /**
27
+ * `provider` means the provider itself stopped running the monitor's resource
28
+ * (a TamRadar `radar_failure` after a successful create, KAR-193). The monitor
29
+ * is `errored`: nothing automatic revives it, and only a changed payload, which
30
+ * creates a fresh resource, clears it.
31
+ */
32
+ export type MonitorDeactivationOwner =
33
+ | 'policy'
34
+ | 'fleet'
35
+ | 'admin'
36
+ | 'provider';
27
37
 
28
38
  /**
29
39
  * The delivery window, in days, that `monitors health` reports against.
@@ -92,6 +102,22 @@ export const MONITOR_DEACTIVATION_REASONS: readonly MonitorDeactivationReasonDef
92
102
  resolution:
93
103
  'Re-add the source row and re-sync the fleet, or leave it deactivated.',
94
104
  },
105
+ {
106
+ id: 'provider_source_inaccessible',
107
+ owner: 'provider',
108
+ summary:
109
+ 'Errored because the provider could not reach the source this monitor watches (source_inaccessible).',
110
+ resolution:
111
+ "Update the monitor with the source's current URL, or remove it. Resubmitting the same payload leaves it errored.",
112
+ },
113
+ {
114
+ id: 'provider_resource_failed',
115
+ owner: 'provider',
116
+ summary:
117
+ 'Errored because the provider failed this monitor twice in a row.',
118
+ resolution:
119
+ 'Update or remove the monitor. Resubmitting the same payload leaves it errored.',
120
+ },
95
121
  ];
96
122
 
97
123
  const BY_ID = new Map(
@@ -132,6 +158,17 @@ export function isPolicyDeactivation(id: string | undefined | null): boolean {
132
158
  return monitorDeactivationReason(id)?.owner === 'policy';
133
159
  }
134
160
 
161
+ /**
162
+ * True when the provider failed the monitor's resource and the monitor is
163
+ * `errored` (KAR-193). Automatic audit, repair and policy recovery leave it
164
+ * alone; a payload change is the only way back.
165
+ */
166
+ export function isProviderErroredDeactivation(
167
+ id: string | undefined | null,
168
+ ): boolean {
169
+ return monitorDeactivationReason(id)?.owner === 'provider';
170
+ }
171
+
135
172
  /** Both policy and admin shutdown retain the definition; only policy owns recovery. */
136
173
  export function isMonitorSuspension(id: string | undefined | null): boolean {
137
174
  const owner = monitorDeactivationReason(id)?.owner;
@@ -65,11 +65,13 @@ export const FLEET_SETTLED_VERDICTS = [
65
65
  /**
66
66
  * A Fleet's customer state. A Fleet has no `provisioning` state: its first
67
67
  * convergence is reported by the durable Fleet operation, while each member
68
- * monitor still pending its create reports `provisioning` itself.
68
+ * monitor still pending its create reports `provisioning` itself. Nor is a
69
+ * Fleet `errored`: the provider fails one member's resource, and that member
70
+ * reports `errored` itself.
69
71
  */
70
72
  export type FleetCustomerState = Exclude<
71
73
  ProviderMonitorCustomerState,
72
- 'provisioning'
74
+ 'provisioning' | 'errored'
73
75
  >;
74
76
 
75
77
  /**
@@ -65,6 +65,8 @@
65
65
  "./org-monitor-limits.js": "./org-monitor-limits.ts",
66
66
  "./provider-callback-verification": "./provider-callback-verification.ts",
67
67
  "./provider-callback-verification.js": "./provider-callback-verification.ts",
68
+ "./provider-monitor-admission-codes": "./provider-monitor-admission-codes.ts",
69
+ "./provider-monitor-admission-codes.js": "./provider-monitor-admission-codes.ts",
68
70
  "./provider-monitor-batch-operation": "./provider-monitor-batch-operation.ts",
69
71
  "./provider-monitor-batch-operation.js": "./provider-monitor-batch-operation.ts",
70
72
  "./provider-monitor-control-plane-capability": "./provider-monitor-control-plane-capability.ts",
@@ -93,6 +95,8 @@
93
95
  "./provider-monitor-status.js": "./provider-monitor-status.ts",
94
96
  "./provider-monitor-upstream-identity": "./provider-monitor-upstream-identity.ts",
95
97
  "./provider-monitor-upstream-identity.js": "./provider-monitor-upstream-identity.ts",
98
+ "./provider-resource-failure": "./provider-resource-failure.ts",
99
+ "./provider-resource-failure.js": "./provider-resource-failure.ts",
96
100
  "./provider-webhook-monitor-runtime": "./provider-webhook-monitor-runtime.ts",
97
101
  "./provider-webhook-monitor-runtime.js": "./provider-webhook-monitor-runtime.ts",
98
102
  "./quickstart-prompts": "./quickstart-prompts.ts",
@@ -0,0 +1,11 @@
1
+ // Failure codes shared by the Convex admission mutations that raise them and
2
+ // the monitor flows that decide what to do about them. Convex imports this
3
+ // file, so it holds constants only.
4
+
5
+ /**
6
+ * A create's admission already names a different provider resource than the
7
+ * one now reported for it. One admission belongs to one create, and so to one
8
+ * resource: this is an identity conflict, never a transient failure.
9
+ */
10
+ export const PROVIDER_MONITOR_ADMISSION_RADAR_CONFLICT_CODE =
11
+ 'provider_monitor_admission_radar_conflict';
@@ -542,6 +542,8 @@ export const PROVIDER_MONITOR_BATCH_CHANGE_BUCKETS: Readonly<
542
542
  fleet_converged_inactive: 'removed',
543
543
  provider_batch_created_then_stopped: 'removed',
544
544
  provider_batch_created_then_deleted: 'removed',
545
+ // A start's radar deleted, never adopted, after a newer stop (KAR-198).
546
+ provider_batch_created_then_discarded: 'removed',
545
547
  pending_create_intent_satisfied: 'removed',
546
548
  };
547
549
 
@@ -130,3 +130,18 @@ export class ProviderMonitorStoppedAfterSubmitError extends Error {
130
130
  this.name = 'ProviderMonitorStoppedAfterSubmitError';
131
131
  }
132
132
  }
133
+
134
+ /**
135
+ * The provider failed this monitor's resource and only a payload change fixes
136
+ * it (`errored`, KAR-193). Nothing else may recreate it from the same payload:
137
+ * not a repair (a forced replacement), including one whose batch selected the
138
+ * monitor before the failure webhook landed, and not a priority-only update.
139
+ */
140
+ export class ProviderMonitorErroredRepairRefusedError extends Error {
141
+ constructor(readonly monitorKey: string) {
142
+ super(
143
+ `Monitor "${monitorKey}" is errored: the provider failed its resource. Change its payload or delete it; only a payload change recreates it.`,
144
+ );
145
+ this.name = 'ProviderMonitorErroredRepairRefusedError';
146
+ }
147
+ }
@@ -1,3 +1,5 @@
1
+ import { isProviderErroredDeactivationReason } from './provider-resource-failure';
2
+
1
3
  /** Provider evidence carried only by an exact, fenced terminal deletion. */
2
4
  export type ProviderMonitorDeletionObservation = {
3
5
  providerResourceId: string;
@@ -11,6 +13,11 @@ export type ProviderMonitorDeletionObservation = {
11
13
  * has not yet confirmed that it exists: it does not deliver events or bill
12
14
  * until the create commits and the monitor becomes `active`.
13
15
  *
16
+ * `errored` means the provider failed the monitor's resource after it was
17
+ * created, in a way recreating the same payload cannot fix (KAR-193). It is a
18
+ * customer state, not operation progress: it lasts until the customer changes
19
+ * the payload or removes the monitor, and the fix is theirs to make.
20
+ *
14
21
  * Provider work, retries, and audit evidence intentionally live on separate
15
22
  * axes. They must never become additional values in this union.
16
23
  */
@@ -18,6 +25,7 @@ export type ProviderMonitorCustomerState =
18
25
  | 'active'
19
26
  | 'provisioning'
20
27
  | 'billing_suspended'
28
+ | 'errored'
21
29
  | 'disabled';
22
30
 
23
31
  /**
@@ -159,21 +167,32 @@ export function providerMonitorCustomerStateForBillingState(
159
167
  /**
160
168
  * The single public monitor-state projection. A billing suspension owns the
161
169
  * off state. A `pending_create` lifecycle is `provisioning`: the create was
162
- * recorded but the provider has not confirmed the resource. Otherwise `active`
163
- * is operational proof: a committed active lifecycle and a non-empty provider
170
+ * recorded but the provider has not confirmed the resource. A provider-owned
171
+ * deactivation on a live lifecycle is `errored`. Otherwise `active` is
172
+ * operational proof: a committed active lifecycle and a non-empty provider
164
173
  * resource binding. Internal billing bookkeeping such as an unresolved usage
165
174
  * charge must not make a usable provider resource look disabled.
175
+ *
176
+ * Callers that omit `deactivationReason` never see `errored`; every public
177
+ * list/get projection passes it.
166
178
  */
167
179
  export function providerMonitorCustomerState(input: {
168
180
  lifecycleStatus?: string | null;
169
181
  billingState?: unknown;
170
182
  providerResourceId?: string | null | undefined;
183
+ deactivationReason?: string | null | undefined;
171
184
  }): ProviderMonitorCustomerState {
172
185
  const billingState = providerMonitorCustomerStateForBillingState(
173
186
  input.billingState,
174
187
  );
175
188
  if (billingState === 'billing_suspended') return billingState;
176
189
  if (input.lifecycleStatus === 'pending_create') return 'provisioning';
190
+ if (
191
+ input.lifecycleStatus === 'active' &&
192
+ isProviderErroredDeactivationReason(input.deactivationReason)
193
+ ) {
194
+ return 'errored';
195
+ }
177
196
 
178
197
  const providerResourceId = providerMonitorResourceId(
179
198
  input.providerResourceId,
@@ -186,8 +205,9 @@ export function providerMonitorCustomerState(input: {
186
205
 
187
206
  /**
188
207
  * Deprecated compatibility projection for the old `status`/`active` keys. The
189
- * alias stays two-valued: every non-active state, including `provisioning`,
190
- * is `inactive`.
208
+ * alias stays two-valued: every non-active state, including `provisioning`
209
+ * and `errored`, is `inactive`. An installed CLI that predates `errored`
210
+ * falls back to this alias and shows such a monitor as `disabled`.
191
211
  */
192
212
  export function providerMonitorStatusAlias(
193
213
  state: ProviderMonitorCustomerState,