agor-live 0.21.2 → 0.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/admin/add-to-branch-group.d.ts +2 -13
- package/dist/cli/commands/admin/add-to-branch-group.d.ts.map +1 -1
- package/dist/cli/commands/admin/add-to-branch-group.js +133 -33
- package/dist/cli/commands/admin/create-branch-group.d.ts +2 -13
- package/dist/cli/commands/admin/create-branch-group.d.ts.map +1 -1
- package/dist/cli/commands/admin/create-branch-group.js +132 -38
- package/dist/cli/commands/admin/create-symlink.d.ts +2 -14
- package/dist/cli/commands/admin/create-symlink.d.ts.map +1 -1
- package/dist/cli/commands/admin/create-symlink.js +138 -61
- package/dist/cli/commands/admin/delete-branch-group.d.ts +2 -13
- package/dist/cli/commands/admin/delete-branch-group.d.ts.map +1 -1
- package/dist/cli/commands/admin/delete-branch-group.js +132 -28
- package/dist/cli/commands/admin/delete-user.d.ts +2 -13
- package/dist/cli/commands/admin/delete-user.d.ts.map +1 -1
- package/dist/cli/commands/admin/delete-user.js +132 -38
- package/dist/cli/commands/admin/ensure-user.d.ts +2 -14
- package/dist/cli/commands/admin/ensure-user.d.ts.map +1 -1
- package/dist/cli/commands/admin/ensure-user.js +131 -46
- package/dist/cli/commands/admin/remove-from-branch-group.d.ts +2 -13
- package/dist/cli/commands/admin/remove-from-branch-group.d.ts.map +1 -1
- package/dist/cli/commands/admin/remove-from-branch-group.js +133 -33
- package/dist/cli/commands/admin/remove-symlink.d.ts +2 -14
- package/dist/cli/commands/admin/remove-symlink.d.ts.map +1 -1
- package/dist/cli/commands/admin/remove-symlink.js +136 -49
- package/dist/cli/commands/admin/scrub-git-remotes.d.ts +2 -2
- package/dist/cli/commands/admin/scrub-git-remotes.d.ts.map +1 -1
- package/dist/cli/commands/admin/scrub-git-remotes.js +128 -86
- package/dist/cli/commands/admin/sync-user-symlinks.d.ts +2 -14
- package/dist/cli/commands/admin/sync-user-symlinks.d.ts.map +1 -1
- package/dist/cli/commands/admin/sync-user-symlinks.js +132 -43
- package/dist/cli/commands/auth/whoami.d.ts.map +1 -1
- package/dist/cli/commands/auth/whoami.js +2 -1
- package/dist/cli/commands/branch/env/request.test.d.ts +2 -0
- package/dist/cli/commands/branch/env/request.test.d.ts.map +1 -0
- package/dist/cli/commands/branch/env/request.test.js +17723 -0
- package/dist/cli/commands/branch/env/restart.d.ts.map +1 -1
- package/dist/cli/commands/branch/env/restart.js +8 -2
- package/dist/cli/commands/branch/env/start.d.ts.map +1 -1
- package/dist/cli/commands/branch/env/start.js +8 -2
- package/dist/cli/commands/branch/env/stop.d.ts.map +1 -1
- package/dist/cli/commands/branch/env/stop.js +8 -2
- package/dist/cli/commands/daemon/status.d.ts.map +1 -1
- package/dist/cli/commands/daemon/status.js +2 -1
- package/dist/cli/commands/init.d.ts +6 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +140 -2
- package/dist/cli/commands/local/add-to-branch-group.d.ts +13 -0
- package/dist/cli/commands/local/add-to-branch-group.d.ts.map +1 -0
- package/dist/cli/commands/local/add-to-branch-group.js +37 -0
- package/dist/cli/commands/local/create-branch-group.d.ts +12 -0
- package/dist/cli/commands/local/create-branch-group.d.ts.map +1 -0
- package/dist/cli/commands/local/create-branch-group.js +35 -0
- package/dist/cli/commands/local/create-symlink.d.ts +14 -0
- package/dist/cli/commands/local/create-symlink.d.ts.map +1 -0
- package/dist/cli/commands/local/create-symlink.js +45 -0
- package/dist/cli/commands/{daemon → local/daemon}/sync.d.ts +1 -1
- package/dist/cli/commands/local/daemon/sync.d.ts.map +1 -0
- package/dist/cli/commands/{daemon → local/daemon}/sync.js +7 -6
- package/dist/cli/commands/local/delete-branch-group.d.ts +12 -0
- package/dist/cli/commands/local/delete-branch-group.d.ts.map +1 -0
- package/dist/cli/commands/local/delete-branch-group.js +35 -0
- package/dist/cli/commands/local/delete-user.d.ts +12 -0
- package/dist/cli/commands/local/delete-user.d.ts.map +1 -0
- package/dist/cli/commands/local/delete-user.js +36 -0
- package/dist/cli/commands/local/ensure-user.d.ts +12 -0
- package/dist/cli/commands/local/ensure-user.d.ts.map +1 -0
- package/dist/cli/commands/local/ensure-user.js +41 -0
- package/dist/cli/commands/local/remove-from-branch-group.d.ts +13 -0
- package/dist/cli/commands/local/remove-from-branch-group.d.ts.map +1 -0
- package/dist/cli/commands/local/remove-from-branch-group.js +37 -0
- package/dist/cli/commands/local/remove-symlink.d.ts +13 -0
- package/dist/cli/commands/local/remove-symlink.d.ts.map +1 -0
- package/dist/cli/commands/local/remove-symlink.js +39 -0
- package/dist/cli/commands/local/scrub-git-remotes.d.ts +9 -0
- package/dist/cli/commands/local/scrub-git-remotes.d.ts.map +1 -0
- package/dist/cli/commands/local/scrub-git-remotes.js +23 -0
- package/dist/cli/commands/{admin → local}/sync-unix.d.ts.map +1 -1
- package/dist/cli/commands/{admin → local}/sync-unix.js +3 -3
- package/dist/cli/commands/local/sync-user-symlinks.d.ts +12 -0
- package/dist/cli/commands/local/sync-user-symlinks.d.ts.map +1 -0
- package/dist/cli/commands/local/sync-user-symlinks.js +37 -0
- package/dist/cli/commands/telemetry/index.d.ts +7 -0
- package/dist/cli/commands/telemetry/index.d.ts.map +1 -0
- package/dist/cli/commands/telemetry/index.js +40 -0
- package/dist/cli/commands/telemetry/off.d.ts +6 -0
- package/dist/cli/commands/telemetry/off.d.ts.map +1 -0
- package/dist/cli/commands/telemetry/off.js +35 -0
- package/dist/cli/commands/telemetry/on.d.ts +6 -0
- package/dist/cli/commands/telemetry/on.d.ts.map +1 -0
- package/dist/cli/commands/telemetry/on.js +37 -0
- package/dist/cli/commands/telemetry/test.d.ts +6 -0
- package/dist/cli/commands/telemetry/test.d.ts.map +1 -0
- package/dist/cli/commands/telemetry/test.js +56 -0
- package/dist/cli/commands/user/create-admin.d.ts.map +1 -1
- package/dist/cli/commands/user/create-admin.js +81 -72
- package/dist/cli/commands/user/list.d.ts.map +1 -1
- package/dist/cli/commands/user/list.js +1 -0
- package/dist/cli/commands/whoami.js +2 -1
- package/dist/cli/lib/branch-environment-action.d.ts +21 -0
- package/dist/cli/lib/branch-environment-action.d.ts.map +1 -0
- package/dist/cli/lib/branch-environment-action.js +8 -0
- package/dist/core/api/index.cjs +12 -3
- package/dist/core/api/index.d.ts +16 -2
- package/dist/core/api/index.d.ts.map +1 -1
- package/dist/core/api/index.js +12 -3
- package/dist/core/claude/index.cjs +634 -81
- package/dist/core/claude/index.js +631 -80
- package/dist/core/claude-cli/index.cjs +11 -0
- package/dist/core/claude-cli/index.js +11 -0
- package/dist/core/claude-cli/pricing.d.ts.map +1 -1
- package/dist/core/client/index.cjs +78 -10
- package/dist/core/client/index.js +69 -10
- package/dist/core/config/browser.cjs +5 -7
- package/dist/core/config/browser.js +5 -7
- package/dist/core/config/config-manager.d.ts +33 -13
- package/dist/core/config/config-manager.d.ts.map +1 -1
- package/dist/core/config/constants.d.ts +1 -1
- package/dist/core/config/index.cjs +4277 -4391
- package/dist/core/config/index.d.ts +1 -0
- package/dist/core/config/index.d.ts.map +1 -1
- package/dist/core/config/index.js +4299 -4433
- package/dist/core/config/key-resolver.d.ts.map +1 -1
- package/dist/core/config/multitenancy.d.ts +33 -0
- package/dist/core/config/multitenancy.d.ts.map +1 -0
- package/dist/core/config/security-resolver.d.ts +1 -0
- package/dist/core/config/security-resolver.d.ts.map +1 -1
- package/dist/core/config/types.d.ts +75 -4
- package/dist/core/config/types.d.ts.map +1 -1
- package/dist/core/db/client.d.ts +34 -2
- package/dist/core/db/client.d.ts.map +1 -1
- package/dist/core/db/database-wrapper.d.ts.map +1 -1
- package/dist/core/db/first-run-bootstrap.d.ts.map +1 -1
- package/dist/core/db/index.cjs +2765 -1018
- package/dist/core/db/index.d.ts +2 -1
- package/dist/core/db/index.d.ts.map +1 -1
- package/dist/core/db/index.js +2612 -895
- package/dist/core/db/migrate.d.ts.map +1 -1
- package/dist/core/db/repositories/artifacts.d.ts +27 -2
- package/dist/core/db/repositories/artifacts.d.ts.map +1 -1
- package/dist/core/db/repositories/base.d.ts +18 -0
- package/dist/core/db/repositories/base.d.ts.map +1 -1
- package/dist/core/db/repositories/board-comments.d.ts +17 -1
- package/dist/core/db/repositories/board-comments.d.ts.map +1 -1
- package/dist/core/db/repositories/board-objects.d.ts.map +1 -1
- package/dist/core/db/repositories/boards.d.ts +28 -4
- package/dist/core/db/repositories/boards.d.ts.map +1 -1
- package/dist/core/db/repositories/branch-access.d.ts +32 -0
- package/dist/core/db/repositories/branch-access.d.ts.map +1 -1
- package/dist/core/db/repositories/branches.d.ts +54 -2
- package/dist/core/db/repositories/branches.d.ts.map +1 -1
- package/dist/core/db/repositories/cards.d.ts +15 -1
- package/dist/core/db/repositories/cards.d.ts.map +1 -1
- package/dist/core/db/repositories/gateway-channels.d.ts.map +1 -1
- package/dist/core/db/repositories/gateway-outbound-messages.d.ts +19 -0
- package/dist/core/db/repositories/gateway-outbound-messages.d.ts.map +1 -0
- package/dist/core/db/repositories/index.d.ts +3 -0
- package/dist/core/db/repositories/index.d.ts.map +1 -1
- package/dist/core/db/repositories/messages.d.ts +9 -2
- package/dist/core/db/repositories/messages.d.ts.map +1 -1
- package/dist/core/db/repositories/repos.d.ts.map +1 -1
- package/dist/core/db/repositories/schedules.d.ts +12 -1
- package/dist/core/db/repositories/schedules.d.ts.map +1 -1
- package/dist/core/db/repositories/session-relationships.d.ts +30 -0
- package/dist/core/db/repositories/session-relationships.d.ts.map +1 -0
- package/dist/core/db/repositories/sessions.d.ts +49 -5
- package/dist/core/db/repositories/sessions.d.ts.map +1 -1
- package/dist/core/db/repositories/tasks.d.ts +7 -2
- package/dist/core/db/repositories/tasks.d.ts.map +1 -1
- package/dist/core/db/repositories/user-api-keys.d.ts +10 -1
- package/dist/core/db/repositories/user-api-keys.d.ts.map +1 -1
- package/dist/core/db/repositories/users.d.ts +18 -7
- package/dist/core/db/repositories/users.d.ts.map +1 -1
- package/dist/core/db/schema.d.ts +2605 -766
- package/dist/core/db/schema.d.ts.map +1 -1
- package/dist/core/db/schema.postgres.d.ts +1318 -49
- package/dist/core/db/schema.postgres.d.ts.map +1 -1
- package/dist/core/db/schema.sqlite.d.ts +667 -45
- package/dist/core/db/schema.sqlite.d.ts.map +1 -1
- package/dist/core/db/tenant-context.d.ts +26 -0
- package/dist/core/db/tenant-context.d.ts.map +1 -0
- package/dist/core/db/tenant-scope.d.ts +31 -0
- package/dist/core/db/tenant-scope.d.ts.map +1 -0
- package/dist/core/db/user-utils.d.ts +2 -2
- package/dist/core/db/user-utils.d.ts.map +1 -1
- package/dist/core/drizzle/postgres/0050_artifact_source_session.sql +3 -0
- package/dist/core/drizzle/postgres/0051_session_relationships.sql +26 -0
- package/dist/core/drizzle/postgres/0052_gateway_outbound_messages.sql +45 -0
- package/dist/core/drizzle/postgres/0053_user_token_invalidation.sql +1 -0
- package/dist/core/drizzle/postgres/0054_app_level_multitenancy.sql +219 -0
- package/dist/core/drizzle/postgres/0055_app_level_multitenancy_rls.sql +411 -0
- package/dist/core/drizzle/postgres/0056_composite_indexes.sql +15 -0
- package/dist/core/drizzle/postgres/0057_message_timestamp_indexes.sql +3 -0
- package/dist/core/drizzle/postgres/meta/_journal.json +56 -0
- package/dist/core/drizzle/sqlite/0059_artifact_source_session.sql +2 -0
- package/dist/core/drizzle/sqlite/0060_session_relationships.sql +23 -0
- package/dist/core/drizzle/sqlite/0061_gateway_outbound_messages.sql +38 -0
- package/dist/core/drizzle/sqlite/0062_user_token_invalidation.sql +1 -0
- package/dist/core/drizzle/sqlite/0063_composite_indexes.sql +10 -0
- package/dist/core/drizzle/sqlite/0064_message_timestamp_indexes.sql +2 -0
- package/dist/core/drizzle/sqlite/meta/_journal.json +42 -0
- package/dist/core/environment/render-snapshot.cjs +1 -4
- package/dist/core/environment/render-snapshot.js +1 -4
- package/dist/core/environment/webhook.cjs +1 -4
- package/dist/core/environment/webhook.js +1 -4
- package/dist/core/gateway/connector-registry.d.ts.map +1 -1
- package/dist/core/gateway/connector.d.ts +32 -1
- package/dist/core/gateway/connector.d.ts.map +1 -1
- package/dist/core/gateway/connectors/slack-manifest.cjs +108 -0
- package/dist/core/gateway/connectors/slack-manifest.d.ts +85 -0
- package/dist/core/gateway/connectors/slack-manifest.d.ts.map +1 -0
- package/dist/core/gateway/connectors/slack-manifest.js +81 -0
- package/dist/core/gateway/connectors/slack.d.ts +136 -7
- package/dist/core/gateway/connectors/slack.d.ts.map +1 -1
- package/dist/core/gateway/connectors/teams.d.ts +107 -0
- package/dist/core/gateway/connectors/teams.d.ts.map +1 -0
- package/dist/core/gateway/context.d.ts.map +1 -1
- package/dist/core/gateway/index.cjs +1044 -78
- package/dist/core/gateway/index.d.ts +6 -2
- package/dist/core/gateway/index.d.ts.map +1 -1
- package/dist/core/gateway/index.js +1031 -77
- package/dist/core/gateway/system-message.d.ts +21 -0
- package/dist/core/gateway/system-message.d.ts.map +1 -1
- package/dist/core/git/exec.cjs +24 -0
- package/dist/core/git/exec.d.ts +6 -4
- package/dist/core/git/exec.d.ts.map +1 -1
- package/dist/core/git/exec.js +2 -0
- package/dist/core/git/index.cjs +3 -1363
- package/dist/core/git/index.d.ts +4 -614
- package/dist/core/git/index.d.ts.map +1 -1
- package/dist/core/git/index.js +1 -1304
- package/dist/core/git/pure.cjs +24 -0
- package/dist/core/git/pure.d.ts +2 -27
- package/dist/core/git/pure.d.ts.map +1 -1
- package/dist/core/git/pure.js +2 -0
- package/dist/core/index.cjs +11268 -10246
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +11703 -10179
- package/dist/core/lib/feathers-validation.cjs +6 -1
- package/dist/core/lib/feathers-validation.d.ts +1 -0
- package/dist/core/lib/feathers-validation.d.ts.map +1 -1
- package/dist/core/lib/feathers-validation.js +6 -1
- package/dist/core/local-actions/git-remotes.d.ts +7 -0
- package/dist/core/local-actions/git-remotes.d.ts.map +1 -0
- package/dist/core/local-actions/index.cjs +7941 -0
- package/dist/core/local-actions/index.d.ts +6 -0
- package/dist/core/local-actions/index.d.ts.map +1 -0
- package/dist/core/local-actions/index.js +7943 -0
- package/dist/core/local-actions/symlinks.d.ts +20 -0
- package/dist/core/local-actions/symlinks.d.ts.map +1 -0
- package/dist/core/local-actions/types.d.ts +14 -0
- package/dist/core/local-actions/types.d.ts.map +1 -0
- package/dist/core/local-actions/unix-groups.d.ts +16 -0
- package/dist/core/local-actions/unix-groups.d.ts.map +1 -0
- package/dist/core/local-actions/unix-users.d.ts +12 -0
- package/dist/core/local-actions/unix-users.d.ts.map +1 -0
- package/dist/core/mcp/index.cjs +498 -34
- package/dist/core/mcp/index.js +497 -33
- package/dist/core/mcp/template-resolver.d.ts.map +1 -1
- package/dist/core/models/browser.cjs +148 -25
- package/dist/core/models/browser.js +144 -25
- package/dist/core/models/claude.d.ts +2 -2
- package/dist/core/models/claude.d.ts.map +1 -1
- package/dist/core/models/codex.d.ts +205 -21
- package/dist/core/models/codex.d.ts.map +1 -1
- package/dist/core/models/index.cjs +148 -25
- package/dist/core/models/index.js +144 -25
- package/dist/core/package.json +24 -0
- package/dist/core/seed/demo-fixtures.d.ts +87 -0
- package/dist/core/seed/demo-fixtures.d.ts.map +1 -0
- package/dist/core/seed/dev-fixtures.d.ts.map +1 -1
- package/dist/core/seed/index.cjs +8785 -5563
- package/dist/core/seed/index.d.ts +1 -0
- package/dist/core/seed/index.d.ts.map +1 -1
- package/dist/core/seed/index.js +8787 -5570
- package/dist/core/sessions/index.cjs +129 -24
- package/dist/core/sessions/index.js +129 -24
- package/dist/core/telemetry/index.cjs +361 -0
- package/dist/core/telemetry/index.d.ts +5 -0
- package/dist/core/telemetry/index.d.ts.map +1 -0
- package/dist/core/telemetry/index.js +315 -0
- package/dist/core/telemetry/logger.d.ts +44 -0
- package/dist/core/telemetry/logger.d.ts.map +1 -0
- package/dist/core/telemetry/model-normalization.d.ts +3 -0
- package/dist/core/telemetry/model-normalization.d.ts.map +1 -0
- package/dist/core/telemetry/types.d.ts +47 -0
- package/dist/core/telemetry/types.d.ts.map +1 -0
- package/dist/core/telemetry/version.d.ts +9 -0
- package/dist/core/telemetry/version.d.ts.map +1 -0
- package/dist/core/templates/agor-system-prompt.md +22 -53
- package/dist/core/templates/session-context.cjs +2 -73
- package/dist/core/templates/session-context.d.ts +9 -53
- package/dist/core/templates/session-context.d.ts.map +1 -1
- package/dist/core/templates/session-context.js +2 -72
- package/dist/core/tools/mcp/jwt-auth.cjs +2 -20
- package/dist/core/tools/mcp/jwt-auth.d.ts.map +1 -1
- package/dist/core/tools/mcp/jwt-auth.js +2 -20
- package/dist/core/tools/mcp/oauth-mcp-transport.cjs +2 -15
- package/dist/core/tools/mcp/oauth-mcp-transport.d.ts.map +1 -1
- package/dist/core/tools/mcp/oauth-mcp-transport.js +2 -15
- package/dist/core/tools/mcp/oauth-refresh.cjs +684 -106
- package/dist/core/tools/mcp/oauth-refresh.js +682 -107
- package/dist/core/types/artifact.d.ts +5 -1
- package/dist/core/types/artifact.d.ts.map +1 -1
- package/dist/core/types/board.d.ts +2 -0
- package/dist/core/types/board.d.ts.map +1 -1
- package/dist/core/types/branch.d.ts +27 -0
- package/dist/core/types/branch.d.ts.map +1 -1
- package/dist/core/types/config-services.d.ts.map +1 -1
- package/dist/core/types/feathers.d.ts +6 -0
- package/dist/core/types/feathers.d.ts.map +1 -1
- package/dist/core/types/gateway.d.ts +77 -2
- package/dist/core/types/gateway.d.ts.map +1 -1
- package/dist/core/types/id.d.ts +1 -0
- package/dist/core/types/id.d.ts.map +1 -1
- package/dist/core/types/index.cjs +61 -0
- package/dist/core/types/index.d.ts +1 -0
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/core/types/index.js +52 -0
- package/dist/core/types/schedule.d.ts +4 -3
- package/dist/core/types/schedule.d.ts.map +1 -1
- package/dist/core/types/session.d.ts +72 -2
- package/dist/core/types/session.d.ts.map +1 -1
- package/dist/core/types/task.d.ts +9 -0
- package/dist/core/types/task.d.ts.map +1 -1
- package/dist/core/types/tenant.d.ts +15 -0
- package/dist/core/types/tenant.d.ts.map +1 -0
- package/dist/core/types/user.d.ts +61 -0
- package/dist/core/types/user.d.ts.map +1 -1
- package/dist/core/unix/index.cjs +1367 -669
- package/dist/core/unix/index.js +1330 -634
- package/dist/core/unix/unix-integration-service.d.ts +10 -7
- package/dist/core/unix/unix-integration-service.d.ts.map +1 -1
- package/dist/core/utils/emoji-shortcodes.d.ts +13 -0
- package/dist/core/utils/emoji-shortcodes.d.ts.map +1 -0
- package/dist/core/utils/permission-mode-mapper.cjs +19 -0
- package/dist/core/utils/permission-mode-mapper.js +19 -0
- package/dist/core/yaml/index.cjs +8 -8
- package/dist/core/yaml/index.d.ts +1 -1
- package/dist/core/yaml/index.d.ts.map +1 -1
- package/dist/core/yaml/index.js +7 -7
- package/dist/daemon/adapters/drizzle.d.ts +26 -4
- package/dist/daemon/adapters/drizzle.d.ts.map +1 -1
- package/dist/daemon/adapters/drizzle.js +68 -7
- package/dist/daemon/auth/api-key-strategy.js +1 -1
- package/dist/daemon/auth/executor-runtime-scope.d.ts.map +1 -1
- package/dist/daemon/auth/executor-runtime-scope.js +19 -5
- package/dist/daemon/auth/launch-auth.d.ts +5 -4
- package/dist/daemon/auth/launch-auth.d.ts.map +1 -1
- package/dist/daemon/auth/launch-auth.js +123 -39
- package/dist/daemon/auth/refresh-token-service.d.ts +22 -0
- package/dist/daemon/auth/refresh-token-service.d.ts.map +1 -0
- package/dist/daemon/auth/refresh-token-service.js +133 -0
- package/dist/daemon/auth/runtime-tokens.d.ts +3 -1
- package/dist/daemon/auth/runtime-tokens.d.ts.map +1 -1
- package/dist/daemon/auth/runtime-tokens.js +17 -4
- package/dist/daemon/auth/service-jwt-strategy.d.ts +2 -1
- package/dist/daemon/auth/service-jwt-strategy.d.ts.map +1 -1
- package/dist/daemon/auth/service-jwt-strategy.js +127 -1
- package/dist/daemon/auth/token-invalidation.d.ts +11 -0
- package/dist/daemon/auth/token-invalidation.d.ts.map +1 -0
- package/dist/daemon/auth/token-invalidation.js +38 -0
- package/dist/daemon/auth/user-redaction.d.ts +12 -0
- package/dist/daemon/auth/user-redaction.d.ts.map +1 -0
- package/dist/daemon/auth/user-redaction.js +13 -0
- package/dist/daemon/declarations.d.ts +8 -1
- package/dist/daemon/declarations.d.ts.map +1 -1
- package/dist/daemon/hooks/gateway-route.d.ts.map +1 -1
- package/dist/daemon/hooks/gateway-route.js +69 -7
- package/dist/daemon/index.d.ts.map +1 -1
- package/dist/daemon/index.js +10429 -4408
- package/dist/daemon/knowledge/pgvector.d.ts +3 -3
- package/dist/daemon/knowledge/pgvector.d.ts.map +1 -1
- package/dist/daemon/knowledge/pgvector.js +24 -0
- package/dist/daemon/knowledge/units.d.ts +2 -2
- package/dist/daemon/knowledge/units.d.ts.map +1 -1
- package/dist/daemon/main.js +10429 -4408
- package/dist/daemon/mcp/server.d.ts +3 -3
- package/dist/daemon/mcp/server.d.ts.map +1 -1
- package/dist/daemon/mcp/server.js +1621 -87
- package/dist/daemon/mcp/tokens.d.ts +2 -2
- package/dist/daemon/mcp/tokens.d.ts.map +1 -1
- package/dist/daemon/mcp/tokens.js +5 -1
- package/dist/daemon/mcp/tool-registry.d.ts.map +1 -1
- package/dist/daemon/mcp/tool-registry.js +1 -0
- package/dist/daemon/mcp/tools/analytics.d.ts.map +1 -1
- package/dist/daemon/mcp/tools/analytics.js +553 -29
- package/dist/daemon/mcp/tools/artifacts.d.ts.map +1 -1
- package/dist/daemon/mcp/tools/artifacts.js +516 -25
- package/dist/daemon/mcp/tools/boards.d.ts.map +1 -1
- package/dist/daemon/mcp/tools/boards.js +522 -26
- package/dist/daemon/mcp/tools/branches.d.ts.map +1 -1
- package/dist/daemon/mcp/tools/branches.js +579 -55
- package/dist/daemon/mcp/tools/card-types.js +513 -23
- package/dist/daemon/mcp/tools/cards.js +513 -23
- package/dist/daemon/mcp/tools/environment.d.ts.map +1 -1
- package/dist/daemon/mcp/tools/environment.js +534 -28
- package/dist/daemon/mcp/tools/gateway-channels.d.ts +4 -0
- package/dist/daemon/mcp/tools/gateway-channels.d.ts.map +1 -0
- package/dist/daemon/mcp/tools/gateway-channels.js +16035 -0
- package/dist/daemon/mcp/tools/knowledge.js +513 -23
- package/dist/daemon/mcp/tools/mcp-servers.d.ts.map +1 -1
- package/dist/daemon/mcp/tools/mcp-servers.js +848 -23
- package/dist/daemon/mcp/tools/messages.d.ts.map +1 -1
- package/dist/daemon/mcp/tools/messages.js +573 -37
- package/dist/daemon/mcp/tools/proxies.js +523 -25
- package/dist/daemon/mcp/tools/repos.js +513 -23
- package/dist/daemon/mcp/tools/schedules.d.ts.map +1 -1
- package/dist/daemon/mcp/tools/schedules.js +516 -24
- package/dist/daemon/mcp/tools/search.js +513 -23
- package/dist/daemon/mcp/tools/sessions.d.ts.map +1 -1
- package/dist/daemon/mcp/tools/sessions.js +660 -33
- package/dist/daemon/mcp/tools/tasks.js +513 -23
- package/dist/daemon/mcp/tools/users.d.ts.map +1 -1
- package/dist/daemon/mcp/tools/users.js +532 -28
- package/dist/daemon/mcp/tools/widgets.d.ts.map +1 -1
- package/dist/daemon/mcp/tools/widgets.js +542 -25
- package/dist/daemon/register-hooks.d.ts +8 -3
- package/dist/daemon/register-hooks.d.ts.map +1 -1
- package/dist/daemon/register-hooks.js +1146 -609
- package/dist/daemon/register-routes.d.ts +3 -2
- package/dist/daemon/register-routes.d.ts.map +1 -1
- package/dist/daemon/register-routes.js +2926 -829
- package/dist/daemon/register-services.d.ts +2 -2
- package/dist/daemon/register-services.d.ts.map +1 -1
- package/dist/daemon/register-services.js +4209 -1140
- package/dist/daemon/services/artifacts.d.ts +43 -6
- package/dist/daemon/services/artifacts.d.ts.map +1 -1
- package/dist/daemon/services/artifacts.js +134 -9
- package/dist/daemon/services/assistant-knowledge.d.ts +2 -2
- package/dist/daemon/services/assistant-knowledge.d.ts.map +1 -1
- package/dist/daemon/services/board-comments.d.ts +8 -5
- package/dist/daemon/services/board-comments.d.ts.map +1 -1
- package/dist/daemon/services/board-comments.js +78 -13
- package/dist/daemon/services/board-objects.d.ts +8 -5
- package/dist/daemon/services/board-objects.d.ts.map +1 -1
- package/dist/daemon/services/board-objects.js +14 -4
- package/dist/daemon/services/boards.d.ts +34 -5
- package/dist/daemon/services/boards.d.ts.map +1 -1
- package/dist/daemon/services/boards.js +116 -8
- package/dist/daemon/services/branch-owners.d.ts +3 -1
- package/dist/daemon/services/branch-owners.d.ts.map +1 -1
- package/dist/daemon/services/branch-owners.js +31 -4
- package/dist/daemon/services/branches.d.ts +39 -6
- package/dist/daemon/services/branches.d.ts.map +1 -1
- package/dist/daemon/services/branches.js +703 -210
- package/dist/daemon/services/card-types.d.ts +3 -3
- package/dist/daemon/services/card-types.d.ts.map +1 -1
- package/dist/daemon/services/card-types.js +68 -7
- package/dist/daemon/services/cards.d.ts +19 -4
- package/dist/daemon/services/cards.d.ts.map +1 -1
- package/dist/daemon/services/cards.js +92 -8
- package/dist/daemon/services/check-auth.d.ts +2 -2
- package/dist/daemon/services/check-auth.d.ts.map +1 -1
- package/dist/daemon/services/claude-cli-integration.d.ts +4 -1
- package/dist/daemon/services/claude-cli-integration.d.ts.map +1 -1
- package/dist/daemon/services/claude-cli-integration.js +117 -65
- package/dist/daemon/services/claude-models.d.ts +3 -3
- package/dist/daemon/services/claude-models.d.ts.map +1 -1
- package/dist/daemon/services/claude-models.js +1048 -397
- package/dist/daemon/services/config.d.ts +12 -4
- package/dist/daemon/services/config.d.ts.map +1 -1
- package/dist/daemon/services/config.js +39 -3
- package/dist/daemon/services/copilot-models.d.ts +3 -3
- package/dist/daemon/services/copilot-models.d.ts.map +1 -1
- package/dist/daemon/services/cursor-models.d.ts +3 -3
- package/dist/daemon/services/cursor-models.d.ts.map +1 -1
- package/dist/daemon/services/files.d.ts +3 -3
- package/dist/daemon/services/files.d.ts.map +1 -1
- package/dist/daemon/services/files.js +24 -5
- package/dist/daemon/services/gateway-channels-test.d.ts +24 -0
- package/dist/daemon/services/gateway-channels-test.d.ts.map +1 -0
- package/dist/daemon/services/gateway-channels-test.js +66 -0
- package/dist/daemon/services/gateway-channels.d.ts +3 -3
- package/dist/daemon/services/gateway-channels.d.ts.map +1 -1
- package/dist/daemon/services/gateway-channels.js +68 -7
- package/dist/daemon/services/gateway.d.ts +106 -5
- package/dist/daemon/services/gateway.d.ts.map +1 -1
- package/dist/daemon/services/gateway.js +1184 -95
- package/dist/daemon/services/github-app-setup.d.ts +3 -3
- package/dist/daemon/services/github-app-setup.d.ts.map +1 -1
- package/dist/daemon/services/groups.d.ts +7 -5
- package/dist/daemon/services/groups.d.ts.map +1 -1
- package/dist/daemon/services/groups.js +56 -0
- package/dist/daemon/services/health-monitor.d.ts +34 -2
- package/dist/daemon/services/health-monitor.d.ts.map +1 -1
- package/dist/daemon/services/health-monitor.js +145 -23
- package/dist/daemon/services/knowledge-document-edits.d.ts +3 -3
- package/dist/daemon/services/knowledge-document-edits.d.ts.map +1 -1
- package/dist/daemon/services/knowledge-documents.d.ts +3 -3
- package/dist/daemon/services/knowledge-documents.d.ts.map +1 -1
- package/dist/daemon/services/knowledge-documents.js +92 -7
- package/dist/daemon/services/knowledge-embedding-indexer.d.ts +7 -2
- package/dist/daemon/services/knowledge-embedding-indexer.d.ts.map +1 -1
- package/dist/daemon/services/knowledge-embedding-indexer.js +37 -3
- package/dist/daemon/services/knowledge-graph.d.ts +3 -3
- package/dist/daemon/services/knowledge-graph.d.ts.map +1 -1
- package/dist/daemon/services/knowledge-indexing.d.ts +3 -3
- package/dist/daemon/services/knowledge-indexing.d.ts.map +1 -1
- package/dist/daemon/services/knowledge-namespaces.d.ts +3 -3
- package/dist/daemon/services/knowledge-namespaces.d.ts.map +1 -1
- package/dist/daemon/services/knowledge-namespaces.js +72 -8
- package/dist/daemon/services/knowledge-reindex.d.ts +3 -3
- package/dist/daemon/services/knowledge-reindex.d.ts.map +1 -1
- package/dist/daemon/services/knowledge-reindex.js +28 -1
- package/dist/daemon/services/knowledge-search.d.ts +3 -3
- package/dist/daemon/services/knowledge-search.d.ts.map +1 -1
- package/dist/daemon/services/knowledge-settings.d.ts +3 -3
- package/dist/daemon/services/knowledge-settings.d.ts.map +1 -1
- package/dist/daemon/services/knowledge-settings.js +24 -0
- package/dist/daemon/services/knowledge-versions.d.ts +3 -3
- package/dist/daemon/services/knowledge-versions.d.ts.map +1 -1
- package/dist/daemon/services/knowledge-versions.js +68 -7
- package/dist/daemon/services/leaderboard.d.ts +14 -6
- package/dist/daemon/services/leaderboard.d.ts.map +1 -1
- package/dist/daemon/services/leaderboard.js +74 -15
- package/dist/daemon/services/local-actions.d.ts +13 -0
- package/dist/daemon/services/local-actions.d.ts.map +1 -0
- package/dist/daemon/services/local-actions.js +120 -0
- package/dist/daemon/services/mcp-servers.d.ts +3 -3
- package/dist/daemon/services/mcp-servers.d.ts.map +1 -1
- package/dist/daemon/services/mcp-servers.js +68 -13
- package/dist/daemon/services/messages.d.ts +10 -6
- package/dist/daemon/services/messages.d.ts.map +1 -1
- package/dist/daemon/services/messages.js +87 -7
- package/dist/daemon/services/repos.d.ts +6 -6
- package/dist/daemon/services/repos.d.ts.map +1 -1
- package/dist/daemon/services/repos.js +131 -32
- package/dist/daemon/services/scheduler.d.ts +23 -27
- package/dist/daemon/services/scheduler.d.ts.map +1 -1
- package/dist/daemon/services/scheduler.js +61 -30
- package/dist/daemon/services/schedules.d.ts +3 -3
- package/dist/daemon/services/schedules.d.ts.map +1 -1
- package/dist/daemon/services/schedules.js +68 -7
- package/dist/daemon/services/session-env-selections.d.ts +3 -3
- package/dist/daemon/services/session-env-selections.d.ts.map +1 -1
- package/dist/daemon/services/session-mcp-servers.d.ts +3 -3
- package/dist/daemon/services/session-mcp-servers.d.ts.map +1 -1
- package/dist/daemon/services/session-token-service.d.ts.map +1 -1
- package/dist/daemon/services/session-token-service.js +3 -0
- package/dist/daemon/services/sessions.d.ts +20 -8
- package/dist/daemon/services/sessions.d.ts.map +1 -1
- package/dist/daemon/services/sessions.js +211 -17
- package/dist/daemon/services/tasks.d.ts +24 -7
- package/dist/daemon/services/tasks.d.ts.map +1 -1
- package/dist/daemon/services/tasks.js +235 -59
- package/dist/daemon/services/terminals.d.ts +21 -3
- package/dist/daemon/services/terminals.d.ts.map +1 -1
- package/dist/daemon/services/terminals.js +81 -25
- package/dist/daemon/services/thread-session-map.d.ts +3 -3
- package/dist/daemon/services/thread-session-map.d.ts.map +1 -1
- package/dist/daemon/services/thread-session-map.js +68 -7
- package/dist/daemon/services/user-avatar-sync.d.ts +21 -0
- package/dist/daemon/services/user-avatar-sync.d.ts.map +1 -0
- package/dist/daemon/services/user-avatar-sync.js +267 -0
- package/dist/daemon/services/users.d.ts +29 -9
- package/dist/daemon/services/users.d.ts.map +1 -1
- package/dist/daemon/services/users.js +383 -30
- package/dist/daemon/services/zone-trigger.d.ts.map +1 -1
- package/dist/daemon/services/zone-trigger.js +17 -4
- package/dist/daemon/setup/build-info.d.ts +1 -1
- package/dist/daemon/setup/build-info.d.ts.map +1 -1
- package/dist/daemon/setup/build-info.js +5 -1
- package/dist/daemon/setup/database.d.ts +8 -3
- package/dist/daemon/setup/database.d.ts.map +1 -1
- package/dist/daemon/setup/database.js +26 -6
- package/dist/daemon/setup/first-run-admin.d.ts +2 -2
- package/dist/daemon/setup/first-run-admin.d.ts.map +1 -1
- package/dist/daemon/setup/index.js +97 -17
- package/dist/daemon/setup/socketio.d.ts +10 -1
- package/dist/daemon/setup/socketio.d.ts.map +1 -1
- package/dist/daemon/setup/socketio.js +68 -10
- package/dist/daemon/startup.d.ts +13 -2
- package/dist/daemon/startup.d.ts.map +1 -1
- package/dist/daemon/startup.js +354 -88
- package/dist/daemon/utils/append-system-message.d.ts +2 -2
- package/dist/daemon/utils/append-system-message.d.ts.map +1 -1
- package/dist/daemon/utils/apply-session-config-defaults.d.ts.map +1 -1
- package/dist/daemon/utils/apply-session-config-defaults.js +12 -1
- package/dist/daemon/utils/authorization.d.ts +3 -1
- package/dist/daemon/utils/authorization.d.ts.map +1 -1
- package/dist/daemon/utils/authorization.js +21 -6
- package/dist/daemon/utils/branch-authorization.d.ts +30 -0
- package/dist/daemon/utils/branch-authorization.d.ts.map +1 -1
- package/dist/daemon/utils/branch-authorization.js +63 -5
- package/dist/daemon/utils/branch-inspect.d.ts +1 -0
- package/dist/daemon/utils/branch-inspect.d.ts.map +1 -1
- package/dist/daemon/utils/branch-inspect.js +11 -3
- package/dist/daemon/utils/executor-read-impersonation.d.ts +2 -2
- package/dist/daemon/utils/executor-read-impersonation.d.ts.map +1 -1
- package/dist/daemon/utils/git-impersonation.d.ts +10 -10
- package/dist/daemon/utils/git-impersonation.d.ts.map +1 -1
- package/dist/daemon/utils/git-remote-credential-scan.d.ts +3 -3
- package/dist/daemon/utils/git-remote-credential-scan.d.ts.map +1 -1
- package/dist/daemon/utils/git-remote-credential-scan.js +6 -2
- package/dist/daemon/utils/mcp-token-authorization.d.ts +18 -13
- package/dist/daemon/utils/mcp-token-authorization.d.ts.map +1 -1
- package/dist/daemon/utils/mcp-token-authorization.js +11 -5
- package/dist/daemon/utils/open-source-telemetry-config.d.ts +6 -0
- package/dist/daemon/utils/open-source-telemetry-config.d.ts.map +1 -0
- package/dist/daemon/utils/open-source-telemetry-config.js +21 -0
- package/dist/daemon/utils/open-source-telemetry-heartbeat.d.ts +7 -0
- package/dist/daemon/utils/open-source-telemetry-heartbeat.d.ts.map +1 -0
- package/dist/daemon/utils/open-source-telemetry-heartbeat.js +15 -0
- package/dist/daemon/utils/open-source-telemetry-usage.d.ts +9 -0
- package/dist/daemon/utils/open-source-telemetry-usage.d.ts.map +1 -0
- package/dist/daemon/utils/open-source-telemetry-usage.js +121 -0
- package/dist/daemon/utils/realign-repo-origin.d.ts +3 -3
- package/dist/daemon/utils/realign-repo-origin.d.ts.map +1 -1
- package/dist/daemon/utils/realign-repo-origin.js +47 -16
- package/dist/daemon/utils/realtime-publish.d.ts +2 -0
- package/dist/daemon/utils/realtime-publish.d.ts.map +1 -1
- package/dist/daemon/utils/realtime-publish.js +51 -10
- package/dist/daemon/utils/session-state-hooks.d.ts +3 -3
- package/dist/daemon/utils/session-state-hooks.d.ts.map +1 -1
- package/dist/daemon/utils/session-stop.d.ts +43 -0
- package/dist/daemon/utils/session-stop.d.ts.map +1 -0
- package/dist/daemon/utils/session-stop.js +102 -0
- package/dist/daemon/utils/session-task-state.d.ts +7 -2
- package/dist/daemon/utils/session-task-state.d.ts.map +1 -1
- package/dist/daemon/utils/session-task-state.js +9 -3
- package/dist/daemon/utils/session-tasks.d.ts +4 -4
- package/dist/daemon/utils/session-tasks.d.ts.map +1 -1
- package/dist/daemon/utils/session-tasks.js +4 -8
- package/dist/daemon/utils/session-turn-lock.d.ts +8 -1
- package/dist/daemon/utils/session-turn-lock.d.ts.map +1 -1
- package/dist/daemon/utils/session-turn-lock.js +25 -2
- package/dist/daemon/utils/spawn-executor.d.ts +23 -1
- package/dist/daemon/utils/spawn-executor.d.ts.map +1 -1
- package/dist/daemon/utils/spawn-executor.js +34 -4
- package/dist/daemon/utils/tenant-db-scope.d.ts +20 -0
- package/dist/daemon/utils/tenant-db-scope.d.ts.map +1 -0
- package/dist/daemon/utils/tenant-db-scope.js +114 -0
- package/dist/daemon/utils/unix-group-init.d.ts +3 -3
- package/dist/daemon/utils/unix-group-init.d.ts.map +1 -1
- package/dist/daemon/utils/upload.d.ts +6 -9
- package/dist/daemon/utils/upload.d.ts.map +1 -1
- package/dist/daemon/utils/upload.js +30 -37
- package/dist/daemon/widgets/env-vars/index.d.ts +26 -1
- package/dist/daemon/widgets/env-vars/index.d.ts.map +1 -1
- package/dist/daemon/widgets/env-vars/index.js +145 -21
- package/dist/daemon/widgets/index.js +137 -21
- package/dist/executor/commands/environment.d.ts +13 -0
- package/dist/executor/commands/environment.d.ts.map +1 -0
- package/dist/executor/commands/environment.js +291 -0
- package/dist/executor/commands/git.js +1 -1
- package/dist/executor/commands/index.d.ts.map +1 -1
- package/dist/executor/commands/index.js +5 -1
- package/dist/executor/commands/unix.d.ts +8 -1
- package/dist/executor/commands/unix.d.ts.map +1 -1
- package/dist/executor/commands/unix.js +157 -2
- package/dist/executor/git/index.d.ts +8 -0
- package/dist/executor/git/index.d.ts.map +1 -0
- package/dist/executor/git/index.js +7 -0
- package/dist/executor/handlers/sdk/base-executor.d.ts.map +1 -1
- package/dist/executor/handlers/sdk/base-executor.js +4 -1
- package/dist/executor/handlers/sdk/git-safe-directory.d.ts.map +1 -1
- package/dist/executor/handlers/sdk/git-safe-directory.js +1 -1
- package/dist/executor/payload-types.d.ts +201 -5
- package/dist/executor/payload-types.d.ts.map +1 -1
- package/dist/executor/payload-types.js +98 -0
- package/dist/executor/sdk-handlers/base/diff-enrichment.js +1 -1
- package/dist/executor/sdk-handlers/base/mcp-scoping.d.ts.map +1 -1
- package/dist/executor/sdk-handlers/base/mcp-scoping.js +14 -0
- package/dist/executor/sdk-handlers/claude/message-processor.d.ts.map +1 -1
- package/dist/executor/sdk-handlers/claude/message-processor.js +0 -1
- package/dist/executor/sdk-handlers/claude/query-builder.d.ts +1 -0
- package/dist/executor/sdk-handlers/claude/query-builder.d.ts.map +1 -1
- package/dist/executor/sdk-handlers/claude/query-builder.js +91 -39
- package/dist/executor/sdk-handlers/codex/codex-tool.d.ts +6 -10
- package/dist/executor/sdk-handlers/codex/codex-tool.d.ts.map +1 -1
- package/dist/executor/sdk-handlers/codex/codex-tool.js +12 -15
- package/dist/executor/sdk-handlers/codex/normalizer.d.ts.map +1 -1
- package/dist/executor/sdk-handlers/codex/normalizer.js +11 -1
- package/dist/executor/sdk-handlers/codex/pricing/litellm-openai-model-prices.json +3663 -0
- package/dist/executor/sdk-handlers/codex/pricing/litellm-pricing.d.ts +31 -0
- package/dist/executor/sdk-handlers/codex/pricing/litellm-pricing.d.ts.map +1 -0
- package/dist/executor/sdk-handlers/codex/pricing/litellm-pricing.js +46 -0
- package/dist/executor/sdk-handlers/codex/prompt-service.d.ts +12 -5
- package/dist/executor/sdk-handlers/codex/prompt-service.d.ts.map +1 -1
- package/dist/executor/sdk-handlers/codex/prompt-service.js +133 -36
- package/dist/executor/sdk-handlers/codex/usage.d.ts +14 -23
- package/dist/executor/sdk-handlers/codex/usage.d.ts.map +1 -1
- package/dist/executor/sdk-handlers/codex/usage.js +18 -33
- package/dist/executor/sdk-handlers/copilot/prompt-service.d.ts +2 -4
- package/dist/executor/sdk-handlers/copilot/prompt-service.d.ts.map +1 -1
- package/dist/executor/sdk-handlers/copilot/prompt-service.js +4 -13
- package/dist/executor/sdk-handlers/gemini/prompt-service.d.ts +2 -4
- package/dist/executor/sdk-handlers/gemini/prompt-service.d.ts.map +1 -1
- package/dist/executor/sdk-handlers/gemini/prompt-service.js +4 -13
- package/dist/executor/services/feathers-client.js +5 -5
- package/dist/git/index.cjs +1101 -0
- package/dist/git/index.d.ts +533 -0
- package/dist/git/index.d.ts.map +1 -0
- package/dist/git/index.js +1022 -0
- package/dist/git/package.json +21 -0
- package/dist/git/pure.cjs +185 -0
- package/dist/git/pure.d.ts +39 -0
- package/dist/git/pure.d.ts.map +1 -0
- package/dist/git/pure.js +139 -0
- package/dist/ui/assets/AgorEmojiPickerInner-DQjr8M3_.js +1 -0
- package/dist/ui/assets/App-hJtcOxHv.js +5 -0
- package/dist/ui/assets/App-hJtcOxHv.js.gz +0 -0
- package/dist/ui/assets/AppNode-BhuMpn8O.js +1 -0
- package/dist/ui/assets/AppNode-BhuMpn8O.js.gz +0 -0
- package/dist/ui/assets/ArtifactConsentModal-oMMzRn8L.js +1 -0
- package/dist/ui/assets/ArtifactConsentModal-oMMzRn8L.js.gz +0 -0
- package/dist/ui/assets/ArtifactFullscreenPage-B3wT8t8f.js +9 -0
- package/dist/ui/assets/ArtifactFullscreenPage-B3wT8t8f.js.gz +0 -0
- package/dist/ui/assets/ArtifactNode-BzQcrwFS.js +9 -0
- package/dist/ui/assets/ArtifactNode-BzQcrwFS.js.gz +0 -0
- package/dist/ui/assets/AutocompleteTextarea-Dau-V_30.js +19 -0
- package/dist/ui/assets/AutocompleteTextarea-Dau-V_30.js.gz +0 -0
- package/dist/ui/assets/BoardObjectNodes-DdKWv_ZT.js +34 -0
- package/dist/ui/assets/BoardObjectNodes-DdKWv_ZT.js.gz +0 -0
- package/dist/ui/assets/CodeEditor.inner-Cuj6RuLL.js +7 -0
- package/dist/ui/assets/CodeEditor.inner-Cuj6RuLL.js.gz +0 -0
- package/dist/ui/assets/ConversationView-9-3ma1u-.js +1 -0
- package/dist/ui/assets/ConversationView-9-3ma1u-.js.gz +0 -0
- package/dist/ui/assets/EmbeddedTerminal-Lx5I9EOJ.js +2 -0
- package/dist/ui/assets/EmbeddedTerminal-Lx5I9EOJ.js.gz +0 -0
- package/dist/ui/assets/KnowledgePage-Dz8YAMYC.js +24 -0
- package/dist/ui/assets/KnowledgePage-Dz8YAMYC.js.gz +0 -0
- package/dist/ui/assets/MarketingScreenshotPage-9Qd7eZsm.css +1 -0
- package/dist/ui/assets/MarketingScreenshotPage-CmDPBHOl.js +143 -0
- package/dist/ui/assets/MarketingScreenshotPage-CmDPBHOl.js.gz +0 -0
- package/dist/ui/assets/MobileApp-BpgSG_gz.js +1 -0
- package/dist/ui/assets/MobileApp-BpgSG_gz.js.gz +0 -0
- package/dist/ui/assets/SessionCanvas-B6_mtlxK.js +13 -0
- package/dist/ui/assets/SessionCanvas-B6_mtlxK.js.gz +0 -0
- package/dist/ui/assets/SessionCanvas-Bh7Yg5dZ.css +1 -0
- package/dist/ui/assets/SessionCanvas-Bh7Yg5dZ.css.gz +0 -0
- package/dist/ui/assets/{StreamdownDemoPage-B9wbgp2s.js → StreamdownDemoPage-okKKR2QH.js} +2 -2
- package/dist/ui/assets/StreamdownDemoPage-okKKR2QH.js.gz +0 -0
- package/dist/ui/assets/TerminalModal-D9jMGZXv.js +2 -0
- package/dist/ui/assets/TerminalModal-D9jMGZXv.js.gz +0 -0
- package/dist/ui/assets/ThemeSwitcher-D9HgT37l.js +1 -0
- package/dist/ui/assets/ThemeSwitcher-D9HgT37l.js.gz +0 -0
- package/dist/ui/assets/ThemedSyntaxHighlighter.inner-C1FdIHn0.js +1 -0
- package/dist/ui/assets/antd-DT5ackd0.js +401 -0
- package/dist/ui/assets/antd-DT5ackd0.js.gz +0 -0
- package/dist/ui/assets/architecture-U656AL7Q-DMnxkQRZ.js +1 -0
- package/dist/ui/assets/architectureDiagram-VXUJARFQ-DwTJGGoj.js +36 -0
- package/dist/ui/assets/architectureDiagram-VXUJARFQ-DwTJGGoj.js.gz +0 -0
- package/dist/ui/assets/{blockDiagram-VD42YOAC-CzGHAHao.js → blockDiagram-VD42YOAC-Dh1_TVW2.js} +4 -4
- package/dist/ui/assets/blockDiagram-VD42YOAC-Dh1_TVW2.js.gz +0 -0
- package/dist/ui/assets/{c4Diagram-YG6GDRKO-DscJyaWN.js → c4Diagram-YG6GDRKO-B1e96AcB.js} +2 -2
- package/dist/ui/assets/c4Diagram-YG6GDRKO-B1e96AcB.js.gz +0 -0
- package/dist/ui/assets/channel-Jv4dT4S5.js +1 -0
- package/dist/ui/assets/{chunk-4BX2VUAB-DoWpTvP8.js → chunk-4BX2VUAB-BODpCjJx.js} +1 -1
- package/dist/ui/assets/chunk-55IACEB6-lJXvUquf.js +1 -0
- package/dist/ui/assets/{chunk-ABZYJK2D-RzDCrjE6.js → chunk-ABZYJK2D-DCTXWSzV.js} +3 -3
- package/dist/ui/assets/chunk-ABZYJK2D-DCTXWSzV.js.gz +0 -0
- package/dist/ui/assets/{chunk-AGHRB4JF-jidCS5Of.js → chunk-AGHRB4JF-CbNphBjE.js} +1 -1
- package/dist/ui/assets/chunk-AGHRB4JF-CbNphBjE.js.gz +0 -0
- package/dist/ui/assets/{chunk-ATLVNIR6-BEIIfJtC.js → chunk-ATLVNIR6-rWg3qxof.js} +1 -1
- package/dist/ui/assets/chunk-ATLVNIR6-rWg3qxof.js.gz +0 -0
- package/dist/ui/assets/{chunk-B4BG7PRW-B8b6dQQ2.js → chunk-B4BG7PRW-CgtLCbpE.js} +3 -3
- package/dist/ui/assets/chunk-B4BG7PRW-CgtLCbpE.js.gz +0 -0
- package/dist/ui/assets/{chunk-CVBHYZKI-D-mQAfrk.js → chunk-CVBHYZKI-DTL6Zgr0.js} +1 -1
- package/dist/ui/assets/{chunk-DI55MBZ5-BfATX3V8.js → chunk-DI55MBZ5-Dwvx2Kva.js} +1 -1
- package/dist/ui/assets/chunk-DI55MBZ5-Dwvx2Kva.js.gz +0 -0
- package/dist/ui/assets/chunk-EXTU4WIE-DHyaqTsP.js +1 -0
- package/dist/ui/assets/{chunk-FMBD7UC4-fqXscNvc.js → chunk-FMBD7UC4-BogA_9CV.js} +1 -1
- package/dist/ui/assets/{chunk-HN2XXSSU-BCHvD80g.js → chunk-HN2XXSSU-2blQO3Gb.js} +1 -1
- package/dist/ui/assets/chunk-HN2XXSSU-2blQO3Gb.js.gz +0 -0
- package/dist/ui/assets/chunk-JA3XYJ7Z-Cr1rmOui.js +11 -0
- package/dist/ui/assets/chunk-JA3XYJ7Z-Cr1rmOui.js.gz +0 -0
- package/dist/ui/assets/{chunk-JZLCHNYA-cKMooY3y.js → chunk-JZLCHNYA-BsgZ79Fa.js} +5 -5
- package/dist/ui/assets/chunk-JZLCHNYA-BsgZ79Fa.js.gz +0 -0
- package/dist/ui/assets/{chunk-MI3HLSF2-BlzO5wOE.js → chunk-MI3HLSF2-dwYeUy5S.js} +1 -1
- package/dist/ui/assets/chunk-MI3HLSF2-dwYeUy5S.js.gz +0 -0
- package/dist/ui/assets/chunk-N4CR4FBY-DEMgSRVe.js +2 -0
- package/dist/ui/assets/chunk-N4CR4FBY-DEMgSRVe.js.gz +0 -0
- package/dist/ui/assets/{chunk-QN33PNHL-DIHGQ_pd.js → chunk-QN33PNHL-DxdIDCAa.js} +1 -1
- package/dist/ui/assets/{chunk-QXUST7PY-C9l0muI0.js → chunk-QXUST7PY-BCK2V0i-.js} +2 -2
- package/dist/ui/assets/chunk-QXUST7PY-BCK2V0i-.js.gz +0 -0
- package/dist/ui/assets/chunk-QZHKN3VN-CALjGrEE.js +1 -0
- package/dist/ui/assets/chunk-S3R3BYOJ-GP3zIxrB.js +2 -0
- package/dist/ui/assets/chunk-S3R3BYOJ-GP3zIxrB.js.gz +0 -0
- package/dist/ui/assets/{chunk-TZMSLE5B-DZwI0C_2.js → chunk-TZMSLE5B-dX5RaM6g.js} +1 -1
- package/dist/ui/assets/chunk-TZMSLE5B-dX5RaM6g.js.gz +0 -0
- package/dist/ui/assets/classDiagram-2ON5EDUG-C3_RVP70.js +1 -0
- package/dist/ui/assets/classDiagram-v2-WZHVMYZB-C3_RVP70.js +1 -0
- package/dist/ui/assets/constants-GjIDNVyt.js +1 -0
- package/dist/ui/assets/{cose-bilkent-S5V4N54A-Ipik-oSD.js → cose-bilkent-S5V4N54A-Dx0BJVDl.js} +1 -1
- package/dist/ui/assets/cose-bilkent-S5V4N54A-Dx0BJVDl.js.gz +0 -0
- package/dist/ui/assets/cursor-QEb7m-rN.png +0 -0
- package/dist/ui/assets/{dagre-6UL2VRFP-BDpyWQnh.js → dagre-6UL2VRFP-DiQSUxqN.js} +1 -1
- package/dist/ui/assets/dagre-6UL2VRFP-DiQSUxqN.js.gz +0 -0
- package/dist/ui/assets/{dagre-CgA4KhUX.js → dagre-Bekd9Vdj.js} +1 -1
- package/dist/ui/assets/dagre-Bekd9Vdj.js.gz +0 -0
- package/dist/ui/assets/diagram-PSM6KHXK-DtJnDQjc.js +24 -0
- package/dist/ui/assets/diagram-PSM6KHXK-DtJnDQjc.js.gz +0 -0
- package/dist/ui/assets/{diagram-QEK2KX5R-BWPW28XI.js → diagram-QEK2KX5R-CobkCRdj.js} +1 -1
- package/dist/ui/assets/diagram-QEK2KX5R-CobkCRdj.js.gz +0 -0
- package/dist/ui/assets/{diagram-S2PKOQOG-BIHhcGoV.js → diagram-S2PKOQOG-DHEZYivc.js} +1 -1
- package/dist/ui/assets/diagram-S2PKOQOG-DHEZYivc.js.gz +0 -0
- package/dist/ui/assets/editor-DQIG-JYZ.js +43 -0
- package/dist/ui/assets/editor-DQIG-JYZ.js.gz +0 -0
- package/dist/ui/assets/emoji-B0hLmSLZ.js +3 -0
- package/dist/ui/assets/emoji-B0hLmSLZ.js.gz +0 -0
- package/dist/ui/assets/{erDiagram-Q2GNP2WA-ubTaAFcK.js → erDiagram-Q2GNP2WA-BVNeTZPQ.js} +2 -2
- package/dist/ui/assets/erDiagram-Q2GNP2WA-BVNeTZPQ.js.gz +0 -0
- package/dist/ui/assets/flowDiagram-NV44I4VS-C73VFdyk.js +162 -0
- package/dist/ui/assets/flowDiagram-NV44I4VS-C73VFdyk.js.gz +0 -0
- package/dist/ui/assets/ganttDiagram-LVOFAZNH-B_RosuD1.js +267 -0
- package/dist/ui/assets/ganttDiagram-LVOFAZNH-B_RosuD1.js.gz +0 -0
- package/dist/ui/assets/{gitGraph-F6HP7TQM-DghoobE6.js → gitGraph-F6HP7TQM-DMFIqn4h.js} +1 -1
- package/dist/ui/assets/gitGraphDiagram-NY62KEGX-hxbgwNA1.js +65 -0
- package/dist/ui/assets/gitGraphDiagram-NY62KEGX-hxbgwNA1.js.gz +0 -0
- package/dist/ui/assets/index-DTz1Dif6.js +64 -0
- package/dist/ui/assets/index-DTz1Dif6.js.gz +0 -0
- package/dist/ui/assets/index-qkT7Qqm2.css +1 -0
- package/dist/ui/assets/index-qkT7Qqm2.css.gz +0 -0
- package/dist/ui/assets/{info-NVLQJR56-0ZldEXPQ.js → info-NVLQJR56-DZ3K-w48.js} +1 -1
- package/dist/ui/assets/{infoDiagram-ER5ION4S-DMmPX-il.js → infoDiagram-ER5ION4S-CxnBJQu6.js} +1 -1
- package/dist/ui/assets/{journeyDiagram-XKPGCS4Q-CrVickA2.js → journeyDiagram-XKPGCS4Q-CHYNj-f8.js} +3 -3
- package/dist/ui/assets/journeyDiagram-XKPGCS4Q-CHYNj-f8.js.gz +0 -0
- package/dist/ui/assets/{kanban-definition-3W4ZIXB7-C_BsdHYL.js → kanban-definition-3W4ZIXB7-DQPCCsj2.js} +1 -1
- package/dist/ui/assets/kanban-definition-3W4ZIXB7-DQPCCsj2.js.gz +0 -0
- package/dist/ui/assets/{line-CfBP7Yic.js → line-DBRjKmfa.js} +1 -1
- package/dist/ui/assets/{linear-BsjageUB.js → linear-DFao5Wyp.js} +1 -1
- package/dist/ui/assets/linear-DFao5Wyp.js.gz +0 -0
- package/dist/ui/assets/{mermaid-parser.core-DZdP-NFq.js → mermaid-parser.core-DYCfacHj.js} +2 -2
- package/dist/ui/assets/mermaid-parser.core-DYCfacHj.js.gz +0 -0
- package/dist/ui/assets/mermaid.core-C6xGFSdE.js +11 -0
- package/dist/ui/assets/mermaid.core-C6xGFSdE.js.gz +0 -0
- package/dist/ui/assets/{mindmap-definition-VGOIOE7T-BbmaUjMY.js → mindmap-definition-VGOIOE7T-L3Pw-YM7.js} +1 -1
- package/dist/ui/assets/mindmap-definition-VGOIOE7T-L3Pw-YM7.js.gz +0 -0
- package/dist/ui/assets/{packet-BFZMPI3H-D_ZhkXuT.js → packet-BFZMPI3H-CpL6iNoa.js} +1 -1
- package/dist/ui/assets/{particles-Dv28pjOd.js → particles-CT8hcJOA.js} +1 -1
- package/dist/ui/assets/particles-CT8hcJOA.js.gz +0 -0
- package/dist/ui/assets/{pie-7BOR55EZ-Dn0Q3qNx.js → pie-7BOR55EZ-hTqChbTo.js} +1 -1
- package/dist/ui/assets/{pieDiagram-ADFJNKIX-BbyjfYu8.js → pieDiagram-ADFJNKIX-Bf4Nou75.js} +1 -1
- package/dist/ui/assets/pieDiagram-ADFJNKIX-Bf4Nou75.js.gz +0 -0
- package/dist/ui/assets/{quadrantDiagram-AYHSOK5B-Bc3GqMKz.js → quadrantDiagram-AYHSOK5B-DpjUTLB1.js} +3 -3
- package/dist/ui/assets/quadrantDiagram-AYHSOK5B-DpjUTLB1.js.gz +0 -0
- package/dist/ui/assets/{radar-NHE76QYJ-BHwoAy1q.js → radar-NHE76QYJ-myy7OENC.js} +1 -1
- package/dist/ui/assets/reactflow-Cubtnk8i.js +2 -0
- package/dist/ui/assets/reactflow-Cubtnk8i.js.gz +0 -0
- package/dist/ui/assets/{requirementDiagram-UZGBJVZJ-BQaKKL09.js → requirementDiagram-UZGBJVZJ-Bfrfh-0-.js} +1 -1
- package/dist/ui/assets/requirementDiagram-UZGBJVZJ-Bfrfh-0-.js.gz +0 -0
- package/dist/ui/assets/{sandpack-BQW_FQ7G.js → sandpack-C58bwfIS.js} +38 -38
- package/dist/ui/assets/sandpack-C58bwfIS.js.gz +0 -0
- package/dist/ui/assets/sandpackDefaults-Bkga8XAE.js +1 -0
- package/dist/ui/assets/sankeyDiagram-TZEHDZUN-ClZAZ6va.js +10 -0
- package/dist/ui/assets/sankeyDiagram-TZEHDZUN-ClZAZ6va.js.gz +0 -0
- package/dist/ui/assets/{sequenceDiagram-WL72ISMW-Dw32824o.js → sequenceDiagram-WL72ISMW-CNgly63p.js} +6 -6
- package/dist/ui/assets/sequenceDiagram-WL72ISMW-CNgly63p.js.gz +0 -0
- package/dist/ui/assets/src-DAeyG22O.js +34 -0
- package/dist/ui/assets/src-DAeyG22O.js.gz +0 -0
- package/dist/ui/assets/stateDiagram-FKZM4ZOC-BrEAoDpE.js +1 -0
- package/dist/ui/assets/stateDiagram-FKZM4ZOC-BrEAoDpE.js.gz +0 -0
- package/dist/ui/assets/stateDiagram-v2-4FDKWEC3-BNL52_oN.js +1 -0
- package/dist/ui/assets/streamdown-BdAVfkeF.js +521 -0
- package/dist/ui/assets/streamdown-BdAVfkeF.js.gz +0 -0
- package/dist/ui/assets/syntax-BOfTnQiy.js +9 -0
- package/dist/ui/assets/syntax-BOfTnQiy.js.gz +0 -0
- package/dist/ui/assets/{timeline-definition-IT6M3QCI-Jh_WZzXv.js → timeline-definition-IT6M3QCI-CaRH3k4l.js} +16 -16
- package/dist/ui/assets/timeline-definition-IT6M3QCI-CaRH3k4l.js.gz +0 -0
- package/dist/ui/assets/{treemap-KMMF4GRG-CPYIgjxE.js → treemap-KMMF4GRG-CUaLOV_B.js} +1 -1
- package/dist/ui/assets/{knowledgeRoutes-CivaUqha.js → useUserLocalStorage-C8sgXgXR.js} +1 -1
- package/dist/ui/assets/useUserLocalStorage-C8sgXgXR.js.gz +0 -0
- package/dist/ui/assets/{xychartDiagram-PRI3JC2R-CERc7Rdb.js → xychartDiagram-PRI3JC2R-BlhkI9T_.js} +1 -1
- package/dist/ui/assets/xychartDiagram-PRI3JC2R-BlhkI9T_.js.gz +0 -0
- package/dist/ui/index.html +13 -12
- package/dist/ui/index.html.gz +0 -0
- package/package.json +12 -10
- package/scripts/postinstall.js +27 -19
- package/dist/cli/commands/daemon/sync.d.ts.map +0 -1
- package/dist/ui/assets/App-9s2WHM6S.js +0 -22
- package/dist/ui/assets/App-9s2WHM6S.js.gz +0 -0
- package/dist/ui/assets/App-BAdBsEnV.css +0 -1
- package/dist/ui/assets/App-BAdBsEnV.css.gz +0 -0
- package/dist/ui/assets/ArtifactConsentModal-ParNk5kW.js +0 -1
- package/dist/ui/assets/ArtifactConsentModal-ParNk5kW.js.gz +0 -0
- package/dist/ui/assets/ArtifactFullscreenPage-VQxLMCiN.js +0 -9
- package/dist/ui/assets/ArtifactFullscreenPage-VQxLMCiN.js.gz +0 -0
- package/dist/ui/assets/AutocompleteTextarea-3RchrIgk.js +0 -18
- package/dist/ui/assets/AutocompleteTextarea-3RchrIgk.js.gz +0 -0
- package/dist/ui/assets/CodeEditor.inner-D51Z_CLQ.js +0 -8
- package/dist/ui/assets/CodeEditor.inner-D51Z_CLQ.js.gz +0 -0
- package/dist/ui/assets/ConversationView-Dyddw2b1.js +0 -34
- package/dist/ui/assets/ConversationView-Dyddw2b1.js.gz +0 -0
- package/dist/ui/assets/KnowledgePage-CdftslnF.js +0 -24
- package/dist/ui/assets/KnowledgePage-CdftslnF.js.gz +0 -0
- package/dist/ui/assets/MobileApp-BdBMpnJ1.js +0 -1
- package/dist/ui/assets/MobileApp-BdBMpnJ1.js.gz +0 -0
- package/dist/ui/assets/StreamdownDemoPage-B9wbgp2s.js.gz +0 -0
- package/dist/ui/assets/ThemeSwitcher-ubn6IOz9.js +0 -1
- package/dist/ui/assets/ThemeSwitcher-ubn6IOz9.js.gz +0 -0
- package/dist/ui/assets/antd-C-HfEC4E.js +0 -400
- package/dist/ui/assets/antd-C-HfEC4E.js.gz +0 -0
- package/dist/ui/assets/architecture-U656AL7Q-dkBewUpN.js +0 -1
- package/dist/ui/assets/architectureDiagram-VXUJARFQ-ChmZt3zk.js +0 -36
- package/dist/ui/assets/architectureDiagram-VXUJARFQ-ChmZt3zk.js.gz +0 -0
- package/dist/ui/assets/blockDiagram-VD42YOAC-CzGHAHao.js.gz +0 -0
- package/dist/ui/assets/c4Diagram-YG6GDRKO-DscJyaWN.js.gz +0 -0
- package/dist/ui/assets/channel-DvRQqEqC.js +0 -1
- package/dist/ui/assets/chunk-55IACEB6-DojF2pZN.js +0 -1
- package/dist/ui/assets/chunk-ABZYJK2D-RzDCrjE6.js.gz +0 -0
- package/dist/ui/assets/chunk-AGHRB4JF-jidCS5Of.js.gz +0 -0
- package/dist/ui/assets/chunk-ATLVNIR6-BEIIfJtC.js.gz +0 -0
- package/dist/ui/assets/chunk-B4BG7PRW-B8b6dQQ2.js.gz +0 -0
- package/dist/ui/assets/chunk-DI55MBZ5-BfATX3V8.js.gz +0 -0
- package/dist/ui/assets/chunk-EXTU4WIE-BKt6lPJM.js +0 -1
- package/dist/ui/assets/chunk-HN2XXSSU-BCHvD80g.js.gz +0 -0
- package/dist/ui/assets/chunk-JA3XYJ7Z-Cp6dqHnY.js +0 -11
- package/dist/ui/assets/chunk-JA3XYJ7Z-Cp6dqHnY.js.gz +0 -0
- package/dist/ui/assets/chunk-JZLCHNYA-cKMooY3y.js.gz +0 -0
- package/dist/ui/assets/chunk-MI3HLSF2-BlzO5wOE.js.gz +0 -0
- package/dist/ui/assets/chunk-N4CR4FBY-pASDorUx.js +0 -2
- package/dist/ui/assets/chunk-N4CR4FBY-pASDorUx.js.gz +0 -0
- package/dist/ui/assets/chunk-QXUST7PY-C9l0muI0.js.gz +0 -0
- package/dist/ui/assets/chunk-QZHKN3VN-CZskCFCf.js +0 -1
- package/dist/ui/assets/chunk-S3R3BYOJ-VJiLzt2o.js +0 -2
- package/dist/ui/assets/chunk-S3R3BYOJ-VJiLzt2o.js.gz +0 -0
- package/dist/ui/assets/chunk-TZMSLE5B-DZwI0C_2.js.gz +0 -0
- package/dist/ui/assets/classDiagram-2ON5EDUG-BFASUbmZ.js +0 -1
- package/dist/ui/assets/classDiagram-v2-WZHVMYZB-BFASUbmZ.js +0 -1
- package/dist/ui/assets/cose-bilkent-S5V4N54A-Ipik-oSD.js.gz +0 -0
- package/dist/ui/assets/dagre-6UL2VRFP-BDpyWQnh.js.gz +0 -0
- package/dist/ui/assets/dagre-CgA4KhUX.js.gz +0 -0
- package/dist/ui/assets/diagram-PSM6KHXK-B4GRzxLJ.js +0 -24
- package/dist/ui/assets/diagram-PSM6KHXK-B4GRzxLJ.js.gz +0 -0
- package/dist/ui/assets/diagram-QEK2KX5R-BWPW28XI.js.gz +0 -0
- package/dist/ui/assets/diagram-S2PKOQOG-BIHhcGoV.js.gz +0 -0
- package/dist/ui/assets/editor-C-HJ7Yw0.js +0 -39
- package/dist/ui/assets/editor-C-HJ7Yw0.js.gz +0 -0
- package/dist/ui/assets/emoji-D8F6B62m.js +0 -3
- package/dist/ui/assets/emoji-D8F6B62m.js.gz +0 -0
- package/dist/ui/assets/erDiagram-Q2GNP2WA-ubTaAFcK.js.gz +0 -0
- package/dist/ui/assets/flowDiagram-NV44I4VS-BHLCTYjI.js +0 -162
- package/dist/ui/assets/flowDiagram-NV44I4VS-BHLCTYjI.js.gz +0 -0
- package/dist/ui/assets/ganttDiagram-LVOFAZNH-ClC3pay1.js +0 -267
- package/dist/ui/assets/ganttDiagram-LVOFAZNH-ClC3pay1.js.gz +0 -0
- package/dist/ui/assets/gitGraphDiagram-NY62KEGX-Clqpiswu.js +0 -65
- package/dist/ui/assets/gitGraphDiagram-NY62KEGX-Clqpiswu.js.gz +0 -0
- package/dist/ui/assets/index-D9OElx9A.css +0 -1
- package/dist/ui/assets/index-D9OElx9A.css.gz +0 -0
- package/dist/ui/assets/index-DxPuzG7E.js +0 -350
- package/dist/ui/assets/index-DxPuzG7E.js.gz +0 -0
- package/dist/ui/assets/journeyDiagram-XKPGCS4Q-CrVickA2.js.gz +0 -0
- package/dist/ui/assets/kanban-definition-3W4ZIXB7-C_BsdHYL.js.gz +0 -0
- package/dist/ui/assets/katex-CamJ39w1.js +0 -257
- package/dist/ui/assets/katex-CamJ39w1.js.gz +0 -0
- package/dist/ui/assets/knowledgeRoutes-CivaUqha.js.gz +0 -0
- package/dist/ui/assets/linear-BsjageUB.js.gz +0 -0
- package/dist/ui/assets/mermaid-parser.core-DZdP-NFq.js.gz +0 -0
- package/dist/ui/assets/mermaid.core-TNrI0pHG.js +0 -11
- package/dist/ui/assets/mermaid.core-TNrI0pHG.js.gz +0 -0
- package/dist/ui/assets/message-BtWWJ9Af.js +0 -36
- package/dist/ui/assets/message-BtWWJ9Af.js.gz +0 -0
- package/dist/ui/assets/mindmap-definition-VGOIOE7T-BbmaUjMY.js.gz +0 -0
- package/dist/ui/assets/particles-Dv28pjOd.js.gz +0 -0
- package/dist/ui/assets/pieDiagram-ADFJNKIX-BbyjfYu8.js.gz +0 -0
- package/dist/ui/assets/quadrantDiagram-AYHSOK5B-Bc3GqMKz.js.gz +0 -0
- package/dist/ui/assets/reactflow-BVYPxNhc.js +0 -2
- package/dist/ui/assets/reactflow-BVYPxNhc.js.gz +0 -0
- package/dist/ui/assets/requirementDiagram-UZGBJVZJ-BQaKKL09.js.gz +0 -0
- package/dist/ui/assets/sandpack-BQW_FQ7G.js.gz +0 -0
- package/dist/ui/assets/sankeyDiagram-TZEHDZUN-DiJvDvhb.js +0 -10
- package/dist/ui/assets/sankeyDiagram-TZEHDZUN-DiJvDvhb.js.gz +0 -0
- package/dist/ui/assets/sequenceDiagram-WL72ISMW-Dw32824o.js.gz +0 -0
- package/dist/ui/assets/stateDiagram-FKZM4ZOC-BCOpNdHV.js +0 -1
- package/dist/ui/assets/stateDiagram-FKZM4ZOC-BCOpNdHV.js.gz +0 -0
- package/dist/ui/assets/stateDiagram-v2-4FDKWEC3-Cuqwvgfg.js +0 -1
- package/dist/ui/assets/syntax-VJrU5BEu.js +0 -10
- package/dist/ui/assets/syntax-VJrU5BEu.js.gz +0 -0
- package/dist/ui/assets/theme-DZtFA8b4.js +0 -1
- package/dist/ui/assets/timeline-definition-IT6M3QCI-Jh_WZzXv.js.gz +0 -0
- package/dist/ui/assets/xychartDiagram-PRI3JC2R-CERc7Rdb.js.gz +0 -0
- /package/dist/cli/commands/{admin → local}/sync-unix.d.ts +0 -0
|
@@ -341,12 +341,16 @@ var TABLE_MAX_ROWS = 100;
|
|
|
341
341
|
var TABLE_MAX_COLS = 20;
|
|
342
342
|
var TABLE_MAX_CELL_CHARS = 3e3;
|
|
343
343
|
var SECTION_MAX_CHARS = 3e3;
|
|
344
|
+
var MARKDOWN_BLOCK_MAX_CHARS = 12e3;
|
|
344
345
|
var MAX_TABLES_PER_MESSAGE = 1;
|
|
345
346
|
var MAX_BLOCKS_PER_MESSAGE = 50;
|
|
346
347
|
var BLOCK_PAYLOAD_ERRORS = /* @__PURE__ */ new Set([
|
|
347
348
|
"invalid_blocks",
|
|
348
349
|
"invalid_blocks_format",
|
|
349
|
-
"
|
|
350
|
+
"invalid_block_type",
|
|
351
|
+
"message_blocks_too_long",
|
|
352
|
+
"unknown_block_type",
|
|
353
|
+
"unsupported_block_type"
|
|
350
354
|
]);
|
|
351
355
|
var FENCE_LINE_RE = /^(`{3,}|~{3,})/;
|
|
352
356
|
var PIPE_LINE_RE = /^\s*\|/;
|
|
@@ -373,6 +377,11 @@ function hasActiveMention2(text, mentionPattern) {
|
|
|
373
377
|
mentionPattern.lastIndex = 0;
|
|
374
378
|
return mentionPattern.test(stripped);
|
|
375
379
|
}
|
|
380
|
+
function slackTsToIso(ts) {
|
|
381
|
+
const seconds = Number(ts.split(".")[0]);
|
|
382
|
+
if (!Number.isFinite(seconds)) return (/* @__PURE__ */ new Date()).toISOString();
|
|
383
|
+
return new Date(seconds * 1e3).toISOString();
|
|
384
|
+
}
|
|
376
385
|
function segmentMarkdown(md) {
|
|
377
386
|
const lines = md.split(/\r?\n/);
|
|
378
387
|
const segments = [];
|
|
@@ -519,12 +528,35 @@ ${tableLines.join("\n")}
|
|
|
519
528
|
text: { type: "mrkdwn", text: wrapped }
|
|
520
529
|
};
|
|
521
530
|
}
|
|
531
|
+
function buildMarkdownBlock(markdown) {
|
|
532
|
+
const trimmed = markdown.trim();
|
|
533
|
+
if (trimmed.length === 0 || trimmed.length > MARKDOWN_BLOCK_MAX_CHARS) return null;
|
|
534
|
+
return { type: "markdown", text: markdown };
|
|
535
|
+
}
|
|
536
|
+
function tableHasRichMarkdown(tableLines) {
|
|
537
|
+
return tableLines.some(
|
|
538
|
+
(line) => /(\*\*|__|~~|`|\[[^\]]+\]\([^)]*\)|<br\s*\/?\s*>|_[^_|]+_|(^|\|)\s*[-*+]\s+)/i.test(line)
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
function shouldUseNativeMarkdownBlock(markdown, segments) {
|
|
542
|
+
if (!buildMarkdownBlock(markdown)) return false;
|
|
543
|
+
const tableSegments = segments.filter((segment) => segment.kind === "table");
|
|
544
|
+
if (tableSegments.length > 1) return true;
|
|
545
|
+
return tableSegments.some((segment) => tableHasRichMarkdown(segment.lines));
|
|
546
|
+
}
|
|
522
547
|
function markdownToSlackPayload(markdown) {
|
|
523
548
|
const text = markdownToMrkdwn(markdown);
|
|
524
549
|
const segments = segmentMarkdown(markdown);
|
|
525
|
-
|
|
550
|
+
const hasTable = segments.some((s) => s.kind === "table");
|
|
551
|
+
if (!hasTable) {
|
|
526
552
|
return { text };
|
|
527
553
|
}
|
|
554
|
+
if (shouldUseNativeMarkdownBlock(markdown, segments)) {
|
|
555
|
+
const markdownBlock = buildMarkdownBlock(markdown);
|
|
556
|
+
if (markdownBlock) {
|
|
557
|
+
return { text, blocks: [markdownBlock] };
|
|
558
|
+
}
|
|
559
|
+
}
|
|
528
560
|
const blocks = [];
|
|
529
561
|
let tablesEmitted = 0;
|
|
530
562
|
for (const seg of segments) {
|
|
@@ -554,6 +586,64 @@ function extractSlackErrorCode(resultOrError) {
|
|
|
554
586
|
const candidate = resultOrError;
|
|
555
587
|
return candidate.data?.error ?? candidate.error;
|
|
556
588
|
}
|
|
589
|
+
function extractSlackErrorDetail(resultOrError) {
|
|
590
|
+
if (typeof resultOrError !== "object" || resultOrError === null) return {};
|
|
591
|
+
const candidate = resultOrError;
|
|
592
|
+
return {
|
|
593
|
+
code: candidate.data?.error ?? candidate.error ?? candidate.code,
|
|
594
|
+
needed: candidate.data?.needed ?? candidate.needed,
|
|
595
|
+
provided: candidate.data?.provided ?? candidate.provided,
|
|
596
|
+
retryAfter: candidate.retryAfter
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
var BOT_TOKEN_ERROR_REASONS = {
|
|
600
|
+
invalid_auth: "The bot token is invalid.",
|
|
601
|
+
account_inactive: "The bot token belongs to a deleted or deactivated account or workspace.",
|
|
602
|
+
token_revoked: "The bot token has been revoked.",
|
|
603
|
+
token_expired: "The bot token has expired.",
|
|
604
|
+
not_authed: "No bot token was provided.",
|
|
605
|
+
no_permission: "The bot token lacks permission to call auth.test."
|
|
606
|
+
};
|
|
607
|
+
var CHANNEL_ACCESS_ERROR_REASONS = {
|
|
608
|
+
not_in_channel: "The bot is not a member of this channel; invite it so it can read messages.",
|
|
609
|
+
channel_not_found: "The channel ID was not found, or the bot cannot see it.",
|
|
610
|
+
is_archived: "The channel is archived."
|
|
611
|
+
};
|
|
612
|
+
function buildTestFailure(capability, detail, reasons) {
|
|
613
|
+
const { code, needed, provided, retryAfter } = detail;
|
|
614
|
+
let reason;
|
|
615
|
+
if (code === "missing_scope") {
|
|
616
|
+
reason = needed ? `Slack reports a missing OAuth scope; add "${needed}".` : "Slack reports a missing OAuth scope.";
|
|
617
|
+
} else if (code === "ratelimited" || retryAfter != null) {
|
|
618
|
+
reason = retryAfter != null ? `Slack rate-limited the probe; retry after ${retryAfter}s. The probe did not retry.` : "Slack rate-limited the probe. The probe did not retry.";
|
|
619
|
+
} else if (code && reasons[code]) {
|
|
620
|
+
reason = reasons[code];
|
|
621
|
+
} else if (code) {
|
|
622
|
+
reason = `Slack returned error "${code}".`;
|
|
623
|
+
} else {
|
|
624
|
+
reason = "A network or unexpected error occurred while contacting Slack.";
|
|
625
|
+
}
|
|
626
|
+
const failure = { capability, reason };
|
|
627
|
+
if (code) failure.slackError = code;
|
|
628
|
+
if (needed) failure.needed = needed;
|
|
629
|
+
if (provided) failure.provided = provided;
|
|
630
|
+
return failure;
|
|
631
|
+
}
|
|
632
|
+
function normalizeAllowedChannelIds(raw) {
|
|
633
|
+
if (Array.isArray(raw)) return raw.filter((id) => typeof id === "string");
|
|
634
|
+
if (typeof raw === "string" && raw) return [raw];
|
|
635
|
+
return [];
|
|
636
|
+
}
|
|
637
|
+
var SLACK_NOT_VERIFIABLE = [
|
|
638
|
+
"Whether the bot token and app-level token belong to the same Slack app.",
|
|
639
|
+
"Whether the required Slack event subscriptions are installed and delivering events.",
|
|
640
|
+
"Whether the full set of required OAuth scopes is granted \u2014 only scopes exercised by the probed API calls are checked."
|
|
641
|
+
];
|
|
642
|
+
function isChannelAllowedByWhitelist(channelType, channelId, allowedChannelIds) {
|
|
643
|
+
if (channelType === "im") return true;
|
|
644
|
+
if (!allowedChannelIds || allowedChannelIds.length === 0) return true;
|
|
645
|
+
return !!channelId && allowedChannelIds.includes(channelId);
|
|
646
|
+
}
|
|
557
647
|
var SlackConnector = class _SlackConnector {
|
|
558
648
|
channelType = "slack";
|
|
559
649
|
web;
|
|
@@ -562,12 +652,15 @@ var SlackConnector = class _SlackConnector {
|
|
|
562
652
|
botUserId = null;
|
|
563
653
|
/** Cache: Slack user ID → profile (email + display name, or null if unavailable). */
|
|
564
654
|
userProfileCache = /* @__PURE__ */ new Map();
|
|
655
|
+
inboundEventDedup = /* @__PURE__ */ new Map();
|
|
565
656
|
/** Cache: Slack channel ID → channel name */
|
|
566
657
|
channelNameCache = /* @__PURE__ */ new Map();
|
|
567
658
|
static USER_CACHE_TTL_MS = 15 * 60 * 1e3;
|
|
568
659
|
// 15 min for successful lookups
|
|
569
660
|
static USER_CACHE_ERROR_TTL_MS = 60 * 1e3;
|
|
570
661
|
// 1 min for errors (transient recovery)
|
|
662
|
+
static INBOUND_EVENT_DEDUP_TTL_MS = 5 * 60 * 1e3;
|
|
663
|
+
// Slack may send message + app_mention for one user action
|
|
571
664
|
/**
|
|
572
665
|
* Cache: Slack channel ID → channel type string (channel/group/mpim/im).
|
|
573
666
|
*
|
|
@@ -590,6 +683,122 @@ var SlackConnector = class _SlackConnector {
|
|
|
590
683
|
}
|
|
591
684
|
this.web = new WebClient(this.config.bot_token);
|
|
592
685
|
}
|
|
686
|
+
/**
|
|
687
|
+
* Build a Slack WebClient for an arbitrary token. Isolated so connection
|
|
688
|
+
* probes can construct a client for the app-level (`xapp-`) token, and so
|
|
689
|
+
* tests can stub the app-token client independently of `this.web`.
|
|
690
|
+
*/
|
|
691
|
+
createWebClient(token) {
|
|
692
|
+
return new WebClient(token);
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* Best-effort probe of the configured Slack credentials and reachability.
|
|
696
|
+
*
|
|
697
|
+
* Probes capabilities directly rather than diffing scope-header strings:
|
|
698
|
+
* - `auth.test()` with the bot token → team + bot identity.
|
|
699
|
+
* - `apps.connections.open()` with the app-level token → Socket Mode /
|
|
700
|
+
* `connections:write` validity.
|
|
701
|
+
* - `conversations.info` on the first whitelisted channel (when any) →
|
|
702
|
+
* channel reachability.
|
|
703
|
+
*
|
|
704
|
+
* Slack's `missing_scope` needed/provided detail and rate-limit `Retry-After`
|
|
705
|
+
* are surfaced verbatim. Never logs or returns token values.
|
|
706
|
+
*/
|
|
707
|
+
async testConnection() {
|
|
708
|
+
const failures = [];
|
|
709
|
+
const notVerifiable = [...SLACK_NOT_VERIFIABLE];
|
|
710
|
+
let team;
|
|
711
|
+
let bot;
|
|
712
|
+
let botTokenValid = false;
|
|
713
|
+
try {
|
|
714
|
+
const authTest = await this.web.auth.test();
|
|
715
|
+
if (authTest.ok) {
|
|
716
|
+
botTokenValid = true;
|
|
717
|
+
team = { id: authTest.team_id ?? "", name: authTest.team ?? "" };
|
|
718
|
+
bot = { userId: authTest.user_id ?? "", name: authTest.user ?? "" };
|
|
719
|
+
} else {
|
|
720
|
+
failures.push(
|
|
721
|
+
buildTestFailure("bot_token", extractSlackErrorDetail(authTest), BOT_TOKEN_ERROR_REASONS)
|
|
722
|
+
);
|
|
723
|
+
}
|
|
724
|
+
} catch (error) {
|
|
725
|
+
failures.push(
|
|
726
|
+
buildTestFailure("bot_token", extractSlackErrorDetail(error), BOT_TOKEN_ERROR_REASONS)
|
|
727
|
+
);
|
|
728
|
+
}
|
|
729
|
+
let appTokenValid;
|
|
730
|
+
const appToken = this.config.app_token;
|
|
731
|
+
if (!appToken) {
|
|
732
|
+
appTokenValid = false;
|
|
733
|
+
failures.push({
|
|
734
|
+
capability: "app_token",
|
|
735
|
+
reason: "No app-level token is configured; Socket Mode cannot connect to receive messages."
|
|
736
|
+
});
|
|
737
|
+
} else {
|
|
738
|
+
try {
|
|
739
|
+
const appClient = this.createWebClient(appToken);
|
|
740
|
+
const res = await appClient.apps.connections.open();
|
|
741
|
+
if (res.ok) {
|
|
742
|
+
appTokenValid = true;
|
|
743
|
+
} else {
|
|
744
|
+
appTokenValid = false;
|
|
745
|
+
failures.push(buildTestFailure("app_token", extractSlackErrorDetail(res), {}));
|
|
746
|
+
}
|
|
747
|
+
} catch (error) {
|
|
748
|
+
appTokenValid = false;
|
|
749
|
+
failures.push(buildTestFailure("app_token", extractSlackErrorDetail(error), {}));
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
let channelAccess;
|
|
753
|
+
const allowedChannelIds = normalizeAllowedChannelIds(this.config.allowed_channel_ids);
|
|
754
|
+
if (allowedChannelIds.length > 0) {
|
|
755
|
+
const channelId = allowedChannelIds[0];
|
|
756
|
+
let channelOk = false;
|
|
757
|
+
try {
|
|
758
|
+
const info = await this.web.conversations.info({ channel: channelId });
|
|
759
|
+
if (info.ok) {
|
|
760
|
+
channelOk = true;
|
|
761
|
+
} else {
|
|
762
|
+
failures.push(
|
|
763
|
+
buildTestFailure(
|
|
764
|
+
"channel_access",
|
|
765
|
+
extractSlackErrorDetail(info),
|
|
766
|
+
CHANNEL_ACCESS_ERROR_REASONS
|
|
767
|
+
)
|
|
768
|
+
);
|
|
769
|
+
}
|
|
770
|
+
} catch (error) {
|
|
771
|
+
failures.push(
|
|
772
|
+
buildTestFailure(
|
|
773
|
+
"channel_access",
|
|
774
|
+
extractSlackErrorDetail(error),
|
|
775
|
+
CHANNEL_ACCESS_ERROR_REASONS
|
|
776
|
+
)
|
|
777
|
+
);
|
|
778
|
+
}
|
|
779
|
+
channelAccess = [{ channelId, ok: channelOk }];
|
|
780
|
+
if (allowedChannelIds.length > 1) {
|
|
781
|
+
notVerifiable.push(
|
|
782
|
+
`Only the first of ${allowedChannelIds.length} configured channels was probed; the rest were not checked.`
|
|
783
|
+
);
|
|
784
|
+
}
|
|
785
|
+
} else {
|
|
786
|
+
notVerifiable.push(
|
|
787
|
+
"No channel whitelist is configured, so no specific channel reachability was verified."
|
|
788
|
+
);
|
|
789
|
+
}
|
|
790
|
+
const channelsOk = !channelAccess || channelAccess.some((c) => c.ok);
|
|
791
|
+
const ok = botTokenValid && appTokenValid && channelsOk && failures.length === 0;
|
|
792
|
+
return {
|
|
793
|
+
ok,
|
|
794
|
+
...team ? { team } : {},
|
|
795
|
+
...bot ? { bot } : {},
|
|
796
|
+
appTokenValid,
|
|
797
|
+
...channelAccess ? { channelAccess } : {},
|
|
798
|
+
failures,
|
|
799
|
+
notVerifiable
|
|
800
|
+
};
|
|
801
|
+
}
|
|
593
802
|
/**
|
|
594
803
|
* Look up a Slack user's email address by their user ID.
|
|
595
804
|
*
|
|
@@ -626,11 +835,7 @@ var SlackConnector = class _SlackConnector {
|
|
|
626
835
|
displayName,
|
|
627
836
|
expiresAt: now + _SlackConnector.USER_CACHE_TTL_MS
|
|
628
837
|
});
|
|
629
|
-
if (email) {
|
|
630
|
-
console.log(
|
|
631
|
-
`[slack] Resolved user ${slackUserId} \u2192 ${displayName ?? "(no name)"} <${email}>`
|
|
632
|
-
);
|
|
633
|
-
} else {
|
|
838
|
+
if (!email) {
|
|
634
839
|
console.log(
|
|
635
840
|
`[slack] User ${slackUserId} has no email (missing users:read.email scope or restricted account)`
|
|
636
841
|
);
|
|
@@ -646,6 +851,33 @@ var SlackConnector = class _SlackConnector {
|
|
|
646
851
|
return { email: null, displayName: null };
|
|
647
852
|
}
|
|
648
853
|
}
|
|
854
|
+
/**
|
|
855
|
+
* Look up a Slack user by email and return display metadata including a
|
|
856
|
+
* high-resolution avatar URL. Used by Agor's admin-triggered user avatar
|
|
857
|
+
* sync. Prefer image_512 for crisp large/retina rendering, falling back to
|
|
858
|
+
* smaller Slack-provided variants.
|
|
859
|
+
*/
|
|
860
|
+
async lookupUserAvatarByEmail(email) {
|
|
861
|
+
const normalized = email.trim().toLowerCase();
|
|
862
|
+
if (!normalized) throw new Error("Slack user email is required");
|
|
863
|
+
const result = await this.web.users.lookupByEmail({ email: normalized }).catch((error) => {
|
|
864
|
+
if (extractSlackErrorCode(error) === "users_not_found") {
|
|
865
|
+
return null;
|
|
866
|
+
}
|
|
867
|
+
throw error;
|
|
868
|
+
});
|
|
869
|
+
if (!result?.ok || !result.user?.id) {
|
|
870
|
+
return null;
|
|
871
|
+
}
|
|
872
|
+
const profile = result.user.profile;
|
|
873
|
+
const avatarUrl = profile?.image_512 || profile?.image_original || profile?.image_1024 || profile?.image_192 || profile?.image_72 || profile?.image_48 || null;
|
|
874
|
+
return {
|
|
875
|
+
slackUserId: result.user.id,
|
|
876
|
+
email: profile?.email ?? normalized,
|
|
877
|
+
displayName: profile?.display_name || profile?.real_name || result.user.real_name || result.user.name || null,
|
|
878
|
+
avatarUrl
|
|
879
|
+
};
|
|
880
|
+
}
|
|
649
881
|
/**
|
|
650
882
|
* Look up a Slack channel's name by its ID.
|
|
651
883
|
*
|
|
@@ -679,6 +911,47 @@ var SlackConnector = class _SlackConnector {
|
|
|
679
911
|
return null;
|
|
680
912
|
}
|
|
681
913
|
}
|
|
914
|
+
async lookupLatestThreadReply(event) {
|
|
915
|
+
const channel = typeof event.channel === "string" ? event.channel : void 0;
|
|
916
|
+
const message = typeof event.message === "object" && event.message !== null ? event.message : void 0;
|
|
917
|
+
const threadTs = (typeof message?.thread_ts === "string" ? message.thread_ts : void 0) ?? (typeof message?.ts === "string" ? message.ts : void 0) ?? (typeof event.thread_ts === "string" ? event.thread_ts : void 0);
|
|
918
|
+
const replies = Array.isArray(message?.replies) ? message.replies.filter((reply) => {
|
|
919
|
+
return typeof reply === "object" && reply !== null;
|
|
920
|
+
}) : [];
|
|
921
|
+
const latestReplyTs = (typeof message?.latest_reply === "string" ? message.latest_reply : void 0) ?? (typeof event.latest_reply === "string" ? event.latest_reply : void 0) ?? [...replies].reverse().map((reply) => typeof reply.ts === "string" ? reply.ts : void 0).find(Boolean);
|
|
922
|
+
if (!channel || !threadTs || !latestReplyTs) return null;
|
|
923
|
+
try {
|
|
924
|
+
const result = await this.web.conversations.replies({
|
|
925
|
+
channel,
|
|
926
|
+
ts: threadTs,
|
|
927
|
+
oldest: latestReplyTs,
|
|
928
|
+
inclusive: true,
|
|
929
|
+
limit: 1
|
|
930
|
+
});
|
|
931
|
+
const reply = result.messages?.find((candidate) => candidate.ts === latestReplyTs) ?? result.messages?.[0] ?? null;
|
|
932
|
+
if (!reply) return null;
|
|
933
|
+
return {
|
|
934
|
+
...reply,
|
|
935
|
+
channel,
|
|
936
|
+
thread_ts: typeof reply.thread_ts === "string" ? reply.thread_ts : threadTs,
|
|
937
|
+
team: event.team
|
|
938
|
+
};
|
|
939
|
+
} catch (error) {
|
|
940
|
+
console.warn("[slack] Failed to fetch latest thread reply for message_replied event:", error);
|
|
941
|
+
return null;
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
shouldProcessInboundEventOnce(channel, ts) {
|
|
945
|
+
if (!channel || !ts) return true;
|
|
946
|
+
const now = Date.now();
|
|
947
|
+
for (const [key2, expiresAt] of this.inboundEventDedup) {
|
|
948
|
+
if (expiresAt <= now) this.inboundEventDedup.delete(key2);
|
|
949
|
+
}
|
|
950
|
+
const key = `${channel}:${ts}`;
|
|
951
|
+
if (this.inboundEventDedup.has(key)) return false;
|
|
952
|
+
this.inboundEventDedup.set(key, now + _SlackConnector.INBOUND_EVENT_DEDUP_TTL_MS);
|
|
953
|
+
return true;
|
|
954
|
+
}
|
|
682
955
|
/**
|
|
683
956
|
* Cache a known channel type from a trusted source (e.g. `message` event with explicit `channel_type`).
|
|
684
957
|
*/
|
|
@@ -724,7 +997,6 @@ var SlackConnector = class _SlackConnector {
|
|
|
724
997
|
} else {
|
|
725
998
|
resolvedType = "channel";
|
|
726
999
|
}
|
|
727
|
-
console.log(`[slack] conversations.info resolved channel ${channelId} \u2192 ${resolvedType}`);
|
|
728
1000
|
this.cacheChannelType(channelId, resolvedType);
|
|
729
1001
|
if (ch.name) {
|
|
730
1002
|
this.channelNameCache.set(channelId, {
|
|
@@ -770,22 +1042,34 @@ var SlackConnector = class _SlackConnector {
|
|
|
770
1042
|
async sendMessage(req) {
|
|
771
1043
|
const { channel, thread_ts } = parseThreadId2(req.threadId);
|
|
772
1044
|
const blocks = req.blocks && req.blocks.length > 0 ? req.blocks : void 0;
|
|
773
|
-
const
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
1045
|
+
const updateTs = typeof req.metadata?.slack_update_ts === "string" ? req.metadata.slack_update_ts : void 0;
|
|
1046
|
+
const send = (withBlocks) => {
|
|
1047
|
+
const base = {
|
|
1048
|
+
channel,
|
|
1049
|
+
text: req.text,
|
|
1050
|
+
...withBlocks && blocks ? { blocks } : {},
|
|
1051
|
+
unfurl_links: false,
|
|
1052
|
+
unfurl_media: false
|
|
1053
|
+
};
|
|
1054
|
+
if (updateTs) {
|
|
1055
|
+
return this.web.chat.update({
|
|
1056
|
+
...base,
|
|
1057
|
+
ts: updateTs
|
|
1058
|
+
});
|
|
1059
|
+
}
|
|
1060
|
+
return this.web.chat.postMessage({
|
|
1061
|
+
...base,
|
|
1062
|
+
thread_ts
|
|
1063
|
+
});
|
|
1064
|
+
};
|
|
781
1065
|
let result;
|
|
782
1066
|
try {
|
|
783
|
-
result = await
|
|
1067
|
+
result = await send(true);
|
|
784
1068
|
} catch (err) {
|
|
785
1069
|
const code = extractSlackErrorCode(err);
|
|
786
1070
|
if (blocks && code && BLOCK_PAYLOAD_ERRORS.has(code)) {
|
|
787
1071
|
console.warn(`[slack] Block payload rejected (${code}); retrying as text-only`);
|
|
788
|
-
result = await
|
|
1072
|
+
result = await send(false);
|
|
789
1073
|
} else {
|
|
790
1074
|
throw err;
|
|
791
1075
|
}
|
|
@@ -794,7 +1078,7 @@ var SlackConnector = class _SlackConnector {
|
|
|
794
1078
|
const code = extractSlackErrorCode(result);
|
|
795
1079
|
if (blocks && code && BLOCK_PAYLOAD_ERRORS.has(code)) {
|
|
796
1080
|
console.warn(`[slack] Block payload rejected (${code}); retrying as text-only`);
|
|
797
|
-
const retry = await
|
|
1081
|
+
const retry = await send(false);
|
|
798
1082
|
if (!retry.ok || !retry.ts) {
|
|
799
1083
|
throw new Error(`Slack API error: ${retry.error ?? "unknown error"}`);
|
|
800
1084
|
}
|
|
@@ -805,6 +1089,234 @@ var SlackConnector = class _SlackConnector {
|
|
|
805
1089
|
}
|
|
806
1090
|
return result.ts;
|
|
807
1091
|
}
|
|
1092
|
+
/**
|
|
1093
|
+
* Send directly to a Slack channel or thread. Used for proactive outbound
|
|
1094
|
+
* emits where no gateway thread_session_map exists yet.
|
|
1095
|
+
*/
|
|
1096
|
+
async sendSlackMessage(req) {
|
|
1097
|
+
const blocks = req.blocks && req.blocks.length > 0 ? req.blocks : void 0;
|
|
1098
|
+
const send = (withBlocks) => this.web.chat.postMessage({
|
|
1099
|
+
channel: req.channel,
|
|
1100
|
+
text: req.text,
|
|
1101
|
+
...withBlocks && blocks ? { blocks } : {},
|
|
1102
|
+
...req.thread_ts ? { thread_ts: req.thread_ts } : {},
|
|
1103
|
+
unfurl_links: false,
|
|
1104
|
+
unfurl_media: false
|
|
1105
|
+
});
|
|
1106
|
+
let result;
|
|
1107
|
+
try {
|
|
1108
|
+
result = await send(true);
|
|
1109
|
+
} catch (err) {
|
|
1110
|
+
const code = extractSlackErrorCode(err);
|
|
1111
|
+
if (blocks && code && BLOCK_PAYLOAD_ERRORS.has(code)) {
|
|
1112
|
+
console.warn(`[slack] Block payload rejected (${code}); retrying direct send as text-only`);
|
|
1113
|
+
result = await send(false);
|
|
1114
|
+
} else {
|
|
1115
|
+
throw err;
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
if (!result.ok || !result.ts) {
|
|
1119
|
+
const code = extractSlackErrorCode(result);
|
|
1120
|
+
if (blocks && code && BLOCK_PAYLOAD_ERRORS.has(code)) {
|
|
1121
|
+
const retry = await send(false);
|
|
1122
|
+
if (!retry.ok || !retry.ts) {
|
|
1123
|
+
throw new Error(`Slack API error: ${retry.error ?? "unknown error"}`);
|
|
1124
|
+
}
|
|
1125
|
+
result = retry;
|
|
1126
|
+
} else {
|
|
1127
|
+
throw new Error(`Slack API error: ${result.error ?? "unknown error"}`);
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
const sentTs = result.ts;
|
|
1131
|
+
if (!sentTs) {
|
|
1132
|
+
throw new Error("Slack API error: missing message timestamp");
|
|
1133
|
+
}
|
|
1134
|
+
let permalink = null;
|
|
1135
|
+
try {
|
|
1136
|
+
const link = await this.web.chat.getPermalink({ channel: req.channel, message_ts: sentTs });
|
|
1137
|
+
permalink = link.ok ? link.permalink ?? null : null;
|
|
1138
|
+
} catch {
|
|
1139
|
+
permalink = null;
|
|
1140
|
+
}
|
|
1141
|
+
return {
|
|
1142
|
+
ts: sentTs,
|
|
1143
|
+
channel: req.channel,
|
|
1144
|
+
thread_ts: req.thread_ts ?? sentTs,
|
|
1145
|
+
permalink
|
|
1146
|
+
};
|
|
1147
|
+
}
|
|
1148
|
+
/** Resolve a Slack channel by its human name (with or without #). */
|
|
1149
|
+
async resolveChannelByName(name) {
|
|
1150
|
+
const normalized = name.replace(/^#/, "").trim().toLowerCase();
|
|
1151
|
+
if (!normalized) throw new Error("Slack channel name is required");
|
|
1152
|
+
let cursor;
|
|
1153
|
+
do {
|
|
1154
|
+
const result = await this.web.conversations.list({
|
|
1155
|
+
types: "public_channel,private_channel",
|
|
1156
|
+
limit: 1e3,
|
|
1157
|
+
...cursor ? { cursor } : {}
|
|
1158
|
+
});
|
|
1159
|
+
if (!result.ok) {
|
|
1160
|
+
throw new Error(`Slack API error: ${result.error ?? "unknown error"}`);
|
|
1161
|
+
}
|
|
1162
|
+
const channels = result.channels ?? [];
|
|
1163
|
+
const match = channels.find((channel) => {
|
|
1164
|
+
if (channel.is_archived) return false;
|
|
1165
|
+
return (channel.name_normalized ?? channel.name ?? "").toLowerCase() === normalized;
|
|
1166
|
+
});
|
|
1167
|
+
if (match?.id) {
|
|
1168
|
+
return { channel: match.id, name: match.name ?? normalized };
|
|
1169
|
+
}
|
|
1170
|
+
cursor = result.response_metadata?.next_cursor || void 0;
|
|
1171
|
+
} while (cursor);
|
|
1172
|
+
throw new Error(`Slack channel not found: #${normalized}`);
|
|
1173
|
+
}
|
|
1174
|
+
/** Resolve a Slack user email to a DM channel with that user. */
|
|
1175
|
+
async openDmByEmail(email) {
|
|
1176
|
+
const normalized = email.trim().toLowerCase();
|
|
1177
|
+
if (!normalized) throw new Error("Slack user email is required");
|
|
1178
|
+
const userResult = await this.web.users.lookupByEmail({ email: normalized });
|
|
1179
|
+
if (!userResult.ok || !userResult.user?.id) {
|
|
1180
|
+
throw new Error(`Slack user lookup failed: ${userResult.error ?? "user_not_found"}`);
|
|
1181
|
+
}
|
|
1182
|
+
const dmResult = await this.web.conversations.open({ users: userResult.user.id });
|
|
1183
|
+
if (!dmResult.ok || !dmResult.channel?.id) {
|
|
1184
|
+
throw new Error(`Slack DM open failed: ${dmResult.error ?? "unknown error"}`);
|
|
1185
|
+
}
|
|
1186
|
+
return { channel: dmResult.channel.id, user_id: userResult.user.id };
|
|
1187
|
+
}
|
|
1188
|
+
async fetchThreadHistory(req) {
|
|
1189
|
+
const { channel, thread_ts } = parseThreadId2(req.threadId);
|
|
1190
|
+
const requestedLimit = Math.min(Math.max(req.limit ?? 50, 1), 200);
|
|
1191
|
+
const messages = [];
|
|
1192
|
+
let cursor;
|
|
1193
|
+
let hasMore = false;
|
|
1194
|
+
do {
|
|
1195
|
+
const rawLimit = req.includeBotMessages ? requestedLimit : Math.min(Math.max(requestedLimit * 4, requestedLimit), 200);
|
|
1196
|
+
const result = await this.web.conversations.replies({
|
|
1197
|
+
channel,
|
|
1198
|
+
ts: thread_ts,
|
|
1199
|
+
limit: rawLimit,
|
|
1200
|
+
...cursor ? { cursor } : {},
|
|
1201
|
+
...req.oldestTs ? { oldest: req.oldestTs } : {},
|
|
1202
|
+
...req.latestTs ? { latest: req.latestTs } : {},
|
|
1203
|
+
...req.inclusive !== void 0 ? { inclusive: req.inclusive } : {}
|
|
1204
|
+
});
|
|
1205
|
+
if (!result.ok) {
|
|
1206
|
+
throw new Error(`Slack thread history error: ${result.error ?? "unknown error"}`);
|
|
1207
|
+
}
|
|
1208
|
+
const rawMessages = result.messages ?? [];
|
|
1209
|
+
let stoppedAtRequestedLimitWithMoreRaw = false;
|
|
1210
|
+
for (let i = 0; i < rawMessages.length; i++) {
|
|
1211
|
+
const raw = rawMessages[i];
|
|
1212
|
+
if (!raw) continue;
|
|
1213
|
+
const ts = typeof raw.ts === "string" ? raw.ts : void 0;
|
|
1214
|
+
if (!ts) continue;
|
|
1215
|
+
const botId = typeof raw.bot_id === "string" ? raw.bot_id : void 0;
|
|
1216
|
+
const subtype = typeof raw.subtype === "string" ? raw.subtype : void 0;
|
|
1217
|
+
const isBot = !!botId || subtype === "bot_message";
|
|
1218
|
+
if (isBot && !req.includeBotMessages) continue;
|
|
1219
|
+
const userId = typeof raw.user === "string" ? raw.user : void 0;
|
|
1220
|
+
let userName;
|
|
1221
|
+
if (userId) {
|
|
1222
|
+
const profile = await this.lookupUserProfile(userId);
|
|
1223
|
+
userName = profile.displayName ?? void 0;
|
|
1224
|
+
}
|
|
1225
|
+
const botProfile = raw.bot_profile;
|
|
1226
|
+
const botName = typeof botProfile?.name === "string" ? botProfile.name : typeof raw.username === "string" ? raw.username : void 0;
|
|
1227
|
+
const actorLabel = userName ?? botName ?? userId ?? botId ?? "unknown";
|
|
1228
|
+
const text = typeof raw.text === "string" ? raw.text : "";
|
|
1229
|
+
messages.push({
|
|
1230
|
+
ts,
|
|
1231
|
+
iso_time: slackTsToIso(ts),
|
|
1232
|
+
...userId ? { user_id: userId } : {},
|
|
1233
|
+
...userName ? { user_name: userName } : {},
|
|
1234
|
+
actor_label: actorLabel,
|
|
1235
|
+
text,
|
|
1236
|
+
is_bot: isBot,
|
|
1237
|
+
is_trigger: req.triggerTs === ts,
|
|
1238
|
+
is_mention: this.botUserId ? text.includes(`<@${this.botUserId}>`) : false
|
|
1239
|
+
});
|
|
1240
|
+
if (messages.length >= requestedLimit) {
|
|
1241
|
+
stoppedAtRequestedLimitWithMoreRaw = i < rawMessages.length - 1;
|
|
1242
|
+
break;
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
cursor = result.response_metadata?.next_cursor || void 0;
|
|
1246
|
+
hasMore = result.has_more === true || !!cursor || stoppedAtRequestedLimitWithMoreRaw;
|
|
1247
|
+
} while (!req.includeBotMessages && messages.length < requestedLimit && cursor);
|
|
1248
|
+
return {
|
|
1249
|
+
threadId: req.threadId,
|
|
1250
|
+
channel,
|
|
1251
|
+
thread_ts,
|
|
1252
|
+
messages: messages.slice(0, requestedLimit),
|
|
1253
|
+
has_more: hasMore
|
|
1254
|
+
};
|
|
1255
|
+
}
|
|
1256
|
+
async startStream(req) {
|
|
1257
|
+
const { channel, thread_ts } = parseThreadId2(req.threadId);
|
|
1258
|
+
const chat = this.web.chat;
|
|
1259
|
+
const result = await chat.startStream({
|
|
1260
|
+
channel,
|
|
1261
|
+
thread_ts,
|
|
1262
|
+
markdown_text: req.text?.trim() ? req.text : " ",
|
|
1263
|
+
...req.recipientUserId ? { recipient_user_id: req.recipientUserId } : {},
|
|
1264
|
+
...req.recipientTeamId ? { recipient_team_id: req.recipientTeamId } : {}
|
|
1265
|
+
});
|
|
1266
|
+
if (!result.ok || !result.ts) {
|
|
1267
|
+
throw new Error(`Slack stream start error: ${result.error ?? "unknown error"}`);
|
|
1268
|
+
}
|
|
1269
|
+
return result.ts;
|
|
1270
|
+
}
|
|
1271
|
+
async appendStream(req) {
|
|
1272
|
+
const { channel } = parseThreadId2(req.threadId);
|
|
1273
|
+
const chat = this.web.chat;
|
|
1274
|
+
const result = await chat.appendStream({
|
|
1275
|
+
channel,
|
|
1276
|
+
ts: req.ts,
|
|
1277
|
+
markdown_text: req.text
|
|
1278
|
+
});
|
|
1279
|
+
if (!result.ok) {
|
|
1280
|
+
throw new Error(`Slack stream append error: ${result.error ?? "unknown error"}`);
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
async stopStream(req) {
|
|
1284
|
+
const { channel } = parseThreadId2(req.threadId);
|
|
1285
|
+
const chat = this.web.chat;
|
|
1286
|
+
const result = await chat.stopStream({
|
|
1287
|
+
channel,
|
|
1288
|
+
ts: req.ts,
|
|
1289
|
+
...req.text ? { markdown_text: req.text } : {}
|
|
1290
|
+
});
|
|
1291
|
+
if (!result.ok) {
|
|
1292
|
+
throw new Error(`Slack stream stop error: ${result.error ?? "unknown error"}`);
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
async deleteMessage(req) {
|
|
1296
|
+
const { channel } = parseThreadId2(req.threadId);
|
|
1297
|
+
const result = await this.web.chat.delete({
|
|
1298
|
+
channel,
|
|
1299
|
+
ts: req.messageId
|
|
1300
|
+
});
|
|
1301
|
+
if (!result.ok) {
|
|
1302
|
+
throw new Error(`Slack delete error: ${result.error ?? "unknown error"}`);
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
async setThreadStatus(req) {
|
|
1306
|
+
const { channel, thread_ts } = parseThreadId2(req.threadId);
|
|
1307
|
+
const web = this.web;
|
|
1308
|
+
const args = {
|
|
1309
|
+
channel_id: channel,
|
|
1310
|
+
thread_ts,
|
|
1311
|
+
status: req.status,
|
|
1312
|
+
...req.loadingMessages?.length ? { loading_messages: req.loadingMessages } : {},
|
|
1313
|
+
...req.iconEmoji ? { icon_emoji: req.iconEmoji } : {}
|
|
1314
|
+
};
|
|
1315
|
+
const result = web.assistant?.threads?.setStatus ? await web.assistant.threads.setStatus(args) : await web.apiCall?.("assistant.threads.setStatus", args);
|
|
1316
|
+
if (!result?.ok) {
|
|
1317
|
+
throw new Error(`Slack assistant status error: ${result?.error ?? "unknown error"}`);
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
808
1320
|
/**
|
|
809
1321
|
* Start listening for inbound messages via Socket Mode
|
|
810
1322
|
*
|
|
@@ -813,31 +1325,24 @@ var SlackConnector = class _SlackConnector {
|
|
|
813
1325
|
* - Public channels (if enable_channels = true)
|
|
814
1326
|
* - Private channels (if enable_groups = true)
|
|
815
1327
|
* - Group DMs (if enable_mpim = true)
|
|
816
|
-
* -
|
|
1328
|
+
* - Explicit mention requirement for channel-like conversations
|
|
817
1329
|
* - Channel whitelist (if allowed_channel_ids is set)
|
|
818
1330
|
*/
|
|
819
1331
|
async startListening(callback) {
|
|
820
|
-
console.log("[slack] startListening called");
|
|
821
1332
|
if (!this.config.app_token) {
|
|
822
1333
|
console.error("[slack] ERROR: app_token is missing from config");
|
|
823
1334
|
throw new Error("Slack Socket Mode requires app_token in config");
|
|
824
1335
|
}
|
|
825
|
-
console.log("[slack] Creating SocketModeClient...");
|
|
826
1336
|
this.socketMode = new SocketModeClient({
|
|
827
1337
|
appToken: this.config.app_token
|
|
828
1338
|
});
|
|
829
1339
|
let botMentionPattern = null;
|
|
830
1340
|
let botMentionReplacePattern = null;
|
|
831
1341
|
try {
|
|
832
|
-
console.log("[slack] Testing bot token with auth.test()...");
|
|
833
1342
|
const authTest = await this.web.auth.test();
|
|
834
1343
|
this.botUserId = authTest.user_id;
|
|
835
1344
|
botMentionPattern = new RegExp(`<@${this.botUserId}>`);
|
|
836
1345
|
botMentionReplacePattern = new RegExp(`<@${this.botUserId}>\\s*`, "g");
|
|
837
|
-
console.log(`[slack] Bot user ID: ${this.botUserId}`);
|
|
838
|
-
console.log(
|
|
839
|
-
`[slack] Bot auth test successful - team: ${authTest.team}, user: ${authTest.user}`
|
|
840
|
-
);
|
|
841
1346
|
} catch (error) {
|
|
842
1347
|
console.error("[slack] Failed to fetch bot user ID:", error);
|
|
843
1348
|
console.error("[slack] This usually means the bot_token is invalid or expired");
|
|
@@ -846,8 +1351,7 @@ var SlackConnector = class _SlackConnector {
|
|
|
846
1351
|
const enableChannels = this.config.enable_channels ?? false;
|
|
847
1352
|
const enableGroups = this.config.enable_groups ?? false;
|
|
848
1353
|
const enableMpim = this.config.enable_mpim ?? false;
|
|
849
|
-
const requireMention =
|
|
850
|
-
const allowThreadRepliesWithoutMention = this.config.allow_thread_replies_without_mention ?? true;
|
|
1354
|
+
const requireMention = true;
|
|
851
1355
|
let allowedChannelIds;
|
|
852
1356
|
if (this.config.allowed_channel_ids) {
|
|
853
1357
|
if (Array.isArray(this.config.allowed_channel_ids)) {
|
|
@@ -863,13 +1367,6 @@ var SlackConnector = class _SlackConnector {
|
|
|
863
1367
|
allowedChannelIds = void 0;
|
|
864
1368
|
}
|
|
865
1369
|
}
|
|
866
|
-
console.log("[slack] Message source config:", {
|
|
867
|
-
enableChannels,
|
|
868
|
-
enableGroups,
|
|
869
|
-
enableMpim,
|
|
870
|
-
requireMention,
|
|
871
|
-
allowedChannelIds: allowedChannelIds?.length || 0
|
|
872
|
-
});
|
|
873
1370
|
this.socketMode.on("slack_event", async ({ type, body, ack }) => {
|
|
874
1371
|
if (type !== "events_api") {
|
|
875
1372
|
await ack();
|
|
@@ -881,44 +1378,69 @@ var SlackConnector = class _SlackConnector {
|
|
|
881
1378
|
return;
|
|
882
1379
|
}
|
|
883
1380
|
await ack();
|
|
884
|
-
|
|
1381
|
+
let event = body.event;
|
|
1382
|
+
const slackTeamId = typeof event.team === "string" ? event.team : typeof body.team_id === "string" ? body.team_id : Array.isArray(body.authorizations) && typeof body.authorizations[0]?.team_id === "string" ? body.authorizations[0].team_id : void 0;
|
|
885
1383
|
console.log(
|
|
886
1384
|
`[slack] Processing ${eventType} event - channel: ${event.channel}, channel_type: ${event.channel_type}`
|
|
887
1385
|
);
|
|
888
1386
|
if (event.bot_id || event.subtype === "bot_message") {
|
|
889
|
-
console.log("[slack] Skipping bot message");
|
|
890
1387
|
return;
|
|
891
1388
|
}
|
|
892
1389
|
if (eventType === "message" && event.subtype) {
|
|
1390
|
+
if (event.subtype === "message_replied") {
|
|
1391
|
+
const replyEvent = await this.lookupLatestThreadReply(event);
|
|
1392
|
+
if (!replyEvent) {
|
|
1393
|
+
console.log(
|
|
1394
|
+
`[slack] Skipping message_replied event without fetchable latest reply channel=${event.channel ?? "(none)"} ts=${event.ts ?? "(none)"}`
|
|
1395
|
+
);
|
|
1396
|
+
return;
|
|
1397
|
+
}
|
|
1398
|
+
event = {
|
|
1399
|
+
...replyEvent,
|
|
1400
|
+
type: "message",
|
|
1401
|
+
channel_type: event.channel_type
|
|
1402
|
+
};
|
|
1403
|
+
console.log(
|
|
1404
|
+
`[slack] Resolved message_replied event to latest reply thread_ts=${event.thread_ts ?? "(none)"} ts=${event.ts ?? "(none)"}`
|
|
1405
|
+
);
|
|
1406
|
+
} else {
|
|
1407
|
+
console.debug(
|
|
1408
|
+
`[slack] Skipping message subtype=${event.subtype} user=${event.user ?? "(none)"} thread_ts=${event.thread_ts ?? "(none)"} ts=${event.ts ?? "(none)"}`
|
|
1409
|
+
);
|
|
1410
|
+
return;
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
if (event.bot_id || event.subtype === "bot_message") {
|
|
1414
|
+
console.debug(
|
|
1415
|
+
`[slack] Skipping resolved bot message subtype=${event.subtype ?? "(none)"} thread_ts=${event.thread_ts ?? "(none)"} ts=${event.ts ?? "(none)"}`
|
|
1416
|
+
);
|
|
893
1417
|
return;
|
|
894
1418
|
}
|
|
895
1419
|
const channelType = event.channel ? await this.resolveChannelType(event.channel, event.channel_type) : void 0;
|
|
896
1420
|
const isThreadReply = !!event.thread_ts;
|
|
897
|
-
const
|
|
898
|
-
if (
|
|
1421
|
+
const isChannelLikeMessage = channelType === "channel" || channelType === "group" || channelType === "mpim";
|
|
1422
|
+
if (isChannelLikeMessage && eventType !== "app_mention") {
|
|
1423
|
+
console.debug(
|
|
1424
|
+
`[slack] Skipping non-app_mention event in channel-like conversation type=${eventType} channel=${event.channel} ts=${event.ts}`
|
|
1425
|
+
);
|
|
1426
|
+
return;
|
|
1427
|
+
}
|
|
1428
|
+
if (isChannelLikeMessage && !botMentionPattern) {
|
|
899
1429
|
if (eventType === "message" && requireMention) {
|
|
900
|
-
console.warn(
|
|
901
|
-
"[slack] Bot ID unavailable, require_mention=true - skipping message event (will use app_mention)"
|
|
902
|
-
);
|
|
903
|
-
return;
|
|
904
|
-
}
|
|
905
|
-
if (eventType === "app_mention" && !requireMention) {
|
|
906
|
-
console.warn(
|
|
907
|
-
"[slack] Bot ID unavailable, require_mention=false - skipping app_mention (will use message)"
|
|
908
|
-
);
|
|
909
1430
|
return;
|
|
910
1431
|
}
|
|
911
1432
|
}
|
|
912
|
-
if (
|
|
1433
|
+
if (isChannelLikeMessage && botMentionPattern) {
|
|
913
1434
|
const mentionOutsideCodeBlock = hasActiveMention2(event.text ?? "", botMentionPattern);
|
|
914
|
-
if (eventType === "message" && mentionOutsideCodeBlock) {
|
|
915
|
-
return;
|
|
916
|
-
}
|
|
917
1435
|
if (eventType === "app_mention" && !mentionOutsideCodeBlock) {
|
|
918
1436
|
return;
|
|
919
1437
|
}
|
|
920
1438
|
}
|
|
921
|
-
if (!channelType
|
|
1439
|
+
if (!channelType) {
|
|
1440
|
+
console.warn(`[slack] Cannot determine channel_type for channel=${event.channel}`);
|
|
1441
|
+
return;
|
|
1442
|
+
}
|
|
1443
|
+
if (channelType === "im") {
|
|
922
1444
|
} else if (channelType === "channel" && !enableChannels) {
|
|
923
1445
|
return;
|
|
924
1446
|
} else if (channelType === "group" && !enableGroups) {
|
|
@@ -929,15 +1451,14 @@ var SlackConnector = class _SlackConnector {
|
|
|
929
1451
|
console.warn(`[slack] Unknown channel_type="${channelType}"`);
|
|
930
1452
|
return;
|
|
931
1453
|
}
|
|
932
|
-
if (
|
|
933
|
-
|
|
934
|
-
return;
|
|
935
|
-
}
|
|
1454
|
+
if (!isChannelAllowedByWhitelist(channelType, event.channel, allowedChannelIds)) {
|
|
1455
|
+
return;
|
|
936
1456
|
}
|
|
937
1457
|
let messageText = event.text ?? "";
|
|
938
1458
|
let hasMention = false;
|
|
939
|
-
|
|
940
|
-
|
|
1459
|
+
const allowedViaThreadReplyException = false;
|
|
1460
|
+
const requiresExplicitMention = channelType !== "im";
|
|
1461
|
+
if (requireMention && requiresExplicitMention) {
|
|
941
1462
|
if (!botMentionPattern || !botMentionReplacePattern) {
|
|
942
1463
|
if (eventType === "app_mention") {
|
|
943
1464
|
hasMention = true;
|
|
@@ -950,20 +1471,25 @@ var SlackConnector = class _SlackConnector {
|
|
|
950
1471
|
} else {
|
|
951
1472
|
hasMention = hasActiveMention2(messageText, botMentionPattern);
|
|
952
1473
|
if (!hasMention) {
|
|
953
|
-
|
|
954
|
-
allowedViaThreadReplyException = true;
|
|
955
|
-
} else {
|
|
956
|
-
return;
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
if (hasMention) {
|
|
960
|
-
messageText = messageText.replace(botMentionReplacePattern, "").trim();
|
|
1474
|
+
return;
|
|
961
1475
|
}
|
|
1476
|
+
messageText = messageText.replace(botMentionReplacePattern, "").trim();
|
|
1477
|
+
}
|
|
1478
|
+
} else if (botMentionPattern && botMentionReplacePattern) {
|
|
1479
|
+
hasMention = hasActiveMention2(messageText, botMentionPattern);
|
|
1480
|
+
if (hasMention) {
|
|
1481
|
+
messageText = messageText.replace(botMentionReplacePattern, "").trim();
|
|
962
1482
|
}
|
|
963
1483
|
}
|
|
1484
|
+
if (!this.shouldProcessInboundEventOnce(event.channel, event.ts)) {
|
|
1485
|
+
console.log(
|
|
1486
|
+
`[slack] Skipping duplicate inbound event type=${eventType} channel=${event.channel} ts=${event.ts}`
|
|
1487
|
+
);
|
|
1488
|
+
return;
|
|
1489
|
+
}
|
|
964
1490
|
const threadId = event.thread_ts ? `${event.channel}-${event.thread_ts}` : `${event.channel}-${event.ts}`;
|
|
965
1491
|
console.log(
|
|
966
|
-
`[slack]
|
|
1492
|
+
`[slack] Accepted inbound message: thread=${threadId} channel_type=${channelType} user=${event.user}`
|
|
967
1493
|
);
|
|
968
1494
|
let slackUserEmail = null;
|
|
969
1495
|
let slackUserDisplayName = null;
|
|
@@ -984,7 +1510,15 @@ var SlackConnector = class _SlackConnector {
|
|
|
984
1510
|
metadata: {
|
|
985
1511
|
channel: event.channel,
|
|
986
1512
|
channel_type: channelType,
|
|
1513
|
+
...event.user ? { slack_user_id: event.user } : {},
|
|
1514
|
+
...slackTeamId ? { slack_team_id: slackTeamId } : {},
|
|
987
1515
|
requires_mapping_verification: allowedViaThreadReplyException,
|
|
1516
|
+
...this.botUserId ? { slack_bot_user_id: this.botUserId } : {},
|
|
1517
|
+
...typeof event.ts === "string" ? { slack_message_ts: event.ts } : {},
|
|
1518
|
+
...typeof event.thread_ts === "string" ? { slack_thread_ts: event.thread_ts } : typeof event.ts === "string" ? { slack_thread_ts: event.ts } : {},
|
|
1519
|
+
slack_is_thread_reply: isThreadReply,
|
|
1520
|
+
slack_has_mention: hasMention,
|
|
1521
|
+
slack_event_type: eventType,
|
|
988
1522
|
...slackUserEmail ? { slack_user_email: slackUserEmail } : {},
|
|
989
1523
|
...slackUserDisplayName ? { slack_user_name: slackUserDisplayName } : {},
|
|
990
1524
|
...slackChannelName ? { slack_channel_name: slackChannelName } : {},
|
|
@@ -995,9 +1529,7 @@ var SlackConnector = class _SlackConnector {
|
|
|
995
1529
|
}
|
|
996
1530
|
});
|
|
997
1531
|
});
|
|
998
|
-
console.log("[slack] Starting Socket Mode client...");
|
|
999
1532
|
await this.socketMode.start();
|
|
1000
|
-
console.log("[slack] Socket Mode client connected successfully!");
|
|
1001
1533
|
}
|
|
1002
1534
|
/**
|
|
1003
1535
|
* Stop Socket Mode listener
|
|
@@ -1013,18 +1545,310 @@ var SlackConnector = class _SlackConnector {
|
|
|
1013
1545
|
*
|
|
1014
1546
|
* Returns `{ text, blocks? }`. `text` is the mrkdwn fallback used for
|
|
1015
1547
|
* notifications and clients that don't render Block Kit; `blocks` is set
|
|
1016
|
-
* when the message contains
|
|
1017
|
-
*
|
|
1548
|
+
* when the message contains tables that can benefit from Slack's native
|
|
1549
|
+
* markdown/table blocks.
|
|
1018
1550
|
*/
|
|
1019
1551
|
formatMessage(markdown) {
|
|
1020
1552
|
return markdownToSlackPayload(markdown);
|
|
1021
1553
|
}
|
|
1022
1554
|
};
|
|
1023
1555
|
|
|
1556
|
+
// src/gateway/connectors/teams.ts
|
|
1557
|
+
import { createServer } from "http";
|
|
1558
|
+
import { BotFrameworkAdapter, TurnContext } from "botbuilder";
|
|
1559
|
+
function parseThreadId3(threadId) {
|
|
1560
|
+
const lastPipe = threadId.lastIndexOf("|");
|
|
1561
|
+
if (lastPipe === -1) {
|
|
1562
|
+
throw new Error(
|
|
1563
|
+
`Invalid Teams thread ID format: "${threadId}" (expected "{conversationId}|{activityId}")`
|
|
1564
|
+
);
|
|
1565
|
+
}
|
|
1566
|
+
const conversationId = threadId.substring(0, lastPipe);
|
|
1567
|
+
const activityId = threadId.substring(lastPipe + 1);
|
|
1568
|
+
if (!conversationId || !activityId) {
|
|
1569
|
+
throw new Error(
|
|
1570
|
+
`Invalid Teams thread ID format: "${threadId}" (expected "{conversationId}|{activityId}")`
|
|
1571
|
+
);
|
|
1572
|
+
}
|
|
1573
|
+
return { conversationId, activityId };
|
|
1574
|
+
}
|
|
1575
|
+
function stripMention2(text, botName) {
|
|
1576
|
+
const escaped = botName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1577
|
+
const pattern = new RegExp(`<at>${escaped}</at>\\s*`, "gi");
|
|
1578
|
+
return text.replace(pattern, "").trim();
|
|
1579
|
+
}
|
|
1580
|
+
function hasActiveMention3(text, botName) {
|
|
1581
|
+
const stripped = text.replace(/```[\s\S]*?```/g, "").replace(/`[^`]*`/g, "");
|
|
1582
|
+
const escaped = botName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1583
|
+
const pattern = new RegExp(`<at>${escaped}</at>`, "i");
|
|
1584
|
+
return pattern.test(stripped);
|
|
1585
|
+
}
|
|
1586
|
+
function stripHtmlTags(text) {
|
|
1587
|
+
return text.replace(/<[^>]+>/g, "");
|
|
1588
|
+
}
|
|
1589
|
+
function extractQuotedReplyText(attachments) {
|
|
1590
|
+
if (!attachments) return null;
|
|
1591
|
+
for (const attachment of attachments) {
|
|
1592
|
+
if (attachment.contentType !== "text/html" || !attachment.content) continue;
|
|
1593
|
+
if (!attachment.content.includes("schema.skype.com/Reply")) continue;
|
|
1594
|
+
const afterQuote = attachment.content.split("</blockquote>").pop();
|
|
1595
|
+
if (!afterQuote) continue;
|
|
1596
|
+
const text = stripHtmlTags(afterQuote).trim();
|
|
1597
|
+
if (text) return text;
|
|
1598
|
+
}
|
|
1599
|
+
return null;
|
|
1600
|
+
}
|
|
1601
|
+
function wrapResponse(res) {
|
|
1602
|
+
const wrapped = res;
|
|
1603
|
+
wrapped.status = (code) => {
|
|
1604
|
+
res.statusCode = code;
|
|
1605
|
+
return res;
|
|
1606
|
+
};
|
|
1607
|
+
wrapped.send = (body) => {
|
|
1608
|
+
if (body !== void 0 && body !== null) {
|
|
1609
|
+
const bodyStr = typeof body === "string" ? body : JSON.stringify(body);
|
|
1610
|
+
res.setHeader("Content-Type", "application/json");
|
|
1611
|
+
res.end(bodyStr);
|
|
1612
|
+
} else {
|
|
1613
|
+
res.end();
|
|
1614
|
+
}
|
|
1615
|
+
};
|
|
1616
|
+
return wrapped;
|
|
1617
|
+
}
|
|
1618
|
+
var TeamsConnector = class {
|
|
1619
|
+
channelType = "teams";
|
|
1620
|
+
adapter;
|
|
1621
|
+
config;
|
|
1622
|
+
server = null;
|
|
1623
|
+
/** Stored ConversationReferences for proactive messaging, keyed by threadId */
|
|
1624
|
+
conversationRefs = /* @__PURE__ */ new Map();
|
|
1625
|
+
constructor(config) {
|
|
1626
|
+
this.config = config;
|
|
1627
|
+
if (!this.config.app_id) {
|
|
1628
|
+
throw new Error("Teams connector requires app_id in config");
|
|
1629
|
+
}
|
|
1630
|
+
if (!this.config.app_password) {
|
|
1631
|
+
throw new Error("Teams connector requires app_password in config");
|
|
1632
|
+
}
|
|
1633
|
+
this.adapter = new BotFrameworkAdapter({
|
|
1634
|
+
appId: this.config.app_id,
|
|
1635
|
+
appPassword: this.config.app_password,
|
|
1636
|
+
...this.config.tenant_id ? { channelAuthTenant: this.config.tenant_id } : {}
|
|
1637
|
+
});
|
|
1638
|
+
}
|
|
1639
|
+
/**
|
|
1640
|
+
* Send a message to a Teams thread using a stored ConversationReference.
|
|
1641
|
+
*
|
|
1642
|
+
* Uses the proactive messaging pattern: look up the stored reference
|
|
1643
|
+
* from the inbound turn, then use adapter.continueConversation() to
|
|
1644
|
+
* send a message outside of a turn.
|
|
1645
|
+
*/
|
|
1646
|
+
async sendMessage(req) {
|
|
1647
|
+
const ref = this.conversationRefs.get(req.threadId);
|
|
1648
|
+
if (!ref) {
|
|
1649
|
+
throw new Error(
|
|
1650
|
+
`No ConversationReference stored for thread ${req.threadId}. Cannot send proactive message before receiving an inbound message.`
|
|
1651
|
+
);
|
|
1652
|
+
}
|
|
1653
|
+
let sentActivityId = "";
|
|
1654
|
+
await this.adapter.continueConversation(ref, async (turnContext) => {
|
|
1655
|
+
const response = await turnContext.sendActivity(req.text);
|
|
1656
|
+
sentActivityId = response?.id ?? "";
|
|
1657
|
+
});
|
|
1658
|
+
return sentActivityId;
|
|
1659
|
+
}
|
|
1660
|
+
/**
|
|
1661
|
+
* Start listening for inbound messages via an HTTP webhook.
|
|
1662
|
+
*
|
|
1663
|
+
* Creates a lightweight HTTP server that receives Bot Framework activities
|
|
1664
|
+
* from Azure Bot Service, processes them, and calls the gateway callback.
|
|
1665
|
+
*/
|
|
1666
|
+
async startListening(callback) {
|
|
1667
|
+
const port = this.config.webhook_port ?? 3978;
|
|
1668
|
+
const path = this.config.webhook_path ?? "/api/messages";
|
|
1669
|
+
const requireMention = this.config.require_mention ?? true;
|
|
1670
|
+
const allowThreadRepliesWithoutMention = this.config.allow_thread_replies_without_mention ?? true;
|
|
1671
|
+
let botName = null;
|
|
1672
|
+
this.server = createServer((req, res) => {
|
|
1673
|
+
if (req.method !== "POST" || req.url !== path) {
|
|
1674
|
+
res.statusCode = 404;
|
|
1675
|
+
res.end();
|
|
1676
|
+
return;
|
|
1677
|
+
}
|
|
1678
|
+
const bodyChunks = [];
|
|
1679
|
+
req.on("data", (chunk) => bodyChunks.push(chunk));
|
|
1680
|
+
req.on("end", () => {
|
|
1681
|
+
const bodyStr = Buffer.concat(bodyChunks).toString("utf-8");
|
|
1682
|
+
let body;
|
|
1683
|
+
try {
|
|
1684
|
+
body = JSON.parse(bodyStr);
|
|
1685
|
+
} catch {
|
|
1686
|
+
res.statusCode = 400;
|
|
1687
|
+
res.end("Invalid JSON");
|
|
1688
|
+
return;
|
|
1689
|
+
}
|
|
1690
|
+
req.body = body;
|
|
1691
|
+
this.adapter.processActivity(
|
|
1692
|
+
req,
|
|
1693
|
+
wrapResponse(res),
|
|
1694
|
+
async (turnContext) => {
|
|
1695
|
+
const activity = turnContext.activity;
|
|
1696
|
+
if (activity.type !== "message") {
|
|
1697
|
+
return;
|
|
1698
|
+
}
|
|
1699
|
+
if (activity.from?.id === this.config.app_id) {
|
|
1700
|
+
return;
|
|
1701
|
+
}
|
|
1702
|
+
const ref = TurnContext.getConversationReference(activity);
|
|
1703
|
+
if (!botName && activity.recipient?.name) {
|
|
1704
|
+
botName = activity.recipient.name;
|
|
1705
|
+
console.log(`[teams] Bot name resolved: "${botName}"`);
|
|
1706
|
+
}
|
|
1707
|
+
const conversationType = activity.conversation?.conversationType;
|
|
1708
|
+
const isPersonal = conversationType === "personal";
|
|
1709
|
+
const isThreadReply = !isPersonal && !!activity.replyToId;
|
|
1710
|
+
const rawConversationId = activity.conversation?.id ?? "";
|
|
1711
|
+
const replyToId = activity.replyToId;
|
|
1712
|
+
let threadId;
|
|
1713
|
+
if (isPersonal) {
|
|
1714
|
+
threadId = rawConversationId;
|
|
1715
|
+
} else {
|
|
1716
|
+
let baseConversationId = rawConversationId;
|
|
1717
|
+
let messageIdFromConv;
|
|
1718
|
+
const msgIdIdx = rawConversationId.indexOf(";messageid=");
|
|
1719
|
+
if (msgIdIdx !== -1) {
|
|
1720
|
+
baseConversationId = rawConversationId.substring(0, msgIdIdx);
|
|
1721
|
+
messageIdFromConv = rawConversationId.substring(msgIdIdx + ";messageid=".length);
|
|
1722
|
+
}
|
|
1723
|
+
const rootId = messageIdFromConv ?? replyToId ?? activity.id ?? "";
|
|
1724
|
+
threadId = `${baseConversationId}|${rootId}`;
|
|
1725
|
+
}
|
|
1726
|
+
this.conversationRefs.set(threadId, ref);
|
|
1727
|
+
const quotedReplyText = extractQuotedReplyText(
|
|
1728
|
+
activity.attachments
|
|
1729
|
+
);
|
|
1730
|
+
let messageText = quotedReplyText ?? activity.text ?? "";
|
|
1731
|
+
let hasMention = false;
|
|
1732
|
+
if (activity.entities) {
|
|
1733
|
+
for (const entity of activity.entities) {
|
|
1734
|
+
if (entity.type !== "mention") continue;
|
|
1735
|
+
const mentioned = entity.mentioned;
|
|
1736
|
+
const mentionedId = mentioned?.id ?? "";
|
|
1737
|
+
const isBotMention = mentionedId === this.config.app_id || mentionedId.includes(this.config.app_id);
|
|
1738
|
+
if (!isBotMention) continue;
|
|
1739
|
+
hasMention = true;
|
|
1740
|
+
const mentionText = entity.text;
|
|
1741
|
+
if (mentionText && messageText.includes(mentionText)) {
|
|
1742
|
+
messageText = messageText.replace(mentionText, "").trim();
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
if (!hasMention) {
|
|
1747
|
+
const allBotNames = /* @__PURE__ */ new Set();
|
|
1748
|
+
if (botName) allBotNames.add(botName);
|
|
1749
|
+
if (activity.recipient?.name) allBotNames.add(activity.recipient.name);
|
|
1750
|
+
for (const name of allBotNames) {
|
|
1751
|
+
if (hasActiveMention3(messageText, name)) {
|
|
1752
|
+
hasMention = true;
|
|
1753
|
+
messageText = stripMention2(messageText, name);
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
messageText = stripHtmlTags(messageText).trim();
|
|
1758
|
+
if (!messageText) {
|
|
1759
|
+
return;
|
|
1760
|
+
}
|
|
1761
|
+
if (!isPersonal && requireMention) {
|
|
1762
|
+
if (!hasMention) {
|
|
1763
|
+
if (isThreadReply && allowThreadRepliesWithoutMention) {
|
|
1764
|
+
} else {
|
|
1765
|
+
return;
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
const userName = activity.from?.name;
|
|
1770
|
+
const userAadObjectId = activity.from?.aadObjectId;
|
|
1771
|
+
const channelData = activity.channelData;
|
|
1772
|
+
const teamName = channelData?.team?.name;
|
|
1773
|
+
const channelName = channelData?.channel?.name;
|
|
1774
|
+
const tenantId = channelData?.tenant?.id;
|
|
1775
|
+
callback({
|
|
1776
|
+
threadId,
|
|
1777
|
+
text: messageText,
|
|
1778
|
+
userId: activity.from?.id ?? "unknown",
|
|
1779
|
+
timestamp: activity.timestamp?.toISOString() ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
1780
|
+
metadata: {
|
|
1781
|
+
teams_conversation_type: conversationType,
|
|
1782
|
+
teams_channel_name: channelName,
|
|
1783
|
+
teams_team_name: teamName,
|
|
1784
|
+
teams_user_name: userName,
|
|
1785
|
+
teams_user_aad_id: userAadObjectId,
|
|
1786
|
+
teams_tenant_id: tenantId,
|
|
1787
|
+
requires_mapping_verification: !hasMention && isThreadReply
|
|
1788
|
+
}
|
|
1789
|
+
});
|
|
1790
|
+
}
|
|
1791
|
+
);
|
|
1792
|
+
});
|
|
1793
|
+
});
|
|
1794
|
+
return new Promise((resolve, reject) => {
|
|
1795
|
+
if (!this.server) {
|
|
1796
|
+
reject(new Error("Server not created"));
|
|
1797
|
+
return;
|
|
1798
|
+
}
|
|
1799
|
+
this.server.on("error", (err) => {
|
|
1800
|
+
console.error(`[teams] HTTP server error:`, err);
|
|
1801
|
+
reject(err);
|
|
1802
|
+
});
|
|
1803
|
+
this.server.listen(port, () => {
|
|
1804
|
+
console.log(`[teams] Webhook server listening on port ${port} at ${path}`);
|
|
1805
|
+
resolve();
|
|
1806
|
+
});
|
|
1807
|
+
});
|
|
1808
|
+
}
|
|
1809
|
+
/**
|
|
1810
|
+
* Stop the HTTP webhook server
|
|
1811
|
+
*/
|
|
1812
|
+
async stopListening() {
|
|
1813
|
+
if (this.server) {
|
|
1814
|
+
return new Promise((resolve) => {
|
|
1815
|
+
this.server?.close(() => {
|
|
1816
|
+
console.log("[teams] Webhook server stopped");
|
|
1817
|
+
this.server = null;
|
|
1818
|
+
resolve();
|
|
1819
|
+
});
|
|
1820
|
+
});
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
/**
|
|
1824
|
+
* Convert markdown to Teams-compatible format.
|
|
1825
|
+
*
|
|
1826
|
+
* Teams natively supports most markdown (bold, italic, code blocks, links, lists).
|
|
1827
|
+
* Main adjustments:
|
|
1828
|
+
* - Collapse <details>/<summary> blocks (not supported in Teams)
|
|
1829
|
+
* - Strip unsupported HTML tags
|
|
1830
|
+
*/
|
|
1831
|
+
formatMessage(markdown) {
|
|
1832
|
+
let text = markdown;
|
|
1833
|
+
text = text.replace(
|
|
1834
|
+
/<details>\s*<summary>([\s\S]*?)<\/summary>\s*([\s\S]*?)<\/details>/gi,
|
|
1835
|
+
(_match, summary, content) => {
|
|
1836
|
+
const summaryText = summary.trim();
|
|
1837
|
+
const contentText = content.trim();
|
|
1838
|
+
return `**${summaryText}**
|
|
1839
|
+
${contentText}`;
|
|
1840
|
+
}
|
|
1841
|
+
);
|
|
1842
|
+
text = stripHtmlTags(text);
|
|
1843
|
+
return text.trim();
|
|
1844
|
+
}
|
|
1845
|
+
};
|
|
1846
|
+
|
|
1024
1847
|
// src/gateway/connector-registry.ts
|
|
1025
1848
|
var connectors = /* @__PURE__ */ new Map();
|
|
1026
1849
|
connectors.set("slack", (config) => new SlackConnector(config));
|
|
1027
1850
|
connectors.set("github", (config) => new GitHubConnector(config));
|
|
1851
|
+
connectors.set("teams", (config) => new TeamsConnector(config));
|
|
1028
1852
|
function getConnector(channelType, config) {
|
|
1029
1853
|
const factory = connectors.get(channelType);
|
|
1030
1854
|
if (!factory) {
|
|
@@ -1039,13 +1863,91 @@ function hasConnector(channelType) {
|
|
|
1039
1863
|
return connectors.has(channelType);
|
|
1040
1864
|
}
|
|
1041
1865
|
|
|
1866
|
+
// src/gateway/connectors/slack-manifest.ts
|
|
1867
|
+
function hasChannelLikeSurface(opts) {
|
|
1868
|
+
return opts.publicChannels || opts.privateChannels || opts.groupDms;
|
|
1869
|
+
}
|
|
1870
|
+
function sortedUnique(values) {
|
|
1871
|
+
return [...new Set(values)].sort();
|
|
1872
|
+
}
|
|
1873
|
+
function requiredBotScopes(opts) {
|
|
1874
|
+
const scopes = ["chat:write", "im:history", "im:read", "users:read"];
|
|
1875
|
+
if (hasChannelLikeSurface(opts)) {
|
|
1876
|
+
scopes.push("app_mentions:read");
|
|
1877
|
+
}
|
|
1878
|
+
if (opts.publicChannels) {
|
|
1879
|
+
scopes.push("channels:history", "channels:read");
|
|
1880
|
+
}
|
|
1881
|
+
if (opts.privateChannels) {
|
|
1882
|
+
scopes.push("groups:history", "groups:read");
|
|
1883
|
+
}
|
|
1884
|
+
if (opts.groupDms) {
|
|
1885
|
+
scopes.push("mpim:history", "mpim:read");
|
|
1886
|
+
}
|
|
1887
|
+
if (opts.alignUsers) {
|
|
1888
|
+
scopes.push("users:read.email");
|
|
1889
|
+
}
|
|
1890
|
+
if (opts.outbound) {
|
|
1891
|
+
scopes.push(
|
|
1892
|
+
"chat:write.public",
|
|
1893
|
+
"channels:read",
|
|
1894
|
+
"groups:read",
|
|
1895
|
+
"im:write",
|
|
1896
|
+
"users:read.email"
|
|
1897
|
+
);
|
|
1898
|
+
}
|
|
1899
|
+
return sortedUnique(scopes);
|
|
1900
|
+
}
|
|
1901
|
+
function requiredBotEvents(opts) {
|
|
1902
|
+
const events = ["message.im"];
|
|
1903
|
+
if (hasChannelLikeSurface(opts)) {
|
|
1904
|
+
events.push("app_mention");
|
|
1905
|
+
}
|
|
1906
|
+
return sortedUnique(events);
|
|
1907
|
+
}
|
|
1908
|
+
function buildSlackManifest(opts) {
|
|
1909
|
+
return {
|
|
1910
|
+
display_information: {
|
|
1911
|
+
name: opts.appName
|
|
1912
|
+
},
|
|
1913
|
+
features: {
|
|
1914
|
+
bot_user: {
|
|
1915
|
+
display_name: opts.botDisplayName ?? opts.appName,
|
|
1916
|
+
always_online: true
|
|
1917
|
+
},
|
|
1918
|
+
app_home: {
|
|
1919
|
+
messages_tab_enabled: true,
|
|
1920
|
+
messages_tab_read_only_enabled: false,
|
|
1921
|
+
home_tab_enabled: false
|
|
1922
|
+
}
|
|
1923
|
+
},
|
|
1924
|
+
oauth_config: {
|
|
1925
|
+
scopes: {
|
|
1926
|
+
bot: requiredBotScopes(opts)
|
|
1927
|
+
}
|
|
1928
|
+
},
|
|
1929
|
+
settings: {
|
|
1930
|
+
event_subscriptions: {
|
|
1931
|
+
bot_events: requiredBotEvents(opts)
|
|
1932
|
+
},
|
|
1933
|
+
interactivity: {
|
|
1934
|
+
is_enabled: false
|
|
1935
|
+
},
|
|
1936
|
+
org_deploy_enabled: false,
|
|
1937
|
+
socket_mode_enabled: true,
|
|
1938
|
+
token_rotation_enabled: false
|
|
1939
|
+
}
|
|
1940
|
+
};
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1042
1943
|
// src/gateway/context.ts
|
|
1043
1944
|
var PLATFORM_LABELS = {
|
|
1044
1945
|
slack: "Slack",
|
|
1045
1946
|
discord: "Discord",
|
|
1046
1947
|
github: "GitHub",
|
|
1047
1948
|
whatsapp: "WhatsApp",
|
|
1048
|
-
telegram: "Telegram"
|
|
1949
|
+
telegram: "Telegram",
|
|
1950
|
+
teams: "Microsoft Teams"
|
|
1049
1951
|
};
|
|
1050
1952
|
function formatGatewayContext(ctx) {
|
|
1051
1953
|
const label = PLATFORM_LABELS[ctx.platform] ?? ctx.platform;
|
|
@@ -1082,23 +1984,75 @@ function formatGatewayContext(ctx) {
|
|
|
1082
1984
|
`;
|
|
1083
1985
|
}
|
|
1084
1986
|
|
|
1987
|
+
// src/types/id.ts
|
|
1988
|
+
var SHORT_ID_LENGTH = 24;
|
|
1989
|
+
function toShortId(id, length = SHORT_ID_LENGTH) {
|
|
1990
|
+
return id.replace(/-/g, "").slice(0, Math.min(length, 32));
|
|
1991
|
+
}
|
|
1992
|
+
function shortId(id) {
|
|
1993
|
+
return toShortId(id, SHORT_ID_LENGTH);
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1085
1996
|
// src/gateway/system-message.ts
|
|
1997
|
+
var GATEWAY_SYSTEM_PREFIX = "Agor:";
|
|
1998
|
+
function formatGatewayMarkdownSessionReference(sessionId, sessionUrl) {
|
|
1999
|
+
return sessionUrl ? `[session](${sessionUrl})` : `session ${shortId(sessionId)}`;
|
|
2000
|
+
}
|
|
2001
|
+
function formatGatewaySessionCreatedMessage(sessionId, sessionUrl) {
|
|
2002
|
+
return sessionUrl ? `Session created: ${sessionUrl}` : `Session ${shortId(sessionId)} created, sending prompt to agent.`;
|
|
2003
|
+
}
|
|
2004
|
+
function formatGatewayFollowUpRoutingMessage(sessionId, sessionUrl) {
|
|
2005
|
+
return `Mention received \u2014 routing to ${formatGatewayMarkdownSessionReference(sessionId, sessionUrl)}.`;
|
|
2006
|
+
}
|
|
1086
2007
|
function formatGatewaySystemMessage(channelType, text) {
|
|
1087
2008
|
const sessionCreatedMatch = text.match(/^Session created: (https?:\/\/\S+)$/);
|
|
2009
|
+
const slackMentionGuidance = "Mention me again to follow up.";
|
|
1088
2010
|
if (channelType === "slack") {
|
|
1089
|
-
const markdown = sessionCreatedMatch ?
|
|
2011
|
+
const markdown = sessionCreatedMatch ? `${GATEWAY_SYSTEM_PREFIX} Session created: [View session](${sessionCreatedMatch[1]}). ${slackMentionGuidance}` : text.startsWith("Session ") && text.includes(" created, sending prompt to agent.") ? `${GATEWAY_SYSTEM_PREFIX} ${text} ${slackMentionGuidance}` : text.startsWith("Mention received") ? `${GATEWAY_SYSTEM_PREFIX} ${text} ${slackMentionGuidance}` : `${GATEWAY_SYSTEM_PREFIX} ${text}`;
|
|
1090
2012
|
return markdownToMrkdwn(markdown);
|
|
1091
2013
|
}
|
|
1092
|
-
return
|
|
2014
|
+
return `${GATEWAY_SYSTEM_PREFIX} ${text}`;
|
|
2015
|
+
}
|
|
2016
|
+
function formatGatewaySystemPayload(channelType, text) {
|
|
2017
|
+
const formatted = formatGatewaySystemMessage(channelType, text);
|
|
2018
|
+
if (channelType !== "slack") {
|
|
2019
|
+
return { text: formatted };
|
|
2020
|
+
}
|
|
2021
|
+
return {
|
|
2022
|
+
text: formatted,
|
|
2023
|
+
blocks: [
|
|
2024
|
+
{
|
|
2025
|
+
type: "context",
|
|
2026
|
+
elements: [
|
|
2027
|
+
{
|
|
2028
|
+
type: "mrkdwn",
|
|
2029
|
+
text: formatted
|
|
2030
|
+
}
|
|
2031
|
+
]
|
|
2032
|
+
}
|
|
2033
|
+
]
|
|
2034
|
+
};
|
|
1093
2035
|
}
|
|
1094
2036
|
export {
|
|
1095
2037
|
GitHubConnector,
|
|
1096
2038
|
SlackConnector,
|
|
2039
|
+
TeamsConnector,
|
|
2040
|
+
buildSlackManifest,
|
|
2041
|
+
extractQuotedReplyText,
|
|
1097
2042
|
formatGatewayContext,
|
|
2043
|
+
formatGatewayFollowUpRoutingMessage,
|
|
2044
|
+
formatGatewayMarkdownSessionReference,
|
|
2045
|
+
formatGatewaySessionCreatedMessage,
|
|
1098
2046
|
formatGatewaySystemMessage,
|
|
2047
|
+
formatGatewaySystemPayload,
|
|
1099
2048
|
getConnector,
|
|
1100
2049
|
hasConnector,
|
|
2050
|
+
isChannelAllowedByWhitelist,
|
|
2051
|
+
markdownToMrkdwn,
|
|
1101
2052
|
normalizeOutbound,
|
|
1102
2053
|
parseThreadId as parseGitHubThreadId,
|
|
1103
|
-
|
|
2054
|
+
parseThreadId3 as parseTeamsThreadId,
|
|
2055
|
+
registerConnector,
|
|
2056
|
+
requiredBotEvents,
|
|
2057
|
+
requiredBotScopes
|
|
1104
2058
|
};
|