byterover-cli 1.2.0 → 1.3.0

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 (91) hide show
  1. package/README.md +87 -9
  2. package/dist/constants.d.ts +0 -5
  3. package/dist/constants.js +0 -5
  4. package/dist/core/domain/cipher/agent/agent-info.d.ts +17 -17
  5. package/dist/core/domain/cipher/llm/schemas.d.ts +14 -14
  6. package/dist/core/domain/cipher/session/session-metadata.d.ts +2 -2
  7. package/dist/core/domain/entities/agent.js +6 -6
  8. package/dist/core/domain/entities/connector-type.d.ts +2 -1
  9. package/dist/core/domain/entities/connector-type.js +2 -1
  10. package/dist/core/domain/transport/schemas.d.ts +66 -66
  11. package/dist/core/interfaces/cipher/i-chat-session.d.ts +3 -1
  12. package/dist/core/interfaces/connectors/i-connector.d.ts +2 -2
  13. package/dist/core/interfaces/i-file-service.d.ts +7 -0
  14. package/dist/infra/auth/oauth-service.d.ts +15 -0
  15. package/dist/infra/auth/oauth-service.js +38 -2
  16. package/dist/infra/cipher/agent/agent-schemas.d.ts +42 -42
  17. package/dist/infra/cipher/llm/context/context-manager.js +7 -9
  18. package/dist/infra/cipher/llm/internal-llm-service.d.ts +5 -1
  19. package/dist/infra/cipher/llm/internal-llm-service.js +57 -46
  20. package/dist/infra/cipher/session/chat-session.d.ts +3 -1
  21. package/dist/infra/cipher/session/chat-session.js +5 -3
  22. package/dist/infra/cipher/system-prompt/contributor-schemas.d.ts +8 -8
  23. package/dist/infra/cipher/system-prompt/schemas.d.ts +5 -5
  24. package/dist/infra/cipher/tools/implementations/task-tool.js +3 -3
  25. package/dist/infra/connectors/connector-manager.js +2 -0
  26. package/dist/infra/connectors/hook/hook-connector.d.ts +1 -1
  27. package/dist/infra/connectors/hook/hook-connector.js +3 -3
  28. package/dist/infra/connectors/mcp/mcp-connector.d.ts +1 -1
  29. package/dist/infra/connectors/mcp/mcp-connector.js +4 -4
  30. package/dist/infra/connectors/rules/rules-connector.d.ts +1 -1
  31. package/dist/infra/connectors/rules/rules-connector.js +4 -4
  32. package/dist/infra/connectors/shared/template-service.js +4 -0
  33. package/dist/infra/connectors/skill/index.d.ts +1 -0
  34. package/dist/infra/connectors/skill/index.js +1 -0
  35. package/dist/infra/connectors/skill/skill-connector-config.d.ts +45 -0
  36. package/dist/infra/connectors/skill/skill-connector-config.js +26 -0
  37. package/dist/infra/connectors/skill/skill-connector.d.ts +39 -0
  38. package/dist/infra/connectors/skill/skill-connector.js +160 -0
  39. package/dist/infra/connectors/skill/skill-content-loader.d.ts +18 -0
  40. package/dist/infra/connectors/skill/skill-content-loader.js +33 -0
  41. package/dist/infra/file/fs-file-service.d.ts +7 -0
  42. package/dist/infra/file/fs-file-service.js +15 -1
  43. package/dist/infra/mcp/tools/task-result-waiter.js +8 -0
  44. package/dist/infra/process/agent-worker.js +30 -14
  45. package/dist/infra/process/task-queue-manager.d.ts +23 -34
  46. package/dist/infra/process/task-queue-manager.js +57 -118
  47. package/dist/infra/process/transport-handlers.js +1 -7
  48. package/dist/infra/repl/commands/connectors-command.js +1 -1
  49. package/dist/infra/transport/socket-io-transport-client.d.ts +9 -0
  50. package/dist/infra/transport/socket-io-transport-client.js +21 -2
  51. package/dist/infra/usecase/connectors-use-case.js +8 -2
  52. package/dist/infra/usecase/init-use-case.js +1 -1
  53. package/dist/infra/usecase/reset-use-case.d.ts +1 -0
  54. package/dist/infra/usecase/reset-use-case.js +4 -1
  55. package/dist/{commands → oclif/commands}/curate.d.ts +1 -1
  56. package/dist/{commands → oclif/commands}/curate.js +6 -6
  57. package/dist/{commands → oclif/commands}/hook-prompt-submit.d.ts +1 -1
  58. package/dist/{commands → oclif/commands}/hook-prompt-submit.js +3 -3
  59. package/dist/{commands → oclif/commands}/main.js +10 -10
  60. package/dist/{commands → oclif/commands}/mcp.js +2 -2
  61. package/dist/{commands → oclif/commands}/query.d.ts +1 -1
  62. package/dist/{commands → oclif/commands}/query.js +6 -6
  63. package/dist/{commands → oclif/commands}/status.d.ts +1 -1
  64. package/dist/{commands → oclif/commands}/status.js +8 -8
  65. package/dist/{commands → oclif/commands}/watch.d.ts +3 -3
  66. package/dist/{commands → oclif/commands}/watch.js +6 -6
  67. package/dist/oclif/constants.d.ts +11 -0
  68. package/dist/oclif/constants.js +11 -0
  69. package/dist/{hooks → oclif/hooks}/prerun/validate-brv-config-version.d.ts +1 -1
  70. package/dist/{hooks → oclif/hooks}/prerun/validate-brv-config-version.js +2 -2
  71. package/dist/templates/sections/command-reference.md +5 -96
  72. package/dist/templates/sections/workflow.md +21 -16
  73. package/dist/templates/skill/SKILL.md +91 -0
  74. package/dist/templates/skill/TROUBLESHOOTING.md +50 -0
  75. package/dist/templates/skill/WORKFLOWS.md +229 -0
  76. package/dist/utils/type-guards.d.ts +11 -0
  77. package/dist/utils/type-guards.js +13 -0
  78. package/oclif.manifest.json +8 -1
  79. package/package.json +9 -9
  80. package/dist/infra/process/constants.d.ts +0 -1
  81. package/dist/infra/process/constants.js +0 -1
  82. /package/dist/{commands → oclif/commands}/main.d.ts +0 -0
  83. /package/dist/{commands → oclif/commands}/mcp.d.ts +0 -0
  84. /package/dist/{hooks → oclif/hooks}/command_not_found/handle-invalid-commands.d.ts +0 -0
  85. /package/dist/{hooks → oclif/hooks}/command_not_found/handle-invalid-commands.js +0 -0
  86. /package/dist/{hooks → oclif/hooks}/error/clean-errors.d.ts +0 -0
  87. /package/dist/{hooks → oclif/hooks}/error/clean-errors.js +0 -0
  88. /package/dist/{hooks → oclif/hooks}/init/update-notifier.d.ts +0 -0
  89. /package/dist/{hooks → oclif/hooks}/init/update-notifier.js +0 -0
  90. /package/dist/{hooks → oclif/hooks}/init/welcome.d.ts +0 -0
  91. /package/dist/{hooks → oclif/hooks}/init/welcome.js +0 -0
