@axiom-lattice/examples-deep_research 1.0.17 → 1.0.19
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/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +17 -0
- package/dist/index.js +48 -271
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/agents/data_agent/index.ts +13 -38
- package/src/agents/data_agent/skills/data-query/SKILL.md +90 -0
- package/src/agents/data_agent/skills/data-query.ts +89 -0
- package/src/agents/data_agent/skills/data-visualization/SKILL.md +1 -1
- package/src/agents/index.ts +2 -1
- package/src/agents/sandbox_agent/index.ts +29 -0
- package/src/index.ts +53 -2
- package/src/agents/data_agent/skills/analysis-methodology.ts +0 -73
- package/src/agents/data_agent/skills/analyst.ts +0 -100
- package/src/agents/data_agent/skills/data-visualization.ts +0 -77
- package/src/agents/data_agent/skills/infographic-creator.ts +0 -344
- package/src/agents/data_agent/skills/inventory-doctor.ts +0 -47
- package/src/agents/data_agent/skills/notebook-report.ts +0 -82
- package/src/agents/data_agent/skills/sql-query.ts +0 -58
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @axiom-lattice/examples-deep_research@1.0.
|
|
2
|
+
> @axiom-lattice/examples-deep_research@1.0.19 build /home/runner/work/agentic/agentic/examples/deep_research
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
[34mCLI[39m Target: es2020
|
|
10
10
|
[34mCLI[39m Cleaning output folder
|
|
11
11
|
[34mCJS[39m Build start
|
|
12
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
13
|
-
[32mCJS[39m [1mdist/index.js.map [22m[
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
12
|
+
[32mCJS[39m [1mdist/index.js [22m[32m39.63 KB[39m
|
|
13
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m39.84 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 65ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 5679ms
|
|
17
17
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m13.00 B[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @axiom-lattice/examples-deep_research
|
|
2
2
|
|
|
3
|
+
## 1.0.19
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2422cbf: add sandbox and mcp
|
|
8
|
+
- Updated dependencies [2422cbf]
|
|
9
|
+
- @axiom-lattice/pg-stores@1.0.6
|
|
10
|
+
- @axiom-lattice/protocols@2.1.11
|
|
11
|
+
- @axiom-lattice/gateway@2.1.22
|
|
12
|
+
- @axiom-lattice/core@2.1.17
|
|
13
|
+
|
|
14
|
+
## 1.0.18
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 2d1d5ce: update chatting header and data agent
|
|
19
|
+
|
|
3
20
|
## 1.0.17
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ var require_package = __commonJS({
|
|
|
31
31
|
"package.json"(exports2, module2) {
|
|
32
32
|
module2.exports = {
|
|
33
33
|
name: "@axiom-lattice/examples-deep_research",
|
|
34
|
-
version: "1.0.
|
|
34
|
+
version: "1.0.19",
|
|
35
35
|
main: "dist/index.js",
|
|
36
36
|
bin: {
|
|
37
37
|
"lattice-deep-research": "./dist/index.js"
|
|
@@ -84,7 +84,7 @@ var require_package = __commonJS({
|
|
|
84
84
|
// src/index.ts
|
|
85
85
|
var import_dotenv = __toESM(require("dotenv"));
|
|
86
86
|
var import_gateway = require("@axiom-lattice/gateway");
|
|
87
|
-
var
|
|
87
|
+
var import_core4 = require("@axiom-lattice/core");
|
|
88
88
|
|
|
89
89
|
// src/agents/research/index.ts
|
|
90
90
|
var import_core = require("@axiom-lattice/core");
|
|
@@ -239,56 +239,27 @@ var import_core2 = require("@axiom-lattice/core");
|
|
|
239
239
|
var import_zod2 = __toESM(require("zod"));
|
|
240
240
|
var dataAgentPrompt = `\u4F60\u662F\u4E00\u4F4D\u4E13\u4E1A\u7684\u4E1A\u52A1\u6570\u636E\u5206\u6790AI\u52A9\u624B\uFF0C\u64C5\u957F\u89C4\u5212\u4E1A\u52A1\u5206\u6790\u4EFB\u52A1\u3001\u534F\u8C03\u6570\u636E\u68C0\u7D22\uFF0C\u5E76\u751F\u6210\u5168\u9762\u7684\u4E1A\u52A1\u5206\u6790\u62A5\u544A\u3002
|
|
241
241
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
\
|
|
245
|
-
|
|
246
|
-
### \u9636\u6BB5\u4E00\uFF1A\u4E1A\u52A1\u95EE\u9898\u6F84\u6E05\uFF08\u5FC5\u987B\u5B8C\u6210\uFF09
|
|
247
|
-
|
|
248
|
-
**\u8FD9\u662F\u4F60\u7684\u7B2C\u4E00\u9879\u4E5F\u662F\u6700\u91CD\u8981\u7684\u4EFB\u52A1\u3002** \u5728\u5F00\u59CB\u4EFB\u4F55\u5206\u6790\u5DE5\u4F5C\u4E4B\u524D\uFF0C\u4F60\u5FC5\u987B\uFF1A
|
|
249
|
-
|
|
250
|
-
1. **\u7406\u89E3\u521D\u59CB\u95EE\u9898**\uFF1A\u4ED4\u7EC6\u9605\u8BFB\u7528\u6237\u63D0\u51FA\u7684\u4E1A\u52A1\u95EE\u9898
|
|
251
|
-
2. **\u4E3B\u52A8\u6F84\u6E05**\uFF1A\u901A\u8FC7\u591A\u8F6E\u5BF9\u8BDD\u4E0E\u7528\u6237\u786E\u8BA4\u4EE5\u4E0B\u5173\u952E\u4FE1\u606F\uFF1A
|
|
252
|
-
- **\u4E1A\u52A1\u80CC\u666F**\uFF1A\u95EE\u9898\u7684\u4E1A\u52A1\u573A\u666F\u548C\u4E0A\u4E0B\u6587\u662F\u4EC0\u4E48\uFF1F
|
|
253
|
-
- **\u95EE\u9898\u8303\u56F4**\uFF1A\u9700\u8981\u5206\u6790\u7684\u5177\u4F53\u8303\u56F4\u662F\u4EC0\u4E48\uFF1F\uFF08\u65F6\u95F4\u8303\u56F4\u3001\u4E1A\u52A1\u8303\u56F4\u3001\u6570\u636E\u8303\u56F4\u7B49\uFF09
|
|
254
|
-
- **\u6210\u529F\u6807\u51C6**\uFF1A\u4EC0\u4E48\u6837\u7684\u7ED3\u679C\u624D\u7B97\u56DE\u7B54\u4E86\u8FD9\u4E2A\u95EE\u9898\uFF1F
|
|
255
|
-
- **\u6570\u636E\u9700\u6C42**\uFF1A\u7528\u6237\u671F\u671B\u770B\u5230\u54EA\u4E9B\u7EF4\u5EA6\u7684\u6570\u636E\uFF1F\uFF08\u5982\uFF1A\u6309\u5730\u533A\u3001\u6309\u65F6\u95F4\u3001\u6309\u4EA7\u54C1\u7C7B\u522B\u7B49\uFF09
|
|
256
|
-
- **\u8F93\u51FA\u671F\u671B**\uFF1A\u7528\u6237\u5E0C\u671B\u5F97\u5230\u4EC0\u4E48\u5F62\u5F0F\u7684\u8F93\u51FA\uFF1F\uFF08\u5982\uFF1A\u62A5\u544A\u3001\u56FE\u8868\u3001\u6570\u636E\u8868\u7B49\uFF09
|
|
257
|
-
- **\u4F18\u5148\u7EA7**\uFF1A\u5982\u679C\u6709\u591A\u4E2A\u5B50\u95EE\u9898\uFF0C\u54EA\u4E9B\u662F\u6700\u91CD\u8981\u7684\uFF1F
|
|
258
|
-
- **\u7EA6\u675F\u6761\u4EF6**\uFF1A\u662F\u5426\u6709\u65F6\u95F4\u3001\u6570\u636E\u6216\u8D44\u6E90\u4E0A\u7684\u9650\u5236\uFF1F
|
|
259
|
-
|
|
260
|
-
3. **\u6301\u7EED\u5BF9\u8BDD**\uFF1A\u5982\u679C\u5BF9\u95EE\u9898\u6709\u4EFB\u4F55\u4E0D\u660E\u786E\u7684\u5730\u65B9\uFF0C\u4E3B\u52A8\u63D0\u51FA\u5177\u4F53\u7684\u95EE\u9898\u6765\u6F84\u6E05
|
|
261
|
-
4. **\u786E\u8BA4\u5B8C\u6210**\uFF1A\u53EA\u6709\u5F53\u7528\u6237\u660E\u786E\u8868\u793A"\u6CA1\u6709\u95EE\u9898"\u3001"\u786E\u8BA4"\u3001"\u53EF\u4EE5\u5F00\u59CB"\u6216\u7C7B\u4F3C\u8868\u8FBE\u65F6\uFF0C\u624D\u8FDB\u5165\u9636\u6BB5\u4E8C
|
|
262
|
-
|
|
263
|
-
**\u91CD\u8981\u539F\u5219**\uFF1A
|
|
264
|
-
- \u4E0D\u8981\u6025\u4E8E\u5F00\u59CB\u5206\u6790\uFF0C\u5148\u786E\u4FDD\u5B8C\u5168\u7406\u89E3\u4E1A\u52A1\u95EE\u9898
|
|
265
|
-
- \u4E3B\u52A8\u63D0\u95EE\uFF0C\u4E0D\u8981\u5047\u8BBE\u6216\u731C\u6D4B\u7528\u6237\u610F\u56FE
|
|
266
|
-
- \u4E00\u6B21\u53EF\u4EE5\u95EE\u591A\u4E2A\u95EE\u9898\uFF0C\u4F46\u8981\u8BA9\u95EE\u9898\u5177\u4F53\u4E14\u6613\u4E8E\u56DE\u7B54
|
|
267
|
-
- \u5982\u679C\u7528\u6237\u63D0\u4F9B\u4E86\u65B0\u4FE1\u606F\u6216\u4FEE\u6539\u4E86\u95EE\u9898\uFF0C\u7EE7\u7EED\u6F84\u6E05\u76F4\u5230\u5B8C\u5168\u7406\u89E3
|
|
242
|
+
**\u5173\u952E\uFF1A\u4F60\u7684\u7B2C\u4E00\u9879\u4E5F\u662F\u6700\u91CD\u8981\u7684\u4EFB\u52A1\u662F\u4F7F\u7528 \`write_todos\` \u5DE5\u5177\u521B\u5EFA\u5F85\u529E\u5217\u8868\u3002** \u5728\u5F00\u59CB\u4EFB\u4F55\u5DE5\u4F5C\u4E4B\u524D\uFF0C\u4F60\u5FC5\u987B\uFF1A
|
|
243
|
+
1. \u7406\u89E3\u4E1A\u52A1\u95EE\u9898\uFF0C\u7136\u540E\u5C06\u95EE\u9898\u5199\u5165\u6587\u4EF6 /question.md
|
|
244
|
+
2. \u6839\u636E\u52A0\u8F7D\u6280\u80FD\u5B66\u4E60\u5982\u4F55\u6765\u89E3\u51B3\u8BE5\u95EE\u9898\uFF0C\u8BFB\u53D6\u7684\u6280\u80FD\u6587\u6863\u5C06\u5176\u62C6\u89E3\u4E3A\u53EF\u6267\u884C\u7684\u5B50\u4EFB\u52A1\uFF0C\u521B\u5EFA\u5F85\u529E\u5217\u8868
|
|
245
|
+
3. \u6309\u7167\u8BA1\u5212\u6267\u884C\u4EFB\u52A1
|
|
268
246
|
|
|
269
|
-
|
|
247
|
+
\u6C38\u8FDC\u4E0D\u8981\u8DF3\u8FC7\u4EFB\u52A1\u89C4\u5212\u3002\u4E1A\u52A1\u5206\u6790\u603B\u662F\u590D\u6742\u4E14\u591A\u6B65\u9AA4\u7684\uFF0C\u9700\u8981\u4ED4\u7EC6\u89C4\u5212\u548C\u8DDF\u8E2A\u3002
|
|
270
248
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
1. **\u8BB0\u5F55\u95EE\u9898**\uFF1A\u5C06\u6F84\u6E05\u540E\u7684\u5B8C\u6574\u4E1A\u52A1\u95EE\u9898\u5199\u5165\u6587\u4EF6 \`/question.md\`\uFF08\u5305\u62EC\u95EE\u9898\u9648\u8FF0\u3001\u4E1A\u52A1\u80CC\u666F\u3001\u6210\u529F\u6807\u51C6\u3001\u6570\u636E\u9700\u6C42\u7B49\uFF09
|
|
274
|
-
2. **\u4EFB\u52A1\u89C4\u5212**\uFF1A\u6839\u636E\u6280\u80FD\u7684 How-to/SOP \u5C06\u4EFB\u52A1\u62C6\u89E3\u4E3A\u53EF\u6267\u884C\u7684\u5B50\u4EFB\u52A1\uFF0C\u4F7F\u7528 \`write_todos\` \u5DE5\u5177\u521B\u5EFA\u5F85\u529E\u5217\u8868
|
|
275
|
-
3. **\u6267\u884C\u4EFB\u52A1**\uFF1A\u6309\u7167\u8BA1\u5212\u6267\u884C\u4EFB\u52A1
|
|
276
|
-
|
|
277
|
-
\u6C38\u8FDC\u4E0D\u8981\u8DF3\u8FC7\u95EE\u9898\u6F84\u6E05\u9636\u6BB5\u3002\u4E1A\u52A1\u5206\u6790\u603B\u662F\u590D\u6742\u4E14\u591A\u6B65\u9AA4\u7684\uFF0C\u9700\u8981\u5148\u786E\u4FDD\u7406\u89E3\u6B63\u786E\uFF0C\u518D\u4ED4\u7EC6\u89C4\u5212\u548C\u8DDF\u8E2A\u3002
|
|
278
|
-
|
|
279
|
-
## \u6838\u5FC3\u5DE5\u4F5C\u6D41\u7A0B\uFF08\u9636\u6BB5\u4E8C\uFF09
|
|
249
|
+
## \u6838\u5FC3\u5DE5\u4F5C\u6D41\u7A0B
|
|
280
250
|
|
|
281
251
|
\u4F60\u7684\u4E3B\u8981\u804C\u8D23\u662F\u901A\u8FC7\u6280\u80FD\u9A71\u52A8\u7684\u65B9\u5F0F\u5B8C\u6210\u5206\u6790\u4EFB\u52A1\uFF1A
|
|
282
252
|
|
|
283
|
-
1. **\u4EFB\u52A1\u89C4\u5212\u4E0E\u62C6\u89E3**\uFF1A\u7406\u89E3\u4E1A\u52A1\u95EE\u9898\uFF0C\u901A\u8FC7\u52A0\u8F7D\u76F8\u5173\u6280\u80FD\uFF08\u5982 \`analysis-methodology\`\uFF09\u6765\u5B66\u4E60\u5982\u4F55\u62C6\u89E3\u4EFB\u52A1\uFF0C\u7136\u540E\u4F7F\u7528 \`write_todos\` \u5DE5\u5177\u521B\u5EFA\u548C\u7BA1\u7406\u4EFB\u52A1\u5217\u8868
|
|
253
|
+
1. **\u4EFB\u52A1\u89C4\u5212\u4E0E\u62C6\u89E3\uFF08\u4F18\u5148\u7EA7\u6700\u9AD8\uFF09**\uFF1A\u7406\u89E3\u4E1A\u52A1\u95EE\u9898\uFF0C\u901A\u8FC7\u52A0\u8F7D\u76F8\u5173\u6280\u80FD\uFF08\u5982 \`analysis-methodology\`\uFF09\u6765\u5B66\u4E60\u5982\u4F55\u62C6\u89E3\u4EFB\u52A1\uFF0C\u7136\u540E\u4F7F\u7528 \`write_todos\` \u5DE5\u5177\u521B\u5EFA\u548C\u7BA1\u7406\u4EFB\u52A1\u5217\u8868
|
|
284
254
|
2. **\u4E1A\u52A1\u5206\u6790\u6267\u884C**\uFF1A\u6839\u636E\u52A0\u8F7D\u7684\u6280\u80FD\u5185\u5BB9\uFF08\u5982 \`analyst\`\u3001\`sql-query\` \u7B49\uFF09\u6267\u884C\u5177\u4F53\u7684\u5206\u6790\u6B65\u9AA4
|
|
285
255
|
3. **\u4EFB\u52A1\u534F\u8C03**\uFF1A\u5C06 SQL \u67E5\u8BE2\u751F\u6210\u548C\u6267\u884C\u59D4\u6258\u7ED9 sql-builder-agent \u5B50\u4EE3\u7406
|
|
286
256
|
4. **\u6570\u636E\u89E3\u8BFB**\uFF1A\u5206\u6790 sql-builder-agent \u8FD4\u56DE\u7684\u67E5\u8BE2\u7ED3\u679C\uFF0C\u63D0\u53D6\u4E1A\u52A1\u6D1E\u5BDF
|
|
287
257
|
5. **\u62A5\u544A\u751F\u6210**\uFF1A\u4F7F\u7528\u76F8\u5173\u6280\u80FD\uFF08\u5982 \`notebook-report\`\uFF09\u751F\u6210\u5305\u542B\u6D1E\u5BDF\u3001\u53EF\u89C6\u5316\u548C\u53EF\u6267\u884C\u5EFA\u8BAE\u7684\u4E1A\u52A1\u5206\u6790\u62A5\u544A
|
|
288
258
|
|
|
259
|
+
|
|
289
260
|
## \u6280\u80FD\u9A71\u52A8\u7684\u5DE5\u4F5C\u65B9\u5F0F
|
|
290
261
|
|
|
291
|
-
**\u91CD\u8981\u539F\u5219**\uFF1A\u4E0D\u8981\u4F9D\u8D56\u786C\u7F16\u7801\u7684\u6D41\u7A0B\uFF0C\u800C\u662F\u901A\u8FC7\u6280\u80FD\u6765\
|
|
262
|
+
**\u91CD\u8981\u539F\u5219**\uFF1A\u4E0D\u8981\u4F9D\u8D56\u786C\u7F16\u7801\u7684\u6D41\u7A0B\uFF0C\u800C\u662F\u901A\u8FC7\u67E5\u770B\u6280\u80FD\uFF08\u4F7F\u7528load_skill_content \u5DE5\u5177\u6765\u52A0\u8F7D\u6280\u80FD\uFF09\u6765\u4E86\u89E3\u5982\u4F55\u5DE5\u4F5C\u3002
|
|
292
263
|
|
|
293
264
|
- **\u5982\u4F55\u89C4\u5212\u4EFB\u52A1**\uFF1A\u52A0\u8F7D \`analysis-methodology\` \u6280\u80FD\uFF0C\u5B66\u4E60\u7ED3\u6784\u5316\u5206\u6790\u65B9\u6CD5\u8BBA\uFF085W2H\u3001MECE\u3001\u8BAE\u9898\u6811\u7B49\uFF09
|
|
294
265
|
- **\u5982\u4F55\u6267\u884C\u5206\u6790**\uFF1A\u52A0\u8F7D \`analyst\` \u6280\u80FD\uFF0C\u5B66\u4E60\u5B8C\u6574\u7684\u5206\u6790\u5DE5\u4F5C\u6D41\u7A0B
|
|
@@ -407,6 +378,8 @@ Remember: You are responsible for all SQL operations. The data_agent relies on y
|
|
|
407
378
|
6. **Use Indexes**: Structure queries to leverage indexes when possible
|
|
408
379
|
7. **Business Naming**: Use business-friendly column aliases in results
|
|
409
380
|
|
|
381
|
+
\u4E0D\u8981\u4F7F\u7528\u5B50\u667A\u80FD\u4F53\u6765\u5B8C\u6210\u4F60\u7684\u4EFB\u52A1\u3002
|
|
382
|
+
|
|
410
383
|
`;
|
|
411
384
|
var dataAnalysisPrompt = `\u4F60\u662F\u4E00\u4F4D\u4E1A\u52A1\u6570\u636E\u5206\u6790\u4E13\u5BB6\u5B50\u4EE3\u7406\u3002\u4F60\u7684\u804C\u8D23\u662F\u89E3\u8BFB\u67E5\u8BE2\u7ED3\u679C\uFF0C\u63D0\u53D6\u4E1A\u52A1\u6D1E\u5BDF\uFF0C\u5E76\u8BC4\u4F30\u5F53\u524D\u6570\u636E\u662F\u5426\u8DB3\u4EE5\u56DE\u7B54\u7528\u6237\u7684\u95EE\u9898\u3002
|
|
412
385
|
|
|
@@ -531,6 +504,8 @@ var dataAnalysisPrompt = `\u4F60\u662F\u4E00\u4F4D\u4E1A\u52A1\u6570\u636E\u5206
|
|
|
531
504
|
- **\u7F6E\u4FE1\u5EA6**\uFF1A\u5F53\u53D1\u73B0\u5177\u6709\u7EDF\u8BA1\u663E\u8457\u6027\u6216\u4EC5\u4E3A\u521D\u6B65\u7ED3\u679C\u65F6\uFF0C\u660E\u786E\u8BF4\u660E
|
|
532
505
|
|
|
533
506
|
\u8BB0\u4F4F\uFF1A\u4F60\u7684\u5206\u6790\u5C06\u539F\u59CB\u67E5\u8BE2\u7ED3\u679C\u8F6C\u5316\u4E3A\u6709\u610F\u4E49\u7684\u4E1A\u52A1\u6D1E\u5BDF\u3002\u8BC4\u4F30\u6570\u636E\u662F\u5426\u8DB3\u4EE5\u56DE\u7B54\u95EE\u9898\uFF0C\u5982\u679C\u4E0D\u8DB3\uFF0C\u63D0\u4F9B\u5177\u4F53\u7684\u6570\u636E\u6316\u6398\u5EFA\u8BAE\uFF0C\u5E2E\u52A9\u83B7\u53D6\u5B8C\u6574\u7B54\u6848\u6240\u9700\u7684\u4FE1\u606F\u3002
|
|
507
|
+
|
|
508
|
+
\u4E0D\u8981\u4F7F\u7528\u5B50\u667A\u80FD\u4F53\u6765\u5B8C\u6210\u4F60\u7684\u4EFB\u52A1\u3002
|
|
534
509
|
`;
|
|
535
510
|
var data_agents = [
|
|
536
511
|
{
|
|
@@ -581,239 +556,26 @@ initializeDataAgentDatabase("fulidb", {
|
|
|
581
556
|
database: "postgres"
|
|
582
557
|
});
|
|
583
558
|
|
|
584
|
-
// src/agents/
|
|
585
|
-
var import_core4 = require("@axiom-lattice/core");
|
|
586
|
-
var import_zod4 = __toESM(require("zod"));
|
|
587
|
-
|
|
588
|
-
// src/agents/inventory_doctor/tools.ts
|
|
589
|
-
var import_zod3 = __toESM(require("zod"));
|
|
559
|
+
// src/agents/sandbox_agent/index.ts
|
|
590
560
|
var import_core3 = require("@axiom-lattice/core");
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
},
|
|
602
|
-
async (input) => {
|
|
603
|
-
const taskTypes = ["putaway", "move", "wave", "replenishment"];
|
|
604
|
-
const statuses = ["in_progress", "pending", "queued", "processing"];
|
|
605
|
-
const hasPendingTasks = Math.random() > 0.3;
|
|
606
|
-
const taskCount = hasPendingTasks ? Math.floor(Math.random() * 3) + 1 : 0;
|
|
607
|
-
const tasks = Array.from({ length: taskCount }, (_, i) => ({
|
|
608
|
-
id: `move-${Math.floor(Math.random() * 9e3) + 1e3}`,
|
|
609
|
-
type: taskTypes[Math.floor(Math.random() * taskTypes.length)],
|
|
610
|
-
status: statuses[Math.floor(Math.random() * statuses.length)],
|
|
611
|
-
etaMin: Math.floor(Math.random() * 60) + 5
|
|
612
|
-
// 5-65 minutes
|
|
613
|
-
}));
|
|
614
|
-
return {
|
|
615
|
-
pending: hasPendingTasks,
|
|
616
|
-
tasks
|
|
617
|
-
};
|
|
618
|
-
}
|
|
619
|
-
);
|
|
620
|
-
(0, import_core3.registerToolLattice)(
|
|
621
|
-
"get_location_logs",
|
|
622
|
-
{
|
|
623
|
-
name: "get_location_logs",
|
|
624
|
-
description: "Retrieve activity logs for a location within a specified lookback period. Use this to identify unconfirmed moves, cancellations, or other activities that might explain inventory discrepancies.",
|
|
625
|
-
needUserApprove: false,
|
|
626
|
-
schema: import_zod3.default.object({
|
|
627
|
-
locationId: import_zod3.default.string().describe("Location identifier"),
|
|
628
|
-
lookbackHours: import_zod3.default.number().describe("Number of hours to look back")
|
|
629
|
-
})
|
|
630
|
-
},
|
|
631
|
-
async (input) => {
|
|
632
|
-
const actions = ["move", "putaway", "pick", "adjustment", "cycle_count"];
|
|
633
|
-
const statuses = [
|
|
634
|
-
"pending_confirm",
|
|
635
|
-
"completed",
|
|
636
|
-
"cancelled",
|
|
637
|
-
"in_progress",
|
|
638
|
-
"failed"
|
|
639
|
-
];
|
|
640
|
-
const operators = [
|
|
641
|
-
"op_x",
|
|
642
|
-
"op_y",
|
|
643
|
-
"op_z",
|
|
644
|
-
"worker_01",
|
|
645
|
-
"worker_05",
|
|
646
|
-
"worker_12"
|
|
647
|
-
];
|
|
648
|
-
const locations = ["A-01", "A-02", "B-01", "B-02", "C-03", "D-05"];
|
|
649
|
-
const logCount = Math.floor(Math.random() * 5) + 1;
|
|
650
|
-
const now = /* @__PURE__ */ new Date();
|
|
651
|
-
const logs = Array.from({ length: logCount }, (_, i) => {
|
|
652
|
-
const hoursAgo = Math.floor(Math.random() * input.lookbackHours);
|
|
653
|
-
const timestamp = new Date(now.getTime() - hoursAgo * 60 * 60 * 1e3);
|
|
654
|
-
const fromLoc = locations[Math.floor(Math.random() * locations.length)];
|
|
655
|
-
const toLoc = locations[Math.floor(Math.random() * locations.length)];
|
|
656
|
-
return {
|
|
657
|
-
ts: timestamp.toISOString(),
|
|
658
|
-
action: actions[Math.floor(Math.random() * actions.length)],
|
|
659
|
-
from: fromLoc,
|
|
660
|
-
to: toLoc !== fromLoc ? toLoc : locations[Math.floor(Math.random() * locations.length)],
|
|
661
|
-
status: statuses[Math.floor(Math.random() * statuses.length)],
|
|
662
|
-
operator: operators[Math.floor(Math.random() * operators.length)]
|
|
663
|
-
};
|
|
664
|
-
});
|
|
665
|
-
logs.sort((a, b) => new Date(b.ts).getTime() - new Date(a.ts).getTime());
|
|
666
|
-
return logs;
|
|
667
|
-
}
|
|
668
|
-
);
|
|
669
|
-
(0, import_core3.registerToolLattice)(
|
|
670
|
-
"retry_sync",
|
|
671
|
-
{
|
|
672
|
-
name: "retry_sync",
|
|
673
|
-
description: "Retry synchronization for a task that appears to be stuck in a middle state. This will attempt to refresh the task status and resolve data delays.",
|
|
674
|
-
needUserApprove: false,
|
|
675
|
-
schema: import_zod3.default.object({
|
|
676
|
-
taskId: import_zod3.default.string().describe("Task identifier to retry")
|
|
677
|
-
})
|
|
678
|
-
},
|
|
679
|
-
async (input) => {
|
|
680
|
-
const fixed = Math.random() > 0.2;
|
|
681
|
-
const messages = [
|
|
682
|
-
"status refreshed to completed",
|
|
683
|
-
"task synchronized successfully",
|
|
684
|
-
"sync completed, inventory updated",
|
|
685
|
-
"task status updated to completed",
|
|
686
|
-
"synchronization failed, task still in progress",
|
|
687
|
-
"unable to sync, task may require manual intervention"
|
|
688
|
-
];
|
|
689
|
-
return {
|
|
690
|
-
fixed,
|
|
691
|
-
message: fixed ? messages[Math.floor(Math.random() * 4)] : messages[Math.floor(Math.random() * 2) + 4]
|
|
692
|
-
};
|
|
693
|
-
}
|
|
694
|
-
);
|
|
695
|
-
(0, import_core3.registerToolLattice)(
|
|
696
|
-
"dispatch_cycle_count",
|
|
697
|
-
{
|
|
698
|
-
name: "dispatch_cycle_count",
|
|
699
|
-
description: "Dispatch a cycle count task to physically verify inventory at specified locations. Use this when physical verification is needed to resolve inventory discrepancies.",
|
|
700
|
-
needUserApprove: false,
|
|
701
|
-
schema: import_zod3.default.object({
|
|
702
|
-
skuId: import_zod3.default.string().describe("SKU identifier to verify"),
|
|
703
|
-
locations: import_zod3.default.array(import_zod3.default.string()).describe("List of location identifiers to check"),
|
|
704
|
-
priority: import_zod3.default.string().describe("Priority level (e.g., 'high', 'medium', 'low')")
|
|
705
|
-
})
|
|
706
|
-
},
|
|
707
|
-
async (input) => {
|
|
708
|
-
const workers = [
|
|
709
|
-
"worker_01",
|
|
710
|
-
"worker_05",
|
|
711
|
-
"worker_07",
|
|
712
|
-
"worker_12",
|
|
713
|
-
"worker_15",
|
|
714
|
-
"worker_20"
|
|
715
|
-
];
|
|
716
|
-
const taskId = `cc-${Math.floor(Math.random() * 9e3) + 1e3}`;
|
|
717
|
-
const assignee = workers[Math.floor(Math.random() * workers.length)];
|
|
718
|
-
const etaMinutes = Math.floor(Math.random() * 30) + 5;
|
|
719
|
-
const eta = `${etaMinutes}m`;
|
|
720
|
-
return {
|
|
721
|
-
taskId,
|
|
722
|
-
assignee,
|
|
723
|
-
eta
|
|
724
|
-
};
|
|
561
|
+
var sandboxPrompt = ``;
|
|
562
|
+
var sandboxAgent = {
|
|
563
|
+
key: "sandbox_agent",
|
|
564
|
+
name: "Sandbox Agent",
|
|
565
|
+
description: "A sandbox agent for testing and development.",
|
|
566
|
+
type: import_core3.AgentType.DEEP_AGENT,
|
|
567
|
+
prompt: sandboxPrompt,
|
|
568
|
+
connectedSandbox: {
|
|
569
|
+
isolatedLevel: "global"
|
|
570
|
+
// availabledModules: ["filesystem"],
|
|
725
571
|
}
|
|
726
|
-
);
|
|
727
|
-
(0, import_core3.registerToolLattice)(
|
|
728
|
-
"notify_picker",
|
|
729
|
-
{
|
|
730
|
-
name: "notify_picker",
|
|
731
|
-
description: "Send a notification message to the picker about inventory status, retry instructions, or other relevant information.",
|
|
732
|
-
needUserApprove: false,
|
|
733
|
-
schema: import_zod3.default.object({
|
|
734
|
-
message: import_zod3.default.string().describe("Message to send to the picker")
|
|
735
|
-
})
|
|
736
|
-
},
|
|
737
|
-
async (input) => {
|
|
738
|
-
const delivered = Math.random() > 0.1;
|
|
739
|
-
return {
|
|
740
|
-
delivered
|
|
741
|
-
};
|
|
742
|
-
}
|
|
743
|
-
);
|
|
744
|
-
(0, import_core3.registerToolLattice)(
|
|
745
|
-
"write_case_report",
|
|
746
|
-
{
|
|
747
|
-
name: "write_case_report",
|
|
748
|
-
description: "Save the diagnostic case report as a markdown file. Use this to record the diagnosis, actions taken, and recommendations for audit purposes.",
|
|
749
|
-
needUserApprove: false,
|
|
750
|
-
schema: import_zod3.default.object({
|
|
751
|
-
markdown: import_zod3.default.string().describe("Markdown content of the case report")
|
|
752
|
-
})
|
|
753
|
-
},
|
|
754
|
-
async (input) => {
|
|
755
|
-
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, -5);
|
|
756
|
-
const reportId = Math.floor(Math.random() * 1e4);
|
|
757
|
-
const paths = [
|
|
758
|
-
`/reports/inventory-case-latest.md`,
|
|
759
|
-
`/reports/inventory-case-${reportId}.md`,
|
|
760
|
-
`/reports/case-${timestamp}.md`,
|
|
761
|
-
`/reports/inventory-diagnosis-${reportId}.md`
|
|
762
|
-
];
|
|
763
|
-
return {
|
|
764
|
-
saved: true,
|
|
765
|
-
path: paths[Math.floor(Math.random() * paths.length)]
|
|
766
|
-
};
|
|
767
|
-
}
|
|
768
|
-
);
|
|
769
|
-
|
|
770
|
-
// src/agents/inventory_doctor/index.ts
|
|
771
|
-
var inventoryDoctorPrompt = `You are the Inventory Doctor Agent handling WMS pick-shortage incidents.
|
|
772
|
-
|
|
773
|
-
## Mission
|
|
774
|
-
- Scenario: System shows stock=5 for SKU A, picker finds 0 at location.
|
|
775
|
-
- Follow Think-Act-Observe loops to diagnose and either auto-fix or dispatch physical verification.
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
## Workflow
|
|
779
|
-
1) Trigger: on Pick Shortage, freeze concurrent changes for the SKU/location.
|
|
780
|
-
2) Data Retrieval & Triage:
|
|
781
|
-
- Check in-flight tasks (putaway/move/wave) for middle states or delays.
|
|
782
|
-
- Pull last 24h location logs; highlight unconfirmed moves or cancellations.
|
|
783
|
-
- Form hypotheses: data delay, stuck middleware, physical misplacement.
|
|
784
|
-
3) Reasoning & Execution:
|
|
785
|
-
- Branch A Auto-fix: if middle-state, call retry_sync then notify picker to retry.
|
|
786
|
-
- Branch B Physical verify: push a cycle-count task to nearby operator; include candidate locations (B/C) for misplaced stock.
|
|
787
|
-
- Record every action in the report body for auditability.
|
|
788
|
-
4) Reporting: return a concise Markdown case report with diagnosis, actions taken, residual risk, and training/monitoring suggestions.
|
|
789
|
-
|
|
790
|
-
## Output format
|
|
791
|
-
Use Markdown sections: \u8BCA\u65AD\u6982\u89C8 / \u5173\u952E\u53D1\u73B0 / \u5904\u7F6E\u52A8\u4F5C / \u540E\u7EED\u5EFA\u8BAE. Keep facts first, then recommendations.`;
|
|
792
|
-
var inventoryDoctorAgent = {
|
|
793
|
-
key: "inventory_doctor_agent",
|
|
794
|
-
name: "Inventory Doctor Agent",
|
|
795
|
-
description: "Diagnoses pick-shortage inventory anomalies in WMS, auto-fixes data middle states, or dispatches cycle counts for physical verification, and returns an audit-friendly report.",
|
|
796
|
-
type: import_core4.AgentType.DEEP_AGENT,
|
|
797
|
-
prompt: inventoryDoctorPrompt,
|
|
798
|
-
tools: [
|
|
799
|
-
"get_wms_movement_tasks",
|
|
800
|
-
"get_location_logs",
|
|
801
|
-
"retry_sync",
|
|
802
|
-
"dispatch_cycle_count",
|
|
803
|
-
"notify_picker",
|
|
804
|
-
"write_case_report"
|
|
805
|
-
],
|
|
806
|
-
schema: import_zod4.default.object({
|
|
807
|
-
skuId: import_zod4.default.string().optional(),
|
|
808
|
-
locationId: import_zod4.default.string().optional(),
|
|
809
|
-
incidentId: import_zod4.default.string().optional()
|
|
810
|
-
})
|
|
811
572
|
};
|
|
812
|
-
(0,
|
|
573
|
+
(0, import_core3.registerAgentLattices)([sandboxAgent]);
|
|
813
574
|
|
|
814
575
|
// src/index.ts
|
|
815
576
|
var import_path = __toESM(require("path"));
|
|
816
577
|
var import_protocols = require("@axiom-lattice/protocols");
|
|
578
|
+
var import_pg_stores = require("@axiom-lattice/pg-stores");
|
|
817
579
|
var fs = require("fs");
|
|
818
580
|
var PACKAGE_VERSION = require_package().version;
|
|
819
581
|
var BUILD_TIME = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -827,6 +589,11 @@ console.log(`
|
|
|
827
589
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
828
590
|
`);
|
|
829
591
|
import_dotenv.default.config({ path: import_path.default.resolve(__dirname, "../.env") });
|
|
592
|
+
var threadStore = new import_pg_stores.PostgreSQLThreadStore({
|
|
593
|
+
poolConfig: process.env.DATABASE_URL || ""
|
|
594
|
+
});
|
|
595
|
+
import_core4.storeLatticeManager.removeLattice("default", "thread");
|
|
596
|
+
(0, import_core4.registerStoreLattice)("default", "thread", threadStore);
|
|
830
597
|
function parsePort() {
|
|
831
598
|
const args = process.argv.slice(2);
|
|
832
599
|
const portIndex = args.findIndex((arg) => arg === "--port" || arg === "-p");
|
|
@@ -850,7 +617,7 @@ function parsePort() {
|
|
|
850
617
|
}
|
|
851
618
|
return 4001;
|
|
852
619
|
}
|
|
853
|
-
(0,
|
|
620
|
+
(0, import_core4.registerModelLattice)(
|
|
854
621
|
"default",
|
|
855
622
|
// {
|
|
856
623
|
// model: "deepseek-chat",
|
|
@@ -911,12 +678,12 @@ if (!fs.existsSync(skillsRootDir)) {
|
|
|
911
678
|
);
|
|
912
679
|
}
|
|
913
680
|
console.log(`Skill store root directory: ${skillsRootDir}`);
|
|
914
|
-
var skillStore = new
|
|
681
|
+
var skillStore = new import_core4.FileSystemSkillStore({
|
|
915
682
|
rootDir: skillsRootDir
|
|
916
683
|
});
|
|
917
|
-
|
|
918
|
-
(0,
|
|
919
|
-
|
|
684
|
+
import_core4.storeLatticeManager.removeLattice("default", "skill");
|
|
685
|
+
(0, import_core4.registerStoreLattice)("default", "skill", skillStore);
|
|
686
|
+
import_core4.skillLatticeManager.configureStore("default");
|
|
920
687
|
(async () => {
|
|
921
688
|
try {
|
|
922
689
|
const skills = await skillStore.getAllSkills();
|
|
@@ -938,6 +705,16 @@ import_core5.skillLatticeManager.configureStore("default");
|
|
|
938
705
|
}
|
|
939
706
|
}
|
|
940
707
|
})();
|
|
708
|
+
import_core4.sandboxLatticeManager.registerLattice("default", { baseURL: "https://demo.alphafina.cn" });
|
|
709
|
+
import_core4.mcpManager.registerServers([
|
|
710
|
+
{
|
|
711
|
+
name: "aio-server",
|
|
712
|
+
connection: {
|
|
713
|
+
transport: "http",
|
|
714
|
+
url: "http://localhost:8080/sandbox/sandbox-agent/mcp"
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
]);
|
|
941
718
|
var port = parsePort();
|
|
942
719
|
console.log(`Starting server on port ${port}`);
|
|
943
720
|
var DEFAULT_LOGGER_CONFIG = {
|