@meetsmore-oss/use-ai-plugin-workflows 1.2.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/WorkflowsPlugin.d.ts +64 -0
- package/dist/WorkflowsPlugin.d.ts.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4821 -0
- package/dist/runners/DifyWorkflowRunner.d.ts +77 -0
- package/dist/runners/DifyWorkflowRunner.d.ts.map +1 -0
- package/dist/test-preload.d.ts +2 -0
- package/dist/test-preload.d.ts.map +1 -0
- package/dist/types.d.ts +109 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/workflows.test.d.ts +2 -0
- package/dist/workflows.test.d.ts.map +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { UseAIServerPlugin, MessageHandler } from '@meetsmore-oss/use-ai-server';
|
|
2
|
+
import type { WorkflowRunner } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for WorkflowsPlugin.
|
|
5
|
+
*/
|
|
6
|
+
export interface WorkflowsPluginConfig {
|
|
7
|
+
/**
|
|
8
|
+
* Map of workflow runner names to runner instances.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* {
|
|
13
|
+
* runners: new Map([
|
|
14
|
+
* ['dify', new DifyWorkflowRunner({ apiBaseUrl: 'http://localhost:3001/v1' })],
|
|
15
|
+
* ])
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
runners: Map<string, WorkflowRunner>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Plugin for workflow execution functionality.
|
|
23
|
+
*
|
|
24
|
+
* This plugin adds support for headless workflow execution to UseAIServer.
|
|
25
|
+
* Workflows are:
|
|
26
|
+
* - Stateless (no conversation history)
|
|
27
|
+
* - Triggered programmatically (not by user chat)
|
|
28
|
+
* - Single-run operations
|
|
29
|
+
* - Can still call frontend tools via AG-UI protocol
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* import { UseAIServer, AISDKAgent } from '@meetsmore-oss/use-ai-server';
|
|
34
|
+
* import { WorkflowsPlugin } from '@meetsmore-oss/use-ai-plugin-workflows';
|
|
35
|
+
* import { DifyWorkflowRunner } from '@meetsmore-oss/use-ai-plugin-workflows'; // Dify workflow runner
|
|
36
|
+
* import { anthropic } from '@ai-sdk/anthropic';
|
|
37
|
+
*
|
|
38
|
+
* const model = anthropic('claude-3-5-sonnet-20241022');
|
|
39
|
+
*
|
|
40
|
+
* const server = new UseAIServer({
|
|
41
|
+
* agents: {
|
|
42
|
+
* claude: new AISDKAgent({ model }),
|
|
43
|
+
* },
|
|
44
|
+
* defaultAgent: 'claude',
|
|
45
|
+
* plugins: [
|
|
46
|
+
* new WorkflowsPlugin({
|
|
47
|
+
* runners: new Map([
|
|
48
|
+
* ['dify', new DifyWorkflowRunner({ apiBaseUrl: 'http://localhost:3001/v1' })],
|
|
49
|
+
* ]),
|
|
50
|
+
* }),
|
|
51
|
+
* ],
|
|
52
|
+
* });
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare class WorkflowsPlugin implements UseAIServerPlugin {
|
|
56
|
+
private runners;
|
|
57
|
+
constructor(config: WorkflowsPluginConfig);
|
|
58
|
+
getName(): string;
|
|
59
|
+
registerHandlers(server: {
|
|
60
|
+
registerMessageHandler(type: string, handler: MessageHandler): void;
|
|
61
|
+
}): void;
|
|
62
|
+
private handleRunWorkflow;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=WorkflowsPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowsPlugin.d.ts","sourceRoot":"","sources":["../src/WorkflowsPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAiB,MAAM,8BAA8B,CAAC;AAIrG,OAAO,KAAK,EAAE,cAAc,EAAgB,MAAM,SAAS,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;;;;;;;OAWG;IACH,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBAAa,eAAgB,YAAW,iBAAiB;IACvD,OAAO,CAAC,OAAO,CAA8B;gBAEjC,MAAM,EAAE,qBAAqB;IAIzC,OAAO,IAAI,MAAM;IAIjB,gBAAgB,CAAC,MAAM,EAAE;QAAE,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI;YAIzF,iBAAiB;CA+EhC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflows plugin for @meetsmore-oss/use-ai-server.
|
|
3
|
+
* Provides headless workflow execution with pluggable workflow runners.
|
|
4
|
+
*/
|
|
5
|
+
export { WorkflowsPlugin, type WorkflowsPluginConfig } from './WorkflowsPlugin';
|
|
6
|
+
export type { WorkflowRunner, WorkflowInput, WorkflowResult, EventEmitter } from './types';
|
|
7
|
+
export { DifyWorkflowRunner, type DifyWorkflowRunnerConfig } from './runners/DifyWorkflowRunner';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAChF,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,KAAK,wBAAwB,EAAE,MAAM,8BAA8B,CAAC"}
|