@sylphx/flow 1.7.0 → 1.8.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.
Files changed (131) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/assets/agents/coder.md +72 -119
  3. package/assets/agents/orchestrator.md +26 -90
  4. package/assets/agents/reviewer.md +76 -47
  5. package/assets/agents/writer.md +82 -63
  6. package/assets/output-styles/silent.md +141 -8
  7. package/assets/rules/code-standards.md +9 -33
  8. package/assets/rules/core.md +67 -59
  9. package/package.json +2 -12
  10. package/src/commands/flow/execute.ts +470 -0
  11. package/src/commands/flow/index.ts +11 -0
  12. package/src/commands/flow/prompt.ts +35 -0
  13. package/src/commands/flow/setup.ts +312 -0
  14. package/src/commands/flow/targets.ts +18 -0
  15. package/src/commands/flow/types.ts +47 -0
  16. package/src/commands/flow-command.ts +18 -967
  17. package/src/commands/flow-orchestrator.ts +14 -5
  18. package/src/commands/hook-command.ts +1 -1
  19. package/src/commands/init-core.ts +12 -3
  20. package/src/commands/run-command.ts +1 -1
  21. package/src/config/rules.ts +1 -1
  22. package/src/core/error-handling.ts +1 -1
  23. package/src/core/loop-controller.ts +1 -1
  24. package/src/core/state-detector.ts +1 -1
  25. package/src/core/target-manager.ts +1 -1
  26. package/src/index.ts +1 -1
  27. package/src/shared/files/index.ts +1 -1
  28. package/src/shared/processing/index.ts +1 -1
  29. package/src/targets/claude-code.ts +3 -3
  30. package/src/targets/opencode.ts +3 -3
  31. package/src/utils/agent-enhancer.ts +2 -2
  32. package/src/utils/{mcp-config.ts → config/mcp-config.ts} +4 -4
  33. package/src/utils/{paths.ts → config/paths.ts} +1 -1
  34. package/src/utils/{settings.ts → config/settings.ts} +1 -1
  35. package/src/utils/{target-config.ts → config/target-config.ts} +5 -5
  36. package/src/utils/{target-utils.ts → config/target-utils.ts} +3 -3
  37. package/src/utils/display/banner.ts +25 -0
  38. package/src/utils/display/status.ts +55 -0
  39. package/src/utils/{file-operations.ts → files/file-operations.ts} +2 -2
  40. package/src/utils/files/jsonc.ts +36 -0
  41. package/src/utils/{sync-utils.ts → files/sync-utils.ts} +3 -3
  42. package/src/utils/index.ts +42 -61
  43. package/src/utils/version.ts +47 -0
  44. package/src/components/benchmark-monitor.tsx +0 -331
  45. package/src/components/reindex-progress.tsx +0 -261
  46. package/src/composables/functional/index.ts +0 -14
  47. package/src/composables/functional/useEnvironment.ts +0 -171
  48. package/src/composables/functional/useFileSystem.ts +0 -139
  49. package/src/composables/index.ts +0 -4
  50. package/src/composables/useEnv.ts +0 -13
  51. package/src/composables/useRuntimeConfig.ts +0 -27
  52. package/src/core/ai-sdk.ts +0 -603
  53. package/src/core/app-factory.ts +0 -381
  54. package/src/core/builtin-agents.ts +0 -9
  55. package/src/core/command-system.ts +0 -550
  56. package/src/core/config-system.ts +0 -550
  57. package/src/core/connection-pool.ts +0 -390
  58. package/src/core/di-container.ts +0 -155
  59. package/src/core/headless-display.ts +0 -96
  60. package/src/core/interfaces/index.ts +0 -22
  61. package/src/core/interfaces/repository.interface.ts +0 -91
  62. package/src/core/interfaces/service.interface.ts +0 -133
  63. package/src/core/interfaces.ts +0 -96
  64. package/src/core/result.ts +0 -351
  65. package/src/core/service-config.ts +0 -252
  66. package/src/core/session-service.ts +0 -121
  67. package/src/core/storage-factory.ts +0 -115
  68. package/src/core/stream-handler.ts +0 -288
  69. package/src/core/type-utils.ts +0 -427
  70. package/src/core/unified-storage.ts +0 -456
  71. package/src/core/validation/limit.ts +0 -46
  72. package/src/core/validation/query.ts +0 -20
  73. package/src/db/auto-migrate.ts +0 -322
  74. package/src/db/base-database-client.ts +0 -144
  75. package/src/db/cache-db.ts +0 -218
  76. package/src/db/cache-schema.ts +0 -75
  77. package/src/db/database.ts +0 -70
  78. package/src/db/index.ts +0 -252
  79. package/src/db/memory-db.ts +0 -153
  80. package/src/db/memory-schema.ts +0 -29
  81. package/src/db/schema.ts +0 -289
  82. package/src/db/session-repository.ts +0 -733
  83. package/src/domains/index.ts +0 -6
  84. package/src/domains/utilities/index.ts +0 -6
  85. package/src/domains/utilities/time/index.ts +0 -5
  86. package/src/domains/utilities/time/tools.ts +0 -291
  87. package/src/services/agent-service.ts +0 -273
  88. package/src/services/evaluation-service.ts +0 -271
  89. package/src/services/functional/evaluation-logic.ts +0 -296
  90. package/src/services/functional/file-processor.ts +0 -273
  91. package/src/services/functional/index.ts +0 -12
  92. package/src/services/memory.service.ts +0 -476
  93. package/src/types/api/batch.ts +0 -108
  94. package/src/types/api/errors.ts +0 -118
  95. package/src/types/api/index.ts +0 -55
  96. package/src/types/api/requests.ts +0 -76
  97. package/src/types/api/responses.ts +0 -180
  98. package/src/types/api/websockets.ts +0 -85
  99. package/src/types/benchmark.ts +0 -49
  100. package/src/types/database.types.ts +0 -510
  101. package/src/types/memory-types.ts +0 -63
  102. package/src/utils/advanced-tokenizer.ts +0 -191
  103. package/src/utils/ai-model-fetcher.ts +0 -19
  104. package/src/utils/async-file-operations.ts +0 -516
  105. package/src/utils/audio-player.ts +0 -345
  106. package/src/utils/codebase-helpers.ts +0 -211
  107. package/src/utils/console-ui.ts +0 -79
  108. package/src/utils/database-errors.ts +0 -140
  109. package/src/utils/debug-logger.ts +0 -49
  110. package/src/utils/file-scanner.ts +0 -259
  111. package/src/utils/help.ts +0 -20
  112. package/src/utils/immutable-cache.ts +0 -106
  113. package/src/utils/jsonc.ts +0 -158
  114. package/src/utils/memory-tui.ts +0 -414
  115. package/src/utils/models-dev.ts +0 -91
  116. package/src/utils/parallel-operations.ts +0 -487
  117. package/src/utils/process-manager.ts +0 -155
  118. package/src/utils/prompts.ts +0 -120
  119. package/src/utils/search-tool-builder.ts +0 -214
  120. package/src/utils/session-manager.ts +0 -168
  121. package/src/utils/session-title.ts +0 -87
  122. package/src/utils/simplified-errors.ts +0 -410
  123. package/src/utils/template-engine.ts +0 -94
  124. package/src/utils/test-audio.ts +0 -71
  125. package/src/utils/todo-context.ts +0 -46
  126. package/src/utils/token-counter.ts +0 -288
  127. /package/src/utils/{cli-output.ts → display/cli-output.ts} +0 -0
  128. /package/src/utils/{logger.ts → display/logger.ts} +0 -0
  129. /package/src/utils/{notifications.ts → display/notifications.ts} +0 -0
  130. /package/src/utils/{secret-utils.ts → security/secret-utils.ts} +0 -0
  131. /package/src/utils/{security.ts → security/security.ts} +0 -0
