@covibes/zeroshot 5.3.0 → 5.4.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 (119) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +8 -385
  3. package/cli/index.js +108 -4615
  4. package/package.json +16 -125
  5. package/CHANGELOG.md +0 -537
  6. package/cli/commands/providers.js +0 -150
  7. package/cli/lib/first-run.js +0 -211
  8. package/cli/lib/update-checker.js +0 -281
  9. package/cli/message-formatter-utils.js +0 -75
  10. package/cli/message-formatters-normal.js +0 -253
  11. package/cli/message-formatters-watch.js +0 -181
  12. package/cluster-templates/base-templates/debug-workflow.json +0 -375
  13. package/cluster-templates/base-templates/full-workflow.json +0 -697
  14. package/cluster-templates/base-templates/single-worker.json +0 -63
  15. package/cluster-templates/base-templates/worker-validator.json +0 -152
  16. package/cluster-templates/conductor-bootstrap.json +0 -124
  17. package/docker/zeroshot-cluster/Dockerfile +0 -152
  18. package/docker/zeroshot-cluster/pre-baked-deps.json +0 -28
  19. package/lib/completion.js +0 -174
  20. package/lib/docker-config.js +0 -212
  21. package/lib/id-detector.js +0 -53
  22. package/lib/provider-detection.js +0 -59
  23. package/lib/provider-names.js +0 -56
  24. package/lib/settings.js +0 -405
  25. package/lib/stream-json-parser.js +0 -10
  26. package/scripts/fix-node-pty-permissions.js +0 -75
  27. package/scripts/record-demo.sh +0 -279
  28. package/scripts/test-install.sh +0 -40
  29. package/scripts/validate-templates.js +0 -100
  30. package/src/agent/agent-config.js +0 -193
  31. package/src/agent/agent-context-builder.js +0 -335
  32. package/src/agent/agent-hook-executor.js +0 -402
  33. package/src/agent/agent-lifecycle.js +0 -683
  34. package/src/agent/agent-stuck-detector.js +0 -256
  35. package/src/agent/agent-task-executor.js +0 -1431
  36. package/src/agent/agent-trigger-evaluator.js +0 -67
  37. package/src/agent/output-extraction.js +0 -200
  38. package/src/agent/output-reformatter.js +0 -175
  39. package/src/agent/schema-utils.js +0 -111
  40. package/src/agent-wrapper.js +0 -570
  41. package/src/agents/git-pusher-agent.json +0 -20
  42. package/src/attach/attach-client.js +0 -438
  43. package/src/attach/attach-server.js +0 -543
  44. package/src/attach/index.js +0 -35
  45. package/src/attach/protocol.js +0 -220
  46. package/src/attach/ring-buffer.js +0 -121
  47. package/src/attach/socket-discovery.js +0 -267
  48. package/src/claude-task-runner.js +0 -523
  49. package/src/config-router.js +0 -80
  50. package/src/config-validator.js +0 -1660
  51. package/src/copy-worker.js +0 -43
  52. package/src/github.js +0 -139
  53. package/src/isolation-manager.js +0 -1381
  54. package/src/ledger.js +0 -614
  55. package/src/logic-engine.js +0 -223
  56. package/src/message-bus-bridge.js +0 -139
  57. package/src/message-bus.js +0 -249
  58. package/src/name-generator.js +0 -232
  59. package/src/orchestrator.js +0 -2519
  60. package/src/preflight.js +0 -485
  61. package/src/process-metrics.js +0 -566
  62. package/src/providers/anthropic/cli-builder.js +0 -45
  63. package/src/providers/anthropic/index.js +0 -134
  64. package/src/providers/anthropic/models.js +0 -23
  65. package/src/providers/anthropic/output-parser.js +0 -159
  66. package/src/providers/base-provider.js +0 -181
  67. package/src/providers/capabilities.js +0 -51
  68. package/src/providers/google/cli-builder.js +0 -55
  69. package/src/providers/google/index.js +0 -116
  70. package/src/providers/google/models.js +0 -24
  71. package/src/providers/google/output-parser.js +0 -92
  72. package/src/providers/index.js +0 -75
  73. package/src/providers/openai/cli-builder.js +0 -122
  74. package/src/providers/openai/index.js +0 -135
  75. package/src/providers/openai/models.js +0 -21
  76. package/src/providers/openai/output-parser.js +0 -129
  77. package/src/schemas/sub-cluster.js +0 -156
  78. package/src/status-footer.js +0 -980
  79. package/src/sub-cluster-wrapper.js +0 -560
  80. package/src/task-runner.js +0 -30
  81. package/src/template-resolver.js +0 -369
  82. package/src/tui/CHANGES.txt +0 -133
  83. package/src/tui/LAYOUT.md +0 -261
  84. package/src/tui/README.txt +0 -192
  85. package/src/tui/TWO-LEVEL-NAVIGATION.md +0 -186
  86. package/src/tui/data-poller.js +0 -325
  87. package/src/tui/demo.js +0 -208
  88. package/src/tui/formatters.js +0 -128
  89. package/src/tui/index.js +0 -193
  90. package/src/tui/keybindings.js +0 -383
  91. package/src/tui/layout.js +0 -334
  92. package/src/tui/renderer.js +0 -194
  93. package/task-lib/attachable-watcher.js +0 -272
  94. package/task-lib/claude-recovery.js +0 -119
  95. package/task-lib/commands/clean.js +0 -50
  96. package/task-lib/commands/get-log-path.js +0 -23
  97. package/task-lib/commands/kill.js +0 -32
  98. package/task-lib/commands/list.js +0 -105
  99. package/task-lib/commands/logs.js +0 -411
  100. package/task-lib/commands/resume.js +0 -42
  101. package/task-lib/commands/run.js +0 -57
  102. package/task-lib/commands/schedule.js +0 -105
  103. package/task-lib/commands/scheduler-cmd.js +0 -96
  104. package/task-lib/commands/schedules.js +0 -98
  105. package/task-lib/commands/status.js +0 -44
  106. package/task-lib/commands/unschedule.js +0 -16
  107. package/task-lib/completion.js +0 -9
  108. package/task-lib/config.js +0 -10
  109. package/task-lib/name-generator.js +0 -230
  110. package/task-lib/package.json +0 -3
  111. package/task-lib/runner.js +0 -144
  112. package/task-lib/scheduler.js +0 -252
  113. package/task-lib/store.js +0 -230
  114. package/task-lib/tui/formatters.js +0 -166
  115. package/task-lib/tui/index.js +0 -197
  116. package/task-lib/tui/layout.js +0 -111
  117. package/task-lib/tui/renderer.js +0 -119
  118. package/task-lib/tui.js +0 -384
  119. package/task-lib/watcher.js +0 -188
