@oar-sh/oar 0.9.17 → 0.9.18
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/.github/extensions/web-relay/skills/tool-activity.mjs +5 -4
- package/CHANGELOG.md +192 -0
- package/README.md +13 -12
- package/package.json +1 -1
- package/server/claude-api-worker/claude-api-backend.mjs +345 -0
- package/server/claude-api-worker/claude-api-session-worker.mjs +29 -0
- package/server/claude-worker/claude-cli-pinned-env.mjs +150 -0
- package/server/claude-worker/claude-remote-relay-tool.mjs +3 -3
- package/server/claude-worker/claude-sdk-adapter.mjs +35 -9
- package/server/claude-worker/claude-session-process.mjs +166 -21
- package/server/claude-worker/claude-session-worker-main.mjs +3 -0
- package/server/claude-worker/claude-subscription-key-check.mjs +64 -0
- package/server/claude-worker/claude-turn-publisher.mjs +117 -5
- package/server/claude-worker/claude-usage-totals.mjs +53 -0
- package/server/claude-worker/sdk-message-normalizer.mjs +1 -1
- package/server/copilot-worker/copilot-remote-relay-tool.mjs +2 -2
- package/server/copilot-worker/copilot-sdk-event-normalizer.mjs +1 -1
- package/server/copilot-worker/copilot-sdk-session-process.mjs +9 -9
- package/server/cursor-worker/cursor-remote-relay-tool.mjs +3 -3
- package/server/cursor-worker/cursor-turn-runner.mjs +4 -4
- package/server/cursor-worker/sdk-message-normalizer.mjs +2 -2
- package/server/db-schema.mjs +33 -1
- package/server/deepseek-worker/deepseek-claude-backend.mjs +14 -130
- package/server/grok-worker/acp-client.mjs +1 -1
- package/server/grok-worker/grok-turn-runner.mjs +4 -4
- package/server/grok-worker/sdk-message-normalizer.mjs +1 -1
- package/server/mcp/oar-mcp-server.mjs +11 -5
- package/server/migrations/0031-queue-provider.mjs +143 -0
- package/server/migrations/0032-runtime-session-billing-switch.mjs +94 -0
- package/server/migrations/0033-claude-api-usage-checkpoints.mjs +138 -0
- package/server/migrations/0034-claude-api-usage-totals.mjs +112 -0
- package/server/public/app/activity-replay-state.mjs +4 -3
- package/server/public/app/agent-sessions-settings-ui.js +1 -1
- package/server/public/app/agent-sessions-settings.mjs +1 -1
- package/server/public/app/api-client.js +52 -0
- package/server/public/app/bootstrap.js +153 -27
- package/server/public/app/claude-api-settings-ui.js +362 -0
- package/server/public/app/claude-billing-toggle-ui.js +224 -0
- package/server/public/app/claude-billing-toggle.mjs +112 -0
- package/server/public/app/context-tier-options.mjs +6 -2
- package/server/public/app/context-usage-view.mjs +1 -1
- package/server/public/app/conversation-provider-indicator.mjs +11 -0
- package/server/public/app/conversation-view.js +29 -3
- package/server/public/app/inbox-view.mjs +1 -1
- package/server/public/app/journal-view.js +127 -10
- package/server/public/app/model-selector-options.mjs +17 -1
- package/server/public/app/new-conversation-model-choice.mjs +21 -0
- package/server/public/app/provider-readiness.mjs +5 -2
- package/server/public/app/relay-error-ctas.mjs +50 -0
- package/server/public/app/relay-schedules-ui.js +1 -1
- package/server/public/app/settings-modal.js +11 -0
- package/server/public/app/settings-tabs.js +1 -1
- package/server/public/app/socket-handlers.js +18 -1
- package/server/public/app/tool-activity-emoji.mjs +4 -3
- package/server/public/app/usage-limit-ui.js +136 -5
- package/server/public/index.html +189 -3
- package/server/relay-tools.md +4 -4
- package/server/repositories/conversation-group-repository.mjs +1 -1
- package/server/repositories/message-repository.mjs +7 -0
- package/server/repositories/session-repository.mjs +8 -1
- package/server/routes/ask-user-routes.mjs +1 -1
- package/server/routes/conversation-group-routes.mjs +1 -1
- package/server/routes/messages-routes.mjs +645 -27
- package/server/routes/relay-ask-routes.mjs +3 -3
- package/server/routes/relay-event-routes.mjs +2 -2
- package/server/routes/relay-schedule-routes.mjs +1 -1
- package/server/routes/remote-relay-routes.mjs +3 -3
- package/server/routes/sessions-routes.mjs +327 -29
- package/server/server-runtime.mjs +363 -26
- package/server/services/about-service.mjs +1 -0
- package/server/services/background-work-view.mjs +2 -1
- package/server/services/claude-api-settings-service.mjs +575 -0
- package/server/services/claude-api-usage-service.mjs +361 -0
- package/server/services/claude-billing-swap-service.mjs +274 -0
- package/server/services/claude-billing-switch-service.mjs +343 -0
- package/server/services/plan-usage-claude-api.mjs +445 -0
- package/server/services/plan-usage-service.mjs +5 -0
- package/server/services/provider-model-selection.mjs +3 -2
- package/server/services/provider-reasoning-effort.mjs +9 -0
- package/server/services/relay-ask-service.mjs +1 -1
- package/server/services/relay-event-service.mjs +3 -2
- package/server/services/relay-schedule-service.mjs +1 -1
- package/server/services/remote-relay-caller-context.mjs +7 -0
- package/server/services/remote-relay-dispatcher.mjs +83 -14
- package/server/services/remote-relay-registry-service.mjs +1 -1
- package/server/services/session-worker-launch-service.mjs +61 -2
- package/server/services/session-worker-registry-service.mjs +28 -1
- package/server/services/session-worker-websocket-service.mjs +17 -0
- package/server/services/usage-limit-pause-service.mjs +55 -4
- package/server/services/worker-secret-redaction.mjs +2 -0
- package/shared/anthropic-api.mjs +202 -0
- package/shared/provider-routing.mjs +5 -3
- package/shared/relay-asks.mjs +11 -5
- package/shared/relay-events.mjs +2 -2
- package/shared/relay-schedules.mjs +2 -2
- package/shared/remote-relay-contract.mjs +29 -9
- package/shared/remote-relay-tool-core.mjs +23 -6
- package/shared/steer-settle-failure.mjs +1 -0
- package/shared/worker-runtime/api-client.mjs +2 -2
- package/shared/worker-runtime/heartbeat.mjs +5 -0
- package/shared/worker-runtime/worker-websocket-link.mjs +6 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
// Questions that don't block (
|
|
3
|
+
// Questions that don't block (relay_tool `ask`) and the Inbox.
|
|
4
4
|
//
|
|
5
5
|
// For the browser (this relay's user; a request from another relay's agent,
|
|
6
6
|
// or this relay's own through the loopback, is refused):
|
|
@@ -175,7 +175,7 @@ export function registerRelayAskRoutes(app, deps) {
|
|
|
175
175
|
function refuseRemote(req, res) {
|
|
176
176
|
const request = readRemoteRelayRequest(req, remoteRelayInbound || {});
|
|
177
177
|
if (!request.remote) return false;
|
|
178
|
-
res.status(403).json({ error: 'The Inbox is this relay\'s user\'s; agents use the
|
|
178
|
+
res.status(403).json({ error: 'The Inbox is this relay\'s user\'s; agents use the relay_tool.', code: REMOTE_RELAY_ERROR_CODES.forbidden });
|
|
179
179
|
return true;
|
|
180
180
|
}
|
|
181
181
|
|
|
@@ -189,7 +189,7 @@ export function registerRelayAskRoutes(app, deps) {
|
|
|
189
189
|
if (!request) return null;
|
|
190
190
|
if (!request.remote || request.local) {
|
|
191
191
|
res.status(403).json({
|
|
192
|
-
error: 'Only another relay calls these routes; this relay\'s own agents use the
|
|
192
|
+
error: 'Only another relay calls these routes; this relay\'s own agents use the relay_tool and its user the Inbox.',
|
|
193
193
|
code: REMOTE_RELAY_ERROR_CODES.forbidden,
|
|
194
194
|
});
|
|
195
195
|
return null;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// Relay event subscriptions, for the browser: the active subscriptions (the
|
|
4
4
|
// "watching" chip and the "watched" badges) and Unsubscribe. Agents use the
|
|
5
|
-
//
|
|
5
|
+
// relay_tool instead; a request from another relay's agent is
|
|
6
6
|
// refused here, so only this relay's user ends a subscription from outside
|
|
7
7
|
// its conversation.
|
|
8
8
|
//
|
|
@@ -69,7 +69,7 @@ export function registerRelayEventRoutes(app, deps) {
|
|
|
69
69
|
if (!request) return null;
|
|
70
70
|
if (!request.remote || request.local) {
|
|
71
71
|
res.status(403).json({
|
|
72
|
-
error: 'Only another relay subscribes to sessions here this way; this relay\'s own agents use the
|
|
72
|
+
error: 'Only another relay subscribes to sessions here this way; this relay\'s own agents use the relay_tool.',
|
|
73
73
|
code: REMOTE_RELAY_ERROR_CODES.forbidden,
|
|
74
74
|
});
|
|
75
75
|
return null;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// Relay schedules, for the browser: the active schedules (the "scheduled"
|
|
4
4
|
// marker and the list in the header) and Cancel. Agents use the
|
|
5
|
-
//
|
|
5
|
+
// relay_tool instead; a request from another relay's agent is
|
|
6
6
|
// refused here, so only this relay's user cancels a schedule from outside
|
|
7
7
|
// its conversation.
|
|
8
8
|
|
|
@@ -48,7 +48,7 @@ export function registerRemoteRelayRoutes(app, deps) {
|
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
// Workers ask at start whether to register the
|
|
51
|
+
// Workers ask at start whether to register the relay_tool at all:
|
|
52
52
|
// when a relay is paired (`count`), or when this relay's own sessions are
|
|
53
53
|
// open to its agents (`localEnabled`, the local target).
|
|
54
54
|
app.get('/api/remote-relays/summary', auth, (_req, res) => {
|
|
@@ -88,7 +88,7 @@ export function registerRemoteRelayRoutes(app, deps) {
|
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
-
// POST /api/remote-relays/tool — every provider adapter's
|
|
91
|
+
// POST /api/remote-relays/tool — every provider adapter's relay_tool call.
|
|
92
92
|
app.post('/api/remote-relays/tool', auth, async (req, res) => {
|
|
93
93
|
if (!dispatcher) return res.status(503).json({ error: 'Remote relay dispatcher unavailable' });
|
|
94
94
|
// The tool acts for one of this relay's conversations: another relay
|
|
@@ -96,7 +96,7 @@ export function registerRemoteRelayRoutes(app, deps) {
|
|
|
96
96
|
// not host). Its agents reach this relay through the routes it calls.
|
|
97
97
|
if (readRemoteRelayRequest(req, remoteRelayInbound).remote) {
|
|
98
98
|
return res.status(403).json({
|
|
99
|
-
error: 'The
|
|
99
|
+
error: 'The relay_tool of this relay is for its own sessions; another relay cannot call it.',
|
|
100
100
|
code: REMOTE_RELAY_ERROR_CODES.forbidden,
|
|
101
101
|
});
|
|
102
102
|
}
|