@yukino.js/yukino 0.0.2 → 0.0.3

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 (27) hide show
  1. package/README.md +20 -22
  2. package/dist/{acp-GPESP7MI.js → acp-5YESBJ7N.js} +6 -6
  3. package/dist/{agent-MPSZKLGX.js → agent-D6LSQHAD.js} +1 -1
  4. package/dist/{anthropic-D7RVWNCE.js → anthropic-CEUDAJL2.js} +1 -1
  5. package/dist/{chunk-IXRJQ6NU.js → chunk-6GCU7CRK.js} +95 -95
  6. package/dist/chunk-7DLUKIPE.js +5 -0
  7. package/dist/{chunk-Z2OKAF7A.js → chunk-OAFPGTZY.js} +24 -24
  8. package/dist/{chunk-RC3MYRC3.js → chunk-QG22QNQJ.js} +1 -1
  9. package/dist/{chunk-MY5FSQD6.js → chunk-YBUSZS75.js} +2 -2
  10. package/dist/{esm-ZTIYTMTS.js → esm-NCEEJIH3.js} +3 -3
  11. package/dist/lib/{agent-H42OYQUH.js → agent-KNGNHPSW.js} +3 -3
  12. package/dist/lib/{anthropic-GTRJZUG3.js → anthropic-MSGL4VBM.js} +2 -2
  13. package/dist/lib/{chunk-OMEH2HQI.js → chunk-BDJLW7U2.js} +3 -3
  14. package/dist/lib/{chunk-PY2WWTDH.js → chunk-BMODZ6SU.js} +11 -2
  15. package/dist/lib/{chunk-UOQV7CZM.js → chunk-E6VFL5IO.js} +1 -1
  16. package/dist/lib/{chunk-AR6FQWXI.js → chunk-ENTAZT2J.js} +1 -1
  17. package/dist/lib/{chunk-AEGITC5R.js → chunk-K4VUUC44.js} +1 -1
  18. package/dist/lib/index.d.ts +10 -1
  19. package/dist/lib/index.js +18 -9
  20. package/dist/lib/{openai-UQC5X2TR.js → openai-DL5VBJR4.js} +2 -2
  21. package/dist/lib/{providers-UA4VT5HA.js → providers-VKVMAYIT.js} +1 -1
  22. package/dist/main.js +186 -184
  23. package/dist/{openai-AEXTBM62.js → openai-AQNX24XU.js} +1 -1
  24. package/dist/{providers-JRGWHWTS.js → providers-SVAEL2RU.js} +1 -1
  25. package/dist/{server-SAJ7FDJQ.js → server-UI2ZQVXG.js} +1 -1
  26. package/package.json +6 -6
  27. package/dist/chunk-7UAMH7BZ.js +0 -5
@@ -2,10 +2,10 @@ import {
2
2
  Agent,
3
3
  events_exports,
4
4
  streaming_executor_exports
5
- } from "./chunk-OMEH2HQI.js";
6
- import "./chunk-AEGITC5R.js";
5
+ } from "./chunk-BDJLW7U2.js";
6
+ import "./chunk-K4VUUC44.js";
7
7
  import "./chunk-F2YJG72O.js";
8
- import "./chunk-PY2WWTDH.js";
8
+ import "./chunk-BMODZ6SU.js";
9
9
  import "./chunk-6AKRDUQF.js";
10
10
  import "./chunk-7SU77J32.js";
11
11
  import "./chunk-MLKGABMK.js";
@@ -4,9 +4,9 @@ import {
4
4
  markLastUserTailForCache,
5
5
  markToolsForCache,
6
6
  needsToolSearchBeta
7
- } from "./chunk-AR6FQWXI.js";
7
+ } from "./chunk-ENTAZT2J.js";
8
8
  import "./chunk-F2YJG72O.js";
9
- import "./chunk-PY2WWTDH.js";
9
+ import "./chunk-BMODZ6SU.js";
10
10
  import "./chunk-6AKRDUQF.js";
11
11
  import "./chunk-7SU77J32.js";
12
12
  import "./chunk-MLKGABMK.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  providers_exports
3
- } from "./chunk-AEGITC5R.js";
3
+ } from "./chunk-K4VUUC44.js";
4
4
  import {
5
5
  normalizeToolResultContentBlock
6
6
  } from "./chunk-F2YJG72O.js";
