@serviceme/devtools-core 0.4.3 → 0.4.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.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _serviceme_devtools_protocol from '@serviceme/devtools-protocol';
2
2
  import { AgentMarketplaceEntry, AgentMutationRequest, AgentPermissionSummary, CopilotDoctorResult, CopilotPromptOptions, CopilotPromptResult, EnvironmentCheckResult, KnownEnvironmentTool, ToolCheckResult, ServiceMeImageValidationResult, ServiceMeImageInfo, ServiceMeImageCompressOptions, ServiceMeImageCompressResult, JsonSortOptions, JsonValidationResult, AgentToolRiskLevel, AgentToolPermission, ServiceMeProjectExtractTemplateInput, ServiceMeProjectExtractTemplateResult, ServiceMeProjectInstallDepsResult, ServiceMeProjectMakeScriptsExecutableResult, ServiceMeProjectGitInitResult, ServiceMeProjectScaffoldPruneResult, TaskExecutionStatus, ScheduledTaskType, TaskPayload, TaskWorkspaceRef, ScheduledTasksConfig, ScheduledTask, TaskExecutionLog, TaskStartedEventParams, TaskOutputEventParams, TaskCompletedEventParams, TaskFailedEventParams, TaskCancelledEventParams, TaskExecutionSnapshot, RunningTaskInfo, SkillMarketplaceEntry, SkillMutationRequest } from '@serviceme/devtools-protocol';
3
3
  import * as fs from 'node:fs/promises';
4
- export { A as AccessCheckResult, a as AccessControl, b as AccessControlOptions, c as AuthCore, d as AuthCoreOptions, e as AuthStateManager, f as AuthStateManagerOptions, C as CancellationCheck, D as DeviceFlowUiCallback, G as GitHubAuthProvider, g as GitHubAuthProviderConfig, I as IAuthProvider, h as IAuthProviderSession, i as IAuthProviderUserInfo, j as InMemoryKeychainAuthTokenStore, K as KeyValueStore, k as KeychainAccountKey, l as KeychainAuthTokenStore, m as KeychainTokenEnvelope, n as KeychainTokenMetadata, o as KeychainUnavailableError, M as MicrosoftAuthProvider, p as MicrosoftProviderNotHostedError, O as OrgMembershipFetcher, P as ProviderRegistry, S as ServiceMeLogger, q as buildGitHubLocalEmail, r as createConsoleLogger, s as isGitHubLocalEmail, t as noopLogger, u as resolvePrimaryEmail } from './index-87-_JvQi.js';
4
+ export { A as AccessCheckResult, a as AccessControl, b as AccessControlOptions, c as AuthCore, d as AuthCoreOptions, e as AuthStateManager, f as AuthStateManagerOptions, C as CancellationCheck, D as DeviceFlowUiCallback, G as GitHubAuthProvider, g as GitHubAuthProviderConfig, I as IAuthProvider, h as IAuthProviderSession, i as IAuthProviderUserInfo, j as InMemoryKeychainAuthTokenStore, K as KeyValueStore, k as KeychainAccountKey, l as KeychainAuthTokenStore, m as KeychainTokenEnvelope, n as KeychainTokenMetadata, o as KeychainUnavailableError, M as MicrosoftAuthProvider, p as MicrosoftProviderNotHostedError, O as OrgMembershipFetcher, P as ProviderRegistry, S as ServiceMeLogger, q as buildGitHubLocalEmail, r as createConsoleLogger, s as isGitHubLocalEmail, t as noopLogger, u as resolvePrimaryEmail } from './index-PD135hlB.js';
5
5
  export { AtomicWriteResult, BuildSignedHeadersParams, DEVICE_JSON_SCHEMA_VERSION, DeviceAuthHeaders, DeviceCore, DeviceCoreOptions, DeviceReenrollRequiresAuthError, DeviceRequestSignatureParams, DeviceSecretVersionMismatchError, DeviceSignedHeaders, EnrollRequestFn, EnrollResponse, Enroller, EnrollerOptions, FsIdentityFileBackend, IdentityFileBackend, IdentityStore, IdentityStoreHooks, IdentityStoreOptions, PersistedDeviceIdentity, buildSignedHeaders, createDeviceRequestSignature, deriveInstallationId, fingerprintSource, randomInstallationId } from './device.js';
