@hearsay-tools/squawk 0.19.0-dev.9172 → 0.19.0-dev.9182
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.
- package/dist/contract/hosts.d.ts +925 -0
- package/dist/contract/index.js +104 -2
- package/dist/core/server-hook-registry.d.ts +13 -0
- package/dist/core/server-hook-registry.js.map +1 -1
- package/dist/delegation/transport.d.ts +78 -78
- package/dist/features/automations/automations-routes.d.ts +150 -150
- package/dist/features/hosts/admission.d.ts +52 -0
- package/dist/features/hosts/admission.js +89 -0
- package/dist/features/hosts/admission.js.map +1 -0
- package/dist/features/hosts/gateway.d.ts +14 -3
- package/dist/features/hosts/gateway.js +35 -21
- package/dist/features/hosts/gateway.js.map +1 -1
- package/dist/features/hosts/index.d.ts +7 -3
- package/dist/features/hosts/index.js +41 -7
- package/dist/features/hosts/index.js.map +1 -1
- package/dist/features/hosts/registry-reconciler.d.ts +41 -0
- package/dist/features/hosts/registry-reconciler.js +168 -0
- package/dist/features/hosts/registry-reconciler.js.map +1 -0
- package/dist/features/hosts/routes.d.ts +370 -4
- package/dist/features/hosts/routes.js +72 -62
- package/dist/features/hosts/routes.js.map +1 -1
- package/dist/features/hosts/runs-index-events.d.ts +23 -0
- package/dist/features/hosts/runs-index-events.js +116 -0
- package/dist/features/hosts/runs-index-events.js.map +1 -0
- package/dist/features/hosts/runs-index-patch.d.ts +203 -0
- package/dist/features/hosts/runs-index-patch.js +798 -0
- package/dist/features/hosts/runs-index-patch.js.map +1 -0
- package/dist/features/hosts/runs-index.d.ts +149 -0
- package/dist/features/hosts/runs-index.js +762 -0
- package/dist/features/hosts/runs-index.js.map +1 -0
- package/dist/features/hosts/runs-search.d.ts +28 -0
- package/dist/features/hosts/runs-search.js +151 -0
- package/dist/features/hosts/runs-search.js.map +1 -0
- package/dist/features/hosts/supervisor.d.ts +4 -0
- package/dist/features/hosts/supervisor.js +14 -6
- package/dist/features/hosts/supervisor.js.map +1 -1
- package/dist/plugin/index.d.ts +1 -1
- package/dist/plugin/index.js.map +1 -1
- package/dist/server/repo-routes.d.ts +52 -52
- package/dist/server/server.js +7 -1
- package/dist/server/server.js.map +1 -1
- package/dist/server/workspace-run-feed.d.ts +4 -0
- package/dist/server/workspace-run-feed.js +13 -0
- package/dist/server/workspace-run-feed.js.map +1 -1
- package/package.json +4 -4
- package/scripts/benchmark-hosts-runs-index-probes.ts +242 -0
- package/scripts/benchmark-hosts-runs-index.ts +776 -0
- package/web/dist/assets/accounts-section-DYQC-wSh.js +1 -0
- package/web/dist/assets/activity-motion-XvrmbNgR.js +1 -0
- package/web/dist/assets/{activity-route-C2zP5vVV.js → activity-route-Dj8ltoqG.js} +1 -1
- package/web/dist/assets/{agent-accounts-D_ZKAmaW.js → agent-accounts-C2ILQhZy.js} +1 -1
- package/web/dist/assets/{agent-config-section-CwK_izpU.js → agent-config-section-D16TRCE_.js} +2 -2
- package/web/dist/assets/agent-defaults-section-Dm0khLjs.js +1 -0
- package/web/dist/assets/{appearance-DvoRcoRX.js → appearance-CP6zVctf.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-DWPtF9dh.js → archive-on-merge-field-BA8aUtRQ.js} +1 -1
- package/web/dist/assets/{ask-card-D-om0EtP.js → ask-card-CLdlwd68.js} +1 -1
- package/web/dist/assets/attention-C7BUdd2s.js +1 -0
- package/web/dist/assets/automations-route-BVDO_Kai.js +2 -0
- package/web/dist/assets/{commit-list-CPJLP4DU.js → commit-list-Bdekr2K7.js} +1 -1
- package/web/dist/assets/{diff-BQJN6jzN.js → diff-Du0FsqAK.js} +2 -2
- package/web/dist/assets/{diff-controls-AsSX7gfO.js → diff-controls-DTC_6oqk.js} +1 -1
- package/web/dist/assets/{diff-view-BW5bbiaq.js → diff-view-TKooupFV.js} +1 -1
- package/web/dist/assets/{discard-changes-dialog-Bv4yc0N1.js → discard-changes-dialog-Bg-3Xbox.js} +1 -1
- package/web/dist/assets/{file-preview-CnrFxbea.js → file-preview-DMJCprVk.js} +1 -1
- package/web/dist/assets/{folder-browser-CFd1U5hn.js → folder-browser-3cBLlnE9.js} +1 -1
- package/web/dist/assets/{git-toolbar-C7iolhIi.js → git-toolbar-COhBdctn.js} +1 -1
- package/web/dist/assets/github-DUTSv2Hs.js +1 -0
- package/web/dist/assets/{global-activity-route-Dijwg4OL.js → global-activity-route-CypEKUv_.js} +1 -1
- package/web/dist/assets/hosts-iUyg8S3j.js +1 -0
- package/web/dist/assets/index-BV3EQb9T.js +21 -0
- package/web/dist/assets/index-Bh7COq0B.css +1 -0
- package/web/dist/assets/{label-CgU9vxuM.js → label-CWlxyeC-.js} +1 -1
- package/web/dist/assets/{markdown-Cljq4S1h.js → markdown-0uCxcToP.js} +1 -1
- package/web/dist/assets/{open-in-menu-BI7mnPPf.js → open-in-menu-Bf8JA2DJ.js} +1 -1
- package/web/dist/assets/{option-select-BcTkv-7t.js → option-select-DQJEHmHf.js} +1 -1
- package/web/dist/assets/{preferences-section-CEKXGhEj.js → preferences-section-Cvl5vyfN.js} +1 -1
- package/web/dist/assets/{preview-EtD19mg1.js → preview-BSFJfN4s.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-CKRBfx7t.js → preview-pane-connected-i3GJtDL3.js} +2 -2
- package/web/dist/assets/{project-location-hufc_p8y.js → project-location-BcjOhqun.js} +1 -1
- package/web/dist/assets/{project-router-Dc6KBQsv.js → project-router-CwD1firw.js} +1 -1
- package/web/dist/assets/{projects-section-vOFZ4lbx.js → projects-section-CAOFPkDQ.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-Caash2nq.js → prompt-templates-section-BXTfLET4.js} +1 -1
- package/web/dist/assets/queries-D9mg7sFY.js +1 -0
- package/web/dist/assets/{read-state-BeVNfGkB.js → read-state-BsTfJki5.js} +1 -1
- package/web/dist/assets/{reference-chip-BjerVjzM.js → reference-chip-CZKBU_Ud.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-fNgh5LdN.js → remote-settings-notice-CUK4ZFYF.js} +1 -1
- package/web/dist/assets/repo-git-Dx85MEuK.js +1 -0
- package/web/dist/assets/{report-reader-CK1WDtEH.js → report-reader-BDdY5kpz.js} +1 -1
- package/web/dist/assets/{report-selection-CZ8eb9QP.js → report-selection-Y2F9NTAs.js} +1 -1
- package/web/dist/assets/{reports-B-GImLAo.js → reports-DWKpm_us.js} +1 -1
- package/web/dist/assets/{resources-section-ApF3gXrw.js → resources-section-D9tzbv9w.js} +1 -1
- package/web/dist/assets/{review-notes-drafts-BdjEFs1G.js → review-notes-drafts-BSkmq3Nj.js} +1 -1
- package/web/dist/assets/{review-panel-D4zmYH8O.js → review-panel-C9UZjWFl.js} +1 -1
- package/web/dist/assets/{review-strip-BpHXklAn.js → review-strip-qTG5JaOw.js} +1 -1
- package/web/dist/assets/{run-detail-refresh-CE0vyYYA.js → run-detail-refresh-SYZM94ch.js} +1 -1
- package/web/dist/assets/{run-diff-ClfLRsHF.js → run-diff-D26PXp6r.js} +1 -1
- package/web/dist/assets/run-header-BrUcSJu6.js +2 -0
- package/web/dist/assets/{select-CwDhRDtw.js → select-BUsS7uOZ.js} +1 -1
- package/web/dist/assets/{session-context-section-C87jx7RB.js → session-context-section-Bgzou-NG.js} +1 -1
- package/web/dist/assets/{settings-agent-picker-Dk8yJ57U.js → settings-agent-picker-CH3CQhOh.js} +1 -1
- package/web/dist/assets/{settings-save-bar-cu8BKCGT.js → settings-save-bar-cyvALSgW.js} +1 -1
- package/web/dist/assets/{settings-shell-mhQfQKf1.js → settings-shell-Cl-cu4r5.js} +1 -1
- package/web/dist/assets/{sidebar-section-DOQ5N1L6.js → sidebar-section-Cj2fDrhV.js} +1 -1
- package/web/dist/assets/{skills-DXJ1gQBD.js → skills-DLMbRR_5.js} +1 -1
- package/web/dist/assets/{status-dot-Bmn4xhch.js → status-dot-DTU7afRv.js} +1 -1
- package/web/dist/assets/{tab-link-6TltE1jl.js → tab-link-BJDe5cT4.js} +1 -1
- package/web/dist/assets/{task-changes-D9Sdmpmw.js → task-changes-ito4fOGh.js} +2 -2
- package/web/dist/assets/{task-commits-A0UIqxpL.js → task-commits-BYOIU9zy.js} +1 -1
- package/web/dist/assets/{task-file-scope-ID220XKo.js → task-file-scope-B8EEJyHp.js} +1 -1
- package/web/dist/assets/{task-files-Id2tuAAG.js → task-files-CF0QKnm-.js} +1 -1
- package/web/dist/assets/{task-github-item-YKUcwp2o.js → task-github-item-C6Fu8MvM.js} +1 -1
- package/web/dist/assets/{task-groups-DCg4iOB9.js → task-groups-BvVfsQKd.js} +1 -1
- package/web/dist/assets/{task-thread-A_vkygGX.js → task-thread-BWrvepxB.js} +2 -2
- package/web/dist/assets/{thread-state-6-BzRrJ_.js → thread-state-8E0eYXGu.js} +1 -1
- package/web/dist/assets/toaster-2ud_VdfV.js +4 -0
- package/web/dist/assets/{use-finish-run-DO-nnAaa.js → use-finish-run-a2qZy6zr.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-CADaL8U8.js → use-hand-to-agent-state-DT1ngmHe.js} +1 -1
- package/web/dist/assets/use-path-bases-CZ6F93wt.js +1 -0
- package/web/dist/assets/use-workspace-config-save-DDI7_WtK.js +1 -0
- package/web/dist/assets/{workflows-DOLG-Rns.js → workflows-2e0Sm6F1.js} +2 -2
- package/web/dist/assets/{workspace-tools-DTCJVDTE.js → workspace-tools-D4DO9w12.js} +1 -1
- package/web/dist/assets/{worktrees-section-BOHDbywt.js → worktrees-section-8-d6zWQ-.js} +5 -5
- package/web/dist/index.html +20 -20
- package/web/dist/assets/accounts-section-Bnr89jmC.js +0 -1
- package/web/dist/assets/activity-motion-BW0tAmYF.js +0 -1
- package/web/dist/assets/agent-defaults-section-RyEogH0g.js +0 -1
- package/web/dist/assets/attention-BI6592lk.js +0 -1
- package/web/dist/assets/automations-route-DfGE4xWT.js +0 -2
- package/web/dist/assets/github-DGElvfMU.js +0 -1
- package/web/dist/assets/hosts-CpDMDiQW.js +0 -1
- package/web/dist/assets/index-BVRdRJAN.css +0 -1
- package/web/dist/assets/index-DPfg7xSB.js +0 -21
- package/web/dist/assets/queries-IlC9MZgh.js +0 -1
- package/web/dist/assets/repo-git-5MK_RAR6.js +0 -1
- package/web/dist/assets/run-header-BUe92WWr.js +0 -2
- package/web/dist/assets/toaster-DNnL8v10.js +0 -4
- package/web/dist/assets/use-path-bases-CFAmFn_E.js +0 -1
- package/web/dist/assets/use-workspace-config-save-DScW6_8J.js +0 -1
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single owner for synchronizing `<config>/hosts.json` changes made outside this process (for
|
|
3
|
+
* example `hsq host add|update|remove` from the CLI while `hsq serve` is running) into both the
|
|
4
|
+
* host supervisor manager and the in-memory host task index (`hearsay-tools/squawk#4541`).
|
|
5
|
+
*
|
|
6
|
+
* - Watches `<config>` via a best-effort non-persistent `fs.watch` (debounced 50 ms) when the
|
|
7
|
+
* directory exists, backed by a bounded `HOST_REGISTRY_SYNC_INTERVAL_MS` (2 s) `statSync` check
|
|
8
|
+
* that catches newly created config directories and dropped watcher events on every OS.
|
|
9
|
+
* - Zero-host rule: when `<config>/hosts.json` is absent, each 2 s check performs a single
|
|
10
|
+
* `statSync` returning `ENOENT` (~5 µs), reads zero files, creates zero supervisors/readers,
|
|
11
|
+
* and emits zero workspace events.
|
|
12
|
+
*/
|
|
13
|
+
import { existsSync, statSync, watch } from 'node:fs';
|
|
14
|
+
import { dirname } from 'node:path';
|
|
15
|
+
import { getHostRunsIndexManager } from './runs-index.js';
|
|
16
|
+
import { getHostSupervisorManager } from './supervisor.js';
|
|
17
|
+
/** Bounded interval for detecting external `<config>/hosts.json` changes without HTTP polls. */
|
|
18
|
+
export const HOST_REGISTRY_SYNC_INTERVAL_MS = 2_000;
|
|
19
|
+
const HOST_REGISTRY_WATCH_DEBOUNCE_MS = 50;
|
|
20
|
+
function hostsFileSignature(path) {
|
|
21
|
+
try {
|
|
22
|
+
const st = statSync(path, { bigint: true });
|
|
23
|
+
return `${st.ino}:${st.size}:${st.mtimeNs}:${st.ctimeNs}`;
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
const code = error.code;
|
|
27
|
+
if (code === 'ENOENT' || code === 'ENOTDIR')
|
|
28
|
+
return 'absent';
|
|
29
|
+
return `err:${code ?? 'unknown'}`;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export class HostRegistryReconciler {
|
|
33
|
+
home;
|
|
34
|
+
supervisor;
|
|
35
|
+
runsIndex;
|
|
36
|
+
intervalMs;
|
|
37
|
+
watchDebounceMs;
|
|
38
|
+
enableWatch;
|
|
39
|
+
running = false;
|
|
40
|
+
signatureCaptured = false;
|
|
41
|
+
lastSignature = 'absent';
|
|
42
|
+
pollTimer;
|
|
43
|
+
debounceTimer;
|
|
44
|
+
watcher;
|
|
45
|
+
constructor(home, supervisor, runsIndex, options = {}) {
|
|
46
|
+
this.home = home;
|
|
47
|
+
this.supervisor = supervisor;
|
|
48
|
+
this.runsIndex = runsIndex;
|
|
49
|
+
this.intervalMs = options.intervalMs ?? HOST_REGISTRY_SYNC_INTERVAL_MS;
|
|
50
|
+
this.watchDebounceMs = options.watchDebounceMs ?? HOST_REGISTRY_WATCH_DEBOUNCE_MS;
|
|
51
|
+
this.enableWatch = options.enableWatch ?? true;
|
|
52
|
+
}
|
|
53
|
+
/** Capture `<config>/hosts.json` metadata before startup reads so mid-startup writes trigger a sync. */
|
|
54
|
+
captureSignature() {
|
|
55
|
+
this.lastSignature = hostsFileSignature(this.home.hosts);
|
|
56
|
+
this.signatureCaptured = true;
|
|
57
|
+
}
|
|
58
|
+
start() {
|
|
59
|
+
if (this.running)
|
|
60
|
+
return;
|
|
61
|
+
this.running = true;
|
|
62
|
+
if (!this.signatureCaptured) {
|
|
63
|
+
this.captureSignature();
|
|
64
|
+
}
|
|
65
|
+
this.tryAttachWatcher();
|
|
66
|
+
this.syncIfChanged();
|
|
67
|
+
if (this.intervalMs > 0) {
|
|
68
|
+
this.pollTimer = setInterval(() => {
|
|
69
|
+
this.checkForExternalChange();
|
|
70
|
+
}, this.intervalMs);
|
|
71
|
+
this.pollTimer.unref();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
stop() {
|
|
75
|
+
this.running = false;
|
|
76
|
+
this.signatureCaptured = false;
|
|
77
|
+
if (this.pollTimer !== undefined) {
|
|
78
|
+
clearInterval(this.pollTimer);
|
|
79
|
+
this.pollTimer = undefined;
|
|
80
|
+
}
|
|
81
|
+
if (this.debounceTimer !== undefined) {
|
|
82
|
+
clearTimeout(this.debounceTimer);
|
|
83
|
+
this.debounceTimer = undefined;
|
|
84
|
+
}
|
|
85
|
+
if (this.watcher) {
|
|
86
|
+
try {
|
|
87
|
+
this.watcher.close();
|
|
88
|
+
}
|
|
89
|
+
catch { /* already closed */ }
|
|
90
|
+
this.watcher = undefined;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/** Synchronize supervisors and index tracking immediately (used by HTTP routes and watcher). */
|
|
94
|
+
reconcileNow() {
|
|
95
|
+
this.lastSignature = hostsFileSignature(this.home.hosts);
|
|
96
|
+
this.supervisor.reconcile();
|
|
97
|
+
this.runsIndex.reconcile();
|
|
98
|
+
if (this.running && !this.watcher) {
|
|
99
|
+
this.tryAttachWatcher();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/** Reconcile only when `<config>/hosts.json` metadata changed since the last sync (fast path for read routes). */
|
|
103
|
+
syncIfChanged() {
|
|
104
|
+
if (this.running && !this.watcher)
|
|
105
|
+
this.tryAttachWatcher();
|
|
106
|
+
const current = hostsFileSignature(this.home.hosts);
|
|
107
|
+
if (current === this.lastSignature)
|
|
108
|
+
return false;
|
|
109
|
+
this.lastSignature = current;
|
|
110
|
+
this.supervisor.reconcile();
|
|
111
|
+
this.runsIndex.reconcile();
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
/** Inspect `<config>/hosts.json` metadata while running and reconcile when the file changed on disk. */
|
|
115
|
+
checkForExternalChange() {
|
|
116
|
+
if (!this.running)
|
|
117
|
+
return false;
|
|
118
|
+
return this.syncIfChanged();
|
|
119
|
+
}
|
|
120
|
+
tryAttachWatcher() {
|
|
121
|
+
if (!this.enableWatch || this.watcher)
|
|
122
|
+
return;
|
|
123
|
+
const dir = dirname(this.home.hosts);
|
|
124
|
+
if (!existsSync(dir))
|
|
125
|
+
return;
|
|
126
|
+
try {
|
|
127
|
+
const watcher = watch(dir, { persistent: false }, (_eventType, filename) => {
|
|
128
|
+
if (!this.running)
|
|
129
|
+
return;
|
|
130
|
+
if (filename && typeof filename === 'string' && !filename.startsWith('hosts.json'))
|
|
131
|
+
return;
|
|
132
|
+
this.scheduleDebouncedCheck();
|
|
133
|
+
});
|
|
134
|
+
watcher.on('error', () => {
|
|
135
|
+
try {
|
|
136
|
+
watcher.close();
|
|
137
|
+
}
|
|
138
|
+
catch { /* already closed */ }
|
|
139
|
+
if (this.watcher === watcher)
|
|
140
|
+
this.watcher = undefined;
|
|
141
|
+
});
|
|
142
|
+
this.watcher = watcher;
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
// Directory unreadable or platform lacks fs.watch; the bounded stat interval covers it.
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
scheduleDebouncedCheck() {
|
|
149
|
+
if (this.debounceTimer !== undefined)
|
|
150
|
+
return;
|
|
151
|
+
this.debounceTimer = setTimeout(() => {
|
|
152
|
+
this.debounceTimer = undefined;
|
|
153
|
+
this.checkForExternalChange();
|
|
154
|
+
}, this.watchDebounceMs);
|
|
155
|
+
this.debounceTimer.unref();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
const reconcilersByServer = new WeakMap();
|
|
159
|
+
/** Return the single `HostRegistryReconciler` owned by a `ServerPluginContext`. */
|
|
160
|
+
export function getHostRegistryReconciler(context, options) {
|
|
161
|
+
let reconciler = reconcilersByServer.get(context);
|
|
162
|
+
if (!reconciler) {
|
|
163
|
+
reconciler = new HostRegistryReconciler(context.home, getHostSupervisorManager(context), getHostRunsIndexManager(context), options);
|
|
164
|
+
reconcilersByServer.set(context, reconciler);
|
|
165
|
+
}
|
|
166
|
+
return reconciler;
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=registry-reconciler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-reconciler.js","sourceRoot":"","sources":["../../../src/features/hosts/registry-reconciler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAkB,MAAM,SAAS,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,gGAAgG;AAChG,MAAM,CAAC,MAAM,8BAA8B,GAAG,KAAK,CAAC;AACpD,MAAM,+BAA+B,GAAG,EAAE,CAAC;AAY3C,SAAS,kBAAkB,CAAC,IAAY;IACtC,IAAI,CAAC;QACH,MAAM,EAAE,GAAG,QAAQ,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5C,OAAO,GAAG,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;IAC5D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,GAAI,KAA+B,CAAC,IAAI,CAAC;QACnD,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,SAAS;YAAE,OAAO,QAAQ,CAAC;QAC7D,OAAO,OAAO,IAAI,IAAI,SAAS,EAAE,CAAC;IACpC,CAAC;AACH,CAAC;AAED,MAAM,OAAO,sBAAsB;IAChB,IAAI,CAAO;IACX,UAAU,CAA8B;IACxC,SAAS,CAA8B;IACvC,UAAU,CAAS;IACnB,eAAe,CAAS;IACxB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GAAG,SAAS,CAAC;YACzD,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACzB,CAAC;QAAC,MAAM,CAAC;YACP,wFAAwF;QAC1F,CAAC;IACH,CAAC;IAEO,sBAAsB;QAC5B,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS;YAAE,OAAO;QAC7C,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,GAAG,EAAE;YACnC,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;YAC/B,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAChC,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QACzB,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;CACF;AAED,MAAM,mBAAmB,GAAG,IAAI,OAAO,EAA+C,CAAC;AAEvF,mFAAmF;AACnF,MAAM,UAAU,yBAAyB,CACvC,OAA4B,EAC5B,OAAuC;IAEvC,IAAI,UAAU,GAAG,mBAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAClD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,UAAU,GAAG,IAAI,sBAAsB,CACrC,OAAO,CAAC,IAAI,EACZ,wBAAwB,CAAC,OAAO,CAAC,EACjC,uBAAuB,CAAC,OAAO,CAAC,EAChC,OAAO,CACR,CAAC;QACF,mBAAmB,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -1,21 +1,36 @@
|
|
|
1
|
+
import { type HostsRunsIndexResponse } from '../../contract/index.js';
|
|
1
2
|
import type { Home } from '../../home/home.ts';
|
|
2
|
-
import type
|
|
3
|
+
import { type HostAdmissionSupervisor } from './admission.ts';
|
|
4
|
+
import { type HostSearchFetcher } from './runs-search.ts';
|
|
3
5
|
export declare const HOST_PROJECTS_FETCH_TIMEOUT_MS = 5000;
|
|
4
6
|
export declare const HOST_PROJECTS_MAX_RESPONSE_BYTES: number;
|
|
5
|
-
export interface HostRoutesSupervisor {
|
|
7
|
+
export interface HostRoutesSupervisor extends HostAdmissionSupervisor {
|
|
6
8
|
isRunning?(): boolean;
|
|
7
9
|
reconcile?(): void;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
}
|
|
11
|
+
export interface HostRoutesRunsIndex {
|
|
12
|
+
getSnapshot(options?: {
|
|
13
|
+
hostId?: string | undefined;
|
|
14
|
+
}): HostsRunsIndexResponse;
|
|
15
|
+
reconcile?(): void;
|
|
10
16
|
}
|
|
11
17
|
export interface HostsRouteDeps {
|
|
12
18
|
home: Home;
|
|
13
19
|
capabilities: () => Readonly<Record<string, boolean | undefined>>;
|
|
14
20
|
supervisorManager?: HostRoutesSupervisor | undefined;
|
|
21
|
+
runsIndexManager?: HostRoutesRunsIndex | undefined;
|
|
22
|
+
/** Shared registry reconciler synchronizing both supervisors and index tracking with `<config>/hosts.json`. */
|
|
23
|
+
reconcileHosts?: ((mode: 'read' | 'write') => void) | undefined;
|
|
24
|
+
/** Main server generation id for fallback `GET /api/v1/hosts/runs-index` answers. */
|
|
25
|
+
generation?: string | undefined;
|
|
15
26
|
/** Invoke the main cockpit HTTP app in-process (for local & gateway project reads). */
|
|
16
27
|
fetchApp?: ((request: Request) => Promise<Response>) | undefined;
|
|
17
28
|
/** Per-host deadline signal for `GET /api/v1/hosts/projects` gateway reads; defaults to `HOST_PROJECTS_FETCH_TIMEOUT_MS`. */
|
|
18
29
|
hostProjectsDeadline?: ((hostId: string) => AbortSignal) | undefined;
|
|
30
|
+
/** Optional per-host search timeout override (ms) for `GET /api/v1/hosts/runs-search`. */
|
|
31
|
+
hostSearchTimeoutMs?: number | undefined;
|
|
32
|
+
/** Optional connected-host fetcher override for `GET /api/v1/hosts/runs-search` tests. */
|
|
33
|
+
hostSearchFetch?: HostSearchFetcher | undefined;
|
|
19
34
|
/** Optional `~/.ssh/config` path override for tests. */
|
|
20
35
|
sshConfigPath?: string | undefined;
|
|
21
36
|
env?: NodeJS.ProcessEnv | undefined;
|
|
@@ -121,6 +136,357 @@ export declare function createHostsRoutes(deps: HostsRouteDeps): import("hono/ho
|
|
|
121
136
|
input: {};
|
|
122
137
|
};
|
|
123
138
|
};
|
|
139
|
+
} & {
|
|
140
|
+
"/hosts/runs-index": {
|
|
141
|
+
$get: {
|
|
142
|
+
output: {
|
|
143
|
+
error: string;
|
|
144
|
+
code?: "invalid_input" | undefined;
|
|
145
|
+
};
|
|
146
|
+
outputFormat: "json";
|
|
147
|
+
status: 400;
|
|
148
|
+
input: {
|
|
149
|
+
query: {
|
|
150
|
+
hostId?: string | undefined;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
} | {
|
|
154
|
+
output: {
|
|
155
|
+
runs: {
|
|
156
|
+
id: string;
|
|
157
|
+
title: string;
|
|
158
|
+
titleSummary?: string | undefined;
|
|
159
|
+
titleOrigin?: "auto" | "marker" | "user" | undefined;
|
|
160
|
+
status: "cancelled" | "done" | "failed" | "queued" | "review" | "running" | "waiting";
|
|
161
|
+
hasPendingPermission?: boolean | undefined;
|
|
162
|
+
waitingOn?: {
|
|
163
|
+
kind: "human";
|
|
164
|
+
shown?: true | undefined;
|
|
165
|
+
} | {
|
|
166
|
+
kind: "usage-limit";
|
|
167
|
+
at: string;
|
|
168
|
+
} | {
|
|
169
|
+
kind: "workers";
|
|
170
|
+
count: number;
|
|
171
|
+
replies?: true | undefined;
|
|
172
|
+
peers?: true | undefined;
|
|
173
|
+
} | {
|
|
174
|
+
kind: "peers";
|
|
175
|
+
count: number;
|
|
176
|
+
} | {
|
|
177
|
+
kind: "subagents";
|
|
178
|
+
count: number;
|
|
179
|
+
} | {
|
|
180
|
+
kind: "pr";
|
|
181
|
+
until: "checks" | "merge" | "merge_or_blocked";
|
|
182
|
+
waitId: string;
|
|
183
|
+
prUrl: string;
|
|
184
|
+
repository: string;
|
|
185
|
+
prNumber: number;
|
|
186
|
+
deadline: string;
|
|
187
|
+
} | {
|
|
188
|
+
kind: "process";
|
|
189
|
+
waitId: string;
|
|
190
|
+
pid: number;
|
|
191
|
+
deadline: string;
|
|
192
|
+
note?: string | undefined;
|
|
193
|
+
} | {
|
|
194
|
+
kind: "plugin";
|
|
195
|
+
pluginKind: string;
|
|
196
|
+
waitId: string;
|
|
197
|
+
summary: string;
|
|
198
|
+
deadline?: string | undefined;
|
|
199
|
+
} | {
|
|
200
|
+
kind: "timer";
|
|
201
|
+
waitId: string;
|
|
202
|
+
at: string;
|
|
203
|
+
note?: string | undefined;
|
|
204
|
+
} | undefined;
|
|
205
|
+
waitWakePending?: true | undefined;
|
|
206
|
+
delegation?: {
|
|
207
|
+
role: "invalid";
|
|
208
|
+
} | {
|
|
209
|
+
role: "root";
|
|
210
|
+
wait?: {
|
|
211
|
+
workerIds?: string[] | undefined;
|
|
212
|
+
requestIds?: string[] | undefined;
|
|
213
|
+
phase: "parked" | "registered" | "wake-pending";
|
|
214
|
+
outcomes?: {
|
|
215
|
+
workerId: string;
|
|
216
|
+
}[] | undefined;
|
|
217
|
+
} | undefined;
|
|
218
|
+
} | {
|
|
219
|
+
role: "worker";
|
|
220
|
+
parentRunId: string;
|
|
221
|
+
supervisorRunId?: string | undefined;
|
|
222
|
+
wait?: {
|
|
223
|
+
requestIds?: string[] | undefined;
|
|
224
|
+
phase: "parked" | "registered" | "wake-pending";
|
|
225
|
+
} | undefined;
|
|
226
|
+
} | undefined;
|
|
227
|
+
createdAt: string;
|
|
228
|
+
finishedAt?: string | undefined;
|
|
229
|
+
seenAt?: string | undefined;
|
|
230
|
+
archived: boolean;
|
|
231
|
+
autoResumeAt?: string | undefined;
|
|
232
|
+
autoResumeReason?: "provider-error" | "usage-limit" | undefined;
|
|
233
|
+
workflow: string;
|
|
234
|
+
branch?: string | undefined;
|
|
235
|
+
startedAt?: string | undefined;
|
|
236
|
+
pullRequestUrl?: string | undefined;
|
|
237
|
+
pullRequests?: {
|
|
238
|
+
number: number;
|
|
239
|
+
url?: string | undefined;
|
|
240
|
+
source: "created" | "declared";
|
|
241
|
+
}[] | undefined;
|
|
242
|
+
referencedPullRequestUrl?: string | undefined;
|
|
243
|
+
prNumber?: number | undefined;
|
|
244
|
+
issueNumber?: number | undefined;
|
|
245
|
+
referencedIssueUrl?: string | undefined;
|
|
246
|
+
markerRefs?: {
|
|
247
|
+
pr?: number | undefined;
|
|
248
|
+
issue?: number | undefined;
|
|
249
|
+
} | undefined;
|
|
250
|
+
costUsd?: number | undefined;
|
|
251
|
+
peakRssBytes?: number | undefined;
|
|
252
|
+
peakProcCount?: number | undefined;
|
|
253
|
+
usage?: {
|
|
254
|
+
cpuPct: number;
|
|
255
|
+
rssBytes: number;
|
|
256
|
+
procCount: number;
|
|
257
|
+
} | undefined;
|
|
258
|
+
workflowLabel: string;
|
|
259
|
+
groupId?: string | undefined;
|
|
260
|
+
variant?: string | undefined;
|
|
261
|
+
pinned?: boolean | undefined;
|
|
262
|
+
automationId?: string | undefined;
|
|
263
|
+
runner?: string | undefined;
|
|
264
|
+
removedRunner?: string | undefined;
|
|
265
|
+
model?: string | undefined;
|
|
266
|
+
notify?: boolean | undefined;
|
|
267
|
+
diffStat?: {
|
|
268
|
+
adds: number;
|
|
269
|
+
dels: number;
|
|
270
|
+
files: number;
|
|
271
|
+
repointed?: boolean | undefined;
|
|
272
|
+
} | undefined;
|
|
273
|
+
tokensUsed: number;
|
|
274
|
+
inputTokens?: number | undefined;
|
|
275
|
+
outputTokens?: number | undefined;
|
|
276
|
+
currentStepId?: string | undefined;
|
|
277
|
+
currentStepBackend?: string | undefined;
|
|
278
|
+
error?: string | undefined;
|
|
279
|
+
statePreview?: {
|
|
280
|
+
kind: "ask" | "error" | "permission" | "review";
|
|
281
|
+
text: string;
|
|
282
|
+
} | undefined;
|
|
283
|
+
worktreePath?: string | undefined;
|
|
284
|
+
projectId: string;
|
|
285
|
+
hostId: string;
|
|
286
|
+
}[];
|
|
287
|
+
hosts: {
|
|
288
|
+
id: string;
|
|
289
|
+
label: string;
|
|
290
|
+
state: "cannot-persist" | "connected" | "connecting" | "identity-changed" | "needs-node" | "not-hosted" | "paused" | "several-servers" | "unreachable" | "version-mismatch";
|
|
291
|
+
stale: boolean;
|
|
292
|
+
loaded: boolean;
|
|
293
|
+
truncated: string[];
|
|
294
|
+
referenceStatuses: {
|
|
295
|
+
[x: string]: {
|
|
296
|
+
prs: {
|
|
297
|
+
[x: number]: "changes-requested" | "checks-failing" | "checks-pending" | "closed" | "completed" | "draft" | "merged" | "not-planned" | "open" | "ready" | "review-required";
|
|
298
|
+
};
|
|
299
|
+
issues: {
|
|
300
|
+
[x: number]: "changes-requested" | "checks-failing" | "checks-pending" | "closed" | "completed" | "draft" | "merged" | "not-planned" | "open" | "ready" | "review-required";
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
perProjectLimit?: number | undefined;
|
|
305
|
+
}[];
|
|
306
|
+
generation: string;
|
|
307
|
+
eventSeq: number;
|
|
308
|
+
warning?: string | undefined;
|
|
309
|
+
};
|
|
310
|
+
outputFormat: "json";
|
|
311
|
+
status: 200;
|
|
312
|
+
input: {
|
|
313
|
+
query: {
|
|
314
|
+
hostId?: string | undefined;
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
} & {
|
|
320
|
+
"/hosts/runs-search": {
|
|
321
|
+
$get: {
|
|
322
|
+
output: {
|
|
323
|
+
error: string;
|
|
324
|
+
code?: "invalid_input" | undefined;
|
|
325
|
+
};
|
|
326
|
+
outputFormat: "json";
|
|
327
|
+
status: 400;
|
|
328
|
+
input: {
|
|
329
|
+
query: {
|
|
330
|
+
q: string | string[];
|
|
331
|
+
limit?: number | undefined;
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
} | {
|
|
335
|
+
output: {
|
|
336
|
+
runs: {
|
|
337
|
+
id: string;
|
|
338
|
+
title: string;
|
|
339
|
+
titleSummary?: string | undefined;
|
|
340
|
+
titleOrigin?: "auto" | "marker" | "user" | undefined;
|
|
341
|
+
status: "cancelled" | "done" | "failed" | "queued" | "review" | "running" | "waiting";
|
|
342
|
+
hasPendingPermission?: boolean | undefined;
|
|
343
|
+
waitingOn?: {
|
|
344
|
+
kind: "human";
|
|
345
|
+
shown?: true | undefined;
|
|
346
|
+
} | {
|
|
347
|
+
kind: "usage-limit";
|
|
348
|
+
at: string;
|
|
349
|
+
} | {
|
|
350
|
+
kind: "workers";
|
|
351
|
+
count: number;
|
|
352
|
+
replies?: true | undefined;
|
|
353
|
+
peers?: true | undefined;
|
|
354
|
+
} | {
|
|
355
|
+
kind: "peers";
|
|
356
|
+
count: number;
|
|
357
|
+
} | {
|
|
358
|
+
kind: "subagents";
|
|
359
|
+
count: number;
|
|
360
|
+
} | {
|
|
361
|
+
kind: "pr";
|
|
362
|
+
until: "checks" | "merge" | "merge_or_blocked";
|
|
363
|
+
waitId: string;
|
|
364
|
+
prUrl: string;
|
|
365
|
+
repository: string;
|
|
366
|
+
prNumber: number;
|
|
367
|
+
deadline: string;
|
|
368
|
+
} | {
|
|
369
|
+
kind: "process";
|
|
370
|
+
waitId: string;
|
|
371
|
+
pid: number;
|
|
372
|
+
deadline: string;
|
|
373
|
+
note?: string | undefined;
|
|
374
|
+
} | {
|
|
375
|
+
kind: "plugin";
|
|
376
|
+
pluginKind: string;
|
|
377
|
+
waitId: string;
|
|
378
|
+
summary: string;
|
|
379
|
+
deadline?: string | undefined;
|
|
380
|
+
} | {
|
|
381
|
+
kind: "timer";
|
|
382
|
+
waitId: string;
|
|
383
|
+
at: string;
|
|
384
|
+
note?: string | undefined;
|
|
385
|
+
} | undefined;
|
|
386
|
+
waitWakePending?: true | undefined;
|
|
387
|
+
delegation?: {
|
|
388
|
+
role: "invalid";
|
|
389
|
+
} | {
|
|
390
|
+
role: "root";
|
|
391
|
+
wait?: {
|
|
392
|
+
workerIds?: string[] | undefined;
|
|
393
|
+
requestIds?: string[] | undefined;
|
|
394
|
+
phase: "parked" | "registered" | "wake-pending";
|
|
395
|
+
outcomes?: {
|
|
396
|
+
workerId: string;
|
|
397
|
+
}[] | undefined;
|
|
398
|
+
} | undefined;
|
|
399
|
+
} | {
|
|
400
|
+
role: "worker";
|
|
401
|
+
parentRunId: string;
|
|
402
|
+
supervisorRunId?: string | undefined;
|
|
403
|
+
wait?: {
|
|
404
|
+
requestIds?: string[] | undefined;
|
|
405
|
+
phase: "parked" | "registered" | "wake-pending";
|
|
406
|
+
} | undefined;
|
|
407
|
+
} | undefined;
|
|
408
|
+
createdAt: string;
|
|
409
|
+
finishedAt?: string | undefined;
|
|
410
|
+
seenAt?: string | undefined;
|
|
411
|
+
archived: boolean;
|
|
412
|
+
autoResumeAt?: string | undefined;
|
|
413
|
+
autoResumeReason?: "provider-error" | "usage-limit" | undefined;
|
|
414
|
+
workflow: string;
|
|
415
|
+
branch?: string | undefined;
|
|
416
|
+
startedAt?: string | undefined;
|
|
417
|
+
pullRequestUrl?: string | undefined;
|
|
418
|
+
pullRequests?: {
|
|
419
|
+
number: number;
|
|
420
|
+
url?: string | undefined;
|
|
421
|
+
source: "created" | "declared";
|
|
422
|
+
}[] | undefined;
|
|
423
|
+
referencedPullRequestUrl?: string | undefined;
|
|
424
|
+
prNumber?: number | undefined;
|
|
425
|
+
issueNumber?: number | undefined;
|
|
426
|
+
referencedIssueUrl?: string | undefined;
|
|
427
|
+
markerRefs?: {
|
|
428
|
+
pr?: number | undefined;
|
|
429
|
+
issue?: number | undefined;
|
|
430
|
+
} | undefined;
|
|
431
|
+
costUsd?: number | undefined;
|
|
432
|
+
peakRssBytes?: number | undefined;
|
|
433
|
+
peakProcCount?: number | undefined;
|
|
434
|
+
usage?: {
|
|
435
|
+
cpuPct: number;
|
|
436
|
+
rssBytes: number;
|
|
437
|
+
procCount: number;
|
|
438
|
+
} | undefined;
|
|
439
|
+
workflowLabel: string;
|
|
440
|
+
groupId?: string | undefined;
|
|
441
|
+
variant?: string | undefined;
|
|
442
|
+
pinned?: boolean | undefined;
|
|
443
|
+
automationId?: string | undefined;
|
|
444
|
+
runner?: string | undefined;
|
|
445
|
+
removedRunner?: string | undefined;
|
|
446
|
+
model?: string | undefined;
|
|
447
|
+
notify?: boolean | undefined;
|
|
448
|
+
diffStat?: {
|
|
449
|
+
adds: number;
|
|
450
|
+
dels: number;
|
|
451
|
+
files: number;
|
|
452
|
+
repointed?: boolean | undefined;
|
|
453
|
+
} | undefined;
|
|
454
|
+
tokensUsed: number;
|
|
455
|
+
inputTokens?: number | undefined;
|
|
456
|
+
outputTokens?: number | undefined;
|
|
457
|
+
currentStepId?: string | undefined;
|
|
458
|
+
currentStepBackend?: string | undefined;
|
|
459
|
+
error?: string | undefined;
|
|
460
|
+
statePreview?: {
|
|
461
|
+
kind: "ask" | "error" | "permission" | "review";
|
|
462
|
+
text: string;
|
|
463
|
+
} | undefined;
|
|
464
|
+
worktreePath?: string | undefined;
|
|
465
|
+
projectId: string;
|
|
466
|
+
hostId: string;
|
|
467
|
+
}[];
|
|
468
|
+
truncated: {
|
|
469
|
+
hostId: string;
|
|
470
|
+
projectId: string;
|
|
471
|
+
}[];
|
|
472
|
+
unanswered: {
|
|
473
|
+
hostId: string;
|
|
474
|
+
label: string;
|
|
475
|
+
state: "cannot-persist" | "connected" | "connecting" | "identity-changed" | "needs-node" | "not-hosted" | "paused" | "several-servers" | "unreachable" | "version-mismatch";
|
|
476
|
+
reason: "deadline" | "error" | "not-connected";
|
|
477
|
+
}[];
|
|
478
|
+
warning?: string | undefined;
|
|
479
|
+
};
|
|
480
|
+
outputFormat: "json";
|
|
481
|
+
status: 200;
|
|
482
|
+
input: {
|
|
483
|
+
query: {
|
|
484
|
+
q: string | string[];
|
|
485
|
+
limit?: number | undefined;
|
|
486
|
+
};
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
};
|
|
124
490
|
} & {
|
|
125
491
|
"/hosts": {
|
|
126
492
|
$post: {
|