@agent-compose/sdk 0.2.4 → 0.2.5
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/index.js +1 -1
- package/dist/runtimes/openai-desktop.js +1 -1
- package/package.json +1 -1
- package/src/utils/bundler.ts +10 -2
package/dist/index.js
CHANGED
|
@@ -946,7 +946,7 @@ async function extractFromBundle(source, label, pick) {
|
|
|
946
946
|
return;
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
|
-
var DEFINE_WORKFLOW_CALLEE = /^defineWorkflow\d*$/;
|
|
949
|
+
var DEFINE_WORKFLOW_CALLEE = /^(?:defineWorkflow|defineSandboxEnvironment)\d*$/;
|
|
950
950
|
function isDefineWorkflowCall(node) {
|
|
951
951
|
if (node.callee.type === "Identifier") {
|
|
952
952
|
return DEFINE_WORKFLOW_CALLEE.test(node.callee.name);
|
|
@@ -946,7 +946,7 @@ async function extractFromBundle(source, label, pick) {
|
|
|
946
946
|
return;
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
|
-
var DEFINE_WORKFLOW_CALLEE = /^defineWorkflow\d*$/;
|
|
949
|
+
var DEFINE_WORKFLOW_CALLEE = /^(?:defineWorkflow|defineSandboxEnvironment)\d*$/;
|
|
950
950
|
function isDefineWorkflowCall(node) {
|
|
951
951
|
if (node.callee.type === "Identifier") {
|
|
952
952
|
return DEFINE_WORKFLOW_CALLEE.test(node.callee.name);
|
package/package.json
CHANGED
package/src/utils/bundler.ts
CHANGED
|
@@ -120,11 +120,19 @@ async function extractFromBundle<T>(
|
|
|
120
120
|
/**
|
|
121
121
|
* Bun bundles `import { defineWorkflow }` to a local identifier — usually
|
|
122
122
|
* the exact name, or a numeric suffix like `defineWorkflow2` to disambiguate
|
|
123
|
-
* scopes. Match exactly
|
|
123
|
+
* scopes. Match exactly those patterns, NOT `startsWith("defineWorkflow")` —
|
|
124
124
|
* the latter would also accept `defineWorkflowAttacker`. The runtime brand
|
|
125
125
|
* check is the second gate, but the syntactic check should be tight.
|
|
126
|
+
*
|
|
127
|
+
* `defineSandboxEnvironment` is sugar over `defineWorkflow` (see
|
|
128
|
+
* `src/types/sandbox-environment.ts`) and is explicitly registerable via
|
|
129
|
+
* `agentc register setup.ts --build` to capture a snapshot. The AST gate
|
|
130
|
+
* accepts it for the same reason it accepts `defineWorkflow`: the bundled
|
|
131
|
+
* default export is a CallExpression to a known SDK identifier, and the
|
|
132
|
+
* runtime brand check downstream catches anything that lies about being a
|
|
133
|
+
* workflow.
|
|
126
134
|
*/
|
|
127
|
-
const DEFINE_WORKFLOW_CALLEE = /^defineWorkflow\d*$/;
|
|
135
|
+
const DEFINE_WORKFLOW_CALLEE = /^(?:defineWorkflow|defineSandboxEnvironment)\d*$/;
|
|
128
136
|
|
|
129
137
|
function isDefineWorkflowCall(node: CallExpression): boolean {
|
|
130
138
|
if (node.callee.type === "Identifier") {
|