@agentsky/sky 2.7.1 → 2.7.2
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 +17 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -64,7 +64,7 @@ function currentUniverse() {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
// src/version.ts
|
|
67
|
-
var CLI_VERSION = "2.7.
|
|
67
|
+
var CLI_VERSION = "2.7.2";
|
|
68
68
|
var USER_AGENT = `sky-cli/${CLI_VERSION} (${process.platform}; node/${process.versions.node})`;
|
|
69
69
|
|
|
70
70
|
// src/api.ts
|
|
@@ -1682,6 +1682,15 @@ async function disconnect(name, opts) {
|
|
|
1682
1682
|
|
|
1683
1683
|
// src/setup.ts
|
|
1684
1684
|
var SETUP_STEPS = ["skill", "logins", "import", "secrets"];
|
|
1685
|
+
var PLAN_PROVIDERS = { claude: "anthropic", anthropic: "anthropic", chatgpt: "openai", codex: "openai", openai: "openai", cursor: "cursor" };
|
|
1686
|
+
function planProviders(names) {
|
|
1687
|
+
if (!names?.length) return null;
|
|
1688
|
+
return new Set(names.map((name) => {
|
|
1689
|
+
const provider = PLAN_PROVIDERS[name.toLowerCase()];
|
|
1690
|
+
if (!provider) throw new ApiError(400, "unknown_provider", `unknown plan "${name}" \u2014 use claude, chatgpt or cursor`);
|
|
1691
|
+
return provider;
|
|
1692
|
+
}));
|
|
1693
|
+
}
|
|
1685
1694
|
function reportPath() {
|
|
1686
1695
|
return join8(dirname4(configPath()), "setup.json");
|
|
1687
1696
|
}
|
|
@@ -1860,6 +1869,8 @@ async function runSetup(opts) {
|
|
|
1860
1869
|
emit({ type: "done", report });
|
|
1861
1870
|
}
|
|
1862
1871
|
async function connectPlans(agents, opts, interactive, emit, run2) {
|
|
1872
|
+
const only = planProviders(opts.plans);
|
|
1873
|
+
const wanted = (provider) => only === null || only.has(provider);
|
|
1863
1874
|
const connected = opts.dryRun && !apiToken() ? /* @__PURE__ */ new Set() : await connectedProviders();
|
|
1864
1875
|
const record = (provider, outcome, detail) => {
|
|
1865
1876
|
emit({ type: "plan", provider, outcome, ...detail ? { detail } : {} });
|
|
@@ -1886,7 +1897,7 @@ async function connectPlans(agents, opts, interactive, emit, run2) {
|
|
|
1886
1897
|
record(provider, "failed", message(error));
|
|
1887
1898
|
}
|
|
1888
1899
|
};
|
|
1889
|
-
if (agents.some((agent2) => agent2.id === "claude_code")) {
|
|
1900
|
+
if (agents.some((agent2) => agent2.id === "claude_code") && wanted("anthropic")) {
|
|
1890
1901
|
if (connected.has("anthropic")) record("anthropic", "already");
|
|
1891
1902
|
else if (opts.dryRun) record("anthropic", "available");
|
|
1892
1903
|
else if (opts.json || opts.yes || opts.claude === false) record("anthropic", "skipped", "needs a browser approval");
|
|
@@ -1904,8 +1915,8 @@ async function connectPlans(agents, opts, interactive, emit, run2) {
|
|
|
1904
1915
|
}
|
|
1905
1916
|
}
|
|
1906
1917
|
}
|
|
1907
|
-
if (agents.some((agent2) => agent2.id === "codex")) await copy("openai", "ChatGPT", () => codexSignIn());
|
|
1908
|
-
if (agents.some((agent2) => agent2.id === "cursor")) await copy("cursor", "Cursor", () => cursorSignIn());
|
|
1918
|
+
if (agents.some((agent2) => agent2.id === "codex") && wanted("openai")) await copy("openai", "ChatGPT", () => codexSignIn());
|
|
1919
|
+
if (agents.some((agent2) => agent2.id === "cursor") && wanted("cursor")) await copy("cursor", "Cursor", () => cursorSignIn());
|
|
1909
1920
|
}
|
|
1910
1921
|
async function saveSecrets(found, opts, interactive, emit) {
|
|
1911
1922
|
const counts = { saved: 0, skipped: 0 };
|
|
@@ -2439,12 +2450,12 @@ program.command("skill").description("the AgentSky skill for the agents on this
|
|
|
2439
2450
|
})
|
|
2440
2451
|
);
|
|
2441
2452
|
program.command("setup [steps...]").description("bring this machine's agents to AgentSky: the skill, your plans, your skills and instructions, your tool keys").addHelpText("after", `
|
|
2442
|
-
Steps (all when none is named): ${SETUP_STEPS.join(" | ")}`).option("--key <key>", "a setup key from agentsky.dev/setup").option("--agent <id...>", "only these agents: claude_code | codex | cursor").option("--secret <name...>", "save these tool keys to your vault (asked one by one when omitted)").option("--no-claude", "leave the Claude plan alone").option("--dry-run", "say what would be done; write and send nothing").option("-y, --yes", "do not ask before each step").option("--json", "print progress as one JSON object per line; never asks").action(
|
|
2453
|
+
Steps (all when none is named): ${SETUP_STEPS.join(" | ")}`).option("--key <key>", "a setup key from agentsky.dev/setup").option("--agent <id...>", "only these agents: claude_code | codex | cursor").option("--secret <name...>", "save these tool keys to your vault (asked one by one when omitted)").option("--no-claude", "leave the Claude plan alone").option("--plan <name...>", "connect only these plans: claude | chatgpt | cursor").option("--dry-run", "say what would be done; write and send nothing").option("-y, --yes", "do not ask before each step").option("--json", "print progress as one JSON object per line; never asks").action(
|
|
2443
2454
|
run(async (steps, opts) => {
|
|
2444
2455
|
const unknown = steps.find((step) => !SETUP_STEPS.includes(step));
|
|
2445
2456
|
if (unknown) throw new Error(`unknown step ${unknown} \u2014 expected ${SETUP_STEPS.join(" | ")}`);
|
|
2446
2457
|
try {
|
|
2447
|
-
await runSetup({ steps, key: opts.key, agents: opts.agent, secrets: opts.secret, claude: opts.claude, dryRun: opts.dryRun, yes: opts.yes, json: opts.json });
|
|
2458
|
+
await runSetup({ steps, key: opts.key, agents: opts.agent, secrets: opts.secret, claude: opts.claude, plans: opts.plan, dryRun: opts.dryRun, yes: opts.yes, json: opts.json });
|
|
2448
2459
|
} catch (error) {
|
|
2449
2460
|
if (!opts.json) throw error;
|
|
2450
2461
|
console.log(JSON.stringify({ type: "error", code: error instanceof ApiError ? error.code : "failed", message: error instanceof Error ? error.message : String(error) }));
|