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
|
@@ -32,13 +32,25 @@ var gateway_exports = {};
|
|
|
32
32
|
__export(gateway_exports, {
|
|
33
33
|
GitHubConnector: () => GitHubConnector,
|
|
34
34
|
SlackConnector: () => SlackConnector,
|
|
35
|
+
TeamsConnector: () => TeamsConnector,
|
|
36
|
+
buildSlackManifest: () => buildSlackManifest,
|
|
37
|
+
extractQuotedReplyText: () => extractQuotedReplyText,
|
|
35
38
|
formatGatewayContext: () => formatGatewayContext,
|
|
39
|
+
formatGatewayFollowUpRoutingMessage: () => formatGatewayFollowUpRoutingMessage,
|
|
40
|
+
formatGatewayMarkdownSessionReference: () => formatGatewayMarkdownSessionReference,
|
|
41
|
+
formatGatewaySessionCreatedMessage: () => formatGatewaySessionCreatedMessage,
|
|
36
42
|
formatGatewaySystemMessage: () => formatGatewaySystemMessage,
|
|
43
|
+
formatGatewaySystemPayload: () => formatGatewaySystemPayload,
|
|
37
44
|
getConnector: () => getConnector,
|
|
38
45
|
hasConnector: () => hasConnector,
|
|
46
|
+
isChannelAllowedByWhitelist: () => isChannelAllowedByWhitelist,
|
|
47
|
+
markdownToMrkdwn: () => markdownToMrkdwn,
|
|
39
48
|
normalizeOutbound: () => normalizeOutbound,
|
|
40
49
|
parseGitHubThreadId: () => parseThreadId,
|
|
41
|
-
|
|
50
|
+
parseTeamsThreadId: () => parseThreadId3,
|
|
51
|
+
registerConnector: () => registerConnector,
|
|
52
|
+
requiredBotEvents: () => requiredBotEvents,
|
|
53
|
+
requiredBotScopes: () => requiredBotScopes
|
|
42
54
|
});
|
|
43
55
|
module.exports = __toCommonJS(gateway_exports);
|
|
44
56
|
|
|
@@ -385,12 +397,16 @@ var TABLE_MAX_ROWS = 100;
|
|
|
385
397
|
var TABLE_MAX_COLS = 20;
|
|
386
398
|
var TABLE_MAX_CELL_CHARS = 3e3;
|
|
387
399
|
var SECTION_MAX_CHARS = 3e3;
|
|
400
|
+
var MARKDOWN_BLOCK_MAX_CHARS = 12e3;
|
|
388
401
|
var MAX_TABLES_PER_MESSAGE = 1;
|
|
389
402
|
var MAX_BLOCKS_PER_MESSAGE = 50;
|
|
390
403
|
var BLOCK_PAYLOAD_ERRORS = /* @__PURE__ */ new Set([
|
|
391
404
|
"invalid_blocks",
|
|
392
405
|
"invalid_blocks_format",
|
|
393
|
-
"
|
|
406
|
+
"invalid_block_type",
|
|
407
|
+
"message_blocks_too_long",
|
|
408
|
+
"unknown_block_type",
|
|
409
|
+
"unsupported_block_type"
|
|
394
410
|
]);
|
|
395
411
|
var FENCE_LINE_RE = /^(`{3,}|~{3,})/;
|
|
396
412
|
var PIPE_LINE_RE = /^\s*\|/;
|
|
@@ -417,6 +433,11 @@ function hasActiveMention2(text, mentionPattern) {
|
|
|
417
433
|
mentionPattern.lastIndex = 0;
|
|
418
434
|
return mentionPattern.test(stripped);
|
|
419
435
|
}
|
|
436
|
+
function slackTsToIso(ts) {
|
|
437
|
+
const seconds = Number(ts.split(".")[0]);
|
|
438
|
+
if (!Number.isFinite(seconds)) return (/* @__PURE__ */ new Date()).toISOString();
|
|
439
|
+
return new Date(seconds * 1e3).toISOString();
|
|
440
|
+
}
|
|
420
441
|
function segmentMarkdown(md) {
|
|
421
442
|
const lines = md.split(/\r?\n/);
|
|
422
443
|
const segments = [];
|
|
@@ -563,12 +584,35 @@ ${tableLines.join("\n")}
|
|
|
563
584
|
text: { type: "mrkdwn", text: wrapped }
|
|
564
585
|
};
|
|
565
586
|
}
|
|
587
|
+
function buildMarkdownBlock(markdown) {
|
|
588
|
+
const trimmed = markdown.trim();
|
|
589
|
+
if (trimmed.length === 0 || trimmed.length > MARKDOWN_BLOCK_MAX_CHARS) return null;
|
|
590
|
+
return { type: "markdown", text: markdown };
|
|
591
|
+
}
|
|
592
|
+
function tableHasRichMarkdown(tableLines) {
|
|
593
|
+
return tableLines.some(
|
|
594
|
+
(line) => /(\*\*|__|~~|`|\[[^\]]+\]\([^)]*\)|<br\s*\/?\s*>|_[^_|]+_|(^|\|)\s*[-*+]\s+)/i.test(line)
|
|
595
|
+
);
|
|
596
|
+
}
|
|
597
|
+
function shouldUseNativeMarkdownBlock(markdown, segments) {
|
|
598
|
+
if (!buildMarkdownBlock(markdown)) return false;
|
|
599
|
+
const tableSegments = segments.filter((segment) => segment.kind === "table");
|
|
600
|
+
if (tableSegments.length > 1) return true;
|
|
601
|
+
return tableSegments.some((segment) => tableHasRichMarkdown(segment.lines));
|
|
602
|
+
}
|
|
566
603
|
function markdownToSlackPayload(markdown) {
|
|
567
604
|
const text = markdownToMrkdwn(markdown);
|
|
568
605
|
const segments = segmentMarkdown(markdown);
|
|
569
|
-
|
|
606
|
+
const hasTable = segments.some((s) => s.kind === "table");
|
|
607
|
+
if (!hasTable) {
|
|
570
608
|
return { text };
|
|
571
609
|
}
|
|
610
|
+
if (shouldUseNativeMarkdownBlock(markdown, segments)) {
|
|
611
|
+
const markdownBlock = buildMarkdownBlock(markdown);
|
|
612
|
+
if (markdownBlock) {
|
|
613
|
+
return { text, blocks: [markdownBlock] };
|
|
614
|
+
}
|
|
615
|
+
}
|
|
572
616
|
const blocks = [];
|
|
573
617
|
let tablesEmitted = 0;
|
|
574
618
|
for (const seg of segments) {
|
|
@@ -598,6 +642,64 @@ function extractSlackErrorCode(resultOrError) {
|
|
|
598
642
|
const candidate = resultOrError;
|
|
599
643
|
return candidate.data?.error ?? candidate.error;
|
|
600
644
|
}
|
|
645
|
+
function extractSlackErrorDetail(resultOrError) {
|
|
646
|
+
if (typeof resultOrError !== "object" || resultOrError === null) return {};
|
|
647
|
+
const candidate = resultOrError;
|
|
648
|
+
return {
|
|
649
|
+
code: candidate.data?.error ?? candidate.error ?? candidate.code,
|
|
650
|
+
needed: candidate.data?.needed ?? candidate.needed,
|
|
651
|
+
provided: candidate.data?.provided ?? candidate.provided,
|
|
652
|
+
retryAfter: candidate.retryAfter
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
var BOT_TOKEN_ERROR_REASONS = {
|
|
656
|
+
invalid_auth: "The bot token is invalid.",
|
|
657
|
+
account_inactive: "The bot token belongs to a deleted or deactivated account or workspace.",
|
|
658
|
+
token_revoked: "The bot token has been revoked.",
|
|
659
|
+
token_expired: "The bot token has expired.",
|
|
660
|
+
not_authed: "No bot token was provided.",
|
|
661
|
+
no_permission: "The bot token lacks permission to call auth.test."
|
|
662
|
+
};
|
|
663
|
+
var CHANNEL_ACCESS_ERROR_REASONS = {
|
|
664
|
+
not_in_channel: "The bot is not a member of this channel; invite it so it can read messages.",
|
|
665
|
+
channel_not_found: "The channel ID was not found, or the bot cannot see it.",
|
|
666
|
+
is_archived: "The channel is archived."
|
|
667
|
+
};
|
|
668
|
+
function buildTestFailure(capability, detail, reasons) {
|
|
669
|
+
const { code, needed, provided, retryAfter } = detail;
|
|
670
|
+
let reason;
|
|
671
|
+
if (code === "missing_scope") {
|
|
672
|
+
reason = needed ? `Slack reports a missing OAuth scope; add "${needed}".` : "Slack reports a missing OAuth scope.";
|
|
673
|
+
} else if (code === "ratelimited" || retryAfter != null) {
|
|
674
|
+
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.";
|
|
675
|
+
} else if (code && reasons[code]) {
|
|
676
|
+
reason = reasons[code];
|
|
677
|
+
} else if (code) {
|
|
678
|
+
reason = `Slack returned error "${code}".`;
|
|
679
|
+
} else {
|
|
680
|
+
reason = "A network or unexpected error occurred while contacting Slack.";
|
|
681
|
+
}
|
|
682
|
+
const failure = { capability, reason };
|
|
683
|
+
if (code) failure.slackError = code;
|
|
684
|
+
if (needed) failure.needed = needed;
|
|
685
|
+
if (provided) failure.provided = provided;
|
|
686
|
+
return failure;
|
|
687
|
+
}
|
|
688
|
+
function normalizeAllowedChannelIds(raw) {
|
|
689
|
+
if (Array.isArray(raw)) return raw.filter((id) => typeof id === "string");
|
|
690
|
+
if (typeof raw === "string" && raw) return [raw];
|
|
691
|
+
return [];
|
|
692
|
+
}
|
|
693
|
+
var SLACK_NOT_VERIFIABLE = [
|
|
694
|
+
"Whether the bot token and app-level token belong to the same Slack app.",
|
|
695
|
+
"Whether the required Slack event subscriptions are installed and delivering events.",
|
|
696
|
+
"Whether the full set of required OAuth scopes is granted \u2014 only scopes exercised by the probed API calls are checked."
|
|
697
|
+
];
|
|
698
|
+
function isChannelAllowedByWhitelist(channelType, channelId, allowedChannelIds) {
|
|
699
|
+
if (channelType === "im") return true;
|
|
700
|
+
if (!allowedChannelIds || allowedChannelIds.length === 0) return true;
|
|
701
|
+
return !!channelId && allowedChannelIds.includes(channelId);
|
|
702
|
+
}
|
|
601
703
|
var SlackConnector = class _SlackConnector {
|
|
602
704
|
channelType = "slack";
|
|
603
705
|
web;
|
|
@@ -606,12 +708,15 @@ var SlackConnector = class _SlackConnector {
|
|
|
606
708
|
botUserId = null;
|
|
607
709
|
/** Cache: Slack user ID → profile (email + display name, or null if unavailable). */
|
|
608
710
|
userProfileCache = /* @__PURE__ */ new Map();
|
|
711
|
+
inboundEventDedup = /* @__PURE__ */ new Map();
|
|
609
712
|
/** Cache: Slack channel ID → channel name */
|
|
610
713
|
channelNameCache = /* @__PURE__ */ new Map();
|
|
611
714
|
static USER_CACHE_TTL_MS = 15 * 60 * 1e3;
|
|
612
715
|
// 15 min for successful lookups
|
|
613
716
|
static USER_CACHE_ERROR_TTL_MS = 60 * 1e3;
|
|
614
717
|
// 1 min for errors (transient recovery)
|
|
718
|
+
static INBOUND_EVENT_DEDUP_TTL_MS = 5 * 60 * 1e3;
|
|
719
|
+
// Slack may send message + app_mention for one user action
|
|
615
720
|
/**
|
|
616
721
|
* Cache: Slack channel ID → channel type string (channel/group/mpim/im).
|
|
617
722
|
*
|
|
@@ -634,6 +739,122 @@ var SlackConnector = class _SlackConnector {
|
|
|
634
739
|
}
|
|
635
740
|
this.web = new import_web_api.WebClient(this.config.bot_token);
|
|
636
741
|
}
|
|
742
|
+
/**
|
|
743
|
+
* Build a Slack WebClient for an arbitrary token. Isolated so connection
|
|
744
|
+
* probes can construct a client for the app-level (`xapp-`) token, and so
|
|
745
|
+
* tests can stub the app-token client independently of `this.web`.
|
|
746
|
+
*/
|
|
747
|
+
createWebClient(token) {
|
|
748
|
+
return new import_web_api.WebClient(token);
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* Best-effort probe of the configured Slack credentials and reachability.
|
|
752
|
+
*
|
|
753
|
+
* Probes capabilities directly rather than diffing scope-header strings:
|
|
754
|
+
* - `auth.test()` with the bot token → team + bot identity.
|
|
755
|
+
* - `apps.connections.open()` with the app-level token → Socket Mode /
|
|
756
|
+
* `connections:write` validity.
|
|
757
|
+
* - `conversations.info` on the first whitelisted channel (when any) →
|
|
758
|
+
* channel reachability.
|
|
759
|
+
*
|
|
760
|
+
* Slack's `missing_scope` needed/provided detail and rate-limit `Retry-After`
|
|
761
|
+
* are surfaced verbatim. Never logs or returns token values.
|
|
762
|
+
*/
|
|
763
|
+
async testConnection() {
|
|
764
|
+
const failures = [];
|
|
765
|
+
const notVerifiable = [...SLACK_NOT_VERIFIABLE];
|
|
766
|
+
let team;
|
|
767
|
+
let bot;
|
|
768
|
+
let botTokenValid = false;
|
|
769
|
+
try {
|
|
770
|
+
const authTest = await this.web.auth.test();
|
|
771
|
+
if (authTest.ok) {
|
|
772
|
+
botTokenValid = true;
|
|
773
|
+
team = { id: authTest.team_id ?? "", name: authTest.team ?? "" };
|
|
774
|
+
bot = { userId: authTest.user_id ?? "", name: authTest.user ?? "" };
|
|
775
|
+
} else {
|
|
776
|
+
failures.push(
|
|
777
|
+
buildTestFailure("bot_token", extractSlackErrorDetail(authTest), BOT_TOKEN_ERROR_REASONS)
|
|
778
|
+
);
|
|
779
|
+
}
|
|
780
|
+
} catch (error) {
|
|
781
|
+
failures.push(
|
|
782
|
+
buildTestFailure("bot_token", extractSlackErrorDetail(error), BOT_TOKEN_ERROR_REASONS)
|
|
783
|
+
);
|
|
784
|
+
}
|
|
785
|
+
let appTokenValid;
|
|
786
|
+
const appToken = this.config.app_token;
|
|
787
|
+
if (!appToken) {
|
|
788
|
+
appTokenValid = false;
|
|
789
|
+
failures.push({
|
|
790
|
+
capability: "app_token",
|
|
791
|
+
reason: "No app-level token is configured; Socket Mode cannot connect to receive messages."
|
|
792
|
+
});
|
|
793
|
+
} else {
|
|
794
|
+
try {
|
|
795
|
+
const appClient = this.createWebClient(appToken);
|
|
796
|
+
const res = await appClient.apps.connections.open();
|
|
797
|
+
if (res.ok) {
|
|
798
|
+
appTokenValid = true;
|
|
799
|
+
} else {
|
|
800
|
+
appTokenValid = false;
|
|
801
|
+
failures.push(buildTestFailure("app_token", extractSlackErrorDetail(res), {}));
|
|
802
|
+
}
|
|
803
|
+
} catch (error) {
|
|
804
|
+
appTokenValid = false;
|
|
805
|
+
failures.push(buildTestFailure("app_token", extractSlackErrorDetail(error), {}));
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
let channelAccess;
|
|
809
|
+
const allowedChannelIds = normalizeAllowedChannelIds(this.config.allowed_channel_ids);
|
|
810
|
+
if (allowedChannelIds.length > 0) {
|
|
811
|
+
const channelId = allowedChannelIds[0];
|
|
812
|
+
let channelOk = false;
|
|
813
|
+
try {
|
|
814
|
+
const info = await this.web.conversations.info({ channel: channelId });
|
|
815
|
+
if (info.ok) {
|
|
816
|
+
channelOk = true;
|
|
817
|
+
} else {
|
|
818
|
+
failures.push(
|
|
819
|
+
buildTestFailure(
|
|
820
|
+
"channel_access",
|
|
821
|
+
extractSlackErrorDetail(info),
|
|
822
|
+
CHANNEL_ACCESS_ERROR_REASONS
|
|
823
|
+
)
|
|
824
|
+
);
|
|
825
|
+
}
|
|
826
|
+
} catch (error) {
|
|
827
|
+
failures.push(
|
|
828
|
+
buildTestFailure(
|
|
829
|
+
"channel_access",
|
|
830
|
+
extractSlackErrorDetail(error),
|
|
831
|
+
CHANNEL_ACCESS_ERROR_REASONS
|
|
832
|
+
)
|
|
833
|
+
);
|
|
834
|
+
}
|
|
835
|
+
channelAccess = [{ channelId, ok: channelOk }];
|
|
836
|
+
if (allowedChannelIds.length > 1) {
|
|
837
|
+
notVerifiable.push(
|
|
838
|
+
`Only the first of ${allowedChannelIds.length} configured channels was probed; the rest were not checked.`
|
|
839
|
+
);
|
|
840
|
+
}
|
|
841
|
+
} else {
|
|
842
|
+
notVerifiable.push(
|
|
843
|
+
"No channel whitelist is configured, so no specific channel reachability was verified."
|
|
844
|
+
);
|
|
845
|
+
}
|
|
846
|
+
const channelsOk = !channelAccess || channelAccess.some((c) => c.ok);
|
|
847
|
+
const ok = botTokenValid && appTokenValid && channelsOk && failures.length === 0;
|
|
848
|
+
return {
|
|
849
|
+
ok,
|
|
850
|
+
...team ? { team } : {},
|
|
851
|
+
...bot ? { bot } : {},
|
|
852
|
+
appTokenValid,
|
|
853
|
+
...channelAccess ? { channelAccess } : {},
|
|
854
|
+
failures,
|
|
855
|
+
notVerifiable
|
|
856
|
+
};
|
|
857
|
+
}
|
|
637
858
|
/**
|
|
638
859
|
* Look up a Slack user's email address by their user ID.
|
|
639
860
|
*
|
|
@@ -670,11 +891,7 @@ var SlackConnector = class _SlackConnector {
|
|
|
670
891
|
displayName,
|
|
671
892
|
expiresAt: now + _SlackConnector.USER_CACHE_TTL_MS
|
|
672
893
|
});
|
|
673
|
-
if (email) {
|
|
674
|
-
console.log(
|
|
675
|
-
`[slack] Resolved user ${slackUserId} \u2192 ${displayName ?? "(no name)"} <${email}>`
|
|
676
|
-
);
|
|
677
|
-
} else {
|
|
894
|
+
if (!email) {
|
|
678
895
|
console.log(
|
|
679
896
|
`[slack] User ${slackUserId} has no email (missing users:read.email scope or restricted account)`
|
|
680
897
|
);
|
|
@@ -690,6 +907,33 @@ var SlackConnector = class _SlackConnector {
|
|
|
690
907
|
return { email: null, displayName: null };
|
|
691
908
|
}
|
|
692
909
|
}
|
|
910
|
+
/**
|
|
911
|
+
* Look up a Slack user by email and return display metadata including a
|
|
912
|
+
* high-resolution avatar URL. Used by Agor's admin-triggered user avatar
|
|
913
|
+
* sync. Prefer image_512 for crisp large/retina rendering, falling back to
|
|
914
|
+
* smaller Slack-provided variants.
|
|
915
|
+
*/
|
|
916
|
+
async lookupUserAvatarByEmail(email) {
|
|
917
|
+
const normalized = email.trim().toLowerCase();
|
|
918
|
+
if (!normalized) throw new Error("Slack user email is required");
|
|
919
|
+
const result = await this.web.users.lookupByEmail({ email: normalized }).catch((error) => {
|
|
920
|
+
if (extractSlackErrorCode(error) === "users_not_found") {
|
|
921
|
+
return null;
|
|
922
|
+
}
|
|
923
|
+
throw error;
|
|
924
|
+
});
|
|
925
|
+
if (!result?.ok || !result.user?.id) {
|
|
926
|
+
return null;
|
|
927
|
+
}
|
|
928
|
+
const profile = result.user.profile;
|
|
929
|
+
const avatarUrl = profile?.image_512 || profile?.image_original || profile?.image_1024 || profile?.image_192 || profile?.image_72 || profile?.image_48 || null;
|
|
930
|
+
return {
|
|
931
|
+
slackUserId: result.user.id,
|
|
932
|
+
email: profile?.email ?? normalized,
|
|
933
|
+
displayName: profile?.display_name || profile?.real_name || result.user.real_name || result.user.name || null,
|
|
934
|
+
avatarUrl
|
|
935
|
+
};
|
|
936
|
+
}
|
|
693
937
|
/**
|
|
694
938
|
* Look up a Slack channel's name by its ID.
|
|
695
939
|
*
|
|
@@ -723,6 +967,47 @@ var SlackConnector = class _SlackConnector {
|
|
|
723
967
|
return null;
|
|
724
968
|
}
|
|
725
969
|
}
|
|
970
|
+
async lookupLatestThreadReply(event) {
|
|
971
|
+
const channel = typeof event.channel === "string" ? event.channel : void 0;
|
|
972
|
+
const message = typeof event.message === "object" && event.message !== null ? event.message : void 0;
|
|
973
|
+
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);
|
|
974
|
+
const replies = Array.isArray(message?.replies) ? message.replies.filter((reply) => {
|
|
975
|
+
return typeof reply === "object" && reply !== null;
|
|
976
|
+
}) : [];
|
|
977
|
+
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);
|
|
978
|
+
if (!channel || !threadTs || !latestReplyTs) return null;
|
|
979
|
+
try {
|
|
980
|
+
const result = await this.web.conversations.replies({
|
|
981
|
+
channel,
|
|
982
|
+
ts: threadTs,
|
|
983
|
+
oldest: latestReplyTs,
|
|
984
|
+
inclusive: true,
|
|
985
|
+
limit: 1
|
|
986
|
+
});
|
|
987
|
+
const reply = result.messages?.find((candidate) => candidate.ts === latestReplyTs) ?? result.messages?.[0] ?? null;
|
|
988
|
+
if (!reply) return null;
|
|
989
|
+
return {
|
|
990
|
+
...reply,
|
|
991
|
+
channel,
|
|
992
|
+
thread_ts: typeof reply.thread_ts === "string" ? reply.thread_ts : threadTs,
|
|
993
|
+
team: event.team
|
|
994
|
+
};
|
|
995
|
+
} catch (error) {
|
|
996
|
+
console.warn("[slack] Failed to fetch latest thread reply for message_replied event:", error);
|
|
997
|
+
return null;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
shouldProcessInboundEventOnce(channel, ts) {
|
|
1001
|
+
if (!channel || !ts) return true;
|
|
1002
|
+
const now = Date.now();
|
|
1003
|
+
for (const [key2, expiresAt] of this.inboundEventDedup) {
|
|
1004
|
+
if (expiresAt <= now) this.inboundEventDedup.delete(key2);
|
|
1005
|
+
}
|
|
1006
|
+
const key = `${channel}:${ts}`;
|
|
1007
|
+
if (this.inboundEventDedup.has(key)) return false;
|
|
1008
|
+
this.inboundEventDedup.set(key, now + _SlackConnector.INBOUND_EVENT_DEDUP_TTL_MS);
|
|
1009
|
+
return true;
|
|
1010
|
+
}
|
|
726
1011
|
/**
|
|
727
1012
|
* Cache a known channel type from a trusted source (e.g. `message` event with explicit `channel_type`).
|
|
728
1013
|
*/
|
|
@@ -768,7 +1053,6 @@ var SlackConnector = class _SlackConnector {
|
|
|
768
1053
|
} else {
|
|
769
1054
|
resolvedType = "channel";
|
|
770
1055
|
}
|
|
771
|
-
console.log(`[slack] conversations.info resolved channel ${channelId} \u2192 ${resolvedType}`);
|
|
772
1056
|
this.cacheChannelType(channelId, resolvedType);
|
|
773
1057
|
if (ch.name) {
|
|
774
1058
|
this.channelNameCache.set(channelId, {
|
|
@@ -814,22 +1098,34 @@ var SlackConnector = class _SlackConnector {
|
|
|
814
1098
|
async sendMessage(req) {
|
|
815
1099
|
const { channel, thread_ts } = parseThreadId2(req.threadId);
|
|
816
1100
|
const blocks = req.blocks && req.blocks.length > 0 ? req.blocks : void 0;
|
|
817
|
-
const
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
1101
|
+
const updateTs = typeof req.metadata?.slack_update_ts === "string" ? req.metadata.slack_update_ts : void 0;
|
|
1102
|
+
const send = (withBlocks) => {
|
|
1103
|
+
const base = {
|
|
1104
|
+
channel,
|
|
1105
|
+
text: req.text,
|
|
1106
|
+
...withBlocks && blocks ? { blocks } : {},
|
|
1107
|
+
unfurl_links: false,
|
|
1108
|
+
unfurl_media: false
|
|
1109
|
+
};
|
|
1110
|
+
if (updateTs) {
|
|
1111
|
+
return this.web.chat.update({
|
|
1112
|
+
...base,
|
|
1113
|
+
ts: updateTs
|
|
1114
|
+
});
|
|
1115
|
+
}
|
|
1116
|
+
return this.web.chat.postMessage({
|
|
1117
|
+
...base,
|
|
1118
|
+
thread_ts
|
|
1119
|
+
});
|
|
1120
|
+
};
|
|
825
1121
|
let result;
|
|
826
1122
|
try {
|
|
827
|
-
result = await
|
|
1123
|
+
result = await send(true);
|
|
828
1124
|
} catch (err) {
|
|
829
1125
|
const code = extractSlackErrorCode(err);
|
|
830
1126
|
if (blocks && code && BLOCK_PAYLOAD_ERRORS.has(code)) {
|
|
831
1127
|
console.warn(`[slack] Block payload rejected (${code}); retrying as text-only`);
|
|
832
|
-
result = await
|
|
1128
|
+
result = await send(false);
|
|
833
1129
|
} else {
|
|
834
1130
|
throw err;
|
|
835
1131
|
}
|
|
@@ -838,7 +1134,7 @@ var SlackConnector = class _SlackConnector {
|
|
|
838
1134
|
const code = extractSlackErrorCode(result);
|
|
839
1135
|
if (blocks && code && BLOCK_PAYLOAD_ERRORS.has(code)) {
|
|
840
1136
|
console.warn(`[slack] Block payload rejected (${code}); retrying as text-only`);
|
|
841
|
-
const retry = await
|
|
1137
|
+
const retry = await send(false);
|
|
842
1138
|
if (!retry.ok || !retry.ts) {
|
|
843
1139
|
throw new Error(`Slack API error: ${retry.error ?? "unknown error"}`);
|
|
844
1140
|
}
|
|
@@ -849,6 +1145,234 @@ var SlackConnector = class _SlackConnector {
|
|
|
849
1145
|
}
|
|
850
1146
|
return result.ts;
|
|
851
1147
|
}
|
|
1148
|
+
/**
|
|
1149
|
+
* Send directly to a Slack channel or thread. Used for proactive outbound
|
|
1150
|
+
* emits where no gateway thread_session_map exists yet.
|
|
1151
|
+
*/
|
|
1152
|
+
async sendSlackMessage(req) {
|
|
1153
|
+
const blocks = req.blocks && req.blocks.length > 0 ? req.blocks : void 0;
|
|
1154
|
+
const send = (withBlocks) => this.web.chat.postMessage({
|
|
1155
|
+
channel: req.channel,
|
|
1156
|
+
text: req.text,
|
|
1157
|
+
...withBlocks && blocks ? { blocks } : {},
|
|
1158
|
+
...req.thread_ts ? { thread_ts: req.thread_ts } : {},
|
|
1159
|
+
unfurl_links: false,
|
|
1160
|
+
unfurl_media: false
|
|
1161
|
+
});
|
|
1162
|
+
let result;
|
|
1163
|
+
try {
|
|
1164
|
+
result = await send(true);
|
|
1165
|
+
} catch (err) {
|
|
1166
|
+
const code = extractSlackErrorCode(err);
|
|
1167
|
+
if (blocks && code && BLOCK_PAYLOAD_ERRORS.has(code)) {
|
|
1168
|
+
console.warn(`[slack] Block payload rejected (${code}); retrying direct send as text-only`);
|
|
1169
|
+
result = await send(false);
|
|
1170
|
+
} else {
|
|
1171
|
+
throw err;
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
if (!result.ok || !result.ts) {
|
|
1175
|
+
const code = extractSlackErrorCode(result);
|
|
1176
|
+
if (blocks && code && BLOCK_PAYLOAD_ERRORS.has(code)) {
|
|
1177
|
+
const retry = await send(false);
|
|
1178
|
+
if (!retry.ok || !retry.ts) {
|
|
1179
|
+
throw new Error(`Slack API error: ${retry.error ?? "unknown error"}`);
|
|
1180
|
+
}
|
|
1181
|
+
result = retry;
|
|
1182
|
+
} else {
|
|
1183
|
+
throw new Error(`Slack API error: ${result.error ?? "unknown error"}`);
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
const sentTs = result.ts;
|
|
1187
|
+
if (!sentTs) {
|
|
1188
|
+
throw new Error("Slack API error: missing message timestamp");
|
|
1189
|
+
}
|
|
1190
|
+
let permalink = null;
|
|
1191
|
+
try {
|
|
1192
|
+
const link = await this.web.chat.getPermalink({ channel: req.channel, message_ts: sentTs });
|
|
1193
|
+
permalink = link.ok ? link.permalink ?? null : null;
|
|
1194
|
+
} catch {
|
|
1195
|
+
permalink = null;
|
|
1196
|
+
}
|
|
1197
|
+
return {
|
|
1198
|
+
ts: sentTs,
|
|
1199
|
+
channel: req.channel,
|
|
1200
|
+
thread_ts: req.thread_ts ?? sentTs,
|
|
1201
|
+
permalink
|
|
1202
|
+
};
|
|
1203
|
+
}
|
|
1204
|
+
/** Resolve a Slack channel by its human name (with or without #). */
|
|
1205
|
+
async resolveChannelByName(name) {
|
|
1206
|
+
const normalized = name.replace(/^#/, "").trim().toLowerCase();
|
|
1207
|
+
if (!normalized) throw new Error("Slack channel name is required");
|
|
1208
|
+
let cursor;
|
|
1209
|
+
do {
|
|
1210
|
+
const result = await this.web.conversations.list({
|
|
1211
|
+
types: "public_channel,private_channel",
|
|
1212
|
+
limit: 1e3,
|
|
1213
|
+
...cursor ? { cursor } : {}
|
|
1214
|
+
});
|
|
1215
|
+
if (!result.ok) {
|
|
1216
|
+
throw new Error(`Slack API error: ${result.error ?? "unknown error"}`);
|
|
1217
|
+
}
|
|
1218
|
+
const channels = result.channels ?? [];
|
|
1219
|
+
const match = channels.find((channel) => {
|
|
1220
|
+
if (channel.is_archived) return false;
|
|
1221
|
+
return (channel.name_normalized ?? channel.name ?? "").toLowerCase() === normalized;
|
|
1222
|
+
});
|
|
1223
|
+
if (match?.id) {
|
|
1224
|
+
return { channel: match.id, name: match.name ?? normalized };
|
|
1225
|
+
}
|
|
1226
|
+
cursor = result.response_metadata?.next_cursor || void 0;
|
|
1227
|
+
} while (cursor);
|
|
1228
|
+
throw new Error(`Slack channel not found: #${normalized}`);
|
|
1229
|
+
}
|
|
1230
|
+
/** Resolve a Slack user email to a DM channel with that user. */
|
|
1231
|
+
async openDmByEmail(email) {
|
|
1232
|
+
const normalized = email.trim().toLowerCase();
|
|
1233
|
+
if (!normalized) throw new Error("Slack user email is required");
|
|
1234
|
+
const userResult = await this.web.users.lookupByEmail({ email: normalized });
|
|
1235
|
+
if (!userResult.ok || !userResult.user?.id) {
|
|
1236
|
+
throw new Error(`Slack user lookup failed: ${userResult.error ?? "user_not_found"}`);
|
|
1237
|
+
}
|
|
1238
|
+
const dmResult = await this.web.conversations.open({ users: userResult.user.id });
|
|
1239
|
+
if (!dmResult.ok || !dmResult.channel?.id) {
|
|
1240
|
+
throw new Error(`Slack DM open failed: ${dmResult.error ?? "unknown error"}`);
|
|
1241
|
+
}
|
|
1242
|
+
return { channel: dmResult.channel.id, user_id: userResult.user.id };
|
|
1243
|
+
}
|
|
1244
|
+
async fetchThreadHistory(req) {
|
|
1245
|
+
const { channel, thread_ts } = parseThreadId2(req.threadId);
|
|
1246
|
+
const requestedLimit = Math.min(Math.max(req.limit ?? 50, 1), 200);
|
|
1247
|
+
const messages = [];
|
|
1248
|
+
let cursor;
|
|
1249
|
+
let hasMore = false;
|
|
1250
|
+
do {
|
|
1251
|
+
const rawLimit = req.includeBotMessages ? requestedLimit : Math.min(Math.max(requestedLimit * 4, requestedLimit), 200);
|
|
1252
|
+
const result = await this.web.conversations.replies({
|
|
1253
|
+
channel,
|
|
1254
|
+
ts: thread_ts,
|
|
1255
|
+
limit: rawLimit,
|
|
1256
|
+
...cursor ? { cursor } : {},
|
|
1257
|
+
...req.oldestTs ? { oldest: req.oldestTs } : {},
|
|
1258
|
+
...req.latestTs ? { latest: req.latestTs } : {},
|
|
1259
|
+
...req.inclusive !== void 0 ? { inclusive: req.inclusive } : {}
|
|
1260
|
+
});
|
|
1261
|
+
if (!result.ok) {
|
|
1262
|
+
throw new Error(`Slack thread history error: ${result.error ?? "unknown error"}`);
|
|
1263
|
+
}
|
|
1264
|
+
const rawMessages = result.messages ?? [];
|
|
1265
|
+
let stoppedAtRequestedLimitWithMoreRaw = false;
|
|
1266
|
+
for (let i = 0; i < rawMessages.length; i++) {
|
|
1267
|
+
const raw = rawMessages[i];
|
|
1268
|
+
if (!raw) continue;
|
|
1269
|
+
const ts = typeof raw.ts === "string" ? raw.ts : void 0;
|
|
1270
|
+
if (!ts) continue;
|
|
1271
|
+
const botId = typeof raw.bot_id === "string" ? raw.bot_id : void 0;
|
|
1272
|
+
const subtype = typeof raw.subtype === "string" ? raw.subtype : void 0;
|
|
1273
|
+
const isBot = !!botId || subtype === "bot_message";
|
|
1274
|
+
if (isBot && !req.includeBotMessages) continue;
|
|
1275
|
+
const userId = typeof raw.user === "string" ? raw.user : void 0;
|
|
1276
|
+
let userName;
|
|
1277
|
+
if (userId) {
|
|
1278
|
+
const profile = await this.lookupUserProfile(userId);
|
|
1279
|
+
userName = profile.displayName ?? void 0;
|
|
1280
|
+
}
|
|
1281
|
+
const botProfile = raw.bot_profile;
|
|
1282
|
+
const botName = typeof botProfile?.name === "string" ? botProfile.name : typeof raw.username === "string" ? raw.username : void 0;
|
|
1283
|
+
const actorLabel = userName ?? botName ?? userId ?? botId ?? "unknown";
|
|
1284
|
+
const text = typeof raw.text === "string" ? raw.text : "";
|
|
1285
|
+
messages.push({
|
|
1286
|
+
ts,
|
|
1287
|
+
iso_time: slackTsToIso(ts),
|
|
1288
|
+
...userId ? { user_id: userId } : {},
|
|
1289
|
+
...userName ? { user_name: userName } : {},
|
|
1290
|
+
actor_label: actorLabel,
|
|
1291
|
+
text,
|
|
1292
|
+
is_bot: isBot,
|
|
1293
|
+
is_trigger: req.triggerTs === ts,
|
|
1294
|
+
is_mention: this.botUserId ? text.includes(`<@${this.botUserId}>`) : false
|
|
1295
|
+
});
|
|
1296
|
+
if (messages.length >= requestedLimit) {
|
|
1297
|
+
stoppedAtRequestedLimitWithMoreRaw = i < rawMessages.length - 1;
|
|
1298
|
+
break;
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
cursor = result.response_metadata?.next_cursor || void 0;
|
|
1302
|
+
hasMore = result.has_more === true || !!cursor || stoppedAtRequestedLimitWithMoreRaw;
|
|
1303
|
+
} while (!req.includeBotMessages && messages.length < requestedLimit && cursor);
|
|
1304
|
+
return {
|
|
1305
|
+
threadId: req.threadId,
|
|
1306
|
+
channel,
|
|
1307
|
+
thread_ts,
|
|
1308
|
+
messages: messages.slice(0, requestedLimit),
|
|
1309
|
+
has_more: hasMore
|
|
1310
|
+
};
|
|
1311
|
+
}
|
|
1312
|
+
async startStream(req) {
|
|
1313
|
+
const { channel, thread_ts } = parseThreadId2(req.threadId);
|
|
1314
|
+
const chat = this.web.chat;
|
|
1315
|
+
const result = await chat.startStream({
|
|
1316
|
+
channel,
|
|
1317
|
+
thread_ts,
|
|
1318
|
+
markdown_text: req.text?.trim() ? req.text : " ",
|
|
1319
|
+
...req.recipientUserId ? { recipient_user_id: req.recipientUserId } : {},
|
|
1320
|
+
...req.recipientTeamId ? { recipient_team_id: req.recipientTeamId } : {}
|
|
1321
|
+
});
|
|
1322
|
+
if (!result.ok || !result.ts) {
|
|
1323
|
+
throw new Error(`Slack stream start error: ${result.error ?? "unknown error"}`);
|
|
1324
|
+
}
|
|
1325
|
+
return result.ts;
|
|
1326
|
+
}
|
|
1327
|
+
async appendStream(req) {
|
|
1328
|
+
const { channel } = parseThreadId2(req.threadId);
|
|
1329
|
+
const chat = this.web.chat;
|
|
1330
|
+
const result = await chat.appendStream({
|
|
1331
|
+
channel,
|
|
1332
|
+
ts: req.ts,
|
|
1333
|
+
markdown_text: req.text
|
|
1334
|
+
});
|
|
1335
|
+
if (!result.ok) {
|
|
1336
|
+
throw new Error(`Slack stream append error: ${result.error ?? "unknown error"}`);
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
async stopStream(req) {
|
|
1340
|
+
const { channel } = parseThreadId2(req.threadId);
|
|
1341
|
+
const chat = this.web.chat;
|
|
1342
|
+
const result = await chat.stopStream({
|
|
1343
|
+
channel,
|
|
1344
|
+
ts: req.ts,
|
|
1345
|
+
...req.text ? { markdown_text: req.text } : {}
|
|
1346
|
+
});
|
|
1347
|
+
if (!result.ok) {
|
|
1348
|
+
throw new Error(`Slack stream stop error: ${result.error ?? "unknown error"}`);
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
async deleteMessage(req) {
|
|
1352
|
+
const { channel } = parseThreadId2(req.threadId);
|
|
1353
|
+
const result = await this.web.chat.delete({
|
|
1354
|
+
channel,
|
|
1355
|
+
ts: req.messageId
|
|
1356
|
+
});
|
|
1357
|
+
if (!result.ok) {
|
|
1358
|
+
throw new Error(`Slack delete error: ${result.error ?? "unknown error"}`);
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
async setThreadStatus(req) {
|
|
1362
|
+
const { channel, thread_ts } = parseThreadId2(req.threadId);
|
|
1363
|
+
const web = this.web;
|
|
1364
|
+
const args = {
|
|
1365
|
+
channel_id: channel,
|
|
1366
|
+
thread_ts,
|
|
1367
|
+
status: req.status,
|
|
1368
|
+
...req.loadingMessages?.length ? { loading_messages: req.loadingMessages } : {},
|
|
1369
|
+
...req.iconEmoji ? { icon_emoji: req.iconEmoji } : {}
|
|
1370
|
+
};
|
|
1371
|
+
const result = web.assistant?.threads?.setStatus ? await web.assistant.threads.setStatus(args) : await web.apiCall?.("assistant.threads.setStatus", args);
|
|
1372
|
+
if (!result?.ok) {
|
|
1373
|
+
throw new Error(`Slack assistant status error: ${result?.error ?? "unknown error"}`);
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
852
1376
|
/**
|
|
853
1377
|
* Start listening for inbound messages via Socket Mode
|
|
854
1378
|
*
|
|
@@ -857,31 +1381,24 @@ var SlackConnector = class _SlackConnector {
|
|
|
857
1381
|
* - Public channels (if enable_channels = true)
|
|
858
1382
|
* - Private channels (if enable_groups = true)
|
|
859
1383
|
* - Group DMs (if enable_mpim = true)
|
|
860
|
-
* -
|
|
1384
|
+
* - Explicit mention requirement for channel-like conversations
|
|
861
1385
|
* - Channel whitelist (if allowed_channel_ids is set)
|
|
862
1386
|
*/
|
|
863
1387
|
async startListening(callback) {
|
|
864
|
-
console.log("[slack] startListening called");
|
|
865
1388
|
if (!this.config.app_token) {
|
|
866
1389
|
console.error("[slack] ERROR: app_token is missing from config");
|
|
867
1390
|
throw new Error("Slack Socket Mode requires app_token in config");
|
|
868
1391
|
}
|
|
869
|
-
console.log("[slack] Creating SocketModeClient...");
|
|
870
1392
|
this.socketMode = new import_socket_mode.SocketModeClient({
|
|
871
1393
|
appToken: this.config.app_token
|
|
872
1394
|
});
|
|
873
1395
|
let botMentionPattern = null;
|
|
874
1396
|
let botMentionReplacePattern = null;
|
|
875
1397
|
try {
|
|
876
|
-
console.log("[slack] Testing bot token with auth.test()...");
|
|
877
1398
|
const authTest = await this.web.auth.test();
|
|
878
1399
|
this.botUserId = authTest.user_id;
|
|
879
1400
|
botMentionPattern = new RegExp(`<@${this.botUserId}>`);
|
|
880
1401
|
botMentionReplacePattern = new RegExp(`<@${this.botUserId}>\\s*`, "g");
|
|
881
|
-
console.log(`[slack] Bot user ID: ${this.botUserId}`);
|
|
882
|
-
console.log(
|
|
883
|
-
`[slack] Bot auth test successful - team: ${authTest.team}, user: ${authTest.user}`
|
|
884
|
-
);
|
|
885
1402
|
} catch (error) {
|
|
886
1403
|
console.error("[slack] Failed to fetch bot user ID:", error);
|
|
887
1404
|
console.error("[slack] This usually means the bot_token is invalid or expired");
|
|
@@ -890,8 +1407,7 @@ var SlackConnector = class _SlackConnector {
|
|
|
890
1407
|
const enableChannels = this.config.enable_channels ?? false;
|
|
891
1408
|
const enableGroups = this.config.enable_groups ?? false;
|
|
892
1409
|
const enableMpim = this.config.enable_mpim ?? false;
|
|
893
|
-
const requireMention =
|
|
894
|
-
const allowThreadRepliesWithoutMention = this.config.allow_thread_replies_without_mention ?? true;
|
|
1410
|
+
const requireMention = true;
|
|
895
1411
|
let allowedChannelIds;
|
|
896
1412
|
if (this.config.allowed_channel_ids) {
|
|
897
1413
|
if (Array.isArray(this.config.allowed_channel_ids)) {
|
|
@@ -907,13 +1423,6 @@ var SlackConnector = class _SlackConnector {
|
|
|
907
1423
|
allowedChannelIds = void 0;
|
|
908
1424
|
}
|
|
909
1425
|
}
|
|
910
|
-
console.log("[slack] Message source config:", {
|
|
911
|
-
enableChannels,
|
|
912
|
-
enableGroups,
|
|
913
|
-
enableMpim,
|
|
914
|
-
requireMention,
|
|
915
|
-
allowedChannelIds: allowedChannelIds?.length || 0
|
|
916
|
-
});
|
|
917
1426
|
this.socketMode.on("slack_event", async ({ type, body, ack }) => {
|
|
918
1427
|
if (type !== "events_api") {
|
|
919
1428
|
await ack();
|
|
@@ -925,44 +1434,69 @@ var SlackConnector = class _SlackConnector {
|
|
|
925
1434
|
return;
|
|
926
1435
|
}
|
|
927
1436
|
await ack();
|
|
928
|
-
|
|
1437
|
+
let event = body.event;
|
|
1438
|
+
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;
|
|
929
1439
|
console.log(
|
|
930
1440
|
`[slack] Processing ${eventType} event - channel: ${event.channel}, channel_type: ${event.channel_type}`
|
|
931
1441
|
);
|
|
932
1442
|
if (event.bot_id || event.subtype === "bot_message") {
|
|
933
|
-
console.log("[slack] Skipping bot message");
|
|
934
1443
|
return;
|
|
935
1444
|
}
|
|
936
1445
|
if (eventType === "message" && event.subtype) {
|
|
1446
|
+
if (event.subtype === "message_replied") {
|
|
1447
|
+
const replyEvent = await this.lookupLatestThreadReply(event);
|
|
1448
|
+
if (!replyEvent) {
|
|
1449
|
+
console.log(
|
|
1450
|
+
`[slack] Skipping message_replied event without fetchable latest reply channel=${event.channel ?? "(none)"} ts=${event.ts ?? "(none)"}`
|
|
1451
|
+
);
|
|
1452
|
+
return;
|
|
1453
|
+
}
|
|
1454
|
+
event = {
|
|
1455
|
+
...replyEvent,
|
|
1456
|
+
type: "message",
|
|
1457
|
+
channel_type: event.channel_type
|
|
1458
|
+
};
|
|
1459
|
+
console.log(
|
|
1460
|
+
`[slack] Resolved message_replied event to latest reply thread_ts=${event.thread_ts ?? "(none)"} ts=${event.ts ?? "(none)"}`
|
|
1461
|
+
);
|
|
1462
|
+
} else {
|
|
1463
|
+
console.debug(
|
|
1464
|
+
`[slack] Skipping message subtype=${event.subtype} user=${event.user ?? "(none)"} thread_ts=${event.thread_ts ?? "(none)"} ts=${event.ts ?? "(none)"}`
|
|
1465
|
+
);
|
|
1466
|
+
return;
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
if (event.bot_id || event.subtype === "bot_message") {
|
|
1470
|
+
console.debug(
|
|
1471
|
+
`[slack] Skipping resolved bot message subtype=${event.subtype ?? "(none)"} thread_ts=${event.thread_ts ?? "(none)"} ts=${event.ts ?? "(none)"}`
|
|
1472
|
+
);
|
|
937
1473
|
return;
|
|
938
1474
|
}
|
|
939
1475
|
const channelType = event.channel ? await this.resolveChannelType(event.channel, event.channel_type) : void 0;
|
|
940
1476
|
const isThreadReply = !!event.thread_ts;
|
|
941
|
-
const
|
|
942
|
-
if (
|
|
1477
|
+
const isChannelLikeMessage = channelType === "channel" || channelType === "group" || channelType === "mpim";
|
|
1478
|
+
if (isChannelLikeMessage && eventType !== "app_mention") {
|
|
1479
|
+
console.debug(
|
|
1480
|
+
`[slack] Skipping non-app_mention event in channel-like conversation type=${eventType} channel=${event.channel} ts=${event.ts}`
|
|
1481
|
+
);
|
|
1482
|
+
return;
|
|
1483
|
+
}
|
|
1484
|
+
if (isChannelLikeMessage && !botMentionPattern) {
|
|
943
1485
|
if (eventType === "message" && requireMention) {
|
|
944
|
-
console.warn(
|
|
945
|
-
"[slack] Bot ID unavailable, require_mention=true - skipping message event (will use app_mention)"
|
|
946
|
-
);
|
|
947
|
-
return;
|
|
948
|
-
}
|
|
949
|
-
if (eventType === "app_mention" && !requireMention) {
|
|
950
|
-
console.warn(
|
|
951
|
-
"[slack] Bot ID unavailable, require_mention=false - skipping app_mention (will use message)"
|
|
952
|
-
);
|
|
953
1486
|
return;
|
|
954
1487
|
}
|
|
955
1488
|
}
|
|
956
|
-
if (
|
|
1489
|
+
if (isChannelLikeMessage && botMentionPattern) {
|
|
957
1490
|
const mentionOutsideCodeBlock = hasActiveMention2(event.text ?? "", botMentionPattern);
|
|
958
|
-
if (eventType === "message" && mentionOutsideCodeBlock) {
|
|
959
|
-
return;
|
|
960
|
-
}
|
|
961
1491
|
if (eventType === "app_mention" && !mentionOutsideCodeBlock) {
|
|
962
1492
|
return;
|
|
963
1493
|
}
|
|
964
1494
|
}
|
|
965
|
-
if (!channelType
|
|
1495
|
+
if (!channelType) {
|
|
1496
|
+
console.warn(`[slack] Cannot determine channel_type for channel=${event.channel}`);
|
|
1497
|
+
return;
|
|
1498
|
+
}
|
|
1499
|
+
if (channelType === "im") {
|
|
966
1500
|
} else if (channelType === "channel" && !enableChannels) {
|
|
967
1501
|
return;
|
|
968
1502
|
} else if (channelType === "group" && !enableGroups) {
|
|
@@ -973,15 +1507,14 @@ var SlackConnector = class _SlackConnector {
|
|
|
973
1507
|
console.warn(`[slack] Unknown channel_type="${channelType}"`);
|
|
974
1508
|
return;
|
|
975
1509
|
}
|
|
976
|
-
if (
|
|
977
|
-
|
|
978
|
-
return;
|
|
979
|
-
}
|
|
1510
|
+
if (!isChannelAllowedByWhitelist(channelType, event.channel, allowedChannelIds)) {
|
|
1511
|
+
return;
|
|
980
1512
|
}
|
|
981
1513
|
let messageText = event.text ?? "";
|
|
982
1514
|
let hasMention = false;
|
|
983
|
-
|
|
984
|
-
|
|
1515
|
+
const allowedViaThreadReplyException = false;
|
|
1516
|
+
const requiresExplicitMention = channelType !== "im";
|
|
1517
|
+
if (requireMention && requiresExplicitMention) {
|
|
985
1518
|
if (!botMentionPattern || !botMentionReplacePattern) {
|
|
986
1519
|
if (eventType === "app_mention") {
|
|
987
1520
|
hasMention = true;
|
|
@@ -994,20 +1527,25 @@ var SlackConnector = class _SlackConnector {
|
|
|
994
1527
|
} else {
|
|
995
1528
|
hasMention = hasActiveMention2(messageText, botMentionPattern);
|
|
996
1529
|
if (!hasMention) {
|
|
997
|
-
|
|
998
|
-
allowedViaThreadReplyException = true;
|
|
999
|
-
} else {
|
|
1000
|
-
return;
|
|
1001
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
if (hasMention) {
|
|
1004
|
-
messageText = messageText.replace(botMentionReplacePattern, "").trim();
|
|
1530
|
+
return;
|
|
1005
1531
|
}
|
|
1532
|
+
messageText = messageText.replace(botMentionReplacePattern, "").trim();
|
|
1533
|
+
}
|
|
1534
|
+
} else if (botMentionPattern && botMentionReplacePattern) {
|
|
1535
|
+
hasMention = hasActiveMention2(messageText, botMentionPattern);
|
|
1536
|
+
if (hasMention) {
|
|
1537
|
+
messageText = messageText.replace(botMentionReplacePattern, "").trim();
|
|
1006
1538
|
}
|
|
1007
1539
|
}
|
|
1540
|
+
if (!this.shouldProcessInboundEventOnce(event.channel, event.ts)) {
|
|
1541
|
+
console.log(
|
|
1542
|
+
`[slack] Skipping duplicate inbound event type=${eventType} channel=${event.channel} ts=${event.ts}`
|
|
1543
|
+
);
|
|
1544
|
+
return;
|
|
1545
|
+
}
|
|
1008
1546
|
const threadId = event.thread_ts ? `${event.channel}-${event.thread_ts}` : `${event.channel}-${event.ts}`;
|
|
1009
1547
|
console.log(
|
|
1010
|
-
`[slack]
|
|
1548
|
+
`[slack] Accepted inbound message: thread=${threadId} channel_type=${channelType} user=${event.user}`
|
|
1011
1549
|
);
|
|
1012
1550
|
let slackUserEmail = null;
|
|
1013
1551
|
let slackUserDisplayName = null;
|
|
@@ -1028,7 +1566,15 @@ var SlackConnector = class _SlackConnector {
|
|
|
1028
1566
|
metadata: {
|
|
1029
1567
|
channel: event.channel,
|
|
1030
1568
|
channel_type: channelType,
|
|
1569
|
+
...event.user ? { slack_user_id: event.user } : {},
|
|
1570
|
+
...slackTeamId ? { slack_team_id: slackTeamId } : {},
|
|
1031
1571
|
requires_mapping_verification: allowedViaThreadReplyException,
|
|
1572
|
+
...this.botUserId ? { slack_bot_user_id: this.botUserId } : {},
|
|
1573
|
+
...typeof event.ts === "string" ? { slack_message_ts: event.ts } : {},
|
|
1574
|
+
...typeof event.thread_ts === "string" ? { slack_thread_ts: event.thread_ts } : typeof event.ts === "string" ? { slack_thread_ts: event.ts } : {},
|
|
1575
|
+
slack_is_thread_reply: isThreadReply,
|
|
1576
|
+
slack_has_mention: hasMention,
|
|
1577
|
+
slack_event_type: eventType,
|
|
1032
1578
|
...slackUserEmail ? { slack_user_email: slackUserEmail } : {},
|
|
1033
1579
|
...slackUserDisplayName ? { slack_user_name: slackUserDisplayName } : {},
|
|
1034
1580
|
...slackChannelName ? { slack_channel_name: slackChannelName } : {},
|
|
@@ -1039,9 +1585,7 @@ var SlackConnector = class _SlackConnector {
|
|
|
1039
1585
|
}
|
|
1040
1586
|
});
|
|
1041
1587
|
});
|
|
1042
|
-
console.log("[slack] Starting Socket Mode client...");
|
|
1043
1588
|
await this.socketMode.start();
|
|
1044
|
-
console.log("[slack] Socket Mode client connected successfully!");
|
|
1045
1589
|
}
|
|
1046
1590
|
/**
|
|
1047
1591
|
* Stop Socket Mode listener
|
|
@@ -1057,18 +1601,310 @@ var SlackConnector = class _SlackConnector {
|
|
|
1057
1601
|
*
|
|
1058
1602
|
* Returns `{ text, blocks? }`. `text` is the mrkdwn fallback used for
|
|
1059
1603
|
* notifications and clients that don't render Block Kit; `blocks` is set
|
|
1060
|
-
* when the message contains
|
|
1061
|
-
*
|
|
1604
|
+
* when the message contains tables that can benefit from Slack's native
|
|
1605
|
+
* markdown/table blocks.
|
|
1062
1606
|
*/
|
|
1063
1607
|
formatMessage(markdown) {
|
|
1064
1608
|
return markdownToSlackPayload(markdown);
|
|
1065
1609
|
}
|
|
1066
1610
|
};
|
|
1067
1611
|
|
|
1612
|
+
// src/gateway/connectors/teams.ts
|
|
1613
|
+
var import_node_http = require("http");
|
|
1614
|
+
var import_botbuilder = require("botbuilder");
|
|
1615
|
+
function parseThreadId3(threadId) {
|
|
1616
|
+
const lastPipe = threadId.lastIndexOf("|");
|
|
1617
|
+
if (lastPipe === -1) {
|
|
1618
|
+
throw new Error(
|
|
1619
|
+
`Invalid Teams thread ID format: "${threadId}" (expected "{conversationId}|{activityId}")`
|
|
1620
|
+
);
|
|
1621
|
+
}
|
|
1622
|
+
const conversationId = threadId.substring(0, lastPipe);
|
|
1623
|
+
const activityId = threadId.substring(lastPipe + 1);
|
|
1624
|
+
if (!conversationId || !activityId) {
|
|
1625
|
+
throw new Error(
|
|
1626
|
+
`Invalid Teams thread ID format: "${threadId}" (expected "{conversationId}|{activityId}")`
|
|
1627
|
+
);
|
|
1628
|
+
}
|
|
1629
|
+
return { conversationId, activityId };
|
|
1630
|
+
}
|
|
1631
|
+
function stripMention2(text, botName) {
|
|
1632
|
+
const escaped = botName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1633
|
+
const pattern = new RegExp(`<at>${escaped}</at>\\s*`, "gi");
|
|
1634
|
+
return text.replace(pattern, "").trim();
|
|
1635
|
+
}
|
|
1636
|
+
function hasActiveMention3(text, botName) {
|
|
1637
|
+
const stripped = text.replace(/```[\s\S]*?```/g, "").replace(/`[^`]*`/g, "");
|
|
1638
|
+
const escaped = botName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1639
|
+
const pattern = new RegExp(`<at>${escaped}</at>`, "i");
|
|
1640
|
+
return pattern.test(stripped);
|
|
1641
|
+
}
|
|
1642
|
+
function stripHtmlTags(text) {
|
|
1643
|
+
return text.replace(/<[^>]+>/g, "");
|
|
1644
|
+
}
|
|
1645
|
+
function extractQuotedReplyText(attachments) {
|
|
1646
|
+
if (!attachments) return null;
|
|
1647
|
+
for (const attachment of attachments) {
|
|
1648
|
+
if (attachment.contentType !== "text/html" || !attachment.content) continue;
|
|
1649
|
+
if (!attachment.content.includes("schema.skype.com/Reply")) continue;
|
|
1650
|
+
const afterQuote = attachment.content.split("</blockquote>").pop();
|
|
1651
|
+
if (!afterQuote) continue;
|
|
1652
|
+
const text = stripHtmlTags(afterQuote).trim();
|
|
1653
|
+
if (text) return text;
|
|
1654
|
+
}
|
|
1655
|
+
return null;
|
|
1656
|
+
}
|
|
1657
|
+
function wrapResponse(res) {
|
|
1658
|
+
const wrapped = res;
|
|
1659
|
+
wrapped.status = (code) => {
|
|
1660
|
+
res.statusCode = code;
|
|
1661
|
+
return res;
|
|
1662
|
+
};
|
|
1663
|
+
wrapped.send = (body) => {
|
|
1664
|
+
if (body !== void 0 && body !== null) {
|
|
1665
|
+
const bodyStr = typeof body === "string" ? body : JSON.stringify(body);
|
|
1666
|
+
res.setHeader("Content-Type", "application/json");
|
|
1667
|
+
res.end(bodyStr);
|
|
1668
|
+
} else {
|
|
1669
|
+
res.end();
|
|
1670
|
+
}
|
|
1671
|
+
};
|
|
1672
|
+
return wrapped;
|
|
1673
|
+
}
|
|
1674
|
+
var TeamsConnector = class {
|
|
1675
|
+
channelType = "teams";
|
|
1676
|
+
adapter;
|
|
1677
|
+
config;
|
|
1678
|
+
server = null;
|
|
1679
|
+
/** Stored ConversationReferences for proactive messaging, keyed by threadId */
|
|
1680
|
+
conversationRefs = /* @__PURE__ */ new Map();
|
|
1681
|
+
constructor(config) {
|
|
1682
|
+
this.config = config;
|
|
1683
|
+
if (!this.config.app_id) {
|
|
1684
|
+
throw new Error("Teams connector requires app_id in config");
|
|
1685
|
+
}
|
|
1686
|
+
if (!this.config.app_password) {
|
|
1687
|
+
throw new Error("Teams connector requires app_password in config");
|
|
1688
|
+
}
|
|
1689
|
+
this.adapter = new import_botbuilder.BotFrameworkAdapter({
|
|
1690
|
+
appId: this.config.app_id,
|
|
1691
|
+
appPassword: this.config.app_password,
|
|
1692
|
+
...this.config.tenant_id ? { channelAuthTenant: this.config.tenant_id } : {}
|
|
1693
|
+
});
|
|
1694
|
+
}
|
|
1695
|
+
/**
|
|
1696
|
+
* Send a message to a Teams thread using a stored ConversationReference.
|
|
1697
|
+
*
|
|
1698
|
+
* Uses the proactive messaging pattern: look up the stored reference
|
|
1699
|
+
* from the inbound turn, then use adapter.continueConversation() to
|
|
1700
|
+
* send a message outside of a turn.
|
|
1701
|
+
*/
|
|
1702
|
+
async sendMessage(req) {
|
|
1703
|
+
const ref = this.conversationRefs.get(req.threadId);
|
|
1704
|
+
if (!ref) {
|
|
1705
|
+
throw new Error(
|
|
1706
|
+
`No ConversationReference stored for thread ${req.threadId}. Cannot send proactive message before receiving an inbound message.`
|
|
1707
|
+
);
|
|
1708
|
+
}
|
|
1709
|
+
let sentActivityId = "";
|
|
1710
|
+
await this.adapter.continueConversation(ref, async (turnContext) => {
|
|
1711
|
+
const response = await turnContext.sendActivity(req.text);
|
|
1712
|
+
sentActivityId = response?.id ?? "";
|
|
1713
|
+
});
|
|
1714
|
+
return sentActivityId;
|
|
1715
|
+
}
|
|
1716
|
+
/**
|
|
1717
|
+
* Start listening for inbound messages via an HTTP webhook.
|
|
1718
|
+
*
|
|
1719
|
+
* Creates a lightweight HTTP server that receives Bot Framework activities
|
|
1720
|
+
* from Azure Bot Service, processes them, and calls the gateway callback.
|
|
1721
|
+
*/
|
|
1722
|
+
async startListening(callback) {
|
|
1723
|
+
const port = this.config.webhook_port ?? 3978;
|
|
1724
|
+
const path = this.config.webhook_path ?? "/api/messages";
|
|
1725
|
+
const requireMention = this.config.require_mention ?? true;
|
|
1726
|
+
const allowThreadRepliesWithoutMention = this.config.allow_thread_replies_without_mention ?? true;
|
|
1727
|
+
let botName = null;
|
|
1728
|
+
this.server = (0, import_node_http.createServer)((req, res) => {
|
|
1729
|
+
if (req.method !== "POST" || req.url !== path) {
|
|
1730
|
+
res.statusCode = 404;
|
|
1731
|
+
res.end();
|
|
1732
|
+
return;
|
|
1733
|
+
}
|
|
1734
|
+
const bodyChunks = [];
|
|
1735
|
+
req.on("data", (chunk) => bodyChunks.push(chunk));
|
|
1736
|
+
req.on("end", () => {
|
|
1737
|
+
const bodyStr = Buffer.concat(bodyChunks).toString("utf-8");
|
|
1738
|
+
let body;
|
|
1739
|
+
try {
|
|
1740
|
+
body = JSON.parse(bodyStr);
|
|
1741
|
+
} catch {
|
|
1742
|
+
res.statusCode = 400;
|
|
1743
|
+
res.end("Invalid JSON");
|
|
1744
|
+
return;
|
|
1745
|
+
}
|
|
1746
|
+
req.body = body;
|
|
1747
|
+
this.adapter.processActivity(
|
|
1748
|
+
req,
|
|
1749
|
+
wrapResponse(res),
|
|
1750
|
+
async (turnContext) => {
|
|
1751
|
+
const activity = turnContext.activity;
|
|
1752
|
+
if (activity.type !== "message") {
|
|
1753
|
+
return;
|
|
1754
|
+
}
|
|
1755
|
+
if (activity.from?.id === this.config.app_id) {
|
|
1756
|
+
return;
|
|
1757
|
+
}
|
|
1758
|
+
const ref = import_botbuilder.TurnContext.getConversationReference(activity);
|
|
1759
|
+
if (!botName && activity.recipient?.name) {
|
|
1760
|
+
botName = activity.recipient.name;
|
|
1761
|
+
console.log(`[teams] Bot name resolved: "${botName}"`);
|
|
1762
|
+
}
|
|
1763
|
+
const conversationType = activity.conversation?.conversationType;
|
|
1764
|
+
const isPersonal = conversationType === "personal";
|
|
1765
|
+
const isThreadReply = !isPersonal && !!activity.replyToId;
|
|
1766
|
+
const rawConversationId = activity.conversation?.id ?? "";
|
|
1767
|
+
const replyToId = activity.replyToId;
|
|
1768
|
+
let threadId;
|
|
1769
|
+
if (isPersonal) {
|
|
1770
|
+
threadId = rawConversationId;
|
|
1771
|
+
} else {
|
|
1772
|
+
let baseConversationId = rawConversationId;
|
|
1773
|
+
let messageIdFromConv;
|
|
1774
|
+
const msgIdIdx = rawConversationId.indexOf(";messageid=");
|
|
1775
|
+
if (msgIdIdx !== -1) {
|
|
1776
|
+
baseConversationId = rawConversationId.substring(0, msgIdIdx);
|
|
1777
|
+
messageIdFromConv = rawConversationId.substring(msgIdIdx + ";messageid=".length);
|
|
1778
|
+
}
|
|
1779
|
+
const rootId = messageIdFromConv ?? replyToId ?? activity.id ?? "";
|
|
1780
|
+
threadId = `${baseConversationId}|${rootId}`;
|
|
1781
|
+
}
|
|
1782
|
+
this.conversationRefs.set(threadId, ref);
|
|
1783
|
+
const quotedReplyText = extractQuotedReplyText(
|
|
1784
|
+
activity.attachments
|
|
1785
|
+
);
|
|
1786
|
+
let messageText = quotedReplyText ?? activity.text ?? "";
|
|
1787
|
+
let hasMention = false;
|
|
1788
|
+
if (activity.entities) {
|
|
1789
|
+
for (const entity of activity.entities) {
|
|
1790
|
+
if (entity.type !== "mention") continue;
|
|
1791
|
+
const mentioned = entity.mentioned;
|
|
1792
|
+
const mentionedId = mentioned?.id ?? "";
|
|
1793
|
+
const isBotMention = mentionedId === this.config.app_id || mentionedId.includes(this.config.app_id);
|
|
1794
|
+
if (!isBotMention) continue;
|
|
1795
|
+
hasMention = true;
|
|
1796
|
+
const mentionText = entity.text;
|
|
1797
|
+
if (mentionText && messageText.includes(mentionText)) {
|
|
1798
|
+
messageText = messageText.replace(mentionText, "").trim();
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
if (!hasMention) {
|
|
1803
|
+
const allBotNames = /* @__PURE__ */ new Set();
|
|
1804
|
+
if (botName) allBotNames.add(botName);
|
|
1805
|
+
if (activity.recipient?.name) allBotNames.add(activity.recipient.name);
|
|
1806
|
+
for (const name of allBotNames) {
|
|
1807
|
+
if (hasActiveMention3(messageText, name)) {
|
|
1808
|
+
hasMention = true;
|
|
1809
|
+
messageText = stripMention2(messageText, name);
|
|
1810
|
+
}
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
messageText = stripHtmlTags(messageText).trim();
|
|
1814
|
+
if (!messageText) {
|
|
1815
|
+
return;
|
|
1816
|
+
}
|
|
1817
|
+
if (!isPersonal && requireMention) {
|
|
1818
|
+
if (!hasMention) {
|
|
1819
|
+
if (isThreadReply && allowThreadRepliesWithoutMention) {
|
|
1820
|
+
} else {
|
|
1821
|
+
return;
|
|
1822
|
+
}
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
const userName = activity.from?.name;
|
|
1826
|
+
const userAadObjectId = activity.from?.aadObjectId;
|
|
1827
|
+
const channelData = activity.channelData;
|
|
1828
|
+
const teamName = channelData?.team?.name;
|
|
1829
|
+
const channelName = channelData?.channel?.name;
|
|
1830
|
+
const tenantId = channelData?.tenant?.id;
|
|
1831
|
+
callback({
|
|
1832
|
+
threadId,
|
|
1833
|
+
text: messageText,
|
|
1834
|
+
userId: activity.from?.id ?? "unknown",
|
|
1835
|
+
timestamp: activity.timestamp?.toISOString() ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
1836
|
+
metadata: {
|
|
1837
|
+
teams_conversation_type: conversationType,
|
|
1838
|
+
teams_channel_name: channelName,
|
|
1839
|
+
teams_team_name: teamName,
|
|
1840
|
+
teams_user_name: userName,
|
|
1841
|
+
teams_user_aad_id: userAadObjectId,
|
|
1842
|
+
teams_tenant_id: tenantId,
|
|
1843
|
+
requires_mapping_verification: !hasMention && isThreadReply
|
|
1844
|
+
}
|
|
1845
|
+
});
|
|
1846
|
+
}
|
|
1847
|
+
);
|
|
1848
|
+
});
|
|
1849
|
+
});
|
|
1850
|
+
return new Promise((resolve, reject) => {
|
|
1851
|
+
if (!this.server) {
|
|
1852
|
+
reject(new Error("Server not created"));
|
|
1853
|
+
return;
|
|
1854
|
+
}
|
|
1855
|
+
this.server.on("error", (err) => {
|
|
1856
|
+
console.error(`[teams] HTTP server error:`, err);
|
|
1857
|
+
reject(err);
|
|
1858
|
+
});
|
|
1859
|
+
this.server.listen(port, () => {
|
|
1860
|
+
console.log(`[teams] Webhook server listening on port ${port} at ${path}`);
|
|
1861
|
+
resolve();
|
|
1862
|
+
});
|
|
1863
|
+
});
|
|
1864
|
+
}
|
|
1865
|
+
/**
|
|
1866
|
+
* Stop the HTTP webhook server
|
|
1867
|
+
*/
|
|
1868
|
+
async stopListening() {
|
|
1869
|
+
if (this.server) {
|
|
1870
|
+
return new Promise((resolve) => {
|
|
1871
|
+
this.server?.close(() => {
|
|
1872
|
+
console.log("[teams] Webhook server stopped");
|
|
1873
|
+
this.server = null;
|
|
1874
|
+
resolve();
|
|
1875
|
+
});
|
|
1876
|
+
});
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
/**
|
|
1880
|
+
* Convert markdown to Teams-compatible format.
|
|
1881
|
+
*
|
|
1882
|
+
* Teams natively supports most markdown (bold, italic, code blocks, links, lists).
|
|
1883
|
+
* Main adjustments:
|
|
1884
|
+
* - Collapse <details>/<summary> blocks (not supported in Teams)
|
|
1885
|
+
* - Strip unsupported HTML tags
|
|
1886
|
+
*/
|
|
1887
|
+
formatMessage(markdown) {
|
|
1888
|
+
let text = markdown;
|
|
1889
|
+
text = text.replace(
|
|
1890
|
+
/<details>\s*<summary>([\s\S]*?)<\/summary>\s*([\s\S]*?)<\/details>/gi,
|
|
1891
|
+
(_match, summary, content) => {
|
|
1892
|
+
const summaryText = summary.trim();
|
|
1893
|
+
const contentText = content.trim();
|
|
1894
|
+
return `**${summaryText}**
|
|
1895
|
+
${contentText}`;
|
|
1896
|
+
}
|
|
1897
|
+
);
|
|
1898
|
+
text = stripHtmlTags(text);
|
|
1899
|
+
return text.trim();
|
|
1900
|
+
}
|
|
1901
|
+
};
|
|
1902
|
+
|
|
1068
1903
|
// src/gateway/connector-registry.ts
|
|
1069
1904
|
var connectors = /* @__PURE__ */ new Map();
|
|
1070
1905
|
connectors.set("slack", (config) => new SlackConnector(config));
|
|
1071
1906
|
connectors.set("github", (config) => new GitHubConnector(config));
|
|
1907
|
+
connectors.set("teams", (config) => new TeamsConnector(config));
|
|
1072
1908
|
function getConnector(channelType, config) {
|
|
1073
1909
|
const factory = connectors.get(channelType);
|
|
1074
1910
|
if (!factory) {
|
|
@@ -1083,13 +1919,91 @@ function hasConnector(channelType) {
|
|
|
1083
1919
|
return connectors.has(channelType);
|
|
1084
1920
|
}
|
|
1085
1921
|
|
|
1922
|
+
// src/gateway/connectors/slack-manifest.ts
|
|
1923
|
+
function hasChannelLikeSurface(opts) {
|
|
1924
|
+
return opts.publicChannels || opts.privateChannels || opts.groupDms;
|
|
1925
|
+
}
|
|
1926
|
+
function sortedUnique(values) {
|
|
1927
|
+
return [...new Set(values)].sort();
|
|
1928
|
+
}
|
|
1929
|
+
function requiredBotScopes(opts) {
|
|
1930
|
+
const scopes = ["chat:write", "im:history", "im:read", "users:read"];
|
|
1931
|
+
if (hasChannelLikeSurface(opts)) {
|
|
1932
|
+
scopes.push("app_mentions:read");
|
|
1933
|
+
}
|
|
1934
|
+
if (opts.publicChannels) {
|
|
1935
|
+
scopes.push("channels:history", "channels:read");
|
|
1936
|
+
}
|
|
1937
|
+
if (opts.privateChannels) {
|
|
1938
|
+
scopes.push("groups:history", "groups:read");
|
|
1939
|
+
}
|
|
1940
|
+
if (opts.groupDms) {
|
|
1941
|
+
scopes.push("mpim:history", "mpim:read");
|
|
1942
|
+
}
|
|
1943
|
+
if (opts.alignUsers) {
|
|
1944
|
+
scopes.push("users:read.email");
|
|
1945
|
+
}
|
|
1946
|
+
if (opts.outbound) {
|
|
1947
|
+
scopes.push(
|
|
1948
|
+
"chat:write.public",
|
|
1949
|
+
"channels:read",
|
|
1950
|
+
"groups:read",
|
|
1951
|
+
"im:write",
|
|
1952
|
+
"users:read.email"
|
|
1953
|
+
);
|
|
1954
|
+
}
|
|
1955
|
+
return sortedUnique(scopes);
|
|
1956
|
+
}
|
|
1957
|
+
function requiredBotEvents(opts) {
|
|
1958
|
+
const events = ["message.im"];
|
|
1959
|
+
if (hasChannelLikeSurface(opts)) {
|
|
1960
|
+
events.push("app_mention");
|
|
1961
|
+
}
|
|
1962
|
+
return sortedUnique(events);
|
|
1963
|
+
}
|
|
1964
|
+
function buildSlackManifest(opts) {
|
|
1965
|
+
return {
|
|
1966
|
+
display_information: {
|
|
1967
|
+
name: opts.appName
|
|
1968
|
+
},
|
|
1969
|
+
features: {
|
|
1970
|
+
bot_user: {
|
|
1971
|
+
display_name: opts.botDisplayName ?? opts.appName,
|
|
1972
|
+
always_online: true
|
|
1973
|
+
},
|
|
1974
|
+
app_home: {
|
|
1975
|
+
messages_tab_enabled: true,
|
|
1976
|
+
messages_tab_read_only_enabled: false,
|
|
1977
|
+
home_tab_enabled: false
|
|
1978
|
+
}
|
|
1979
|
+
},
|
|
1980
|
+
oauth_config: {
|
|
1981
|
+
scopes: {
|
|
1982
|
+
bot: requiredBotScopes(opts)
|
|
1983
|
+
}
|
|
1984
|
+
},
|
|
1985
|
+
settings: {
|
|
1986
|
+
event_subscriptions: {
|
|
1987
|
+
bot_events: requiredBotEvents(opts)
|
|
1988
|
+
},
|
|
1989
|
+
interactivity: {
|
|
1990
|
+
is_enabled: false
|
|
1991
|
+
},
|
|
1992
|
+
org_deploy_enabled: false,
|
|
1993
|
+
socket_mode_enabled: true,
|
|
1994
|
+
token_rotation_enabled: false
|
|
1995
|
+
}
|
|
1996
|
+
};
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1086
1999
|
// src/gateway/context.ts
|
|
1087
2000
|
var PLATFORM_LABELS = {
|
|
1088
2001
|
slack: "Slack",
|
|
1089
2002
|
discord: "Discord",
|
|
1090
2003
|
github: "GitHub",
|
|
1091
2004
|
whatsapp: "WhatsApp",
|
|
1092
|
-
telegram: "Telegram"
|
|
2005
|
+
telegram: "Telegram",
|
|
2006
|
+
teams: "Microsoft Teams"
|
|
1093
2007
|
};
|
|
1094
2008
|
function formatGatewayContext(ctx) {
|
|
1095
2009
|
const label = PLATFORM_LABELS[ctx.platform] ?? ctx.platform;
|
|
@@ -1126,24 +2040,76 @@ function formatGatewayContext(ctx) {
|
|
|
1126
2040
|
`;
|
|
1127
2041
|
}
|
|
1128
2042
|
|
|
2043
|
+
// src/types/id.ts
|
|
2044
|
+
var SHORT_ID_LENGTH = 24;
|
|
2045
|
+
function toShortId(id, length = SHORT_ID_LENGTH) {
|
|
2046
|
+
return id.replace(/-/g, "").slice(0, Math.min(length, 32));
|
|
2047
|
+
}
|
|
2048
|
+
function shortId(id) {
|
|
2049
|
+
return toShortId(id, SHORT_ID_LENGTH);
|
|
2050
|
+
}
|
|
2051
|
+
|
|
1129
2052
|
// src/gateway/system-message.ts
|
|
2053
|
+
var GATEWAY_SYSTEM_PREFIX = "Agor:";
|
|
2054
|
+
function formatGatewayMarkdownSessionReference(sessionId, sessionUrl) {
|
|
2055
|
+
return sessionUrl ? `[session](${sessionUrl})` : `session ${shortId(sessionId)}`;
|
|
2056
|
+
}
|
|
2057
|
+
function formatGatewaySessionCreatedMessage(sessionId, sessionUrl) {
|
|
2058
|
+
return sessionUrl ? `Session created: ${sessionUrl}` : `Session ${shortId(sessionId)} created, sending prompt to agent.`;
|
|
2059
|
+
}
|
|
2060
|
+
function formatGatewayFollowUpRoutingMessage(sessionId, sessionUrl) {
|
|
2061
|
+
return `Mention received \u2014 routing to ${formatGatewayMarkdownSessionReference(sessionId, sessionUrl)}.`;
|
|
2062
|
+
}
|
|
1130
2063
|
function formatGatewaySystemMessage(channelType, text) {
|
|
1131
2064
|
const sessionCreatedMatch = text.match(/^Session created: (https?:\/\/\S+)$/);
|
|
2065
|
+
const slackMentionGuidance = "Mention me again to follow up.";
|
|
1132
2066
|
if (channelType === "slack") {
|
|
1133
|
-
const markdown = sessionCreatedMatch ?
|
|
2067
|
+
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}`;
|
|
1134
2068
|
return markdownToMrkdwn(markdown);
|
|
1135
2069
|
}
|
|
1136
|
-
return
|
|
2070
|
+
return `${GATEWAY_SYSTEM_PREFIX} ${text}`;
|
|
2071
|
+
}
|
|
2072
|
+
function formatGatewaySystemPayload(channelType, text) {
|
|
2073
|
+
const formatted = formatGatewaySystemMessage(channelType, text);
|
|
2074
|
+
if (channelType !== "slack") {
|
|
2075
|
+
return { text: formatted };
|
|
2076
|
+
}
|
|
2077
|
+
return {
|
|
2078
|
+
text: formatted,
|
|
2079
|
+
blocks: [
|
|
2080
|
+
{
|
|
2081
|
+
type: "context",
|
|
2082
|
+
elements: [
|
|
2083
|
+
{
|
|
2084
|
+
type: "mrkdwn",
|
|
2085
|
+
text: formatted
|
|
2086
|
+
}
|
|
2087
|
+
]
|
|
2088
|
+
}
|
|
2089
|
+
]
|
|
2090
|
+
};
|
|
1137
2091
|
}
|
|
1138
2092
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1139
2093
|
0 && (module.exports = {
|
|
1140
2094
|
GitHubConnector,
|
|
1141
2095
|
SlackConnector,
|
|
2096
|
+
TeamsConnector,
|
|
2097
|
+
buildSlackManifest,
|
|
2098
|
+
extractQuotedReplyText,
|
|
1142
2099
|
formatGatewayContext,
|
|
2100
|
+
formatGatewayFollowUpRoutingMessage,
|
|
2101
|
+
formatGatewayMarkdownSessionReference,
|
|
2102
|
+
formatGatewaySessionCreatedMessage,
|
|
1143
2103
|
formatGatewaySystemMessage,
|
|
2104
|
+
formatGatewaySystemPayload,
|
|
1144
2105
|
getConnector,
|
|
1145
2106
|
hasConnector,
|
|
2107
|
+
isChannelAllowedByWhitelist,
|
|
2108
|
+
markdownToMrkdwn,
|
|
1146
2109
|
normalizeOutbound,
|
|
1147
2110
|
parseGitHubThreadId,
|
|
1148
|
-
|
|
2111
|
+
parseTeamsThreadId,
|
|
2112
|
+
registerConnector,
|
|
2113
|
+
requiredBotEvents,
|
|
2114
|
+
requiredBotScopes
|
|
1149
2115
|
});
|