@swifty.js/swifty 0.0.36 → 0.0.37

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 (35) hide show
  1. package/README.md +8 -8
  2. package/dist/{acp-ZU5LZRUP.js → acp-R22FJPVN.js} +1 -1
  3. package/dist/{agent-YDU6HB4S.js → agent-WOWGQDBG.js} +1 -1
  4. package/dist/anthropic-3DXT42SN.js +4 -0
  5. package/dist/{chunk-MTAGHTBG.js → chunk-ENZ5LHRN.js} +4 -4
  6. package/dist/{chunk-RDVRYI56.js → chunk-FOPUR6OB.js} +11 -11
  7. package/dist/{chunk-EEEW3GG4.js → chunk-LW273HD5.js} +1 -1
  8. package/dist/{chunk-Q3NPRV5P.js → chunk-QBGGDF62.js} +1 -1
  9. package/dist/{chunk-MNP6IJ7C.js → chunk-R62BGTT4.js} +2 -2
  10. package/dist/chunk-S2VEXEVV.js +4 -0
  11. package/dist/{chunk-H56UQALW.js → chunk-VN7HK3YD.js} +1 -1
  12. package/dist/chunk-YBS5ATGZ.js +4 -0
  13. package/dist/esm-VBV56AO5.js +229 -0
  14. package/dist/lib/{agent-ZMIS6IH6.js → agent-ZSFK66FQ.js} +2 -2
  15. package/dist/lib/{anthropic-FKIGL7NL.js → anthropic-GD3ILYG6.js} +1 -1
  16. package/dist/lib/{chunk-YUDCYSKO.js → chunk-5OJV33Y2.js} +17 -9
  17. package/dist/lib/{chunk-LRN4MOQ3.js → chunk-GWZDEU27.js} +0 -5
  18. package/dist/lib/{chunk-ALQHMYOZ.js → chunk-LKFJIK6F.js} +0 -3
  19. package/dist/lib/{chunk-PJ7354ZG.js → chunk-O35GIE35.js} +1 -1
  20. package/dist/lib/{chunk-6V7RW6HA.js → chunk-TD7Z6L4D.js} +10 -13
  21. package/dist/lib/index.d.ts +215 -491
  22. package/dist/lib/index.js +17 -358
  23. package/dist/lib/{openai-ZWIYIBLC.js → openai-N6X7XUQJ.js} +1 -1
  24. package/dist/lib/{providers-5SJFTU2G.js → providers-WQ3UOLMF.js} +1 -1
  25. package/dist/lib/{tool-filter-QU4LOZII.js → tool-filter-S3ZZOXFD.js} +1 -1
  26. package/dist/main.js +164 -164
  27. package/dist/{openai-7LMX5HKW.js → openai-XMJVVTTX.js} +1 -1
  28. package/dist/{providers-FQCJFM3Q.js → providers-NWLGMQOZ.js} +1 -1
  29. package/dist/{server-C6H5ZWUG.js → server-TINTK5DM.js} +1 -1
  30. package/dist/{tool-filter-U5SSL3LR.js → tool-filter-QETBQPHL.js} +1 -1
  31. package/package.json +2 -2
  32. package/dist/anthropic-GDT73MMP.js +0 -4
  33. package/dist/chunk-I7XJSLRI.js +0 -4
  34. package/dist/chunk-UJGMTIYO.js +0 -4
  35. package/dist/esm-PDXUGWFK.js +0 -229
package/dist/lib/index.js CHANGED
@@ -43,23 +43,23 @@ import {
43
43
  spillDir,
44
44
  telemetry_exports,
45
45
  tool_result_exports
46
- } from "./chunk-YUDCYSKO.js";
46
+ } from "./chunk-5OJV33Y2.js";
47
47
  import {
48
48
  version,
49
49
  version_exports
50
- } from "./chunk-PJ7354ZG.js";
50
+ } from "./chunk-O35GIE35.js";
51
51
  import {
52
52
  anthropic_exports,
53
53
  decideAndApply,
54
54
  strategy_exports
55
- } from "./chunk-6V7RW6HA.js";
55
+ } from "./chunk-TD7Z6L4D.js";
56
56
  import {
57
57
  SKIP_DIRS,
58
58
  types_exports
59
59
  } from "./chunk-BQFVUVLI.js";
