orchajs 0.27.2 → 0.27.4
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/dist/compiler/build-project.js +15 -4
- package/dist/compiler/compile.js +53 -11
- package/dist/errors.d.ts +1 -0
- package/dist/errors.js +7 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/orcha.js +14 -8
- package/dist/providers/dependencies.js +15 -4
- package/dist/providers/index.js +7 -1
- package/dist/runtime/agent.js +23 -10
- package/dist/runtime/create-orcha.js +18 -17
- package/dist/runtime/node-module-loader.d.ts +11 -0
- package/dist/runtime/node-module-loader.js +18 -0
- package/dist/runtime/structured-output.d.ts +1 -0
- package/dist/runtime/structured-output.js +10 -1
- package/dist/storage/create-store.js +1 -1
- package/dist/storage/node-sqlite-facade.d.ts +20 -0
- package/dist/storage/node-sqlite-facade.js +48 -0
- package/dist/testing.js +23 -14
- package/dist/types.d.ts +1 -0
- package/dist-cjs/compiler/build-project.js +14 -4
- package/dist-cjs/compiler/compile.js +65 -20
- package/dist-cjs/errors.js +7 -0
- package/dist-cjs/index.js +2 -2
- package/dist-cjs/orcha.js +19 -8
- package/dist-cjs/providers/dependencies.js +14 -4
- package/dist-cjs/providers/index.js +7 -1
- package/dist-cjs/runtime/agent.js +18 -8
- package/dist-cjs/runtime/create-orcha.js +29 -26
- package/dist-cjs/runtime/node-module-loader.js +42 -0
- package/dist-cjs/runtime/structured-output.js +12 -1
- package/dist-cjs/storage/create-store.js +2 -2
- package/dist-cjs/storage/node-sqlite-facade.js +72 -0
- package/dist-cjs/testing.js +30 -16
- package/package.json +30 -1
package/dist-cjs/testing.js
CHANGED
|
@@ -88,24 +88,38 @@ async function runTests(orcha, options = {}) {
|
|
|
88
88
|
const store = createStore(manifest);
|
|
89
89
|
const activeSessions = /* @__PURE__ */ new Set();
|
|
90
90
|
const sessionControls = /* @__PURE__ */ new Map();
|
|
91
|
-
const
|
|
92
|
-
Object.entries(
|
|
93
|
-
([name, subagentManifest]) =>
|
|
94
|
-
name
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
91
|
+
const createTestSubagents = (parentManifest, ancestry) => Object.fromEntries(
|
|
92
|
+
Object.entries(parentManifest.subagents ?? {}).map(
|
|
93
|
+
([name, subagentManifest]) => {
|
|
94
|
+
if (ancestry.has(name)) {
|
|
95
|
+
throw new Error(
|
|
96
|
+
`Circular subagent registration detected: ${[...ancestry, name].join(" -> ")}.`
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
const nextAncestry = new Set(ancestry);
|
|
100
|
+
nextAncestry.add(name);
|
|
101
|
+
return [
|
|
102
|
+
name,
|
|
103
|
+
new import_agent.RuntimeAgent({
|
|
104
|
+
manifest: subagentManifest,
|
|
105
|
+
configuration: context.configuration,
|
|
106
|
+
store: createStore(subagentManifest),
|
|
107
|
+
activeSessions,
|
|
108
|
+
sessionControls,
|
|
109
|
+
generateProviderResponse: context.generateProviderResponse,
|
|
110
|
+
subagents: createTestSubagents(subagentManifest, nextAncestry),
|
|
111
|
+
delegatedOnly: true,
|
|
112
|
+
sessionIdPrefix: "ses_test_",
|
|
113
|
+
projectRoot: context.projectRoot
|
|
114
|
+
})
|
|
115
|
+
];
|
|
116
|
+
}
|
|
107
117
|
)
|
|
108
118
|
);
|
|
119
|
+
const subagents = createTestSubagents(
|
|
120
|
+
manifest,
|
|
121
|
+
/* @__PURE__ */ new Set([manifest.key ?? manifest.name])
|
|
122
|
+
);
|
|
109
123
|
const agent = new import_agent.RuntimeAgent({
|
|
110
124
|
manifest: withTestActions(
|
|
111
125
|
manifest,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orchajs",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.4",
|
|
4
4
|
"description": "A filesystem-convention, stateful agent framework for JavaScript.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
".": {
|
|
25
25
|
"types": "./dist/index.d.ts",
|
|
26
26
|
"react-native": "./dist/react-native.js",
|
|
27
|
+
"edge-light": "./dist/browser.js",
|
|
27
28
|
"browser": "./dist/browser.js",
|
|
28
29
|
"import": "./dist/index.js",
|
|
29
30
|
"require": "./dist-cjs/index.js"
|
|
@@ -67,6 +68,31 @@
|
|
|
67
68
|
"types": "./dist/integrations/expo.d.ts",
|
|
68
69
|
"import": "./dist/integrations/expo.js",
|
|
69
70
|
"require": "./dist-cjs/integrations/expo.js"
|
|
71
|
+
},
|
|
72
|
+
"./compiler": {
|
|
73
|
+
"types": "./dist/compiler/compile.d.ts",
|
|
74
|
+
"import": "./dist/compiler/compile.js",
|
|
75
|
+
"require": "./dist-cjs/compiler/compile.js"
|
|
76
|
+
},
|
|
77
|
+
"./providers/*": {
|
|
78
|
+
"types": "./dist/providers/*.d.ts",
|
|
79
|
+
"import": "./dist/providers/*.js",
|
|
80
|
+
"require": "./dist-cjs/providers/*.js"
|
|
81
|
+
},
|
|
82
|
+
"./runtime/sandbox": {
|
|
83
|
+
"types": "./dist/runtime/actions/sandbox.d.ts",
|
|
84
|
+
"import": "./dist/runtime/actions/sandbox.js",
|
|
85
|
+
"require": "./dist-cjs/runtime/actions/sandbox.js"
|
|
86
|
+
},
|
|
87
|
+
"./runtime/mcp-node": {
|
|
88
|
+
"types": "./dist/runtime/mcp/node-client.d.ts",
|
|
89
|
+
"import": "./dist/runtime/mcp/node-client.js",
|
|
90
|
+
"require": "./dist-cjs/runtime/mcp/node-client.js"
|
|
91
|
+
},
|
|
92
|
+
"./storage/sqlite": {
|
|
93
|
+
"types": "./dist/storage/node-sqlite.d.ts",
|
|
94
|
+
"import": "./dist/storage/node-sqlite.js",
|
|
95
|
+
"require": "./dist-cjs/storage/node-sqlite.js"
|
|
70
96
|
}
|
|
71
97
|
},
|
|
72
98
|
"typesVersions": {
|
|
@@ -94,6 +120,9 @@
|
|
|
94
120
|
],
|
|
95
121
|
"expo": [
|
|
96
122
|
"dist/integrations/expo.d.ts"
|
|
123
|
+
],
|
|
124
|
+
"storage/sqlite": [
|
|
125
|
+
"dist/storage/node-sqlite.d.ts"
|
|
97
126
|
]
|
|
98
127
|
}
|
|
99
128
|
},
|