@hearsay-tools/squawk 0.18.0-pr4067.7757 → 0.18.0-pr4068.7759

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.
@@ -4608,6 +4608,19 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
4608
4608
  } & {
4609
4609
  "/repo/commit/:sha": {
4610
4610
  $get: {
4611
+ output: string;
4612
+ outputFormat: "text";
4613
+ status: import("hono/utils/http-status").ContentfulStatusCode;
4614
+ input: {
4615
+ query: {
4616
+ structured?: string | undefined;
4617
+ };
4618
+ } & {
4619
+ param: {
4620
+ sha: string;
4621
+ };
4622
+ };
4623
+ } | {
4611
4624
  output: {
4612
4625
  error: string;
4613
4626
  code?: "invalid_input" | undefined;
@@ -4671,19 +4684,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
4671
4684
  sha: string;
4672
4685
  };
4673
4686
  };
4674
- } | {
4675
- output: string;
4676
- outputFormat: "text";
4677
- status: import("hono/utils/http-status").ContentfulStatusCode;
4678
- input: {
4679
- query: {
4680
- structured?: string | undefined;
4681
- };
4682
- } & {
4683
- param: {
4684
- sha: string;
4685
- };
4686
- };
4687
4687
  };
4688
4688
  };
4689
4689
  } & {
@@ -18485,20 +18485,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
18485
18485
  } & {
18486
18486
  "/runs/:id/handoff": {
18487
18487
  $get: {
18488
- output: {
18489
- error: string;
18490
- };
18491
- outputFormat: "json";
18492
- status: 404;
18488
+ output: string;
18489
+ outputFormat: "text";
18490
+ status: 200;
18493
18491
  input: {
18494
18492
  param: {
18495
18493
  id: string;
18496
18494
  };
18497
18495
  };
18498
18496
  } | {
18499
- output: string;
18500
- outputFormat: "text";
18501
- status: 200;
18497
+ output: {
18498
+ error: string;
18499
+ };
18500
+ outputFormat: "json";
18501
+ status: 404;
18502
18502
  input: {
18503
18503
  param: {
18504
18504
  id: string;
@@ -18536,20 +18536,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
18536
18536
  } & {
18537
18537
  "/runs/:id/diff": {
18538
18538
  $get: {
18539
- output: {
18540
- error: string;
18541
- };
18542
- outputFormat: "json";
18543
- status: 404 | 409;
18539
+ output: string;
18540
+ outputFormat: "text";
18541
+ status: import("hono/utils/http-status").ContentfulStatusCode;
18544
18542
  input: {
18545
18543
  param: {
18546
18544
  id: string;
18547
18545
  };
18548
18546
  };
18549
18547
  } | {
18550
- output: string;
18551
- outputFormat: "text";
18552
- status: import("hono/utils/http-status").ContentfulStatusCode;
18548
+ output: {
18549
+ error: string;
18550
+ };
18551
+ outputFormat: "json";
18552
+ status: 404 | 409;
18553
18553
  input: {
18554
18554
  param: {
18555
18555
  id: string;
@@ -20567,6 +20567,19 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
20567
20567
  } & {
20568
20568
  "/repo/commit/:sha": {
20569
20569
  $get: {
20570
+ output: string;
20571
+ outputFormat: "text";
20572
+ status: import("hono/utils/http-status").ContentfulStatusCode;
20573
+ input: {
20574
+ query: {
20575
+ structured?: string | undefined;
20576
+ };
20577
+ } & {
20578
+ param: {
20579
+ sha: string;
20580
+ };
20581
+ };
20582
+ } | {
20570
20583
  output: {
20571
20584
  error: string;
20572
20585
  code?: "invalid_input" | undefined;
@@ -20630,19 +20643,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
20630
20643
  sha: string;
20631
20644
  };
20632
20645
  };
20633
- } | {
20634
- output: string;
20635
- outputFormat: "text";
20636
- status: import("hono/utils/http-status").ContentfulStatusCode;
20637
- input: {
20638
- query: {
20639
- structured?: string | undefined;
20640
- };
20641
- } & {
20642
- param: {
20643
- sha: string;
20644
- };
20645
- };
20646
20646
  };
20647
20647
  };
20648
20648
  } & {
@@ -34444,20 +34444,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
34444
34444
  } & {
34445
34445
  "/runs/:id/handoff": {
34446
34446
  $get: {
34447
- output: {
34448
- error: string;
34449
- };
34450
- outputFormat: "json";
34451
- status: 404;
34447
+ output: string;
34448
+ outputFormat: "text";
34449
+ status: 200;
34452
34450
  input: {
34453
34451
  param: {
34454
34452
  id: string;
34455
34453
  };
34456
34454
  };
34457
34455
  } | {
34458
- output: string;
34459
- outputFormat: "text";
34460
- status: 200;
34456
+ output: {
34457
+ error: string;
34458
+ };
34459
+ outputFormat: "json";
34460
+ status: 404;
34461
34461
  input: {
34462
34462
  param: {
34463
34463
  id: string;
@@ -34495,20 +34495,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
34495
34495
  } & {
34496
34496
  "/runs/:id/diff": {
34497
34497
  $get: {
34498
- output: {
34499
- error: string;
34500
- };
34501
- outputFormat: "json";
34502
- status: 404 | 409;
34498
+ output: string;
34499
+ outputFormat: "text";
34500
+ status: import("hono/utils/http-status").ContentfulStatusCode;
34503
34501
  input: {
34504
34502
  param: {
34505
34503
  id: string;
34506
34504
  };
34507
34505
  };
34508
34506
  } | {
34509
- output: string;
34510
- outputFormat: "text";
34511
- status: import("hono/utils/http-status").ContentfulStatusCode;
34507
+ output: {
34508
+ error: string;
34509
+ };
34510
+ outputFormat: "json";
34511
+ status: 404 | 409;
34512
34512
  input: {
34513
34513
  param: {
34514
34514
  id: string;
@@ -137,7 +137,7 @@ import { normalizeProjectTags, probeProjectStatus, toProjectListEntry, registerP
137
137
  import { mergeWriteWorkspaceUiState, readWorkspaceUiState } from '../workspace/ui-state.js';
138
138
  import { checkoutRepo } from './checkout.js';
139
139
  import { createProject, listGithubOwners } from './create-project.js';
140
- import { createWorkspaceRunFeed } from './workspace-run-feed.js';
140
+ import { createWorkspaceRunFeed, currentRecord } from './workspace-run-feed.js';
141
141
  import { mergeWriteProjectUiState, readUiState } from '../ui-state.js';
142
142
  import { expandTilde } from '../paths.js';
143
143
  import { isLoopbackHostHeader, normalizeHostname, resolveCapabilities } from './capabilities.js';
@@ -3332,12 +3332,12 @@ export function createApp(deps) {
3332
3332
  return streamSSENoBuffer(c, async (stream) => {
3333
3333
  const controller = new AbortController();
3334
3334
  const stop = () => controller.abort();
3335
- const onRun = (run) => {
3336
- if (run.id === id)
3337
- void stream.writeSSE({ event: 'run', data: JSON.stringify(run) });
3335
+ const onRun = (write) => {
3336
+ if (write.run.id === id)
3337
+ void stream.writeSSE({ event: 'run', data: JSON.stringify(currentRecord(store, write)) });
3338
3338
  };
3339
- store.on('run', onRun);
3340
- stream.onAbort(() => { stop(); store.off('run', onRun); });
3339
+ const unsubscribe = store.lifecycle.subscribe({ 'run.created': onRun, 'run.updated': onRun });
3340
+ stream.onAbort(() => { stop(); unsubscribe(); });
3341
3341
  const feed = subscribeRunFeed({ store, dataDir }, {
3342
3342
  projectId: c.get('project').id, runId: id, afterSeq: requestedAfter,
3343
3343
  ...(query.cursor ? { cursor: query.cursor } : {}),
@@ -3360,7 +3360,7 @@ export function createApp(deps) {
3360
3360
  }
3361
3361
  finally {
3362
3362
  stop();
3363
- store.off('run', onRun);
3363
+ unsubscribe();
3364
3364
  await feed;
3365
3365
  }
3366
3366
  });
@@ -3373,8 +3373,8 @@ export function createApp(deps) {
3373
3373
  .get('/events', (c) => {
3374
3374
  const { store } = c.get('project');
3375
3375
  return streamSSENoBuffer(c, async (stream) => {
3376
- const onRun = (run) => void stream.writeSSE({ event: 'run', data: JSON.stringify(run) });
3377
- const onDeleted = (id) => void stream.writeSSE({
3376
+ const onRun = (write) => void stream.writeSSE({ event: 'run', data: JSON.stringify(currentRecord(store, write)) });
3377
+ const onDeleted = ({ runId: id }) => void stream.writeSSE({
3378
3378
  event: 'run-deleted',
3379
3379
  data: JSON.stringify({ id }),
3380
3380
  });
@@ -3393,11 +3393,9 @@ export function createApp(deps) {
3393
3393
  }
3394
3394
  void stream.writeSSE({ event: 'usage', data: JSON.stringify(owned) });
3395
3395
  });
3396
- store.on('run', onRun);
3397
- store.on('deleted', onDeleted);
3396
+ const unsubscribe = store.lifecycle.subscribe({ 'run.created': onRun, 'run.updated': onRun, 'run.deleted': onDeleted });
3398
3397
  stream.onAbort(() => {
3399
- store.off('run', onRun);
3400
- store.off('deleted', onDeleted);
3398
+ unsubscribe();
3401
3399
  offUsage();
3402
3400
  });
3403
3401
  while (!stream.aborted) {