@excitedjs/agent-runtime-claude-code 0.7.0-alpha.g3180b18cd009 → 0.7.0-alpha.g4a45d478cc7c
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/tool-display.d.ts +9 -7
- package/dist/tool-display.d.ts.map +1 -1
- package/dist/tool-display.js +37 -18
- package/dist/tool-display.js.map +1 -1
- package/package.json +3 -3
package/dist/tool-display.d.ts
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* How claude's built-in tools present themselves on a display line.
|
|
3
3
|
*
|
|
4
|
-
* A tool row wants
|
|
4
|
+
* A tool row wants a few neutral facts beside the tool's name: what kind of
|
|
5
5
|
* thing the call does (`action`), the one line claude's own UI leads with
|
|
6
6
|
* (`summary`), the member of the input that has a notation of its own
|
|
7
|
-
* (`invocation`)
|
|
8
|
-
* from the tool's
|
|
9
|
-
* (`sdk-tools.d.ts` of `@anthropic-ai/claude-agent-sdk`;
|
|
10
|
-
* CLI's observed wire), so this module is the only place in
|
|
11
|
-
* knows a built-in tool's field names. A tool this table
|
|
12
|
-
* every MCP tool included — gets `null` for
|
|
7
|
+
* (`invocation`) and which notation that is (`invocationLanguage`), and the
|
|
8
|
+
* items a file tool is about (`items`). All of them come from the tool's
|
|
9
|
+
* declared input schema (`sdk-tools.d.ts` of `@anthropic-ai/claude-agent-sdk`;
|
|
10
|
+
* `Skill` from the CLI's observed wire), so this module is the only place in
|
|
11
|
+
* the runtime that knows a built-in tool's field names. A tool this table
|
|
12
|
+
* does not know — every MCP tool included — gets `null` for each and shows as
|
|
13
|
+
* its name.
|
|
13
14
|
*/
|
|
14
15
|
import type { JsonValue, RuntimeToolAction } from '@excitedjs/dreamux-types';
|
|
15
16
|
export interface ToolDisplay {
|
|
16
17
|
readonly action: RuntimeToolAction | null;
|
|
17
18
|
readonly summary: string | null;
|
|
18
19
|
readonly invocation: string | null;
|
|
20
|
+
readonly invocationLanguage: string | null;
|
|
19
21
|
readonly items: readonly string[];
|
|
20
22
|
}
|
|
21
23
|
export declare function toolDisplay(name: string | null | undefined, args: JsonValue | null): ToolDisplay;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-display.d.ts","sourceRoot":"","sources":["../src/tool-display.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tool-display.d.ts","sourceRoot":"","sources":["../src/tool-display.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7E,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAUD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,WAAW,CAkDhG"}
|
package/dist/tool-display.js
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* How claude's built-in tools present themselves on a display line.
|
|
3
3
|
*
|
|
4
|
-
* A tool row wants
|
|
4
|
+
* A tool row wants a few neutral facts beside the tool's name: what kind of
|
|
5
5
|
* thing the call does (`action`), the one line claude's own UI leads with
|
|
6
6
|
* (`summary`), the member of the input that has a notation of its own
|
|
7
|
-
* (`invocation`)
|
|
8
|
-
* from the tool's
|
|
9
|
-
* (`sdk-tools.d.ts` of `@anthropic-ai/claude-agent-sdk`;
|
|
10
|
-
* CLI's observed wire), so this module is the only place in
|
|
11
|
-
* knows a built-in tool's field names. A tool this table
|
|
12
|
-
* every MCP tool included — gets `null` for
|
|
7
|
+
* (`invocation`) and which notation that is (`invocationLanguage`), and the
|
|
8
|
+
* items a file tool is about (`items`). All of them come from the tool's
|
|
9
|
+
* declared input schema (`sdk-tools.d.ts` of `@anthropic-ai/claude-agent-sdk`;
|
|
10
|
+
* `Skill` from the CLI's observed wire), so this module is the only place in
|
|
11
|
+
* the runtime that knows a built-in tool's field names. A tool this table
|
|
12
|
+
* does not know — every MCP tool included — gets `null` for each and shows as
|
|
13
|
+
* its name.
|
|
13
14
|
*/
|
|
14
|
-
const UNKNOWN = {
|
|
15
|
+
const UNKNOWN = {
|
|
16
|
+
action: null,
|
|
17
|
+
summary: null,
|
|
18
|
+
invocation: null,
|
|
19
|
+
invocationLanguage: null,
|
|
20
|
+
items: [],
|
|
21
|
+
};
|
|
15
22
|
export function toolDisplay(name, args) {
|
|
16
23
|
const input = inputRecord(args);
|
|
17
24
|
const field = (key) => {
|
|
@@ -26,6 +33,7 @@ export function toolDisplay(name, args) {
|
|
|
26
33
|
action: 'run',
|
|
27
34
|
summary: field('description') ?? firstLine(command),
|
|
28
35
|
invocation: command,
|
|
36
|
+
invocationLanguage: command === null ? null : name === 'Bash' ? 'bash' : 'powershell',
|
|
29
37
|
items: [],
|
|
30
38
|
};
|
|
31
39
|
}
|
|
@@ -39,30 +47,41 @@ export function toolDisplay(name, args) {
|
|
|
39
47
|
return fileTool('edit', field('notebook_path'));
|
|
40
48
|
case 'Grep':
|
|
41
49
|
case 'Glob':
|
|
42
|
-
return { action: 'search', summary: field('pattern')
|
|
50
|
+
return { ...UNKNOWN, action: 'search', summary: field('pattern') };
|
|
43
51
|
case 'WebSearch':
|
|
44
|
-
return { action: 'search', summary: field('query')
|
|
52
|
+
return { ...UNKNOWN, action: 'search', summary: field('query') };
|
|
45
53
|
case 'ToolSearch':
|
|
46
|
-
return {
|
|
54
|
+
return { ...UNKNOWN, summary: field('query') };
|
|
47
55
|
case 'WebFetch':
|
|
48
|
-
return {
|
|
56
|
+
return { ...UNKNOWN, summary: field('url') };
|
|
49
57
|
case 'Agent':
|
|
50
|
-
return {
|
|
58
|
+
return { ...UNKNOWN, summary: field('description'), invocation: field('prompt') };
|
|
51
59
|
case 'Skill':
|
|
52
|
-
return {
|
|
60
|
+
return { ...UNKNOWN, summary: field('skill') };
|
|
53
61
|
case 'TaskCreate':
|
|
54
|
-
return {
|
|
62
|
+
return { ...UNKNOWN, summary: field('subject') };
|
|
63
|
+
// REPL runs JavaScript with top-level await; a Workflow is a JavaScript
|
|
64
|
+
// script that begins with an exported `meta` literal.
|
|
55
65
|
case 'REPL':
|
|
56
|
-
return
|
|
66
|
+
return script('run', field('description'), field('code'));
|
|
57
67
|
case 'Workflow':
|
|
58
|
-
return
|
|
68
|
+
return script(null, field('name'), field('script'));
|
|
59
69
|
default:
|
|
60
70
|
return UNKNOWN;
|
|
61
71
|
}
|
|
62
72
|
}
|
|
63
73
|
/** A file tool is labelled by the one path it touches, which is also its one item. */
|
|
64
74
|
function fileTool(action, path) {
|
|
65
|
-
return { action, summary: path,
|
|
75
|
+
return { ...UNKNOWN, action, summary: path, items: path === null ? [] : [path] };
|
|
76
|
+
}
|
|
77
|
+
function script(action, summary, code) {
|
|
78
|
+
return {
|
|
79
|
+
...UNKNOWN,
|
|
80
|
+
action,
|
|
81
|
+
summary,
|
|
82
|
+
invocation: code,
|
|
83
|
+
invocationLanguage: code === null ? null : 'javascript',
|
|
84
|
+
};
|
|
66
85
|
}
|
|
67
86
|
function inputRecord(args) {
|
|
68
87
|
return args !== null && typeof args === 'object' && !Array.isArray(args)
|
package/dist/tool-display.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-display.js","sourceRoot":"","sources":["../src/tool-display.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tool-display.js","sourceRoot":"","sources":["../src/tool-display.ts"],"names":[],"mappings":"AAAA;;;;;;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AAsF;AACtF,SAAS,QAAQ,CAAC,MAAuB,EAAE,IAAmB;IAC5D,OAAO,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;AACnF,CAAC;AAED,SAAS,MAAM,CACb,MAAgC,EAChC,OAAsB,EACtB,IAAmB;IAEnB,OAAO;QACL,GAAG,OAAO;QACV,MAAM;QACN,OAAO;QACP,UAAU,EAAE,IAAI;QAChB,kBAAkB,EAAE,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY;KACxD,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,IAAsB;IACzC,OAAO,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QACtE,CAAC,CAAE,IAA4C;QAC/C,CAAC,CAAC,EAAE,CAAC;AACT,CAAC;AAED,SAAS,SAAS,CAAC,KAAoB;IACrC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAClE,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AACnC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@excitedjs/agent-runtime-claude-code",
|
|
3
|
-
"version": "0.7.0-alpha.
|
|
3
|
+
"version": "0.7.0-alpha.g4a45d478cc7c",
|
|
4
4
|
"description": "Built-in Claude Code Agent Runtime provider for Dreamux (alias builtin:claude-code). Implements the @excitedjs/dreamux-types AgentRuntimeProvider contract against a resident `claude` stream-json child; depends on @excitedjs/dreamux-types only, never on @excitedjs/dreamux core (issue excitedjs/dreamux#209).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"LICENSE"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@excitedjs/dreamux-types": "0.10.0-alpha.
|
|
36
|
-
"@excitedjs/dreamux-utils": "0.5.1-alpha.
|
|
35
|
+
"@excitedjs/dreamux-types": "0.10.0-alpha.g4a45d478cc7c",
|
|
36
|
+
"@excitedjs/dreamux-utils": "0.5.1-alpha.g4a45d478cc7c"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^22.10.0",
|