@cleocode/core 2026.9.26 → 2026.10.1

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 (52) hide show
  1. package/dist/build-provenance.json +2 -2
  2. package/dist/cloud/nexus-attach.d.ts +94 -0
  3. package/dist/cloud/nexus-attach.d.ts.map +1 -0
  4. package/dist/cloud/nexus-attach.js +192 -0
  5. package/dist/cloud/nexus-attach.js.map +1 -0
  6. package/dist/cloud/nexus-auth.d.ts +15 -3
  7. package/dist/cloud/nexus-auth.d.ts.map +1 -1
  8. package/dist/cloud/nexus-auth.js +90 -6
  9. package/dist/cloud/nexus-auth.js.map +1 -1
  10. package/dist/cloud/nexus-cloud-status.d.ts +132 -0
  11. package/dist/cloud/nexus-cloud-status.d.ts.map +1 -0
  12. package/dist/cloud/nexus-cloud-status.js +440 -0
  13. package/dist/cloud/nexus-cloud-status.js.map +1 -0
  14. package/dist/cloud/nexus-cloud.d.ts +179 -0
  15. package/dist/cloud/nexus-cloud.d.ts.map +1 -0
  16. package/dist/cloud/nexus-cloud.js +296 -0
  17. package/dist/cloud/nexus-cloud.js.map +1 -0
  18. package/dist/cloud/nexus-device.d.ts +31 -6
  19. package/dist/cloud/nexus-device.d.ts.map +1 -1
  20. package/dist/cloud/nexus-device.js +54 -7
  21. package/dist/cloud/nexus-device.js.map +1 -1
  22. package/dist/cloud/nexus-enrol.d.ts +35 -4
  23. package/dist/cloud/nexus-enrol.d.ts.map +1 -1
  24. package/dist/cloud/nexus-enrol.js +187 -47
  25. package/dist/cloud/nexus-enrol.js.map +1 -1
  26. package/dist/cloud/nexus-link.d.ts +8 -1
  27. package/dist/cloud/nexus-link.d.ts.map +1 -1
  28. package/dist/cloud/nexus-link.js +138 -11
  29. package/dist/cloud/nexus-link.js.map +1 -1
  30. package/dist/cloud/nexus-logout.d.ts +114 -0
  31. package/dist/cloud/nexus-logout.d.ts.map +1 -0
  32. package/dist/cloud/nexus-logout.js +429 -0
  33. package/dist/cloud/nexus-logout.js.map +1 -0
  34. package/dist/docs/export-document.js +242 -37
  35. package/dist/docs/export-document.js.map +3 -3
  36. package/dist/llm/plugin-facade.js +343 -138
  37. package/dist/llm/plugin-facade.js.map +3 -3
  38. package/dist/selfimprove/fix-gen.js +347 -142
  39. package/dist/selfimprove/fix-gen.js.map +3 -3
  40. package/dist/setup/sections/nexus-account.d.ts +8 -6
  41. package/dist/setup/sections/nexus-account.d.ts.map +1 -1
  42. package/dist/setup/sections/nexus-account.js +53 -9
  43. package/dist/setup/sections/nexus-account.js.map +1 -1
  44. package/dist/store/sync/replica.d.ts +34 -3
  45. package/dist/store/sync/replica.d.ts.map +1 -1
  46. package/dist/store/sync/replica.js +39 -2
  47. package/dist/store/sync/replica.js.map +1 -1
  48. package/dist/store/sync/schema.d.ts +6 -3
  49. package/dist/store/sync/schema.d.ts.map +1 -1
  50. package/dist/store/sync/schema.js +6 -3
  51. package/dist/store/sync/schema.js.map +1 -1
  52. package/package.json +13 -13
@@ -17463,6 +17463,210 @@ var init_nexus_account = __esm({
17463
17463
  }
17464
17464
  });
17465
17465
 