@@ -11,7 +11,7 @@ import {
11
11
  REJECTED_TOOL_RESULT,
12
12
  RateLimitError,
13
13
  pairing_exports
14
- } from "./chunk-PY2WWTDH.js";
14
+ } from "./chunk-BMODZ6SU.js";
15
15
  import {
16
16
  McpCallTool
17
17
  } from "./chunk-6AKRDUQF.js";
@@ -106,7 +106,7 @@ async function initializeTelemetry() {
106
106
  if (!shouldInitialize()) {
107
107
  return;
108
108
  }
109
- initialization = import("./providers-UA4VT5HA.js").then(async ({ createTelemetryRuntime }) => {
109
+ initialization = import("./providers-VKVMAYIT.js").then(async ({ createTelemetryRuntime }) => {
110
110
  runtime = await createTelemetryRuntime();
111
111
  runtime.setMode(mode);
112
112
  process.once("beforeExit", () => {
@@ -251,6 +251,7 @@ var SandboxYamlConfigSchema = z.object({
251
251
  network_enabled: z.boolean().optional()
252
252
  });
253
253
  var AppConfigSchema = z.looseObject({
254
+ default_provider: z.number().default(0),
254
255
  providers: z.array(ProviderConfigSchema),
255
256
  permission_mode: z.string().optional(),
256
257
  mcp_servers: z.array(MCPServerConfigSchema).default([]),
@@ -276,7 +277,7 @@ function loadSingleFile(path) {
276
277
  const raw = yaml.load(data);
277
278
  if (!isRecord(raw)) {
278
279
  log.error({ path }, "invalid yaml");
279
- return { providers: [], mcp_servers: [], hooks: [] };
280
+ return { default_provider: 0, providers: [], mcp_servers: [], hooks: [] };
280
281
  }
281
282
  const parsed = safeParse(AppConfigSchema, raw);
282
283
  if (parsed.success) {
@@ -287,6 +288,7 @@ function loadSingleFile(path) {
287
288
  };
288
289
  }
289
290
  log.error({ error: parsed.error }, "config error");
291
+ let defaultProvider = 0;
290
292
  let providers = [];
291
293
  let permissionMode;
292
294
  let mcpServers = [];
@@ -294,6 +296,12 @@ function loadSingleFile(path) {
294
296
  let sandbox = void 0;
295
297
  let enableCoordinatorMode = false;
296
298
  let enableFork = true;
299
+ if ("default_provider" in raw) {
300
+ const parsed2 = safeParse(z.number(), raw.default_provider);
301
+ if (parsed2.success) {
302
+ defaultProvider = parsed2.data;
303
+ }
304
+ }
297
305
  if ("providers" in raw) {
298
306
  const parsed2 = safeParse(z.array(ProviderConfigSchema), raw.providers);
299
307
  if (parsed2.success) {
@@ -340,6 +348,7 @@ function loadSingleFile(path) {
340
348
  enableFork = Boolean(raw.enable_fork);
341
349
  }
342
350
  return {
351
+ default_provider: defaultProvider,
343
352
  providers,
344
353
  permission_mode: permissionMode,
345
354
  mcp_servers: mcpServers,
@@ -510,7 +519,7 @@ function loadConfig(path, options = {}) {
510
519
  const candidate = globalConfigPath();
511
520
  if (!existsSync(candidate)) {
512
521
  if (options.allowEmptyProviders) {
513
- return { providers: [], mcp_servers: [], hooks: [] };
522
+ return { default_provider: 0, providers: [], mcp_servers: [], hooks: [] };
514
523
  }
515
524
  throw new ConfigError(`No config file found, expected ${candidate}.`);
516
525
  }
@@ -12,7 +12,7 @@ import {
12
12
  getThinkingLevel,
13
13
  resolveAPIKey,
14
14
  toReasoningEffort
15
- } from "./chunk-PY2WWTDH.js";
15
+ } from "./chunk-BMODZ6SU.js";
16
16
  import {
17
17
  asRecord,
18
18
  asString,
@@ -18,7 +18,7 @@ import {
18
18
  thinkingBudgetForLevel,
19
19
  toAnthropicThinkingEffort,
20
20
  toReasoningEffort
21
- } from "./chunk-PY2WWTDH.js";
21
+ } from "./chunk-BMODZ6SU.js";
22
22
  import {
23
23
  MCP_TOOL_PREFIX,
24
24
  isMcpToolLike
@@ -52,7 +52,7 @@ var PackageJsonSchema = z.object({
52
52
  });
53
53
  function resolveVersion() {
54
54
  if (true) {
55
- return "0.0.2";
55
+ return "0.0.3";
56
56
  }
57
57
  const here = path.dirname(fileURLToPath(import.meta.url));
58
58
  for (const levels of ["..", "../.."]) {
@@ -1416,6 +1416,7 @@ declare const SandboxYamlConfigSchema: z$1.ZodObject<{
1416
1416
  }, z$1.core.$strip>;
1417
1417
  type SandboxYamlConfig = z$1.infer<typeof SandboxYamlConfigSchema>;
1418
1418
  declare const AppConfigSchema: z$1.ZodObject<{
1419
+ default_provider: z$1.ZodDefault<z$1.ZodNumber>;
1419
1420
  providers: z$1.ZodArray<z$1.ZodObject<{
1420
1421
  name: z$1.ZodString;
1421
1422
  protocol: z$1.ZodEnum<{
@@ -4782,12 +4783,20 @@ declare function saveProvider(input: unknown, available: ProviderConfig[]): {
4782
4783
  * the endpoint is absent so callers can surface a clear error.
4783
4784
  */
4784
4785
  declare function persistThinkingLevel(baseUrl: string, level: ThinkingLevel): void;
4786
+ /**
4787
+ * Persist the index (into the config's providers array) of the provider the
4788
+ * user selected last, so the next start selects it directly instead of showing
4789
+ * the provider picker. No-op when the stored index already matches, so the file
4790
+ * is not rewritten (and reformatted) on every selection.
4791
+ */
4792
+ declare function persistDefaultProvider(index: number): void;
4785
4793
 
4786
4794
  declare const providerLogin_ProviderLoginSchema: typeof ProviderLoginSchema;
4795
+ declare const providerLogin_persistDefaultProvider: typeof persistDefaultProvider;
4787
4796
  declare const providerLogin_persistThinkingLevel: typeof persistThinkingLevel;
4788
4797
  declare const providerLogin_saveProvider: typeof saveProvider;
4789
4798
  declare namespace providerLogin {
4790
- export { providerLogin_ProviderLoginSchema as ProviderLoginSchema, providerLogin_persistThinkingLevel as persistThinkingLevel, providerLogin_saveProvider as saveProvider };
4799
+ export { providerLogin_ProviderLoginSchema as ProviderLoginSchema, providerLogin_persistDefaultProvider as persistDefaultProvider, providerLogin_persistThinkingLevel as persistThinkingLevel, providerLogin_saveProvider as saveProvider };
4791
4800
  }
4792
4801
 
4793
4802
  /**
package/dist/lib/index.js CHANGED
@@ -42,23 +42,23 @@ import {
42
42
  spillDir,
43
43
  telemetry_exports,
44
44
  tool_result_exports
45
- } from "./chunk-OMEH2HQI.js";
45
+ } from "./chunk-BDJLW7U2.js";
46
46
  import {
47
47
  version,
48
48
  version_exports
49
- } from "./chunk-AEGITC5R.js";
49
+ } from "./chunk-K4VUUC44.js";
50
50
  import {
51
51
  anthropic_exports,
52
52
  decideAndApply,
53
53
  strategy_exports
54
- } from "./chunk-AR6FQWXI.js";
54
+ } from "./chunk-ENTAZT2J.js";
55
55
  import {
56
56
  SKIP_DIRS,
57
57
  types_exports
58
58
  } from "./chunk-F2YJG72O.js";
59
59
  import {
60
60
  openai_exports
61
- } from "./chunk-UOQV7CZM.js";
61
+ } from "./chunk-E6VFL5IO.js";
62
62
  import {
63
63
  DEFAULT_CONTEXT_WINDOW,
64
64
  DEFAULT_MAX_OUTPUT_TOKENS,
@@ -76,7 +76,7 @@ import {
76
76
  isValidThinkingLevel,
77
77
  loadConfig,
78
78
  withProjectMcpServers
79
- } from "./chunk-PY2WWTDH.js";
79
+ } from "./chunk-BMODZ6SU.js";
80
80
  import {
81
81
  PermissionChecker,
82
82
  isSafeCommand,
@@ -971,6 +971,7 @@ ${args}`;
971
971
  var provider_login_exports = {};
972
972
  __export(provider_login_exports, {
973
973
  ProviderLoginSchema: () => ProviderLoginSchema,
974
+ persistDefaultProvider: () => persistDefaultProvider,
974
975
  persistThinkingLevel: () => persistThinkingLevel,
975
976
  saveProvider: () => saveProvider
976
977
  });
@@ -1089,6 +1090,14 @@ function persistThinkingLevel(baseUrl, level) {
1089
1090
  }
1090
1091
  writeConfigAtomic(path, { ...config, providers });
1091
1092
  }
1093
+ function persistDefaultProvider(index) {
1094
+ const path = globalConfigPath();
1095
+ const config = readConfigRaw(path);
1096
+ if (config.default_provider === index) {
1097
+ return;
1098
+ }
1099
+ writeConfigAtomic(path, { ...config, default_provider: index });
1100
+ }
1092
1101
 
1093
1102
  // src/hooks/index.ts
1094
1103
  var hooks_exports = {};
@@ -1455,21 +1464,21 @@ __export(client_exports, {
1455
1464
  async function createClient(config, systemPrompt) {
1456
1465
  switch (config.protocol) {
1457
1466
  case "anthropic": {
1458
- const { AnthropicClient } = await import("./anthropic-GTRJZUG3.js");
1467
+ const { AnthropicClient } = await import("./anthropic-MSGL4VBM.js");
1459
1468
  return registerLlmClient(new AnthropicClient(config, systemPrompt), {
1460
1469
  model: config.model,
1461
1470
  protocol: config.protocol
1462
1471
  });
1463
1472
  }
1464
1473
  case "openai": {
1465
- const { OpenAIClient } = await import("./openai-UQC5X2TR.js");
1474
+ const { OpenAIClient } = await import("./openai-DL5VBJR4.js");
1466
1475
  return registerLlmClient(new OpenAIClient(config, systemPrompt), {
1467
1476
  model: config.model,
1468
1477
  protocol: config.protocol
1469
1478
  });
1470
1479
  }
1471
1480
  case "openai-compat": {
1472
- const { OpenAICompatClient } = await import("./openai-UQC5X2TR.js");
1481
+ const { OpenAICompatClient } = await import("./openai-DL5VBJR4.js");
1473
1482
  return registerLlmClient(new OpenAICompatClient(config, systemPrompt), {
1474
1483
  model: config.model,
1475
1484
  protocol: config.protocol
@@ -11757,7 +11766,7 @@ async function createRemoteAgent(opts) {
11757
11766
  throw new Error("no llm client (provider not initialized)");
11758
11767
  }
11759
11768
  const { PermissionChecker: PC } = await import("./permissions-Q4FBU5VD.js");
11760
- const { Agent: AgentClass } = await import("./agent-H42OYQUH.js");
11769
+ const { Agent: AgentClass } = await import("./agent-KNGNHPSW.js");
11761
11770
  const subConv = new ConversationManager();
11762
11771
  subConv.addUserMessage(prompt);
11763
11772
  const taskManager = new TaskManager();
@@ -3,8 +3,8 @@ import {
3
3
  OpenAICompatClient,
4
4
  buildChatCompletionMessages,
5
5
  buildOpenAIInput
6
- } from "./chunk-UOQV7CZM.js";
7
- import "./chunk-PY2WWTDH.js";
6
+ } from "./chunk-E6VFL5IO.js";
7
+ import "./chunk-BMODZ6SU.js";
8
8
  import "./chunk-7SU77J32.js";
9
9
  import "./chunk-MLKGABMK.js";
10
10
  export {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createTelemetryRuntime,
3
3
  parseExporterTypes
4
- } from "./chunk-AEGITC5R.js";
4
+ } from "./chunk-K4VUUC44.js";
5
5
  import "./chunk-MLKGABMK.js";
6
6
  export {
7
7
  createTelemetryRuntime,