@cat-factory/server 0.111.0 → 0.112.0

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.
@@ -4,9 +4,10 @@ import type { AppEnv } from '../../http/env.js';
4
4
  * Workspace-scoped implementation-fork decision endpoints. Before the Coder writes code the
5
5
  * read-only proposer surfaces materially different ways to implement the task and the run
6
6
  * parks; these endpoints let a human read the surfaced approaches and CHOOSE one (a proposed
7
- * fork or their own free-text approach). Choosing re-runs the Coder with the chosen approach
8
- * folded in as a binding directive. The read returns null when no coder step carries fork
9
- * state. Chat is added in a later slice. Mounted under `/workspaces/:workspaceId`.
7
+ * fork or their own free-text approach) or CHAT about them before deciding. Choosing re-runs the
8
+ * Coder with the chosen approach folded in as a binding directive; a chat message is answered by
9
+ * an inline grounded LLM in the durable driver (the reply arrives via the execution stream). The
10
+ * read returns null when no coder step carries fork state. Mounted under `/workspaces/:workspaceId`.
10
11
  */
11
12
  export declare function forkDecisionController(): Hono<AppEnv>;
12
13
  //# sourceMappingURL=ForkDecisionController.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ForkDecisionController.d.ts","sourceRoot":"","sources":["../../../src/modules/forkDecision/ForkDecisionController.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAG/C;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAAC,MAAM,CAAC,CAyBrD"}
1
+ {"version":3,"file":"ForkDecisionController.d.ts","sourceRoot":"","sources":["../../../src/modules/forkDecision/ForkDecisionController.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAG/C;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAAC,MAAM,CAAC,CAuCrD"}
@@ -1,4 +1,4 @@
1
- import { chooseForkContract, getForkDecisionContract } from '@cat-factory/contracts';
1
+ import { chooseForkContract, forkChatContract, getForkDecisionContract, } from '@cat-factory/contracts';
2
2
  import { buildHonoRoute } from '@toad-contracts/hono';
3
3
  import { Hono } from 'hono';
4
4
  import { runWithInitiator } from '../../github/runInitiatorContext.js';
@@ -7,9 +7,10 @@ import { param } from '../../http/params.js';
7
7
  * Workspace-scoped implementation-fork decision endpoints. Before the Coder writes code the
8
8
  * read-only proposer surfaces materially different ways to implement the task and the run
9
9
  * parks; these endpoints let a human read the surfaced approaches and CHOOSE one (a proposed
10
- * fork or their own free-text approach). Choosing re-runs the Coder with the chosen approach
11
- * folded in as a binding directive. The read returns null when no coder step carries fork
12
- * state. Chat is added in a later slice. Mounted under `/workspaces/:workspaceId`.
10
+ * fork or their own free-text approach) or CHAT about them before deciding. Choosing re-runs the
11
+ * Coder with the chosen approach folded in as a binding directive; a chat message is answered by
12
+ * an inline grounded LLM in the durable driver (the reply arrives via the execution stream). The
13
+ * read returns null when no coder step carries fork state. Mounted under `/workspaces/:workspaceId`.
13
14
  */
14
15
  export function forkDecisionController() {
15
16
  const app = new Hono();
@@ -20,6 +21,17 @@ export function forkDecisionController() {
20
21
  .executionService.getForkDecision(param(c, 'workspaceId'), c.req.valid('param').executionId);
21
22
  return c.json(state, 200);
22
23
  });
24
+ // Send a grounded chat message about the surfaced forks. The reply is computed inline in the
25
+ // durable driver (off this request) and delivered via the execution stream; the response is the
26
+ // immediate `answering` state. Runs under the acting user's ambient context so an inline
27
+ // subscription/local model served through a per-run activation can lease the initiator's credential.
28
+ buildHonoRoute(app, forkChatContract, async (c) => {
29
+ const { executionId } = c.req.valid('param');
30
+ const input = c.req.valid('json');
31
+ const userId = c.get('user')?.id;
32
+ const state = await runWithInitiator(userId, () => c.get('container').executionService.forkChat(param(c, 'workspaceId'), executionId, input));
33
+ return c.json(state, 200);
34
+ });
23
35
  // Choose an implementation approach (a proposed fork id or a custom approach) — the Coder
24
36
  // then runs with it folded in. Runs under the acting user's ambient context so the resumed
25
37
  // run's container work (clone/push) uses their per-user credentials where applicable.
@@ -1 +1 @@
1
- {"version":3,"file":"ForkDecisionController.js","sourceRoot":"","sources":["../../../src/modules/forkDecision/ForkDecisionController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AAEtE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE5C;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB;IACpC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAU,CAAA;IAE9B,8EAA8E;IAC9E,cAAc,CAAC,GAAG,EAAE,uBAAuB,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;QACvD,MAAM,KAAK,GAAG,MAAM,CAAC;aAClB,GAAG,CAAC,WAAW,CAAC;aAChB,gBAAgB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAA;QAC9F,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IAC3B,CAAC,CAAC,CAAA;IAEF,0FAA0F;IAC1F,2FAA2F;IAC3F,sFAAsF;IACtF,cAAc,CAAC,GAAG,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;QAClD,MAAM,EAAE,WAAW,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAC5C,MAAM,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QACjC,MAAM,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,CAAA;QAChC,MAAM,KAAK,GAAG,MAAM,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,CAChD,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,gBAAgB,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,CAC5F,CAAA;QACD,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IAC3B,CAAC,CAAC,CAAA;IAEF,OAAO,GAAG,CAAA;AACZ,CAAC"}
1
+ {"version":3,"file":"ForkDecisionController.js","sourceRoot":"","sources":["../../../src/modules/forkDecision/ForkDecisionController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AAEtE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE5C;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB;IACpC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAU,CAAA;IAE9B,8EAA8E;IAC9E,cAAc,CAAC,GAAG,EAAE,uBAAuB,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;QACvD,MAAM,KAAK,GAAG,MAAM,CAAC;aAClB,GAAG,CAAC,WAAW,CAAC;aAChB,gBAAgB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CA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D,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,gBAAgB,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,CAC5F,CAAA;QACD,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IAC3B,CAAC,CAAC,CAAA;IAEF,OAAO,GAAG,CAAA;AACZ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cat-factory/server",
3
- "version": "0.111.0",
3
+ "version": "0.112.0",
4
4
  "description": "Runtime-neutral HTTP layer for the Agent Architecture Board: the Hono controllers, middleware (auth/authz/CORS/error), request helpers and the gateway seams shared by every deployment facade (Cloudflare Worker, Node service).",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,13 +30,13 @@
30
30
  "hono": "^4.12.27",
31
31
  "pino": "^10.3.1",
32
32
  "valibot": "^1.4.2",
33
- "@cat-factory/agents": "0.53.6",
34
- "@cat-factory/contracts": "0.126.0",
35
- "@cat-factory/integrations": "0.81.5",
36
- "@cat-factory/kernel": "0.121.1",
37
- "@cat-factory/orchestration": "0.105.6",
38
- "@cat-factory/prompt-fragments": "0.13.12",
39
- "@cat-factory/spend": "0.12.15"
33
+ "@cat-factory/agents": "0.54.0",
34
+ "@cat-factory/integrations": "0.81.6",
35
+ "@cat-factory/contracts": "0.127.0",
36
+ "@cat-factory/kernel": "0.121.2",
37
+ "@cat-factory/orchestration": "0.106.0",
38
+ "@cat-factory/prompt-fragments": "0.13.13",
39
+ "@cat-factory/spend": "0.12.16"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/node": "^26.1.0",