6
6
  import { c as SkillKind, b as SkillFile } from './types-B9gk3dXH.js';
7
7
  import { G as GitClient, P as PullResult } from './index-CR1hbAnO.js';
@@ -667,39 +667,12 @@ declare const defaultRepoSchema: z.ZodObject<{
667
667
  addedAt: z.ZodString;
668
668
  lastSyncAt: z.ZodOptional<z.ZodString>;
669
669
  lastSyncCommitSha: z.ZodOptional<z.ZodString>;
670
- lastSyncStatus: z.ZodOptional<z.ZodEnum<["ok", "error"]>>;
670
+ lastSyncStatus: z.ZodOptional<z.ZodEnum<{
671
+ ok: "ok";
672
+ error: "error";
673
+ }>>;
671
674
  lastSyncError: z.ZodOptional<z.ZodString>;
672
- }, "strip", z.ZodTypeAny, {
673
- name: string;
674
- id: string;
675
- description: string;
676
- source: "default";
677
- url: string;
678
- branch: string;
679
- enabled: boolean;
680
- useProxy: boolean;
681
- writeEnabled: boolean;
682
- addedAt: string;
683
- lastSyncAt?: string | undefined;
684
- lastSyncCommitSha?: string | undefined;
685
- lastSyncStatus?: "ok" | "error" | undefined;
686
- lastSyncError?: string | undefined;
687
- }, {
688
- name: string;
689
- id: string;
690
- description: string;
691
- source: "default";
692
- url: string;
693
- branch: string;
694
- enabled: boolean;
695
- writeEnabled: boolean;
696
- addedAt: string;
697
- useProxy?: boolean | undefined;
698
- lastSyncAt?: string | undefined;
699
- lastSyncCommitSha?: string | undefined;
700
- lastSyncStatus?: "ok" | "error" | undefined;
701
- lastSyncError?: string | undefined;
702
- }>;
675
+ }, z.core.$strip>;
703
676
  declare const userRepoSchema: z.ZodObject<{
704
677
  source: z.ZodLiteral<"user">;
705
678
  id: z.ZodString;
@@ -712,38 +685,13 @@ declare const userRepoSchema: z.ZodObject<{
712
685
  addedAt: z.ZodString;
713
686
  lastSyncAt: z.ZodOptional<z.ZodString>;
714
687
  lastSyncCommitSha: z.ZodOptional<z.ZodString>;
715
- lastSyncStatus: z.ZodOptional<z.ZodEnum<["ok", "error"]>>;
688
+ lastSyncStatus: z.ZodOptional<z.ZodEnum<{
689
+ ok: "ok";
690
+ error: "error";
691
+ }>>;
716
692
  lastSyncError: z.ZodOptional<z.ZodString>;
717
- }, "strip", z.ZodTypeAny, {
718
- name: string;
719
- id: string;
720
- source: "user";
721
- url: string;
722
- branch: string;
723
- enabled: boolean;
724
- useProxy: boolean;
725
- writeEnabled: boolean;
726
- addedAt: string;
727
- lastSyncAt?: string | undefined;
728
- lastSyncCommitSha?: string | undefined;
729
- lastSyncStatus?: "ok" | "error" | undefined;
730
- lastSyncError?: string | undefined;
731
- }, {
732
- name: string;
733
- id: string;
734
- source: "user";
735
- url: string;
736
- branch: string;
737
- enabled: boolean;
738
- writeEnabled: boolean;
739
- addedAt: string;
740
- useProxy?: boolean | undefined;
741
- lastSyncAt?: string | undefined;
742
- lastSyncCommitSha?: string | undefined;
743
- lastSyncStatus?: "ok" | "error" | undefined;
744
- lastSyncError?: string | undefined;
745
- }>;
746
- declare const repoSchema: z.ZodDiscriminatedUnion<"source", [z.ZodObject<{
693
+ }, z.core.$strip>;
694
+ declare const repoSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
747
695
  source: z.ZodLiteral<"default">;
748
696
  description: z.ZodString;
749
697
  id: z.ZodString;
@@ -756,39 +704,12 @@ declare const repoSchema: z.ZodDiscriminatedUnion<"source", [z.ZodObject<{
756
704
  addedAt: z.ZodString;
757
705
  lastSyncAt: z.ZodOptional<z.ZodString>;
758
706
  lastSyncCommitSha: z.ZodOptional<z.ZodString>;
759
- lastSyncStatus: z.ZodOptional<z.ZodEnum<["ok", "error"]>>;
707
+ lastSyncStatus: z.ZodOptional<z.ZodEnum<{
708
+ ok: "ok";
709
+ error: "error";
710
+ }>>;
760
711
  lastSyncError: z.ZodOptional<z.ZodString>;
761
- }, "strip", z.ZodTypeAny, {
762
- name: string;
763
- id: string;
764
- description: string;
765
- source: "default";
766
- url: string;
767
- branch: string;
768
- enabled: boolean;
769
- useProxy: boolean;
770
- writeEnabled: boolean;
771
- addedAt: string;
772
- lastSyncAt?: string | undefined;
773
- lastSyncCommitSha?: string | undefined;
774
- lastSyncStatus?: "ok" | "error" | undefined;
775
- lastSyncError?: string | undefined;
776
- }, {
777
- name: string;
778
- id: string;
779
- description: string;
780
- source: "default";
781
- url: string;
782
- branch: string;
783
- enabled: boolean;
784
- writeEnabled: boolean;
785
- addedAt: string;
786
- useProxy?: boolean | undefined;
787
- lastSyncAt?: string | undefined;
788
- lastSyncCommitSha?: string | undefined;
789
- lastSyncStatus?: "ok" | "error" | undefined;
790
- lastSyncError?: string | undefined;
791
- }>, z.ZodObject<{
712
+ }, z.core.$strip>, z.ZodObject<{
792
713
  source: z.ZodLiteral<"user">;
793
714
  id: z.ZodString;
794
715
  name: z.ZodString;
@@ -800,41 +721,16 @@ declare const repoSchema: z.ZodDiscriminatedUnion<"source", [z.ZodObject<{
800
721
  addedAt: z.ZodString;
801
722
  lastSyncAt: z.ZodOptional<z.ZodString>;
802
723
  lastSyncCommitSha: z.ZodOptional<z.ZodString>;
803
- lastSyncStatus: z.ZodOptional<z.ZodEnum<["ok", "error"]>>;
724
+ lastSyncStatus: z.ZodOptional<z.ZodEnum<{
725
+ ok: "ok";
726
+ error: "error";
727
+ }>>;
804
728
  lastSyncError: z.ZodOptional<z.ZodString>;
805
- }, "strip", z.ZodTypeAny, {
806
- name: string;
807
- id: string;
808
- source: "user";
809
- url: string;
810
- branch: string;
811
- enabled: boolean;
812
- useProxy: boolean;
813
- writeEnabled: boolean;
814
- addedAt: string;
815
- lastSyncAt?: string | undefined;
816
- lastSyncCommitSha?: string | undefined;
817
- lastSyncStatus?: "ok" | "error" | undefined;
818
- lastSyncError?: string | undefined;
819
- }, {
820
- name: string;
821
- id: string;
822
- source: "user";
823
- url: string;
824
- branch: string;
825
- enabled: boolean;
826
- writeEnabled: boolean;
827
- addedAt: string;
828
- useProxy?: boolean | undefined;
829
- lastSyncAt?: string | undefined;
830
- lastSyncCommitSha?: string | undefined;
831
- lastSyncStatus?: "ok" | "error" | undefined;
832
- lastSyncError?: string | undefined;
833
- }>]>;
834
- declare const reposFileSchema: z.ZodEffects<z.ZodObject<{
729
+ }, z.core.$strip>], "source">;
730
+ declare const reposFileSchema: z.ZodObject<{
835
731
  version: z.ZodLiteral<1>;
836
732
  defaultRepoId: z.ZodString;
837
- repos: z.ZodArray<z.ZodDiscriminatedUnion<"source", [z.ZodObject<{
733
+ repos: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
838
734
  source: z.ZodLiteral<"default">;
839
735
  description: z.ZodString;
840
736
  id: z.ZodString;
@@ -847,39 +743,12 @@ declare const reposFileSchema: z.ZodEffects<z.ZodObject<{
847
743
  addedAt: z.ZodString;
848
744
  lastSyncAt: z.ZodOptional<z.ZodString>;
849
745
  lastSyncCommitSha: z.ZodOptional<z.ZodString>;
850
- lastSyncStatus: z.ZodOptional<z.ZodEnum<["ok", "error"]>>;
746
+ lastSyncStatus: z.ZodOptional<z.ZodEnum<{
747
+ ok: "ok";
748
+ error: "error";
749
+ }>>;
851
750
  lastSyncError: z.ZodOptional<z.ZodString>;
852
- }, "strip", z.ZodTypeAny, {
853
- name: string;
854
- id: string;
855
- description: string;
856
- source: "default";
857
- url: string;
858
- branch: string;
859
- enabled: boolean;
860
- useProxy: boolean;
861
- writeEnabled: boolean;
862
- addedAt: string;
863
- lastSyncAt?: string | undefined;
864
- lastSyncCommitSha?: string | undefined;
865
- lastSyncStatus?: "ok" | "error" | undefined;
866
- lastSyncError?: string | undefined;
867
- }, {
868
- name: string;
869
- id: string;
870
- description: string;
871
- source: "default";
872
- url: string;
873
- branch: string;
874
- enabled: boolean;
875
- writeEnabled: boolean;
876
- addedAt: string;
877
- useProxy?: boolean | undefined;
878
- lastSyncAt?: string | undefined;
879
- lastSyncCommitSha?: string | undefined;
880
- lastSyncStatus?: "ok" | "error" | undefined;
881
- lastSyncError?: string | undefined;
882
- }>, z.ZodObject<{
751
+ }, z.core.$strip>, z.ZodObject<{
883
752
  source: z.ZodLiteral<"user">;
884
753
  id: z.ZodString;
885
754
  name: z.ZodString;
@@ -891,170 +760,13 @@ declare const reposFileSchema: z.ZodEffects<z.ZodObject<{
891
760
  addedAt: z.ZodString;
892
761
  lastSyncAt: z.ZodOptional<z.ZodString>;
893
762
  lastSyncCommitSha: z.ZodOptional<z.ZodString>;
894
- lastSyncStatus: z.ZodOptional<z.ZodEnum<["ok", "error"]>>;
763
+ lastSyncStatus: z.ZodOptional<z.ZodEnum<{
764
+ ok: "ok";
765
+ error: "error";
766
+ }>>;
895
767
  lastSyncError: z.ZodOptional<z.ZodString>;
896
- }, "strip", z.ZodTypeAny, {
897
- name: string;
898
- id: string;
899
- source: "user";
900
- url: string;
901
- branch: string;
902
- enabled: boolean;
903
- useProxy: boolean;
904
- writeEnabled: boolean;
905
- addedAt: string;
906
- lastSyncAt?: string | undefined;
907
- lastSyncCommitSha?: string | undefined;
908
- lastSyncStatus?: "ok" | "error" | undefined;
909
- lastSyncError?: string | undefined;
910
- }, {
911
- name: string;
912
- id: string;
913
- source: "user";
914
- url: string;
915
- branch: string;
916
- enabled: boolean;
917
- writeEnabled: boolean;
918
- addedAt: string;
919
- useProxy?: boolean | undefined;
920
- lastSyncAt?: string | undefined;
921
- lastSyncCommitSha?: string | undefined;
922
- lastSyncStatus?: "ok" | "error" | undefined;
923
- lastSyncError?: string | undefined;
924
- }>]>, "many">;
925
- }, "strip", z.ZodTypeAny, {
926
- version: 1;
927
- repos: ({
928
- name: string;
929
- id: string;
930
- description: string;
931
- source: "default";
932
- url: string;
933
- branch: string;
934
- enabled: boolean;
935
- useProxy: boolean;
936
- writeEnabled: boolean;
937
- addedAt: string;
938
- lastSyncAt?: string | undefined;
939
- lastSyncCommitSha?: string | undefined;
940
- lastSyncStatus?: "ok" | "error" | undefined;
941
- lastSyncError?: string | undefined;
942
- } | {
943
- name: string;
944
- id: string;
945
- source: "user";
946
- url: string;
947
- branch: string;
948
- enabled: boolean;
949
- useProxy: boolean;
950
- writeEnabled: boolean;
951
- addedAt: string;
952
- lastSyncAt?: string | undefined;
953
- lastSyncCommitSha?: string | undefined;
954
- lastSyncStatus?: "ok" | "error" | undefined;
955
- lastSyncError?: string | undefined;
956
- })[];
957
- defaultRepoId: string;
958
- }, {
959
- version: 1;
960
- repos: ({
961
- name: string;
962
- id: string;
963
- description: string;
964
- source: "default";
965
- url: string;
966
- branch: string;
967
- enabled: boolean;
968
- writeEnabled: boolean;
969
- addedAt: string;
970
- useProxy?: boolean | undefined;
971
- lastSyncAt?: string | undefined;
972
- lastSyncCommitSha?: string | undefined;
973
- lastSyncStatus?: "ok" | "error" | undefined;
974
- lastSyncError?: string | undefined;
975
- } | {
976
- name: string;
977
- id: string;
978
- source: "user";
979
- url: string;
980
- branch: string;
981
- enabled: boolean;
982
- writeEnabled: boolean;
983
- addedAt: string;
984
- useProxy?: boolean | undefined;
985
- lastSyncAt?: string | undefined;
986
- lastSyncCommitSha?: string | undefined;
987
- lastSyncStatus?: "ok" | "error" | undefined;
988
- lastSyncError?: string | undefined;
989
- })[];
990
- defaultRepoId: string;
991
- }>, {
992
- version: 1;
993
- repos: ({
994
- name: string;
995
- id: string;
996
- description: string;
997
- source: "default";
998
- url: string;
999
- branch: string;
1000
- enabled: boolean;
1001
- useProxy: boolean;
1002
- writeEnabled: boolean;
1003
- addedAt: string;
1004
- lastSyncAt?: string | undefined;
1005
- lastSyncCommitSha?: string | undefined;
1006
- lastSyncStatus?: "ok" | "error" | undefined;
1007
- lastSyncError?: string | undefined;
1008
- } | {
1009
- name: string;
1010
- id: string;
1011
- source: "user";
1012
- url: string;
1013
- branch: string;
1014
- enabled: boolean;
1015
- useProxy: boolean;
1016
- writeEnabled: boolean;
1017
- addedAt: string;
1018
- lastSyncAt?: string | undefined;
1019
- lastSyncCommitSha?: string | undefined;
1020
- lastSyncStatus?: "ok" | "error" | undefined;
1021
- lastSyncError?: string | undefined;
1022
- })[];
1023
- defaultRepoId: string;
1024
- }, {
1025
- version: 1;
1026
- repos: ({
1027
- name: string;
1028
- id: string;
1029
- description: string;
1030
- source: "default";
1031
- url: string;
1032
- branch: string;
1033
- enabled: boolean;
1034
- writeEnabled: boolean;
1035
- addedAt: string;
1036
- useProxy?: boolean | undefined;
1037
- lastSyncAt?: string | undefined;
1038
- lastSyncCommitSha?: string | undefined;
1039
- lastSyncStatus?: "ok" | "error" | undefined;
1040
- lastSyncError?: string | undefined;
1041
- } | {
1042
- name: string;
1043
- id: string;
1044
- source: "user";
1045
- url: string;
1046
- branch: string;
1047
- enabled: boolean;
1048
- writeEnabled: boolean;
1049
- addedAt: string;
1050
- useProxy?: boolean | undefined;
1051
- lastSyncAt?: string | undefined;
1052
- lastSyncCommitSha?: string | undefined;
1053
- lastSyncStatus?: "ok" | "error" | undefined;
1054
- lastSyncError?: string | undefined;
1055
- })[];
1056
- defaultRepoId: string;
1057
- }>;
768
+ }, z.core.$strip>], "source">>;
769
+ }, z.core.$strip>;
1058
770
  /** Inferred Zod type — identical to our hand-written `ReposFile`. */
1059
771
  type ReposFileInput = z.infer<typeof reposFileSchema>;
1060
772
  /** Result of a load attempt — either a parsed file or a recovery notice. */
@@ -1307,9 +1019,10 @@ declare class CannotRemoveDefaultRepoError extends Error {
1307
1019
  }
1308
1020
  /**
1309
1021
  * Bootstrap helper — invokes `ensureDefaultsInstalled` on the store to
1310
- * guarantee that all default repos are present. Returns the resulting
1311
- * config. Lives here (not in `default-repos.ts`) to keep the default-repo
1312
- * module free of store concerns.
1022
+ * guarantee that all default repos are present and their catalog metadata
1023
+ * is up to date with `DEFAULT_REPO_SEEDS`. Returns the resulting config.
1024
+ * Lives here (not in `default-repos.ts`) to keep the default-repo module
1025
+ * free of store concerns.
1313
1026
  */
1314
1027
  declare function bootstrapDefaults(store: ReposStore): Promise<ReposFile>;
1315
1028
 
@@ -1351,6 +1064,8 @@ interface AddUserRepoInput {
1351
1064
  branch?: string;
1352
1065
  /** Optional display name (defaults to id). */
1353
1066
  name?: string;
1067
+ /** Whether this repo participates in scheduled syncs. Defaults to true. */
1068
+ enabled?: boolean;
1354
1069
  /** Route git traffic via the server proxy (default true). */
1355
1070
  useProxy?: boolean;
1356
1071
  }
@@ -1457,9 +1172,10 @@ declare function getDefaultRepoConfig(id: string, now?: () => string): DefaultRe
1457
1172
  declare function buildDefaultReposFile(now?: () => string, existing?: ReposFile): ReposFile;
1458
1173
  /**
1459
1174
  * `ensureDefaultsInstalled(existing)` — pure helper that returns either
1460
- * `existing` (when defaults are already present) or a merged copy that
1461
- * appends the missing defaults. The companion `ensureDefaultsInstalledInStore`
1462
- * below is the mutating, store-bound counterpart.
1175
+ * `existing` (when defaults are already present and up to date) or a merged
1176
+ * copy that appends the missing defaults and refreshes catalog metadata on
1177
+ * existing ones. The companion `ensureDefaultsInstalledInStore` below is the
1178
+ * mutating, store-bound counterpart.
1463
1179
  */
1464
1180
  declare function ensureDefaultsInstalled(existing: ReposFile, now?: () => string): {
1465
1181
  config: ReposFile;
package/dist/index.js CHANGED
@@ -2317,7 +2317,6 @@ var IdentityStore = class {
2317
2317
  this.hooks = opts.hooks ?? {};
2318
2318
  this.lockTimeoutMs = opts.lockTimeoutMs ?? DEFAULT_LOCK_TIMEOUT_MS;
2319
2319
  this.lockRetryMs = opts.lockRetryMs ?? DEFAULT_LOCK_RETRY_MS;
2320
- this.now = opts.now ?? (() => /* @__PURE__ */ new Date());
2321
2320
  }
2322
2321
  /** Absolute path to the underlying JSON file (test seam). */
2323
2322
  getFilePath() {
@@ -4141,7 +4140,7 @@ var RepoManager = class {
4141
4140
  name: input.name?.trim() || id,
4142
4141
  url,
4143
4142
  branch,
4144
- enabled: true,
4143
+ enabled: input.enabled ?? true,
4145
4144
  useProxy,
4146
4145
  writeEnabled: false,
4147
4146
  source: "user",
@@ -4271,7 +4270,7 @@ var DEFAULT_REPO_SEEDS = [
4271
4270
  id: "composiohq-awesome-claude-skills",
4272
4271
  name: "Composio Awesome Claude Skills",
4273
4272
  url: "https://github.com/ComposioHQ/awesome-claude-skills.git",
4274
- branch: "main",
4273
+ branch: "master",
4275
4274
  enabled: true,
4276
4275
  useProxy: true,
4277
4276
  writeEnabled: false,
@@ -4304,12 +4303,13 @@ function buildDefaultReposFile(now = () => (/* @__PURE__ */ new Date()).toISOStr
4304
4303
  }
4305
4304
  const existingIds = new Set(existing.repos.map((r) => r.id));
4306
4305
  const missingDefaults = defaults.filter((d) => !existingIds.has(d.id));
4307
- if (missingDefaults.length === 0) {
4306
+ const { repos: refreshedRepos, changed } = refreshDefaultsMetadata(existing.repos, defaults);
4307
+ if (missingDefaults.length === 0 && !changed) {
4308
4308
  return existing;
4309
4309
  }
4310
4310
  return {
4311
4311
  ...existing,
4312
- repos: [...existing.repos, ...missingDefaults],
4312
+ repos: [...refreshedRepos, ...missingDefaults],
4313
4313
  defaultRepoId: resolveDefaultRepoId(existing, existingIds)
4314
4314
  };
4315
4315
  }
@@ -4317,16 +4317,52 @@ function ensureDefaultsInstalled(existing, now = () => (/* @__PURE__ */ new Date
4317
4317
  const defaults = getAllDefaultRepoConfigs(now);
4318
4318
  const existingIds = new Set(existing.repos.map((r) => r.id));
4319
4319
  const missing = defaults.filter((d) => !existingIds.has(d.id));
4320
- if (missing.length === 0) {
4320
+ const { repos: refreshedRepos, changed } = refreshDefaultsMetadata(existing.repos, defaults);
4321
+ if (missing.length === 0 && !changed) {
4321
4322
  return { config: existing, installed: [] };
4322
4323
  }
4323
4324
  const next = {
4324
4325
  ...existing,
4325
- repos: [...existing.repos, ...missing],
4326
+ repos: [...refreshedRepos, ...missing],
4326
4327
  defaultRepoId: resolveDefaultRepoId(existing, existingIds)
4327
4328
  };
4328
4329
  return { config: next, installed: missing.map((d) => d.id) };
4329
4330
  }
4331
+ var SYNCED_METADATA_KEYS = [
4332
+ "name",
4333
+ "url",
4334
+ "branch",
4335
+ "description",
4336
+ "useProxy",
4337
+ "writeEnabled"
4338
+ ];
4339
+ function refreshDefaultsMetadata(repos, defaults) {
4340
+ const seedById = new Map(defaults.map((d) => [d.id, d]));
4341
+ let changed = false;
4342
+ const next = repos.map((repo) => {
4343
+ if (!isDefaultRepo(repo)) {
4344
+ return repo;
4345
+ }
4346
+ const seed = seedById.get(repo.id);
4347
+ if (!seed) {
4348
+ return repo;
4349
+ }
4350
+ const isStale = SYNCED_METADATA_KEYS.some((key) => repo[key] !== seed[key]);
4351
+ if (!isStale) {
4352
+ return repo;
4353
+ }
4354
+ changed = true;
4355
+ return { ...repo, ...pick(seed, SYNCED_METADATA_KEYS) };
4356
+ });
4357
+ return { repos: next, changed };
4358
+ }
4359
+ function pick(source, keys) {
4360
+ const result = {};
4361
+ for (const key of keys) {
4362
+ result[key] = source[key];
4363
+ }
4364
+ return result;
4365
+ }
4330
4366
  function resolveDefaultRepoId(existing, existingIds) {
4331
4367
  const placeholder = existing.defaultRepoId;
4332
4368
  if (placeholder && existingIds.has(placeholder)) {
@@ -4380,7 +4416,7 @@ var reposFileSchema = import_zod.z.object({
4380
4416
  for (const repo of value.repos) {
4381
4417
  if (ids.has(repo.id)) {
4382
4418
  ctx.addIssue({
4383
- code: import_zod.z.ZodIssueCode.custom,
4419
+ code: "custom",
4384
4420
  path: ["repos"],
4385
4421
  message: `Duplicate repo id: ${repo.id}`
4386
4422
  });
@@ -4391,7 +4427,7 @@ var reposFileSchema = import_zod.z.object({
4391
4427
  if (value.repos.length === 0) {
4392
4428
  if (value.defaultRepoId !== "") {
4393
4429
  ctx.addIssue({
4394
- code: import_zod.z.ZodIssueCode.custom,
4430
+ code: "custom",
4395
4431
  path: ["defaultRepoId"],
4396
4432
  message: "defaultRepoId must be '' when repos[] is empty"
4397
4433
  });
@@ -4400,7 +4436,7 @@ var reposFileSchema = import_zod.z.object({
4400
4436
  }
4401
4437
  if (!ids.has(value.defaultRepoId)) {
4402
4438
  ctx.addIssue({
4403
- code: import_zod.z.ZodIssueCode.custom,
4439
+ code: "custom",
4404
4440
  path: ["defaultRepoId"],
4405
4441
  message: `defaultRepoId '${value.defaultRepoId}' not present in repos[]`
4406
4442
  });
@@ -4825,7 +4861,7 @@ var CannotRemoveDefaultRepoError = class extends Error {
4825
4861
  async function bootstrapDefaults(store) {
4826
4862
  const config = store.getConfig() ?? await store.ensureLoaded();
4827
4863
  const result = ensureDefaultsInstalled(config, store.getNow());
4828
- if (result.installed.length === 0) {
4864
+ if (result.config === config) {
4829
4865
  return config;
4830
4866
  }
4831
4867
  await store.replaceConfig(result.config);