@hearsay-tools/squawk 0.18.0-pr4107.7862 → 0.18.0-pr4108.7872
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/cli-dispatch.d.ts +2 -1
- package/dist/cli-dispatch.js +3 -7
- package/dist/cli-dispatch.js.map +1 -1
- package/dist/contract/delegation.d.ts +1 -0
- package/dist/contract/index.js +56 -2
- package/dist/contract/runs.d.ts +1 -1
- package/dist/core/process-usage.d.ts +5 -0
- package/dist/core/process-usage.js +8 -2
- package/dist/core/process-usage.js.map +1 -1
- package/dist/delegation/transport.d.ts +15 -15
- package/dist/index.js +36 -42
- package/dist/index.js.map +1 -1
- package/dist/legacy-runs.d.ts +5 -6
- package/dist/legacy-runs.js +3 -16
- package/dist/legacy-runs.js.map +1 -1
- package/dist/runs/run-persistence.js +2 -5
- package/dist/runs/run-persistence.js.map +1 -1
- package/dist/runs/run-references.d.ts +2 -0
- package/dist/runs/run-references.js +12 -0
- package/dist/runs/run-references.js.map +1 -1
- package/dist/server/brand-file-routes.d.ts +1 -1
- package/dist/server/models-routes.d.ts +13 -13
- package/dist/server/reports-api.d.ts +2 -2
- package/dist/server/run-event-feed.js +14 -5
- package/dist/server/run-event-feed.js.map +1 -1
- package/dist/server/server.d.ts +470 -470
- package/dist/server/server.js +26 -28
- package/dist/server/server.js.map +1 -1
- package/dist/server/static-assets.d.ts +5 -0
- package/dist/server/static-assets.js +109 -0
- package/dist/server/static-assets.js.map +1 -0
- package/dist/server/workspace-live-routes.d.ts +6 -6
- package/dist/subcommands.d.ts +0 -2
- package/dist/subcommands.js +0 -26
- package/dist/subcommands.js.map +1 -1
- package/dist/task-cli/cli.js +2 -2
- package/dist/task-cli/cli.js.map +1 -1
- package/dist/workflows/attachment-path.d.ts +2 -0
- package/dist/workflows/attachment-path.js +21 -0
- package/dist/workflows/attachment-path.js.map +1 -1
- package/package.json +4 -4
- package/web/dist/assets/activity-motion-BNen0Yj8.js +2 -0
- package/web/dist/assets/{activity-route-Cz-rvbZ2.js → activity-route-BGQMI1Yu.js} +1 -1
- package/web/dist/assets/attention-B0IBc2_D.js +1 -0
- package/web/dist/assets/{cez-idle-BZ4uUtP5.js → cez-idle-BY3rjM_y.js} +1 -1
- package/web/dist/assets/{chunk-BO2N2NFS-CM5F_Wdn.js → chunk-BO2N2NFS-y7WHTKOf.js} +4 -4
- package/web/dist/assets/commit-diff-panel-Cr-XVbz_.js +1 -0
- package/web/dist/assets/{diff-DI4VzuYN.js → diff-DqLaONaB.js} +2 -2
- package/web/dist/assets/{diff-view-D_4gizCK.js → diff-view-CHj5zMlT.js} +1 -1
- package/web/dist/assets/{file-preview-Bi4gKafB.js → file-preview-C9yv3267.js} +1 -1
- package/web/dist/assets/{git-toolbar-rD304H-0.js → git-toolbar-uHPKACQa.js} +1 -1
- package/web/dist/assets/github-Fy6-Zf4b.js +1 -0
- package/web/dist/assets/{global-activity-route-DlY7H1rT.js → global-activity-route-CpAGVfbb.js} +1 -1
- package/web/dist/assets/{highlighted-body-OFNGDK62-D2OLwPBs.js → highlighted-body-OFNGDK62-D62LjTH2.js} +1 -1
- package/web/dist/assets/index-Dn02NPUV.js +14 -0
- package/web/dist/assets/live-protocol-D9ji1YCl.js +64 -0
- package/web/dist/assets/markdown-9j2EqN9q.js +4 -0
- package/web/dist/assets/mermaid-GHXKKRXX-C7OP146z.js +1 -0
- package/web/dist/assets/{picker-pill-B8HQMHMO.js → picker-pill-D8SyrTxD.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-Dggh7YST.js → preview-pane-connected-CBKK0crt.js} +1 -1
- package/web/dist/assets/{project-router-CFmb6NlX.js → project-router-CcyPWtFH.js} +1 -1
- package/web/dist/assets/project-scope-context-CX36ze1Q.js +4 -0
- package/web/dist/assets/{prompt-template-menu-DBFmXFq5.js → prompt-template-menu-DT_0Pyd5.js} +1 -1
- package/web/dist/assets/queries-Cb76PEoL.js +1 -0
- package/web/dist/assets/{reference-chip-6RyUrDc6.js → reference-chip-DwiE3MIR.js} +1 -1
- package/web/dist/assets/{repo-git-7kwazD3R.js → repo-git-CjKFvYdb.js} +1 -1
- package/web/dist/assets/{report-reader-Dg2ojBc_.js → report-reader--BXJs1DJ.js} +1 -1
- package/web/dist/assets/{reports-DaN1XZ5g.js → reports-CZw5ztdC.js} +1 -1
- package/web/dist/assets/run-header-BOEjnB1z.js +2 -0
- package/web/dist/assets/{runners-M0-6Uumh.js → runners-CKrq5tR_.js} +1 -1
- package/web/dist/assets/{skills-CXU7ZjvL.js → skills-aBp_7vVU.js} +1 -1
- package/web/dist/assets/{tab-link-B8m0q2sJ.js → tab-link-Dn7KFNYr.js} +1 -1
- package/web/dist/assets/{task-changes-BuVilcOg.js → task-changes-B0u392zf.js} +1 -1
- package/web/dist/assets/task-commits-DzWFfo43.js +1 -0
- package/web/dist/assets/{task-files-D-vyiZrz.js → task-files-DTWfdMRi.js} +1 -1
- package/web/dist/assets/{task-github-item-DQHmhrMu.js → task-github-item-CFWE3MpX.js} +1 -1
- package/web/dist/assets/task-thread-vYwAvLtU.js +9 -0
- package/web/dist/assets/{thread-state-Cd3Q9ZdX.js → thread-state-zGEm4Ym4.js} +1 -1
- package/web/dist/assets/{use-desktop-NTwdvSZg.js → use-desktop-DN7wbSS7.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-DMy1raU0.js → use-hand-to-agent-state-C9YTgLEG.js} +1 -1
- package/web/dist/assets/{useInfiniteQuery-g210uX4t.js → useInfiniteQuery-BdIIhzMI.js} +1 -1
- package/web/dist/assets/useQuery-Dg1rzYtR.js +1 -0
- package/web/dist/assets/{workflows-KeaSZ0DF.js → workflows-C8EnR0NU.js} +2 -2
- package/web/dist/assets/{ws-DBXUJ3K4.js → ws-DiWUfn_t.js} +1 -1
- package/web/dist/index.html +15 -15
- package/web/dist/live-worker.js +1 -1
- package/web/dist/assets/activity-motion-CUiNY01w.js +0 -2
- package/web/dist/assets/attention-BbVNVmrP.js +0 -1
- package/web/dist/assets/commit-diff-panel-DMI0GCL1.js +0 -1
- package/web/dist/assets/github-DZQgKb40.js +0 -1
- package/web/dist/assets/index-D4lUB-OA.js +0 -14
- package/web/dist/assets/live-protocol-60uiPDg6.js +0 -64
- package/web/dist/assets/markdown-doq86ner.js +0 -4
- package/web/dist/assets/mermaid-GHXKKRXX-DCw6rSYC.js +0 -1
- package/web/dist/assets/project-scope-context-Dlbq88xo.js +0 -4
- package/web/dist/assets/queries-BtkCvBtK.js +0 -1
- package/web/dist/assets/run-header-GF37CaAZ.js +0 -2
- package/web/dist/assets/task-commits-DDWgrNtx.js +0 -1
- package/web/dist/assets/task-thread-CQN8oXtT.js +0 -9
- package/web/dist/assets/useQuery-D89BPQpm.js +0 -1
package/dist/server/server.js
CHANGED
|
@@ -54,7 +54,7 @@ import { runRelationships } from './run-relationships.js';
|
|
|
54
54
|
import { delegationFailure } from '../delegation/routes.js';
|
|
55
55
|
import { githubItemParamsSchema } from '../contract/index.js';
|
|
56
56
|
import { workerDestroyRequestSchema, workerEmptyRequestSchema, runRelationshipsSchema } from '../contract/index.js';
|
|
57
|
-
import { existsSync
|
|
57
|
+
import { existsSync } from 'node:fs';
|
|
58
58
|
import { randomUUID } from 'node:crypto';
|
|
59
59
|
import { createAutomationService, onceCreateAnswer } from '../automations/service.js';
|
|
60
60
|
import { createAutomationToolService } from '../automations/tool-adapter.js';
|
|
@@ -105,7 +105,7 @@ import { ownPullRequestNumbers } from '../runs/pull-requests.js';
|
|
|
105
105
|
import { ColdRepoHandles } from './cold-repo-handles.js';
|
|
106
106
|
import { isV2WireEventType } from '../runs/ui-event-sink.js';
|
|
107
107
|
import { runEventsQuerySchema, runHistoryQuerySchema, runIdParamSchema, } from '../contract/index.js';
|
|
108
|
-
import {
|
|
108
|
+
import { resolveAttachmentPathAsync } from '../workflows/attachment-path.js';
|
|
109
109
|
import { artifactParamsSchema, fileLinkQuerySchema } from '../contract/index.js';
|
|
110
110
|
import { listArtifacts, readArtifact, readArtifactMetadata } from '../artifacts/store.js';
|
|
111
111
|
import { artifactPreview, loadFileLink, rasterMime } from '../artifacts/resolve.js';
|
|
@@ -153,6 +153,7 @@ import { providerForExistingRun, providersRequiredByWorkflow, } from './provider
|
|
|
153
153
|
import { attachProjectWebhooks, createBootContext, createProviderStatus, emitProviderRow, resolveServerDeps, watchProviderRuntimeAuth, } from './server-deps.js';
|
|
154
154
|
import { NO_WEBHOOK_ERROR, agentProfileRefusal, clientRequestOf, launchRun, modelLockRefusal, notifyRefusal, providerGateRefusal, replayedRun, resolveStartWorkflow, startRunInput, } from './start-run-options.js';
|
|
155
155
|
import { ASSET_CACHE_CONTROL, BUILD_HINT_HTML, assetContentType, isSafeAssetFilename, resolveGetRequest, } from './static-ui.js';
|
|
156
|
+
import { compression, createStaticAssets, isFile } from './static-assets.js';
|
|
156
157
|
import { registerBrandFileRoutes } from './brand-file-routes.js';
|
|
157
158
|
/** The hosted-mode refusal, worded like the agent-config one it mirrors. */
|
|
158
159
|
const HOSTED_GITHUB_CREATE_REFUSAL = 'Creating GitHub repositories is available from a local cockpit only';
|
|
@@ -481,6 +482,11 @@ export function createApp(deps) {
|
|
|
481
482
|
};
|
|
482
483
|
};
|
|
483
484
|
const app = new Hono();
|
|
485
|
+
app.use('*', compression);
|
|
486
|
+
// One cache per app: immutable bundle bytes and their negotiated encodings share a cap.
|
|
487
|
+
// Live shell and worker files bypass it so a rebuild appears on the next request.
|
|
488
|
+
// Compression runs outside route families and leaves live event streams untouched.
|
|
489
|
+
const staticResponse = createStaticAssets();
|
|
484
490
|
// Reject oversized request bodies before they reach any handler (#429). GETs
|
|
485
491
|
// and SSE carry no body, so this only ever gates the mutating routes.
|
|
486
492
|
app.use('*', bodyLimit({ maxSize: GLOBAL_BODY_LIMIT }));
|
|
@@ -574,7 +580,7 @@ export function createApp(deps) {
|
|
|
574
580
|
const webDir = resolveWebDir();
|
|
575
581
|
const distDir = join(webDir, 'dist');
|
|
576
582
|
const HTML_TYPE = 'text/html; charset=utf-8';
|
|
577
|
-
const staticFile = (name, type) => (c) => {
|
|
583
|
+
const staticFile = (name, type) => async (c) => {
|
|
578
584
|
// Read per request — the files are tiny and this keeps dev iteration live.
|
|
579
585
|
//
|
|
580
586
|
// Served out of the Vite build: the files are `public/` assets of the web package, which the
|
|
@@ -583,24 +589,22 @@ export function createApp(deps) {
|
|
|
583
589
|
// paths. Without a build there is nothing to serve, which is a 404 rather than a crash (the
|
|
584
590
|
// shell route answers the same dev-only state with its build hint).
|
|
585
591
|
const path = join(distDir, name);
|
|
586
|
-
|
|
587
|
-
return c.json({ error: 'not found' }, 404);
|
|
588
|
-
return new Response(readFileSync(path), { headers: { 'content-type': type } });
|
|
592
|
+
return staticResponse(c.req.raw, path, { 'content-type': type });
|
|
589
593
|
};
|
|
590
594
|
// Stable SharedWorker identity across same-origin tabs; its imported chunks stay hashed.
|
|
591
|
-
app.get('/live-worker.js', (c) => {
|
|
592
|
-
const response = staticFile('live-worker.js', 'text/javascript; charset=utf-8')(c);
|
|
595
|
+
app.get('/live-worker.js', async (c) => {
|
|
596
|
+
const response = await staticFile('live-worker.js', 'text/javascript; charset=utf-8')(c);
|
|
593
597
|
response.headers.set('Cache-Control', 'no-cache');
|
|
594
598
|
return response;
|
|
595
599
|
});
|
|
596
600
|
let hintLogged = false;
|
|
597
|
-
const serveShell = (c) => {
|
|
601
|
+
const serveShell = async (c) => {
|
|
598
602
|
const distIndex = join(distDir, 'index.html');
|
|
599
|
-
//
|
|
603
|
+
// Async stat per request, like the reads below: `npm run build:web` in a
|
|
600
604
|
// running cockpit takes effect on the next reload, no restart.
|
|
601
605
|
const target = resolveGetRequest({
|
|
602
606
|
path: c.req.path,
|
|
603
|
-
distExists:
|
|
607
|
+
distExists: await isFile(distIndex),
|
|
604
608
|
});
|
|
605
609
|
if (target === 'passthrough')
|
|
606
610
|
return undefined;
|
|
@@ -615,28 +619,22 @@ export function createApp(deps) {
|
|
|
615
619
|
headers: { 'content-type': HTML_TYPE },
|
|
616
620
|
});
|
|
617
621
|
}
|
|
618
|
-
return
|
|
619
|
-
headers: { 'content-type': HTML_TYPE },
|
|
620
|
-
});
|
|
622
|
+
return staticResponse(c.req.raw, distIndex, { 'content-type': HTML_TYPE });
|
|
621
623
|
};
|
|
622
624
|
// Hashed bundles/fonts of the built app. Vite fingerprints every name, so
|
|
623
625
|
// the bytes behind a URL never change — cache them hard. Only plain
|
|
624
626
|
// filenames are served: `basename('..')` is `'..'` (it resolves to the
|
|
625
|
-
// assets dir itself and
|
|
627
|
+
// assets dir itself and readFile would throw EISDIR), so dot-segments
|
|
626
628
|
// and separator-bearing params get a 404, not a 500.
|
|
627
|
-
app.get('/assets/:file', (c) => {
|
|
629
|
+
app.get('/assets/:file', async (c) => {
|
|
628
630
|
const file = c.req.param('file');
|
|
629
631
|
if (!isSafeAssetFilename(file))
|
|
630
632
|
return c.json({ error: 'not found' }, 404);
|
|
631
633
|
const path = join(distDir, 'assets', file);
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
'content-type': assetContentType(file),
|
|
637
|
-
'cache-control': ASSET_CACHE_CONTROL,
|
|
638
|
-
},
|
|
639
|
-
});
|
|
634
|
+
return staticResponse(c.req.raw, path, {
|
|
635
|
+
'content-type': assetContentType(file),
|
|
636
|
+
'cache-control': ASSET_CACHE_CONTROL,
|
|
637
|
+
}, true);
|
|
640
638
|
});
|
|
641
639
|
registerBrandFileRoutes(app, staticFile);
|
|
642
640
|
// ---- meta ----------------------------------------------------------------
|
|
@@ -2872,13 +2870,13 @@ export function createApp(deps) {
|
|
|
2872
2870
|
'content-type': 'text/markdown; charset=utf-8',
|
|
2873
2871
|
});
|
|
2874
2872
|
})
|
|
2875
|
-
.get('/runs/:id/images/:file', paramZodValidator(attachmentFileParamSchema), (c) => {
|
|
2873
|
+
.get('/runs/:id/images/:file', paramZodValidator(attachmentFileParamSchema), async (c) => {
|
|
2876
2874
|
const { store } = c.get('project');
|
|
2877
2875
|
const run = store.getRun(c.req.param('id'));
|
|
2878
2876
|
if (!run)
|
|
2879
2877
|
return c.json({ error: 'not found' }, 404);
|
|
2880
2878
|
const file = c.req.valid('param').file;
|
|
2881
|
-
const path =
|
|
2879
|
+
const path = await resolveAttachmentPathAsync(store.claims.sourceDataDir(run.id), run.id, file);
|
|
2882
2880
|
if (!path)
|
|
2883
2881
|
return c.json({ error: 'not found' }, 404);
|
|
2884
2882
|
const ext = file.split('.').pop() ?? '';
|
|
@@ -2886,7 +2884,7 @@ export function createApp(deps) {
|
|
|
2886
2884
|
// An image answers exactly as it always has — the cockpit renders it in an `<img>`.
|
|
2887
2885
|
// Everything else is a user-supplied file (#950) and leaves under the download headers.
|
|
2888
2886
|
const type = image ?? FILE_TYPES[ext] ?? 'application/octet-stream';
|
|
2889
|
-
return new Response(
|
|
2887
|
+
return new Response(await readFile(path), {
|
|
2890
2888
|
headers: {
|
|
2891
2889
|
'content-type': type,
|
|
2892
2890
|
'cache-control': 'private, max-age=31536000, immutable',
|
|
@@ -4156,7 +4154,7 @@ export function createApp(deps) {
|
|
|
4156
4154
|
// an unknown API path must never answer with HTML.
|
|
4157
4155
|
// Without a web/dist build this serves the built-in build-hint page (dev-only
|
|
4158
4156
|
// state — the published tarball ships web/dist), never a 404.
|
|
4159
|
-
routed.get('*', (c) => serveShell(c) ?? c.notFound());
|
|
4157
|
+
routed.get('*', async (c) => await serveShell(c) ?? c.notFound());
|
|
4160
4158
|
return routed;
|
|
4161
4159
|
}
|
|
4162
4160
|
/** The host a thread link names (#589): the bound one, or loopback for a wildcard bind. */
|