@getpaseo/server 0.11.0-beta.4 → 0.11.0-beta.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.
Files changed (43) hide show
  1. package/dist/scripts/supervisor.js +10 -0
  2. package/dist/server/builtin-plugins/antigravity-provider/server/internal/process.ts +4 -3
  3. package/dist/server/builtin-plugins/antigravity-provider/server/internal/signals.ts +2 -5
  4. package/dist/server/builtin-plugins/claude-usage-source/server/usage.ts +5 -2
  5. package/dist/server/builtin-plugins/codex-usage-source/server/usage.ts +7 -1
  6. package/dist/server/builtin-plugins/muse-provider/server/catalog.ts +1 -4
  7. package/dist/server/builtin-plugins/muse-provider/server/connection.ts +41 -14
  8. package/dist/server/builtin-plugins/muse-provider/server/provider.ts +12 -13
  9. package/dist/server/builtin-plugins/muse-provider/server/session.ts +20 -19
  10. package/dist/server/builtin-plugins/muse-provider/server/sessions.ts +4 -1
  11. package/dist/server/builtin-plugins/muse-provider/server/usage.ts +20 -7
  12. package/dist/server/builtin-plugins/muse-provider/server/wire.ts +15 -8
  13. package/dist/server/builtin-plugins/package.json +1 -1
  14. package/dist/server/executable-resolution/executable-resolution.d.ts +0 -1
  15. package/dist/server/executable-resolution/executable-resolution.js +0 -3
  16. package/dist/server/server/agent/providers/claude/agent.js +30 -12
  17. package/dist/server/server/agent/providers/jsonl-rpc-process.d.ts +2 -2
  18. package/dist/server/server/agent/providers/jsonl-rpc-process.js +9 -11
  19. package/dist/server/server/agent/providers/omp/agent.d.ts +1 -0
  20. package/dist/server/server/agent/providers/omp/agent.js +24 -4
  21. package/dist/server/server/agent/providers/omp/cli-runtime.js +4 -4
  22. package/dist/server/server/agent/providers/omp/rpc-types.d.ts +365 -0
  23. package/dist/server/server/agent/providers/omp/rpc-types.js +54 -0
  24. package/dist/server/server/plugins/bundle-evaluator.js +2 -1
  25. package/dist/server/server/plugins/index.d.ts +21 -0
  26. package/dist/server/server/plugins/usage-sources/index.js +54 -22
  27. package/dist/server/server/session/daemon/npm-global-cli.js +4 -2
  28. package/dist/server/utils/spawn.d.ts +1 -1
  29. package/dist/server/utils/spawn.js +5 -33
  30. package/dist/server/web-ui/_expo/static/js/web/{index-244720b41ed4a2ce25809182e2510d6d.js → index-88d552b322a98d03fa394582d599904b.js} +24 -24
  31. package/dist/server/web-ui/_expo/static/js/web/index-88d552b322a98d03fa394582d599904b.js.br +0 -0
  32. package/dist/server/web-ui/_expo/static/js/web/index-88d552b322a98d03fa394582d599904b.js.gz +0 -0
  33. package/dist/server/web-ui/index.html +10 -1
  34. package/dist/server/web-ui/index.html.br +0 -0
  35. package/dist/server/web-ui/index.html.gz +0 -0
  36. package/dist/src/executable-resolution/executable-resolution.js +0 -3
  37. package/dist/src/utils/spawn.js +5 -33
  38. package/package.json +6 -6
  39. package/dist/server/utils/windows-command.d.ts +0 -15
  40. package/dist/server/utils/windows-command.js +0 -41
  41. package/dist/server/web-ui/_expo/static/js/web/index-244720b41ed4a2ce25809182e2510d6d.js.br +0 -0
  42. package/dist/server/web-ui/_expo/static/js/web/index-244720b41ed4a2ce25809182e2510d6d.js.gz +0 -0
  43. package/dist/src/utils/windows-command.js +0 -41
