@hearsay-tools/squawk 0.18.0-dev.8312 → 0.18.0-dev.8318

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.
@@ -18,7 +18,7 @@ import { loadWorkspaceConfig, mergeWriteWorkspaceConfig } from '../workspace/con
18
18
  import { WorkspaceSemaphore } from '../workspace/semaphore.ts';
19
19
  import { type CloneRunner } from './checkout.ts';
20
20
  import { type CommandRunner } from './create-project.ts';
21
- import { ProjectContexts, type ProjectContext, type ProjectRunManager, type RunManagerFactory } from './project-context.ts';
21
+ import { ProjectContexts, type ProjectRunManager, type RunManagerFactory } from './project-context.ts';
22
22
  import type { SocketHub, WsUpgradeVerdict } from './ws.ts';
23
23
  import type { PreviewHost } from '../preview/host.ts';
24
24
  import { type ForgeFactory } from './forge/index.ts';
@@ -26,6 +26,7 @@ import { type CockpitOwnership } from './cockpit-ownership.ts';
26
26
  import { openInTerminal } from './open-in-terminal.ts';
27
27
  import { openFileInDefaultApp, openInApp } from './open-in-app.ts';
28
28
  import { ProviderRuntimeAuthObserver } from './provider-auth-runtime.ts';
29
+ import { WorkspaceEventBus } from './server-types.ts';
29
30
  export interface ServerDeps extends ActivityServerDeps {
30
31
  home: Home;
31
32
  /** Per-repository forge injection for embedded servers and tests. */
@@ -138,14 +139,7 @@ export interface ServerDeps extends ActivityServerDeps {
138
139
  automationsChanged?: () => void;
139
140
  archiveOnMergeChanged?: () => void;
140
141
  }
141
- /** Hono env for the mirrored project-route table: the scope resolver puts the
142
- * request's `ProjectContext` on the context, handlers read `c.get('project')`. */
143
- export type ProjectApiEnv = {
144
- Variables: {
145
- project: ProjectContext;
146
- stoppedOnAdoption?: boolean;
147
- };
148
- };
142
+ export { WorkspaceEventBus, type ProjectApiEnv, type WorkspaceEventName } from './server-types.ts';
149
143
  /** One row of the mirrored project-route table. */
150
144
  export interface ProjectRouteInfo {
151
145
  method: string;
@@ -161,26 +155,6 @@ export interface ProjectRouteInfo {
161
155
  */
162
156
  export declare function projectRouteManifest(app: Hono): ProjectRouteInfo[];
163
157
  export type { ProjectsResponse, RegisterProjectResponse, RemoveProjectResponse, UpdateProjectResponse } from '../contract/index.js';
164
- /** Workspace-level event names carried ONLY on `GET /api/workspace/events`
165
- * (never on the per-project streams): registry mutations, the GUI-clone
166
- * progress feed (step 4.3), and host-wide unstamped provider status. */
167
- export type WorkspaceEventName = 'project-added' | 'project-removed' | 'checkout-progress' | 'health' | 'provider-status' | 'automation-change' | 'project-ready';
168
- /**
169
- * The in-process bus for workspace-level SSE events. The registry-mutating
170
- * routes (`POST /api/projects` — step 4.2, emits `project-added` for a
171
- * genuinely new entry; `DELETE /api/projects/:projectId` — step 4.4) and the
172
- * checkout flow (step 4.3) call `emit()`; runtime provider auth observation
173
- * emits host-wide `provider-status`; every open `/api/workspace/events` stream
174
- * relays the event verbatim under its name. Injectable via
175
- * `ServerDeps.workspaceEvents` so tests (and any out-of-createApp emitter) can
176
- * drive the stream.
177
- */
178
- export declare class WorkspaceEventBus {
179
- private readonly listeners;
180
- emit(event: WorkspaceEventName, data: unknown): void;
181
- /** Subscribe; returns an unsubscribe. */
182
- on(listener: (event: WorkspaceEventName, data: unknown) => void): () => void;
183
- }
184
158
  export declare function createApp(deps: ServerDeps): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<{
185
159
  "/health": {
186
160
  $get: {
@@ -3118,6 +3092,12 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
3118
3092
  output: {
3119
3093
  generation: string;
3120
3094
  results: ({
3095
+ projectId: string;
3096
+ runId: string;
3097
+ type: "error" | "reset";
3098
+ status: 400 | 404 | 409 | 413 | 503;
3099
+ error: string;
3100
+ } | {
3121
3101
  projectId: string;
3122
3102
  runId: string;
3123
3103
  type: "batch";
@@ -3131,12 +3111,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
3131
3111
  cursor: string;
3132
3112
  afterSeq: number;
3133
3113
  hasMore: boolean;
3134
- } | {
3135
- projectId: string;
3136
- runId: string;
3137
- type: "error" | "reset";
3138
- status: 400 | 404 | 409 | 413 | 503;
3139
- error: string;
3140
3114
  })[];
3141
3115
  };
3142
3116
  outputFormat: "json";
@@ -8658,6 +8632,37 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
8658
8632
  } & {
8659
8633
  "/runs/:id/worker-destroy": {
8660
8634
  $post: {
8635
+ output: {
8636
+ readonly code: "capacity_limit" | "denied_scope" | "incompatible_state" | "incomplete_cleanup" | "invalid_baseline" | "invalid_input" | "unauthenticated" | "unavailable_diff" | "unavailable_transport";
8637
+ readonly error: string;
8638
+ readonly modelChoices?: {
8639
+ runner: string;
8640
+ requestedModel: string;
8641
+ availableModels: {
8642
+ id: string;
8643
+ label: string;
8644
+ description: string;
8645
+ effortLevels?: ("high" | "low" | "max" | "medium" | "xhigh")[] | undefined;
8646
+ }[];
8647
+ otherRunners: string[];
8648
+ } | undefined;
8649
+ };
8650
+ outputFormat: "json";
8651
+ status: 400 | 401 | 403 | 409 | 503;
8652
+ input: {
8653
+ query: {
8654
+ [x: string]: string | string[];
8655
+ };
8656
+ } & {
8657
+ param: {
8658
+ id: string;
8659
+ };
8660
+ } & {
8661
+ json: {
8662
+ discardWork?: true | undefined;
8663
+ };
8664
+ };
8665
+ } | {
8661
8666
  output: {
8662
8667
  error: string;
8663
8668
  code?: "invalid_input" | undefined;
@@ -8743,37 +8748,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
8743
8748
  discardWork?: true | undefined;
8744
8749
  };
8745
8750
  };
8746
- } | {
8747
- output: {
8748
- readonly code: "capacity_limit" | "denied_scope" | "incompatible_state" | "incomplete_cleanup" | "invalid_baseline" | "invalid_input" | "unauthenticated" | "unavailable_diff" | "unavailable_transport";
8749
- readonly error: string;
8750
- readonly modelChoices?: {
8751
- runner: string;
8752
- requestedModel: string;
8753
- availableModels: {
8754
- id: string;
8755
- label: string;
8756
- description: string;
8757
- effortLevels?: ("high" | "low" | "max" | "medium" | "xhigh")[] | undefined;
8758
- }[];
8759
- otherRunners: string[];
8760
- } | undefined;
8761
- };
8762
- outputFormat: "json";
8763
- status: 400 | 401 | 403 | 409 | 503;
8764
- input: {
8765
- query: {
8766
- [x: string]: string | string[];
8767
- };
8768
- } & {
8769
- param: {
8770
- id: string;
8771
- };
8772
- } & {
8773
- json: {
8774
- discardWork?: true | undefined;
8775
- };
8776
- };
8777
8751
  };
8778
8752
  };
8779
8753
  } & {
@@ -25312,6 +25286,37 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
25312
25286
  } & {
25313
25287
  "/runs/:id/worker-destroy": {
25314
25288
  $post: {
25289
+ output: {
25290
+ readonly code: "capacity_limit" | "denied_scope" | "incompatible_state" | "incomplete_cleanup" | "invalid_baseline" | "invalid_input" | "unauthenticated" | "unavailable_diff" | "unavailable_transport";
25291
+ readonly error: string;
25292
+ readonly modelChoices?: {
25293
+ runner: string;
25294
+ requestedModel: string;
25295
+ availableModels: {
25296
+ id: string;
25297
+ label: string;
25298
+ description: string;
25299
+ effortLevels?: ("high" | "low" | "max" | "medium" | "xhigh")[] | undefined;
25300
+ }[];
25301
+ otherRunners: string[];
25302
+ } | undefined;
25303
+ };
25304
+ outputFormat: "json";
25305
+ status: 400 | 401 | 403 | 409 | 503;
25306
+ input: {
25307
+ query: {
25308
+ [x: string]: string | string[];
25309
+ };
25310
+ } & {
25311
+ param: {
25312
+ id: string;
25313
+ };
25314
+ } & {
25315
+ json: {
25316
+ discardWork?: true | undefined;
25317
+ };
25318
+ };
25319
+ } | {
25315
25320
  output: {
25316
25321
  error: string;
25317
25322
  code?: "invalid_input" | undefined;
@@ -25397,37 +25402,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
25397
25402
  discardWork?: true | undefined;
25398
25403
  };
25399
25404
  };
25400
- } | {
25401
- output: {
25402
- readonly code: "capacity_limit" | "denied_scope" | "incompatible_state" | "incomplete_cleanup" | "invalid_baseline" | "invalid_input" | "unauthenticated" | "unavailable_diff" | "unavailable_transport";
25403
- readonly error: string;
25404
- readonly modelChoices?: {
25405
- runner: string;
25406
- requestedModel: string;
25407
- availableModels: {
25408
- id: string;
25409
- label: string;
25410
- description: string;
25411
- effortLevels?: ("high" | "low" | "max" | "medium" | "xhigh")[] | undefined;
25412
- }[];
25413
- otherRunners: string[];
25414
- } | undefined;
25415
- };
25416
- outputFormat: "json";
25417
- status: 400 | 401 | 403 | 409 | 503;
25418
- input: {
25419
- query: {
25420
- [x: string]: string | string[];
25421
- };
25422
- } & {
25423
- param: {
25424
- id: string;
25425
- };
25426
- } & {
25427
- json: {
25428
- discardWork?: true | undefined;
25429
- };
25430
- };
25431
25405
  };
25432
25406
  };
25433
25407
  } & {