spacecode 2.12.1 → 2.12.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.
- package/dist/index.js +20 -10
- package/dist/index.js.map +3 -3
- package/dist/repl.mjs +239 -39
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8752,7 +8752,7 @@ Agent error: ${message}
|
|
|
8752
8752
|
fileSync.start();
|
|
8753
8753
|
}
|
|
8754
8754
|
const ttyHost = new URL(wsUrl.replace("wss://", "https://").replace("ws://", "http://")).host;
|
|
8755
|
-
const version = "2.12.
|
|
8755
|
+
const version = "2.12.3";
|
|
8756
8756
|
if (isResume) {
|
|
8757
8757
|
let turnCount = 0;
|
|
8758
8758
|
try {
|
|
@@ -24125,6 +24125,17 @@ __export(index_exports, {
|
|
|
24125
24125
|
launchWithOptions: () => launchWithOptions
|
|
24126
24126
|
});
|
|
24127
24127
|
module.exports = __toCommonJS(index_exports);
|
|
24128
|
+
async function runImport(agent, opts) {
|
|
24129
|
+
if (!IMPORT_AGENTS.includes(agent)) {
|
|
24130
|
+
console.error(`Unknown agent "${agent}". Supported: ${IMPORT_AGENTS.join(", ")}`);
|
|
24131
|
+
process.exit(2);
|
|
24132
|
+
}
|
|
24133
|
+
const { startLocalRepl: startLocalRepl2 } = await Promise.resolve().then(() => (init_repl(), repl_exports));
|
|
24134
|
+
const code = await startLocalRepl2({
|
|
24135
|
+
args: ["import", agent, ...opts.dryRun ? ["--dry-run"] : [], ...opts.overwrite ? ["--overwrite"] : [], ...opts.adapt === false ? ["--no-adapt"] : [], ...opts.yes ? ["--yes"] : [], ...opts.restoreOriginal ? ["--restore-original"] : []]
|
|
24136
|
+
});
|
|
24137
|
+
process.exit(code);
|
|
24138
|
+
}
|
|
24128
24139
|
function formatSessionAge(timestampMs) {
|
|
24129
24140
|
const diff = Date.now() - timestampMs;
|
|
24130
24141
|
const mins = Math.floor(diff / 6e4);
|
|
@@ -24172,7 +24183,7 @@ async function readStdin() {
|
|
|
24172
24183
|
}
|
|
24173
24184
|
return Buffer.concat(chunks).toString().trim();
|
|
24174
24185
|
}
|
|
24175
|
-
var import_commander, program;
|
|
24186
|
+
var import_commander, program, IMPORT_AGENTS, withImportOptions;
|
|
24176
24187
|
var init_index = __esm({
|
|
24177
24188
|
"src/index.ts"() {
|
|
24178
24189
|
import_commander = require("commander");
|
|
@@ -24199,7 +24210,7 @@ var init_index = __esm({
|
|
|
24199
24210
|
init_analytics();
|
|
24200
24211
|
initPostHog();
|
|
24201
24212
|
program = new import_commander.Command();
|
|
24202
|
-
program.name("spacecode").description("SpaceCode - launch cloud dev environments with AI coding agents").version("2.12.
|
|
24213
|
+
program.name("spacecode").description("SpaceCode - launch cloud dev environments with AI coding agents").version("2.12.3").enablePositionalOptions();
|
|
24203
24214
|
program.command("launch").description("Launch a new cloud session").option("-R, --repo <repo>", "Clone a GitHub repository into workspace (URL or owner/repo)").option("-n, --new [name]", "Start a new project (optionally specify name, or will prompt)").option("--name <name>", "Name this session for easy reconnection").option("--destroy", "Destroy the session on exit (default: session stays alive)").option("-t, --idle-timeout <minutes>", "Auto-shutdown timeout in minutes (default: 15)", "15").option("--proxy-mode <mode>", 'API proxy mode: "legacy" (round-robin GLM) or "pipeline" (multi-model router)', "pipeline").option("--own-key", "Bring your own API key (no proxy)").option("--api-key <key>", "Use a specific API key (bypasses proxy)").action(async (options) => {
|
|
24204
24215
|
await launchWithOptions(options);
|
|
24205
24216
|
});
|
|
@@ -24320,13 +24331,12 @@ Batch ${result.groupId}: ${result.dispatched}/${result.total} dispatched`));
|
|
|
24320
24331
|
program.command("login").description("Sign in with a SpaceCode API key").option("--api-key <key>", "SpaceCode API key (sk_...) from your dashboard").action(async (opts) => {
|
|
24321
24332
|
await login({ apiKey: opts.apiKey });
|
|
24322
24333
|
});
|
|
24323
|
-
|
|
24324
|
-
|
|
24325
|
-
|
|
24326
|
-
|
|
24327
|
-
|
|
24328
|
-
|
|
24329
|
-
});
|
|
24334
|
+
IMPORT_AGENTS = ["claude"];
|
|
24335
|
+
withImportOptions = (cmd) => cmd.option("--dry-run", "Show what would be imported without writing anything").option("--overwrite", "Replace profile items that differ from the agent's files").option("--no-adapt", "Import instructions as is instead of adapting them (default: a short always-on core plus on-demand sections, confirmed before storing)").option("--yes", "Store the adapted result without asking").option("--restore-original", "Put the unadapted instructions back as your loaded instructions");
|
|
24336
|
+
withImportOptions(
|
|
24337
|
+
program.command("import <agent>").description(`Import another coding agent's instructions, memory, commands, skills and MCP servers into your SpaceCode profile (agents: ${IMPORT_AGENTS.join(", ")})`)
|
|
24338
|
+
).action(async (agent, opts) => runImport(agent, opts));
|
|
24339
|
+
withImportOptions(program.command("import-claude", { hidden: true }).description("Deprecated: use `spacecode import claude`")).action(async (opts) => runImport("claude", opts));
|
|
24330
24340
|
program.command("approve-mcp").description("Approve the stdio commands of your imported MCP servers on this machine (each one separately; a changed command asks again)").action(async () => {
|
|
24331
24341
|
const { startLocalRepl: startLocalRepl2 } = await Promise.resolve().then(() => (init_repl(), repl_exports));
|
|
24332
24342
|
const code = await startLocalRepl2({ args: ["approve-mcp"] });
|