@hearsay-tools/squawk 0.19.0-pr4575.9079 → 0.19.0-pr4576.9083
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/boot.js +2 -0
- package/dist/boot.js.map +1 -1
- package/dist/ci-wait/controller.d.ts +7 -7
- package/dist/core/live-topic-registry.d.ts +29 -0
- package/dist/core/live-topic-registry.js +68 -0
- package/dist/core/live-topic-registry.js.map +1 -0
- package/dist/core/server-hook-registry.d.ts +2 -0
- package/dist/core/server-hook-registry.js.map +1 -1
- package/dist/delegation/transport.d.ts +78 -78
- package/dist/features/automations/tools.d.ts +8 -8
- package/dist/features/reports/capability.d.ts +3 -0
- package/dist/features/reports/capability.js +6 -0
- package/dist/features/reports/capability.js.map +1 -0
- package/dist/features/reports/index.d.ts +13 -0
- package/dist/features/reports/index.js +12 -0
- package/dist/features/reports/index.js.map +1 -0
- package/dist/features/reports/live-topic.d.ts +5 -0
- package/dist/{server/reports-topic.js → features/reports/live-topic.js} +10 -7
- package/dist/features/reports/live-topic.js.map +1 -0
- package/dist/{artifacts → features/reports}/reports-index.d.ts +5 -5
- package/dist/{artifacts → features/reports}/reports-index.js +7 -7
- package/dist/features/reports/reports-index.js.map +1 -0
- package/dist/{artifacts → features/reports}/reports-watch.d.ts +3 -3
- package/dist/{artifacts → features/reports}/reports-watch.js +2 -2
- package/dist/features/reports/reports-watch.js.map +1 -0
- package/dist/{server/reports-api.d.ts → features/reports/routes.d.ts} +8 -4
- package/dist/features/reports/routes.js +32 -0
- package/dist/features/reports/routes.js.map +1 -0
- package/dist/features/reports/server-hook.d.ts +8 -0
- package/dist/features/reports/server-hook.js +25 -0
- package/dist/features/reports/server-hook.js.map +1 -0
- package/dist/plugin/api.d.ts +3 -0
- package/dist/plugin/api.js +10 -1
- package/dist/plugin/api.js.map +1 -1
- package/dist/plugin/cli.js +1 -1
- package/dist/plugin/cli.js.map +1 -1
- package/dist/plugin/index.d.ts +1 -0
- package/dist/plugin/index.js.map +1 -1
- package/dist/server/activity-routes.d.ts +23 -23
- package/dist/server/activity-routes.js +0 -2
- package/dist/server/activity-routes.js.map +1 -1
- package/dist/server/live-routes.d.ts +6 -6
- package/dist/server/plugin-live-topics.d.ts +18 -0
- package/dist/server/plugin-live-topics.js +120 -0
- package/dist/server/plugin-live-topics.js.map +1 -0
- package/dist/server/project-context.js +0 -2
- package/dist/server/project-context.js.map +1 -1
- package/dist/server/providers-routes.d.ts +58 -58
- package/dist/server/runs-routes.d.ts +22 -22
- package/dist/server/server.d.ts +1588 -1761
- package/dist/server/server.js +3 -4
- package/dist/server/server.js.map +1 -1
- package/dist/server/start-server.js +6 -3
- package/dist/server/start-server.js.map +1 -1
- package/dist/server/workspace-identity-routes.d.ts +5 -5
- package/dist/server/workspace-live-routes.d.ts +11 -11
- package/package.json +4 -4
- package/dist/artifacts/reports-index.js.map +0 -1
- package/dist/artifacts/reports-watch.js.map +0 -1
- package/dist/server/reports-api.js +0 -22
- package/dist/server/reports-api.js.map +0 -1
- package/dist/server/reports-topic.d.ts +0 -5
- package/dist/server/reports-topic.js.map +0 -1
package/dist/boot.js
CHANGED
|
@@ -55,6 +55,7 @@ async function sealRuntime({ pluginsDir, bundledRunnersDir, bundledFeaturesDir,
|
|
|
55
55
|
const { sealRunLifecycleListeners } = await import('./runs/lifecycle-registry.js');
|
|
56
56
|
const { sealRunners } = await import('./core/runner-registry.js');
|
|
57
57
|
const { sealHttpRoutes } = await import('./core/http-route-registry.js');
|
|
58
|
+
const { sealLiveTopics } = await import('./core/live-topic-registry.js');
|
|
58
59
|
const { sealServerHooks } = await import('./core/server-hook-registry.js');
|
|
59
60
|
const { sealCapabilities } = await import('./core/capability-registry.js');
|
|
60
61
|
const { sealForges } = await import('./core/forge-registry.js');
|
|
@@ -75,6 +76,7 @@ async function sealRuntime({ pluginsDir, bundledRunnersDir, bundledFeaturesDir,
|
|
|
75
76
|
await beforeSeal?.();
|
|
76
77
|
sealBuiltInCliCommands();
|
|
77
78
|
sealHttpRoutes();
|
|
79
|
+
sealLiveTopics();
|
|
78
80
|
sealServerHooks();
|
|
79
81
|
sealCapabilities();
|
|
80
82
|
sealForges();
|
package/dist/boot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAGpE;;;GAGG;AACH,MAAM,UAAU,WAAW;IACzB,0BAA0B,EAAE,CAAC;IAC7B,sBAAsB,EAAE,CAAC;AAC3B,CAAC;AAED,oGAAoG;AACpG,MAAM,UAAU,cAAc,CAAC,IAAgB,EAAE,IAAI,GAA2B,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;IACzG,IAAI,CAAC;QACH,OAAO,IAAI,EAAE,CAAC,OAAO,CAAC;IACxB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,oCAAoC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QACjI,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAwBD,IAAI,WAAsC,CAAC;AAC3C,kHAAkH;AAClH,IAAI,kBAAgD,CAAC;AACrD,yFAAyF;AACzF,IAAI,mBAAiD,CAAC;AACtD,iGAAiG;AACjG,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAE9B;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,OAA4B;IACtD,IAAI,WAAW;QAAE,OAAO,WAAW,CAAC;IACpC,WAAW,GAAG,WAAW,CAAC,OAAO,IAAI,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B,EAAE,CAAC;IACvB,wBAAwB,EAAE,CAAC;IAC3B,MAAM,CAAC,kBAAkB,KAAK,iBAAiB,KAAK,SAAS;QAC3D,CAAC,CAAC,MAAM,CAAC,kBAAkB,EAAE;QAC7B,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,iBAAiB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACxE,MAAM,CAAC,mBAAmB,KAAK,MAAM,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC/E,IAAI,UAAU,KAAK,SAAS,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACnD,iBAAiB,GAAG,IAAI,CAAC;QACzB,MAAM,MAAM,CAAC,gBAAgB,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACrE,CAAC;IACD,MAAM,UAAU,EAAE,EAAE,CAAC;IACrB,sBAAsB,EAAE,CAAC;IACzB,cAAc,EAAE,CAAC;IACjB,cAAc,EAAE,CAAC;IACjB,eAAe,EAAE,CAAC;IAClB,gBAAgB,EAAE,CAAC;IACnB,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;IACd,mBAAmB,EAAE,CAAC;IACtB,sBAAsB,EAAE,CAAC;IACzB,oBAAoB,EAAE,CAAC;IACvB,gBAAgB,EAAE,CAAC;IACnB,oBAAoB,EAAE,CAAC;IACvB,yBAAyB,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -121,9 +121,12 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
|
|
|
121
121
|
} & {
|
|
122
122
|
"/api/v1/tools/:name": {
|
|
123
123
|
$post: {
|
|
124
|
-
output:
|
|
124
|
+
output: {
|
|
125
|
+
code: string;
|
|
126
|
+
message: string;
|
|
127
|
+
};
|
|
125
128
|
outputFormat: "json";
|
|
126
|
-
status:
|
|
129
|
+
status: 401;
|
|
127
130
|
input: {
|
|
128
131
|
json: unknown;
|
|
129
132
|
} & {
|
|
@@ -146,12 +149,9 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
|
|
|
146
149
|
};
|
|
147
150
|
};
|
|
148
151
|
} | {
|
|
149
|
-
output:
|
|
150
|
-
code: string;
|
|
151
|
-
message: string;
|
|
152
|
-
};
|
|
152
|
+
output: never;
|
|
153
153
|
outputFormat: "json";
|
|
154
|
-
status:
|
|
154
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
155
155
|
input: {
|
|
156
156
|
json: unknown;
|
|
157
157
|
} & {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ServerPluginContext, ServerProjectHandle } from './server-hook-registry.ts';
|
|
2
|
+
/** Demand-driven publisher for one concrete topic name (structurally matches `server/ws.ts` `TopicPublisher`). */
|
|
3
|
+
export interface LiveTopicPublisher {
|
|
4
|
+
snapshot(): Promise<unknown>;
|
|
5
|
+
start(publish: (data: unknown) => void): () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const LIVE_TOPIC_SCOPES: readonly ['project'];
|
|
8
|
+
export type LiveTopicScope = typeof LIVE_TOPIC_SCOPES[number];
|
|
9
|
+
/** Core topic prefixes reserved by `server/ws.ts`, `server/activity-topic.ts`, `server/home-recovery-routes.ts` and `server/server.ts`. */
|
|
10
|
+
export declare const RESERVED_LIVE_TOPIC_IDS: ReadonlySet<string>;
|
|
11
|
+
export interface LiveTopicDefinition {
|
|
12
|
+
/** Lowercase slug; project-scoped topics mount as `<id>:project:<project id>`. */
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly scope: LiveTopicScope;
|
|
15
|
+
/** Whether an untrusted loopback connection may subscribe. Defaults to `false`. */
|
|
16
|
+
readonly loopbackReadable?: boolean | undefined;
|
|
17
|
+
publisher(project: ServerProjectHandle, context: ServerPluginContext): LiveTopicPublisher | undefined | Promise<LiveTopicPublisher | undefined>;
|
|
18
|
+
}
|
|
19
|
+
export declare const MAX_LIVE_TOPIC_ID_LENGTH = 55;
|
|
20
|
+
/** Throws what `registerLiveTopic` would throw, without writing. */
|
|
21
|
+
export declare function checkLiveTopicRegistration(topic: LiveTopicDefinition): void;
|
|
22
|
+
export declare function registerLiveTopic(topic: LiveTopicDefinition): void;
|
|
23
|
+
export declare function sealLiveTopics(): void;
|
|
24
|
+
/** Whether the registry is sealed. Never throws. */
|
|
25
|
+
export declare function liveTopicsSealed(): boolean;
|
|
26
|
+
/** Registered live topics in registration order. Throws until sealed. */
|
|
27
|
+
export declare function registeredLiveTopics(): LiveTopicDefinition[];
|
|
28
|
+
/** Look up one registered live topic by id. Throws until sealed. */
|
|
29
|
+
export declare function liveTopic(id: string): LiveTopicDefinition | undefined;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live WebSocket topic registry for bundled features and plugins (spec
|
|
3
|
+
* 2026-11-30-task-file-store-and-bundled-webhooks-reports, Decision 3,
|
|
4
|
+
* hearsay-tools/squawk#4568). Follows the register -> seal -> read lifecycle of
|
|
5
|
+
* `core/registry.ts`. Each registered topic is mounted as a topic family
|
|
6
|
+
* `<id>:project:<project id>` by `server/plugin-live-topics.ts`; a plugin never
|
|
7
|
+
* receives the socket hub.
|
|
8
|
+
*/
|
|
9
|
+
import { createKeyedRegistry } from './registry.js';
|
|
10
|
+
export const LIVE_TOPIC_SCOPES = ['project'];
|
|
11
|
+
/** Core topic prefixes reserved by `server/ws.ts`, `server/activity-topic.ts`, `server/home-recovery-routes.ts` and `server/server.ts`. */
|
|
12
|
+
export const RESERVED_LIVE_TOPIC_IDS = new Set([
|
|
13
|
+
'activity',
|
|
14
|
+
'health',
|
|
15
|
+
'home',
|
|
16
|
+
]);
|
|
17
|
+
const LIVE_TOPIC_ID = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
|
|
18
|
+
// Keeps `<id>:project:<projectId>` within the 128-character WebSocket topic limit (`ws.ts`)
|
|
19
|
+
// for the longest 64-character project slug (`workspace/projects.ts` `SLUG_MAX`): 55 + 9 + 64 = 128.
|
|
20
|
+
export const MAX_LIVE_TOPIC_ID_LENGTH = 55;
|
|
21
|
+
const topics = createKeyedRegistry({
|
|
22
|
+
name: 'Live topics',
|
|
23
|
+
bootHint: 'register every live topic, then call sealLiveTopics() at the runtime boot boundary (boot.ts), or import a testkit that seals it.',
|
|
24
|
+
});
|
|
25
|
+
function checkShape(topic) {
|
|
26
|
+
if (typeof topic !== 'object' || topic === null) {
|
|
27
|
+
throw new Error('Live topics: a live topic definition must be an object.');
|
|
28
|
+
}
|
|
29
|
+
if (typeof topic.id !== 'string'
|
|
30
|
+
|| topic.id.length === 0
|
|
31
|
+
|| topic.id.length > MAX_LIVE_TOPIC_ID_LENGTH
|
|
32
|
+
|| !LIVE_TOPIC_ID.test(topic.id)) {
|
|
33
|
+
throw new Error(`Live topics: invalid id ${JSON.stringify(topic.id)} (must be a lowercase slug).`);
|
|
34
|
+
}
|
|
35
|
+
if (RESERVED_LIVE_TOPIC_IDS.has(topic.id)) {
|
|
36
|
+
throw new Error(`Live topics: '${topic.id}' is reserved for core.`);
|
|
37
|
+
}
|
|
38
|
+
if (!LIVE_TOPIC_SCOPES.includes(topic.scope)) {
|
|
39
|
+
throw new Error(`Live topics: '${topic.id}' has unsupported scope ${JSON.stringify(topic.scope)}.`);
|
|
40
|
+
}
|
|
41
|
+
if (topic.loopbackReadable !== undefined && typeof topic.loopbackReadable !== 'boolean') {
|
|
42
|
+
throw new Error(`Live topics: '${topic.id}' loopbackReadable must be a boolean.`);
|
|
43
|
+
}
|
|
44
|
+
if (typeof topic.publisher !== 'function') {
|
|
45
|
+
throw new Error(`Live topics: '${topic.id}' needs a publisher function.`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/** Throws what `registerLiveTopic` would throw, without writing. */
|
|
49
|
+
export function checkLiveTopicRegistration(topic) {
|
|
50
|
+
checkShape(topic);
|
|
51
|
+
topics.check(topic.id, topic);
|
|
52
|
+
}
|
|
53
|
+
export function registerLiveTopic(topic) {
|
|
54
|
+
checkLiveTopicRegistration(topic);
|
|
55
|
+
topics.register(topic.id, topic);
|
|
56
|
+
}
|
|
57
|
+
export function sealLiveTopics() { topics.seal(); }
|
|
58
|
+
/** Whether the registry is sealed. Never throws. */
|
|
59
|
+
export function liveTopicsSealed() { return topics.isSealed(); }
|
|
60
|
+
/** Registered live topics in registration order. Throws until sealed. */
|
|
61
|
+
export function registeredLiveTopics() {
|
|
62
|
+
return topics.values();
|
|
63
|
+
}
|
|
64
|
+
/** Look up one registered live topic by id. Throws until sealed. */
|
|
65
|
+
export function liveTopic(id) {
|
|
66
|
+
return topics.get(id);
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=live-topic-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-topic-registry.js","sourceRoot":"","sources":["../../src/core/live-topic-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AASpD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,SAAS,CAAU,CAAC;AAGtD,2IAA2I;AAC3I,MAAM,CAAC,MAAM,uBAAuB,GAAwB,IAAI,GAAG,CAAC;IAClE,UAAU;IACV,QAAQ;IACR,MAAM;CACP,CAAC,CAAC;AAcH,MAAM,aAAa,GAAG,iCAAiC,CAAC;AACxD,4FAA4F;AAC5F,qGAAqG;AACrG,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAE3C,MAAM,MAAM,GAAG,mBAAmB,CAA8B;IAC9D,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE,kIAAkI;CAC7I,CAAC,CAAC;AAEH,SAAS,UAAU,CAAC,KAA0B;IAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IACD,IACE,OAAO,KA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ED,MAAM,UAAU,iBAAiB,CAAC,KAA0B;IAC1D,0BAA0B,CAAC,KAAK,CAAC,CAAC;IAClC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,cAAc,KAAW,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAEzD,oDAAoD;AACpD,MAAM,UAAU,gBAAgB,KAAc,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;AAEzE,yEAAyE;AACzE,MAAM,UAAU,oBAAoB;IAClC,OAAO,MAAM,CAAC,MAAM,EAAE,CAAC;AACzB,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,SAAS,CAAC,EAAU;IAClC,OAAO,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -63,6 +63,8 @@ export interface ServerPluginContext {
|
|
|
63
63
|
readonly home: Home;
|
|
64
64
|
/** Boot project id, or `undefined` on a server started with no boot project. */
|
|
65
65
|
readonly bootProjectId?: string | undefined;
|
|
66
|
+
/** Resolves with the bound cockpit origin once the listener binds, or immediately with `''` when built without a listener. */
|
|
67
|
+
readonly cockpitOrigin: Promise<string>;
|
|
66
68
|
readonly capabilities: () => Readonly<Record<string, boolean | undefined>>;
|
|
67
69
|
readonly modelCatalog: RunnerModelCatalog;
|
|
68
70
|
readonly providerStatus: (options?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-hook-registry.js","sourceRoot":"","sources":["../../src/core/server-hook-registry.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAUpD,MAAM,UAAU,wBAAwB,CAAC,OAA2C;IAClF,MAAM,KAAK,GAAG,IAAI,GAAG,CAAkB,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC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CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,eAAe,KAAW,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAEzD,oDAAoD;AACpD,MAAM,UAAU,iBAAiB,KAAc,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;AAEzE,0EAA0E;AAC1E,MAAM,UAAU,qBAAqB;IACnC,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;AACxB,CAAC"}
|
|
@@ -2,6 +2,18 @@ import type { DelegationRoutes } from './routes.ts';
|
|
|
2
2
|
export declare function createDelegationApp(routes: DelegationRoutes): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<{
|
|
3
3
|
"/list": {
|
|
4
4
|
$get: {
|
|
5
|
+
output: {
|
|
6
|
+
error: string;
|
|
7
|
+
code?: "invalid_input" | undefined;
|
|
8
|
+
};
|
|
9
|
+
outputFormat: "json";
|
|
10
|
+
status: 400;
|
|
11
|
+
input: {
|
|
12
|
+
query: {
|
|
13
|
+
offset?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
} | {
|
|
5
17
|
output: {
|
|
6
18
|
workers: {
|
|
7
19
|
workerId: string;
|
|
@@ -54,18 +66,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
54
66
|
offset?: string | undefined;
|
|
55
67
|
};
|
|
56
68
|
};
|
|
57
|
-
} | {
|
|
58
|
-
output: {
|
|
59
|
-
error: string;
|
|
60
|
-
code?: "invalid_input" | undefined;
|
|
61
|
-
};
|
|
62
|
-
outputFormat: "json";
|
|
63
|
-
status: 400;
|
|
64
|
-
input: {
|
|
65
|
-
query: {
|
|
66
|
-
offset?: string | undefined;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
71
|
} & {
|
|
@@ -652,6 +652,18 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
652
652
|
} & {
|
|
653
653
|
"/:workerId": {
|
|
654
654
|
$get: {
|
|
655
|
+
output: {
|
|
656
|
+
error: string;
|
|
657
|
+
code?: "invalid_input" | undefined;
|
|
658
|
+
};
|
|
659
|
+
outputFormat: "json";
|
|
660
|
+
status: 400;
|
|
661
|
+
input: {
|
|
662
|
+
param: {
|
|
663
|
+
workerId: string;
|
|
664
|
+
};
|
|
665
|
+
};
|
|
666
|
+
} | {
|
|
655
667
|
output: {
|
|
656
668
|
workerId: string;
|
|
657
669
|
settled: boolean;
|
|
@@ -776,7 +788,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
776
788
|
workerId: string;
|
|
777
789
|
};
|
|
778
790
|
};
|
|
779
|
-
}
|
|
791
|
+
};
|
|
792
|
+
};
|
|
793
|
+
} & {
|
|
794
|
+
"/:workerId/collect": {
|
|
795
|
+
$post: {
|
|
780
796
|
output: {
|
|
781
797
|
error: string;
|
|
782
798
|
code?: "invalid_input" | undefined;
|
|
@@ -787,12 +803,10 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
787
803
|
param: {
|
|
788
804
|
workerId: string;
|
|
789
805
|
};
|
|
806
|
+
} & {
|
|
807
|
+
json: Record<string, never>;
|
|
790
808
|
};
|
|
791
|
-
}
|
|
792
|
-
};
|
|
793
|
-
} & {
|
|
794
|
-
"/:workerId/collect": {
|
|
795
|
-
$post: {
|
|
809
|
+
} | {
|
|
796
810
|
output: {
|
|
797
811
|
workerId: string;
|
|
798
812
|
parentRunId: string;
|
|
@@ -917,7 +931,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
917
931
|
} & {
|
|
918
932
|
json: Record<string, never>;
|
|
919
933
|
};
|
|
920
|
-
}
|
|
934
|
+
};
|
|
935
|
+
};
|
|
936
|
+
} & {
|
|
937
|
+
"/:workerId/steer": {
|
|
938
|
+
$post: {
|
|
921
939
|
output: {
|
|
922
940
|
error: string;
|
|
923
941
|
code?: "invalid_input" | undefined;
|
|
@@ -929,13 +947,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
929
947
|
workerId: string;
|
|
930
948
|
};
|
|
931
949
|
} & {
|
|
932
|
-
json:
|
|
950
|
+
json: {
|
|
951
|
+
text: string;
|
|
952
|
+
};
|
|
933
953
|
};
|
|
934
|
-
}
|
|
935
|
-
};
|
|
936
|
-
} & {
|
|
937
|
-
"/:workerId/steer": {
|
|
938
|
-
$post: {
|
|
954
|
+
} | {
|
|
939
955
|
output: {
|
|
940
956
|
workerId: string;
|
|
941
957
|
state: "delivered" | "queued";
|
|
@@ -951,7 +967,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
951
967
|
text: string;
|
|
952
968
|
};
|
|
953
969
|
};
|
|
954
|
-
}
|
|
970
|
+
};
|
|
971
|
+
};
|
|
972
|
+
} & {
|
|
973
|
+
"/:workerId/stop": {
|
|
974
|
+
$post: {
|
|
955
975
|
output: {
|
|
956
976
|
error: string;
|
|
957
977
|
code?: "invalid_input" | undefined;
|
|
@@ -963,15 +983,9 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
963
983
|
workerId: string;
|
|
964
984
|
};
|
|
965
985
|
} & {
|
|
966
|
-
json:
|
|
967
|
-
text: string;
|
|
968
|
-
};
|
|
986
|
+
json: Record<string, never>;
|
|
969
987
|
};
|
|
970
|
-
}
|
|
971
|
-
};
|
|
972
|
-
} & {
|
|
973
|
-
"/:workerId/stop": {
|
|
974
|
-
$post: {
|
|
988
|
+
} | {
|
|
975
989
|
output: {
|
|
976
990
|
workerId: string;
|
|
977
991
|
state: "stopping" | "terminated";
|
|
@@ -985,7 +999,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
985
999
|
} & {
|
|
986
1000
|
json: Record<string, never>;
|
|
987
1001
|
};
|
|
988
|
-
}
|
|
1002
|
+
};
|
|
1003
|
+
};
|
|
1004
|
+
} & {
|
|
1005
|
+
"/:workerId/destroy": {
|
|
1006
|
+
$post: {
|
|
989
1007
|
output: {
|
|
990
1008
|
error: string;
|
|
991
1009
|
code?: "invalid_input" | undefined;
|
|
@@ -997,13 +1015,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
997
1015
|
workerId: string;
|
|
998
1016
|
};
|
|
999
1017
|
} & {
|
|
1000
|
-
json:
|
|
1018
|
+
json: {
|
|
1019
|
+
discardWork?: true | undefined;
|
|
1020
|
+
};
|
|
1001
1021
|
};
|
|
1002
|
-
}
|
|
1003
|
-
};
|
|
1004
|
-
} & {
|
|
1005
|
-
"/:workerId/destroy": {
|
|
1006
|
-
$post: {
|
|
1022
|
+
} | {
|
|
1007
1023
|
output: {
|
|
1008
1024
|
workerId: string;
|
|
1009
1025
|
state: "complete" | "incomplete";
|
|
@@ -1032,22 +1048,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
1032
1048
|
discardWork?: true | undefined;
|
|
1033
1049
|
};
|
|
1034
1050
|
};
|
|
1035
|
-
} | {
|
|
1036
|
-
output: {
|
|
1037
|
-
error: string;
|
|
1038
|
-
code?: "invalid_input" | undefined;
|
|
1039
|
-
};
|
|
1040
|
-
outputFormat: "json";
|
|
1041
|
-
status: 400;
|
|
1042
|
-
input: {
|
|
1043
|
-
param: {
|
|
1044
|
-
workerId: string;
|
|
1045
|
-
};
|
|
1046
|
-
} & {
|
|
1047
|
-
json: {
|
|
1048
|
-
discardWork?: true | undefined;
|
|
1049
|
-
};
|
|
1050
|
-
};
|
|
1051
1051
|
} | {
|
|
1052
1052
|
output: {
|
|
1053
1053
|
workerId: string;
|
|
@@ -1083,18 +1083,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
1083
1083
|
"/:workerId/summary": {
|
|
1084
1084
|
$post: {
|
|
1085
1085
|
output: {
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
source: "assistant" | "failure";
|
|
1089
|
-
seq: number;
|
|
1090
|
-
totalLines: number;
|
|
1091
|
-
offset: number;
|
|
1092
|
-
lineCount: number;
|
|
1093
|
-
text: string;
|
|
1094
|
-
nextOffset?: number | undefined;
|
|
1086
|
+
error: string;
|
|
1087
|
+
code?: "invalid_input" | undefined;
|
|
1095
1088
|
};
|
|
1096
1089
|
outputFormat: "json";
|
|
1097
|
-
status:
|
|
1090
|
+
status: 400;
|
|
1098
1091
|
input: {
|
|
1099
1092
|
param: {
|
|
1100
1093
|
workerId: string;
|
|
@@ -1107,11 +1100,18 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
1107
1100
|
};
|
|
1108
1101
|
} | {
|
|
1109
1102
|
output: {
|
|
1110
|
-
|
|
1111
|
-
|
|
1103
|
+
workerId: string;
|
|
1104
|
+
revision: number;
|
|
1105
|
+
source: "assistant" | "failure";
|
|
1106
|
+
seq: number;
|
|
1107
|
+
totalLines: number;
|
|
1108
|
+
offset: number;
|
|
1109
|
+
lineCount: number;
|
|
1110
|
+
text: string;
|
|
1111
|
+
nextOffset?: number | undefined;
|
|
1112
1112
|
};
|
|
1113
1113
|
outputFormat: "json";
|
|
1114
|
-
status:
|
|
1114
|
+
status: 200;
|
|
1115
1115
|
input: {
|
|
1116
1116
|
param: {
|
|
1117
1117
|
workerId: string;
|
|
@@ -1128,13 +1128,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
1128
1128
|
"/:workerId/diff": {
|
|
1129
1129
|
$get: {
|
|
1130
1130
|
output: {
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
diff: string;
|
|
1134
|
-
truncated: boolean;
|
|
1131
|
+
error: string;
|
|
1132
|
+
code?: "invalid_input" | undefined;
|
|
1135
1133
|
};
|
|
1136
1134
|
outputFormat: "json";
|
|
1137
|
-
status:
|
|
1135
|
+
status: 400;
|
|
1138
1136
|
input: {
|
|
1139
1137
|
param: {
|
|
1140
1138
|
workerId: string;
|
|
@@ -1142,11 +1140,13 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
1142
1140
|
};
|
|
1143
1141
|
} | {
|
|
1144
1142
|
output: {
|
|
1145
|
-
|
|
1146
|
-
|
|
1143
|
+
workerId: string;
|
|
1144
|
+
baselineSha: string;
|
|
1145
|
+
diff: string;
|
|
1146
|
+
truncated: boolean;
|
|
1147
1147
|
};
|
|
1148
1148
|
outputFormat: "json";
|
|
1149
|
-
status:
|
|
1149
|
+
status: 200;
|
|
1150
1150
|
input: {
|
|
1151
1151
|
param: {
|
|
1152
1152
|
workerId: string;
|
|
@@ -7,6 +7,10 @@ export declare function invokeScheduleTaskTool(input: unknown): Promise<{
|
|
|
7
7
|
}[];
|
|
8
8
|
isError: boolean;
|
|
9
9
|
details: {
|
|
10
|
+
ok: false;
|
|
11
|
+
code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
|
|
12
|
+
message: string;
|
|
13
|
+
} | {
|
|
10
14
|
ok: true;
|
|
11
15
|
task: {
|
|
12
16
|
id: string;
|
|
@@ -19,10 +23,6 @@ export declare function invokeScheduleTaskTool(input: unknown): Promise<{
|
|
|
19
23
|
url?: string | undefined;
|
|
20
24
|
};
|
|
21
25
|
note: string;
|
|
22
|
-
} | {
|
|
23
|
-
ok: false;
|
|
24
|
-
code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
|
|
25
|
-
message: string;
|
|
26
26
|
};
|
|
27
27
|
}>;
|
|
28
28
|
export declare function formatScheduleTaskTool(answer: Awaited<ReturnType<typeof callScheduleTask>>): {
|
|
@@ -32,6 +32,10 @@ export declare function formatScheduleTaskTool(answer: Awaited<ReturnType<typeof
|
|
|
32
32
|
}[];
|
|
33
33
|
isError: boolean;
|
|
34
34
|
details: {
|
|
35
|
+
ok: false;
|
|
36
|
+
code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
|
|
37
|
+
message: string;
|
|
38
|
+
} | {
|
|
35
39
|
ok: true;
|
|
36
40
|
task: {
|
|
37
41
|
id: string;
|
|
@@ -44,10 +48,6 @@ export declare function formatScheduleTaskTool(answer: Awaited<ReturnType<typeof
|
|
|
44
48
|
url?: string | undefined;
|
|
45
49
|
};
|
|
46
50
|
note: string;
|
|
47
|
-
} | {
|
|
48
|
-
ok: false;
|
|
49
|
-
code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
|
|
50
|
-
message: string;
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
53
|
export declare function invokeScheduledTasksTool(input: unknown): Promise<{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability.js","sourceRoot":"","sources":["../../../src/features/reports/capability.ts"],"names":[],"mappings":"AAEA,6GAA6G;AAC7G,MAAM,CAAC,MAAM,iBAAiB,GAAyB;IACrD,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI;CACrB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bundled reports feature (spec 2026-11-30-task-file-store-and-bundled-webhooks-reports,
|
|
3
|
+
* Decision 4, hearsay-tools/squawk#4568): registers its project HTTP route bundle (`GET /reports`,
|
|
4
|
+
* `GET /reports/state`), `reports:project:<id>` live topic, server lifecycle hook, and `reports`
|
|
5
|
+
* capability solely through `SquawkPluginApi`. Nothing outside this folder imports it.
|
|
6
|
+
*/
|
|
7
|
+
import type { SquawkPluginApi } from '../../plugin/index.ts';
|
|
8
|
+
import { reportsCapability } from './capability.ts';
|
|
9
|
+
import { reportsLiveTopic } from './live-topic.ts';
|
|
10
|
+
import { reportsHttpRoute } from './routes.ts';
|
|
11
|
+
import { reportsServerHook } from './server-hook.ts';
|
|
12
|
+
export { reportsCapability, reportsHttpRoute, reportsLiveTopic, reportsServerHook, };
|
|
13
|
+
export default function setup(api: SquawkPluginApi): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { reportsCapability } from './capability.js';
|
|
2
|
+
import { reportsLiveTopic } from './live-topic.js';
|
|
3
|
+
import { reportsHttpRoute } from './routes.js';
|
|
4
|
+
import { reportsServerHook } from './server-hook.js';
|
|
5
|
+
export { reportsCapability, reportsHttpRoute, reportsLiveTopic, reportsServerHook, };
|
|
6
|
+
export default function setup(api) {
|
|
7
|
+
api.registerHttpRoute(reportsHttpRoute);
|
|
8
|
+
api.registerLiveTopic(reportsLiveTopic);
|
|
9
|
+
api.registerServerHook(reportsServerHook);
|
|
10
|
+
api.registerCapability(reportsCapability);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/reports/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,GAClB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,GAAoB;IAChD,GAAG,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IACxC,GAAG,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IACxC,GAAG,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;IAC1C,GAAG,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LiveTopicDefinition, LiveTopicPublisher } from '../../plugin/index.ts';
|
|
2
|
+
import { type ReportsIndex } from './reports-index.ts';
|
|
3
|
+
export declare function reportsPublisher(index: ReportsIndex): LiveTopicPublisher;
|
|
4
|
+
/** Project-scoped live topic `reports:project:<project id>`. */
|
|
5
|
+
export declare const reportsLiveTopic: LiveTopicDefinition;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reportsIndex } from '
|
|
1
|
+
import { reportsIndex } from './reports-index.js';
|
|
2
2
|
export function reportsPublisher(index) {
|
|
3
3
|
return {
|
|
4
4
|
snapshot: async () => ({ type: 'snapshot', ...index.state() }),
|
|
@@ -27,12 +27,15 @@ export function reportsPublisher(index) {
|
|
|
27
27
|
},
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
/** Project-scoped live topic `reports:project:<project id>`. */
|
|
31
|
+
export const reportsLiveTopic = {
|
|
32
|
+
id: 'reports',
|
|
33
|
+
scope: 'project',
|
|
34
|
+
loopbackReadable: false,
|
|
35
|
+
publisher(project) {
|
|
33
36
|
if (project.store.unavailable)
|
|
34
37
|
return undefined;
|
|
35
38
|
return reportsPublisher(reportsIndex(project.store));
|
|
36
|
-
},
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=live-topic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-topic.js","sourceRoot":"","sources":["../../../src/features/reports/live-topic.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAqB,MAAM,oBAAoB,CAAC;AAErE,MAAM,UAAU,gBAAgB,CAAC,KAAmB;IAClD,OAAO;QACL,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;QAC9D,KAAK,CAAC,OAAO;YACX,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;YAC9B,IAAI,KAAgD,CAAC;YACrD,IAAI,OAAO,GAAG,KAAK,CAAC;YACpB,MAAM,IAAI,GAA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AAC,WAAW;YAAE,OAAO,SAAS,CAAC;QAChD,OAAO,gBAAgB,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IACvD,CAAC;CACF,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ReportsWatch } from './reports-watch.ts';
|
|
2
|
-
import type { ReportsQuery, ReportsResponse } from '
|
|
3
|
-
import type { RunDatabase } from '
|
|
4
|
-
import type { RunLifecycleSource } from '
|
|
5
|
-
import type { RunAccess, RunLookup, RunPersistence } from '
|
|
6
|
-
export { REPORTS_BACKFILL_KEY } from '
|
|
2
|
+
import type { ReportsQuery, ReportsResponse } from '../../contract/index.js';
|
|
3
|
+
import type { RunDatabase } from '../../runs/run-database.ts';
|
|
4
|
+
import type { RunLifecycleSource } from '../../runs/lifecycle.ts';
|
|
5
|
+
import type { RunAccess, RunLookup, RunPersistence } from '../../runs/ports.ts';
|
|
6
|
+
export { REPORTS_BACKFILL_KEY } from '../../runs/report-rows.ts';
|
|
7
7
|
/** What the index reads from a run store: its database, a run's record and files, the write-out
|
|
8
8
|
* before a read, and the lifecycle whose run changes drive the report watch. */
|
|
9
9
|
export interface ReportsStore extends RunLookup {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ReportsWatch, reportMetadataKey } from './reports-watch.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { matchesRunSearch } from '
|
|
4
|
-
import { reportTitle } from '
|
|
5
|
-
import { isLiveStatus } from '
|
|
6
|
-
import { REPORTS_BACKFILL_KEY } from '
|
|
7
|
-
import { parseStoredSummary } from '
|
|
8
|
-
import { artifactDirectoryInRunsRoot, artifactRunsRoot, scanArtifactsForIndex, checkArtifactContentForIndex } from '
|
|
9
|
-
export { REPORTS_BACKFILL_KEY } from '
|
|
3
|
+
import { matchesRunSearch } from '../../contract/index.js';
|
|
4
|
+
import { reportTitle } from '../../contract/index.js';
|
|
5
|
+
import { isLiveStatus } from '../../contract/index.js';
|
|
6
|
+
import { REPORTS_BACKFILL_KEY } from '../../runs/report-rows.js';
|
|
7
|
+
import { parseStoredSummary } from '../../runs/run-summary-page.js';
|
|
8
|
+
import { artifactDirectoryInRunsRoot, artifactRunsRoot, scanArtifactsForIndex, checkArtifactContentForIndex } from '../../task-files/artifact-kind.js';
|
|
9
|
+
export { REPORTS_BACKFILL_KEY } from '../../runs/report-rows.js';
|
|
10
10
|
const cursorSchema = z.tuple([z.iso.datetime(), z.uuid()]);
|
|
11
11
|
const instances = new WeakMap();
|
|
12
12
|
export function reportsIndex(store) {
|