@mycompbox/compbox-mcp 1.21.9 → 1.21.11

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 (2) hide show
  1. package/index.js +427 -5
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -113,7 +113,7 @@ function normalizeGitRemote(raw) {
113
113
  path4 = path4.replace(/^\/+/, "").replace(/\/+$/, "").replace(/\.git$/, "");
114
114
  return `https://${host}/${path4}`;
115
115
  }
116
- var MACHINE_STATUSES, JOB_TYPES, JOB_STATUSES, TERMINAL_JOB_STATUSES, TURN_ROLES, START_EXECUTION_KINDS;
116
+ var MACHINE_STATUSES, JOB_TYPES, JOB_STATUSES, TERMINAL_JOB_STATUSES, TURN_ROLES, START_EXECUTION_KINDS, MIN_CLI_FOR_REPLY_RESUME;
117
117
  var init_mailbox = __esm({
118
118
  "../shared/dist/types/mailbox.js"() {
119
119
  "use strict";
@@ -129,6 +129,7 @@ var init_mailbox = __esm({
129
129
  "claimed",
130
130
  "running",
131
131
  "awaiting_input",
132
+ "waiting",
132
133
  "cancelling",
133
134
  "done",
134
135
  "failed",
@@ -137,6 +138,7 @@ var init_mailbox = __esm({
137
138
  TERMINAL_JOB_STATUSES = ["done", "failed", "cancelled"];
138
139
  TURN_ROLES = ["agent", "user"];
139
140
  START_EXECUTION_KINDS = ["plan", "orchestrate", "refine"];
141
+ MIN_CLI_FOR_REPLY_RESUME = "1.21.10";
140
142
  }
141
143
  });
142
144
 
@@ -1157,6 +1159,10 @@ function gcpServiceAccountEmail(projectId) {
1157
1159
  function gcpWorkloadProvider(projectNumber) {
1158
1160
  return `projects/${projectNumber}/locations/global/workloadIdentityPools/${GCP_IDENTITY_POOL}/providers/${GCP_IDENTITY_PROVIDER}`;
1159
1161
  }
1162
+ function gcpAttributeCondition(githubOwners) {
1163
+ const owners = [...new Set(githubOwners)];
1164
+ return `assertion.repository_owner in [${owners.map((o) => `'${o}'`).join(", ")}]`;
1165
+ }
1160
1166
  function gcpStateBucket(projectId) {
1161
1167
  return `${projectId}-compbox-tfstate`;
1162
1168
  }
@@ -1172,7 +1178,7 @@ function buildGcpSetupScript(input) {
1172
1178
  throw new Error(`Not a GitHub account name: ${owner}`);
1173
1179
  }
1174
1180
  const owners = [...new Set(input.githubOwners)];
1175
- const condition = `assertion.repository_owner in [${owners.map((o) => `'${o}'`).join(", ")}]`;
1181
+ const condition = gcpAttributeCondition(owners);
1176
1182
  const pool = `--location=global --workload-identity-pool=${GCP_IDENTITY_POOL}`;
1177
1183
  const oidc = [
1178
1184
  "--issuer-uri=https://token.actions.githubusercontent.com",
@@ -2442,6 +2448,393 @@ var init_return_to = __esm({
2442
2448
  }
2443
2449
  });
2444
2450
 
2451
+ // ../shared/dist/machineVersion.js
2452
+ function currentEnv2(env) {
2453
+ if (env)
2454
+ return env;
2455
+ return typeof process !== "undefined" ? process.env : {};
2456
+ }
2457
+ function parseMachineVersion(value) {
2458
+ if (typeof value !== "string")
2459
+ return null;
2460
+ const m = SEMVER_RE.exec(value.trim());
2461
+ if (!m)
2462
+ return null;
2463
+ return {
2464
+ major: Number(m[1]),
2465
+ minor: Number(m[2]),
2466
+ patch: Number(m[3]),
2467
+ prerelease: m[4] ? m[4].split(".") : []
2468
+ };
2469
+ }
2470
+ function compareIdentifiers(a, b) {
2471
+ const aNum = /^\d+$/.test(a);
2472
+ const bNum = /^\d+$/.test(b);
2473
+ if (aNum && bNum)
2474
+ return Math.sign(Number(a) - Number(b));
2475
+ if (aNum)
2476
+ return -1;
2477
+ if (bNum)
2478
+ return 1;
2479
+ return a < b ? -1 : a > b ? 1 : 0;
2480
+ }
2481
+ function compareParsed(a, b) {
2482
+ for (const key of ["major", "minor", "patch"]) {
2483
+ if (a[key] !== b[key])
2484
+ return a[key] < b[key] ? -1 : 1;
2485
+ }
2486
+ if (a.prerelease.length === 0 && b.prerelease.length === 0)
2487
+ return 0;
2488
+ if (a.prerelease.length === 0)
2489
+ return 1;
2490
+ if (b.prerelease.length === 0)
2491
+ return -1;
2492
+ const len = Math.max(a.prerelease.length, b.prerelease.length);
2493
+ for (let i = 0; i < len; i++) {
2494
+ const x = a.prerelease[i];
2495
+ const y = b.prerelease[i];
2496
+ if (x === void 0)
2497
+ return -1;
2498
+ if (y === void 0)
2499
+ return 1;
2500
+ const c = compareIdentifiers(x, y);
2501
+ if (c !== 0)
2502
+ return c;
2503
+ }
2504
+ return 0;
2505
+ }
2506
+ function compareMachineVersions(a, b) {
2507
+ const pa = parseMachineVersion(a);
2508
+ const pb = parseMachineVersion(b);
2509
+ if (!pa || !pb)
2510
+ return null;
2511
+ return compareParsed(pa, pb);
2512
+ }
2513
+ function isValidVersion(value) {
2514
+ return typeof value === "string" && parseMachineVersion(value) !== null;
2515
+ }
2516
+ function parseMinMachineVersionOverride(raw) {
2517
+ if (typeof raw !== "string")
2518
+ return null;
2519
+ const trimmed = raw.trim();
2520
+ if (!trimmed)
2521
+ return null;
2522
+ if (trimmed.startsWith("{")) {
2523
+ let parsed;
2524
+ try {
2525
+ parsed = JSON.parse(trimmed);
2526
+ } catch {
2527
+ return null;
2528
+ }
2529
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
2530
+ return null;
2531
+ const out = {};
2532
+ for (const [key, value] of Object.entries(parsed)) {
2533
+ if (isValidVersion(value))
2534
+ out[key] = value.trim();
2535
+ }
2536
+ return Object.keys(out).length > 0 ? out : null;
2537
+ }
2538
+ return isValidVersion(trimmed) ? { [MIN_MACHINE_VERSION_DEFAULT_KEY]: trimmed } : null;
2539
+ }
2540
+ function getMinimumFor(jobKind, env) {
2541
+ const override = parseMinMachineVersionOverride(currentEnv2(env).MIN_MACHINE_VERSION);
2542
+ const builtIn = MIN_MACHINE_VERSION;
2543
+ return override?.[jobKind] ?? override?.[MIN_MACHINE_VERSION_DEFAULT_KEY] ?? builtIn[jobKind] ?? MIN_MACHINE_VERSION.default;
2544
+ }
2545
+ function meetsMinimum(version, jobKind, env) {
2546
+ const current = parseMachineVersion(version);
2547
+ if (!current)
2548
+ return true;
2549
+ const minimum = parseMachineVersion(getMinimumFor(jobKind, env));
2550
+ if (!minimum)
2551
+ return true;
2552
+ return compareParsed(current, minimum) >= 0;
2553
+ }
2554
+ var MIN_MACHINE_VERSION_DEFAULT_KEY, MACHINE_UPDATE_COMMAND, MIN_MACHINE_VERSION, SEMVER_RE, MIN_MACHINE_VERSION_JOB_KINDS;
2555
+ var init_machineVersion = __esm({
2556
+ "../shared/dist/machineVersion.js"() {
2557
+ "use strict";
2558
+ init_mailbox();
2559
+ MIN_MACHINE_VERSION_DEFAULT_KEY = "default";
2560
+ MACHINE_UPDATE_COMMAND = "compbox update";
2561
+ MIN_MACHINE_VERSION = Object.freeze({
2562
+ default: "0.0.0",
2563
+ epic_request: "0.0.0",
2564
+ interview_reply: "0.0.0",
2565
+ start_execution: "0.0.0",
2566
+ connect_repo: "0.0.0"
2567
+ });
2568
+ SEMVER_RE = /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/;
2569
+ MIN_MACHINE_VERSION_JOB_KINDS = JOB_TYPES;
2570
+ }
2571
+ });
2572
+
2573
+ // ../shared/dist/needs-input.js
2574
+ function isNeedsInputKind(value) {
2575
+ return value === "merge_approval" || value === "cloud_preflight" || value === "merge_prs";
2576
+ }
2577
+ function isStringArray(value) {
2578
+ return Array.isArray(value) && value.every((v) => typeof v === "string");
2579
+ }
2580
+ function isPlainObject(value) {
2581
+ return value !== null && typeof value === "object" && !Array.isArray(value);
2582
+ }
2583
+ function isOption(value) {
2584
+ if (!isPlainObject(value))
2585
+ return false;
2586
+ if (typeof value.label !== "string" || !isStringArray(value.steps))
2587
+ return false;
2588
+ return value.onMachine === void 0 || typeof value.onMachine === "boolean";
2589
+ }
2590
+ function isOwnerItem(value) {
2591
+ return isPlainObject(value) && typeof value.title === "string" && typeof value.how === "string";
2592
+ }
2593
+ function isNeedsInputRequest(value) {
2594
+ if (!isPlainObject(value))
2595
+ return false;
2596
+ if (typeof value.question !== "string" || value.question.trim() === "")
2597
+ return false;
2598
+ if (value.why !== void 0 && typeof value.why !== "string")
2599
+ return false;
2600
+ if (value.steps !== void 0 && !isStringArray(value.steps))
2601
+ return false;
2602
+ if (value.options !== void 0 && !(Array.isArray(value.options) && value.options.every(isOption))) {
2603
+ return false;
2604
+ }
2605
+ if (value.afterAnswer !== void 0 && typeof value.afterAnswer !== "string")
2606
+ return false;
2607
+ if (value.ownerItems !== void 0 && !(Array.isArray(value.ownerItems) && value.ownerItems.every(isOwnerItem))) {
2608
+ return false;
2609
+ }
2610
+ if (value.ownerTaskIds !== void 0 && !isStringArray(value.ownerTaskIds))
2611
+ return false;
2612
+ if (value.kind !== void 0 && !isNeedsInputKind(value.kind))
2613
+ return false;
2614
+ if (value.prNumber !== void 0 && !(typeof value.prNumber === "number" && Number.isInteger(value.prNumber) && value.prNumber > 0)) {
2615
+ return false;
2616
+ }
2617
+ if (value.prNumbers !== void 0 && !(Array.isArray(value.prNumbers) && value.prNumbers.length <= 50 && value.prNumbers.every((n) => typeof n === "number" && Number.isInteger(n) && n > 0))) {
2618
+ return false;
2619
+ }
2620
+ return true;
2621
+ }
2622
+ function utf8ByteLength(text) {
2623
+ let bytes = 0;
2624
+ for (let i = 0; i < text.length; i++) {
2625
+ const code = text.charCodeAt(i);
2626
+ if (code < 128)
2627
+ bytes += 1;
2628
+ else if (code < 2048)
2629
+ bytes += 2;
2630
+ else if (code >= 55296 && code <= 56319 && i + 1 < text.length) {
2631
+ bytes += 4;
2632
+ i++;
2633
+ } else
2634
+ bytes += 3;
2635
+ }
2636
+ return bytes;
2637
+ }
2638
+ function normalize(req) {
2639
+ const out = { question: req.question };
2640
+ if (req.why !== void 0)
2641
+ out.why = req.why;
2642
+ if (req.steps !== void 0)
2643
+ out.steps = [...req.steps];
2644
+ if (req.options !== void 0) {
2645
+ out.options = req.options.map((o) => {
2646
+ const option = { label: o.label, steps: [...o.steps] };
2647
+ if (o.onMachine !== void 0)
2648
+ option.onMachine = o.onMachine;
2649
+ return option;
2650
+ });
2651
+ }
2652
+ if (req.afterAnswer !== void 0)
2653
+ out.afterAnswer = req.afterAnswer;
2654
+ if (req.ownerItems !== void 0) {
2655
+ out.ownerItems = req.ownerItems.map((i) => ({ title: i.title, how: i.how }));
2656
+ }
2657
+ if (req.ownerTaskIds !== void 0)
2658
+ out.ownerTaskIds = [...req.ownerTaskIds];
2659
+ if (req.kind !== void 0)
2660
+ out.kind = req.kind;
2661
+ if (req.prNumber !== void 0)
2662
+ out.prNumber = req.prNumber;
2663
+ if (req.prNumbers !== void 0)
2664
+ out.prNumbers = [...req.prNumbers];
2665
+ return out;
2666
+ }
2667
+ function stripRunnerOnlyFields(req) {
2668
+ const { kind: _kind, prNumber: _prNumber, prNumbers: _prNumbers, ...rest } = req;
2669
+ return rest;
2670
+ }
2671
+ function parseNeedsInputMarker(output) {
2672
+ if (typeof output !== "string" || output === "")
2673
+ return null;
2674
+ const lines = output.split(/\r?\n/);
2675
+ let last;
2676
+ for (let i = lines.length - 1; i >= 0; i--) {
2677
+ const line2 = lines[i];
2678
+ if (line2 !== void 0 && line2.trim() !== "") {
2679
+ last = line2;
2680
+ break;
2681
+ }
2682
+ }
2683
+ if (last === void 0)
2684
+ return null;
2685
+ const line = last.replace(/^[ \t]+/, "");
2686
+ if (!line.startsWith(NEEDS_INPUT_MARKER))
2687
+ return null;
2688
+ const rest = line.slice(NEEDS_INPUT_MARKER.length);
2689
+ if (!/^[ \t]/.test(rest))
2690
+ return null;
2691
+ const json = rest.trim();
2692
+ if (!json.startsWith("{") || !json.endsWith("}"))
2693
+ return null;
2694
+ if (utf8ByteLength(json) > NEEDS_INPUT_MAX_JSON_BYTES)
2695
+ return null;
2696
+ let parsed;
2697
+ try {
2698
+ parsed = JSON.parse(json);
2699
+ } catch {
2700
+ return null;
2701
+ }
2702
+ return isNeedsInputRequest(parsed) ? stripRunnerOnlyFields(normalize(parsed)) : null;
2703
+ }
2704
+ function formatNeedsInputText(req) {
2705
+ const out = [req.question.trim()];
2706
+ if (req.why?.trim())
2707
+ out.push("", `Why: ${req.why.trim()}`);
2708
+ if (req.steps && req.steps.length > 0) {
2709
+ out.push("", "Steps:");
2710
+ req.steps.forEach((s, i) => out.push(` ${String(i + 1)}. ${s}`));
2711
+ }
2712
+ if (req.options && req.options.length > 0) {
2713
+ out.push("", "Options (quickest first):");
2714
+ req.options.forEach((o, i) => {
2715
+ out.push(` Option ${String(i + 1)}: ${o.label}${o.onMachine ? " (runs on your machine)" : ""}`);
2716
+ o.steps.forEach((s, j) => out.push(` ${String(j + 1)}. ${s}`));
2717
+ });
2718
+ }
2719
+ if (req.ownerItems && req.ownerItems.length > 0) {
2720
+ out.push("", "Also waiting on you:");
2721
+ for (const item of req.ownerItems)
2722
+ out.push(` - ${item.title}: ${item.how}`);
2723
+ }
2724
+ if (req.afterAnswer?.trim()) {
2725
+ out.push("", `After you answer: ${req.afterAnswer.trim()}`);
2726
+ }
2727
+ out.push("", "Never paste secret values in your reply. Store them as GitHub environment secrets or in your cloud secret manager and reply with where you put them.");
2728
+ return out.join("\n");
2729
+ }
2730
+ function shannonEntropy(text) {
2731
+ if (text.length === 0)
2732
+ return 0;
2733
+ const counts = /* @__PURE__ */ new Map();
2734
+ let len = 0;
2735
+ for (const ch of text) {
2736
+ counts.set(ch, (counts.get(ch) ?? 0) + 1);
2737
+ len++;
2738
+ }
2739
+ let bits = 0;
2740
+ for (const n of counts.values()) {
2741
+ const p = n / len;
2742
+ bits -= p * Math.log2(p);
2743
+ }
2744
+ return bits;
2745
+ }
2746
+ function looksLikePathOrResource(token) {
2747
+ if (RESOURCE_PREFIX_RE.test(token))
2748
+ return true;
2749
+ const segments = token.split("/").filter((s) => s.length > 0);
2750
+ return segments.length >= 2 && segments.every((s) => PATH_SEGMENT_RE.test(s));
2751
+ }
2752
+ function isAwsSecretToken(token) {
2753
+ if (!AWS_SECRET_RE.test(token))
2754
+ return false;
2755
+ if (RESOURCE_PREFIX_RE.test(token))
2756
+ return false;
2757
+ if (!/[A-Z]/.test(token) || !/[a-z]/.test(token) || !/[0-9]/.test(token))
2758
+ return false;
2759
+ return shannonEntropy(token) > HIGH_ENTROPY_THRESHOLD;
2760
+ }
2761
+ function isHighEntropyToken(token) {
2762
+ if (token.length < HIGH_ENTROPY_MIN_LENGTH)
2763
+ return false;
2764
+ if (token.includes("/") && looksLikePathOrResource(token))
2765
+ return false;
2766
+ if (UUID_RE.test(token))
2767
+ return false;
2768
+ if (!/[0-9]/.test(token) || !/[A-Za-z]/.test(token))
2769
+ return false;
2770
+ return shannonEntropy(token) > HIGH_ENTROPY_THRESHOLD;
2771
+ }
2772
+ function looksLikeSecret(text) {
2773
+ if (typeof text !== "string" || text.trim() === "")
2774
+ return { secret: false };
2775
+ for (const { re, reason } of SECRET_PATTERNS) {
2776
+ if (re.test(text))
2777
+ return { secret: true, reason: `Looks like ${reason}.` };
2778
+ }
2779
+ for (const raw of text.split(/[\s"'`,;()<>[\]{}|]+/)) {
2780
+ const token = raw.replace(/^[.!?*]+|[.!?*]+$/g, "");
2781
+ if (token.length < HIGH_ENTROPY_MIN_LENGTH)
2782
+ continue;
2783
+ if (URL_RE.test(token) || EMAIL_RE.test(token))
2784
+ continue;
2785
+ if (isAwsSecretToken(token)) {
2786
+ return { secret: true, reason: "Looks like an AWS secret access key (40 chars)." };
2787
+ }
2788
+ for (const part of token.split(/[=:]+/)) {
2789
+ if (isHighEntropyToken(part)) {
2790
+ return {
2791
+ secret: true,
2792
+ reason: `Looks like a high-entropy token (${String(part.length)} chars starting "${part.slice(0, 4)}...").`
2793
+ };
2794
+ }
2795
+ }
2796
+ }
2797
+ return { secret: false };
2798
+ }
2799
+ var NEEDS_INPUT_MARKER, NEEDS_INPUT_MAX_JSON_BYTES, SECRET_PATTERNS, HIGH_ENTROPY_MIN_LENGTH, HIGH_ENTROPY_THRESHOLD, UUID_RE, URL_RE, EMAIL_RE, RESOURCE_PREFIX_RE, PATH_SEGMENT_RE, AWS_SECRET_RE;
2800
+ var init_needs_input = __esm({
2801
+ "../shared/dist/needs-input.js"() {
2802
+ "use strict";
2803
+ NEEDS_INPUT_MARKER = "COMPBOX_NEEDS_INPUT";
2804
+ NEEDS_INPUT_MAX_JSON_BYTES = 32 * 1024;
2805
+ SECRET_PATTERNS = [
2806
+ { re: /-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----/, reason: "a private key block (-----BEGIN ... PRIVATE KEY-----)" },
2807
+ { re: /(?<![A-Za-z0-9])sk-ant-[A-Za-z0-9_-]{16,}/, reason: "an Anthropic API key (sk-ant-)" },
2808
+ { re: /(?<![A-Za-z0-9])sk-[A-Za-z0-9_-]{16,}/, reason: "an API key starting with sk-" },
2809
+ { re: /(?<![A-Za-z0-9])[sr]k_(?:live|test)_[A-Za-z0-9]{16,}/, reason: "a Stripe secret key (sk_live_/sk_test_)" },
2810
+ { re: /(?<![A-Za-z0-9])github_pat_[A-Za-z0-9_]{20,}/, reason: "a GitHub fine-grained token (github_pat_)" },
2811
+ { re: /(?<![A-Za-z0-9])ghp_[A-Za-z0-9]{20,}/, reason: "a GitHub personal access token (ghp_)" },
2812
+ { re: /(?<![A-Za-z0-9])gho_[A-Za-z0-9]{20,}/, reason: "a GitHub OAuth token (gho_)" },
2813
+ { re: /(?<![A-Za-z0-9])gh[sur]_[A-Za-z0-9]{20,}/, reason: "a GitHub app or refresh token (ghs_/ghu_/ghr_)" },
2814
+ { re: /(?<![A-Za-z0-9])glpat-[A-Za-z0-9_-]{20,}/, reason: "a GitLab personal access token (glpat-)" },
2815
+ { re: /(?<![A-Za-z0-9])npm_[A-Za-z0-9]{30,}/, reason: "an npm access token (npm_)" },
2816
+ { re: /(?<![A-Za-z0-9])AKIA[0-9A-Z]{16}(?![A-Za-z0-9])/, reason: "an AWS access key id (AKIA...)" },
2817
+ {
2818
+ re: /aws_secret_access_key["']?\s*[=:]\s*["']?[A-Za-z0-9/+]{40}(?![A-Za-z0-9/+])/i,
2819
+ reason: "an AWS secret access key (aws_secret_access_key=...)"
2820
+ },
2821
+ { re: /(?<![A-Za-z0-9])xox[abp]-[A-Za-z0-9-]{10,}/, reason: "a Slack token (xoxa-/xoxb-/xoxp-)" },
2822
+ {
2823
+ re: /[a-z][a-z0-9+.-]*:\/\/[^\s/:@]+:[^\s/@]+@[^\s/@]+/i,
2824
+ reason: "a URL with an embedded password (scheme://user:password@host)"
2825
+ }
2826
+ ];
2827
+ HIGH_ENTROPY_MIN_LENGTH = 32;
2828
+ HIGH_ENTROPY_THRESHOLD = 4;
2829
+ UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
2830
+ URL_RE = /^[a-z][a-z0-9+.-]*:\/\//i;
2831
+ EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
2832
+ RESOURCE_PREFIX_RE = /^(?:(?:projects|organizations|folders|billingAccounts|locations|subscriptions)\/|arn:)/i;
2833
+ PATH_SEGMENT_RE = /^[a-z0-9._~-]{1,40}$/i;
2834
+ AWS_SECRET_RE = /^[A-Za-z0-9/+]{40}$/;
2835
+ }
2836
+ });
2837
+
2445
2838
  // ../shared/dist/index.js
2446
2839
  var dist_exports = {};
2447
2840
  __export(dist_exports, {
@@ -2471,7 +2864,14 @@ __export(dist_exports, {
2471
2864
  JOB_STATUSES: () => JOB_STATUSES,
2472
2865
  JOB_TYPES: () => JOB_TYPES,
2473
2866
  MACHINE_STATUSES: () => MACHINE_STATUSES,
2867
+ MACHINE_UPDATE_COMMAND: () => MACHINE_UPDATE_COMMAND,
2868
+ MIN_CLI_FOR_REPLY_RESUME: () => MIN_CLI_FOR_REPLY_RESUME,
2869
+ MIN_MACHINE_VERSION: () => MIN_MACHINE_VERSION,
2870
+ MIN_MACHINE_VERSION_DEFAULT_KEY: () => MIN_MACHINE_VERSION_DEFAULT_KEY,
2871
+ MIN_MACHINE_VERSION_JOB_KINDS: () => MIN_MACHINE_VERSION_JOB_KINDS,
2474
2872
  MODEL_CATALOG: () => MODEL_CATALOG,
2873
+ NEEDS_INPUT_MARKER: () => NEEDS_INPUT_MARKER,
2874
+ NEEDS_INPUT_MAX_JSON_BYTES: () => NEEDS_INPUT_MAX_JSON_BYTES,
2475
2875
  ORG_ROLES: () => ORG_ROLES,
2476
2876
  PXPIPE_DEFAULT_PROXY_URL: () => PXPIPE_DEFAULT_PROXY_URL,
2477
2877
  RETURN_TO_MAX_LENGTH: () => RETURN_TO_MAX_LENGTH,
@@ -2502,16 +2902,20 @@ __export(dist_exports, {
2502
2902
  buildStackFiles: () => buildStackFiles,
2503
2903
  cloudRunUrl: () => cloudRunUrl,
2504
2904
  cloudSqlInstanceName: () => cloudSqlInstanceName,
2905
+ compareMachineVersions: () => compareMachineVersions,
2505
2906
  complianceFromRecord: () => complianceFromRecord,
2506
2907
  databaseSecretName: () => databaseSecretName,
2507
2908
  deployRunTitle: () => deployRunTitle,
2508
2909
  err: () => err,
2509
2910
  estimateStackCost: () => estimateStackCost,
2510
2911
  extractCompletionJson: () => extractCompletionJson,
2912
+ formatNeedsInputText: () => formatNeedsInputText,
2913
+ gcpAttributeCondition: () => gcpAttributeCondition,
2511
2914
  gcpServiceAccountEmail: () => gcpServiceAccountEmail,
2512
2915
  gcpStateBucket: () => gcpStateBucket,
2513
2916
  gcpWorkloadProvider: () => gcpWorkloadProvider,
2514
2917
  getAnthropicProxyUrl: () => getAnthropicProxyUrl,
2918
+ getMinimumFor: () => getMinimumFor,
2515
2919
  getModelById: () => getModelById,
2516
2920
  getModelDisplayName: () => getModelDisplayName,
2517
2921
  getOpenAiProxyUrl: () => getOpenAiProxyUrl,
@@ -2534,6 +2938,8 @@ __export(dist_exports, {
2534
2938
  isJobStatus: () => isJobStatus,
2535
2939
  isJobType: () => isJobType,
2536
2940
  isMachineStatus: () => isMachineStatus,
2941
+ isNeedsInputKind: () => isNeedsInputKind,
2942
+ isNeedsInputRequest: () => isNeedsInputRequest,
2537
2943
  isOrgRole: () => isOrgRole,
2538
2944
  isPxpipeEnabled: () => isPxpipeEnabled,
2539
2945
  isS3BucketName: () => isS3BucketName,
@@ -2549,13 +2955,18 @@ __export(dist_exports, {
2549
2955
  isValidModelId: () => isValidModelId,
2550
2956
  lockedRequestMessage: () => lockedRequestMessage,
2551
2957
  looksLikeCompletionAttempt: () => looksLikeCompletionAttempt,
2958
+ looksLikeSecret: () => looksLikeSecret,
2552
2959
  mcpConfigSchema: () => mcpConfigSchema,
2553
2960
  mcpServerConfigSchema: () => mcpServerConfigSchema,
2554
2961
  meetsComplianceTarget: () => meetsComplianceTarget,
2962
+ meetsMinimum: () => meetsMinimum,
2555
2963
  modelRecommendationSourceValues: () => modelRecommendationSourceValues,
2556
2964
  normalizeDatabaseChoice: () => normalizeDatabaseChoice,
2557
2965
  normalizeGitRemote: () => normalizeGitRemote,
2558
2966
  ok: () => ok,
2967
+ parseMachineVersion: () => parseMachineVersion,
2968
+ parseMinMachineVersionOverride: () => parseMinMachineVersionOverride,
2969
+ parseNeedsInputMarker: () => parseNeedsInputMarker,
2559
2970
  probeProxyHealth: () => probeProxyHealth,
2560
2971
  renderConversationPrompt: () => renderConversationPrompt,
2561
2972
  requestLockReason: () => requestLockReason,
@@ -2565,12 +2976,14 @@ __export(dist_exports, {
2565
2976
  safeValidateSkillPackManifest: () => safeValidateSkillPackManifest,
2566
2977
  savedContextFromRecord: () => savedContextFromRecord,
2567
2978
  savedMessage: () => savedMessage,
2979
+ shannonEntropy: () => shannonEntropy,
2568
2980
  skillPackManifestSchema: () => skillPackManifestSchema,
2569
2981
  skillSchema: () => skillSchema,
2570
2982
  sleep: () => sleep,
2571
2983
  stackAppName: () => stackAppName,
2572
2984
  stackEnvSettings: () => stackEnvSettings,
2573
2985
  stackEnvironments: () => stackEnvironments,
2986
+ stripRunnerOnlyFields: () => stripRunnerOnlyFields,
2574
2987
  teardownConfirmation: () => teardownConfirmation,
2575
2988
  teardownRunTitle: () => teardownRunTitle,
2576
2989
  thinkingLevelValues: () => thinkingLevelValues,
@@ -2596,6 +3009,8 @@ var init_dist = __esm({
2596
3009
  init_stack_cost();
2597
3010
  init_github_repo();
2598
3011
  init_return_to();
3012
+ init_machineVersion();
3013
+ init_needs_input();
2599
3014
  }
2600
3015
  });
2601
3016
 
@@ -11002,6 +11417,11 @@ function isUuid(value) {
11002
11417
 
11003
11418
  // src/tools/teams.ts
11004
11419
  import { z as z20 } from "zod";
11420
+ function gcpKeylessGuidance(k) {
11421
+ const auth = k.workloadProvider ? `In GitHub Actions, sign in with google-github-actions/auth using workload_identity_provider "${k.workloadProvider}" and the deploy service account; never ask the owner for the workload provider, it is given here.` : "The Workload Identity provider is missing for this connection, so keyless sign-in can't be configured yet; don't ask the owner to type it in \u2014 an organization admin should reconnect Google Cloud in Settings -> Cloud.";
11422
+ const missing = k.missing.length > 0 ? ` Missing: ${k.missing.join(" ")}` : "";
11423
+ return `${auth} Only repositories owned by ${k.allowedGithubOwners.join(", ") || "(no connected GitHub account)"} can deploy. deployRoles are the roles CompBox's setup grants (expected, not verified).${missing}`;
11424
+ }
11005
11425
  function registerTeamTools(server2) {
11006
11426
  server2.registerTool(
11007
11427
  "compbox__list_teams",
@@ -11034,7 +11454,7 @@ function registerTeamTools(server2) {
11034
11454
  server2.registerTool(
11035
11455
  "compbox__get_project_cloud",
11036
11456
  {
11037
- description: "Get the cloud a project (team) deploys to: provider (gcp/aws/azure), cloud project or account ID, region and deploy identity, and whether it is the project's own choice or the organization's default. A team's cloudConnectionId of null means it FOLLOWS THE ORG DEFAULT, not that it has no cloud; always call this before planning hosting, databases or deployment. Returns cloud: null only when the organization has no cloud connected.",
11457
+ description: "Get the cloud a project (team) deploys to: provider (gcp/aws/azure), cloud project or account ID, region and deploy identity, and whether it is the project's own choice or the organization's default. A team's cloudConnectionId of null means it FOLLOWS THE ORG DEFAULT, not that it has no cloud; always call this before planning hosting, databases or deployment. Returns cloud: null only when the organization has no cloud connected. For Google Cloud it also returns gcpKeyless: projectNumber, workloadProvider (pass it as workload_identity_provider to google-github-actions/auth), identityPool, attributeCondition, allowedGithubOwners, deployRoles and requiredApis \u2014 everything a keyless deploy needs.",
11038
11458
  inputSchema: {
11039
11459
  team: z20.string().min(1).describe("The project/team: UUID, name or key (e.g. 'SAISUD').")
11040
11460
  }
@@ -11048,6 +11468,7 @@ function registerTeamTools(server2) {
11048
11468
  }
11049
11469
  const { data } = await apiClient.getProjectCloud(found.data.id);
11050
11470
  const cloud = data.cloud;
11471
+ const keyless = data.gcpKeyless ?? null;
11051
11472
  return createResponse({
11052
11473
  team: { id: found.data.id, name: found.data.name, key: found.data.key },
11053
11474
  hasCloud: cloud !== null,
@@ -11061,7 +11482,8 @@ function registerTeamTools(server2) {
11061
11482
  stateStore: cloud.stateStore,
11062
11483
  consoleUrl: cloud.consoleUrl
11063
11484
  },
11064
- guidance: cloud === null ? "No cloud is connected. An organization admin can connect one in Settings -> Cloud; until then don't assume a hosting provider." : `Plan hosting, databases and storage on ${cloud.provider.toUpperCase()} (${cloud.projectId}, ${cloud.region}). CompBox stacks deploy through GitHub Actions with keyless sign-in, so never plan stored cloud keys.`
11485
+ gcpKeyless: keyless,
11486
+ guidance: cloud === null ? "No cloud is connected. An organization admin can connect one in Settings -> Cloud; until then don't assume a hosting provider." : `Plan hosting, databases and storage on ${cloud.provider.toUpperCase()} (${cloud.projectId}, ${cloud.region}). CompBox stacks deploy through GitHub Actions with keyless sign-in, so never plan stored cloud keys.` + (keyless ? ` ${gcpKeylessGuidance(keyless)}` : "")
11065
11487
  });
11066
11488
  } catch (error) {
11067
11489
  return createErrorResponse(error);
@@ -12822,7 +13244,7 @@ function withLegacyToolCallRewrite(transport) {
12822
13244
  var SERVER_NAME = "compbox-mcp";
12823
13245
  function resolveServerVersion() {
12824
13246
  if (true) {
12825
- return "1.21.9";
13247
+ return "1.21.11";
12826
13248
  }
12827
13249
  const require2 = createRequire(import.meta.url);
12828
13250
  for (const candidate of ["../package.json", "./package.json"]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycompbox/compbox-mcp",
3
- "version": "1.21.9",
3
+ "version": "1.21.11",
4
4
  "description": "CompBox MCP server - Uses HTTP API client (no direct database access)",
5
5
  "license": "MIT",
6
6
  "type": "module",