deepline 0.3.398 → 0.3.400

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 (88) hide show
  1. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  2. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-state.ts +6 -0
  3. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/worker-resource-metrics.ts +57 -46
  4. package/dist/cli/{auth-7ZBPAAZU.mjs → auth-JL76JRJP.mjs} +4 -4
  5. package/dist/cli/auth-TNYZVC73.js +40 -0
  6. package/dist/cli/{billing-WHP3YMNQ.js → billing-BPYI4EUH.js} +73 -73
  7. package/dist/cli/{billing-QTWEEL27.mjs → billing-C6QEIDES.mjs} +4 -4
  8. package/dist/cli/{chunk-CTZJLQ7A.js → chunk-2H37YDDG.js} +8 -8
  9. package/dist/cli/{chunk-S22ZQZMU.js → chunk-4OPBTEVW.js} +6 -6
  10. package/dist/cli/{chunk-ZJ7HLJRF.mjs → chunk-6PRUVCMW.mjs} +1 -1
  11. package/dist/cli/{chunk-OU2RZYVS.js → chunk-6SRV2NM3.js} +65 -65
  12. package/dist/cli/{chunk-2QC2T7E3.mjs → chunk-BENKBQ2J.mjs} +4 -4
  13. package/dist/cli/{chunk-IJU5YQSF.mjs → chunk-BRMEK6KG.mjs} +3 -3
  14. package/dist/cli/{chunk-52HHMLRM.mjs → chunk-CKIELGYT.mjs} +5 -5
  15. package/dist/cli/{chunk-6DVXLWPB.mjs → chunk-GCIMQKW4.mjs} +2 -2
  16. package/dist/cli/{chunk-6HXULNTW.mjs → chunk-GMMJMFCQ.mjs} +2 -2
  17. package/dist/cli/{chunk-OVUFHUMG.mjs → chunk-GYJSZ6J6.mjs} +2 -2
  18. package/dist/cli/{chunk-AWQNG55D.mjs → chunk-H33BWG7S.mjs} +1 -1
  19. package/dist/cli/{chunk-Q3FNSWJG.js → chunk-H7Q6RK5Y.js} +44 -44
  20. package/dist/cli/{chunk-NUBIAJI2.js → chunk-IDXATBJB.js} +6 -6
  21. package/dist/cli/{chunk-LCRQKI7D.mjs → chunk-III4UASP.mjs} +1 -1
  22. package/dist/cli/{chunk-HFDBZXMV.js → chunk-JIDNO3FI.js} +1 -1
  23. package/dist/cli/{chunk-J4WYPANC.js → chunk-O4JZTJEP.js} +8 -8
  24. package/dist/cli/{chunk-FDAMQFQ7.js → chunk-ORQE3XBG.js} +50 -50
  25. package/dist/cli/{chunk-JU3PF7WM.js → chunk-OVYVMPEC.js} +4 -4
  26. package/dist/cli/{chunk-U46S43LV.js → chunk-PF3N65JD.js} +2 -2
  27. package/dist/cli/{chunk-G6BP55EP.js → chunk-QUCAOIN7.js} +26 -26
  28. package/dist/cli/{chunk-QP2TRM7M.mjs → chunk-QZDHNVKF.mjs} +1 -1
  29. package/dist/cli/{chunk-6CBU7W56.js → chunk-USSWEZNP.js} +15 -15
  30. package/dist/cli/{chunk-ATDUVJCW.mjs → chunk-UYIRTEU6.mjs} +3 -3
  31. package/dist/cli/{chunk-CH6EFAJ3.mjs → chunk-V3T4CHXI.mjs} +1 -1
  32. package/dist/cli/{csv-TSBHKVNU.mjs → csv-FLNTE5CW.mjs} +3 -3
  33. package/dist/cli/{csv-NM25BBX7.js → csv-NK4QWZNT.js} +12 -12
  34. package/dist/cli/{db-JQN6SYLK.mjs → db-CAGTZIVN.mjs} +4 -4
  35. package/dist/cli/{db-GBDNQJF3.js → db-DU7J3CEM.js} +25 -25
  36. package/dist/cli/{describe-NVLINP5A.js → describe-IWQW7OLG.js} +10 -10
  37. package/dist/cli/{describe-ETTGW5LT.mjs → describe-YJHDN5IE.mjs} +6 -6
  38. package/dist/cli/{executions-6S4KIVEY.mjs → executions-CDFAK267.mjs} +4 -4
  39. package/dist/cli/{executions-IH5JUPIT.js → executions-SUKU6I7V.js} +6 -6
  40. package/dist/cli/{feedback-PGOZLNXU.mjs → feedback-EQKQZTC4.mjs} +3 -3
  41. package/dist/cli/{feedback-ER375ZCB.js → feedback-SRPRMYAN.js} +7 -7
  42. package/dist/cli/git-IRCN2ZZY.js +24 -0
  43. package/dist/cli/{git-7SBFCM52.mjs → git-M555IN55.mjs} +4 -4
  44. package/dist/cli/index.js +89 -89
  45. package/dist/cli/index.mjs +32 -32
  46. package/dist/cli/{legacy-noops-Q4UQIOQN.mjs → legacy-noops-LRNAWLDN.mjs} +4 -4
  47. package/dist/cli/{legacy-noops-IOEF2SB7.js → legacy-noops-M4X6PQFZ.js} +7 -7
  48. package/dist/cli/{monitors-NZ2J4YGD.js → monitors-AOXY55KT.js} +84 -84
  49. package/dist/cli/{monitors-RZYBFY3Z.mjs → monitors-IKRE2U3J.mjs} +4 -4
  50. package/dist/cli/{org-ERUOT4B2.js → org-HNFRABMG.js} +64 -64
  51. package/dist/cli/{org-JLSEM6GG.mjs → org-V5MRHKRO.mjs} +4 -4
  52. package/dist/cli/{play-7TUO7YNG.js → play-LSGWSQE2.js} +231 -231
  53. package/dist/cli/{play-Z73VC7YR.mjs → play-Z22R7FWE.mjs} +7 -7
  54. package/dist/cli/{providers-7HIII2PW.mjs → providers-BJJCETVG.mjs} +4 -4
  55. package/dist/cli/{providers-ABKBK2C7.js → providers-VYVFZR4J.js} +7 -7
  56. package/dist/cli/{quickstart-QQAOCPCZ.mjs → quickstart-EFPCKX32.mjs} +3 -3
  57. package/dist/cli/{quickstart-JBG5RTFZ.js → quickstart-UGWUJK67.js} +5 -5
  58. package/dist/cli/{search-MT2Q64WC.mjs → search-NVPTBYU3.mjs} +5 -5
  59. package/dist/cli/search-V3STUCIN.js +30 -0
  60. package/dist/cli/{secrets-ZFJPIT6B.mjs → secrets-4N4LSDKP.mjs} +4 -4
  61. package/dist/cli/{secrets-MEW6LLU5.js → secrets-ENLLOXON.js} +13 -13
  62. package/dist/cli/{sessions-F2KVVZ2Z.mjs → sessions-7BKKDN5T.mjs} +4 -4
  63. package/dist/cli/{sessions-TBPU4S6M.js → sessions-PHGZZFBP.js} +5 -5
  64. package/dist/cli/{settings-6VDZ6G5V.js → settings-CV2ZCTVK.js} +74 -74
  65. package/dist/cli/{settings-LUDDM7HO.mjs → settings-VWEGOBRP.mjs} +7 -7
  66. package/dist/cli/{setup-IP2KTFYO.js → setup-DEJSO3OM.js} +41 -41
  67. package/dist/cli/{setup-MCEY473G.mjs → setup-KG5HHXZD.mjs} +6 -6
  68. package/dist/cli/{skills-KMJ3CY4O.mjs → skills-EKFHOC3V.mjs} +4 -4
  69. package/dist/cli/skills-YEVGRKB6.js +29 -0
  70. package/dist/cli/{tools-KNLHQ3L6.js → tools-4RLOPQJK.js} +7 -7
  71. package/dist/cli/{tools-WY3PLUA7.mjs → tools-4YNU6U4J.mjs} +6 -6
  72. package/dist/cli/update-2RMF5UZD.js +29 -0
  73. package/dist/cli/{update-XBV52OFM.mjs → update-DE4SJRNA.mjs} +6 -6
  74. package/dist/cli/{workflow-CO7XWS4D.js → workflow-I7QMPLIW.js} +15 -15
  75. package/dist/cli/{workflow-5N5HMYDY.mjs → workflow-ODAFYNZA.mjs} +5 -5
  76. package/dist/index.js +6 -6
  77. package/dist/index.mjs +3 -3
  78. package/dist/install-integrity.json +70 -70
  79. package/dist/release.d.mts +1 -1
  80. package/dist/release.d.ts +1 -1
  81. package/dist/release.js +2 -2
  82. package/dist/release.mjs +1 -1
  83. package/package.json +1 -1
  84. package/dist/cli/auth-3GA2ASQF.js +0 -40
  85. package/dist/cli/git-W6DBPLZO.js +0 -24
  86. package/dist/cli/search-QMQBC6SV.js +0 -30
  87. package/dist/cli/skills-EVIIEX6N.js +0 -29
  88. package/dist/cli/update-LVADY5YE.js +0 -29
