@cursor/july 0.1.97 → 0.1.100
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/AGENTS.md +5 -3
- package/dist/bin/agent-serve.js +6 -7
- package/dist/channels/github/defaults.d.ts.map +1 -1
- package/dist/channels/github/defaults.js +28 -3
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +16 -0
- package/dist/channels/github/progress.d.ts +7 -0
- package/dist/channels/github/progress.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.d.ts +2 -0
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +37 -4
- package/dist/channels/slack/api.d.ts +16 -7
- package/dist/channels/slack/api.d.ts.map +1 -1
- package/dist/channels/slack/api.js +29 -13
- package/dist/channels/slack/constants.d.ts +6 -0
- package/dist/channels/slack/constants.d.ts.map +1 -1
- package/dist/channels/slack/constants.js +6 -0
- package/dist/channels/slack/defaults.d.ts +9 -4
- package/dist/channels/slack/defaults.d.ts.map +1 -1
- package/dist/channels/slack/defaults.js +221 -122
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +3 -3
- package/dist/channels/slack/inbound.d.ts +9 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +14 -0
- package/dist/channels/slack/index.d.ts +1 -0
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +1 -0
- package/dist/channels/slack/live-delivery.d.ts +6 -1
- package/dist/channels/slack/live-delivery.d.ts.map +1 -1
- package/dist/channels/slack/live-delivery.js +110 -20
- package/dist/channels/slack/progress-delivery.d.ts +28 -0
- package/dist/channels/slack/progress-delivery.d.ts.map +1 -0
- package/dist/channels/slack/progress-delivery.js +115 -0
- package/dist/channels/slack/reasoning-card.d.ts +38 -0
- package/dist/channels/slack/reasoning-card.d.ts.map +1 -0
- package/dist/channels/slack/reasoning-card.js +104 -0
- package/dist/channels/slack/redact.d.ts +2 -0
- package/dist/channels/slack/redact.d.ts.map +1 -0
- package/dist/channels/slack/redact.js +5 -0
- package/dist/channels/slack/reply-options.d.ts +40 -0
- package/dist/channels/slack/reply-options.d.ts.map +1 -0
- package/dist/channels/slack/reply-options.js +150 -0
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +8 -4
- package/dist/channels/slack/stream.d.ts +22 -10
- package/dist/channels/slack/stream.d.ts.map +1 -1
- package/dist/channels/slack/stream.js +9 -16
- package/dist/channels/slack/tool-cards.d.ts +22 -0
- package/dist/channels/slack/tool-cards.d.ts.map +1 -0
- package/dist/channels/slack/tool-cards.js +178 -0
- package/dist/channels/slack/types.d.ts +154 -7
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +6 -6
- package/dist/docs/ab.md +1 -1
- package/dist/docs/assets/{ab.md.DJo5r4R-.js → ab.md.mlVgqvSk.js} +1 -1
- package/dist/docs/assets/{app.B3rWNYE1.js → app.DZ1e0Ycq.js} +1 -1
- package/dist/docs/assets/{building-with-agents.md.DI4mEzlt.js → building-with-agents.md.CUSWxlP_.js} +2 -2
- package/dist/docs/assets/chunks/@localSearchIndexroot.j70vvPL4.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.C1lhqJJR.js → VPLocalSearchBox.l8omwc6D.js} +1 -1
- package/dist/docs/assets/chunks/{theme.B40_SXuv.js → theme.JVcD6gel.js} +2 -2
- package/dist/docs/assets/{evals.md.lfJoEVc8.js → evals.md.CPzDAwoH.js} +1 -1
- package/dist/docs/assets/{guides_github.md.Cnh2mL4a.js → guides_github.md.BtPr9GaP.js} +1 -1
- package/dist/docs/assets/{guides_mcp-oauth.md.CN-6YmTJ.js → guides_mcp-oauth.md.Dp6cDP7f.js} +1 -1
- package/dist/docs/assets/{guides_opentelemetry.md.bmPmkvJu.js → guides_opentelemetry.md.BVTXDCRg.js} +2 -2
- package/dist/docs/assets/{guides_slack.md.VDXQV3ja.js → guides_slack.md.9oHPye9o.js} +19 -3
- package/dist/docs/assets/{guides_slack.md.VDXQV3ja.lean.js → guides_slack.md.9oHPye9o.lean.js} +1 -1
- package/dist/docs/assets/hillclimbing.md.CpTGTCle.js +4 -0
- package/dist/docs/assets/{index.md.CVeRUOeZ.js → index.md.Bb4k8kUm.js} +1 -1
- package/dist/docs/assets/{quickstart.md.Nj_LjW_a.js → quickstart.md.DdQOF7Y8.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.RyZf5OTE.js → reference_cli.md.DfoeyvL0.js} +4 -4
- package/dist/docs/assets/{reference_cli.md.RyZf5OTE.lean.js → reference_cli.md.DfoeyvL0.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.DxldvyIB.js → reference_connections.md.BiGoBAk2.js} +1 -1
- package/dist/docs/assets/{reference_http-api.md.5zOAbV86.js → reference_http-api.md.BEJx9XVj.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.B84gw9Ii.js → reference_tools.md.CvAHsdSp.js} +10 -2
- package/dist/docs/assets/{reference_tools.md.B84gw9Ii.lean.js → reference_tools.md.CvAHsdSp.lean.js} +1 -1
- package/dist/docs/assets/scaffolding-agents.md.em43xlY1.js +1 -0
- package/dist/docs/assets/skills_ab.md.CsFNatVx.js +26 -0
- package/dist/docs/assets/skills_ab.md.CsFNatVx.lean.js +1 -0
- package/dist/docs/assets/skills_create-agent.md.BVoWPcan.js +8 -0
- package/dist/docs/assets/skills_create-agent.md.BVoWPcan.lean.js +1 -0
- package/dist/docs/assets/skills_debug.md.CDbPhHfg.js +1 -0
- package/dist/docs/assets/skills_debug.md.CDbPhHfg.lean.js +1 -0
- package/dist/docs/assets/skills_evals.md.723kpUmA.js +25 -0
- package/dist/docs/assets/skills_evals.md.723kpUmA.lean.js +1 -0
- package/dist/docs/assets/skills_framework-map.md.BTi817yv.js +1 -0
- package/dist/docs/assets/skills_framework-map.md.BTi817yv.lean.js +1 -0
- package/dist/docs/assets/skills_github.md.D0JahM8c.js +16 -0
- package/dist/docs/assets/skills_github.md.D0JahM8c.lean.js +1 -0
- package/dist/docs/assets/skills_hillclimb.md.B_zJerxA.js +7 -0
- package/dist/docs/assets/skills_hillclimb.md.B_zJerxA.lean.js +1 -0
- package/dist/docs/assets/skills_index.md.DKwIxzGg.js +1 -0
- package/dist/docs/assets/skills_index.md.DKwIxzGg.lean.js +1 -0
- package/dist/docs/assets/skills_mcp-auth.md.DGvFP3HE.js +18 -0
- package/dist/docs/assets/skills_mcp-auth.md.DGvFP3HE.lean.js +1 -0
- package/dist/docs/assets/skills_otel.md.CgiZryR3.js +8 -0
- package/dist/docs/assets/skills_otel.md.CgiZryR3.lean.js +1 -0
- package/dist/docs/assets/skills_setup-slack.md.BBgx8lUz.js +20 -0
- package/dist/docs/assets/skills_setup-slack.md.BBgx8lUz.lean.js +1 -0
- package/dist/docs/assets/{troubleshooting.md.DCiPBhYs.js → troubleshooting.md.Cus_YZga.js} +1 -1
- package/dist/docs/building-with-agents.html +6 -6
- package/dist/docs/building-with-agents.md +14 -11
- package/dist/docs/concepts.html +4 -4
- package/dist/docs/deployment.html +4 -4
- package/dist/docs/design/runtime-abstraction.md +1757 -0
- package/dist/docs/evals.html +6 -6
- package/dist/docs/evals.md +1 -1
- package/dist/docs/guides/agent-to-agent.html +4 -4
- package/dist/docs/guides/cloud-runtime.html +4 -4
- package/dist/docs/guides/convert-automation.html +4 -4
- package/dist/docs/guides/github.html +5 -5
- package/dist/docs/guides/github.md +1 -1
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/mcp-oauth.html +5 -5
- package/dist/docs/guides/mcp-oauth.md +1 -1
- package/dist/docs/guides/opentelemetry.html +7 -7
- package/dist/docs/guides/opentelemetry.md +2 -2
- package/dist/docs/guides/slack.html +22 -6
- package/dist/docs/guides/slack.md +80 -1
- package/dist/docs/guides/webhooks.html +5 -5
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +6 -6
- package/dist/docs/hillclimbing.md +5 -5
- package/dist/docs/index.html +6 -6
- package/dist/docs/index.md +1 -1
- package/dist/docs/llms-full.txt +2830 -37
- package/dist/docs/llms.txt +15 -0
- package/dist/docs/quickstart.html +5 -5
- package/dist/docs/quickstart.md +1 -1
- package/dist/docs/reference/agent-config.html +4 -4
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +4 -4
- package/dist/docs/reference/cli.html +7 -7
- package/dist/docs/reference/cli.md +1 -7
- package/dist/docs/reference/connections.html +6 -6
- package/dist/docs/reference/connections.md +1 -1
- package/dist/docs/reference/hooks.html +4 -4
- package/dist/docs/reference/http-api.html +6 -6
- package/dist/docs/reference/http-api.md +1 -0
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +4 -4
- package/dist/docs/reference/project-layout.html +4 -4
- package/dist/docs/reference/prompt.html +4 -4
- package/dist/docs/reference/schedules.html +4 -4
- package/dist/docs/reference/sessions.html +4 -4
- package/dist/docs/reference/skills.html +4 -4
- package/dist/docs/reference/subagents.html +4 -4
- package/dist/docs/reference/tools.html +14 -6
- package/dist/docs/reference/tools.md +25 -0
- package/dist/docs/scaffolding-agents.html +5 -5
- package/dist/docs/scaffolding-agents.md +3 -3
- package/dist/docs/skills/ab.html +52 -0
- package/dist/docs/skills/ab.md +50 -0
- package/dist/docs/skills/create-agent.html +34 -0
- package/dist/docs/skills/create-agent.md +160 -0
- package/dist/docs/skills/debug.html +27 -0
- package/dist/docs/skills/debug.md +36 -0
- package/dist/docs/skills/evals.html +51 -0
- package/dist/docs/skills/evals.md +99 -0
- package/dist/docs/skills/framework-map.html +27 -0
- package/dist/docs/skills/framework-map.md +95 -0
- package/dist/docs/skills/github.html +42 -0
- package/dist/docs/skills/github.md +93 -0
- package/dist/docs/skills/hillclimb.html +33 -0
- package/dist/docs/skills/hillclimb.md +55 -0
- package/dist/docs/skills/index.html +27 -0
- package/dist/docs/skills/index.md +21 -0
- package/dist/docs/skills/mcp-auth.html +44 -0
- package/dist/docs/skills/mcp-auth.md +76 -0
- package/dist/docs/skills/otel.html +34 -0
- package/dist/docs/skills/otel.md +48 -0
- package/dist/docs/skills/setup-slack.html +46 -0
- package/dist/docs/skills/setup-slack.md +141 -0
- package/dist/docs/storage.html +4 -4
- package/dist/docs/templates/agentic-owners.html +4 -4
- package/dist/docs/templates/agents-md.html +4 -4
- package/dist/docs/templates/code-wiki.html +4 -4
- package/dist/docs/templates/demo.html +4 -4
- package/dist/docs/templates/pr-autofixer.html +4 -4
- package/dist/docs/templates/security-help.html +4 -4
- package/dist/docs/templates/security-reviewer.html +4 -4
- package/dist/docs/templates/triage.html +4 -4
- package/dist/docs/troubleshooting.html +5 -5
- package/dist/docs/troubleshooting.md +1 -1
- package/dist/files-backends/cursor-hosted.d.ts +9 -2
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +9 -11
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/internal/as-of.d.ts +19 -0
- package/dist/internal/as-of.d.ts.map +1 -0
- package/dist/internal/as-of.js +82 -0
- package/dist/internal/cli-deploy.d.ts +2 -1
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +102 -7
- package/dist/internal/conversation-mirror.d.ts.map +1 -1
- package/dist/internal/conversation-mirror.js +3 -4
- package/dist/internal/cursor/hosted-store-secrets.d.ts +15 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-store-secrets.js +48 -0
- package/dist/internal/cursor-event-relay.d.ts.map +1 -1
- package/dist/internal/cursor-event-relay.js +5 -6
- package/dist/internal/deploy-client.d.ts +6 -6
- package/dist/internal/deploy-client.js +7 -7
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +11 -1
- package/dist/internal/framework-file-storage.d.ts +5 -4
- package/dist/internal/framework-file-storage.d.ts.map +1 -1
- package/dist/internal/framework-file-storage.js +6 -4
- package/dist/internal/framework-storage-selection.d.ts +13 -11
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/framework-storage-selection.js +28 -23
- package/dist/internal/hosted-admission-adapter.d.ts +28 -0
- package/dist/internal/hosted-admission-adapter.d.ts.map +1 -0
- package/dist/internal/hosted-admission-adapter.js +7 -0
- package/dist/internal/hosted-delivery-protocol.d.ts +6 -1
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +1 -1
- package/dist/internal/hosted-delivery.d.ts +15 -1
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +47 -21
- package/dist/internal/hosted-execution-diag.d.ts +11 -0
- package/dist/internal/hosted-execution-diag.d.ts.map +1 -1
- package/dist/internal/hosted-execution-diag.js +39 -2
- package/dist/internal/http-channel.d.ts.map +1 -1
- package/dist/internal/http-channel.js +4 -1
- package/dist/internal/server.d.ts +3 -0
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +82 -19
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +24 -4
- package/dist/internal/session-run-log.d.ts +120 -0
- package/dist/internal/session-run-log.d.ts.map +1 -0
- package/dist/internal/session-run-log.js +358 -0
- package/dist/internal/tool-policy.d.ts +20 -8
- package/dist/internal/tool-policy.d.ts.map +1 -1
- package/dist/internal/tool-policy.js +11 -0
- package/dist/playground/assets/index-BszoQDc6.css +1 -0
- package/dist/playground/assets/index-DVs98vPL.js +69 -0
- package/dist/playground/index.html +2 -2
- package/dist/storage-backends/cursor-hosted-v2.d.ts +83 -0
- package/dist/storage-backends/cursor-hosted-v2.d.ts.map +1 -0
- package/dist/storage-backends/cursor-hosted-v2.js +164 -0
- package/dist/storage-backends/cursor-hosted.d.ts +6 -0
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted.js +6 -1
- package/dist/storage-protocol.d.ts +8 -0
- package/dist/storage-protocol.d.ts.map +1 -1
- package/dist/storage-protocol.js +8 -0
- package/dist/tools.d.ts +12 -2
- package/dist/tools.d.ts.map +1 -1
- package/dist/types.d.ts +30 -0
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +1 -1
- package/docs/ab.md +1 -1
- package/docs/building-with-agents.md +14 -11
- package/docs/design/runtime-abstraction.md +1757 -0
- package/docs/evals.md +1 -1
- package/docs/guides/github.md +1 -1
- package/docs/guides/mcp-oauth.md +1 -1
- package/docs/guides/opentelemetry.md +2 -2
- package/docs/guides/slack.md +80 -1
- package/docs/hillclimbing.md +5 -5
- package/docs/quickstart.md +1 -1
- package/docs/reference/cli.md +1 -7
- package/docs/reference/connections.md +1 -1
- package/docs/reference/http-api.md +1 -0
- package/docs/reference/tools.md +25 -0
- package/docs/scaffolding-agents.md +3 -3
- package/docs/skills/index.md +26 -0
- package/docs/troubleshooting.md +1 -1
- package/package.json +1 -1
- package/src/bin/agent-serve.ts +6 -7
- package/src/channels/github/defaults.ts +36 -3
- package/src/channels/github/github-channel.ts +17 -0
- package/src/channels/github/progress.ts +7 -0
- package/src/channels/origin/origin-channel.ts +74 -10
- package/src/channels/slack/api.ts +35 -17
- package/src/channels/slack/constants.ts +6 -0
- package/src/channels/slack/defaults.ts +253 -144
- package/src/channels/slack/dispatch.ts +10 -1
- package/src/channels/slack/inbound.ts +17 -0
- package/src/channels/slack/index.ts +1 -0
- package/src/channels/slack/live-delivery.ts +135 -22
- package/src/channels/slack/progress-delivery.ts +133 -0
- package/src/channels/slack/reasoning-card.ts +140 -0
- package/src/channels/slack/redact.ts +6 -0
- package/src/channels/slack/reply-options.ts +229 -0
- package/src/channels/slack/slack-channel.ts +7 -2
- package/src/channels/slack/stream.ts +31 -24
- package/src/channels/slack/tool-cards.ts +221 -0
- package/src/channels/slack/types.ts +168 -7
- package/src/files-backends/cursor-hosted.ts +18 -7
- package/src/index.ts +4 -0
- package/src/internal/as-of.ts +107 -0
- package/src/internal/cli-deploy.ts +130 -10
- package/src/internal/conversation-mirror.ts +3 -8
- package/src/internal/cursor/hosted-store-secrets.ts +72 -0
- package/src/internal/cursor-event-relay.ts +5 -6
- package/src/internal/deploy-client.ts +10 -10
- package/src/internal/discovery.ts +9 -1
- package/src/internal/framework-file-storage.ts +6 -4
- package/src/internal/framework-storage-selection.ts +28 -25
- package/src/internal/hosted-admission-adapter.ts +42 -0
- package/src/internal/hosted-delivery-protocol.ts +7 -2
- package/src/internal/hosted-delivery.ts +88 -36
- package/src/internal/hosted-execution-diag.ts +45 -0
- package/src/internal/http-channel.ts +8 -0
- package/src/internal/server.ts +100 -2
- package/src/internal/session-engine.ts +32 -1
- package/src/internal/session-run-log.ts +579 -0
- package/src/internal/tool-policy.ts +31 -9
- package/src/storage-backends/cursor-hosted-v2.ts +219 -0
- package/src/storage-backends/cursor-hosted.ts +6 -1
- package/src/storage-protocol.ts +10 -0
- package/src/tools.ts +12 -2
- package/src/types.ts +30 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.BU9nHdnQ.js +0 -1
- package/dist/docs/assets/hillclimbing.md.DhESf3OO.js +0 -4
- package/dist/docs/assets/scaffolding-agents.md.D7UUkWw0.js +0 -1
- package/dist/playground/assets/index-DrkI6y5O.js +0 -88
- package/dist/playground/assets/index-DzNGwm7q.css +0 -1
- /package/dist/docs/assets/{ab.md.DJo5r4R-.lean.js → ab.md.mlVgqvSk.lean.js} +0 -0
- /package/dist/docs/assets/{building-with-agents.md.DI4mEzlt.lean.js → building-with-agents.md.CUSWxlP_.lean.js} +0 -0
- /package/dist/docs/assets/{evals.md.lfJoEVc8.lean.js → evals.md.CPzDAwoH.lean.js} +0 -0
- /package/dist/docs/assets/{guides_github.md.Cnh2mL4a.lean.js → guides_github.md.BtPr9GaP.lean.js} +0 -0
- /package/dist/docs/assets/{guides_mcp-oauth.md.CN-6YmTJ.lean.js → guides_mcp-oauth.md.Dp6cDP7f.lean.js} +0 -0
- /package/dist/docs/assets/{guides_opentelemetry.md.bmPmkvJu.lean.js → guides_opentelemetry.md.BVTXDCRg.lean.js} +0 -0
- /package/dist/docs/assets/{hillclimbing.md.DhESf3OO.lean.js → hillclimbing.md.CpTGTCle.lean.js} +0 -0
- /package/dist/docs/assets/{index.md.CVeRUOeZ.lean.js → index.md.Bb4k8kUm.lean.js} +0 -0
- /package/dist/docs/assets/{quickstart.md.Nj_LjW_a.lean.js → quickstart.md.DdQOF7Y8.lean.js} +0 -0
- /package/dist/docs/assets/{reference_connections.md.DxldvyIB.lean.js → reference_connections.md.BiGoBAk2.lean.js} +0 -0
- /package/dist/docs/assets/{reference_http-api.md.5zOAbV86.lean.js → reference_http-api.md.BEJx9XVj.lean.js} +0 -0
- /package/dist/docs/assets/{scaffolding-agents.md.D7UUkWw0.lean.js → scaffolding-agents.md.em43xlY1.lean.js} +0 -0
- /package/dist/docs/assets/{troubleshooting.md.DCiPBhYs.lean.js → troubleshooting.md.Cus_YZga.lean.js} +0 -0
|
@@ -10,13 +10,28 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
11
|
});
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
import { postMessage, setThreadStatus, truncateTypingStatus } from "./api.js";
|
|
14
25
|
import { firstNonEmptyLine, maybeSetSuggestedPrompts } from "./assistant.js";
|
|
15
26
|
import { defaultSlackAuth } from "./auth.js";
|
|
16
27
|
import { SLACK_DEFAULT_LOADING_MESSAGES, SLACK_TYPING_MIN_GROWTH, SLACK_TYPING_MIN_INTERVAL_MS, } from "./constants.js";
|
|
17
28
|
import { createStreamDeliveryStrategy } from "./live-delivery.js";
|
|
18
29
|
import { defaultSlackLog } from "./log.js";
|
|
19
|
-
import {
|
|
30
|
+
import { createProgressDelivery } from "./progress-delivery.js";
|
|
31
|
+
import { createReasoningCard } from "./reasoning-card.js";
|
|
32
|
+
import { redactSecretTokens } from "./redact.js";
|
|
33
|
+
import { resolveSlackReply } from "./reply-options.js";
|
|
34
|
+
import { createToolCards } from "./tool-cards.js";
|
|
20
35
|
const SLACK_TURN_FAILURE_FALLBACK = "I hit an error while handling your request. Please try again or rephrase.";
|
|
21
36
|
const SLACK_TURN_FAILURE_MAX_CHARS = 400;
|
|
22
37
|
export function resolveSlackRespondTo(policy) {
|
|
@@ -39,9 +54,8 @@ export function formatSlackTurnFailureMessage(raw) {
|
|
|
39
54
|
return `I hit an error while handling your request: ${scrubbed}`;
|
|
40
55
|
}
|
|
41
56
|
function scrubSlackErrorDetail(message) {
|
|
42
|
-
const scrubbed = message
|
|
57
|
+
const scrubbed = redactSecretTokens(message)
|
|
43
58
|
.replace(/https?:\/\/\S+/gi, "[url]")
|
|
44
|
-
.replace(/\b(crsr_|xox[baprs]-|sk-|Bearer\s+)\S+/gi, "[redacted]")
|
|
45
59
|
.replace(/\/(?:home|Users|var\/folders)\/\S+/g, "[path]")
|
|
46
60
|
.replace(/\b[A-Za-z]:(?:\\|\/)[^\s]+/g, "[path]")
|
|
47
61
|
.replace(/\\\\[^\s]+/g, "[path]")
|
|
@@ -90,7 +104,6 @@ export const defaultOnDirectMessage = createDefaultOnInbound();
|
|
|
90
104
|
export const defaultOnChannelPost = createDefaultOnChannelPost();
|
|
91
105
|
/**
|
|
92
106
|
* Build default stream-event handlers (typing, streaming, replies).
|
|
93
|
-
* Streaming / thinking default to ON.
|
|
94
107
|
*
|
|
95
108
|
* Tool-approval cards are a separate primitive — compose with
|
|
96
109
|
* `buildToolApprovalEvents` or set `toolApprovals: true` on `slackChannel`.
|
|
@@ -98,14 +111,58 @@ export const defaultOnChannelPost = createDefaultOnChannelPost();
|
|
|
98
111
|
export function buildDefaultEvents(options = {}) {
|
|
99
112
|
var _a, _b;
|
|
100
113
|
const credentials = options.credentials;
|
|
101
|
-
const
|
|
102
|
-
|
|
114
|
+
const reply = resolveSlackReply({
|
|
115
|
+
reply: options.reply,
|
|
116
|
+
toolLabels: options.toolLabels,
|
|
117
|
+
streaming: options.streaming,
|
|
118
|
+
thinkingSteps: options.thinkingSteps,
|
|
119
|
+
loadingMessages: options.loadingMessages,
|
|
120
|
+
});
|
|
121
|
+
const streaming = reply.mode === "stream";
|
|
103
122
|
const suggestedPrompts = (_a = options.suggestedPrompts) !== null && _a !== void 0 ? _a : [];
|
|
104
123
|
const suggestedPromptsTitle = options.suggestedPromptsTitle;
|
|
105
|
-
const loadingMessages =
|
|
124
|
+
const loadingMessages = reply.status.idle;
|
|
106
125
|
const botToken = credentials === null || credentials === void 0 ? void 0 : credentials.botToken;
|
|
107
126
|
const getLog = (_b = options.getLog) !== null && _b !== void 0 ? _b : (() => defaultSlackLog);
|
|
108
127
|
const strategy = createStreamDeliveryStrategy({ botToken, getLog });
|
|
128
|
+
const progress = createProgressDelivery({ botToken, getLog });
|
|
129
|
+
const streamLive = (state) => streaming && !state.streamingUnavailable;
|
|
130
|
+
const streamTarget = (channel) => {
|
|
131
|
+
var _a;
|
|
132
|
+
const channelId = (_a = channel.state.streamChannelId) !== null && _a !== void 0 ? _a : channel.state.channelId;
|
|
133
|
+
if (channelId === null ||
|
|
134
|
+
channelId === "" ||
|
|
135
|
+
channel.state.threadTs === null) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
return channelId;
|
|
139
|
+
};
|
|
140
|
+
const sendCards = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
141
|
+
if (!streamLive(args.channel.state)) {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
const channelId = streamTarget(args.channel);
|
|
145
|
+
if (channelId === null) {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
return strategy.appendChunks(Object.assign(Object.assign({}, args), { channelId }));
|
|
149
|
+
});
|
|
150
|
+
const reasoning = reply.reasoningCard === false
|
|
151
|
+
? null
|
|
152
|
+
: createReasoningCard(reply.reasoningCard, (_a) => {
|
|
153
|
+
var { chunk } = _a, rest = __rest(_a, ["chunk"]);
|
|
154
|
+
return sendCards(Object.assign(Object.assign({}, rest), { chunks: [chunk] }));
|
|
155
|
+
});
|
|
156
|
+
const toolCards = reply.toolCards === false
|
|
157
|
+
? null
|
|
158
|
+
: createToolCards(reply.toolCards, reply.toolLabel);
|
|
159
|
+
const completeReasoning = (channel, sessionId) => __awaiter(this, void 0, void 0, function* () {
|
|
160
|
+
if (reasoning === null || reasoning === void 0 ? void 0 : reasoning.inProgress(channel)) {
|
|
161
|
+
yield reasoning.flush({ channel, sessionId, status: "complete" });
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
/** Subagent events carry `parentCallId`; cards and the reply are the parent's. */
|
|
165
|
+
const nested = (event) => event.data.parentCallId !== undefined;
|
|
109
166
|
const clearWorkingStatus = (channelId, threadTs) => __awaiter(this, void 0, void 0, function* () {
|
|
110
167
|
const result = yield setThreadStatus({
|
|
111
168
|
botToken,
|
|
@@ -121,6 +178,51 @@ export function buildDefaultEvents(options = {}) {
|
|
|
121
178
|
});
|
|
122
179
|
}
|
|
123
180
|
});
|
|
181
|
+
const finishProgress = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
const log = getLog();
|
|
183
|
+
const state = args.channel.state;
|
|
184
|
+
if (state.channelId === null ||
|
|
185
|
+
state.threadTs === null ||
|
|
186
|
+
args.text === "") {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
if (yield progress.replace({ channel: args.channel, text: args.text })) {
|
|
190
|
+
log.info("reply delivered via progress update", {
|
|
191
|
+
channel: state.channelId,
|
|
192
|
+
thread_ts: state.threadTs,
|
|
193
|
+
session: args.sessionId,
|
|
194
|
+
chars: args.text.length,
|
|
195
|
+
});
|
|
196
|
+
return true;
|
|
197
|
+
}
|
|
198
|
+
yield progress.clear({ channel: args.channel });
|
|
199
|
+
try {
|
|
200
|
+
const posted = yield postMessage({
|
|
201
|
+
botToken,
|
|
202
|
+
channel: state.channelId,
|
|
203
|
+
text: args.text,
|
|
204
|
+
threadTs: state.threadTs,
|
|
205
|
+
});
|
|
206
|
+
state.lastPostedText = args.text;
|
|
207
|
+
state.lastBotMessageTs = posted.ts;
|
|
208
|
+
log.info("reply delivered via postMessage", {
|
|
209
|
+
channel: state.channelId,
|
|
210
|
+
thread_ts: state.threadTs,
|
|
211
|
+
message_ts: posted.ts,
|
|
212
|
+
session: args.sessionId,
|
|
213
|
+
chars: args.text.length,
|
|
214
|
+
});
|
|
215
|
+
return true;
|
|
216
|
+
}
|
|
217
|
+
catch (error) {
|
|
218
|
+
log.error(`postMessage failed: ${error instanceof Error ? error.message : String(error)}`, {
|
|
219
|
+
channel: state.channelId,
|
|
220
|
+
thread_ts: state.threadTs,
|
|
221
|
+
session: args.sessionId,
|
|
222
|
+
});
|
|
223
|
+
return false;
|
|
224
|
+
}
|
|
225
|
+
});
|
|
124
226
|
/**
|
|
125
227
|
* Deliver assistant text to the bound Slack thread. Used by a stop-reason
|
|
126
228
|
* `message.completed` and by `turn.completed` when the last assistant
|
|
@@ -129,7 +231,6 @@ export function buildDefaultEvents(options = {}) {
|
|
|
129
231
|
*/
|
|
130
232
|
const deliverReplyText = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
131
233
|
var _a, _b;
|
|
132
|
-
const log = getLog();
|
|
133
234
|
const state = args.channel.state;
|
|
134
235
|
if (state.channelId === null ||
|
|
135
236
|
state.threadTs === null ||
|
|
@@ -141,8 +242,7 @@ export function buildDefaultEvents(options = {}) {
|
|
|
141
242
|
// pending. Treat a match as "already on Slack", not "already finalized".
|
|
142
243
|
const streamTs = state.streamTs;
|
|
143
244
|
if (streamTs !== null && streamTs !== "") {
|
|
144
|
-
|
|
145
|
-
if (canStream) {
|
|
245
|
+
if (streamLive(state)) {
|
|
146
246
|
yield strategy.finalize({
|
|
147
247
|
channel: args.channel,
|
|
148
248
|
channelId: (_a = state.streamChannelId) !== null && _a !== void 0 ? _a : state.channelId,
|
|
@@ -156,8 +256,7 @@ export function buildDefaultEvents(options = {}) {
|
|
|
156
256
|
}
|
|
157
257
|
return true;
|
|
158
258
|
}
|
|
159
|
-
|
|
160
|
-
if (canStream) {
|
|
259
|
+
if (streamLive(state)) {
|
|
161
260
|
const { delivered } = yield strategy.finalize({
|
|
162
261
|
channel: args.channel,
|
|
163
262
|
channelId: (_b = state.streamChannelId) !== null && _b !== void 0 ? _b : state.channelId,
|
|
@@ -168,43 +267,23 @@ export function buildDefaultEvents(options = {}) {
|
|
|
168
267
|
return true;
|
|
169
268
|
}
|
|
170
269
|
}
|
|
171
|
-
|
|
172
|
-
const posted = yield postMessage({
|
|
173
|
-
botToken,
|
|
174
|
-
channel: state.channelId,
|
|
175
|
-
text: args.text,
|
|
176
|
-
threadTs: state.threadTs,
|
|
177
|
-
});
|
|
178
|
-
state.lastPostedText = args.text;
|
|
179
|
-
state.lastBotMessageTs = posted.ts;
|
|
180
|
-
log.info("reply delivered via postMessage", {
|
|
181
|
-
channel: state.channelId,
|
|
182
|
-
thread_ts: state.threadTs,
|
|
183
|
-
message_ts: posted.ts,
|
|
184
|
-
session: args.sessionId,
|
|
185
|
-
chars: args.text.length,
|
|
186
|
-
});
|
|
187
|
-
return true;
|
|
188
|
-
}
|
|
189
|
-
catch (error) {
|
|
190
|
-
log.error(`postMessage failed: ${error instanceof Error ? error.message : String(error)}`, {
|
|
191
|
-
channel: state.channelId,
|
|
192
|
-
thread_ts: state.threadTs,
|
|
193
|
-
session: args.sessionId,
|
|
194
|
-
});
|
|
195
|
-
return false;
|
|
196
|
-
}
|
|
270
|
+
return finishProgress(args);
|
|
197
271
|
});
|
|
198
272
|
return {
|
|
199
273
|
"turn.started"(event, channel) {
|
|
200
274
|
return __awaiter(this, void 0, void 0, function* () {
|
|
201
275
|
const log = getLog();
|
|
276
|
+
yield progress.clear({ channel });
|
|
202
277
|
channel.state.pendingToolCallMessage = null;
|
|
203
278
|
channel.state.lastReasoningTypingAtMs = null;
|
|
204
279
|
channel.state.lastReasoningTypingStatus = null;
|
|
205
280
|
channel.state.streamTs = null;
|
|
206
281
|
channel.state.streamChannelId = null;
|
|
282
|
+
channel.state.streamFull = false;
|
|
207
283
|
channel.state.lastPostedText = null;
|
|
284
|
+
channel.state.streamBlockText = null;
|
|
285
|
+
channel.state.reasoningCard = undefined;
|
|
286
|
+
channel.state.toolCardCounts = {};
|
|
208
287
|
// Keep lastBotMessageTs across turns — warm delta watermark.
|
|
209
288
|
channel.state.approvalMessageByCallId = {};
|
|
210
289
|
const state = channel.state;
|
|
@@ -228,15 +307,15 @@ export function buildDefaultEvents(options = {}) {
|
|
|
228
307
|
},
|
|
229
308
|
"message.appended"(event, channel) {
|
|
230
309
|
return __awaiter(this, void 0, void 0, function* () {
|
|
231
|
-
|
|
232
|
-
if (
|
|
310
|
+
// Nested (subagent) text is not the reply.
|
|
311
|
+
if (nested(event) || !streamLive(channel.state)) {
|
|
233
312
|
return;
|
|
234
313
|
}
|
|
235
|
-
const channelId = (
|
|
236
|
-
|
|
237
|
-
if (channelId === null || channelId === "" || threadTs === null) {
|
|
314
|
+
const channelId = streamTarget(channel);
|
|
315
|
+
if (channelId === null) {
|
|
238
316
|
return;
|
|
239
317
|
}
|
|
318
|
+
yield completeReasoning(channel, event.sessionId);
|
|
240
319
|
yield strategy.append({
|
|
241
320
|
channel,
|
|
242
321
|
channelId,
|
|
@@ -247,6 +326,17 @@ export function buildDefaultEvents(options = {}) {
|
|
|
247
326
|
},
|
|
248
327
|
"reasoning.appended"(event, channel) {
|
|
249
328
|
return __awaiter(this, void 0, void 0, function* () {
|
|
329
|
+
if (!nested(event)) {
|
|
330
|
+
yield reasoning === null || reasoning === void 0 ? void 0 : reasoning.append({
|
|
331
|
+
channel,
|
|
332
|
+
sessionId: event.sessionId,
|
|
333
|
+
text: event.data.text,
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
// The chip is hidden while a stream is open.
|
|
337
|
+
if (!reply.status.reasoning || channel.state.streamTs !== null) {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
250
340
|
const line = firstNonEmptyLine(event.data.text);
|
|
251
341
|
if (line === undefined) {
|
|
252
342
|
return;
|
|
@@ -267,100 +357,114 @@ export function buildDefaultEvents(options = {}) {
|
|
|
267
357
|
if (channel.state.channelId === null || channel.state.threadTs === null) {
|
|
268
358
|
return;
|
|
269
359
|
}
|
|
360
|
+
// One entry: Slack cycles `loading_messages` every couple of seconds,
|
|
361
|
+
// so padding an informative line with the rotation makes the chip
|
|
362
|
+
// flip between the reasoning and filler until the next update.
|
|
270
363
|
yield setThreadStatus({
|
|
271
364
|
botToken,
|
|
272
365
|
channelId: channel.state.channelId,
|
|
273
366
|
threadTs: channel.state.threadTs,
|
|
274
367
|
status,
|
|
275
|
-
loadingMessages: [
|
|
276
|
-
status,
|
|
277
|
-
...loadingMessages.filter((message) => message !== status),
|
|
278
|
-
],
|
|
368
|
+
loadingMessages: [status],
|
|
279
369
|
});
|
|
280
370
|
channel.state.lastReasoningTypingAtMs = now;
|
|
281
371
|
channel.state.lastReasoningTypingStatus = status;
|
|
282
372
|
});
|
|
283
373
|
},
|
|
374
|
+
"reasoning.completed"(event, channel) {
|
|
375
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
376
|
+
if (reasoning === null || nested(event)) {
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
reasoning.endBlock(channel);
|
|
380
|
+
yield reasoning.flush({
|
|
381
|
+
channel,
|
|
382
|
+
sessionId: event.sessionId,
|
|
383
|
+
status: "in_progress",
|
|
384
|
+
});
|
|
385
|
+
});
|
|
386
|
+
},
|
|
284
387
|
"actions.requested"(event, channel) {
|
|
285
388
|
return __awaiter(this, void 0, void 0, function* () {
|
|
286
|
-
var _a;
|
|
287
389
|
const pending = channel.state.pendingToolCallMessage;
|
|
288
390
|
channel.state.pendingToolCallMessage = null;
|
|
289
|
-
const
|
|
391
|
+
const calls = event.data.calls;
|
|
392
|
+
if (toolCards !== null && strategy.inlineToolSteps && !nested(event)) {
|
|
393
|
+
// Card order: the thinking that led to these tools goes first.
|
|
394
|
+
yield reasoning === null || reasoning === void 0 ? void 0 : reasoning.flush({
|
|
395
|
+
channel,
|
|
396
|
+
sessionId: event.sessionId,
|
|
397
|
+
status: "in_progress",
|
|
398
|
+
});
|
|
399
|
+
const streamed = yield sendCards({
|
|
400
|
+
channel,
|
|
401
|
+
sessionId: event.sessionId,
|
|
402
|
+
chunks: toolCards.forCalls(channel.state, calls),
|
|
403
|
+
});
|
|
404
|
+
// An open stream hides the chip; skip the status write.
|
|
405
|
+
if (streamed) {
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
if (reply.status.tools === false) {
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
290
412
|
const statusText = pending !== null
|
|
291
413
|
? truncateTypingStatus(pending)
|
|
292
|
-
: truncateTypingStatus(
|
|
293
|
-
if (
|
|
294
|
-
|
|
295
|
-
streaming &&
|
|
296
|
-
channel.state.streamingUnavailable !== true) {
|
|
297
|
-
const channelId = (_a = channel.state.streamChannelId) !== null && _a !== void 0 ? _a : channel.state.channelId;
|
|
298
|
-
const threadTs = channel.state.threadTs;
|
|
299
|
-
if (channelId !== null && channelId !== "" && threadTs !== null) {
|
|
300
|
-
const chunks = buildTaskChunksForCalls(event.data.calls, "in_progress");
|
|
301
|
-
const streamed = yield strategy.appendChunks({
|
|
302
|
-
channel,
|
|
303
|
-
channelId,
|
|
304
|
-
chunks,
|
|
305
|
-
sessionId: event.sessionId,
|
|
306
|
-
});
|
|
307
|
-
if (streamed) {
|
|
308
|
-
if (channel.state.channelId !== null &&
|
|
309
|
-
channel.state.threadTs !== null) {
|
|
310
|
-
yield setThreadStatus({
|
|
311
|
-
botToken,
|
|
312
|
-
channelId: channel.state.channelId,
|
|
313
|
-
threadTs: channel.state.threadTs,
|
|
314
|
-
status: statusText,
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
return;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
414
|
+
: truncateTypingStatus(reply.status.tools(calls));
|
|
415
|
+
if (channel.state.channelId === null || channel.state.threadTs === null) {
|
|
416
|
+
return;
|
|
320
417
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
418
|
+
// Hold the tool line steady; see reasoning.appended.
|
|
419
|
+
yield setThreadStatus({
|
|
420
|
+
botToken,
|
|
421
|
+
channelId: channel.state.channelId,
|
|
422
|
+
threadTs: channel.state.threadTs,
|
|
423
|
+
status: statusText,
|
|
424
|
+
loadingMessages: [statusText],
|
|
425
|
+
});
|
|
426
|
+
if (toolCards !== null &&
|
|
427
|
+
channel.state.streamingUnavailable === true &&
|
|
428
|
+
(channel.state.streamTs === null || channel.state.streamTs === "")) {
|
|
429
|
+
yield progress.upsert({ channel, text: statusText });
|
|
328
430
|
}
|
|
329
431
|
});
|
|
330
432
|
},
|
|
331
433
|
"action.result"(event, channel) {
|
|
332
434
|
return __awaiter(this, void 0, void 0, function* () {
|
|
333
|
-
|
|
334
|
-
if (
|
|
335
|
-
!
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
channel.state.streamTs === "") {
|
|
340
|
-
return;
|
|
341
|
-
}
|
|
342
|
-
const channelId = (_a = channel.state.streamChannelId) !== null && _a !== void 0 ? _a : channel.state.channelId;
|
|
343
|
-
if (channelId === null || channelId === "") {
|
|
435
|
+
const streamTs = channel.state.streamTs;
|
|
436
|
+
if (toolCards === null ||
|
|
437
|
+
!strategy.inlineToolSteps ||
|
|
438
|
+
nested(event) ||
|
|
439
|
+
streamTs === null ||
|
|
440
|
+
streamTs === "") {
|
|
344
441
|
return;
|
|
345
442
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
443
|
+
yield sendCards({
|
|
444
|
+
channel,
|
|
445
|
+
sessionId: event.sessionId,
|
|
446
|
+
chunks: [
|
|
447
|
+
toolCards.forResult(channel.state, {
|
|
448
|
+
callId: event.data.callId,
|
|
449
|
+
toolName: event.data.toolName,
|
|
450
|
+
output: event.data.output,
|
|
451
|
+
isError: event.data.isError,
|
|
452
|
+
}),
|
|
453
|
+
],
|
|
356
454
|
});
|
|
357
455
|
});
|
|
358
456
|
},
|
|
359
457
|
"message.completed"(event, channel) {
|
|
360
458
|
return __awaiter(this, void 0, void 0, function* () {
|
|
361
459
|
var _a;
|
|
460
|
+
if (nested(event)) {
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
362
463
|
if (event.data.finishReason === "tool_call") {
|
|
363
464
|
channel.state.pendingToolCallMessage = (_a = firstNonEmptyLine(event.data.text)) !== null && _a !== void 0 ? _a : null;
|
|
465
|
+
// The harness restarts its cumulative text after a tool call, so the
|
|
466
|
+
// next block appends in full instead of diffing against this one.
|
|
467
|
+
channel.state.streamBlockText = null;
|
|
364
468
|
return;
|
|
365
469
|
}
|
|
366
470
|
channel.state.pendingToolCallMessage = null;
|
|
@@ -368,10 +472,12 @@ export function buildDefaultEvents(options = {}) {
|
|
|
368
472
|
if (state.channelId === null || state.threadTs === null) {
|
|
369
473
|
return;
|
|
370
474
|
}
|
|
475
|
+
yield completeReasoning(channel, event.sessionId);
|
|
371
476
|
// Empty final text: still close any open stream / clear the skeleton
|
|
372
477
|
// and clear typing.
|
|
373
478
|
if (event.data.text === "") {
|
|
374
479
|
yield strategy.finalizeEmpty({ channel });
|
|
480
|
+
yield progress.clear({ channel });
|
|
375
481
|
yield clearWorkingStatus(state.channelId, state.threadTs);
|
|
376
482
|
return;
|
|
377
483
|
}
|
|
@@ -400,6 +506,7 @@ export function buildDefaultEvents(options = {}) {
|
|
|
400
506
|
const unpublished = typeof result === "string" &&
|
|
401
507
|
result !== "" &&
|
|
402
508
|
result !== channel.state.lastPostedText;
|
|
509
|
+
yield completeReasoning(channel, event.sessionId);
|
|
403
510
|
if (unpublished) {
|
|
404
511
|
yield deliverReplyText({
|
|
405
512
|
channel,
|
|
@@ -410,6 +517,7 @@ export function buildDefaultEvents(options = {}) {
|
|
|
410
517
|
// Always close leftovers. deliverReplyText may fall through to
|
|
411
518
|
// postMessage when streaming is unavailable and leave streamTs open.
|
|
412
519
|
yield strategy.cleanupOrphan({ channel });
|
|
520
|
+
yield progress.clear({ channel });
|
|
413
521
|
// Always drop the assistant chip. message.completed already clears
|
|
414
522
|
// after a normal reply, but a tool-call-only finish (or a missed
|
|
415
523
|
// final assistant message) never hits that path — leaving
|
|
@@ -444,7 +552,8 @@ export function buildDefaultEvents(options = {}) {
|
|
|
444
552
|
}
|
|
445
553
|
const errorText = formatSlackTurnFailureMessage(event.data.message);
|
|
446
554
|
let delivered = false;
|
|
447
|
-
if (
|
|
555
|
+
if (streamLive(state)) {
|
|
556
|
+
yield completeReasoning(channel, event.sessionId);
|
|
448
557
|
({ delivered } = yield strategy.fail({
|
|
449
558
|
channel,
|
|
450
559
|
channelId: (_a = state.streamChannelId) !== null && _a !== void 0 ? _a : state.channelId,
|
|
@@ -453,21 +562,11 @@ export function buildDefaultEvents(options = {}) {
|
|
|
453
562
|
}));
|
|
454
563
|
}
|
|
455
564
|
if (!delivered) {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
threadTs: state.threadTs,
|
|
462
|
-
});
|
|
463
|
-
}
|
|
464
|
-
catch (error) {
|
|
465
|
-
log.error(`turn.failed postMessage failed: ${error instanceof Error ? error.message : String(error)}`, {
|
|
466
|
-
channel: state.channelId,
|
|
467
|
-
thread_ts: state.threadTs,
|
|
468
|
-
session: event.sessionId,
|
|
469
|
-
});
|
|
470
|
-
}
|
|
565
|
+
yield finishProgress({
|
|
566
|
+
channel,
|
|
567
|
+
text: errorText,
|
|
568
|
+
sessionId: event.sessionId,
|
|
569
|
+
});
|
|
471
570
|
}
|
|
472
571
|
yield clearWorkingStatus(state.channelId, state.threadTs);
|
|
473
572
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../../src/channels/slack/dispatch.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,KAAK,oBAAoB,EAI1B,MAAM,yCAAyC,CAAC;AAGjD,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EAEX,aAAa,EACd,MAAM,gBAAgB,CAAC;AAYxB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAK7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../../src/channels/slack/dispatch.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,KAAK,oBAAoB,EAI1B,MAAM,yCAAyC,CAAC;AAGjD,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EAEX,aAAa,EACd,MAAM,gBAAgB,CAAC;AAYxB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAK7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|
import { appendSlackAttachmentAnnotations, prepareSlackAttachments, SLACK_ATTACHMENT_ONLY_PROMPT, } from "./attachments.js";
|
|
19
19
|
import { handleSlackEvalDirective, parseSlackEvalDirective, } from "./eval-directive.js";
|
|
20
20
|
import { isExternalSlackSender } from "./external-policy.js";
|
|
21
|
-
import { formatSlackContextBlock, parseAppMentionEvent, parseAssistantThreadStarted, parseChannelMessageEvent, parseDirectMessageEvent, parseReactionAddedEvent, } from "./inbound.js";
|
|
21
|
+
import { describeSlackEventShape, formatSlackContextBlock, parseAppMentionEvent, parseAssistantThreadStarted, parseChannelMessageEvent, parseDirectMessageEvent, parseReactionAddedEvent, } from "./inbound.js";
|
|
22
22
|
import { defaultSlackLog } from "./log.js";
|
|
23
23
|
import { isWholeMessageStop } from "./stop.js";
|
|
24
24
|
import { loadSlackThreadContextBlock, loadSlackThreadDeltaBlock, } from "./thread-context.js";
|
|
@@ -56,7 +56,7 @@ function slackTurnMedia(args) {
|
|
|
56
56
|
}
|
|
57
57
|
/** Blank per-session adapter state. */
|
|
58
58
|
export function emptySlackChannelState(patch = {}) {
|
|
59
|
-
return Object.assign({ channelId: null, threadTs: null, teamId: null, triggeringUserId: null, pendingToolCallMessage: null, lastReasoningTypingAtMs: null, lastReasoningTypingStatus: null, streamTs: null, streamChannelId: null, lastPostedText: null, lastBotMessageTs: null, streamingUnavailable: false, approvalMessageByCallId: {} }, patch);
|
|
59
|
+
return Object.assign({ channelId: null, threadTs: null, teamId: null, triggeringUserId: null, pendingToolCallMessage: null, lastReasoningTypingAtMs: null, lastReasoningTypingStatus: null, streamTs: null, streamChannelId: null, lastPostedText: null, streamBlockText: null, lastBotMessageTs: null, streamingUnavailable: false, streamFull: false, progressTs: null, approvalMessageByCallId: {}, reasoningCard: undefined, toolCardCounts: {} }, patch);
|
|
60
60
|
}
|
|
61
61
|
function triggeringMergeMessage(message) {
|
|
62
62
|
var _a, _b;
|
|
@@ -484,6 +484,6 @@ export function dispatchInboundFromEventBody(body, deps) {
|
|
|
484
484
|
return deps.channelWatch.handle(channelEvent, eventId);
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
|
-
log.debug("inbound ignored (unhandled event shape)", { event_id: eventId });
|
|
487
|
+
log.debug("inbound ignored (unhandled event shape)", Object.assign(Object.assign({}, describeSlackEventShape(body)), { event_id: eventId }));
|
|
488
488
|
return false;
|
|
489
489
|
}
|
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
* Parse Slack Events API payloads into structured inbound messages.
|
|
3
3
|
*/
|
|
4
4
|
import type { SlackMessage } from "./types.js";
|
|
5
|
+
/**
|
|
6
|
+
* `type` / `subtype` of an Events API body's inner event, for log lines about
|
|
7
|
+
* payloads no parser claimed (own-bot echoes, `message_changed`, pane
|
|
8
|
+
* context changes). Never throws on odd shapes.
|
|
9
|
+
*/
|
|
10
|
+
export declare function describeSlackEventShape(body: unknown): {
|
|
11
|
+
event_type: string;
|
|
12
|
+
event_subtype?: string;
|
|
13
|
+
};
|
|
5
14
|
/** Strip common Slack mention tokens for a cleaner model prompt. */
|
|
6
15
|
export declare function slackTextToMarkdown(text: string): string;
|
|
7
16
|
export interface ParseAppMentionOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inbound.d.ts","sourceRoot":"","sources":["../../../src/channels/slack/inbound.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,YAAY,CAAC;AAe5D,oEAAoE;AACpE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CASxD;AAsDD,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,OAAO,EACb,OAAO,CAAC,EAAE,sBAAsB,GAC/B,YAAY,GAAG,IAAI,CAsBrB;AAED,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,MAAM,CAAC;I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AAM,WAAW,0BAA0B;IACzC;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,OAAO,EACb,OAAO,CAAC,EAAE,0BAA0B,GACnC,wBAAwB,GAAG,IAAI,CA4DjC;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,MAAM,CAYT"}
|
|
@@ -13,6 +13,20 @@ function asRecord(value) {
|
|
|
13
13
|
function asString(value) {
|
|
14
14
|
return typeof value === "string" ? value : undefined;
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* `type` / `subtype` of an Events API body's inner event, for log lines about
|
|
18
|
+
* payloads no parser claimed (own-bot echoes, `message_changed`, pane
|
|
19
|
+
* context changes). Never throws on odd shapes.
|
|
20
|
+
*/
|
|
21
|
+
export function describeSlackEventShape(body) {
|
|
22
|
+
var _a, _b;
|
|
23
|
+
const root = asRecord(body);
|
|
24
|
+
const event = asRecord(root === null || root === void 0 ? void 0 : root.event);
|
|
25
|
+
return {
|
|
26
|
+
event_type: (_b = (_a = asString(event === null || event === void 0 ? void 0 : event.type)) !== null && _a !== void 0 ? _a : asString(root === null || root === void 0 ? void 0 : root.type)) !== null && _b !== void 0 ? _b : "unknown",
|
|
27
|
+
event_subtype: asString(event === null || event === void 0 ? void 0 : event.subtype),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
16
30
|
/** Strip common Slack mention tokens for a cleaner model prompt. */
|
|
17
31
|
export function slackTextToMarkdown(text) {
|
|
18
32
|
return text
|
|
@@ -45,5 +45,6 @@ export * from "./stop.js";
|
|
|
45
45
|
export * from "./stream.js";
|
|
46
46
|
export * from "./thread-context.js";
|
|
47
47
|
export * from "./tool-approval-events.js";
|
|
48
|
+
export { defaultToolCardDetails } from "./tool-cards.js";
|
|
48
49
|
export * from "./types.js";
|
|
49
50
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/channels/slack/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/channels/slack/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,cAAc,YAAY,CAAC"}
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
* Assistant-pane threads only render stream APIs. Start lazily with the
|
|
9
9
|
* first real markdown/chunks plus recipient ids — empty startStream is
|
|
10
10
|
* rejected or never attaches.
|
|
11
|
+
*
|
|
12
|
+
* Every call speaks `chunks`. Slack pins a stream's mode at start: text
|
|
13
|
+
* opened as bare `markdown_text` rejects later `task_update` appends with
|
|
14
|
+
* `streaming_mode_mismatch`, so assistant text goes out as `markdown_text`
|
|
15
|
+
* chunks and tool steps can land in the same message.
|
|
11
16
|
*/
|
|
12
17
|
import type { ChannelEventContext } from "../../types.js";
|
|
13
18
|
import type { SlackLog } from "./log.js";
|
|
@@ -34,7 +39,7 @@ type StreamArgs = {
|
|
|
34
39
|
/**
|
|
35
40
|
* How the default handlers deliver an in-progress reply. Methods write live
|
|
36
41
|
* delivery state (`streamTs`, `streamChannelId`, `lastPostedText`,
|
|
37
|
-
* `streamingUnavailable`) on `channel.state` directly.
|
|
42
|
+
* `streamBlockText`, `streamingUnavailable`) on `channel.state` directly.
|
|
38
43
|
*/
|
|
39
44
|
export interface LiveDeliveryStrategy {
|
|
40
45
|
readonly inlineToolSteps: boolean;
|