@steerable/agent-client 0.7.1 → 0.7.4

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/client.d.ts CHANGED
@@ -23,6 +23,14 @@ export interface LocalClientOptions {
23
23
  hasWindow?: () => boolean;
24
24
  env?: NodeJS.ProcessEnv;
25
25
  }
26
+ /**
27
+ * The CLI passes `{ answers, unattended }` while a typed reply is already the
28
+ * answer map. Unwrap one level so question ids stay the keys the tool stores.
29
+ */
30
+ export declare function normalizeAskReply(answer: unknown): {
31
+ answers: Record<string, unknown>;
32
+ unattended?: boolean;
33
+ };
26
34
  /** Opens one in-process host and exposes it as the CLI/TUI client. */
27
35
  export declare function createLocalClient(options?: LocalClientOptions): Promise<AgentClient>;
28
36
  /** Chat ids whose write lock is held by another process. */
package/dist/client.js CHANGED
@@ -32,6 +32,23 @@ function queue() {
32
32
  },
33
33
  };
34
34
  }
35
+ /**
36
+ * The CLI passes `{ answers, unattended }` while a typed reply is already the
37
+ * answer map. Unwrap one level so question ids stay the keys the tool stores.
38
+ */
39
+ export function normalizeAskReply(answer) {
40
+ const body = answer && typeof answer === 'object' && !Array.isArray(answer)
41
+ ? answer
42
+ : {};
43
+ const nested = body.answers;
44
+ const answers = nested && typeof nested === 'object' && !Array.isArray(nested)
45
+ ? nested
46
+ : body;
47
+ return {
48
+ answers,
49
+ ...(body.unattended === true ? { unattended: true } : {}),
50
+ };
51
+ }
35
52
  /** Opens one in-process host and exposes it as the CLI/TUI client. */
36
53
  export async function createLocalClient(options = {}) {
37
54
  const env = options.env ?? process.env;
@@ -67,8 +84,12 @@ export async function createLocalClient(options = {}) {
67
84
  return runtime.approvalBridge.decide({ requestId, kind, reason: reason ?? '' }).ok;
68
85
  },
69
86
  async answerAsk(requestId, answer) {
70
- const answers = answer && typeof answer === 'object' ? answer : {};
71
- return runtime.askUserBridge.answer({ requestId, answers }).ok;
87
+ const reply = normalizeAskReply(answer);
88
+ return runtime.askUserBridge.answer({
89
+ requestId,
90
+ answers: reply.answers,
91
+ ...(reply.unattended ? { unattended: true } : {}),
92
+ }).ok;
72
93
  },
73
94
  async close() {
74
95
  events.close();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steerable/agent-client",
3
- "version": "0.7.1",
3
+ "version": "0.7.4",
4
4
  "description": "In-process client for a Steerable host: HTTP-shaped requests, turn streams, and approval replies.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://steerableframework.com/",
@@ -33,8 +33,8 @@
33
33
  "node": ">=26"
34
34
  },
35
35
  "dependencies": {
36
- "@steerable/agent-protocol": "0.7.1",
37
- "@steerable/agent-shell": "0.7.1"
36
+ "@steerable/agent-protocol": "0.7.4",
37
+ "@steerable/agent-shell": "0.7.4"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/node": "^22.10.5",