60
60
  import {
61
61
  openai_exports
62
- } from "./chunk-ALQHMYOZ.js";
62
+ } from "./chunk-LKFJIK6F.js";
63
63
  import {
64
64
  DEFAULT_CONTEXT_WINDOW,
65
65
  DEFAULT_MAX_OUTPUT_TOKENS,
@@ -117,7 +117,7 @@ import {
117
117
  filterToolsForAgent,
118
118
  registry_exports,
119
119
  tool_filter_exports
120
- } from "./chunk-LRN4MOQ3.js";
120
+ } from "./chunk-GWZDEU27.js";
121
121
  import {
122
122
  bwrap_exports
123
123
  } from "./chunk-YIWNQ7OA.js";
@@ -1404,21 +1404,21 @@ __export(client_exports, {
1404
1404
  async function createClient(config, systemPrompt) {
1405
1405
  switch (config.protocol) {
1406
1406
  case "anthropic": {
1407
- const { AnthropicClient } = await import("./anthropic-FKIGL7NL.js");
1407
+ const { AnthropicClient } = await import("./anthropic-GD3ILYG6.js");
1408
1408
  return registerLlmClient(new AnthropicClient(config, systemPrompt), {
1409
1409
  model: config.model,
1410
1410
  protocol: config.protocol
1411
1411
  });
1412
1412
  }
1413
1413
  case "openai": {
1414
- const { OpenAIClient } = await import("./openai-ZWIYIBLC.js");
1414
+ const { OpenAIClient } = await import("./openai-N6X7XUQJ.js");
1415
1415
  return registerLlmClient(new OpenAIClient(config, systemPrompt), {
1416
1416
  model: config.model,
1417
1417
  protocol: config.protocol
1418
1418
  });
1419
1419
  }
1420
1420
  case "openai-compat": {
1421
- const { OpenAICompatClient } = await import("./openai-ZWIYIBLC.js");
1421
+ const { OpenAICompatClient } = await import("./openai-N6X7XUQJ.js");
1422
1422
  return registerLlmClient(new OpenAICompatClient(config, systemPrompt), {
1423
1423
  model: config.model,
1424
1424
  protocol: config.protocol
@@ -6166,7 +6166,7 @@ ${prompt}`;
6166
6166
  permissionChecker: ctx.permissionChecker?.forWorkDir(worktree.path)
6167
6167
  };
6168
6168
  }
6169
- const { cloneRegistryForFork } = await import("./tool-filter-QU4LOZII.js");
6169
+ const { cloneRegistryForFork } = await import("./tool-filter-S3ZZOXFD.js");
6170
6170
  const forkedRegistry = cloneRegistryForFork(this.registry);
6171
6171
  const snapshot = conversationSnapshot ?? this.conversation.fork();
6172
6172
  const output = await this.forkHandler(
@@ -8671,7 +8671,7 @@ var BashTool = class {
8671
8671
  networkEnabled: true
8672
8672
  };
8673
8673
  /**
8674
- * Background task registry, injected by the host (TUI / print mode / remote
8674
+ * Background task registry, injected by the host (UI / print mode / remote
8675
8675
  * server) — the same instance the Agent tool uses, so completion
8676
8676
  * notifications share one drain and TaskStop covers both. When null, Bash is
8677
8677
  * foreground-only: run_in_background disappears from the schema, timeouts
@@ -9800,22 +9800,6 @@ var ComputerUseTool = class {
9800
9800
  isConcurrencySafe(_args) {
9801
9801
  return false;
9802
9802
  }
9803
- providerSchema(protocol) {
9804
- if (protocol === "anthropic") {
9805
- return {
9806
- type: "computer_20251124",
9807
- name: "computer",
9808
- display_width_px: this.displayWidthPx,
9809
- display_height_px: this.displayHeightPx,
9810
- ...this.displayNumber !== void 0 ? { display_number: this.displayNumber } : {},
9811
- ...this.enableZoom ? { enable_zoom: true } : {}
9812
- };
9813
- }
9814
- if (protocol === "openai") {
9815
- return { type: "computer" };
9816
- }
9817
- return void 0;
9818
- }
9819
9803
  schema() {
9820
9804
  return {
9821
9805
  name: this.name,
@@ -11386,7 +11370,7 @@ async function createRemoteAgent(opts) {
11386
11370
  throw new Error("no llm client (provider not initialized)");
11387
11371
  }
11388
11372
  const { PermissionChecker: PC } = await import("./permissions-77UJQITR.js");
11389
- const { Agent: AgentClass } = await import("./agent-ZMIS6IH6.js");
11373
+ const { Agent: AgentClass } = await import("./agent-ZSFK66FQ.js");
11390
11374
  const subConv = new ConversationManager();
11391
11375
  subConv.addUserMessage(prompt);
11392
11376
  const taskManager = new TaskManager();
@@ -15090,262 +15074,13 @@ function isDiffTool(toolName) {
15090
15074
  return toolName === "EditFile";
15091
15075
  }
15092
15076
 
15093
- // src/ui/index.ts
15094
- var ui_exports = {};
15095
- __export(ui_exports, {
15096
- Styles: () => styles_exports,
15097
- UseFollowUpQueue: () => use_follow_up_queue_exports,
15098
- UseIdeInput: () => use_ide_input_exports,
15099
- UseTeammateStates: () => use_teammate_states_exports
15100
- });
15101
-
15102
- // src/ui/styles.ts
15103
- var styles_exports = {};
15104
- __export(styles_exports, {
15105
- DARK_THEME: () => DARK_THEME,
15106
- ICONS: () => ICONS,
15107
- LIGHT_THEME: () => LIGHT_THEME,
15108
- THEME: () => THEME,
15109
- activityStatusColor: () => activityStatusColor,
15110
- setThemeMode: () => setThemeMode,
15111
- thinkingLevelColor: () => thinkingLevelColor
15112
- });
15113
- var DARK_THEME = {
15114
- accent: "#8abeb7",
15115
- bashMode: "#b5bd68",
15116
- border: "#5f87ff",
15117
- borderAccent: "#00d7ff",
15118
- borderMuted: "#505050",
15119
- customMessageBg: "#2d2838",
15120
- customMessageLabel: "#9575cd",
15121
- dim: "#666666",
15122
- error: "#cc6666",
15123
- mdCode: "#8abeb7",
15124
- mdCodeBlock: "#b5bd68",
15125
- mdCodeBlockBorder: "#808080",
15126
- mdHeading: "#f0c674",
15127
- mdHr: "#808080",
15128
- mdLink: "#81a2be",
15129
- mdLinkUrl: "#666666",
15130
- mdListBullet: "#8abeb7",
15131
- mdQuote: "#808080",
15132
- mdQuoteBorder: "#808080",
15133
- muted: "#808080",
15134
- searchMatchBg: "#3a3a4a",
15135
- searchMatchText: "#d4d4d4",
15136
- selectedBg: "#3a3a4a",
15137
- success: "#b5bd68",
15138
- syntaxComment: "#6A9955",
15139
- syntaxFunction: "#DCDCAA",
15140
- syntaxKeyword: "#569CD6",
15141
- syntaxNumber: "#B5CEA8",
15142
- syntaxOperator: "#D4D4D4",
15143
- syntaxPunctuation: "#D4D4D4",
15144
- syntaxString: "#CE9178",
15145
- syntaxType: "#4EC9B0",
15146
- syntaxVariable: "#9CDCFE",
15147
- text: "#d4d4d4",
15148
- thinking: "#808080",
15149
- thinkingText: "#808080",
15150
- thinkingHigh: "#b294bb",
15151
- thinkingLow: "#5f87af",
15152
- thinkingMax: "#ff5fff",
15153
- thinkingMedium: "#81a2be",
15154
- thinkingMinimal: "#6e6e6e",
15155
- thinkingOff: "#505050",
15156
- thinkingXHigh: "#d183e8",
15157
- toolDiffAdded: "#b5bd68",
15158
- toolDiffContext: "#808080",
15159
- toolDiffRemoved: "#cc6666",
15160
- toolErrorBg: "#3c2828",
15161
- toolOutput: "#808080",
15162
- toolPendingBg: "#282832",
15163
- toolSuccessBg: "#283228",
15164
- toolTitle: "#d4d4d4",
15165
- customMessageText: "#d4d4d4",
15166
- userMessageText: "#d4d4d4",
15167
- userMessageBg: "#343541",
15168
- warning: "#ffff00"
15169
- };
15170
- var LIGHT_THEME = {
15171
- accent: "#5a8080",
15172
- bashMode: "#588458",
15173
- border: "#547da7",
15174
- borderAccent: "#5a8080",
15175
- borderMuted: "#b0b0b0",
15176
- customMessageBg: "#ede7f6",
15177
- customMessageLabel: "#7e57c2",
15178
- dim: "#767676",
15179
- error: "#aa5555",
15180
- mdCode: "#5a8080",
15181
- mdCodeBlock: "#588458",
15182
- mdCodeBlockBorder: "#6c6c6c",
15183
- mdHeading: "#9a7326",
15184
- mdHr: "#6c6c6c",
15185
- mdLink: "#547da7",
15186
- mdLinkUrl: "#767676",
15187
- mdListBullet: "#588458",
15188
- mdQuote: "#6c6c6c",
15189
- mdQuoteBorder: "#6c6c6c",
15190
- muted: "#6c6c6c",
15191
- searchMatchBg: "#d0d0e0",
15192
- searchMatchText: "#1f2328",
15193
- selectedBg: "#d0d0e0",
15194
- success: "#588458",
15195
- syntaxComment: "#008000",
15196
- syntaxFunction: "#795E26",
15197
- syntaxKeyword: "#0000FF",
15198
- syntaxNumber: "#098658",
15199
- syntaxOperator: "#000000",
15200
- syntaxPunctuation: "#000000",
15201
- syntaxString: "#A31515",
15202
- syntaxType: "#267F99",
15203
- syntaxVariable: "#001080",
15204
- text: "#1f2328",
15205
- thinking: "#6c6c6c",
15206
- thinkingText: "#6c6c6c",
15207
- thinkingHigh: "#875f87",
15208
- thinkingLow: "#547da7",
15209
- thinkingMax: "#af005f",
15210
- thinkingMedium: "#5a8080",
15211
- thinkingMinimal: "#767676",
15212
- thinkingOff: "#b0b0b0",
15213
- thinkingXHigh: "#8b008b",
15214
- toolDiffAdded: "#588458",
15215
- toolDiffContext: "#6c6c6c",
15216
- toolDiffRemoved: "#aa5555",
15217
- toolErrorBg: "#f0e8e8",
15218
- toolOutput: "#6c6c6c",
15219
- toolPendingBg: "#e8e8f0",
15220
- toolSuccessBg: "#e8f0e8",
15221
- toolTitle: "#1f2328",
15222
- customMessageText: "#1f2328",
15223
- userMessageText: "#1f2328",
15224
- userMessageBg: "#e8e8e8",
15225
- warning: "#9a7326"
15226
- };
15227
- var THEME = { ...DARK_THEME };
15228
- function setThemeMode(mode) {
15229
- Object.assign(THEME, mode === "light" ? LIGHT_THEME : DARK_THEME);
15230
- }
15231
- function thinkingLevelColor(level) {
15232
- switch (level) {
15233
- case "off":
15234
- return THEME.thinkingOff;
15235
- case "minimal":
15236
- return THEME.thinkingMinimal;
15237
- case "low":
15238
- return THEME.thinkingLow;
15239
- case "medium":
15240
- return THEME.thinkingMedium;
15241
- case "high":
15242
- return THEME.thinkingHigh;
15243
- case "xhigh":
15244
- return THEME.thinkingXHigh;
15245
- case "max":
15246
- return THEME.thinkingMax;
15247
- }
15248
- }
15249
- function activityStatusColor(status) {
15250
- switch (status) {
15251
- case "working":
15252
- return THEME.thinkingHigh;
15253
- case "retry":
15254
- return THEME.warning;
15255
- case "compacting":
15256
- return THEME.accent;
15257
- case "error":
15258
- return THEME.error;
15259
- case "idle":
15260
- return THEME.borderMuted;
15261
- }
15262
- }
15263
- var ICONS = {
15264
- active: "\u25C9",
15265
- arrow: "\u2192",
15266
- branch: "\u251C\u2500",
15267
- collapsed: "\u229E",
15268
- expanded: "\u229F",
15269
- inactive: "\u25CB",
15270
- lastBranch: "\u2514\u2500",
15271
- prompt: ">",
15272
- success: "\u2713",
15273
- tree: "\u2502"
15274
- };
15275
-
15276
- // src/ui/use-follow-up-queue.ts
15277
- var use_follow_up_queue_exports = {};
15278
- __export(use_follow_up_queue_exports, {
15279
- useFollowUpQueue: () => useFollowUpQueue
15280
- });
15281
- import { useCallback, useEffect, useRef, useState } from "react";
15282
- function useFollowUpQueue({ blocked, send, onError }) {
15283
- const pending = useRef([]);
15284
- const active = useRef(false);
15285
- const mounted = useRef(true);
15286
- const callbacks = useRef({ send, onError });
15287
- callbacks.current = { send, onError };
15288
- const [messages, setMessages] = useState([]);
15289
- const [processing, setProcessing] = useState(false);
15290
- const [paused, setPaused] = useState(false);
15291
- useEffect(() => {
15292
- mounted.current = true;
15293
- return () => {
15294
- mounted.current = false;
15295
- };
15296
- }, []);
15297
- const enqueue = useCallback((message) => {
15298
- if (!message.trim()) {
15299
- return;
15300
- }
15301
- pending.current = [...pending.current, message];
15302
- setMessages(pending.current);
15303
- setPaused(false);
15304
- }, []);
15305
- const takeLast = useCallback(() => {
15306
- const message = pending.current.at(-1);
15307
- if (message === void 0) {
15308
- return void 0;
15309
- }
15310
- pending.current = pending.current.slice(0, -1);
15311
- setMessages(pending.current);
15312
- return message;
15313
- }, []);
15314
- useEffect(() => {
15315
- if (blocked || paused || active.current || pending.current.length === 0) {
15316
- return;
15317
- }
15318
- const next = pending.current[0];
15319
- pending.current = pending.current.slice(1);
15320
- active.current = true;
15321
- setMessages(pending.current);
15322
- setProcessing(true);
15323
- void (async () => {
15324
- try {
15325
- await callbacks.current.send(next);
15326
- } catch (error) {
15327
- if (mounted.current) {
15328
- setPaused(true);
15329
- callbacks.current.onError(error);
15330
- }
15331
- } finally {
15332
- active.current = false;
15333
- if (mounted.current) {
15334
- setProcessing(false);
15335
- }
15336
- }
15337
- })();
15338
- }, [blocked, messages, paused, processing]);
15339
- return { messages, enqueue, takeLast, processing, paused };
15340
- }
15341
-
15342
- // src/ui/use-ide-input.ts
15343
- var use_ide_input_exports = {};
15344
- __export(use_ide_input_exports, {
15345
- useIdeInput: () => useIdeInput
15077
+ // src/vscode/index.ts
15078
+ var vscode_exports = {};
15079
+ __export(vscode_exports, {
15080
+ IdeClient: () => ide_client_exports,
15081
+ Lockfile: () => lockfile_exports,
15082
+ WsTransport: () => ws_transport_exports
15346
15083
  });
15347
- import { relative as relative4 } from "path";
15348
- import { useEffect as useEffect2, useRef as useRef2 } from "react";
15349
15084
 
15350
15085
  // src/vscode/ide-client.ts
15351
15086
  var ide_client_exports = {};
@@ -15610,81 +15345,6 @@ async function connectToIde(opts) {
15610
15345
  };
15611
15346
  }
15612
15347
 
15613
- // src/ui/use-ide-input.ts
15614
- function useIdeInput(workDir) {
15615
- const insertInputTextRef = useRef2(null);
15616
- const clearInputRef = useRef2(null);
15617
- useEffect2(() => {
15618
- let connection = null;
15619
- let cancelled = false;
15620
- const controller = new AbortController();
15621
- void connectToIde({
15622
- cwd: workDir,
15623
- signal: controller.signal,
15624
- onAtMentioned: ({ filePath, lineStart, lineEnd }) => {
15625
- const rel = relative4(workDir, filePath);
15626
- const shown = rel && !rel.startsWith("..") ? rel : filePath;
15627
- let mention = `@${shown}`;
15628
- if (lineStart !== void 0) {
15629
- mention += `#L${String(lineStart)}`;
15630
- if (lineEnd !== void 0 && lineEnd !== lineStart) {
15631
- mention += `-${String(lineEnd)}`;
15632
- }
15633
- }
15634
- insertInputTextRef.current?.(mention + " ");
15635
- }
15636
- }).then((connected) => {
15637
- if (!connected) {
15638
- return;
15639
- }
15640
- if (cancelled) {
15641
- void connected.close();
15642
- return;
15643
- }
15644
- connection = connected;
15645
- });
15646
- return () => {
15647
- cancelled = true;
15648
- controller.abort();
15649
- void connection?.close();
15650
- };
15651
- }, [workDir]);
15652
- return { insertInputTextRef, clearInputRef };
15653
- }
15654
-
15655
- // src/ui/use-teammate-states.ts
15656
- var use_teammate_states_exports = {};
15657
- __export(use_teammate_states_exports, {
15658
- useTeammateStates: () => useTeammateStates
15659
- });
15660
- import { useEffect as useEffect3, useState as useState2 } from "react";
15661
- function useTeammateStates(manager) {
15662
- const [states, setStates] = useState2([]);
15663
- useEffect3(() => {
15664
- let signature = "";
15665
- const timer = setInterval(() => {
15666
- const next = manager.getAllTeammateStates();
15667
- const nextSignature = JSON.stringify(next);
15668
- if (nextSignature !== signature) {
15669
- signature = nextSignature;
15670
- setStates(next);
15671
- }
15672
- }, 500);
15673
- return () => {
15674
- clearInterval(timer);
15675
- };
15676
- }, [manager]);
15677
- return states;
15678
- }
15679
-
15680
- // src/vscode/index.ts
15681
- var vscode_exports = {};
15682
- __export(vscode_exports, {
15683
- IdeClient: () => ide_client_exports,
15684
- Lockfile: () => lockfile_exports,
15685
- WsTransport: () => ws_transport_exports
15686
- });
15687
-
15688
15348
  // src/print-mode.ts
