@lzn1998/dsh-langgraph 1.5.0 → 1.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.
@@ -0,0 +1,75 @@
1
+ {
2
+ "ir": 1,
3
+ "name": "data-extract",
4
+ "description": "Extract one JSON record per file and write a single JSON array.",
5
+ "state": {
6
+ "pattern": { "type": "string", "default": "data/*.txt" },
7
+ "files": { "type": "string[]", "default": [] },
8
+ "contents": { "type": "string[]", "default": [], "reducer": "append" },
9
+ "records": { "type": "string[]", "default": [], "reducer": "append" },
10
+ "json": { "type": "string", "default": "" }
11
+ },
12
+ "nodes": [
13
+ {
14
+ "id": "list",
15
+ "do": "tool",
16
+ "tool": "glob",
17
+ "args": { "pattern": { "$state": "pattern" } },
18
+ "out": { "files": "lines" }
19
+ },
20
+ {
21
+ "id": "read",
22
+ "do": "map",
23
+ "over": "files",
24
+ "maxConcurrency": 8,
25
+ "body": {
26
+ "do": "tool",
27
+ "tool": "read",
28
+ "args": { "file_path": { "$state": "item" } },
29
+ "out": { "contents": "text" }
30
+ }
31
+ },
32
+ {
33
+ "id": "extract",
34
+ "do": "map",
35
+ "over": "contents",
36
+ "maxConcurrency": 8,
37
+ "body": {
38
+ "do": "model",
39
+ "prompt": ["Return one compact JSON object for this record; no prose.\n", { "$state": "item" }],
40
+ "schema": {
41
+ "type": "object",
42
+ "required": ["id", "value"],
43
+ "properties": {
44
+ "id": { "type": "string" },
45
+ "value": { "type": "number" }
46
+ }
47
+ },
48
+ "out": { "records": "text" }
49
+ }
50
+ },
51
+ {
52
+ "id": "join",
53
+ "do": "model",
54
+ "prompt": ["Merge these JSON objects into one valid JSON array. Return the array only.\n", { "$state": "records" }],
55
+ "out": { "json": "text" }
56
+ },
57
+ {
58
+ "id": "write",
59
+ "do": "tool",
60
+ "tool": "write",
61
+ "args": { "file_path": "records.json", "content": { "$state": "json" } },
62
+ "out": {}
63
+ }
64
+ ],
65
+ "edges": [
66
+ { "from": "START", "to": "list" },
67
+ { "from": "list", "to": "read" },
68
+ { "from": "read", "to": "extract" },
69
+ { "from": "extract", "to": "join" },
70
+ { "from": "join", "to": "write" },
71
+ { "from": "write", "to": "END" }
72
+ ],
73
+ "output": ["json"],
74
+ "maxSteps": 20
75
+ }
@@ -0,0 +1,64 @@
1
+ {
2
+ "ir": 1,
3
+ "name": "incident-triage",
4
+ "description": "Read logs, classify the incident, ask whether to page, and write a triage note.",
5
+ "state": {
6
+ "pattern": { "type": "string", "default": "logs/*.log" },
7
+ "files": { "type": "string[]", "default": [] },
8
+ "logs": { "type": "string[]", "default": [], "reducer": "append" },
9
+ "triage": { "type": "string", "default": "" },
10
+ "decision": { "type": "string", "default": "" }
11
+ },
12
+ "nodes": [
13
+ {
14
+ "id": "list",
15
+ "do": "tool",
16
+ "tool": "glob",
17
+ "args": { "pattern": { "$state": "pattern" } },
18
+ "out": { "files": "lines" }
19
+ },
20
+ {
21
+ "id": "read",
22
+ "do": "map",
23
+ "over": "files",
24
+ "maxConcurrency": 8,
25
+ "body": {
26
+ "do": "tool",
27
+ "tool": "read",
28
+ "args": { "file_path": { "$state": "item" } },
29
+ "out": { "logs": "text" }
30
+ }
31
+ },
32
+ {
33
+ "id": "classify",
34
+ "do": "model",
35
+ "prompt": ["Triage these logs: likely cause, confidence, and the next check.\n", { "$state": "logs" }],
36
+ "out": { "triage": "text" }
37
+ },
38
+ {
39
+ "id": "page",
40
+ "do": "gate",
41
+ "question": "Page the on-call engineer?",
42
+ "options": ["Page", "No"],
43
+ "out": { "decision": "text" }
44
+ },
45
+ {
46
+ "id": "write",
47
+ "do": "tool",
48
+ "tool": "write",
49
+ "args": { "file_path": "triage.md", "content": { "$state": "triage" } },
50
+ "out": {}
51
+ }
52
+ ],
53
+ "edges": [
54
+ { "from": "START", "to": "list" },
55
+ { "from": "list", "to": "read" },
56
+ { "from": "read", "to": "classify" },
57
+ { "from": "classify", "to": "page" },
58
+ { "from": "page", "to": "write", "when": { "op": "eq", "args": [{ "$state": "decision" }, "Page"] } },
59
+ { "from": "page", "to": "END", "when": true },
60
+ { "from": "write", "to": "END" }
61
+ ],
62
+ "output": ["triage", "decision"],
63
+ "maxSteps": 20
64
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "ir": 1,
3
+ "name": "pr-review",
4
+ "description": "Read the current diff, draft a review, ask for approval, and write it.",
5
+ "state": {
6
+ "diff": { "type": "string", "default": "" },
7
+ "review": { "type": "string", "default": "" },
8
+ "decision": { "type": "string", "default": "" }
9
+ },
10
+ "nodes": [
11
+ {
12
+ "id": "read_diff",
13
+ "do": "tool",
14
+ "tool": "bash",
15
+ "args": { "command": "git diff --stat && git diff --no-ext-diff" },
16
+ "out": { "diff": "text" }
17
+ },
18
+ {
19
+ "id": "draft_review",
20
+ "do": "model",
21
+ "prompt": ["Review this diff. List only concrete correctness risks; say none if there are none.\n", { "$state": "diff" }],
22
+ "out": { "review": "text" }
23
+ },
24
+ {
25
+ "id": "approve",
26
+ "do": "gate",
27
+ "question": "Post this review?",
28
+ "options": ["Approve", "Revise"],
29
+ "out": { "decision": "text" }
30
+ },
31
+ {
32
+ "id": "write",
33
+ "do": "tool",
34
+ "tool": "write",
35
+ "args": { "file_path": "review.md", "content": { "$state": "review" } },
36
+ "out": {}
37
+ }
38
+ ],
39
+ "edges": [
40
+ { "from": "START", "to": "read_diff" },
41
+ { "from": "read_diff", "to": "draft_review" },
42
+ { "from": "draft_review", "to": "approve" },
43
+ { "from": "approve", "to": "write", "when": { "op": "eq", "args": [{ "$state": "decision" }, "Approve"] } },
44
+ { "from": "approve", "to": "END", "when": true },
45
+ { "from": "write", "to": "END" }
46
+ ],
47
+ "output": ["review", "decision"],
48
+ "maxSteps": 20
49
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "ir": 1,
3
+ "name": "repo-scan",
4
+ "description": "Scan a set of source files in parallel and write one review.",
5
+ "state": {
6
+ "pattern": { "type": "string", "default": "src/**/*.js" },
7
+ "files": { "type": "string[]", "default": [] },
8
+ "snippets": { "type": "string[]", "default": [], "reducer": "append" },
9
+ "report": { "type": "string", "default": "" }
10
+ },
11
+ "nodes": [
12
+ {
13
+ "id": "list",
14
+ "do": "tool",
15
+ "tool": "glob",
16
+ "args": { "pattern": { "$state": "pattern" } },
17
+ "out": { "files": "lines" }
18
+ },
19
+ {
20
+ "id": "read",
21
+ "do": "map",
22
+ "over": "files",
23
+ "maxConcurrency": 8,
24
+ "body": {
25
+ "do": "tool",
26
+ "tool": "read",
27
+ "args": { "file_path": { "$state": "item" } },
28
+ "out": { "snippets": "text" }
29
+ }
30
+ },
31
+ {
32
+ "id": "review",
33
+ "do": "model",
34
+ "prompt": ["Review these source files. Give the main risks and the smallest next action:\n", { "$state": "snippets" }],
35
+ "out": { "report": "text" }
36
+ },
37
+ {
38
+ "id": "write",
39
+ "do": "tool",
40
+ "tool": "write",
41
+ "args": { "file_path": "scan-report.md", "content": { "$state": "report" } },
42
+ "out": {}
43
+ }
44
+ ],
45
+ "edges": [
46
+ { "from": "START", "to": "list" },
47
+ { "from": "list", "to": "read" },
48
+ { "from": "read", "to": "review" },
49
+ { "from": "review", "to": "write" },
50
+ { "from": "write", "to": "END" }
51
+ ],
52
+ "output": ["report"],
53
+ "maxSteps": 20
54
+ }
@@ -0,0 +1,94 @@
1
+ {
2
+ "ir": 1,
3
+ "name": "research-brief",
4
+ "description": "Read a folder, extract one row per file, approve an outline, and write a brief.",
5
+ "state": {
6
+ "pattern": { "type": "string", "default": "topics/*.txt" },
7
+ "files": { "type": "string[]", "default": [] },
8
+ "contents": { "type": "string[]", "default": [], "reducer": "append" },
9
+ "extracts": { "type": "json", "default": [], "reducer": "append" },
10
+ "outline": { "type": "string", "default": "" },
11
+ "decision": { "type": "string", "default": "" },
12
+ "brief": { "type": "string", "default": "" }
13
+ },
14
+ "nodes": [
15
+ {
16
+ "id": "list",
17
+ "do": "tool",
18
+ "tool": "glob",
19
+ "args": { "pattern": { "$state": "pattern" } },
20
+ "out": { "files": "lines" }
21
+ },
22
+ {
23
+ "id": "read",
24
+ "do": "map",
25
+ "over": "files",
26
+ "maxConcurrency": 8,
27
+ "body": {
28
+ "do": "tool",
29
+ "tool": "read",
30
+ "args": { "file_path": { "$state": "item" } },
31
+ "out": { "contents": "text" }
32
+ }
33
+ },
34
+ {
35
+ "id": "extract",
36
+ "do": "map",
37
+ "over": "contents",
38
+ "maxConcurrency": 8,
39
+ "body": {
40
+ "do": "model",
41
+ "prompt": ["Extract topic, claim and risk as JSON. Source:\n", { "$state": "item" }],
42
+ "schema": {
43
+ "type": "object",
44
+ "required": ["topic", "claim", "risk"],
45
+ "properties": {
46
+ "topic": { "type": "string" },
47
+ "claim": { "type": "string" },
48
+ "risk": { "type": "string" }
49
+ }
50
+ },
51
+ "out": { "extracts": "json" }
52
+ }
53
+ },
54
+ {
55
+ "id": "draft_outline",
56
+ "do": "model",
57
+ "prompt": ["Draft a one-paragraph summary and an ordered outline from these extracts:\n", { "$state": "extracts" }],
58
+ "out": { "outline": "text" }
59
+ },
60
+ {
61
+ "id": "approve",
62
+ "do": "gate",
63
+ "question": "Approve this outline before I write the brief?",
64
+ "options": ["Approve", "Revise"],
65
+ "out": { "decision": "text" }
66
+ },
67
+ {
68
+ "id": "compose",
69
+ "do": "model",
70
+ "prompt": ["Write the final brief from this approved outline.\nOutline:\n", { "$state": "outline" }],
71
+ "out": { "brief": "text" }
72
+ },
73
+ {
74
+ "id": "write",
75
+ "do": "tool",
76
+ "tool": "write",
77
+ "args": { "file_path": "brief.md", "content": { "$state": "brief" } },
78
+ "out": {}
79
+ }
80
+ ],
81
+ "edges": [
82
+ { "from": "START", "to": "list" },
83
+ { "from": "list", "to": "read" },
84
+ { "from": "read", "to": "extract" },
85
+ { "from": "extract", "to": "draft_outline" },
86
+ { "from": "draft_outline", "to": "approve" },
87
+ { "from": "approve", "to": "compose", "when": { "op": "eq", "args": [{ "$state": "decision" }, "Approve"] } },
88
+ { "from": "approve", "to": "END", "when": true },
89
+ { "from": "compose", "to": "write" },
90
+ { "from": "write", "to": "END" }
91
+ ],
92
+ "output": ["brief", "decision"],
93
+ "maxSteps": 30
94
+ }
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lzn1998/dsh-langgraph",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "type": "module",
5
5
  "description": "Durable LangGraph graphs as DSH tools: register TS/JS graphs or compose session-owned ones from strict JSON, advertise them in the system prompt, run, resume and time-travel them, give them durable long-term memory, ask the user in the native question UI, run them as background jobs, delegate to DSH subagents, recover from structured failures, trace every node/tool/model call in Trajectory, draw their topology in a Web panel, and let graph nodes call this session's own tools.",
6
6
  "repository": {
@@ -37,13 +37,16 @@
37
37
  "graphs",
38
38
  "locale",
39
39
  "docs",
40
+ "gallery",
40
41
  "lib/client.js",
41
42
  "client/index.tsx",
42
43
  "scripts/build-client.mjs",
43
44
  "icon.svg",
44
45
  "cordis.patch.yml",
45
46
  "README.md",
46
- "LICENSE"
47
+ "LICENSE",
48
+ "bench",
49
+ "media"
47
50
  ],
48
51
  "engines": {
49
52
  "dsh": ">=0.2.2-rc.5 <0.3.0",