@@ -202,7 +202,7 @@ export const SDK_RELEASE = {
202
202
  // getters keep their established compatibility behavior.
203
203
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
204
204
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
205
- version: '0.3.398',
205
+ version: '0.3.400',
206
206
  updateSummary:
207
207
  'Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.',
208
208
  packageCapabilities: {
@@ -1,3 +1,9 @@
1
+ /** Provider evidence carried only by an exact, fenced terminal deletion. */
2
+ export type ProviderMonitorDeletionObservation = {
3
+ providerResourceId: string;
4
+ observedAt: number;
5
+ };
6
+
1
7
  /**
2
8
  * The complete customer-visible lifecycle of a monitor.
3
9
  *
@@ -1,5 +1,5 @@
1
1
  import { statfsSync } from 'node:fs';
2
- import { cpus } from 'node:os';
2
+ import { cpus, totalmem } from 'node:os';
3
3
  import { getHeapStatistics } from 'node:v8';
4
4
 
5
5
  type ReadFile = (path: string, encoding: 'utf8') => string;
@@ -9,7 +9,7 @@ export type WorkerResourceMetrics = {
9
9
  cpuLimitCores: number;
10
10
  memoryUsageBytes: number;
11
11
  memoryLimitBytes: number;
12
- memoryLimitSource: 'cgroup' | 'process_fallback';
12
+ memoryLimitSource: 'cgroup' | 'system_fallback' | 'process_fallback';
13
13
  memoryUtilizationRatio: number;
14
14
  heapUsedBytes: number;
15
15
  heapLimitBytes: number;
@@ -32,8 +32,8 @@ export type WorkerResourcePressureReason = 'cpu' | 'memory' | 'heap';
32
32
  * engine still owns already-claimed tasks and drains them before close.
33
33
  *
34
34
  * Memory pressure requires a real cgroup limit. A local process fallback uses
35
- * RSS as both the observed value and its fallback limit, so it must never
36
- * masquerade as a saturated container.
35
+ * RSS without a container quota. System capacity also remains telemetry-only;
36
+ * neither fallback may masquerade as a finite cgroup admission limit.
37
37
  */
38
38
  export function workerResourcePressureReasons(
39
39
  metrics: Pick<
@@ -50,8 +50,7 @@ export function workerResourcePressureReasons(
50
50
  }> = {},
51
51
  ): WorkerResourcePressureReason[] {
52
52
  const cpuThreshold = thresholds.cpu ?? WORKER_CPU_PRESSURE_RATIO;
53
- const memoryThreshold =
54
- thresholds.memory ?? WORKER_MEMORY_PRESSURE_RATIO;
53
+ const memoryThreshold = thresholds.memory ?? WORKER_MEMORY_PRESSURE_RATIO;
55
54
  const heapThreshold = thresholds.heap ?? WORKER_HEAP_PRESSURE_RATIO;
56
55
  const reasons: WorkerResourcePressureReason[] = [];
57
56
  if (metrics.cpuUtilizationRatio >= cpuThreshold) reasons.push('cpu');
@@ -161,6 +160,7 @@ export function parseCgroupCpuLimit(raw: string, fallback: number): number {
161
160
 
162
161
  /** cgroup v1 reports aggregate CPU time in nanoseconds. */
163
162
  export function parseCgroupV1CpuUsageMicroseconds(raw: string): number | null {
163
+ if (!raw.trim()) return null;
164
164
  const nanoseconds = Number(raw.trim());
165
165
  return Number.isFinite(nanoseconds) && nanoseconds >= 0
166
166
  ? nanoseconds / 1_000
@@ -207,23 +207,26 @@ export function parseFileSystemStats(stats: FileSystemStats | null): {
207
207
 
208
208
  /**
209
209
  * Produces container-scoped CPU and memory gauges for one Fly worker process.
210
- * Fly's guest exposes cgroup v1 memory files and may expose cgroup v2 CPU
211
- * files. Local development falls back to process RSS and host core count,
212
- * preserving a useful metric endpoint without pretending local values are
213
- * container quotas.
210
+ * Fly guests expose v1 controllers, including a combined cpu,cpuacct mount;
211
+ * v2 and separate v1 mounts remain supported. An unlimited memory cgroup uses
212
+ * the guest's physical capacity for telemetry, without expanding the existing
213
+ * finite-cgroup-only memory admission policy.
214
214
  */
215
215
  export function createWorkerResourceMetricsReader(input: {
216
216
  readFile: ReadFile;
217
217
  now?: () => number;
218
218
  cpuCount?: () => number;
219
+ totalMemory?: () => number;
219
220
  memoryUsage?: () => NodeJS.MemoryUsage;
220
221
  heapLimit?: () => number;
221
222
  statfs?: (path: string) => FileSystemStats;
222
223
  }) {
223
224
  const now = input.now ?? Date.now;
224
225
  const cpuCount = input.cpuCount ?? (() => cpus().length || 1);
226
+ const totalMemory = input.totalMemory ?? totalmem;
225
227
  const memoryUsage = input.memoryUsage ?? process.memoryUsage;
226
- const heapLimit = input.heapLimit ?? (() => getHeapStatistics().heap_size_limit);
228
+ const heapLimit =
229
+ input.heapLimit ?? (() => getHeapStatistics().heap_size_limit);
227
230
  const statfs = input.statfs ?? statfsSync;
228
231
  let previousCpu: CpuSample | null = null;
229
232
 
@@ -237,12 +240,16 @@ export function createWorkerResourceMetricsReader(input: {
237
240
 
238
241
  return (): WorkerResourceMetrics => {
239
242
  const fallbackCpuLimit = Math.max(cpuCount(), 1);
240
- const cpuQuota = read('/sys/fs/cgroup/cpu/cpu.cfs_quota_us');
241
- const cpuPeriod = read('/sys/fs/cgroup/cpu/cpu.cfs_period_us');
243
+ const cpuController = ['/sys/fs/cgroup/cpu', '/sys/fs/cgroup/cpu,cpuacct']
244
+ .map((path) => ({
245
+ quota: read(`${path}/cpu.cfs_quota_us`),
246
+ period: read(`${path}/cpu.cfs_period_us`),
247
+ }))
248
+ .find(({ quota, period }) => quota !== null && period !== null);
242
249
  const cpuLimitCores = parseCgroupCpuLimit(
243
250
  read('/sys/fs/cgroup/cpu.max') ??
244
- (cpuQuota !== null && cpuPeriod !== null
245
- ? `${cpuQuota} ${cpuPeriod}`
251
+ (cpuController
252
+ ? `${cpuController.quota} ${cpuController.period}`
246
253
  : 'max'),
247
254
  fallbackCpuLimit,
248
255
  );
@@ -251,23 +258,25 @@ export function createWorkerResourceMetricsReader(input: {
251
258
  parseCgroupCpuUsageMicroseconds(read('/sys/fs/cgroup/cpu.stat') ?? '') ??
252
259
  parseCgroupV1CpuUsageMicroseconds(
253
260
  read('/sys/fs/cgroup/cpuacct/cpuacct.usage') ?? '',
261
+ ) ??
262
+ parseCgroupV1CpuUsageMicroseconds(
263
+ read('/sys/fs/cgroup/cpu,cpuacct/cpuacct.usage') ?? '',
254
264
  );
265
+ const elapsedMs = previousCpu ? sampledAtMs - previousCpu.sampledAtMs : 0;
266
+ const usageDelta =
267
+ cpuUsageMicroseconds !== null && previousCpu
268
+ ? cpuUsageMicroseconds - previousCpu.usageMicroseconds
269
+ : -1;
270
+ // First, missing, reset and same-timestamp samples are unavailable, not idle.
271
+ // Prometheus accepts NaN, and it cannot accidentally trigger admission.
255
272
  const cpuUtilizationRatio =
256
- cpuUsageMicroseconds === null || previousCpu === null
257
- ? 0
258
- : Math.max(
259
- 0,
260
- Math.min(
261
- 1,
262
- (cpuUsageMicroseconds - previousCpu.usageMicroseconds) /
263
- ((sampledAtMs - previousCpu.sampledAtMs) *
264
- 1_000 *
265
- cpuLimitCores),
266
- ),
267
- );
268
- if (cpuUsageMicroseconds !== null) {
269
- previousCpu = { usageMicroseconds: cpuUsageMicroseconds, sampledAtMs };
270
- }
273
+ elapsedMs > 0 && usageDelta >= 0
274
+ ? Math.min(1, usageDelta / (elapsedMs * 1_000 * cpuLimitCores))
275
+ : Number.NaN;
276
+ previousCpu =
277
+ cpuUsageMicroseconds === null
278
+ ? null
279
+ : { usageMicroseconds: cpuUsageMicroseconds, sampledAtMs };
271
280
 
272
281
  const processMemory = memoryUsage();
273
282
  const fallbackMemory = processMemory.rss;
@@ -281,21 +290,23 @@ export function createWorkerResourceMetricsReader(input: {
281
290
  const cgroupMemoryUsage =
282
291
  read('/sys/fs/cgroup/memory.current') ??
283
292
  read('/sys/fs/cgroup/memory/memory.usage_in_bytes');
284
- const cgroupMemoryLimit =
285
- read('/sys/fs/cgroup/memory.max') ??
286
- read('/sys/fs/cgroup/memory/memory.limit_in_bytes');
293
+ // Match readCgroupMemoryLimitBytes: v2 "max" and v1's near-2^63
294
+ // sentinel are unlimited, not usable capacities. Check both mount layouts.
295
+ const cgroupMemoryLimitBytes = [
296
+ read('/sys/fs/cgroup/memory.max'),
297
+ read('/sys/fs/cgroup/memory/memory.limit_in_bytes'),
298
+ ]
299
+ .map((raw) => parseCgroupLimit(raw ?? '', Number.NaN))
300
+ .find((value) => value > 0 && value < Number.MAX_SAFE_INTEGER);
287
301
  const memoryUsageBytes = parseCgroupLimit(
288
302
  cgroupMemoryUsage ?? '',
289
303
  fallbackMemory,
290
304
  );
291
- const memoryLimitBytes = parseCgroupLimit(
292
- cgroupMemoryLimit ?? '',
293
- fallbackMemory,
294
- );
295
- const heapUsedBytes = finiteNonNegative(
296
- processMemory.heapUsed,
297
- 0,
298
- );
305
+ const systemMemory = finiteNonNegative(totalMemory(), 0);
306
+ const memoryLimitBytes =
307
+ cgroupMemoryLimitBytes ??
308
+ (systemMemory > 0 ? systemMemory : fallbackMemory);
309
+ const heapUsedBytes = finiteNonNegative(processMemory.heapUsed, 0);
299
310
  const heapLimitBytes = finiteNonNegative(heapLimit(), 0);
300
311
  return {
301
312
  cpuUtilizationRatio,
@@ -303,11 +314,11 @@ export function createWorkerResourceMetricsReader(input: {
303
314
  memoryUsageBytes,
304
315
  memoryLimitBytes,
305
316
  memoryLimitSource:
306
- cgroupMemoryLimit === null ||
307
- cgroupMemoryLimit === undefined ||
308
- cgroupMemoryLimit.trim() === 'max'
309
- ? 'process_fallback'
310
- : 'cgroup',
317
+ cgroupMemoryLimitBytes !== undefined
318
+ ? 'cgroup'
319
+ : cgroupMemoryUsage !== null && systemMemory > 0
320
+ ? 'system_fallback'
321
+ : 'process_fallback',
311
322
  memoryUtilizationRatio:
312
323
  memoryLimitBytes > 0
313
324
  ? Math.min(1, memoryUsageBytes / memoryLimitBytes)
@@ -13,13 +13,13 @@ import {
13
13
  reportSetupCompleted,
14
14
  resolvePendingAuthClaimForResume,
15
15
  statusBannerLine
16
- } from "./chunk-OVUFHUMG.mjs";
17
- import "./chunk-CH6EFAJ3.mjs";
18
- import "./chunk-ZJ7HLJRF.mjs";
16
+ } from "./chunk-GYJSZ6J6.mjs";
17
+ import "./chunk-V3T4CHXI.mjs";
18
+ import "./chunk-6PRUVCMW.mjs";
19
19
  import "./chunk-YHPYUZZX.mjs";
20
20
  import "./chunk-DLIRSHV6.mjs";
21
21
  import "./chunk-NXGCO4JB.mjs";
22
- import "./chunk-QP2TRM7M.mjs";
22
+ import "./chunk-QZDHNVKF.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 _chunkORQE3XBGjs = require('./chunk-ORQE3XBG.js');
17
+ require('./chunk-4OPBTEVW.js');
18
+ require('./chunk-OVYVMPEC.js');
19
+ require('./chunk-Q2E4E4FJ.js');
20
+ require('./chunk-XNYIZMNQ.js');
21
+ require('./chunk-7P5AA3SN.js');
22
+ require('./chunk-JIDNO3FI.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 = _chunkORQE3XBGjs.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunkORQE3XBGjs.authStatusLine; exports.clearPendingClaim = _chunkORQE3XBGjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkORQE3XBGjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkORQE3XBGjs.handleRegister; exports.handleStatus = _chunkORQE3XBGjs.handleStatus; exports.handleWait = _chunkORQE3XBGjs.handleWait; exports.httpJson = _chunkORQE3XBGjs.httpJson; exports.readPendingAuthClaim = _chunkORQE3XBGjs.readPendingAuthClaim; exports.readStatusBanner = _chunkORQE3XBGjs.readStatusBanner; exports.registerAuthCommands = _chunkORQE3XBGjs.registerAuthCommands; exports.reportSetupCompleted = _chunkORQE3XBGjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkORQE3XBGjs.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunkORQE3XBGjs.statusBannerLine;