17466
+ // packages/contracts/src/nexus-cloud.ts
17467
+ import { z as z26 } from "zod";
17468
+ var NEXUS_DEVICE_STATES, NEXUS_CLOUD_PROFILES, NEXUS_DEVICE_STATE_UNKNOWN, isoTime, profile, deviceState, nexusCloudCredentialSchema, nexusCloudDeviceSchema, nexusCloudOrganizationSchema, nexusCloudUserSchema, nexusCloudWhoamiSchema, nexusCloudDevicePageSchema, nexusCloudPresenceSchema, nexusCloudReplicaSchema, nexusCloudDeviceCountsSchema, projectFields, nexusCloudProjectListItemSchema, nexusCloudProjectPageSchema, nexusCloudProjectDetailSchema, nexusCloudReplicaPageSchema, NEXUS_STATUS_CHECK_IDS, NEXUS_STATUS_VERDICTS, CLOUD_STATUS_VERDICTS, knownCheckId, nexusCloudStatusCheckSchema, nexusCloudStatusSchema;
17469
+ var init_nexus_cloud = __esm({
17470
+ "packages/contracts/src/nexus-cloud.ts"() {
17471
+ "use strict";
17472
+ NEXUS_DEVICE_STATES = ["active", "signed-out", "revoked"];
17473
+ NEXUS_CLOUD_PROFILES = ["device", "read-only"];
17474
+ NEXUS_DEVICE_STATE_UNKNOWN = "unknown";
17475
+ isoTime = z26.iso.datetime({ offset: true });
17476
+ profile = z26.enum(NEXUS_CLOUD_PROFILES).nullable().catch(null);
17477
+ deviceState = z26.enum([...NEXUS_DEVICE_STATES, NEXUS_DEVICE_STATE_UNKNOWN]).catch(NEXUS_DEVICE_STATE_UNKNOWN);
17478
+ nexusCloudCredentialSchema = z26.object({
17479
+ kind: z26.enum(["device", "session"]),
17480
+ credentialId: z26.string().nullable().optional(),
17481
+ profile: profile.optional(),
17482
+ scopes: z26.array(z26.string()).default([]),
17483
+ createdAt: isoTime.nullable().optional(),
17484
+ lastUsedAt: isoTime.nullable().optional(),
17485
+ /** When the credential expires if it is not used again; null for sessions. */
17486
+ idleExpiresAt: isoTime.nullable().optional()
17487
+ });
17488
+ nexusCloudDeviceSchema = z26.object({
17489
+ deviceId: z26.string(),
17490
+ name: z26.string(),
17491
+ platform: z26.string().optional(),
17492
+ arch: z26.string().nullable().optional(),
17493
+ cliVersion: z26.string().nullable().optional(),
17494
+ createdAt: isoTime.optional(),
17495
+ lastSeenAt: isoTime.nullable().optional(),
17496
+ state: deviceState,
17497
+ signedOutAt: isoTime.nullable().optional(),
17498
+ /** Base64 device certificate; null until the device holds a key grant. */
17499
+ certificate: z26.string().nullable().optional(),
17500
+ /** The current credential's profile, or null with none (signed out or revoked). */
17501
+ profile: profile.optional(),
17502
+ /** True for the device whose credential made this request. */
17503
+ current: z26.boolean().default(false),
17504
+ projects: z26.number().int().nonnegative().optional(),
17505
+ replicas: z26.number().int().nonnegative().optional(),
17506
+ lastSyncAt: isoTime.nullable().optional(),
17507
+ lastPresenceAt: isoTime.nullable().optional()
17508
+ });
17509
+ nexusCloudOrganizationSchema = z26.object({
17510
+ id: z26.string(),
17511
+ name: z26.string(),
17512
+ slug: z26.string().nullable().optional(),
17513
+ role: z26.string().optional(),
17514
+ personal: z26.boolean().optional()
17515
+ });
17516
+ nexusCloudUserSchema = z26.object({
17517
+ id: z26.string(),
17518
+ email: z26.string(),
17519
+ name: z26.string().nullable().optional()
17520
+ });
17521
+ nexusCloudWhoamiSchema = z26.object({
17522
+ serverTime: isoTime.optional(),
17523
+ user: nexusCloudUserSchema,
17524
+ organizations: z26.array(nexusCloudOrganizationSchema).default([]),
17525
+ credential: nexusCloudCredentialSchema,
17526
+ /** The calling device; null for a session caller. */
17527
+ device: nexusCloudDeviceSchema.nullable()
17528
+ });
17529
+ nexusCloudDevicePageSchema = z26.object({
17530
+ devices: z26.array(nexusCloudDeviceSchema),
17531
+ nextCursor: z26.string().max(512).nullable().default(null),
17532
+ truncated: z26.boolean().default(false)
17533
+ });
17534
+ nexusCloudPresenceSchema = z26.looseObject({
17535
+ observedAt: isoTime.optional(),
17536
+ sync: z26.object({ enabled: z26.boolean() }).optional()
17537
+ });
17538
+ nexusCloudReplicaSchema = z26.object({
17539
+ projectId: z26.string(),
17540
+ replicaId: z26.string(),
17541
+ deviceId: z26.string(),
17542
+ deviceName: z26.string(),
17543
+ deviceState: deviceState.optional(),
17544
+ attachedAt: isoTime.optional(),
17545
+ lastSyncAt: isoTime.nullable(),
17546
+ presence: nexusCloudPresenceSchema.nullable(),
17547
+ presenceAt: isoTime.nullable()
17548
+ });
17549
+ nexusCloudDeviceCountsSchema = z26.object({
17550
+ active: z26.number().int().nonnegative(),
17551
+ total: z26.number().int().nonnegative()
17552
+ });
17553
+ projectFields = {
17554
+ projectId: z26.string(),
17555
+ label: z26.string().nullable(),
17556
+ organizationId: z26.string(),
17557
+ organizationName: z26.string().optional(),
17558
+ remoteUrl: z26.string().nullable().optional(),
17559
+ createdAt: isoTime.optional()
17560
+ };
17561
+ nexusCloudProjectListItemSchema = z26.object({
17562
+ ...projectFields,
17563
+ role: z26.string(),
17564
+ streamId: z26.string().optional(),
17565
+ headSeq: z26.number().int().nonnegative().nullable().optional(),
17566
+ openConflicts: z26.number().int().nonnegative().optional(),
17567
+ replicas: z26.array(nexusCloudReplicaSchema).default([]),
17568
+ devices: nexusCloudDeviceCountsSchema.optional(),
17569
+ replicaCount: z26.number().int().nonnegative().optional(),
17570
+ lastSyncAt: isoTime.nullable().optional(),
17571
+ lastPresenceAt: isoTime.nullable().optional(),
17572
+ /** This project's replica list was cut at 50 (T12858). */
17573
+ replicasTruncated: z26.boolean().default(false)
17574
+ });
17575
+ nexusCloudProjectPageSchema = z26.object({
17576
+ projects: z26.array(nexusCloudProjectListItemSchema),
17577
+ nextCursor: z26.string().max(512).nullable().default(null),
17578
+ /** Anything in the page was cut (the project list or a replica list). */
17579
+ truncated: z26.boolean().default(false),
17580
+ /** The project list itself was cut at 1000 (T12858). */
17581
+ projectsTruncated: z26.boolean().default(false)
17582
+ });
17583
+ nexusCloudProjectDetailSchema = z26.object({
17584
+ project: z26.object({ ...projectFields, deletedAt: isoTime.nullable().optional() }),
17585
+ role: z26.string(),
17586
+ canTrash: z26.boolean().optional(),
17587
+ openConflicts: z26.number().int().nonnegative(),
17588
+ /** At most 50, oldest attachment first. */
17589
+ replicas: z26.array(nexusCloudReplicaSchema),
17590
+ devices: nexusCloudDeviceCountsSchema,
17591
+ replicaCount: z26.number().int().nonnegative().optional(),
17592
+ lastSyncAt: isoTime.nullable().optional(),
17593
+ /** `replicas` was cut at 50. */
17594
+ truncated: z26.boolean().default(false),
17595
+ stream: z26.object({
17596
+ streamId: z26.string(),
17597
+ headSeq: z26.number().int().nonnegative(),
17598
+ headCheckpointId: z26.string().nullable()
17599
+ }).nullable()
17600
+ });
17601
+ nexusCloudReplicaPageSchema = z26.object({
17602
+ replicas: z26.array(nexusCloudReplicaSchema),
17603
+ devices: nexusCloudDeviceCountsSchema.optional(),
17604
+ nextCursor: z26.string().max(512).nullable().default(null),
17605
+ truncated: z26.boolean().default(false)
17606
+ });
17607
+ NEXUS_STATUS_CHECK_IDS = [
17608
+ "credential.valid",
17609
+ "device.registered",
17610
+ "device.active",
17611
+ "device.certified",
17612
+ "project.registered",
17613
+ "project.writable",
17614
+ "replica.attached",
17615
+ "presence.fresh",
17616
+ "replica.synced",
17617
+ "conflicts.none"
17618
+ ];
17619
+ NEXUS_STATUS_VERDICTS = ["ok", "attention", "not-linked", "not-registered"];
17620
+ CLOUD_STATUS_VERDICTS = [...NEXUS_STATUS_VERDICTS, "not-signed-in"];
17621
+ knownCheckId = z26.enum(NEXUS_STATUS_CHECK_IDS);
17622
+ nexusCloudStatusCheckSchema = z26.object({
17623
+ id: z26.enum(NEXUS_STATUS_CHECK_IDS),
17624
+ ok: z26.boolean(),
17625
+ required: z26.boolean(),
17626
+ detail: z26.string()
17627
+ });
17628
+ nexusCloudStatusSchema = z26.object({
17629
+ serverTime: isoTime.optional(),
17630
+ apiVersion: z26.string().optional(),
17631
+ user: nexusCloudUserSchema,
17632
+ credential: nexusCloudCredentialSchema,
17633
+ device: nexusCloudDeviceSchema.nullable(),
17634
+ project: z26.object({
17635
+ projectId: z26.string(),
17636
+ registered: z26.boolean(),
17637
+ organizationId: z26.string().nullable(),
17638
+ organizationName: z26.string().nullable(),
17639
+ role: z26.string().nullable()
17640
+ }).nullable(),
17641
+ replica: z26.object({
17642
+ replicaId: z26.string(),
17643
+ attached: z26.boolean(),
17644
+ attachedElsewhere: z26.boolean(),
17645
+ attachedAt: isoTime.nullable(),
17646
+ lastSyncAt: isoTime.nullable(),
17647
+ presenceAt: isoTime.nullable(),
17648
+ lastReplicaSeq: z26.number().int().nonnegative().nullable().optional()
17649
+ }).nullable(),
17650
+ stream: z26.object({
17651
+ streamId: z26.string(),
17652
+ headSeq: z26.number().int().nonnegative(),
17653
+ headCheckpointId: z26.string().nullable(),
17654
+ openConflicts: z26.number().int().nonnegative(),
17655
+ devices: nexusCloudDeviceCountsSchema
17656
+ }).nullable(),
17657
+ /** Check ids added by a newer server are dropped, never a parse failure. */
17658
+ checks: z26.array(nexusCloudStatusCheckSchema.extend({ id: z26.string() })).transform(
17659
+ (list) => list.flatMap((c) => {
17660
+ const id = knownCheckId.safeParse(c.id);
17661
+ return id.success ? [{ ...c, id: id.data }] : [];
17662
+ })
17663
+ ),
17664
+ /** A verdict added by a newer server reads as `attention`: never `ok` by accident. */
17665
+ verdict: z26.enum(NEXUS_STATUS_VERDICTS).catch("attention")
17666
+ });
17667
+ }
17668
+ });
17669
+
17466
17670
  // packages/contracts/src/task-id.ts
