@ai-sdk/anthropic 3.0.19 → 3.0.21
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/CHANGELOG.md +12 -0
- package/dist/index.js +58 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +58 -26
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +57 -25
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +57 -25
- package/dist/internal/index.mjs.map +1 -1
- package/docs/05-anthropic.mdx +1096 -0
- package/package.json +8 -4
- package/src/__fixtures__/anthropic-tool-search-deferred-bm25.2.json +65 -0
- package/src/__fixtures__/anthropic-tool-search-deferred-bm25.chunks.txt +115 -0
- package/src/__fixtures__/anthropic-tool-search-deferred-regex.2.json +69 -0
- package/src/__fixtures__/anthropic-tool-search-deferred-regex.chunks.txt +119 -0
- package/src/anthropic-messages-language-model.test.ts +198 -0
- package/src/anthropic-messages-language-model.ts +38 -5
- package/src/tool/tool-search-bm25_20251119.ts +1 -0
- package/src/tool/tool-search-regex_20251119.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/anthropic",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.21",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -8,11 +8,15 @@
|
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"files": [
|
|
10
10
|
"dist/**/*",
|
|
11
|
+
"docs/**/*",
|
|
11
12
|
"src",
|
|
12
13
|
"CHANGELOG.md",
|
|
13
14
|
"README.md",
|
|
14
15
|
"internal.d.ts"
|
|
15
16
|
],
|
|
17
|
+
"directories": {
|
|
18
|
+
"doc": "./docs"
|
|
19
|
+
},
|
|
16
20
|
"exports": {
|
|
17
21
|
"./package.json": "./package.json",
|
|
18
22
|
".": {
|
|
@@ -36,8 +40,8 @@
|
|
|
36
40
|
"tsup": "^8",
|
|
37
41
|
"typescript": "5.8.3",
|
|
38
42
|
"zod": "3.25.76",
|
|
39
|
-
"@ai-
|
|
40
|
-
"@
|
|
43
|
+
"@vercel/ai-tsconfig": "0.0.0",
|
|
44
|
+
"@ai-sdk/test-server": "1.0.2"
|
|
41
45
|
},
|
|
42
46
|
"peerDependencies": {
|
|
43
47
|
"zod": "^3.25.76 || ^4.1.8"
|
|
@@ -62,7 +66,7 @@
|
|
|
62
66
|
"scripts": {
|
|
63
67
|
"build": "pnpm clean && tsup --tsconfig tsconfig.build.json",
|
|
64
68
|
"build:watch": "pnpm clean && tsup --watch --tsconfig tsconfig.build.json",
|
|
65
|
-
"clean": "del-cli dist *.tsbuildinfo",
|
|
69
|
+
"clean": "del-cli dist docs *.tsbuildinfo",
|
|
66
70
|
"lint": "eslint \"./**/*.ts*\"",
|
|
67
71
|
"type-check": "tsc --build",
|
|
68
72
|
"prettier-check": "prettier --check \"./**/*.ts*\"",
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"model": "claude-sonnet-4-5-20250929",
|
|
3
|
+
"id": "msg_01SyorFoaYHS6homn4ntwKWk",
|
|
4
|
+
"type": "message",
|
|
5
|
+
"role": "assistant",
|
|
6
|
+
"content": [
|
|
7
|
+
{
|
|
8
|
+
"type": "tool_search_tool_result",
|
|
9
|
+
"tool_use_id": "srvtoolu_01Daym2FbLXTL2hg6bVwCcoj",
|
|
10
|
+
"content": {
|
|
11
|
+
"type": "tool_search_tool_search_result",
|
|
12
|
+
"tool_references": [
|
|
13
|
+
{
|
|
14
|
+
"type": "tool_reference",
|
|
15
|
+
"tool_name": "executeEditorOperation"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"type": "text",
|
|
22
|
+
"text": "Perfect! I can see the current structure has one bulleted list item with the text \"hi\". Now I need to add a new bullet point with \"bye\" after it. Let me use the `executeEditorOperation` tool to insert a new bulleted list item."
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"type": "tool_use",
|
|
26
|
+
"id": "toolu_019oFKxH7xzoKZtBX1mBGHeJ",
|
|
27
|
+
"name": "executeEditorOperation",
|
|
28
|
+
"input": {
|
|
29
|
+
"noteId": "d10aa585-982b-4bd9-984e-420f9b3717f7",
|
|
30
|
+
"operations": [
|
|
31
|
+
{
|
|
32
|
+
"op": "insert_node",
|
|
33
|
+
"at": {
|
|
34
|
+
"type": "path",
|
|
35
|
+
"path": [
|
|
36
|
+
1
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"type": "bulletedListItem",
|
|
40
|
+
"text": "bye"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"caller": {
|
|
45
|
+
"type": "direct"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"stop_reason": "tool_use",
|
|
50
|
+
"stop_sequence": null,
|
|
51
|
+
"usage": {
|
|
52
|
+
"input_tokens": 1398,
|
|
53
|
+
"cache_creation_input_tokens": 0,
|
|
54
|
+
"cache_read_input_tokens": 0,
|
|
55
|
+
"cache_creation": {
|
|
56
|
+
"ephemeral_5m_input_tokens": 0,
|
|
57
|
+
"ephemeral_1h_input_tokens": 0
|
|
58
|
+
},
|
|
59
|
+
"output_tokens": 213,
|
|
60
|
+
"service_tier": "standard",
|
|
61
|
+
"server_tool_use": {
|
|
62
|
+
"web_search_requests": 0
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
{"type":"message_start","message":{"model":"claude-sonnet-4-5-20250929","id":"msg_01WUP4eZFC22KbkesuJGqVAw","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":879,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":5,"service_tier":"standard"}}}
|
|
2
|
+
{"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}
|
|
3
|
+
{"type":"ping"}
|
|
4
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"I'll help you with"}}
|
|
5
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" this"}}
|
|
6
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" task"}}
|
|
7
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":". Let me start by reading the note"}}
|
|
8
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" tree to see"}}
|
|
9
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" the current structure, and then search"}}
|
|
10
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" for the right tools to add a"}}
|
|
11
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" bullet"}}
|
|
12
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" point"}}
|
|
13
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"."}}
|
|
14
|
+
{"type":"content_block_stop","index":0}
|
|
15
|
+
{"type":"content_block_start","index":1,"content_block":{"type":"tool_use","id":"toolu_01U8pzAHj2vNdPCA2Kf8JjeN","name":"readNoteTree","input":{},"caller":{"type":"direct"}}}
|
|
16
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":""}}
|
|
17
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"{\"noteId\": \"d10aa585-982b"}}
|
|
18
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"-4bd9-984e-"}}
|
|
19
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"420f9b3717f7"}}
|
|
20
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"\"}"}}
|
|
21
|
+
{"type":"content_block_stop","index":1}
|
|
22
|
+
{"type":"content_block_start","index":2,"content_block":{"type":"server_tool_use","id":"srvtoolu_01FjZe9o4YXXJjGxLmfj44Rf","name":"tool_search_tool_bm25","input":{},"caller":{"type":"direct"}}}
|
|
23
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":""}}
|
|
24
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"{\"query\": \"ad"}}
|
|
25
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"d bullet"}}
|
|
26
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":" point insert"}}
|
|
27
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":" text"}}
|
|
28
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":" editor"}}
|
|
29
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\", \"limit\": 5"}}
|
|
30
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"}"}}
|
|
31
|
+
{"type":"content_block_stop","index":2}
|
|
32
|
+
{"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":879,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":177}}
|
|
33
|
+
{"type":"message_stop"}
|
|
34
|
+
{"type":"message_start","message":{"model":"claude-sonnet-4-5-20250929","id":"msg_014CbStN8SFzjGbDkZzTtD7i","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":1398,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}}
|
|
35
|
+
{"type":"content_block_start","index":0,"content_block":{"type":"tool_search_tool_result","tool_use_id":"srvtoolu_01FjZe9o4YXXJjGxLmfj44Rf","content":{"type":"tool_search_tool_search_result","tool_references":[{"type":"tool_reference","tool_name":"executeEditorOperation"}]}}}
|
|
36
|
+
{"type":"content_block_stop","index":0}
|
|
37
|
+
{"type":"content_block_start","index":1,"content_block":{"type":"text","text":""}}
|
|
38
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":"Perfect"}}
|
|
39
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":"! I can"}}
|
|
40
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" see the current"}}
|
|
41
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" note structure has"}}
|
|
42
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" one"}}
|
|
43
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" bull"}}
|
|
44
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":"eted list item with"}}
|
|
45
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" the"}}
|
|
46
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" text \"hi\". Now I nee"}}
|
|
47
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":"d to ad"}}
|
|
48
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":"d a"}}
|
|
49
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" new bullet with"}}
|
|
50
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" \"bye\" after it"}}
|
|
51
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":". Let me use"}}
|
|
52
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" the `"}}
|
|
53
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":"executeEditorOperation` tool"}}
|
|
54
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" to"}}
|
|
55
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" insert"}}
|
|
56
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" a"}}
|
|
57
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" new bull"}}
|
|
58
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":"eted list item."}}
|
|
59
|
+
{"type":"content_block_stop","index":1}
|
|
60
|
+
{"type":"content_block_start","index":2,"content_block":{"type":"tool_use","id":"toolu_01QoRrvXNv6w4vZSyo9cnxP2","name":"executeEditorOperation","input":{},"caller":{"type":"direct"}}}
|
|
61
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":""}}
|
|
62
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"{\"noteId\": \"d10aa"}}
|
|
63
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"585-982b-4bd9"}}
|
|
64
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"-984e-420f9b"}}
|
|
65
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"3717f7"}}
|
|
66
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\", \"operations\": [\n {\n \"op"}}
|
|
67
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\": \"insert_"}}
|
|
68
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"node"}}
|
|
69
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\",\n \"type"}}
|
|
70
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\": \"bulletedListItem\","}}
|
|
71
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\n \"text\": \"bye\","}}
|
|
72
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\n \"at"}}
|
|
73
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\": {\n \"type\": \""}}
|
|
74
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"path"}}
|
|
75
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\",\n \"path\": [1"}}
|
|
76
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"]\n }\n }"}}
|
|
77
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\n]"}}
|
|
78
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"}"}}
|
|
79
|
+
{"type":"content_block_stop","index":2}
|
|
80
|
+
{"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":1398,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":213,"server_tool_use":{"web_search_requests":0}}}
|
|
81
|
+
{"type":"message_stop"}
|
|
82
|
+
{"type":"message_start","message":{"model":"claude-sonnet-4-5-20250929","id":"msg_01XnBpTaw23kf2UnGUdkKfey","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":1639,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":6,"service_tier":"standard"}}}
|
|
83
|
+
{"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}
|
|
84
|
+
{"type":"ping"}
|
|
85
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Great! I've successfully complete"}}
|
|
86
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d the task. Here"}}
|
|
87
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"'s what I did:\n\n1."}}
|
|
88
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" **Read the note tree**:"}}
|
|
89
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" The"}}
|
|
90
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" note"}}
|
|
91
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" ha"}}
|
|
92
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d one"}}
|
|
93
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" bulleted list item containing"}}
|
|
94
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" \"hi\""}}
|
|
95
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n2. **Adde"}}
|
|
96
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d a"}}
|
|
97
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" new bullet**: I"}}
|
|
98
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" inserted a"}}
|
|
99
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" new bulleted list item with the"}}
|
|
100
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" text \"bye\" at"}}
|
|
101
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" position"}}
|
|
102
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" ["}}
|
|
103
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"1],"}}
|
|
104
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" which places"}}
|
|
105
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" it right"}}
|
|
106
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" after the \"hi\" bullet"}}
|
|
107
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\nThe note now"}}
|
|
108
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" contains"}}
|
|
109
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":":\n- hi"}}
|
|
110
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n- bye\n\nThe operation"}}
|
|
111
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" was successful"}}
|
|
112
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"!"}}
|
|
113
|
+
{"type":"content_block_stop","index":0}
|
|
114
|
+
{"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":1639,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":95}}
|
|
115
|
+
{"type":"message_stop"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"model": "claude-sonnet-4-5-20250929",
|
|
3
|
+
"id": "msg_01AyVh7iTyYup5o85hpFmYC1",
|
|
4
|
+
"type": "message",
|
|
5
|
+
"role": "assistant",
|
|
6
|
+
"content": [
|
|
7
|
+
{
|
|
8
|
+
"type": "tool_search_tool_result",
|
|
9
|
+
"tool_use_id": "srvtoolu_01WD1PoedV47LMZdJrsVNZtM",
|
|
10
|
+
"content": {
|
|
11
|
+
"type": "tool_search_tool_search_result",
|
|
12
|
+
"tool_references": [
|
|
13
|
+
{
|
|
14
|
+
"type": "tool_reference",
|
|
15
|
+
"tool_name": "readNoteTree"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"type": "tool_reference",
|
|
19
|
+
"tool_name": "executeEditorOperation"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"type": "text",
|
|
26
|
+
"text": "Good! I can see the current note structure has one bulleted list item with the text \"hi\". Now I need to add a new bullet point with \"bye\" after it. Let me use the `executeEditorOperation` tool to insert a new bulleted list item."
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"type": "tool_use",
|
|
30
|
+
"id": "toolu_01Vif37vPguXdx5yxixnpvpM",
|
|
31
|
+
"name": "executeEditorOperation",
|
|
32
|
+
"input": {
|
|
33
|
+
"noteId": "d10aa585-982b-4bd9-984e-420f9b3717f7",
|
|
34
|
+
"operations": [
|
|
35
|
+
{
|
|
36
|
+
"op": "insert_node",
|
|
37
|
+
"at": {
|
|
38
|
+
"type": "path",
|
|
39
|
+
"path": [
|
|
40
|
+
1
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"type": "bulletedListItem",
|
|
44
|
+
"text": "bye"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"caller": {
|
|
49
|
+
"type": "direct"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"stop_reason": "tool_use",
|
|
54
|
+
"stop_sequence": null,
|
|
55
|
+
"usage": {
|
|
56
|
+
"input_tokens": 1520,
|
|
57
|
+
"cache_creation_input_tokens": 0,
|
|
58
|
+
"cache_read_input_tokens": 0,
|
|
59
|
+
"cache_creation": {
|
|
60
|
+
"ephemeral_5m_input_tokens": 0,
|
|
61
|
+
"ephemeral_1h_input_tokens": 0
|
|
62
|
+
},
|
|
63
|
+
"output_tokens": 203,
|
|
64
|
+
"service_tier": "standard",
|
|
65
|
+
"server_tool_use": {
|
|
66
|
+
"web_search_requests": 0
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
{"type":"message_start","message":{"model":"claude-sonnet-4-5-20250929","id":"msg_01MCmfPn2yQ8Nfqz1cGmHe6K","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":904,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":5,"service_tier":"standard"}}}
|
|
2
|
+
{"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}
|
|
3
|
+
{"type":"ping"}
|
|
4
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"I'll help you with"}}
|
|
5
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" this task. Let me start"}}
|
|
6
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" by reading the note tree to see"}}
|
|
7
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" the current structure,"}}
|
|
8
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" an"}}
|
|
9
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d then search"}}
|
|
10
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" for the appropriate"}}
|
|
11
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" tools to add a"}}
|
|
12
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" bullet"}}
|
|
13
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"."}}
|
|
14
|
+
{"type":"content_block_stop","index":0}
|
|
15
|
+
{"type":"content_block_start","index":1,"content_block":{"type":"tool_use","id":"toolu_01WPkY6CkyJnFsaCqY7SZ9FX","name":"readNoteTree","input":{},"caller":{"type":"direct"}}}
|
|
16
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":""}}
|
|
17
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"{\"noteId\": \"d10aa585-982b"}}
|
|
18
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"-4bd9-984e-"}}
|
|
19
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"420f9b3717f7"}}
|
|
20
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"\"}"}}
|
|
21
|
+
{"type":"content_block_stop","index":1}
|
|
22
|
+
{"type":"content_block_start","index":2,"content_block":{"type":"server_tool_use","id":"srvtoolu_01H4HgrFsi9xizPtvnx1Tm7D","name":"tool_search_tool_regex","input":{},"caller":{"type":"direct"}}}
|
|
23
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":""}}
|
|
24
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"{\"pattern\": \"ad"}}
|
|
25
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"d|"}}
|
|
26
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"insert"}}
|
|
27
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"|bullet"}}
|
|
28
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"|create"}}
|
|
29
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\", \"limit\": 10"}}
|
|
30
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"}"}}
|
|
31
|
+
{"type":"content_block_stop","index":2}
|
|
32
|
+
{"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":904,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":175}}
|
|
33
|
+
{"type":"message_stop"}
|
|
34
|
+
{"type":"message_start","message":{"model":"claude-sonnet-4-5-20250929","id":"msg_017tMyttPYQeSLKYEe8V9BN5","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":1519,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}}
|
|
35
|
+
{"type":"content_block_start","index":0,"content_block":{"type":"tool_search_tool_result","tool_use_id":"srvtoolu_01H4HgrFsi9xizPtvnx1Tm7D","content":{"type":"tool_search_tool_search_result","tool_references":[{"type":"tool_reference","tool_name":"readNoteTree"},{"type":"tool_reference","tool_name":"executeEditorOperation"}]}}}
|
|
36
|
+
{"type":"content_block_stop","index":0}
|
|
37
|
+
{"type":"content_block_start","index":1,"content_block":{"type":"text","text":""}}
|
|
38
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":"Perfect"}}
|
|
39
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":"! I can"}}
|
|
40
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" see the current"}}
|
|
41
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" note structure"}}
|
|
42
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" has"}}
|
|
43
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" one"}}
|
|
44
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" bull"}}
|
|
45
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":"eted list"}}
|
|
46
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" item with"}}
|
|
47
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" the"}}
|
|
48
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" text \"hi\". Now I nee"}}
|
|
49
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":"d to add \"bye\" as a new"}}
|
|
50
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" bullet after it"}}
|
|
51
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":"."}}
|
|
52
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" Let"}}
|
|
53
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" me use"}}
|
|
54
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" the `"}}
|
|
55
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":"executeEditorOperation` tool"}}
|
|
56
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" to insert"}}
|
|
57
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" a"}}
|
|
58
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":" new bull"}}
|
|
59
|
+
{"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":"eted list item."}}
|
|
60
|
+
{"type":"content_block_stop","index":1}
|
|
61
|
+
{"type":"content_block_start","index":2,"content_block":{"type":"tool_use","id":"toolu_01UFHf8D27JBYu9FmrcjJk1p","name":"executeEditorOperation","input":{},"caller":{"type":"direct"}}}
|
|
62
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":""}}
|
|
63
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"{\"noteId\": \"d10aa585-982b"}}
|
|
64
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"-4bd9-984e-"}}
|
|
65
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"420f9b3717f7"}}
|
|
66
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\", \"operations\": ["}}
|
|
67
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\n "}}
|
|
68
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"{\n \"op\": \"insert"}}
|
|
69
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\",\n \"type"}}
|
|
70
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\": \"bulletedListItem\","}}
|
|
71
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\n \"text"}}
|
|
72
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\": \"bye\","}}
|
|
73
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\n \"at"}}
|
|
74
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\": {"}}
|
|
75
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\n \"type"}}
|
|
76
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\": \"after"}}
|
|
77
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\",\n \"path\": [0"}}
|
|
78
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"]\n }\n }"}}
|
|
79
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"\n]"}}
|
|
80
|
+
{"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"}"}}
|
|
81
|
+
{"type":"content_block_stop","index":2}
|
|
82
|
+
{"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":1519,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":211,"server_tool_use":{"web_search_requests":0}}}
|
|
83
|
+
{"type":"message_stop"}
|
|
84
|
+
{"type":"message_start","message":{"model":"claude-sonnet-4-5-20250929","id":"msg_01B2PApN3MtQ8zF4Xvnw6pvY","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":1758,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":3,"service_tier":"standard"}}}
|
|
85
|
+
{"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}
|
|
86
|
+
{"type":"ping"}
|
|
87
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Great! I"}}
|
|
88
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"'ve successfully complete"}}
|
|
89
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d the task. Here"}}
|
|
90
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"'s what I did:\n\n1."}}
|
|
91
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" **Rea"}}
|
|
92
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d the note tree**:"}}
|
|
93
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" The"}}
|
|
94
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" note containe"}}
|
|
95
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d one"}}
|
|
96
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" bulleted list item with the"}}
|
|
97
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" text \"hi\""}}
|
|
98
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" at"}}
|
|
99
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" path"}}
|
|
100
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" [0]"}}
|
|
101
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n2. **Added \"bye\""}}
|
|
102
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" as a new bullet**: I"}}
|
|
103
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" use"}}
|
|
104
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d the `executeEditorOperation` tool"}}
|
|
105
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" to insert a new bulleted list item"}}
|
|
106
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" with"}}
|
|
107
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" the text \"bye\" after"}}
|
|
108
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" the \"hi\" bullet"}}
|
|
109
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" ("}}
|
|
110
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"at path [0])\n\nThe operation"}}
|
|
111
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" was successful"}}
|
|
112
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":","}}
|
|
113
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" and the note now contains"}}
|
|
114
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" two bulleted list items:"}}
|
|
115
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n- hi"}}
|
|
116
|
+
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n- bye"}}
|
|
117
|
+
{"type":"content_block_stop","index":0}
|
|
118
|
+
{"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":1758,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":118}}
|
|
119
|
+
{"type":"message_stop"}
|