@@ -1,55 +0,0 @@
1
- /**
2
- * API types barrel export
3
- * Organized API-related types and interfaces
4
- */
5
-
6
- // Batch operation types
7
- export type {
8
- BatchApiResult,
9
- BatchOperationResult,
10
- } from './batch.js';
11
- export {
12
- BatchApiResultSchema,
13
- BatchOperationResultSchema,
14
- } from './batch.js';
15
-
16
- // Error types
17
- export type {
18
- ApiError,
19
- EnhancedError,
20
- ErrorContext,
21
- } from './errors.js';
22
-
23
- export {
24
- EnhancedErrorSchema,
25
- ErrorContextSchema,
26
- } from './errors.js';
27
-
28
- // Request types
29
- export type { HttpRequestConfig } from './requests.js';
30
-
31
- export { HttpRequestConfigSchema } from './requests.js';
32
- // Response types
33
- export type {
34
- ApiResponse,
35
- HttpResponse,
36
- PaginationInfo,
37
- RateLimitInfo,
38
- } from './responses.js';
39
- export {
40
- ApiResponseSchema,
41
- HttpResponseSchema,
42
- PaginationInfoSchema,
43
- RateLimitInfoSchema,
44
- } from './responses.js';
45
-
46
- // WebSocket types
47
- export type {
48
- WebSocketConnectionStatus,
49
- WebSocketMessage,
50
- } from './websockets.js';
51
-
52
- export {
53
- WebSocketConnectionStatusSchema,
54
- WebSocketMessageSchema,
55
- } from './websockets.js';
@@ -1,76 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- // ============================================================================
4
- // API REQUEST INTERFACES
5
- // ============================================================================
6
-
7
- /**
8
- * HTTP request configuration
9
- */
10
- export interface HttpRequestConfig {
11
- /** Request URL */
12
- url: string;
13
- /** HTTP method */
14
- method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
15
- /** Request headers */
16
- headers?: Record<string, string>;
17
- /** Request body */
18
- body?: unknown;
19
- /** Query parameters */
20
- params?: Record<string, string | number | boolean>;
21
- /** Request timeout in milliseconds */
22
- timeout?: number;
23
- /** Number of retry attempts */
24
- retries?: number;
25
- /** Retry delay in milliseconds */
26
- retryDelay?: number;
27
- /** Whether to validate SSL certificates */
28
- validateSSL?: boolean;
29
- /** Request ID for tracing */
30
- requestId?: string;
31
- /** User agent */
32
- userAgent?: string;
33
- /** Authentication token */
34
- token?: string;
35
- /** API key */
36
- apiKey?: string;
37
- /** Request metadata */
38
- metadata?: {
39
- /** Source of the request */
40
- source?: string;
41
- /** Request priority */
42
- priority?: 'low' | 'normal' | 'high';
43
- /** Request tags */
44
- tags?: string[];
45
- /** Custom metadata */
46
- data?: Record<string, unknown>;
47
- };
48
- }
49
-
50
- // ============================================================================
51
- // ZOD SCHEMAS
52
- // ============================================================================
53
-
54
- export const HttpRequestConfigSchema = z.object({
55
- url: z.string().url(),
56
- method: z.enum(['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS']),
57
- headers: z.record(z.string()).optional(),
58
- body: z.unknown().optional(),
59
- params: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),
60
- timeout: z.number().positive().optional(),
61
- retries: z.number().min(0).optional(),
62
- retryDelay: z.number().min(0).optional(),
63
- validateSSL: z.boolean().optional(),
64
- requestId: z.string().optional(),
65
- userAgent: z.string().optional(),
66
- token: z.string().optional(),
67
- apiKey: z.string().optional(),
68
- metadata: z
69
- .object({
70
- source: z.string().optional(),
71
- priority: z.enum(['low', 'normal', 'high']).optional(),
72
- tags: z.array(z.string()).optional(),
73
- data: z.record(z.unknown()).optional(),
74
- })
75
- .optional(),
76
- });
@@ -1,180 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- // ============================================================================
4
- // API RESPONSE INTERFACES
5
- // ============================================================================
6
-
7
- /**
8
- * Standard API response wrapper
9
- */
10
- export interface ApiResponse<T = unknown> {
11
- /** Response success status */
12
- success: boolean;
13
- /** Response data */
14
- data?: T;
15
- /** Response message */
16
- message?: string;
17
- /** Response metadata */
18
- metadata?: {
19
- /** Response timestamp */
20
- timestamp: string;
21
- /** Request ID for tracing */
22
- requestId?: string;
23
- /** API version */
24
- version?: string;
25
- /** Response time in milliseconds */
26
- responseTime?: number;
27
- /** Pagination information */
28
- pagination?: PaginationInfo;
29
- /** Rate limiting information */
30
- rateLimit?: RateLimitInfo;
31
- };
32
- /** Error information */
33
- error?: ApiError;
34
- }
35
-
36
- /**
37
- * HTTP response wrapper
38
- */
39
- export interface HttpResponse<T = unknown> {
40
- /** Response data */
41
- data: T;
42
- /** HTTP status code */
43
- status: number;
44
- /** HTTP status text */
45
- statusText: string;
46
- /** Response headers */
47
- headers: Record<string, string>;
48
- /** Response metadata */
49
- metadata?: {
50
- /** Response timestamp */
51
- timestamp: string;
52
- /** Request ID for tracing */
53
- requestId?: string;
54
- /** Response time in milliseconds */
55
- responseTime?: number;
56
- /** Response size in bytes */
57
- size?: number;
58
- /** Cached response indicator */
59
- fromCache?: boolean;
60
- };
61
- }
62
-
63
- /**
64
- * Pagination information
65
- */
66
- export interface PaginationInfo {
67
- /** Current page number */
68
- page: number;
69
- /** Items per page */
70
- limit: number;
71
- /** Total number of items */
72
- total: number;
73
- /** Total number of pages */
74
- totalPages: number;
75
- /** Whether there's a next page */
76
- hasNext: boolean;
77
- /** Whether there's a previous page */
78
- hasPrev: boolean;
79
- /** Next page cursor (for cursor-based pagination) */
80
- nextCursor?: string;
81
- /** Previous page cursor (for cursor-based pagination) */
82
- prevCursor?: string;
83
- }
84
-
85
- /**
86
- * Rate limiting information
87
- */
88
- export interface RateLimitInfo {
89
- /** Maximum requests allowed */
90
- limit: number;
91
- /** Remaining requests */
92
- remaining: number;
93
- /** Reset timestamp (Unix timestamp) */
94
- resetAt: number;
95
- /** Reset time in ISO format */
96
- resetTime?: string;
97
- /** Retry after seconds */
98
- retryAfter?: number;
99
- /** Request window in seconds */
100
- window?: number;
101
- }
102
-
103
- // ============================================================================
104
- // ZOD SCHEMAS
105
- // ============================================================================
106
-
107
- export const PaginationInfoSchema = z.object({
108
- page: z.number().min(1),
109
- limit: z.number().min(1).max(100),
110
- total: z.number().min(0),
111
- totalPages: z.number().min(0),
112
- hasNext: z.boolean(),
113
- hasPrev: z.boolean(),
114
- nextCursor: z.string().optional(),
115
- prevCursor: z.string().optional(),
116
- });
117
-
118
- export const RateLimitInfoSchema = z.object({
119
- limit: z.number().min(1),
120
- remaining: z.number().min(0),
121
- resetAt: z.number().min(0),
122
- resetTime: z.string().optional(),
123
- retryAfter: z.number().optional(),
124
- window: z.number().optional(),
125
- });
126
-
127
- export const ApiErrorSchema = z.object({
128
- code: z.string(),
129
- message: z.string(),
130
- statusCode: z.number().optional(),
131
- type: z.enum([
132
- 'validation',
133
- 'authentication',
134
- 'authorization',
135
- 'not_found',
136
- 'conflict',
137
- 'rate_limit',
138
- 'server_error',
139
- 'network',
140
- 'timeout',
141
- ]),
142
- description: z.string().optional(),
143
- fieldErrors: z.record(z.array(z.string())).optional(),
144
- stack: z.string().optional(),
145
- context: z.record(z.unknown()).optional(),
146
- suggestions: z.array(z.string()).optional(),
147
- });
148
-
149
- export const ApiResponseSchema = z.object({
150
- success: z.boolean(),
151
- data: z.unknown().optional(),
152
- message: z.string().optional(),
153
- metadata: z
154
- .object({
155
- timestamp: z.string(),
156
- requestId: z.string().optional(),
157
- version: z.string().optional(),
158
- responseTime: z.number().optional(),
159
- pagination: PaginationInfoSchema.optional(),
160
- rateLimit: RateLimitInfoSchema.optional(),
161
- })
162
- .optional(),
163
- error: ApiErrorSchema.optional(),
164
- });
165
-
166
- export const HttpResponseSchema = z.object({
167
- data: z.unknown(),
168
- status: z.number(),
169
- statusText: z.string(),
170
- headers: z.record(z.string()),
171
- metadata: z
172
- .object({
173
- timestamp: z.string(),
174
- requestId: z.string().optional(),
175
- responseTime: z.number().optional(),
176
- size: z.number().optional(),
177
- fromCache: z.boolean().optional(),
178
- })
179
- .optional(),
180
- });
@@ -1,85 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- // ============================================================================
4
- // WEBSOCKET INTERFACES
5
- // ============================================================================
6
-
7
- /**
8
- * WebSocket message structure
9
- */
10
- export interface WebSocketMessage<T = unknown> {
11
- /** Message type for routing */
12
- type: string;
13
- /** Message payload */
14
- payload: T;
15
- /** Message ID for correlation */
16
- id?: string;
17
- /** Timestamp when message was created */
18
- timestamp: string;
19
- /** Message metadata */
20
- metadata?: {
21
- /** Sender ID */
22
- senderId?: string;
23
- /** Recipient ID (for direct messages) */
24
- recipientId?: string;
25
- /** Room or channel ID */
26
- room?: string;
27
- /** Message version for compatibility */
28
- version?: string;
29
- /** Whether message requires acknowledgment */
30
- requiresAck?: boolean;
31
- /** Message priority */
32
- priority?: 'low' | 'normal' | 'high';
33
- };
34
- }
35
-
36
- /**
37
- * WebSocket connection status
38
- */
39
- export interface WebSocketConnectionStatus {
40
- /** Connection state */
41
- status: 'connecting' | 'connected' | 'disconnected' | 'error' | 'reconnecting';
42
- /** Connection ID */
43
- connectionId?: string;
44
- /** URL of connected server */
45
- url?: string;
46
- /** Connection timestamp */
47
- connectedAt?: string;
48
- /** Last activity timestamp */
49
- lastActivity?: string;
50
- /** Number of reconnection attempts */
51
- retryCount?: number;
52
- /** Connection error (if any) */
53
- error?: string;
54
- }
55
-
56
- // ============================================================================
57
- // ZOD SCHEMAS
58
- // ============================================================================
59
-
60
- export const WebSocketMessageSchema = z.object({
61
- type: z.string(),
62
- payload: z.unknown(),
63
- id: z.string().optional(),
64
- timestamp: z.string(),
65
- metadata: z
66
- .object({
67
- senderId: z.string().optional(),
68
- recipientId: z.string().optional(),
69
- room: z.string().optional(),
70
- version: z.string().optional(),
71
- requiresAck: z.boolean().optional(),
72
- priority: z.enum(['low', 'normal', 'high']).optional(),
73
- })
74
- .optional(),
75
- });
76
-
77
- export const WebSocketConnectionStatusSchema = z.object({
78
- status: z.enum(['connecting', 'connected', 'disconnected', 'error', 'reconnecting']),
79
- connectionId: z.string().optional(),
80
- url: z.string().optional(),
81
- connectedAt: z.string().optional(),
82
- lastActivity: z.string().optional(),
83
- retryCount: z.number().min(0).optional(),
84
- error: z.string().optional(),
85
- });
@@ -1,49 +0,0 @@
1
- export interface BenchmarkCommandOptions {
2
- agents?: string;
3
- task?: string;
4
- output?: string;
5
- context?: string;
6
- evaluate?: boolean;
7
- report?: string;
8
- concurrency?: number;
9
- delay?: number;
10
- timeout?: number;
11
- quiet?: boolean;
12
- }
13
-
14
- export type AgentStatus = 'idle' | 'running' | 'completed' | 'error';
15
-
16
- export interface AgentData {
17
- status: AgentStatus;
18
- output: string[];
19
- startTime?: number;
20
- endTime?: number;
21
- pid?: number;
22
- }
23
-
24
- export interface InitialInfo {
25
- agentCount: number;
26
- concurrency: number;
27
- delay: number;
28
- taskFile: string;
29
- outputDir: string;
30
- }
31
-
32
- export interface AgentWork {
33
- [key: string]: string;
34
- }
35
-
36
- export interface AgentTimings {
37
- [key: string]: {
38
- startTime?: number;
39
- endTime?: number;
40
- duration?: number;
41
- };
42
- }
43
-
44
- export interface TimingData {
45
- endTime: number;
46
- exitCode: number;
47
- stdoutLength: number;
48
- stderrLength: number;
49
- }