@@ -1,67 +0,0 @@
1
- /**
2
- * AgentTriggerEvaluator - Trigger matching and logic evaluation
3
- *
4
- * Provides:
5
- * - Trigger matching based on message topics
6
- * - Logic evaluation via LogicEngine
7
- * - Trigger action determination
8
- */
9
-
10
- /**
11
- * Find trigger matching the message topic
12
- * @param {Object} params - Evaluation parameters
13
- * @param {Array} params.triggers - Agent triggers configuration
14
- * @param {Object} params.message - Message to match against
15
- * @returns {Object|null} Matching trigger or null
16
- */
17
- function findMatchingTrigger({ triggers, message }) {
18
- if (!triggers) {
19
- return null;
20
- }
21
-
22
- return triggers.find((trigger) => {
23
- // Match exact topic or wildcard
24
- if (trigger.topic === '*' || trigger.topic === message.topic) {
25
- return true;
26
- }
27
- // Match topic prefix (e.g., "VALIDATION_*")
28
- if (trigger.topic.endsWith('*')) {
29
- const prefix = trigger.topic.slice(0, -1);
30
- return message.topic.startsWith(prefix);
31
- }
32
- return false;
33
- });
34
- }
35
-
36
- /**
37
- * Evaluate trigger logic
38
- * @param {Object} params - Evaluation parameters
39
- * @param {Object} params.trigger - Trigger to evaluate
40
- * @param {Object} params.message - Triggering message
41
- * @param {Object} params.agent - Agent context (id, role, iteration, cluster_id)
42
- * @param {Object} params.logicEngine - LogicEngine instance
43
- * @returns {boolean} Whether trigger logic passed
44
- */
45
- function evaluateTrigger({ trigger, message, agent, logicEngine }) {
46
- if (!trigger.logic || !trigger.logic.script) {
47
- return true; // No logic = always true
48
- }
49
-
50
- // NO TRY/CATCH - let errors propagate and crash
51
- return logicEngine.evaluate(trigger.logic.script, agent, message);
52
- }
53
-
54
- /**
55
- * Get trigger action type
56
- * @param {Object} trigger - Trigger object
57
- * @returns {string} Action type ('execute_task' or 'stop_cluster')
58
- */
59
- function getTriggerAction(trigger) {
60
- return trigger.action || 'execute_task';
61
- }
62
-
63
- module.exports = {
64
- findMatchingTrigger,
65
- evaluateTrigger,
66
- getTriggerAction,
67
- };
@@ -1,200 +0,0 @@
1
- /**
2
- * Output Extraction Module - Multi-Provider JSON Extraction
3
- *
4
- * Clean extraction pipeline for structured JSON from AI provider outputs.
5
- * Each provider has different output formats - this module normalizes them.
6
- *
7
- * Provider formats:
8
- * - Claude: {"type":"result","result":{...}} or {"type":"result","structured_output":{...}}
9
- * - Codex: Raw text in item.created events, turn.completed has NO result field
10
- * - Gemini: Raw text in message events, result event may have NO result field
11
- *
12
- * Extraction priority (most specific → least specific):
13
- * 1. Result wrapper with content (type:result + result/structured_output field)
14
- * 2. Accumulated text from provider parser events
15
- * 3. Markdown code block extraction
16
- * 4. Direct JSON parse of entire output
17
- */
18
-
19
- const { getProvider, parseChunkWithProvider } = require('../providers');
20
-
21
- /**
22
- * Strip timestamp prefix from log lines.
23
- * Format: [epochMs]content or [epochMs]{json...}
24
- *
25
- * @param {string} line - Raw log line
26
- * @returns {string} Content without timestamp prefix
27
- */
28
- function stripTimestamp(line) {
29
- if (!line || typeof line !== 'string') return '';
30
- const trimmed = line.trim().replace(/\r$/, '');
31
- if (!trimmed) return '';
32
- const match = trimmed.match(/^\[(\d{13})\](.*)$/);
33
- return match ? match[2] : trimmed;
34
- }
35
-
36
- /**
37
- * Strategy 1: Extract from result wrapper
38
- * Handles Claude CLI format: {"type":"result","result":{...}}
39
- *
40
- * @param {string} output - Raw output
41
- * @returns {object|null} Extracted JSON or null
42
- */
43
- function extractFromResultWrapper(output) {
44
- const lines = output.split('\n');
45
-
46
- for (const line of lines) {
47
- const content = stripTimestamp(line);
48
- if (!content.startsWith('{')) continue;
49
-
50
- try {
51
- const obj = JSON.parse(content);
52
-
53
- // Must be type:result WITH actual content
54
- if (obj.type !== 'result') continue;
55
-
56
- // Check structured_output first (standard CLI format)
57
- if (obj.structured_output && typeof obj.structured_output === 'object') {
58
- return obj.structured_output;
59
- }
60
-
61
- // Check result field - can be object or string
62
- if (obj.result) {
63
- if (typeof obj.result === 'object') {
64
- return obj.result;
65
- }
66
-
67
- // Result is string - might contain markdown-wrapped JSON
68
- if (typeof obj.result === 'string') {
69
- const extracted = extractFromMarkdown(obj.result) || extractDirectJson(obj.result);
70
- if (extracted) return extracted;
71
- }
72
- }
73
- } catch {
74
- // Not valid JSON, continue to next line
75
- }
76
- }
77
-
78
- return null;
79
- }
80
-
81
- /**
82
- * Strategy 2: Extract from accumulated text events
83
- * Handles non-Claude providers where JSON is in text content
84
- *
85
- * @param {string} output - Raw output
86
- * @param {string} providerName - Provider name for parser selection
87
- * @returns {object|null} Extracted JSON or null
88
- */
89
- function extractFromTextEvents(output, providerName) {
90
- const provider = getProvider(providerName);
91
- const events = parseChunkWithProvider(provider, output);
92
-
93
- // Accumulate all text events
94
- const textContent = events
95
- .filter((e) => e.type === 'text')
96
- .map((e) => e.text)
97
- .join('');
98
-
99
- if (!textContent.trim()) return null;
100
-
101
- // Try parsing accumulated text as JSON
102
- return extractDirectJson(textContent) || extractFromMarkdown(textContent);
103
- }
104
-
105
- /**
106
- * Strategy 3: Extract JSON from markdown code block
107
- * Handles: ```json\n{...}\n```
108
- *
109
- * @param {string} text - Text that may contain markdown
110
- * @returns {object|null} Extracted JSON or null
111
- */
112
- function extractFromMarkdown(text) {
113
- if (!text) return null;
114
-
115
- // Match ```json ... ``` with any whitespace
116
- const match = text.match(/```json\s*([\s\S]*?)```/);
117
- if (!match) return null;
118
-
119
- try {
120
- const parsed = JSON.parse(match[1].trim());
121
- if (typeof parsed === 'object' && parsed !== null) {
122
- return parsed;
123
- }
124
- } catch {
125
- // Invalid JSON in markdown block
126
- }
127
-
128
- return null;
129
- }
130
-
131
- /**
132
- * Strategy 4: Direct JSON parse
133
- * Handles raw JSON output (single-line or multi-line)
134
- *
135
- * @param {string} text - Text to parse
136
- * @returns {object|null} Parsed JSON or null
137
- */
138
- function extractDirectJson(text) {
139
- if (!text) return null;
140
-
141
- const trimmed = text.trim();
142
- if (!trimmed) return null;
143
-
144
- try {
145
- const parsed = JSON.parse(trimmed);
146
- if (typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed)) {
147
- return parsed;
148
- }
149
- } catch {
150
- // Not valid JSON
151
- }
152
-
153
- return null;
154
- }
155
-
156
- /**
157
- * Main extraction function - tries all strategies in priority order
158
- *
159
- * @param {string} output - Raw output from AI provider CLI
160
- * @param {string} providerName - Provider name ('claude', 'codex', 'gemini')
161
- * @returns {object|null} Extracted JSON object or null if extraction failed
162
- */
163
- function extractJsonFromOutput(output, providerName = 'claude') {
164
- if (!output || typeof output !== 'string') return null;
165
-
166
- const trimmedOutput = output.trim();
167
- if (!trimmedOutput) return null;
168
-
169
- // Check for fatal error indicators
170
- if (trimmedOutput.includes('Task not found') || trimmedOutput.includes('Process terminated')) {
171
- return null;
172
- }
173
-
174
- // Strategy 1: Result wrapper (Claude format)
175
- const fromWrapper = extractFromResultWrapper(trimmedOutput);
176
- if (fromWrapper) return fromWrapper;
177
-
178
- // Strategy 2: Text events (non-Claude providers)
179
- const fromText = extractFromTextEvents(trimmedOutput, providerName);
180
- if (fromText) return fromText;
181
-
182
- // Strategy 3: Markdown extraction
183
- const fromMarkdown = extractFromMarkdown(trimmedOutput);
184
- if (fromMarkdown) return fromMarkdown;
185
-
186
- // Strategy 4: Direct JSON parse (raw output)
187
- const fromDirect = extractDirectJson(trimmedOutput);
188
- if (fromDirect) return fromDirect;
189
-
190
- return null;
191
- }
192
-
193
- module.exports = {
194
- extractJsonFromOutput,
195
- extractFromResultWrapper,
196
- extractFromTextEvents,
197
- extractFromMarkdown,
198
- extractDirectJson,
199
- stripTimestamp,
200
- };
@@ -1,175 +0,0 @@
1
- /**
2
- * Output Reformatter - Convert non-JSON output to valid JSON
3
- *
4
- * When an LLM outputs markdown/text instead of JSON despite schema instructions,
5
- * this module attempts to extract/reformat the content into valid JSON.
6
- *
7
- * STATUS: SDK NOT IMPLEMENTED - Reformatting is not available.
8
- * This module exists for future extension when SDK support is added.
9
- *
10
- * To enable reformatting:
11
- * 1. Implement SDK support in the provider (getSDKEnvVar, callSimple)
12
- * 2. The reformatOutput() function will then work automatically
13
- */
14
-
15
- const DEFAULT_MAX_ATTEMPTS = 3;
16
-
17
- /**
18
- * Build the reformatting prompt
19
- *
20
- * @param {string} rawOutput - The non-JSON output to reformat
21
- * @param {Object} schema - Target JSON schema
22
- * @param {string|null} previousError - Error from previous attempt (for feedback)
23
- * @returns {string} The prompt for the reformatting model
24
- */
25
- function buildReformatPrompt(rawOutput, schema, previousError = null) {
26
- const schemaStr = JSON.stringify(schema, null, 2);
27
- // Truncate long outputs to avoid context limits
28
- const truncatedOutput = rawOutput.length > 4000 ? rawOutput.slice(-4000) : rawOutput;
29
-
30
- let prompt = `Convert this text into a JSON object matching the schema.
31
-
32
- ## SCHEMA
33
- \`\`\`json
34
- ${schemaStr}
35
- \`\`\`
36
-
37
- ## TEXT TO CONVERT
38
- \`\`\`
39
- ${truncatedOutput}
40
- \`\`\`
41
-
42
- ## RULES
43
- - Output ONLY the JSON object
44
- - NO markdown code blocks
45
- - NO explanations
46
- - Start with { end with }
47
- - Match ALL required fields from schema`;
48
-
49
- if (previousError) {
50
- prompt += `
51
-
52
- ## PREVIOUS ATTEMPT FAILED
53
- Error: ${previousError}
54
- Fix this issue in your response.`;
55
- }
56
-
57
- return prompt;
58
- }
59
-
60
- /**
61
- * Attempt to reformat non-JSON output into valid JSON
62
- *
63
- * STATUS: SDK NOT IMPLEMENTED - This function always throws.
64
- * When SDK support is added to providers, this will work automatically.
65
- *
66
- * @param {Object} options
67
- * @param {string} options.rawOutput - The non-JSON output to reformat
68
- * @param {Object} options.schema - Target JSON schema
69
- * @param {string} options.providerName - Provider name (claude, codex, gemini)
70
- * @param {number} [options.maxAttempts=3] - Maximum reformatting attempts
71
- * @param {Function} [options.onAttempt] - Callback for each attempt (attempt, error)
72
- * @returns {Promise<Object>} The reformatted JSON object
73
- * @throws {Error} Always throws - SDK not implemented
74
- */
75
- function reformatOutput({
76
- rawOutput,
77
- schema: _schema,
78
- providerName,
79
- maxAttempts: _maxAttempts = DEFAULT_MAX_ATTEMPTS,
80
- onAttempt: _onAttempt,
81
- }) {
82
- // SDK not implemented - reformatting not available
83
- // When SDK support is added, uncomment the implementation below
84
- return Promise.reject(
85
- new Error(
86
- `Output reformatting not available: SDK not implemented for provider "${providerName}". ` +
87
- `Agent output must be valid JSON. Raw output (last 200 chars): ${(rawOutput || '').slice(-200)}`
88
- )
89
- );
90
-
91
- // FUTURE: When SDK support is added to providers, uncomment this:
92
- /*
93
- const { getProvider } = require('../providers');
94
- const provider = getProvider(providerName);
95
-
96
- let lastError = null;
97
-
98
- for (let attempt = 1; attempt <= maxAttempts; attempt++) {
99
- if (onAttempt) {
100
- onAttempt(attempt, lastError);
101
- }
102
-
103
- const prompt = buildReformatPrompt(rawOutput, schema, lastError);
104
-
105
- try {
106
- const result = await provider.callSimple(prompt, {
107
- level: 'level1',
108
- maxTokens: 2000,
109
- });
110
-
111
- if (!result?.success) {
112
- lastError = result?.error || 'API call failed';
113
- continue;
114
- }
115
-
116
- if (!result?.text) {
117
- lastError = 'Empty response from reformatting model';
118
- continue;
119
- }
120
-
121
- const parsed = extractJsonFromOutput(result.text, providerName);
122
-
123
- if (!parsed) {
124
- lastError = 'Could not extract JSON from reformatted output';
125
- continue;
126
- }
127
-
128
- const validationError = validateAgainstSchema(parsed, schema);
129
- if (validationError) {
130
- lastError = validationError;
131
- continue;
132
- }
133
-
134
- return parsed;
135
- } catch (err) {
136
- lastError = err.message;
137
- }
138
- }
139
-
140
- throw new Error(
141
- `Failed to reformat output after ${maxAttempts} attempts. Last error: ${lastError}`
142
- );
143
- */
144
- }
145
-
146
- /**
147
- * Validate parsed output against JSON schema
148
- *
149
- * @param {Object} parsed - Parsed JSON object
150
- * @param {Object} schema - JSON schema to validate against
151
- * @returns {string|null} Error message if validation failed, null if valid
152
- */
153
- function validateAgainstSchema(parsed, schema) {
154
- const Ajv = require('ajv');
155
- const ajv = new Ajv({ allErrors: true, strict: false });
156
- const validate = ajv.compile(schema);
157
- const valid = validate(parsed);
158
-
159
- if (!valid) {
160
- const errors = (validate.errors || [])
161
- .slice(0, 3)
162
- .map((e) => `${e.instancePath || '#'} ${e.message}`)
163
- .join('; ');
164
- return errors || 'Schema validation failed';
165
- }
166
-
167
- return null;
168
- }
169
-
170
- module.exports = {
171
- reformatOutput,
172
- buildReformatPrompt,
173
- validateAgainstSchema,
174
- DEFAULT_MAX_ATTEMPTS,
175
- };
@@ -1,111 +0,0 @@
1
- /**
2
- * Schema utilities for normalizing LLM output before validation.
3
- *
4
- * PROBLEM: LLMs (Claude, Gemini, Codex) via any interface (CLI, API) may return
5
- * enum values that don't exactly match the schema (e.g., "simple" vs "SIMPLE").
6
- *
7
- * SOLUTION: Normalize enum values BEFORE validation. Provider-agnostic.
8
- */
9
-
10
- /**
11
- * Normalize enum values in parsed JSON to match schema definitions.
12
- *
13
- * Handles:
14
- * - Case mismatches: "simple" → "SIMPLE"
15
- * - Whitespace: " SIMPLE " → "SIMPLE"
16
- * - Common variations: "bug" → "DEBUG", "fix" → "DEBUG"
17
- *
18
- * @param {Object} result - Parsed JSON result from LLM
19
- * @param {Object} schema - JSON schema with enum definitions
20
- * @returns {Object} Normalized result (mutates and returns same object)
21
- */
22
- function normalizeEnumValues(result, schema) {
23
- if (!result || typeof result !== 'object' || !schema?.properties) {
24
- return result;
25
- }
26
-
27
- for (const [key, propSchema] of Object.entries(schema.properties)) {
28
- if (propSchema.enum && typeof result[key] === 'string') {
29
- let value = result[key].trim().toUpperCase();
30
-
31
- // DETECT: Model copied the enum list instead of choosing (e.g., "TRIVIAL|SIMPLE|STANDARD")
32
- if (value.includes('|')) {
33
- const parts = value.split('|').map((p) => p.trim());
34
- // Check if this looks like the enum list was copied verbatim
35
- const matchCount = parts.filter((p) => propSchema.enum.includes(p)).length;
36
- if (matchCount >= 2) {
37
- // Model copied the format - pick the first valid option and warn
38
- const firstValid = parts.find((p) => propSchema.enum.includes(p));
39
- if (firstValid) {
40
- console.warn(
41
- `⚠️ Model copied enum format instead of choosing. Field "${key}" had "${result[key]}", using "${firstValid}"`
42
- );
43
- value = firstValid;
44
- }
45
- }
46
- }
47
-
48
- // Find exact match (case-insensitive)
49
- const match = propSchema.enum.find((e) => e.toUpperCase() === value);
50
- if (match) {
51
- result[key] = match;
52
- continue;
53
- }
54
-
55
- // Common variations mapping
56
- const variations = {
57
- // taskType variations
58
- BUG: 'DEBUG',
59
- FIX: 'DEBUG',
60
- BUGFIX: 'DEBUG',
61
- BUG_FIX: 'DEBUG',
62
- INVESTIGATE: 'DEBUG',
63
- TROUBLESHOOT: 'DEBUG',
64
- IMPLEMENT: 'TASK',
65
- BUILD: 'TASK',
66
- CREATE: 'TASK',
67
- ADD: 'TASK',
68
- FEATURE: 'TASK',
69
- QUESTION: 'INQUIRY',
70
- ASK: 'INQUIRY',
71
- EXPLORE: 'INQUIRY',
72
- RESEARCH: 'INQUIRY',
73
- UNDERSTAND: 'INQUIRY',
74
- // complexity variations
75
- EASY: 'TRIVIAL',
76
- BASIC: 'SIMPLE',
77
- MINOR: 'SIMPLE',
78
- MODERATE: 'STANDARD',
79
- MEDIUM: 'STANDARD',
80
- NORMAL: 'STANDARD',
81
- HARD: 'STANDARD',
82
- COMPLEX: 'CRITICAL',
83
- RISKY: 'CRITICAL',
84
- HIGH_RISK: 'CRITICAL',
85
- DANGEROUS: 'CRITICAL',
86
- };
87
-
88
- if (variations[value] && propSchema.enum.includes(variations[value])) {
89
- result[key] = variations[value];
90
- }
91
- }
92
-
93
- // Recursively handle nested objects
94
- if (propSchema.type === 'object' && propSchema.properties && result[key]) {
95
- normalizeEnumValues(result[key], propSchema);
96
- }
97
-
98
- // Handle arrays of objects
99
- if (propSchema.type === 'array' && propSchema.items?.properties && Array.isArray(result[key])) {
100
- for (const item of result[key]) {
101
- normalizeEnumValues(item, propSchema.items);
102
- }
103
- }
104
- }
105
-
106
- return result;
107
- }
108
-
109
- module.exports = {
110
- normalizeEnumValues,
111
- };