@jungjaehoon/mama-os 0.28.6 → 0.29.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.
- package/dist/agent/agent-loop.d.ts +0 -4
- package/dist/agent/agent-loop.d.ts.map +1 -1
- package/dist/agent/agent-loop.js +33 -10
- package/dist/agent/agent-loop.js.map +1 -1
- package/dist/agent/code-act/host-bridge.d.ts.map +1 -1
- package/dist/agent/code-act/host-bridge.js +53 -3
- package/dist/agent/code-act/host-bridge.js.map +1 -1
- package/dist/agent/code-act/tool-policy.d.ts.map +1 -1
- package/dist/agent/code-act/tool-policy.js +5 -0
- package/dist/agent/code-act/tool-policy.js.map +1 -1
- package/dist/agent/codex-auth.d.ts +0 -1
- package/dist/agent/codex-auth.d.ts.map +1 -1
- package/dist/agent/codex-auth.js +0 -4
- package/dist/agent/codex-auth.js.map +1 -1
- package/dist/agent/codex-home.d.ts +0 -2
- package/dist/agent/codex-home.d.ts.map +1 -1
- package/dist/agent/codex-home.js +0 -66
- package/dist/agent/codex-home.js.map +1 -1
- package/dist/agent/context-compile-service.d.ts +9 -0
- package/dist/agent/context-compile-service.d.ts.map +1 -1
- package/dist/agent/context-compile-service.js +6 -0
- package/dist/agent/context-compile-service.js.map +1 -1
- package/dist/agent/context-prompt-builder.d.ts +0 -6
- package/dist/agent/context-prompt-builder.d.ts.map +1 -1
- package/dist/agent/context-prompt-builder.js +0 -131
- package/dist/agent/context-prompt-builder.js.map +1 -1
- package/dist/agent/contract-extractor.d.ts +0 -4
- package/dist/agent/contract-extractor.d.ts.map +1 -1
- package/dist/agent/contract-extractor.js +0 -68
- package/dist/agent/contract-extractor.js.map +1 -1
- package/dist/agent/gateway-tool-executor.d.ts +20 -15
- package/dist/agent/gateway-tool-executor.d.ts.map +1 -1
- package/dist/agent/gateway-tool-executor.js +236 -90
- package/dist/agent/gateway-tool-executor.js.map +1 -1
- package/dist/agent/gateway-tools.md +7 -4
- package/dist/agent/skill-loader.d.ts +0 -7
- package/dist/agent/skill-loader.d.ts.map +1 -1
- package/dist/agent/skill-loader.js +0 -86
- package/dist/agent/skill-loader.js.map +1 -1
- package/dist/agent/token-estimator.d.ts +0 -8
- package/dist/agent/token-estimator.d.ts.map +1 -1
- package/dist/agent/token-estimator.js +0 -14
- package/dist/agent/token-estimator.js.map +1 -1
- package/dist/agent/tool-registry.d.ts.map +1 -1
- package/dist/agent/tool-registry.js +23 -5
- package/dist/agent/tool-registry.js.map +1 -1
- package/dist/agent/types.d.ts +27 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/api/agent-graph-handler.d.ts +9 -0
- package/dist/api/agent-graph-handler.d.ts.map +1 -1
- package/dist/api/agent-graph-handler.js +27 -1
- package/dist/api/agent-graph-handler.js.map +1 -1
- package/dist/api/entity-audit-handler.d.ts +1 -2
- package/dist/api/entity-audit-handler.d.ts.map +1 -1
- package/dist/api/entity-audit-handler.js +0 -5
- package/dist/api/entity-audit-handler.js.map +1 -1
- package/dist/api/index.d.ts +1 -9
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +4 -17
- package/dist/api/index.js.map +1 -1
- package/dist/api/intelligence-handler.d.ts +0 -5
- package/dist/api/intelligence-handler.d.ts.map +1 -1
- package/dist/api/intelligence-handler.js +0 -15
- package/dist/api/intelligence-handler.js.map +1 -1
- package/dist/api/types.d.ts +1 -5
- package/dist/api/types.d.ts.map +1 -1
- package/dist/api/types.js +0 -14
- package/dist/api/types.js.map +1 -1
- package/dist/cli/commands/start.d.ts +117 -3
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +223 -62
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/config/config-manager.d.ts +0 -5
- package/dist/cli/config/config-manager.d.ts.map +1 -1
- package/dist/cli/config/config-manager.js +0 -29
- package/dist/cli/config/config-manager.js.map +1 -1
- package/dist/cli/config/types.d.ts.map +1 -1
- package/dist/cli/config/types.js +3 -0
- package/dist/cli/config/types.js.map +1 -1
- package/dist/cli/runtime/api-routes-init.d.ts.map +1 -1
- package/dist/cli/runtime/api-routes-init.js +32 -5
- package/dist/cli/runtime/api-routes-init.js.map +1 -1
- package/dist/cli/runtime/api-server-init.d.ts.map +1 -1
- package/dist/cli/runtime/api-server-init.js +2 -0
- package/dist/cli/runtime/api-server-init.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 +11 -38
- package/dist/cli/runtime/gateway-init.js.map +1 -1
- package/dist/cli/runtime/gateway-wiring.d.ts.map +1 -1
- package/dist/cli/runtime/gateway-wiring.js +6 -120
- package/dist/cli/runtime/gateway-wiring.js.map +1 -1
- package/dist/cli/utils/pid-manager.d.ts +0 -10
- package/dist/cli/utils/pid-manager.d.ts.map +1 -1
- package/dist/cli/utils/pid-manager.js +0 -26
- package/dist/cli/utils/pid-manager.js.map +1 -1
- package/dist/connectors/framework/polling-scheduler.d.ts +33 -1
- package/dist/connectors/framework/polling-scheduler.d.ts.map +1 -1
- package/dist/connectors/framework/polling-scheduler.js +46 -40
- package/dist/connectors/framework/polling-scheduler.js.map +1 -1
- package/dist/connectors/trello/query-tools.d.ts +32 -5
- package/dist/connectors/trello/query-tools.d.ts.map +1 -1
- package/dist/connectors/trello/query-tools.js +56 -17
- package/dist/connectors/trello/query-tools.js.map +1 -1
- package/dist/db/agent-store.d.ts +0 -4
- package/dist/db/agent-store.d.ts.map +1 -1
- package/dist/db/agent-store.js +0 -65
- package/dist/db/agent-store.js.map +1 -1
- package/dist/envelope/enforcer.d.ts.map +1 -1
- package/dist/envelope/enforcer.js +10 -1
- package/dist/envelope/enforcer.js.map +1 -1
- package/dist/envelope/index.d.ts +0 -1
- package/dist/envelope/index.d.ts.map +1 -1
- package/dist/envelope/index.js +0 -1
- package/dist/envelope/index.js.map +1 -1
- package/dist/envelope/signature.d.ts +0 -1
- package/dist/envelope/signature.d.ts.map +1 -1
- package/dist/envelope/signature.js +0 -7
- package/dist/envelope/signature.js.map +1 -1
- package/dist/envelope/tool-connector-scope.d.ts +35 -0
- package/dist/envelope/tool-connector-scope.d.ts.map +1 -0
- package/dist/envelope/tool-connector-scope.js +57 -0
- package/dist/envelope/tool-connector-scope.js.map +1 -0
- package/dist/evidence/effects.d.ts +107 -0
- package/dist/evidence/effects.d.ts.map +1 -0
- package/dist/evidence/effects.js +281 -0
- package/dist/evidence/effects.js.map +1 -0
- package/dist/evidence/read.d.ts +75 -0
- package/dist/evidence/read.d.ts.map +1 -0
- package/dist/evidence/read.js +105 -0
- package/dist/evidence/read.js.map +1 -0
- package/dist/gateways/base-gateway.d.ts +23 -3
- package/dist/gateways/base-gateway.d.ts.map +1 -1
- package/dist/gateways/base-gateway.js +15 -2
- package/dist/gateways/base-gateway.js.map +1 -1
- package/dist/gateways/discord.d.ts +4 -16
- package/dist/gateways/discord.d.ts.map +1 -1
- package/dist/gateways/discord.js +22 -189
- package/dist/gateways/discord.js.map +1 -1
- package/dist/gateways/index.d.ts +2 -1
- package/dist/gateways/index.d.ts.map +1 -1
- package/dist/gateways/message-router.d.ts +13 -20
- package/dist/gateways/message-router.d.ts.map +1 -1
- package/dist/gateways/message-router.js +32 -3
- package/dist/gateways/message-router.js.map +1 -1
- package/dist/gateways/slack.d.ts +2 -12
- package/dist/gateways/slack.d.ts.map +1 -1
- package/dist/gateways/slack.js +6 -220
- package/dist/gateways/slack.js.map +1 -1
- package/dist/gateways/telegram.d.ts +2 -2
- package/dist/gateways/telegram.d.ts.map +1 -1
- package/dist/gateways/telegram.js +3 -2
- package/dist/gateways/telegram.js.map +1 -1
- package/dist/gateways/turn-contract.d.ts +104 -0
- package/dist/gateways/turn-contract.d.ts.map +1 -0
- package/dist/{memory/consult-contract.js → gateways/turn-contract.js} +1 -1
- package/dist/gateways/turn-contract.js.map +1 -0
- package/dist/memory/provenance-live.d.ts +111 -0
- package/dist/memory/provenance-live.d.ts.map +1 -0
- package/dist/memory/provenance-live.js +381 -0
- package/dist/memory/provenance-live.js.map +1 -0
- package/dist/memory/provenance-resolver.d.ts +184 -0
- package/dist/memory/provenance-resolver.d.ts.map +1 -0
- package/dist/memory/provenance-resolver.js +152 -0
- package/dist/memory/provenance-resolver.js.map +1 -0
- package/dist/multi-agent/agent-event-bus.d.ts +1 -0
- package/dist/multi-agent/agent-event-bus.d.ts.map +1 -1
- package/dist/multi-agent/bmad-templates.d.ts +0 -18
- package/dist/multi-agent/bmad-templates.d.ts.map +1 -1
- package/dist/multi-agent/bmad-templates.js +0 -127
- package/dist/multi-agent/bmad-templates.js.map +1 -1
- package/dist/multi-agent/dashboard-agent-persona.js +3 -3
- package/dist/operator/board-reconcile.d.ts +2 -3
- package/dist/operator/board-reconcile.d.ts.map +1 -1
- package/dist/operator/board-reconcile.js +18 -32
- package/dist/operator/board-reconcile.js.map +1 -1
- package/dist/operator/changes-projection.d.ts +70 -0
- package/dist/operator/changes-projection.d.ts.map +1 -0
- package/dist/operator/changes-projection.js +109 -0
- package/dist/operator/changes-projection.js.map +1 -0
- package/dist/operator/external-correlation.d.ts +94 -0
- package/dist/operator/external-correlation.d.ts.map +1 -0
- package/dist/operator/external-correlation.js +177 -0
- package/dist/operator/external-correlation.js.map +1 -0
- package/dist/operator/operator-trigger-loop.d.ts +9 -1
- package/dist/operator/operator-trigger-loop.d.ts.map +1 -1
- package/dist/operator/operator-trigger-loop.js +8 -4
- package/dist/operator/operator-trigger-loop.js.map +1 -1
- package/dist/operator/provenance-lookup.d.ts +18 -0
- package/dist/operator/provenance-lookup.d.ts.map +1 -0
- package/dist/operator/provenance-lookup.js +54 -0
- package/dist/operator/provenance-lookup.js.map +1 -0
- package/dist/operator/report-carry.d.ts +18 -1
- package/dist/operator/report-carry.d.ts.map +1 -1
- package/dist/operator/report-carry.js +22 -3
- package/dist/operator/report-carry.js.map +1 -1
- package/dist/operator/report-run.d.ts +31 -0
- package/dist/operator/report-run.d.ts.map +1 -1
- package/dist/operator/report-run.js +140 -22
- package/dist/operator/report-run.js.map +1 -1
- package/dist/operator/task-ledger.d.ts +84 -2
- package/dist/operator/task-ledger.d.ts.map +1 -1
- package/dist/operator/task-ledger.js +274 -31
- package/dist/operator/task-ledger.js.map +1 -1
- package/dist/operator/worker-run.js +1 -1
- package/dist/operator/worker-run.js.map +1 -1
- package/dist/operator/workorder-hooks.d.ts +79 -4
- package/dist/operator/workorder-hooks.d.ts.map +1 -1
- package/dist/operator/workorder-hooks.js +152 -20
- package/dist/operator/workorder-hooks.js.map +1 -1
- package/dist/operator/workorder-publishers.d.ts +2 -0
- package/dist/operator/workorder-publishers.d.ts.map +1 -1
- package/dist/operator/workorder-publishers.js +8 -1
- package/dist/operator/workorder-publishers.js.map +1 -1
- package/dist/utils/untrusted-content.d.ts +11 -0
- package/dist/utils/untrusted-content.d.ts.map +1 -1
- package/dist/utils/untrusted-content.js +20 -0
- package/dist/utils/untrusted-content.js.map +1 -1
- package/package.json +4 -3
- package/scripts/backfill-channel-keys.ts +451 -0
- package/dist/agent/auto-recall.d.ts +0 -48
- package/dist/agent/auto-recall.d.ts.map +0 -1
- package/dist/agent/auto-recall.js +0 -192
- package/dist/agent/auto-recall.js.map +0 -1
- package/dist/agent/claude-client.d.ts +0 -50
- package/dist/agent/claude-client.d.ts.map +0 -1
- package/dist/agent/claude-client.js +0 -219
- package/dist/agent/claude-client.js.map +0 -1
- package/dist/agent/delegation-executor.d.ts +0 -49
- package/dist/agent/delegation-executor.d.ts.map +0 -1
- package/dist/agent/delegation-executor.js +0 -692
- package/dist/agent/delegation-executor.js.map +0 -1
- package/dist/agent/mcp-executor.d.ts +0 -60
- package/dist/agent/mcp-executor.d.ts.map +0 -1
- package/dist/agent/mcp-executor.js +0 -190
- package/dist/agent/mcp-executor.js.map +0 -1
- package/dist/agent/process-tree.d.ts +0 -6
- package/dist/agent/process-tree.d.ts.map +0 -1
- package/dist/agent/process-tree.js +0 -21
- package/dist/agent/process-tree.js.map +0 -1
- package/dist/agent/streaming-callback-manager.d.ts +0 -85
- package/dist/agent/streaming-callback-manager.d.ts.map +0 -1
- package/dist/agent/streaming-callback-manager.js +0 -103
- package/dist/agent/streaming-callback-manager.js.map +0 -1
- package/dist/agent/token-budget.d.ts +0 -49
- package/dist/agent/token-budget.d.ts.map +0 -1
- package/dist/agent/token-budget.js +0 -92
- package/dist/agent/token-budget.js.map +0 -1
- package/dist/connectors/kagemusha/history-compiler.d.ts +0 -18
- package/dist/connectors/kagemusha/history-compiler.d.ts.map +0 -1
- package/dist/connectors/kagemusha/history-compiler.js +0 -35
- package/dist/connectors/kagemusha/history-compiler.js.map +0 -1
- package/dist/db/migrations/wiki-artifacts.d.ts +0 -3
- package/dist/db/migrations/wiki-artifacts.d.ts.map +0 -1
- package/dist/db/migrations/wiki-artifacts.js +0 -24
- package/dist/db/migrations/wiki-artifacts.js.map +0 -1
- package/dist/envelope/subset.d.ts +0 -9
- package/dist/envelope/subset.d.ts.map +0 -1
- package/dist/envelope/subset.js +0 -67
- package/dist/envelope/subset.js.map +0 -1
- package/dist/memory/consult-contract.d.ts +0 -8
- package/dist/memory/consult-contract.d.ts.map +0 -1
- package/dist/memory/consult-contract.js.map +0 -1
- package/dist/multi-agent/agent-message-queue.d.ts +0 -104
- package/dist/multi-agent/agent-message-queue.d.ts.map +0 -1
- package/dist/multi-agent/agent-message-queue.js +0 -227
- package/dist/multi-agent/agent-message-queue.js.map +0 -1
- package/dist/multi-agent/background-task-manager.d.ts +0 -248
- package/dist/multi-agent/background-task-manager.d.ts.map +0 -1
- package/dist/multi-agent/background-task-manager.js +0 -415
- package/dist/multi-agent/background-task-manager.js.map +0 -1
- package/dist/multi-agent/category-router.d.ts +0 -56
- package/dist/multi-agent/category-router.d.ts.map +0 -1
- package/dist/multi-agent/category-router.js +0 -99
- package/dist/multi-agent/category-router.js.map +0 -1
- package/dist/multi-agent/council-engine.d.ts +0 -60
- package/dist/multi-agent/council-engine.d.ts.map +0 -1
- package/dist/multi-agent/council-engine.js +0 -284
- package/dist/multi-agent/council-engine.js.map +0 -1
- package/dist/multi-agent/delegation-format-validator.d.ts +0 -22
- package/dist/multi-agent/delegation-format-validator.d.ts.map +0 -1
- package/dist/multi-agent/delegation-format-validator.js +0 -31
- package/dist/multi-agent/delegation-format-validator.js.map +0 -1
- package/dist/multi-agent/delegation-manager.d.ts +0 -128
- package/dist/multi-agent/delegation-manager.d.ts.map +0 -1
- package/dist/multi-agent/delegation-manager.js +0 -276
- package/dist/multi-agent/delegation-manager.js.map +0 -1
- package/dist/multi-agent/i18n-messages.d.ts +0 -35
- package/dist/multi-agent/i18n-messages.d.ts.map +0 -1
- package/dist/multi-agent/i18n-messages.js +0 -54
- package/dist/multi-agent/i18n-messages.js.map +0 -1
- package/dist/multi-agent/index.d.ts +0 -31
- package/dist/multi-agent/index.d.ts.map +0 -1
- package/dist/multi-agent/index.js +0 -46
- package/dist/multi-agent/index.js.map +0 -1
- package/dist/multi-agent/multi-agent-base.d.ts +0 -223
- package/dist/multi-agent/multi-agent-base.d.ts.map +0 -1
- package/dist/multi-agent/multi-agent-base.js +0 -592
- package/dist/multi-agent/multi-agent-base.js.map +0 -1
- package/dist/multi-agent/multi-agent-discord.d.ts +0 -142
- package/dist/multi-agent/multi-agent-discord.d.ts.map +0 -1
- package/dist/multi-agent/multi-agent-discord.js +0 -1235
- package/dist/multi-agent/multi-agent-discord.js.map +0 -1
- package/dist/multi-agent/multi-agent-slack.d.ts +0 -146
- package/dist/multi-agent/multi-agent-slack.d.ts.map +0 -1
- package/dist/multi-agent/multi-agent-slack.js +0 -953
- package/dist/multi-agent/multi-agent-slack.js.map +0 -1
- package/dist/multi-agent/multi-bot-manager.d.ts +0 -119
- package/dist/multi-agent/multi-bot-manager.d.ts.map +0 -1
- package/dist/multi-agent/multi-bot-manager.js +0 -449
- package/dist/multi-agent/multi-bot-manager.js.map +0 -1
- package/dist/multi-agent/orchestrator.d.ts +0 -110
- package/dist/multi-agent/orchestrator.d.ts.map +0 -1
- package/dist/multi-agent/orchestrator.js +0 -436
- package/dist/multi-agent/orchestrator.js.map +0 -1
- package/dist/multi-agent/rate-limiter.d.ts +0 -76
- package/dist/multi-agent/rate-limiter.d.ts.map +0 -1
- package/dist/multi-agent/rate-limiter.js +0 -128
- package/dist/multi-agent/rate-limiter.js.map +0 -1
- package/dist/multi-agent/shared-context.d.ts +0 -127
- package/dist/multi-agent/shared-context.d.ts.map +0 -1
- package/dist/multi-agent/shared-context.js +0 -239
- package/dist/multi-agent/shared-context.js.map +0 -1
- package/dist/multi-agent/slack-config-validator.d.ts +0 -42
- package/dist/multi-agent/slack-config-validator.d.ts.map +0 -1
- package/dist/multi-agent/slack-config-validator.js +0 -194
- package/dist/multi-agent/slack-config-validator.js.map +0 -1
- package/dist/multi-agent/slack-multi-bot-manager.d.ts +0 -143
- package/dist/multi-agent/slack-multi-bot-manager.d.ts.map +0 -1
- package/dist/multi-agent/slack-multi-bot-manager.js +0 -413
- package/dist/multi-agent/slack-multi-bot-manager.js.map +0 -1
- package/dist/multi-agent/swarm/swarm-anti-pattern-detector.d.ts +0 -98
- package/dist/multi-agent/swarm/swarm-anti-pattern-detector.d.ts.map +0 -1
- package/dist/multi-agent/swarm/swarm-anti-pattern-detector.js +0 -225
- package/dist/multi-agent/swarm/swarm-anti-pattern-detector.js.map +0 -1
- package/dist/multi-agent/swarm/swarm-db.d.ts +0 -175
- package/dist/multi-agent/swarm/swarm-db.d.ts.map +0 -1
- package/dist/multi-agent/swarm/swarm-db.js +0 -313
- package/dist/multi-agent/swarm/swarm-db.js.map +0 -1
- package/dist/multi-agent/swarm/swarm-event-reporter.d.ts +0 -116
- package/dist/multi-agent/swarm/swarm-event-reporter.d.ts.map +0 -1
- package/dist/multi-agent/swarm/swarm-event-reporter.js +0 -243
- package/dist/multi-agent/swarm/swarm-event-reporter.js.map +0 -1
- package/dist/multi-agent/swarm/swarm-mama-adapter.d.ts +0 -57
- package/dist/multi-agent/swarm/swarm-mama-adapter.d.ts.map +0 -1
- package/dist/multi-agent/swarm/swarm-mama-adapter.js +0 -87
- package/dist/multi-agent/swarm/swarm-mama-adapter.js.map +0 -1
- package/dist/multi-agent/swarm/swarm-manager.d.ts +0 -122
- package/dist/multi-agent/swarm/swarm-manager.d.ts.map +0 -1
- package/dist/multi-agent/swarm/swarm-manager.js +0 -199
- package/dist/multi-agent/swarm/swarm-manager.js.map +0 -1
- package/dist/multi-agent/swarm/swarm-task-learner.d.ts +0 -104
- package/dist/multi-agent/swarm/swarm-task-learner.d.ts.map +0 -1
- package/dist/multi-agent/swarm/swarm-task-learner.js +0 -211
- package/dist/multi-agent/swarm/swarm-task-learner.js.map +0 -1
- package/dist/multi-agent/swarm/swarm-task-runner.d.ts +0 -155
- package/dist/multi-agent/swarm/swarm-task-runner.d.ts.map +0 -1
- package/dist/multi-agent/swarm/swarm-task-runner.js +0 -615
- package/dist/multi-agent/swarm/swarm-task-runner.js.map +0 -1
- package/dist/multi-agent/swarm/wave-engine.d.ts +0 -96
- package/dist/multi-agent/swarm/wave-engine.d.ts.map +0 -1
- package/dist/multi-agent/swarm/wave-engine.js +0 -123
- package/dist/multi-agent/swarm/wave-engine.js.map +0 -1
- package/dist/multi-agent/system-reminder.d.ts +0 -206
- package/dist/multi-agent/system-reminder.d.ts.map +0 -1
- package/dist/multi-agent/system-reminder.js +0 -455
- package/dist/multi-agent/system-reminder.js.map +0 -1
- package/dist/multi-agent/task-continuation.d.ts +0 -74
- package/dist/multi-agent/task-continuation.d.ts.map +0 -1
- package/dist/multi-agent/task-continuation.js +0 -172
- package/dist/multi-agent/task-continuation.js.map +0 -1
- package/dist/multi-agent/ultrawork-state.d.ts +0 -57
- package/dist/multi-agent/ultrawork-state.d.ts.map +0 -1
- package/dist/multi-agent/ultrawork-state.js +0 -191
- package/dist/multi-agent/ultrawork-state.js.map +0 -1
- package/dist/multi-agent/ultrawork.d.ts +0 -152
- package/dist/multi-agent/ultrawork.d.ts.map +0 -1
- package/dist/multi-agent/ultrawork.js +0 -879
- package/dist/multi-agent/ultrawork.js.map +0 -1
- package/dist/multi-agent/work-tracker.d.ts +0 -22
- package/dist/multi-agent/work-tracker.d.ts.map +0 -1
- package/dist/multi-agent/work-tracker.js +0 -45
- package/dist/multi-agent/work-tracker.js.map +0 -1
- package/dist/multi-agent/workflow-engine.d.ts +0 -87
- package/dist/multi-agent/workflow-engine.d.ts.map +0 -1
- package/dist/multi-agent/workflow-engine.js +0 -604
- package/dist/multi-agent/workflow-engine.js.map +0 -1
- package/dist/onboarding/all-tools.d.ts +0 -18
- package/dist/onboarding/all-tools.d.ts.map +0 -1
- package/dist/onboarding/all-tools.js +0 -149
- package/dist/onboarding/all-tools.js.map +0 -1
- package/dist/onboarding/autonomous-discovery-tools.d.ts +0 -23
- package/dist/onboarding/autonomous-discovery-tools.d.ts.map +0 -1
- package/dist/onboarding/autonomous-discovery-tools.js +0 -268
- package/dist/onboarding/autonomous-discovery-tools.js.map +0 -1
- package/dist/onboarding/onboarding-state.d.ts +0 -70
- package/dist/onboarding/onboarding-state.d.ts.map +0 -1
- package/dist/onboarding/onboarding-state.js +0 -183
- package/dist/onboarding/onboarding-state.js.map +0 -1
- package/dist/onboarding/personality-quiz.d.ts +0 -35
- package/dist/onboarding/personality-quiz.d.ts.map +0 -1
- package/dist/onboarding/personality-quiz.js +0 -219
- package/dist/onboarding/personality-quiz.js.map +0 -1
- package/dist/onboarding/phase-5-summary.d.ts +0 -26
- package/dist/onboarding/phase-5-summary.d.ts.map +0 -1
- package/dist/onboarding/phase-5-summary.js +0 -153
- package/dist/onboarding/phase-5-summary.js.map +0 -1
- package/dist/onboarding/phase-6-security.d.ts +0 -33
- package/dist/onboarding/phase-6-security.d.ts.map +0 -1
- package/dist/onboarding/phase-6-security.js +0 -473
- package/dist/onboarding/phase-6-security.js.map +0 -1
- package/dist/onboarding/phase-7-integrations.d.ts +0 -91
- package/dist/onboarding/phase-7-integrations.d.ts.map +0 -1
- package/dist/onboarding/phase-7-integrations.js +0 -725
- package/dist/onboarding/phase-7-integrations.js.map +0 -1
- package/dist/onboarding/phase-8-demo.d.ts +0 -43
- package/dist/onboarding/phase-8-demo.d.ts.map +0 -1
- package/dist/onboarding/phase-8-demo.js +0 -346
- package/dist/onboarding/phase-8-demo.js.map +0 -1
- package/dist/onboarding/phase-9-finalization.d.ts +0 -27
- package/dist/onboarding/phase-9-finalization.d.ts.map +0 -1
- package/dist/onboarding/phase-9-finalization.js +0 -417
- package/dist/onboarding/phase-9-finalization.js.map +0 -1
- package/dist/onboarding/ritual-prompt.d.ts +0 -2
- package/dist/onboarding/ritual-prompt.d.ts.map +0 -1
- package/dist/onboarding/ritual-prompt.js +0 -285
- package/dist/onboarding/ritual-prompt.js.map +0 -1
- package/dist/onboarding/ritual-tools.d.ts +0 -17
- package/dist/onboarding/ritual-tools.d.ts.map +0 -1
- package/dist/onboarding/ritual-tools.js +0 -93
- package/dist/onboarding/ritual-tools.js.map +0 -1
- package/dist/setup/setup-tools.d.ts +0 -13
- package/dist/setup/setup-tools.d.ts.map +0 -1
- package/dist/setup/setup-tools.js +0 -106
- package/dist/setup/setup-tools.js.map +0 -1
- package/dist/utils/slack-input-validator.d.ts +0 -74
- package/dist/utils/slack-input-validator.d.ts.map +0 -1
- package/dist/utils/slack-input-validator.js +0 -275
- package/dist/utils/slack-input-validator.js.map +0 -1
- package/dist/utils/slack-rate-limiter.d.ts +0 -139
- package/dist/utils/slack-rate-limiter.d.ts.map +0 -1
- package/dist/utils/slack-rate-limiter.js +0 -324
- package/dist/utils/slack-rate-limiter.js.map +0 -1
- package/dist/wiki/wiki-compiler.d.ts +0 -13
- package/dist/wiki/wiki-compiler.d.ts.map +0 -1
- package/dist/wiki/wiki-compiler.js +0 -82
- package/dist/wiki/wiki-compiler.js.map +0 -1
|
@@ -61,6 +61,8 @@ const mama_core_1 = require("@jungjaehoon/mama-core");
|
|
|
61
61
|
const security_monitor_js_1 = require("../security/security-monitor.js");
|
|
62
62
|
const secret_filter_js_1 = require("../memory/secret-filter.js");
|
|
63
63
|
const scope_context_js_1 = require("../memory/scope-context.js");
|
|
64
|
+
const provenance_live_js_1 = require("../memory/provenance-live.js");
|
|
65
|
+
const worker_envelope_js_1 = require("../api/worker-envelope.js");
|
|
64
66
|
const drive_tools_js_1 = require("./drive-tools.js");
|
|
65
67
|
const image_translation_tools_js_1 = require("./image-translation-tools.js");
|
|
66
68
|
const attachment_text_extractor_js_1 = require("./attachment-text-extractor.js");
|
|
@@ -75,9 +77,10 @@ const agent_store_js_1 = require("../db/agent-store.js");
|
|
|
75
77
|
const types_js_2 = require("../cli/config/types.js");
|
|
76
78
|
const managed_agent_runtime_sync_js_1 = require("./managed-agent-runtime-sync.js");
|
|
77
79
|
const managed_agent_validation_js_1 = require("./managed-agent-validation.js");
|
|
78
|
-
const delegation_executor_js_1 = require("./delegation-executor.js");
|
|
79
80
|
const index_js_1 = require("../envelope/index.js");
|
|
80
81
|
const wiki_publish_adapter_js_1 = require("../wiki-artifacts/wiki-publish-adapter.js");
|
|
82
|
+
const changes_projection_js_1 = require("../operator/changes-projection.js");
|
|
83
|
+
const read_js_1 = require("../evidence/read.js");
|
|
81
84
|
function serializeTaskToolRecord(task) {
|
|
82
85
|
return {
|
|
83
86
|
...task,
|
|
@@ -168,6 +171,7 @@ const MEMORY_SCOPE_AUDIT_TOOLS = new Set([
|
|
|
168
171
|
'mama_save',
|
|
169
172
|
'mama_search',
|
|
170
173
|
'mama_recall',
|
|
174
|
+
'mama_provenance',
|
|
171
175
|
'context_compile',
|
|
172
176
|
'mama_update',
|
|
173
177
|
'mama_add',
|
|
@@ -219,6 +223,7 @@ const MEMORY_READ_PERMISSION_BEFORE_ENVELOPE_TOOLS = new Set([
|
|
|
219
223
|
'mama_save',
|
|
220
224
|
'mama_search',
|
|
221
225
|
'mama_recall',
|
|
226
|
+
'mama_provenance',
|
|
222
227
|
'context_compile',
|
|
223
228
|
]);
|
|
224
229
|
const ENVELOPE_REQUIRED_SURFACES = new Set([
|
|
@@ -266,6 +271,10 @@ function sanitizeRecallMemory(value) {
|
|
|
266
271
|
return null;
|
|
267
272
|
}
|
|
268
273
|
const safe = {};
|
|
274
|
+
const memoryId = stringField(record, 'id');
|
|
275
|
+
if (memoryId) {
|
|
276
|
+
safe.memoryId = memoryId;
|
|
277
|
+
}
|
|
269
278
|
const topic = sanitizeRecallText(stringField(record, 'topic'));
|
|
270
279
|
const kind = sanitizeRecallText(stringField(record, 'kind'));
|
|
271
280
|
const summary = sanitizeRecallText(stringField(record, 'summary'));
|
|
@@ -416,7 +425,6 @@ class GatewayToolExecutor {
|
|
|
416
425
|
currentContext = null;
|
|
417
426
|
memoryAgentProcessManager = null;
|
|
418
427
|
agentProcessManager = null;
|
|
419
|
-
delegationManagerRef = null;
|
|
420
428
|
currentAgentId = '';
|
|
421
429
|
currentSource = '';
|
|
422
430
|
currentChannelId = '';
|
|
@@ -450,14 +458,11 @@ class GatewayToolExecutor {
|
|
|
450
458
|
sessionsDb = null;
|
|
451
459
|
setSessionsDb(db) {
|
|
452
460
|
this.sessionsDb = db;
|
|
453
|
-
this.refreshDelegationExecutor();
|
|
454
|
-
}
|
|
455
|
-
rawStore = null;
|
|
456
|
-
setRawStore(store) {
|
|
457
|
-
this.rawStore = store;
|
|
458
|
-
this.refreshDelegationExecutor();
|
|
459
461
|
}
|
|
460
|
-
|
|
462
|
+
/** Accepted and discarded: the only reader was the delegation executor, which is gone.
|
|
463
|
+
* The setter stays because its callers are live - delete both together when a second
|
|
464
|
+
* reader appears or the callers do not. */
|
|
465
|
+
setRawStore(_store) { }
|
|
461
466
|
uiCommandQueue = null;
|
|
462
467
|
setUICommandQueue(queue) {
|
|
463
468
|
this.uiCommandQueue = queue;
|
|
@@ -470,21 +475,13 @@ class GatewayToolExecutor {
|
|
|
470
475
|
setRestartMultiAgentAgent(fn) {
|
|
471
476
|
this.restartMultiAgentAgent = fn;
|
|
472
477
|
}
|
|
473
|
-
|
|
474
|
-
setValidationService(
|
|
475
|
-
this.validationService = svc;
|
|
476
|
-
this.refreshDelegationExecutor();
|
|
477
|
-
}
|
|
478
|
+
/** Same as setRawStore: the only reader was the delegation executor. */
|
|
479
|
+
setValidationService(_svc) { }
|
|
478
480
|
setMemoryAgent(processManager) {
|
|
479
481
|
this.memoryAgentProcessManager = processManager;
|
|
480
482
|
}
|
|
481
483
|
setAgentProcessManager(pm) {
|
|
482
484
|
this.agentProcessManager = pm;
|
|
483
|
-
this.refreshDelegationExecutor();
|
|
484
|
-
}
|
|
485
|
-
setDelegationManager(dm) {
|
|
486
|
-
this.delegationManagerRef = dm;
|
|
487
|
-
this.refreshDelegationExecutor();
|
|
488
485
|
}
|
|
489
486
|
/** Get AgentProcessManager (for cron/event triggers that need direct process access) */
|
|
490
487
|
getAgentProcessManager() {
|
|
@@ -509,6 +506,7 @@ class GatewayToolExecutor {
|
|
|
509
506
|
gatewayCallId: executionContext?.gatewayCallId,
|
|
510
507
|
workorderAttemptId: executionContext?.workorderAttemptId,
|
|
511
508
|
temporalWorkContext: executionContext?.temporalWorkContext,
|
|
509
|
+
causeEventIds: executionContext?.causeEventIds,
|
|
512
510
|
signal: executionContext?.signal,
|
|
513
511
|
parentToolName: executionContext?.parentToolName,
|
|
514
512
|
backgroundTasks: executionContext?.backgroundTasks,
|
|
@@ -546,6 +544,7 @@ class GatewayToolExecutor {
|
|
|
546
544
|
workorderAttemptId: active.workorderAttemptId,
|
|
547
545
|
// Never merged from fallback - temporal authority belongs to one claimed run only.
|
|
548
546
|
temporalWorkContext: active.temporalWorkContext,
|
|
547
|
+
causeEventIds: active.causeEventIds,
|
|
549
548
|
signal: active.signal,
|
|
550
549
|
parentToolName: active.parentToolName ?? fallback.parentToolName,
|
|
551
550
|
backgroundTasks: active.backgroundTasks ?? fallback.backgroundTasks,
|
|
@@ -556,6 +555,7 @@ class GatewayToolExecutor {
|
|
|
556
555
|
getActiveContext() {
|
|
557
556
|
return this.getExecutionState().agentContext;
|
|
558
557
|
}
|
|
558
|
+
/** Who and where the active turn is. Was typed by the delegation executor; now local. */
|
|
559
559
|
getActiveRouting() {
|
|
560
560
|
const state = this.getExecutionState();
|
|
561
561
|
return {
|
|
@@ -564,14 +564,6 @@ class GatewayToolExecutor {
|
|
|
564
564
|
channelId: state.channelId,
|
|
565
565
|
};
|
|
566
566
|
}
|
|
567
|
-
getActiveDelegationRouting() {
|
|
568
|
-
const routing = this.getActiveRouting();
|
|
569
|
-
return {
|
|
570
|
-
agentId: routing.agentId || 'conductor',
|
|
571
|
-
source: routing.source || 'viewer',
|
|
572
|
-
channelId: routing.channelId || 'default',
|
|
573
|
-
};
|
|
574
|
-
}
|
|
575
567
|
async withExecutionContext(executionContext, fn) {
|
|
576
568
|
if (!executionContext) {
|
|
577
569
|
return fn();
|
|
@@ -715,32 +707,6 @@ class GatewayToolExecutor {
|
|
|
715
707
|
return this.memoryAgentProcessManager !== null;
|
|
716
708
|
}
|
|
717
709
|
/** Check if delegate tool support is available (multi-agent wired). */
|
|
718
|
-
hasDelegateSupport() {
|
|
719
|
-
return this.agentProcessManager !== null && this.delegationManagerRef !== null;
|
|
720
|
-
}
|
|
721
|
-
/** Retry delay (ms) for delegate backoff. Initialized from config in constructor. */
|
|
722
|
-
_retryDelayMs = 1000;
|
|
723
|
-
createDelegationExecutor() {
|
|
724
|
-
return new delegation_executor_js_1.DelegationExecutor({
|
|
725
|
-
agentProcessManager: this.agentProcessManager,
|
|
726
|
-
delegationManagerRef: this.delegationManagerRef,
|
|
727
|
-
rawStore: this.rawStore,
|
|
728
|
-
sessionsDb: this.sessionsDb,
|
|
729
|
-
validationService: this.validationService,
|
|
730
|
-
retryDelayMs: this._retryDelayMs,
|
|
731
|
-
resolveManagedAgentId: (id) => this.resolveManagedAgentId(id),
|
|
732
|
-
checkViewerOnly: () => this.checkViewerOnly(),
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
refreshDelegationExecutor() {
|
|
736
|
-
this.delegationExecutor = this.createDelegationExecutor();
|
|
737
|
-
}
|
|
738
|
-
getDelegationExecutor() {
|
|
739
|
-
if (!this.delegationExecutor) {
|
|
740
|
-
this.refreshDelegationExecutor();
|
|
741
|
-
}
|
|
742
|
-
return this.delegationExecutor;
|
|
743
|
-
}
|
|
744
710
|
constructor(options = {}) {
|
|
745
711
|
const privateWorkspaceRoot = (0, path_1.resolve)(process.env.MAMA_WORKSPACE || (0, path_1.join)((0, os_1.homedir)(), '.mama', 'workspace'));
|
|
746
712
|
this.driveTools = new drive_tools_js_1.DriveToolService({ workspaceRoot: privateWorkspaceRoot });
|
|
@@ -775,14 +741,6 @@ class GatewayToolExecutor {
|
|
|
775
741
|
if (options.mamaApi) {
|
|
776
742
|
this.mamaApi = options.mamaApi;
|
|
777
743
|
}
|
|
778
|
-
// Read retry delay from config (safe: falls back to 1000ms if config not yet initialized)
|
|
779
|
-
try {
|
|
780
|
-
this._retryDelayMs = (0, config_manager_js_1.getConfig)().timeouts?.busy_retry_ms ?? 1000;
|
|
781
|
-
}
|
|
782
|
-
catch {
|
|
783
|
-
// Config not initialized yet — keep default 1000ms
|
|
784
|
-
}
|
|
785
|
-
this.refreshDelegationExecutor();
|
|
786
744
|
}
|
|
787
745
|
async beginRuntimeModelRun(input) {
|
|
788
746
|
const api = this.requireTraceApi(await this.initializeMAMAApi(), true);
|
|
@@ -1319,6 +1277,7 @@ class GatewayToolExecutor {
|
|
|
1319
1277
|
}
|
|
1320
1278
|
if (toolName === 'mama_search' ||
|
|
1321
1279
|
toolName === 'mama_recall' ||
|
|
1280
|
+
toolName === 'mama_provenance' ||
|
|
1322
1281
|
toolName === 'context_compile') {
|
|
1323
1282
|
return normalizeMemoryScopes(input.scopes);
|
|
1324
1283
|
}
|
|
@@ -1350,7 +1309,7 @@ class GatewayToolExecutor {
|
|
|
1350
1309
|
projectId: process.env.MAMA_WORKSPACE || process.cwd(),
|
|
1351
1310
|
});
|
|
1352
1311
|
}
|
|
1353
|
-
resolveMamaRecallScopes(input) {
|
|
1312
|
+
resolveMamaRecallScopes(input, toolName = 'mama_recall') {
|
|
1354
1313
|
const ctx = this.getExecutionState();
|
|
1355
1314
|
const requestedScopes = normalizeMemoryScopes(input.scopes);
|
|
1356
1315
|
const callerProvidedScopes = input.scopes !== undefined;
|
|
@@ -1362,7 +1321,7 @@ class GatewayToolExecutor {
|
|
|
1362
1321
|
denial: {
|
|
1363
1322
|
success: false,
|
|
1364
1323
|
code: 'memory_scope_invalid',
|
|
1365
|
-
error:
|
|
1324
|
+
error: `${toolName} scopes must be valid memory scope objects.`,
|
|
1366
1325
|
},
|
|
1367
1326
|
};
|
|
1368
1327
|
}
|
|
@@ -1373,7 +1332,7 @@ class GatewayToolExecutor {
|
|
|
1373
1332
|
denial: {
|
|
1374
1333
|
success: false,
|
|
1375
1334
|
code: 'memory_scope_denied',
|
|
1376
|
-
error:
|
|
1335
|
+
error: `${toolName} requires an active session or envelope for caller-supplied scopes.`,
|
|
1377
1336
|
},
|
|
1378
1337
|
};
|
|
1379
1338
|
}
|
|
@@ -1390,7 +1349,7 @@ class GatewayToolExecutor {
|
|
|
1390
1349
|
denial: {
|
|
1391
1350
|
success: false,
|
|
1392
1351
|
code: 'memory_scope_denied',
|
|
1393
|
-
error:
|
|
1352
|
+
error: `${toolName} requested scopes outside the active session or envelope.`,
|
|
1394
1353
|
},
|
|
1395
1354
|
};
|
|
1396
1355
|
}
|
|
@@ -1759,9 +1718,6 @@ class GatewayToolExecutor {
|
|
|
1759
1718
|
// Obsidian vault management via CLI
|
|
1760
1719
|
case 'obsidian':
|
|
1761
1720
|
return await this.executeObsidian(input);
|
|
1762
|
-
// Agent lifecycle tools
|
|
1763
|
-
case 'agent_test':
|
|
1764
|
-
return await this.getDelegationExecutor().runAgentTest(input, this.getActiveDelegationRouting());
|
|
1765
1721
|
// Agent management tools (Managed Agents pattern)
|
|
1766
1722
|
case 'agent_get': {
|
|
1767
1723
|
if (!this.sessionsDb) {
|
|
@@ -1959,9 +1915,6 @@ class GatewayToolExecutor {
|
|
|
1959
1915
|
this.uiCommandQueue.push({ type: 'notify', payload: args });
|
|
1960
1916
|
return { success: true, notified: true };
|
|
1961
1917
|
}
|
|
1962
|
-
// Multi-Agent delegation
|
|
1963
|
-
case 'delegate':
|
|
1964
|
-
return await this.getDelegationExecutor().runDelegate(input, this.getActiveDelegationRouting());
|
|
1965
1918
|
}
|
|
1966
1919
|
// Lazy MAMA API init — only for tools that need it
|
|
1967
1920
|
const getApi = () => this.initializeMAMAApi();
|
|
@@ -2045,6 +1998,8 @@ class GatewayToolExecutor {
|
|
|
2045
1998
|
return await (0, mama_tool_handlers_js_1.handleSearch)(await getApi(), input);
|
|
2046
1999
|
case 'mama_recall':
|
|
2047
2000
|
return await this.handleMamaRecall(input);
|
|
2001
|
+
case 'mama_provenance':
|
|
2002
|
+
return await this.handleMamaProvenance(input);
|
|
2048
2003
|
case 'context_compile':
|
|
2049
2004
|
return await this.handleContextCompile(input);
|
|
2050
2005
|
case 'mama_update': {
|
|
@@ -2331,10 +2286,13 @@ class GatewayToolExecutor {
|
|
|
2331
2286
|
const { getTrelloKanban } = await import('../connectors/trello/query-tools.js');
|
|
2332
2287
|
const kanbanInput = input;
|
|
2333
2288
|
try {
|
|
2334
|
-
|
|
2289
|
+
// Coverage rides alongside the data: `complete`/`boards`/`truncated`/
|
|
2290
|
+
// `observedAt` are what let a caller tell a truly empty board from one it
|
|
2291
|
+
// failed to read, and a whole column from a sliced one.
|
|
2292
|
+
const snapshot = await getTrelloKanban({
|
|
2335
2293
|
maxCardsPerList: kanbanInput.maxCardsPerList,
|
|
2336
2294
|
});
|
|
2337
|
-
return { success: true,
|
|
2295
|
+
return { success: true, ...snapshot };
|
|
2338
2296
|
}
|
|
2339
2297
|
catch (err) {
|
|
2340
2298
|
return {
|
|
@@ -2352,6 +2310,16 @@ class GatewayToolExecutor {
|
|
|
2352
2310
|
}
|
|
2353
2311
|
return { success: true, messages: queryMessages(msgInput) };
|
|
2354
2312
|
}
|
|
2313
|
+
case 'changes_read': {
|
|
2314
|
+
if (!this.taskLedger) {
|
|
2315
|
+
return { success: false, error: 'Task ledger not configured' };
|
|
2316
|
+
}
|
|
2317
|
+
// Coverage and totals ride with the rows for the same reason task_list carries
|
|
2318
|
+
// its own: "I changed 12 things" and "I can say why for 4 of them" are
|
|
2319
|
+
// different claims, and a page of rows without the count it was drawn from
|
|
2320
|
+
// states more than the ledger holds.
|
|
2321
|
+
return (0, changes_projection_js_1.readChanges)(this.taskLedger, input, Date.now());
|
|
2322
|
+
}
|
|
2355
2323
|
case 'task_list': {
|
|
2356
2324
|
if (!this.taskLedger) {
|
|
2357
2325
|
return { success: false, error: 'Task ledger not configured' };
|
|
@@ -2368,26 +2336,100 @@ class GatewayToolExecutor {
|
|
|
2368
2336
|
};
|
|
2369
2337
|
}
|
|
2370
2338
|
const listInput = input;
|
|
2339
|
+
// total/returned/nextCursor ride with the rows: a bounded read (default 50,
|
|
2340
|
+
// max 200) is otherwise indistinguishable from the whole board, and a report
|
|
2341
|
+
// that says "the open items are..." from one page states more than it read.
|
|
2342
|
+
const page = this.taskLedger.listPage({
|
|
2343
|
+
status: listInput.status,
|
|
2344
|
+
channel: listInput.channel,
|
|
2345
|
+
search: listInput.search,
|
|
2346
|
+
limit: listInput.limit,
|
|
2347
|
+
order: listInput.order ?? 'deadline_priority',
|
|
2348
|
+
cursor: listInput.cursor,
|
|
2349
|
+
});
|
|
2371
2350
|
return {
|
|
2372
2351
|
success: true,
|
|
2373
|
-
tasks:
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
search: listInput.search,
|
|
2378
|
-
limit: listInput.limit,
|
|
2379
|
-
order: listInput.order ?? 'deadline_priority',
|
|
2380
|
-
})
|
|
2381
|
-
.map(serializeTaskToolRecord),
|
|
2352
|
+
tasks: page.tasks.map(serializeTaskToolRecord),
|
|
2353
|
+
total: page.total,
|
|
2354
|
+
returned: page.returned,
|
|
2355
|
+
nextCursor: page.nextCursor,
|
|
2382
2356
|
};
|
|
2383
2357
|
}
|
|
2358
|
+
case 'task_external_correlation': {
|
|
2359
|
+
if (!this.taskLedger) {
|
|
2360
|
+
return { success: false, error: 'Task ledger not configured' };
|
|
2361
|
+
}
|
|
2362
|
+
const { correlateTasksWithExternalItems } = await import('../operator/external-correlation.js');
|
|
2363
|
+
const { buildProvenanceLookup } = await import('../operator/provenance-lookup.js');
|
|
2364
|
+
const { getTrelloKanban } = await import('../connectors/trello/query-tools.js');
|
|
2365
|
+
try {
|
|
2366
|
+
// The whole open set is walked HERE, not by the model: a correlation over
|
|
2367
|
+
// one page would answer "what did the caller happen to see" rather than
|
|
2368
|
+
// "what is on the board", which is the substitution this tool exists to stop.
|
|
2369
|
+
const ledger = this.taskLedger;
|
|
2370
|
+
const open = [];
|
|
2371
|
+
let cursor;
|
|
2372
|
+
do {
|
|
2373
|
+
const page = ledger.listPage({ limit: 200, cursor });
|
|
2374
|
+
for (const task of page.tasks) {
|
|
2375
|
+
if (task.status !== 'done' && task.status !== 'cancelled') {
|
|
2376
|
+
open.push({
|
|
2377
|
+
id: task.id,
|
|
2378
|
+
sourceChannel: task.sourceChannel,
|
|
2379
|
+
sourceEventId: task.sourceEventId,
|
|
2380
|
+
});
|
|
2381
|
+
}
|
|
2382
|
+
}
|
|
2383
|
+
cursor = page.nextCursor ?? undefined;
|
|
2384
|
+
} while (cursor);
|
|
2385
|
+
const snapshot = await getTrelloKanban({ maxCardsPerList: 100 });
|
|
2386
|
+
const liveItems = snapshot.columns.flatMap((column) => column.cards.map((card) => ({
|
|
2387
|
+
itemId: card.cardId,
|
|
2388
|
+
board: column.board,
|
|
2389
|
+
list: column.list,
|
|
2390
|
+
})));
|
|
2391
|
+
const result = correlateTasksWithExternalItems({
|
|
2392
|
+
connector: 'trello',
|
|
2393
|
+
rows: open,
|
|
2394
|
+
lookupProvenance: await buildProvenanceLookup(),
|
|
2395
|
+
liveItems,
|
|
2396
|
+
liveSnapshotComplete: snapshot.complete,
|
|
2397
|
+
});
|
|
2398
|
+
return {
|
|
2399
|
+
success: true,
|
|
2400
|
+
correlations: result.correlations,
|
|
2401
|
+
coverage: result.coverage,
|
|
2402
|
+
snapshot: {
|
|
2403
|
+
observedAt: snapshot.observedAt,
|
|
2404
|
+
cacheAgeMs: snapshot.cacheAgeMs,
|
|
2405
|
+
complete: snapshot.complete,
|
|
2406
|
+
truncated: snapshot.truncated,
|
|
2407
|
+
boards: snapshot.boards,
|
|
2408
|
+
},
|
|
2409
|
+
};
|
|
2410
|
+
}
|
|
2411
|
+
catch (err) {
|
|
2412
|
+
return {
|
|
2413
|
+
success: false,
|
|
2414
|
+
code: 'correlation_failed',
|
|
2415
|
+
error: err instanceof Error ? err.message : String(err),
|
|
2416
|
+
};
|
|
2417
|
+
}
|
|
2418
|
+
}
|
|
2384
2419
|
case 'task_create': {
|
|
2385
2420
|
if (!this.taskLedger) {
|
|
2386
2421
|
return { success: false, error: 'Task ledger not configured' };
|
|
2387
2422
|
}
|
|
2388
2423
|
return {
|
|
2389
2424
|
success: true,
|
|
2390
|
-
task: serializeTaskToolRecord(
|
|
2425
|
+
task: serializeTaskToolRecord(
|
|
2426
|
+
// The run id comes from trusted execution state, never from the tool call:
|
|
2427
|
+
// an agent that can name its own run in the effect ledger can sign someone
|
|
2428
|
+
// else's work with it.
|
|
2429
|
+
this.taskLedger.create(input, {
|
|
2430
|
+
runId: this.getExecutionState().modelRunId ?? null,
|
|
2431
|
+
causeEventIds: this.getExecutionState().causeEventIds,
|
|
2432
|
+
})),
|
|
2391
2433
|
};
|
|
2392
2434
|
}
|
|
2393
2435
|
case 'task_update': {
|
|
@@ -2400,10 +2442,14 @@ class GatewayToolExecutor {
|
|
|
2400
2442
|
if (!Number.isInteger(id) || id <= 0) {
|
|
2401
2443
|
throw new types_js_1.AgentError(`task_update requires a numeric id, got: ${String(rawId)}`, 'TOOL_ERROR', undefined, false);
|
|
2402
2444
|
}
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2445
|
+
const updated = this.taskLedger.update(id, patch, {
|
|
2446
|
+
runId: this.getExecutionState().modelRunId ?? null,
|
|
2447
|
+
// The batch this run was handed. A bounded run's changes rest on the delta it
|
|
2448
|
+
// was given, and the system knew that before the run began - so there is
|
|
2449
|
+
// nothing to ask the agent for.
|
|
2450
|
+
causeEventIds: this.getExecutionState().causeEventIds,
|
|
2451
|
+
});
|
|
2452
|
+
return { success: true, task: serializeTaskToolRecord(updated) };
|
|
2407
2453
|
}
|
|
2408
2454
|
case 'task_temporal_reconcile': {
|
|
2409
2455
|
if (!this.taskLedger) {
|
|
@@ -3806,9 +3852,11 @@ class GatewayToolExecutor {
|
|
|
3806
3852
|
return;
|
|
3807
3853
|
}
|
|
3808
3854
|
hostToolsInvoked.push(toolName);
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3855
|
+
// Board/card text is written by people outside this system and now reaches the
|
|
3856
|
+
// report lane, whose composed text is delivered to the owner verbatim by host
|
|
3857
|
+
// code with no intervening model. Deriving this from the connector map keeps a
|
|
3858
|
+
// newly registered reader from arriving unfenced.
|
|
3859
|
+
if ((0, untrusted_content_js_1.isUntrustedExternalEvidenceTool)(toolName)) {
|
|
3812
3860
|
usedUntrustedExternalEvidence = true;
|
|
3813
3861
|
}
|
|
3814
3862
|
};
|
|
@@ -3937,6 +3985,104 @@ class GatewayToolExecutor {
|
|
|
3937
3985
|
};
|
|
3938
3986
|
}
|
|
3939
3987
|
}
|
|
3988
|
+
/**
|
|
3989
|
+
* Answer what a stored claim rests on.
|
|
3990
|
+
*
|
|
3991
|
+
* The counterpart to recall, and the reason recall now returns an id at all: an agent
|
|
3992
|
+
* that can only read memories can assert them, while an agent that can resolve them can
|
|
3993
|
+
* say which ones a statement stands on - or that a statement stands on nothing. That
|
|
3994
|
+
* second answer is the one the original bad report could not produce.
|
|
3995
|
+
*
|
|
3996
|
+
* Scope is re-derived here rather than trusted from the caller, and the connector grant
|
|
3997
|
+
* is read off the active envelope, so this path can never show an event that the normal
|
|
3998
|
+
* raw read would refuse.
|
|
3999
|
+
*/
|
|
4000
|
+
async handleMamaProvenance(input) {
|
|
4001
|
+
const memoryId = typeof input.memory_id === 'string' ? input.memory_id.trim() : '';
|
|
4002
|
+
if (memoryId.length === 0) {
|
|
4003
|
+
return {
|
|
4004
|
+
success: false,
|
|
4005
|
+
error: 'memory_id is required',
|
|
4006
|
+
};
|
|
4007
|
+
}
|
|
4008
|
+
// Tier 3 is denied context_compile, its sanctioned path to raw connector data. A
|
|
4009
|
+
// per-citation event reader would reopen exactly that, one event at a time, so the
|
|
4010
|
+
// same denial applies here - fail closed on a Tier-3 designation from either source.
|
|
4011
|
+
const tierContext = this.getExecutionState();
|
|
4012
|
+
if (tierContext.agentContext?.tier === 3 || tierContext.envelope?.tier === 3) {
|
|
4013
|
+
return {
|
|
4014
|
+
success: false,
|
|
4015
|
+
code: 'permission_denied_tier3',
|
|
4016
|
+
error: 'mama_provenance is not allowed for Tier 3 agents.',
|
|
4017
|
+
};
|
|
4018
|
+
}
|
|
4019
|
+
const scopeResolution = this.resolveMamaRecallScopes(input, 'mama_provenance');
|
|
4020
|
+
if (scopeResolution.denial) {
|
|
4021
|
+
return scopeResolution.denial;
|
|
4022
|
+
}
|
|
4023
|
+
if (scopeResolution.scopes.length === 0) {
|
|
4024
|
+
return {
|
|
4025
|
+
success: false,
|
|
4026
|
+
error: 'mama_provenance requires scopes (provide via input or active agent context)',
|
|
4027
|
+
};
|
|
4028
|
+
}
|
|
4029
|
+
const ctx = this.getExecutionState();
|
|
4030
|
+
// No envelope means no connector grant, and no grant means NO raw events - never all
|
|
4031
|
+
// of them. The raw reader fails closed on exactly this input and so does this call.
|
|
4032
|
+
const connectors = ctx.envelope?.scope.raw_connectors ?? [];
|
|
4033
|
+
// Derived exactly the way the compile path derives them, through the same functions.
|
|
4034
|
+
// Taking `project_refs` off the envelope directly and skipping tenant entirely is what
|
|
4035
|
+
// made an earlier version wider than the reader: the reader always resolves a tenant
|
|
4036
|
+
// ('default' today), and an absent tenant on this side skipped the filter rather than
|
|
4037
|
+
// narrowing it - so tenant-null and cross-tenant rows resolved that reading refuses.
|
|
4038
|
+
const projectIds = ctx.envelope
|
|
4039
|
+
? (0, worker_envelope_js_1.deriveEffectiveProjectRefs)(ctx.envelope).map((project) => project.id)
|
|
4040
|
+
: [];
|
|
4041
|
+
// deriveEffectiveTenantId() is a constant today and is load-bearing: the reader
|
|
4042
|
+
// resolves the same value on every call, so passing anything else - or nothing -
|
|
4043
|
+
// makes citation and reading disagree.
|
|
4044
|
+
const tenantId = (0, worker_envelope_js_1.deriveEffectiveTenantId)();
|
|
4045
|
+
// Declared on the envelope and assigned nowhere yet. Threaded so the clamp holds for
|
|
4046
|
+
// citation on the day it is, rather than becoming the next uncovered filter.
|
|
4047
|
+
const asOfMs = ctx.envelope?.scope.as_of ? Date.parse(ctx.envelope.scope.as_of) : NaN;
|
|
4048
|
+
const maxObservedMs = Number.isNaN(asOfMs) ? null : asOfMs;
|
|
4049
|
+
try {
|
|
4050
|
+
// The SAME grant the compile path reads under, derived by the same function. This is
|
|
4051
|
+
// what makes citation and reading answer the same question: while these were separate
|
|
4052
|
+
// rules, this tool refused excerpts for the very events context_compile was citing.
|
|
4053
|
+
// Narrowed by the ENVELOPE's scopes, never by the caller's requested subset.
|
|
4054
|
+
// scopeResolution.scopes is any subset the caller asked for that the envelope allows,
|
|
4055
|
+
// so narrowing by it let a caller widen its own grant by simply omitting the channel
|
|
4056
|
+
// scope: ask with global:system alone and the channel narrowing disappears, handing
|
|
4057
|
+
// back excerpts from every other channel of the connector. Citation would then be
|
|
4058
|
+
// strictly wider than reading, which is the one thing this path must never be.
|
|
4059
|
+
const citationChannels = ctx.envelope
|
|
4060
|
+
? (0, read_js_1.narrowGrantToEnvelope)((0, read_js_1.liveBoundaryChannels)(), {
|
|
4061
|
+
connectors,
|
|
4062
|
+
scopes: ctx.envelope.scope.memory_scopes ?? [],
|
|
4063
|
+
})
|
|
4064
|
+
: undefined;
|
|
4065
|
+
const resolution = await (0, provenance_live_js_1.resolveMemoryProvenanceLive)(memoryId, {
|
|
4066
|
+
scopes: scopeResolution.scopes,
|
|
4067
|
+
connectors,
|
|
4068
|
+
...(citationChannels ? { channels: citationChannels } : {}),
|
|
4069
|
+
projectIds,
|
|
4070
|
+
tenantId,
|
|
4071
|
+
maxObservedMs,
|
|
4072
|
+
// The same scrubbing recall applies to memory text. Without it this surface would
|
|
4073
|
+
// emit connector content that its sibling redacts, which is only invisible today
|
|
4074
|
+
// because no event excerpt has ever been produced.
|
|
4075
|
+
redact: (text) => sanitizeRecallText(text) ?? '',
|
|
4076
|
+
});
|
|
4077
|
+
return { success: true, data: resolution };
|
|
4078
|
+
}
|
|
4079
|
+
catch (error) {
|
|
4080
|
+
return {
|
|
4081
|
+
success: false,
|
|
4082
|
+
error: `Failed to resolve provenance: ${error instanceof Error ? error.message : String(error)}`,
|
|
4083
|
+
};
|
|
4084
|
+
}
|
|
4085
|
+
}
|
|
3940
4086
|
async handleMamaRecall(input) {
|
|
3941
4087
|
const api = await this.initializeMAMAApi();
|
|
3942
4088
|
if (!api.recallMemory || typeof input.query !== 'string' || input.query.length === 0) {
|