@dawn-ai/langchain 0.4.0 → 0.6.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"stub.d.ts","sourceRoot":"","sources":["../../src/offload/stub.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;CAChC;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAarD"}
1
+ {"version":3,"file":"stub.d.ts","sourceRoot":"","sources":["../../src/offload/stub.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;CAChC;AAqBD,wBAAgB,SAAS,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAarD"}
@@ -1,5 +1,24 @@
1
+ /**
2
+ * Source text used for the preview slice. When the offloaded content is a
3
+ * single-line JSON blob (e.g. a tool returned an object, so newlines are escaped
4
+ * as `\n`), pretty-print it so the preview shows readable lines instead of one
5
+ * giant escaped line. Plain-text content (the common case) is returned as-is.
6
+ * Only the preview is affected — the stored file and its hash are unchanged.
7
+ */
8
+ function previewSource(content) {
9
+ const trimmed = content.trimStart();
10
+ if (trimmed.startsWith("{") || trimmed.startsWith("[")) {
11
+ try {
12
+ return JSON.stringify(JSON.parse(content), null, 2);
13
+ }
14
+ catch {
15
+ // Not valid JSON — fall through to the raw content.
16
+ }
17
+ }
18
+ return content;
19
+ }
1
20
  export function buildStub(args) {
2
- const lines = args.content.split("\n").slice(0, args.previewLines);
21
+ const lines = previewSource(args.content).split("\n").slice(0, args.previewLines);
3
22
  const shown = lines.length;
4
23
  const preview = lines.join("\n");
5
24
  const chars = args.content.length.toLocaleString("en-US");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dawn-ai/langchain",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -33,8 +33,8 @@
33
33
  "@langchain/langgraph": "^1.3.0",
34
34
  "@langchain/openai": "^1.4.5",
35
35
  "gpt-tokenizer": "^3.4.0",
36
- "@dawn-ai/sdk": "0.4.0",
37
- "@dawn-ai/core": "0.4.0",
36
+ "@dawn-ai/core": "0.6.0",
37
+ "@dawn-ai/sdk": "0.6.0",
38
38
  "@dawn-ai/workspace": "0.2.0"
39
39
  },
40
40
  "peerDependencies": {
@@ -88,7 +88,7 @@
88
88
  "@langchain/xai": "^1.3.18",
89
89
  "@types/node": "25.6.0",
90
90
  "zod": "4.4.3",
91
- "@dawn-ai/config-typescript": "0.4.0"
91
+ "@dawn-ai/config-typescript": "0.6.0"
92
92
  },
93
93
  "scripts": {
94
94
  "build": "tsc -b tsconfig.json",