@0xmaxma/claude-gateway 2.0.4 → 2.0.5
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/README.md +10 -1
- package/dist/agent/builtin-commands.d.ts +1 -1
- package/dist/agent/builtin-commands.d.ts.map +1 -1
- package/dist/agent/builtin-commands.js +3 -2
- package/dist/agent/builtin-commands.js.map +1 -1
- package/dist/agent/runner.d.ts +109 -9
- package/dist/agent/runner.d.ts.map +1 -1
- package/dist/agent/runner.js +148 -119
- package/dist/agent/runner.js.map +1 -1
- package/dist/agent/skill-learning/index.d.ts.map +1 -1
- package/dist/agent/skill-learning/index.js +27 -8
- package/dist/agent/skill-learning/index.js.map +1 -1
- package/dist/agent/skill-learning/reviewer.d.ts +3 -1
- package/dist/agent/skill-learning/reviewer.d.ts.map +1 -1
- package/dist/agent/skill-learning/reviewer.js +6 -2
- package/dist/agent/skill-learning/reviewer.js.map +1 -1
- package/dist/agent/turn-stream.d.ts +3 -1
- package/dist/agent/turn-stream.d.ts.map +1 -1
- package/dist/agent/turn-stream.js +8 -4
- package/dist/agent/turn-stream.js.map +1 -1
- package/dist/api/gateway-router.d.ts +2 -0
- package/dist/api/gateway-router.d.ts.map +1 -1
- package/dist/api/gateway-router.js +229 -12
- package/dist/api/gateway-router.js.map +1 -1
- package/dist/api/router.js +11 -11
- package/dist/api/router.js.map +1 -1
- package/dist/api/slack-webhook-router.js +1 -1
- package/dist/api/slack-webhook-router.js.map +1 -1
- package/dist/api/voice-router.d.ts +1 -0
- package/dist/api/voice-router.d.ts.map +1 -1
- package/dist/api/voice-router.js +129 -7
- package/dist/api/voice-router.js.map +1 -1
- package/dist/config/claude-settings.d.ts +14 -0
- package/dist/config/claude-settings.d.ts.map +1 -1
- package/dist/config/claude-settings.js +20 -0
- package/dist/config/claude-settings.js.map +1 -1
- package/dist/orchestration/agent-cli-session.d.ts +46 -0
- package/dist/orchestration/agent-cli-session.d.ts.map +1 -0
- package/dist/orchestration/agent-cli-session.js +121 -0
- package/dist/orchestration/agent-cli-session.js.map +1 -0
- package/dist/orchestration/agent-tool-schemas.d.ts +6 -0
- package/dist/orchestration/agent-tool-schemas.d.ts.map +1 -0
- package/dist/orchestration/agent-tool-schemas.js +23 -0
- package/dist/orchestration/agent-tool-schemas.js.map +1 -0
- package/dist/orchestration/bridge.d.ts +6 -3
- package/dist/orchestration/bridge.d.ts.map +1 -1
- package/dist/orchestration/bridge.js +31 -14
- package/dist/orchestration/bridge.js.map +1 -1
- package/dist/orchestration/browser-voice.d.ts +14 -0
- package/dist/orchestration/browser-voice.d.ts.map +1 -0
- package/dist/orchestration/browser-voice.js +30 -0
- package/dist/orchestration/browser-voice.js.map +1 -0
- package/dist/orchestration/context-footprint.d.ts +14 -0
- package/dist/orchestration/context-footprint.d.ts.map +1 -0
- package/dist/orchestration/context-footprint.js +57 -0
- package/dist/orchestration/context-footprint.js.map +1 -0
- package/dist/orchestration/dashboard-reader-worker.d.ts +2 -0
- package/dist/orchestration/dashboard-reader-worker.d.ts.map +1 -0
- package/dist/orchestration/dashboard-reader-worker.js +155 -0
- package/dist/orchestration/dashboard-reader-worker.js.map +1 -0
- package/dist/orchestration/dashboard-reader.d.ts +15 -0
- package/dist/orchestration/dashboard-reader.d.ts.map +1 -0
- package/dist/orchestration/dashboard-reader.js +87 -0
- package/dist/orchestration/dashboard-reader.js.map +1 -0
- package/dist/orchestration/decision-context.d.ts +15 -0
- package/dist/orchestration/decision-context.d.ts.map +1 -0
- package/dist/orchestration/decision-context.js +57 -0
- package/dist/orchestration/decision-context.js.map +1 -0
- package/dist/orchestration/display-stream.d.ts +21 -2
- package/dist/orchestration/display-stream.d.ts.map +1 -1
- package/dist/orchestration/display-stream.js +61 -8
- package/dist/orchestration/display-stream.js.map +1 -1
- package/dist/orchestration/inference-errors.d.ts.map +1 -1
- package/dist/orchestration/inference-errors.js +19 -21
- package/dist/orchestration/inference-errors.js.map +1 -1
- package/dist/orchestration/mutation-recovery.d.ts +12 -0
- package/dist/orchestration/mutation-recovery.d.ts.map +1 -0
- package/dist/orchestration/mutation-recovery.js +41 -0
- package/dist/orchestration/mutation-recovery.js.map +1 -0
- package/dist/orchestration/native-compact.d.ts +5 -0
- package/dist/orchestration/native-compact.d.ts.map +1 -0
- package/dist/orchestration/native-compact.js +29 -0
- package/dist/orchestration/native-compact.js.map +1 -0
- package/dist/orchestration/notification-mailbox.d.ts +3 -1
- package/dist/orchestration/notification-mailbox.d.ts.map +1 -1
- package/dist/orchestration/notification-mailbox.js +4 -2
- package/dist/orchestration/notification-mailbox.js.map +1 -1
- package/dist/orchestration/process-turn.d.ts +15 -2
- package/dist/orchestration/process-turn.d.ts.map +1 -1
- package/dist/orchestration/process-turn.js +78 -14
- package/dist/orchestration/process-turn.js.map +1 -1
- package/dist/orchestration/progress-review.d.ts +8 -18
- package/dist/orchestration/progress-review.d.ts.map +1 -1
- package/dist/orchestration/progress-review.js +12 -14
- package/dist/orchestration/progress-review.js.map +1 -1
- package/dist/orchestration/provider-message.d.ts +7 -0
- package/dist/orchestration/provider-message.d.ts.map +1 -0
- package/dist/orchestration/provider-message.js +63 -0
- package/dist/orchestration/provider-message.js.map +1 -0
- package/dist/orchestration/response-errors.d.ts +6 -0
- package/dist/orchestration/response-errors.d.ts.map +1 -0
- package/dist/orchestration/response-errors.js +88 -0
- package/dist/orchestration/response-errors.js.map +1 -0
- package/dist/orchestration/response-schema.d.ts +33 -0
- package/dist/orchestration/response-schema.d.ts.map +1 -0
- package/dist/orchestration/response-schema.js +61 -0
- package/dist/orchestration/response-schema.js.map +1 -0
- package/dist/orchestration/runtime.d.ts +67 -0
- package/dist/orchestration/runtime.d.ts.map +1 -1
- package/dist/orchestration/runtime.js +266 -62
- package/dist/orchestration/runtime.js.map +1 -1
- package/dist/orchestration/skills.d.ts.map +1 -1
- package/dist/orchestration/skills.js +3 -2
- package/dist/orchestration/skills.js.map +1 -1
- package/dist/orchestration/source-policy.d.ts +1 -1
- package/dist/orchestration/source-policy.d.ts.map +1 -1
- package/dist/orchestration/source-policy.js +1 -1
- package/dist/orchestration/speech.d.ts +15 -17
- package/dist/orchestration/speech.d.ts.map +1 -1
- package/dist/orchestration/speech.js +90 -30
- package/dist/orchestration/speech.js.map +1 -1
- package/dist/orchestration/store.d.ts +2 -0
- package/dist/orchestration/store.d.ts.map +1 -1
- package/dist/orchestration/store.js +16 -1
- package/dist/orchestration/store.js.map +1 -1
- package/dist/orchestration/tasks/driver.d.ts.map +1 -1
- package/dist/orchestration/tasks/driver.js +8 -3
- package/dist/orchestration/tasks/driver.js.map +1 -1
- package/dist/orchestration/tasks/pool.d.ts.map +1 -1
- package/dist/orchestration/tasks/pool.js +8 -4
- package/dist/orchestration/tasks/pool.js.map +1 -1
- package/dist/orchestration/tasks/service.d.ts +48 -1
- package/dist/orchestration/tasks/service.d.ts.map +1 -1
- package/dist/orchestration/tasks/service.js +41 -17
- package/dist/orchestration/tasks/service.js.map +1 -1
- package/dist/orchestration/token-ledger.d.ts +125 -0
- package/dist/orchestration/token-ledger.d.ts.map +1 -0
- package/dist/orchestration/token-ledger.js +232 -0
- package/dist/orchestration/token-ledger.js.map +1 -0
- package/dist/orchestration/token-usage.d.ts +46 -0
- package/dist/orchestration/token-usage.d.ts.map +1 -0
- package/dist/orchestration/token-usage.js +102 -0
- package/dist/orchestration/token-usage.js.map +1 -0
- package/dist/orchestration/tool-activity.d.ts.map +1 -1
- package/dist/orchestration/tool-activity.js +5 -3
- package/dist/orchestration/tool-activity.js.map +1 -1
- package/dist/orchestration/tool-name.d.ts +10 -0
- package/dist/orchestration/tool-name.d.ts.map +1 -0
- package/dist/orchestration/tool-name.js +14 -0
- package/dist/orchestration/tool-name.js.map +1 -0
- package/dist/orchestration/transcript-checkpoint.d.ts +14 -0
- package/dist/orchestration/transcript-checkpoint.d.ts.map +1 -0
- package/dist/orchestration/transcript-checkpoint.js +83 -0
- package/dist/orchestration/transcript-checkpoint.js.map +1 -0
- package/dist/orchestration/unanswered-inputs.d.ts +6 -0
- package/dist/orchestration/unanswered-inputs.d.ts.map +1 -0
- package/dist/orchestration/unanswered-inputs.js +18 -0
- package/dist/orchestration/unanswered-inputs.js.map +1 -0
- package/dist/session/process.d.ts +10 -0
- package/dist/session/process.d.ts.map +1 -1
- package/dist/session/process.js +91 -9
- package/dist/session/process.js.map +1 -1
- package/dist/session/request-tool-capture.d.ts +31 -0
- package/dist/session/request-tool-capture.d.ts.map +1 -0
- package/dist/session/request-tool-capture.js +194 -0
- package/dist/session/request-tool-capture.js.map +1 -0
- package/dist/session/runtime-profile.d.ts +7 -3
- package/dist/session/runtime-profile.d.ts.map +1 -1
- package/dist/session/runtime-profile.js +3 -1
- package/dist/session/runtime-profile.js.map +1 -1
- package/dist/session/store.d.ts +7 -0
- package/dist/session/store.d.ts.map +1 -1
- package/dist/session/store.js +27 -0
- package/dist/session/store.js.map +1 -1
- package/dist/shell/tailer.d.ts +7 -5
- package/dist/shell/tailer.d.ts.map +1 -1
- package/dist/shell/tailer.js +6 -17
- package/dist/shell/tailer.js.map +1 -1
- package/dist/ui/cli-viewer-ui.js +1 -1
- package/dist/ui/dashboard-client.d.ts +3 -0
- package/dist/ui/dashboard-client.d.ts.map +1 -0
- package/dist/ui/dashboard-client.js +188 -0
- package/dist/ui/dashboard-client.js.map +1 -0
- package/dist/ui/dashboard-presentation.d.ts +9 -0
- package/dist/ui/dashboard-presentation.d.ts.map +1 -0
- package/dist/ui/dashboard-presentation.js +56 -0
- package/dist/ui/dashboard-presentation.js.map +1 -0
- package/dist/ui/dashboard-range.d.ts +5 -0
- package/dist/ui/dashboard-range.d.ts.map +1 -0
- package/dist/ui/dashboard-range.js +20 -0
- package/dist/ui/dashboard-range.js.map +1 -0
- package/dist/ui/dashboard-theme.d.ts +4 -0
- package/dist/ui/dashboard-theme.d.ts.map +1 -0
- package/dist/ui/dashboard-theme.js +485 -0
- package/dist/ui/dashboard-theme.js.map +1 -0
- package/dist/ui/token-report-client.d.ts +3 -0
- package/dist/ui/token-report-client.d.ts.map +1 -0
- package/dist/ui/token-report-client.js +34 -0
- package/dist/ui/token-report-client.js.map +1 -0
- package/dist/ui/token-report.d.ts +89 -0
- package/dist/ui/token-report.d.ts.map +1 -0
- package/dist/ui/token-report.js +200 -0
- package/dist/ui/token-report.js.map +1 -0
- package/dist/ui/web-ui.d.ts.map +1 -1
- package/dist/ui/web-ui.js +124 -181
- package/dist/ui/web-ui.js.map +1 -1
- package/dist/voice/replay.d.ts +8 -0
- package/dist/voice/replay.d.ts.map +1 -0
- package/dist/voice/replay.js +48 -0
- package/dist/voice/replay.js.map +1 -0
- package/dist/voice/session.d.ts +9 -0
- package/dist/voice/session.d.ts.map +1 -1
- package/dist/voice/session.js +72 -14
- package/dist/voice/session.js.map +1 -1
- package/mcp/lazy-connector.test.ts +58 -0
- package/mcp/lazy-connector.ts +67 -0
- package/mcp/lazy-tools.test.ts +152 -0
- package/mcp/lazy-tools.ts +41 -0
- package/mcp/server.ts +53 -34
- package/mcp/tools/discord/commands.ts +2 -0
- package/mcp/tools/tasks/module.ts +1 -12
- package/mcp/tools/telegram/receiver-server.ts +14 -14
- package/package.json +2 -1
- package/resource/dashboard/OFL.txt +93 -0
- package/resource/dashboard/poppins-300.woff2 +0 -0
- package/resource/dashboard/poppins-400.woff2 +0 -0
- package/resource/dashboard/poppins-500.woff2 +0 -0
- package/resource/dashboard/poppins-600.woff2 +0 -0
package/dist/api/router.js
CHANGED
|
@@ -37,7 +37,7 @@ exports.isValidSessionId = isValidSessionId;
|
|
|
37
37
|
exports.isValidAgentId = isValidAgentId;
|
|
38
38
|
exports.openSseStream = openSseStream;
|
|
39
39
|
exports.createApiRouter = createApiRouter;
|
|
40
|
-
const
|
|
40
|
+
const response_errors_1 = require("../orchestration/response-errors");
|
|
41
41
|
const voice_settings_router_1 = require("./voice-settings-router");
|
|
42
42
|
const express_1 = require("express");
|
|
43
43
|
const identity_1 = require("../orchestration/identity");
|
|
@@ -186,7 +186,7 @@ function createSseCallbacks(res, meta) {
|
|
|
186
186
|
// interrupted, do not wait for it) from a crash (PROCESS_EXITED) or a
|
|
187
187
|
// transport failure, instead of string-matching `message`.
|
|
188
188
|
const code = (0, turn_stream_1.errorCode)(err);
|
|
189
|
-
res.write(`data: ${JSON.stringify({ type: 'error', message: err
|
|
189
|
+
res.write(`data: ${JSON.stringify({ type: 'error', message: (0, response_errors_1.responseFailureMessage)(err, true), ...(code ? { code } : {}), seq, ...ids() })}\n\n`);
|
|
190
190
|
}
|
|
191
191
|
catch { /* client gone */ }
|
|
192
192
|
finally {
|
|
@@ -594,8 +594,8 @@ function createApiRouter(agentRunners, agentConfigs, apiKeys, configPath, models
|
|
|
594
594
|
res.json({
|
|
595
595
|
commands: [
|
|
596
596
|
{ name: '/session', description: 'Show current session info (name, message count, context %)' },
|
|
597
|
-
{ name: '/clear', description: '
|
|
598
|
-
{ name: '/compact', description: '
|
|
597
|
+
{ name: '/clear', description: 'Reset Claude Code context; keep chat history' },
|
|
598
|
+
{ name: '/compact', description: 'Compact Claude Code context without changing chat history' },
|
|
599
599
|
{ name: '/stop', description: 'Interrupt the in-flight turn' },
|
|
600
600
|
{ name: '/restart', description: 'Graceful session restart' },
|
|
601
601
|
{ name: '/model', description: 'Show the current AI model' },
|
|
@@ -842,12 +842,12 @@ function createApiRouter(agentRunners, agentConfigs, apiKeys, configPath, models
|
|
|
842
842
|
res.status(409).json({ error: 'Session already has a pending request' });
|
|
843
843
|
}
|
|
844
844
|
else {
|
|
845
|
-
res.status(code === 'PROVIDER_CAPACITY' || code === 'PROVIDER_UNAVAILABLE' ? 503 : 500).json({ error: (0,
|
|
845
|
+
res.status(code === 'PROVIDER_CAPACITY' || code === 'PROVIDER_UNAVAILABLE' ? 503 : 500).json({ error: (0, response_errors_1.responseFailureMessage)(err), ...((0, turn_stream_1.errorCode)(err) ? { code: (0, turn_stream_1.errorCode)(err) } : {}) });
|
|
846
846
|
}
|
|
847
847
|
}
|
|
848
848
|
else {
|
|
849
849
|
try {
|
|
850
|
-
res.write(`data: ${JSON.stringify({ type: 'error', message: (0,
|
|
850
|
+
res.write(`data: ${JSON.stringify({ type: 'error', message: (0, response_errors_1.responseFailureMessage)(err), ...((0, turn_stream_1.errorCode)(err) ? { code: (0, turn_stream_1.errorCode)(err) } : {}) })}\n\n`);
|
|
851
851
|
res.end();
|
|
852
852
|
}
|
|
853
853
|
catch { /* client gone */ }
|
|
@@ -901,7 +901,7 @@ function createApiRouter(agentRunners, agentConfigs, apiKeys, configPath, models
|
|
|
901
901
|
res.status(409).json({ error: 'Session already has a pending request' });
|
|
902
902
|
}
|
|
903
903
|
else {
|
|
904
|
-
res.status(code === 'PROVIDER_CAPACITY' || code === 'PROVIDER_UNAVAILABLE' ? 503 : 500).json({ error: (0,
|
|
904
|
+
res.status(code === 'PROVIDER_CAPACITY' || code === 'PROVIDER_UNAVAILABLE' ? 503 : 500).json({ error: (0, response_errors_1.responseFailureMessage)(err), ...((0, turn_stream_1.errorCode)(err) ? { code: (0, turn_stream_1.errorCode)(err) } : {}) });
|
|
905
905
|
}
|
|
906
906
|
}
|
|
907
907
|
}
|
|
@@ -4343,11 +4343,11 @@ function createApiRouter(agentRunners, agentConfigs, apiKeys, configPath, models
|
|
|
4343
4343
|
}
|
|
4344
4344
|
catch (err) {
|
|
4345
4345
|
if (!res.headersSent) {
|
|
4346
|
-
res.status(500).json({ error:
|
|
4346
|
+
res.status(500).json({ error: (0, response_errors_1.responseFailureMessage)(err), ...((0, turn_stream_1.errorCode)(err) ? { code: (0, turn_stream_1.errorCode)(err) } : {}) });
|
|
4347
4347
|
}
|
|
4348
4348
|
else {
|
|
4349
4349
|
try {
|
|
4350
|
-
res.write(`data: ${JSON.stringify({ type: 'error', message:
|
|
4350
|
+
res.write(`data: ${JSON.stringify({ type: 'error', message: (0, response_errors_1.responseFailureMessage)(err), ...((0, turn_stream_1.errorCode)(err) ? { code: (0, turn_stream_1.errorCode)(err) } : {}) })}\n\n`);
|
|
4351
4351
|
res.end();
|
|
4352
4352
|
}
|
|
4353
4353
|
catch { /* client gone */ }
|
|
@@ -5322,12 +5322,12 @@ function createApiRouter(agentRunners, agentConfigs, apiKeys, configPath, models
|
|
|
5322
5322
|
res.status(409).json({ error: 'Session already has a pending request' });
|
|
5323
5323
|
}
|
|
5324
5324
|
else {
|
|
5325
|
-
res.status(500).json({ error: err.
|
|
5325
|
+
res.status(500).json({ error: (0, response_errors_1.responseFailureMessage)(err), ...((0, turn_stream_1.errorCode)(err) ? { code: (0, turn_stream_1.errorCode)(err) } : {}) });
|
|
5326
5326
|
}
|
|
5327
5327
|
}
|
|
5328
5328
|
else {
|
|
5329
5329
|
try {
|
|
5330
|
-
res.write(`data: ${JSON.stringify({ type: 'error', message: err.
|
|
5330
|
+
res.write(`data: ${JSON.stringify({ type: 'error', message: (0, response_errors_1.responseFailureMessage)(err), ...((0, turn_stream_1.errorCode)(err) ? { code: (0, turn_stream_1.errorCode)(err) } : {}) })}\n\n`);
|
|
5331
5331
|
res.end();
|
|
5332
5332
|
}
|
|
5333
5333
|
catch { /* client gone */ }
|