@@ -34,12 +34,12 @@ export declare const TodoItemSchema: z.ZodObject<{
34
34
  status: z.ZodEnum<["cancelled", "completed", "in_progress", "pending"]>;
35
35
  }, "strip", z.ZodTypeAny, {
36
36
  status: "cancelled" | "completed" | "in_progress" | "pending";
37
- activeForm: string;
38
37
  content: string;
38
+ activeForm: string;
39
39
  }, {
40
40
  status: "cancelled" | "completed" | "in_progress" | "pending";
41
- activeForm: string;
42
41
  content: string;
42
+ activeForm: string;
43
43
  }>;
44
44
  export declare const ConversationResetPayloadSchema: z.ZodObject<{
45
45
  sessionId: z.ZodString;
@@ -54,14 +54,14 @@ export declare const ExecutionStartedPayloadSchema: z.ZodObject<{
54
54
  sessionId: z.ZodString;
55
55
  startTime: z.ZodDate;
56
56
  }, "strip", z.ZodTypeAny, {
57
- sessionId: string;
58
57
  maxIterations: number;
59
58
  startTime: Date;
59
+ sessionId: string;
60
60
  maxTimeMs?: number | undefined;
61
61
  }, {
62
- sessionId: string;
63
62
  maxIterations: number;
64
63
  startTime: Date;
64
+ sessionId: string;
65
65
  maxTimeMs?: number | undefined;
66
66
  }>;
67
67
  export declare const ExecutionTerminatedPayloadSchema: z.ZodObject<{
@@ -73,19 +73,19 @@ export declare const ExecutionTerminatedPayloadSchema: z.ZodObject<{
73
73
  toolCallsExecuted: z.ZodNumber;
74
74
  turnCount: z.ZodNumber;
75
75
  }, "strip", z.ZodTypeAny, {
76
- sessionId: string;
77
- endTime: Date;
78
- reason: "TIMEOUT" | "ABORTED" | "ERROR" | "GOAL" | "MAX_TURNS" | "PROTOCOL_VIOLATION";
79
76
  toolCallsExecuted: number;
80
77
  turnCount: number;
78
+ reason: "ABORTED" | "ERROR" | "GOAL" | "MAX_TURNS" | "PROTOCOL_VIOLATION" | "TIMEOUT";
79
+ sessionId: string;
80
+ endTime: Date;
81
81
  error?: any;
82
82
  durationMs?: number | undefined;
83
83
  }, {
84
- sessionId: string;
85
- endTime: Date;
86
- reason: "TIMEOUT" | "ABORTED" | "ERROR" | "GOAL" | "MAX_TURNS" | "PROTOCOL_VIOLATION";
87
84
  toolCallsExecuted: number;
88
85
  turnCount: number;
86
+ reason: "ABORTED" | "ERROR" | "GOAL" | "MAX_TURNS" | "PROTOCOL_VIOLATION" | "TIMEOUT";
87
+ sessionId: string;
88
+ endTime: Date;
89
89
  error?: any;
90
90
  durationMs?: number | undefined;
91
91
  }>;
@@ -98,14 +98,14 @@ export declare const LogPayloadSchema: z.ZodObject<{
98
98
  }, "strip", z.ZodTypeAny, {
99
99
  message: string;
100
100
  level: "debug" | "error" | "info" | "warn";
101
- source?: string | undefined;
102
101
  sessionId?: string | undefined;
102
+ source?: string | undefined;
103
103
  context?: Record<string, unknown> | undefined;
104
104
  }, {
105
105
  message: string;
106
106
  level: "debug" | "error" | "info" | "warn";
107
- source?: string | undefined;
108
107
  sessionId?: string | undefined;
108
+ source?: string | undefined;
109
109
  context?: Record<string, unknown> | undefined;
110
110
  }>;
111
111
  export declare const StateChangedPayloadSchema: z.ZodObject<{
@@ -137,12 +137,12 @@ export declare const UIPayloadSchema: z.ZodObject<{
137
137
  sessionId: z.ZodOptional<z.ZodString>;
138
138
  type: z.ZodEnum<["banner", "help", "prompt", "response", "separator", "shutdown"]>;
139
139
  }, "strip", z.ZodTypeAny, {
140
- type: "banner" | "help" | "prompt" | "response" | "separator" | "shutdown";
140
+ type: "prompt" | "banner" | "help" | "response" | "separator" | "shutdown";
141
141
  message?: string | undefined;
142
142
  sessionId?: string | undefined;
143
143
  context?: Record<string, unknown> | undefined;
144
144
  }, {
145
- type: "banner" | "help" | "prompt" | "response" | "separator" | "shutdown";
145
+ type: "prompt" | "banner" | "help" | "response" | "separator" | "shutdown";
146
146
  message?: string | undefined;
147
147
  sessionId?: string | undefined;
148
148
  context?: Record<string, unknown> | undefined;
@@ -154,13 +154,13 @@ export declare const ChunkPayloadSchema: z.ZodObject<{
154
154
  type: z.ZodEnum<["reasoning", "text"]>;
155
155
  }, "strip", z.ZodTypeAny, {
156
156
  type: "reasoning" | "text";
157
- content: string;
158
157
  sessionId: string;
158
+ content: string;
159
159
  isComplete?: boolean | undefined;
160
160
  }, {
161
161
  type: "reasoning" | "text";
162
- content: string;
163
162
  sessionId: string;
163
+ content: string;
164
164
  isComplete?: boolean | undefined;
165
165
  }>;
166
166
  export declare const ErrorPayloadSchema: z.ZodObject<{
@@ -183,14 +183,14 @@ export declare const OutputTruncatedPayloadSchema: z.ZodObject<{
183
183
  toolName: z.ZodString;
184
184
  }, "strip", z.ZodTypeAny, {
185
185
  sessionId: string;
186
+ toolName: string;
186
187
  originalLength: number;
187
188
  savedToFile: string;
188
- toolName: string;
189
189
  }, {
190
190
  sessionId: string;
191
+ toolName: string;
191
192
  originalLength: number;
192
193
  savedToFile: string;
193
- toolName: string;
194
194
  }>;
195
195
  export declare const ResponsePayloadSchema: z.ZodObject<{
196
196
  content: z.ZodString;
@@ -213,24 +213,24 @@ export declare const ResponsePayloadSchema: z.ZodObject<{
213
213
  totalTokens: number;
214
214
  }>>;
215
215
  }, "strip", z.ZodTypeAny, {
216
- content: string;
217
216
  sessionId: string;
218
- reasoning?: string | undefined;
217
+ content: string;
219
218
  model?: string | undefined;
220
- partial?: boolean | undefined;
219
+ reasoning?: string | undefined;
221
220
  provider?: string | undefined;
221
+ partial?: boolean | undefined;
222
222
  tokenUsage?: {
223
223
  inputTokens: number;
224
224
  outputTokens: number;
225
225
  totalTokens: number;
226
226
  } | undefined;
227
227
  }, {
228
- content: string;
229
228
  sessionId: string;
230
- reasoning?: string | undefined;
229
+ content: string;
231
230
  model?: string | undefined;
232
- partial?: boolean | undefined;
231
+ reasoning?: string | undefined;
233
232
  provider?: string | undefined;
233
+ partial?: boolean | undefined;
234
234
  tokenUsage?: {
235
235
  inputTokens: number;
236
236
  outputTokens: number;
@@ -249,12 +249,12 @@ export declare const ThoughtPayloadSchema: z.ZodObject<{
249
249
  sessionId: z.ZodString;
250
250
  subject: z.ZodString;
251
251
  }, "strip", z.ZodTypeAny, {
252
- sessionId: string;
253
252
  description: string;
253
+ sessionId: string;
254
254
  subject: string;
255
255
  }, {
256
- sessionId: string;
257
256
  description: string;
257
+ sessionId: string;
258
258
  subject: string;
259
259
  }>;
260
260
  export declare const TodoUpdatedPayloadSchema: z.ZodObject<{
@@ -265,26 +265,26 @@ export declare const TodoUpdatedPayloadSchema: z.ZodObject<{
265
265
  status: z.ZodEnum<["cancelled", "completed", "in_progress", "pending"]>;
266
266
  }, "strip", z.ZodTypeAny, {
267
267
  status: "cancelled" | "completed" | "in_progress" | "pending";
268
- activeForm: string;
269
268
  content: string;
269
+ activeForm: string;
270
270
  }, {
271
271
  status: "cancelled" | "completed" | "in_progress" | "pending";
272
- activeForm: string;
273
272
  content: string;
273
+ activeForm: string;
274
274
  }>, "many">;
275
275
  }, "strip", z.ZodTypeAny, {
276
276
  sessionId: string;
277
277
  todos: {
278
278
  status: "cancelled" | "completed" | "in_progress" | "pending";
279
- activeForm: string;
280
279
  content: string;
280
+ activeForm: string;
281
281
  }[];
282
282
  }, {
283
283
  sessionId: string;
284
284
  todos: {
285
285
  status: "cancelled" | "completed" | "in_progress" | "pending";
286
- activeForm: string;
287
286
  content: string;
287
+ activeForm: string;
288
288
  }[];
289
289
  }>;
290
290
  export declare const ToolCallPayloadSchema: z.ZodObject<{
@@ -318,8 +318,8 @@ export declare const ToolResultPayloadSchema: z.ZodObject<{
318
318
  success: boolean;
319
319
  error?: string | undefined;
320
320
  callId?: string | undefined;
321
- errorType?: "CANCELLED" | "CONFIRMATION_REJECTED" | "EXECUTION_FAILED" | "INTERNAL_ERROR" | "INVALID_PARAM_TYPE" | "INVALID_PARAMS" | "MISSING_REQUIRED_PARAM" | "PARAM_VALIDATION_FAILED" | "PERMISSION_DENIED" | "PROVIDER_ERROR" | "TIMEOUT" | "TOOL_DISABLED" | "TOOL_NOT_FOUND" | undefined;
322
321
  metadata?: Record<string, unknown> | undefined;
322
+ errorType?: "TIMEOUT" | "CANCELLED" | "CONFIRMATION_REJECTED" | "EXECUTION_FAILED" | "INTERNAL_ERROR" | "INVALID_PARAM_TYPE" | "INVALID_PARAMS" | "MISSING_REQUIRED_PARAM" | "PARAM_VALIDATION_FAILED" | "PERMISSION_DENIED" | "PROVIDER_ERROR" | "TOOL_DISABLED" | "TOOL_NOT_FOUND" | undefined;
323
323
  result?: unknown;
324
324
  }, {
325
325
  sessionId: string;
@@ -327,19 +327,19 @@ export declare const ToolResultPayloadSchema: z.ZodObject<{
327
327
  success: boolean;
328
328
  error?: string | undefined;
329
329
  callId?: string | undefined;
330
- errorType?: "CANCELLED" | "CONFIRMATION_REJECTED" | "EXECUTION_FAILED" | "INTERNAL_ERROR" | "INVALID_PARAM_TYPE" | "INVALID_PARAMS" | "MISSING_REQUIRED_PARAM" | "PARAM_VALIDATION_FAILED" | "PERMISSION_DENIED" | "PROVIDER_ERROR" | "TIMEOUT" | "TOOL_DISABLED" | "TOOL_NOT_FOUND" | undefined;
331
330
  metadata?: Record<string, unknown> | undefined;
331
+ errorType?: "TIMEOUT" | "CANCELLED" | "CONFIRMATION_REJECTED" | "EXECUTION_FAILED" | "INTERNAL_ERROR" | "INVALID_PARAM_TYPE" | "INVALID_PARAMS" | "MISSING_REQUIRED_PARAM" | "PARAM_VALIDATION_FAILED" | "PERMISSION_DENIED" | "PROVIDER_ERROR" | "TOOL_DISABLED" | "TOOL_NOT_FOUND" | undefined;
332
332
  result?: unknown;
333
333
  }>;
334
334
  export declare const UnsupportedInputPayloadSchema: z.ZodObject<{
335
335
  reason: z.ZodString;
336
336
  sessionId: z.ZodString;
337
337
  }, "strip", z.ZodTypeAny, {
338
- sessionId: string;
339
338
  reason: string;
340
- }, {
341
339
  sessionId: string;
340
+ }, {
342
341
  reason: string;
342
+ sessionId: string;
343
343
  }>;
344
344
  export declare const WarningPayloadSchema: z.ZodObject<{
345
345
  message: z.ZodString;
@@ -464,19 +464,19 @@ export declare const TaskExecuteSchema: z.ZodObject<{
464
464
  /** Task type */
465
465
  type: z.ZodEnum<["curate", "query"]>;
466
466
  }, "strip", z.ZodTypeAny, {
467
+ clientId: string;
467
468
  type: "curate" | "query";
468
469
  content: string;
469
- clientId: string;
470
470
  taskId: string;
471
- clientCwd?: string | undefined;
472
471
  files?: string[] | undefined;
472
+ clientCwd?: string | undefined;
473
473
  }, {
474
+ clientId: string;
474
475
  type: "curate" | "query";
475
476
  content: string;
476
- clientId: string;
477
477
  taskId: string;
478
- clientCwd?: string | undefined;
479
478
  files?: string[] | undefined;
479
+ clientCwd?: string | undefined;
480
480
  }>;
481
481
  /**
482
482
  * task:cancel - Transport tells Agent to cancel a task
@@ -557,14 +557,14 @@ export declare const LlmChunkEventSchema: z.ZodObject<{
557
557
  type: z.ZodEnum<["reasoning", "text"]>;
558
558
  }, "strip", z.ZodTypeAny, {
559
559
  type: "reasoning" | "text";
560
- content: string;
561
560
  sessionId: string;
561
+ content: string;
562
562
  taskId: string;
563
563
  isComplete?: boolean | undefined;
564
564
  }, {
565
565
  type: "reasoning" | "text";
566
- content: string;
567
566
  sessionId: string;
567
+ content: string;
568
568
  taskId: string;
569
569
  isComplete?: boolean | undefined;
570
570
  }>;
@@ -589,12 +589,12 @@ export declare const LlmUnsupportedInputEventSchema: z.ZodObject<{
589
589
  sessionId: z.ZodString;
590
590
  taskId: z.ZodString;
591
591
  }, "strip", z.ZodTypeAny, {
592
- sessionId: string;
593
592
  reason: string;
593
+ sessionId: string;
594
594
  taskId: string;
595
595
  }, {
596
- sessionId: string;
597
596
  reason: string;
597
+ sessionId: string;
598
598
  taskId: string;
599
599
  }>;
600
600
  /**
@@ -626,14 +626,14 @@ export declare const TaskCreatedSchema: z.ZodObject<{
626
626
  type: "curate" | "query";
627
627
  content: string;
628
628
  taskId: string;
629
- clientCwd?: string | undefined;
630
629
  files?: string[] | undefined;
630
+ clientCwd?: string | undefined;
631
631
  }, {
632
632
  type: "curate" | "query";
633
633
  content: string;
634
634
  taskId: string;
635
- clientCwd?: string | undefined;
636
635
  files?: string[] | undefined;
636
+ clientCwd?: string | undefined;
637
637
  }>;
638
638
  /**
639
639
  * task:started - Agent begins processing the task
@@ -655,14 +655,14 @@ export declare const TaskStartedEventSchema: z.ZodObject<{
655
655
  taskId: string;
656
656
  type?: string | undefined;
657
657
  content?: string | undefined;
658
- clientCwd?: string | undefined;
659
658
  files?: string[] | undefined;
659
+ clientCwd?: string | undefined;
660
660
  }, {
661
661
  taskId: string;
662
662
  type?: string | undefined;
663
663
  content?: string | undefined;
664
- clientCwd?: string | undefined;
665
664
  files?: string[] | undefined;
665
+ clientCwd?: string | undefined;
666
666
  }>;
667
667
  /**
668
668
  * task:cancelled - Task was cancelled before completion
@@ -772,26 +772,26 @@ export declare const LlmResponseEventSchema: z.ZodObject<{
772
772
  totalTokens: number;
773
773
  }>>;
774
774
  }, "strip", z.ZodTypeAny, {
775
- content: string;
776
775
  sessionId: string;
776
+ content: string;
777
777
  taskId: string;
778
- reasoning?: string | undefined;
779
778
  model?: string | undefined;
780
- partial?: boolean | undefined;
779
+ reasoning?: string | undefined;
781
780
  provider?: string | undefined;
781
+ partial?: boolean | undefined;
782
782
  tokenUsage?: {
783
783
  inputTokens: number;
784
784
  outputTokens: number;
785
785
  totalTokens: number;
786
786
  } | undefined;
787
787
  }, {
788
- content: string;
789
788
  sessionId: string;
789
+ content: string;
790
790
  taskId: string;
791
- reasoning?: string | undefined;
792
791
  model?: string | undefined;
793
- partial?: boolean | undefined;
792
+ reasoning?: string | undefined;
794
793
  provider?: string | undefined;
794
+ partial?: boolean | undefined;
795
795
  tokenUsage?: {
796
796
  inputTokens: number;
797
797
  outputTokens: number;
@@ -842,8 +842,8 @@ export declare const LlmToolResultEventSchema: z.ZodObject<{
842
842
  taskId: string;
843
843
  error?: string | undefined;
844
844
  callId?: string | undefined;
845
- errorType?: "CANCELLED" | "CONFIRMATION_REJECTED" | "EXECUTION_FAILED" | "INTERNAL_ERROR" | "INVALID_PARAM_TYPE" | "INVALID_PARAMS" | "MISSING_REQUIRED_PARAM" | "PARAM_VALIDATION_FAILED" | "PERMISSION_DENIED" | "PROVIDER_ERROR" | "TIMEOUT" | "TOOL_DISABLED" | "TOOL_NOT_FOUND" | undefined;
846
845
  metadata?: Record<string, unknown> | undefined;
846
+ errorType?: "TIMEOUT" | "CANCELLED" | "CONFIRMATION_REJECTED" | "EXECUTION_FAILED" | "INTERNAL_ERROR" | "INVALID_PARAM_TYPE" | "INVALID_PARAMS" | "MISSING_REQUIRED_PARAM" | "PARAM_VALIDATION_FAILED" | "PERMISSION_DENIED" | "PROVIDER_ERROR" | "TOOL_DISABLED" | "TOOL_NOT_FOUND" | undefined;
847
847
  result?: unknown;
848
848
  }, {
849
849
  sessionId: string;
@@ -852,8 +852,8 @@ export declare const LlmToolResultEventSchema: z.ZodObject<{
852
852
  taskId: string;
853
853
  error?: string | undefined;
854
854
  callId?: string | undefined;
855
- errorType?: "CANCELLED" | "CONFIRMATION_REJECTED" | "EXECUTION_FAILED" | "INTERNAL_ERROR" | "INVALID_PARAM_TYPE" | "INVALID_PARAMS" | "MISSING_REQUIRED_PARAM" | "PARAM_VALIDATION_FAILED" | "PERMISSION_DENIED" | "PROVIDER_ERROR" | "TIMEOUT" | "TOOL_DISABLED" | "TOOL_NOT_FOUND" | undefined;
856
855
  metadata?: Record<string, unknown> | undefined;
856
+ errorType?: "TIMEOUT" | "CANCELLED" | "CONFIRMATION_REJECTED" | "EXECUTION_FAILED" | "INTERNAL_ERROR" | "INVALID_PARAM_TYPE" | "INVALID_PARAMS" | "MISSING_REQUIRED_PARAM" | "PARAM_VALIDATION_FAILED" | "PERMISSION_DENIED" | "PROVIDER_ERROR" | "TOOL_DISABLED" | "TOOL_NOT_FOUND" | undefined;
857
857
  result?: unknown;
858
858
  }>;
859
859
  export type TaskAck = z.infer<typeof TaskAckSchema>;
@@ -882,14 +882,14 @@ export declare const TaskCreateRequestSchema: z.ZodObject<{
882
882
  type: "curate" | "query";
883
883
  content: string;
884
884
  taskId: string;
885
- clientCwd?: string | undefined;
886
885
  files?: string[] | undefined;
886
+ clientCwd?: string | undefined;
887
887
  }, {
888
888
  type: "curate" | "query";
889
889
  content: string;
890
890
  taskId: string;
891
- clientCwd?: string | undefined;
892
891
  files?: string[] | undefined;
892
+ clientCwd?: string | undefined;
893
893
  }>;
894
894
  /**
895
895
  * Response after task creation
@@ -935,13 +935,13 @@ export declare const SessionInfoSchema: z.ZodObject<{
935
935
  lastActiveAt: z.ZodNumber;
936
936
  name: z.ZodOptional<z.ZodString>;
937
937
  }, "strip", z.ZodTypeAny, {
938
- createdAt: number;
939
938
  id: string;
939
+ createdAt: number;
940
940
  lastActiveAt: number;
941
941
  name?: string | undefined;
942
942
  }, {
943
- createdAt: number;
944
943
  id: string;
944
+ createdAt: number;
945
945
  lastActiveAt: number;
946
946
  name?: string | undefined;
947
947
  }>;
@@ -975,13 +975,13 @@ export declare const SessionInfoResponseSchema: z.ZodObject<{
975
975
  lastActiveAt: z.ZodNumber;
976
976
  name: z.ZodOptional<z.ZodString>;
977
977
  }, "strip", z.ZodTypeAny, {
978
- createdAt: number;
979
978
  id: string;
979
+ createdAt: number;
980
980
  lastActiveAt: number;
981
981
  name?: string | undefined;
982
982
  }, {
983
- createdAt: number;
984
983
  id: string;
984
+ createdAt: number;
985
985
  lastActiveAt: number;
986
986
  name?: string | undefined;
987
987
  }>;
@@ -1000,8 +1000,8 @@ export declare const SessionInfoResponseSchema: z.ZodObject<{
1000
1000
  }>;
1001
1001
  }, "strip", z.ZodTypeAny, {
1002
1002
  session: {
1003
- createdAt: number;
1004
1003
  id: string;
1004
+ createdAt: number;
1005
1005
  lastActiveAt: number;
1006
1006
  name?: string | undefined;
1007
1007
  };
@@ -1012,8 +1012,8 @@ export declare const SessionInfoResponseSchema: z.ZodObject<{
1012
1012
  };
1013
1013
  }, {
1014
1014
  session: {
1015
- createdAt: number;
1016
1015
  id: string;
1016
+ createdAt: number;
1017
1017
  lastActiveAt: number;
1018
1018
  name?: string | undefined;
1019
1019
  };
@@ -1037,27 +1037,27 @@ export declare const SessionListResponseSchema: z.ZodObject<{
1037
1037
  lastActiveAt: z.ZodNumber;
1038
1038
  name: z.ZodOptional<z.ZodString>;
1039
1039
  }, "strip", z.ZodTypeAny, {
1040
- createdAt: number;
1041
1040
  id: string;
1041
+ createdAt: number;
1042
1042
  lastActiveAt: number;
1043
1043
  name?: string | undefined;
1044
1044
  }, {
1045
- createdAt: number;
1046
1045
  id: string;
1046
+ createdAt: number;
1047
1047
  lastActiveAt: number;
1048
1048
  name?: string | undefined;
1049
1049
  }>, "many">;
1050
1050
  }, "strip", z.ZodTypeAny, {
1051
1051
  sessions: {
1052
- createdAt: number;
1053
1052
  id: string;
1053
+ createdAt: number;
1054
1054
  lastActiveAt: number;
1055
1055
  name?: string | undefined;
1056
1056
  }[];
1057
1057
  }, {
1058
1058
  sessions: {
1059
- createdAt: number;
1060
1059
  id: string;
1060
+ createdAt: number;
1061
1061
  lastActiveAt: number;
1062
1062
  name?: string | undefined;
1063
1063
  }[];
@@ -56,13 +56,15 @@ export interface IChatSession {
56
56
  * @param input - User message content
57
57
  * @param options - Optional execution options
58
58
  * @param options.executionContext - Optional execution context
59
- * @param options.taskId - Optional task ID for concurrent task isolation (included in all emitted events)
59
+ * @param options.taskId - Optional task ID for billing tracking and event correlation
60
+ * @param options.emitTaskId - Whether to include taskId in emitted events (default: true)
60
61
  * @returns Assistant response
61
62
  * @throws SessionCancelledError if operation is cancelled
62
63
  * @throws MaxIterationsExceededError if tool loop exceeds maximum iterations
63
64
  * @throws LLMError if LLM call fails
64
65
  */
65
66
  run(input: string, options?: {
67
+ emitTaskId?: boolean;
66
68
  executionContext?: ExecutionContext;
67
69
  taskId?: string;
68
70
  }): Promise<string>;
@@ -6,6 +6,8 @@ import type { ConnectorInstallResult, ConnectorStatus, ConnectorUninstallResult
6
6
  * Each connector type (rules, hook, mcp) has its own implementation.
7
7
  */
8
8
  export interface IConnector {
9
+ /** The type of this connector */
10
+ readonly connectorType: ConnectorType;
9
11
  /**
10
12
  * Get the path to the configuration/rule file for a specific agent.
11
13
  *
@@ -41,8 +43,6 @@ export interface IConnector {
41
43
  * @returns Status including installed state and config file existence
42
44
  */
43
45
  status(agent: Agent): Promise<ConnectorStatus>;
44
- /** The type of this connector */
45
- readonly type: ConnectorType;
46
46
  /**
47
47
  * Uninstall the connector for the specified agent.
48
48
  * Only removes BRV content, preserves user's other configurations.
@@ -22,6 +22,13 @@ export interface IFileService {
22
22
  * @returns A promise that resolves when the file has been deleted.
23
23
  */
24
24
  delete: (filePath: string) => Promise<void>;
25
+ /**
26
+ * Deletes a directory and all its contents recursively.
27
+ *
28
+ * @param dirPath The path to the directory to delete.
29
+ * @returns A promise that resolves when the directory has been deleted.
30
+ */
31
+ deleteDirectory: (dirPath: string) => Promise<void>;
25
32
  /**
26
33
  * Checks if a file exists at the specified path.
27
34
  *
@@ -1,6 +1,15 @@
1
1
  import { OAuthConfig } from '../../config/auth.config.js';
2
2
  import { OAuthTokenData } from '../../core/domain/entities/oauth-token-data.js';
3
3
  import { AuthorizationContext, IAuthService } from '../../core/interfaces/i-auth-service.js';
4
+ export declare const NETWORK_ERROR_CODE: {
5
+ readonly EAI_AGAIN: "EAI_AGAIN";
6
+ readonly ECONNABORTED: "ECONNABORTED";
7
+ readonly ECONNREFUSED: "ECONNREFUSED";
8
+ readonly ECONNRESET: "ECONNRESET";
9
+ readonly ENOTFOUND: "ENOTFOUND";
10
+ readonly ERR_NETWORK: "ERR_NETWORK";
11
+ readonly ETIMEDOUT: "ETIMEDOUT";
12
+ };
4
13
  /**
5
14
  * OAuth service implementation for handling OAuth authentication flows.
6
15
  */
@@ -40,6 +49,12 @@ export declare class OAuthService implements IAuthService {
40
49
  * @returns A random state string.
41
50
  */
42
51
  private generateState;
52
+ /**
53
+ * Returns a user-friendly error message for network-related errors.
54
+ * @param errorCode The Axios error code (e.g., ECONNREFUSED, ETIMEOUT, etc.).
55
+ * @returns A user-friendly error message.
56
+ */
57
+ private getNetworkErrorMessage;
43
58
  /**
44
59
  * Parses the token response from the OAuth server.
45
60
  * @param data The response data from the OAuth server.
@@ -3,6 +3,15 @@ import axios, { isAxiosError } from 'axios';
3
3
  import crypto from 'node:crypto';
4
4
  import { OAuthTokenData } from '../../core/domain/entities/oauth-token-data.js';
5
5
  import { AuthenticationError } from '../../core/domain/errors/auth-error.js';
6
+ export const NETWORK_ERROR_CODE = {
7
+ EAI_AGAIN: 'EAI_AGAIN',
8
+ ECONNABORTED: 'ECONNABORTED',
9
+ ECONNREFUSED: 'ECONNREFUSED',
10
+ ECONNRESET: 'ECONNRESET',
11
+ ENOTFOUND: 'ENOTFOUND',
12
+ ERR_NETWORK: 'ERR_NETWORK',
13
+ ETIMEDOUT: 'ETIMEDOUT'
14
+ };
6
15
  /**
7
16
  * OAuth service implementation for handling OAuth authentication flows.
8
17
  */
@@ -45,7 +54,7 @@ export class OAuthService {
45
54
  }
46
55
  catch (error) {
47
56
  if (isAxiosError(error)) {
48
- throw new AuthenticationError(error.response?.data?.error_description ?? 'Failed to exchange code for token', error.response?.data?.error);
57
+ throw new AuthenticationError(error.response?.data?.error_description ?? this.getNetworkErrorMessage(error.code), error.response?.data?.error ?? error.code);
49
58
  }
50
59
  throw error;
51
60
  }
@@ -87,7 +96,7 @@ export class OAuthService {
87
96
  }
88
97
  catch (error) {
89
98
  if (isAxiosError(error)) {
90
- throw new AuthenticationError(error.response?.data?.error_description ?? 'Failed to refresh token', error.response?.data?.error);
99
+ throw new AuthenticationError(error.response?.data?.error_description ?? this.getNetworkErrorMessage(error.code), error.response?.data?.error ?? error.code);
91
100
  }
92
101
  throw error;
93
102
  }
@@ -114,6 +123,33 @@ export class OAuthService {
114
123
  generateState() {
115
124
  return crypto.randomBytes(16).toString('base64url');
116
125
  }
126
+ /**
127
+ * Returns a user-friendly error message for network-related errors.
128
+ * @param errorCode The Axios error code (e.g., ECONNREFUSED, ETIMEOUT, etc.).
129
+ * @returns A user-friendly error message.
130
+ */
131
+ getNetworkErrorMessage(errorCode) {
132
+ switch (errorCode) {
133
+ case NETWORK_ERROR_CODE.EAI_AGAIN:
134
+ case NETWORK_ERROR_CODE.ENOTFOUND: {
135
+ return 'Unable to reach authentication server. Please check your internet connection.';
136
+ }
137
+ case NETWORK_ERROR_CODE.ECONNABORTED:
138
+ case NETWORK_ERROR_CODE.ETIMEDOUT: {
139
+ return 'Login timed out. Please check your internet connection and try again.';
140
+ }
141
+ case NETWORK_ERROR_CODE.ECONNREFUSED:
142
+ case NETWORK_ERROR_CODE.ECONNRESET: {
143
+ return 'Unable to reach authentication server. Please try again later.';
144
+ }
145
+ case NETWORK_ERROR_CODE.ERR_NETWORK: {
146
+ return 'Network error occurred. Please check your internet connection and try again.';
147
+ }
148
+ default: {
149
+ return 'Login failed. Please check your internet connection and try again.';
150
+ }
151
+ }
152
+ }
117
153
  /**
118
154
  * Parses the token response from the OAuth server.
119
155
  * @param data The response data from the OAuth server.