@@ -178,24 +178,22 @@ export class JsonlRpcProcess {
178
178
  handleStdoutChunk(chunk) {
179
179
  this.frameDecoder.write(chunk);
180
180
  }
181
- /** Route a complete logical frame to its consumer (response or subscriber). */
181
+ /** Route a complete logical frame to its consumer (pending request or subscriber). */
182
182
  dispatchFrame(message) {
183
- if (message.type === "response") {
184
- this.handleResponse(message);
183
+ const pending = message.type === "response" && typeof message.id === "string"
184
+ ? this.pending.get(message.id)
185
+ : undefined;
186
+ if (pending) {
187
+ this.settleRequest(pending, message);
185
188
  return;
186
189
  }
190
+ // A response nothing is waiting for is published like any other frame, so a provider
191
+ // can read it as an event, such as OMP 18.3 rejecting a prompt after acknowledging it.
187
192
  for (const subscriber of this.messageSubscribers) {
188
193
  subscriber(message);
189
194
  }
190
195
  }
191
- handleResponse(response) {
192
- if (!response.id) {
193
- return;
194
- }
195
- const pending = this.pending.get(response.id);
196
- if (!pending) {
197
- return;
198
- }
196
+ settleRequest(pending, response) {
199
197
  if (pending.timer) {
200
198
  clearTimeout(pending.timer);
201
199
  }
@@ -67,6 +67,7 @@ export declare class OmpAgentSession implements AgentSession {
67
67
  private readonly pendingNoTurnOutputs;
68
68
  private activePromptRequestId;
69
69
  private activePromptAgentInvoked;
70
+ private activePromptError;
70
71
  private readonly pendingPromptResults;
71
72
  private pendingNoTurnCompletionAbort;
72
73
  private lastKnownThinkingOptionId;
@@ -54,6 +54,11 @@ const OMP_CORE_CAPABILITIES = {
54
54
  const OMP_NO_TURN_SETTLE_MS = 5000;
55
55
  const OMP_PROVIDER_IDLE_DEADLINE_MS = 600000;
56
56
  const OMP_FAST_INACTIVE_MESSAGE = "Fast is enabled but does not apply to this model.";
57
+ function promptResultError(result) {
58
+ if (result.status !== "error")
59
+ return null;
60
+ return result.error?.message || "OMP rejected the prompt";
61
+ }
57
62
  function createOmpProviderIdleScheduler() {
58
63
  return {
59
64
  waitForRetry: async () => {
@@ -457,6 +462,7 @@ export class OmpAgentSession {
457
462
  this.pendingNoTurnOutputs = [];
458
463
  this.activePromptRequestId = null;
459
464
  this.activePromptAgentInvoked = null;
465
+ this.activePromptError = null;
460
466
  this.pendingPromptResults = new Map();
461
467
  this.pendingNoTurnCompletionAbort = null;
462
468
  this.outOfBandCompactionEmit = null;
@@ -593,12 +599,13 @@ export class OmpAgentSession {
593
599
  if (ack.requestId) {
594
600
  this.pendingPromptResults.delete(ack.requestId);
595
601
  }
596
- this.activePromptAgentInvoked = correlatedResult ?? ack.agentInvoked ?? null;
597
- if (correlatedResult === false) {
602
+ this.activePromptAgentInvoked = correlatedResult?.agentInvoked ?? ack.agentInvoked ?? null;
603
+ this.activePromptError = correlatedResult?.error ?? null;
604
+ if (correlatedResult?.agentInvoked === false) {
598
605
  this.scheduleNoTurnPromptCompletion(turnId);
599
606
  return;
600
607
  }
601
- if (correlatedResult !== true && ack.agentInvoked === false) {
608
+ if (correlatedResult?.agentInvoked !== true && ack.agentInvoked === false) {
602
609
  await this.completeNoTurnPrompt(turnId);
603
610
  return;
604
611
  }
@@ -738,6 +745,9 @@ export class OmpAgentSession {
738
745
  if (this.closed)
739
746
  throw new Error("OMP session is closed");
740
747
  this.unsubscribeRuntime?.();
748
+ // Request ids restart with each OMP process, so results held for the old one cannot
749
+ // correlate with prompts sent to the new one.
750
+ this.pendingPromptResults.clear();
741
751
  this.runtimeSession = next;
742
752
  this.hostTools = restarted.hostTools;
743
753
  this.state = state;
@@ -996,7 +1006,14 @@ export class OmpAgentSession {
996
1006
  this.activeTurnHasUserMessage) {
997
1007
  return;
998
1008
  }
1009
+ const error = this.activePromptError;
999
1010
  this.emitBufferedNoTurnOutputs(turnId);
1011
+ if (error) {
1012
+ this.usagePoller.stopTurn();
1013
+ this.resetActiveTurn({ terminalizeWork: true });
1014
+ this.emit({ type: "turn_failed", provider: this.provider, turnId, error });
1015
+ return;
1016
+ }
1000
1017
  this.completeTurn(turnId, []);
1001
1018
  }
1002
1019
  clearNoTurnBuffers() {
@@ -1004,6 +1021,7 @@ export class OmpAgentSession {
1004
1021
  this.activeNoTurnPromptText = null;
1005
1022
  this.activePromptRequestId = null;
1006
1023
  this.activePromptAgentInvoked = null;
1024
+ this.activePromptError = null;
1007
1025
  this.pendingNoTurnOutputs.splice(0, this.pendingNoTurnOutputs.length);
1008
1026
  }
1009
1027
  emitBufferedNoTurnOutputs(turnId) {
@@ -1355,8 +1373,10 @@ export class OmpAgentSession {
1355
1373
  ? event.agentInvoked
1356
1374
  : undefined;
1357
1375
  if (requestId && agentInvoked !== undefined) {
1376
+ const result = { agentInvoked, error: promptResultError(event) };
1358
1377
  if (requestId === this.activePromptRequestId && this.activeTurnId) {
1359
1378
  this.activePromptAgentInvoked = agentInvoked;
1379
+ this.activePromptError = result.error;
1360
1380
  if (agentInvoked === false) {
1361
1381
  this.scheduleNoTurnPromptCompletion(this.activeTurnId);
1362
1382
  }
@@ -1365,7 +1385,7 @@ export class OmpAgentSession {
1365
1385
  }
1366
1386
  }
1367
1387
  else if (this.activePromptRequestId === null) {
1368
- this.pendingPromptResults.set(requestId, agentInvoked);
1388
+ this.pendingPromptResults.set(requestId, result);
1369
1389
  }
1370
1390
  }
1371
1391
  return;
@@ -3,7 +3,7 @@ import { z } from "zod";
3
3
  import { JSONL_RPC_NO_TIMEOUT, JsonlRpcProcess, } from "../jsonl-rpc-process.js";
4
4
  import { establishOmpProtocol } from "./protocol-session.js";
5
5
  import { buildOmpLaunch, } from "./runtime.js";
6
- import { OmpBranchMessagesResultSchema, OmpBranchResultSchema, OmpCommandsResultSchema, OmpHostToolsResultSchema, OmpMessagesResultSchema, OmpModelSchema, OmpModelsResultSchema, OmpPromptAckSchema, OmpRpcCommandSchema, OmpRuntimeEventSchema, OmpSessionStateSchema, OmpSessionStatsSchema, } from "./rpc-types.js";
6
+ import { OmpBranchMessagesResultSchema, OmpBranchResultSchema, OmpCommandsResultSchema, OmpHostToolsResultSchema, OmpMessagesResultSchema, OmpModelSchema, OmpModelsResultSchema, OmpPromptAckSchema, OmpRpcCommandSchema, parseOmpRuntimeEvent, OmpSessionStateSchema, OmpSessionStatsSchema, } from "./rpc-types.js";
7
7
  const DEFAULT_OMP_COMMAND = [process.env.OMP_COMMAND ?? "omp"];
8
8
  const DEFAULT_COMMANDS_RPC_NAME = "get_available_commands";
9
9
  export class OmpCliRuntime {
@@ -63,9 +63,9 @@ class OmpCliRuntimeSession {
63
63
  this.launchEnvironment = launchEnvironment;
64
64
  this.subscribers = new Set();
65
65
  process.onMessage((message) => {
66
- const event = OmpRuntimeEventSchema.safeParse(message);
67
- if (event.success) {
68
- this.emit(event.data);
66
+ const event = parseOmpRuntimeEvent(message);
67
+ if (event) {
68
+ this.emit(event);
69
69
  }
70
70
  });
71
71
  process.onExit(({ error }) => {