@hearsay-tools/squawk 0.19.0-dev.8773 → 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.
Files changed (81) hide show
  1. package/dist/boot.js +2 -0
  2. package/dist/boot.js.map +1 -1
  3. package/dist/built-in-http-routes.d.ts +10 -0
  4. package/dist/built-in-http-routes.js +41 -0
  5. package/dist/built-in-http-routes.js.map +1 -0
  6. package/dist/contract/automation-requests.d.ts +4 -0
  7. package/dist/core/http-route-registry.d.ts +28 -5
  8. package/dist/core/http-route-registry.js +37 -9
  9. package/dist/core/http-route-registry.js.map +1 -1
  10. package/dist/delegation/transport.d.ts +65 -65
  11. package/dist/plugin/api.js +3 -1
  12. package/dist/plugin/api.js.map +1 -1
  13. package/dist/plugin/index.d.ts +1 -1
  14. package/dist/plugin/index.js.map +1 -1
  15. package/dist/server/live-routes.d.ts +6 -6
  16. package/dist/server/models-routes.d.ts +12 -12
  17. package/dist/server/plugin-http-routes.d.ts +29 -4
  18. package/dist/server/plugin-http-routes.js +100 -13
  19. package/dist/server/plugin-http-routes.js.map +1 -1
  20. package/dist/server/projects-routes.d.ts +45 -45
  21. package/dist/server/providers-routes.d.ts +53 -53
  22. package/dist/server/repo-routes.d.ts +34 -34
  23. package/dist/server/runner-install-routes.d.ts +10 -10
  24. package/dist/server/server.d.ts +2870 -5670
  25. package/dist/server/server.js +39 -59
  26. package/dist/server/server.js.map +1 -1
  27. package/dist/server/workspace-routes.d.ts +84 -84
  28. package/dist/server/ws.d.ts +6 -0
  29. package/dist/server/ws.js +41 -0
  30. package/dist/server/ws.js.map +1 -1
  31. package/package.json +4 -4
  32. package/web/dist/assets/{accounts-section-CIgJyKva.js → accounts-section-DyE8nZhG.js} +1 -1
  33. package/web/dist/assets/{activity-motion-D_URV8Di.js → activity-motion-BbCsI0zQ.js} +1 -1
  34. package/web/dist/assets/{activity-route-Do33FDky.js → activity-route-BBHWMCvF.js} +1 -1
  35. package/web/dist/assets/{agent-config-section-BMfcQCbi.js → agent-config-section-7k8wATxQ.js} +1 -1
  36. package/web/dist/assets/{agent-defaults-section-Co96ec0d.js → agent-defaults-section-DwjS2zpP.js} +1 -1
  37. package/web/dist/assets/{appearance-DkSPOcn0.js → appearance-Cz_Xisdp.js} +1 -1
  38. package/web/dist/assets/{automations-route-YNUMP0mD.js → automations-route-331MoIW6.js} +1 -1
  39. package/web/dist/assets/{commit-list-0tp9mxng.js → commit-list-Ogvgv0V9.js} +1 -1
  40. package/web/dist/assets/{diff-6Tr1DKFm.js → diff-ZGlCIC2o.js} +2 -2
  41. package/web/dist/assets/{diff-controls-Uj68AWl-.js → diff-controls-CY3bqJPO.js} +1 -1
  42. package/web/dist/assets/{diff-view-DMO64pR1.js → diff-view-9-FcV8NQ.js} +1 -1
  43. package/web/dist/assets/{file-preview-BqaVkwcr.js → file-preview-CBme1fo_.js} +1 -1
  44. package/web/dist/assets/{git-toolbar-D513sAp1.js → git-toolbar-p0Gt04pZ.js} +1 -1
  45. package/web/dist/assets/{github-C5qUGzPx.js → github-ohX3f9y8.js} +1 -1
  46. package/web/dist/assets/{global-activity-route-DRZlGf9a.js → global-activity-route-Do0nIcLb.js} +1 -1
  47. package/web/dist/assets/{index-CIAFRUw6.js → index-BSZD2aai.js} +4 -4
  48. package/web/dist/assets/index-BwvwfpYW.css +1 -0
  49. package/web/dist/assets/{markdown-B8uIJFot.js → markdown-BZgLow5j.js} +1 -1
  50. package/web/dist/assets/{notifications-section-DcR7A7aZ.js → notifications-section-UWrIuuqK.js} +1 -1
  51. package/web/dist/assets/{preview-pane-connected-BOptVmB7.js → preview-pane-connected-D-NHVwVK.js} +1 -1
  52. package/web/dist/assets/{projects-section-ByjMveO2.js → projects-section-ZvcZ3_Gf.js} +1 -1
  53. package/web/dist/assets/{prompt-templates-section-mztZbjR2.js → prompt-templates-section-C41o3_cn.js} +1 -1
  54. package/web/dist/assets/{remote-settings-notice-_lT2fFKo.js → remote-settings-notice-BsKK4zWt.js} +1 -1
  55. package/web/dist/assets/{repo-git-muNCGIF4.js → repo-git-CaKYihkq.js} +1 -1
  56. package/web/dist/assets/{report-reader-CJTciXLf.js → report-reader-MQRVVGOV.js} +1 -1
  57. package/web/dist/assets/{reports-Ddq_ls0m.js → reports-BkkJOinX.js} +1 -1
  58. package/web/dist/assets/{resources-section-C5ssAmKn.js → resources-section-D4cLySUg.js} +1 -1
  59. package/web/dist/assets/{review-panel-wst8aLz4.js → review-panel-DwoLnSOz.js} +1 -1
  60. package/web/dist/assets/{run-header-bZAJ80iC.js → run-header-DXt2EtCb.js} +1 -1
  61. package/web/dist/assets/{select-B05NBo-9.js → select-DsxHxI9X.js} +1 -1
  62. package/web/dist/assets/{session-context-section-BzflGStM.js → session-context-section-Dq7kwhFC.js} +1 -1
  63. package/web/dist/assets/{settings-agent-picker-BjvjnUs4.js → settings-agent-picker--LZQKc3H.js} +1 -1
  64. package/web/dist/assets/{settings-shell-vD5R1O7D.js → settings-shell-BLI4CANd.js} +1 -1
  65. package/web/dist/assets/{sidebar-section-BZLTjCJ6.js → sidebar-section-BZKlFvG9.js} +1 -1
  66. package/web/dist/assets/{skills-BNbkK6g-.js → skills-Dvzt9DdF.js} +1 -1
  67. package/web/dist/assets/{task-changes-BbRB1M0L.js → task-changes-Bj8vcfpY.js} +1 -1
  68. package/web/dist/assets/{task-commits-_hMQ47BK.js → task-commits-D2sgt47s.js} +1 -1
  69. package/web/dist/assets/{task-file-scope-CGgYP4rR.js → task-file-scope-BEi9o8Ur.js} +1 -1
  70. package/web/dist/assets/{task-files-Cce3Lghe.js → task-files-CSGqLTZ9.js} +1 -1
  71. package/web/dist/assets/{task-github-item-C25rYc6W.js → task-github-item-DyMsNAdL.js} +1 -1
  72. package/web/dist/assets/{task-thread-Cqs9j6f8.js → task-thread-D7iB5aiK.js} +1 -1
  73. package/web/dist/assets/{thread-state-C4f5H6np.js → thread-state-D8MmuQvJ.js} +1 -1
  74. package/web/dist/assets/{use-hand-to-agent-state-Dnb5uNM1.js → use-hand-to-agent-state-BFCOOUq3.js} +1 -1
  75. package/web/dist/assets/{workflows-FH3RBKvk.css → workflows-BpuZNAc8.css} +1 -1
  76. package/web/dist/assets/workflows-V_D7FZYN.js +7 -0
  77. package/web/dist/assets/{workspace-tools-DJcDHrF-.js → workspace-tools-BwNE3W6C.js} +1 -1
  78. package/web/dist/assets/{worktrees-section-DRG2wiAo.js → worktrees-section-DLigjWPB.js} +1 -1
  79. package/web/dist/index.html +2 -2
  80. package/web/dist/assets/index-DclFk8VO.css +0 -1
  81. package/web/dist/assets/workflows-Cl1NhrpU.js +0 -7