17467
17671
  var init_task_id = __esm({
17468
17672
  "packages/contracts/src/task-id.ts"() {
@@ -17547,6 +17751,7 @@ var init_src = __esm({
17547
17751
  init_decide();
17548
17752
  init_decide_sites();
17549
17753
  init_nexus_account();
17754
+ init_nexus_cloud();
17550
17755
  init_task_id();
17551
17756
  }
17552
17757
  });
@@ -33295,7 +33500,7 @@ var init_task_claim = __esm({
33295
33500
  });
33296
33501
 
33297
33502
  // packages/core/src/store/converters.ts
33298
- import { z as z26 } from "zod";
33503
+ import { z as z27 } from "zod";
33299
33504
  function readStoredAcceptance(row) {
33300
33505
  if (row.acceptanceJson === null || row.acceptanceJson === void 0) return void 0;
33301
33506
  try {
@@ -33453,7 +33658,7 @@ var init_converters = __esm({
33453
33658
  init_src();
33454
33659
  init_parsers();
33455
33660
  init_task_claim();
33456
- storedAcceptanceSchema = z26.custom(
33661
+ storedAcceptanceSchema = z27.custom(
33457
33662
  (value) => Array.isArray(value) && value.every((item) => acceptanceItemSchema.safeParse(item).success)
33458
33663
  );
33459
33664
  }
@@ -36116,7 +36321,7 @@ import {
36116
36321
  } from "node:fs";
36117
36322
  import { createRequire as createRequire5 } from "node:module";
36118
36323
  import { basename as basename7, dirname as dirname12, join as join13 } from "node:path";
36119
- import { z as z27 } from "zod";
36324
+ import { z as z28 } from "zod";
36120
36325
  function formatBackupTimestamp(d) {
36121
36326
  const pad = (n, len = 2) => String(n).padStart(len, "0");
36122
36327
  return `${d.getFullYear()}${pad(d.getMonth() + 1)}${pad(d.getDate())}-${pad(d.getHours())}${pad(d.getMinutes())}${pad(d.getSeconds())}`;
@@ -36253,16 +36458,16 @@ var init_backup_sidecar = __esm({
36253
36458
  init_logger2();
36254
36459
  PRE_COLLAPSE_BACKUP_TYPE = "migration";
36255
36460
  MARKER_PREFIX = "twin_collapse:";
36256
- backupSidecarSchema = z27.object({
36257
- backupId: z27.string().min(1),
36258
- type: z27.string().min(1),
36259
- timestamp: z27.string().min(1),
36260
- note: z27.string().optional(),
36261
- files: z27.array(z27.string()),
36262
- pinned: z27.boolean().optional(),
36263
- pinnedReason: z27.string().optional(),
36264
- releasedAt: z27.string().optional(),
36265
- releasedReason: z27.string().optional()
36461
+ backupSidecarSchema = z28.object({
36462
+ backupId: z28.string().min(1),
36463
+ type: z28.string().min(1),
36464
+ timestamp: z28.string().min(1),
36465
+ note: z28.string().optional(),
36466
+ files: z28.array(z28.string()),
36467
+ pinned: z28.boolean().optional(),
36468
+ pinnedReason: z28.string().optional(),
36469
+ releasedAt: z28.string().optional(),
36470
+ releasedReason: z28.string().optional()
36266
36471
  }).passthrough();
36267
36472
  }
36268
36473
  });
@@ -36434,7 +36639,7 @@ var init_pre_repair_snapshot = __esm({
36434
36639
  import { createHash as createHash5 } from "node:crypto";
36435
36640
  import { basename as basename8, dirname as dirname15 } from "node:path";
36436
36641
  import { fileURLToPath as fileURLToPath4 } from "node:url";
36437
- import { z as z28 } from "zod";
36642
+ import { z as z29 } from "zod";
36438
36643
  function hasMainTable(db, name15) {
36439
36644
  return db.prepare("SELECT 1 FROM main.sqlite_master WHERE type = 'table' AND name = ?").get(name15) !== void 0;
36440
36645
  }
@@ -37567,20 +37772,20 @@ var init_twin_collapse = __esm({
37567
37772
  SHADOW_WRITE_REFUSED = "E_TWIN_COLLAPSE_FAILED: store is read-only until the twin collapse succeeds; run cleo doctor twin-collapse";
37568
37773
  SHADOW_WRITE_OPS = ["INSERT", "UPDATE", "DELETE"];
37569
37774
  STICKY_ARCHIVE_KEY = `${TWIN_COLLAPSE_ARCHIVE_PREFIX}sticky_tags`;
37570
- FocusNotesShape = z28.object({ sessionNotes: z28.array(z28.unknown()) }).passthrough();
37571
- StickyArchiveShape = z28.array(z28.string());
37572
- RecoveryReceiptShape = z28.object({
37573
- task: z28.literal("T12727"),
37574
- id: z28.string(),
37575
- recoveredAt: z28.string(),
37576
- snapshot: z28.string().nullable(),
37577
- archived: z28.array(z28.object({ key: z28.string(), archiveKey: z28.string(), sha: z28.string() })),
37578
- focusNotesAdded: z28.number(),
37579
- stickyArchived: z28.array(z28.string()),
37580
- stickyArchiveKey: z28.string(),
37581
- before: z28.object({ focusState: z28.string().nullable(), stickyArchive: z28.string().nullable() }),
37582
- after: z28.object({ focusState: z28.string().nullable(), stickyArchive: z28.string().nullable() }),
37583
- rolledBackAt: z28.string().nullable()
37775
+ FocusNotesShape = z29.object({ sessionNotes: z29.array(z29.unknown()) }).passthrough();
37776
+ StickyArchiveShape = z29.array(z29.string());
37777
+ RecoveryReceiptShape = z29.object({
37778
+ task: z29.literal("T12727"),
37779
+ id: z29.string(),
37780
+ recoveredAt: z29.string(),
37781
+ snapshot: z29.string().nullable(),
37782
+ archived: z29.array(z29.object({ key: z29.string(), archiveKey: z29.string(), sha: z29.string() })),
37783
+ focusNotesAdded: z29.number(),
37784
+ stickyArchived: z29.array(z29.string()),
37785
+ stickyArchiveKey: z29.string(),
37786
+ before: z29.object({ focusState: z29.string().nullable(), stickyArchive: z29.string().nullable() }),
37787
+ after: z29.object({ focusState: z29.string().nullable(), stickyArchive: z29.string().nullable() }),
37788
+ rolledBackAt: z29.string().nullable()
37584
37789
  });
37585
37790
  }
37586
37791
  });
@@ -45304,7 +45509,7 @@ var init_governor = __esm({
45304
45509
  // packages/core/src/store/exodus/recovery.ts
45305
45510
  import { randomUUID as randomUUID2 } from "node:crypto";
45306
45511
  import { constants } from "node:sqlite";
45307
- import { z as z29 } from "zod";
45512
+ import { z as z30 } from "zod";
45308
45513
  function identityValues(encoded) {
45309
45514
  return identitySchema.parse(JSON.parse(encoded)).map(([kind, value]) => {
45310
45515
  if (kind === "null") return null;
@@ -45640,8 +45845,8 @@ var init_recovery = __esm({
45640
45845
  "use strict";
45641
45846
  init_row_identity_registry();
45642
45847
  RECEIPTS = "_exodus_recovery_rows";
45643
- identitySchema = z29.array(
45644
- z29.tuple([z29.enum(["null", "integer", "real", "text", "blob"]), z29.string()])
45848
+ identitySchema = z30.array(
45849
+ z30.tuple([z30.enum(["null", "integer", "real", "text", "blob"]), z30.string()])
45645
45850
  );
45646
45851
  ExodusRecoveryError = class extends Error {
45647
45852
  };
@@ -45659,7 +45864,7 @@ import {
45659
45864
  writeFileSync as writeFileSync6
45660
45865
  } from "node:fs";
45661
45866
  import { basename as basename9, dirname as dirname19, join as join26, resolve as resolve12 } from "node:path";
45662
- import { z as z30 } from "zod";
45867
+ import { z as z31 } from "zod";
45663
45868
  function scopeBaseDir(scope, cwd, targetDbPath) {
45664
45869
  if (targetDbPath !== void 0) return dirname19(targetDbPath);
45665
45870
  return scope === "project" ? resolveCleoDir(cwd) : getCleoHome();
@@ -45802,11 +46007,11 @@ var init_archive2 = __esm({
45802
46007
  init_ensure_config();
45803
46008
  init_recovery();
45804
46009
  log8 = getLogger("exodus-archive");
45805
- markerIdentity = z30.object({
45806
- version: z30.literal(1),
45807
- scope: z30.enum(["project", "global"]),
45808
- targetDbPath: z30.string().optional(),
45809
- databaseIdentity: z30.string().optional()
46010
+ markerIdentity = z31.object({
46011
+ version: z31.literal(1),
46012
+ scope: z31.enum(["project", "global"]),
46013
+ targetDbPath: z31.string().optional(),
46014
+ databaseIdentity: z31.string().optional()
45810
46015
  });
45811
46016
  ARCHIVE_DIR_NAME = "_archive";
45812
46017
  MARKER_FILENAME_BY_SCOPE = {
@@ -53755,8 +53960,8 @@ async function scanAndLoadPlugins(pluginDir, api) {
53755
53960
  }
53756
53961
  async function runDiscovery(registerProvider2, builtins) {
53757
53962
  const api = { registerProvider: registerProvider2 };
53758
- for (const profile of builtins) {
53759
- registerProvider2(profile);
53963
+ for (const profile2 of builtins) {
53964
+ registerProvider2(profile2);
53760
53965
  }
53761
53966
  await scanAndLoadPlugins(getPluginDir(), api);
53762
53967
  }
@@ -53779,16 +53984,16 @@ __export(provider_registry_exports, {
53779
53984
  listProviders: () => listProviders,
53780
53985
  registerProvider: () => registerProvider
53781
53986
  });
53782
- function registerProvider(profile) {
53783
- const key = profile.name.toLowerCase();
53784
- _registry.set(key, profile);
53785
- for (const alias of profile.aliases ?? []) {
53987
+ function registerProvider(profile2) {
53988
+ const key = profile2.name.toLowerCase();
53989
+ _registry.set(key, profile2);
53990
+ for (const alias of profile2.aliases ?? []) {
53786
53991
  const aliasKey = alias.toLowerCase();
53787
53992
  const existing = _aliases.get(aliasKey);
53788
53993
  if (existing !== void 0 && existing !== key) {
53789
53994
  if (_registry.has(aliasKey) && aliasKey !== key) {
53790
53995
  throw new TypeError(
53791
- `[provider-registry] Alias "${alias}" for provider "${profile.name}" conflicts with the primary name of provider "${_registry.get(aliasKey)?.name ?? aliasKey}".`
53996
+ `[provider-registry] Alias "${alias}" for provider "${profile2.name}" conflicts with the primary name of provider "${_registry.get(aliasKey)?.name ?? aliasKey}".`
53792
53997
  );
53793
53998
  }
53794
53999
  }
@@ -54261,8 +54466,8 @@ var init_credential_pool = __esm({
54261
54466
  */
54262
54467
  async _refreshOAuthCredential(existing) {
54263
54468
  if (!existing.refreshToken) return;
54264
- const profile = await getProviderProfile(this.provider);
54265
- const oauthCfg = profile?.oauth;
54469
+ const profile2 = await getProviderProfile(this.provider);
54470
+ const oauthCfg = profile2?.oauth;
54266
54471
  if (oauthCfg?.mode === "pkce") {
54267
54472
  await this._refreshViaPkce(
54268
54473
  existing,
@@ -56213,7 +56418,7 @@ var init_structured_output = __esm({
56213
56418
 
56214
56419
  // packages/core/src/llm/transports/anthropic.ts
56215
56420
  import Anthropic from "@anthropic-ai/sdk";
56216
- import { z as z31 } from "zod";
56421
+ import { z as z32 } from "zod";
56217
56422
  function isTextBlock(block) {
56218
56423
  return block.type === "text";
56219
56424
  }
@@ -56285,8 +56490,8 @@ function mapUsage(usage) {
56285
56490
  function zodSchemaFrom(responseFormat) {
56286
56491
  if (responseFormat == null) return null;
56287
56492
  const asAny = responseFormat;
56288
- if (asAny["schema"] instanceof z31.ZodType) return asAny["schema"];
56289
- if (responseFormat instanceof z31.ZodType) return responseFormat;
56493
+ if (asAny["schema"] instanceof z32.ZodType) return asAny["schema"];
56494
+ if (responseFormat instanceof z32.ZodType) return responseFormat;
56290
56495
  return null;
56291
56496
  }
56292
56497
  function getJsonSchemaString(responseFormat) {
@@ -56692,7 +56897,7 @@ ${schemaJson}`
56692
56897
  content = typeof validated === "string" ? validated : JSON.stringify(validated);
56693
56898
  } catch {
56694
56899
  try {
56695
- const repaired = repairResponseModelJson(rawContent, zodSchema2 ?? z31.unknown(), modelName);
56900
+ const repaired = repairResponseModelJson(rawContent, zodSchema2 ?? z32.unknown(), modelName);
56696
56901
  content = typeof repaired === "string" ? repaired : JSON.stringify(repaired);
56697
56902
  } catch {
56698
56903
  content = rawContent || null;
@@ -58257,7 +58462,7 @@ var init_caching = __esm({
58257
58462
 
58258
58463
  // packages/core/src/llm/transports/gemini.ts
58259
58464
  import { GoogleGenerativeAI } from "@google/generative-ai";
58260
- import { z as z32 } from "zod";
58465
+ import { z as z33 } from "zod";
58261
58466
  function messagesToRaw(messages, system) {
58262
58467
  const raw = [];
58263
58468
  if (system) {
@@ -58645,7 +58850,7 @@ var init_gemini2 = __esm({
58645
58850
  const parsed = response["parsed"];
58646
58851
  if (parsed !== null && parsed !== void 0) {
58647
58852
  try {
58648
- const zodResult = z32.string().safeParse(String(parsed));
58853
+ const zodResult = z33.string().safeParse(String(parsed));
58649
58854
  if (!zodResult.success) {
58650
58855
  content = JSON.stringify(parsed);
58651
58856
  } else {
@@ -73042,7 +73247,7 @@ function resolveRef2(ref, ctx) {
73042
73247
  function convertBaseSchema(schema, ctx) {
73043
73248
  if (schema.not !== void 0) {
73044
73249
  if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
73045
- return z33.never();
73250
+ return z34.never();
73046
73251
  }
73047
73252
  throw new Error("not is not supported in Zod (except { not: {} } for never)");
73048
73253
  }
@@ -73064,7 +73269,7 @@ function convertBaseSchema(schema, ctx) {
73064
73269
  return ctx.refs.get(refPath);
73065
73270
  }
73066
73271
  if (ctx.processing.has(refPath)) {
73067
- return z33.lazy(() => {
73272
+ return z34.lazy(() => {
73068
73273
  if (!ctx.refs.has(refPath)) {
73069
73274
  throw new Error(`Circular reference not resolved: ${refPath}`);
73070
73275
  }
@@ -73081,25 +73286,25 @@ function convertBaseSchema(schema, ctx) {
73081
73286
  if (schema.enum !== void 0) {
73082
73287
  const enumValues = schema.enum;
73083
73288
  if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
73084
- return z33.null();
73289
+ return z34.null();
73085
73290
  }
73086
73291
  if (enumValues.length === 0) {
73087
- return z33.never();
73292
+ return z34.never();
73088
73293
  }
73089
73294
  if (enumValues.length === 1) {
73090
- return z33.literal(enumValues[0]);
73295
+ return z34.literal(enumValues[0]);
73091
73296
  }
73092
73297
  if (enumValues.every((v) => typeof v === "string")) {
73093
- return z33.enum(enumValues);
73298
+ return z34.enum(enumValues);
73094
73299
  }
73095
- const literalSchemas = enumValues.map((v) => z33.literal(v));
73300
+ const literalSchemas = enumValues.map((v) => z34.literal(v));
73096
73301
  if (literalSchemas.length < 2) {
73097
73302
  return literalSchemas[0];
73098
73303
  }
73099
- return z33.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
73304
+ return z34.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
73100
73305
  }
73101
73306
  if (schema.const !== void 0) {
73102
- return z33.literal(schema.const);
73307
+ return z34.literal(schema.const);
73103
73308
  }
73104
73309
  const type = schema.type;
73105
73310
  if (Array.isArray(type)) {
@@ -73108,68 +73313,68 @@ function convertBaseSchema(schema, ctx) {
73108
73313
  return convertBaseSchema(typeSchema, ctx);
73109
73314
  });
73110
73315
  if (typeSchemas.length === 0) {
73111
- return z33.never();
73316
+ return z34.never();
73112
73317
  }
73113
73318
  if (typeSchemas.length === 1) {
73114
73319
  return typeSchemas[0];
73115
73320
  }
73116
- return z33.union(typeSchemas);
73321
+ return z34.union(typeSchemas);
73117
73322
  }
73118
73323
  if (!type) {
73119
- return z33.any();
73324
+ return z34.any();
73120
73325
  }
73121
73326
  let zodSchema2;
73122
73327
  switch (type) {
73123
73328
  case "string": {
73124
- let stringSchema = z33.string();
73329
+ let stringSchema = z34.string();
73125
73330
  if (schema.format) {
73126
73331
  const format = schema.format;
73127
73332
  if (format === "email") {
73128
- stringSchema = stringSchema.check(z33.email());
73333
+ stringSchema = stringSchema.check(z34.email());
73129
73334
  } else if (format === "uri" || format === "uri-reference") {
73130
- stringSchema = stringSchema.check(z33.url());
73335
+ stringSchema = stringSchema.check(z34.url());
73131
73336
  } else if (format === "uuid" || format === "guid") {
73132
- stringSchema = stringSchema.check(z33.uuid());
73337
+ stringSchema = stringSchema.check(z34.uuid());
73133
73338
  } else if (format === "date-time") {
73134
- stringSchema = stringSchema.check(z33.iso.datetime());
73339
+ stringSchema = stringSchema.check(z34.iso.datetime());
73135
73340
  } else if (format === "date") {
73136
- stringSchema = stringSchema.check(z33.iso.date());
73341
+ stringSchema = stringSchema.check(z34.iso.date());
73137
73342
  } else if (format === "time") {
73138
- stringSchema = stringSchema.check(z33.iso.time());
73343
+ stringSchema = stringSchema.check(z34.iso.time());
73139
73344
  } else if (format === "duration") {
73140
- stringSchema = stringSchema.check(z33.iso.duration());
73345
+ stringSchema = stringSchema.check(z34.iso.duration());
73141
73346
  } else if (format === "ipv4") {
73142
- stringSchema = stringSchema.check(z33.ipv4());
73347
+ stringSchema = stringSchema.check(z34.ipv4());
73143
73348
  } else if (format === "ipv6") {
73144
- stringSchema = stringSchema.check(z33.ipv6());
73349
+ stringSchema = stringSchema.check(z34.ipv6());
73145
73350
  } else if (format === "mac") {
73146
- stringSchema = stringSchema.check(z33.mac());
73351
+ stringSchema = stringSchema.check(z34.mac());
73147
73352
  } else if (format === "cidr") {
73148
- stringSchema = stringSchema.check(z33.cidrv4());
73353
+ stringSchema = stringSchema.check(z34.cidrv4());
73149
73354
  } else if (format === "cidr-v6") {
73150
- stringSchema = stringSchema.check(z33.cidrv6());
73355
+ stringSchema = stringSchema.check(z34.cidrv6());
73151
73356
  } else if (format === "base64") {
73152
- stringSchema = stringSchema.check(z33.base64());
73357
+ stringSchema = stringSchema.check(z34.base64());
73153
73358
  } else if (format === "base64url") {
73154
- stringSchema = stringSchema.check(z33.base64url());
73359
+ stringSchema = stringSchema.check(z34.base64url());
73155
73360
  } else if (format === "e164") {
73156
- stringSchema = stringSchema.check(z33.e164());
73361
+ stringSchema = stringSchema.check(z34.e164());
73157
73362
  } else if (format === "jwt") {
73158
- stringSchema = stringSchema.check(z33.jwt());
73363
+ stringSchema = stringSchema.check(z34.jwt());
73159
73364
  } else if (format === "emoji") {
73160
- stringSchema = stringSchema.check(z33.emoji());
73365
+ stringSchema = stringSchema.check(z34.emoji());
73161
73366
  } else if (format === "nanoid") {
73162
- stringSchema = stringSchema.check(z33.nanoid());
73367
+ stringSchema = stringSchema.check(z34.nanoid());
73163
73368
  } else if (format === "cuid") {
73164
- stringSchema = stringSchema.check(z33.cuid());
73369
+ stringSchema = stringSchema.check(z34.cuid());
73165
73370
  } else if (format === "cuid2") {
73166
- stringSchema = stringSchema.check(z33.cuid2());
73371
+ stringSchema = stringSchema.check(z34.cuid2());
73167
73372
  } else if (format === "ulid") {
73168
- stringSchema = stringSchema.check(z33.ulid());
73373
+ stringSchema = stringSchema.check(z34.ulid());
73169
73374
  } else if (format === "xid") {
73170
- stringSchema = stringSchema.check(z33.xid());
73375
+ stringSchema = stringSchema.check(z34.xid());
73171
73376
  } else if (format === "ksuid") {
73172
- stringSchema = stringSchema.check(z33.ksuid());
73377
+ stringSchema = stringSchema.check(z34.ksuid());
73173
73378
  }
73174
73379
  }
73175
73380
  if (typeof schema.minLength === "number") {
@@ -73186,7 +73391,7 @@ function convertBaseSchema(schema, ctx) {
73186
73391
  }
73187
73392
  case "number":
73188
73393
  case "integer": {
73189
- let numberSchema = type === "integer" ? z33.number().int() : z33.number();
73394
+ let numberSchema = type === "integer" ? z34.number().int() : z34.number();
73190
73395
  if (typeof schema.minimum === "number") {
73191
73396
  numberSchema = numberSchema.min(schema.minimum);
73192
73397
  }
@@ -73210,11 +73415,11 @@ function convertBaseSchema(schema, ctx) {
73210
73415
  break;
73211
73416
  }
73212
73417
  case "boolean": {
73213
- zodSchema2 = z33.boolean();
73418
+ zodSchema2 = z34.boolean();
73214
73419
  break;
73215
73420
  }
73216
73421
  case "null": {
73217
- zodSchema2 = z33.null();
73422
+ zodSchema2 = z34.null();
73218
73423
  break;
73219
73424
  }
73220
73425
  case "object": {
@@ -73227,14 +73432,14 @@ function convertBaseSchema(schema, ctx) {
73227
73432
  }
73228
73433
  if (schema.propertyNames) {
73229
73434
  const keySchema = convertSchema(schema.propertyNames, ctx);
73230
- const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z33.any();
73435
+ const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z34.any();
73231
73436
  if (Object.keys(shape).length === 0) {
73232
- zodSchema2 = z33.record(keySchema, valueSchema);
73437
+ zodSchema2 = z34.record(keySchema, valueSchema);
73233
73438
  break;
73234
73439
  }
73235
- const objectSchema2 = z33.object(shape).passthrough();
73236
- const recordSchema = z33.looseRecord(keySchema, valueSchema);
73237
- zodSchema2 = z33.intersection(objectSchema2, recordSchema);
73440
+ const objectSchema2 = z34.object(shape).passthrough();
73441
+ const recordSchema = z34.looseRecord(keySchema, valueSchema);
73442
+ zodSchema2 = z34.intersection(objectSchema2, recordSchema);
73238
73443
  break;
73239
73444
  }
73240
73445
  if (schema.patternProperties) {
@@ -73243,28 +73448,28 @@ function convertBaseSchema(schema, ctx) {
73243
73448
  const looseRecords = [];
73244
73449
  for (const pattern of patternKeys) {
73245
73450
  const patternValue = convertSchema(patternProps[pattern], ctx);
73246
- const keySchema = z33.string().regex(new RegExp(pattern));
73247
- looseRecords.push(z33.looseRecord(keySchema, patternValue));
73451
+ const keySchema = z34.string().regex(new RegExp(pattern));
73452
+ looseRecords.push(z34.looseRecord(keySchema, patternValue));
73248
73453
  }
73249
73454
  const schemasToIntersect = [];
73250
73455
  if (Object.keys(shape).length > 0) {
73251
- schemasToIntersect.push(z33.object(shape).passthrough());
73456
+ schemasToIntersect.push(z34.object(shape).passthrough());
73252
73457
  }
73253
73458
  schemasToIntersect.push(...looseRecords);
73254
73459
  if (schemasToIntersect.length === 0) {
73255
- zodSchema2 = z33.object({}).passthrough();
73460
+ zodSchema2 = z34.object({}).passthrough();
73256
73461
  } else if (schemasToIntersect.length === 1) {
73257
73462
  zodSchema2 = schemasToIntersect[0];
73258
73463
  } else {
73259
- let result = z33.intersection(schemasToIntersect[0], schemasToIntersect[1]);
73464
+ let result = z34.intersection(schemasToIntersect[0], schemasToIntersect[1]);
73260
73465
  for (let i = 2; i < schemasToIntersect.length; i++) {
73261
- result = z33.intersection(result, schemasToIntersect[i]);
73466
+ result = z34.intersection(result, schemasToIntersect[i]);
73262
73467
  }
73263
73468
  zodSchema2 = result;
73264
73469
  }
73265
73470
  break;
73266
73471
  }
73267
- const objectSchema = z33.object(shape);
73472
+ const objectSchema = z34.object(shape);
73268
73473
  if (schema.additionalProperties === false) {
73269
73474
  zodSchema2 = objectSchema.strict();
73270
73475
  } else if (typeof schema.additionalProperties === "object") {
@@ -73281,33 +73486,33 @@ function convertBaseSchema(schema, ctx) {
73281
73486
  const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
73282
73487
  const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
73283
73488
  if (rest) {
73284
- zodSchema2 = z33.tuple(tupleItems).rest(rest);
73489
+ zodSchema2 = z34.tuple(tupleItems).rest(rest);
73285
73490
  } else {
73286
- zodSchema2 = z33.tuple(tupleItems);
73491
+ zodSchema2 = z34.tuple(tupleItems);
73287
73492
  }
73288
73493
  if (typeof schema.minItems === "number") {
73289
- zodSchema2 = zodSchema2.check(z33.minLength(schema.minItems));
73494
+ zodSchema2 = zodSchema2.check(z34.minLength(schema.minItems));
73290
73495
  }
73291
73496
  if (typeof schema.maxItems === "number") {
73292
- zodSchema2 = zodSchema2.check(z33.maxLength(schema.maxItems));
73497
+ zodSchema2 = zodSchema2.check(z34.maxLength(schema.maxItems));
73293
73498
  }
73294
73499
  } else if (Array.isArray(items)) {
73295
73500
  const tupleItems = items.map((item) => convertSchema(item, ctx));
73296
73501
  const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
73297
73502
  if (rest) {
73298
- zodSchema2 = z33.tuple(tupleItems).rest(rest);
73503
+ zodSchema2 = z34.tuple(tupleItems).rest(rest);
73299
73504
  } else {
73300
- zodSchema2 = z33.tuple(tupleItems);
73505
+ zodSchema2 = z34.tuple(tupleItems);
73301
73506
  }
73302
73507
  if (typeof schema.minItems === "number") {
73303
- zodSchema2 = zodSchema2.check(z33.minLength(schema.minItems));
73508
+ zodSchema2 = zodSchema2.check(z34.minLength(schema.minItems));
73304
73509
  }
73305
73510
  if (typeof schema.maxItems === "number") {
73306
- zodSchema2 = zodSchema2.check(z33.maxLength(schema.maxItems));
73511
+ zodSchema2 = zodSchema2.check(z34.maxLength(schema.maxItems));
73307
73512
  }
73308
73513
  } else if (items !== void 0) {
73309
73514
  const element = convertSchema(items, ctx);
73310
- let arraySchema = z33.array(element);
73515
+ let arraySchema = z34.array(element);
73311
73516
  if (typeof schema.minItems === "number") {
73312
73517
  arraySchema = arraySchema.min(schema.minItems);
73313
73518
  }
@@ -73316,7 +73521,7 @@ function convertBaseSchema(schema, ctx) {
73316
73521
  }
73317
73522
  zodSchema2 = arraySchema;
73318
73523
  } else {
73319
- zodSchema2 = z33.array(z33.any());
73524
+ zodSchema2 = z34.array(z34.any());
73320
73525
  }
73321
73526
  break;
73322
73527
  }
@@ -73333,37 +73538,37 @@ function convertBaseSchema(schema, ctx) {
73333
73538
  }
73334
73539
  function convertSchema(schema, ctx) {
73335
73540
  if (typeof schema === "boolean") {
73336
- return schema ? z33.any() : z33.never();
73541
+ return schema ? z34.any() : z34.never();
73337
73542
  }
73338
73543
  let baseSchema = convertBaseSchema(schema, ctx);
73339
73544
  const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
73340
73545
  if (schema.anyOf && Array.isArray(schema.anyOf)) {
73341
73546
  const options = schema.anyOf.map((s) => convertSchema(s, ctx));
73342
- const anyOfUnion = z33.union(options);
73343
- baseSchema = hasExplicitType ? z33.intersection(baseSchema, anyOfUnion) : anyOfUnion;
73547
+ const anyOfUnion = z34.union(options);
73548
+ baseSchema = hasExplicitType ? z34.intersection(baseSchema, anyOfUnion) : anyOfUnion;
73344
73549
  }
73345
73550
  if (schema.oneOf && Array.isArray(schema.oneOf)) {
73346
73551
  const options = schema.oneOf.map((s) => convertSchema(s, ctx));
73347
- const oneOfUnion = z33.xor(options);
73348
- baseSchema = hasExplicitType ? z33.intersection(baseSchema, oneOfUnion) : oneOfUnion;
73552
+ const oneOfUnion = z34.xor(options);
73553
+ baseSchema = hasExplicitType ? z34.intersection(baseSchema, oneOfUnion) : oneOfUnion;
73349
73554
  }
73350
73555
  if (schema.allOf && Array.isArray(schema.allOf)) {
73351
73556
  if (schema.allOf.length === 0) {
73352
- baseSchema = hasExplicitType ? baseSchema : z33.any();
73557
+ baseSchema = hasExplicitType ? baseSchema : z34.any();
73353
73558
  } else {
73354
73559
  let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
73355
73560
  const startIdx = hasExplicitType ? 0 : 1;
73356
73561
  for (let i = startIdx; i < schema.allOf.length; i++) {
73357
- result = z33.intersection(result, convertSchema(schema.allOf[i], ctx));
73562
+ result = z34.intersection(result, convertSchema(schema.allOf[i], ctx));
73358
73563
  }
73359
73564
  baseSchema = result;
73360
73565
  }
73361
73566
  }
73362
73567
  if (schema.nullable === true && ctx.version === "openapi-3.0") {
73363
- baseSchema = z33.nullable(baseSchema);
73568
+ baseSchema = z34.nullable(baseSchema);
73364
73569
  }
73365
73570
  if (schema.readOnly === true) {
73366
- baseSchema = z33.readonly(baseSchema);
73571
+ baseSchema = z34.readonly(baseSchema);
73367
73572
  }
73368
73573
  const extraMeta = {};
73369
73574
  const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
@@ -73390,7 +73595,7 @@ function convertSchema(schema, ctx) {
73390
73595
  }
73391
73596
  function fromJSONSchema(schema, params) {
73392
73597
  if (typeof schema === "boolean") {
73393
- return schema ? z33.any() : z33.never();
73598
+ return schema ? z34.any() : z34.never();
73394
73599
  }
73395
73600
  const version2 = detectVersion(schema, params?.defaultTarget);
73396
73601
  const defs = schema.$defs || schema.definitions || {};
@@ -73404,14 +73609,14 @@ function fromJSONSchema(schema, params) {
73404
73609
  };
73405
73610
  return convertSchema(schema, ctx);
73406
73611
  }
73407
- var z33, RECOGNIZED_KEYS;
73612
+ var z34, RECOGNIZED_KEYS;
73408
73613
  var init_from_json_schema = __esm({
73409
73614
  "node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/from-json-schema.js"() {
73410
73615
  init_registries();
73411
73616
  init_checks2();
73412
73617
  init_iso();
73413
73618
  init_schemas2();
73414
- z33 = {
73619
+ z34 = {
73415
73620
  ...schemas_exports2,
73416
73621
  ...checks_exports2,
73417
73622
  iso: iso_exports
@@ -87324,15 +87529,15 @@ async function selectBestProvisioned(role, opts) {
87324
87529
  const ollamaProvisioned = provisionedIds.includes("ollama");
87325
87530
  let ollamaAlive = localModels.length > 0;
87326
87531
  if (ollamaProvisioned && !ollamaAlive) {
87327
- const profile = await getProviderProfile2("ollama");
87328
- const ollamaBase = profile?.baseUrl ?? "http://localhost:11434";
87532
+ const profile2 = await getProviderProfile2("ollama");
87533
+ const ollamaBase = profile2?.baseUrl ?? "http://localhost:11434";
87329
87534
  ollamaAlive = await probeOllamaAlive(ollamaBase);
87330
87535
  if (ollamaAlive) localModels = await listOllamaModels(ollamaBase);
87331
87536
  }
87332
87537
  const scored = [];
87333
87538
  for (const id of provisionedIds) {
87334
- const profile = await getProviderProfile2(id);
87335
- const tier = profile?.tier ?? "standard";
87539
+ const profile2 = await getProviderProfile2(id);
87540
+ const tier = profile2?.tier ?? "standard";
87336
87541
  const costInput = 0;
87337
87542
  const score = scoreProvider(id, tier, taskTier, ollamaAlive, costInput);
87338
87543
  const storedCred = await pickCredentialForProvider2(id, { strategy: "priorityOnly" });
@@ -87527,12 +87732,12 @@ function readLlmBlock(config2) {
87527
87732
  }
87528
87733
  function resolveNamedProfile(llm, name15, source) {
87529
87734
  if (!name15) return void 0;
87530
- const profile = llm?.profiles?.[name15];
87531
- if (!profile?.provider || !profile.model) return void 0;
87735
+ const profile2 = llm?.profiles?.[name15];
87736
+ if (!profile2?.provider || !profile2.model) return void 0;
87532
87737
  return {
87533
- provider: profile.provider,
87534
- model: profile.model,
87535
- credentialLabel: profile.credentialLabel,
87738
+ provider: profile2.provider,
87739
+ model: profile2.model,
87740
+ credentialLabel: profile2.credentialLabel,
87536
87741
  source
87537
87742
  };
87538
87743
  }
@@ -87560,11 +87765,11 @@ function resolveSystemBinding(llm, systemKey) {
87560
87765
  function resolveRegisteredSystemDefault(llm, systemKey) {
87561
87766
  const defaults = getRegisteredSystemDefault(systemKey);
87562
87767
  if (!defaults) return void 0;
87563
- const profile = resolveNamedProfile(llm, defaults.profile, "registered-default");
87564
- if (profile) {
87768
+ const profile2 = resolveNamedProfile(llm, defaults.profile, "registered-default");
87769
+ if (profile2) {
87565
87770
  return {
87566
- ...profile,
87567
- credentialLabel: defaults.credentialLabel ?? profile.credentialLabel
87771
+ ...profile2,
87772
+ credentialLabel: defaults.credentialLabel ?? profile2.credentialLabel
87568
87773
  };
87569
87774
  }
87570
87775
  if (defaults.provider && defaults.model) {