agent-shim 11.71.0 → 11.72.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/dist/cli.cjs CHANGED
@@ -37387,7 +37387,7 @@ var init_package = __esm({
37387
37387
  "package.json"() {
37388
37388
  package_default = {
37389
37389
  name: "agent-shim",
37390
- version: "11.71.0",
37390
+ version: "11.72.0",
37391
37391
  description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
37392
37392
  license: "MIT",
37393
37393
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -68781,6 +68781,7 @@ function messagesToGeminiContents(messages, names, toolIdToName) {
68781
68781
  const signature = toolCallSignatureOf(block2.id);
68782
68782
  ensureRole("model").push({
68783
68783
  functionCall: {
68784
+ id: block2.id,
68784
68785
  name: sanitizedName,
68785
68786
  args: isRecord8(block2.input) ? block2.input : {}
68786
68787
  },
@@ -68791,6 +68792,7 @@ function messagesToGeminiContents(messages, names, toolIdToName) {
68791
68792
  const toolName = toolIdToName.get(block2.tool_use_id) ?? "unknown_tool";
68792
68793
  ensureRole("user").push({
68793
68794
  functionResponse: {
68795
+ id: block2.tool_use_id,
68794
68796
  name: toolName,
68795
68797
  response: { output: flattenToolResult(block2.content) }
68796
68798
  }
@@ -135221,6 +135223,9 @@ function createAntigravityRelay(params) {
135221
135223
  let currentBlockIndex = -1;
135222
135224
  let sawToolUse = false;
135223
135225
  let finished = false;
135226
+ let stopReason = "end_turn";
135227
+ const content = [];
135228
+ let activeText;
135224
135229
  let usage = {
135225
135230
  input_tokens: 0,
135226
135231
  cache_creation_input_tokens: 0,
@@ -135282,6 +135287,8 @@ function createAntigravityRelay(params) {
135282
135287
  closeActiveBlock();
135283
135288
  currentBlockIndex += 1;
135284
135289
  activeBlockType = "text";
135290
+ activeText = { type: "text", text: "" };
135291
+ content.push(activeText);
135285
135292
  frames.push({
135286
135293
  event: "content_block_start",
135287
135294
  data: {
@@ -135291,6 +135298,9 @@ function createAntigravityRelay(params) {
135291
135298
  }
135292
135299
  });
135293
135300
  }
135301
+ if (activeText !== void 0) {
135302
+ activeText.text += part.text;
135303
+ }
135294
135304
  frames.push({
135295
135305
  event: "content_block_delta",
135296
135306
  data: {
@@ -135307,6 +135317,7 @@ function createAntigravityRelay(params) {
135307
135317
  const callName = part.functionCall.name;
135308
135318
  const originalName = params.toolNames.get(callName) ?? callName;
135309
135319
  const callId = params.fallbackId();
135320
+ content.push({ type: "tool_use", id: callId, name: originalName, input: part.functionCall.args });
135310
135321
  if (typeof part.thoughtSignature === "string") {
135311
135322
  rememberToolCallSignature(callId, part.thoughtSignature);
135312
135323
  }
@@ -135340,7 +135351,7 @@ function createAntigravityRelay(params) {
135340
135351
  }
135341
135352
  }
135342
135353
  if (candidate?.finishReason !== void 0) {
135343
- const stopReason = sawToolUse ? "tool_use" : candidate.finishReason === "MAX_TOKENS" ? "max_tokens" : "end_turn";
135354
+ stopReason = sawToolUse ? "tool_use" : candidate.finishReason === "MAX_TOKENS" ? "max_tokens" : "end_turn";
135344
135355
  closeActiveBlock();
135345
135356
  frames.push({
135346
135357
  event: "message_delta",
@@ -135363,7 +135374,7 @@ function createAntigravityRelay(params) {
135363
135374
  if (!finished) {
135364
135375
  ensureStarted();
135365
135376
  closeActiveBlock();
135366
- const stopReason = sawToolUse ? "tool_use" : "end_turn";
135377
+ stopReason = sawToolUse ? "tool_use" : "end_turn";
135367
135378
  frames.push({
135368
135379
  event: "message_delta",
135369
135380
  data: {
@@ -135380,7 +135391,8 @@ function createAntigravityRelay(params) {
135380
135391
  }
135381
135392
  return { frames: [...frames], done: true };
135382
135393
  };
135383
- return { pushChunk, finish };
135394
+ const message = () => ({ id: messageId, type: "message", role: "assistant", model: params.servedModel, content: [...content], stop_reason: stopReason, stop_sequence: null, usage });
135395
+ return { pushChunk, finish, message };
135384
135396
  }
135385
135397
 
135386
135398
  // src/antigravity/route.ts
@@ -135699,12 +135711,12 @@ function createAntigravityRoute(ports) {
135699
135711
  nowMs,
135700
135712
  model: translated.model
135701
135713
  });
135702
- const stream = async function* () {
135714
+ const frames = async function* () {
135703
135715
  try {
135704
135716
  if (firstResult.done !== true) {
135705
135717
  const step2 = relay.pushChunk(firstResult.value);
135706
135718
  for (const frame of step2.frames) {
135707
- yield renderSseFrame2(frame);
135719
+ yield frame;
135708
135720
  }
135709
135721
  if (!step2.done) {
135710
135722
  for (; ; ) {
@@ -135717,7 +135729,7 @@ function createAntigravityRoute(ports) {
135717
135729
  }
135718
135730
  const nextStep = relay.pushChunk(nextResult.value);
135719
135731
  for (const frame of nextStep.frames) {
135720
- yield renderSseFrame2(frame);
135732
+ yield frame;
135721
135733
  }
135722
135734
  if (nextStep.done) {
135723
135735
  break;
@@ -135727,30 +135739,40 @@ function createAntigravityRoute(ports) {
135727
135739
  }
135728
135740
  const finalStep = relay.finish();
135729
135741
  for (const frame of finalStep.frames) {
135730
- yield renderSseFrame2(frame);
135742
+ yield frame;
135731
135743
  }
135732
135744
  } catch (error63) {
135733
135745
  if (!request7.signal.aborted) {
135734
135746
  const errMsg = error63 instanceof Error ? error63.message : String(error63);
135735
- yield renderSseFrame2({
135736
- event: "error",
135737
- data: { type: "error", error: { type: "api_error", message: errMsg } }
135738
- });
135747
+ yield { event: "error", data: { type: "error", error: { type: "api_error", message: errMsg } } };
135739
135748
  }
135740
135749
  }
135741
135750
  };
135742
- return {
135743
- status: HTTP_STATUS.ok,
135744
- headers: {
135745
- "Content-Type": "text/event-stream",
135746
- "Cache-Control": "no-cache",
135747
- Connection: "keep-alive",
135748
- ...quotaHeaders2
135749
- },
135750
- body: stream(),
135751
- // The tier alias the session asked for, whenever the translation resolved it to a different model: the front door's mount turns it into the model choice the usage record keeps.
135752
- ...requestedModel !== translated.model ? { requestedModel } : {}
135753
- };
135751
+ const served = requestedModel !== translated.model ? { requestedModel } : {};
135752
+ if (parsed.data.stream === true) {
135753
+ const rendered = async function* () {
135754
+ for await (const frame of frames()) {
135755
+ yield renderSseFrame2(frame);
135756
+ }
135757
+ };
135758
+ return {
135759
+ status: HTTP_STATUS.ok,
135760
+ headers: {
135761
+ "Content-Type": "text/event-stream",
135762
+ "Cache-Control": "no-cache",
135763
+ Connection: "keep-alive",
135764
+ ...quotaHeaders2
135765
+ },
135766
+ body: rendered(),
135767
+ ...served
135768
+ };
135769
+ }
135770
+ for await (const frame of frames()) {
135771
+ if (frame.event === "error") {
135772
+ return { status: HTTP_STATUS.badGateway, headers: { "Content-Type": "application/json" }, body: JSON.stringify(frame.data) };
135773
+ }
135774
+ }
135775
+ return { status: HTTP_STATUS.ok, headers: { "Content-Type": "application/json", ...quotaHeaders2 }, body: JSON.stringify(relay.message()), ...served };
135754
135776
  };
135755
135777
  }
135756
135778
 
package/dist/index.cjs CHANGED
@@ -4762,7 +4762,7 @@ var init_package = __esm({
4762
4762
  "package.json"() {
4763
4763
  package_default = {
4764
4764
  name: "agent-shim",
4765
- version: "11.71.0",
4765
+ version: "11.72.0",
4766
4766
  description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
4767
4767
  license: "MIT",
4768
4768
  author: "Joseph Mearman <joseph@mearman.co.uk>",
package/dist/index.mjs CHANGED
@@ -4738,7 +4738,7 @@ var init_package = __esm({
4738
4738
  "package.json"() {
4739
4739
  package_default = {
4740
4740
  name: "agent-shim",
4741
- version: "11.71.0",
4741
+ version: "11.72.0",
4742
4742
  description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
4743
4743
  license: "MIT",
4744
4744
  author: "Joseph Mearman <joseph@mearman.co.uk>",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-shim",
3
- "version": "11.71.0",
3
+ "version": "11.72.0",
4
4
  "description": "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
5
5
  "license": "MIT",
6
6
  "author": "Joseph Mearman <joseph@mearman.co.uk>",