spacecode 2.12.3 → 2.12.4

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/repl.mjs CHANGED
@@ -5792,6 +5792,10 @@ async function readSkills(fs6, home, report) {
5792
5792
  const path13 = `${root}/${dir}/${rel}`;
5793
5793
  const content = await readOptional(fs6, path13, report);
5794
5794
  if (content === null) continue;
5795
+ if (content.trim() === "") {
5796
+ report.notes.push(`Skill ${parsed.name}: ${rel} not imported (empty file); the skill still loads without it`);
5797
+ continue;
5798
+ }
5795
5799
  const size = Buffer.byteLength(content, "utf8");
5796
5800
  const name = siblingAssetName(parsed.name, rel);
5797
5801
  if (size > MAX_ASSET_BYTES || slugs.has(name) || siblings.length >= MAX_SKILL_FILES || content.includes("\0")) {
@@ -7786,7 +7790,7 @@ async function adaptInstructions(deps, original) {
7786
7790
  const existingOrig = await client.get("instructions", "global.orig");
7787
7791
  if (current && existingOrig && existingOrig.content === original && current.description === marker) {
7788
7792
  log(" unchanged instructions/global (already adapted from this source)");
7789
- return true;
7793
+ return "unchanged";
7790
7794
  }
7791
7795
  const input = prepareAdaptation(original);
7792
7796
  if (input.sections.length === 0) {
@@ -7893,7 +7897,8 @@ ${USAGE}`);
7893
7897
  const report = await readClaudeAssets({ fs: deps.fs, home: deps.homedir(), projectDirs });
7894
7898
  deps.log(`Claude Code setup (project "${projectKey(projectDirs[projectDirs.length - 1] ?? deps.cwd)}"):`);
7895
7899
  for (const n of report.notes) deps.log(` note: ${n}`);
7896
- for (const a of report.assets) deps.log(` ${dryRun ? "would import" : "found"} ${a.kind}/${a.name} (${a.content.length} chars) ${a.source}`);
7900
+ if (dryRun) for (const a of report.assets) deps.log(` would import ${a.kind}/${a.name} (${a.content.length} chars) ${a.source}`);
7901
+ else if (report.assets.length > 0) deps.log(` found ${report.assets.length} item(s): ${summarizeKinds(report.assets)}`);
7897
7902
  for (const e of report.errors) deps.log(` ERROR ${e.path}: ${e.message}`);
7898
7903
  if (report.assets.length === 0) {
7899
7904
  deps.log("Nothing to import.");
@@ -7922,8 +7927,10 @@ ${USAGE}`);
7922
7927
  for (const a of report.assets) {
7923
7928
  try {
7924
7929
  if (adapt && a.kind === "instructions" && a.name === "global") {
7925
- if (await adaptInstructions({ client, log: deps.log, confirm: deps.confirm, assumeYes: flags.includes("--yes") }, a.content)) {
7926
- imported++;
7930
+ const adapted = await adaptInstructions({ client, log: deps.log, confirm: deps.confirm, assumeYes: flags.includes("--yes") }, a.content);
7931
+ if (adapted) {
7932
+ if (adapted === "unchanged") skipped++;
7933
+ else imported++;
7927
7934
  continue;
7928
7935
  }
7929
7936
  }
@@ -7961,6 +7968,11 @@ ${USAGE}`);
7961
7968
  deps.log(`Done: ${imported} imported, ${skipped} unchanged${failed ? ", some items need attention (see above)" : ""}.`);
7962
7969
  return failed ? 1 : 0;
7963
7970
  }
7971
+ function summarizeKinds(assets) {
7972
+ const counts = /* @__PURE__ */ new Map();
7973
+ for (const a of assets) counts.set(a.kind, (counts.get(a.kind) ?? 0) + 1);
7974
+ return [...counts].map(([kind, n]) => `${n} ${kind}`).join(", ");
7975
+ }
7964
7976
  var USAGE;
7965
7977
  var init_import_claude = __esm({
7966
7978
  "src/import-claude.ts"() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spacecode",
3
- "version": "2.12.3",
3
+ "version": "2.12.4",
4
4
  "description": "SpaceCode - launch cloud dev environments with AI coding agents",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",