@hearsay-tools/squawk 0.19.0-dev.8776 → 0.19.0-dev.8778
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/built-in-http-routes.d.ts +10 -0
- package/dist/built-in-http-routes.js +41 -0
- package/dist/built-in-http-routes.js.map +1 -0
- package/dist/contract/automation-requests.d.ts +4 -0
- package/dist/core/http-route-registry.d.ts +28 -5
- package/dist/core/http-route-registry.js +37 -9
- package/dist/core/http-route-registry.js.map +1 -1
- package/dist/delegation/routes.d.ts +65 -65
- package/dist/plugin/api.js +3 -1
- package/dist/plugin/api.js.map +1 -1
- package/dist/plugin/index.d.ts +1 -1
- package/dist/plugin/index.js.map +1 -1
- package/dist/server/automations-routes.d.ts +150 -150
- package/dist/server/live-routes.d.ts +6 -6
- package/dist/server/plugin-http-routes.d.ts +29 -4
- package/dist/server/plugin-http-routes.js +100 -13
- package/dist/server/plugin-http-routes.js.map +1 -1
- package/dist/server/project-settings-routes.d.ts +107 -107
- package/dist/server/providers-routes.d.ts +7 -7
- package/dist/server/runners-routes.d.ts +10 -10
- package/dist/server/server.d.ts +3248 -6048
- package/dist/server/server.js +39 -59
- package/dist/server/server.js.map +1 -1
- package/dist/server/ws.d.ts +6 -0
- package/dist/server/ws.js +41 -0
- package/dist/server/ws.js.map +1 -1
- package/package.json +4 -4
package/dist/boot.js
CHANGED
|
@@ -49,6 +49,7 @@ async function sealRuntime({ pluginsDir, bundledRunnersDir, bundledFeaturesDir,
|
|
|
49
49
|
registerBuiltInCliCommands();
|
|
50
50
|
const { registerBuiltInRunSlots, sealBuiltInRunSlots } = await import('./built-in-run-slots.js');
|
|
51
51
|
const { registerBuiltInLaunchParts, sealBuiltInLaunchParts } = await import('./built-in-launch-parts.js');
|
|
52
|
+
const { registerBuiltInHttpRoutes } = await import('./built-in-http-routes.js');
|
|
52
53
|
const { registerBuiltInStepKinds, sealBuiltInStepKinds } = await import('./workflows/step-kind-registry.js');
|
|
53
54
|
const { registerBuiltInTools, sealBuiltInTools } = await import('./built-in-tools.js');
|
|
54
55
|
const { registerBuiltInWaitKinds, sealBuiltInWaitKinds } = await import('./built-in-wait-kinds.js');
|
|
@@ -58,6 +59,7 @@ async function sealRuntime({ pluginsDir, bundledRunnersDir, bundledFeaturesDir,
|
|
|
58
59
|
const loader = await import('./plugin/loader.js');
|
|
59
60
|
registerBuiltInRunSlots();
|
|
60
61
|
registerBuiltInLaunchParts();
|
|
62
|
+
registerBuiltInHttpRoutes();
|
|
61
63
|
registerBuiltInStepKinds();
|
|
62
64
|
registerBuiltInTools();
|
|
63
65
|
registerBuiltInWaitKinds();
|
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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C,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,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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Temporary built-in HTTP route bundle registrations for automations (hearsay-tools/squawk#4441).
|
|
3
|
+
* Moves into `features/automations/index.ts` and is deleted in `hearsay-tools/squawk#4444`.
|
|
4
|
+
*/
|
|
5
|
+
import { type HttpBundleRouteDefinition, type HttpRouteDefinition } from './core/http-route-registry.ts';
|
|
6
|
+
export declare const automationsHttpRoute: HttpBundleRouteDefinition;
|
|
7
|
+
export declare const automationChecksHttpRoute: HttpBundleRouteDefinition;
|
|
8
|
+
export declare const BUILT_IN_HTTP_ROUTES: readonly HttpRouteDefinition[];
|
|
9
|
+
/** Register the temporary built-in HTTP routes. Idempotent for the same objects. */
|
|
10
|
+
export declare function registerBuiltInHttpRoutes(): void;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Temporary built-in HTTP route bundle registrations for automations (hearsay-tools/squawk#4441).
|
|
3
|
+
* Moves into `features/automations/index.ts` and is deleted in `hearsay-tools/squawk#4444`.
|
|
4
|
+
*/
|
|
5
|
+
import { registerHttpRoute, } from './core/http-route-registry.js';
|
|
6
|
+
import { createAutomationsRouteBundles } from './server/automations-routes.js';
|
|
7
|
+
const bundlesByBridge = new WeakMap();
|
|
8
|
+
function automationsBundles(context) {
|
|
9
|
+
const bridge = context.appBridge;
|
|
10
|
+
if (!bridge || typeof bridge !== 'object') {
|
|
11
|
+
throw new Error('HTTP routes: automations bundle requires server app context.');
|
|
12
|
+
}
|
|
13
|
+
let created = bundlesByBridge.get(bridge);
|
|
14
|
+
if (!created) {
|
|
15
|
+
created = createAutomationsRouteBundles(bridge);
|
|
16
|
+
bundlesByBridge.set(bridge, created);
|
|
17
|
+
}
|
|
18
|
+
return created;
|
|
19
|
+
}
|
|
20
|
+
export const automationsHttpRoute = {
|
|
21
|
+
kind: 'bundle',
|
|
22
|
+
id: 'automations',
|
|
23
|
+
scope: 'project',
|
|
24
|
+
createRoutes: (context) => automationsBundles(context).automationsRoutes,
|
|
25
|
+
};
|
|
26
|
+
export const automationChecksHttpRoute = {
|
|
27
|
+
kind: 'bundle',
|
|
28
|
+
id: 'automation-checks',
|
|
29
|
+
scope: 'workspace',
|
|
30
|
+
createRoutes: (context) => automationsBundles(context).automationChecksRoutes,
|
|
31
|
+
};
|
|
32
|
+
export const BUILT_IN_HTTP_ROUTES = [
|
|
33
|
+
automationsHttpRoute,
|
|
34
|
+
automationChecksHttpRoute,
|
|
35
|
+
];
|
|
36
|
+
/** Register the temporary built-in HTTP routes. Idempotent for the same objects. */
|
|
37
|
+
export function registerBuiltInHttpRoutes() {
|
|
38
|
+
for (const route of BUILT_IN_HTTP_ROUTES)
|
|
39
|
+
registerHttpRoute(route);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=built-in-http-routes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"built-in-http-routes.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,UAAU,yBAAyB;IACvC,KAAK,MAAM,KAAK,IAAI,oBAAoB;QAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -164,6 +164,7 @@ export declare const automationCreateSchema: z.ZodObject<{
|
|
|
164
164
|
}, z.core.$strict>;
|
|
165
165
|
enable: z.ZodOptional<z.ZodBoolean>;
|
|
166
166
|
}, z.core.$strict>;
|
|
167
|
+
export type AutomationCreateRequest = z.input<typeof automationCreateSchema>;
|
|
167
168
|
export declare const automationUpdateSchema: z.ZodObject<{
|
|
168
169
|
name: z.ZodString;
|
|
169
170
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -244,12 +245,14 @@ export declare const automationUpdateSchema: z.ZodObject<{
|
|
|
244
245
|
}, z.core.$strict>;
|
|
245
246
|
expectedRevision: z.ZodNumber;
|
|
246
247
|
}, z.core.$strict>;
|
|
248
|
+
export type AutomationUpdateRequest = z.input<typeof automationUpdateSchema>;
|
|
247
249
|
export declare const automationCheckRequestSchema: z.ZodObject<{
|
|
248
250
|
mode: z.ZodEnum<{
|
|
249
251
|
execute: "execute";
|
|
250
252
|
preview: "preview";
|
|
251
253
|
}>;
|
|
252
254
|
}, z.core.$strict>;
|
|
255
|
+
export type AutomationCheckRequest = z.input<typeof automationCheckRequestSchema>;
|
|
253
256
|
export declare const automationLogQuerySchema: z.ZodObject<{
|
|
254
257
|
automationId: z.ZodOptional<z.ZodString>;
|
|
255
258
|
result: z.ZodOptional<z.ZodEnum<{
|
|
@@ -276,3 +279,4 @@ export declare const automationLogQuerySchema: z.ZodObject<{
|
|
|
276
279
|
cursor: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
277
280
|
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
278
281
|
}, z.core.$strip>;
|
|
282
|
+
export type AutomationLogQuery = z.output<typeof automationLogQuerySchema>;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Follows the register → seal → read lifecycle of `core/registry.ts`.
|
|
4
|
-
* outside `AppType` RPC inference, behind the global `/api/*`
|
|
5
|
-
* SPA catch-all.
|
|
2
|
+
* Plugin HTTP route registry for bundled features and plugins (hearsay-tools/squawk#4402,
|
|
3
|
+
* hearsay-tools/squawk#4441). Follows the register → seal → read lifecycle of `core/registry.ts`.
|
|
4
|
+
* Routes mounted here sit outside `AppType` RPC inference, behind the global `/api/*`
|
|
5
|
+
* request-origin guard and before the SPA catch-all.
|
|
6
6
|
*/
|
|
7
|
+
import type { Hono } from 'hono';
|
|
7
8
|
import type { Home } from '../home/home.ts';
|
|
8
9
|
export declare const HTTP_ROUTE_METHODS: readonly ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'ALL'];
|
|
9
10
|
export type HttpRouteMethod = typeof HTTP_ROUTE_METHODS[number];
|
|
11
|
+
export declare const HTTP_ROUTE_SCOPES: readonly ['project', 'workspace'];
|
|
12
|
+
export type HttpRouteScope = typeof HTTP_ROUTE_SCOPES[number];
|
|
10
13
|
export interface HttpRouteContext {
|
|
11
14
|
readonly home: Home;
|
|
12
15
|
readonly version: string;
|
|
@@ -15,7 +18,15 @@ export interface HttpRouteContext {
|
|
|
15
18
|
/** Invoke the cockpit HTTP app in-process (synthetic loopback Host, no Origin). */
|
|
16
19
|
fetchApp(request: Request): Promise<Response>;
|
|
17
20
|
}
|
|
18
|
-
export interface
|
|
21
|
+
export interface HttpRouteBundleContext extends HttpRouteContext {
|
|
22
|
+
/**
|
|
23
|
+
* Opaque per-app bridge for server-scoped route bundles until server lifecycle hooks
|
|
24
|
+
* (`hearsay-tools/squawk#4442`) replace it with `ServerPluginContext`.
|
|
25
|
+
*/
|
|
26
|
+
readonly appBridge?: unknown;
|
|
27
|
+
}
|
|
28
|
+
export interface HttpHandlerRouteDefinition {
|
|
29
|
+
readonly kind?: 'handler' | undefined;
|
|
19
30
|
readonly id: string;
|
|
20
31
|
readonly method: HttpRouteMethod;
|
|
21
32
|
/** Must start with `/api/v1/`. */
|
|
@@ -27,6 +38,18 @@ export interface HttpRouteDefinition {
|
|
|
27
38
|
readonly managesBodyLimit?: boolean | undefined;
|
|
28
39
|
handle(request: Request, context: HttpRouteContext): Response | Promise<Response>;
|
|
29
40
|
}
|
|
41
|
+
export interface HttpBundleRouteDefinition {
|
|
42
|
+
readonly kind: 'bundle';
|
|
43
|
+
readonly id: string;
|
|
44
|
+
readonly scope: HttpRouteScope;
|
|
45
|
+
/**
|
|
46
|
+
* Build the Hono sub-app mounted under `/api/v1/p/:projectId` and `/api/v1` (when `scope` is
|
|
47
|
+
* `'project'`) or under `/api/v1` only (when `scope` is `'workspace'`).
|
|
48
|
+
*/
|
|
49
|
+
createRoutes(context: HttpRouteBundleContext): Hono<any, any, any>;
|
|
50
|
+
}
|
|
51
|
+
export type HttpRouteDefinition = HttpHandlerRouteDefinition | HttpBundleRouteDefinition;
|
|
52
|
+
export declare function isHttpBundleRoute(route: HttpRouteDefinition): route is HttpBundleRouteDefinition;
|
|
30
53
|
/** Throws what `registerHttpRoute` would throw, without writing. */
|
|
31
54
|
export declare function checkHttpRouteRegistration(route: HttpRouteDefinition): void;
|
|
32
55
|
export declare function registerHttpRoute(route: HttpRouteDefinition): void;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { createKeyedRegistry } from './registry.js';
|
|
2
2
|
export const HTTP_ROUTE_METHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'ALL'];
|
|
3
|
+
export const HTTP_ROUTE_SCOPES = ['project', 'workspace'];
|
|
4
|
+
export function isHttpBundleRoute(route) {
|
|
5
|
+
return route.kind === 'bundle';
|
|
6
|
+
}
|
|
3
7
|
const API_V1_PREFIX = '/api/v1/';
|
|
4
8
|
const routes = createKeyedRegistry({
|
|
5
9
|
name: 'HTTP routes',
|
|
6
10
|
bootHint: 'register every HTTP route, then call sealHttpRoutes() at the runtime boot boundary (boot.ts), or import a testkit that seals it.',
|
|
7
11
|
});
|
|
8
12
|
const claimedPaths = new Map();
|
|
9
|
-
function
|
|
10
|
-
if (typeof route !== 'object' || route === null)
|
|
11
|
-
throw new Error('HTTP routes: a route definition must be an object.');
|
|
12
|
-
if (typeof route.id !== 'string' || route.id.length === 0)
|
|
13
|
-
throw new Error(`HTTP routes: invalid id ${JSON.stringify(route.id)}.`);
|
|
13
|
+
function checkHandlerShape(route) {
|
|
14
14
|
if (!HTTP_ROUTE_METHODS.includes(route.method)) {
|
|
15
15
|
throw new Error(`HTTP routes: '${route.id}' has unsupported method ${JSON.stringify(route.method)}.`);
|
|
16
16
|
}
|
|
@@ -23,19 +23,47 @@ function checkShape(route) {
|
|
|
23
23
|
if (typeof route.handle !== 'function')
|
|
24
24
|
throw new Error(`HTTP routes: '${route.id}' needs a handle function.`);
|
|
25
25
|
}
|
|
26
|
+
function checkBundleShape(route) {
|
|
27
|
+
if (!HTTP_ROUTE_SCOPES.includes(route.scope)) {
|
|
28
|
+
throw new Error(`HTTP routes: '${route.id}' has unsupported scope ${JSON.stringify(route.scope)}.`);
|
|
29
|
+
}
|
|
30
|
+
if (typeof route.createRoutes !== 'function') {
|
|
31
|
+
throw new Error(`HTTP routes: '${route.id}' needs a createRoutes function.`);
|
|
32
|
+
}
|
|
33
|
+
if (route.createRoutes.constructor?.name === 'AsyncFunction') {
|
|
34
|
+
throw new Error(`HTTP routes: '${route.id}' createRoutes must be synchronous.`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function checkShape(route) {
|
|
38
|
+
if (typeof route !== 'object' || route === null)
|
|
39
|
+
throw new Error('HTTP routes: a route definition must be an object.');
|
|
40
|
+
if (typeof route.id !== 'string' || route.id.length === 0)
|
|
41
|
+
throw new Error(`HTTP routes: invalid id ${JSON.stringify(route.id)}.`);
|
|
42
|
+
if (route.kind === 'bundle') {
|
|
43
|
+
checkBundleShape(route);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (route.kind !== undefined && route.kind !== 'handler') {
|
|
47
|
+
throw new Error(`HTTP routes: '${route.id}' has unsupported kind ${JSON.stringify(route.kind)}.`);
|
|
48
|
+
}
|
|
49
|
+
checkHandlerShape(route);
|
|
50
|
+
}
|
|
26
51
|
/** Throws what `registerHttpRoute` would throw, without writing. */
|
|
27
52
|
export function checkHttpRouteRegistration(route) {
|
|
28
53
|
checkShape(route);
|
|
29
54
|
routes.check(route.id, route);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
55
|
+
if (!isHttpBundleRoute(route)) {
|
|
56
|
+
const owner = claimedPaths.get(route.path);
|
|
57
|
+
if (owner !== undefined && owner !== route) {
|
|
58
|
+
throw new Error(`HTTP routes: path '${route.path}' is already registered by '${owner.id}'.`);
|
|
59
|
+
}
|
|
33
60
|
}
|
|
34
61
|
}
|
|
35
62
|
export function registerHttpRoute(route) {
|
|
36
63
|
checkHttpRouteRegistration(route);
|
|
37
64
|
routes.register(route.id, route);
|
|
38
|
-
|
|
65
|
+
if (!isHttpBundleRoute(route))
|
|
66
|
+
claimedPaths.set(route.path, route);
|
|
39
67
|
}
|
|
40
68
|
export function sealHttpRoutes() { routes.seal(); }
|
|
41
69
|
/** Whether the registry is sealed. Never throws. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-route-registry.js","sourceRoot":"","sources":["../../src/core/http-route-registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http-route-registry.js","sourceRoot":"","sources":["../../src/core/http-route-registry.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAU,CAAC;AAG5F,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,WAAW,CAAU,CAAC;AA+CnE,MAAM,UAAU,iBAAiB,CAAC,KAA0B;IAC1D,OAAO,KAAK,C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AAK,CAAC,CAAC;AAC3B,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,0BAA0B,CAAC,KAA0B;IACnE,UAAU,CAAC,KAAK,CAAC,CAAC;IAClB,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC9B,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;YAC3C,MAAM,IAAI,KAAK,CAAC,sBAAsB,KAAK,CAAC,IAAI,+BAA+B,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;QAC/F,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAA0B;IAC1D,0BAA0B,CAAC,KAAK,CAAC,CAAC;IAClC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC;QAAE,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACrE,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,gFAAgF;AAChF,MAAM,UAAU,oBAAoB;IAClC,OAAO,MAAM,CAAC,MAAM,EAAE,CAAC;AACzB,CAAC"}
|
|
@@ -27,6 +27,18 @@ export declare function delegationFailure(error: unknown): {
|
|
|
27
27
|
export declare function createDelegationRoutes(service: DelegationService, credentials: CredentialRegistry): import("hono/hono-base").HonoBase<Env, {
|
|
28
28
|
"/list": {
|
|
29
29
|
$get: {
|
|
30
|
+
output: {
|
|
31
|
+
error: string;
|
|
32
|
+
code?: "invalid_input" | undefined;
|
|
33
|
+
};
|
|
34
|
+
outputFormat: "json";
|
|
35
|
+
status: 400;
|
|
36
|
+
input: {
|
|
37
|
+
query: {
|
|
38
|
+
offset?: string | undefined;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
} | {
|
|
30
42
|
output: {
|
|
31
43
|
workers: {
|
|
32
44
|
workerId: string;
|
|
@@ -79,18 +91,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
79
91
|
offset?: string | undefined;
|
|
80
92
|
};
|
|
81
93
|
};
|
|
82
|
-
} | {
|
|
83
|
-
output: {
|
|
84
|
-
error: string;
|
|
85
|
-
code?: "invalid_input" | undefined;
|
|
86
|
-
};
|
|
87
|
-
outputFormat: "json";
|
|
88
|
-
status: 400;
|
|
89
|
-
input: {
|
|
90
|
-
query: {
|
|
91
|
-
offset?: string | undefined;
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
94
|
};
|
|
95
95
|
};
|
|
96
96
|
} & {
|
|
@@ -677,6 +677,18 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
677
677
|
} & {
|
|
678
678
|
"/:workerId": {
|
|
679
679
|
$get: {
|
|
680
|
+
output: {
|
|
681
|
+
error: string;
|
|
682
|
+
code?: "invalid_input" | undefined;
|
|
683
|
+
};
|
|
684
|
+
outputFormat: "json";
|
|
685
|
+
status: 400;
|
|
686
|
+
input: {
|
|
687
|
+
param: {
|
|
688
|
+
workerId: string;
|
|
689
|
+
};
|
|
690
|
+
};
|
|
691
|
+
} | {
|
|
680
692
|
output: {
|
|
681
693
|
workerId: string;
|
|
682
694
|
settled: boolean;
|
|
@@ -801,7 +813,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
801
813
|
workerId: string;
|
|
802
814
|
};
|
|
803
815
|
};
|
|
804
|
-
}
|
|
816
|
+
};
|
|
817
|
+
};
|
|
818
|
+
} & {
|
|
819
|
+
"/:workerId/collect": {
|
|
820
|
+
$post: {
|
|
805
821
|
output: {
|
|
806
822
|
error: string;
|
|
807
823
|
code?: "invalid_input" | undefined;
|
|
@@ -812,12 +828,10 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
812
828
|
param: {
|
|
813
829
|
workerId: string;
|
|
814
830
|
};
|
|
831
|
+
} & {
|
|
832
|
+
json: Record<string, never>;
|
|
815
833
|
};
|
|
816
|
-
}
|
|
817
|
-
};
|
|
818
|
-
} & {
|
|
819
|
-
"/:workerId/collect": {
|
|
820
|
-
$post: {
|
|
834
|
+
} | {
|
|
821
835
|
output: {
|
|
822
836
|
workerId: string;
|
|
823
837
|
parentRunId: string;
|
|
@@ -940,7 +954,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
940
954
|
} & {
|
|
941
955
|
json: Record<string, never>;
|
|
942
956
|
};
|
|
943
|
-
}
|
|
957
|
+
};
|
|
958
|
+
};
|
|
959
|
+
} & {
|
|
960
|
+
"/:workerId/steer": {
|
|
961
|
+
$post: {
|
|
944
962
|
output: {
|
|
945
963
|
error: string;
|
|
946
964
|
code?: "invalid_input" | undefined;
|
|
@@ -952,13 +970,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
952
970
|
workerId: string;
|
|
953
971
|
};
|
|
954
972
|
} & {
|
|
955
|
-
json:
|
|
973
|
+
json: {
|
|
974
|
+
text: string;
|
|
975
|
+
};
|
|
956
976
|
};
|
|
957
|
-
}
|
|
958
|
-
};
|
|
959
|
-
} & {
|
|
960
|
-
"/:workerId/steer": {
|
|
961
|
-
$post: {
|
|
977
|
+
} | {
|
|
962
978
|
output: {
|
|
963
979
|
workerId: string;
|
|
964
980
|
state: "delivered" | "queued";
|
|
@@ -974,7 +990,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
974
990
|
text: string;
|
|
975
991
|
};
|
|
976
992
|
};
|
|
977
|
-
}
|
|
993
|
+
};
|
|
994
|
+
};
|
|
995
|
+
} & {
|
|
996
|
+
"/:workerId/stop": {
|
|
997
|
+
$post: {
|
|
978
998
|
output: {
|
|
979
999
|
error: string;
|
|
980
1000
|
code?: "invalid_input" | undefined;
|
|
@@ -986,15 +1006,9 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
986
1006
|
workerId: string;
|
|
987
1007
|
};
|
|
988
1008
|
} & {
|
|
989
|
-
json:
|
|
990
|
-
text: string;
|
|
991
|
-
};
|
|
1009
|
+
json: Record<string, never>;
|
|
992
1010
|
};
|
|
993
|
-
}
|
|
994
|
-
};
|
|
995
|
-
} & {
|
|
996
|
-
"/:workerId/stop": {
|
|
997
|
-
$post: {
|
|
1011
|
+
} | {
|
|
998
1012
|
output: {
|
|
999
1013
|
workerId: string;
|
|
1000
1014
|
state: "stopping" | "terminated";
|
|
@@ -1008,7 +1022,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1008
1022
|
} & {
|
|
1009
1023
|
json: Record<string, never>;
|
|
1010
1024
|
};
|
|
1011
|
-
}
|
|
1025
|
+
};
|
|
1026
|
+
};
|
|
1027
|
+
} & {
|
|
1028
|
+
"/:workerId/destroy": {
|
|
1029
|
+
$post: {
|
|
1012
1030
|
output: {
|
|
1013
1031
|
error: string;
|
|
1014
1032
|
code?: "invalid_input" | undefined;
|
|
@@ -1020,13 +1038,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1020
1038
|
workerId: string;
|
|
1021
1039
|
};
|
|
1022
1040
|
} & {
|
|
1023
|
-
json:
|
|
1041
|
+
json: {
|
|
1042
|
+
discardWork?: true | undefined;
|
|
1043
|
+
};
|
|
1024
1044
|
};
|
|
1025
|
-
}
|
|
1026
|
-
};
|
|
1027
|
-
} & {
|
|
1028
|
-
"/:workerId/destroy": {
|
|
1029
|
-
$post: {
|
|
1045
|
+
} | {
|
|
1030
1046
|
output: {
|
|
1031
1047
|
workerId: string;
|
|
1032
1048
|
state: "complete" | "incomplete";
|
|
@@ -1055,22 +1071,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1055
1071
|
discardWork?: true | undefined;
|
|
1056
1072
|
};
|
|
1057
1073
|
};
|
|
1058
|
-
} | {
|
|
1059
|
-
output: {
|
|
1060
|
-
error: string;
|
|
1061
|
-
code?: "invalid_input" | undefined;
|
|
1062
|
-
};
|
|
1063
|
-
outputFormat: "json";
|
|
1064
|
-
status: 400;
|
|
1065
|
-
input: {
|
|
1066
|
-
param: {
|
|
1067
|
-
workerId: string;
|
|
1068
|
-
};
|
|
1069
|
-
} & {
|
|
1070
|
-
json: {
|
|
1071
|
-
discardWork?: true | undefined;
|
|
1072
|
-
};
|
|
1073
|
-
};
|
|
1074
1074
|
} | {
|
|
1075
1075
|
output: {
|
|
1076
1076
|
workerId: string;
|
|
@@ -1106,13 +1106,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1106
1106
|
"/:workerId/diff": {
|
|
1107
1107
|
$get: {
|
|
1108
1108
|
output: {
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
diff: string;
|
|
1112
|
-
truncated: boolean;
|
|
1109
|
+
error: string;
|
|
1110
|
+
code?: "invalid_input" | undefined;
|
|
1113
1111
|
};
|
|
1114
1112
|
outputFormat: "json";
|
|
1115
|
-
status:
|
|
1113
|
+
status: 400;
|
|
1116
1114
|
input: {
|
|
1117
1115
|
param: {
|
|
1118
1116
|
workerId: string;
|
|
@@ -1120,11 +1118,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1120
1118
|
};
|
|
1121
1119
|
} | {
|
|
1122
1120
|
output: {
|
|
1123
|
-
|
|
1124
|
-
|
|
1121
|
+
workerId: string;
|
|
1122
|
+
baselineSha: string;
|
|
1123
|
+
diff: string;
|
|
1124
|
+
truncated: boolean;
|
|
1125
1125
|
};
|
|
1126
1126
|
outputFormat: "json";
|
|
1127
|
-
status:
|
|
1127
|
+
status: 200;
|
|
1128
1128
|
input: {
|
|
1129
1129
|
param: {
|
|
1130
1130
|
workerId: string;
|
package/dist/plugin/api.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { checkAgentToolRegistration, registerAgentTool } from '../ci-wait/tool-registry.js';
|
|
8
8
|
import { checkCliCommandRegistration, registerCliCommand } from '../core/cli-registry.js';
|
|
9
|
-
import { checkHttpRouteRegistration, registerHttpRoute } from '../core/http-route-registry.js';
|
|
9
|
+
import { checkHttpRouteRegistration, isHttpBundleRoute, registerHttpRoute } from '../core/http-route-registry.js';
|
|
10
10
|
import { checkLaunchPartRegistration, registerLaunchPart } from '../core/launch-registry.js';
|
|
11
11
|
import { checkRunnerRegistration, registerRunner } from '../core/runner-registry.js';
|
|
12
12
|
import { checkRunLifecycleListenerRegistration, registerRunLifecycleListener } from '../runs/lifecycle-registry.js';
|
|
@@ -77,6 +77,8 @@ function checkSlots(slots) {
|
|
|
77
77
|
function checkStagedHttpPaths(routes) {
|
|
78
78
|
const owners = new Map();
|
|
79
79
|
for (const route of routes) {
|
|
80
|
+
if (isHttpBundleRoute(route))
|
|
81
|
+
continue;
|
|
80
82
|
const owner = owners.get(route.path);
|
|
81
83
|
if (owner && owner !== route)
|
|
82
84
|
throw new Error(`HTTP routes: the plugin registers path '${route.path}' twice.`);
|
package/dist/plugin/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/plugin/api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAA4B,MAAM,6BAA6B,CAAC;AACtH,OAAO,EAAE,2BAA2B,EAAE,kBAAkB,EAA6B,MAAM,yBAAyB,CAAC;AACrH,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAA4B,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/plugin/api.ts"],"names":[],"mappings":"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AM,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;QACxD,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;QACpD,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC,MAAM;QACxC,qBAAqB,EAAE,MAAM,CAAC,SAAS,CAAC,MAAM;QAC9C,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;KACvD,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,MAAoB;IACvD,MAAM,MAAM,GAAiB,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;IACzK,IAAI,IAAI,GAAG,IAAI,CAAC;IAChB,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/C,CAAC;YAAS,CAAC;QACT,IAAI,GAAG,KAAK,CAAC;IACf,CAAC;IACD,WAAW,CAAC,MAAM,CAAC,CAAC;IACpB,YAAY,CAAC,MAAM,CAAC,CAAC;IACrB,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
package/dist/plugin/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type { AgentToolDefinition, AgentToolResult } from '../ci-wait/tool-regis
|
|
|
8
8
|
export type { WaitKindRow, WaitKindRegistration, WaitLifecycle, WaitInputDescriptor } from '../workflows/run/wait-kind-registry.ts';
|
|
9
9
|
export type { StepKindDefinition, StepKindContext, StepKindOutcome } from '../workflows/step-kind-registry.ts';
|
|
10
10
|
export type { CliCommandDefinition, RootCommandContext, SubcommandRunner } from '../core/cli-registry.ts';
|
|
11
|
-
export type { HttpRouteContext, HttpRouteDefinition, HttpRouteMethod } from '../core/http-route-registry.ts';
|
|
11
|
+
export type { HttpBundleRouteDefinition, HttpHandlerRouteDefinition, HttpRouteBundleContext, HttpRouteContext, HttpRouteDefinition, HttpRouteMethod, HttpRouteScope, } from '../core/http-route-registry.ts';
|
|
12
12
|
export type { RunSlots, DeletionGate, DeletionGateContext, DeletionKind, ReclaimPreparation, ReclaimContext, RemovalCleanup } from '../runs/removal-slots.ts';
|
|
13
13
|
export type { LaunchCockpitAddress, LaunchPartContext, LaunchPartContribution, LaunchPartDefinition } from '../core/launch-registry.ts';
|
|
14
14
|
export type { RunLifecycleHandlers, RunLifecycleHandler, RunLifecycleEvents, RunLifecycleEventType } from '../runs/lifecycle.ts';
|
package/dist/plugin/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AAsBA,cAAc,iBAAiB,CAAC"}
|