@ai-sdk/harness-deepagents 1.0.92 → 1.0.94

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.
@@ -0,0 +1,137 @@
1
+ import { mkdir, readFile, rename, rm, writeFile } from 'node:fs/promises';
2
+ import { dirname } from 'node:path';
3
+ import type { MemorySaver } from '@langchain/langgraph';
4
+
5
+ const SNAPSHOT_HEADER = 'deepagents-memory-saver-v1';
6
+
7
+ function encodeString(value: string): string {
8
+ return Buffer.from(value, 'utf8').toString('base64');
9
+ }
10
+
11
+ function decodeString(value: string): string {
12
+ return Buffer.from(value, 'base64').toString('utf8');
13
+ }
14
+
15
+ function encodeBytes(value: Uint8Array): string {
16
+ return Buffer.from(value).toString('base64');
17
+ }
18
+
19
+ function decodeBytes(value: string): Uint8Array {
20
+ return Buffer.from(value, 'base64');
21
+ }
22
+
23
+ export async function loadMemorySaver({
24
+ path,
25
+ saver,
26
+ }: {
27
+ path: string;
28
+ saver: MemorySaver;
29
+ }): Promise<void> {
30
+ let snapshot: string;
31
+ try {
32
+ snapshot = await readFile(path, 'utf8');
33
+ } catch (error) {
34
+ if ((error as NodeJS.ErrnoException).code === 'ENOENT') return;
35
+ throw error;
36
+ }
37
+
38
+ const [header, ...lines] = snapshot.split('\n');
39
+ if (header !== SNAPSHOT_HEADER) {
40
+ throw new Error('Unsupported Deep Agents conversation checkpoint format');
41
+ }
42
+
43
+ const storage: MemorySaver['storage'] = Object.create(null);
44
+ const writes: MemorySaver['writes'] = Object.create(null);
45
+
46
+ for (const line of lines) {
47
+ if (line === '') continue;
48
+ const fields = line.split('\t');
49
+ if (fields[0] === 'S' && fields.length === 7) {
50
+ const [, threadIdValue, namespaceValue, checkpointIdValue] = fields;
51
+ const threadId = decodeString(threadIdValue);
52
+ const namespace = decodeString(namespaceValue);
53
+ const checkpointId = decodeString(checkpointIdValue);
54
+ storage[threadId] ??= Object.create(null);
55
+ storage[threadId][namespace] ??= Object.create(null);
56
+ storage[threadId][namespace][checkpointId] = [
57
+ decodeBytes(fields[4]),
58
+ decodeBytes(fields[5]),
59
+ fields[6] === '' ? undefined : decodeString(fields[6]),
60
+ ];
61
+ continue;
62
+ }
63
+ if (fields[0] === 'W' && fields.length === 6) {
64
+ const [, keyValue, indexValue, taskIdValue, channelValue, value] = fields;
65
+ const key = decodeString(keyValue);
66
+ const index = decodeString(indexValue);
67
+ writes[key] ??= Object.create(null);
68
+ writes[key][index] = [
69
+ decodeString(taskIdValue),
70
+ decodeString(channelValue),
71
+ decodeBytes(value),
72
+ ];
73
+ continue;
74
+ }
75
+ throw new Error('Invalid Deep Agents conversation checkpoint');
76
+ }
77
+
78
+ saver.storage = storage;
79
+ saver.writes = writes;
80
+ }
81
+
82
+ export async function saveMemorySaver({
83
+ path,
84
+ saver,
85
+ }: {
86
+ path: string;
87
+ saver: MemorySaver;
88
+ }): Promise<void> {
89
+ const lines = [SNAPSHOT_HEADER];
90
+
91
+ for (const [threadId, namespaces] of Object.entries(saver.storage)) {
92
+ for (const [namespace, checkpoints] of Object.entries(namespaces)) {
93
+ for (const [
94
+ checkpointId,
95
+ [checkpoint, metadata, parentCheckpointId],
96
+ ] of Object.entries(checkpoints)) {
97
+ lines.push(
98
+ [
99
+ 'S',
100
+ encodeString(threadId),
101
+ encodeString(namespace),
102
+ encodeString(checkpointId),
103
+ encodeBytes(checkpoint),
104
+ encodeBytes(metadata),
105
+ parentCheckpointId == null ? '' : encodeString(parentCheckpointId),
106
+ ].join('\t'),
107
+ );
108
+ }
109
+ }
110
+ }
111
+
112
+ for (const [key, indexedWrites] of Object.entries(saver.writes)) {
113
+ for (const [index, [taskId, channel, value]] of Object.entries(
114
+ indexedWrites,
115
+ )) {
116
+ lines.push(
117
+ [
118
+ 'W',
119
+ encodeString(key),
120
+ encodeString(index),
121
+ encodeString(taskId),
122
+ encodeString(channel),
123
+ encodeBytes(value),
124
+ ].join('\t'),
125
+ );
126
+ }
127
+ }
128
+
129
+ await mkdir(dirname(path), { recursive: true });
130
+ const temporaryPath = `${path}.${process.pid}.tmp`;
131
+ await writeFile(temporaryPath, `${lines.join('\n')}\n`, 'utf8');
132
+ await rename(temporaryPath, path);
133
+ }
134
+
135
+ export async function removeMemorySaverSnapshot(path: string): Promise<void> {
136
+ await rm(path, { force: true });
137
+ }
@@ -9,26 +9,26 @@ importers:
9
9
  .:
