@ai-setting/roy-agent-core 1.5.16-test → 1.5.22

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.
Files changed (54) hide show
  1. package/dist/env/index.js +20 -8
  2. package/dist/env/log-trace/index.js +1 -1
  3. package/dist/env/prompt/index.js +1 -1
  4. package/dist/env/workflow/engine/index.js +1 -1
  5. package/dist/env/workflow/index.js +2 -2
  6. package/dist/index.js +6 -7
  7. package/dist/shared/@ai-setting/{roy-agent-core-xq8hhqb8.js → roy-agent-core-4wjywp3c.js} +4 -2
  8. package/dist/shared/@ai-setting/roy-agent-core-8jxva565.js +19 -0
  9. package/dist/shared/@ai-setting/roy-agent-core-avq1x4t7.js +84 -0
  10. package/dist/shared/@ai-setting/{roy-agent-core-gq20wsgv.js → roy-agent-core-ffb9fq4v.js} +23 -2
  11. package/dist/shared/@ai-setting/{roy-agent-core-93zfb3r1.js → roy-agent-core-mrcxzpbg.js} +1 -1
  12. package/dist/shared/@ai-setting/{roy-agent-core-rhmtwnw1.js → roy-agent-core-pw7cv1px.js} +1 -1
  13. package/dist/shared/@ai-setting/{roy-agent-core-gbqcyegm.js → roy-agent-core-rccptwv0.js} +512 -673
  14. package/dist/shared/@ai-setting/{roy-agent-core-wrcy0h6z.js → roy-agent-core-ty94k28r.js} +1 -1
  15. package/package.json +1 -1
  16. package/dist/config/index.d.ts +0 -1250
  17. package/dist/env/agent/index.d.ts +0 -2279
  18. package/dist/env/commands/index.d.ts +0 -1131
  19. package/dist/env/debug/formatters/index.d.ts +0 -236
  20. package/dist/env/debug/index.d.ts +0 -1652
  21. package/dist/env/hook/index.d.ts +0 -279
  22. package/dist/env/index.d.ts +0 -3481
  23. package/dist/env/llm/index.d.ts +0 -1760
  24. package/dist/env/log-trace/index.d.ts +0 -1574
  25. package/dist/env/mcp/index.d.ts +0 -1331
  26. package/dist/env/mcp/tool/index.d.ts +0 -183
  27. package/dist/env/memory/built-in/index.d.ts +0 -232
  28. package/dist/env/memory/index.d.ts +0 -1799
  29. package/dist/env/memory/plugin/index.d.ts +0 -747
  30. package/dist/env/prompt/index.d.ts +0 -1164
  31. package/dist/env/session/index.d.ts +0 -1908
  32. package/dist/env/session/storage/index.d.ts +0 -564
  33. package/dist/env/skill/index.d.ts +0 -1266
  34. package/dist/env/skill/tool/index.d.ts +0 -193
  35. package/dist/env/task/delegate/index.d.ts +0 -1612
  36. package/dist/env/task/events/index.d.ts +0 -171
  37. package/dist/env/task/hooks/index.d.ts +0 -624
  38. package/dist/env/task/index.d.ts +0 -1553
  39. package/dist/env/task/plugins/index.d.ts +0 -466
  40. package/dist/env/task/storage/index.d.ts +0 -241
  41. package/dist/env/task/tools/index.d.ts +0 -1485
  42. package/dist/env/task/tools/operation/index.d.ts +0 -1484
  43. package/dist/env/tool/built-in/index.d.ts +0 -218
  44. package/dist/env/tool/index.d.ts +0 -1396
  45. package/dist/env/workflow/decorators/index.d.ts +0 -2161
  46. package/dist/env/workflow/engine/index.d.ts +0 -3453
  47. package/dist/env/workflow/index.d.ts +0 -3546
  48. package/dist/env/workflow/nodes/index.d.ts +0 -2092
  49. package/dist/env/workflow/service/index.d.ts +0 -227
  50. package/dist/env/workflow/storage/index.d.ts +0 -165
  51. package/dist/env/workflow/tools/index.d.ts +0 -416
  52. package/dist/env/workflow/types/index.d.ts +0 -2255
  53. package/dist/env/workflow/utils/index.d.ts +0 -2031
  54. package/dist/index.d.ts +0 -7858
