@jungjaehoon/mama-os 0.53.0 → 0.57.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/CHANGELOG.md +64 -0
- package/README.md +62 -259
- package/db/migrations/001-connector-event-index.sql +251 -0
- package/dist/agent/claude-native-tool-policy.d.ts +17 -0
- package/dist/agent/claude-native-tool-policy.d.ts.map +1 -0
- package/dist/agent/claude-native-tool-policy.js +88 -0
- package/dist/agent/claude-native-tool-policy.js.map +1 -0
- package/dist/api/attachment-actions.d.ts +16 -0
- package/dist/api/attachment-actions.d.ts.map +1 -0
- package/dist/api/attachment-actions.js +278 -0
- package/dist/api/attachment-actions.js.map +1 -0
- package/dist/api/auth-middleware.d.ts +15 -55
- package/dist/api/auth-middleware.d.ts.map +1 -1
- package/dist/api/auth-middleware.js +56 -233
- package/dist/api/auth-middleware.js.map +1 -1
- package/dist/api/cf-access.d.ts +6 -0
- package/dist/api/cf-access.d.ts.map +1 -0
- package/dist/api/cf-access.js +121 -0
- package/dist/api/cf-access.js.map +1 -0
- package/dist/api/file-delivery.d.ts +29 -0
- package/dist/api/file-delivery.d.ts.map +1 -0
- package/dist/api/file-delivery.js +90 -0
- package/dist/api/file-delivery.js.map +1 -0
- package/dist/api/owner-timezone-actions.d.ts +10 -0
- package/dist/api/owner-timezone-actions.d.ts.map +1 -0
- package/dist/api/owner-timezone-actions.js +73 -0
- package/dist/api/owner-timezone-actions.js.map +1 -0
- package/dist/api/report-actions.d.ts +22 -0
- package/dist/api/report-actions.d.ts.map +1 -0
- package/dist/api/report-actions.js +137 -0
- package/dist/api/report-actions.js.map +1 -0
- package/dist/api/report-handler.d.ts +15 -11
- package/dist/api/report-handler.d.ts.map +1 -1
- package/dist/api/report-handler.js +48 -120
- package/dist/api/report-handler.js.map +1 -1
- package/dist/api/report-persistence.d.ts +3 -3
- package/dist/api/report-persistence.d.ts.map +1 -1
- package/dist/api/report-persistence.js +35 -10
- package/dist/api/report-persistence.js.map +1 -1
- package/dist/api/report-source-actions.d.ts +11 -0
- package/dist/api/report-source-actions.d.ts.map +1 -0
- package/dist/api/report-source-actions.js +309 -0
- package/dist/api/report-source-actions.js.map +1 -0
- package/dist/api/security-events.d.ts +23 -0
- package/dist/api/security-events.d.ts.map +1 -0
- package/dist/api/security-events.js +71 -0
- package/dist/api/security-events.js.map +1 -0
- package/dist/api/source-actions.d.ts +9 -0
- package/dist/api/source-actions.d.ts.map +1 -0
- package/dist/api/source-actions.js +274 -0
- package/dist/api/source-actions.js.map +1 -0
- package/dist/api/stored-source-reader.d.ts +21 -0
- package/dist/api/stored-source-reader.d.ts.map +1 -0
- package/dist/api/stored-source-reader.js +269 -0
- package/dist/api/stored-source-reader.js.map +1 -0
- package/dist/api/viewer-data.d.ts +143 -0
- package/dist/api/viewer-data.d.ts.map +1 -0
- package/dist/api/viewer-data.js +518 -0
- package/dist/api/viewer-data.js.map +1 -0
- package/dist/api/viewer-request-security.d.ts +12 -0
- package/dist/api/viewer-request-security.d.ts.map +1 -0
- package/dist/api/viewer-request-security.js +217 -0
- package/dist/api/viewer-request-security.js.map +1 -0
- package/dist/api/viewer-server.d.ts +55 -0
- package/dist/api/viewer-server.d.ts.map +1 -0
- package/dist/api/viewer-server.js +933 -0
- package/dist/api/viewer-server.js.map +1 -0
- package/dist/api/wiki-actions.d.ts +20 -0
- package/dist/api/wiki-actions.d.ts.map +1 -0
- package/dist/api/wiki-actions.js +296 -0
- package/dist/api/wiki-actions.js.map +1 -0
- package/dist/api/work-actions.d.ts +109 -0
- package/dist/api/work-actions.d.ts.map +1 -0
- package/dist/api/work-actions.js +987 -0
- package/dist/api/work-actions.js.map +1 -0
- package/dist/cli/commands/daemon.d.ts +90 -0
- package/dist/cli/commands/daemon.d.ts.map +1 -0
- package/dist/cli/commands/daemon.js +620 -0
- package/dist/cli/commands/daemon.js.map +1 -0
- package/dist/cli/commands/init.d.ts +7 -18
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +357 -273
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/replay.d.ts +12 -0
- package/dist/cli/commands/replay.d.ts.map +1 -0
- package/dist/cli/commands/replay.js +145 -0
- package/dist/cli/commands/replay.js.map +1 -0
- package/dist/cli/commands/secret.d.ts +6 -0
- package/dist/cli/commands/secret.d.ts.map +1 -0
- package/dist/cli/commands/secret.js +24 -0
- package/dist/cli/commands/secret.js.map +1 -0
- package/dist/cli/index.d.ts +0 -5
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +52 -95
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/launch-files.d.ts +10 -0
- package/dist/cli/launch-files.d.ts.map +1 -0
- package/dist/cli/launch-files.js +74 -0
- package/dist/cli/launch-files.js.map +1 -0
- package/dist/cli/prompt.d.ts +15 -0
- package/dist/cli/prompt.d.ts.map +1 -0
- package/dist/cli/prompt.js +64 -0
- package/dist/cli/prompt.js.map +1 -0
- package/dist/cli/runtime/action-mcp-config.d.ts +15 -0
- package/dist/cli/runtime/action-mcp-config.d.ts.map +1 -0
- package/dist/cli/runtime/action-mcp-config.js +56 -0
- package/dist/cli/runtime/action-mcp-config.js.map +1 -0
- package/dist/cli/runtime/claude-caller-config.d.ts +4 -0
- package/dist/cli/runtime/claude-caller-config.d.ts.map +1 -0
- package/dist/cli/runtime/claude-caller-config.js +46 -0
- package/dist/cli/runtime/claude-caller-config.js.map +1 -0
- package/dist/cli/secrets.d.ts +9 -0
- package/dist/cli/secrets.d.ts.map +1 -0
- package/dist/cli/secrets.js +94 -0
- package/dist/cli/secrets.js.map +1 -0
- package/dist/connectors/calendar/index.d.ts +11 -10
- package/dist/connectors/calendar/index.d.ts.map +1 -1
- package/dist/connectors/calendar/index.js +171 -97
- package/dist/connectors/calendar/index.js.map +1 -1
- package/dist/connectors/chatwork/index.d.ts +31 -5
- package/dist/connectors/chatwork/index.d.ts.map +1 -1
- package/dist/connectors/chatwork/index.js +184 -20
- package/dist/connectors/chatwork/index.js.map +1 -1
- package/dist/connectors/claude-code/index.d.ts +0 -2
- package/dist/connectors/claude-code/index.d.ts.map +1 -1
- package/dist/connectors/claude-code/index.js +94 -70
- package/dist/connectors/claude-code/index.js.map +1 -1
- package/dist/connectors/config-loader.d.ts +1 -6
- package/dist/connectors/config-loader.d.ts.map +1 -1
- package/dist/connectors/config-loader.js +154 -134
- package/dist/connectors/config-loader.js.map +1 -1
- package/dist/connectors/discord/index.d.ts +8 -1
- package/dist/connectors/discord/index.d.ts.map +1 -1
- package/dist/connectors/discord/index.js +110 -32
- package/dist/connectors/discord/index.js.map +1 -1
- package/dist/connectors/drive/index.d.ts +10 -5
- package/dist/connectors/drive/index.d.ts.map +1 -1
- package/dist/connectors/drive/index.js +145 -88
- package/dist/connectors/drive/index.js.map +1 -1
- package/dist/connectors/framework/attachment-io.d.ts +5 -0
- package/dist/connectors/framework/attachment-io.d.ts.map +1 -0
- package/dist/connectors/framework/attachment-io.js +72 -0
- package/dist/connectors/framework/attachment-io.js.map +1 -0
- package/dist/connectors/framework/attachments.d.ts +32 -0
- package/dist/connectors/framework/attachments.d.ts.map +1 -0
- package/dist/connectors/framework/attachments.js +14 -0
- package/dist/connectors/framework/attachments.js.map +1 -0
- package/dist/connectors/framework/connector-event-types.d.ts +136 -0
- package/dist/connectors/framework/connector-event-types.d.ts.map +1 -0
- package/dist/connectors/framework/connector-event-types.js +3 -0
- package/dist/connectors/framework/connector-event-types.js.map +1 -0
- package/dist/connectors/framework/connector-state.d.ts +3 -0
- package/dist/connectors/framework/connector-state.d.ts.map +1 -0
- package/dist/connectors/framework/connector-state.js +47 -0
- package/dist/connectors/framework/connector-state.js.map +1 -0
- package/dist/connectors/framework/event-index.d.ts +28 -0
- package/dist/connectors/framework/event-index.d.ts.map +1 -0
- package/dist/connectors/framework/event-index.js +354 -0
- package/dist/connectors/framework/event-index.js.map +1 -0
- package/dist/connectors/framework/gws-utils.d.ts +3 -8
- package/dist/connectors/framework/gws-utils.d.ts.map +1 -1
- package/dist/connectors/framework/gws-utils.js +23 -30
- package/dist/connectors/framework/gws-utils.js.map +1 -1
- package/dist/connectors/framework/index.d.ts +4 -2
- package/dist/connectors/framework/index.d.ts.map +1 -1
- package/dist/connectors/framework/index.js +8 -6
- package/dist/connectors/framework/index.js.map +1 -1
- package/dist/connectors/framework/polling-scheduler.d.ts +71 -52
- package/dist/connectors/framework/polling-scheduler.d.ts.map +1 -1
- package/dist/connectors/framework/polling-scheduler.js +227 -168
- package/dist/connectors/framework/polling-scheduler.js.map +1 -1
- package/dist/connectors/framework/raw-query.d.ts +44 -0
- package/dist/connectors/framework/raw-query.d.ts.map +1 -0
- package/dist/connectors/framework/raw-query.js +584 -0
- package/dist/connectors/framework/raw-query.js.map +1 -0
- package/dist/connectors/framework/stored-index-read.d.ts +16 -0
- package/dist/connectors/framework/stored-index-read.d.ts.map +1 -0
- package/dist/connectors/framework/stored-index-read.js +66 -0
- package/dist/connectors/framework/stored-index-read.js.map +1 -0
- package/dist/connectors/framework/types.d.ts +17 -61
- package/dist/connectors/framework/types.d.ts.map +1 -1
- package/dist/connectors/framework/types.js +0 -4
- package/dist/connectors/framework/types.js.map +1 -1
- package/dist/connectors/gmail/index.d.ts +3 -2
- package/dist/connectors/gmail/index.d.ts.map +1 -1
- package/dist/connectors/gmail/index.js +74 -27
- package/dist/connectors/gmail/index.js.map +1 -1
- package/dist/connectors/ical/index.d.ts +29 -0
- package/dist/connectors/ical/index.d.ts.map +1 -0
- package/dist/connectors/ical/index.js +220 -0
- package/dist/connectors/ical/index.js.map +1 -0
- package/dist/connectors/ical/parser.d.ts +13 -0
- package/dist/connectors/ical/parser.d.ts.map +1 -0
- package/dist/connectors/ical/parser.js +117 -0
- package/dist/connectors/ical/parser.js.map +1 -0
- package/dist/connectors/imessage/index.d.ts +3 -1
- package/dist/connectors/imessage/index.d.ts.map +1 -1
- package/dist/connectors/imessage/index.js +31 -16
- package/dist/connectors/imessage/index.js.map +1 -1
- package/dist/connectors/index.d.ts +12 -5
- package/dist/connectors/index.d.ts.map +1 -1
- package/dist/connectors/index.js +67 -18
- package/dist/connectors/index.js.map +1 -1
- package/dist/connectors/kagemusha/index.d.ts +7 -19
- package/dist/connectors/kagemusha/index.d.ts.map +1 -1
- package/dist/connectors/kagemusha/index.js +123 -173
- package/dist/connectors/kagemusha/index.js.map +1 -1
- package/dist/connectors/notion/index.d.ts.map +1 -1
- package/dist/connectors/notion/index.js +79 -36
- package/dist/connectors/notion/index.js.map +1 -1
- package/dist/connectors/obsidian/index.d.ts +1 -1
- package/dist/connectors/obsidian/index.d.ts.map +1 -1
- package/dist/connectors/obsidian/index.js +59 -57
- package/dist/connectors/obsidian/index.js.map +1 -1
- package/dist/connectors/sheets/index.d.ts +8 -4
- package/dist/connectors/sheets/index.d.ts.map +1 -1
- package/dist/connectors/sheets/index.js +155 -143
- package/dist/connectors/sheets/index.js.map +1 -1
- package/dist/connectors/slack/index.d.ts +24 -5
- package/dist/connectors/slack/index.d.ts.map +1 -1
- package/dist/connectors/slack/index.js +177 -39
- package/dist/connectors/slack/index.js.map +1 -1
- package/dist/connectors/telegram/index.d.ts +9 -2
- package/dist/connectors/telegram/index.d.ts.map +1 -1
- package/dist/connectors/telegram/index.js +119 -70
- package/dist/connectors/telegram/index.js.map +1 -1
- package/dist/connectors/trello/index.d.ts +10 -3
- package/dist/connectors/trello/index.d.ts.map +1 -1
- package/dist/connectors/trello/index.js +88 -39
- package/dist/connectors/trello/index.js.map +1 -1
- package/dist/gateways/base-gateway.d.ts +9 -33
- package/dist/gateways/base-gateway.d.ts.map +1 -1
- package/dist/gateways/base-gateway.js +7 -28
- package/dist/gateways/base-gateway.js.map +1 -1
- package/dist/gateways/conversation-record.d.ts +52 -0
- package/dist/gateways/conversation-record.d.ts.map +1 -0
- package/dist/gateways/conversation-record.js +220 -0
- package/dist/gateways/conversation-record.js.map +1 -0
- package/dist/gateways/discord.d.ts +33 -135
- package/dist/gateways/discord.d.ts.map +1 -1
- package/dist/gateways/discord.js +258 -778
- package/dist/gateways/discord.js.map +1 -1
- package/dist/gateways/session-store.d.ts +28 -9
- package/dist/gateways/session-store.d.ts.map +1 -1
- package/dist/gateways/session-store.js +192 -60
- package/dist/gateways/session-store.js.map +1 -1
- package/dist/gateways/slack.d.ts +35 -105
- package/dist/gateways/slack.d.ts.map +1 -1
- package/dist/gateways/slack.js +282 -440
- package/dist/gateways/slack.js.map +1 -1
- package/dist/gateways/telegram-attachments.d.ts +32 -0
- package/dist/gateways/telegram-attachments.d.ts.map +1 -0
- package/dist/gateways/telegram-attachments.js +113 -0
- package/dist/gateways/telegram-attachments.js.map +1 -0
- package/dist/gateways/telegram-errors.d.ts +3 -0
- package/dist/gateways/telegram-errors.d.ts.map +1 -0
- package/dist/gateways/telegram-errors.js +10 -0
- package/dist/gateways/telegram-errors.js.map +1 -0
- package/dist/gateways/telegram-format.d.ts.map +1 -1
- package/dist/gateways/telegram-format.js +9 -1
- package/dist/gateways/telegram-format.js.map +1 -1
- package/dist/gateways/telegram-message-ledger.d.ts +31 -25
- package/dist/gateways/telegram-message-ledger.d.ts.map +1 -1
- package/dist/gateways/telegram-message-ledger.js +122 -146
- package/dist/gateways/telegram-message-ledger.js.map +1 -1
- package/dist/gateways/telegram-response-presenter.d.ts +3 -1
- package/dist/gateways/telegram-response-presenter.d.ts.map +1 -1
- package/dist/gateways/telegram-response-presenter.js +14 -0
- package/dist/gateways/telegram-response-presenter.js.map +1 -1
- package/dist/gateways/telegram-text-entities.d.ts +2 -3
- package/dist/gateways/telegram-text-entities.d.ts.map +1 -1
- package/dist/gateways/telegram-text-entities.js +4 -5
- package/dist/gateways/telegram-text-entities.js.map +1 -1
- package/dist/gateways/telegram.d.ts +39 -101
- package/dist/gateways/telegram.d.ts.map +1 -1
- package/dist/gateways/telegram.js +406 -919
- package/dist/gateways/telegram.js.map +1 -1
- package/dist/gateways/turn-contract.d.ts +27 -87
- package/dist/gateways/turn-contract.d.ts.map +1 -1
- package/dist/gateways/types.d.ts +14 -299
- package/dist/gateways/types.d.ts.map +1 -1
- package/dist/gateways/types.js +0 -3
- package/dist/gateways/types.js.map +1 -1
- package/dist/index.d.ts +1 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -23
- package/dist/index.js.map +1 -1
- package/dist/operator/board-read-views.d.ts +8 -10
- package/dist/operator/board-read-views.d.ts.map +1 -1
- package/dist/operator/board-read-views.js +4 -13
- package/dist/operator/board-read-views.js.map +1 -1
- package/dist/operator/board-slot-instructions.d.ts +10 -11
- package/dist/operator/board-slot-instructions.d.ts.map +1 -1
- package/dist/operator/board-slot-instructions.js +22 -21
- package/dist/operator/board-slot-instructions.js.map +1 -1
- package/dist/replay/import-manifest.d.ts +21 -0
- package/dist/replay/import-manifest.d.ts.map +1 -0
- package/dist/replay/import-manifest.js +157 -0
- package/dist/replay/import-manifest.js.map +1 -0
- package/dist/replay/jev-client.d.ts +35 -0
- package/dist/replay/jev-client.d.ts.map +1 -0
- package/dist/replay/jev-client.js +141 -0
- package/dist/replay/jev-client.js.map +1 -0
- package/dist/replay/kagemusha-import.d.ts +35 -0
- package/dist/replay/kagemusha-import.d.ts.map +1 -0
- package/dist/replay/kagemusha-import.js +543 -0
- package/dist/replay/kagemusha-import.js.map +1 -0
- package/dist/replay/replay-cursor.d.ts +31 -0
- package/dist/replay/replay-cursor.d.ts.map +1 -0
- package/dist/replay/replay-cursor.js +189 -0
- package/dist/replay/replay-cursor.js.map +1 -0
- package/dist/replay/replay-feeder.d.ts +55 -0
- package/dist/replay/replay-feeder.d.ts.map +1 -0
- package/dist/replay/replay-feeder.js +214 -0
- package/dist/replay/replay-feeder.js.map +1 -0
- package/dist/replay/replay-ledger.d.ts +32 -0
- package/dist/replay/replay-ledger.d.ts.map +1 -0
- package/dist/replay/replay-ledger.js +91 -0
- package/dist/replay/replay-ledger.js.map +1 -0
- package/dist/replay/replay-source-catalog.d.ts +66 -0
- package/dist/replay/replay-source-catalog.d.ts.map +1 -0
- package/dist/replay/replay-source-catalog.js +332 -0
- package/dist/replay/replay-source-catalog.js.map +1 -0
- package/dist/replay/trello-import.d.ts +33 -0
- package/dist/replay/trello-import.d.ts.map +1 -0
- package/dist/replay/trello-import.js +204 -0
- package/dist/replay/trello-import.js.map +1 -0
- package/dist/replay/window-queue.d.ts +116 -0
- package/dist/replay/window-queue.d.ts.map +1 -0
- package/dist/replay/window-queue.js +497 -0
- package/dist/replay/window-queue.js.map +1 -0
- package/dist/runtime/action-mcp-server.d.ts +30 -0
- package/dist/runtime/action-mcp-server.d.ts.map +1 -0
- package/dist/runtime/action-mcp-server.js +179 -0
- package/dist/runtime/action-mcp-server.js.map +1 -0
- package/dist/runtime/action-surface.d.ts +47 -0
- package/dist/runtime/action-surface.d.ts.map +1 -0
- package/dist/runtime/action-surface.js +182 -0
- package/dist/runtime/action-surface.js.map +1 -0
- package/dist/runtime/backend-security.d.ts +7 -0
- package/dist/runtime/backend-security.d.ts.map +1 -0
- package/dist/runtime/backend-security.js +28 -0
- package/dist/runtime/backend-security.js.map +1 -0
- package/dist/runtime/claude-caller-hook.d.ts +20 -0
- package/dist/runtime/claude-caller-hook.d.ts.map +1 -0
- package/dist/runtime/claude-caller-hook.js +41 -0
- package/dist/runtime/claude-caller-hook.js.map +1 -0
- package/dist/runtime/config.d.ts +84 -0
- package/dist/runtime/config.d.ts.map +1 -0
- package/dist/runtime/config.js +361 -0
- package/dist/runtime/config.js.map +1 -0
- package/dist/runtime/connectors.d.ts +41 -0
- package/dist/runtime/connectors.d.ts.map +1 -0
- package/dist/runtime/connectors.js +187 -0
- package/dist/runtime/connectors.js.map +1 -0
- package/dist/runtime/core-db.d.ts +8 -0
- package/dist/runtime/core-db.d.ts.map +1 -0
- package/dist/runtime/core-db.js +19 -0
- package/dist/runtime/core-db.js.map +1 -0
- package/dist/runtime/model-cache.d.ts +9 -0
- package/dist/runtime/model-cache.d.ts.map +1 -0
- package/dist/runtime/model-cache.js +22 -0
- package/dist/runtime/model-cache.js.map +1 -0
- package/dist/runtime/native-session.d.ts +80 -0
- package/dist/runtime/native-session.d.ts.map +1 -0
- package/dist/runtime/native-session.js +284 -0
- package/dist/runtime/native-session.js.map +1 -0
- package/dist/runtime/owner-policy.d.ts +10 -0
- package/dist/runtime/owner-policy.d.ts.map +1 -0
- package/dist/runtime/owner-policy.js +35 -0
- package/dist/runtime/owner-policy.js.map +1 -0
- package/dist/runtime/owner-runtime.d.ts +78 -0
- package/dist/runtime/owner-runtime.d.ts.map +1 -0
- package/dist/runtime/owner-runtime.js +255 -0
- package/dist/runtime/owner-runtime.js.map +1 -0
- package/dist/runtime/owner-system-prompt.d.ts +17 -0
- package/dist/runtime/owner-system-prompt.d.ts.map +1 -0
- package/dist/runtime/owner-system-prompt.js +122 -0
- package/dist/runtime/owner-system-prompt.js.map +1 -0
- package/dist/runtime/recent-owner-exchanges.d.ts +10 -0
- package/dist/runtime/recent-owner-exchanges.d.ts.map +1 -0
- package/dist/runtime/recent-owner-exchanges.js +53 -0
- package/dist/runtime/recent-owner-exchanges.js.map +1 -0
- package/dist/runtime/report-prompts.d.ts +14 -0
- package/dist/runtime/report-prompts.d.ts.map +1 -0
- package/dist/runtime/report-prompts.js +69 -0
- package/dist/runtime/report-prompts.js.map +1 -0
- package/dist/runtime/report-scheduler.d.ts +24 -0
- package/dist/runtime/report-scheduler.d.ts.map +1 -0
- package/dist/runtime/report-scheduler.js +97 -0
- package/dist/runtime/report-scheduler.js.map +1 -0
- package/dist/runtime/session-credential.d.ts +5 -0
- package/dist/runtime/session-credential.d.ts.map +1 -0
- package/dist/runtime/session-credential.js +19 -0
- package/dist/runtime/session-credential.js.map +1 -0
- package/dist/runtime/stimulus-delivery.d.ts +85 -0
- package/dist/runtime/stimulus-delivery.d.ts.map +1 -0
- package/dist/runtime/stimulus-delivery.js +590 -0
- package/dist/runtime/stimulus-delivery.js.map +1 -0
- package/dist/runtime/timezone.d.ts +13 -0
- package/dist/runtime/timezone.d.ts.map +1 -0
- package/dist/runtime/timezone.js +119 -0
- package/dist/runtime/timezone.js.map +1 -0
- package/dist/sqlite.d.ts +7 -32
- package/dist/sqlite.d.ts.map +1 -1
- package/dist/sqlite.js +10 -48
- package/dist/sqlite.js.map +1 -1
- package/dist/storage/migrations/raw-item-revisions.d.ts +6 -0
- package/dist/storage/migrations/raw-item-revisions.d.ts.map +1 -0
- package/dist/storage/migrations/raw-item-revisions.js +109 -0
- package/dist/storage/migrations/raw-item-revisions.js.map +1 -0
- package/dist/storage/migrations-source.d.ts +5 -0
- package/dist/storage/migrations-source.d.ts.map +1 -0
- package/dist/storage/migrations-source.js +24 -0
- package/dist/storage/migrations-source.js.map +1 -0
- package/dist/storage/source-archive.d.ts +123 -0
- package/dist/storage/source-archive.d.ts.map +1 -0
- package/dist/storage/source-archive.js +595 -0
- package/dist/storage/source-archive.js.map +1 -0
- package/dist/storage-sqlite.d.ts +59 -0
- package/dist/storage-sqlite.d.ts.map +1 -0
- package/dist/storage-sqlite.js +75 -0
- package/dist/storage-sqlite.js.map +1 -0
- package/dist/utils/untrusted-content.d.ts +5 -35
- package/dist/utils/untrusted-content.d.ts.map +1 -1
- package/dist/utils/untrusted-content.js +16 -75
- package/dist/utils/untrusted-content.js.map +1 -1
- package/dist/wiki/obsidian-writer.d.ts +4 -2
- package/dist/wiki/obsidian-writer.d.ts.map +1 -1
- package/dist/wiki/obsidian-writer.js +85 -4
- package/dist/wiki/obsidian-writer.js.map +1 -1
- package/dist/wiki/path-safety.d.ts +2 -0
- package/dist/wiki/path-safety.d.ts.map +1 -1
- package/dist/wiki/path-safety.js +11 -3
- package/dist/wiki/path-safety.js.map +1 -1
- package/dist/wiki/wiki-edits.d.ts +17 -0
- package/dist/wiki/wiki-edits.d.ts.map +1 -0
- package/dist/wiki/wiki-edits.js +75 -0
- package/dist/wiki/wiki-edits.js.map +1 -0
- package/dist/wiki/wiki-read.d.ts +20 -11
- package/dist/wiki/wiki-read.d.ts.map +1 -1
- package/dist/wiki/wiki-read.js +87 -89
- package/dist/wiki/wiki-read.js.map +1 -1
- package/dist/wiki-artifacts/types.d.ts +1 -1
- package/dist/wiki-artifacts/types.d.ts.map +1 -1
- package/dist/wiki-artifacts/wiki-publish-adapter.d.ts.map +1 -1
- package/dist/wiki-artifacts/wiki-publish-adapter.js +13 -9
- package/dist/wiki-artifacts/wiki-publish-adapter.js.map +1 -1
- package/package.json +11 -41
- package/public/viewer/js/modules/graph.js +111 -41
- package/public/viewer/js/modules/memory.js +4 -31
- package/public/viewer/js/modules/wiki.js +0 -37
- package/public/viewer/js/utils/api.js +4 -50
- package/public/viewer/log-viewer.html +46 -0
- package/public/viewer/operator/operator.css +1 -1
- package/public/viewer/operator/operator.js +10835 -8211
- package/public/viewer/src/modules/graph.ts +133 -41
- package/public/viewer/src/modules/memory.ts +4 -31
- package/public/viewer/src/modules/wiki.ts +0 -42
- package/public/viewer/src/types/global.d.ts +1 -1
- package/public/viewer/src/utils/api.ts +7 -83
- package/public/viewer/viewer.html +7 -96
- package/dist/agent/agent-loop.d.ts +0 -289
- package/dist/agent/agent-loop.d.ts.map +0 -1
- package/dist/agent/agent-loop.js +0 -2842
- package/dist/agent/agent-loop.js.map +0 -1
- package/dist/agent/attachment-text-extractor.d.ts +0 -2
- package/dist/agent/attachment-text-extractor.d.ts.map +0 -1
- package/dist/agent/attachment-text-extractor.js +0 -128
- package/dist/agent/attachment-text-extractor.js.map +0 -1
- package/dist/agent/backend-model-policy.d.ts +0 -58
- package/dist/agent/backend-model-policy.d.ts.map +0 -1
- package/dist/agent/backend-model-policy.js +0 -167
- package/dist/agent/backend-model-policy.js.map +0 -1
- package/dist/agent/backend-model-runner-factory.d.ts +0 -27
- package/dist/agent/backend-model-runner-factory.d.ts.map +0 -1
- package/dist/agent/backend-model-runner-factory.js +0 -88
- package/dist/agent/backend-model-runner-factory.js.map +0 -1
- package/dist/agent/claude-cli-wrapper.d.ts +0 -144
- package/dist/agent/claude-cli-wrapper.d.ts.map +0 -1
- package/dist/agent/claude-cli-wrapper.js +0 -382
- package/dist/agent/claude-cli-wrapper.js.map +0 -1
- package/dist/agent/cli-arg-redaction.d.ts +0 -2
- package/dist/agent/cli-arg-redaction.d.ts.map +0 -1
- package/dist/agent/cli-arg-redaction.js +0 -18
- package/dist/agent/cli-arg-redaction.js.map +0 -1
- package/dist/agent/cline-cli-adapter.d.ts +0 -126
- package/dist/agent/cline-cli-adapter.d.ts.map +0 -1
- package/dist/agent/cline-cli-adapter.js +0 -1042
- package/dist/agent/cline-cli-adapter.js.map +0 -1
- package/dist/agent/cline-native-tool-policy.d.ts +0 -9
- package/dist/agent/cline-native-tool-policy.d.ts.map +0 -1
- package/dist/agent/cline-native-tool-policy.js +0 -61
- package/dist/agent/cline-native-tool-policy.js.map +0 -1
- package/dist/agent/code-act/completed-terminal-result.d.ts +0 -5
- package/dist/agent/code-act/completed-terminal-result.d.ts.map +0 -1
- package/dist/agent/code-act/completed-terminal-result.js +0 -83
- package/dist/agent/code-act/completed-terminal-result.js.map +0 -1
- package/dist/agent/code-act/constants.d.ts +0 -11
- package/dist/agent/code-act/constants.d.ts.map +0 -1
- package/dist/agent/code-act/constants.js +0 -64
- package/dist/agent/code-act/constants.js.map +0 -1
- package/dist/agent/code-act/host-bridge.d.ts +0 -50
- package/dist/agent/code-act/host-bridge.d.ts.map +0 -1
- package/dist/agent/code-act/host-bridge.js +0 -1405
- package/dist/agent/code-act/host-bridge.js.map +0 -1
- package/dist/agent/code-act/index.d.ts +0 -10
- package/dist/agent/code-act/index.d.ts.map +0 -1
- package/dist/agent/code-act/index.js +0 -22
- package/dist/agent/code-act/index.js.map +0 -1
- package/dist/agent/code-act/run-context-registry.d.ts +0 -36
- package/dist/agent/code-act/run-context-registry.d.ts.map +0 -1
- package/dist/agent/code-act/run-context-registry.js +0 -143
- package/dist/agent/code-act/run-context-registry.js.map +0 -1
- package/dist/agent/code-act/sandbox.d.ts +0 -25
- package/dist/agent/code-act/sandbox.d.ts.map +0 -1
- package/dist/agent/code-act/sandbox.js +0 -494
- package/dist/agent/code-act/sandbox.js.map +0 -1
- package/dist/agent/code-act/tool-catalog.d.ts +0 -30
- package/dist/agent/code-act/tool-catalog.d.ts.map +0 -1
- package/dist/agent/code-act/tool-catalog.js +0 -185
- package/dist/agent/code-act/tool-catalog.js.map +0 -1
- package/dist/agent/code-act/tool-policy.d.ts +0 -51
- package/dist/agent/code-act/tool-policy.d.ts.map +0 -1
- package/dist/agent/code-act/tool-policy.js +0 -160
- package/dist/agent/code-act/tool-policy.js.map +0 -1
- package/dist/agent/code-act/type-definition-generator.d.ts +0 -19
- package/dist/agent/code-act/type-definition-generator.d.ts.map +0 -1
- package/dist/agent/code-act/type-definition-generator.js +0 -73
- package/dist/agent/code-act/type-definition-generator.js.map +0 -1
- package/dist/agent/code-act/types.d.ts +0 -57
- package/dist/agent/code-act/types.d.ts.map +0 -1
- package/dist/agent/code-act/types.js +0 -14
- package/dist/agent/code-act/types.js.map +0 -1
- package/dist/agent/codex-app-server-process.d.ts +0 -257
- package/dist/agent/codex-app-server-process.d.ts.map +0 -1
- package/dist/agent/codex-app-server-process.js +0 -2084
- package/dist/agent/codex-app-server-process.js.map +0 -1
- package/dist/agent/codex-auth.d.ts +0 -2
- package/dist/agent/codex-auth.d.ts.map +0 -1
- package/dist/agent/codex-auth.js +0 -17
- package/dist/agent/codex-auth.js.map +0 -1
- package/dist/agent/codex-auxiliary-tools.d.ts +0 -17
- package/dist/agent/codex-auxiliary-tools.d.ts.map +0 -1
- package/dist/agent/codex-auxiliary-tools.js +0 -267
- package/dist/agent/codex-auxiliary-tools.js.map +0 -1
- package/dist/agent/codex-home.d.ts +0 -13
- package/dist/agent/codex-home.d.ts.map +0 -1
- package/dist/agent/codex-home.js +0 -644
- package/dist/agent/codex-home.js.map +0 -1
- package/dist/agent/codex-thread-registry.d.ts +0 -63
- package/dist/agent/codex-thread-registry.d.ts.map +0 -1
- package/dist/agent/codex-thread-registry.js +0 -433
- package/dist/agent/codex-thread-registry.js.map +0 -1
- package/dist/agent/content-dedup.d.ts +0 -86
- package/dist/agent/content-dedup.d.ts.map +0 -1
- package/dist/agent/content-dedup.js +0 -114
- package/dist/agent/content-dedup.js.map +0 -1
- package/dist/agent/context-compile-contract.d.ts +0 -5
- package/dist/agent/context-compile-contract.d.ts.map +0 -1
- package/dist/agent/context-compile-contract.js +0 -8
- package/dist/agent/context-compile-contract.js.map +0 -1
- package/dist/agent/context-compile-service.d.ts +0 -60
- package/dist/agent/context-compile-service.d.ts.map +0 -1
- package/dist/agent/context-compile-service.js +0 -481
- package/dist/agent/context-compile-service.js.map +0 -1
- package/dist/agent/context-prompt-builder.d.ts +0 -24
- package/dist/agent/context-prompt-builder.d.ts.map +0 -1
- package/dist/agent/context-prompt-builder.js +0 -61
- package/dist/agent/context-prompt-builder.js.map +0 -1
- package/dist/agent/contract-extractor.d.ts +0 -124
- package/dist/agent/contract-extractor.d.ts.map +0 -1
- package/dist/agent/contract-extractor.js +0 -465
- package/dist/agent/contract-extractor.js.map +0 -1
- package/dist/agent/drive-tools.d.ts +0 -83
- package/dist/agent/drive-tools.d.ts.map +0 -1
- package/dist/agent/drive-tools.js +0 -338
- package/dist/agent/drive-tools.js.map +0 -1
- package/dist/agent/gateway-tool-catalog.d.ts +0 -14
- package/dist/agent/gateway-tool-catalog.d.ts.map +0 -1
- package/dist/agent/gateway-tool-catalog.js +0 -41
- package/dist/agent/gateway-tool-catalog.js.map +0 -1
- package/dist/agent/gateway-tool-executor.d.ts +0 -353
- package/dist/agent/gateway-tool-executor.d.ts.map +0 -1
- package/dist/agent/gateway-tool-executor.js +0 -5448
- package/dist/agent/gateway-tool-executor.js.map +0 -1
- package/dist/agent/gateway-tools.md +0 -166
- package/dist/agent/image-translation-tools.d.ts +0 -48
- package/dist/agent/image-translation-tools.d.ts.map +0 -1
- package/dist/agent/image-translation-tools.js +0 -274
- package/dist/agent/image-translation-tools.js.map +0 -1
- package/dist/agent/index.d.ts +0 -13
- package/dist/agent/index.d.ts.map +0 -1
- package/dist/agent/index.js +0 -18
- package/dist/agent/index.js.map +0 -1
- package/dist/agent/mama-tool-handlers.d.ts +0 -11
- package/dist/agent/mama-tool-handlers.d.ts.map +0 -1
- package/dist/agent/mama-tool-handlers.js +0 -220
- package/dist/agent/mama-tool-handlers.js.map +0 -1
- package/dist/agent/managed-agent-runtime-sync.d.ts +0 -36
- package/dist/agent/managed-agent-runtime-sync.d.ts.map +0 -1
- package/dist/agent/managed-agent-runtime-sync.js +0 -245
- package/dist/agent/managed-agent-runtime-sync.js.map +0 -1
- package/dist/agent/managed-agent-validation.d.ts +0 -4
- package/dist/agent/managed-agent-validation.d.ts.map +0 -1
- package/dist/agent/managed-agent-validation.js +0 -85
- package/dist/agent/managed-agent-validation.js.map +0 -1
- package/dist/agent/model-runner.d.ts +0 -180
- package/dist/agent/model-runner.d.ts.map +0 -1
- package/dist/agent/model-runner.js +0 -54
- package/dist/agent/model-runner.js.map +0 -1
- package/dist/agent/native-effect-observer.d.ts +0 -20
- package/dist/agent/native-effect-observer.d.ts.map +0 -1
- package/dist/agent/native-effect-observer.js +0 -86
- package/dist/agent/native-effect-observer.js.map +0 -1
- package/dist/agent/obsidian-cli-args.d.ts +0 -14
- package/dist/agent/obsidian-cli-args.d.ts.map +0 -1
- package/dist/agent/obsidian-cli-args.js +0 -57
- package/dist/agent/obsidian-cli-args.js.map +0 -1
- package/dist/agent/os-agent-capabilities.md +0 -367
- package/dist/agent/persistent-cli-adapter.d.ts +0 -173
- package/dist/agent/persistent-cli-adapter.d.ts.map +0 -1
- package/dist/agent/persistent-cli-adapter.js +0 -467
- package/dist/agent/persistent-cli-adapter.js.map +0 -1
- package/dist/agent/persistent-cli-process.d.ts +0 -392
- package/dist/agent/persistent-cli-process.d.ts.map +0 -1
- package/dist/agent/persistent-cli-process.js +0 -1568
- package/dist/agent/persistent-cli-process.js.map +0 -1
- package/dist/agent/post-tool-handler.d.ts +0 -27
- package/dist/agent/post-tool-handler.d.ts.map +0 -1
- package/dist/agent/post-tool-handler.js +0 -194
- package/dist/agent/post-tool-handler.js.map +0 -1
- package/dist/agent/pre-compact-handler.d.ts +0 -36
- package/dist/agent/pre-compact-handler.d.ts.map +0 -1
- package/dist/agent/pre-compact-handler.js +0 -162
- package/dist/agent/pre-compact-handler.js.map +0 -1
- package/dist/agent/prompt-enhancer.d.ts +0 -33
- package/dist/agent/prompt-enhancer.d.ts.map +0 -1
- package/dist/agent/prompt-enhancer.js +0 -811
- package/dist/agent/prompt-enhancer.js.map +0 -1
- package/dist/agent/prompt-size-monitor.d.ts +0 -104
- package/dist/agent/prompt-size-monitor.d.ts.map +0 -1
- package/dist/agent/prompt-size-monitor.js +0 -192
- package/dist/agent/prompt-size-monitor.js.map +0 -1
- package/dist/agent/role-manager.d.ts +0 -122
- package/dist/agent/role-manager.d.ts.map +0 -1
- package/dist/agent/role-manager.js +0 -300
- package/dist/agent/role-manager.js.map +0 -1
- package/dist/agent/session-pool.d.ts +0 -176
- package/dist/agent/session-pool.d.ts.map +0 -1
- package/dist/agent/session-pool.js +0 -368
- package/dist/agent/session-pool.js.map +0 -1
- package/dist/agent/skill-loader.d.ts +0 -87
- package/dist/agent/skill-loader.d.ts.map +0 -1
- package/dist/agent/skill-loader.js +0 -461
- package/dist/agent/skill-loader.js.map +0 -1
- package/dist/agent/stop-continuation-handler.d.ts +0 -106
- package/dist/agent/stop-continuation-handler.d.ts.map +0 -1
- package/dist/agent/stop-continuation-handler.js +0 -230
- package/dist/agent/stop-continuation-handler.js.map +0 -1
- package/dist/agent/subagent-run-reconcile.d.ts +0 -23
- package/dist/agent/subagent-run-reconcile.d.ts.map +0 -1
- package/dist/agent/subagent-run-reconcile.js +0 -56
- package/dist/agent/subagent-run-reconcile.js.map +0 -1
- package/dist/agent/temporal-code-act-breaker.d.ts +0 -26
- package/dist/agent/temporal-code-act-breaker.d.ts.map +0 -1
- package/dist/agent/temporal-code-act-breaker.js +0 -94
- package/dist/agent/temporal-code-act-breaker.js.map +0 -1
- package/dist/agent/token-estimator.d.ts +0 -25
- package/dist/agent/token-estimator.d.ts.map +0 -1
- package/dist/agent/token-estimator.js +0 -75
- package/dist/agent/token-estimator.js.map +0 -1
- package/dist/agent/tool-registry.d.ts +0 -81
- package/dist/agent/tool-registry.d.ts.map +0 -1
- package/dist/agent/tool-registry.js +0 -876
- package/dist/agent/tool-registry.js.map +0 -1
- package/dist/agent/types.d.ts +0 -1261
- package/dist/agent/types.d.ts.map +0 -1
- package/dist/agent/types.js +0 -60
- package/dist/agent/types.js.map +0 -1
- package/dist/agent/yaml-frontmatter.d.ts +0 -75
- package/dist/agent/yaml-frontmatter.d.ts.map +0 -1
- package/dist/agent/yaml-frontmatter.js +0 -166
- package/dist/agent/yaml-frontmatter.js.map +0 -1
- package/dist/api/agent-context-handler.d.ts +0 -10
- package/dist/api/agent-context-handler.d.ts.map +0 -1
- package/dist/api/agent-context-handler.js +0 -216
- package/dist/api/agent-context-handler.js.map +0 -1
- package/dist/api/agent-graph-handler.d.ts +0 -18
- package/dist/api/agent-graph-handler.d.ts.map +0 -1
- package/dist/api/agent-graph-handler.js +0 -569
- package/dist/api/agent-graph-handler.js.map +0 -1
- package/dist/api/agent-handler.d.ts +0 -36
- package/dist/api/agent-handler.d.ts.map +0 -1
- package/dist/api/agent-handler.js +0 -223
- package/dist/api/agent-handler.js.map +0 -1
- package/dist/api/agent-raw-handler.d.ts +0 -70
- package/dist/api/agent-raw-handler.d.ts.map +0 -1
- package/dist/api/agent-raw-handler.js +0 -262
- package/dist/api/agent-raw-handler.js.map +0 -1
- package/dist/api/agent-situation-handler.d.ts +0 -14
- package/dist/api/agent-situation-handler.d.ts.map +0 -1
- package/dist/api/agent-situation-handler.js +0 -383
- package/dist/api/agent-situation-handler.js.map +0 -1
- package/dist/api/connector-feed-handler.d.ts +0 -42
- package/dist/api/connector-feed-handler.d.ts.map +0 -1
- package/dist/api/connector-feed-handler.js +0 -180
- package/dist/api/connector-feed-handler.js.map +0 -1
- package/dist/api/cron-handler.d.ts +0 -44
- package/dist/api/cron-handler.d.ts.map +0 -1
- package/dist/api/cron-handler.js +0 -261
- package/dist/api/cron-handler.js.map +0 -1
- package/dist/api/entity-audit-handler.d.ts +0 -12
- package/dist/api/entity-audit-handler.d.ts.map +0 -1
- package/dist/api/entity-audit-handler.js +0 -119
- package/dist/api/entity-audit-handler.js.map +0 -1
- package/dist/api/entity-audit-queue.d.ts +0 -74
- package/dist/api/entity-audit-queue.d.ts.map +0 -1
- package/dist/api/entity-audit-queue.js +0 -123
- package/dist/api/entity-audit-queue.js.map +0 -1
- package/dist/api/entity-audit-runner.d.ts +0 -9
- package/dist/api/entity-audit-runner.d.ts.map +0 -1
- package/dist/api/entity-audit-runner.js +0 -240
- package/dist/api/entity-audit-runner.js.map +0 -1
- package/dist/api/entity-review-handler.d.ts +0 -18
- package/dist/api/entity-review-handler.d.ts.map +0 -1
- package/dist/api/entity-review-handler.js +0 -521
- package/dist/api/entity-review-handler.js.map +0 -1
- package/dist/api/error-handler.d.ts +0 -22
- package/dist/api/error-handler.d.ts.map +0 -1
- package/dist/api/error-handler.js +0 -104
- package/dist/api/error-handler.js.map +0 -1
- package/dist/api/graph-api-types.d.ts +0 -105
- package/dist/api/graph-api-types.d.ts.map +0 -1
- package/dist/api/graph-api-types.js +0 -6
- package/dist/api/graph-api-types.js.map +0 -1
- package/dist/api/graph-api.d.ts +0 -42
- package/dist/api/graph-api.d.ts.map +0 -1
- package/dist/api/graph-api.js +0 -3460
- package/dist/api/graph-api.js.map +0 -1
- package/dist/api/heartbeat-handler.d.ts +0 -49
- package/dist/api/heartbeat-handler.d.ts.map +0 -1
- package/dist/api/heartbeat-handler.js +0 -106
- package/dist/api/heartbeat-handler.js.map +0 -1
- package/dist/api/index.d.ts +0 -145
- package/dist/api/index.d.ts.map +0 -1
- package/dist/api/index.js +0 -448
- package/dist/api/index.js.map +0 -1
- package/dist/api/intelligence-handler.d.ts +0 -116
- package/dist/api/intelligence-handler.d.ts.map +0 -1
- package/dist/api/intelligence-handler.js +0 -280
- package/dist/api/intelligence-handler.js.map +0 -1
- package/dist/api/memory-provenance-handler.d.ts +0 -3
- package/dist/api/memory-provenance-handler.d.ts.map +0 -1
- package/dist/api/memory-provenance-handler.js +0 -120
- package/dist/api/memory-provenance-handler.js.map +0 -1
- package/dist/api/operator-handler.d.ts +0 -19
- package/dist/api/operator-handler.d.ts.map +0 -1
- package/dist/api/operator-handler.js +0 -106
- package/dist/api/operator-handler.js.map +0 -1
- package/dist/api/operator-summary.d.ts +0 -3
- package/dist/api/operator-summary.d.ts.map +0 -1
- package/dist/api/operator-summary.js +0 -72
- package/dist/api/operator-summary.js.map +0 -1
- package/dist/api/operator-tasks-handler.d.ts +0 -7
- package/dist/api/operator-tasks-handler.d.ts.map +0 -1
- package/dist/api/operator-tasks-handler.js +0 -192
- package/dist/api/operator-tasks-handler.js.map +0 -1
- package/dist/api/runtime-status-handler.d.ts +0 -42
- package/dist/api/runtime-status-handler.d.ts.map +0 -1
- package/dist/api/runtime-status-handler.js +0 -56
- package/dist/api/runtime-status-handler.js.map +0 -1
- package/dist/api/skills-handler.d.ts +0 -12
- package/dist/api/skills-handler.d.ts.map +0 -1
- package/dist/api/skills-handler.js +0 -156
- package/dist/api/skills-handler.js.map +0 -1
- package/dist/api/token-handler.d.ts +0 -33
- package/dist/api/token-handler.d.ts.map +0 -1
- package/dist/api/token-handler.js +0 -118
- package/dist/api/token-handler.js.map +0 -1
- package/dist/api/types.d.ts +0 -155
- package/dist/api/types.d.ts.map +0 -1
- package/dist/api/types.js +0 -49
- package/dist/api/types.js.map +0 -1
- package/dist/api/ui-command-handler.d.ts +0 -48
- package/dist/api/ui-command-handler.d.ts.map +0 -1
- package/dist/api/ui-command-handler.js +0 -160
- package/dist/api/ui-command-handler.js.map +0 -1
- package/dist/api/upload-handler.d.ts +0 -12
- package/dist/api/upload-handler.d.ts.map +0 -1
- package/dist/api/upload-handler.js +0 -321
- package/dist/api/upload-handler.js.map +0 -1
- package/dist/api/wiki-handler.d.ts +0 -19
- package/dist/api/wiki-handler.d.ts.map +0 -1
- package/dist/api/wiki-handler.js +0 -136
- package/dist/api/wiki-handler.js.map +0 -1
- package/dist/api/worker-envelope.d.ts +0 -26
- package/dist/api/worker-envelope.d.ts.map +0 -1
- package/dist/api/worker-envelope.js +0 -176
- package/dist/api/worker-envelope.js.map +0 -1
- package/dist/auth/claude-client.d.ts +0 -12
- package/dist/auth/claude-client.d.ts.map +0 -1
- package/dist/auth/claude-client.js +0 -36
- package/dist/auth/claude-client.js.map +0 -1
- package/dist/auth/claude-code-auth.d.ts +0 -12
- package/dist/auth/claude-code-auth.d.ts.map +0 -1
- package/dist/auth/claude-code-auth.js +0 -85
- package/dist/auth/claude-code-auth.js.map +0 -1
- package/dist/auth/index.d.ts +0 -9
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js +0 -13
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/oauth-manager.d.ts +0 -59
- package/dist/auth/oauth-manager.d.ts.map +0 -1
- package/dist/auth/oauth-manager.js +0 -252
- package/dist/auth/oauth-manager.js.map +0 -1
- package/dist/auth/types.d.ts +0 -92
- package/dist/auth/types.d.ts.map +0 -1
- package/dist/auth/types.js +0 -23
- package/dist/auth/types.js.map +0 -1
- package/dist/cli/commands/connector.d.ts +0 -14
- package/dist/cli/commands/connector.d.ts.map +0 -1
- package/dist/cli/commands/connector.js +0 -174
- package/dist/cli/commands/connector.js.map +0 -1
- package/dist/cli/commands/gateway.d.ts +0 -18
- package/dist/cli/commands/gateway.d.ts.map +0 -1
- package/dist/cli/commands/gateway.js +0 -144
- package/dist/cli/commands/gateway.js.map +0 -1
- package/dist/cli/commands/report.d.ts +0 -14
- package/dist/cli/commands/report.d.ts.map +0 -1
- package/dist/cli/commands/report.js +0 -102
- package/dist/cli/commands/report.js.map +0 -1
- package/dist/cli/commands/run.d.ts +0 -19
- package/dist/cli/commands/run.d.ts.map +0 -1
- package/dist/cli/commands/run.js +0 -123
- package/dist/cli/commands/run.js.map +0 -1
- package/dist/cli/commands/setup.d.ts +0 -3
- package/dist/cli/commands/setup.d.ts.map +0 -1
- package/dist/cli/commands/setup.js +0 -9
- package/dist/cli/commands/setup.js.map +0 -1
- package/dist/cli/commands/start.d.ts +0 -263
- package/dist/cli/commands/start.d.ts.map +0 -1
- package/dist/cli/commands/start.js +0 -2230
- package/dist/cli/commands/start.js.map +0 -1
- package/dist/cli/commands/status.d.ts +0 -18
- package/dist/cli/commands/status.d.ts.map +0 -1
- package/dist/cli/commands/status.js +0 -326
- package/dist/cli/commands/status.js.map +0 -1
- package/dist/cli/commands/stop.d.ts +0 -28
- package/dist/cli/commands/stop.d.ts.map +0 -1
- package/dist/cli/commands/stop.js +0 -597
- package/dist/cli/commands/stop.js.map +0 -1
- package/dist/cli/config/config-manager.d.ts +0 -84
- package/dist/cli/config/config-manager.d.ts.map +0 -1
- package/dist/cli/config/config-manager.js +0 -886
- package/dist/cli/config/config-manager.js.map +0 -1
- package/dist/cli/config/types.d.ts +0 -633
- package/dist/cli/config/types.d.ts.map +0 -1
- package/dist/cli/config/types.js +0 -247
- package/dist/cli/config/types.js.map +0 -1
- package/dist/cli/runtime/agent-loop-init.d.ts +0 -53
- package/dist/cli/runtime/agent-loop-init.d.ts.map +0 -1
- package/dist/cli/runtime/agent-loop-init.js +0 -368
- package/dist/cli/runtime/agent-loop-init.js.map +0 -1
- package/dist/cli/runtime/api-routes-init.d.ts +0 -84
- package/dist/cli/runtime/api-routes-init.d.ts.map +0 -1
- package/dist/cli/runtime/api-routes-init.js +0 -1542
- package/dist/cli/runtime/api-routes-init.js.map +0 -1
- package/dist/cli/runtime/api-server-init.d.ts +0 -59
- package/dist/cli/runtime/api-server-init.d.ts.map +0 -1
- package/dist/cli/runtime/api-server-init.js +0 -159
- package/dist/cli/runtime/api-server-init.js.map +0 -1
- package/dist/cli/runtime/code-act-executor.d.ts +0 -14
- package/dist/cli/runtime/code-act-executor.d.ts.map +0 -1
- package/dist/cli/runtime/code-act-executor.js +0 -108
- package/dist/cli/runtime/code-act-executor.js.map +0 -1
- package/dist/cli/runtime/connector-bootstrap.d.ts +0 -8
- package/dist/cli/runtime/connector-bootstrap.d.ts.map +0 -1
- package/dist/cli/runtime/connector-bootstrap.js +0 -14
- package/dist/cli/runtime/connector-bootstrap.js.map +0 -1
- package/dist/cli/runtime/connector-init.d.ts +0 -64
- package/dist/cli/runtime/connector-init.d.ts.map +0 -1
- package/dist/cli/runtime/connector-init.js +0 -237
- package/dist/cli/runtime/connector-init.js.map +0 -1
- package/dist/cli/runtime/daemon.d.ts +0 -38
- package/dist/cli/runtime/daemon.d.ts.map +0 -1
- package/dist/cli/runtime/daemon.js +0 -263
- package/dist/cli/runtime/daemon.js.map +0 -1
- package/dist/cli/runtime/envelope-bootstrap.d.ts +0 -17
- package/dist/cli/runtime/envelope-bootstrap.d.ts.map +0 -1
- package/dist/cli/runtime/envelope-bootstrap.js +0 -56
- package/dist/cli/runtime/envelope-bootstrap.js.map +0 -1
- package/dist/cli/runtime/gateway-init.d.ts +0 -55
- package/dist/cli/runtime/gateway-init.d.ts.map +0 -1
- package/dist/cli/runtime/gateway-init.js +0 -196
- package/dist/cli/runtime/gateway-init.js.map +0 -1
- package/dist/cli/runtime/gateway-wiring.d.ts +0 -51
- package/dist/cli/runtime/gateway-wiring.d.ts.map +0 -1
- package/dist/cli/runtime/gateway-wiring.js +0 -215
- package/dist/cli/runtime/gateway-wiring.js.map +0 -1
- package/dist/cli/runtime/mama-core-init.d.ts +0 -42
- package/dist/cli/runtime/mama-core-init.d.ts.map +0 -1
- package/dist/cli/runtime/mama-core-init.js +0 -211
- package/dist/cli/runtime/mama-core-init.js.map +0 -1
- package/dist/cli/runtime/message-router-config.d.ts +0 -4
- package/dist/cli/runtime/message-router-config.d.ts.map +0 -1
- package/dist/cli/runtime/message-router-config.js +0 -11
- package/dist/cli/runtime/message-router-config.js.map +0 -1
- package/dist/cli/runtime/metrics-init.d.ts +0 -28
- package/dist/cli/runtime/metrics-init.d.ts.map +0 -1
- package/dist/cli/runtime/metrics-init.js +0 -131
- package/dist/cli/runtime/metrics-init.js.map +0 -1
- package/dist/cli/runtime/owner-backfill.d.ts +0 -24
- package/dist/cli/runtime/owner-backfill.d.ts.map +0 -1
- package/dist/cli/runtime/owner-backfill.js +0 -24
- package/dist/cli/runtime/owner-backfill.js.map +0 -1
- package/dist/cli/runtime/scheduler-init.d.ts +0 -60
- package/dist/cli/runtime/scheduler-init.d.ts.map +0 -1
- package/dist/cli/runtime/scheduler-init.js +0 -173
- package/dist/cli/runtime/scheduler-init.js.map +0 -1
- package/dist/cli/runtime/server-start.d.ts +0 -23
- package/dist/cli/runtime/server-start.d.ts.map +0 -1
- package/dist/cli/runtime/server-start.js +0 -174
- package/dist/cli/runtime/server-start.js.map +0 -1
- package/dist/cli/runtime/shutdown.d.ts +0 -46
- package/dist/cli/runtime/shutdown.d.ts.map +0 -1
- package/dist/cli/runtime/shutdown.js +0 -240
- package/dist/cli/runtime/shutdown.js.map +0 -1
- package/dist/cli/runtime/temporal-init.d.ts +0 -26
- package/dist/cli/runtime/temporal-init.d.ts.map +0 -1
- package/dist/cli/runtime/temporal-init.js +0 -57
- package/dist/cli/runtime/temporal-init.js.map +0 -1
- package/dist/cli/runtime/types.d.ts +0 -127
- package/dist/cli/runtime/types.d.ts.map +0 -1
- package/dist/cli/runtime/types.js +0 -12
- package/dist/cli/runtime/types.js.map +0 -1
- package/dist/cli/runtime/utilities.d.ts +0 -72
- package/dist/cli/runtime/utilities.d.ts.map +0 -1
- package/dist/cli/runtime/utilities.js +0 -472
- package/dist/cli/runtime/utilities.js.map +0 -1
- package/dist/cli/shutdown-utils.d.ts +0 -6
- package/dist/cli/shutdown-utils.d.ts.map +0 -1
- package/dist/cli/shutdown-utils.js +0 -11
- package/dist/cli/shutdown-utils.js.map +0 -1
- package/dist/cli/utils/pid-manager.d.ts +0 -56
- package/dist/cli/utils/pid-manager.d.ts.map +0 -1
- package/dist/cli/utils/pid-manager.js +0 -141
- package/dist/cli/utils/pid-manager.js.map +0 -1
- package/dist/concurrency/index.d.ts +0 -13
- package/dist/concurrency/index.d.ts.map +0 -1
- package/dist/concurrency/index.js +0 -22
- package/dist/concurrency/index.js.map +0 -1
- package/dist/concurrency/lane-manager.d.ts +0 -113
- package/dist/concurrency/lane-manager.d.ts.map +0 -1
- package/dist/concurrency/lane-manager.js +0 -248
- package/dist/concurrency/lane-manager.js.map +0 -1
- package/dist/concurrency/session-key.d.ts +0 -41
- package/dist/concurrency/session-key.d.ts.map +0 -1
- package/dist/concurrency/session-key.js +0 -61
- package/dist/concurrency/session-key.js.map +0 -1
- package/dist/concurrency/types.d.ts +0 -73
- package/dist/concurrency/types.d.ts.map +0 -1
- package/dist/concurrency/types.js +0 -16
- package/dist/concurrency/types.js.map +0 -1
- package/dist/connectors/framework/raw-store.d.ts +0 -63
- package/dist/connectors/framework/raw-store.d.ts.map +0 -1
- package/dist/connectors/framework/raw-store.js +0 -356
- package/dist/connectors/framework/raw-store.js.map +0 -1
- package/dist/connectors/kagemusha/query-tools.d.ts +0 -146
- package/dist/connectors/kagemusha/query-tools.d.ts.map +0 -1
- package/dist/connectors/kagemusha/query-tools.js +0 -467
- package/dist/connectors/kagemusha/query-tools.js.map +0 -1
- package/dist/connectors/private-connector-policy.d.ts +0 -174
- package/dist/connectors/private-connector-policy.d.ts.map +0 -1
- package/dist/connectors/private-connector-policy.js +0 -299
- package/dist/connectors/private-connector-policy.js.map +0 -1
- package/dist/connectors/private-prompt-overlay.d.ts +0 -17
- package/dist/connectors/private-prompt-overlay.d.ts.map +0 -1
- package/dist/connectors/private-prompt-overlay.js +0 -156
- package/dist/connectors/private-prompt-overlay.js.map +0 -1
- package/dist/connectors/trello/query-tools.d.ts +0 -243
- package/dist/connectors/trello/query-tools.d.ts.map +0 -1
- package/dist/connectors/trello/query-tools.js +0 -661
- package/dist/connectors/trello/query-tools.js.map +0 -1
- package/dist/db/agent-store.d.ts +0 -145
- package/dist/db/agent-store.d.ts.map +0 -1
- package/dist/db/agent-store.js +0 -279
- package/dist/db/agent-store.js.map +0 -1
- package/dist/db/migrations/agent-activity-envelope-hash.d.ts +0 -3
- package/dist/db/migrations/agent-activity-envelope-hash.d.ts.map +0 -1
- package/dist/db/migrations/agent-activity-envelope-hash.js +0 -29
- package/dist/db/migrations/agent-activity-envelope-hash.js.map +0 -1
- package/dist/db/migrations/agent-activity-gateway-call-id.d.ts +0 -3
- package/dist/db/migrations/agent-activity-gateway-call-id.d.ts.map +0 -1
- package/dist/db/migrations/agent-activity-gateway-call-id.js +0 -17
- package/dist/db/migrations/agent-activity-gateway-call-id.js.map +0 -1
- package/dist/db/migrations/agent-activity-tool-name.d.ts +0 -8
- package/dist/db/migrations/agent-activity-tool-name.d.ts.map +0 -1
- package/dist/db/migrations/agent-activity-tool-name.js +0 -24
- package/dist/db/migrations/agent-activity-tool-name.js.map +0 -1
- package/dist/db/migrations/agent-activity-validation-columns.d.ts +0 -3
- package/dist/db/migrations/agent-activity-validation-columns.d.ts.map +0 -1
- package/dist/db/migrations/agent-activity-validation-columns.js +0 -22
- package/dist/db/migrations/agent-activity-validation-columns.js.map +0 -1
- package/dist/db/migrations/agent-metrics-response-avg.d.ts +0 -3
- package/dist/db/migrations/agent-metrics-response-avg.d.ts.map +0 -1
- package/dist/db/migrations/agent-metrics-response-avg.js +0 -19
- package/dist/db/migrations/agent-metrics-response-avg.js.map +0 -1
- package/dist/db/migrations/agent-store-tables.d.ts +0 -3
- package/dist/db/migrations/agent-store-tables.d.ts.map +0 -1
- package/dist/db/migrations/agent-store-tables.js +0 -64
- package/dist/db/migrations/agent-store-tables.js.map +0 -1
- package/dist/db/migrations/envelope-tables.d.ts +0 -3
- package/dist/db/migrations/envelope-tables.d.ts.map +0 -1
- package/dist/db/migrations/envelope-tables.js +0 -38
- package/dist/db/migrations/envelope-tables.js.map +0 -1
- package/dist/db/migrations/operator-owner-action-candidates.d.ts +0 -19
- package/dist/db/migrations/operator-owner-action-candidates.d.ts.map +0 -1
- package/dist/db/migrations/operator-owner-action-candidates.js +0 -254
- package/dist/db/migrations/operator-owner-action-candidates.js.map +0 -1
- package/dist/db/migrations/operator-procedures.d.ts +0 -4
- package/dist/db/migrations/operator-procedures.d.ts.map +0 -1
- package/dist/db/migrations/operator-procedures.js +0 -63
- package/dist/db/migrations/operator-procedures.js.map +0 -1
- package/dist/db/migrations/operator-task-classification.d.ts +0 -15
- package/dist/db/migrations/operator-task-classification.d.ts.map +0 -1
- package/dist/db/migrations/operator-task-classification.js +0 -25
- package/dist/db/migrations/operator-task-classification.js.map +0 -1
- package/dist/db/migrations/operator-task-external-lifecycle.d.ts +0 -17
- package/dist/db/migrations/operator-task-external-lifecycle.d.ts.map +0 -1
- package/dist/db/migrations/operator-task-external-lifecycle.js +0 -199
- package/dist/db/migrations/operator-task-external-lifecycle.js.map +0 -1
- package/dist/db/migrations/operator-task-review-lifecycle.d.ts +0 -4
- package/dist/db/migrations/operator-task-review-lifecycle.d.ts.map +0 -1
- package/dist/db/migrations/operator-task-review-lifecycle.js +0 -17
- package/dist/db/migrations/operator-task-review-lifecycle.js.map +0 -1
- package/dist/db/migrations/operator-task-temporal.d.ts +0 -8
- package/dist/db/migrations/operator-task-temporal.d.ts.map +0 -1
- package/dist/db/migrations/operator-task-temporal.js +0 -214
- package/dist/db/migrations/operator-task-temporal.js.map +0 -1
- package/dist/db/migrations/owner-action-effects.d.ts +0 -18
- package/dist/db/migrations/owner-action-effects.d.ts.map +0 -1
- package/dist/db/migrations/owner-action-effects.js +0 -111
- package/dist/db/migrations/owner-action-effects.js.map +0 -1
- package/dist/db/migrations/raw-item-revisions.d.ts +0 -4
- package/dist/db/migrations/raw-item-revisions.d.ts.map +0 -1
- package/dist/db/migrations/raw-item-revisions.js +0 -29
- package/dist/db/migrations/raw-item-revisions.js.map +0 -1
- package/dist/db/migrations/token-usage-agent-version.d.ts +0 -3
- package/dist/db/migrations/token-usage-agent-version.d.ts.map +0 -1
- package/dist/db/migrations/token-usage-agent-version.js +0 -16
- package/dist/db/migrations/token-usage-agent-version.js.map +0 -1
- package/dist/db/migrations/validation-session-tables.d.ts +0 -3
- package/dist/db/migrations/validation-session-tables.d.ts.map +0 -1
- package/dist/db/migrations/validation-session-tables.js +0 -59
- package/dist/db/migrations/validation-session-tables.js.map +0 -1
- package/dist/envelope/authority.d.ts +0 -15
- package/dist/envelope/authority.d.ts.map +0 -1
- package/dist/envelope/authority.js +0 -95
- package/dist/envelope/authority.js.map +0 -1
- package/dist/envelope/canonical.d.ts +0 -14
- package/dist/envelope/canonical.d.ts.map +0 -1
- package/dist/envelope/canonical.js +0 -68
- package/dist/envelope/canonical.js.map +0 -1
- package/dist/envelope/enforcer.d.ts +0 -30
- package/dist/envelope/enforcer.d.ts.map +0 -1
- package/dist/envelope/enforcer.js +0 -286
- package/dist/envelope/enforcer.js.map +0 -1
- package/dist/envelope/expiry.d.ts +0 -2
- package/dist/envelope/expiry.d.ts.map +0 -1
- package/dist/envelope/expiry.js +0 -15
- package/dist/envelope/expiry.js.map +0 -1
- package/dist/envelope/index.d.ts +0 -9
- package/dist/envelope/index.d.ts.map +0 -1
- package/dist/envelope/index.js +0 -25
- package/dist/envelope/index.js.map +0 -1
- package/dist/envelope/key-provider.d.ts +0 -7
- package/dist/envelope/key-provider.d.ts.map +0 -1
- package/dist/envelope/key-provider.js +0 -137
- package/dist/envelope/key-provider.js.map +0 -1
- package/dist/envelope/reactive-config.d.ts +0 -24
- package/dist/envelope/reactive-config.d.ts.map +0 -1
- package/dist/envelope/reactive-config.js +0 -198
- package/dist/envelope/reactive-config.js.map +0 -1
- package/dist/envelope/run-guard.d.ts +0 -10
- package/dist/envelope/run-guard.d.ts.map +0 -1
- package/dist/envelope/run-guard.js +0 -19
- package/dist/envelope/run-guard.js.map +0 -1
- package/dist/envelope/signature.d.ts +0 -15
- package/dist/envelope/signature.d.ts.map +0 -1
- package/dist/envelope/signature.js +0 -75
- package/dist/envelope/signature.js.map +0 -1
- package/dist/envelope/store.d.ts +0 -16
- package/dist/envelope/store.d.ts.map +0 -1
- package/dist/envelope/store.js +0 -118
- package/dist/envelope/store.js.map +0 -1
- package/dist/envelope/tool-connector-scope.d.ts +0 -35
- package/dist/envelope/tool-connector-scope.d.ts.map +0 -1
- package/dist/envelope/tool-connector-scope.js +0 -61
- package/dist/envelope/tool-connector-scope.js.map +0 -1
- package/dist/envelope/types.d.ts +0 -60
- package/dist/envelope/types.d.ts.map +0 -1
- package/dist/envelope/types.js +0 -9
- package/dist/envelope/types.js.map +0 -1
- package/dist/evidence/effects.d.ts +0 -125
- package/dist/evidence/effects.d.ts.map +0 -1
- package/dist/evidence/effects.js +0 -409
- package/dist/evidence/effects.js.map +0 -1
- package/dist/evidence/read.d.ts +0 -130
- package/dist/evidence/read.d.ts.map +0 -1
- package/dist/evidence/read.js +0 -167
- package/dist/evidence/read.js.map +0 -1
- package/dist/gateways/attachment-utils.d.ts +0 -28
- package/dist/gateways/attachment-utils.d.ts.map +0 -1
- package/dist/gateways/attachment-utils.js +0 -489
- package/dist/gateways/attachment-utils.js.map +0 -1
- package/dist/gateways/channel-history.d.ts +0 -148
- package/dist/gateways/channel-history.d.ts.map +0 -1
- package/dist/gateways/channel-history.js +0 -385
- package/dist/gateways/channel-history.js.map +0 -1
- package/dist/gateways/context-injector.d.ts +0 -255
- package/dist/gateways/context-injector.d.ts.map +0 -1
- package/dist/gateways/context-injector.js +0 -285
- package/dist/gateways/context-injector.js.map +0 -1
- package/dist/gateways/image-analyzer.d.ts +0 -28
- package/dist/gateways/image-analyzer.d.ts.map +0 -1
- package/dist/gateways/image-analyzer.js +0 -154
- package/dist/gateways/image-analyzer.js.map +0 -1
- package/dist/gateways/index.d.ts +0 -35
- package/dist/gateways/index.d.ts.map +0 -1
- package/dist/gateways/index.js +0 -55
- package/dist/gateways/index.js.map +0 -1
- package/dist/gateways/member-candidate-store.d.ts +0 -26
- package/dist/gateways/member-candidate-store.d.ts.map +0 -1
- package/dist/gateways/member-candidate-store.js +0 -90
- package/dist/gateways/member-candidate-store.js.map +0 -1
- package/dist/gateways/member-effective-scope.d.ts +0 -25
- package/dist/gateways/member-effective-scope.d.ts.map +0 -1
- package/dist/gateways/member-effective-scope.js +0 -323
- package/dist/gateways/member-effective-scope.js.map +0 -1
- package/dist/gateways/message-router.d.ts +0 -239
- package/dist/gateways/message-router.d.ts.map +0 -1
- package/dist/gateways/message-router.js +0 -1714
- package/dist/gateways/message-router.js.map +0 -1
- package/dist/gateways/plugin-loader.d.ts +0 -80
- package/dist/gateways/plugin-loader.d.ts.map +0 -1
- package/dist/gateways/plugin-loader.js +0 -299
- package/dist/gateways/plugin-loader.js.map +0 -1
- package/dist/gateways/principal.d.ts +0 -37
- package/dist/gateways/principal.d.ts.map +0 -1
- package/dist/gateways/principal.js +0 -95
- package/dist/gateways/principal.js.map +0 -1
- package/dist/gateways/report-projection-v1.d.ts +0 -41
- package/dist/gateways/report-projection-v1.d.ts.map +0 -1
- package/dist/gateways/report-projection-v1.js +0 -160
- package/dist/gateways/report-projection-v1.js.map +0 -1
- package/dist/gateways/telegram-media.d.ts +0 -41
- package/dist/gateways/telegram-media.d.ts.map +0 -1
- package/dist/gateways/telegram-media.js +0 -242
- package/dist/gateways/telegram-media.js.map +0 -1
- package/dist/gateways/telegram-report-context-store.d.ts +0 -131
- package/dist/gateways/telegram-report-context-store.d.ts.map +0 -1
- package/dist/gateways/telegram-report-context-store.js +0 -388
- package/dist/gateways/telegram-report-context-store.js.map +0 -1
- package/dist/gateways/tool-status-tracker.d.ts +0 -87
- package/dist/gateways/tool-status-tracker.d.ts.map +0 -1
- package/dist/gateways/tool-status-tracker.js +0 -284
- package/dist/gateways/tool-status-tracker.js.map +0 -1
- package/dist/mcp/code-act-api-client.d.ts +0 -32
- package/dist/mcp/code-act-api-client.d.ts.map +0 -1
- package/dist/mcp/code-act-api-client.js +0 -80
- package/dist/mcp/code-act-api-client.js.map +0 -1
- package/dist/mcp/code-act-mcp-config.d.ts +0 -49
- package/dist/mcp/code-act-mcp-config.d.ts.map +0 -1
- package/dist/mcp/code-act-mcp-config.js +0 -124
- package/dist/mcp/code-act-mcp-config.js.map +0 -1
- package/dist/mcp/code-act-server.d.ts +0 -14
- package/dist/mcp/code-act-server.d.ts.map +0 -1
- package/dist/mcp/code-act-server.js +0 -204
- package/dist/mcp/code-act-server.js.map +0 -1
- package/dist/mcp/code-act-terminal-transport.d.ts +0 -64
- package/dist/mcp/code-act-terminal-transport.d.ts.map +0 -1
- package/dist/mcp/code-act-terminal-transport.js +0 -176
- package/dist/mcp/code-act-terminal-transport.js.map +0 -1
- package/dist/memory/agent-notice-queue.d.ts +0 -24
- package/dist/memory/agent-notice-queue.d.ts.map +0 -1
- package/dist/memory/agent-notice-queue.js +0 -40
- package/dist/memory/agent-notice-queue.js.map +0 -1
- package/dist/memory/audit-task-queue.d.ts +0 -28
- package/dist/memory/audit-task-queue.d.ts.map +0 -1
- package/dist/memory/audit-task-queue.js +0 -29
- package/dist/memory/audit-task-queue.js.map +0 -1
- package/dist/memory/bootstrap-context.d.ts +0 -12
- package/dist/memory/bootstrap-context.d.ts.map +0 -1
- package/dist/memory/bootstrap-context.js +0 -68
- package/dist/memory/bootstrap-context.js.map +0 -1
- package/dist/memory/history-extractor.d.ts +0 -69
- package/dist/memory/history-extractor.d.ts.map +0 -1
- package/dist/memory/history-extractor.js +0 -210
- package/dist/memory/history-extractor.js.map +0 -1
- package/dist/memory/memory-agent-ack.d.ts +0 -4
- package/dist/memory/memory-agent-ack.d.ts.map +0 -1
- package/dist/memory/memory-agent-ack.js +0 -54
- package/dist/memory/memory-agent-ack.js.map +0 -1
- package/dist/memory/memory-agent-dashboard.d.ts +0 -35
- package/dist/memory/memory-agent-dashboard.d.ts.map +0 -1
- package/dist/memory/memory-agent-dashboard.js +0 -116
- package/dist/memory/memory-agent-dashboard.js.map +0 -1
- package/dist/memory/memory-logger.d.ts +0 -47
- package/dist/memory/memory-logger.d.ts.map +0 -1
- package/dist/memory/memory-logger.js +0 -126
- package/dist/memory/memory-logger.js.map +0 -1
- package/dist/memory/provenance-live.d.ts +0 -111
- package/dist/memory/provenance-live.d.ts.map +0 -1
- package/dist/memory/provenance-live.js +0 -381
- package/dist/memory/provenance-live.js.map +0 -1
- package/dist/memory/provenance-resolver.d.ts +0 -184
- package/dist/memory/provenance-resolver.d.ts.map +0 -1
- package/dist/memory/provenance-resolver.js +0 -152
- package/dist/memory/provenance-resolver.js.map +0 -1
- package/dist/memory/raw-backed-memory-ingest.d.ts +0 -26
- package/dist/memory/raw-backed-memory-ingest.d.ts.map +0 -1
- package/dist/memory/raw-backed-memory-ingest.js +0 -214
- package/dist/memory/raw-backed-memory-ingest.js.map +0 -1
- package/dist/memory/recall-bundle-formatter.d.ts +0 -26
- package/dist/memory/recall-bundle-formatter.d.ts.map +0 -1
- package/dist/memory/recall-bundle-formatter.js +0 -53
- package/dist/memory/recall-bundle-formatter.js.map +0 -1
- package/dist/memory/save-candidate-extractor.d.ts +0 -16
- package/dist/memory/save-candidate-extractor.d.ts.map +0 -1
- package/dist/memory/save-candidate-extractor.js +0 -127
- package/dist/memory/save-candidate-extractor.js.map +0 -1
- package/dist/memory/save-candidate-types.d.ts +0 -16
- package/dist/memory/save-candidate-types.d.ts.map +0 -1
- package/dist/memory/save-candidate-types.js +0 -3
- package/dist/memory/save-candidate-types.js.map +0 -1
- package/dist/memory/scope-context.d.ts +0 -12
- package/dist/memory/scope-context.d.ts.map +0 -1
- package/dist/memory/scope-context.js +0 -18
- package/dist/memory/scope-context.js.map +0 -1
- package/dist/memory/secret-filter.d.ts +0 -23
- package/dist/memory/secret-filter.d.ts.map +0 -1
- package/dist/memory/secret-filter.js +0 -90
- package/dist/memory/secret-filter.js.map +0 -1
- package/dist/multi-agent/agent-event-bus.d.ts +0 -50
- package/dist/multi-agent/agent-event-bus.d.ts.map +0 -1
- package/dist/multi-agent/agent-event-bus.js +0 -101
- package/dist/multi-agent/agent-event-bus.js.map +0 -1
- package/dist/multi-agent/agent-process-manager.d.ts +0 -205
- package/dist/multi-agent/agent-process-manager.d.ts.map +0 -1
- package/dist/multi-agent/agent-process-manager.js +0 -1191
- package/dist/multi-agent/agent-process-manager.js.map +0 -1
- package/dist/multi-agent/bmad-templates.d.ts +0 -49
- package/dist/multi-agent/bmad-templates.d.ts.map +0 -1
- package/dist/multi-agent/bmad-templates.js +0 -121
- package/dist/multi-agent/bmad-templates.js.map +0 -1
- package/dist/multi-agent/runtime-process.d.ts +0 -74
- package/dist/multi-agent/runtime-process.d.ts.map +0 -1
- package/dist/multi-agent/runtime-process.js +0 -160
- package/dist/multi-agent/runtime-process.js.map +0 -1
- package/dist/multi-agent/tool-permission-manager.d.ts +0 -70
- package/dist/multi-agent/tool-permission-manager.d.ts.map +0 -1
- package/dist/multi-agent/tool-permission-manager.js +0 -195
- package/dist/multi-agent/tool-permission-manager.js.map +0 -1
- package/dist/multi-agent/types.d.ts +0 -438
- package/dist/multi-agent/types.d.ts.map +0 -1
- package/dist/multi-agent/types.js +0 -27
- package/dist/multi-agent/types.js.map +0 -1
- package/dist/multi-agent/wiki-agent-persona.d.ts +0 -16
- package/dist/multi-agent/wiki-agent-persona.d.ts.map +0 -1
- package/dist/multi-agent/wiki-agent-persona.js +0 -23
- package/dist/multi-agent/wiki-agent-persona.js.map +0 -1
- package/dist/multi-agent/workflow-types.d.ts +0 -186
- package/dist/multi-agent/workflow-types.d.ts.map +0 -1
- package/dist/multi-agent/workflow-types.js +0 -9
- package/dist/multi-agent/workflow-types.js.map +0 -1
- package/dist/observability/code-audit.d.ts +0 -87
- package/dist/observability/code-audit.d.ts.map +0 -1
- package/dist/observability/code-audit.js +0 -414
- package/dist/observability/code-audit.js.map +0 -1
- package/dist/observability/health-check.d.ts +0 -102
- package/dist/observability/health-check.d.ts.map +0 -1
- package/dist/observability/health-check.js +0 -422
- package/dist/observability/health-check.js.map +0 -1
- package/dist/observability/health-score.d.ts +0 -29
- package/dist/observability/health-score.d.ts.map +0 -1
- package/dist/observability/health-score.js +0 -83
- package/dist/observability/health-score.js.map +0 -1
- package/dist/observability/metrics-cleanup.d.ts +0 -24
- package/dist/observability/metrics-cleanup.d.ts.map +0 -1
- package/dist/observability/metrics-cleanup.js +0 -51
- package/dist/observability/metrics-cleanup.js.map +0 -1
- package/dist/observability/metrics-store.d.ts +0 -52
- package/dist/observability/metrics-store.d.ts.map +0 -1
- package/dist/observability/metrics-store.js +0 -186
- package/dist/observability/metrics-store.js.map +0 -1
- package/dist/observability/operational-issues.d.ts +0 -55
- package/dist/observability/operational-issues.d.ts.map +0 -1
- package/dist/observability/operational-issues.js +0 -170
- package/dist/observability/operational-issues.js.map +0 -1
- package/dist/onboarding/agent-contract.d.ts +0 -42
- package/dist/onboarding/agent-contract.d.ts.map +0 -1
- package/dist/onboarding/agent-contract.js +0 -129
- package/dist/onboarding/agent-contract.js.map +0 -1
- package/dist/onboarding/assess-live.d.ts +0 -22
- package/dist/onboarding/assess-live.d.ts.map +0 -1
- package/dist/onboarding/assess-live.js +0 -200
- package/dist/onboarding/assess-live.js.map +0 -1
- package/dist/onboarding/bootstrap-template.d.ts +0 -5
- package/dist/onboarding/bootstrap-template.d.ts.map +0 -1
- package/dist/onboarding/bootstrap-template.js +0 -34
- package/dist/onboarding/bootstrap-template.js.map +0 -1
- package/dist/operator/action-verifier.d.ts +0 -75
- package/dist/operator/action-verifier.d.ts.map +0 -1
- package/dist/operator/action-verifier.js +0 -149
- package/dist/operator/action-verifier.js.map +0 -1
- package/dist/operator/board-delta-gate.d.ts +0 -131
- package/dist/operator/board-delta-gate.d.ts.map +0 -1
- package/dist/operator/board-delta-gate.js +0 -181
- package/dist/operator/board-delta-gate.js.map +0 -1
- package/dist/operator/board-pipeline-render.d.ts +0 -16
- package/dist/operator/board-pipeline-render.d.ts.map +0 -1
- package/dist/operator/board-pipeline-render.js +0 -69
- package/dist/operator/board-pipeline-render.js.map +0 -1
- package/dist/operator/board-reconcile.d.ts +0 -61
- package/dist/operator/board-reconcile.d.ts.map +0 -1
- package/dist/operator/board-reconcile.js +0 -157
- package/dist/operator/board-reconcile.js.map +0 -1
- package/dist/operator/board-refresh-gate.d.ts +0 -39
- package/dist/operator/board-refresh-gate.d.ts.map +0 -1
- package/dist/operator/board-refresh-gate.js +0 -83
- package/dist/operator/board-refresh-gate.js.map +0 -1
- package/dist/operator/changes-projection.d.ts +0 -72
- package/dist/operator/changes-projection.d.ts.map +0 -1
- package/dist/operator/changes-projection.js +0 -110
- package/dist/operator/changes-projection.js.map +0 -1
- package/dist/operator/connector-delta-repo.d.ts +0 -33
- package/dist/operator/connector-delta-repo.d.ts.map +0 -1
- package/dist/operator/connector-delta-repo.js +0 -0
- package/dist/operator/connector-delta-repo.js.map +0 -1
- package/dist/operator/console-brief.d.ts +0 -40
- package/dist/operator/console-brief.d.ts.map +0 -1
- package/dist/operator/console-brief.js +0 -246
- package/dist/operator/console-brief.js.map +0 -1
- package/dist/operator/experience-evidence.d.ts +0 -18
- package/dist/operator/experience-evidence.d.ts.map +0 -1
- package/dist/operator/experience-evidence.js +0 -82
- package/dist/operator/experience-evidence.js.map +0 -1
- package/dist/operator/experience-hints.d.ts +0 -44
- package/dist/operator/experience-hints.d.ts.map +0 -1
- package/dist/operator/experience-hints.js +0 -98
- package/dist/operator/experience-hints.js.map +0 -1
- package/dist/operator/external-correlation.d.ts +0 -94
- package/dist/operator/external-correlation.d.ts.map +0 -1
- package/dist/operator/external-correlation.js +0 -177
- package/dist/operator/external-correlation.js.map +0 -1
- package/dist/operator/external-lifecycle-candidates.d.ts +0 -70
- package/dist/operator/external-lifecycle-candidates.d.ts.map +0 -1
- package/dist/operator/external-lifecycle-candidates.js +0 -579
- package/dist/operator/external-lifecycle-candidates.js.map +0 -1
- package/dist/operator/external-lifecycle-discovery.d.ts +0 -61
- package/dist/operator/external-lifecycle-discovery.d.ts.map +0 -1
- package/dist/operator/external-lifecycle-discovery.js +0 -103
- package/dist/operator/external-lifecycle-discovery.js.map +0 -1
- package/dist/operator/external-lifecycle.d.ts +0 -105
- package/dist/operator/external-lifecycle.d.ts.map +0 -1
- package/dist/operator/external-lifecycle.js +0 -27
- package/dist/operator/external-lifecycle.js.map +0 -1
- package/dist/operator/file-coordination.d.ts +0 -7
- package/dist/operator/file-coordination.d.ts.map +0 -1
- package/dist/operator/file-coordination.js +0 -84
- package/dist/operator/file-coordination.js.map +0 -1
- package/dist/operator/file-export.d.ts +0 -22
- package/dist/operator/file-export.d.ts.map +0 -1
- package/dist/operator/file-export.js +0 -115
- package/dist/operator/file-export.js.map +0 -1
- package/dist/operator/leg-cadence.d.ts +0 -72
- package/dist/operator/leg-cadence.d.ts.map +0 -1
- package/dist/operator/leg-cadence.js +0 -122
- package/dist/operator/leg-cadence.js.map +0 -1
- package/dist/operator/mama-memory-port.d.ts +0 -13
- package/dist/operator/mama-memory-port.d.ts.map +0 -1
- package/dist/operator/mama-memory-port.js +0 -33
- package/dist/operator/mama-memory-port.js.map +0 -1
- package/dist/operator/operator-interfaces.d.ts +0 -136
- package/dist/operator/operator-interfaces.d.ts.map +0 -1
- package/dist/operator/operator-interfaces.js +0 -15
- package/dist/operator/operator-interfaces.js.map +0 -1
- package/dist/operator/operator-trigger-loop.d.ts +0 -203
- package/dist/operator/operator-trigger-loop.d.ts.map +0 -1
- package/dist/operator/operator-trigger-loop.js +0 -827
- package/dist/operator/operator-trigger-loop.js.map +0 -1
- package/dist/operator/owner-action-effects.d.ts +0 -112
- package/dist/operator/owner-action-effects.d.ts.map +0 -1
- package/dist/operator/owner-action-effects.js +0 -375
- package/dist/operator/owner-action-effects.js.map +0 -1
- package/dist/operator/owner-event-effects.d.ts +0 -65
- package/dist/operator/owner-event-effects.d.ts.map +0 -1
- package/dist/operator/owner-event-effects.js +0 -249
- package/dist/operator/owner-event-effects.js.map +0 -1
- package/dist/operator/owner-event-inbox.d.ts +0 -124
- package/dist/operator/owner-event-inbox.d.ts.map +0 -1
- package/dist/operator/owner-event-inbox.js +0 -440
- package/dist/operator/owner-event-inbox.js.map +0 -1
- package/dist/operator/owner-event-loop.d.ts +0 -99
- package/dist/operator/owner-event-loop.d.ts.map +0 -1
- package/dist/operator/owner-event-loop.js +0 -253
- package/dist/operator/owner-event-loop.js.map +0 -1
- package/dist/operator/owner-event-outcome.d.ts +0 -36
- package/dist/operator/owner-event-outcome.d.ts.map +0 -1
- package/dist/operator/owner-event-outcome.js +0 -174
- package/dist/operator/owner-event-outcome.js.map +0 -1
- package/dist/operator/owner-event-policy.d.ts +0 -40
- package/dist/operator/owner-event-policy.d.ts.map +0 -1
- package/dist/operator/owner-event-policy.js +0 -75
- package/dist/operator/owner-event-policy.js.map +0 -1
- package/dist/operator/owner-event-prompt.d.ts +0 -21
- package/dist/operator/owner-event-prompt.d.ts.map +0 -1
- package/dist/operator/owner-event-prompt.js +0 -69
- package/dist/operator/owner-event-prompt.js.map +0 -1
- package/dist/operator/owner-runtime-journal.d.ts +0 -21
- package/dist/operator/owner-runtime-journal.d.ts.map +0 -1
- package/dist/operator/owner-runtime-journal.js +0 -135
- package/dist/operator/owner-runtime-journal.js.map +0 -1
- package/dist/operator/owner-runtime.d.ts +0 -48
- package/dist/operator/owner-runtime.d.ts.map +0 -1
- package/dist/operator/owner-runtime.js +0 -99
- package/dist/operator/owner-runtime.js.map +0 -1
- package/dist/operator/pending-report-store.d.ts +0 -99
- package/dist/operator/pending-report-store.d.ts.map +0 -1
- package/dist/operator/pending-report-store.js +0 -554
- package/dist/operator/pending-report-store.js.map +0 -1
- package/dist/operator/procedure-activation.d.ts +0 -7
- package/dist/operator/procedure-activation.d.ts.map +0 -1
- package/dist/operator/procedure-activation.js +0 -132
- package/dist/operator/procedure-activation.js.map +0 -1
- package/dist/operator/procedure-projection.d.ts +0 -25
- package/dist/operator/procedure-projection.d.ts.map +0 -1
- package/dist/operator/procedure-projection.js +0 -80
- package/dist/operator/procedure-projection.js.map +0 -1
- package/dist/operator/procedure-runtime.d.ts +0 -45
- package/dist/operator/procedure-runtime.d.ts.map +0 -1
- package/dist/operator/procedure-runtime.js +0 -496
- package/dist/operator/procedure-runtime.js.map +0 -1
- package/dist/operator/procedure-store.d.ts +0 -97
- package/dist/operator/procedure-store.d.ts.map +0 -1
- package/dist/operator/procedure-store.js +0 -368
- package/dist/operator/procedure-store.js.map +0 -1
- package/dist/operator/provenance-lookup.d.ts +0 -18
- package/dist/operator/provenance-lookup.d.ts.map +0 -1
- package/dist/operator/provenance-lookup.js +0 -54
- package/dist/operator/provenance-lookup.js.map +0 -1
- package/dist/operator/repair-request.d.ts +0 -29
- package/dist/operator/repair-request.d.ts.map +0 -1
- package/dist/operator/repair-request.js +0 -115
- package/dist/operator/repair-request.js.map +0 -1
- package/dist/operator/report-carry-delivery.d.ts +0 -35
- package/dist/operator/report-carry-delivery.d.ts.map +0 -1
- package/dist/operator/report-carry-delivery.js +0 -55
- package/dist/operator/report-carry-delivery.js.map +0 -1
- package/dist/operator/report-carry.d.ts +0 -66
- package/dist/operator/report-carry.d.ts.map +0 -1
- package/dist/operator/report-carry.js +0 -352
- package/dist/operator/report-carry.js.map +0 -1
- package/dist/operator/report-delivery-coordinator.d.ts +0 -84
- package/dist/operator/report-delivery-coordinator.d.ts.map +0 -1
- package/dist/operator/report-delivery-coordinator.js +0 -146
- package/dist/operator/report-delivery-coordinator.js.map +0 -1
- package/dist/operator/report-run.d.ts +0 -52
- package/dist/operator/report-run.d.ts.map +0 -1
- package/dist/operator/report-run.js +0 -32
- package/dist/operator/report-run.js.map +0 -1
- package/dist/operator/report-scheduler.d.ts +0 -66
- package/dist/operator/report-scheduler.d.ts.map +0 -1
- package/dist/operator/report-scheduler.js +0 -135
- package/dist/operator/report-scheduler.js.map +0 -1
- package/dist/operator/runtime-config.d.ts +0 -10
- package/dist/operator/runtime-config.d.ts.map +0 -1
- package/dist/operator/runtime-config.js +0 -21
- package/dist/operator/runtime-config.js.map +0 -1
- package/dist/operator/situation-report.d.ts +0 -197
- package/dist/operator/situation-report.d.ts.map +0 -1
- package/dist/operator/situation-report.js +0 -462
- package/dist/operator/situation-report.js.map +0 -1
- package/dist/operator/subagent-stimulus.d.ts +0 -34
- package/dist/operator/subagent-stimulus.d.ts.map +0 -1
- package/dist/operator/subagent-stimulus.js +0 -145
- package/dist/operator/subagent-stimulus.js.map +0 -1
- package/dist/operator/task-ledger.d.ts +0 -879
- package/dist/operator/task-ledger.d.ts.map +0 -1
- package/dist/operator/task-ledger.js +0 -3601
- package/dist/operator/task-ledger.js.map +0 -1
- package/dist/operator/task-list-views.d.ts +0 -91
- package/dist/operator/task-list-views.d.ts.map +0 -1
- package/dist/operator/task-list-views.js +0 -532
- package/dist/operator/task-list-views.js.map +0 -1
- package/dist/operator/task-temporal.d.ts +0 -24
- package/dist/operator/task-temporal.d.ts.map +0 -1
- package/dist/operator/task-temporal.js +0 -123
- package/dist/operator/task-temporal.js.map +0 -1
- package/dist/operator/temporal-effect.d.ts +0 -65
- package/dist/operator/temporal-effect.d.ts.map +0 -1
- package/dist/operator/temporal-effect.js +0 -71
- package/dist/operator/temporal-effect.js.map +0 -1
- package/dist/operator/temporal-reconcile.d.ts +0 -49
- package/dist/operator/temporal-reconcile.d.ts.map +0 -1
- package/dist/operator/temporal-reconcile.js +0 -231
- package/dist/operator/temporal-reconcile.js.map +0 -1
- package/dist/operator/temporal-runtime.d.ts +0 -51
- package/dist/operator/temporal-runtime.d.ts.map +0 -1
- package/dist/operator/temporal-runtime.js +0 -104
- package/dist/operator/temporal-runtime.js.map +0 -1
- package/dist/operator/temporal-worker.d.ts +0 -18
- package/dist/operator/temporal-worker.d.ts.map +0 -1
- package/dist/operator/temporal-worker.js +0 -82
- package/dist/operator/temporal-worker.js.map +0 -1
- package/dist/operator/thread-brief-memory.d.ts +0 -29
- package/dist/operator/thread-brief-memory.d.ts.map +0 -1
- package/dist/operator/thread-brief-memory.js +0 -61
- package/dist/operator/thread-brief-memory.js.map +0 -1
- package/dist/operator/trigger-author.d.ts +0 -63
- package/dist/operator/trigger-author.d.ts.map +0 -1
- package/dist/operator/trigger-author.js +0 -384
- package/dist/operator/trigger-author.js.map +0 -1
- package/dist/operator/trigger-evolve.d.ts +0 -31
- package/dist/operator/trigger-evolve.d.ts.map +0 -1
- package/dist/operator/trigger-evolve.js +0 -51
- package/dist/operator/trigger-evolve.js.map +0 -1
- package/dist/operator/trigger-fire.d.ts +0 -29
- package/dist/operator/trigger-fire.d.ts.map +0 -1
- package/dist/operator/trigger-fire.js +0 -41
- package/dist/operator/trigger-fire.js.map +0 -1
- package/dist/operator/trigger-matcher.d.ts +0 -19
- package/dist/operator/trigger-matcher.d.ts.map +0 -1
- package/dist/operator/trigger-matcher.js +0 -65
- package/dist/operator/trigger-matcher.js.map +0 -1
- package/dist/operator/trigger-registry.d.ts +0 -58
- package/dist/operator/trigger-registry.d.ts.map +0 -1
- package/dist/operator/trigger-registry.js +0 -349
- package/dist/operator/trigger-registry.js.map +0 -1
- package/dist/operator/trigger-review.d.ts +0 -23
- package/dist/operator/trigger-review.d.ts.map +0 -1
- package/dist/operator/trigger-review.js +0 -193
- package/dist/operator/trigger-review.js.map +0 -1
- package/dist/operator/trigger-types.d.ts +0 -95
- package/dist/operator/trigger-types.d.ts.map +0 -1
- package/dist/operator/trigger-types.js +0 -14
- package/dist/operator/trigger-types.js.map +0 -1
- package/dist/operator/wiki-continuity.d.ts +0 -153
- package/dist/operator/wiki-continuity.d.ts.map +0 -1
- package/dist/operator/wiki-continuity.js +0 -221
- package/dist/operator/wiki-continuity.js.map +0 -1
- package/dist/operator/worker-run.d.ts +0 -109
- package/dist/operator/worker-run.d.ts.map +0 -1
- package/dist/operator/worker-run.js +0 -131
- package/dist/operator/worker-run.js.map +0 -1
- package/dist/operator/workorder-consumer.d.ts +0 -294
- package/dist/operator/workorder-consumer.d.ts.map +0 -1
- package/dist/operator/workorder-consumer.js +0 -1108
- package/dist/operator/workorder-consumer.js.map +0 -1
- package/dist/operator/workorder-hooks.d.ts +0 -162
- package/dist/operator/workorder-hooks.d.ts.map +0 -1
- package/dist/operator/workorder-hooks.js +0 -342
- package/dist/operator/workorder-hooks.js.map +0 -1
- package/dist/operator/workorder-publishers.d.ts +0 -117
- package/dist/operator/workorder-publishers.d.ts.map +0 -1
- package/dist/operator/workorder-publishers.js +0 -544
- package/dist/operator/workorder-publishers.js.map +0 -1
- package/dist/runners/cli-runner.d.ts +0 -59
- package/dist/runners/cli-runner.d.ts.map +0 -1
- package/dist/runners/cli-runner.js +0 -191
- package/dist/runners/cli-runner.js.map +0 -1
- package/dist/runners/index.d.ts +0 -11
- package/dist/runners/index.d.ts.map +0 -1
- package/dist/runners/index.js +0 -15
- package/dist/runners/index.js.map +0 -1
- package/dist/runners/types.d.ts +0 -81
- package/dist/runners/types.d.ts.map +0 -1
- package/dist/runners/types.js +0 -31
- package/dist/runners/types.js.map +0 -1
- package/dist/scheduler/cron-result-router.d.ts +0 -24
- package/dist/scheduler/cron-result-router.d.ts.map +0 -1
- package/dist/scheduler/cron-result-router.js +0 -63
- package/dist/scheduler/cron-result-router.js.map +0 -1
- package/dist/scheduler/cron-scheduler.d.ts +0 -115
- package/dist/scheduler/cron-scheduler.d.ts.map +0 -1
- package/dist/scheduler/cron-scheduler.js +0 -336
- package/dist/scheduler/cron-scheduler.js.map +0 -1
- package/dist/scheduler/cron-worker.d.ts +0 -39
- package/dist/scheduler/cron-worker.d.ts.map +0 -1
- package/dist/scheduler/cron-worker.js +0 -94
- package/dist/scheduler/cron-worker.js.map +0 -1
- package/dist/scheduler/heartbeat.d.ts +0 -64
- package/dist/scheduler/heartbeat.d.ts.map +0 -1
- package/dist/scheduler/heartbeat.js +0 -197
- package/dist/scheduler/heartbeat.js.map +0 -1
- package/dist/scheduler/index.d.ts +0 -26
- package/dist/scheduler/index.d.ts.map +0 -1
- package/dist/scheduler/index.js +0 -37
- package/dist/scheduler/index.js.map +0 -1
- package/dist/scheduler/job-lock.d.ts +0 -85
- package/dist/scheduler/job-lock.d.ts.map +0 -1
- package/dist/scheduler/job-lock.js +0 -137
- package/dist/scheduler/job-lock.js.map +0 -1
- package/dist/scheduler/recovery.d.ts +0 -78
- package/dist/scheduler/recovery.d.ts.map +0 -1
- package/dist/scheduler/recovery.js +0 -124
- package/dist/scheduler/recovery.js.map +0 -1
- package/dist/scheduler/schedule-store.d.ts +0 -112
- package/dist/scheduler/schedule-store.d.ts.map +0 -1
- package/dist/scheduler/schedule-store.js +0 -259
- package/dist/scheduler/schedule-store.js.map +0 -1
- package/dist/scheduler/token-keep-alive.d.ts +0 -49
- package/dist/scheduler/token-keep-alive.d.ts.map +0 -1
- package/dist/scheduler/token-keep-alive.js +0 -102
- package/dist/scheduler/token-keep-alive.js.map +0 -1
- package/dist/scheduler/types.d.ts +0 -98
- package/dist/scheduler/types.d.ts.map +0 -1
- package/dist/scheduler/types.js +0 -21
- package/dist/scheduler/types.js.map +0 -1
- package/dist/security/security-monitor.d.ts +0 -56
- package/dist/security/security-monitor.d.ts.map +0 -1
- package/dist/security/security-monitor.js +0 -779
- package/dist/security/security-monitor.js.map +0 -1
- package/dist/security/trusted-proxy.d.ts +0 -9
- package/dist/security/trusted-proxy.d.ts.map +0 -1
- package/dist/security/trusted-proxy.js +0 -36
- package/dist/security/trusted-proxy.js.map +0 -1
- package/dist/skills/index.d.ts +0 -10
- package/dist/skills/index.d.ts.map +0 -1
- package/dist/skills/index.js +0 -26
- package/dist/skills/index.js.map +0 -1
- package/dist/skills/skill-executor.d.ts +0 -48
- package/dist/skills/skill-executor.d.ts.map +0 -1
- package/dist/skills/skill-executor.js +0 -483
- package/dist/skills/skill-executor.js.map +0 -1
- package/dist/skills/skill-loader.d.ts +0 -40
- package/dist/skills/skill-loader.d.ts.map +0 -1
- package/dist/skills/skill-loader.js +0 -233
- package/dist/skills/skill-loader.js.map +0 -1
- package/dist/skills/skill-matcher.d.ts +0 -33
- package/dist/skills/skill-matcher.d.ts.map +0 -1
- package/dist/skills/skill-matcher.js +0 -190
- package/dist/skills/skill-matcher.js.map +0 -1
- package/dist/skills/skill-registry.d.ts +0 -117
- package/dist/skills/skill-registry.d.ts.map +0 -1
- package/dist/skills/skill-registry.js +0 -627
- package/dist/skills/skill-registry.js.map +0 -1
- package/dist/skills/types.d.ts +0 -131
- package/dist/skills/types.d.ts.map +0 -1
- package/dist/skills/types.js +0 -12
- package/dist/skills/types.js.map +0 -1
- package/dist/utils/log-sanitizer.d.ts +0 -79
- package/dist/utils/log-sanitizer.d.ts.map +0 -1
- package/dist/utils/log-sanitizer.js +0 -215
- package/dist/utils/log-sanitizer.js.map +0 -1
- package/dist/validation/session-service.d.ts +0 -72
- package/dist/validation/session-service.d.ts.map +0 -1
- package/dist/validation/session-service.js +0 -298
- package/dist/validation/session-service.js.map +0 -1
- package/dist/validation/store.d.ts +0 -25
- package/dist/validation/store.d.ts.map +0 -1
- package/dist/validation/store.js +0 -200
- package/dist/validation/store.js.map +0 -1
- package/dist/validation/types.d.ts +0 -119
- package/dist/validation/types.d.ts.map +0 -1
- package/dist/validation/types.js +0 -57
- package/dist/validation/types.js.map +0 -1
- package/dist/wiki/wiki-turn-contract.d.ts +0 -19
- package/dist/wiki/wiki-turn-contract.d.ts.map +0 -1
- package/dist/wiki/wiki-turn-contract.js +0 -60
- package/dist/wiki/wiki-turn-contract.js.map +0 -1
- package/public/viewer/js/utils/ui-commands.js +0 -88
- package/public/viewer/src/utils/ui-commands.ts +0 -114
- package/scripts/attachment/extract-office-text.js +0 -179
- package/scripts/attachment/extract-pdf-text.swift +0 -36
- package/scripts/backfill-channel-keys.ts +0 -509
- package/scripts/crack-failure-digests.ts +0 -55
- package/scripts/generate-gateway-tools.ts +0 -131
- package/scripts/image/fb-overlay.py +0 -128
- package/scripts/image/ocr-image.py +0 -38
- package/scripts/postinstall.js +0 -161
- package/scripts/setup-ocr.js +0 -120
- package/templates/AGENTS.claude.md +0 -23
- package/templates/AGENTS.codex.md +0 -11
- package/templates/bmad/LICENSE +0 -28
- package/templates/bmad/architecture.md +0 -343
- package/templates/bmad/bmm-workflow-status.template.yaml +0 -66
- package/templates/bmad/prd.md +0 -198
- package/templates/bmad/product-brief.md +0 -149
- package/templates/bmad/sprint-status.template.yaml +0 -35
- package/templates/bmad/tech-spec.md +0 -151
- package/templates/entity-audit-fixtures/cross-language-aliases.json +0 -28
- package/templates/entity-audit-fixtures/gold-canonical-identities.json +0 -46
- package/templates/skills/danggeun-monitor.md +0 -88
- package/templates/skills/document-analyze.md +0 -63
- package/templates/skills/frontend-design.md +0 -71
- package/templates/skills/image-translate.md +0 -62
- package/templates/skills/multi-agent-collab.md +0 -145
- package/templates/skills/scheduling.md +0 -107
- package/templates/workspace/skill-forge/DESIGN.md +0 -115
- package/templates/workspace/skill-forge/agents/architect.ts +0 -295
- package/templates/workspace/skill-forge/agents/developer.ts +0 -364
- package/templates/workspace/skill-forge/agents/qa.ts +0 -313
- package/templates/workspace/skill-forge/claude-api.ts +0 -353
- package/templates/workspace/skill-forge/discord-ui.ts +0 -580
- package/templates/workspace/skill-forge/error-handler.ts +0 -354
- package/templates/workspace/skill-forge/mama-integration.ts +0 -357
- package/templates/workspace/skill-forge/orchestrator.ts +0 -495
- package/templates/workspace/skill-forge/output/generated-skills/skills/hello-world/README.md +0 -24
- package/templates/workspace/skill-forge/output/generated-skills/skills/hello-world/index.ts +0 -79
- package/templates/workspace/skill-forge/output/generated-skills/skills/hello-world/types.ts +0 -17
- package/templates/workspace/skill-forge/package.json +0 -21
- package/templates/workspace/skill-forge/state/session.json +0 -132
- package/templates/workspace/skill-forge/test-e2e.ts +0 -139
- package/templates/workspace/skill-forge/tsconfig.json +0 -20
- package/templates/workspace/skill-forge/types.ts +0 -159
package/dist/gateways/discord.js
CHANGED
|
@@ -1,843 +1,323 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Discord Gateway for MAMA Standalone
|
|
4
|
-
*
|
|
5
|
-
* Provides Discord bot integration for receiving and responding to messages.
|
|
6
|
-
* Supports both DM and channel mentions with configurable filtering.
|
|
7
|
-
*/
|
|
8
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
-
if (k2 === undefined) k2 = k;
|
|
10
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
-
}
|
|
14
|
-
Object.defineProperty(o, k2, desc);
|
|
15
|
-
}) : (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
o[k2] = m[k];
|
|
18
|
-
}));
|
|
19
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
-
}) : function(o, v) {
|
|
22
|
-
o["default"] = v;
|
|
23
|
-
});
|
|
24
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
-
var ownKeys = function(o) {
|
|
26
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
-
var ar = [];
|
|
28
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
-
return ar;
|
|
30
|
-
};
|
|
31
|
-
return ownKeys(o);
|
|
32
|
-
};
|
|
33
|
-
return function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
})();
|
|
41
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
3
|
exports.DiscordGateway = void 0;
|
|
43
|
-
const
|
|
4
|
+
const node_crypto_1 = require("node:crypto");
|
|
44
5
|
const node_fs_1 = require("node:fs");
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const channel_history_js_1 = require("./channel-history.js");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const discord_js_1 = require("discord.js");
|
|
48
8
|
const base_gateway_js_1 = require("./base-gateway.js");
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
function isRecord(value) {
|
|
56
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
57
|
-
}
|
|
58
|
-
function coerceDiscordGuildConfig(raw) {
|
|
59
|
-
if (!isRecord(raw)) {
|
|
60
|
-
return undefined;
|
|
61
|
-
}
|
|
62
|
-
const source = raw instanceof Map ? Object.fromEntries(raw) : raw;
|
|
63
|
-
const normalized = {};
|
|
64
|
-
for (const [rawGuildId, rawGuildConfig] of Object.entries(source)) {
|
|
65
|
-
if (!rawGuildId || !isRecord(rawGuildConfig)) {
|
|
66
|
-
continue;
|
|
67
|
-
}
|
|
68
|
-
const guildConfig = {};
|
|
69
|
-
if (typeof rawGuildConfig.requireMention === 'boolean') {
|
|
70
|
-
guildConfig.requireMention = rawGuildConfig.requireMention;
|
|
71
|
-
}
|
|
72
|
-
const rawChannels = rawGuildConfig.channels;
|
|
73
|
-
if (isRecord(rawChannels)) {
|
|
74
|
-
const channels = {};
|
|
75
|
-
for (const [rawChannelId, rawChannelConfig] of Object.entries(rawChannels)) {
|
|
76
|
-
if (!rawChannelId || !isRecord(rawChannelConfig)) {
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
|
-
const next = {};
|
|
80
|
-
if (typeof rawChannelConfig.requireMention === 'boolean') {
|
|
81
|
-
next.requireMention = rawChannelConfig.requireMention;
|
|
82
|
-
}
|
|
83
|
-
channels[String(rawChannelId)] = next;
|
|
84
|
-
}
|
|
85
|
-
if (Object.keys(channels).length > 0) {
|
|
86
|
-
guildConfig.channels = channels;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
normalized[String(rawGuildId)] = guildConfig;
|
|
90
|
-
}
|
|
91
|
-
return Object.keys(normalized).length > 0 ? normalized : undefined;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Discord Gateway class
|
|
95
|
-
*
|
|
96
|
-
* Connects to Discord via bot token and routes messages
|
|
97
|
-
* to the MessageRouter for processing.
|
|
98
|
-
*/
|
|
9
|
+
const telegram_message_ledger_js_1 = require("./telegram-message-ledger.js");
|
|
10
|
+
const message_splitter_js_1 = require("./message-splitter.js");
|
|
11
|
+
const file_delivery_js_1 = require("../api/file-delivery.js");
|
|
12
|
+
const attachment_io_js_1 = require("../connectors/framework/attachment-io.js");
|
|
13
|
+
const attachment_actions_js_1 = require("../api/attachment-actions.js");
|
|
14
|
+
/** Owner-only Discord transport. It accepts messages into the shared owner turn contract. */
|
|
99
15
|
class DiscordGateway extends base_gateway_js_1.BaseGateway {
|
|
16
|
+
options;
|
|
100
17
|
source = 'discord';
|
|
101
|
-
principalResolver;
|
|
102
18
|
client;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
lastEditTime = 0;
|
|
108
|
-
pendingEdit = null;
|
|
109
|
-
editTimer = null;
|
|
110
|
-
// Multi-agent support
|
|
111
|
-
get mentionPattern() {
|
|
112
|
-
return null; // Discord uses custom cleanMessageContent with multiple patterns
|
|
113
|
-
}
|
|
19
|
+
ledger;
|
|
20
|
+
log;
|
|
21
|
+
activeInputs = new Set();
|
|
22
|
+
deliveryTails = new Map();
|
|
114
23
|
constructor(options) {
|
|
115
|
-
super({
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
this.principalResolver = options.principalResolver;
|
|
121
|
-
this.defaultChannelId = options.defaultChannelId;
|
|
122
|
-
this.config = {
|
|
123
|
-
enabled: true,
|
|
124
|
-
token: options.token,
|
|
125
|
-
guilds: coerceDiscordGuildConfig(options.config?.guilds) || {},
|
|
126
|
-
ownerUserId: options.ownerUserId,
|
|
127
|
-
};
|
|
128
|
-
discordLogger.info(`[Discord] Initialized with guild config keys: ${this.config.guilds ? Object.keys(this.config.guilds).join(', ') : '(none)'}`);
|
|
129
|
-
// Create Discord client with required intents
|
|
24
|
+
super({ intake: options.intake });
|
|
25
|
+
this.options = options;
|
|
26
|
+
this.log = options.log ?? console.log;
|
|
27
|
+
this.ledger =
|
|
28
|
+
options.messageLedger ?? new telegram_message_ledger_js_1.OwnerMessageLedger(options.messageLedgerPath, { log: this.log });
|
|
130
29
|
this.client = new discord_js_1.Client({
|
|
131
30
|
intents: [
|
|
132
31
|
discord_js_1.GatewayIntentBits.Guilds,
|
|
133
32
|
discord_js_1.GatewayIntentBits.GuildMessages,
|
|
134
33
|
discord_js_1.GatewayIntentBits.DirectMessages,
|
|
135
34
|
discord_js_1.GatewayIntentBits.MessageContent,
|
|
136
|
-
discord_js_1.GatewayIntentBits.GuildMembers,
|
|
137
|
-
discord_js_1.GatewayIntentBits.GuildMessageReactions,
|
|
138
35
|
],
|
|
139
|
-
partials: [discord_js_1.Partials.Channel],
|
|
36
|
+
partials: [discord_js_1.Partials.Channel],
|
|
140
37
|
});
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
this.setupEventListeners();
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Set up Discord client event listeners
|
|
147
|
-
*/
|
|
148
|
-
setupEventListeners() {
|
|
149
|
-
// Ready event
|
|
150
|
-
this.client.once(discord_js_1.Events.ClientReady, (client) => {
|
|
151
|
-
console.log(`Discord bot logged in as ${client.user.tag}`);
|
|
152
|
-
this.connected = true;
|
|
153
|
-
this.emitEvent({
|
|
154
|
-
type: 'connected',
|
|
155
|
-
source: 'discord',
|
|
156
|
-
timestamp: new Date(),
|
|
157
|
-
data: { username: client.user.tag },
|
|
158
|
-
});
|
|
159
|
-
// Backfill channel names for existing sessions
|
|
160
|
-
this.backfillChannelNames();
|
|
161
|
-
});
|
|
162
|
-
// Message event
|
|
163
|
-
this.client.on(discord_js_1.Events.MessageCreate, async (message) => {
|
|
164
|
-
try {
|
|
165
|
-
await this.handleMessage(message);
|
|
166
|
-
}
|
|
167
|
-
catch (error) {
|
|
168
|
-
console.error('Error handling Discord message:', error);
|
|
169
|
-
this.emitEvent({
|
|
170
|
-
type: 'error',
|
|
171
|
-
source: 'discord',
|
|
172
|
-
timestamp: new Date(),
|
|
173
|
-
error: error instanceof Error ? error : new Error(String(error)),
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
// Disconnect event
|
|
178
|
-
this.client.on(discord_js_1.Events.ShardDisconnect, () => {
|
|
179
|
-
this.connected = false;
|
|
180
|
-
this.emitEvent({
|
|
181
|
-
type: 'disconnected',
|
|
182
|
-
source: 'discord',
|
|
183
|
-
timestamp: new Date(),
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
// Error event
|
|
187
|
-
this.client.on(discord_js_1.Events.Error, (error) => {
|
|
188
|
-
console.error('Discord client error:', error);
|
|
189
|
-
this.emitEvent({
|
|
38
|
+
this.client.on(discord_js_1.Events.MessageCreate, (message) => {
|
|
39
|
+
void this.accept(message).catch((error) => this.emitEvent({
|
|
190
40
|
type: 'error',
|
|
191
|
-
source:
|
|
41
|
+
source: this.source,
|
|
192
42
|
timestamp: new Date(),
|
|
193
|
-
error,
|
|
194
|
-
});
|
|
43
|
+
error: error instanceof Error ? error : new Error(String(error)),
|
|
44
|
+
}));
|
|
195
45
|
});
|
|
46
|
+
this.client.on('error', (error) => this.log(`discord client error=${error.message}`));
|
|
196
47
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
*/
|
|
200
|
-
async handleMessage(message) {
|
|
201
|
-
// 1. Classify - handle bot messages
|
|
202
|
-
const classification = await this.classifyMessage(message);
|
|
203
|
-
if (!classification)
|
|
204
|
-
return; // bot message, already handled or ignored
|
|
205
|
-
const isDM = !message.guild;
|
|
206
|
-
const namespace = message.guild?.id ?? 'direct';
|
|
207
|
-
let principal = (0, principal_js_1.resolveConnectorPrincipal)({
|
|
208
|
-
connector: 'discord',
|
|
209
|
-
namespace,
|
|
210
|
-
userId: message.author.id,
|
|
211
|
-
ownerUserId: this.config.ownerUserId,
|
|
212
|
-
isDirectMessage: isDM,
|
|
213
|
-
});
|
|
214
|
-
if (principal.class === 'external' && this.principalResolver) {
|
|
215
|
-
principal = (0, principal_js_1.overlayMemberPrincipal)(principal, this.principalResolver('discord', namespace, message.author.id));
|
|
216
|
-
}
|
|
217
|
-
if (principal.lane === 'divert') {
|
|
48
|
+
async start() {
|
|
49
|
+
if (this.connected)
|
|
218
50
|
return;
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
// Check if we should respond to this message
|
|
231
|
-
if (!this.shouldRespond(message, isDM, isMentioned)) {
|
|
232
|
-
console.log('[Discord] Skipping - shouldRespond returned false');
|
|
51
|
+
if (!this.options.config.allowedChannels.length || !this.options.config.ownerUserIds.length)
|
|
52
|
+
throw new Error('discord owner allowlist is not configured');
|
|
53
|
+
if (!this.options.token.trim())
|
|
54
|
+
throw new Error('MAMA_DISCORD_TOKEN is required');
|
|
55
|
+
await this.client.login(this.options.token);
|
|
56
|
+
this.connected = true;
|
|
57
|
+
this.emitEvent({ type: 'connected', source: this.source, timestamp: new Date() });
|
|
58
|
+
await this.recoverPendingResponses();
|
|
59
|
+
}
|
|
60
|
+
async stop() {
|
|
61
|
+
if (!this.connected)
|
|
233
62
|
return;
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
this.emitEvent({
|
|
237
|
-
type: 'message_received',
|
|
238
|
-
source: 'discord',
|
|
239
|
-
timestamp: new Date(),
|
|
240
|
-
data: {
|
|
241
|
-
channelId: message.channel.id,
|
|
242
|
-
userId: message.author.id,
|
|
243
|
-
isDM,
|
|
244
|
-
isMentioned,
|
|
245
|
-
},
|
|
246
|
-
});
|
|
247
|
-
if (!cleanContent.trim() && attachmentInfo.effectiveAttachments.length === 0) {
|
|
248
|
-
return; // Don't process empty messages without attachments
|
|
249
|
-
}
|
|
250
|
-
// Start typing indicator
|
|
251
|
-
const typingInterval = setInterval(() => {
|
|
252
|
-
if ('sendTyping' in message.channel) {
|
|
253
|
-
message.channel.sendTyping().catch(() => { });
|
|
254
|
-
}
|
|
255
|
-
}, 5000);
|
|
256
|
-
if ('sendTyping' in message.channel) {
|
|
257
|
-
await message.channel.sendTyping();
|
|
258
|
-
}
|
|
259
|
-
// Add eyes emoji to indicate processing
|
|
260
|
-
try {
|
|
261
|
-
await message.react('👀');
|
|
262
|
-
}
|
|
263
|
-
catch (err) {
|
|
264
|
-
console.warn('[Discord] Failed to add reaction emoji:', err instanceof Error ? err.message : err);
|
|
265
|
-
}
|
|
266
|
-
const channelHistory = (0, channel_history_js_1.getChannelHistory)();
|
|
267
|
-
// Build message history context for Claude (OpenClaw style)
|
|
268
|
-
const ownerHistoryUserIds = new Set(this.config.ownerUserId ? [this.config.ownerUserId] : []);
|
|
269
|
-
const historyContext = channelHistory.formatForContext(message.channel.id, message.id, undefined, { includeUserIds: ownerHistoryUserIds });
|
|
270
|
-
if (historyContext) {
|
|
271
|
-
console.log(`[Discord] Built historyContext (${historyContext.length} chars):`, historyContext.substring(0, 200));
|
|
272
|
-
}
|
|
273
|
-
else {
|
|
274
|
-
console.log(`[Discord] No historyContext - empty history`);
|
|
275
|
-
}
|
|
276
|
-
// Get channel name for session display
|
|
277
|
-
const channelName = this.getChannelDisplayName(message);
|
|
278
|
-
// Normalize message for router - ALL messages go to Claude
|
|
279
|
-
const normalizedMessage = {
|
|
280
|
-
source: 'discord',
|
|
281
|
-
channelId: message.channel.id,
|
|
282
|
-
channelName,
|
|
283
|
-
userId: message.author.id,
|
|
284
|
-
text: cleanContent,
|
|
285
|
-
principal,
|
|
286
|
-
contentBlocks: attachmentInfo.contentBlocks.length > 0 ? attachmentInfo.contentBlocks : undefined,
|
|
287
|
-
metadata: {
|
|
288
|
-
guildId: message.guild?.id,
|
|
289
|
-
username: message.author.username,
|
|
290
|
-
messageId: message.id,
|
|
291
|
-
historyContext,
|
|
292
|
-
attachments: attachmentInfo.effectiveAttachments.length > 0
|
|
293
|
-
? attachmentInfo.effectiveAttachments
|
|
294
|
-
: undefined,
|
|
295
|
-
},
|
|
296
|
-
};
|
|
297
|
-
// 3. Dispatch to agent
|
|
298
|
-
let processingSuccess = false;
|
|
299
|
-
try {
|
|
300
|
-
await this.dispatchToAgent(message, cleanContent, normalizedMessage, attachmentInfo);
|
|
301
|
-
processingSuccess = true;
|
|
302
|
-
}
|
|
303
|
-
catch (error) {
|
|
304
|
-
console.error('[Discord] Message processing failed:', error);
|
|
305
|
-
processingSuccess = false;
|
|
306
|
-
throw error;
|
|
307
|
-
}
|
|
308
|
-
finally {
|
|
309
|
-
clearInterval(typingInterval);
|
|
310
|
-
// Add conditional reaction based on processing success
|
|
311
|
-
try {
|
|
312
|
-
await message.react(processingSuccess ? '✅' : '❌');
|
|
313
|
-
}
|
|
314
|
-
catch {
|
|
315
|
-
/* ignore reaction errors */
|
|
316
|
-
}
|
|
317
|
-
}
|
|
63
|
+
this.connected = false;
|
|
64
|
+
await this.client.destroy();
|
|
65
|
+
this.emitEvent({ type: 'disconnected', source: this.source, timestamp: new Date() });
|
|
318
66
|
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
* Returns null if the message was fully handled (bot-to-bot routing)
|
|
322
|
-
* or should be ignored, or classification info for further processing.
|
|
323
|
-
*/
|
|
324
|
-
async classifyMessage(message) {
|
|
325
|
-
// Agent-bot message classification was here: it recorded cross-agent chatter into a
|
|
326
|
-
// shared context and routed mention-delegation between bots. Removed with the
|
|
327
|
-
// multi-bot handler, which never ran on this install.
|
|
328
|
-
// Ignore other bot messages (not part of our multi-agent system)
|
|
329
|
-
if (message.author.bot)
|
|
330
|
-
return null;
|
|
331
|
-
return { handled: false, isBot: false };
|
|
67
|
+
recentDeliveredMessageRefs() {
|
|
68
|
+
return this.ledger.recentDeliveredMessageRefs();
|
|
332
69
|
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
*/
|
|
336
|
-
async collectAttachments(message, cleanContent) {
|
|
337
|
-
// Download all attachments (images, documents, etc.)
|
|
338
|
-
const attachments = [];
|
|
339
|
-
for (const [, attachment] of message.attachments) {
|
|
70
|
+
async recoverPendingResponses() {
|
|
71
|
+
for (const entry of this.ledger.listUndelivered()) {
|
|
340
72
|
try {
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
catch (err) {
|
|
354
|
-
console.error(`[Discord] Failed to download attachment: ${err}`);
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
// Record to channel history (always, for context)
|
|
358
|
-
const channelHistory = (0, channel_history_js_1.getChannelHistory)();
|
|
359
|
-
const historyEntry = {
|
|
360
|
-
messageId: message.id,
|
|
361
|
-
sender: message.author.username,
|
|
362
|
-
userId: message.author.id,
|
|
363
|
-
body: this.cleanMessageContent(message.content),
|
|
364
|
-
timestamp: Date.now(),
|
|
365
|
-
attachments: attachments.length > 0 ? attachments : undefined,
|
|
366
|
-
isBot: false,
|
|
367
|
-
};
|
|
368
|
-
channelHistory.record(message.channel.id, historyEntry);
|
|
369
|
-
console.log(`[Discord] Recorded to history: ${message.channel.id} (${channelHistory.getHistory(message.channel.id).length} entries)`);
|
|
370
|
-
// Get attachments from history if current message has none
|
|
371
|
-
// Only reuse attachments if message contains action keywords (translate, analyze, etc.)
|
|
372
|
-
let effectiveAttachments = attachments;
|
|
373
|
-
if (attachments.length === 0) {
|
|
374
|
-
const lowerContent = cleanContent.toLowerCase();
|
|
375
|
-
const isMetaQuestion = lowerContent.includes('품질') ||
|
|
376
|
-
lowerContent.includes('어때') ||
|
|
377
|
-
lowerContent.includes('어떤가') ||
|
|
378
|
-
lowerContent.includes('어떻') ||
|
|
379
|
-
lowerContent.includes('결과') ||
|
|
380
|
-
lowerContent.includes('quality') ||
|
|
381
|
-
lowerContent.includes('how') ||
|
|
382
|
-
lowerContent.includes('result') ||
|
|
383
|
-
lowerContent.includes('어떠') ||
|
|
384
|
-
lowerContent.match(/어때[??]/) ||
|
|
385
|
-
lowerContent.match(/어떤가[??]/);
|
|
386
|
-
const hasActionKeyword = lowerContent.includes('번역') ||
|
|
387
|
-
lowerContent.includes('translate') ||
|
|
388
|
-
lowerContent.includes('분석') ||
|
|
389
|
-
lowerContent.includes('analyze') ||
|
|
390
|
-
lowerContent.includes('읽어') ||
|
|
391
|
-
lowerContent.includes('read') ||
|
|
392
|
-
lowerContent.includes('뭐라') ||
|
|
393
|
-
lowerContent.includes('무슨말');
|
|
394
|
-
if (hasActionKeyword && !isMetaQuestion) {
|
|
395
|
-
const historyAttachments = channelHistory.getRecentAttachments(message.channel.id, message.author.id);
|
|
396
|
-
if (historyAttachments.length > 0) {
|
|
397
|
-
effectiveAttachments = historyAttachments;
|
|
398
|
-
console.log(`[Discord] Using ${historyAttachments.length} attachments from history (action keyword detected)`);
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
else if (hasActionKeyword && isMetaQuestion) {
|
|
402
|
-
console.log(`[Discord] Action keyword found but meta question detected - NOT reusing attachments`);
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
// Convert attachments to content blocks (OpenClaw-style)
|
|
406
|
-
const contentBlocks = await (0, attachment_utils_js_1.buildContentBlocks)(effectiveAttachments);
|
|
407
|
-
return { attachments, effectiveAttachments, contentBlocks };
|
|
408
|
-
}
|
|
409
|
-
/**
|
|
410
|
-
* Dispatch message to multi-agent or single-agent processing.
|
|
411
|
-
*/
|
|
412
|
-
async dispatchToAgent(message, cleanContent, normalizedMessage, _attachmentInfo) {
|
|
413
|
-
// Enrich content with file reference text blocks for multi-agent (text-only)
|
|
414
|
-
let enrichedContent = cleanContent;
|
|
415
|
-
const fileRefTexts = normalizedMessage.contentBlocks
|
|
416
|
-
?.filter((b) => b.type === 'text' && b.text?.startsWith('[File:'))
|
|
417
|
-
.map((b) => b.text);
|
|
418
|
-
if (fileRefTexts && fileRefTexts.length > 0) {
|
|
419
|
-
enrichedContent = `${cleanContent}\n\n${fileRefTexts.join('\n')}`;
|
|
420
|
-
}
|
|
421
|
-
// Pre-analyze images before routing (multi-agent handler only gets text)
|
|
422
|
-
let imagesWerePreAnalyzed = false;
|
|
423
|
-
if (normalizedMessage.contentBlocks?.some((b) => b.type === 'image')) {
|
|
424
|
-
const { getImageAnalyzer, shouldUseClaudeImagePreanalysis } = await import('./image-analyzer.js');
|
|
425
|
-
if (shouldUseClaudeImagePreanalysis()) {
|
|
426
|
-
imagesWerePreAnalyzed = true;
|
|
427
|
-
const analysisText = await getImageAnalyzer().processContentBlocks(normalizedMessage.contentBlocks);
|
|
428
|
-
if (analysisText) {
|
|
429
|
-
enrichedContent = `${enrichedContent}\n\n${analysisText}`;
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
// Multi-agent routing was here: it owned the message and never fell through to the
|
|
434
|
-
// message router. Removed with the handler - single-agent processing below is now
|
|
435
|
-
// the only path, which is what every message on this install has taken anyway.
|
|
436
|
-
// Regular single-agent processing
|
|
437
|
-
// Pass enriched content (images already analyzed above) to avoid double analysis
|
|
438
|
-
if (enrichedContent !== cleanContent) {
|
|
439
|
-
normalizedMessage.text = enrichedContent;
|
|
440
|
-
}
|
|
441
|
-
// Clear only when Claude already converted the image to text. Cline/Codex
|
|
442
|
-
// retain the original block for their configured native media path.
|
|
443
|
-
if (imagesWerePreAnalyzed && normalizedMessage.contentBlocks?.some((b) => b.type === 'image')) {
|
|
444
|
-
normalizedMessage.contentBlocks = undefined;
|
|
445
|
-
}
|
|
446
|
-
// Create tool status tracker for real-time progress
|
|
447
|
-
const discordAdapter = {
|
|
448
|
-
postPlaceholder: async (content) => {
|
|
449
|
-
if ('send' in message.channel) {
|
|
450
|
-
const sent = await message.channel.send(content);
|
|
451
|
-
return sent.id;
|
|
452
|
-
}
|
|
453
|
-
return null;
|
|
454
|
-
},
|
|
455
|
-
editPlaceholder: async (handle, content) => {
|
|
456
|
-
try {
|
|
457
|
-
const msg = await message.channel.messages.fetch(handle);
|
|
458
|
-
await msg.edit(content);
|
|
73
|
+
const channel = entry.deliveryTarget?.startsWith('discord:')
|
|
74
|
+
? entry.deliveryTarget.slice('discord:'.length)
|
|
75
|
+
: '';
|
|
76
|
+
const source = entry.key.startsWith('discord:');
|
|
77
|
+
const outbound = entry.key.startsWith('outbound:') || entry.key.startsWith('file:');
|
|
78
|
+
if ((!source && !outbound) ||
|
|
79
|
+
!channel ||
|
|
80
|
+
!this.options.config.allowedChannels.includes(channel))
|
|
81
|
+
continue;
|
|
82
|
+
if (entry.deliveryUncertain) {
|
|
83
|
+
this.log(`discord delivery requires reconciliation key=${entry.key}`);
|
|
84
|
+
continue;
|
|
459
85
|
}
|
|
460
|
-
|
|
461
|
-
|
|
86
|
+
if (source && entry.state === 'processing' && !this.intake.isPending?.(entry.key)) {
|
|
87
|
+
this.ledger.markReady(entry.key, INTERRUPTED_RESPONSE);
|
|
88
|
+
await this.deliverResponse(entry.key, INTERRUPTED_RESPONSE);
|
|
462
89
|
}
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
90
|
+
else if (entry.state === 'ready' && entry.response !== undefined) {
|
|
91
|
+
if (source)
|
|
92
|
+
await this.deliverResponse(entry.key, entry.response);
|
|
93
|
+
else
|
|
94
|
+
await this.runInDestination(channel, () => this.sendChunks(channel, entry.key, entry.response));
|
|
468
95
|
}
|
|
469
|
-
catch {
|
|
470
|
-
/* ignore */
|
|
471
|
-
}
|
|
472
|
-
},
|
|
473
|
-
};
|
|
474
|
-
const tracker = new tool_status_tracker_js_1.ToolStatusTracker(discordAdapter, {
|
|
475
|
-
throttleMs: 3000,
|
|
476
|
-
initialDelayMs: 5000,
|
|
477
|
-
});
|
|
478
|
-
const streamCallbacks = tracker.toStreamCallbacks();
|
|
479
|
-
let routerResult;
|
|
480
|
-
try {
|
|
481
|
-
routerResult = await this.turnProcessor.processTurn(normalizedMessage, {
|
|
482
|
-
onStream: streamCallbacks,
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
finally {
|
|
486
|
-
await tracker.cleanup();
|
|
487
|
-
}
|
|
488
|
-
if (routerResult.outcome === 'external_divert') {
|
|
489
|
-
discordLogger.info('[Discord] Turn externally diverted; no response sent');
|
|
490
|
-
return;
|
|
491
|
-
}
|
|
492
|
-
const response = routerResult.response;
|
|
493
|
-
const duration = routerResult.duration;
|
|
494
|
-
await this.sendResponse(message, response);
|
|
495
|
-
this.emitEvent({
|
|
496
|
-
type: 'message_sent',
|
|
497
|
-
source: 'discord',
|
|
498
|
-
timestamp: new Date(),
|
|
499
|
-
data: {
|
|
500
|
-
channelId: message.channel.id,
|
|
501
|
-
responseLength: response.length,
|
|
502
|
-
duration,
|
|
503
|
-
},
|
|
504
|
-
});
|
|
505
|
-
// Keep attachments in history for reference in subsequent turns
|
|
506
|
-
// (localPath allows "that image" references to work)
|
|
507
|
-
console.log(`[Discord] Kept attachments for future reference: ${message.channel.id}`);
|
|
508
|
-
}
|
|
509
|
-
/**
|
|
510
|
-
* Check if bot should respond to this message
|
|
511
|
-
*/
|
|
512
|
-
shouldRespond(message, isDM, isMentioned) {
|
|
513
|
-
// Always respond to DMs
|
|
514
|
-
if (isDM)
|
|
515
|
-
return true;
|
|
516
|
-
// For guild messages, check configuration
|
|
517
|
-
const guildId = message.guild?.id;
|
|
518
|
-
const channelId = message.channel.id;
|
|
519
|
-
console.log(`[Discord] shouldRespond check - guildId: ${guildId}, channelId: ${channelId}`);
|
|
520
|
-
console.log(`[Discord] guilds config:`, JSON.stringify(this.config.guilds, null, 2));
|
|
521
|
-
if (!guildId)
|
|
522
|
-
return false;
|
|
523
|
-
// Get guild config (or wildcard config)
|
|
524
|
-
const guildConfig = this.config.guilds?.[String(guildId)] || this.config.guilds?.['*'];
|
|
525
|
-
console.log(`[Discord] guildConfig:`, JSON.stringify(guildConfig, null, 2));
|
|
526
|
-
if (!guildConfig) {
|
|
527
|
-
// No config for this guild, only respond to mentions
|
|
528
|
-
return isMentioned;
|
|
529
|
-
}
|
|
530
|
-
// Get channel config
|
|
531
|
-
const channelConfig = guildConfig.channels?.[String(channelId)] || guildConfig.channels?.['*'];
|
|
532
|
-
if (channelConfig) {
|
|
533
|
-
// Channel-specific config
|
|
534
|
-
if (channelConfig.requireMention === false) {
|
|
535
|
-
return true; // No mention required for this channel
|
|
536
96
|
}
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
if (guildConfig.requireMention === false) {
|
|
541
|
-
return true;
|
|
542
|
-
}
|
|
543
|
-
return isMentioned;
|
|
544
|
-
}
|
|
545
|
-
/**
|
|
546
|
-
* Clean message content (remove mentions)
|
|
547
|
-
*/
|
|
548
|
-
cleanMessageContent(content) {
|
|
549
|
-
return content
|
|
550
|
-
.replace(/<@!?\d+>/g, '')
|
|
551
|
-
.replace(/<@&\d+>/g, '') // Role mentions
|
|
552
|
-
.trim();
|
|
553
|
-
}
|
|
554
|
-
/**
|
|
555
|
-
* Edit message with 150ms throttle to respect Discord rate limits
|
|
556
|
-
*/
|
|
557
|
-
async editMessageThrottled(message, content) {
|
|
558
|
-
this.pendingEdit = content;
|
|
559
|
-
const now = Date.now();
|
|
560
|
-
const timeSinceLastEdit = now - this.lastEditTime;
|
|
561
|
-
if (timeSinceLastEdit >= 150) {
|
|
562
|
-
await this.flushEdit(message);
|
|
563
|
-
}
|
|
564
|
-
else if (!this.editTimer) {
|
|
565
|
-
const delay = 150 - timeSinceLastEdit;
|
|
566
|
-
this.editTimer = setTimeout(() => this.flushEdit(message), delay);
|
|
97
|
+
catch (error) {
|
|
98
|
+
this.log(`discord recovery failed key=${entry.key} error=${error instanceof Error ? error.message : String(error)}`);
|
|
99
|
+
}
|
|
567
100
|
}
|
|
568
101
|
}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
if (!
|
|
102
|
+
async deliverResponse(sourceRef, response) {
|
|
103
|
+
const channelId = sourceRefChannel(sourceRef, 'discord');
|
|
104
|
+
this.requireAllowed(channelId);
|
|
105
|
+
const entry = this.ledger.get(sourceRef);
|
|
106
|
+
if (!entry)
|
|
107
|
+
throw new Error(`Discord response has no accepted message ${sourceRef}`);
|
|
108
|
+
if (entry.deliveryTarget !== `discord:${channelId}`)
|
|
109
|
+
throw new Error('Discord response destination conflicts with its accepted message');
|
|
110
|
+
if (entry.state === 'delivered')
|
|
574
111
|
return;
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
this.
|
|
578
|
-
this.editTimer = null;
|
|
112
|
+
if (entry.state === 'processing')
|
|
113
|
+
this.ledger.markReady(sourceRef, response);
|
|
114
|
+
await this.runInDestination(channelId, () => this.sendChunks(channelId, sourceRef, response));
|
|
579
115
|
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
if ((0, node_fs_1.existsSync)(filePath)) {
|
|
597
|
-
filePaths.push(filePath);
|
|
598
|
-
console.log(`[Discord] Found file via marker: ${filePath}`);
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
// Find outbound media files
|
|
602
|
-
while ((match = outboundPattern.exec(response)) !== null) {
|
|
603
|
-
const filePath = cleanPath(match[0]);
|
|
604
|
-
if ((0, node_fs_1.existsSync)(filePath) && !filePaths.includes(filePath)) {
|
|
605
|
-
filePaths.push(filePath);
|
|
606
|
-
console.log(`[Discord] Found outbound file: ${filePath}`);
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
// Build attachments
|
|
610
|
-
const attachments = filePaths.map((fp) => new discord_js_1.AttachmentBuilder(fp));
|
|
611
|
-
if (attachments.length > 0) {
|
|
612
|
-
console.log(`[Discord] Attaching ${attachments.length} file(s): ${filePaths.join(', ')}`);
|
|
613
|
-
}
|
|
614
|
-
const chunks = (0, message_splitter_js_1.splitForDiscord)(response);
|
|
615
|
-
for (let i = 0; i < chunks.length; i++) {
|
|
616
|
-
let sentMessage;
|
|
617
|
-
// Attach files to the first message only
|
|
618
|
-
const messageOptions = i === 0 && attachments.length > 0
|
|
619
|
-
? { content: chunks[i], files: attachments }
|
|
620
|
-
: { content: chunks[i] };
|
|
621
|
-
if (i === 0) {
|
|
622
|
-
sentMessage = await originalMessage.reply(messageOptions);
|
|
623
|
-
}
|
|
624
|
-
else {
|
|
625
|
-
if ('send' in originalMessage.channel) {
|
|
626
|
-
sentMessage = await originalMessage.channel.send(messageOptions);
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
if (sentMessage && this.client.user) {
|
|
630
|
-
const history = (0, channel_history_js_1.getChannelHistory)();
|
|
631
|
-
history.record(originalMessage.channel.id, {
|
|
632
|
-
messageId: sentMessage.id,
|
|
633
|
-
sender: this.client.user.username,
|
|
634
|
-
userId: this.client.user.id,
|
|
635
|
-
body: chunks[i],
|
|
636
|
-
timestamp: Date.now(),
|
|
637
|
-
isBot: true,
|
|
638
|
-
});
|
|
639
|
-
}
|
|
116
|
+
async sendMessage(channelId, text, idempotencyKey) {
|
|
117
|
+
this.requireConnected();
|
|
118
|
+
this.requireAllowed(channelId);
|
|
119
|
+
const key = `outbound:${(0, node_crypto_1.createHash)('sha256')
|
|
120
|
+
.update(`text\0${idempotencyKey ?? `${channelId}:${text}`}`)
|
|
121
|
+
.digest('hex')}`;
|
|
122
|
+
const claim = this.ledger.claim(key, {
|
|
123
|
+
deliveryTarget: `discord:${channelId}`,
|
|
124
|
+
payloadIdentity: (0, node_crypto_1.createHash)('sha256').update(text).digest('hex'),
|
|
125
|
+
keepDeliveredOnPayloadChange: true,
|
|
126
|
+
...(idempotencyKey ? { idempotencyKey } : {}),
|
|
127
|
+
});
|
|
128
|
+
if (!claim.claimed) {
|
|
129
|
+
if (claim.entry.state === 'delivered')
|
|
130
|
+
return;
|
|
131
|
+
throw new Error('Discord message delivery is already in progress or uncertain');
|
|
640
132
|
}
|
|
133
|
+
this.ledger.markReady(key, text);
|
|
134
|
+
await this.runInDestination(channelId, () => this.sendChunks(channelId, key, text));
|
|
641
135
|
}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
// DM channel
|
|
648
|
-
if (channel.isDMBased()) {
|
|
649
|
-
const recipient = message.author.username;
|
|
650
|
-
return `DM with ${recipient}`;
|
|
651
|
-
}
|
|
652
|
-
// Guild channel - try to get the name
|
|
653
|
-
if ('name' in channel && channel.name) {
|
|
654
|
-
const guildName = message.guild?.name;
|
|
655
|
-
return guildName ? `#${channel.name} (${guildName})` : `#${channel.name}`;
|
|
656
|
-
}
|
|
657
|
-
// Fallback to channel ID
|
|
658
|
-
return `Channel ${channel.id}`;
|
|
136
|
+
async sendToOwner(text, idempotencyKey) {
|
|
137
|
+
const channel = this.options.config.ownerChannelId;
|
|
138
|
+
if (!channel)
|
|
139
|
+
throw new Error('discord.owner_channel_id is required');
|
|
140
|
+
await this.sendMessage(channel, text, idempotencyKey);
|
|
659
141
|
}
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
142
|
+
async sendFile(path, caption, operationId) {
|
|
143
|
+
this.requireConnected();
|
|
144
|
+
if (!operationId.trim())
|
|
145
|
+
throw new Error('Discord file operation id is required');
|
|
146
|
+
const channel = this.options.config.ownerChannelId;
|
|
147
|
+
if (!channel)
|
|
148
|
+
throw new Error('discord.owner_channel_id is required');
|
|
149
|
+
this.requireAllowed(channel);
|
|
150
|
+
if (!this.options.filesRoot)
|
|
151
|
+
throw new Error('Discord workspace files root is not configured');
|
|
152
|
+
const file = (0, file_delivery_js_1.openWorkspaceFile)(this.options.filesRoot, path);
|
|
665
153
|
try {
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
const
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
continue;
|
|
678
|
-
// Try to find the channel in the client cache
|
|
679
|
-
const channel = this.client.channels.cache.get(session.channelId);
|
|
680
|
-
if (!channel)
|
|
681
|
-
continue;
|
|
682
|
-
let channelName;
|
|
683
|
-
// DM channel
|
|
684
|
-
if (channel.isDMBased()) {
|
|
685
|
-
channelName = 'DM';
|
|
686
|
-
}
|
|
687
|
-
else if ('name' in channel && channel.name) {
|
|
688
|
-
// Guild channel
|
|
689
|
-
const guild = 'guild' in channel ? channel.guild : undefined;
|
|
690
|
-
channelName = guild ? `#${channel.name} (${guild.name})` : `#${channel.name}`;
|
|
691
|
-
}
|
|
692
|
-
else {
|
|
693
|
-
continue; // Can't determine name
|
|
694
|
-
}
|
|
695
|
-
// Update session with channel name
|
|
696
|
-
if (router.updateChannelName('discord', session.channelId, channelName)) {
|
|
697
|
-
updated++;
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
if (updated > 0) {
|
|
701
|
-
console.log(`[Discord] Backfilled ${updated} channel names`);
|
|
154
|
+
const identity = (0, file_delivery_js_1.workspaceFileIdentity)(file.fd, caption);
|
|
155
|
+
const key = `file:${operationId}`;
|
|
156
|
+
const claim = this.ledger.claim(key, {
|
|
157
|
+
deliveryTarget: `discord:${channel}`,
|
|
158
|
+
payloadIdentity: identity,
|
|
159
|
+
idempotencyKey: operationId,
|
|
160
|
+
});
|
|
161
|
+
if (!claim.claimed) {
|
|
162
|
+
if (claim.entry.state === 'delivered')
|
|
163
|
+
return { sentAs: file.sentAs, size: file.size, idempotent: true };
|
|
164
|
+
throw new Error('Discord file delivery is already in progress or uncertain');
|
|
702
165
|
}
|
|
166
|
+
const target = await this.client.channels.fetch(channel);
|
|
167
|
+
if (!target?.isSendable())
|
|
168
|
+
throw new Error('Discord target channel cannot receive messages');
|
|
169
|
+
const sent = await this.runInDestination(channel, () => target.send({
|
|
170
|
+
content: caption,
|
|
171
|
+
files: [new discord_js_1.AttachmentBuilder((0, node_fs_1.readFileSync)(file.fd), { name: (0, node_path_1.basename)(file.path) })],
|
|
172
|
+
}));
|
|
173
|
+
this.ledger.markDelivered(key);
|
|
174
|
+
return { messageId: sent.id, sentAs: file.sentAs, size: file.size };
|
|
703
175
|
}
|
|
704
176
|
catch (error) {
|
|
705
|
-
|
|
177
|
+
if (this.ledger.get(`file:${operationId}`)?.state === 'processing')
|
|
178
|
+
this.ledger.markFailed(`file:${operationId}`);
|
|
179
|
+
throw error;
|
|
706
180
|
}
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
// Gateway Interface Implementation
|
|
710
|
-
// ============================================================================
|
|
711
|
-
/**
|
|
712
|
-
* Start the Discord gateway
|
|
713
|
-
*/
|
|
714
|
-
async start() {
|
|
715
|
-
if (this.connected) {
|
|
716
|
-
console.log('Discord gateway already connected');
|
|
717
|
-
return;
|
|
181
|
+
finally {
|
|
182
|
+
(0, node_fs_1.closeSync)(file.fd);
|
|
718
183
|
}
|
|
719
|
-
await this.client.login(this.token);
|
|
720
184
|
}
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
185
|
+
async accept(message) {
|
|
186
|
+
const channel = message.channelId;
|
|
187
|
+
const user = message.author.id;
|
|
188
|
+
if (message.author.bot ||
|
|
189
|
+
!this.options.config.allowedChannels.includes(channel) ||
|
|
190
|
+
!this.options.config.ownerUserIds.includes(user)) {
|
|
191
|
+
this.log(`discord message dropped reason=non_owner channel_hash=${hash('channel', channel)} sender_hash=${hash('sender', user)}`);
|
|
726
192
|
return;
|
|
727
193
|
}
|
|
728
|
-
|
|
729
|
-
this.
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
// ============================================================================
|
|
737
|
-
// Configuration
|
|
738
|
-
// ============================================================================
|
|
739
|
-
/**
|
|
740
|
-
* Update gateway configuration
|
|
741
|
-
*/
|
|
742
|
-
setConfig(config) {
|
|
743
|
-
if (config.guilds) {
|
|
744
|
-
this.config.guilds = { ...this.config.guilds, ...config.guilds };
|
|
194
|
+
const ref = `discord:${channel}:${message.id}`;
|
|
195
|
+
if (this.activeInputs.has(ref))
|
|
196
|
+
return;
|
|
197
|
+
const existing = this.ledger.get(ref);
|
|
198
|
+
if (existing) {
|
|
199
|
+
if (existing.state === 'ready')
|
|
200
|
+
await this.deliverResponse(ref, existing.response ?? '');
|
|
201
|
+
return;
|
|
745
202
|
}
|
|
746
|
-
if (
|
|
747
|
-
|
|
203
|
+
if (!message.content.trim() && !message.attachments.size)
|
|
204
|
+
return;
|
|
205
|
+
const identity = (0, node_crypto_1.createHash)('sha256')
|
|
206
|
+
.update(`${message.content}\0${[...message.attachments.values()]
|
|
207
|
+
.map((item) => item.id)
|
|
208
|
+
.sort()
|
|
209
|
+
.join(',')}`)
|
|
210
|
+
.digest('hex');
|
|
211
|
+
this.ledger.claim(ref, { deliveryTarget: `discord:${channel}`, payloadIdentity: identity });
|
|
212
|
+
this.activeInputs.add(ref);
|
|
213
|
+
try {
|
|
214
|
+
const attachments = await Promise.all([...message.attachments.values()].map(async (attachment) => {
|
|
215
|
+
let name = attachment.name || attachment.id;
|
|
216
|
+
try {
|
|
217
|
+
name = (0, attachment_actions_js_1.safeFileName)(name);
|
|
218
|
+
if (!this.options.downloadsDir)
|
|
219
|
+
throw new Error('Attachment downloads directory is not configured');
|
|
220
|
+
const response = await fetch(attachment.url, { signal: AbortSignal.timeout(60_000) });
|
|
221
|
+
if (!response.ok)
|
|
222
|
+
throw new Error(`Discord attachment download failed (HTTP ${response.status})`);
|
|
223
|
+
const path = (0, node_path_1.join)(this.options.downloadsDir, 'discord', `${message.id}_${attachment.id}_${name}`);
|
|
224
|
+
const size = await (0, attachment_io_js_1.saveResponseBody)(response, path);
|
|
225
|
+
return {
|
|
226
|
+
name,
|
|
227
|
+
path,
|
|
228
|
+
size,
|
|
229
|
+
...(attachment.contentType ? { mimeType: attachment.contentType } : {}),
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
return { name, error: error instanceof Error ? error.message : String(error) };
|
|
234
|
+
}
|
|
235
|
+
}));
|
|
236
|
+
const input = {
|
|
237
|
+
id: ref,
|
|
238
|
+
channelKey: channel,
|
|
239
|
+
occurredAt: message.createdTimestamp,
|
|
240
|
+
text: message.content.trim() || attachments.map((file) => `[file: ${file.name}]`).join('\n'),
|
|
241
|
+
...(attachments.length ? { payload: { attachments } } : {}),
|
|
242
|
+
};
|
|
243
|
+
this.intake.acceptOwnerMessage(input);
|
|
244
|
+
this.emitEvent({
|
|
245
|
+
type: 'message_received',
|
|
246
|
+
source: this.source,
|
|
247
|
+
timestamp: new Date(message.createdTimestamp),
|
|
248
|
+
data: { sourceMessageRef: ref },
|
|
249
|
+
});
|
|
748
250
|
}
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
* Get current configuration
|
|
752
|
-
*/
|
|
753
|
-
getConfig() {
|
|
754
|
-
return { ...this.config };
|
|
755
|
-
}
|
|
756
|
-
/**
|
|
757
|
-
* Add guild configuration
|
|
758
|
-
*/
|
|
759
|
-
addGuildConfig(guildId, config) {
|
|
760
|
-
this.config.guilds = this.config.guilds || {};
|
|
761
|
-
this.config.guilds[guildId] = config;
|
|
762
|
-
}
|
|
763
|
-
/**
|
|
764
|
-
* Add channel configuration
|
|
765
|
-
*/
|
|
766
|
-
addChannelConfig(guildId, channelId, config) {
|
|
767
|
-
this.config.guilds = this.config.guilds || {};
|
|
768
|
-
if (!this.config.guilds[guildId]) {
|
|
769
|
-
this.config.guilds[guildId] = { channels: {} };
|
|
251
|
+
finally {
|
|
252
|
+
this.activeInputs.delete(ref);
|
|
770
253
|
}
|
|
771
|
-
this.config.guilds[guildId].channels = this.config.guilds[guildId].channels || {};
|
|
772
|
-
this.config.guilds[guildId].channels[channelId] = config;
|
|
773
254
|
}
|
|
774
|
-
async
|
|
775
|
-
const
|
|
255
|
+
async sendChunks(channelId, key, text) {
|
|
256
|
+
const entry = this.ledger.get(key);
|
|
257
|
+
if (entry.deliveryUncertain)
|
|
258
|
+
throw new Error('Discord response delivery is uncertain');
|
|
259
|
+
const channel = await this.client.channels.fetch(channelId);
|
|
260
|
+
if (!channel?.isSendable())
|
|
261
|
+
throw new Error('Discord target channel cannot receive messages');
|
|
262
|
+
const chunks = (0, message_splitter_js_1.splitForDiscord)(text);
|
|
263
|
+
for (let i = entry.nextChunkIndex ?? 0; i < chunks.length; i++) {
|
|
264
|
+
this.ledger.markDeliveryProgress(key, i, true);
|
|
776
265
|
try {
|
|
777
|
-
const
|
|
778
|
-
|
|
779
|
-
return null;
|
|
780
|
-
}
|
|
781
|
-
return {
|
|
782
|
-
channelId: targetChannelId,
|
|
783
|
-
send: channel.send.bind(channel),
|
|
784
|
-
};
|
|
266
|
+
const sent = await channel.send(chunks[i]);
|
|
267
|
+
this.ledger.markDeliveryProgress(key, i + 1, false, sent.id);
|
|
785
268
|
}
|
|
786
269
|
catch (error) {
|
|
787
|
-
|
|
788
|
-
error !== null &&
|
|
789
|
-
error.code === 10003) {
|
|
790
|
-
return null;
|
|
791
|
-
}
|
|
270
|
+
this.ledger.markDeliveryProgress(key, i, true);
|
|
792
271
|
throw error;
|
|
793
272
|
}
|
|
794
|
-
};
|
|
795
|
-
const direct = await tryResolve(channelId);
|
|
796
|
-
if (direct) {
|
|
797
|
-
return direct;
|
|
798
273
|
}
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
throw new Error(`Channel not found: ${channelId}`);
|
|
274
|
+
this.ledger.markDelivered(key);
|
|
275
|
+
this.emitEvent({
|
|
276
|
+
type: 'message_sent',
|
|
277
|
+
source: this.source,
|
|
278
|
+
timestamp: new Date(),
|
|
279
|
+
data: { sourceMessageRef: key },
|
|
280
|
+
});
|
|
807
281
|
}
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
282
|
+
async runInDestination(destination, work) {
|
|
283
|
+
const previous = this.deliveryTails.get(destination) ?? Promise.resolve();
|
|
284
|
+
let release;
|
|
285
|
+
const gate = new Promise((resolve) => {
|
|
286
|
+
release = resolve;
|
|
287
|
+
});
|
|
288
|
+
const tail = previous.then(() => gate);
|
|
289
|
+
this.deliveryTails.set(destination, tail);
|
|
290
|
+
await previous;
|
|
291
|
+
try {
|
|
292
|
+
return await work();
|
|
814
293
|
}
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
294
|
+
finally {
|
|
295
|
+
release();
|
|
296
|
+
if (this.deliveryTails.get(destination) === tail)
|
|
297
|
+
this.deliveryTails.delete(destination);
|
|
819
298
|
}
|
|
820
299
|
}
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
async sendFile(channelId, filePath, caption) {
|
|
825
|
-
if (!this.connected) {
|
|
826
|
-
throw new Error('Discord gateway not connected');
|
|
827
|
-
}
|
|
828
|
-
const channel = await this.resolveSendChannel(channelId);
|
|
829
|
-
await channel.send({
|
|
830
|
-
content: caption,
|
|
831
|
-
files: [filePath],
|
|
832
|
-
});
|
|
300
|
+
requireAllowed(channel) {
|
|
301
|
+
if (!this.options.config.allowedChannels.includes(channel))
|
|
302
|
+
throw new Error('Discord destination is not allowlisted');
|
|
833
303
|
}
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
*/
|
|
838
|
-
async sendImage(channelId, imagePath, caption) {
|
|
839
|
-
return this.sendFile(channelId, imagePath, caption);
|
|
304
|
+
requireConnected() {
|
|
305
|
+
if (!this.connected)
|
|
306
|
+
throw new Error('Discord gateway not connected');
|
|
840
307
|
}
|
|
841
308
|
}
|
|
842
309
|
exports.DiscordGateway = DiscordGateway;
|
|
310
|
+
const INTERRUPTED_RESPONSE = 'The previous processing attempt was interrupted. It was not rerun because its external side effects could not be proven safe to repeat. Please send a new message if you want to retry it.';
|
|
311
|
+
function hash(kind, value) {
|
|
312
|
+
return (0, node_crypto_1.createHash)('sha256').update(`${kind}\0${value}`).digest('hex');
|
|
313
|
+
}
|
|
314
|
+
function sourceRefChannel(value, source) {
|
|
315
|
+
const prefix = `${source}:`;
|
|
316
|
+
if (!value.startsWith(prefix))
|
|
317
|
+
throw new Error(`${source} source message reference is invalid`);
|
|
318
|
+
const parts = value.split(':');
|
|
319
|
+
if (parts.length !== 3)
|
|
320
|
+
throw new Error(`${source} source message reference is invalid`);
|
|
321
|
+
return parts[1];
|
|
322
|
+
}
|
|
843
323
|
//# sourceMappingURL=discord.js.map
|