10
10
  dependencies:
11
11
  '@langchain/anthropic':
12
- specifier: ^1.0.0
13
- version: 1.5.1(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))
12
+ specifier: ^1.5.8
13
+ version: 1.5.8(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))
14
14
  '@langchain/core':
15
- specifier: ^1.2.0
16
- version: 1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
15
+ specifier: ^1.2.9
16
+ version: 1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
17
17
  '@langchain/langgraph':
18
- specifier: ^1.4.4
19
- version: 1.4.8(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(zod@4.4.3)
18
+ specifier: ^1.4.12
19
+ version: 1.4.12(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(zod@4.4.3)
20
20
  '@langchain/mcp-adapters':
21
21
  specifier: 1.1.3
22
- version: 1.1.3(@cfworker/json-schema@4.1.1)(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(@langchain/langgraph@1.4.8(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(zod@4.4.3))
22
+ version: 1.1.3(@cfworker/json-schema@4.1.1)(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(@langchain/langgraph@1.4.12(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(zod@4.4.3))
23
23
  deepagents:
24
- specifier: 1.11.0
25
- version: 1.11.0(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(@langchain/langgraph-checkpoint@1.1.3(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)))(@langchain/langgraph-sdk@1.9.27(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)))(@langchain/langgraph@1.4.8(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(zod@4.4.3))(langchain@1.5.3(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(langsmith@0.7.17(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))
24
+ specifier: 1.13.1
25
+ version: 1.13.1(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(@langchain/langgraph-checkpoint@1.1.5(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)))(@langchain/langgraph-sdk@1.9.31(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)))(@langchain/langgraph@1.4.12(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(zod@4.4.3))(langchain@1.5.10(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(langsmith@0.9.0(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))
26
26
  langchain:
27
- specifier: ^1.5.0
28
- version: 1.5.3(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
27
+ specifier: ^1.5.10
28
+ version: 1.5.10(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
29
29
  langsmith:
30
- specifier: ^0.7.17
31
- version: 0.7.17(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
30
+ specifier: ^0.9.0
31
+ version: 0.9.0(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
32
32
  ws:
33
33
  specifier: 8.21.0
34
34
  version: 8.21.0
@@ -38,8 +38,8 @@ importers:
38
38
 
39
39
  packages:
40
40
 
41
- '@anthropic-ai/sdk@0.103.0':
42
- resolution: {integrity: sha512-1uG7RNgoHTUxzOXqSCODKt0UTVlxWiHk/2Tt2/uQJiPW7XzBeKVuJyd3Aw6T3LPyvZV/jDTnPLX7SaM70WLLjA==}
41
+ '@anthropic-ai/sdk@0.115.0':
42
+ resolution: {integrity: sha512-BJrFIVyjNuU8lfDyIJTvlRYzgQg+zEl78BxE7fq8esULsGz9IRQvGtW5spq3tydmtjQb/GFdooKGdGsetpx+lQ==}
43
43
  hasBin: true
44
44
  peerDependencies:
45
45
  zod: ^3.25.0 || ^4.0.0
@@ -60,24 +60,24 @@ packages:
60
60
  peerDependencies:
61
61
  hono: ^4
62
62
 
63
- '@langchain/anthropic@1.5.1':
64
- resolution: {integrity: sha512-j92zCCd5BFH3rHMRzc2wBmSKDoVpinof1oh8aFiAz9TWbSOc4tGU4n6bqwy/wP0GH1uO96zZHLGCHBMPgrxTNw==}
63
+ '@langchain/anthropic@1.5.8':
64
+ resolution: {integrity: sha512-KZWgIf+04M9XZHhgH1rVJkqw/C26DM4a4jKk4Qc4HaSbRawN2Dw5nDffna+IoaU/50ohTdyB3HOz9g8XFQYF2A==}
65
65
  engines: {node: '>=20'}
66
66
  peerDependencies:
67
- '@langchain/core': ^1.2.1
67
+ '@langchain/core': ^1.2.9
68
68
 
69
- '@langchain/core@1.2.3':
70
- resolution: {integrity: sha512-F+L5SsciykwDl7eDxacnhDTcWe1IF6jetzfkvI5PPfq6ogWHO7xcjU90SGh/3lqbbS0tgun+qF01KIqxawrCsA==}
69
+ '@langchain/core@1.2.9':
70
+ resolution: {integrity: sha512-conzSEj9Zu1AyXJLXsSbgrtxtxinmI1yGqQ5CIJZSoV5rvv+yvQE/vgBnoySpBQ/bl3YPgj2FL/gbDjWykLSfg==}
71
71
  engines: {node: '>=20'}
72
72
 
73
- '@langchain/langgraph-checkpoint@1.1.3':
74
- resolution: {integrity: sha512-wgzdQNeEsdw1e+4lvlj0tdq/RYR/k1vPin10g0ymGoehZDDgd9nvIllGXSXN4TFgF9sf5qQP/KTkOcLfeseIhA==}
73
+ '@langchain/langgraph-checkpoint@1.1.5':
74
+ resolution: {integrity: sha512-BwDwl5VeTOh6CVuiIPgsUgfK51vTJDMSbFcSCUfjJWsl8/DPdK/mbv+ejxJstkSk/BlSPMP4JfXWcN6jD2ea2Q==}
75
75
  engines: {node: '>=18'}
76
76
  peerDependencies:
77
77
  '@langchain/core': ^1.1.48
78
78
 
79
- '@langchain/langgraph-sdk@1.9.27':
80
- resolution: {integrity: sha512-EHGFsxawniLw2pGVUDLSSdMriASIP4oz0Mihytb50iRsIqhmODzGBWW7iLWA/0hqavggNpqjat4WD7LjmxiXSQ==}
79
+ '@langchain/langgraph-sdk@1.9.31':
80
+ resolution: {integrity: sha512-y1sSdq39IPb6mOX43+JiSezVbUdA8EBEJ1gvn91GP0jrLG0EcSApeRDCjRouyDpPXZ51bQXEQhA8CiHM0mzcAw==}
81
81
  peerDependencies:
82
82
  '@langchain/core': ^1.1.48
83
83
  react: ^18 || ^19
@@ -94,8 +94,8 @@ packages:
94
94
  vue:
95
95
  optional: true
96
96
 
97
- '@langchain/langgraph@1.4.8':
98
- resolution: {integrity: sha512-DN1Np1XefdBEbp1qBKlt39cwoL743AAGpR5Ipja0gY2YbWvsoQnOTIrjnj/orSAhaUYsdTKS8VSWdFzsHZo6Ig==}
97
+ '@langchain/langgraph@1.4.12':
98
+ resolution: {integrity: sha512-63iH/igH5Fh5fHqmWp09YYWaDKKB9v4RCmYNJBrnQ224rFRbjebgyYW6o5RCczN5FZxIhQj+xT51rrNmG0zi5A==}
99
99
  engines: {node: '>=18'}
100
100
  peerDependencies:
101
101
  '@langchain/core': ^1.1.48
@@ -217,15 +217,15 @@ packages:
217
217
  supports-color:
218
218
  optional: true
219
219
 
220
- deepagents@1.11.0:
221
- resolution: {integrity: sha512-HPKLmOoi23fRykXpJgrhYNhjm+Yrd3qVmvwm7mvJ2DeTcJBKu1mc+VYbYeHunIVfi9F05GgjZa9JjdWwuAVuPQ==}
220
+ deepagents@1.13.1:
221
+ resolution: {integrity: sha512-DB8dkbrd4cqejroU90qAGTtY7ZvIchsMSaOMjE7TWnsi/6IrpBPxg3xN0Vxjuq/x8jkufkIqk3I57RbZmdSJFw==}
222
222
  peerDependencies:
223
- '@langchain/core': ^1.2.0
224
- '@langchain/langgraph': ^1.4.4
225
- '@langchain/langgraph-checkpoint': ^1.1.2
223
+ '@langchain/core': ^1.2.9
224
+ '@langchain/langgraph': ^1.4.10
225
+ '@langchain/langgraph-checkpoint': ^1.1.5
226
226
  '@langchain/langgraph-sdk': ^1.9.23
227
- langchain: ^1.5.0
228
- langsmith: ^0.7.1
227
+ langchain: ^1.5.10
228
+ langsmith: '>=0.7.1 <0.10.0'
229
229
 
230
230
  depd@2.0.0:
231
231
  resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==}
@@ -408,14 +408,14 @@ packages:
408
408
  json-schema-typed@8.0.2:
409
409
  resolution: {integrity: sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==}
410
410
 
411
- langchain@1.5.3:
412
- resolution: {integrity: sha512-YRYPy1xPq4CgKe0NdPoscYHnKBW5cViEyWiZsUKQfN3xL1X5DpGlIpaBQg1A/t6o9ePKE7J5b7nqrfLz8t7/Rw==}
411
+ langchain@1.5.10:
412
+ resolution: {integrity: sha512-JaC12C1qyGn985vvjttr4hr8lfFzWhrXp2M1byZJGmNJ2RiIgqnhiYDuLlG/xHDxhKD3onJ5pCuUif/cbdqPhA==}
413
413
  engines: {node: '>=20'}
414
414
  peerDependencies:
415
- '@langchain/core': ^1.2.1
415
+ '@langchain/core': ^1.2.9
416
416
 
417
- langsmith@0.7.17:
418
- resolution: {integrity: sha512-FfmxKOVp+qBkdbOWTwXxU7qeX2H40RMsLW9Us+53/4rZYl/QzfUeeBe/rE98mfuSSnEz1tOOMjoPJIYoMt1wnw==}
417
+ langsmith@0.9.0:
418
+ resolution: {integrity: sha512-tlg/aG7qezAKY6G3fgADSX7PkRj+JKoF3z7QNkCMsAOvwvuzhiwP9Amn1Z+zAIxuKoWuXQdIjtFN0LVmUC1oUQ==}
419
419
  peerDependencies:
420
420
  '@opentelemetry/api': '*'
421
421
  '@opentelemetry/exporter-trace-otlp-proto': '*'
@@ -679,7 +679,7 @@ packages:
679
679
 
680
680
  snapshots:
681
681
 
682
- '@anthropic-ai/sdk@0.103.0(zod@4.4.3)':
682
+ '@anthropic-ai/sdk@0.115.0(zod@4.4.3)':
683
683
  dependencies:
684
684
  json-schema-to-ts: 3.1.1
685
685
  standardwebhooks: 1.0.0
@@ -694,18 +694,18 @@ snapshots:
694
694
  dependencies:
695
695
  hono: 4.13.1
696
696
 
697
- '@langchain/anthropic@1.5.1(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))':
697
+ '@langchain/anthropic@1.5.8(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))':
698
698
  dependencies:
699
- '@anthropic-ai/sdk': 0.103.0(zod@4.4.3)
700
- '@langchain/core': 1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
699
+ '@anthropic-ai/sdk': 0.115.0(zod@4.4.3)
700
+ '@langchain/core': 1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
701
701
  zod: 4.4.3
702
702
 
703
- '@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)':
703
+ '@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)':
704
704
  dependencies:
705
705
  '@cfworker/json-schema': 4.1.1
706
706
  '@standard-schema/spec': 1.1.0
707
707
  js-tiktoken: 1.0.21
708
- langsmith: 0.7.17(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
708
+ langsmith: 0.9.0(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
709
709
  mustache: 4.2.0
710
710
  p-queue: 6.6.2
711
711
  zod: 4.4.3
@@ -716,23 +716,23 @@ snapshots:
716
716
  - openai
717
717
  - ws
718
718
 
719
- '@langchain/langgraph-checkpoint@1.1.3(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))':
719
+ '@langchain/langgraph-checkpoint@1.1.5(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))':
720
720
  dependencies:
721
- '@langchain/core': 1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
721
+ '@langchain/core': 1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
722
722
 
723
- '@langchain/langgraph-sdk@1.9.27(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))':
723
+ '@langchain/langgraph-sdk@1.9.31(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))':
724
724
  dependencies:
725
- '@langchain/core': 1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
725
+ '@langchain/core': 1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
726
726
  '@langchain/protocol': 0.0.18
727
727
  '@types/json-schema': 7.0.15
728
728
  p-queue: 9.3.1
729
729
  p-retry: 7.1.1
730
730
 
731
- '@langchain/langgraph@1.4.8(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(zod@4.4.3)':
731
+ '@langchain/langgraph@1.4.12(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(zod@4.4.3)':
732
732
  dependencies:
733
- '@langchain/core': 1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
734
- '@langchain/langgraph-checkpoint': 1.1.3(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))
735
- '@langchain/langgraph-sdk': 1.9.27(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))
733
+ '@langchain/core': 1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
734
+ '@langchain/langgraph-checkpoint': 1.1.5(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))
735
+ '@langchain/langgraph-sdk': 1.9.31(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))
736
736
  '@langchain/protocol': 0.0.18
737
737
  '@standard-schema/spec': 1.1.0
738
738
  zod: 4.4.3
@@ -742,10 +742,10 @@ snapshots:
742
742
  - svelte
743
743
  - vue
744
744
 
745
- '@langchain/mcp-adapters@1.1.3(@cfworker/json-schema@4.1.1)(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(@langchain/langgraph@1.4.8(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(zod@4.4.3))':
745
+ '@langchain/mcp-adapters@1.1.3(@cfworker/json-schema@4.1.1)(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(@langchain/langgraph@1.4.12(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(zod@4.4.3))':
746
746
  dependencies:
747
- '@langchain/core': 1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
748
- '@langchain/langgraph': 1.4.8(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(zod@4.4.3)
747
+ '@langchain/core': 1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
748
+ '@langchain/langgraph': 1.4.12(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(zod@4.4.3)
749
749
  '@modelcontextprotocol/sdk': 1.30.0(@cfworker/json-schema@4.1.1)(zod@4.4.3)
750
750
  debug: 4.4.3
751
751
  zod: 4.4.3
@@ -872,15 +872,15 @@ snapshots:
872
872
  dependencies:
873
873
  ms: 2.1.3
874
874
 
875
- deepagents@1.11.0(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(@langchain/langgraph-checkpoint@1.1.3(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)))(@langchain/langgraph-sdk@1.9.27(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)))(@langchain/langgraph@1.4.8(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(zod@4.4.3))(langchain@1.5.3(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(langsmith@0.7.17(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)):
875
+ deepagents@1.13.1(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(@langchain/langgraph-checkpoint@1.1.5(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)))(@langchain/langgraph-sdk@1.9.31(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)))(@langchain/langgraph@1.4.12(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(zod@4.4.3))(langchain@1.5.10(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(langsmith@0.9.0(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)):
876
876
  dependencies:
877
- '@langchain/core': 1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
878
- '@langchain/langgraph': 1.4.8(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(zod@4.4.3)
879
- '@langchain/langgraph-checkpoint': 1.1.3(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))
880
- '@langchain/langgraph-sdk': 1.9.27(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))
877
+ '@langchain/core': 1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
878
+ '@langchain/langgraph': 1.4.12(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(zod@4.4.3)
879
+ '@langchain/langgraph-checkpoint': 1.1.5(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))
880
+ '@langchain/langgraph-sdk': 1.9.31(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))
881
881
  fast-glob: 3.3.3
882
- langchain: 1.5.3(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
883
- langsmith: 0.7.17(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
882
+ langchain: 1.5.10(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
883
+ langsmith: 0.9.0(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
884
884
  micromatch: 4.0.8
885
885
  yaml: 2.9.0
886
886
  zod: 4.4.3
@@ -1081,12 +1081,12 @@ snapshots:
1081
1081
 
1082
1082
  json-schema-typed@8.0.2: {}
1083
1083
 
1084
- langchain@1.5.3(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0):
1084
+ langchain@1.5.10(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0):
1085
1085
  dependencies:
1086
- '@langchain/core': 1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
1087
- '@langchain/langgraph': 1.4.8(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(zod@4.4.3)
1088
- '@langchain/langgraph-checkpoint': 1.1.3(@langchain/core@1.2.3(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))
1089
- langsmith: 0.7.17(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
1086
+ '@langchain/core': 1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
1087
+ '@langchain/langgraph': 1.4.12(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))(zod@4.4.3)
1088
+ '@langchain/langgraph-checkpoint': 1.1.5(@langchain/core@1.2.9(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0))
1089
+ langsmith: 0.9.0(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0)
1090
1090
  zod: 4.4.3
1091
1091
  transitivePeerDependencies:
1092
1092
  - '@opentelemetry/api'
@@ -1099,7 +1099,7 @@ snapshots:
1099
1099
  - vue
1100
1100
  - ws
1101
1101
 
1102
- langsmith@0.7.17(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0):
1102
+ langsmith@0.9.0(openai@6.43.0(ws@8.21.0)(zod@4.4.3))(ws@8.21.0):
1103
1103
  dependencies:
1104
1104
  p-queue: 6.6.2
1105
1105
  optionalDependencies:
@@ -34,6 +34,7 @@ export const startMessageSchema = harnessV1BridgeStartBaseSchema.extend({
34
34
  effort: z.enum(['low', 'medium', 'high', 'xhigh', 'max']).optional(),
35
35
  // In-backend skills source dirs ($HOME and <workDir>), passed to createDeepAgent({ skills }).
36
36
  skillsPaths: z.array(z.string()).optional(),
37
+ skillsChanged: z.boolean().optional(),
37
38
  // Max LangGraph super-steps per turn (streamEvents recursionLimit).
38
39
  recursionLimit: z.number().optional(),
39
40
  });
@@ -35,6 +35,7 @@ import {
35
35
  warnCredentialBrokeringUnavailable,
36
36
  waitForBridgeReady,
37
37
  writeSkills as writeHarnessSkills,
38
+ type WriteSkillsResult,
38
39
  } from '@ai-sdk/harness/utils';
39
40
  import {
40
41
  tool,
@@ -93,7 +94,12 @@ export type DeepAgentsHarnessSettings = {
93
94
  * discover, read, or otherwise access in the host process.
94
95
  */
95
96
  readonly credentialForwarding?: HarnessV1CredentialForwarding;
96
- /** Model id for the DeepAgents runtime, e.g. `claude-sonnet-4` (converted to `provider:model`). */
97
+ /**
98
+ * Model id for the DeepAgents runtime, e.g. `claude-sonnet-4` (converted to
99
+ * `provider:model`).
100
+ *
101
+ * @deprecated Use `model` on `HarnessAgent` instead.
102
+ */
97
103
  readonly model?: string;
98
104
  /**
99
105
  * Controls Anthropic extended thinking for the Deep Agents model. Unset
@@ -294,6 +300,17 @@ export function createDeepAgents(
294
300
  );
295
301
 
296
302
  const workDir = startOpts.sessionWorkDir;
303
+ /*
304
+ * Deep Agents discovers repository skills under the working directory.
305
+ * Harness-provided skills use an absolute home-directory path listed
306
+ * last, so they take precedence when names collide.
307
+ */
308
+ const homeDir = await resolveSandboxHomeDir({
309
+ sandbox: toolSafeSandboxSession,
310
+ abortSignal: startOpts.abortSignal,
311
+ });
312
+ const homeSkillsRoot = `${homeDir}${SKILLS_SOURCE_PATH}`;
313
+ const skillsPaths = [`${workDir}${SKILLS_SOURCE_PATH}`, homeSkillsRoot];
297
314
  const sessionDataDir = `${defaultWorkingDirectory}/.agent-runs/${startOpts.sessionId}`;
298
315
  const bridgeStateDir = `${sessionDataDir}/bridge`;
299
316
  const timeoutMs = settings.startupTimeoutMs ?? 120_000;
@@ -345,7 +362,9 @@ export function createDeepAgents(
345
362
  sandboxId,
346
363
  sandboxCredentialEnvironment,
347
364
  isResume: true,
348
- attached: true,
365
+ sandbox: toolSafeSandboxSession,
366
+ homeSkillsRoot,
367
+ skillsPaths,
349
368
  permissionMode,
350
369
  builtinToolFiltering: startOpts.builtinToolFiltering,
351
370
  recursionLimit: settings.recursionLimit,
@@ -365,25 +384,6 @@ export function createDeepAgents(
365
384
  ? randomBytes(32).toString('hex')
366
385
  : settings.mintBridgeToken(sandboxId!);
367
386
 
368
- // Always discover repo-provided skills under <workDir>/.agents/skills (e.g. a cloned repo); a missing dir is tolerated by deepagents.
369
- // Absolute paths: LocalShellBackend (non-virtual) treats a leading-slash path as a real fs path.
370
- const skillsPaths = [`${workDir}${SKILLS_SOURCE_PATH}`];
371
- // Host-provided skills go to $HOME (out of the work dir) and take priority (listed last → wins on name collision).
372
- if ((startOpts.skills?.length ?? 0) > 0) {
373
- const homeDir = await resolveSandboxHomeDir({
374
- sandbox: toolSafeSandboxSession,
375
- abortSignal: startOpts.abortSignal,
376
- });
377
- const homeSkillsRoot = `${homeDir}${SKILLS_SOURCE_PATH}`;
378
- await writeSkills({
379
- sandbox: toolSafeSandboxSession,
380
- root: homeSkillsRoot,
381
- skills: startOpts.skills ?? [],
382
- abortSignal: startOpts.abortSignal,
383
- });
384
- skillsPaths.push(homeSkillsRoot);
385
- }
386
-
387
387
  const forwardedAuthEnvironment = credentialsBrokered
388
388
  ? sandboxAuthEnvironment
389
389
  : await applyCredentialForwarding({
@@ -412,7 +412,7 @@ export function createDeepAgents(
412
412
  });
413
413
 
414
414
  const proc = await toolSafeSandboxSession.spawn({
415
- command: `node ${shellQuote(`${bootstrapDir}/bridge.mjs`)} --workdir ${shellQuote(workDir)} --bridge-state-dir ${shellQuote(bridgeStateDir)} --bootstrap-dir ${shellQuote(bootstrapDir)}`,
415
+ command: `node ${shellQuote(`${bootstrapDir}/bridge.mjs`)} --workdir ${shellQuote(workDir)} --bridge-state-dir ${shellQuote(bridgeStateDir)} --bootstrap-dir ${shellQuote(bootstrapDir)}${isResume ? ' --resume true' : ''}`,
416
416
  env,
417
417
  abortSignal: startOpts.abortSignal,
418
418
  });
@@ -477,8 +477,8 @@ export function createDeepAgents(
477
477
  sandboxId,
478
478
  sandboxCredentialEnvironment,
479
479
  isResume,
480
- // Freshly spawned bridge — it must receive the instructions on the first prompt.
481
- attached: false,
480
+ sandbox: toolSafeSandboxSession,
481
+ homeSkillsRoot,
482
482
  skillsPaths,
483
483
  permissionMode,
484
484
  builtinToolFiltering: startOpts.builtinToolFiltering,
@@ -565,12 +565,12 @@ async function writeSkills({
565
565
  root: string;
566
566
  skills: ReadonlyArray<HarnessV1Skill>;
567
567
  abortSignal?: AbortSignal;
568
- }): Promise<void> {
568
+ }): Promise<WriteSkillsResult> {
569
569
  /*
570
570
  * DeepAgents requires each `SKILL.md` frontmatter name to match the parent
571
571
  * directory name, so keep the stricter lowercase skill-name policy here.
572
572
  */
573
- await writeHarnessSkills({
573
+ return writeHarnessSkills({
574
574
  sandbox,
575
575
  rootDir: root,
576
576
  skills,
@@ -629,7 +629,8 @@ function createSession({
629
629
  sandboxId,
630
630
  sandboxCredentialEnvironment,
631
631
  isResume,
632
- attached,
632
+ sandbox,
633
+ homeSkillsRoot,
633
634
  skillsPaths,
634
635
  permissionMode,
635
636
  builtinToolFiltering,
@@ -648,10 +649,8 @@ function createSession({
648
649
  sandboxId: string | undefined;
649
650
  sandboxCredentialEnvironment: Record<string, string> | undefined;
650
651
  isResume: boolean;
651
- // True only when attaching to a live bridge that already built the agent with
652
- // its instructions. A fresh spawn (incl. a respawn on attach failure or a
653
- // stop-resume) starts a new bridge that must receive the instructions again.
654
- attached: boolean;
652
+ sandbox: SandboxSession;
653
+ homeSkillsRoot: string;
655
654
  skillsPaths?: string[];
656
655
  permissionMode?: HarnessV1PermissionMode;
657
656
  builtinToolFiltering?: HarnessV1BuiltinToolFiltering;
@@ -659,7 +658,6 @@ function createSession({
659
658
  mcpServers?: Record<string, unknown>;
660
659
  }): HarnessV1Session {
661
660
  let stopped = false;
662
- let instructionsApplied = attached;
663
661
 
664
662
  const wireTurn = (turnOpts: {
665
663
  emit: (event: HarnessV1StreamPart) => void;
@@ -786,7 +784,6 @@ function createSession({
786
784
  return {
787
785
  sessionId,
788
786
  isResume,
789
- modelId: model,
790
787
  doPromptTurn: async promptOpts => {
791
788
  if (
792
789
  promptOpts.responseFormat?.type === 'json' &&
@@ -798,19 +795,23 @@ function createSession({
798
795
  harnessId: 'deepagents',
799
796
  });
800
797
  }
798
+ const skillWriteResult = await writeSkills({
799
+ sandbox,
800
+ root: homeSkillsRoot,
801
+ skills: promptOpts.skills,
802
+ abortSignal: promptOpts.abortSignal,
803
+ });
801
804
  const control = wireTurn({
802
805
  emit: promptOpts.emit,
803
806
  abortSignal: promptOpts.abortSignal,
804
807
  });
805
808
 
806
- const applyInstructions =
807
- !instructionsApplied && !!promptOpts.instructions;
808
- instructionsApplied = true;
809
-
810
809
  channel.send({
811
810
  type: 'start',
812
811
  prompt: extractUserText(promptOpts.prompt),
813
- ...(applyInstructions ? { instructions: promptOpts.instructions } : {}),
812
+ ...(promptOpts.instructions
813
+ ? { instructions: promptOpts.instructions }
814
+ : {}),
814
815
  tools: (promptOpts.tools ?? []).map(t => ({
815
816
  name: t.name,
816
817
  description: t.description,
@@ -819,10 +820,13 @@ function createSession({
819
820
  ...(promptOpts.responseFormat == null
820
821
  ? {}
821
822
  : { responseFormat: promptOpts.responseFormat }),
822
- ...(model ? { model } : {}),
823
+ ...((promptOpts.model ?? model)
824
+ ? { model: promptOpts.model ?? model }
825
+ : {}),
823
826
  ...(thinking ? { thinking } : {}),
824
827
  ...(effort ? { effort } : {}),
825
828
  ...(skillsPaths?.length ? { skillsPaths } : {}),
829
+ skillsChanged: skillWriteResult.changed,
826
830
  ...(permissionMode ? { permissionMode } : {}),
827
831
  ...(builtinToolFiltering ? { builtinToolFiltering } : {}),
828
832
  ...(recursionLimit != null ? { recursionLimit } : {}),
@@ -911,7 +915,6 @@ function createSession({
911
915
  }
912
916
  stopped = true;
913
917
  await teardown({ channel, proc, operation: 'stop' });
914
- // In-memory conversation is lost on teardown; the sandbox snapshot preserves the workspace files, not the conversation.
915
918
  const payload: HarnessV1ResumeSessionState = {
916
919
  type: 'resume-session',
917
920
  harnessId: 'deepagents',