15689
15349
  var print_mode_exports = {};
15690
15350
  __export(print_mode_exports, {
@@ -16303,7 +15963,6 @@ export {
16303
15963
  todo_exports as Todo,
16304
15964
  tool_result_exports as ToolResult,
16305
15965
  tools_exports3 as Tools,
16306
- ui_exports as UI,
16307
15966
  utils_exports as Utils,
16308
15967
  vscode_exports as VSCode,
16309
15968
  version_exports as Version,
@@ -3,7 +3,7 @@ import {
3
3
  OpenAICompatClient,
4
4
  buildChatCompletionMessages,
5
5
  buildOpenAIInput
6
- } from "./chunk-ALQHMYOZ.js";
6
+ } from "./chunk-LKFJIK6F.js";
7
7
  import "./chunk-HQSYRTER.js";
8
8
  import "./chunk-ZPIF7IJN.js";
9
9
  import "./chunk-MLKGABMK.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createTelemetryRuntime,
3
3
  parseExporterTypes
4
- } from "./chunk-PJ7354ZG.js";
4
+ } from "./chunk-O35GIE35.js";
5
5
  import "./chunk-MLKGABMK.js";
6
6
  export {
7
7
  createTelemetryRuntime,
@@ -7,7 +7,7 @@ import {
7
7
  TEAMMATE_DISALLOWED_TOOLS,
8
8
  cloneRegistryForFork,
9
9
  filterToolsForAgent
10
- } from "./chunk-LRN4MOQ3.js";
10
+ } from "./chunk-GWZDEU27.js";
11
11
  import "./chunk-MLKGABMK.js";
12
12
  export {
13
13
  ASYNC_AGENT_ALLOWED_TOOLS,