@code-sentinel-cli/code-sentinel-cli 3.0.5 → 3.0.6

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/bin.js CHANGED
@@ -2382,11 +2382,11 @@ var definedBuildValue = (value, fallback) => typeof value === "string" && value.
2382
2382
  var getCliBuildMetadata = (version2) => ({
2383
2383
  version: version2,
2384
2384
  gitSha: definedBuildValue(
2385
- "73d6e7b299a5" ,
2385
+ "0fea7c67e128" ,
2386
2386
  "unknown"
2387
2387
  ),
2388
2388
  buildTimestamp: definedBuildValue(
2389
- "2026-08-10T07:21:32.211Z" ,
2389
+ "2026-08-10T07:35:20.778Z" ,
2390
2390
  "unknown"
2391
2391
  ),
2392
2392
  configSchemaRange: definedBuildValue(
@@ -7132,7 +7132,7 @@ var workspaceLinkCandidateSchema = external_exports.object({
7132
7132
  codebaseId: dashboardIdSchema,
7133
7133
  fingerprint: external_exports.string().regex(/^[a-f0-9]{64}$/i, "Expected a SHA-256 fingerprint."),
7134
7134
  // The server canonicalizes HTTP(S) and git@host:path SSH remotes.
7135
- canonicalRemote: external_exports.string().min(1).max(2048),
7135
+ canonicalRemote: external_exports.string().min(1).max(2048).nullable(),
7136
7136
  subdirectory: external_exports.string(),
7137
7137
  providerRepositoryId: external_exports.string().min(1).max(255).optional()
7138
7138
  }).strict();
@@ -7669,7 +7669,7 @@ var parseLink = (value) => {
7669
7669
  return {
7670
7670
  ...candidate,
7671
7671
  serverUrl: new URL(candidate.serverUrl).origin,
7672
- canonicalRemote: canonicalizeRepositoryRemote(candidate.canonicalRemote),
7672
+ canonicalRemote: candidate.canonicalRemote === null ? null : canonicalizeRepositoryRemote(candidate.canonicalRemote),
7673
7673
  subdirectory: normalizeRepositorySubdirectory(candidate.subdirectory)
7674
7674
  };
7675
7675
  } catch {
@@ -22456,6 +22456,14 @@ var migration0029 = {
22456
22456
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci`
22457
22457
  ]
22458
22458
  };
22459
+ var migration0030 = {
22460
+ version: 30,
22461
+ name: "optional-cli-workspace-remote",
22462
+ statements: [
22463
+ `ALTER TABLE cli_workspace_links
22464
+ MODIFY canonical_remote LONGTEXT NULL`
22465
+ ]
22466
+ };
22459
22467
  var MARIADB_MIGRATIONS = [
22460
22468
  migration0001,
22461
22469
  migration0002,
@@ -22485,7 +22493,8 @@ var MARIADB_MIGRATIONS = [
22485
22493
  migration0026,
22486
22494
  migration0027,
22487
22495
  migration0028,
22488
- migration0029
22496
+ migration0029,
22497
+ migration0030
22489
22498
  ];
22490
22499
  MARIADB_MIGRATIONS[MARIADB_MIGRATIONS.length - 1]?.version ?? 0;
22491
22500
 
@@ -30990,7 +30999,7 @@ var getProjectStatus = async (dependencies) => {
30990
30999
  dependencies.readOriginRemote()
30991
31000
  ]);
30992
31001
  let remoteMatchesLink = null;
30993
- if (link && originRemote) {
31002
+ if (link?.canonicalRemote && originRemote) {
30994
31003
  try {
30995
31004
  remoteMatchesLink = canonicalizeRepositoryRemote(originRemote) === link.canonicalRemote;
30996
31005
  } catch {
@@ -31073,11 +31082,21 @@ var canonicalRepositoryUrl = (value) => {
31073
31082
  return null;
31074
31083
  }
31075
31084
  };
31085
+ var workspaceGitMetadata = async (root) => {
31086
+ const [remoteResult, subdirectoryResult] = await Promise.allSettled([
31087
+ gitValue(root, ["remote", "get-url", "origin"]),
31088
+ gitValue(root, ["rev-parse", "--show-prefix"])
31089
+ ]);
31090
+ const remote = remoteResult.status === "fulfilled" ? canonicalRepositoryUrl(remoteResult.value) : null;
31091
+ const subdirectory = subdirectoryResult.status === "fulfilled" ? subdirectoryResult.value : "";
31092
+ return { canonicalRemote: remote, subdirectory };
31093
+ };
31076
31094
  var workspaceFingerprint = (input4) => createHash("sha256").update(JSON.stringify(input4)).digest("hex");
31077
31095
  var suggestedIdentifier = (canonicalRemote) => {
31078
31096
  const lastPath = canonicalRemote.split("/").filter(Boolean).at(-1) ?? "project";
31079
31097
  return lastPath.toLowerCase().normalize("NFD").replace(new RegExp("\\p{M}", "gu"), "").replace(/[^a-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 128) || "project";
31080
31098
  };
31099
+ var suggestedIdentifierFromRoot = (root) => resolve(root).split(/[\\/]/).filter(Boolean).at(-1)?.toLowerCase().replace(/[^a-z0-9._-]+/g, "-") || "project";
31081
31100
  var inferCodebaseType = async (root) => {
31082
31101
  const has = async (file) => {
31083
31102
  try {
@@ -31095,11 +31114,7 @@ var inferCodebaseType = async (root) => {
31095
31114
  return "other";
31096
31115
  };
31097
31116
  var linkWorkspace = async (args) => {
31098
- const [remote, subdirectory] = await Promise.all([
31099
- gitValue(args.root, ["remote", "get-url", "origin"]),
31100
- gitValue(args.root, ["rev-parse", "--show-prefix"])
31101
- ]);
31102
- const canonicalRemote = canonicalizeRepositoryRemote(remote);
31117
+ const { canonicalRemote, subdirectory } = await workspaceGitMetadata(args.root);
31103
31118
  const serverUrl = new URL(args.server).origin;
31104
31119
  const fingerprint = workspaceFingerprint({
31105
31120
  serverUrl,
@@ -31139,9 +31154,7 @@ var runProjectLink = async (options) => {
31139
31154
  writeError("Interactive linking requires a TTY. Use --project-id and --codebase-id.");
31140
31155
  return EXIT.USAGE;
31141
31156
  }
31142
- const canonicalRemote = canonicalizeRepositoryRemote(
31143
- await gitValue(root, ["remote", "get-url", "origin"])
31144
- );
31157
+ const { canonicalRemote } = await workspaceGitMetadata(root);
31145
31158
  const prompts = options.prompts ?? { select };
31146
31159
  if (!projectId) {
31147
31160
  const projects = (await client.listProjects()).projects.slice().sort((left, right) => left.projectName.localeCompare(right.projectName));
@@ -31159,8 +31172,8 @@ var runProjectLink = async (options) => {
31159
31172
  }
31160
31173
  if (!codebaseId) {
31161
31174
  const repositories = (await client.listProjectCodebases(projectId)).repositories.slice().sort((left, right) => {
31162
- const leftMatches = canonicalRepositoryUrl(left.repositoryUrl) === canonicalRemote ? 1 : 0;
31163
- const rightMatches = canonicalRepositoryUrl(right.repositoryUrl) === canonicalRemote ? 1 : 0;
31175
+ const leftMatches = canonicalRemote !== null && canonicalRepositoryUrl(left.repositoryUrl) === canonicalRemote ? 1 : 0;
31176
+ const rightMatches = canonicalRemote !== null && canonicalRepositoryUrl(right.repositoryUrl) === canonicalRemote ? 1 : 0;
31164
31177
  return rightMatches - leftMatches || left.name.localeCompare(right.name);
31165
31178
  });
31166
31179
  if (repositories.length === 0) {
@@ -31170,7 +31183,7 @@ var runProjectLink = async (options) => {
31170
31183
  codebaseId = await prompts.select({
31171
31184
  message: `Choose a codebase in project ${projectId}`,
31172
31185
  choices: repositories.map((repository) => ({
31173
- name: `${repository.name} (${repository.repoKey})${canonicalRepositoryUrl(repository.repositoryUrl) === canonicalRemote ? " \u2014 matches this Git remote" : ""}`,
31186
+ name: `${repository.name} (${repository.repoKey})${canonicalRemote !== null && canonicalRepositoryUrl(repository.repositoryUrl) === canonicalRemote ? " \u2014 matches this Git remote" : ""}`,
31174
31187
  value: repository.id
31175
31188
  }))
31176
31189
  });
@@ -31409,22 +31422,22 @@ var runProjectSetup = async (options) => {
31409
31422
  try {
31410
31423
  const client = options.client ?? await authenticatedClient2(options.server, options.store ?? credentialStore2());
31411
31424
  const prompts = options.prompts ?? defaultProjectSetupPrompts;
31412
- const remote = await gitValue(root, ["remote", "get-url", "origin"]);
31413
- const canonicalRemote = canonicalizeRepositoryRemote(remote);
31414
- const suggestedId = suggestedIdentifier(canonicalRemote);
31425
+ const { canonicalRemote } = await workspaceGitMetadata(root);
31426
+ const suggestedId = canonicalRemote !== null ? suggestedIdentifier(canonicalRemote) : suggestedIdentifierFromRoot(root);
31415
31427
  const inferredType = await inferCodebaseType(root);
31428
+ const setupChoices = canonicalRemote !== null ? [
31429
+ { name: "Create a new project from this repository", value: "create-project" },
31430
+ { name: "Add this repository to an existing project", value: "add-codebase" },
31431
+ { name: "Link to an existing codebase", value: "link-existing" }
31432
+ ] : [{ name: "Link to an existing codebase", value: "link-existing" }];
31416
31433
  const choice = await prompts.select({
31417
- message: "Set up this Git workspace in Code Sentinel",
31418
- choices: [
31419
- { name: "Create a new project from this repository", value: "create-project" },
31420
- { name: "Add this repository to an existing project", value: "add-codebase" },
31421
- { name: "Link to an existing codebase", value: "link-existing" }
31422
- ]
31434
+ message: canonicalRemote !== null ? "Set up this Git workspace in Code Sentinel" : "Set up this workspace in Code Sentinel",
31435
+ choices: setupChoices
31423
31436
  });
31424
31437
  if (choice === "link-existing") {
31425
31438
  const codebases = (await client.listCodebases()).slice().sort((left, right) => {
31426
- const leftMatches = left.canonicalRemote === canonicalRemote ? 1 : 0;
31427
- const rightMatches = right.canonicalRemote === canonicalRemote ? 1 : 0;
31439
+ const leftMatches = canonicalRemote !== null && left.canonicalRemote === canonicalRemote ? 1 : 0;
31440
+ const rightMatches = canonicalRemote !== null && right.canonicalRemote === canonicalRemote ? 1 : 0;
31428
31441
  return rightMatches - leftMatches || left.name.localeCompare(right.name);
31429
31442
  });
31430
31443
  if (codebases.length === 0)
@@ -31432,7 +31445,7 @@ var runProjectSetup = async (options) => {
31432
31445
  const selected = await prompts.select({
31433
31446
  message: "Choose the Code Sentinel codebase for this Git workspace",
31434
31447
  choices: codebases.map((codebase2) => ({
31435
- name: `${codebase2.name} (${codebase2.projectId}/${codebase2.codebaseId})${codebase2.canonicalRemote === canonicalRemote ? " \u2014 matches this Git remote" : ""}`,
31448
+ name: `${codebase2.name} (${codebase2.projectId}/${codebase2.codebaseId})${canonicalRemote !== null && codebase2.canonicalRemote === canonicalRemote ? " \u2014 matches this Git remote" : ""}`,
31436
31449
  value: `${codebase2.projectId}\0${codebase2.codebaseId}`
31437
31450
  }))
31438
31451
  });
@@ -31442,6 +31455,12 @@ var runProjectSetup = async (options) => {
31442
31455
  write(`Linked this workspace to ${projectId2}/${codebaseId}.`);
31443
31456
  return EXIT.SUCCESS;
31444
31457
  }
31458
+ if (canonicalRemote === null) {
31459
+ writeError(
31460
+ "A safe Git origin is required to create or add a codebase. Link to an existing codebase instead."
31461
+ );
31462
+ return EXIT.USAGE;
31463
+ }
31445
31464
  const codebaseName = await prompts.input({
31446
31465
  message: "Codebase name",
31447
31466
  default: suggestedId
package/dist/index.d.ts CHANGED
@@ -195,7 +195,7 @@ interface WorkspaceLinkState {
195
195
  readonly projectId: string;
196
196
  readonly codebaseId: string;
197
197
  readonly fingerprint: string;
198
- readonly canonicalRemote: string;
198
+ readonly canonicalRemote: string | null;
199
199
  readonly subdirectory: string;
200
200
  readonly providerRepositoryId?: string;
201
201
  readonly configCache?: {
@@ -1525,7 +1525,7 @@ interface ProjectStatus {
1525
1525
  readonly serverUrl: string;
1526
1526
  readonly projectId: string;
1527
1527
  readonly codebaseId: string;
1528
- readonly canonicalRemote: string;
1528
+ readonly canonicalRemote: string | null;
1529
1529
  readonly subdirectory: string;
1530
1530
  };
1531
1531
  readonly git: {
package/dist/index.js CHANGED
@@ -2382,11 +2382,11 @@ var definedBuildValue = (value, fallback) => typeof value === "string" && value.
2382
2382
  var getCliBuildMetadata = (version2) => ({
2383
2383
  version: version2,
2384
2384
  gitSha: definedBuildValue(
2385
- "73d6e7b299a5" ,
2385
+ "0fea7c67e128" ,
2386
2386
  "unknown"
2387
2387
  ),
2388
2388
  buildTimestamp: definedBuildValue(
2389
- "2026-08-10T07:21:32.211Z" ,
2389
+ "2026-08-10T07:35:20.778Z" ,
2390
2390
  "unknown"
2391
2391
  ),
2392
2392
  configSchemaRange: definedBuildValue(
@@ -7162,7 +7162,7 @@ var workspaceLinkCandidateSchema = external_exports.object({
7162
7162
  codebaseId: dashboardIdSchema,
7163
7163
  fingerprint: external_exports.string().regex(/^[a-f0-9]{64}$/i, "Expected a SHA-256 fingerprint."),
7164
7164
  // The server canonicalizes HTTP(S) and git@host:path SSH remotes.
7165
- canonicalRemote: external_exports.string().min(1).max(2048),
7165
+ canonicalRemote: external_exports.string().min(1).max(2048).nullable(),
7166
7166
  subdirectory: external_exports.string(),
7167
7167
  providerRepositoryId: external_exports.string().min(1).max(255).optional()
7168
7168
  }).strict();
@@ -7699,7 +7699,7 @@ var parseLink = (value) => {
7699
7699
  return {
7700
7700
  ...candidate,
7701
7701
  serverUrl: new URL(candidate.serverUrl).origin,
7702
- canonicalRemote: canonicalizeRepositoryRemote(candidate.canonicalRemote),
7702
+ canonicalRemote: candidate.canonicalRemote === null ? null : canonicalizeRepositoryRemote(candidate.canonicalRemote),
7703
7703
  subdirectory: normalizeRepositorySubdirectory(candidate.subdirectory)
7704
7704
  };
7705
7705
  } catch {
@@ -22486,6 +22486,14 @@ var migration0029 = {
22486
22486
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci`
22487
22487
  ]
22488
22488
  };
22489
+ var migration0030 = {
22490
+ version: 30,
22491
+ name: "optional-cli-workspace-remote",
22492
+ statements: [
22493
+ `ALTER TABLE cli_workspace_links
22494
+ MODIFY canonical_remote LONGTEXT NULL`
22495
+ ]
22496
+ };
22489
22497
  var MARIADB_MIGRATIONS = [
22490
22498
  migration0001,
22491
22499
  migration0002,
@@ -22515,7 +22523,8 @@ var MARIADB_MIGRATIONS = [
22515
22523
  migration0026,
22516
22524
  migration0027,
22517
22525
  migration0028,
22518
- migration0029
22526
+ migration0029,
22527
+ migration0030
22519
22528
  ];
22520
22529
  MARIADB_MIGRATIONS[MARIADB_MIGRATIONS.length - 1]?.version ?? 0;
22521
22530
 
@@ -31020,7 +31029,7 @@ var getProjectStatus = async (dependencies) => {
31020
31029
  dependencies.readOriginRemote()
31021
31030
  ]);
31022
31031
  let remoteMatchesLink = null;
31023
- if (link && originRemote) {
31032
+ if (link?.canonicalRemote && originRemote) {
31024
31033
  try {
31025
31034
  remoteMatchesLink = canonicalizeRepositoryRemote(originRemote) === link.canonicalRemote;
31026
31035
  } catch {
@@ -31103,11 +31112,21 @@ var canonicalRepositoryUrl = (value) => {
31103
31112
  return null;
31104
31113
  }
31105
31114
  };
31115
+ var workspaceGitMetadata = async (root) => {
31116
+ const [remoteResult, subdirectoryResult] = await Promise.allSettled([
31117
+ gitValue(root, ["remote", "get-url", "origin"]),
31118
+ gitValue(root, ["rev-parse", "--show-prefix"])
31119
+ ]);
31120
+ const remote = remoteResult.status === "fulfilled" ? canonicalRepositoryUrl(remoteResult.value) : null;
31121
+ const subdirectory = subdirectoryResult.status === "fulfilled" ? subdirectoryResult.value : "";
31122
+ return { canonicalRemote: remote, subdirectory };
31123
+ };
31106
31124
  var workspaceFingerprint = (input4) => createHash("sha256").update(JSON.stringify(input4)).digest("hex");
31107
31125
  var suggestedIdentifier = (canonicalRemote) => {
31108
31126
  const lastPath = canonicalRemote.split("/").filter(Boolean).at(-1) ?? "project";
31109
31127
  return lastPath.toLowerCase().normalize("NFD").replace(new RegExp("\\p{M}", "gu"), "").replace(/[^a-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 128) || "project";
31110
31128
  };
31129
+ var suggestedIdentifierFromRoot = (root) => resolve(root).split(/[\\/]/).filter(Boolean).at(-1)?.toLowerCase().replace(/[^a-z0-9._-]+/g, "-") || "project";
31111
31130
  var inferCodebaseType = async (root) => {
31112
31131
  const has = async (file) => {
31113
31132
  try {
@@ -31125,11 +31144,7 @@ var inferCodebaseType = async (root) => {
31125
31144
  return "other";
31126
31145
  };
31127
31146
  var linkWorkspace = async (args) => {
31128
- const [remote, subdirectory] = await Promise.all([
31129
- gitValue(args.root, ["remote", "get-url", "origin"]),
31130
- gitValue(args.root, ["rev-parse", "--show-prefix"])
31131
- ]);
31132
- const canonicalRemote = canonicalizeRepositoryRemote(remote);
31147
+ const { canonicalRemote, subdirectory } = await workspaceGitMetadata(args.root);
31133
31148
  const serverUrl = new URL(args.server).origin;
31134
31149
  const fingerprint = workspaceFingerprint({
31135
31150
  serverUrl,
@@ -31169,9 +31184,7 @@ var runProjectLink = async (options) => {
31169
31184
  writeError("Interactive linking requires a TTY. Use --project-id and --codebase-id.");
31170
31185
  return EXIT.USAGE;
31171
31186
  }
31172
- const canonicalRemote = canonicalizeRepositoryRemote(
31173
- await gitValue(root, ["remote", "get-url", "origin"])
31174
- );
31187
+ const { canonicalRemote } = await workspaceGitMetadata(root);
31175
31188
  const prompts = options.prompts ?? { select };
31176
31189
  if (!projectId) {
31177
31190
  const projects = (await client.listProjects()).projects.slice().sort((left, right) => left.projectName.localeCompare(right.projectName));
@@ -31189,8 +31202,8 @@ var runProjectLink = async (options) => {
31189
31202
  }
31190
31203
  if (!codebaseId) {
31191
31204
  const repositories = (await client.listProjectCodebases(projectId)).repositories.slice().sort((left, right) => {
31192
- const leftMatches = canonicalRepositoryUrl(left.repositoryUrl) === canonicalRemote ? 1 : 0;
31193
- const rightMatches = canonicalRepositoryUrl(right.repositoryUrl) === canonicalRemote ? 1 : 0;
31205
+ const leftMatches = canonicalRemote !== null && canonicalRepositoryUrl(left.repositoryUrl) === canonicalRemote ? 1 : 0;
31206
+ const rightMatches = canonicalRemote !== null && canonicalRepositoryUrl(right.repositoryUrl) === canonicalRemote ? 1 : 0;
31194
31207
  return rightMatches - leftMatches || left.name.localeCompare(right.name);
31195
31208
  });
31196
31209
  if (repositories.length === 0) {
@@ -31200,7 +31213,7 @@ var runProjectLink = async (options) => {
31200
31213
  codebaseId = await prompts.select({
31201
31214
  message: `Choose a codebase in project ${projectId}`,
31202
31215
  choices: repositories.map((repository) => ({
31203
- name: `${repository.name} (${repository.repoKey})${canonicalRepositoryUrl(repository.repositoryUrl) === canonicalRemote ? " \u2014 matches this Git remote" : ""}`,
31216
+ name: `${repository.name} (${repository.repoKey})${canonicalRemote !== null && canonicalRepositoryUrl(repository.repositoryUrl) === canonicalRemote ? " \u2014 matches this Git remote" : ""}`,
31204
31217
  value: repository.id
31205
31218
  }))
31206
31219
  });
@@ -31439,22 +31452,22 @@ var runProjectSetup = async (options) => {
31439
31452
  try {
31440
31453
  const client = options.client ?? await authenticatedClient2(options.server, options.store ?? credentialStore2());
31441
31454
  const prompts = options.prompts ?? defaultProjectSetupPrompts;
31442
- const remote = await gitValue(root, ["remote", "get-url", "origin"]);
31443
- const canonicalRemote = canonicalizeRepositoryRemote(remote);
31444
- const suggestedId = suggestedIdentifier(canonicalRemote);
31455
+ const { canonicalRemote } = await workspaceGitMetadata(root);
31456
+ const suggestedId = canonicalRemote !== null ? suggestedIdentifier(canonicalRemote) : suggestedIdentifierFromRoot(root);
31445
31457
  const inferredType = await inferCodebaseType(root);
31458
+ const setupChoices = canonicalRemote !== null ? [
31459
+ { name: "Create a new project from this repository", value: "create-project" },
31460
+ { name: "Add this repository to an existing project", value: "add-codebase" },
31461
+ { name: "Link to an existing codebase", value: "link-existing" }
31462
+ ] : [{ name: "Link to an existing codebase", value: "link-existing" }];
31446
31463
  const choice = await prompts.select({
31447
- message: "Set up this Git workspace in Code Sentinel",
31448
- choices: [
31449
- { name: "Create a new project from this repository", value: "create-project" },
31450
- { name: "Add this repository to an existing project", value: "add-codebase" },
31451
- { name: "Link to an existing codebase", value: "link-existing" }
31452
- ]
31464
+ message: canonicalRemote !== null ? "Set up this Git workspace in Code Sentinel" : "Set up this workspace in Code Sentinel",
31465
+ choices: setupChoices
31453
31466
  });
31454
31467
  if (choice === "link-existing") {
31455
31468
  const codebases = (await client.listCodebases()).slice().sort((left, right) => {
31456
- const leftMatches = left.canonicalRemote === canonicalRemote ? 1 : 0;
31457
- const rightMatches = right.canonicalRemote === canonicalRemote ? 1 : 0;
31469
+ const leftMatches = canonicalRemote !== null && left.canonicalRemote === canonicalRemote ? 1 : 0;
31470
+ const rightMatches = canonicalRemote !== null && right.canonicalRemote === canonicalRemote ? 1 : 0;
31458
31471
  return rightMatches - leftMatches || left.name.localeCompare(right.name);
31459
31472
  });
31460
31473
  if (codebases.length === 0)
@@ -31462,7 +31475,7 @@ var runProjectSetup = async (options) => {
31462
31475
  const selected = await prompts.select({
31463
31476
  message: "Choose the Code Sentinel codebase for this Git workspace",
31464
31477
  choices: codebases.map((codebase2) => ({
31465
- name: `${codebase2.name} (${codebase2.projectId}/${codebase2.codebaseId})${codebase2.canonicalRemote === canonicalRemote ? " \u2014 matches this Git remote" : ""}`,
31478
+ name: `${codebase2.name} (${codebase2.projectId}/${codebase2.codebaseId})${canonicalRemote !== null && codebase2.canonicalRemote === canonicalRemote ? " \u2014 matches this Git remote" : ""}`,
31466
31479
  value: `${codebase2.projectId}\0${codebase2.codebaseId}`
31467
31480
  }))
31468
31481
  });
@@ -31472,6 +31485,12 @@ var runProjectSetup = async (options) => {
31472
31485
  write(`Linked this workspace to ${projectId2}/${codebaseId}.`);
31473
31486
  return EXIT.SUCCESS;
31474
31487
  }
31488
+ if (canonicalRemote === null) {
31489
+ writeError(
31490
+ "A safe Git origin is required to create or add a codebase. Link to an existing codebase instead."
31491
+ );
31492
+ return EXIT.USAGE;
31493
+ }
31475
31494
  const codebaseName = await prompts.input({
31476
31495
  message: "Codebase name",
31477
31496
  default: suggestedId
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-sentinel-cli/code-sentinel-cli",
3
- "version": "3.0.5",
3
+ "version": "3.0.6",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "AI-assisted code review CLI for Angular, Spring Boot, and Flutter projects.",