experimental-ash 0.2.0-alpha.23 → 0.2.0-alpha.25
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/src/channel/schedule.d.ts.map +1 -1
- package/dist/src/channel/schedule.js +0 -1
- package/dist/src/channel/schedule.js.map +1 -1
- package/dist/src/channel/slack-channel.d.ts +44 -30
- package/dist/src/channel/slack-channel.d.ts.map +1 -1
- package/dist/src/channel/slack-channel.js +110 -89
- package/dist/src/channel/slack-channel.js.map +1 -1
- package/dist/src/channel/slack-render.d.ts +18 -0
- package/dist/src/channel/slack-render.d.ts.map +1 -0
- package/dist/src/channel/slack-render.js +177 -0
- package/dist/src/channel/slack-render.js.map +1 -0
- package/dist/src/channel/slack-types.d.ts +208 -0
- package/dist/src/channel/slack-types.d.ts.map +1 -0
- package/dist/src/channel/slack-types.js +2 -0
- package/dist/src/channel/slack-types.js.map +1 -0
- package/dist/src/channel/types.d.ts +79 -11
- package/dist/src/channel/types.d.ts.map +1 -1
- package/dist/src/cli/dev/repl.d.ts +21 -0
- package/dist/src/cli/dev/repl.d.ts.map +1 -1
- package/dist/src/cli/dev/repl.js +184 -54
- package/dist/src/cli/dev/repl.js.map +1 -1
- package/dist/src/cli/dev/terminal.d.ts +2 -0
- package/dist/src/cli/dev/terminal.d.ts.map +1 -1
- package/dist/src/cli/dev/terminal.js +69 -3
- package/dist/src/cli/dev/terminal.js.map +1 -1
- package/dist/src/client/index.d.ts +1 -1
- package/dist/src/client/index.d.ts.map +1 -1
- package/dist/src/client/index.js.map +1 -1
- package/dist/src/compiler/manifest.d.ts +34 -2
- package/dist/src/compiler/manifest.d.ts.map +1 -1
- package/dist/src/compiler/manifest.js +12 -1
- package/dist/src/compiler/manifest.js.map +1 -1
- package/dist/src/compiler/module-map.d.ts +9 -1
- package/dist/src/compiler/module-map.d.ts.map +1 -1
- package/dist/src/compiler/module-map.js +17 -1
- package/dist/src/compiler/module-map.js.map +1 -1
- package/dist/src/compiler/normalize-agent-config.d.ts.map +1 -1
- package/dist/src/compiler/normalize-agent-config.js +3 -0
- package/dist/src/compiler/normalize-agent-config.js.map +1 -1
- package/dist/src/execution/continuous-entry.d.ts +2 -1
- package/dist/src/execution/continuous-entry.d.ts.map +1 -1
- package/dist/src/execution/continuous-entry.js +14 -2
- package/dist/src/execution/continuous-entry.js.map +1 -1
- package/dist/src/execution/continuous-runtime.d.ts.map +1 -1
- package/dist/src/execution/continuous-runtime.js +23 -3
- package/dist/src/execution/continuous-runtime.js.map +1 -1
- package/dist/src/execution/node-step.d.ts.map +1 -1
- package/dist/src/execution/node-step.js +1 -0
- package/dist/src/execution/node-step.js.map +1 -1
- package/dist/src/execution/runtime-context.d.ts +3 -1
- package/dist/src/execution/runtime-context.d.ts.map +1 -1
- package/dist/src/execution/runtime-context.js +4 -3
- package/dist/src/execution/runtime-context.js.map +1 -1
- package/dist/src/execution/session-snapshot.d.ts +21 -0
- package/dist/src/execution/session-snapshot.d.ts.map +1 -0
- package/dist/src/execution/session-snapshot.js +58 -0
- package/dist/src/execution/session-snapshot.js.map +1 -0
- package/dist/src/execution/session-start.d.ts +16 -0
- package/dist/src/execution/session-start.d.ts.map +1 -0
- package/dist/src/execution/session-start.js +55 -0
- package/dist/src/execution/session-start.js.map +1 -0
- package/dist/src/execution/session.d.ts +12 -10
- package/dist/src/execution/session.d.ts.map +1 -1
- package/dist/src/execution/session.js +15 -11
- package/dist/src/execution/session.js.map +1 -1
- package/dist/src/execution/subagent-tool.d.ts.map +1 -1
- package/dist/src/execution/subagent-tool.js +0 -1
- package/dist/src/execution/subagent-tool.js.map +1 -1
- package/dist/src/execution/workflow-entry.d.ts.map +1 -1
- package/dist/src/execution/workflow-entry.js +3 -2
- package/dist/src/execution/workflow-entry.js.map +1 -1
- package/dist/src/execution/workflow-runtime.d.ts.map +1 -1
- package/dist/src/execution/workflow-runtime.js +31 -1
- package/dist/src/execution/workflow-runtime.js.map +1 -1
- package/dist/src/execution/workflow-steps.d.ts.map +1 -1
- package/dist/src/execution/workflow-steps.js +22 -2
- package/dist/src/execution/workflow-steps.js.map +1 -1
- package/dist/src/harness/compaction.d.ts +31 -10
- package/dist/src/harness/compaction.d.ts.map +1 -1
- package/dist/src/harness/compaction.js +53 -23
- package/dist/src/harness/compaction.js.map +1 -1
- package/dist/src/harness/emission.d.ts.map +1 -1
- package/dist/src/harness/emission.js +15 -1
- package/dist/src/harness/emission.js.map +1 -1
- package/dist/src/harness/step-hooks.d.ts +7 -1
- package/dist/src/harness/step-hooks.d.ts.map +1 -1
- package/dist/src/harness/step-hooks.js +14 -4
- package/dist/src/harness/step-hooks.js.map +1 -1
- package/dist/src/harness/tool-loop.d.ts +0 -14
- package/dist/src/harness/tool-loop.d.ts.map +1 -1
- package/dist/src/harness/tool-loop.js +126 -5
- package/dist/src/harness/tool-loop.js.map +1 -1
- package/dist/src/harness/types.d.ts +15 -0
- package/dist/src/harness/types.d.ts.map +1 -1
- package/dist/src/internal/application/compiled-artifacts.d.ts +14 -0
- package/dist/src/internal/application/compiled-artifacts.d.ts.map +1 -1
- package/dist/src/internal/application/compiled-artifacts.js +41 -1
- package/dist/src/internal/application/compiled-artifacts.js.map +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/core.d.ts +7 -0
- package/dist/src/internal/authored-definition/core.d.ts.map +1 -1
- package/dist/src/internal/authored-definition/core.js +34 -1
- package/dist/src/internal/authored-definition/core.js.map +1 -1
- package/dist/src/internal/authored-module.d.ts.map +1 -1
- package/dist/src/internal/authored-module.js +1 -1
- package/dist/src/internal/authored-module.js.map +1 -1
- package/dist/src/internal/message/builder.d.ts.map +1 -1
- package/dist/src/internal/message/builder.js +73 -29
- package/dist/src/internal/message/builder.js.map +1 -1
- package/dist/src/internal/message/vercel-workflow-output.d.ts +34 -16
- package/dist/src/internal/message/vercel-workflow-output.d.ts.map +1 -1
- package/dist/src/internal/message/vercel-workflow-output.js +247 -122
- package/dist/src/internal/message/vercel-workflow-output.js.map +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.d.ts.map +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +118 -8
- package/dist/src/internal/nitro/host/create-application-nitro.js.map +1 -1
- package/dist/src/internal/nitro/routes/web-ui/assets/index.js +7 -6
- package/dist/src/internal/nitro/routes/web-ui/assets/style.css +1 -1
- package/dist/src/protocol/message.d.ts +55 -3
- package/dist/src/protocol/message.d.ts.map +1 -1
- package/dist/src/protocol/message.js +38 -2
- package/dist/src/protocol/message.js.map +1 -1
- package/dist/src/public/channels/http.d.ts.map +1 -1
- package/dist/src/public/channels/http.js +0 -1
- package/dist/src/public/channels/http.js.map +1 -1
- package/dist/src/public/channels/index.d.ts +1 -1
- package/dist/src/public/channels/index.d.ts.map +1 -1
- package/dist/src/public/channels/index.js.map +1 -1
- package/dist/src/public/channels/slack/index.d.ts +5 -5
- package/dist/src/public/channels/slack/index.d.ts.map +1 -1
- package/dist/src/public/channels/slack/index.js +10 -74
- package/dist/src/public/channels/slack/index.js.map +1 -1
- package/dist/src/public/channels/slack/lowlevel.d.ts +1 -0
- package/dist/src/public/channels/slack/lowlevel.d.ts.map +1 -1
- package/dist/src/public/channels/slack/slack-interaction.d.ts +30 -0
- package/dist/src/public/channels/slack/slack-interaction.d.ts.map +1 -0
- package/dist/src/public/channels/slack/slack-interaction.js +121 -0
- package/dist/src/public/channels/slack/slack-interaction.js.map +1 -0
- package/dist/src/public/definitions/agent.d.ts +21 -1
- package/dist/src/public/definitions/agent.d.ts.map +1 -1
- package/dist/src/public/definitions/agent.js.map +1 -1
- package/dist/src/public/definitions/channel.d.ts +17 -2
- package/dist/src/public/definitions/channel.d.ts.map +1 -1
- package/dist/src/public/definitions/channel.js.map +1 -1
- package/dist/src/public/index.d.ts +2 -3
- package/dist/src/public/index.d.ts.map +1 -1
- package/dist/src/public/index.js +0 -1
- package/dist/src/public/index.js.map +1 -1
- package/dist/src/public/system/index.d.ts +31 -0
- package/dist/src/public/system/index.d.ts.map +1 -0
- package/dist/src/public/system/index.js +31 -0
- package/dist/src/public/system/index.js.map +1 -0
- package/dist/src/runtime/loaders/module-map.d.ts.map +1 -1
- package/dist/src/runtime/loaders/module-map.js +1 -48
- package/dist/src/runtime/loaders/module-map.js.map +1 -1
- package/dist/src/runtime/resolve-agent.d.ts.map +1 -1
- package/dist/src/runtime/resolve-agent.js +9 -10
- package/dist/src/runtime/resolve-agent.js.map +1 -1
- package/dist/src/runtime/sessions/compiled-agent-cache.d.ts +2 -0
- package/dist/src/runtime/sessions/compiled-agent-cache.d.ts.map +1 -1
- package/dist/src/runtime/sessions/compiled-agent-cache.js +2 -0
- package/dist/src/runtime/sessions/compiled-agent-cache.js.map +1 -1
- package/dist/src/runtime/types.d.ts +19 -0
- package/dist/src/runtime/types.d.ts.map +1 -1
- package/docs/external-agent-protocol.md +8 -1
- package/docs/internals/message-runtime.md +7 -0
- package/docs/public/agent-ts.md +61 -0
- package/docs/public/channels/README.md +96 -0
- package/docs/public/getting-started.md +6 -0
- package/docs/public/project-layout.md +4 -3
- package/docs/public/runs-and-streaming.md +10 -0
- package/docs/public/typescript-api.md +32 -1
- package/package.json +20 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../../src/channel/schedule.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAsB,MAAM,YAAY,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;gBAEtB,MAAM,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;KAAE;IAI3C,OAAO,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../../src/channel/schedule.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAsB,MAAM,YAAY,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;gBAEtB,MAAM,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;KAAE;IAI3C,OAAO,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,SAAS,CAAC;CAU/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../../src/channel/schedule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAUxD;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,kBAAkB;IACZ,OAAO,CAAU;IAElC,YAAY,MAAqC;QAC/C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,KAA2B;QACvC,MAAM,iBAAiB,GAAG,YAAY,KAAK,CAAC,UAAU,IAAI,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC;QAChF,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;YAC5B,IAAI,EAAE,yBAAyB,CAAC,KAAK,CAAC,UAAU,CAAC;YACjD,OAAO,EAAE,IAAI,eAAe,EAAE;YAC9B,iBAAiB;YACjB,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,QAAQ,EAAE;YAClC,IAAI,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../../src/channel/schedule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAUxD;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,kBAAkB;IACZ,OAAO,CAAU;IAElC,YAAY,MAAqC;QAC/C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,KAA2B;QACvC,MAAM,iBAAiB,GAAG,YAAY,KAAK,CAAC,UAAU,IAAI,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC;QAChF,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;YAC5B,IAAI,EAAE,yBAAyB,CAAC,KAAK,CAAC,UAAU,CAAC;YACjD,OAAO,EAAE,IAAI,eAAe,EAAE;YAC9B,iBAAiB;YACjB,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,QAAQ,EAAE;YAClC,IAAI,EAAE,MAAM;SACb,CAAC,CAAC;IACL,CAAC;CACF;AAED,SAAS,yBAAyB,CAAC,UAAkB;IACnD,OAAO;QACL,UAAU,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE;QAC3C,aAAa,EAAE,UAAU;QACzB,MAAM,EAAE,iBAAiB;QACzB,WAAW,EAAE,gBAAgB,UAAU,EAAE;QACzC,aAAa,EAAE,SAAS;QACxB,OAAO,EAAE,UAAU;KACpB,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AdapterPostableMessage, SerializedThread, Thread } from "chat";
|
|
2
2
|
import type { StepInput } from "../harness/types.js";
|
|
3
3
|
import type { HandleMessageStreamEvent } from "../protocol/message.js";
|
|
4
4
|
import type { InputRequest } from "../runtime/input/types.js";
|
|
5
|
+
import { createSlackCardKit } from "./slack-render.js";
|
|
6
|
+
import type { InteractionDelivery, SlackInteraction, SlackInteractionContext, SlackRenderable, SlackThreadHandle } from "./slack-types.js";
|
|
5
7
|
import { Channel, type ContextAccessor, type DeliverPayload } from "./types.js";
|
|
6
8
|
/**
|
|
7
9
|
* User context for the Slack message sender, stored in channel state so
|
|
@@ -40,25 +42,6 @@ export interface SlackChannelState {
|
|
|
40
42
|
*/
|
|
41
43
|
readonly userContext?: SlackUserContext;
|
|
42
44
|
}
|
|
43
|
-
interface RehydratedThread {
|
|
44
|
-
post(message: string | {
|
|
45
|
-
readonly markdown: string;
|
|
46
|
-
} | unknown): Promise<unknown>;
|
|
47
|
-
startTyping(status?: string): Promise<void>;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Dynamically imported Chat SDK card element constructors.
|
|
51
|
-
* Loaded lazily alongside the adapter to avoid bundling `chat`
|
|
52
|
-
* in workflow VMs.
|
|
53
|
-
*/
|
|
54
|
-
interface CardKit {
|
|
55
|
-
Actions: typeof Actions;
|
|
56
|
-
Button: typeof Button;
|
|
57
|
-
Card: typeof Card;
|
|
58
|
-
CardText: typeof CardText;
|
|
59
|
-
Select: typeof Select;
|
|
60
|
-
SelectOption: typeof SelectOption;
|
|
61
|
-
}
|
|
62
45
|
/**
|
|
63
46
|
* Channel that rehydrates a Chat SDK `Thread` from serialized state and
|
|
64
47
|
* uses `thread.startTyping()` to show typing status with tool names while
|
|
@@ -78,9 +61,9 @@ interface CardKit {
|
|
|
78
61
|
export declare class SlackChannel<TState extends SlackChannelState = SlackChannelState> extends Channel {
|
|
79
62
|
static readonly kind: string;
|
|
80
63
|
private _state;
|
|
81
|
-
private
|
|
64
|
+
private _cardKitPromise;
|
|
82
65
|
private _pendingToolCallMessage;
|
|
83
|
-
private
|
|
66
|
+
private _threadPromise;
|
|
84
67
|
constructor(state: TState);
|
|
85
68
|
/**
|
|
86
69
|
* Typed serializable state for this channel instance.
|
|
@@ -94,6 +77,22 @@ export declare class SlackChannel<TState extends SlackChannelState = SlackChanne
|
|
|
94
77
|
get botToken(): string | undefined;
|
|
95
78
|
get serializedThread(): SerializedThread;
|
|
96
79
|
serialize(): Record<string, unknown>;
|
|
80
|
+
/**
|
|
81
|
+
* Interaction hook for Slack `block_actions`.
|
|
82
|
+
*
|
|
83
|
+
* Called when the route can rehydrate the channel from the last durable
|
|
84
|
+
* session snapshot. The return value controls what happens next:
|
|
85
|
+
*
|
|
86
|
+
* - `{ inputResponses }` — deliver structured HITL responses.
|
|
87
|
+
* - `{ message }` — wake the agent with a text message.
|
|
88
|
+
* - bare `return` (void) — nothing to deliver (handled inline or no-op).
|
|
89
|
+
*
|
|
90
|
+
* The default implementation calls `ctx.resolveInputResponses()` which
|
|
91
|
+
* maps button clicks and select menus to HITL input responses.
|
|
92
|
+
* Subclasses override to handle custom actions and call
|
|
93
|
+
* `ctx.resolveInputResponses()` for the explicit HITL path.
|
|
94
|
+
*/
|
|
95
|
+
onInteraction(_interaction: SlackInteraction, ctx: SlackInteractionContext): Promise<InteractionDelivery | void>;
|
|
97
96
|
onDeliver(_ctx: ContextAccessor, payload: DeliverPayload): Promise<StepInput>;
|
|
98
97
|
/**
|
|
99
98
|
* Prepends the Slack user context XML block to a message if user context
|
|
@@ -109,24 +108,39 @@ export declare class SlackChannel<TState extends SlackChannelState = SlackChanne
|
|
|
109
108
|
protected post(text: string): Promise<void>;
|
|
110
109
|
protected startTyping(status: string): Promise<void>;
|
|
111
110
|
/**
|
|
112
|
-
*
|
|
113
|
-
* interactive buttons or select menus, posted to the Slack thread.
|
|
111
|
+
* Exposes an Ash-owned Slack thread surface for subclasses.
|
|
114
112
|
*/
|
|
115
|
-
|
|
113
|
+
protected getSlackThread(): Promise<SlackThreadHandle>;
|
|
116
114
|
/**
|
|
117
115
|
* Lazily imports the Chat SDK card element constructors.
|
|
118
116
|
*/
|
|
119
|
-
protected getCardKit(): Promise<
|
|
117
|
+
protected getCardKit(): Promise<ReturnType<typeof createSlackCardKit>>;
|
|
118
|
+
protected toPostableMessage(renderable: SlackRenderable): Promise<AdapterPostableMessage>;
|
|
119
|
+
/**
|
|
120
|
+
* Renders each pending input request as a rich Slack card with
|
|
121
|
+
* interactive buttons or select menus, posted to the thread.
|
|
122
|
+
*/
|
|
123
|
+
private renderInputRequests;
|
|
120
124
|
/**
|
|
121
125
|
* Lazily rehydrates the Chat SDK Thread from serialized state.
|
|
122
126
|
*
|
|
123
127
|
* `@chat-adapter/slack` and `chat` are listed in
|
|
124
128
|
* `WORKFLOW_BUILDER_DEFERRED_PACKAGES` so the initial
|
|
125
129
|
* `@workflow/builders` pass externalizes them (avoiding `node:*`
|
|
126
|
-
* errors in the workflow VM).
|
|
127
|
-
*
|
|
130
|
+
* errors in the workflow VM). Nitro's hosted-function bundle pass
|
|
131
|
+
* then traces and resolves them for deployment output.
|
|
128
132
|
*/
|
|
129
|
-
protected getThread(): Promise<
|
|
133
|
+
protected getThread(): Promise<Thread<Record<string, unknown>, unknown>>;
|
|
130
134
|
}
|
|
131
|
-
|
|
135
|
+
/**
|
|
136
|
+
* Maps Slack button clicks and select menus to HITL input responses.
|
|
137
|
+
*
|
|
138
|
+
* Buttons encode `requestId` as the button `value` and `optionId` as the
|
|
139
|
+
* `actionId`. Selects encode `requestId` as the `actionId` (prefixed with
|
|
140
|
+
* `select_`) and `optionId` as the `selectedOptionId`.
|
|
141
|
+
*
|
|
142
|
+
* Returns an {@link InteractionDelivery} with the mapped responses, or
|
|
143
|
+
* `null` when no actions could be mapped.
|
|
144
|
+
*/
|
|
145
|
+
export declare function deriveInputResponsesFromInteraction(interaction: SlackInteraction): InteractionDelivery | undefined;
|
|
132
146
|
//# sourceMappingURL=slack-channel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slack-channel.d.ts","sourceRoot":"","sources":["../../../src/channel/slack-channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"slack-channel.d.ts","sourceRoot":"","sources":["../../../src/channel/slack-channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAW,gBAAgB,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACtF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAEvE,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,2BAA2B,CAAC;AAE7E,OAAO,EAEL,kBAAkB,EAGnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAEhF;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,sCAAsC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,uCAAuC;IACvC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,uCAAuC;IACvC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,kDAAkD;IAClD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,6EAA6E;IAC7E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,0DAA0D;IAC1D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;I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cAKjB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;cAYjC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAS1D;;OAEG;cACa,cAAc,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAoB5D;;OAEG;cACa,UAAU,IAAI,OAAO,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;cAW5D,iBAAiB,CAAC,UAAU,EAAE,eAAe,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAK/F;;;OAGG;YACW,mBAAmB;IAWjC;;;;;;;;OAQG;cACa,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;CAc/E;AAED;;;;;;;;;GASG;AACH,wBAAgB,mCAAmC,CACjD,WAAW,EAAE,gBAAgB,GAC5B,mBAAmB,GAAG,SAAS,CA2BjC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { resolveTextToResponses } from "./resolve-text.js";
|
|
2
|
+
import { buildSlackInputRequestRenderable, createSlackCardKit, toSlackPostableMessage, toSlackThreadMessage, } from "./slack-render.js";
|
|
2
3
|
import { Channel } from "./types.js";
|
|
3
4
|
const SLACK_MAX_TYPING_STATUS_LENGTH = 50;
|
|
4
5
|
function labelForAction(action) {
|
|
@@ -68,9 +69,9 @@ function formatUserContextBlock(ctx) {
|
|
|
68
69
|
export class SlackChannel extends Channel {
|
|
69
70
|
static kind = "slack";
|
|
70
71
|
_state;
|
|
71
|
-
|
|
72
|
+
_cardKitPromise = null;
|
|
72
73
|
_pendingToolCallMessage = null;
|
|
73
|
-
|
|
74
|
+
_threadPromise = null;
|
|
74
75
|
constructor(state) {
|
|
75
76
|
super();
|
|
76
77
|
this._state = state;
|
|
@@ -95,12 +96,25 @@ export class SlackChannel extends Channel {
|
|
|
95
96
|
return this._state.serializedThread;
|
|
96
97
|
}
|
|
97
98
|
serialize() {
|
|
98
|
-
return {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
99
|
+
return { ...this._state };
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Interaction hook for Slack `block_actions`.
|
|
103
|
+
*
|
|
104
|
+
* Called when the route can rehydrate the channel from the last durable
|
|
105
|
+
* session snapshot. The return value controls what happens next:
|
|
106
|
+
*
|
|
107
|
+
* - `{ inputResponses }` — deliver structured HITL responses.
|
|
108
|
+
* - `{ message }` — wake the agent with a text message.
|
|
109
|
+
* - bare `return` (void) — nothing to deliver (handled inline or no-op).
|
|
110
|
+
*
|
|
111
|
+
* The default implementation calls `ctx.resolveInputResponses()` which
|
|
112
|
+
* maps button clicks and select menus to HITL input responses.
|
|
113
|
+
* Subclasses override to handle custom actions and call
|
|
114
|
+
* `ctx.resolveInputResponses()` for the explicit HITL path.
|
|
115
|
+
*/
|
|
116
|
+
async onInteraction(_interaction, ctx) {
|
|
117
|
+
return ctx.resolveInputResponses();
|
|
104
118
|
}
|
|
105
119
|
// ── Inbound: transform delivered input ─────────────────
|
|
106
120
|
async onDeliver(_ctx, payload) {
|
|
@@ -202,10 +216,11 @@ export class SlackChannel extends Channel {
|
|
|
202
216
|
}
|
|
203
217
|
async post(text) {
|
|
204
218
|
try {
|
|
205
|
-
const thread = await this.
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
219
|
+
const thread = await this.getSlackThread();
|
|
220
|
+
await thread.post({
|
|
221
|
+
kind: "markdown",
|
|
222
|
+
markdown: text,
|
|
223
|
+
});
|
|
209
224
|
}
|
|
210
225
|
catch (error) {
|
|
211
226
|
console.error("[ash] Slack message delivery failed.", error);
|
|
@@ -221,110 +236,116 @@ export class SlackChannel extends Channel {
|
|
|
221
236
|
}
|
|
222
237
|
}
|
|
223
238
|
/**
|
|
224
|
-
*
|
|
225
|
-
* interactive buttons or select menus, posted to the Slack thread.
|
|
239
|
+
* Exposes an Ash-owned Slack thread surface for subclasses.
|
|
226
240
|
*/
|
|
227
|
-
async
|
|
241
|
+
async getSlackThread() {
|
|
242
|
+
const thread = await this.getThread();
|
|
243
|
+
const userContext = this.state.userContext;
|
|
244
|
+
return {
|
|
245
|
+
channelId: userContext?.channelId ?? this.serializedThread.channelId,
|
|
246
|
+
listRecentMessages: async () => (thread.recentMessages ?? []).map((message) => toSlackThreadMessage(message)),
|
|
247
|
+
post: async (renderable) => {
|
|
248
|
+
await thread.post(await this.toPostableMessage(renderable));
|
|
249
|
+
},
|
|
250
|
+
refresh: async () => {
|
|
251
|
+
await thread.refresh();
|
|
252
|
+
},
|
|
253
|
+
teamId: userContext?.teamId,
|
|
254
|
+
threadId: this.serializedThread.id,
|
|
255
|
+
threadTs: userContext?.threadTs ?? parseSlackThreadTs(this.serializedThread),
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Lazily imports the Chat SDK card element constructors.
|
|
260
|
+
*/
|
|
261
|
+
async getCardKit() {
|
|
262
|
+
if (this._cardKitPromise !== null) {
|
|
263
|
+
return this._cardKitPromise;
|
|
264
|
+
}
|
|
265
|
+
this._cardKitPromise = import("chat").then((chatModule) => createSlackCardKit(chatModule));
|
|
266
|
+
return this._cardKitPromise;
|
|
267
|
+
}
|
|
268
|
+
async toPostableMessage(renderable) {
|
|
228
269
|
const kit = await this.getCardKit();
|
|
270
|
+
return toSlackPostableMessage(renderable, kit);
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Renders each pending input request as a rich Slack card with
|
|
274
|
+
* interactive buttons or select menus, posted to the thread.
|
|
275
|
+
*/
|
|
276
|
+
async renderInputRequests(requests) {
|
|
229
277
|
for (const request of requests) {
|
|
230
278
|
try {
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
await thread.post(card);
|
|
279
|
+
const thread = await this.getSlackThread();
|
|
280
|
+
await thread.post(buildSlackInputRequestRenderable(request));
|
|
234
281
|
}
|
|
235
282
|
catch (error) {
|
|
236
283
|
console.error("[ash] Slack input request render failed.", error);
|
|
237
284
|
}
|
|
238
285
|
}
|
|
239
286
|
}
|
|
240
|
-
/**
|
|
241
|
-
* Lazily imports the Chat SDK card element constructors.
|
|
242
|
-
*/
|
|
243
|
-
async getCardKit() {
|
|
244
|
-
if (this._cardKit !== null) {
|
|
245
|
-
return this._cardKit;
|
|
246
|
-
}
|
|
247
|
-
const chatModule = (await import("chat"));
|
|
248
|
-
this._cardKit = {
|
|
249
|
-
Actions: chatModule.Actions,
|
|
250
|
-
Button: chatModule.Button,
|
|
251
|
-
Card: chatModule.Card,
|
|
252
|
-
CardText: chatModule.CardText,
|
|
253
|
-
Select: chatModule.Select,
|
|
254
|
-
SelectOption: chatModule.SelectOption,
|
|
255
|
-
};
|
|
256
|
-
return this._cardKit;
|
|
257
|
-
}
|
|
258
287
|
/**
|
|
259
288
|
* Lazily rehydrates the Chat SDK Thread from serialized state.
|
|
260
289
|
*
|
|
261
290
|
* `@chat-adapter/slack` and `chat` are listed in
|
|
262
291
|
* `WORKFLOW_BUILDER_DEFERRED_PACKAGES` so the initial
|
|
263
292
|
* `@workflow/builders` pass externalizes them (avoiding `node:*`
|
|
264
|
-
* errors in the workflow VM).
|
|
265
|
-
*
|
|
293
|
+
* errors in the workflow VM). Nitro's hosted-function bundle pass
|
|
294
|
+
* then traces and resolves them for deployment output.
|
|
266
295
|
*/
|
|
267
296
|
async getThread() {
|
|
268
|
-
if (this.
|
|
269
|
-
return this.
|
|
297
|
+
if (this._threadPromise !== null) {
|
|
298
|
+
return this._threadPromise;
|
|
270
299
|
}
|
|
271
|
-
|
|
300
|
+
this._threadPromise = Promise.all([
|
|
272
301
|
import("@chat-adapter/slack"),
|
|
273
302
|
import("chat"),
|
|
274
|
-
]))
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
return
|
|
303
|
+
]).then(([slackModule, chatModule]) => {
|
|
304
|
+
const adapter = slackModule.createSlackAdapter({ botToken: this.botToken });
|
|
305
|
+
return chatModule.ThreadImpl.fromJSON(this.serializedThread, adapter);
|
|
306
|
+
});
|
|
307
|
+
return this._threadPromise;
|
|
279
308
|
}
|
|
280
309
|
}
|
|
281
|
-
const INPUT_OPTION_STYLE_TO_BUTTON_STYLE = {
|
|
282
|
-
danger: "danger",
|
|
283
|
-
default: undefined,
|
|
284
|
-
primary: "primary",
|
|
285
|
-
};
|
|
286
310
|
/**
|
|
287
|
-
*
|
|
311
|
+
* Maps Slack button clicks and select menus to HITL input responses.
|
|
312
|
+
*
|
|
313
|
+
* Buttons encode `requestId` as the button `value` and `optionId` as the
|
|
314
|
+
* `actionId`. Selects encode `requestId` as the `actionId` (prefixed with
|
|
315
|
+
* `select_`) and `optionId` as the `selectedOptionId`.
|
|
288
316
|
*
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
* - `text` → prompt text only (user replies in thread)
|
|
317
|
+
* Returns an {@link InteractionDelivery} with the mapped responses, or
|
|
318
|
+
* `null` when no actions could be mapped.
|
|
292
319
|
*/
|
|
293
|
-
function
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
320
|
+
export function deriveInputResponsesFromInteraction(interaction) {
|
|
321
|
+
const inputResponses = [];
|
|
322
|
+
for (const action of interaction.actions) {
|
|
323
|
+
if (action.kind === "button") {
|
|
324
|
+
if (action.value === undefined) {
|
|
325
|
+
continue;
|
|
326
|
+
}
|
|
327
|
+
inputResponses.push({ optionId: action.actionId, requestId: action.value });
|
|
328
|
+
continue;
|
|
329
|
+
}
|
|
330
|
+
if (action.kind === "static_select" || action.kind === "external_select") {
|
|
331
|
+
if (action.selectedOptionId === undefined) {
|
|
332
|
+
continue;
|
|
333
|
+
}
|
|
334
|
+
const requestId = action.actionId.startsWith("select_")
|
|
335
|
+
? action.actionId.slice(7)
|
|
336
|
+
: action.actionId;
|
|
337
|
+
inputResponses.push({ optionId: action.selectedOptionId, requestId });
|
|
338
|
+
}
|
|
306
339
|
}
|
|
307
|
-
if (
|
|
308
|
-
return
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
options: request.options.map((opt) => kit.SelectOption({
|
|
316
|
-
description: opt.description,
|
|
317
|
-
label: opt.label,
|
|
318
|
-
value: opt.id,
|
|
319
|
-
})),
|
|
320
|
-
}),
|
|
321
|
-
]),
|
|
322
|
-
],
|
|
323
|
-
});
|
|
340
|
+
if (inputResponses.length > 0) {
|
|
341
|
+
return { inputResponses };
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
function parseSlackThreadTs(serializedThread) {
|
|
345
|
+
const parts = serializedThread.id.split(":");
|
|
346
|
+
if (parts.length === 3 && parts[0] === "slack" && parts[2] !== undefined && parts[2] !== "") {
|
|
347
|
+
return parts[2];
|
|
324
348
|
}
|
|
325
|
-
|
|
326
|
-
return kit.Card({
|
|
327
|
-
children: [kit.CardText(request.prompt)],
|
|
328
|
-
});
|
|
349
|
+
return undefined;
|
|
329
350
|
}
|
|
330
351
|
//# sourceMappingURL=slack-channel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slack-channel.js","sourceRoot":"","sources":["../../../src/channel/slack-channel.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAA6C,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"slack-channel.js","sourceRoot":"","sources":["../../../src/channel/slack-channel.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EACL,gCAAgC,EAChC,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAQ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,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,gBAAgB,EAAE,SAAS,EAAE,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;IAED,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,EAAE,cAAc,EAAE,CAAC;IAC5B,CAAC;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,gBAAkC;IAC5D,MAAM,KAAK,GAAG,gBAAgB,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;QAC5F,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Actions, AdapterPostableMessage, Button, Card, CardText, Message, Select, SelectOption, Table } from "chat";
|
|
2
|
+
import type { InputRequest } from "../runtime/input/types.js";
|
|
3
|
+
import type { SlackRenderable, SlackThreadMessage } from "./slack-types.js";
|
|
4
|
+
interface SlackCardKit {
|
|
5
|
+
Actions: typeof Actions;
|
|
6
|
+
Button: typeof Button;
|
|
7
|
+
Card: typeof Card;
|
|
8
|
+
CardText: typeof CardText;
|
|
9
|
+
Select: typeof Select;
|
|
10
|
+
SelectOption: typeof SelectOption;
|
|
11
|
+
Table: typeof Table;
|
|
12
|
+
}
|
|
13
|
+
export declare function createSlackCardKit(chatModule: typeof import("chat")): SlackCardKit;
|
|
14
|
+
export declare function buildSlackInputRequestRenderable(request: InputRequest): SlackRenderable;
|
|
15
|
+
export declare function toSlackPostableMessage(renderable: SlackRenderable, kit: SlackCardKit): AdapterPostableMessage;
|
|
16
|
+
export declare function toSlackThreadMessage(message: Message): SlackThreadMessage;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=slack-render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-render.d.ts","sourceRoot":"","sources":["../../../src/channel/slack-render.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,OAAO,EACP,sBAAsB,EACtB,MAAM,EACN,IAAI,EAEJ,QAAQ,EAER,OAAO,EACP,MAAM,EACN,YAAY,EACZ,KAAK,EACN,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAKV,eAAe,EAGf,kBAAkB,EAEnB,MAAM,kBAAkB,CAAC;AAE1B,UAAU,YAAY;IACpB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,QAAQ,EAAE,OAAO,QAAQ,CAAC;IAC1B,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,YAAY,EAAE,OAAO,YAAY,CAAC;IAClC,KAAK,EAAE,OAAO,KAAK,CAAC;CACrB;AAWD,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,cAAc,MAAM,CAAC,GAAG,YAAY,CAUlF;AAED,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,YAAY,GAAG,eAAe,CAiDvF;AAED,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,eAAe,EAC3B,GAAG,EAAE,YAAY,GAChB,sBAAsB,CAmBxB;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,kBAAkB,CAazE"}
|