deepline 0.3.405 → 0.3.406

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/observability/scheduled-jobs.json +43 -4
  3. package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-machine-lifecycle.ts +101 -0
  4. package/dist/cli/auth-K5QAZH42.js +40 -0
  5. package/dist/cli/{auth-D4GXO4IN.mjs → auth-U7LIMXIS.mjs} +4 -4
  6. package/dist/cli/{billing-TQ4UM4D4.js → billing-5ABVIJFU.js} +73 -73
  7. package/dist/cli/{billing-NVV5VSUJ.mjs → billing-KGGS3444.mjs} +4 -4
  8. package/dist/cli/{chunk-3FF3SPSE.mjs → chunk-2MLY2ZBT.mjs} +2 -2
  9. package/dist/cli/{chunk-EVLCUV64.mjs → chunk-2OFPPAUY.mjs} +4 -4
  10. package/dist/cli/{chunk-EKWJXPIX.mjs → chunk-42RUJLQI.mjs} +1 -1
  11. package/dist/cli/{chunk-NAJEB3N4.js → chunk-4REBZQNK.js} +44 -44
  12. package/dist/cli/{chunk-3DWMYKWU.mjs → chunk-5IGBBYXH.mjs} +1 -1
  13. package/dist/cli/{chunk-MPXPTSGJ.mjs → chunk-77UGRG6X.mjs} +3 -3
  14. package/dist/cli/{chunk-HG5PMETP.mjs → chunk-7ZMVAV2B.mjs} +1 -1
  15. package/dist/cli/{chunk-HYAA3F6U.js → chunk-APLRSERF.js} +6 -6
  16. package/dist/cli/{chunk-TPYRDAU7.mjs → chunk-CGX4NSS3.mjs} +1 -1
  17. package/dist/cli/{chunk-NLT6GCWZ.js → chunk-EKS2FXL5.js} +8 -8
  18. package/dist/cli/{chunk-6HXTHMHZ.js → chunk-FQBKK5DG.js} +26 -26
  19. package/dist/cli/{chunk-MZ4LBCV7.js → chunk-IE6IKRQA.js} +15 -15
  20. package/dist/cli/{chunk-WGX7SIGL.js → chunk-KPU53YBB.js} +65 -65
  21. package/dist/cli/{chunk-BZBV2GY2.js → chunk-N43PX2CA.js} +8 -8
  22. package/dist/cli/{chunk-AAIV3ACM.js → chunk-N6DJQQ2S.js} +50 -50
  23. package/dist/cli/{chunk-JPNBAZBR.js → chunk-NYDRX6JJ.js} +6 -6
  24. package/dist/cli/{chunk-YX7JSSJ2.mjs → chunk-OPHLT4TM.mjs} +2 -2
  25. package/dist/cli/{chunk-B6ME2XIO.mjs → chunk-RXDJKAM2.mjs} +5 -5
  26. package/dist/cli/{chunk-TECEX3K5.mjs → chunk-T7YF4MQH.mjs} +3 -3
  27. package/dist/cli/{chunk-YRZIKG47.mjs → chunk-V3OTRWVK.mjs} +2 -2
  28. package/dist/cli/{chunk-3MVBOBV4.js → chunk-W2BAO4OR.js} +2 -2
  29. package/dist/cli/{chunk-LM2JHRZM.js → chunk-W3ZNQE5Y.js} +1 -1
  30. package/dist/cli/{chunk-4ONG2MWB.mjs → chunk-YLV6PT6B.mjs} +1 -1
  31. package/dist/cli/{chunk-CB6AJNHI.js → chunk-YSAZVLJD.js} +4 -4
  32. package/dist/cli/{csv-H7LD6IQK.mjs → csv-HXJAAW3H.mjs} +3 -3
  33. package/dist/cli/{csv-5AASYDRF.js → csv-U36TIOKU.js} +12 -12
  34. package/dist/cli/{db-CG3UQUA7.mjs → db-GRWD3JAC.mjs} +4 -4
  35. package/dist/cli/{db-MJBZBDWZ.js → db-T5MLQQWJ.js} +25 -25
  36. package/dist/cli/{describe-INFC5ACQ.mjs → describe-HXFEIZFO.mjs} +6 -6
  37. package/dist/cli/{describe-2A7GARI2.js → describe-NFX6THJE.js} +10 -10
  38. package/dist/cli/{executions-AUDQ5HOJ.js → executions-KBHTDL3A.js} +6 -6
  39. package/dist/cli/{executions-DO47P6MX.mjs → executions-YGOS5E44.mjs} +4 -4
  40. package/dist/cli/{feedback-XGZSJM2N.mjs → feedback-NEQGCSHB.mjs} +3 -3
  41. package/dist/cli/{feedback-MNWNDZVU.js → feedback-VP3GWJIH.js} +7 -7
  42. package/dist/cli/git-63RYCZSI.js +24 -0
  43. package/dist/cli/{git-2ECFQKAA.mjs → git-JJ3CHOTL.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-534TKEMO.mjs → legacy-noops-A6KGBODU.mjs} +4 -4
  47. package/dist/cli/{legacy-noops-3UZTD4DS.js → legacy-noops-ITTD33ZN.js} +7 -7
  48. package/dist/cli/{monitors-G4S54JSX.js → monitors-DXVP5YFC.js} +84 -84
  49. package/dist/cli/{monitors-5ARELE2S.mjs → monitors-NGEXCUEY.mjs} +4 -4
  50. package/dist/cli/{org-BAMOOXQW.mjs → org-34DBJSFP.mjs} +4 -4
  51. package/dist/cli/{org-RIWF2TLI.js → org-C4ZTOSQC.js} +64 -64
  52. package/dist/cli/{play-32XSQMFK.js → play-5FWTZCHN.js} +231 -231
  53. package/dist/cli/{play-WV4UNGPR.mjs → play-SVLQKZBG.mjs} +7 -7
  54. package/dist/cli/{providers-XKY2CNKH.js → providers-QWR2HRNY.js} +7 -7
  55. package/dist/cli/{providers-SMSRO23R.mjs → providers-RQTSGYE4.mjs} +4 -4
  56. package/dist/cli/{quickstart-Q2TA72HD.js → quickstart-DHFNEMGY.js} +5 -5
  57. package/dist/cli/{quickstart-BFYYEVSS.mjs → quickstart-W5UHZAEU.mjs} +3 -3
  58. package/dist/cli/{search-I2TVB2P5.mjs → search-U4AJC3FH.mjs} +5 -5
  59. package/dist/cli/search-YAYYU3WD.js +30 -0
  60. package/dist/cli/{secrets-B4NYTSL7.js → secrets-HH4H7BLE.js} +13 -13
  61. package/dist/cli/{secrets-BHKICIE3.mjs → secrets-YSMQ7CVZ.mjs} +4 -4
  62. package/dist/cli/{sessions-XY2UREJ7.js → sessions-AJZXYUCJ.js} +5 -5
  63. package/dist/cli/{sessions-IOR2ZNNH.mjs → sessions-URONRCTV.mjs} +4 -4
  64. package/dist/cli/{settings-W6S7B4NH.mjs → settings-KGAMW4MN.mjs} +7 -7
  65. package/dist/cli/{settings-ASGROQDE.js → settings-QAW62BH4.js} +74 -74
  66. package/dist/cli/{setup-YIYQ73OV.js → setup-KAMFU5VE.js} +41 -41
  67. package/dist/cli/{setup-UUWGI3IN.mjs → setup-P54DPBFO.mjs} +6 -6
  68. package/dist/cli/skills-M2GGHYJU.js +29 -0
  69. package/dist/cli/{skills-CHA4QCGI.mjs → skills-UMWRJ6TL.mjs} +4 -4
  70. package/dist/cli/{tools-PMZDYKTT.mjs → tools-HN4EFVY7.mjs} +6 -6
  71. package/dist/cli/{tools-43ZFJWAQ.js → tools-HX3BHT55.js} +7 -7
  72. package/dist/cli/{update-6VSEGTSG.mjs → update-7AFQCJ75.mjs} +6 -6
  73. package/dist/cli/update-I23NN5QI.js +29 -0
  74. package/dist/cli/{workflow-26EOXZ7M.js → workflow-7EHU5ZPX.js} +15 -15
  75. package/dist/cli/{workflow-SVMVLQOF.mjs → workflow-ARDO4VHU.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-IJKAKAHG.js +0 -40
  85. package/dist/cli/git-6S64UBWC.js +0 -24
  86. package/dist/cli/search-GK7P3AZY.js +0 -30
  87. package/dist/cli/skills-LKNKHB2I.js +0 -29
  88. package/dist/cli/update-R7FODDIW.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.405',
205
+ version: '0.3.406',
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: {
@@ -89,6 +89,45 @@
89
89
  "failureAlert": "github_workflow_run",
90
90
  "domainReportRequired": true
91
91
  },
92
+ {
93
+ "id": "github.cloudflare-tunnel-reconciliation",
94
+ "name": "Cloudflare Tunnel Reconciliation",
95
+ "workflowEvents": ["schedule"],
96
+ "scheduler": "github_actions",
97
+ "cadence": "17 6 * * *",
98
+ "timezone": "UTC",
99
+ "source": ".github/workflows/cloudflare-tunnel-reconciliation.yml",
100
+ "locator": "schedule:",
101
+ "owner": "platform",
102
+ "criticality": "maintenance",
103
+ "purpose": "Report and, only after explicit rollout admission, reclaim exact managed developer tunnel UUIDs from current PR and disconnected-idle evidence while retaining protected, connected, legacy and unknown resources.",
104
+ "successDefinition": "Every selected UUID has a retained, deleted or unresolved outcome with durable intent and rate-budget evidence; disabled rollout and zero eligible resources are explicit no-ops, and unresolved outcomes fail the pass.",
105
+ "failureDefinition": "Provider or GitHub authority is unavailable, ownership or idle eligibility is misclassified, deletion remains unresolved, a continuation cannot finish, or immutable intent and outcome evidence is missing.",
106
+ "startGraceMs": 600000,
107
+ "runTimeoutMs": 84600000,
108
+ "failureAlert": "github_workflow_run",
109
+ "domainReportRequired": true
110
+ },
111
+ {
112
+ "id": "github.cloudflare-tunnel-reconciliation-events",
113
+ "name": "Cloudflare Tunnel Reconciliation events",
114
+ "workflowName": "Cloudflare Tunnel Reconciliation",
115
+ "workflowEvents": ["pull_request_target", "workflow_dispatch"],
116
+ "scheduler": "github_actions",
117
+ "cadence": "runAfter trusted same-repository PR close or explicit operator workflow dispatch",
118
+ "timezone": "UTC",
119
+ "source": ".github/workflows/cloudflare-tunnel-reconciliation.yml",
120
+ "locator": "workflow_dispatch:",
121
+ "owner": "platform",
122
+ "criticality": "maintenance",
123
+ "purpose": "Record PR-close and operator tunnel reconciliation separately from the daily cleanup slot, with the same exact ownership, rollout and retained-evidence controls.",
124
+ "successDefinition": "The admitted event pass completes its exact selected UUIDs with durable outcomes; disabled rollout and no eligible resources are explicit no-ops.",
125
+ "failureDefinition": "Event authority, provider truth, continuation or retained evidence is unavailable, or an exact selected UUID remains unresolved.",
126
+ "startGraceMs": 600000,
127
+ "runTimeoutMs": 84600000,
128
+ "failureAlert": "github_workflow_run",
129
+ "domainReportRequired": true
130
+ },
92
131
  {
93
132
  "id": "github.cleanup-stale-preview-infrastructure",
94
133
  "name": "Cleanup Stale Preview Infrastructure",
@@ -189,9 +228,9 @@
189
228
  "locator": "schedule:",
190
229
  "owner": "platform",
191
230
  "criticality": "maintenance",
192
- "purpose": "Reconcile completed PR Preview Machines and release capacity only after the per-app lease fence allows it.",
193
- "successDefinition": "Fly inventory is reconciled and eligible terminal/closed PR capacity is released; no eligible app is a valid no-op.",
194
- "failureDefinition": "Inventory, lease resolution, scale-down, or empty-app cleanup fails or is ambiguous.",
231
+ "purpose": "Reconcile completed PR Preview Machines and release capacity only after the per-app lease fence allows it. Its named-estate lane plans every named Preview estate (eval reuse keys, runtime up preview branch lanes, one-off namespaces) with `bun scripts/fly-preview-estate-lifecycle.ts --report --named-reclaim-plan` and, only on a workflow_dispatch with reclaim_named_estates=true, scales at most 8 planned estates per pass (interrupted reclaims first, then reclaimable estates idle 24 h by lease, release or reclaim evidence) to zero through the claimed runtime-preview-namespace.yml scale-to-zero, recording the start and lane app before the seam, retiring the release lane and recording reclaimed history; scheduled passes only report it.",
232
+ "successDefinition": "Fly inventory is reconciled and eligible terminal/closed PR capacity is released; every named estate is classified without a read failure, and a dispatched named reclaim leaves each target at zero Machines with its release lane retired and reclaimed history written. No eligible app or estate is a valid no-op.",
233
+ "failureDefinition": "Inventory, lease resolution, scale-down, or empty-app cleanup fails or is ambiguous; a named-estate Fly or authority read fails; a named reclaim is refused inside its claim (active owner, used since discovery, ownership or lane-app refusal) or any role keeps a Machine; or any named reclaim is incomplete (started but its release lane was never retired), which fails every pass until a dispatch finishes it.",
195
234
  "startGraceMs": 600000,
196
235
  "runTimeoutMs": 3600000,
197
236
  "failureAlert": "github_workflow_run",
@@ -207,7 +246,7 @@
207
246
  "locator": "schedule:",
208
247
  "owner": "platform",
209
248
  "criticality": "maintenance",
210
- "purpose": "Classify numbered Fly PR Preview estates by PR lifetime and ownership (report only), record organization Machine headroom, and list failed PR-close and post-CI cleanup runs that completed in the previous UTC day.",
249
+ "purpose": "Classify numbered Fly PR Preview estates by PR lifetime and ownership and named estates by the idle clock (report only), record organization Machine headroom, and list failed PR-close and post-CI cleanup runs that completed in the previous UTC day.",
211
250
  "successDefinition": "Every estate is read and classified without a mutation, headroom is recorded, and no event-driven Preview cleanup run that completed in the previous UTC day failed or was left unfinished.",
212
251
  "failureDefinition": "Fly, GitHub, or estate-authority reads fail for an estate, or a PR-close or post-CI cleanup run that completed in the previous UTC day failed, or one is still unfinished after six hours.",
213
252
  "startGraceMs": 600000,
@@ -25,6 +25,107 @@ export type FlyMachine = {
25
25
  // Fly Machines API expects a Go duration string. Never send bare seconds.
26
26
  export const RECEIPT_GATEWAY_DRAIN_TIMEOUT = '300s';
27
27
 
28
+ /** One Fly app of a Preview estate, named by the role it plays. */
29
+ export type EstateRoleApp = { role: string; app: string };
30
+
31
+ const SCALE_TO_ZERO_DELETE_CONCURRENCY = 8;
32
+ // A force delete returns before Fly drops the Machine from its list; one still
33
+ // `destroying` is not a survivor yet. Re-read on a bounded schedule (about a
34
+ // minute in total) before calling it one.
35
+ const SCALE_TO_ZERO_CONFIRM_DELAYS_MS = [
36
+ 2_000, 3_000, 5_000, 5_000, 10_000, 10_000, 10_000, 15_000,
37
+ ] as const;
38
+
39
+ /**
40
+ * Remove every Machine of a Preview estate, role by role, and prove each role
41
+ * reached zero before touching the next. Compute only: apps, images, secrets,
42
+ * the scheduler schema, queue registration and release lanes are the caller's
43
+ * business and are never touched here.
44
+ *
45
+ * The scaler owns worker desired count, so it must be the first role whenever
46
+ * it is present; otherwise it can replace the last worker between the destroy
47
+ * and the zero assertion. A role whose Machines survive the destroy is a loud
48
+ * failure naming the app and Machine IDs, and later roles are left alone so a
49
+ * retry starts from a known order.
50
+ */
51
+ export async function scaleEstateRolesToZero(input: {
52
+ roles: readonly EstateRoleApp[];
53
+ /**
54
+ * Machines in the app that still exist, excluding any Fly reports as
55
+ * `destroyed`; an app that does not exist has none.
56
+ */
57
+ listMachines: (app: string) => Promise<Array<{ id: string; state?: string }>>;
58
+ deleteMachine: (app: string, machineId: string) => Promise<void>;
59
+ log?: (line: string) => void;
60
+ sleep?: (ms: number) => Promise<void>;
61
+ }): Promise<Array<EstateRoleApp & { destroyed: string[] }>> {
62
+ const sleep =
63
+ input.sleep ??
64
+ ((ms: number) => new Promise<void>((resolve) => setTimeout(resolve, ms)));
65
+ if (input.roles.length === 0) {
66
+ throw new Error('Estate scale-to-zero requires at least one role.');
67
+ }
68
+ const scalerIndex = input.roles.findIndex((role) => role.role === 'scaler');
69
+ if (scalerIndex > 0) {
70
+ throw new Error(
71
+ 'Estate scale-to-zero must remove the scaler before any other role.',
72
+ );
73
+ }
74
+ const seen = new Set<string>();
75
+ for (const { role, app } of input.roles) {
76
+ if (!role.trim() || !app.trim()) {
77
+ throw new Error('Estate scale-to-zero roles need a role and an app.');
78
+ }
79
+ if (seen.has(app)) {
80
+ throw new Error(`Estate scale-to-zero repeats app ${app}.`);
81
+ }
82
+ seen.add(app);
83
+ }
84
+
85
+ const results: Array<EstateRoleApp & { destroyed: string[] }> = [];
86
+ for (const { role, app } of input.roles) {
87
+ const machineIds = (await input.listMachines(app))
88
+ .filter((machine) => machine.state !== 'destroying')
89
+ .map((machine) => machine.id);
90
+ for (
91
+ let offset = 0;
92
+ offset < machineIds.length;
93
+ offset += SCALE_TO_ZERO_DELETE_CONCURRENCY
94
+ ) {
95
+ await Promise.all(
96
+ machineIds
97
+ .slice(offset, offset + SCALE_TO_ZERO_DELETE_CONCURRENCY)
98
+ .map((machineId) => input.deleteMachine(app, machineId)),
99
+ );
100
+ }
101
+ let remaining = await input.listMachines(app);
102
+ for (const delayMs of SCALE_TO_ZERO_CONFIRM_DELAYS_MS) {
103
+ // Only Machines Fly is still tearing down may settle on their own; any
104
+ // other survivor fails now rather than waiting out the schedule.
105
+ if (
106
+ remaining.length === 0 ||
107
+ remaining.some((machine) => machine.state !== 'destroying')
108
+ ) {
109
+ break;
110
+ }
111
+ await sleep(delayMs);
112
+ remaining = await input.listMachines(app);
113
+ }
114
+ if (remaining.length > 0) {
115
+ throw new Error(
116
+ `Preview ${role} did not scale to zero Machines: ${app} still has ${remaining
117
+ .map((machine) => `${machine.id}=${machine.state ?? 'unknown'}`)
118
+ .join(', ')}.`,
119
+ );
120
+ }
121
+ input.log?.(
122
+ `[estate-scale-to-zero] ${role} ${app}: destroyed ${machineIds.length}, now 0`,
123
+ );
124
+ results.push({ role, app, destroyed: machineIds });
125
+ }
126
+ return results;
127
+ }
128
+
28
129
  export async function stopAndDestroyCordonedMachines(input: {
29
130
  machineIds: string[];
30
131
  readMachines: () => FlyMachine[] | Promise<FlyMachine[]>;
@@ -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 _chunkN6DJQQ2Sjs = require('./chunk-N6DJQQ2S.js');
17
+ require('./chunk-NYDRX6JJ.js');
18
+ require('./chunk-YSAZVLJD.js');
19
+ require('./chunk-Q2E4E4FJ.js');
20
+ require('./chunk-XNYIZMNQ.js');
21
+ require('./chunk-7P5AA3SN.js');
22
+ require('./chunk-W3ZNQE5Y.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 = _chunkN6DJQQ2Sjs.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunkN6DJQQ2Sjs.authStatusLine; exports.clearPendingClaim = _chunkN6DJQQ2Sjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkN6DJQQ2Sjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkN6DJQQ2Sjs.handleRegister; exports.handleStatus = _chunkN6DJQQ2Sjs.handleStatus; exports.handleWait = _chunkN6DJQQ2Sjs.handleWait; exports.httpJson = _chunkN6DJQQ2Sjs.httpJson; exports.readPendingAuthClaim = _chunkN6DJQQ2Sjs.readPendingAuthClaim; exports.readStatusBanner = _chunkN6DJQQ2Sjs.readStatusBanner; exports.registerAuthCommands = _chunkN6DJQQ2Sjs.registerAuthCommands; exports.reportSetupCompleted = _chunkN6DJQQ2Sjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkN6DJQQ2Sjs.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunkN6DJQQ2Sjs.statusBannerLine;
@@ -13,13 +13,13 @@ import {
13
13
  reportSetupCompleted,
14
14
  resolvePendingAuthClaimForResume,
15
15
  statusBannerLine
16
- } from "./chunk-3FF3SPSE.mjs";
17
- import "./chunk-3DWMYKWU.mjs";
18
- import "./chunk-TPYRDAU7.mjs";
16
+ } from "./chunk-2MLY2ZBT.mjs";
17
+ import "./chunk-5IGBBYXH.mjs";
18
+ import "./chunk-CGX4NSS3.mjs";
19
19
  import "./chunk-YHPYUZZX.mjs";
20
20
  import "./chunk-DLIRSHV6.mjs";
21
21
  import "./chunk-NXGCO4JB.mjs";
22
- import "./chunk-EKWJXPIX.mjs";
22
+ import "./chunk-42RUJLQI.mjs";
23
23
  import "./chunk-WZYKRD7T.mjs";
24
24
  import "./chunk-KRD6H754.mjs";
25
25
  export {