@jungjaehoon/mama-os 0.28.5 → 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 +44 -12
- 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/agent-loop-init.d.ts.map +1 -1
- package/dist/cli/runtime/agent-loop-init.js +9 -1
- package/dist/cli/runtime/agent-loop-init.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 +35 -0
- package/dist/operator/report-run.d.ts.map +1 -1
- package/dist/operator/report-run.js +184 -24
- package/dist/operator/report-run.js.map +1 -1
- package/dist/operator/situation-report.d.ts.map +1 -1
- package/dist/operator/situation-report.js +9 -2
- package/dist/operator/situation-report.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
|
@@ -45,12 +45,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
45
45
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.OPERATOR_REPORT_TOOL_POLICY = exports.WORKORDER_TOOL_POLICIES = void 0;
|
|
48
49
|
exports.requireRuntimeBackend = requireRuntimeBackend;
|
|
49
50
|
exports.serializeCodeActExecutionResult = serializeCodeActExecutionResult;
|
|
50
51
|
exports.deriveCodeActToolPolicy = deriveCodeActToolPolicy;
|
|
51
52
|
exports.resolveCodeActAgentPolicy = resolveCodeActAgentPolicy;
|
|
52
53
|
exports.resolveCodeActRawConnectors = resolveCodeActRawConnectors;
|
|
53
54
|
exports.scopeDaemonRawConnectors = scopeDaemonRawConnectors;
|
|
55
|
+
exports.buildFullReportGatherLines = buildFullReportGatherLines;
|
|
56
|
+
exports.causeEventIdsFromPayload = causeEventIdsFromPayload;
|
|
57
|
+
exports.workOrderEnvelopeScope = workOrderEnvelopeScope;
|
|
58
|
+
exports.temporalTaskBinding = temporalTaskBinding;
|
|
54
59
|
exports.resolveCodeActMemoryScopes = resolveCodeActMemoryScopes;
|
|
55
60
|
exports.buildOperatorReportAgentPolicy = buildOperatorReportAgentPolicy;
|
|
56
61
|
exports.buildWorkOrderAgentPolicy = buildWorkOrderAgentPolicy;
|
|
@@ -66,6 +71,7 @@ const stop_js_1 = require("./stop.js");
|
|
|
66
71
|
const index_js_1 = require("../../auth/index.js");
|
|
67
72
|
const gateway_tool_executor_js_1 = require("../../agent/gateway-tool-executor.js");
|
|
68
73
|
const context_compile_service_js_1 = require("../../agent/context-compile-service.js");
|
|
74
|
+
const read_js_1 = require("../../evidence/read.js");
|
|
69
75
|
const tool_registry_js_1 = require("../../agent/tool-registry.js");
|
|
70
76
|
const tool_policy_js_1 = require("../../agent/code-act/tool-policy.js");
|
|
71
77
|
const index_js_2 = require("../../gateways/index.js");
|
|
@@ -235,13 +241,21 @@ function resolveCodeActRawConnectors(enabledConnectorNames) {
|
|
|
235
241
|
return [...new Set((enabledConnectorNames ?? []).map((name) => name.trim()).filter(Boolean))];
|
|
236
242
|
}
|
|
237
243
|
/**
|
|
238
|
-
* Trello contains owner-scoped project evidence. Among daemon-internal runs,
|
|
239
|
-
*
|
|
240
|
-
* chat receives its separate route-scoped envelope in envelope-bootstrap.
|
|
244
|
+
* Trello contains owner-scoped project evidence. Among daemon-internal runs, only host-issued
|
|
245
|
+
* board and temporal workorders and the scheduled operator report may read it. Verified
|
|
246
|
+
* owner-console chat receives its separate route-scoped envelope in envelope-bootstrap.
|
|
247
|
+
*
|
|
248
|
+
* The report is admitted because it must cross-check the native ledger against the live board
|
|
249
|
+
* before asserting item state; its envelope still grants NO destinations, so this widens what
|
|
250
|
+
* the report may READ, never what it may send. Read authority is enforced per tool through
|
|
251
|
+
* envelope/tool-connector-scope.ts - the api-code-act principal below stays filtered and its
|
|
252
|
+
* direct board reads are now denied rather than silently permitted by role membership.
|
|
241
253
|
*/
|
|
242
254
|
function scopeDaemonRawConnectors(enabledConnectorNames, principal) {
|
|
243
255
|
const connectors = resolveCodeActRawConnectors(enabledConnectorNames);
|
|
244
|
-
if (principal === 'workorder-board' ||
|
|
256
|
+
if (principal === 'workorder-board' ||
|
|
257
|
+
principal === 'workorder-temporal' ||
|
|
258
|
+
principal === 'operator-report') {
|
|
245
259
|
return connectors;
|
|
246
260
|
}
|
|
247
261
|
return connectors.filter((connector) => connector !== 'trello');
|
|
@@ -268,6 +282,108 @@ function uniqueMemoryScopes(scopes) {
|
|
|
268
282
|
}
|
|
269
283
|
return unique;
|
|
270
284
|
}
|
|
285
|
+
/**
|
|
286
|
+
* The connector and channel a temporal task is bound to, as plain values.
|
|
287
|
+
*
|
|
288
|
+
* The workorder payload carries only HASHED source identifiers (they are compared, never
|
|
289
|
+
* read), so the binding has to come from the owner task row. Split on the FIRST colon:
|
|
290
|
+
* `source_channel` is `<connector>:<channelId>` and channel ids contain colons of their own.
|
|
291
|
+
*
|
|
292
|
+
* Returns null when the task names no channel - which is not a failure, it is a task whose
|
|
293
|
+
* reconcile may rest on no raw evidence at all.
|
|
294
|
+
*/
|
|
295
|
+
/**
|
|
296
|
+
* The scope a workorder envelope carries.
|
|
297
|
+
*
|
|
298
|
+
* Extracted so the binding can be asserted directly. Composed inline, the only way to test
|
|
299
|
+
* it was to re-compose it in the test - which tests the copy, and a copy of a scope
|
|
300
|
+
* construction is how this subsystem's authority drifts from what it claims.
|
|
301
|
+
*/
|
|
302
|
+
/**
|
|
303
|
+
* What the scheduled full report is INSTRUCTED to gather with.
|
|
304
|
+
*
|
|
305
|
+
* Exported so a test can hold it against the lane's tool grant. Every defect this session
|
|
306
|
+
* found was a wiring defect - a tool granted and never instructed, a lane wired zero times,
|
|
307
|
+
* a binder that never bound - and all of them live in this file and its neighbour, the two
|
|
308
|
+
* directories the suite covers at a third. An instruction list that cannot be read by a
|
|
309
|
+
* test is one nobody can check against the grant it depends on.
|
|
310
|
+
*/
|
|
311
|
+
function buildFullReportGatherLines({ lastSuccessIso, }) {
|
|
312
|
+
return [
|
|
313
|
+
'kagemusha_overview() for room/task/message counts',
|
|
314
|
+
'kagemusha_tasks({}) for the open task board, plus kagemusha_tasks({ status: "review" }) for items awaiting review (status values must be real board statuses like pending/in_progress/review - invented labels match nothing)',
|
|
315
|
+
lastSuccessIso
|
|
316
|
+
? `kagemusha_entities({ activeOnly: true }) for active channels, then kagemusha_messages({ channelId, since: "${lastSuccessIso}" }) on the busiest 2-3 - since is the last successful report; do NOT widen it`
|
|
317
|
+
: 'kagemusha_entities({ activeOnly: true }) for active channels, then kagemusha_messages({ channelId }) on the busiest 2-3 (since defaults to the last 7 days; pass an ISO-8601 timestamp like since: "2026-07-09T00:00:00Z" to narrow it - never a phrase like "24h ago")',
|
|
318
|
+
'mama_recall(query) for memory relevant to what you find',
|
|
319
|
+
'schedule_upcoming({ days: 14 }) for upcoming calendar events -- cross-check task deadlines against them',
|
|
320
|
+
lastSuccessIso
|
|
321
|
+
? `changes_read({ since: "${lastSuccessIso}" }) for what THIS system durably changed since the last report -- lead with it, and say what each change rested on`
|
|
322
|
+
: 'changes_read({ since: "7d" }) for what THIS system durably changed in the window -- lead with it, and say what each change rested on',
|
|
323
|
+
'On changes_read: cause_state "unattributed" means the system cannot explain that change, NOT that nothing happened -- report the coverage counts as they are rather than rounding them up. It is ONE PAGE: if returned is less than total, say so instead of describing the page as the whole. It covers work items only today, so the absence of report or memory changes there is not evidence they did not happen.',
|
|
324
|
+
];
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* The batch a work order carries, as the run's cause.
|
|
328
|
+
*
|
|
329
|
+
* Exported because it was an inline closure and therefore untestable, while being the ONE
|
|
330
|
+
* hop that carries this branch's whole claim: the system knew the batch before the run
|
|
331
|
+
* began, so the agent never has to restate it. Review pointed out that `causeEventIds`
|
|
332
|
+
* appeared in exactly two test files and both called the ledger directly - a rename or a
|
|
333
|
+
* payload-shape drift here would have returned attribution to 32% with the suite green.
|
|
334
|
+
*
|
|
335
|
+
* Only per-channel reconcile work orders carry `eventIds`; `board:full`, wiki and
|
|
336
|
+
* memory-curation do not, and get an empty batch rather than an invented one.
|
|
337
|
+
*/
|
|
338
|
+
function causeEventIdsFromPayload(payload) {
|
|
339
|
+
if (payload === null || typeof payload !== 'object')
|
|
340
|
+
return [];
|
|
341
|
+
const batch = payload.eventIds;
|
|
342
|
+
if (!Array.isArray(batch))
|
|
343
|
+
return [];
|
|
344
|
+
return batch.filter((id) => typeof id === 'string' && id.trim().length > 0);
|
|
345
|
+
}
|
|
346
|
+
function workOrderEnvelopeScope(input) {
|
|
347
|
+
const isTemporal = input.workKind === 'temporal';
|
|
348
|
+
return {
|
|
349
|
+
project_refs: [{ kind: 'project', id: input.projectId }],
|
|
350
|
+
// A temporal run reads its task's connector or nothing. Every other lane keeps the
|
|
351
|
+
// connectors it was configured with.
|
|
352
|
+
raw_connectors: isTemporal
|
|
353
|
+
? input.temporalBinding
|
|
354
|
+
? [input.temporalBinding.connector]
|
|
355
|
+
: []
|
|
356
|
+
: input.laneConnectors,
|
|
357
|
+
memory_scopes: [
|
|
358
|
+
...(0, scope_context_js_1.deriveMemoryScopes)({
|
|
359
|
+
source: 'operator',
|
|
360
|
+
channelId: `worker:${input.workKind}`,
|
|
361
|
+
projectId: input.projectId,
|
|
362
|
+
}),
|
|
363
|
+
...(input.temporalBinding
|
|
364
|
+
? [
|
|
365
|
+
{
|
|
366
|
+
kind: 'channel',
|
|
367
|
+
id: `${input.temporalBinding.connector}:${input.temporalBinding.channel}`,
|
|
368
|
+
},
|
|
369
|
+
]
|
|
370
|
+
: []),
|
|
371
|
+
],
|
|
372
|
+
allowed_destinations: [],
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
function temporalTaskBinding(ledger, taskId) {
|
|
376
|
+
const sourceChannel = ledger.getById(taskId)?.sourceChannel;
|
|
377
|
+
if (typeof sourceChannel !== 'string')
|
|
378
|
+
return null;
|
|
379
|
+
const separator = sourceChannel.indexOf(':');
|
|
380
|
+
if (separator <= 0 || separator === sourceChannel.length - 1)
|
|
381
|
+
return null;
|
|
382
|
+
return {
|
|
383
|
+
connector: sourceChannel.slice(0, separator),
|
|
384
|
+
channel: sourceChannel.slice(separator + 1),
|
|
385
|
+
};
|
|
386
|
+
}
|
|
271
387
|
function resolveCodeActMemoryScopes(baseScopes, adapter) {
|
|
272
388
|
const scopes = [...baseScopes];
|
|
273
389
|
if (!adapter) {
|
|
@@ -313,11 +429,12 @@ function buildCodeActRole(policy) {
|
|
|
313
429
|
// Stage-2 workers are short-lived operator jobs, not standing multi-agent
|
|
314
430
|
// personas. Their permissions must therefore be complete on a default install
|
|
315
431
|
// and must not vary with optional legacy agent configuration.
|
|
316
|
-
|
|
432
|
+
exports.WORKORDER_TOOL_POLICIES = {
|
|
317
433
|
board: {
|
|
318
434
|
roleName: 'workorder-board',
|
|
319
435
|
allowedTools: [
|
|
320
436
|
'agent_notices',
|
|
437
|
+
'changes_read',
|
|
321
438
|
'context_compile',
|
|
322
439
|
'contract_no_update',
|
|
323
440
|
'kagemusha_entities',
|
|
@@ -372,23 +489,41 @@ const WORKORDER_TOOL_POLICIES = {
|
|
|
372
489
|
* decides whether a full report has task-board substance), the fullReportSelfGather lines,
|
|
373
490
|
* the board_publish lines, and the single mama_save the report may make.
|
|
374
491
|
*
|
|
375
|
-
* Its envelope grants no destinations
|
|
376
|
-
*
|
|
492
|
+
* Its envelope grants no destinations, so no send tool belongs here, and no task-mutation
|
|
493
|
+
* tool either: the report observes, the board workorder maintains.
|
|
494
|
+
*
|
|
495
|
+
* trello_kanban is the ONE whole-board live read. Without it the report could only restate the
|
|
496
|
+
* native ledger, which is a derived store the board workorder is forbidden to sync from Trello -
|
|
497
|
+
* so a card that moved days ago still reported as "no completion signal" (live 2026-07-28).
|
|
498
|
+
* Reading it is scoped by the envelope now that direct connector readers are mapped in
|
|
499
|
+
* envelope/tool-connector-scope.ts; without that mapping this entry alone would have granted
|
|
500
|
+
* unscoped access.
|
|
377
501
|
*/
|
|
378
|
-
|
|
502
|
+
exports.OPERATOR_REPORT_TOOL_POLICY = {
|
|
379
503
|
roleName: 'operator-report',
|
|
380
504
|
allowedTools: [
|
|
381
|
-
|
|
505
|
+
// context_compile is deliberately ABSENT. Envelope scope is connector-level, so
|
|
506
|
+
// granting the board connector for trello_kanban would otherwise also permit
|
|
507
|
+
// context_compile({connectors:['trello']}) - raw card bodies pulled into a tier-2
|
|
508
|
+
// lane that can write durable memory. The report needs the whole-board read, not
|
|
509
|
+
// raw compilation, and its gather instructions never ask for it.
|
|
510
|
+
// What the report is FOR: what moved since last time. Until now the only way to
|
|
511
|
+
// answer that was to re-read current state and infer the delta, which is how a
|
|
512
|
+
// report ends up restating the board instead of naming the change.
|
|
513
|
+
'changes_read',
|
|
382
514
|
'kagemusha_entities',
|
|
383
515
|
'kagemusha_messages',
|
|
384
516
|
'kagemusha_overview',
|
|
385
517
|
'kagemusha_tasks',
|
|
518
|
+
'mama_provenance',
|
|
386
519
|
'mama_recall',
|
|
387
520
|
'mama_save',
|
|
388
521
|
'mama_search',
|
|
389
522
|
'report_publish',
|
|
390
523
|
'schedule_upcoming',
|
|
524
|
+
'task_external_correlation',
|
|
391
525
|
'task_list',
|
|
526
|
+
'trello_kanban',
|
|
392
527
|
],
|
|
393
528
|
};
|
|
394
529
|
/**
|
|
@@ -402,12 +537,12 @@ const OPERATOR_REPORT_TOOL_POLICY = {
|
|
|
402
537
|
*/
|
|
403
538
|
function buildOperatorReportAgentPolicy(model, backend) {
|
|
404
539
|
const blockedTools = [];
|
|
405
|
-
const innerTools = uniqueToolList(OPERATOR_REPORT_TOOL_POLICY.allowedTools);
|
|
540
|
+
const innerTools = uniqueToolList(exports.OPERATOR_REPORT_TOOL_POLICY.allowedTools);
|
|
406
541
|
const allowedTools = uniqueToolList(['code_act', ...innerTools]);
|
|
407
542
|
const agentContext = {
|
|
408
543
|
source: 'operator',
|
|
409
544
|
platform: 'cli',
|
|
410
|
-
roleName: OPERATOR_REPORT_TOOL_POLICY.roleName,
|
|
545
|
+
roleName: exports.OPERATOR_REPORT_TOOL_POLICY.roleName,
|
|
411
546
|
role: {
|
|
412
547
|
allowedTools,
|
|
413
548
|
blockedTools,
|
|
@@ -431,7 +566,7 @@ function buildOperatorReportAgentPolicy(model, backend) {
|
|
|
431
566
|
return { agentContext, gatewayToolsPrompt: tool_registry_js_1.ToolRegistry.generatePrompt(innerTools) };
|
|
432
567
|
}
|
|
433
568
|
function buildWorkOrderAgentPolicy(kind, model, backend) {
|
|
434
|
-
const policy = WORKORDER_TOOL_POLICIES[kind];
|
|
569
|
+
const policy = exports.WORKORDER_TOOL_POLICIES[kind];
|
|
435
570
|
if (!policy) {
|
|
436
571
|
throw new Error(`Missing built-in workorder tool policy for '${kind}'`);
|
|
437
572
|
}
|
|
@@ -733,6 +868,10 @@ async function runAgentLoop(config, options = {}) {
|
|
|
733
868
|
const { getAdapter } = require('@jungjaehoon/mama-core/db-manager');
|
|
734
869
|
const contextCompileService = (0, context_compile_service_js_1.createContextCompileService)({
|
|
735
870
|
memoryAdapter: getAdapter(),
|
|
871
|
+
// Raw visibility comes from the owner's connector config, not from the derived scope
|
|
872
|
+
// columns. Without this the compile reads nothing: measured on the live index, the
|
|
873
|
+
// scope-based predicate returns 0 of 30,671 events for the input shape sent here.
|
|
874
|
+
channelGrant: read_js_1.liveBoundaryChannels,
|
|
736
875
|
});
|
|
737
876
|
toolExecutor.setContextCompileService(contextCompileService);
|
|
738
877
|
agentLoop.setContextCompileService(contextCompileService);
|
|
@@ -1018,28 +1157,11 @@ async function runAgentLoop(config, options = {}) {
|
|
|
1018
1157
|
toolExecutor.setRestartMultiAgentAgent(graphHandlerOptions.restartMultiAgentAgent);
|
|
1019
1158
|
agentLoop.setApplyMultiAgentConfig(graphHandlerOptions.applyMultiAgentConfig);
|
|
1020
1159
|
agentLoop.setRestartMultiAgentAgent(graphHandlerOptions.restartMultiAgentAgent);
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
}));
|
|
1027
|
-
const dm = new DelegationManager(agentConfigs);
|
|
1028
|
-
dm.setSessionsDb(db);
|
|
1029
|
-
toolExecutor.setDelegationManager(dm);
|
|
1030
|
-
agentLoop.setDelegationManager(dm);
|
|
1031
|
-
graphHandlerOptions.applyMultiAgentConfig = async (rawConfig) => {
|
|
1032
|
-
const nextConfig = rawConfig;
|
|
1033
|
-
pm.updateConfig(nextConfig);
|
|
1034
|
-
dm.updateAgents(Object.entries(nextConfig.agents || {}).map(([id, cfg]) => ({ id, ...cfg })));
|
|
1035
|
-
};
|
|
1036
|
-
toolExecutor.setApplyMultiAgentConfig(graphHandlerOptions.applyMultiAgentConfig);
|
|
1037
|
-
agentLoop.setApplyMultiAgentConfig(graphHandlerOptions.applyMultiAgentConfig);
|
|
1038
|
-
console.log('[start] ✓ Delegate tool wired (standalone — no Discord/Slack handler)');
|
|
1039
|
-
}
|
|
1040
|
-
else {
|
|
1041
|
-
console.log('[start] ✓ System agent process manager wired');
|
|
1042
|
-
}
|
|
1160
|
+
// The delegate wiring was here. Over the full log history it was wired ZERO times and
|
|
1161
|
+
// its only runtime trace was one call refused by role permission. The process manager
|
|
1162
|
+
// above stays: that one IS wired on every boot (113 so far) and runs the dashboard and
|
|
1163
|
+
// wiki agents.
|
|
1164
|
+
console.log('[start] ✓ System agent process manager wired');
|
|
1043
1165
|
}
|
|
1044
1166
|
// ── Phase 9: Heartbeat + Connectors ──────────────────────────────────────
|
|
1045
1167
|
const { heartbeatScheduler, tokenKeepAlive, healthWarningInterval } = (0, scheduler_init_js_1.initHeartbeat)(config, agentLoop, discordGateway, scheduler, healthCheckService);
|
|
@@ -1148,8 +1270,32 @@ async function runAgentLoop(config, options = {}) {
|
|
|
1148
1270
|
systemPrompt: buildWorkerSystemPrompt(workOrderPolicy.gatewayToolsPrompt, runtimeBackend, wo.workKind),
|
|
1149
1271
|
agentContext: workOrderPolicy.agentContext,
|
|
1150
1272
|
}, wo.id);
|
|
1273
|
+
// A temporal run is bound to ONE task on ONE channel, and the packet check
|
|
1274
|
+
// (temporalPacketRawSourcesWithinBoundSource) enforces exactly that: every raw ref
|
|
1275
|
+
// must match the task's connector:channel or the reconcile is refused.
|
|
1276
|
+
//
|
|
1277
|
+
// While raw reads returned nothing that check was vacuous. Once the channel grant
|
|
1278
|
+
// makes them return rows it stops being vacuous, and a lane-wide envelope hands
|
|
1279
|
+
// the compile every configured channel of every granted connector - so every
|
|
1280
|
+
// raw-backed temporal run would fail a check it cannot satisfy. The envelope has
|
|
1281
|
+
// to say what the run is actually bound to.
|
|
1282
|
+
//
|
|
1283
|
+
// A task with no source channel gets no connector at all, which is the same answer
|
|
1284
|
+
// from the other direction: the check requires zero raw refs for those, so the
|
|
1285
|
+
// grant must be empty rather than merely narrow.
|
|
1286
|
+
// A reconcile carries the channel's delta batch. Handing it to the run makes every
|
|
1287
|
+
// durable change the run produces rest on it WITHOUT the agent restating anything -
|
|
1288
|
+
// the system knew the batch before the run began. This is the whole difference
|
|
1289
|
+
// between a bounded run and an unbounded one.
|
|
1290
|
+
const workOrderBatch = causeEventIdsFromPayload(wo.payload);
|
|
1291
|
+
if (workOrderBatch.length > 0) {
|
|
1292
|
+
runOptions.causeEventIds = workOrderBatch;
|
|
1293
|
+
}
|
|
1294
|
+
let temporalBinding = null;
|
|
1151
1295
|
if (wo.workKind === 'temporal') {
|
|
1152
|
-
|
|
1296
|
+
const temporalContext = (0, temporal_worker_js_1.buildTemporalWorkerContext)(taskLedger, wo);
|
|
1297
|
+
runOptions.temporalWorkContext = temporalContext;
|
|
1298
|
+
temporalBinding = temporalTaskBinding(taskLedger, temporalContext.taskId);
|
|
1153
1299
|
}
|
|
1154
1300
|
// Per-run scoped envelope (live-gate finding, 2026-07-18): gateway
|
|
1155
1301
|
// 'model_tool' executions are envelope-gated, and workerRun is a new
|
|
@@ -1168,16 +1314,18 @@ async function runAgentLoop(config, options = {}) {
|
|
|
1168
1314
|
source: 'watch',
|
|
1169
1315
|
channel_id: `worker:${wo.workKind}`,
|
|
1170
1316
|
trigger_context: { user_text: `<stage2 workorder ${wo.workKind}#${wo.id}>` },
|
|
1171
|
-
scope: {
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
memory_scopes: resolveCodeActMemoryScopes((0, scope_context_js_1.deriveMemoryScopes)({
|
|
1175
|
-
source: 'operator',
|
|
1176
|
-
channelId: `worker:${wo.workKind}`,
|
|
1317
|
+
scope: (() => {
|
|
1318
|
+
const scope = workOrderEnvelopeScope({
|
|
1319
|
+
workKind: wo.workKind,
|
|
1177
1320
|
projectId,
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1321
|
+
laneConnectors: scopeDaemonRawConnectors(codeActRawConnectors, `workorder-${wo.workKind}`),
|
|
1322
|
+
temporalBinding,
|
|
1323
|
+
});
|
|
1324
|
+
return {
|
|
1325
|
+
...scope,
|
|
1326
|
+
memory_scopes: resolveCodeActMemoryScopes(scope.memory_scopes, getAdapter()),
|
|
1327
|
+
};
|
|
1328
|
+
})(),
|
|
1181
1329
|
tier: 2,
|
|
1182
1330
|
budget: { wall_seconds: wallSeconds },
|
|
1183
1331
|
expires_at: new Date(Date.now() + wallSeconds * 1000 + 30_000).toISOString(),
|
|
@@ -1289,6 +1437,14 @@ async function runAgentLoop(config, options = {}) {
|
|
|
1289
1437
|
const { reviewTriggerCLI } = await import('../../operator/trigger-review.js');
|
|
1290
1438
|
const { ReportScheduler, FileReportScheduleStore, parseReportHours } = await import('../../operator/report-scheduler.js');
|
|
1291
1439
|
const { persistLastFullReport } = await import('../../operator/report-carry.js');
|
|
1440
|
+
// Set when a report is composed, read when that same report is delivered. Safe
|
|
1441
|
+
// because ALL operator work serializes on the operator lane (SOURCE_GLOBAL_LANES),
|
|
1442
|
+
// so compose and deliver cannot interleave with another report - stated here
|
|
1443
|
+
// because the safety comes from the lane, not from this file.
|
|
1444
|
+
let lastReportProvenance = {
|
|
1445
|
+
status: 'unavailable',
|
|
1446
|
+
reason: 'no_run_handle',
|
|
1447
|
+
};
|
|
1292
1448
|
const { createPersonaReportAsk } = await import('../../operator/report-run.js');
|
|
1293
1449
|
const { OPERATOR_FULL_REPORT_TAG } = await import('../../operator/situation-report.js');
|
|
1294
1450
|
const { buildBoardPublishLines } = await import('../../operator/board-slot-instructions.js');
|
|
@@ -1323,7 +1479,7 @@ async function runAgentLoop(config, options = {}) {
|
|
|
1323
1479
|
delta: new ConnectorDeltaRepo(getAdapter(), (0, config_manager_js_1.expandPath)('~/.mama/operator/trigger-loop-cursors.json')),
|
|
1324
1480
|
memory: createMamaMemoryPort(),
|
|
1325
1481
|
registry: triggerRegistry,
|
|
1326
|
-
onChannelDelta: (channelKey, lines) => channelDeltaSink.current?.(channelKey, lines),
|
|
1482
|
+
onChannelDelta: (channelKey, lines, eventIds) => channelDeltaSink.current?.(channelKey, lines, eventIds),
|
|
1327
1483
|
askAgent: triggerAgentRuntime.askAuthor,
|
|
1328
1484
|
// M2.2: reports go through the daemon's persona agent (system prompt, pinned model,
|
|
1329
1485
|
// session lanes) instead of the bare CLI - report tone comes from generation inputs.
|
|
@@ -1358,11 +1514,11 @@ async function runAgentLoop(config, options = {}) {
|
|
|
1358
1514
|
channel_id: 'report',
|
|
1359
1515
|
trigger_context: { user_text: '<operator scheduled report>' },
|
|
1360
1516
|
scope: {
|
|
1361
|
-
// Reads: enabled
|
|
1362
|
-
//
|
|
1363
|
-
//
|
|
1364
|
-
//
|
|
1365
|
-
//
|
|
1517
|
+
// Reads: enabled raw connectors (kagemusha_* gathers plus the live board
|
|
1518
|
+
// cross-check) + memory scopes covering mama_recall/mama_save.
|
|
1519
|
+
// allowed_destinations stays [] - NO send surface. That bounds SENDS only;
|
|
1520
|
+
// read authority is bounded per tool by envelope/tool-connector-scope.ts
|
|
1521
|
+
// against the connectors granted here.
|
|
1366
1522
|
project_refs: [{ kind: 'project', id: projectId }],
|
|
1367
1523
|
raw_connectors: scopeDaemonRawConnectors(codeActRawConnectors, 'operator-report'),
|
|
1368
1524
|
memory_scopes: resolveCodeActMemoryScopes((0, scope_context_js_1.deriveMemoryScopes)({ source: 'operator', channelId: 'report', projectId }), getAdapter()),
|
|
@@ -1393,10 +1549,23 @@ async function runAgentLoop(config, options = {}) {
|
|
|
1393
1549
|
freshSession: true,
|
|
1394
1550
|
...(envelope ? { envelope } : {}),
|
|
1395
1551
|
});
|
|
1396
|
-
return {
|
|
1552
|
+
return {
|
|
1553
|
+
response: result.response,
|
|
1554
|
+
history: result.history,
|
|
1555
|
+
// Dropped here until now: the loop already resolves a run handle, and
|
|
1556
|
+
// discarding it meant a delivered report could not be traced to the run
|
|
1557
|
+
// that wrote it.
|
|
1558
|
+
modelRunId: result.modelRunId,
|
|
1559
|
+
...(result.modelRunProvenance === undefined
|
|
1560
|
+
? {}
|
|
1561
|
+
: { modelRunProvenance: result.modelRunProvenance }),
|
|
1562
|
+
};
|
|
1397
1563
|
},
|
|
1398
1564
|
log: (line) => console.log(line),
|
|
1399
1565
|
fullReportTag: OPERATOR_FULL_REPORT_TAG,
|
|
1566
|
+
onRunProvenance: (provenance) => {
|
|
1567
|
+
lastReportProvenance = provenance;
|
|
1568
|
+
},
|
|
1400
1569
|
}),
|
|
1401
1570
|
review: (trigger, context) => reviewTriggerCLI(trigger, context, triggerAgentRuntime.askReview),
|
|
1402
1571
|
output: reportOutput,
|
|
@@ -1404,21 +1573,13 @@ async function runAgentLoop(config, options = {}) {
|
|
|
1404
1573
|
// M2.3: the scheduled full report self-gathers via the persona agent's gateway tools
|
|
1405
1574
|
// (the Kagemusha lesson: a reporter with tools has substance; a window summary alone
|
|
1406
1575
|
// reports "quiet" whenever polling is between batches).
|
|
1407
|
-
fullReportSelfGather:
|
|
1408
|
-
'kagemusha_overview() for room/task/message counts',
|
|
1409
|
-
'kagemusha_tasks({}) for the open task board, plus kagemusha_tasks({ status: "review" }) for items awaiting review (status values must be real board statuses like pending/in_progress/review - invented labels match nothing)',
|
|
1410
|
-
lastSuccessIso
|
|
1411
|
-
? `kagemusha_entities({ activeOnly: true }) for active channels, then kagemusha_messages({ channelId, since: "${lastSuccessIso}" }) on the busiest 2-3 - since is the last successful report; do NOT widen it`
|
|
1412
|
-
: 'kagemusha_entities({ activeOnly: true }) for active channels, then kagemusha_messages({ channelId }) on the busiest 2-3 (since defaults to the last 7 days; pass an ISO-8601 timestamp like since: "2026-07-09T00:00:00Z" to narrow it - never a phrase like "24h ago")',
|
|
1413
|
-
'mama_recall(query) for memory relevant to what you find',
|
|
1414
|
-
'schedule_upcoming({ days: 14 }) for upcoming calendar events -- cross-check task deadlines against them',
|
|
1415
|
-
],
|
|
1576
|
+
fullReportSelfGather: buildFullReportGatherLines,
|
|
1416
1577
|
// Kagemusha dual output: the same scheduled run updates the /ui operator board
|
|
1417
1578
|
// slots via report_publish, then writes the plain-text owner report.
|
|
1418
1579
|
fullReportBoardLines: buildBoardPublishLines(),
|
|
1419
1580
|
// S1-T4 context carry: the delivered FULL report persists so the owner
|
|
1420
1581
|
// console references it per turn instead of fabricating status.
|
|
1421
|
-
persistLastFullReport: (iso, text) => persistLastFullReport(iso, text),
|
|
1582
|
+
persistLastFullReport: (iso, text) => persistLastFullReport(iso, text, lastReportProvenance),
|
|
1422
1583
|
pendingReportStore: new FilePendingReportStore((0, config_manager_js_1.expandPath)('~/.mama/operator/pending-owner-reports.json'), (line) => console.error(line)),
|
|
1423
1584
|
config: {
|
|
1424
1585
|
tickMs: Number(process.env.MAMA_TRIGGER_LOOP_TICK_MS || 60_000),
|
|
@@ -1474,7 +1635,7 @@ async function runAgentLoop(config, options = {}) {
|
|
|
1474
1635
|
envelopeAuthority: envelopeBootstrap.envelopeAuthority,
|
|
1475
1636
|
contextCompileService,
|
|
1476
1637
|
});
|
|
1477
|
-
channelDeltaSink.current = (channelKey, lines) => eventBus.emit({ type: 'operator:channel-delta', channelKey, lines });
|
|
1638
|
+
channelDeltaSink.current = (channelKey, lines, eventIds) => eventBus.emit({ type: 'operator:channel-delta', channelKey, lines, eventIds });
|
|
1478
1639
|
await (0, api_routes_init_js_1.registerApiRoutes)({
|
|
1479
1640
|
config,
|
|
1480
1641
|
apiServer,
|