@@ -1,21 +1,46 @@
1
1
  import type { Hono } from 'hono';
2
2
  import { type HttpRouteDefinition } from '../core/http-route-registry.ts';
3
3
  import type { Home } from '../home/home.ts';
4
- export interface MountPluginHttpRoutesInput {
5
- routed: Hono;
4
+ import type { ProjectApiEnv } from './server-types.ts';
5
+ export interface MountPluginHttpRoutesBaseInput {
6
6
  home: Home;
7
7
  version: string;
8
8
  squawkPort?: (() => number | undefined) | undefined;
9
9
  isHostedMode: () => boolean;
10
10
  httpRoutes?: readonly HttpRouteDefinition[] | undefined;
11
11
  }
12
+ export interface MountPluginRouteBundlesInput extends MountPluginHttpRoutesBaseInput {
13
+ app: Hono;
14
+ v1: Hono<ProjectApiEnv>;
15
+ workspaceV1: Hono;
16
+ v1Prefix: string;
17
+ v1ScopedPrefix: string;
18
+ /** Called for each mounted method+path of a project-scoped route bundle. */
19
+ onProjectRouteMounted?: ((methodAndPath: string) => void) | undefined;
20
+ /** Per-app bridge forwarded to route bundles until S2 introduces `ServerPluginContext`. */
21
+ appBridge?: unknown;
22
+ /** Receives one stderr line per skipped non-bundled bundle that fails to initialize. */
23
+ warn?: ((line: string) => void) | undefined;
24
+ }
25
+ export interface MountPluginHttpHandlersInput extends MountPluginHttpRoutesBaseInput {
26
+ routed: Hono;
27
+ }
12
28
  /**
13
29
  * Paths whose plugin route enforces its own auth and streaming body limit, so the global 32 MiB
14
30
  * `bodyLimit` middleware skips them instead of pre-buffering unauthenticated chunked uploads.
15
31
  */
16
32
  export declare function pluginManagedBodyLimitPaths(httpRoutes?: readonly HttpRouteDefinition[]): ReadonlySet<string>;
17
33
  /**
18
- * Mount non-RPC plugin HTTP routes (hearsay-tools/squawk#4402) outside the `AppType` RPC
34
+ * Mount project-scoped and workspace-scoped plugin route bundles onto `v1` and `workspaceV1`
35
+ * AFTER those sub-apps fix their `AppType` types and BEFORE `app.route(...)` mounts them.
36
+ * That preserves single-pass project scope resolution (one `resolveProjectScope` per request),
37
+ * enforces unavailable-store and admission guards on every bundle route (including `.all()`),
38
+ * and isolates non-bundled (host) bundle factory failures so a broken host plugin never aborts
39
+ * cockpit startup.
40
+ */
41
+ export declare function mountPluginRouteBundles(input: MountPluginRouteBundlesInput): void;
42
+ /**
43
+ * Mount single-path plugin HTTP handlers (hearsay-tools/squawk#4402) outside the `AppType` RPC
19
44
  * chain, after the global `/api/*` request-origin guard and before the SPA catch-all.
20
45
  */
21
- export declare function mountPluginHttpRoutes(input: MountPluginHttpRoutesInput): void;
46
+ export declare function mountPluginHttpRoutes(input: MountPluginHttpHandlersInput): void;
@@ -1,4 +1,5 @@
1
- import { httpRoutesSealed, registeredHttpRoutes, } from '../core/http-route-registry.js';
1
+ import { httpRoutesSealed, isHttpBundleRoute, registeredHttpRoutes, } from '../core/http-route-registry.js';
2
+ import { pluginLoadReport } from '../plugin/loader.js';
2
3
  /**
3
4
  * Paths whose plugin route enforces its own auth and streaming body limit, so the global 32 MiB
4
5
  * `bodyLimit` middleware skips them instead of pre-buffering unauthenticated chunked uploads.
@@ -7,19 +8,12 @@ export function pluginManagedBodyLimitPaths(httpRoutes) {
7
8
  const routes = httpRoutes ?? (httpRoutesSealed() ? registeredHttpRoutes() : []);
8
9
  const paths = new Set();
9
10
  for (const route of routes) {
10
- if (route.managesBodyLimit)
11
+ if (!isHttpBundleRoute(route) && route.managesBodyLimit)
11
12
  paths.add(route.path);
12
13
  }
13
14
  return paths;
14
15
  }
15
- /**
16
- * Mount non-RPC plugin HTTP routes (hearsay-tools/squawk#4402) outside the `AppType` RPC
17
- * chain, after the global `/api/*` request-origin guard and before the SPA catch-all.
18
- */
19
- export function mountPluginHttpRoutes(input) {
20
- const pluginHttpRoutes = input.httpRoutes ?? (httpRoutesSealed() ? registeredHttpRoutes() : []);
21
- if (pluginHttpRoutes.length === 0)
22
- return;
16
+ function buildRouteContext(target, input, appBridge) {
23
17
  const fetchApp = async (request) => {
24
18
  const headers = new Headers(request.headers);
25
19
  headers.delete('origin');
@@ -32,16 +26,109 @@ export function mountPluginHttpRoutes(input) {
32
26
  ...(body !== undefined ? { body } : {}),
33
27
  signal: request.signal,
34
28
  });
35
- return input.routed.fetch(internal);
29
+ return target.fetch(internal);
36
30
  };
37
- const routeContext = {
31
+ return {
38
32
  home: input.home,
39
33
  version: input.version,
40
34
  squawkPort: () => input.squawkPort?.(),
41
35
  isHostedMode: input.isHostedMode,
42
36
  fetchApp,
37
+ appBridge,
43
38
  };
44
- for (const route of pluginHttpRoutes) {
39
+ }
40
+ function errorText(error) {
41
+ if (error instanceof Error)
42
+ return error.message;
43
+ try {
44
+ return String(error);
45
+ }
46
+ catch {
47
+ return 'a thrown value with no string form';
48
+ }
49
+ }
50
+ function validateBundleSubApp(route, subApp) {
51
+ if ((typeof subApp === 'object' || typeof subApp === 'function') && subApp !== null && typeof subApp.then === 'function') {
52
+ // Consume any rejection from a JS plugin that returned a Promise/thenable so Node never terminates on unhandledRejection.
53
+ void Promise.resolve(subApp).catch(() => undefined);
54
+ throw new Error(`HTTP route bundle '${route.id}' createRoutes() must be synchronous and return a Hono instance.`);
55
+ }
56
+ if (typeof subApp !== 'object' || subApp === null || !Array.isArray(subApp.routes)) {
57
+ throw new Error(`HTTP route bundle '${route.id}' createRoutes() must return a Hono instance.`);
58
+ }
59
+ const app = subApp;
60
+ for (const entry of app.routes) {
61
+ if (entry.method === 'ALL' && (entry.path === '*' || entry.path === '/*')) {
62
+ throw new Error(`HTTP route bundle '${route.id}' cannot register a root wildcard handler ('${entry.path}').`);
63
+ }
64
+ }
65
+ return app;
66
+ }
67
+ function bundledHttpRouteIds() {
68
+ const ids = new Set();
69
+ for (const plugin of pluginLoadReport().loaded) {
70
+ if (plugin.source !== 'bundled')
71
+ continue;
72
+ for (const id of plugin.contributions.httpRoutes)
73
+ ids.add(id);
74
+ }
75
+ return ids;
76
+ }
77
+ function joinMountedPath(prefix, path) {
78
+ return path === '/' ? prefix : `${prefix}${path}`;
79
+ }
80
+ /**
81
+ * Mount project-scoped and workspace-scoped plugin route bundles onto `v1` and `workspaceV1`
82
+ * AFTER those sub-apps fix their `AppType` types and BEFORE `app.route(...)` mounts them.
83
+ * That preserves single-pass project scope resolution (one `resolveProjectScope` per request),
84
+ * enforces unavailable-store and admission guards on every bundle route (including `.all()`),
85
+ * and isolates non-bundled (host) bundle factory failures so a broken host plugin never aborts
86
+ * cockpit startup.
87
+ */
88
+ export function mountPluginRouteBundles(input) {
89
+ const pluginHttpRoutes = input.httpRoutes ?? (httpRoutesSealed() ? registeredHttpRoutes() : []);
90
+ const bundles = pluginHttpRoutes.filter(isHttpBundleRoute);
91
+ if (bundles.length === 0)
92
+ return;
93
+ const routeContext = buildRouteContext(input.app, input, input.appBridge);
94
+ const bundledIds = bundledHttpRouteIds();
95
+ const warn = input.warn ?? ((line) => { process.stderr.write(`${line}\n`); });
96
+ for (const route of bundles) {
97
+ let subApp;
98
+ try {
99
+ subApp = validateBundleSubApp(route, route.createRoutes(routeContext));
100
+ }
101
+ catch (error) {
102
+ if (bundledIds.has(route.id))
103
+ throw error;
104
+ warn(`[hsq] plugin HTTP route bundle "${route.id}" skipped: ${errorText(error)}`);
105
+ continue;
106
+ }
107
+ if (route.scope === 'project') {
108
+ const before = input.v1.routes.length;
109
+ input.v1.route('/', subApp);
110
+ for (const mounted of input.v1.routes.slice(before)) {
111
+ for (const prefix of [input.v1Prefix, input.v1ScopedPrefix]) {
112
+ input.onProjectRouteMounted?.(`${mounted.method} ${joinMountedPath(prefix, mounted.path)}`);
113
+ }
114
+ }
115
+ }
116
+ else {
117
+ input.workspaceV1.route('/', subApp);
118
+ }
119
+ }
120
+ }
121
+ /**
122
+ * Mount single-path plugin HTTP handlers (hearsay-tools/squawk#4402) outside the `AppType` RPC
123
+ * chain, after the global `/api/*` request-origin guard and before the SPA catch-all.
124
+ */
125
+ export function mountPluginHttpRoutes(input) {
126
+ const pluginHttpRoutes = input.httpRoutes ?? (httpRoutesSealed() ? registeredHttpRoutes() : []);
127
+ const handlers = pluginHttpRoutes.filter((route) => !isHttpBundleRoute(route));
128
+ if (handlers.length === 0)
129
+ return;
130
+ const routeContext = buildRouteContext(input.routed, input);
131
+ for (const route of handlers) {
45
132
  const handler = (c) => route.handle(c.req.raw, routeContext);
46
133
  if (route.method === 'ALL')
47
134
  input.routed.all(route.path, handler);
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-http-routes.js","sourceRoot":"","sources":["../../src/server/plugin-http-routes.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,EAChB,oBAAoB,GAGrB,MAAM,gCAAgC,CAAC;AAYxC;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,UAA2C;IACrF,MAAM,MAAM,GAAG,UAAU,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,oBAAoB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAChF,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,gBAAgB;YAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAiC;IACrE,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,IAAI,CAAC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AAG,CAAC,CAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;QACtE,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK;YAAE,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;;YAC7D,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC"}
@@ -63,6 +63,17 @@ export declare function createProjectsRoutes(deps: ProjectsRouteDeps): import("h
63
63
  } & {
64
64
  "/projects": {
65
65
  $post: {
66
+ output: {
67
+ error: string;
68
+ };
69
+ outputFormat: "json";
70
+ status: 400 | 500;
71
+ input: {
72
+ json: {
73
+ root: string;
74
+ };
75
+ };
76
+ } | {
66
77
  output: {
67
78
  project: {
68
79
  id: string;
@@ -93,10 +104,10 @@ export declare function createProjectsRoutes(deps: ProjectsRouteDeps): import("h
93
104
  agent: boolean;
94
105
  }[] | undefined;
95
106
  };
96
- error?: string | undefined;
107
+ error: string;
97
108
  };
98
109
  outputFormat: "json";
99
- status: 200;
110
+ status: 409;
100
111
  input: {
101
112
  json: {
102
113
  root: string;
@@ -133,21 +144,10 @@ export declare function createProjectsRoutes(deps: ProjectsRouteDeps): import("h
133
144
  agent: boolean;
134
145
  }[] | undefined;
135
146
  };
136
- error: string;
137
- };
138
- outputFormat: "json";
139
- status: 409;
140
- input: {
141
- json: {
142
- root: string;
143
- };
144
- };
145
- } | {
146
- output: {
147
- error: string;
147
+ error?: string | undefined;
148
148
  };
149
149
  outputFormat: "json";
150
- status: 400 | 500;
150
+ status: 200;
151
151
  input: {
152
152
  json: {
153
153
  root: string;
@@ -306,7 +306,7 @@ export declare function createProjectsRoutes(deps: ProjectsRouteDeps): import("h
306
306
  error: string;
307
307
  };
308
308
  outputFormat: "json";
309
- status: 400;
309
+ status: 404;
310
310
  input: {
311
311
  param: {
312
312
  projectId: string;
@@ -317,7 +317,7 @@ export declare function createProjectsRoutes(deps: ProjectsRouteDeps): import("h
317
317
  error: string;
318
318
  };
319
319
  outputFormat: "json";
320
- status: 404;
320
+ status: 400;
321
321
  input: {
322
322
  param: {
323
323
  projectId: string;
@@ -342,6 +342,27 @@ export declare function createProjectsRoutes(deps: ProjectsRouteDeps): import("h
342
342
  } & {
343
343
  "/projects/:projectId/webhooks": {
344
344
  $post: {
345
+ output: {
346
+ error: string;
347
+ };
348
+ outputFormat: "json";
349
+ status: 400 | 404 | 409 | 500;
350
+ input: {
351
+ json: {
352
+ name: string;
353
+ description?: string | undefined;
354
+ url: string;
355
+ token?: string | undefined;
356
+ tasks?: boolean | undefined;
357
+ triggers?: ("cancelled" | "done" | "failed" | "needs-you" | "running" | "waiting-ci" | "waiting-other" | "waiting-timer" | "waiting-workers")[] | undefined;
358
+ agent?: boolean | undefined;
359
+ };
360
+ } & {
361
+ param: {
362
+ projectId: string;
363
+ };
364
+ };
365
+ } | {
345
366
  output: {
346
367
  project: {
347
368
  id: string;
@@ -400,27 +421,6 @@ export declare function createProjectsRoutes(deps: ProjectsRouteDeps): import("h
400
421
  projectId: string;
401
422
  };
402
423
  };
403
- } | {
404
- output: {
405
- error: string;
406
- };
407
- outputFormat: "json";
408
- status: 400 | 404 | 409 | 500;
409
- input: {
410
- json: {
411
- name: string;
412
- description?: string | undefined;
413
- url: string;
414
- token?: string | undefined;
415
- tasks?: boolean | undefined;
416
- triggers?: ("cancelled" | "done" | "failed" | "needs-you" | "running" | "waiting-ci" | "waiting-other" | "waiting-timer" | "waiting-workers")[] | undefined;
417
- agent?: boolean | undefined;
418
- };
419
- } & {
420
- param: {
421
- projectId: string;
422
- };
423
- };
424
424
  };
425
425
  };
426
426
  } & {
@@ -618,10 +618,13 @@ export declare function createProjectsRoutes(deps: ProjectsRouteDeps): import("h
618
618
  };
619
619
  } | {
620
620
  output: {
621
- error: string;
621
+ ok: boolean;
622
+ status?: number | undefined;
623
+ error?: string | undefined;
624
+ dryRun?: boolean | undefined;
622
625
  };
623
626
  outputFormat: "json";
624
- status: 404;
627
+ status: import("hono/utils/http-status").ContentfulStatusCode;
625
628
  input: {
626
629
  param: {
627
630
  projectId: string;
@@ -630,13 +633,10 @@ export declare function createProjectsRoutes(deps: ProjectsRouteDeps): import("h
630
633
  };
631
634
  } | {
632
635
  output: {
633
- ok: boolean;
634
- status?: number | undefined;
635
- error?: string | undefined;
636
- dryRun?: boolean | undefined;
636
+ error: string;
637
637
  };
638
638
  outputFormat: "json";
639
- status: import("hono/utils/http-status").ContentfulStatusCode;
639
+ status: 404;
640
640
  input: {
641
641
  param: {
642
642
  projectId: string;
@@ -70,10 +70,18 @@ export declare function createProvidersRoutes(deps: ProvidersRouteDeps): import(
70
70
  };
71
71
  } | {
72
72
  output: {
73
- error: string;
73
+ providers: {
74
+ requiresAccountHome?: boolean | undefined;
75
+ provider: string;
76
+ status: "connected" | "disconnected" | "not-installed" | "unknown";
77
+ enabled?: boolean | undefined;
78
+ hint?: string | undefined;
79
+ authFailureId?: string | undefined;
80
+ profileId?: string | undefined;
81
+ }[];
74
82
  };
75
83
  outputFormat: "json";
76
- status: 500;
84
+ status: import("hono/utils/http-status").ContentfulStatusCode;
77
85
  input: {
78
86
  param: {
79
87
  provider: string;
@@ -85,18 +93,10 @@ export declare function createProvidersRoutes(deps: ProvidersRouteDeps): import(
85
93
  };
86
94
  } | {
87
95
  output: {
88
- providers: {
89
- requiresAccountHome?: boolean | undefined;
90
- provider: string;
91
- status: "connected" | "disconnected" | "not-installed" | "unknown";
92
- enabled?: boolean | undefined;
93
- hint?: string | undefined;
94
- authFailureId?: string | undefined;
95
- profileId?: string | undefined;
96
- }[];
96
+ error: string;
97
97
  };
98
98
  outputFormat: "json";
99
- status: import("hono/utils/http-status").ContentfulStatusCode;
99
+ status: 500;
100
100
  input: {
101
101
  param: {
102
102
  provider: string;
@@ -128,10 +128,18 @@ export declare function createProvidersRoutes(deps: ProvidersRouteDeps): import(
128
128
  };
129
129
  } | {
130
130
  output: {
131
- error: string;
131
+ providers: {
132
+ requiresAccountHome?: boolean | undefined;
133
+ provider: string;
134
+ status: "connected" | "disconnected" | "not-installed" | "unknown";
135
+ enabled?: boolean | undefined;
136
+ hint?: string | undefined;
137
+ authFailureId?: string | undefined;
138
+ profileId?: string | undefined;
139
+ }[];
132
140
  };
133
141
  outputFormat: "json";
134
- status: 409;
142
+ status: import("hono/utils/http-status").ContentfulStatusCode;
135
143
  input: {
136
144
  param: {
137
145
  provider: string;
@@ -143,18 +151,10 @@ export declare function createProvidersRoutes(deps: ProvidersRouteDeps): import(
143
151
  };
144
152
  } | {
145
153
  output: {
146
- providers: {
147
- requiresAccountHome?: boolean | undefined;
148
- provider: string;
149
- status: "connected" | "disconnected" | "not-installed" | "unknown";
150
- enabled?: boolean | undefined;
151
- hint?: string | undefined;
152
- authFailureId?: string | undefined;
153
- profileId?: string | undefined;
154
- }[];
154
+ error: string;
155
155
  };
156
156
  outputFormat: "json";
157
- status: import("hono/utils/http-status").ContentfulStatusCode;
157
+ status: 409;
158
158
  input: {
159
159
  param: {
160
160
  provider: string;
@@ -290,28 +290,10 @@ export declare function createAgentProfilesRoutes(deps: AgentProfilesRouteDeps):
290
290
  "/workspace/agent-profiles": {
291
291
  $post: {
292
292
  output: {
293
- profile: {
294
- id: string;
295
- provider: string;
296
- label: string;
297
- configDir?: string | undefined;
298
- path?: string | undefined;
299
- exists: boolean;
300
- looksValid: boolean;
301
- isDefault: boolean;
302
- status?: {
303
- requiresAccountHome?: boolean | undefined;
304
- provider: string;
305
- status: "connected" | "disconnected" | "not-installed" | "unknown";
306
- enabled?: boolean | undefined;
307
- hint?: string | undefined;
308
- authFailureId?: string | undefined;
309
- profileId?: string | undefined;
310
- } | undefined;
311
- };
293
+ error: string;
312
294
  };
313
295
  outputFormat: "json";
314
- status: 201;
296
+ status: 400;
315
297
  input: {
316
298
  json: {
317
299
  provider: string;
@@ -324,7 +306,7 @@ export declare function createAgentProfilesRoutes(deps: AgentProfilesRouteDeps):
324
306
  error: string;
325
307
  };
326
308
  outputFormat: "json";
327
- status: 400;
309
+ status: 409;
328
310
  input: {
329
311
  json: {
330
312
  provider: string;
@@ -337,7 +319,7 @@ export declare function createAgentProfilesRoutes(deps: AgentProfilesRouteDeps):
337
319
  error: string;
338
320
  };
339
321
  outputFormat: "json";
340
- status: 409;
322
+ status: 500;
341
323
  input: {
342
324
  json: {
343
325
  provider: string;
@@ -347,10 +329,28 @@ export declare function createAgentProfilesRoutes(deps: AgentProfilesRouteDeps):
347
329
  };
348
330
  } | {
349
331
  output: {
350
- error: string;
332
+ profile: {
333
+ id: string;
334
+ provider: string;
335
+ label: string;
336
+ configDir?: string | undefined;
337
+ path?: string | undefined;
338
+ exists: boolean;
339
+ looksValid: boolean;
340
+ isDefault: boolean;
341
+ status?: {
342
+ requiresAccountHome?: boolean | undefined;
343
+ provider: string;
344
+ status: "connected" | "disconnected" | "not-installed" | "unknown";
345
+ enabled?: boolean | undefined;
346
+ hint?: string | undefined;
347
+ authFailureId?: string | undefined;
348
+ profileId?: string | undefined;
349
+ } | undefined;
350
+ };
351
351
  };
352
352
  outputFormat: "json";
353
- status: 500;
353
+ status: 201;
354
354
  input: {
355
355
  json: {
356
356
  provider: string;
@@ -544,7 +544,7 @@ export declare function createAgentProfilesRoutes(deps: AgentProfilesRouteDeps):
544
544
  error: string;
545
545
  };
546
546
  outputFormat: "json";
547
- status: 400;
547
+ status: 404;
548
548
  input: {
549
549
  json: {
550
550
  projectId: string;
@@ -557,7 +557,7 @@ export declare function createAgentProfilesRoutes(deps: AgentProfilesRouteDeps):
557
557
  error: string;
558
558
  };
559
559
  outputFormat: "json";
560
- status: 404;
560
+ status: 400;
561
561
  input: {
562
562
  json: {
563
563
  projectId: string;
@@ -621,7 +621,7 @@ export declare function createAgentProfilesRoutes(deps: AgentProfilesRouteDeps):
621
621
  error: string;
622
622
  };
623
623
  outputFormat: "json";
624
- status: 404;
624
+ status: 409;
625
625
  input: {
626
626
  param: {
627
627
  id: string;
@@ -632,7 +632,7 @@ export declare function createAgentProfilesRoutes(deps: AgentProfilesRouteDeps):
632
632
  error: string;
633
633
  };
634
634
  outputFormat: "json";
635
- status: 409;
635
+ status: 500;
636
636
  input: {
637
637
  param: {
638
638
  id: string;
@@ -643,7 +643,7 @@ export declare function createAgentProfilesRoutes(deps: AgentProfilesRouteDeps):
643
643
  error: string;
644
644
  };
645
645
  outputFormat: "json";
646
- status: 500;
646
+ status: 404;
647
647
  input: {
648
648
  param: {
649
649
  id: string;