@exaudeus/workrail 0.0.17 → 0.0.18

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 (102) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +9 -9
  3. package/dist/application/app.d.ts +0 -7
  4. package/dist/application/app.js +1 -18
  5. package/dist/application/services/enhanced-error-service.d.ts +0 -64
  6. package/dist/application/services/enhanced-error-service.js +11 -82
  7. package/dist/application/services/validation-engine.d.ts +0 -65
  8. package/dist/application/services/validation-engine.js +5 -91
  9. package/dist/application/services/workflow-service.d.ts +0 -11
  10. package/dist/application/services/workflow-service.js +0 -17
  11. package/dist/application/use-cases/get-next-step.d.ts +0 -9
  12. package/dist/application/use-cases/get-next-step.js +0 -9
  13. package/dist/application/use-cases/get-workflow.d.ts +0 -9
  14. package/dist/application/use-cases/get-workflow.js +0 -17
  15. package/dist/application/use-cases/list-workflows.d.ts +0 -9
  16. package/dist/application/use-cases/list-workflows.js +0 -9
  17. package/dist/application/use-cases/validate-step-output.d.ts +0 -9
  18. package/dist/application/use-cases/validate-step-output.js +0 -9
  19. package/dist/application/use-cases/validate-workflow-json.d.ts +0 -12
  20. package/dist/application/use-cases/validate-workflow-json.js +0 -21
  21. package/dist/application/validation.d.ts +0 -1
  22. package/dist/application/validation.js +6 -5
  23. package/dist/cli.d.ts +0 -1
  24. package/dist/cli.js +7 -12
  25. package/dist/container.d.ts +0 -11
  26. package/dist/container.js +0 -6
  27. package/dist/core/error-handler.d.ts +0 -43
  28. package/dist/core/error-handler.js +0 -65
  29. package/dist/domain/index.d.ts +0 -1
  30. package/dist/domain/index.js +16 -4
  31. package/dist/index.d.ts +0 -1
  32. package/dist/index.js +0 -2
  33. package/dist/infrastructure/index.d.ts +0 -1
  34. package/dist/infrastructure/index.js +16 -4
  35. package/dist/infrastructure/rpc/handler.d.ts +0 -9
  36. package/dist/infrastructure/rpc/handler.js +3 -16
  37. package/dist/infrastructure/rpc/index.d.ts +0 -1
  38. package/dist/infrastructure/rpc/index.js +15 -3
  39. package/dist/infrastructure/rpc/server.d.ts +0 -1
  40. package/dist/infrastructure/rpc/server.js +0 -3
  41. package/dist/infrastructure/storage/caching-workflow-storage.d.ts +0 -4
  42. package/dist/infrastructure/storage/caching-workflow-storage.js +2 -9
  43. package/dist/infrastructure/storage/file-workflow-storage.d.ts +0 -28
  44. package/dist/infrastructure/storage/file-workflow-storage.js +14 -57
  45. package/dist/infrastructure/storage/git-workflow-storage.d.ts +0 -14
  46. package/dist/infrastructure/storage/git-workflow-storage.js +19 -51
  47. package/dist/infrastructure/storage/in-memory-storage.d.ts +0 -6
  48. package/dist/infrastructure/storage/in-memory-storage.js +0 -7
  49. package/dist/infrastructure/storage/index.d.ts +0 -1
  50. package/dist/infrastructure/storage/index.js +19 -7
  51. package/dist/infrastructure/storage/multi-directory-workflow-storage.d.ts +0 -18
  52. package/dist/infrastructure/storage/multi-directory-workflow-storage.js +7 -36
  53. package/dist/infrastructure/storage/plugin-workflow-storage.d.ts +0 -43
  54. package/dist/infrastructure/storage/plugin-workflow-storage.js +17 -78
  55. package/dist/infrastructure/storage/remote-workflow-storage.d.ts +0 -10
  56. package/dist/infrastructure/storage/remote-workflow-storage.js +6 -39
  57. package/dist/infrastructure/storage/schema-validating-workflow-storage.d.ts +0 -5
  58. package/dist/infrastructure/storage/schema-validating-workflow-storage.js +7 -12
  59. package/dist/infrastructure/storage/storage.d.ts +0 -14
  60. package/dist/infrastructure/storage/storage.js +2 -21
  61. package/dist/mcp-server.d.ts +0 -1
  62. package/dist/mcp-server.js +2 -14
  63. package/dist/tools/mcp_initialize.d.ts +0 -1
  64. package/dist/tools/mcp_initialize.js +2 -9
  65. package/dist/tools/mcp_shutdown.d.ts +0 -1
  66. package/dist/tools/mcp_shutdown.js +0 -1
  67. package/dist/tools/mcp_tools_list.d.ts +0 -1
  68. package/dist/tools/mcp_tools_list.js +0 -1
  69. package/dist/types/mcp-types.d.ts +0 -1
  70. package/dist/types/mcp-types.js +0 -8
  71. package/dist/types/server.d.ts +0 -1
  72. package/dist/types/server.js +0 -1
  73. package/dist/types/storage.d.ts +0 -20
  74. package/dist/types/storage.js +0 -4
  75. package/dist/types/workflow-types.d.ts +0 -1
  76. package/dist/types/workflow-types.js +0 -3
  77. package/dist/utils/condition-evaluator.d.ts +0 -15
  78. package/dist/utils/condition-evaluator.js +0 -24
  79. package/dist/utils/config.d.ts +0 -55
  80. package/dist/utils/config.js +0 -84
  81. package/dist/utils/storage-security.d.ts +0 -62
  82. package/dist/utils/storage-security.js +6 -62
  83. package/dist/validation/request-validator.d.ts +0 -1
  84. package/dist/validation/request-validator.js +6 -6
  85. package/dist/validation/response-validator.d.ts +0 -1
  86. package/dist/validation/response-validator.js +4 -21
  87. package/dist/validation/schemas.d.ts +0 -5
  88. package/dist/validation/schemas.js +0 -5
  89. package/package.json +7 -14
  90. package/spec/mcp-protocol-handshake.md +4 -3
  91. package/workflows/coding-task-workflow.json +32 -0
  92. package/workflows/document-creation-workflow.json +235 -0
  93. package/workflows/exploration-workflow.json +254 -0
  94. package/workflows/presentation-creation.json +71 -0
  95. package/workflows/systemic-bug-investigation.json +32 -14
  96. package/workflows/systemic-bug-investigation.json.bak +196 -0
  97. package/dist/mcp-server-simple.js +0 -391
  98. package/dist/types/session-types.d.ts +0 -354
  99. package/dist/types/session-types.d.ts.map +0 -1
  100. package/dist/types/session-types.js +0 -89
  101. package/dist/types/session-types.js.map +0 -1
  102. package/workflows/example-agent-role-workflow.json +0 -83
