@code-sentinel-cli/code-sentinel-cli 3.0.7 → 3.0.9

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
@@ -2383,11 +2383,11 @@ var definedBuildValue = (value, fallback) => typeof value === "string" && value.
2383
2383
  var getCliBuildMetadata = (version2) => ({
2384
2384
  version: version2,
2385
2385
  gitSha: definedBuildValue(
2386
- "dab1b770e3f0" ,
2386
+ "ffa3a8c96cca" ,
2387
2387
  "unknown"
2388
2388
  ),
2389
2389
  buildTimestamp: definedBuildValue(
2390
- "2026-08-12T02:47:33.225Z" ,
2390
+ "2026-08-12T08:09:49.865Z" ,
2391
2391
  "unknown"
2392
2392
  ),
2393
2393
  configSchemaRange: definedBuildValue(
@@ -3454,11 +3454,30 @@ var runAnnotate = async (options) => {
3454
3454
 
3455
3455
  // src/auth/device-auth-client.ts
3456
3456
  var requestJson = async (serverUrl, path, init, fetchFn) => {
3457
- const response = await fetchFn(new URL(path, serverUrl), {
3458
- ...init,
3459
- headers: { accept: "application/json", "content-type": "application/json", ...init.headers }
3460
- });
3461
- const body = await response.json();
3457
+ let response;
3458
+ try {
3459
+ response = await fetchFn(new URL(path, serverUrl), {
3460
+ ...init,
3461
+ headers: { accept: "application/json", "content-type": "application/json", ...init.headers }
3462
+ });
3463
+ } catch (error) {
3464
+ throw new Error(
3465
+ `Failed to connect to ${serverUrl}: ${error instanceof Error ? error.message : "network error"}`
3466
+ );
3467
+ }
3468
+ const contentType = response.headers.get("content-type");
3469
+ if (!contentType || !contentType.includes("json")) {
3470
+ const text2 = await response.text().catch(() => "");
3471
+ throw new Error(
3472
+ `Unexpected non-JSON response from server (HTTP ${response.status}): ${text2.slice(0, 100).replace(/\s+/g, " ")}...`
3473
+ );
3474
+ }
3475
+ let body;
3476
+ try {
3477
+ body = await response.json();
3478
+ } catch {
3479
+ throw new Error(`Failed to parse JSON response from server (HTTP ${response.status})`);
3480
+ }
3462
3481
  return { status: response.status, body };
3463
3482
  };
3464
3483
  var startDeviceAuthorization = async (serverUrl, fetchFn = fetch) => {
@@ -3756,11 +3775,13 @@ try {
3756
3775
  $credential = [Runtime.InteropServices.Marshal]::PtrToStructure($credentialPtr, [type][CodeSentinelCredentialNative+CREDENTIAL])
3757
3776
  $bytes = New-Object byte[] $credential.CredentialBlobSize
3758
3777
  [Runtime.InteropServices.Marshal]::Copy($credential.CredentialBlob, $bytes, 0, $bytes.Length)
3759
- [Console]::Out.WriteLine([Convert]::ToBase64String($bytes))
3778
+ [Console]::Out.WriteLine("___CS_CLI_B64_START___$([Convert]::ToBase64String($bytes))___CS_CLI_B64_END___")
3760
3779
  } finally { [CodeSentinelCredentialNative]::CredFree($credentialPtr) }
3761
3780
  `
3762
3781
  );
3763
- return output2.trim() ? Buffer.from(output2.trim(), "base64").toString("utf8") : null;
3782
+ const match = output2.match(/___CS_CLI_B64_START___(.*?)___CS_CLI_B64_END___/);
3783
+ if (match?.[1]) return Buffer.from(match[1], "base64").toString("utf8");
3784
+ return null;
3764
3785
  }
3765
3786
  async write(service, account, value) {
3766
3787
  await this.run(
@@ -13865,7 +13886,7 @@ var withAiApiKey = (config, credential, apiKey) => {
13865
13886
  };
13866
13887
  };
13867
13888
  var OLLAMA_DEFAULT_BASE = "http://localhost:11434";
13868
- var NETMIND_DEFAULT_BASE = "https://example.invalid/netmind/v1";
13889
+ var NETMIND_DEFAULT_BASE = "https://netmind.viettel.vn/gateway/v1";
13869
13890
  var OPENCODE_GO_DEFAULT_BASE = "https://opencode.ai/zen/go/v1";
13870
13891
  var stripTrailingSlash = (s) => s.replace(/\/+$/, "");
13871
13892
  var buildLanguageModel = (config, modelOverride) => {
@@ -23509,7 +23530,7 @@ var codeReviewConfigObjectSchema = external_exports.object({
23509
23530
  * default until M3 passes the repository's finding-quality gate.
23510
23531
  */
23511
23532
  viettelNetmind: external_exports.object({
23512
- baseUrl: external_exports.string().url().default("https://example.invalid/netmind/v1"),
23533
+ baseUrl: external_exports.string().url().default("https://netmind.viettel.vn/gateway/v1"),
23513
23534
  apiKey: external_exports.string().optional(),
23514
23535
  // Model access is team-scoped; `/models` is the source of truth.
23515
23536
  // M2.7 is the measured fast option but under-detected per-module
@@ -23517,7 +23538,7 @@ var codeReviewConfigObjectSchema = external_exports.object({
23517
23538
  // remains opt-in until the same gate has measured its recall.
23518
23539
  model: external_exports.string().default("zai-org/GLM-4.7-cc")
23519
23540
  }).default({
23520
- baseUrl: "https://example.invalid/netmind/v1",
23541
+ baseUrl: "https://netmind.viettel.vn/gateway/v1",
23521
23542
  model: "zai-org/GLM-4.7-cc"
23522
23543
  }),
23523
23544
  opencodeGo: external_exports.object({
@@ -23558,7 +23579,7 @@ var codeReviewConfigObjectSchema = external_exports.object({
23558
23579
  gemini: { model: "gemini-2.0-flash" },
23559
23580
  groq: { model: "llama-3.3-70b-versatile" },
23560
23581
  viettelNetmind: {
23561
- baseUrl: "https://example.invalid/netmind/v1",
23582
+ baseUrl: "https://netmind.viettel.vn/gateway/v1",
23562
23583
  apiKey: "",
23563
23584
  model: "zai-org/GLM-4.7-cc"
23564
23585
  },
@@ -23864,7 +23885,7 @@ var codeReviewConfigObjectSchema = external_exports.object({
23864
23885
  * `${ENV_VAR}` interpolation for the token so secrets stay out of the file.
23865
23886
  */
23866
23887
  dashboard: external_exports.object({
23867
- /** Base URL of the @code-sentinel/server instance, e.g. `https://example.invalid/code-sentinel-dashboard`. */
23888
+ /** Base URL of the @code-sentinel/server instance, e.g. `https://codesentinel.vtscloud.vn`. */
23868
23889
  serverUrl: external_exports.string().url().optional(),
23869
23890
  /** Project-scoped bearer token for `POST /api/runs`. */
23870
23891
  token: external_exports.string().optional(),
@@ -24287,7 +24308,7 @@ var pathMatchesAnyGlob = (path, patterns) => {
24287
24308
  };
24288
24309
 
24289
24310
  // src/config/dashboard-defaults.ts
24290
- var DEFAULT_DASHBOARD_SERVER_URL = "https://example.invalid/code-sentinel-dashboard";
24311
+ var DEFAULT_DASHBOARD_SERVER_URL = "https://codesentinel.vtscloud.vn";
24291
24312
  var getDefaultDashboardServerUrl = () => process.env.CODE_SENTINEL_DASHBOARD_URL?.trim() || DEFAULT_DASHBOARD_SERVER_URL;
24292
24313
 
24293
24314
  // src/commands/push.command.ts
@@ -31655,7 +31676,7 @@ var runInit = async (options = {}) => {
31655
31676
  ai: {
31656
31677
  provider: "viettel-netmind",
31657
31678
  viettelNetmind: {
31658
- baseUrl: "https://example.invalid/netmind/v1",
31679
+ baseUrl: "https://netmind.viettel.vn/gateway/v1",
31659
31680
  apiKey: "",
31660
31681
  model: "zai-org/GLM-4.7-cc"
31661
31682
  }
@@ -32880,7 +32901,7 @@ var runReviewFortify = async (options) => {
32880
32901
  contextPack,
32881
32902
  "",
32882
32903
  "Y\xCAU C\u1EA6U:",
32883
- "H\xE3y tr\u1EA3 l\u1EDDi b\u1EB1ng TI\u1EBENG VI\u1EC6T. \u0110\u01B0a ra h\u01B0\u1EDBng d\u1EABn s\u1EEDa l\u1ED7i (Remediation Advice) ng\u1EAFn g\u1ECDn trong 1-2 c\xE2u, m\xF4 t\u1EA3 ch\xEDnh x\xE1c c\xE1ch kh\u1EAFc ph\u1EE5c tr\u1EF1c ti\u1EBFp cho \u0111o\u1EA1n m\xE3 ngu\u1ED3n n\xE0y."
32904
+ "H\xE3y tr\u1EA3 l\u1EDDi b\u1EB1ng TI\u1EBENG VI\u1EC6T. \u0110\u01B0a ra h\u01B0\u1EDBng d\u1EABn s\u1EEDa l\u1ED7i (Remediation Advice) ng\u1EAFn g\u1ECDn, m\xF4 t\u1EA3 ch\xEDnh x\xE1c c\xE1ch kh\u1EAFc ph\u1EE5c tr\u1EF1c ti\u1EBFp cho \u0111o\u1EA1n m\xE3 ngu\u1ED3n n\xE0y. Xin h\xE3y k\xE8m theo m\xE3 ngu\u1ED3n (code snippet) g\u1EE3i \xFD \u0111\u1EC3 s\u1EEDa l\u1ED7i n\u1EBFu c\xF3 th\u1EC3."
32884
32905
  ].join("\n");
32885
32906
  try {
32886
32907
  console.log(
@@ -34611,7 +34632,7 @@ var providerDefaults = {
34611
34632
  },
34612
34633
  "viettel-netmind": {
34613
34634
  model: "zai-org/GLM-4.7-cc",
34614
- baseUrl: "https://example.invalid/netmind/v1",
34635
+ baseUrl: "https://netmind.viettel.vn/gateway/v1",
34615
34636
  apiKeyEnv: "LLM_API_KEY",
34616
34637
  needsApiKey: true,
34617
34638
  needsBaseUrl: true
package/dist/index.d.ts CHANGED
@@ -625,12 +625,12 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
625
625
  groupBy: z.ZodDefault<z.ZodEnum<["severity", "file", "rule", "category"]>>;
626
626
  includeSnippets: z.ZodDefault<z.ZodBoolean>;
627
627
  }, "strip", z.ZodTypeAny, {
628
- format: "markdown" | "markdown-compact" | "json" | "sarif";
628
+ format: "json" | "markdown" | "markdown-compact" | "sarif";
629
629
  output: string;
630
630
  groupBy: "file" | "severity" | "category" | "rule";
631
631
  includeSnippets: boolean;
632
632
  }, {
633
- format?: "markdown" | "markdown-compact" | "json" | "sarif" | undefined;
633
+ format?: "json" | "markdown" | "markdown-compact" | "sarif" | undefined;
634
634
  output?: string | undefined;
635
635
  groupBy?: "file" | "severity" | "category" | "rule" | undefined;
636
636
  includeSnippets?: boolean | undefined;
@@ -999,7 +999,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
999
999
  * `${ENV_VAR}` interpolation for the token so secrets stay out of the file.
1000
1000
  */
1001
1001
  dashboard: z.ZodDefault<z.ZodObject<{
1002
- /** Base URL of the @code-sentinel/server instance, e.g. `https://example.invalid/code-sentinel-dashboard`. */
1002
+ /** Base URL of the @code-sentinel/server instance, e.g. `https://codesentinel.vtscloud.vn`. */
1003
1003
  serverUrl: z.ZodOptional<z.ZodString>;
1004
1004
  /** Project-scoped bearer token for `POST /api/runs`. */
1005
1005
  token: z.ZodOptional<z.ZodString>;
@@ -1087,7 +1087,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1087
1087
  };
1088
1088
  };
1089
1089
  report: {
1090
- format: "markdown" | "markdown-compact" | "json" | "sarif";
1090
+ format: "json" | "markdown" | "markdown-compact" | "sarif";
1091
1091
  output: string;
1092
1092
  groupBy: "file" | "severity" | "category" | "rule";
1093
1093
  includeSnippets: boolean;
@@ -1243,7 +1243,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1243
1243
  } | undefined;
1244
1244
  } | undefined;
1245
1245
  report?: {
1246
- format?: "markdown" | "markdown-compact" | "json" | "sarif" | undefined;
1246
+ format?: "json" | "markdown" | "markdown-compact" | "sarif" | undefined;
1247
1247
  output?: string | undefined;
1248
1248
  groupBy?: "file" | "severity" | "category" | "rule" | undefined;
1249
1249
  includeSnippets?: boolean | undefined;
@@ -1399,7 +1399,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
1399
1399
  };
1400
1400
  };
1401
1401
  report: {
1402
- format: "markdown" | "markdown-compact" | "json" | "sarif";
1402
+ format: "json" | "markdown" | "markdown-compact" | "sarif";
1403
1403
  output: string;
1404
1404
  groupBy: "file" | "severity" | "category" | "rule";
1405
1405
  includeSnippets: boolean;
package/dist/index.js CHANGED
@@ -2383,11 +2383,11 @@ var definedBuildValue = (value, fallback) => typeof value === "string" && value.
2383
2383
  var getCliBuildMetadata = (version2) => ({
2384
2384
  version: version2,
2385
2385
  gitSha: definedBuildValue(
2386
- "dab1b770e3f0" ,
2386
+ "ffa3a8c96cca" ,
2387
2387
  "unknown"
2388
2388
  ),
2389
2389
  buildTimestamp: definedBuildValue(
2390
- "2026-08-12T02:47:33.225Z" ,
2390
+ "2026-08-12T08:09:49.865Z" ,
2391
2391
  "unknown"
2392
2392
  ),
2393
2393
  configSchemaRange: definedBuildValue(
@@ -3454,11 +3454,30 @@ var runAnnotate = async (options) => {
3454
3454
 
3455
3455
  // src/auth/device-auth-client.ts
3456
3456
  var requestJson = async (serverUrl, path, init, fetchFn) => {
3457
- const response = await fetchFn(new URL(path, serverUrl), {
3458
- ...init,
3459
- headers: { accept: "application/json", "content-type": "application/json", ...init.headers }
3460
- });
3461
- const body = await response.json();
3457
+ let response;
3458
+ try {
3459
+ response = await fetchFn(new URL(path, serverUrl), {
3460
+ ...init,
3461
+ headers: { accept: "application/json", "content-type": "application/json", ...init.headers }
3462
+ });
3463
+ } catch (error) {
3464
+ throw new Error(
3465
+ `Failed to connect to ${serverUrl}: ${error instanceof Error ? error.message : "network error"}`
3466
+ );
3467
+ }
3468
+ const contentType = response.headers.get("content-type");
3469
+ if (!contentType || !contentType.includes("json")) {
3470
+ const text2 = await response.text().catch(() => "");
3471
+ throw new Error(
3472
+ `Unexpected non-JSON response from server (HTTP ${response.status}): ${text2.slice(0, 100).replace(/\s+/g, " ")}...`
3473
+ );
3474
+ }
3475
+ let body;
3476
+ try {
3477
+ body = await response.json();
3478
+ } catch {
3479
+ throw new Error(`Failed to parse JSON response from server (HTTP ${response.status})`);
3480
+ }
3462
3481
  return { status: response.status, body };
3463
3482
  };
3464
3483
  var startDeviceAuthorization = async (serverUrl, fetchFn = fetch) => {
@@ -3773,11 +3792,13 @@ try {
3773
3792
  $credential = [Runtime.InteropServices.Marshal]::PtrToStructure($credentialPtr, [type][CodeSentinelCredentialNative+CREDENTIAL])
3774
3793
  $bytes = New-Object byte[] $credential.CredentialBlobSize
3775
3794
  [Runtime.InteropServices.Marshal]::Copy($credential.CredentialBlob, $bytes, 0, $bytes.Length)
3776
- [Console]::Out.WriteLine([Convert]::ToBase64String($bytes))
3795
+ [Console]::Out.WriteLine("___CS_CLI_B64_START___$([Convert]::ToBase64String($bytes))___CS_CLI_B64_END___")
3777
3796
  } finally { [CodeSentinelCredentialNative]::CredFree($credentialPtr) }
3778
3797
  `
3779
3798
  );
3780
- return output2.trim() ? Buffer.from(output2.trim(), "base64").toString("utf8") : null;
3799
+ const match = output2.match(/___CS_CLI_B64_START___(.*?)___CS_CLI_B64_END___/);
3800
+ if (match?.[1]) return Buffer.from(match[1], "base64").toString("utf8");
3801
+ return null;
3781
3802
  }
3782
3803
  async write(service, account, value) {
3783
3804
  await this.run(
@@ -13895,7 +13916,7 @@ var withAiApiKey = (config, credential, apiKey) => {
13895
13916
  };
13896
13917
  };
13897
13918
  var OLLAMA_DEFAULT_BASE = "http://localhost:11434";
13898
- var NETMIND_DEFAULT_BASE = "https://example.invalid/netmind/v1";
13919
+ var NETMIND_DEFAULT_BASE = "https://netmind.viettel.vn/gateway/v1";
13899
13920
  var OPENCODE_GO_DEFAULT_BASE = "https://opencode.ai/zen/go/v1";
13900
13921
  var stripTrailingSlash = (s) => s.replace(/\/+$/, "");
13901
13922
  var buildLanguageModel = (config, modelOverride) => {
@@ -23539,7 +23560,7 @@ var codeReviewConfigObjectSchema = external_exports.object({
23539
23560
  * default until M3 passes the repository's finding-quality gate.
23540
23561
  */
23541
23562
  viettelNetmind: external_exports.object({
23542
- baseUrl: external_exports.string().url().default("https://example.invalid/netmind/v1"),
23563
+ baseUrl: external_exports.string().url().default("https://netmind.viettel.vn/gateway/v1"),
23543
23564
  apiKey: external_exports.string().optional(),
23544
23565
  // Model access is team-scoped; `/models` is the source of truth.
23545
23566
  // M2.7 is the measured fast option but under-detected per-module
@@ -23547,7 +23568,7 @@ var codeReviewConfigObjectSchema = external_exports.object({
23547
23568
  // remains opt-in until the same gate has measured its recall.
23548
23569
  model: external_exports.string().default("zai-org/GLM-4.7-cc")
23549
23570
  }).default({
23550
- baseUrl: "https://example.invalid/netmind/v1",
23571
+ baseUrl: "https://netmind.viettel.vn/gateway/v1",
23551
23572
  model: "zai-org/GLM-4.7-cc"
23552
23573
  }),
23553
23574
  opencodeGo: external_exports.object({
@@ -23588,7 +23609,7 @@ var codeReviewConfigObjectSchema = external_exports.object({
23588
23609
  gemini: { model: "gemini-2.0-flash" },
23589
23610
  groq: { model: "llama-3.3-70b-versatile" },
23590
23611
  viettelNetmind: {
23591
- baseUrl: "https://example.invalid/netmind/v1",
23612
+ baseUrl: "https://netmind.viettel.vn/gateway/v1",
23592
23613
  apiKey: "",
23593
23614
  model: "zai-org/GLM-4.7-cc"
23594
23615
  },
@@ -23894,7 +23915,7 @@ var codeReviewConfigObjectSchema = external_exports.object({
23894
23915
  * `${ENV_VAR}` interpolation for the token so secrets stay out of the file.
23895
23916
  */
23896
23917
  dashboard: external_exports.object({
23897
- /** Base URL of the @code-sentinel/server instance, e.g. `https://example.invalid/code-sentinel-dashboard`. */
23918
+ /** Base URL of the @code-sentinel/server instance, e.g. `https://codesentinel.vtscloud.vn`. */
23898
23919
  serverUrl: external_exports.string().url().optional(),
23899
23920
  /** Project-scoped bearer token for `POST /api/runs`. */
23900
23921
  token: external_exports.string().optional(),
@@ -24317,7 +24338,7 @@ var pathMatchesAnyGlob = (path, patterns) => {
24317
24338
  };
24318
24339
 
24319
24340
  // src/config/dashboard-defaults.ts
24320
- var DEFAULT_DASHBOARD_SERVER_URL = "https://example.invalid/code-sentinel-dashboard";
24341
+ var DEFAULT_DASHBOARD_SERVER_URL = "https://codesentinel.vtscloud.vn";
24321
24342
  var getDefaultDashboardServerUrl = () => process.env.CODE_SENTINEL_DASHBOARD_URL?.trim() || DEFAULT_DASHBOARD_SERVER_URL;
24322
24343
 
24323
24344
  // src/commands/push.command.ts
@@ -31685,7 +31706,7 @@ var runInit = async (options = {}) => {
31685
31706
  ai: {
31686
31707
  provider: "viettel-netmind",
31687
31708
  viettelNetmind: {
31688
- baseUrl: "https://example.invalid/netmind/v1",
31709
+ baseUrl: "https://netmind.viettel.vn/gateway/v1",
31689
31710
  apiKey: "",
31690
31711
  model: "zai-org/GLM-4.7-cc"
31691
31712
  }
@@ -32910,7 +32931,7 @@ var runReviewFortify = async (options) => {
32910
32931
  contextPack,
32911
32932
  "",
32912
32933
  "Y\xCAU C\u1EA6U:",
32913
- "H\xE3y tr\u1EA3 l\u1EDDi b\u1EB1ng TI\u1EBENG VI\u1EC6T. \u0110\u01B0a ra h\u01B0\u1EDBng d\u1EABn s\u1EEDa l\u1ED7i (Remediation Advice) ng\u1EAFn g\u1ECDn trong 1-2 c\xE2u, m\xF4 t\u1EA3 ch\xEDnh x\xE1c c\xE1ch kh\u1EAFc ph\u1EE5c tr\u1EF1c ti\u1EBFp cho \u0111o\u1EA1n m\xE3 ngu\u1ED3n n\xE0y."
32934
+ "H\xE3y tr\u1EA3 l\u1EDDi b\u1EB1ng TI\u1EBENG VI\u1EC6T. \u0110\u01B0a ra h\u01B0\u1EDBng d\u1EABn s\u1EEDa l\u1ED7i (Remediation Advice) ng\u1EAFn g\u1ECDn, m\xF4 t\u1EA3 ch\xEDnh x\xE1c c\xE1ch kh\u1EAFc ph\u1EE5c tr\u1EF1c ti\u1EBFp cho \u0111o\u1EA1n m\xE3 ngu\u1ED3n n\xE0y. Xin h\xE3y k\xE8m theo m\xE3 ngu\u1ED3n (code snippet) g\u1EE3i \xFD \u0111\u1EC3 s\u1EEDa l\u1ED7i n\u1EBFu c\xF3 th\u1EC3."
32914
32935
  ].join("\n");
32915
32936
  try {
32916
32937
  console.log(
@@ -34641,7 +34662,7 @@ var providerDefaults = {
34641
34662
  },
34642
34663
  "viettel-netmind": {
34643
34664
  model: "zai-org/GLM-4.7-cc",
34644
- baseUrl: "https://example.invalid/netmind/v1",
34665
+ baseUrl: "https://netmind.viettel.vn/gateway/v1",
34645
34666
  apiKeyEnv: "LLM_API_KEY",
34646
34667
  needsApiKey: true,
34647
34668
  needsBaseUrl: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-sentinel-cli/code-sentinel-cli",
3
- "version": "3.0.7",
3
+ "version": "3.0.9",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "AI-assisted code review CLI for Angular, Spring Boot, and Flutter projects.",