@kodycodes/cli 3.45.4 → 3.45.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.
@@ -28846,18 +28846,6 @@ var init_registry = __esm({
28846
28846
  hypothesis: "Experimenters who create profiles give their agents narrower identities and keep executing through them."
28847
28847
  }
28848
28848
  },
28849
- {
28850
- key: "mcp-skills-extension",
28851
- defaultEnabled: false,
28852
- defaultAudience: "experiments_opt_in",
28853
- description: "Skills-over-MCP (SEP-2640) for package-shipped Agent Skills: packages may ship `skills/<name>/SKILL.md`, and when an MCP client advertises the skills extension Kody exposes those skills via skills/list, skills/get, and resources/read as a progressive enhancement. Signed-in users can opt in from /docs/package-skills; enable for experimenters via admin (adminFeatureFlagSet with audience experiments_opt_in). Off by default. Delete the flag and gate sites when the experiment ends.",
28854
- successMetric: {
28855
- eventType: "execute",
28856
- measure: "event_count",
28857
- goal: "increase",
28858
- hypothesis: "Skill-aware hosts that load package skills over MCP then act via execute, so experimenters with the extension on run more execute calls against skill-guided packages."
28859
- }
28860
- },
28861
28849
  {
28862
28850
  key: "mcp-events-extension",
28863
28851
  defaultEnabled: false,
@@ -28880,9 +28868,8 @@ var init_registry = __esm({
28880
28868
  },
28881
28869
  {
28882
28870
  key: "repo-push-queue",
28883
- defaultEnabled: false,
28884
- defaultAudience: "experiments_opt_in",
28885
- description: "Per-repo Durable Object write queue for plain-repo git pushes (git-receive-pack): pushes land in the kody-push-queue Worker (RepoPushQueueV1) and reach Artifacts one at a time in FIFO order, with a 90s per-push budget and a clean 503 + Retry-After instead of a raw busy error. Evaluated per repo: repo allowlist (adminFeatureFlagRepoOverride), then the repo owner override, then the global switch with percentage rollout bucketed by repo, then the audience gate on the repo owner. Off repos keep the isolate-local wait-and-retry proxy. Kept as a kill switch after the global rollout. Every push records an observe-only git_push usage event (path, outcome, Durable Object wall time, wait, queue depth, attempts) and an exposure for the repo owner; read queue cost with adminRepoPushQueueCost.",
28871
+ defaultEnabled: true,
28872
+ description: "Per-repo Durable Object write queue for plain-repo git pushes (git-receive-pack): pushes land in the kody-push-queue Worker (RepoPushQueueV1) and reach Artifacts one at a time in FIFO order, with a 90s per-push budget and a clean 503 + Retry-After instead of a raw busy error. Evaluated per repo: repo allowlist (adminFeatureFlagRepoOverride), then the repo owner override, then the global switch with percentage rollout bucketed by repo, then the audience gate on the repo owner. On for everyone; off repos keep the isolate-local wait-and-retry proxy, which is removed (with this flag) after two clean weeks on the queue. Every push records an observe-only git_push usage event (path, outcome, Durable Object wall time, wait, queue depth, attempts) and an exposure for the repo owner; read queue cost with adminRepoPushQueueCost.",
28886
28873
  exposureRecording: "repo-push-owners",
28887
28874
  successMetric: {
28888
28875
  eventType: "git_push",
@@ -198351,6 +198338,121 @@ var init_granted_scopes = __esm({
198351
198338
  }
198352
198339
  });
198353
198340
 
198341
+ // ../worker/src/mcp/events/constants.ts
198342
+ var mcpEventPayloadMaxBytes, mcpEventSubscriptionDefaultTtlMs, mcpEventSubscriptionMaxTtlMs, mcpEventSubscriptionMinTtlMs, mcpEventCallbackVerificationTtlMs, mcpEventSecretRotationGraceMs;
198343
+ var init_constants = __esm({
198344
+ "../worker/src/mcp/events/constants.ts"() {
198345
+ "use strict";
198346
+ mcpEventPayloadMaxBytes = 256 * 1024;
198347
+ mcpEventSubscriptionDefaultTtlMs = 60 * 60 * 1e3;
198348
+ mcpEventSubscriptionMaxTtlMs = 24 * 60 * 60 * 1e3;
198349
+ mcpEventSubscriptionMinTtlMs = 60 * 1e3;
198350
+ mcpEventCallbackVerificationTtlMs = 24 * 60 * 60 * 1e3;
198351
+ mcpEventSecretRotationGraceMs = 5 * 60 * 1e3;
198352
+ }
198353
+ });
198354
+
198355
+ // ../worker/src/mcp/events/ssrf.ts
198356
+ function isPublicFetchHostname(hostname3) {
198357
+ const host = hostname3.toLowerCase().replace(/\.$/, "");
198358
+ if (host.startsWith("[")) return isPublicIpv6(host.slice(1, -1));
198359
+ const ipv43 = parseIpv4(host);
198360
+ if (ipv43) return isPublicIpv4(ipv43);
198361
+ return !blockedHostnames.has(host) && !host.endsWith(".localhost");
198362
+ }
198363
+ function parseIpv4(hostname3) {
198364
+ const match2 = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(hostname3);
198365
+ if (!match2) return null;
198366
+ const octets = match2.slice(1).map(Number);
198367
+ if (octets.some((octet) => octet > 255)) return null;
198368
+ return octets;
198369
+ }
198370
+ function ipv4ToNumber(octets) {
198371
+ return (octets[0] << 24 >>> 0) + (octets[1] << 16) + (octets[2] << 8) + octets[3];
198372
+ }
198373
+ function isPublicIpv4(octets) {
198374
+ const address = ipv4ToNumber(octets);
198375
+ for (const [base, prefix2] of nonPublicIpv4Ranges) {
198376
+ const baseNumber = ipv4ToNumber(base.split(".").map(Number));
198377
+ const mask = prefix2 === 0 ? 0 : ~0 << 32 - prefix2 >>> 0;
198378
+ if ((address & mask) >>> 0 === (baseNumber & mask) >>> 0) {
198379
+ return false;
198380
+ }
198381
+ }
198382
+ return true;
198383
+ }
198384
+ function parseIpv6Groups(part) {
198385
+ if (part === "") return [];
198386
+ const groups = part.split(":");
198387
+ if (groups.some((group) => !/^[0-9a-f]{1,4}$/i.test(group))) return null;
198388
+ return groups.map((group) => Number.parseInt(group, 16));
198389
+ }
198390
+ function expandIpv6(value) {
198391
+ if (!/^[0-9a-f:.]+$/i.test(value)) return null;
198392
+ let address = value;
198393
+ const embeddedIpv4Groups = [];
198394
+ const embeddedIpv4 = /(\d{1,3}(?:\.\d{1,3}){3})$/.exec(address);
198395
+ if (embeddedIpv4) {
198396
+ const octets = parseIpv4(embeddedIpv4[1]);
198397
+ if (!octets) return null;
198398
+ address = address.slice(0, -embeddedIpv4[1].length);
198399
+ if (!address.endsWith(":")) return null;
198400
+ if (!address.endsWith("::")) address = address.slice(0, -1);
198401
+ embeddedIpv4Groups.push(
198402
+ octets[0] << 8 | octets[1],
198403
+ octets[2] << 8 | octets[3]
198404
+ );
198405
+ }
198406
+ const halves = address.split("::");
198407
+ if (halves.length > 2) return null;
198408
+ const left = parseIpv6Groups(halves[0]);
198409
+ const right = parseIpv6Groups(halves[1] ?? "");
198410
+ if (!left || !right) return null;
198411
+ if (halves.length === 1) {
198412
+ const groups = [...left, ...embeddedIpv4Groups];
198413
+ return groups.length === 8 ? groups : null;
198414
+ }
198415
+ const tail = [...right, ...embeddedIpv4Groups];
198416
+ const missing = 8 - left.length - tail.length;
198417
+ if (missing < 1) return null;
198418
+ return [...left, ...Array(missing).fill(0), ...tail];
198419
+ }
198420
+ function isPublicIpv6(value) {
198421
+ const groups = expandIpv6(value);
198422
+ if (!groups) return false;
198423
+ const first = groups[0];
198424
+ if ((first & 57344) !== 8192) return false;
198425
+ if (first === 8193 && groups[1] < 512) return false;
198426
+ if (first === 8193 && groups[1] === 3512) return false;
198427
+ if (first === 8194) return false;
198428
+ return true;
198429
+ }
198430
+ var blockedHostnames, nonPublicIpv4Ranges;
198431
+ var init_ssrf = __esm({
198432
+ "../worker/src/mcp/events/ssrf.ts"() {
198433
+ "use strict";
198434
+ init_constants();
198435
+ blockedHostnames = /* @__PURE__ */ new Set(["localhost", "localhost.localdomain"]);
198436
+ nonPublicIpv4Ranges = [
198437
+ ["0.0.0.0", 8],
198438
+ ["10.0.0.0", 8],
198439
+ ["100.64.0.0", 10],
198440
+ ["127.0.0.0", 8],
198441
+ ["169.254.0.0", 16],
198442
+ ["172.16.0.0", 12],
198443
+ ["192.0.0.0", 24],
198444
+ ["192.0.2.0", 24],
198445
+ ["192.88.99.0", 24],
198446
+ ["192.168.0.0", 16],
198447
+ ["198.18.0.0", 15],
198448
+ ["198.51.100.0", 24],
198449
+ ["203.0.113.0", 24],
198450
+ ["224.0.0.0", 4],
198451
+ ["240.0.0.0", 4]
198452
+ ];
198453
+ }
198454
+ });
198455
+
198354
198456
  // ../worker/src/integrations/secure-credential-url.ts
198355
198457
  function isLoopbackHostname2(hostname3) {
198356
198458
  const normalized = hostname3.trim().toLowerCase();
@@ -198365,10 +198467,16 @@ function isSecureCredentialUrl(raw) {
198365
198467
  return false;
198366
198468
  }
198367
198469
  }
198470
+ function isPublicCredentialEndpoint(raw) {
198471
+ if (!isSecureCredentialUrl(raw)) return false;
198472
+ const hostname3 = new URL(raw).hostname.replace(/\.$/, "");
198473
+ return isLoopbackHostname2(hostname3) || isPublicFetchHostname(hostname3);
198474
+ }
198368
198475
  var loopbackHostnames;
198369
198476
  var init_secure_credential_url = __esm({
198370
198477
  "../worker/src/integrations/secure-credential-url.ts"() {
198371
198478
  "use strict";
198479
+ init_ssrf();
198372
198480
  loopbackHostnames = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]", "::1"]);
198373
198481
  }
198374
198482
  });
@@ -198487,6 +198595,8 @@ var init_integration_shared = __esm({
198487
198595
  name: integrationNameSchema,
198488
198596
  tokenUrl: external_exports.string().url().refine(isSecureCredentialUrl, {
198489
198597
  message: "Token URL must use https (http is only allowed for localhost)."
198598
+ }).refine(isPublicCredentialEndpoint, {
198599
+ message: "Token URL must not target a private, link-local, or reserved address."
198490
198600
  }).optional(),
198491
198601
  apiBaseUrl: external_exports.string().url().nullable().optional(),
198492
198602
  flow: external_exports.enum(integrationFlowValues).optional(),
@@ -198496,6 +198606,8 @@ var init_integration_shared = __esm({
198496
198606
  tokenExchangeStyle: external_exports.enum(tokenExchangeStyleValues).nullable().optional(),
198497
198607
  deviceAuthorizationUrl: external_exports.string().url().refine(isSecureCredentialUrl, {
198498
198608
  message: "Device authorization URL must use https (http is only allowed for localhost)."
198609
+ }).refine(isPublicCredentialEndpoint, {
198610
+ message: "Device authorization URL must not target a private, link-local, or reserved address."
198499
198611
  }).nullable().optional(),
198500
198612
  authorization: integrationAuthorizationSchema.nullable().optional(),
198501
198613
  accountLabel: external_exports.string().min(1).nullable().optional(),
@@ -200807,6 +200919,7 @@ var init_token_refresh = __esm({
200807
200919
  init_oauth_token_exchange();
200808
200920
  init_account_identity();
200809
200921
  init_platform_apps();
200922
+ init_secure_credential_url();
200810
200923
  init_service3();
200811
200924
  init_live_sql();
200812
200925
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kodycodes/cli",
3
- "version": "3.45.4",
3
+ "version": "3.45.5",
4
4
  "description": "Official Kody CLI: login, secure token storage, search, and execute over the OpenAPI.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -24,6 +24,7 @@
24
24
  "bench": "node scripts/bench.mjs",
25
25
  "typecheck": "tsc --noEmit",
26
26
  "test": "KODY_CLI_CREDENTIAL_STORE=file KODY_DEV_STUB_RUNTIME=1 KODY_SKIP_SKILL_REFRESH=1 KODY_SKIP_GIT_HELPER_REFRESH=1 tsx --test --test-timeout=300000 --test-force-exit test/*.test.ts",
27
+ "test:windows": "KODY_CLI_CREDENTIAL_STORE=file KODY_DEV_STUB_RUNTIME=1 KODY_SKIP_SKILL_REFRESH=1 KODY_SKIP_GIT_HELPER_REFRESH=1 tsx --test --test-timeout=300000 --test-force-exit test/windows-paths.test.ts test/windows-command.test.ts test/credential-dir.test.ts test/keyring-entry.test.ts test/store.test.ts test/cli-credential.test.ts test/host-commands.test.ts test/host-access.test.ts test/fs-access.test.ts test/daemon-service.test.ts test/daemon-service-env.test.ts test/workerd-binary.test.ts test/install.test.ts",
27
28
  "validate": "npm run typecheck && npm run test && npm run build"
28
29
  },
29
30
  "engines": {