@things-factory/ai-client-base 10.1.280 → 10.1.282
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/agent/agent-directory.js +1 -1
- package/dist-server/service/agent/agent-settings-save.js +3 -2
- package/dist-server/service/agent/agent-spec.d.ts +11 -2
- package/dist-server/service/agent/agent-spec.js +23 -2
- package/dist-server/service/agent/ai-client-for.js +4 -1
- package/dist-server/service/agent/ai-usage.d.ts +1 -1
- package/dist-server/service/agent/ai-usage.js +1 -1
- package/dist-server/service/agent/provider-models.js +5 -2
- package/dist-server/service/agentic-loop/agentic-loop.d.ts +9 -3
- package/dist-server/service/agentic-loop/agentic-loop.js +9 -2
- package/dist-server/service/assistant/abort-notice.d.ts +5 -0
- package/dist-server/service/assistant/abort-notice.js +10 -1
- package/dist-server/service/assistant/assistant-chat.js +1 -1
- package/dist-server/service/assistant/registry-assistant.d.ts +1 -1
- package/dist-server/service/assistant/registry-assistant.js +2 -24
- package/dist-server/service/providers/anthropic.d.ts +4 -1
- package/dist-server/service/providers/anthropic.js +16 -61
- package/dist-server/service/providers/claude-code-tools-mcp.d.ts +3 -0
- package/dist-server/service/providers/claude-code-tools-mcp.js +56 -0
- package/dist-server/service/providers/claude-code.d.ts +38 -0
- package/dist-server/service/providers/claude-code.js +322 -0
- package/dist-server/service/providers/common.d.ts +20 -0
- package/dist-server/service/providers/common.js +52 -0
- package/dist-server/service/providers/gemini.js +4 -26
- package/dist-server/service/providers/index.d.ts +2 -0
- package/dist-server/service/providers/index.js +6 -1
- package/dist-server/service/providers/openai.js +37 -48
- package/dist-server/service/tool-registry/index.d.ts +2 -1
- package/dist-server/service/tool-registry/index.js +4 -1
- package/dist-server/service/tool-registry/registry.d.ts +2 -0
- package/dist-server/service/tool-registry/registry.js +9 -0
- package/dist-server/service/tool-registry/run-tool.d.ts +15 -0
- package/dist-server/service/tool-registry/run-tool.js +37 -0
- package/package.json +6 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.digestOf = exports.recordToolCall = exports.clearToolCallRecorders = exports.registerToolCallRecorder = exports.defaultValueTranslate = exports.getToolRegistryWarnings = exports.clearToolRegistry = exports.getCategorySpecs = exports.hasTool = exports.getToolKind = exports.findToolSpec = exports.getCategoryGuidance = exports.getToolSpecsFor = exports.getAllToolSpecs = exports.getToolCategories = exports.registerToolCategory = void 0;
|
|
3
|
+
exports.runRegisteredTool = exports.digestOf = exports.recordToolCall = exports.clearToolCallRecorders = exports.registerToolCallRecorder = exports.defaultValueTranslate = exports.getToolRegistryWarnings = exports.clearToolRegistry = exports.getCategorySpecs = exports.hasTool = exports.getToolKind = exports.findToolCategory = exports.findToolSpec = exports.getCategoryGuidance = exports.getToolSpecsFor = exports.getAllToolSpecs = exports.getToolCategories = exports.registerToolCategory = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Tool Registry — board-ai 의 외부 도메인 LLM tool 노출 plugin point.
|
|
6
6
|
*
|
|
@@ -13,6 +13,7 @@ Object.defineProperty(exports, "getAllToolSpecs", { enumerable: true, get: funct
|
|
|
13
13
|
Object.defineProperty(exports, "getToolSpecsFor", { enumerable: true, get: function () { return registry_1.getToolSpecsFor; } });
|
|
14
14
|
Object.defineProperty(exports, "getCategoryGuidance", { enumerable: true, get: function () { return registry_1.getCategoryGuidance; } });
|
|
15
15
|
Object.defineProperty(exports, "findToolSpec", { enumerable: true, get: function () { return registry_1.findToolSpec; } });
|
|
16
|
+
Object.defineProperty(exports, "findToolCategory", { enumerable: true, get: function () { return registry_1.findToolCategory; } });
|
|
16
17
|
Object.defineProperty(exports, "getToolKind", { enumerable: true, get: function () { return registry_1.getToolKind; } });
|
|
17
18
|
Object.defineProperty(exports, "hasTool", { enumerable: true, get: function () { return registry_1.hasTool; } });
|
|
18
19
|
Object.defineProperty(exports, "getCategorySpecs", { enumerable: true, get: function () { return registry_1.getCategorySpecs; } });
|
|
@@ -25,4 +26,6 @@ Object.defineProperty(exports, "registerToolCallRecorder", { enumerable: true, g
|
|
|
25
26
|
Object.defineProperty(exports, "clearToolCallRecorders", { enumerable: true, get: function () { return call_recorder_1.clearToolCallRecorders; } });
|
|
26
27
|
Object.defineProperty(exports, "recordToolCall", { enumerable: true, get: function () { return call_recorder_1.recordToolCall; } });
|
|
27
28
|
Object.defineProperty(exports, "digestOf", { enumerable: true, get: function () { return call_recorder_1.digestOf; } });
|
|
29
|
+
var run_tool_1 = require("./run-tool");
|
|
30
|
+
Object.defineProperty(exports, "runRegisteredTool", { enumerable: true, get: function () { return run_tool_1.runRegisteredTool; } });
|
|
28
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -87,6 +87,8 @@ export declare function getCategoryGuidance(filter: ToolCategoryFilter): string[
|
|
|
87
87
|
* tool name 으로 spec 검색. 없으면 undefined.
|
|
88
88
|
*/
|
|
89
89
|
export declare function findToolSpec(name: string, filter?: ToolCategoryFilter): ToolSpec | undefined;
|
|
90
|
+
/** The name of the category a tool is registered in; undefined for a tool not registered or not allowed. */
|
|
91
|
+
export declare function findToolCategory(name: string, filter?: ToolCategoryFilter): string | undefined;
|
|
90
92
|
/**
|
|
91
93
|
* tool name 의 카테고리 (read/write/action/external). 미등록 tool 은 undefined.
|
|
92
94
|
* assistant.ts 의 isReadTool / isWriteTool / isActionTool 이 이 함수에 위임할 수 있다.
|
|
@@ -7,6 +7,7 @@ exports.getAllToolSpecs = getAllToolSpecs;
|
|
|
7
7
|
exports.getToolSpecsFor = getToolSpecsFor;
|
|
8
8
|
exports.getCategoryGuidance = getCategoryGuidance;
|
|
9
9
|
exports.findToolSpec = findToolSpec;
|
|
10
|
+
exports.findToolCategory = findToolCategory;
|
|
10
11
|
exports.getToolKind = getToolKind;
|
|
11
12
|
exports.hasTool = hasTool;
|
|
12
13
|
exports.getCategorySpecs = getCategorySpecs;
|
|
@@ -157,6 +158,14 @@ function findToolSpec(name, filter) {
|
|
|
157
158
|
}
|
|
158
159
|
return undefined;
|
|
159
160
|
}
|
|
161
|
+
/** The name of the category a tool is registered in; undefined for a tool not registered or not allowed. */
|
|
162
|
+
function findToolCategory(name, filter) {
|
|
163
|
+
for (const [catName, cat] of categories) {
|
|
164
|
+
if (allowed(catName, filter) && cat.specs.some(s => s.name === name))
|
|
165
|
+
return catName;
|
|
166
|
+
}
|
|
167
|
+
return undefined;
|
|
168
|
+
}
|
|
160
169
|
/**
|
|
161
170
|
* tool name 의 카테고리 (read/write/action/external). 미등록 tool 은 undefined.
|
|
162
171
|
* assistant.ts 의 isReadTool / isWriteTool / isActionTool 이 이 함수에 위임할 수 있다.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ToolCallRecord } from './call-recorder';
|
|
2
|
+
import type { ToolCallContext, ToolSpec } from './types';
|
|
3
|
+
export interface RegisteredToolRun {
|
|
4
|
+
spec: ToolSpec;
|
|
5
|
+
/** The category it was offered from, as the record names it. */
|
|
6
|
+
category: string;
|
|
7
|
+
args: Record<string, any>;
|
|
8
|
+
/** What the builder is handed. */
|
|
9
|
+
context: any;
|
|
10
|
+
/** What the recorders are handed; the builder's context when absent. */
|
|
11
|
+
recordContext?: ToolCallContext;
|
|
12
|
+
/** Each call's digest as the recorders get it - an unattended run lists the reads its draft rested on. */
|
|
13
|
+
onToolCall?: (record: ToolCallRecord) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function runRegisteredTool({ spec, category, args, context, recordContext, onToolCall }: RegisteredToolRun): Promise<any>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runRegisteredTool = runRegisteredTool;
|
|
4
|
+
/*
|
|
5
|
+
* One registered tool run, and the run handed to the recorders (2026-11-14).
|
|
6
|
+
*
|
|
7
|
+
* Every conversation that runs a registered tool runs it here: the assistant's registry door, and board-ai, whose
|
|
8
|
+
* registered read and external tools ran unrecorded -- an application's audit saw a call through one door and missed
|
|
9
|
+
* the same call through the other. A run is recorded whether it answered or threw; a throw goes on to the loop, which
|
|
10
|
+
* answers it to the model.
|
|
11
|
+
*/
|
|
12
|
+
const call_recorder_1 = require("./call-recorder");
|
|
13
|
+
async function runRegisteredTool({ spec, category, args, context, recordContext, onToolCall }) {
|
|
14
|
+
const started = Date.now();
|
|
15
|
+
const recorded = async (outcome) => {
|
|
16
|
+
const run = { tool: spec.name, category, args, ...outcome, durationMs: Date.now() - started };
|
|
17
|
+
if (onToolCall) {
|
|
18
|
+
try {
|
|
19
|
+
onToolCall((0, call_recorder_1.digestOf)(run));
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
console.warn(`[tool-registry] onToolCall failed for ${spec.name}:`, e?.message ?? e);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
await (0, call_recorder_1.recordToolCall)(run, recordContext ?? context);
|
|
26
|
+
};
|
|
27
|
+
try {
|
|
28
|
+
const result = await spec.builder(args, context);
|
|
29
|
+
await recorded({ result });
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
await recorded({ error });
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=run-tool.js.map
|
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.282",
|
|
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.
|
|
42
|
-
"@things-factory/env": "^10.1.
|
|
43
|
-
"@things-factory/setting-base": "^10.1.
|
|
44
|
-
"@things-factory/shell": "^10.1.
|
|
41
|
+
"@things-factory/auth-base": "^10.1.282",
|
|
42
|
+
"@things-factory/env": "^10.1.281",
|
|
43
|
+
"@things-factory/setting-base": "^10.1.282",
|
|
44
|
+
"@things-factory/shell": "^10.1.282",
|
|
45
45
|
"openai": "^4.0.0"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "6a232e670bdb52e1420b1d33cdeeb37ceb0f26b8"
|
|
48
48
|
}
|