pm-orchestrator-runner 1.0.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.
- package/LICENSE +21 -0
- package/README.md +108 -0
- package/dist/cli/cli-interface.d.ts +150 -0
- package/dist/cli/cli-interface.d.ts.map +1 -0
- package/dist/cli/cli-interface.js +606 -0
- package/dist/cli/cli-interface.js.map +1 -0
- package/dist/cli/index.d.ts +13 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +243 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/llm-sentinel.d.ts +15 -0
- package/dist/cli/llm-sentinel.d.ts.map +1 -0
- package/dist/cli/llm-sentinel.js +184 -0
- package/dist/cli/llm-sentinel.js.map +1 -0
- package/dist/config/configuration-manager.d.ts +149 -0
- package/dist/config/configuration-manager.d.ts.map +1 -0
- package/dist/config/configuration-manager.js +241 -0
- package/dist/config/configuration-manager.js.map +1 -0
- package/dist/continuation/continuation-control-manager.d.ts +154 -0
- package/dist/continuation/continuation-control-manager.d.ts.map +1 -0
- package/dist/continuation/continuation-control-manager.js +303 -0
- package/dist/continuation/continuation-control-manager.js.map +1 -0
- package/dist/core/runner-core.d.ts +474 -0
- package/dist/core/runner-core.d.ts.map +1 -0
- package/dist/core/runner-core.js +1311 -0
- package/dist/core/runner-core.js.map +1 -0
- package/dist/errors/error-codes.d.ts +105 -0
- package/dist/errors/error-codes.d.ts.map +1 -0
- package/dist/errors/error-codes.js +198 -0
- package/dist/errors/error-codes.js.map +1 -0
- package/dist/errors/runner-error.d.ts +14 -0
- package/dist/errors/runner-error.d.ts.map +1 -0
- package/dist/errors/runner-error.js +33 -0
- package/dist/errors/runner-error.js.map +1 -0
- package/dist/evidence/evidence-manager.d.ts +112 -0
- package/dist/evidence/evidence-manager.d.ts.map +1 -0
- package/dist/evidence/evidence-manager.js +337 -0
- package/dist/evidence/evidence-manager.js.map +1 -0
- package/dist/executor/claude-code-executor.d.ts +136 -0
- package/dist/executor/claude-code-executor.d.ts.map +1 -0
- package/dist/executor/claude-code-executor.js +643 -0
- package/dist/executor/claude-code-executor.js.map +1 -0
- package/dist/executor/deterministic-executor.d.ts +40 -0
- package/dist/executor/deterministic-executor.d.ts.map +1 -0
- package/dist/executor/deterministic-executor.js +269 -0
- package/dist/executor/deterministic-executor.js.map +1 -0
- package/dist/lifecycle/lifecycle-controller.d.ts +270 -0
- package/dist/lifecycle/lifecycle-controller.d.ts.map +1 -0
- package/dist/lifecycle/lifecycle-controller.js +596 -0
- package/dist/lifecycle/lifecycle-controller.js.map +1 -0
- package/dist/limits/resource-limit-manager.d.ts +200 -0
- package/dist/limits/resource-limit-manager.d.ts.map +1 -0
- package/dist/limits/resource-limit-manager.js +376 -0
- package/dist/limits/resource-limit-manager.js.map +1 -0
- package/dist/locks/lock-manager.d.ts +116 -0
- package/dist/locks/lock-manager.d.ts.map +1 -0
- package/dist/locks/lock-manager.js +306 -0
- package/dist/locks/lock-manager.js.map +1 -0
- package/dist/logging/index.d.ts +8 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/logging/index.js +22 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/logging/sensitive-data-masker.d.ts +90 -0
- package/dist/logging/sensitive-data-masker.d.ts.map +1 -0
- package/dist/logging/sensitive-data-masker.js +228 -0
- package/dist/logging/sensitive-data-masker.js.map +1 -0
- package/dist/logging/task-log-manager.d.ts +215 -0
- package/dist/logging/task-log-manager.d.ts.map +1 -0
- package/dist/logging/task-log-manager.js +743 -0
- package/dist/logging/task-log-manager.js.map +1 -0
- package/dist/mediation/fail-closed-runner.d.ts +131 -0
- package/dist/mediation/fail-closed-runner.d.ts.map +1 -0
- package/dist/mediation/fail-closed-runner.js +245 -0
- package/dist/mediation/fail-closed-runner.js.map +1 -0
- package/dist/mediation/llm-client-with-evidence.d.ts +123 -0
- package/dist/mediation/llm-client-with-evidence.d.ts.map +1 -0
- package/dist/mediation/llm-client-with-evidence.js +245 -0
- package/dist/mediation/llm-client-with-evidence.js.map +1 -0
- package/dist/mediation/llm-client.d.ts +102 -0
- package/dist/mediation/llm-client.d.ts.map +1 -0
- package/dist/mediation/llm-client.js +206 -0
- package/dist/mediation/llm-client.js.map +1 -0
- package/dist/mediation/llm-evidence-manager.d.ts +108 -0
- package/dist/mediation/llm-evidence-manager.d.ts.map +1 -0
- package/dist/mediation/llm-evidence-manager.js +230 -0
- package/dist/mediation/llm-evidence-manager.js.map +1 -0
- package/dist/mediation/llm-mediation-layer.d.ts +175 -0
- package/dist/mediation/llm-mediation-layer.d.ts.map +1 -0
- package/dist/mediation/llm-mediation-layer.js +315 -0
- package/dist/mediation/llm-mediation-layer.js.map +1 -0
- package/dist/mediation/llm-sentinel.d.ts +107 -0
- package/dist/mediation/llm-sentinel.d.ts.map +1 -0
- package/dist/mediation/llm-sentinel.js +187 -0
- package/dist/mediation/llm-sentinel.js.map +1 -0
- package/dist/mediation/real-llm-mediation-layer.d.ts +104 -0
- package/dist/mediation/real-llm-mediation-layer.d.ts.map +1 -0
- package/dist/mediation/real-llm-mediation-layer.js +322 -0
- package/dist/mediation/real-llm-mediation-layer.js.map +1 -0
- package/dist/mediation/verdict-reporter.d.ts +61 -0
- package/dist/mediation/verdict-reporter.d.ts.map +1 -0
- package/dist/mediation/verdict-reporter.js +178 -0
- package/dist/mediation/verdict-reporter.js.map +1 -0
- package/dist/models/enums.d.ts +133 -0
- package/dist/models/enums.d.ts.map +1 -0
- package/dist/models/enums.js +201 -0
- package/dist/models/enums.js.map +1 -0
- package/dist/models/evidence.d.ts +60 -0
- package/dist/models/evidence.d.ts.map +1 -0
- package/dist/models/evidence.js +135 -0
- package/dist/models/evidence.js.map +1 -0
- package/dist/models/execution-result.d.ts +89 -0
- package/dist/models/execution-result.d.ts.map +1 -0
- package/dist/models/execution-result.js +197 -0
- package/dist/models/execution-result.js.map +1 -0
- package/dist/models/file-lock.d.ts +62 -0
- package/dist/models/file-lock.d.ts.map +1 -0
- package/dist/models/file-lock.js +133 -0
- package/dist/models/file-lock.js.map +1 -0
- package/dist/models/index.d.ts +12 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +91 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/repl/index.d.ts +7 -0
- package/dist/models/repl/index.d.ts.map +1 -0
- package/dist/models/repl/index.js +32 -0
- package/dist/models/repl/index.js.map +1 -0
- package/dist/models/repl/model-registry.d.ts +73 -0
- package/dist/models/repl/model-registry.d.ts.map +1 -0
- package/dist/models/repl/model-registry.js +116 -0
- package/dist/models/repl/model-registry.js.map +1 -0
- package/dist/models/repl/repl-state.d.ts +86 -0
- package/dist/models/repl/repl-state.d.ts.map +1 -0
- package/dist/models/repl/repl-state.js +152 -0
- package/dist/models/repl/repl-state.js.map +1 -0
- package/dist/models/repl/task-log.d.ts +247 -0
- package/dist/models/repl/task-log.d.ts.map +1 -0
- package/dist/models/repl/task-log.js +178 -0
- package/dist/models/repl/task-log.js.map +1 -0
- package/dist/models/session.d.ts +71 -0
- package/dist/models/session.d.ts.map +1 -0
- package/dist/models/session.js +140 -0
- package/dist/models/session.js.map +1 -0
- package/dist/models/supporting.d.ts +97 -0
- package/dist/models/supporting.d.ts.map +1 -0
- package/dist/models/supporting.js +208 -0
- package/dist/models/supporting.js.map +1 -0
- package/dist/models/task.d.ts +77 -0
- package/dist/models/task.d.ts.map +1 -0
- package/dist/models/task.js +170 -0
- package/dist/models/task.js.map +1 -0
- package/dist/output/output-control-manager.d.ts +217 -0
- package/dist/output/output-control-manager.d.ts.map +1 -0
- package/dist/output/output-control-manager.js +378 -0
- package/dist/output/output-control-manager.js.map +1 -0
- package/dist/pool/agent-pool.d.ts +284 -0
- package/dist/pool/agent-pool.d.ts.map +1 -0
- package/dist/pool/agent-pool.js +451 -0
- package/dist/pool/agent-pool.js.map +1 -0
- package/dist/repl/commands/index.d.ts +12 -0
- package/dist/repl/commands/index.d.ts.map +1 -0
- package/dist/repl/commands/index.js +26 -0
- package/dist/repl/commands/index.js.map +1 -0
- package/dist/repl/commands/init.d.ts +31 -0
- package/dist/repl/commands/init.d.ts.map +1 -0
- package/dist/repl/commands/init.js +234 -0
- package/dist/repl/commands/init.js.map +1 -0
- package/dist/repl/commands/keys.d.ts +63 -0
- package/dist/repl/commands/keys.d.ts.map +1 -0
- package/dist/repl/commands/keys.js +114 -0
- package/dist/repl/commands/keys.js.map +1 -0
- package/dist/repl/commands/logs.d.ts +91 -0
- package/dist/repl/commands/logs.d.ts.map +1 -0
- package/dist/repl/commands/logs.js +200 -0
- package/dist/repl/commands/logs.js.map +1 -0
- package/dist/repl/commands/model.d.ts +85 -0
- package/dist/repl/commands/model.d.ts.map +1 -0
- package/dist/repl/commands/model.js +225 -0
- package/dist/repl/commands/model.js.map +1 -0
- package/dist/repl/commands/models.d.ts +50 -0
- package/dist/repl/commands/models.d.ts.map +1 -0
- package/dist/repl/commands/models.js +180 -0
- package/dist/repl/commands/models.js.map +1 -0
- package/dist/repl/commands/provider.d.ts +79 -0
- package/dist/repl/commands/provider.d.ts.map +1 -0
- package/dist/repl/commands/provider.js +291 -0
- package/dist/repl/commands/provider.js.map +1 -0
- package/dist/repl/commands/session.d.ts +50 -0
- package/dist/repl/commands/session.d.ts.map +1 -0
- package/dist/repl/commands/session.js +152 -0
- package/dist/repl/commands/session.js.map +1 -0
- package/dist/repl/commands/status.d.ts +55 -0
- package/dist/repl/commands/status.d.ts.map +1 -0
- package/dist/repl/commands/status.js +182 -0
- package/dist/repl/commands/status.js.map +1 -0
- package/dist/repl/index.d.ts +6 -0
- package/dist/repl/index.d.ts.map +1 -0
- package/dist/repl/index.js +25 -0
- package/dist/repl/index.js.map +1 -0
- package/dist/repl/repl-interface.d.ts +371 -0
- package/dist/repl/repl-interface.d.ts.map +1 -0
- package/dist/repl/repl-interface.js +1214 -0
- package/dist/repl/repl-interface.js.map +1 -0
- package/dist/session/session-manager.d.ts +85 -0
- package/dist/session/session-manager.d.ts.map +1 -0
- package/dist/session/session-manager.js +217 -0
- package/dist/session/session-manager.js.map +1 -0
- package/dist/supervisor/executor-supervisor.d.ts +90 -0
- package/dist/supervisor/executor-supervisor.d.ts.map +1 -0
- package/dist/supervisor/executor-supervisor.js +223 -0
- package/dist/supervisor/executor-supervisor.js.map +1 -0
- package/dist/supervisor/index.d.ts +5 -0
- package/dist/supervisor/index.d.ts.map +1 -0
- package/dist/supervisor/index.js +9 -0
- package/dist/supervisor/index.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Models Index
|
|
4
|
+
* Re-exports all model definitions for convenient importing
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.addViolation = exports.validateExecutionResult = exports.createExecutionResult = exports.ExecutionResultValidationError = exports.isExpired = exports.extendLockExpiration = exports.isLockCompatible = exports.isLockHeldBy = exports.validateFileLock = exports.createFileLock = exports.FileLockValidationError = exports.verifyEvidenceHash = exports.addRawEvidenceRef = exports.markIntegrityValidated = exports.addArtifact = exports.validateEvidence = exports.createEvidence = exports.EvidenceValidationError = exports.approveDecomposition = exports.addTestRun = exports.addModifiedFile = exports.addEvidenceRef = exports.assignExecutor = exports.updateTaskStatus = exports.validateTask = exports.createTask = exports.TaskValidationError = exports.failSession = exports.completeSession = exports.updateSessionStatus = exports.updateSessionPhase = exports.validateSession = exports.createSession = exports.SessionValidationError = exports.SessionStatus = exports.isLastPhase = exports.isFirstPhase = exports.getAllPhases = exports.getPhaseIndex = exports.isValidPhaseTransition = exports.getNextPhase = exports.isTerminalStatus = exports.aggregateStatus = exports.getStatusPriority = exports.EvidenceType = exports.LockType = exports.LifecyclePhase = exports.Phase = exports.TaskStatus = exports.OverallStatus = void 0;
|
|
8
|
+
exports.hasInventoryIssues = exports.incrementEvidenceCount = exports.addRawEvidenceFile = exports.addIntegrityFailure = exports.addMissingEvidenceOperation = exports.validateEvidenceInventory = exports.createEvidenceInventory = exports.validateLimitViolation = exports.createLimitViolation = exports.validateTaskLimits = exports.createTaskLimits = exports.EvidenceInventoryValidationError = exports.LimitViolationValidationError = exports.TaskLimitsValidationError = exports.approveNextAction = exports.markSpeculativeLanguageDetected = exports.updateEvidenceInventory = exports.addIncompleteTaskReason = void 0;
|
|
9
|
+
// Enums
|
|
10
|
+
var enums_1 = require("./enums");
|
|
11
|
+
Object.defineProperty(exports, "OverallStatus", { enumerable: true, get: function () { return enums_1.OverallStatus; } });
|
|
12
|
+
Object.defineProperty(exports, "TaskStatus", { enumerable: true, get: function () { return enums_1.TaskStatus; } });
|
|
13
|
+
Object.defineProperty(exports, "Phase", { enumerable: true, get: function () { return enums_1.Phase; } });
|
|
14
|
+
Object.defineProperty(exports, "LifecyclePhase", { enumerable: true, get: function () { return enums_1.LifecyclePhase; } });
|
|
15
|
+
Object.defineProperty(exports, "LockType", { enumerable: true, get: function () { return enums_1.LockType; } });
|
|
16
|
+
Object.defineProperty(exports, "EvidenceType", { enumerable: true, get: function () { return enums_1.EvidenceType; } });
|
|
17
|
+
Object.defineProperty(exports, "getStatusPriority", { enumerable: true, get: function () { return enums_1.getStatusPriority; } });
|
|
18
|
+
Object.defineProperty(exports, "aggregateStatus", { enumerable: true, get: function () { return enums_1.aggregateStatus; } });
|
|
19
|
+
Object.defineProperty(exports, "isTerminalStatus", { enumerable: true, get: function () { return enums_1.isTerminalStatus; } });
|
|
20
|
+
Object.defineProperty(exports, "getNextPhase", { enumerable: true, get: function () { return enums_1.getNextPhase; } });
|
|
21
|
+
Object.defineProperty(exports, "isValidPhaseTransition", { enumerable: true, get: function () { return enums_1.isValidPhaseTransition; } });
|
|
22
|
+
Object.defineProperty(exports, "getPhaseIndex", { enumerable: true, get: function () { return enums_1.getPhaseIndex; } });
|
|
23
|
+
Object.defineProperty(exports, "getAllPhases", { enumerable: true, get: function () { return enums_1.getAllPhases; } });
|
|
24
|
+
Object.defineProperty(exports, "isFirstPhase", { enumerable: true, get: function () { return enums_1.isFirstPhase; } });
|
|
25
|
+
Object.defineProperty(exports, "isLastPhase", { enumerable: true, get: function () { return enums_1.isLastPhase; } });
|
|
26
|
+
// Session
|
|
27
|
+
var session_1 = require("./session");
|
|
28
|
+
Object.defineProperty(exports, "SessionStatus", { enumerable: true, get: function () { return session_1.SessionStatus; } });
|
|
29
|
+
Object.defineProperty(exports, "SessionValidationError", { enumerable: true, get: function () { return session_1.SessionValidationError; } });
|
|
30
|
+
Object.defineProperty(exports, "createSession", { enumerable: true, get: function () { return session_1.createSession; } });
|
|
31
|
+
Object.defineProperty(exports, "validateSession", { enumerable: true, get: function () { return session_1.validateSession; } });
|
|
32
|
+
Object.defineProperty(exports, "updateSessionPhase", { enumerable: true, get: function () { return session_1.updateSessionPhase; } });
|
|
33
|
+
Object.defineProperty(exports, "updateSessionStatus", { enumerable: true, get: function () { return session_1.updateSessionStatus; } });
|
|
34
|
+
Object.defineProperty(exports, "completeSession", { enumerable: true, get: function () { return session_1.completeSession; } });
|
|
35
|
+
Object.defineProperty(exports, "failSession", { enumerable: true, get: function () { return session_1.failSession; } });
|
|
36
|
+
// Task
|
|
37
|
+
var task_1 = require("./task");
|
|
38
|
+
Object.defineProperty(exports, "TaskValidationError", { enumerable: true, get: function () { return task_1.TaskValidationError; } });
|
|
39
|
+
Object.defineProperty(exports, "createTask", { enumerable: true, get: function () { return task_1.createTask; } });
|
|
40
|
+
Object.defineProperty(exports, "validateTask", { enumerable: true, get: function () { return task_1.validateTask; } });
|
|
41
|
+
Object.defineProperty(exports, "updateTaskStatus", { enumerable: true, get: function () { return task_1.updateTaskStatus; } });
|
|
42
|
+
Object.defineProperty(exports, "assignExecutor", { enumerable: true, get: function () { return task_1.assignExecutor; } });
|
|
43
|
+
Object.defineProperty(exports, "addEvidenceRef", { enumerable: true, get: function () { return task_1.addEvidenceRef; } });
|
|
44
|
+
Object.defineProperty(exports, "addModifiedFile", { enumerable: true, get: function () { return task_1.addModifiedFile; } });
|
|
45
|
+
Object.defineProperty(exports, "addTestRun", { enumerable: true, get: function () { return task_1.addTestRun; } });
|
|
46
|
+
Object.defineProperty(exports, "approveDecomposition", { enumerable: true, get: function () { return task_1.approveDecomposition; } });
|
|
47
|
+
// Evidence
|
|
48
|
+
var evidence_1 = require("./evidence");
|
|
49
|
+
Object.defineProperty(exports, "EvidenceValidationError", { enumerable: true, get: function () { return evidence_1.EvidenceValidationError; } });
|
|
50
|
+
Object.defineProperty(exports, "createEvidence", { enumerable: true, get: function () { return evidence_1.createEvidence; } });
|
|
51
|
+
Object.defineProperty(exports, "validateEvidence", { enumerable: true, get: function () { return evidence_1.validateEvidence; } });
|
|
52
|
+
Object.defineProperty(exports, "addArtifact", { enumerable: true, get: function () { return evidence_1.addArtifact; } });
|
|
53
|
+
Object.defineProperty(exports, "markIntegrityValidated", { enumerable: true, get: function () { return evidence_1.markIntegrityValidated; } });
|
|
54
|
+
Object.defineProperty(exports, "addRawEvidenceRef", { enumerable: true, get: function () { return evidence_1.addRawEvidenceRef; } });
|
|
55
|
+
Object.defineProperty(exports, "verifyEvidenceHash", { enumerable: true, get: function () { return evidence_1.verifyEvidenceHash; } });
|
|
56
|
+
// FileLock
|
|
57
|
+
var file_lock_1 = require("./file-lock");
|
|
58
|
+
Object.defineProperty(exports, "FileLockValidationError", { enumerable: true, get: function () { return file_lock_1.FileLockValidationError; } });
|
|
59
|
+
Object.defineProperty(exports, "createFileLock", { enumerable: true, get: function () { return file_lock_1.createFileLock; } });
|
|
60
|
+
Object.defineProperty(exports, "validateFileLock", { enumerable: true, get: function () { return file_lock_1.validateFileLock; } });
|
|
61
|
+
Object.defineProperty(exports, "isLockHeldBy", { enumerable: true, get: function () { return file_lock_1.isLockHeldBy; } });
|
|
62
|
+
Object.defineProperty(exports, "isLockCompatible", { enumerable: true, get: function () { return file_lock_1.isLockCompatible; } });
|
|
63
|
+
Object.defineProperty(exports, "extendLockExpiration", { enumerable: true, get: function () { return file_lock_1.extendLockExpiration; } });
|
|
64
|
+
Object.defineProperty(exports, "isExpired", { enumerable: true, get: function () { return file_lock_1.isExpired; } });
|
|
65
|
+
// ExecutionResult
|
|
66
|
+
var execution_result_1 = require("./execution-result");
|
|
67
|
+
Object.defineProperty(exports, "ExecutionResultValidationError", { enumerable: true, get: function () { return execution_result_1.ExecutionResultValidationError; } });
|
|
68
|
+
Object.defineProperty(exports, "createExecutionResult", { enumerable: true, get: function () { return execution_result_1.createExecutionResult; } });
|
|
69
|
+
Object.defineProperty(exports, "validateExecutionResult", { enumerable: true, get: function () { return execution_result_1.validateExecutionResult; } });
|
|
70
|
+
Object.defineProperty(exports, "addViolation", { enumerable: true, get: function () { return execution_result_1.addViolation; } });
|
|
71
|
+
Object.defineProperty(exports, "addIncompleteTaskReason", { enumerable: true, get: function () { return execution_result_1.addIncompleteTaskReason; } });
|
|
72
|
+
Object.defineProperty(exports, "updateEvidenceInventory", { enumerable: true, get: function () { return execution_result_1.updateEvidenceInventory; } });
|
|
73
|
+
Object.defineProperty(exports, "markSpeculativeLanguageDetected", { enumerable: true, get: function () { return execution_result_1.markSpeculativeLanguageDetected; } });
|
|
74
|
+
Object.defineProperty(exports, "approveNextAction", { enumerable: true, get: function () { return execution_result_1.approveNextAction; } });
|
|
75
|
+
// Supporting Structures
|
|
76
|
+
var supporting_1 = require("./supporting");
|
|
77
|
+
Object.defineProperty(exports, "TaskLimitsValidationError", { enumerable: true, get: function () { return supporting_1.TaskLimitsValidationError; } });
|
|
78
|
+
Object.defineProperty(exports, "LimitViolationValidationError", { enumerable: true, get: function () { return supporting_1.LimitViolationValidationError; } });
|
|
79
|
+
Object.defineProperty(exports, "EvidenceInventoryValidationError", { enumerable: true, get: function () { return supporting_1.EvidenceInventoryValidationError; } });
|
|
80
|
+
Object.defineProperty(exports, "createTaskLimits", { enumerable: true, get: function () { return supporting_1.createTaskLimits; } });
|
|
81
|
+
Object.defineProperty(exports, "validateTaskLimits", { enumerable: true, get: function () { return supporting_1.validateTaskLimits; } });
|
|
82
|
+
Object.defineProperty(exports, "createLimitViolation", { enumerable: true, get: function () { return supporting_1.createLimitViolation; } });
|
|
83
|
+
Object.defineProperty(exports, "validateLimitViolation", { enumerable: true, get: function () { return supporting_1.validateLimitViolation; } });
|
|
84
|
+
Object.defineProperty(exports, "createEvidenceInventory", { enumerable: true, get: function () { return supporting_1.createEvidenceInventory; } });
|
|
85
|
+
Object.defineProperty(exports, "validateEvidenceInventory", { enumerable: true, get: function () { return supporting_1.validateEvidenceInventory; } });
|
|
86
|
+
Object.defineProperty(exports, "addMissingEvidenceOperation", { enumerable: true, get: function () { return supporting_1.addMissingEvidenceOperation; } });
|
|
87
|
+
Object.defineProperty(exports, "addIntegrityFailure", { enumerable: true, get: function () { return supporting_1.addIntegrityFailure; } });
|
|
88
|
+
Object.defineProperty(exports, "addRawEvidenceFile", { enumerable: true, get: function () { return supporting_1.addRawEvidenceFile; } });
|
|
89
|
+
Object.defineProperty(exports, "incrementEvidenceCount", { enumerable: true, get: function () { return supporting_1.incrementEvidenceCount; } });
|
|
90
|
+
Object.defineProperty(exports, "hasInventoryIssues", { enumerable: true, get: function () { return supporting_1.hasInventoryIssues; } });
|
|
91
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,QAAQ;AACR,iCAkBiB;AAjBf,sGAAA,aAAa,OAAA;AACb,mGAAA,UAAU,OAAA;AACV,8FAAA,KAAK,OAAA;AACL,uGAAA,cAAc,OAAA;AACd,iGAAA,QAAQ,OAAA;AACR,qGAAA,YAAY,OAAA;AACZ,0GAAA,iBAAiB,OAAA;AACjB,wGAAA,eAAe,OAAA;AACf,yGAAA,gBAAgB,OAAA;AAChB,qGAAA,YAAY,OAAA;AACZ,+GAAA,sBAAsB,OAAA;AACtB,sGAAA,aAAa,OAAA;AACb,qGAAA,YAAY,OAAA;AACZ,qGAAA,YAAY,OAAA;AACZ,oGAAA,WA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zB,2HAAA,6BAA6B,OAAA;AAC7B,8HAAA,gCAAgC,OAAA;AAChC,8GAAA,gBAAgB,OAAA;AAChB,gHAAA,kBAAkB,OAAA;AAClB,kHAAA,oBAAoB,OAAA;AACpB,oHAAA,sBAAsB,OAAA;AACtB,qHAAA,uBAAuB,OAAA;AACvB,uHAAA,yBAAyB,OAAA;AACzB,yHAAA,2BAA2B,OAAA;AAC3B,iHAAA,mBAAmB,OAAA;AACnB,gHAAA,kBAAkB,OAAA;AAClB,oHAAA,sBAAsB,OAAA;AACtB,gHAAA,kBAAkB,OAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* REPL Models Index
|
|
3
|
+
*/
|
|
4
|
+
export { ReplState, INITIAL_REPL_STATE, VALID_PROVIDERS, Provider, validateProvider, validateModel, validateReplState, changeProvider, changeModel, } from './repl-state';
|
|
5
|
+
export { ModelInfo, ProviderInfo, PROVIDER_REGISTRY, OPENAI_MODELS, ANTHROPIC_MODELS, getModelsForProvider, getProviderInfo, getAllProviders, isValidModelForProvider, } from './model-registry';
|
|
6
|
+
export { VisibilityLevel, LogEventType, LogEventContent, LogEvent, TaskLogSummary, TaskLog, TaskLogEntry, TaskLogIndex, SUMMARY_VISIBLE_EVENTS, FULL_ONLY_EVENTS, getEventVisibility, createTaskLogIndex, createTaskLog, createLogEvent, addEventToTaskLog, filterEventsByVisibility, } from './task-log';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/repl/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,eAAe,EACf,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,cAAc,EACd,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* REPL Models Index
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.filterEventsByVisibility = exports.addEventToTaskLog = exports.createLogEvent = exports.createTaskLog = exports.createTaskLogIndex = exports.getEventVisibility = exports.FULL_ONLY_EVENTS = exports.SUMMARY_VISIBLE_EVENTS = exports.isValidModelForProvider = exports.getAllProviders = exports.getProviderInfo = exports.getModelsForProvider = exports.ANTHROPIC_MODELS = exports.OPENAI_MODELS = exports.PROVIDER_REGISTRY = exports.changeModel = exports.changeProvider = exports.validateReplState = exports.validateModel = exports.validateProvider = exports.VALID_PROVIDERS = exports.INITIAL_REPL_STATE = void 0;
|
|
7
|
+
var repl_state_1 = require("./repl-state");
|
|
8
|
+
Object.defineProperty(exports, "INITIAL_REPL_STATE", { enumerable: true, get: function () { return repl_state_1.INITIAL_REPL_STATE; } });
|
|
9
|
+
Object.defineProperty(exports, "VALID_PROVIDERS", { enumerable: true, get: function () { return repl_state_1.VALID_PROVIDERS; } });
|
|
10
|
+
Object.defineProperty(exports, "validateProvider", { enumerable: true, get: function () { return repl_state_1.validateProvider; } });
|
|
11
|
+
Object.defineProperty(exports, "validateModel", { enumerable: true, get: function () { return repl_state_1.validateModel; } });
|
|
12
|
+
Object.defineProperty(exports, "validateReplState", { enumerable: true, get: function () { return repl_state_1.validateReplState; } });
|
|
13
|
+
Object.defineProperty(exports, "changeProvider", { enumerable: true, get: function () { return repl_state_1.changeProvider; } });
|
|
14
|
+
Object.defineProperty(exports, "changeModel", { enumerable: true, get: function () { return repl_state_1.changeModel; } });
|
|
15
|
+
var model_registry_1 = require("./model-registry");
|
|
16
|
+
Object.defineProperty(exports, "PROVIDER_REGISTRY", { enumerable: true, get: function () { return model_registry_1.PROVIDER_REGISTRY; } });
|
|
17
|
+
Object.defineProperty(exports, "OPENAI_MODELS", { enumerable: true, get: function () { return model_registry_1.OPENAI_MODELS; } });
|
|
18
|
+
Object.defineProperty(exports, "ANTHROPIC_MODELS", { enumerable: true, get: function () { return model_registry_1.ANTHROPIC_MODELS; } });
|
|
19
|
+
Object.defineProperty(exports, "getModelsForProvider", { enumerable: true, get: function () { return model_registry_1.getModelsForProvider; } });
|
|
20
|
+
Object.defineProperty(exports, "getProviderInfo", { enumerable: true, get: function () { return model_registry_1.getProviderInfo; } });
|
|
21
|
+
Object.defineProperty(exports, "getAllProviders", { enumerable: true, get: function () { return model_registry_1.getAllProviders; } });
|
|
22
|
+
Object.defineProperty(exports, "isValidModelForProvider", { enumerable: true, get: function () { return model_registry_1.isValidModelForProvider; } });
|
|
23
|
+
var task_log_1 = require("./task-log");
|
|
24
|
+
Object.defineProperty(exports, "SUMMARY_VISIBLE_EVENTS", { enumerable: true, get: function () { return task_log_1.SUMMARY_VISIBLE_EVENTS; } });
|
|
25
|
+
Object.defineProperty(exports, "FULL_ONLY_EVENTS", { enumerable: true, get: function () { return task_log_1.FULL_ONLY_EVENTS; } });
|
|
26
|
+
Object.defineProperty(exports, "getEventVisibility", { enumerable: true, get: function () { return task_log_1.getEventVisibility; } });
|
|
27
|
+
Object.defineProperty(exports, "createTaskLogIndex", { enumerable: true, get: function () { return task_log_1.createTaskLogIndex; } });
|
|
28
|
+
Object.defineProperty(exports, "createTaskLog", { enumerable: true, get: function () { return task_log_1.createTaskLog; } });
|
|
29
|
+
Object.defineProperty(exports, "createLogEvent", { enumerable: true, get: function () { return task_log_1.createLogEvent; } });
|
|
30
|
+
Object.defineProperty(exports, "addEventToTaskLog", { enumerable: true, get: function () { return task_log_1.addEventToTaskLog; } });
|
|
31
|
+
Object.defineProperty(exports, "filterEventsByVisibility", { enumerable: true, get: function () { return task_log_1.filterEventsByVisibility; } });
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/repl/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,2CAUsB;AARpB,gHAAA,kBAAkB,OAAA;AAClB,6GAAA,eAAe,OAAA;AAEf,8GAAA,gBAAgB,OAAA;AAChB,2GAAA,aAAa,OAAA;AACb,+GAAA,iBAAiB,OAAA;AACjB,4GAAA,cAAc,OAAA;AACd,yGAAA,WAAW,OAAA;AAGb,mDAU0B;AAPxB,mHAAA,iBAAiB,OAAA;AACjB,+GAAA,aAAa,OAAA;AACb,kHAAA,gBAAgB,OAAA;AAChB,sHAAA,oBAAoB,OAAA;AACpB,iHAAA,eAAe,OAAA;AACf,iHAAA,eAAe,OAAA;AACf,yHAAA,uBAAuB,OAAA;AAGzB,uCAiBoB;AARlB,kHAAA,sBAAsB,OAAA;AACtB,4GAAA,gBAAgB,OAAA;AAChB,8GAAA,kBAAkB,OAAA;AAClB,8GAAA,kBAAkB,OAAA;AAClB,yGAAA,aAAa,OAAA;AACb,0GAAA,cAAc,OAAA;AACd,6GAAA,iBAAiB,OAAA;AACjB,oHAAA,wBAAwB,OAAA"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model Registry
|
|
3
|
+
*
|
|
4
|
+
* Per spec 12_LLM_PROVIDER_AND_MODELS.md Section 2:
|
|
5
|
+
* - OpenAI models with pricing
|
|
6
|
+
* - Anthropic models with pricing
|
|
7
|
+
* - claude-code does not have explicit models (delegated)
|
|
8
|
+
*/
|
|
9
|
+
import { Provider } from './repl-state';
|
|
10
|
+
/**
|
|
11
|
+
* Model information structure
|
|
12
|
+
*/
|
|
13
|
+
export interface ModelInfo {
|
|
14
|
+
id: string;
|
|
15
|
+
displayName: string;
|
|
16
|
+
inputPricePerMillion: number;
|
|
17
|
+
outputPricePerMillion: number;
|
|
18
|
+
contextSize: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Provider information structure
|
|
22
|
+
*/
|
|
23
|
+
export interface ProviderInfo {
|
|
24
|
+
id: Provider;
|
|
25
|
+
displayName: string;
|
|
26
|
+
description: string;
|
|
27
|
+
requiresApiKey: boolean;
|
|
28
|
+
envVariable: string | null;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Provider registry
|
|
32
|
+
* Per spec 12_LLM_PROVIDER_AND_MODELS.md Section 1.1
|
|
33
|
+
*/
|
|
34
|
+
export declare const PROVIDER_REGISTRY: Record<Provider, ProviderInfo>;
|
|
35
|
+
/**
|
|
36
|
+
* OpenAI models
|
|
37
|
+
* Per spec 12_LLM_PROVIDER_AND_MODELS.md Section 2.1
|
|
38
|
+
*/
|
|
39
|
+
export declare const OPENAI_MODELS: ModelInfo[];
|
|
40
|
+
/**
|
|
41
|
+
* Anthropic models
|
|
42
|
+
* Per spec 12_LLM_PROVIDER_AND_MODELS.md Section 2.1
|
|
43
|
+
*/
|
|
44
|
+
export declare const ANTHROPIC_MODELS: ModelInfo[];
|
|
45
|
+
/**
|
|
46
|
+
* Get models for a provider
|
|
47
|
+
*
|
|
48
|
+
* @param provider - Provider identifier
|
|
49
|
+
* @returns Array of available models (empty for claude-code)
|
|
50
|
+
*/
|
|
51
|
+
export declare function getModelsForProvider(provider: Provider): ModelInfo[];
|
|
52
|
+
/**
|
|
53
|
+
* Get provider info
|
|
54
|
+
*
|
|
55
|
+
* @param provider - Provider identifier
|
|
56
|
+
* @returns ProviderInfo or undefined
|
|
57
|
+
*/
|
|
58
|
+
export declare function getProviderInfo(provider: Provider): ProviderInfo | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Get all providers
|
|
61
|
+
*
|
|
62
|
+
* @returns Array of all provider infos
|
|
63
|
+
*/
|
|
64
|
+
export declare function getAllProviders(): ProviderInfo[];
|
|
65
|
+
/**
|
|
66
|
+
* Check if a model exists for a provider
|
|
67
|
+
*
|
|
68
|
+
* @param provider - Provider identifier
|
|
69
|
+
* @param modelId - Model identifier
|
|
70
|
+
* @returns true if model exists
|
|
71
|
+
*/
|
|
72
|
+
export declare function isValidModelForProvider(provider: Provider, modelId: string): boolean;
|
|
73
|
+
//# sourceMappingURL=model-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-registry.d.ts","sourceRoot":"","sources":["../../../src/models/repl/model-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,QAAQ,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,QAAQ,EAAE,YAAY,CAsB5D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,EASpC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,EAQvC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,EAAE,CAWpE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY,GAAG,SAAS,CAE5E;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,YAAY,EAAE,CAEhD;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAGpF"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Model Registry
|
|
4
|
+
*
|
|
5
|
+
* Per spec 12_LLM_PROVIDER_AND_MODELS.md Section 2:
|
|
6
|
+
* - OpenAI models with pricing
|
|
7
|
+
* - Anthropic models with pricing
|
|
8
|
+
* - claude-code does not have explicit models (delegated)
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.ANTHROPIC_MODELS = exports.OPENAI_MODELS = exports.PROVIDER_REGISTRY = void 0;
|
|
12
|
+
exports.getModelsForProvider = getModelsForProvider;
|
|
13
|
+
exports.getProviderInfo = getProviderInfo;
|
|
14
|
+
exports.getAllProviders = getAllProviders;
|
|
15
|
+
exports.isValidModelForProvider = isValidModelForProvider;
|
|
16
|
+
/**
|
|
17
|
+
* Provider registry
|
|
18
|
+
* Per spec 12_LLM_PROVIDER_AND_MODELS.md Section 1.1
|
|
19
|
+
*/
|
|
20
|
+
exports.PROVIDER_REGISTRY = {
|
|
21
|
+
'claude-code': {
|
|
22
|
+
id: 'claude-code',
|
|
23
|
+
displayName: 'Claude Code',
|
|
24
|
+
description: 'Claude Code Executor - recommended',
|
|
25
|
+
requiresApiKey: false,
|
|
26
|
+
envVariable: null,
|
|
27
|
+
},
|
|
28
|
+
'openai': {
|
|
29
|
+
id: 'openai',
|
|
30
|
+
displayName: 'OpenAI',
|
|
31
|
+
description: 'OpenAI API direct',
|
|
32
|
+
requiresApiKey: true,
|
|
33
|
+
envVariable: 'OPENAI_API_KEY',
|
|
34
|
+
},
|
|
35
|
+
'anthropic': {
|
|
36
|
+
id: 'anthropic',
|
|
37
|
+
displayName: 'Anthropic',
|
|
38
|
+
description: 'Anthropic API direct',
|
|
39
|
+
requiresApiKey: true,
|
|
40
|
+
envVariable: 'ANTHROPIC_API_KEY',
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* OpenAI models
|
|
45
|
+
* Per spec 12_LLM_PROVIDER_AND_MODELS.md Section 2.1
|
|
46
|
+
*/
|
|
47
|
+
exports.OPENAI_MODELS = [
|
|
48
|
+
{ id: 'gpt-4o', displayName: 'GPT-4o', inputPricePerMillion: 2.50, outputPricePerMillion: 10.00, contextSize: '128K' },
|
|
49
|
+
{ id: 'gpt-4o-mini', displayName: 'GPT-4o Mini', inputPricePerMillion: 0.15, outputPricePerMillion: 0.60, contextSize: '128K' },
|
|
50
|
+
{ id: 'gpt-4-turbo', displayName: 'GPT-4 Turbo', inputPricePerMillion: 10.00, outputPricePerMillion: 30.00, contextSize: '128K' },
|
|
51
|
+
{ id: 'gpt-4', displayName: 'GPT-4', inputPricePerMillion: 30.00, outputPricePerMillion: 60.00, contextSize: '8K' },
|
|
52
|
+
{ id: 'gpt-3.5-turbo', displayName: 'GPT-3.5 Turbo', inputPricePerMillion: 0.50, outputPricePerMillion: 1.50, contextSize: '16K' },
|
|
53
|
+
{ id: 'o1', displayName: 'o1', inputPricePerMillion: 15.00, outputPricePerMillion: 60.00, contextSize: '200K' },
|
|
54
|
+
{ id: 'o1-mini', displayName: 'o1 Mini', inputPricePerMillion: 3.00, outputPricePerMillion: 12.00, contextSize: '128K' },
|
|
55
|
+
{ id: 'o1-preview', displayName: 'o1 Preview', inputPricePerMillion: 15.00, outputPricePerMillion: 60.00, contextSize: '128K' },
|
|
56
|
+
];
|
|
57
|
+
/**
|
|
58
|
+
* Anthropic models
|
|
59
|
+
* Per spec 12_LLM_PROVIDER_AND_MODELS.md Section 2.1
|
|
60
|
+
*/
|
|
61
|
+
exports.ANTHROPIC_MODELS = [
|
|
62
|
+
{ id: 'claude-opus-4-20250514', displayName: 'Claude Opus 4', inputPricePerMillion: 15.00, outputPricePerMillion: 75.00, contextSize: '200K' },
|
|
63
|
+
{ id: 'claude-sonnet-4-20250514', displayName: 'Claude Sonnet 4', inputPricePerMillion: 3.00, outputPricePerMillion: 15.00, contextSize: '200K' },
|
|
64
|
+
{ id: 'claude-3-5-sonnet-20241022', displayName: 'Claude 3.5 Sonnet', inputPricePerMillion: 3.00, outputPricePerMillion: 15.00, contextSize: '200K' },
|
|
65
|
+
{ id: 'claude-3-5-haiku-20241022', displayName: 'Claude 3.5 Haiku', inputPricePerMillion: 0.80, outputPricePerMillion: 4.00, contextSize: '200K' },
|
|
66
|
+
{ id: 'claude-3-opus-20240229', displayName: 'Claude 3 Opus', inputPricePerMillion: 15.00, outputPricePerMillion: 75.00, contextSize: '200K' },
|
|
67
|
+
{ id: 'claude-3-sonnet-20240229', displayName: 'Claude 3 Sonnet', inputPricePerMillion: 3.00, outputPricePerMillion: 15.00, contextSize: '200K' },
|
|
68
|
+
{ id: 'claude-3-haiku-20240307', displayName: 'Claude 3 Haiku', inputPricePerMillion: 0.25, outputPricePerMillion: 1.25, contextSize: '200K' },
|
|
69
|
+
];
|
|
70
|
+
/**
|
|
71
|
+
* Get models for a provider
|
|
72
|
+
*
|
|
73
|
+
* @param provider - Provider identifier
|
|
74
|
+
* @returns Array of available models (empty for claude-code)
|
|
75
|
+
*/
|
|
76
|
+
function getModelsForProvider(provider) {
|
|
77
|
+
switch (provider) {
|
|
78
|
+
case 'openai':
|
|
79
|
+
return exports.OPENAI_MODELS;
|
|
80
|
+
case 'anthropic':
|
|
81
|
+
return exports.ANTHROPIC_MODELS;
|
|
82
|
+
case 'claude-code':
|
|
83
|
+
return []; // Claude Code manages models internally
|
|
84
|
+
default:
|
|
85
|
+
return [];
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Get provider info
|
|
90
|
+
*
|
|
91
|
+
* @param provider - Provider identifier
|
|
92
|
+
* @returns ProviderInfo or undefined
|
|
93
|
+
*/
|
|
94
|
+
function getProviderInfo(provider) {
|
|
95
|
+
return exports.PROVIDER_REGISTRY[provider];
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Get all providers
|
|
99
|
+
*
|
|
100
|
+
* @returns Array of all provider infos
|
|
101
|
+
*/
|
|
102
|
+
function getAllProviders() {
|
|
103
|
+
return Object.values(exports.PROVIDER_REGISTRY);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Check if a model exists for a provider
|
|
107
|
+
*
|
|
108
|
+
* @param provider - Provider identifier
|
|
109
|
+
* @param modelId - Model identifier
|
|
110
|
+
* @returns true if model exists
|
|
111
|
+
*/
|
|
112
|
+
function isValidModelForProvider(provider, modelId) {
|
|
113
|
+
const models = getModelsForProvider(provider);
|
|
114
|
+
return models.some(m => m.id === modelId);
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=model-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-registry.js","sourceRoot":"","sources":["../../../src/models/repl/model-registry.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAyFH,oDAWC;AAQD,0CAEC;AAOD,0CAEC;AASD,0DAGC;AAzGD;;;GAGG;AACU,QAAA,iBAAiB,GAAmC;IAC/D,aAAa,EAAE;QACb,EAAE,EAAE,aAAa;QACjB,WAAW,EAAE,aAAa;QAC1B,WAAW,EAAE,oCAAoC;QACjD,cAAc,EAAE,KAAK;QACrB,WAAW,EAAE,IAAI;KAClB;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,QAAQ;QACZ,WAAW,EAAE,QAAQ;QACrB,WAAW,EAAE,mBAAmB;QAChC,cAAc,EAAE,IAAI;QACpB,WAAW,EAAE,gBAA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K,QAAQ;YACX,OAAO,qBAAa,CAAC;QACvB,KAAK,WAAW;YACd,OAAO,wBAAgB,CAAC;QAC1B,KAAK,aAAa;YAChB,OAAO,EAAE,CAAC,CAAC,wCAAwC;QACrD;YACE,OAAO,EAAE,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,QAAkB;IAChD,OAAO,yBAAiB,CAAC,QAAQ,CAAC,CAAC;AACrC,CAAC;AAED;;;;GAIG;AACH,SAAgB,eAAe;IAC7B,OAAO,MAAM,CAAC,MAAM,CAAC,yBAAiB,CAAC,CAAC;AAC1C,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,uBAAuB,CAAC,QAAkB,EAAE,OAAe;IACzE,MAAM,MAAM,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ReplState - REPL Session State Model
|
|
3
|
+
*
|
|
4
|
+
* Per spec 05_DATA_MODELS.md:
|
|
5
|
+
* - selected_provider: "claude-code" | "openai" | "anthropic" | null
|
|
6
|
+
* - selected_model: string | null
|
|
7
|
+
* - updated_at: string (ISO 8601) | null
|
|
8
|
+
*
|
|
9
|
+
* Per spec 12_LLM_PROVIDER_AND_MODELS.md:
|
|
10
|
+
* - Valid providers: claude-code, openai, anthropic
|
|
11
|
+
* - claude-code: no API key required
|
|
12
|
+
* - openai/anthropic: API key required
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Valid provider identifiers
|
|
16
|
+
* Per spec 12_LLM_PROVIDER_AND_MODELS.md Section 1.1
|
|
17
|
+
*/
|
|
18
|
+
export declare const VALID_PROVIDERS: readonly ["claude-code", "openai", "anthropic"];
|
|
19
|
+
export type Provider = typeof VALID_PROVIDERS[number];
|
|
20
|
+
/**
|
|
21
|
+
* ReplState structure
|
|
22
|
+
* Per spec 05_DATA_MODELS.md Section "REPL State Structures"
|
|
23
|
+
*/
|
|
24
|
+
export interface ReplState {
|
|
25
|
+
selected_provider: Provider | null;
|
|
26
|
+
selected_model: string | null;
|
|
27
|
+
updated_at: string | null;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Initial ReplState value
|
|
31
|
+
* Per spec 10_REPL_UX.md L163-168
|
|
32
|
+
*/
|
|
33
|
+
export declare const INITIAL_REPL_STATE: ReplState;
|
|
34
|
+
/**
|
|
35
|
+
* Validate provider identifier
|
|
36
|
+
* Per spec 12_LLM_PROVIDER_AND_MODELS.md Section 1.2
|
|
37
|
+
*
|
|
38
|
+
* @param providerId - Provider identifier to validate
|
|
39
|
+
* @returns ValidationResult
|
|
40
|
+
*/
|
|
41
|
+
export declare function validateProvider(providerId: string | null | undefined): {
|
|
42
|
+
valid: boolean;
|
|
43
|
+
error?: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Validate model identifier
|
|
47
|
+
* Per spec 12_LLM_PROVIDER_AND_MODELS.md Section 5.2
|
|
48
|
+
*
|
|
49
|
+
* @param providerId - Provider identifier
|
|
50
|
+
* @param modelId - Model identifier to validate
|
|
51
|
+
* @returns ValidationResult
|
|
52
|
+
*/
|
|
53
|
+
export declare function validateModel(providerId: string | null, modelId: string | null | undefined): {
|
|
54
|
+
valid: boolean;
|
|
55
|
+
error?: string;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Validate ReplState structure
|
|
59
|
+
* Per spec 05_DATA_MODELS.md
|
|
60
|
+
*
|
|
61
|
+
* @param state - ReplState to validate
|
|
62
|
+
* @returns ValidationResult
|
|
63
|
+
*/
|
|
64
|
+
export declare function validateReplState(state: unknown): {
|
|
65
|
+
valid: boolean;
|
|
66
|
+
error?: string;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Create a new ReplState with provider change
|
|
70
|
+
* Per spec 12_LLM_PROVIDER_AND_MODELS.md Section 4.2:
|
|
71
|
+
* Provider change resets selected_model to null
|
|
72
|
+
*
|
|
73
|
+
* @param current - Current ReplState
|
|
74
|
+
* @param provider - New provider
|
|
75
|
+
* @returns Updated ReplState
|
|
76
|
+
*/
|
|
77
|
+
export declare function changeProvider(current: ReplState, provider: Provider): ReplState;
|
|
78
|
+
/**
|
|
79
|
+
* Create a new ReplState with model change
|
|
80
|
+
*
|
|
81
|
+
* @param current - Current ReplState
|
|
82
|
+
* @param model - New model
|
|
83
|
+
* @returns Updated ReplState
|
|
84
|
+
*/
|
|
85
|
+
export declare function changeModel(current: ReplState, model: string): ReplState;
|
|
86
|
+
//# sourceMappingURL=repl-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repl-state.d.ts","sourceRoot":"","sources":["../../../src/models/repl/repl-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;GAGG;AACH,eAAO,MAAM,eAAe,iDAAkD,CAAC;AAC/E,MAAM,MAAM,QAAQ,GAAG,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,iBAAiB,EAAE,QAAQ,GAAG,IAAI,CAAC;IACnC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAIhC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG;IACvE,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAoBA;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACjC;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAYpC;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG;IACjD,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAyCA;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAMhF;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAMxE"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ReplState - REPL Session State Model
|
|
4
|
+
*
|
|
5
|
+
* Per spec 05_DATA_MODELS.md:
|
|
6
|
+
* - selected_provider: "claude-code" | "openai" | "anthropic" | null
|
|
7
|
+
* - selected_model: string | null
|
|
8
|
+
* - updated_at: string (ISO 8601) | null
|
|
9
|
+
*
|
|
10
|
+
* Per spec 12_LLM_PROVIDER_AND_MODELS.md:
|
|
11
|
+
* - Valid providers: claude-code, openai, anthropic
|
|
12
|
+
* - claude-code: no API key required
|
|
13
|
+
* - openai/anthropic: API key required
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.INITIAL_REPL_STATE = exports.VALID_PROVIDERS = void 0;
|
|
17
|
+
exports.validateProvider = validateProvider;
|
|
18
|
+
exports.validateModel = validateModel;
|
|
19
|
+
exports.validateReplState = validateReplState;
|
|
20
|
+
exports.changeProvider = changeProvider;
|
|
21
|
+
exports.changeModel = changeModel;
|
|
22
|
+
/**
|
|
23
|
+
* Valid provider identifiers
|
|
24
|
+
* Per spec 12_LLM_PROVIDER_AND_MODELS.md Section 1.1
|
|
25
|
+
*/
|
|
26
|
+
exports.VALID_PROVIDERS = ['claude-code', 'openai', 'anthropic'];
|
|
27
|
+
/**
|
|
28
|
+
* Initial ReplState value
|
|
29
|
+
* Per spec 10_REPL_UX.md L163-168
|
|
30
|
+
*/
|
|
31
|
+
exports.INITIAL_REPL_STATE = {
|
|
32
|
+
selected_provider: null,
|
|
33
|
+
selected_model: null,
|
|
34
|
+
updated_at: null,
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Validate provider identifier
|
|
38
|
+
* Per spec 12_LLM_PROVIDER_AND_MODELS.md Section 1.2
|
|
39
|
+
*
|
|
40
|
+
* @param providerId - Provider identifier to validate
|
|
41
|
+
* @returns ValidationResult
|
|
42
|
+
*/
|
|
43
|
+
function validateProvider(providerId) {
|
|
44
|
+
if (providerId === null || providerId === undefined) {
|
|
45
|
+
return { valid: true }; // null is allowed (unset state)
|
|
46
|
+
}
|
|
47
|
+
if (typeof providerId !== 'string' || providerId.trim() === '') {
|
|
48
|
+
return { valid: false, error: 'Provider ID must be a non-empty string' };
|
|
49
|
+
}
|
|
50
|
+
// Per spec: Provider ID must match pattern [a-z0-9-]+
|
|
51
|
+
if (!/^[a-z0-9-]+$/.test(providerId)) {
|
|
52
|
+
return { valid: false, error: 'Provider ID must match pattern [a-z0-9-]+' };
|
|
53
|
+
}
|
|
54
|
+
if (!exports.VALID_PROVIDERS.includes(providerId)) {
|
|
55
|
+
const validList = exports.VALID_PROVIDERS.join(', ');
|
|
56
|
+
return { valid: false, error: 'Unknown provider: ' + providerId + '. Valid providers: ' + validList };
|
|
57
|
+
}
|
|
58
|
+
return { valid: true };
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Validate model identifier
|
|
62
|
+
* Per spec 12_LLM_PROVIDER_AND_MODELS.md Section 5.2
|
|
63
|
+
*
|
|
64
|
+
* @param providerId - Provider identifier
|
|
65
|
+
* @param modelId - Model identifier to validate
|
|
66
|
+
* @returns ValidationResult
|
|
67
|
+
*/
|
|
68
|
+
function validateModel(providerId, modelId) {
|
|
69
|
+
// claude-code: model can be null (Claude Code manages internally)
|
|
70
|
+
if (providerId === 'claude-code') {
|
|
71
|
+
return { valid: true };
|
|
72
|
+
}
|
|
73
|
+
// For other providers, model is required
|
|
74
|
+
if (!modelId || modelId.trim() === '') {
|
|
75
|
+
return { valid: false, error: 'Model selection is required for this provider' };
|
|
76
|
+
}
|
|
77
|
+
return { valid: true };
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Validate ReplState structure
|
|
81
|
+
* Per spec 05_DATA_MODELS.md
|
|
82
|
+
*
|
|
83
|
+
* @param state - ReplState to validate
|
|
84
|
+
* @returns ValidationResult
|
|
85
|
+
*/
|
|
86
|
+
function validateReplState(state) {
|
|
87
|
+
if (state === null || state === undefined) {
|
|
88
|
+
return { valid: false, error: 'ReplState cannot be null or undefined' };
|
|
89
|
+
}
|
|
90
|
+
if (typeof state !== 'object') {
|
|
91
|
+
return { valid: false, error: 'ReplState must be an object' };
|
|
92
|
+
}
|
|
93
|
+
const s = state;
|
|
94
|
+
// Validate selected_provider
|
|
95
|
+
if ('selected_provider' in s && s.selected_provider !== null) {
|
|
96
|
+
const providerValidation = validateProvider(s.selected_provider);
|
|
97
|
+
if (!providerValidation.valid) {
|
|
98
|
+
return providerValidation;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// Validate selected_model (if selected_provider is not claude-code)
|
|
102
|
+
if ('selected_provider' in s && s.selected_provider !== 'claude-code') {
|
|
103
|
+
if ('selected_model' in s && s.selected_model !== null) {
|
|
104
|
+
if (typeof s.selected_model !== 'string') {
|
|
105
|
+
return { valid: false, error: 'selected_model must be a string or null' };
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// Validate updated_at (if present)
|
|
110
|
+
if ('updated_at' in s && s.updated_at !== null) {
|
|
111
|
+
if (typeof s.updated_at !== 'string') {
|
|
112
|
+
return { valid: false, error: 'updated_at must be a string or null' };
|
|
113
|
+
}
|
|
114
|
+
// Check ISO 8601 format
|
|
115
|
+
const date = new Date(s.updated_at);
|
|
116
|
+
if (isNaN(date.getTime())) {
|
|
117
|
+
return { valid: false, error: 'updated_at must be a valid ISO 8601 date string' };
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return { valid: true };
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Create a new ReplState with provider change
|
|
124
|
+
* Per spec 12_LLM_PROVIDER_AND_MODELS.md Section 4.2:
|
|
125
|
+
* Provider change resets selected_model to null
|
|
126
|
+
*
|
|
127
|
+
* @param current - Current ReplState
|
|
128
|
+
* @param provider - New provider
|
|
129
|
+
* @returns Updated ReplState
|
|
130
|
+
*/
|
|
131
|
+
function changeProvider(current, provider) {
|
|
132
|
+
return {
|
|
133
|
+
selected_provider: provider,
|
|
134
|
+
selected_model: null, // Reset model on provider change
|
|
135
|
+
updated_at: new Date().toISOString(),
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Create a new ReplState with model change
|
|
140
|
+
*
|
|
141
|
+
* @param current - Current ReplState
|
|
142
|
+
* @param model - New model
|
|
143
|
+
* @returns Updated ReplState
|
|
144
|
+
*/
|
|
145
|
+
function changeModel(current, model) {
|
|
146
|
+
return {
|
|
147
|
+
...current,
|
|
148
|
+
selected_model: model,
|
|
149
|
+
updated_at: new Date().toISOString(),
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=repl-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repl-state.js","sourceRoot":"","sources":["../../../src/models/repl/repl-state.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAoCH,4CAuBC;AAUD,sCAeC;AASD,8CA4CC;AAWD,wCAMC;AASD,kCAMC;AAvKD;;;GAGG;AACU,QAAA,eAAe,GAAG,CAAC,aAAa,EAAE,QAAQ,EAA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