@things-factory/ai-client-base 10.1.282 → 10.1.290
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-server/service/assistant/registry-assistant.d.ts +2 -0
- package/dist-server/service/assistant/registry-assistant.js +3 -1
- package/dist-server/service/providers/claude-code.d.ts +1 -1
- package/dist-server/service/providers/claude-code.js +3 -2
- package/dist-server/service/testing/tool-call-context.d.ts +2 -0
- package/dist-server/service/testing/tool-call-context.js +2 -0
- package/dist-server/service/tool-registry/types.d.ts +13 -0
- package/package.json +5 -5
|
@@ -76,6 +76,8 @@ export interface RegistryAssistantInput {
|
|
|
76
76
|
* rested on from the same digest the audit keeps, so the two cannot describe one call differently.
|
|
77
77
|
*/
|
|
78
78
|
onToolCall?: (record: ToolCallRecord) => void;
|
|
79
|
+
/** Where a tool's progress goes while the person waits (ToolCallContext.progress). */
|
|
80
|
+
progress?: (text: string) => void;
|
|
79
81
|
/** Set for an unattended run; tools and recorders see it as `context.run`. */
|
|
80
82
|
run?: UnattendedRunRef; /** The stored conversation of this turn; tools see it as `context.conversation`. The caller's value, never the client's. */
|
|
81
83
|
conversation?: {
|
|
@@ -56,7 +56,9 @@ async function registryAssistantChat(input) {
|
|
|
56
56
|
t: input.t ?? translate_js_1.defaultValueTranslate,
|
|
57
57
|
attachments: input.attachments ?? [],
|
|
58
58
|
...(input.run ? { run: input.run } : {}),
|
|
59
|
-
...(input.conversation?.id ? { conversation: { id: input.conversation.id } } : {})
|
|
59
|
+
...(input.conversation?.id ? { conversation: { id: input.conversation.id } } : {}),
|
|
60
|
+
...(input.progress ? { progress: input.progress } : {}),
|
|
61
|
+
...(input.toolAccess ? { access: input.toolAccess } : {})
|
|
60
62
|
};
|
|
61
63
|
const result = await (0, assistant_chat_js_1.assistantChat)({
|
|
62
64
|
initialConversation: messages,
|
|
@@ -29,7 +29,7 @@ export interface ClaudeCodeRunner {
|
|
|
29
29
|
* The `claude` CLI started in a folder, as every caller on this server starts it -- this provider, and the figure agent
|
|
30
30
|
* that runs it with the figure MCP server (figure-service).
|
|
31
31
|
*/
|
|
32
|
-
export declare function startClaudeCode(args: string[], cwd: string): ChildProcessWithoutNullStreams;
|
|
32
|
+
export declare function startClaudeCode(args: string[], cwd: string, env?: NodeJS.ProcessEnv): ChildProcessWithoutNullStreams;
|
|
33
33
|
/**
|
|
34
34
|
* Offered only where it can answer and where it belongs: a development server whose machine has the `claude` CLI
|
|
35
35
|
* logged in. A production server is never one (NODE_ENV production), and has no logged-in CLI either.
|
|
@@ -43,12 +43,13 @@ const bin = () => process.env.AI_CLAUDE_CODE_BIN || 'claude';
|
|
|
43
43
|
* The `claude` CLI started in a folder, as every caller on this server starts it -- this provider, and the figure agent
|
|
44
44
|
* that runs it with the figure MCP server (figure-service).
|
|
45
45
|
*/
|
|
46
|
-
function startClaudeCode(args, cwd) {
|
|
46
|
+
function startClaudeCode(args, cwd, env = process.env) {
|
|
47
47
|
/*
|
|
48
48
|
MCP servers named by --mcp-config connect without blocking in print mode, and the first turn could start before
|
|
49
49
|
the tools were listed: the model wrote a call as words and ended (2026-11-14). Waiting costs nothing without one.
|
|
50
|
+
`env` is what the CLI -- and the MCP servers it starts -- may read; the server's own when not narrowed.
|
|
50
51
|
*/
|
|
51
|
-
return (0, child_process_1.spawn)(bin(), args, { cwd, stdio: ['pipe', 'pipe', 'pipe'], env: { ...
|
|
52
|
+
return (0, child_process_1.spawn)(bin(), args, { cwd, stdio: ['pipe', 'pipe', 'pipe'], env: { ...env, MCP_CONNECTION_NONBLOCKING: 'false' } });
|
|
52
53
|
}
|
|
53
54
|
const run = (args, input, cwd, signal) => new Promise((resolve, reject) => {
|
|
54
55
|
const child = startClaudeCode(args, cwd);
|
|
@@ -12,5 +12,7 @@ export interface ToolCallContextFixtureInput {
|
|
|
12
12
|
attachments?: ToolAttachment[];
|
|
13
13
|
/** The unattended run the call belongs to. Absent: a turn of a conversation. */
|
|
14
14
|
run?: UnattendedRunRef;
|
|
15
|
+
/** The conversation's tool gate. Absent: the door was given none. */
|
|
16
|
+
access?: (door: string) => Promise<boolean>;
|
|
15
17
|
}
|
|
16
18
|
export declare function toolCallContextFixture(input?: ToolCallContextFixtureInput): ToolCallContext;
|
|
@@ -75,6 +75,19 @@ export interface ToolCallContext {
|
|
|
75
75
|
conversation?: {
|
|
76
76
|
id: string;
|
|
77
77
|
};
|
|
78
|
+
/**
|
|
79
|
+
* Tells the person waiting what a long call is doing now -- "Building piece 3 of 7: left leg" (2026-11-13: a figure
|
|
80
|
+
* built piece by piece took minutes behind three dots). Said in the request's language (`t`); shown beside the
|
|
81
|
+
* waiting line and gone with the answer. Absent where nobody waits for it.
|
|
82
|
+
*/
|
|
83
|
+
progress?: (text: string) => void;
|
|
84
|
+
/**
|
|
85
|
+
* Whether this caller passes a GraphQL door (`'Query.figures'`) -- the conversation's own tool gate (`toolAccess`),
|
|
86
|
+
* the one that chose which tools this turn offers. A tool that hands work on to something that reaches the
|
|
87
|
+
* application in the caller's name (figure's MCP agent) asks it which doors that work may go through, never a copy
|
|
88
|
+
* of it. Absent where the door was given no gate: then no door is passed.
|
|
89
|
+
*/
|
|
90
|
+
access?: (door: string) => Promise<boolean>;
|
|
78
91
|
}
|
|
79
92
|
export interface ToolCallMode {
|
|
80
93
|
kind: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/ai-client-base",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.290",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"config",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@anthropic-ai/sdk": "^0.40.0",
|
|
40
40
|
"@google/generative-ai": "^0.24.0",
|
|
41
|
-
"@things-factory/auth-base": "^10.1.
|
|
41
|
+
"@things-factory/auth-base": "^10.1.290",
|
|
42
42
|
"@things-factory/env": "^10.1.281",
|
|
43
|
-
"@things-factory/setting-base": "^10.1.
|
|
44
|
-
"@things-factory/shell": "^10.1.
|
|
43
|
+
"@things-factory/setting-base": "^10.1.290",
|
|
44
|
+
"@things-factory/shell": "^10.1.290",
|
|
45
45
|
"openai": "^4.0.0"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "b3d769457fc4976b73726bb1556b5036351f1b10"
|
|
48
48
|
}
|