@@ -1,227 +0,0 @@
1
- import { z as z5 } from "zod";
2
- import { z as z4 } from "zod";
3
- declare const RunStatusSchema: unknown;
4
- type RunStatus = z4.infer<typeof RunStatusSchema>;
5
- interface RunOptions {
6
- input?: Record<string, any>;
7
- debug?: boolean;
8
- parallelLimit?: number | null;
9
- timeout?: number | null;
10
- /** @deprecated No-op: workflow always waits for completion */
11
- sync?: boolean;
12
- }
13
- interface RunResult {
14
- runId: string;
15
- /** Session ID (workflow_{runId} format) - useful for CLI resume */
16
- sessionId?: string;
17
- status: RunStatus;
18
- output?: Record<string, any>;
19
- error?: string;
20
- durationMs?: number;
21
- /** Pending node ID (when status is 'paused') */
22
- pendingNodeId?: string;
23
- /** Query from ask_user (when status is 'paused') */
24
- query?: string;
25
- /** Agent sub-session ID (for resuming agent nodes) */
26
- agentSessionId?: string;
27
- }
28
- declare const NodeDefinitionSchema: unknown;
29
- type NodeDefinition = z5.infer<typeof NodeDefinitionSchema>;
30
- declare const WorkflowConfigSchema: unknown;
31
- type WorkflowConfig = z5.infer<typeof WorkflowConfigSchema>;
32
- declare const WorkflowMetadataSchema: unknown;
33
- type WorkflowMetadata = z5.infer<typeof WorkflowMetadataSchema>;
34
- declare const WorkflowDefinitionSchema: unknown;
35
- type WorkflowDefinition = z5.infer<typeof WorkflowDefinitionSchema>;
36
- interface Workflow {
37
- id: string;
38
- name: string;
39
- version: string;
40
- description?: string;
41
- definition: WorkflowDefinition;
42
- config: WorkflowConfig;
43
- metadata: WorkflowMetadata;
44
- tags: string[];
45
- createdAt: Date;
46
- updatedAt: Date;
47
- }
48
- interface WorkflowRepository {
49
- create(workflow: Omit<Workflow, "id" | "createdAt" | "updatedAt">): Workflow;
50
- getById(id: string): Workflow | null;
51
- getByName(name: string): Workflow | null;
52
- list(options?: ListOptions): Workflow[];
53
- update(id: string, updates: Partial<Workflow>): Workflow | null;
54
- delete(id: string): boolean;
55
- }
56
- interface CreateOptions {
57
- tags?: string[];
58
- metadata?: WorkflowMetadata;
59
- taskId?: number;
60
- force?: boolean;
61
- }
62
- interface ListOptions {
63
- tag?: string;
64
- taskId?: number;
65
- search?: string;
66
- limit?: number;
67
- offset?: number;
68
- }
69
- interface WorkflowUpdates {
70
- definition?: WorkflowDefinition;
71
- config?: WorkflowConfig;
72
- tags?: string[];
73
- metadata?: WorkflowMetadata;
74
- }
75
- interface WorkflowEngine {
76
- createSession(workflowId: string, options?: {
77
- input?: Record<string, any>;
78
- workflowName?: string;
79
- workflowVersion?: string;
80
- }): Promise<string>;
81
- run(sessionId: string, options?: RunOptions): Promise<RunResult>;
82
- runWorkflow(workflow: Workflow | WorkflowDefinition, options?: RunOptions): Promise<RunResult>;
83
- stop(sessionId: string, reason?: string): Promise<void>;
84
- addNode(sessionId: string, nodeDefinition: NodeDefinition): Promise<void>;
85
- removeNode(sessionId: string, nodeId: string): Promise<void>;
86
- }
87
- type WorkflowEngineFactory = (workflow: Workflow, options?: RunOptions) => Pick<WorkflowEngine, "run" | "stop" | "runWorkflow">;
88
- interface SessionInfo {
89
- id: string;
90
- title: string;
91
- metadata: WorkflowSessionMetadata3;
92
- createdAt: Date;
93
- updatedAt: Date;
94
- }
95
- interface WorkflowSessionMetadata3 {
96
- type: "workflow";
97
- runId?: string;
98
- workflowId?: string;
99
- workflowName: string;
100
- workflowVersion?: string;
101
- status: "running" | "paused" | "completed" | "failed";
102
- input?: any;
103
- rootNodeId?: string;
104
- agentSessions?: AgentSessionRef3[];
105
- }
106
- interface AgentSessionRef3 {
107
- nodeId: string;
108
- sessionId: string;
109
- status: "active" | "paused" | "completed";
110
- }
111
- declare class WorkflowService {
112
- private workflowRepository;
113
- private engineFactory;
114
- private sessionComponent?;
115
- constructor(workflowRepository: WorkflowRepository, engineFactory: WorkflowEngineFactory, sessionComponent?: {
116
- create(options: {
117
- id?: string;
118
- title: string;
119
- metadata: any;
120
- }): Promise<{
121
- id: string;
122
- }>;
123
- get(id: string): Promise<SessionInfo | null | undefined>;
124
- list?(options?: {
125
- limit?: number;
126
- offset?: number;
127
- }): Promise<SessionInfo[]>;
128
- update(id: string, updates: {
129
- metadata?: any;
130
- }): Promise<boolean>;
131
- addMessage(sessionId: string, message: any): Promise<string>;
132
- getMessages(sessionId: string): Promise<any[]>;
133
- } | undefined);
134
- /**
135
- * Create a new workflow from definition
136
- */
137
- createWorkflow(definition: WorkflowDefinition, options?: CreateOptions): Promise<Workflow>;
138
- /**
139
- * Get workflow by id or name
140
- */
141
- getWorkflow(idOrName: string): Workflow | null;
142
- /**
143
- * Get workflow by id
144
- */
145
- getWorkflowById(id: string): Workflow | null;
146
- /**
147
- * Get workflow by name
148
- */
149
- getWorkflowByName(name: string): Workflow | null;
150
- /**
151
- * List workflows with optional filters
152
- */
153
- listWorkflows(options?: ListOptions): Workflow[];
154
- /**
155
- * Update an existing workflow
156
- */
157
- updateWorkflow(idOrName: string, updates: WorkflowUpdates, options?: {
158
- tags?: string[];
159
- }): Promise<Workflow>;
160
- /**
161
- * Delete a workflow by name or id
162
- */
163
- deleteWorkflow(idOrName: string): Promise<boolean>;
164
- /**
165
- * Run a workflow by definition or name
166
- *
167
- * This creates a Session that represents the workflow run.
168
- * The Session ID is used as the run identifier for pause/resume.
169
- */
170
- runWorkflow(idOrNameOrDefinition: string | WorkflowDefinition, input?: Record<string, any>, options?: RunOptions): Promise<RunResult>;
171
- /**
172
- * Run workflow by name (convenience method)
173
- */
174
- runWorkflowByName(name: string, input?: Record<string, any>, options?: RunOptions): Promise<RunResult>;
175
- /**
176
- * Stop a running workflow session
177
- */
178
- stopRun(sessionId: string, reason?: string): Promise<void>;
179
- /**
180
- * Get workflow session by ID
181
- */
182
- getSession(sessionId: string): Promise<SessionInfo | null>;
183
- /**
184
- * List workflow sessions
185
- */
186
- listSessions(options?: {
187
- limit?: number;
188
- offset?: number;
189
- }): Promise<SessionInfo[]>;
190
- /**
191
- * Get messages from a workflow session
192
- */
193
- getSessionMessages(sessionId: string): Promise<any[]>;
194
- }
195
- /**
196
- * Singleton registry for WorkflowService
197
- * Provides centralized access to the workflow service instance
198
- */
199
- declare class WorkflowServiceRegistry {
200
- private static instance;
201
- private service;
202
- private constructor();
203
- /**
204
- * Get the singleton registry instance
205
- */
206
- static getInstance(): WorkflowServiceRegistry;
207
- /**
208
- * Register a WorkflowService instance
209
- */
210
- register(service: WorkflowService): void;
211
- /**
212
- * Get the registered WorkflowService instance
213
- * @throws Error if no service is registered
214
- */
215
- get(): WorkflowService;
216
- /**
217
- * Check if a service is registered
218
- */
219
- isRegistered(): boolean;
220
- /**
221
- * Reset the registry (primarily for testing)
222
- */
223
- reset(): void;
224
- }
225
- declare function getWorkflowService(): WorkflowService;
226
- declare function registerWorkflowService(service: WorkflowService): void;
227
- export { registerWorkflowService, getWorkflowService, WorkflowUpdates, WorkflowSessionMetadata3 as WorkflowSessionMetadata, WorkflowServiceRegistry, WorkflowService, WorkflowRepository, WorkflowEngineFactory, WorkflowEngine, WorkflowDefinition, SessionInfo, ListOptions, CreateOptions, AgentSessionRef3 as AgentSessionRef };
@@ -1,165 +0,0 @@
1
- import { z as z5 } from "zod";
2
- declare const WorkflowConfigSchema: unknown;
3
- type WorkflowConfig = z5.infer<typeof WorkflowConfigSchema>;
4
- declare const WorkflowMetadataSchema: unknown;
5
- type WorkflowMetadata = z5.infer<typeof WorkflowMetadataSchema>;
6
- declare const WorkflowDefinitionSchema: unknown;
7
- type WorkflowDefinition = z5.infer<typeof WorkflowDefinitionSchema>;
8
- interface Workflow {
9
- id: string;
10
- name: string;
11
- version: string;
12
- description?: string;
13
- definition: WorkflowDefinition;
14
- config: WorkflowConfig;
15
- metadata: WorkflowMetadata;
16
- tags: string[];
17
- createdAt: Date;
18
- updatedAt: Date;
19
- }
20
- /**
21
- * Get the database file path
22
- * Default: ~/.local/share/roy-agent/workflows.db
23
- */
24
- declare function getDatabasePath(): string;
25
- /**
26
- * Get the singleton database instance
27
- * @param path - Optional custom database path. If not provided, uses default path.
28
- * Use ':memory:' for in-memory database (testing)
29
- */
30
- declare function getDatabase(path?: string): any;
31
- /**
32
- * Close the database connection
33
- */
34
- declare function closeDatabase(): void;
35
- type BunDatabase = {
36
- exec(sql: string): void;
37
- query<T>(sql: string): {
38
- all(): T[];
39
- get(...params: any[]): T | null;
40
- };
41
- run(sql: string, ...params: any[]): {
42
- lastInsertRowid: number;
43
- changes: number;
44
- };
45
- close(): void;
46
- pragma?: (sql: string) => void;
47
- };
48
- /**
49
- * Initialize all required tables
50
- *
51
- * Note: Only workflows table is created. Workflow runs are managed via SessionComponent
52
- * using the session/message storage, following the session-based design.
53
- */
54
- declare function initializeTables(): void;
55
- /**
56
- * Reset the database instance (for testing purposes)
57
- * This is useful for tests that need a fresh database
58
- */
59
- declare function resetDatabase(): void;
60
- /**
61
- * Initialize tables and return a ready database
62
- * This is a convenience function that combines getDatabase and initializeTables
63
- */
64
- declare function initDatabase(path?: string): any;
65
- interface WorkflowRow {
66
- id: string;
67
- name: string;
68
- version: string;
69
- description: string | null;
70
- definition: string;
71
- config: string;
72
- metadata: string;
73
- tags: string;
74
- task_id: number | null;
75
- created_at: string;
76
- updated_at: string;
77
- }
78
- interface ListWorkflowsOptions {
79
- limit?: number;
80
- offset?: number;
81
- orderBy?: "name" | "created_at" | "updated_at";
82
- order?: "asc" | "desc";
83
- tag?: string;
84
- taskId?: number;
85
- search?: string;
86
- }
87
- interface UpdateWorkflowOptions {
88
- name?: string;
89
- version?: string;
90
- description?: string;
91
- definition?: WorkflowDefinition;
92
- config?: WorkflowConfig;
93
- metadata?: WorkflowMetadata;
94
- tags?: string[];
95
- }
96
- /**
97
- * Row to Workflow conversion helper
98
- */
99
- declare function rowToWorkflow(row: WorkflowRow): Workflow;
100
- /**
101
- * WorkflowRepository class
102
- *
103
- * Provides CRUD operations for workflows in SQLite.
104
- */
105
- declare class WorkflowRepository {
106
- private db;
107
- constructor(db?: ReturnType<typeof getDatabase>);
108
- /**
109
- * Create a new workflow
110
- */
111
- create(workflow: Omit<Workflow, "id" | "createdAt" | "updatedAt">): Workflow;
112
- /**
113
- * Create a workflow from definition only
114
- */
115
- createFromDefinition(definition: WorkflowDefinition, options?: {
116
- config?: WorkflowConfig;
117
- metadata?: WorkflowMetadata;
118
- tags?: string[];
119
- }): Workflow;
120
- /**
121
- * Get a workflow by ID
122
- */
123
- getById(id: string): Workflow | undefined;
124
- /**
125
- * Get a workflow by name (returns latest version)
126
- */
127
- getByName(name: string): Workflow | undefined;
128
- /**
129
- * Get a specific version of a workflow by name
130
- */
131
- getByNameAndVersion(name: string, version: string): Workflow | undefined;
132
- /**
133
- * List workflows with optional filtering and pagination
134
- */
135
- list(options?: ListWorkflowsOptions): Workflow[];
136
- /**
137
- * List all versions of a workflow by name
138
- */
139
- listVersions(name: string): Workflow[];
140
- /**
141
- * Update a workflow
142
- */
143
- update(id: string, updates: UpdateWorkflowOptions): Workflow | undefined;
144
- /**
145
- * Delete a workflow
146
- */
147
- delete(id: string): boolean;
148
- /**
149
- * Check if a workflow exists
150
- */
151
- exists(id: string): boolean;
152
- /**
153
- * Check if a workflow with name and version exists
154
- */
155
- existsByNameAndVersion(name: string, version: string): boolean;
156
- /**
157
- * Get total count of workflows
158
- */
159
- count(): number;
160
- /**
161
- * Search workflows by name (partial match)
162
- */
163
- search(query: string, limit?: number): Workflow[];
164
- }
165
- export { rowToWorkflow, resetDatabase, initializeTables, initDatabase, getDatabasePath, getDatabase, closeDatabase, WorkflowRow, WorkflowRepository, UpdateWorkflowOptions, ListWorkflowsOptions, BunDatabase };