@@ -1,354 +0,0 @@
1
- import { ConditionContext } from '../utils/condition-evaluator';
2
- /**
3
- * Represents a unique session for workflow execution.
4
- * Sessions maintain state across multiple tool calls, enabling stateful workflows.
5
- */
6
- export interface SessionState {
7
- /** Cryptographically secure session identifier */
8
- sessionId: string;
9
- /** ID of the workflow being executed */
10
- workflowId: string;
11
- /** Array of completed step IDs in execution order */
12
- completedSteps: string[];
13
- /** Context variables for workflow step conditions and state */
14
- context: ConditionContext;
15
- /** Timestamp when session was created */
16
- createdAt: Date;
17
- /** Timestamp of last activity (tool call) */
18
- lastActivity: Date;
19
- /** Current storage tier for tiered cleanup */
20
- tier: SessionTier;
21
- /** Total number of tool calls made in this session */
22
- accessCount: number;
23
- /** Total milliseconds spent in inactive state */
24
- hibernationTime: number;
25
- /** Client-provided hints for session lifecycle management */
26
- hints: SessionHints;
27
- /** Session metadata for monitoring and analytics */
28
- metadata: SessionMetadata;
29
- }
30
- /**
31
- * Storage tiers for session lifecycle management.
32
- * Sessions migrate through tiers based on activity patterns.
33
- */
34
- export type SessionTier = 'memory' | 'disk' | 'archive';
35
- /**
36
- * Client-provided hints for session management.
37
- * Helps optimize cleanup policies and resource allocation.
38
- */
39
- export interface SessionHints {
40
- /** Expected session duration in milliseconds */
41
- expectedDuration?: number;
42
- /** Session importance level affects cleanup priority */
43
- importance: SessionImportance;
44
- /** Whether client expects to pause/resume this session */
45
- pauseExpected?: boolean;
46
- /** Type of client for different cleanup strategies */
47
- clientType: SessionClientType;
48
- /** Human-readable description of session purpose */
49
- description?: string;
50
- }
51
- export type SessionImportance = 'low' | 'medium' | 'high' | 'critical';
52
- export type SessionClientType = 'human' | 'agent' | 'scheduled' | 'test';
53
- /**
54
- * Session metadata for monitoring and analytics.
55
- */
56
- export interface SessionMetadata {
57
- /** Current workflow progress (0-100) */
58
- progress: number;
59
- /** Estimated time remaining in milliseconds */
60
- estimatedTimeRemaining?: number;
61
- /** Recent activity frequency (calls per hour) */
62
- activityFrequency: number;
63
- /** Session size in bytes for memory management */
64
- memoryFootprint: number;
65
- /** Number of validation errors encountered */
66
- validationErrors: number;
67
- /** Custom labels for session categorization */
68
- labels: Record<string, string>;
69
- }
70
- /**
71
- * Result of session creation.
72
- */
73
- export interface SessionStartResult {
74
- /** Created session ID */
75
- sessionId: string;
76
- /** First step of the workflow */
77
- step: {
78
- id: string;
79
- title: string;
80
- prompt: string;
81
- agentRole?: string;
82
- guidance?: string[];
83
- } | null;
84
- /** Workflow guidance for first step */
85
- guidance: {
86
- prompt: string;
87
- };
88
- /** Whether workflow is complete (empty workflow) */
89
- isComplete: boolean;
90
- /** Session configuration used */
91
- config: SessionConfig;
92
- }
93
- /**
94
- * Session activity tracking for cleanup decisions.
95
- */
96
- export interface SessionActivity {
97
- /** Most recent activity timestamp */
98
- recentActivity: Date;
99
- /** Activity frequency in calls per hour */
100
- activityFrequency: number;
101
- /** Workflow completion percentage */
102
- workflowProgress: number;
103
- /** Client type for different cleanup strategies */
104
- clientType: SessionClientType;
105
- /** Session importance level */
106
- importance: SessionImportance;
107
- /** Whether session is expected to be paused */
108
- pauseExpected: boolean;
109
- }
110
- /**
111
- * Result of session validation operations.
112
- */
113
- export interface SessionValidationResult {
114
- /** Whether validation passed */
115
- valid: boolean;
116
- /** Array of validation issues */
117
- issues: string[];
118
- /** Array of suggestions for fixing issues */
119
- suggestions: string[];
120
- /** Validation warnings that don't prevent operation */
121
- warnings: string[];
122
- }
123
- /**
124
- * Parameters for session update operations.
125
- */
126
- export interface SessionUpdateParams {
127
- /** New completed steps to add */
128
- completedSteps?: string[];
129
- /** Context updates to apply */
130
- context?: Partial<ConditionContext>;
131
- /** Update session hints */
132
- hints?: Partial<SessionHints>;
133
- /** Update session metadata */
134
- metadata?: Partial<SessionMetadata>;
135
- }
136
- /**
137
- * Configuration for session management system.
138
- */
139
- export interface SessionConfig {
140
- /** Memory tier cleanup policy */
141
- memoryTTL: number;
142
- /** Disk tier cleanup policy */
143
- diskTTL: number;
144
- /** Archive tier cleanup policy */
145
- archiveTTL: number;
146
- /** Maximum sessions allowed in memory */
147
- maxMemorySessions: number;
148
- /** Maximum sessions allowed on disk */
149
- maxDiskSessions: number;
150
- /** Cleanup task interval in milliseconds */
151
- cleanupInterval: number;
152
- /** Whether to enable adaptive cleanup policies */
153
- adaptiveCleanup: boolean;
154
- /** Security settings for session ID generation */
155
- security: SessionSecurityConfig;
156
- }
157
- /**
158
- * Security configuration for session management.
159
- */
160
- export interface SessionSecurityConfig {
161
- /** Length of session ID in bytes */
162
- sessionIdLength: number;
163
- /** Whether to use cryptographically secure random generation */
164
- useSecureRandom: boolean;
165
- /** Whether to hash session IDs in logs */
166
- hashSessionIds: boolean;
167
- /** Maximum session context size in bytes */
168
- maxContextSize: number;
169
- /** Whether to validate session context values */
170
- validateContext: boolean;
171
- }
172
- /**
173
- * Cleanup policy for different session types.
174
- */
175
- export interface SessionCleanupPolicy {
176
- /** Base TTL for memory tier */
177
- memoryTTL: number;
178
- /** Base TTL for disk tier */
179
- diskTTL: number;
180
- /** Base TTL for archive tier */
181
- archiveTTL: number;
182
- /** Multiplier for high importance sessions */
183
- importanceMultiplier: Record<SessionImportance, number>;
184
- /** Multiplier for different client types */
185
- clientTypeMultiplier: Record<SessionClientType, number>;
186
- /** Whether to extend TTL for near-complete workflows */
187
- extendForProgress: boolean;
188
- }
189
- /**
190
- * Interface for session storage backends.
191
- * Supports tiered storage with memory, disk, and archive layers.
192
- */
193
- export interface ISessionStorage {
194
- /**
195
- * Create a new session with the given state.
196
- */
197
- createSession(sessionState: SessionState): Promise<void>;
198
- /**
199
- * Retrieve a session by ID, checking all tiers.
200
- */
201
- getSession(sessionId: string): Promise<SessionState | null>;
202
- /**
203
- * Update an existing session with partial state.
204
- */
205
- updateSession(sessionId: string, updates: SessionUpdateParams): Promise<void>;
206
- /**
207
- * Delete a session from all tiers.
208
- */
209
- deleteSession(sessionId: string): Promise<void>;
210
- /**
211
- * List all sessions in a specific tier.
212
- */
213
- listSessions(tier?: SessionTier): Promise<SessionState[]>;
214
- /**
215
- * Move a session to a different tier.
216
- */
217
- migrateSession(sessionId: string, targetTier: SessionTier): Promise<void>;
218
- /**
219
- * Clean up expired sessions based on policy.
220
- */
221
- cleanupExpiredSessions(policy: SessionCleanupPolicy): Promise<SessionCleanupResult>;
222
- /**
223
- * Get storage statistics for monitoring.
224
- */
225
- getStorageStats(): Promise<SessionStorageStats>;
226
- }
227
- /**
228
- * Result of session cleanup operations.
229
- */
230
- export interface SessionCleanupResult {
231
- /** Number of sessions cleaned up */
232
- sessionsRemoved: number;
233
- /** Number of sessions migrated to disk */
234
- sessionsMigratedToDisk: number;
235
- /** Number of sessions migrated to archive */
236
- sessionsMigratedToArchive: number;
237
- /** Memory freed in bytes */
238
- memoryFreed: number;
239
- /** Cleanup duration in milliseconds */
240
- duration: number;
241
- /** Any errors encountered during cleanup */
242
- errors: string[];
243
- }
244
- /**
245
- * Storage statistics for monitoring.
246
- */
247
- export interface SessionStorageStats {
248
- /** Sessions in each tier */
249
- sessionsByTier: Record<SessionTier, number>;
250
- /** Total memory usage in bytes */
251
- memoryUsage: number;
252
- /** Total disk usage in bytes */
253
- diskUsage: number;
254
- /** Average session size in bytes */
255
- averageSessionSize: number;
256
- /** Sessions by importance level */
257
- sessionsByImportance: Record<SessionImportance, number>;
258
- /** Sessions by client type */
259
- sessionsByClientType: Record<SessionClientType, number>;
260
- /** Last cleanup timestamp */
261
- lastCleanup: Date;
262
- }
263
- /**
264
- * Interface for session management service.
265
- * Provides high-level operations for session lifecycle management.
266
- */
267
- export interface SessionService {
268
- /**
269
- * Create a new session for the given workflow.
270
- */
271
- createSession(workflowId: string, hints?: SessionHints): Promise<SessionStartResult>;
272
- /**
273
- * Retrieve a session by ID.
274
- */
275
- getSession(sessionId: string): Promise<SessionState | null>;
276
- /**
277
- * Update session state after a workflow step.
278
- */
279
- updateSession(sessionId: string, updates: SessionUpdateParams): Promise<void>;
280
- /**
281
- * Validate session update parameters.
282
- */
283
- validateSessionUpdate(sessionId: string, updates: SessionUpdateParams): Promise<SessionValidationResult>;
284
- /**
285
- * Delete a session.
286
- */
287
- deleteSession(sessionId: string): Promise<void>;
288
- /**
289
- * List active sessions with optional filtering.
290
- */
291
- listSessions(filter?: SessionFilter): Promise<SessionState[]>;
292
- /**
293
- * Calculate TTL for a session based on activity.
294
- */
295
- calculateSessionTTL(activity: SessionActivity): number;
296
- /**
297
- * Perform cleanup of expired sessions.
298
- */
299
- cleanupSessions(): Promise<SessionCleanupResult>;
300
- /**
301
- * Get session service statistics.
302
- */
303
- getStats(): Promise<SessionStorageStats>;
304
- }
305
- /**
306
- * Filter options for listing sessions.
307
- */
308
- export interface SessionFilter {
309
- /** Filter by workflow ID */
310
- workflowId?: string;
311
- /** Filter by client type */
312
- clientType?: SessionClientType;
313
- /** Filter by importance level */
314
- importance?: SessionImportance;
315
- /** Filter by storage tier */
316
- tier?: SessionTier;
317
- /** Filter by minimum last activity */
318
- minLastActivity?: Date;
319
- /** Filter by maximum last activity */
320
- maxLastActivity?: Date;
321
- }
322
- /**
323
- * Session-related error types.
324
- */
325
- export declare class SessionError extends Error {
326
- readonly code: SessionErrorCode;
327
- readonly sessionId?: string | undefined;
328
- readonly details?: Record<string, any> | undefined;
329
- constructor(message: string, code: SessionErrorCode, sessionId?: string | undefined, details?: Record<string, any> | undefined);
330
- }
331
- export declare enum SessionErrorCode {
332
- SESSION_NOT_FOUND = "SESSION_NOT_FOUND",
333
- SESSION_EXPIRED = "SESSION_EXPIRED",
334
- INVALID_SESSION_ID = "INVALID_SESSION_ID",
335
- SESSION_ALREADY_EXISTS = "SESSION_ALREADY_EXISTS",
336
- INVALID_UPDATE = "INVALID_UPDATE",
337
- STORAGE_ERROR = "STORAGE_ERROR",
338
- VALIDATION_ERROR = "VALIDATION_ERROR",
339
- RESOURCE_EXHAUSTED = "RESOURCE_EXHAUSTED",
340
- SECURITY_ERROR = "SECURITY_ERROR"
341
- }
342
- /**
343
- * Default session configuration.
344
- */
345
- export declare const DEFAULT_SESSION_CONFIG: SessionConfig;
346
- /**
347
- * Default cleanup policy.
348
- */
349
- export declare const DEFAULT_CLEANUP_POLICY: SessionCleanupPolicy;
350
- /**
351
- * Default session hints.
352
- */
353
- export declare const DEFAULT_SESSION_HINTS: SessionHints;
354
- //# sourceMappingURL=session-types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"session-types.d.ts","sourceRoot":"","sources":["../../src/types/session-types.ts"],"names":[],"mappings":"AAIA,OAAO,EAA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B,EAAE,oBAiBpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAInC,CAAC"}
@@ -1,89 +0,0 @@
1
- "use strict";
2
- // =============================================================================
3
- // SESSION MANAGEMENT TYPES
4
- // =============================================================================
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.DEFAULT_SESSION_HINTS = exports.DEFAULT_CLEANUP_POLICY = exports.DEFAULT_SESSION_CONFIG = exports.SessionErrorCode = exports.SessionError = void 0;
7
- // =============================================================================
8
- // SESSION ERROR TYPES
9
- // =============================================================================
10
- /**
11
- * Session-related error types.
12
- */
13
- class SessionError extends Error {
14
- code;
15
- sessionId;
16
- details;
17
- constructor(message, code, sessionId, details) {
18
- super(message);
19
- this.code = code;
20
- this.sessionId = sessionId;
21
- this.details = details;
22
- this.name = 'SessionError';
23
- }
24
- }
25
- exports.SessionError = SessionError;
26
- var SessionErrorCode;
27
- (function (SessionErrorCode) {
28
- SessionErrorCode["SESSION_NOT_FOUND"] = "SESSION_NOT_FOUND";
29
- SessionErrorCode["SESSION_EXPIRED"] = "SESSION_EXPIRED";
30
- SessionErrorCode["INVALID_SESSION_ID"] = "INVALID_SESSION_ID";
31
- SessionErrorCode["SESSION_ALREADY_EXISTS"] = "SESSION_ALREADY_EXISTS";
32
- SessionErrorCode["INVALID_UPDATE"] = "INVALID_UPDATE";
33
- SessionErrorCode["STORAGE_ERROR"] = "STORAGE_ERROR";
34
- SessionErrorCode["VALIDATION_ERROR"] = "VALIDATION_ERROR";
35
- SessionErrorCode["RESOURCE_EXHAUSTED"] = "RESOURCE_EXHAUSTED";
36
- SessionErrorCode["SECURITY_ERROR"] = "SECURITY_ERROR";
37
- })(SessionErrorCode || (exports.SessionErrorCode = SessionErrorCode = {}));
38
- // =============================================================================
39
- // DEFAULT CONFIGURATIONS
40
- // =============================================================================
41
- /**
42
- * Default session configuration.
43
- */
44
- exports.DEFAULT_SESSION_CONFIG = {
45
- memoryTTL: 2 * 60 * 60 * 1000, // 2 hours
46
- diskTTL: 24 * 60 * 60 * 1000, // 24 hours
47
- archiveTTL: 7 * 24 * 60 * 60 * 1000, // 7 days
48
- maxMemorySessions: 1000,
49
- maxDiskSessions: 10000,
50
- cleanupInterval: 15 * 60 * 1000, // 15 minutes
51
- adaptiveCleanup: true,
52
- security: {
53
- sessionIdLength: 32,
54
- useSecureRandom: true,
55
- hashSessionIds: true,
56
- maxContextSize: 1024 * 1024, // 1MB
57
- validateContext: true
58
- }
59
- };
60
- /**
61
- * Default cleanup policy.
62
- */
63
- exports.DEFAULT_CLEANUP_POLICY = {
64
- memoryTTL: 2 * 60 * 60 * 1000, // 2 hours
65
- diskTTL: 24 * 60 * 60 * 1000, // 24 hours
66
- archiveTTL: 7 * 24 * 60 * 60 * 1000, // 7 days
67
- importanceMultiplier: {
68
- low: 0.5,
69
- medium: 1.0,
70
- high: 2.0,
71
- critical: 4.0
72
- },
73
- clientTypeMultiplier: {
74
- human: 1.0,
75
- agent: 1.5,
76
- scheduled: 2.0,
77
- test: 0.1
78
- },
79
- extendForProgress: true
80
- };
81
- /**
82
- * Default session hints.
83
- */
84
- exports.DEFAULT_SESSION_HINTS = {
85
- importance: 'medium',
86
- pauseExpected: false,
87
- clientType: 'human'
88
- };
89
- //# sourceMappingURL=session-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"session-types.js","sourceRoot":"","sources":["../../src/types/session-types.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,2BAA2B;AAC3B,gFAAgF;;;AA8bhF,gFAAgF;AAChF,sBAAsB;AACtB,gFAAgF;AAEhF;;GAEG;AACH,MAAa,YAAa,SAAQ,KAAK;IAGnB;IACA;IACA;IAJlB,YACE,OAAe,EACC,IAAsB,EACtB,SAAkB,EAClB,OAA6B;QAE7C,KAAK,CAAC,OAAO,CAAC,CAAC;QAJC,SAAI,GAAJ,IAAI,CAAkB;QACtB,cAAS,GAAT,SAAS,CAAS;QAClB,YAAO,GAAP,OAAO,CAAsB;QAG7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AAE,SAAS;IAC9C,oBAAoB,EAAE;QACpB,GAAG,EAAE,GAAG;QACR,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,GAAG;KACd;IACD,oBAAoB,EAAE;QACpB,KAAK,EAAE,GAAG;QACV,KAAK,EAAE,GAAG;QACV,SAAS,EAAE,GAAG;QACd,IAAI,EAAE,GAAG;KACV;IACD,iBAAiB,EAAE,IAAI;CACxB,CAAC;AAEF;;GAEG;AACU,QAAA,qBAAqB,GAAiB;IACjD,UAAU,EAAE,QAAQ;IACpB,aAAa,EAAE,KAAK;IACpB,UAAU,EAAE,OAAO;CACpB,CAAC"}
@@ -1,83 +0,0 @@
1
- {
2
- "id": "example-agent-role-workflow",
3
- "name": "Example Agent Role Workflow",
4
- "description": "Demonstrates agentRole functionality with a practical code review workflow",
5
- "version": "1.0.0",
6
- "preconditions": [
7
- "Code changes are ready for review",
8
- "All tests are passing"
9
- ],
10
- "clarificationPrompts": [
11
- "What type of code review is needed? (security, performance, style, functionality)",
12
- "Are there specific areas of concern?"
13
- ],
14
- "steps": [
15
- {
16
- "id": "initial-analysis",
17
- "title": "Initial Code Analysis",
18
- "prompt": "Please provide the code you'd like reviewed. Include any specific areas of concern or the type of review needed.",
19
- "agentRole": "You are an expert code reviewer with 10+ years of experience. Focus on identifying potential issues, security vulnerabilities, and opportunities for improvement. Be thorough but constructive in your feedback.",
20
- "guidance": [
21
- "Ask for the code to be reviewed",
22
- "Clarify the type of review needed",
23
- "Note any specific concerns mentioned"
24
- ],
25
- "askForFiles": true,
26
- "requireConfirmation": false
27
- },
28
- {
29
- "id": "security-review",
30
- "title": "Security Analysis",
31
- "prompt": "Based on the code provided, perform a comprehensive security review.",
32
- "agentRole": "You are a cybersecurity expert specializing in code security. Look for common vulnerabilities like SQL injection, XSS, authentication bypasses, data exposure, and insecure dependencies. Provide specific remediation steps for any issues found.",
33
- "guidance": [
34
- "Check for common security vulnerabilities",
35
- "Review authentication and authorization logic",
36
- "Examine data handling and validation",
37
- "Look for potential injection attacks"
38
- ]
39
- },
40
- {
41
- "id": "performance-review",
42
- "title": "Performance Analysis",
43
- "prompt": "Analyze the code for performance issues and optimization opportunities.",
44
- "agentRole": "You are a performance optimization specialist. Focus on algorithmic complexity, memory usage, database queries, caching opportunities, and scalability concerns. Suggest specific optimizations with measurable impact.",
45
- "guidance": [
46
- "Analyze algorithmic complexity",
47
- "Review database query efficiency",
48
- "Check for memory leaks or excessive allocations",
49
- "Identify caching opportunities"
50
- ]
51
- },
52
- {
53
- "id": "code-quality-review",
54
- "title": "Code Quality & Style Review",
55
- "prompt": "Review the code for quality, maintainability, and adherence to best practices.",
56
- "agentRole": "You are a senior software architect focused on code quality and maintainability. Evaluate code structure, naming conventions, documentation, error handling, and adherence to SOLID principles. Suggest improvements that enhance readability and maintainability.",
57
- "guidance": [
58
- "Check naming conventions and clarity",
59
- "Review code structure and organization",
60
- "Evaluate error handling patterns",
61
- "Assess documentation quality"
62
- ]
63
- },
64
- {
65
- "id": "final-recommendations",
66
- "title": "Final Recommendations",
67
- "prompt": "Provide a summary of findings and prioritized recommendations for improvement.",
68
- "agentRole": "You are a technical lead providing final recommendations. Synthesize all previous findings into actionable priorities. Categorize issues by severity (critical, high, medium, low) and provide a clear action plan with estimated effort for each recommendation.",
69
- "guidance": [
70
- "Summarize all findings from previous steps",
71
- "Prioritize issues by severity and impact",
72
- "Provide clear action items",
73
- "Estimate effort for each recommendation"
74
- ],
75
- "requireConfirmation": true
76
- }
77
- ],
78
- "metaGuidance": [
79
- "This workflow demonstrates how agentRole separates behavioral instructions from user-facing prompts",
80
- "Each step has specific agent expertise while maintaining clear user communication",
81
- "The agentRole field guides the AI's approach without cluttering the user interface"
82
- ]
83
- }