openbot 0.5.9 → 0.5.10
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/app/active-runs.js +70 -0
- package/dist/app/cli.js +1 -1
- package/dist/app/lifecycle-events.js +27 -0
- package/dist/app/run-event-handler.js +37 -0
- package/dist/app/server.js +127 -123
- package/dist/app/slack-webhook.js +81 -0
- package/dist/app/webhook-routing.js +52 -0
- package/dist/harness/index.js +11 -14
- package/dist/plugins/slack-webhook/index.js +51 -0
- package/dist/plugins/storage/index.js +72 -14
- package/dist/plugins/storage/service.js +7 -1
- package/docs/plugins.md +27 -0
- package/package.json +2 -2
- package/src/app/active-runs.ts +95 -0
- package/src/app/cli.ts +1 -1
- package/src/app/lifecycle-events.ts +46 -0
- package/src/app/run-event-handler.ts +55 -0
- package/src/app/server.ts +147 -154
- package/src/app/types.ts +31 -4
- package/src/app/webhook-routing.ts +70 -0
- package/src/harness/index.ts +10 -19
- package/src/plugins/storage/index.ts +432 -372
- package/src/plugins/storage/service.ts +9 -3
- package/src/services/plugins/types.ts +0 -2
|
@@ -1750,11 +1750,17 @@ export const storageService = {
|
|
|
1750
1750
|
getOpenBotState: async (options: {
|
|
1751
1751
|
runId: string;
|
|
1752
1752
|
agentId: string;
|
|
1753
|
-
channelId: string;
|
|
1754
|
-
threadId?: string;
|
|
1755
1753
|
event: OpenBotEvent;
|
|
1756
1754
|
}): Promise<OpenBotState> => {
|
|
1757
|
-
const { runId, agentId,
|
|
1755
|
+
const { runId, agentId, event } = options;
|
|
1756
|
+
const channelId =
|
|
1757
|
+
typeof event.meta?.channelId === 'string'
|
|
1758
|
+
? event.meta.channelId.trim() || undefined
|
|
1759
|
+
: undefined;
|
|
1760
|
+
const threadId =
|
|
1761
|
+
typeof event.meta?.threadId === 'string'
|
|
1762
|
+
? event.meta.threadId.trim() || undefined
|
|
1763
|
+
: undefined;
|
|
1758
1764
|
|
|
1759
1765
|
let agentDetails: AgentDetails;
|
|
1760
1766
|
try {
|
|
@@ -25,8 +25,6 @@ export interface RunAgentHostOptions {
|
|
|
25
25
|
runId: string;
|
|
26
26
|
agentId: string;
|
|
27
27
|
event: OpenBotEvent;
|
|
28
|
-
channelId: string;
|
|
29
|
-
threadId?: string;
|
|
30
28
|
persistEvents?: boolean;
|
|
31
29
|
publicBaseUrl?: string;
|
|
32
30
|
onEvent: (event: OpenBotEvent, state?: OpenBotState) => Promise<void>;
|