@jungjaehoon/mama-os 0.23.0 → 0.24.1
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/CHANGELOG.md +11 -0
- package/README.md +1 -1
- package/dist/agent/agent-loop.d.ts +3 -6
- package/dist/agent/agent-loop.d.ts.map +1 -1
- package/dist/agent/agent-loop.js +466 -230
- package/dist/agent/agent-loop.js.map +1 -1
- package/dist/agent/code-act/constants.d.ts +2 -2
- package/dist/agent/code-act/constants.d.ts.map +1 -1
- package/dist/agent/code-act/constants.js +16 -9
- package/dist/agent/code-act/constants.js.map +1 -1
- package/dist/agent/code-act/host-bridge.d.ts +12 -11
- package/dist/agent/code-act/host-bridge.d.ts.map +1 -1
- package/dist/agent/code-act/host-bridge.js +92 -15
- package/dist/agent/code-act/host-bridge.js.map +1 -1
- package/dist/agent/code-act/index.d.ts +2 -0
- package/dist/agent/code-act/index.d.ts.map +1 -1
- package/dist/agent/code-act/index.js +5 -1
- package/dist/agent/code-act/index.js.map +1 -1
- package/dist/agent/code-act/tool-policy.d.ts +42 -0
- package/dist/agent/code-act/tool-policy.d.ts.map +1 -0
- package/dist/agent/code-act/tool-policy.js +122 -0
- package/dist/agent/code-act/tool-policy.js.map +1 -0
- package/dist/agent/code-act/type-definition-generator.d.ts +4 -3
- package/dist/agent/code-act/type-definition-generator.d.ts.map +1 -1
- package/dist/agent/code-act/type-definition-generator.js +26 -48
- package/dist/agent/code-act/type-definition-generator.js.map +1 -1
- package/dist/agent/codex-app-server-process.d.ts +116 -0
- package/dist/agent/codex-app-server-process.d.ts.map +1 -0
- package/dist/agent/codex-app-server-process.js +1382 -0
- package/dist/agent/codex-app-server-process.js.map +1 -0
- package/dist/agent/codex-home.d.ts +9 -0
- package/dist/agent/codex-home.d.ts.map +1 -1
- package/dist/agent/codex-home.js +626 -4
- package/dist/agent/codex-home.js.map +1 -1
- package/dist/agent/codex-thread-registry.d.ts +63 -0
- package/dist/agent/codex-thread-registry.d.ts.map +1 -0
- package/dist/agent/codex-thread-registry.js +433 -0
- package/dist/agent/codex-thread-registry.js.map +1 -0
- package/dist/agent/gateway-tool-executor.d.ts +2 -7
- package/dist/agent/gateway-tool-executor.d.ts.map +1 -1
- package/dist/agent/gateway-tool-executor.js +69 -84
- package/dist/agent/gateway-tool-executor.js.map +1 -1
- package/dist/agent/managed-agent-runtime-sync.d.ts.map +1 -1
- package/dist/agent/managed-agent-runtime-sync.js +0 -3
- package/dist/agent/managed-agent-runtime-sync.js.map +1 -1
- package/dist/agent/managed-agent-validation.js +1 -1
- package/dist/agent/managed-agent-validation.js.map +1 -1
- package/dist/agent/model-runner.d.ts +51 -3
- package/dist/agent/model-runner.d.ts.map +1 -1
- package/dist/agent/model-runner.js +1 -1
- package/dist/agent/model-runner.js.map +1 -1
- package/dist/agent/persistent-cli-adapter.d.ts +1 -0
- package/dist/agent/persistent-cli-adapter.d.ts.map +1 -1
- package/dist/agent/persistent-cli-adapter.js +3 -0
- package/dist/agent/persistent-cli-adapter.js.map +1 -1
- package/dist/agent/session-pool.d.ts +10 -3
- package/dist/agent/session-pool.d.ts.map +1 -1
- package/dist/agent/session-pool.js +23 -8
- package/dist/agent/session-pool.js.map +1 -1
- package/dist/agent/tool-registry.d.ts +14 -0
- package/dist/agent/tool-registry.d.ts.map +1 -1
- package/dist/agent/tool-registry.js +46 -7
- package/dist/agent/tool-registry.js.map +1 -1
- package/dist/agent/types.d.ts +44 -6
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/api/graph-api.d.ts.map +1 -1
- package/dist/api/graph-api.js +19 -7
- package/dist/api/graph-api.js.map +1 -1
- package/dist/cli/commands/init.d.ts +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +22 -14
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/run.d.ts.map +1 -1
- package/dist/cli/commands/run.js +7 -4
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/start.d.ts +12 -1
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +161 -27
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/status.js +2 -2
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/config/config-manager.d.ts.map +1 -1
- package/dist/cli/config/config-manager.js +21 -4
- package/dist/cli/config/config-manager.js.map +1 -1
- package/dist/cli/config/types.d.ts +4 -4
- package/dist/cli/config/types.d.ts.map +1 -1
- package/dist/cli/config/types.js +1 -0
- package/dist/cli/config/types.js.map +1 -1
- package/dist/cli/index.js +2 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/runtime/agent-loop-init.d.ts +1 -1
- package/dist/cli/runtime/agent-loop-init.d.ts.map +1 -1
- package/dist/cli/runtime/agent-loop-init.js +12 -11
- package/dist/cli/runtime/agent-loop-init.js.map +1 -1
- package/dist/cli/runtime/connector-init.d.ts.map +1 -1
- package/dist/cli/runtime/connector-init.js +13 -17
- package/dist/cli/runtime/connector-init.js.map +1 -1
- package/dist/cli/runtime/envelope-bootstrap.d.ts.map +1 -1
- package/dist/cli/runtime/envelope-bootstrap.js +13 -1
- package/dist/cli/runtime/envelope-bootstrap.js.map +1 -1
- package/dist/cli/runtime/gateway-init.d.ts +1 -1
- package/dist/cli/runtime/gateway-init.d.ts.map +1 -1
- package/dist/cli/runtime/gateway-init.js.map +1 -1
- package/dist/cli/runtime/mama-core-init.d.ts +2 -2
- package/dist/cli/runtime/mama-core-init.d.ts.map +1 -1
- package/dist/cli/runtime/mama-core-init.js +17 -0
- package/dist/cli/runtime/mama-core-init.js.map +1 -1
- package/dist/cli/runtime/memory-agent-init.d.ts +1 -1
- package/dist/cli/runtime/memory-agent-init.d.ts.map +1 -1
- package/dist/cli/runtime/memory-agent-init.js +16 -6
- package/dist/cli/runtime/memory-agent-init.js.map +1 -1
- package/dist/cli/runtime/types.d.ts +4 -26
- package/dist/cli/runtime/types.d.ts.map +1 -1
- package/dist/cli/runtime/utilities.js +2 -2
- package/dist/cli/runtime/utilities.js.map +1 -1
- package/dist/connectors/config-loader.d.ts +24 -0
- package/dist/connectors/config-loader.d.ts.map +1 -0
- package/dist/connectors/config-loader.js +205 -0
- package/dist/connectors/config-loader.js.map +1 -0
- package/dist/connectors/framework/types.d.ts +2 -0
- package/dist/connectors/framework/types.d.ts.map +1 -1
- package/dist/connectors/kagemusha/query-tools.js +2 -2
- package/dist/connectors/kagemusha/query-tools.js.map +1 -1
- package/dist/envelope/reactive-config.d.ts +2 -2
- package/dist/envelope/reactive-config.d.ts.map +1 -1
- package/dist/envelope/reactive-config.js +13 -6
- package/dist/envelope/reactive-config.js.map +1 -1
- package/dist/gateways/context-injector.d.ts +2 -1
- package/dist/gateways/context-injector.d.ts.map +1 -1
- package/dist/gateways/context-injector.js.map +1 -1
- package/dist/gateways/message-router.d.ts +9 -0
- package/dist/gateways/message-router.d.ts.map +1 -1
- package/dist/gateways/message-router.js +87 -18
- package/dist/gateways/message-router.js.map +1 -1
- package/dist/gateways/types.d.ts +1 -1
- package/dist/gateways/types.d.ts.map +1 -1
- package/dist/multi-agent/agent-process-manager.d.ts +9 -1
- package/dist/multi-agent/agent-process-manager.d.ts.map +1 -1
- package/dist/multi-agent/agent-process-manager.js +197 -49
- package/dist/multi-agent/agent-process-manager.js.map +1 -1
- package/dist/multi-agent/dashboard-agent-persona.js +4 -4
- package/dist/multi-agent/multi-agent-base.d.ts.map +1 -1
- package/dist/multi-agent/multi-agent-base.js +2 -1
- package/dist/multi-agent/multi-agent-base.js.map +1 -1
- package/dist/multi-agent/runtime-process.d.ts +18 -15
- package/dist/multi-agent/runtime-process.d.ts.map +1 -1
- package/dist/multi-agent/runtime-process.js +63 -59
- package/dist/multi-agent/runtime-process.js.map +1 -1
- package/dist/multi-agent/types.d.ts +13 -7
- package/dist/multi-agent/types.d.ts.map +1 -1
- package/dist/multi-agent/types.js.map +1 -1
- package/dist/multi-agent/workflow-engine.js +3 -3
- package/dist/multi-agent/workflow-engine.js.map +1 -1
- package/dist/multi-agent/workflow-types.d.ts +2 -2
- package/dist/multi-agent/workflow-types.d.ts.map +1 -1
- package/dist/operator/operator-trigger-loop.d.ts +3 -0
- package/dist/operator/operator-trigger-loop.d.ts.map +1 -1
- package/dist/operator/operator-trigger-loop.js +1 -0
- package/dist/operator/operator-trigger-loop.js.map +1 -1
- package/dist/operator/report-run.d.ts +4 -4
- package/dist/operator/situation-report.d.ts +3 -0
- package/dist/operator/situation-report.d.ts.map +1 -1
- package/dist/operator/situation-report.js +43 -26
- package/dist/operator/situation-report.js.map +1 -1
- package/dist/operator/trigger-author.d.ts +35 -1
- package/dist/operator/trigger-author.d.ts.map +1 -1
- package/dist/operator/trigger-author.js +73 -10
- package/dist/operator/trigger-author.js.map +1 -1
- package/dist/operator/worker-run.d.ts +31 -0
- package/dist/operator/worker-run.d.ts.map +1 -1
- package/dist/operator/worker-run.js +76 -1
- package/dist/operator/worker-run.js.map +1 -1
- package/dist/operator/workorder-consumer.d.ts +7 -4
- package/dist/operator/workorder-consumer.d.ts.map +1 -1
- package/dist/operator/workorder-consumer.js +8 -3
- package/dist/operator/workorder-consumer.js.map +1 -1
- package/dist/setup/setup-prompt.d.ts +1 -1
- package/dist/setup/setup-prompt.d.ts.map +1 -1
- package/dist/setup/setup-prompt.js +4 -5
- package/dist/setup/setup-prompt.js.map +1 -1
- package/dist/utils/untrusted-content.d.ts +1 -0
- package/dist/utils/untrusted-content.d.ts.map +1 -1
- package/dist/utils/untrusted-content.js +5 -0
- package/dist/utils/untrusted-content.js.map +1 -1
- package/package.json +1 -1
- package/public/viewer/js/modules/agents.js +13 -9
- package/public/viewer/js/modules/settings.js +15 -10
- package/public/viewer/src/modules/agents.ts +12 -10
- package/public/viewer/src/modules/settings.ts +17 -12
- package/public/viewer/src/utils/api.ts +2 -2
- package/templates/AGENTS.codex.md +2 -23
- package/templates/personas/conductor.md +1 -1
- package/dist/agent/codex-mcp-process.d.ts +0 -105
- package/dist/agent/codex-mcp-process.d.ts.map +0 -1
- package/dist/agent/codex-mcp-process.js +0 -748
- package/dist/agent/codex-mcp-process.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-tool-executor.d.ts","sourceRoot":"","sources":["../../src/agent/gateway-tool-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAyBH,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EASjB,0BAA0B,
|
|
1
|
+
{"version":3,"file":"gateway-tool-executor.d.ts","sourceRoot":"","sources":["../../src/agent/gateway-tool-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAyBH,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EASjB,0BAA0B,EAG1B,eAAe,EASf,YAAY,EASZ,WAAW,EAGX,2BAA2B,EAE3B,kBAAkB,EAClB,cAAc,EAEf,MAAM,YAAY,CAAC;AAYpB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AA0BnE,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAwB,MAAM,4BAA4B,CAAC;AAuB1F,KAAK,uBAAuB,GAAG,2BAA2B,CAAC;AAC3D,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAsQF;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,WA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H7B;;;OAGG;IACH,OAAO,CAAC,iBAAiB,CAClB;IAEP;;;OAGG;IACH,OAAO,CAAC,kBAAkB,CAKV;IAEhB;;OAEG;IACH,oBAAoB,CAClB,QAAQ,EAAE,MAAM,GAAG,CAAC,WAAW,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GACrE,IAAI;IAIP;;OAEG;IACH,qBAAqB,CACnB,QAAQ,EAAE,CACR,QAAQ,EAAE,WAAW,EACrB,MAAM,EAAE,OAAO,GAAG,MAAM,KACrB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GACjD,IAAI;IAIP;;OAEG;YACW,eAAe;IAkD7B;;;OAGG;YACW,iBAAiB;IA4C/B;;;OAGG;YACW,cAAc;IAuC5B,OAAO,CAAC,UAAU;YAMJ,sBAAsB;IA2HpC;;;;;OAKG;YACW,kBAAkB;IA2EhC;;;;;;OAMG;IACH,OAAO,CAAC,UAAU,CAAsD;IACxE,OAAO,CAAC,uBAAuB;IAsE/B;;OAEG;YACW,eAAe;YAqDf,cAAc;IAiD5B;;OAEG;YACW,aAAa;YA4Bb,gBAAgB;YAuFhB,gBAAgB;IAoC9B,MAAM,CAAC,aAAa,IAAI,eAAe,EAAE;IAIzC;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,IAAI,eAAe;YAInD,oBAAoB;CAuDnC"}
|
|
@@ -378,6 +378,8 @@ class GatewayToolExecutor {
|
|
|
378
378
|
sourceMessageRef: executionContext?.sourceMessageRef,
|
|
379
379
|
modelRunId: executionContext?.modelRunId ?? null,
|
|
380
380
|
gatewayCallId: executionContext?.gatewayCallId,
|
|
381
|
+
signal: executionContext?.signal,
|
|
382
|
+
parentToolName: executionContext?.parentToolName,
|
|
381
383
|
backgroundTasks: executionContext?.backgroundTasks,
|
|
382
384
|
disallowedGatewayTools: executionContext?.disallowedGatewayTools,
|
|
383
385
|
reportPublisherOverride: executionContext?.reportPublisherOverride,
|
|
@@ -410,6 +412,7 @@ class GatewayToolExecutor {
|
|
|
410
412
|
sourceMessageRef: active.sourceMessageRef ?? fallback.sourceMessageRef,
|
|
411
413
|
modelRunId: active.modelRunId ?? fallback.modelRunId,
|
|
412
414
|
gatewayCallId: active.gatewayCallId ?? fallback.gatewayCallId,
|
|
415
|
+
signal: active.signal,
|
|
413
416
|
parentToolName: active.parentToolName ?? fallback.parentToolName,
|
|
414
417
|
backgroundTasks: active.backgroundTasks ?? fallback.backgroundTasks,
|
|
415
418
|
// Never merged from fallback - blocks are strictly per-call.
|
|
@@ -654,7 +657,35 @@ class GatewayToolExecutor {
|
|
|
654
657
|
/** Wire the shared MAMA API built at boot (initMamaCore) so the executor never
|
|
655
658
|
* lazily constructs a second API/adapter stack against the same DB. */
|
|
656
659
|
setMamaApi(api) {
|
|
657
|
-
|
|
660
|
+
const listDecisions = 'listDecisions' in api ? api.listDecisions : undefined;
|
|
661
|
+
if (typeof listDecisions === 'function') {
|
|
662
|
+
this.mamaApi = api;
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
665
|
+
const list = 'list' in api ? api.list : undefined;
|
|
666
|
+
if (typeof list !== 'function') {
|
|
667
|
+
throw new Error('MAMA API must provide listDecisions() or list()');
|
|
668
|
+
}
|
|
669
|
+
const normalizedListDecisions = list.bind(api);
|
|
670
|
+
const boundMethods = new WeakMap();
|
|
671
|
+
this.mamaApi = new Proxy({}, {
|
|
672
|
+
get(_target, property) {
|
|
673
|
+
if (property === 'listDecisions') {
|
|
674
|
+
return normalizedListDecisions;
|
|
675
|
+
}
|
|
676
|
+
const value = Reflect.get(api, property, api);
|
|
677
|
+
if (typeof value !== 'function') {
|
|
678
|
+
return value;
|
|
679
|
+
}
|
|
680
|
+
const cached = boundMethods.get(value);
|
|
681
|
+
if (cached) {
|
|
682
|
+
return cached;
|
|
683
|
+
}
|
|
684
|
+
const bound = value.bind(api);
|
|
685
|
+
boundMethods.set(value, bound);
|
|
686
|
+
return bound;
|
|
687
|
+
},
|
|
688
|
+
});
|
|
658
689
|
}
|
|
659
690
|
/**
|
|
660
691
|
* Initialize the MAMA API by importing from mcp-server package
|
|
@@ -716,6 +747,12 @@ class GatewayToolExecutor {
|
|
|
716
747
|
// If no context set, allow all tools (backward compatibility)
|
|
717
748
|
const context = this.getActiveContext();
|
|
718
749
|
if (!context) {
|
|
750
|
+
if (toolName === 'code_act') {
|
|
751
|
+
return {
|
|
752
|
+
allowed: false,
|
|
753
|
+
error: 'Permission denied: code_act requires an active agent role',
|
|
754
|
+
};
|
|
755
|
+
}
|
|
719
756
|
return { allowed: true };
|
|
720
757
|
}
|
|
721
758
|
const role = context.role;
|
|
@@ -852,6 +889,7 @@ class GatewayToolExecutor {
|
|
|
852
889
|
}
|
|
853
890
|
const startedAt = Date.now();
|
|
854
891
|
const baseCtx = this.mergeWithFallbackExecutionContext(this.executionContextStorage.getStore());
|
|
892
|
+
baseCtx.signal?.throwIfAborted();
|
|
855
893
|
const gatewayCallId = baseCtx.gatewayCallId ?? `gw_${(0, crypto_1.randomUUID)().replace(/-/g, '')}`;
|
|
856
894
|
const ctx = { ...baseCtx, gatewayCallId };
|
|
857
895
|
const effectiveInput = this.applyEnvelopeScopedReadDefaults(toolName, input, ctx);
|
|
@@ -861,6 +899,7 @@ class GatewayToolExecutor {
|
|
|
861
899
|
let result;
|
|
862
900
|
try {
|
|
863
901
|
result = await this.executionContextStorage.run(activeCtx, () => this.executeWithEnvelopeAndPermissions(toolName, effectiveInput, gatewayCallId));
|
|
902
|
+
activeCtx.signal?.throwIfAborted();
|
|
864
903
|
}
|
|
865
904
|
catch (error) {
|
|
866
905
|
await this.appendToolTraceIfNeeded(traceState, activeCtx, toolName, undefined, Date.now() - startedAt, gatewayCallId, error).catch((appendError) => {
|
|
@@ -1274,6 +1313,7 @@ class GatewayToolExecutor {
|
|
|
1274
1313
|
}
|
|
1275
1314
|
}
|
|
1276
1315
|
async executeWithEnvelopeAndPermissions(toolName, input, gatewayCallId) {
|
|
1316
|
+
this.getExecutionState().signal?.throwIfAborted();
|
|
1277
1317
|
if (!VALID_TOOLS.includes(toolName)) {
|
|
1278
1318
|
throw new types_js_1.AgentError(`Unknown tool: ${toolName}. Valid tools: ${VALID_TOOLS.join(', ')}`, 'UNKNOWN_TOOL', undefined, false);
|
|
1279
1319
|
}
|
|
@@ -3179,95 +3219,39 @@ class GatewayToolExecutor {
|
|
|
3179
3219
|
};
|
|
3180
3220
|
}
|
|
3181
3221
|
}
|
|
3182
|
-
resolveCodeActSandboxRole(input, activeRole, registryNames) {
|
|
3183
|
-
const allowedResolution = this.normalizeCodeActToolPatterns(input.allowedTools, 'allowedTools', registryNames);
|
|
3184
|
-
if (allowedResolution.error) {
|
|
3185
|
-
return { error: allowedResolution.error };
|
|
3186
|
-
}
|
|
3187
|
-
const blockedResolution = this.normalizeCodeActToolPatterns(input.blockedTools, 'blockedTools', registryNames);
|
|
3188
|
-
if (blockedResolution.error) {
|
|
3189
|
-
return { error: blockedResolution.error };
|
|
3190
|
-
}
|
|
3191
|
-
if (!activeRole && !allowedResolution.patterns && !blockedResolution.patterns) {
|
|
3192
|
-
return {};
|
|
3193
|
-
}
|
|
3194
|
-
let effectiveToolNames = activeRole
|
|
3195
|
-
? registryNames.filter((toolName) => this.roleManager.isToolAllowed(activeRole, toolName))
|
|
3196
|
-
: [...registryNames];
|
|
3197
|
-
const allowedPatterns = allowedResolution.patterns;
|
|
3198
|
-
if (allowedPatterns) {
|
|
3199
|
-
effectiveToolNames = effectiveToolNames.filter((toolName) => this.matchesAnyCodeActToolPattern(toolName, allowedPatterns));
|
|
3200
|
-
}
|
|
3201
|
-
const blockedPatterns = blockedResolution.patterns;
|
|
3202
|
-
if (blockedPatterns) {
|
|
3203
|
-
effectiveToolNames = effectiveToolNames.filter((toolName) => !this.matchesAnyCodeActToolPattern(toolName, blockedPatterns));
|
|
3204
|
-
}
|
|
3205
|
-
return {
|
|
3206
|
-
role: {
|
|
3207
|
-
...activeRole,
|
|
3208
|
-
allowedTools: effectiveToolNames,
|
|
3209
|
-
blockedTools: undefined,
|
|
3210
|
-
allowedPaths: activeRole?.allowedPaths ?? [],
|
|
3211
|
-
systemControl: activeRole?.systemControl ?? false,
|
|
3212
|
-
sensitiveAccess: activeRole?.sensitiveAccess ?? false,
|
|
3213
|
-
},
|
|
3214
|
-
};
|
|
3215
|
-
}
|
|
3216
|
-
normalizeCodeActToolPatterns(value, fieldName, registryNames) {
|
|
3217
|
-
if (value === undefined) {
|
|
3218
|
-
return {};
|
|
3219
|
-
}
|
|
3220
|
-
if (!Array.isArray(value)) {
|
|
3221
|
-
return { error: `${fieldName} must be an array of gateway tool names.` };
|
|
3222
|
-
}
|
|
3223
|
-
const patterns = [];
|
|
3224
|
-
const seen = new Set();
|
|
3225
|
-
for (const item of value) {
|
|
3226
|
-
if (typeof item !== 'string' || item.trim().length === 0) {
|
|
3227
|
-
return { error: `${fieldName} must contain non-empty gateway tool names.` };
|
|
3228
|
-
}
|
|
3229
|
-
const pattern = item.trim();
|
|
3230
|
-
if (seen.has(pattern)) {
|
|
3231
|
-
continue;
|
|
3232
|
-
}
|
|
3233
|
-
if (!this.isKnownCodeActToolPattern(pattern, registryNames)) {
|
|
3234
|
-
return { error: `Unknown Code-Act tool pattern in ${fieldName}: ${pattern}` };
|
|
3235
|
-
}
|
|
3236
|
-
seen.add(pattern);
|
|
3237
|
-
patterns.push(pattern);
|
|
3238
|
-
}
|
|
3239
|
-
return { patterns };
|
|
3240
|
-
}
|
|
3241
|
-
isKnownCodeActToolPattern(pattern, registryNames) {
|
|
3242
|
-
return (pattern === '*' ||
|
|
3243
|
-
registryNames.some((toolName) => this.matchesCodeActToolPattern(toolName, pattern)));
|
|
3244
|
-
}
|
|
3245
|
-
matchesAnyCodeActToolPattern(toolName, patterns) {
|
|
3246
|
-
return patterns.some((pattern) => this.matchesCodeActToolPattern(toolName, pattern));
|
|
3247
|
-
}
|
|
3248
|
-
matchesCodeActToolPattern(toolName, pattern) {
|
|
3249
|
-
return this.roleManager.isToolAllowed({
|
|
3250
|
-
allowedTools: [pattern],
|
|
3251
|
-
allowedPaths: [],
|
|
3252
|
-
systemControl: false,
|
|
3253
|
-
sensitiveAccess: false,
|
|
3254
|
-
}, toolName);
|
|
3255
|
-
}
|
|
3256
3222
|
async executeCodeAct(input) {
|
|
3257
|
-
const { CodeActSandbox, HostBridge } = await import('./code-act/index.js');
|
|
3223
|
+
const { CodeActSandbox, CodeActToolPolicyValidationError, HostBridge, projectCodeActToolPolicy, } = await import('./code-act/index.js');
|
|
3258
3224
|
const sandbox = new CodeActSandbox();
|
|
3259
|
-
const
|
|
3260
|
-
const
|
|
3261
|
-
const
|
|
3262
|
-
|
|
3263
|
-
|
|
3225
|
+
const state = this.getExecutionState();
|
|
3226
|
+
const contextTier = state.agentContext?.tier;
|
|
3227
|
+
const tier = contextTier === undefined ? 1 : contextTier;
|
|
3228
|
+
let policy;
|
|
3229
|
+
try {
|
|
3230
|
+
policy = projectCodeActToolPolicy({
|
|
3231
|
+
tier,
|
|
3232
|
+
role: state.agentContext?.role,
|
|
3233
|
+
disallowedTools: state.disallowedGatewayTools,
|
|
3234
|
+
requestedAllowedTools: input.allowedTools,
|
|
3235
|
+
requestedBlockedTools: input.blockedTools,
|
|
3236
|
+
});
|
|
3237
|
+
}
|
|
3238
|
+
catch (error) {
|
|
3239
|
+
if (!(error instanceof CodeActToolPolicyValidationError)) {
|
|
3240
|
+
throw error;
|
|
3241
|
+
}
|
|
3264
3242
|
return {
|
|
3265
3243
|
success: false,
|
|
3266
|
-
error:
|
|
3244
|
+
error: error.message,
|
|
3267
3245
|
};
|
|
3268
3246
|
}
|
|
3269
|
-
const
|
|
3270
|
-
|
|
3247
|
+
const nestedExecutionContext = {
|
|
3248
|
+
...state,
|
|
3249
|
+
agentContext: state.agentContext ?? undefined,
|
|
3250
|
+
executionSurface: 'code_act',
|
|
3251
|
+
parentToolName: 'code_act',
|
|
3252
|
+
};
|
|
3253
|
+
const bridge = new HostBridge(this, this.roleManager, nestedExecutionContext);
|
|
3254
|
+
bridge.injectInto(sandbox, policy.names);
|
|
3271
3255
|
const result = await sandbox.execute(input.code);
|
|
3272
3256
|
return {
|
|
3273
3257
|
success: result.success,
|
|
@@ -3444,6 +3428,7 @@ class GatewayToolExecutor {
|
|
|
3444
3428
|
envelope: ctx.envelope,
|
|
3445
3429
|
modelRunId: ctx.modelRunId ?? null,
|
|
3446
3430
|
input,
|
|
3431
|
+
signal: ctx.signal,
|
|
3447
3432
|
});
|
|
3448
3433
|
return {
|
|
3449
3434
|
success: true,
|