@hearsay-tools/squawk 0.18.0-dev.6646 → 0.18.0-dev.6683
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/ci-wait/tool-catalog.js +1 -1
- package/dist/ci-wait/tool-catalog.js.map +1 -1
- package/dist/contract/attention.d.ts +8 -0
- package/dist/contract/index.js +14 -0
- package/dist/contract/runs.d.ts +15 -0
- package/dist/delegation/conversations.d.ts +4 -2
- package/dist/delegation/park-notice.d.ts +5 -1
- package/dist/delegation/park-notice.js +7 -0
- package/dist/delegation/park-notice.js.map +1 -1
- package/dist/delegation/routes.d.ts +4 -4
- package/dist/delegation/scratch-cleanup.js +6 -3
- package/dist/delegation/scratch-cleanup.js.map +1 -1
- package/dist/delegation/transport.d.ts +16 -16
- package/dist/home/command.js +1 -1
- package/dist/home/command.js.map +1 -1
- package/dist/jobs/cli.js +4 -2
- package/dist/jobs/cli.js.map +1 -1
- package/dist/jobs/job.d.ts +7 -0
- package/dist/jobs/job.js +32 -3
- package/dist/jobs/job.js.map +1 -1
- package/dist/runs/agent-tmpdir.d.ts +3 -2
- package/dist/runs/agent-tmpdir.js +11 -4
- package/dist/runs/agent-tmpdir.js.map +1 -1
- package/dist/runs/automation-runs.js +4 -3
- package/dist/runs/automation-runs.js.map +1 -1
- package/dist/runs/conversation-members.js +3 -2
- package/dist/runs/conversation-members.js.map +1 -1
- package/dist/runs/guarded-json-sql.d.ts +8 -0
- package/dist/runs/guarded-json-sql.js +11 -0
- package/dist/runs/guarded-json-sql.js.map +1 -0
- package/dist/runs/run-database-peer-page.js +3 -4
- package/dist/runs/run-database-peer-page.js.map +1 -1
- package/dist/runs/run-database-version.d.ts +1 -1
- package/dist/runs/run-database-version.js +2 -1
- package/dist/runs/run-database-version.js.map +1 -1
- package/dist/runs/run-database.js +5 -4
- package/dist/runs/run-database.js.map +1 -1
- package/dist/runs/run-exits.d.ts +15 -6
- package/dist/runs/run-exits.js +13 -4
- package/dist/runs/run-exits.js.map +1 -1
- package/dist/runs/run-index.js +1 -2
- package/dist/runs/run-index.js.map +1 -1
- package/dist/runs/store.d.ts +11 -5
- package/dist/runs/store.js +21 -20
- package/dist/runs/store.js.map +1 -1
- package/dist/serve-boot.d.ts +1 -2
- package/dist/serve-command.js +25 -15
- package/dist/serve-command.js.map +1 -1
- package/dist/serve-stop.d.ts +41 -0
- package/dist/serve-stop.js +42 -0
- package/dist/serve-stop.js.map +1 -0
- package/dist/server/checkout.d.ts +1 -1
- package/dist/server/health-cache.d.ts +39 -0
- package/dist/server/health-cache.js +66 -0
- package/dist/server/health-cache.js.map +1 -0
- package/dist/server/server.d.ts +1825 -1807
- package/dist/server/server.js +17 -63
- package/dist/server/server.js.map +1 -1
- package/dist/server-install/platforms/macosx-migration.js +1 -1
- package/dist/server-install/platforms/macosx-migration.js.map +1 -1
- package/dist/server-install/platforms/ubuntu-vps-migration.js +1 -1
- package/dist/server-install/platforms/ubuntu-vps-migration.js.map +1 -1
- package/dist/workflows/continuation-admission.d.ts +2 -1
- package/dist/workflows/run/prompts.js +1 -1
- package/dist/workflows/run/prompts.js.map +1 -1
- package/dist/workflows/run/run-settlement.d.ts +10 -0
- package/dist/workflows/run/run-settlement.js +39 -5
- package/dist/workflows/run/run-settlement.js.map +1 -1
- package/dist/workflows/run/step-loop.js +1 -1
- package/dist/workflows/run/step-loop.js.map +1 -1
- package/dist/workflows/run/wait-engine.d.ts +2 -1
- package/dist/workflows/run/worker-questions.d.ts +3 -2
- package/dist/workflows/run/worker-questions.js +6 -5
- package/dist/workflows/run/worker-questions.js.map +1 -1
- package/dist/workflows/run-states.js +1 -1
- package/dist/workflows/run-states.js.map +1 -1
- package/package.json +4 -4
- package/scripts/measure-transcript-facts-health.mjs +13 -6
- package/web/dist/assets/activity-motion-DhLXb8Pt.js +2 -0
- package/web/dist/assets/{activity-route--Qj4NT9h.js → activity-route-CpwAMYLn.js} +1 -1
- package/web/dist/assets/{agent-accounts-BxpWcFS3.js → agent-accounts-Bc0LJ4SB.js} +1 -1
- package/web/dist/assets/attention-BF8NA1XM.js +1 -0
- package/web/dist/assets/{commit-diff-panel-DOgakNKv.js → commit-diff-panel-B1KZl0GP.js} +1 -1
- package/web/dist/assets/{diff-MoyKcT8Q.js → diff-Ci-qd1lU.js} +2 -2
- package/web/dist/assets/{diff-view-BFQcOCEf.js → diff-view-CWZElKoD.js} +1 -1
- package/web/dist/assets/{file-preview-BancpZHA.js → file-preview-CoWRr13R.js} +1 -1
- package/web/dist/assets/{git-toolbar-ClMasBRM.js → git-toolbar-BYIni94R.js} +1 -1
- package/web/dist/assets/{github-BVZ01nJq.js → github-CAPNq5vY.js} +1 -1
- package/web/dist/assets/{global-activity-route-DTgywy--.js → global-activity-route-DLEwsMA7.js} +1 -1
- package/web/dist/assets/index-CpwAOct4.js +17 -0
- package/web/dist/assets/{preview-pane-connected-B5PCWA9a.js → preview-pane-connected-CGw_9VuF.js} +2 -2
- package/web/dist/assets/{project-router-CiB1O_5A.js → project-router-oKsNlPN6.js} +1 -1
- package/web/dist/assets/{project-scope-context-CSPQyWoO.js → project-scope-context-BBVJVcJp.js} +1 -1
- package/web/dist/assets/{prompt-template-menu-VwBcsbqE.js → prompt-template-menu-BZTz2mIG.js} +1 -1
- package/web/dist/assets/queries-Be8VyHam.js +1 -0
- package/web/dist/assets/{reference-chip-DT-_ninM.js → reference-chip-Ht4xX9-k.js} +1 -1
- package/web/dist/assets/{repo-git-7KuJaDRk.js → repo-git-CzVLCWig.js} +1 -1
- package/web/dist/assets/{report-reader-CgY75QM2.js → report-reader-iTBkUgg-.js} +1 -1
- package/web/dist/assets/reports-BJF1Cl3C.js +1 -0
- package/web/dist/assets/run-header-BxB6gyt1.js +2 -0
- package/web/dist/assets/{skills-Dnrta_-m.js → skills-DvgHKWgK.js} +1 -1
- package/web/dist/assets/{tab-link-BPBiho7-.js → tab-link-Buy1fRFO.js} +1 -1
- package/web/dist/assets/{task-changes-C6sDd3Le.js → task-changes-CStxhLFG.js} +1 -1
- package/web/dist/assets/{task-commits-CQHxnFJ5.js → task-commits-DhpOAdOf.js} +1 -1
- package/web/dist/assets/{task-files-DK8Demuc.js → task-files-COmKUUfN.js} +1 -1
- package/web/dist/assets/{task-github-item-DgmmFFtN.js → task-github-item-BNLeAz58.js} +1 -1
- package/web/dist/assets/{task-thread-Dg9VWJq6.js → task-thread-DjSFvEQe.js} +6 -6
- package/web/dist/assets/{thread-state-DIMUAyFk.js → thread-state-B5tTsVNm.js} +1 -1
- package/web/dist/assets/use-desktop-BPWIJ0Kw.js +1 -0
- package/web/dist/assets/{use-hand-to-agent-state-D-yaVRRx.js → use-hand-to-agent-state-Ce6QW2j_.js} +1 -1
- package/web/dist/assets/{useInfiniteQuery-Q8eFXz-L.js → useInfiniteQuery-Yn58_Fkn.js} +1 -1
- package/web/dist/assets/useQuery-C1xFF0nd.js +1 -0
- package/web/dist/assets/{workflows-W_uriBcj.js → workflows-CN8uKYnY.js} +1 -1
- package/web/dist/assets/{ws-B-tB133E.js → ws-DbXGHAke.js} +1 -1
- package/web/dist/index.html +12 -12
- package/web/dist/assets/activity-motion-CEnf2rDh.js +0 -2
- package/web/dist/assets/attention-BDa7opY9.js +0 -1
- package/web/dist/assets/index-CsOa03VW.js +0 -17
- package/web/dist/assets/queries-pj368bmB.js +0 -1
- package/web/dist/assets/reports-CxTUchWh.js +0 -1
- package/web/dist/assets/run-header-BcX23gw7.js +0 -2
- package/web/dist/assets/use-desktop-Bq_Qh5ur.js +0 -1
- package/web/dist/assets/useQuery-BoLjCS2U.js +0 -1
package/dist/server/server.js
CHANGED
|
@@ -110,6 +110,7 @@ import { worktreeDiff, worktreeSizeBytes } from '../git-worktree.js';
|
|
|
110
110
|
import { releaseThenRemoveWorktree } from '../git-worktree-release.js';
|
|
111
111
|
import { isReclaimable, reclaimWorktree, reclaimWorktrees, selectReclaimableWorktrees } from '../runs/retention.js';
|
|
112
112
|
import { getBranches, getCommit, getDiff, getLogWithParents, getRepoInfo, getStatus, getTracking } from './git.js';
|
|
113
|
+
import { createHealthCache, HEALTH_TTL_MS } from './health-cache.js';
|
|
113
114
|
import { createGithubBranchForge } from './repo-branch-forge.js';
|
|
114
115
|
import { attributeLog, classifyInputFor, deleteBranches, forgetRepoBranches, readRepoBranchCounts, readRepoBranches } from './repo-branches.js';
|
|
115
116
|
import { claimRepoGitMutation, localPullBranches, pullRepoCheckout } from './repo-pull.js';
|
|
@@ -678,11 +679,9 @@ export function createApp(deps) {
|
|
|
678
679
|
.then((changed) => {
|
|
679
680
|
if (!changed)
|
|
680
681
|
return;
|
|
681
|
-
// Probe is settled;
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
await refreshHealth();
|
|
685
|
-
})().catch(() => { });
|
|
682
|
+
// Probe is settled; publish the new checks to both transports. Only availability changed:
|
|
683
|
+
// re-reading Git would spawn processes on this loop (hearsay-tools/squawk#3355).
|
|
684
|
+
void healthCache.patch((payload) => ({ ...payload, checks: backendChecks })).catch(() => { });
|
|
686
685
|
});
|
|
687
686
|
}
|
|
688
687
|
return backendChecks;
|
|
@@ -730,69 +729,24 @@ export function createApp(deps) {
|
|
|
730
729
|
bootProject: workspace.bootProject,
|
|
731
730
|
};
|
|
732
731
|
};
|
|
733
|
-
//
|
|
734
|
-
//
|
|
735
|
-
// probes have their own nonblocking cache above. Paying that on the browser's FIRST `GET /api/health` is
|
|
736
|
-
// exactly the few-seconds-blank the cockpit showed at load. So on the live
|
|
737
|
-
// server the snapshot is computed at the server's OWN pace: both the GET and
|
|
738
|
-
// the WS `health` topic serve the cached value immediately and revalidate
|
|
739
|
-
// behind the response, and the cache is pre-warmed at boot so that first
|
|
740
|
-
// request lands on a warm value instead of the cold compute.
|
|
741
|
-
const HEALTH_TTL_MS = 5_000;
|
|
742
|
-
// The staleness CEILING, which is a different job from the TTL above. The TTL
|
|
743
|
-
// decides how often a revalidation is kicked off; on its own it bounds nothing,
|
|
744
|
-
// because the revalidation is fire-and-forget. While a cockpit holds the
|
|
745
|
-
// `health` topic the publisher's interval keeps the cache warm and the two are
|
|
746
|
-
// the same number — but the normal state of a background `hsq serve` is NO
|
|
747
|
-
// subscriber, and then nothing refreshes the cache at all: the next `GET
|
|
748
|
-
// /api/health`, an hour later, would answer with the boot pre-warm's payload
|
|
749
|
-
// and only the request AFTER it would see the truth. `repo.branch` going stale there is
|
|
750
|
-
// literally #369, so past this age correctness beats the latency win and the
|
|
751
|
-
// read waits for the compute. `refreshHealth` dedupes, so waiting costs one.
|
|
752
|
-
const HEALTH_MAX_STALE_MS = 60_000;
|
|
753
|
-
let healthCache;
|
|
754
|
-
let healthInFlight;
|
|
755
|
-
// Set while the topic has a subscriber; a change a refresh detects is pushed
|
|
756
|
-
// here (a noop when nobody is listening).
|
|
732
|
+
// Stale-while-revalidate cache over the snapshot; see health-cache.ts.
|
|
733
|
+
// Set while the topic has a subscriber (a noop when nobody is listening).
|
|
757
734
|
let publishHealth = () => { };
|
|
758
|
-
const
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
const body = JSON.stringify(payload);
|
|
767
|
-
const changed = body !== healthCache?.body;
|
|
768
|
-
healthCache = { at: Date.now(), payload, body };
|
|
769
|
-
if (changed) {
|
|
770
|
-
publishHealth(payload);
|
|
771
|
-
workspaceEvents.emit('health', payload);
|
|
772
|
-
} // only a real change reaches either transport
|
|
773
|
-
return payload;
|
|
774
|
-
}
|
|
775
|
-
finally {
|
|
776
|
-
healthInFlight = undefined;
|
|
777
|
-
}
|
|
778
|
-
})();
|
|
779
|
-
return healthInFlight;
|
|
780
|
-
};
|
|
735
|
+
const healthCache = createHealthCache({
|
|
736
|
+
snapshot: healthSnapshot,
|
|
737
|
+
publish: (payload) => {
|
|
738
|
+
publishHealth(payload);
|
|
739
|
+
workspaceEvents.emit('health', payload);
|
|
740
|
+
},
|
|
741
|
+
});
|
|
742
|
+
const refreshHealth = () => healthCache.refresh();
|
|
781
743
|
// The read the GET and the topic snapshot share. On the live server (a hub is
|
|
782
|
-
// injected) it answers from cache
|
|
783
|
-
//
|
|
784
|
-
// keeping a cache coherent, so it computes fresh, exactly as before.
|
|
744
|
+
// injected) it answers from cache; without a hub — a bare app in tests — there is
|
|
745
|
+
// no refresher keeping a cache coherent, so it computes fresh, exactly as before.
|
|
785
746
|
const readHealth = async () => {
|
|
786
747
|
if (!deps.socketHub)
|
|
787
748
|
return healthSnapshot();
|
|
788
|
-
|
|
789
|
-
return refreshHealth(); // first ever: nothing to serve yet
|
|
790
|
-
const age = Date.now() - healthCache.at;
|
|
791
|
-
if (age > HEALTH_MAX_STALE_MS)
|
|
792
|
-
return refreshHealth(); // too old to serve — wait for the truth
|
|
793
|
-
if (age > HEALTH_TTL_MS)
|
|
794
|
-
void refreshHealth(); // stale: refresh, don't wait on it
|
|
795
|
-
return { ...healthCache.payload, capabilities: capabilities() }; // per request, like the gates (ADR 0055)
|
|
749
|
+
return healthCache.read((payload) => ({ ...payload, capabilities: capabilities() })); // per request, like the gates (ADR 0055)
|
|
796
750
|
};
|
|
797
751
|
// ---- chained family: health (workspace-level) ----------------------------
|
|
798
752
|
// Written as ONE chained expression rather than a loose `app.get(...)`
|