@tablation/crew 0.130.1 → 0.130.3

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/dist/cli.js +19 -5
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -2353,6 +2353,7 @@ function storeForgeToken(forges, host, token, stateDir, env = process.env) {
2353
2353
  if (!i.write) throw new ForgeError(`forges.${host} reads its token from ${i.describe(f.entry.token, { host: f.host, stateDir, env })}, which crew cannot write`);
2354
2354
  if (!token.trim()) throw new ForgeError("empty token");
2355
2355
  i.write(f.entry.token, token.trim(), { host: f.host, stateDir, env });
2356
+ noteForgeMiss(stateDir, f.host, null);
2356
2357
  }
2357
2358
  function eraseForgeToken(forges, host, stateDir, env = process.env) {
2358
2359
  const f = forgeFor(forges, host);
@@ -13665,12 +13666,24 @@ function baseLayer() {
13665
13666
  return { name: "base", tag: `crew-sandbox-base:${hash({ SANDBOX_BASE_IMAGE, SANDBOX_OPENSHELL_VERSION })}`, dockerfile, files: {} };
13666
13667
  }
13667
13668
  var APT_HTTPS_COMMAND = "sed -i -E 's#http://([a-z0-9.-]*\\.)?ubuntu\\.com#https://\\1ubuntu.com#g' /etc/apt/sources.list.d/ubuntu.sources 2>/dev/null || true";
13669
+ var CA_BUNDLE_FILE = "ca-certificates.crt";
13670
+ var HOST_CA_BUNDLES = ["/etc/ssl/certs/ca-certificates.crt", "/etc/pki/tls/certs/ca-bundle.crt", "/etc/ssl/cert.pem"];
13671
+ function readHostCaBundle(paths = HOST_CA_BUNDLES) {
13672
+ for (const path of paths) {
13673
+ try {
13674
+ return readFileSync28(path, "utf8");
13675
+ } catch {
13676
+ }
13677
+ }
13678
+ return "";
13679
+ }
13668
13680
  function crewLayer(base, intel, bridge) {
13669
13681
  const files = { "credential-helper": CREDENTIAL_HELPER, "mcp.json": MCP_CONFIG, ...bridge ? { "intel-bridge": bridge } : {} };
13670
13682
  const env = Object.entries(CREW_ENV).map(([k, v]) => `${k}=${v}`).join(" ");
13671
13683
  const dockerfile = [
13672
13684
  `FROM ${base.tag}`,
13673
13685
  "USER root",
13686
+ `COPY ${CA_BUNDLE_FILE} /etc/ssl/certs/ca-certificates.crt`,
13674
13687
  run2(APT_HTTPS_COMMAND),
13675
13688
  run2(`apt-get update && apt-get install -y --no-install-recommends ca-certificates curl git${intel ? " python3 python3-venv nodejs" : ""} && rm -rf /var/lib/apt/lists/*`),
13676
13689
  `COPY credential-helper ${CREW_PREFIX}/bin/credential-helper`,
@@ -13685,7 +13698,7 @@ function crewLayer(base, intel, bridge) {
13685
13698
  `LABEL io.crew.sandbox.layer="crew" io.crew.sandbox.claude="${SANDBOX_CLAUDE_VERSION}"`,
13686
13699
  ""
13687
13700
  ].join("\n");
13688
- return { name: "crew", tag: `crew-sandbox-crew:${hash({ base: base.tag, dockerfile, files })}`, dockerfile, files };
13701
+ return { name: "crew", tag: `crew-sandbox-crew:${hash({ base: base.tag, dockerfile, files })}`, dockerfile, files, caBundleFile: CA_BUNDLE_FILE };
13689
13702
  }
13690
13703
  var WARM_DIR = "/tmp/crew-warm";
13691
13704
  var WARM_MAX_BYTES = 64 * 1024 * 1024;
@@ -13831,6 +13844,7 @@ async function buildSandboxImage(plan, deps) {
13831
13844
  mkdirSync19(dirname15(join32(ctx, name)), { recursive: true });
13832
13845
  writeFileSync20(join32(ctx, name), content);
13833
13846
  }
13847
+ if (layer.caBundleFile) writeFileSync20(join32(ctx, layer.caBundleFile), (deps.caBundle ?? readHostCaBundle)());
13834
13848
  const code = await deps.run(["build", "--tag", layer.tag, "--file", join32(ctx, "Dockerfile"), ctx], logPath);
13835
13849
  if (code !== 0) {
13836
13850
  state[plan.repo] = { ...entry, failure: { tag: plan.tag, at: now().toISOString(), logPath } };
@@ -15826,7 +15840,7 @@ function realProvisionDeps(crewHome) {
15826
15840
  return wrote ? "set" : "kept";
15827
15841
  },
15828
15842
  storedToken(host) {
15829
- const res = spawnCrew(["credential", "get"], { input: `protocol=https
15843
+ const res = spawnCrew(["credential", "get", "--no-miss"], { input: `protocol=https
15830
15844
  host=${host}
15831
15845
 
15832
15846
  ` });
@@ -19864,11 +19878,11 @@ function formatProjectsReport(report) {
19864
19878
 
19865
19879
  // src/forge-cmd.ts
19866
19880
  import { parseDocument as parseDocument4 } from "yaml";
19867
- function runCredential(action, stdin, forges, stateDir, env = process.env) {
19881
+ function runCredential(action, stdin, forges, stateDir, env = process.env, recordMisses = true) {
19868
19882
  try {
19869
19883
  const input = parseCredentialInput(stdin);
19870
19884
  const out = answerCredential(action ?? "", input, forges, stateDir, env);
19871
- if (action === "get" && input.host && (!input.protocol || input.protocol === "https")) {
19885
+ if (recordMisses && action === "get" && input.host && (!input.protocol || input.protocol === "https")) {
19872
19886
  noteForgeMiss(stateDir, input.host, out ? null : (/* @__PURE__ */ new Date()).toISOString());
19873
19887
  }
19874
19888
  return { code: 0, out, err: "" };
@@ -26315,7 +26329,7 @@ if (command === "passenger-sync-daemon") {
26315
26329
  throw e;
26316
26330
  }
26317
26331
  if (command === "credential") {
26318
- const r = runCredential(positional[1], readFileSync47(0, "utf8"), cfg.ship.forges, cfg.ship.stateDir);
26332
+ const r = runCredential(positional[1], readFileSync47(0, "utf8"), cfg.ship.forges, cfg.ship.stateDir, process.env, !flag("no-miss"));
26319
26333
  process.stdout.write(r.out);
26320
26334
  process.stderr.write(r.err);
26321
26335
  process.exit(r.code);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tablation/crew",
3
- "version": "0.130.1",
3
+ "version": "0.130.3",
4
4
  "description": "A standing team of headless agents that picks work off a Tablation board, does it on a machine you control, and reports back.",
5
5
  "type": "module",
6
6
  "license": "MIT",