deepline 0.1.296 → 0.1.298
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.
|
@@ -155,7 +155,7 @@ export const SDK_RELEASE = {
|
|
|
155
155
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
156
156
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
157
157
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
158
|
-
version: '0.1.
|
|
158
|
+
version: '0.1.298',
|
|
159
159
|
contracts: {
|
|
160
160
|
api: {
|
|
161
161
|
name: 'sdk-http-api',
|
|
@@ -6583,10 +6583,16 @@ async function completeRuntimeMapRowChunks(
|
|
|
6583
6583
|
AND target._write_version = $13::bigint
|
|
6584
6584
|
AND target._run_id = $5::text
|
|
6585
6585
|
AND target._status IN ('enriched', 'failed')
|
|
6586
|
-
AND
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6586
|
+
AND (
|
|
6587
|
+
EXISTS (
|
|
6588
|
+
SELECT 1
|
|
6589
|
+
FROM unnest($8::text[]) AS field_values(field)
|
|
6590
|
+
WHERE target._cell_meta -> field_values.field ->> 'runId' = $5::text
|
|
6591
|
+
)
|
|
6592
|
+
OR (
|
|
6593
|
+
coalesce(target._attempt_owner_run_id, target._run_id) = $10::text
|
|
6594
|
+
AND COALESCE(target._attempt_seq, 0) = $12::integer
|
|
6595
|
+
)
|
|
6590
6596
|
)
|
|
6591
6597
|
AND (
|
|
6592
6598
|
target._status <> 'enriched'
|
|
@@ -6874,10 +6880,16 @@ async function completeRuntimeMapRowChunksWithInputIndexRepair(
|
|
|
6874
6880
|
AND target._write_version = $13::bigint
|
|
6875
6881
|
AND target._run_id = $5::text
|
|
6876
6882
|
AND target._status IN ('enriched', 'failed')
|
|
6877
|
-
AND
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6883
|
+
AND (
|
|
6884
|
+
EXISTS (
|
|
6885
|
+
SELECT 1
|
|
6886
|
+
FROM unnest($8::text[]) AS field_values(field)
|
|
6887
|
+
WHERE target._cell_meta -> field_values.field ->> 'runId' = $5::text
|
|
6888
|
+
)
|
|
6889
|
+
OR (
|
|
6890
|
+
coalesce(target._attempt_owner_run_id, target._run_id) = $10::text
|
|
6891
|
+
AND COALESCE(target._attempt_seq, 0) = $12::integer
|
|
6892
|
+
)
|
|
6881
6893
|
)
|
|
6882
6894
|
AND (
|
|
6883
6895
|
target._status <> 'enriched'
|
|
@@ -7324,10 +7336,16 @@ async function failRuntimeMapRowChunks(
|
|
|
7324
7336
|
AND target._write_version = $16::bigint
|
|
7325
7337
|
AND target._run_id = $6::text
|
|
7326
7338
|
AND target._status IN ('enriched', 'failed')
|
|
7327
|
-
AND
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
7339
|
+
AND (
|
|
7340
|
+
EXISTS (
|
|
7341
|
+
SELECT 1
|
|
7342
|
+
FROM unnest($9::text[]) AS field_values(field)
|
|
7343
|
+
WHERE target._cell_meta -> field_values.field ->> 'runId' = $6::text
|
|
7344
|
+
)
|
|
7345
|
+
OR (
|
|
7346
|
+
coalesce(target._attempt_owner_run_id, target._run_id) = $12::text
|
|
7347
|
+
AND COALESCE(target._attempt_seq, 0) = $14::integer
|
|
7348
|
+
)
|
|
7331
7349
|
)
|
|
7332
7350
|
AND (
|
|
7333
7351
|
target._status <> 'failed'
|
package/dist/cli/index.js
CHANGED
|
@@ -718,7 +718,7 @@ var SDK_RELEASE = {
|
|
|
718
718
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
719
719
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
720
720
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
721
|
-
version: "0.1.
|
|
721
|
+
version: "0.1.298",
|
|
722
722
|
contracts: {
|
|
723
723
|
api: {
|
|
724
724
|
name: "sdk-http-api",
|
|
@@ -29914,6 +29914,7 @@ var install_commands_default = {
|
|
|
29914
29914
|
|
|
29915
29915
|
// src/cli/install-commands.ts
|
|
29916
29916
|
var INSTALL_COMMANDS = install_commands_default;
|
|
29917
|
+
var DEFAULT_SKILL_AGENTS = INSTALL_COMMANDS.skills.default_agents;
|
|
29917
29918
|
var DEFAULT_V1_SKILL_NAMES = [
|
|
29918
29919
|
"build-tam",
|
|
29919
29920
|
"clay-to-deepline",
|
|
@@ -29950,9 +29951,10 @@ function skillsIndexUrl(baseUrl) {
|
|
|
29950
29951
|
function buildSkillsAddArgs(baseUrl, skillName, options = {}) {
|
|
29951
29952
|
const skillNames = Array.isArray(skillName) ? skillName : [skillName];
|
|
29952
29953
|
const [firstSkillName, ...extraSkillNames] = skillNames;
|
|
29954
|
+
const agents = options.agents ?? INSTALL_COMMANDS.skills.default_agents;
|
|
29953
29955
|
const values = {
|
|
29954
29956
|
skills_index_url: skillsIndexUrl(baseUrl),
|
|
29955
|
-
agents:
|
|
29957
|
+
agents: agents.join(" "),
|
|
29956
29958
|
skill_name: firstSkillName ?? ""
|
|
29957
29959
|
};
|
|
29958
29960
|
const rendered = INSTALL_COMMANDS.skills.npx_add_args_template.flatMap(
|
|
@@ -29960,10 +29962,13 @@ function buildSkillsAddArgs(baseUrl, skillName, options = {}) {
|
|
|
29960
29962
|
const next = index === 0 && options.firstArg ? options.firstArg : arg;
|
|
29961
29963
|
const value = renderTemplate(next, values);
|
|
29962
29964
|
if (arg === "{agents}") {
|
|
29963
|
-
return
|
|
29965
|
+
return agents;
|
|
29964
29966
|
}
|
|
29965
29967
|
if (arg === "{skill_name}") {
|
|
29966
|
-
return [
|
|
29968
|
+
return [
|
|
29969
|
+
value,
|
|
29970
|
+
...extraSkillNames.flatMap((name) => ["--skill", name])
|
|
29971
|
+
];
|
|
29967
29972
|
}
|
|
29968
29973
|
return value;
|
|
29969
29974
|
}
|
|
@@ -29984,6 +29989,29 @@ function sdkNpmGlobalInstallCommand() {
|
|
|
29984
29989
|
return INSTALL_COMMANDS.cli.sdk_npm_global;
|
|
29985
29990
|
}
|
|
29986
29991
|
|
|
29992
|
+
// src/cli/windows-arg-escape.ts
|
|
29993
|
+
var CMD_META_CHARS = /([()\][%!^"`<>&|;, *?])/g;
|
|
29994
|
+
function escapeCmdArgument(arg, forBatchFile = true) {
|
|
29995
|
+
let escaped = arg.replace(/(\\*)"/g, '$1$1\\"');
|
|
29996
|
+
escaped = escaped.replace(/(\\*)$/, "$1$1");
|
|
29997
|
+
escaped = `"${escaped}"`;
|
|
29998
|
+
escaped = escaped.replace(CMD_META_CHARS, "^$1");
|
|
29999
|
+
return forBatchFile ? escaped.replace(CMD_META_CHARS, "^$1") : escaped;
|
|
30000
|
+
}
|
|
30001
|
+
function escapeCmdCommand(command) {
|
|
30002
|
+
return command.replace(CMD_META_CHARS, "^$1");
|
|
30003
|
+
}
|
|
30004
|
+
function resolveShellSpawn(command, args, platform3 = process.platform) {
|
|
30005
|
+
if (platform3 !== "win32") {
|
|
30006
|
+
return { command, args: [...args], shell: false };
|
|
30007
|
+
}
|
|
30008
|
+
return {
|
|
30009
|
+
command: escapeCmdCommand(command),
|
|
30010
|
+
args: args.map((arg) => escapeCmdArgument(arg)),
|
|
30011
|
+
shell: true
|
|
30012
|
+
};
|
|
30013
|
+
}
|
|
30014
|
+
|
|
29987
30015
|
// src/cli/commands/skills.ts
|
|
29988
30016
|
var RUNTIME_TO_SKILLS_AGENT = {
|
|
29989
30017
|
antigravity: "antigravity",
|
|
@@ -30149,11 +30177,12 @@ function readSkillsInstallState(path) {
|
|
|
30149
30177
|
}
|
|
30150
30178
|
function runProcess(command, args, cwd) {
|
|
30151
30179
|
return new Promise((resolve15, reject) => {
|
|
30152
|
-
const
|
|
30180
|
+
const plan = resolveShellSpawn(command, args);
|
|
30181
|
+
const child = (0, import_node_child_process2.spawn)(plan.command, plan.args, {
|
|
30153
30182
|
cwd,
|
|
30154
30183
|
env: process.env,
|
|
30155
30184
|
stdio: ["ignore", "ignore", "pipe"],
|
|
30156
|
-
shell:
|
|
30185
|
+
shell: plan.shell
|
|
30157
30186
|
});
|
|
30158
30187
|
let stderr = "";
|
|
30159
30188
|
child.stderr.on("data", (chunk) => {
|
|
@@ -30695,9 +30724,10 @@ function installedPackageVersion(versionDir) {
|
|
|
30695
30724
|
function runCommand(command, args, env = process.env) {
|
|
30696
30725
|
return new Promise((resolveResult) => {
|
|
30697
30726
|
let output2 = "";
|
|
30698
|
-
const
|
|
30727
|
+
const plan = resolveShellSpawn(command, args);
|
|
30728
|
+
const child = (0, import_node_child_process3.spawn)(plan.command, plan.args, {
|
|
30699
30729
|
stdio: ["inherit", "pipe", "pipe"],
|
|
30700
|
-
shell:
|
|
30730
|
+
shell: plan.shell,
|
|
30701
30731
|
env
|
|
30702
30732
|
});
|
|
30703
30733
|
child.stdout?.on("data", (chunk) => {
|
|
@@ -31240,19 +31270,27 @@ function isHomebrewFormulaCommand(path) {
|
|
|
31240
31270
|
const cellarIndex = parts.lastIndexOf("Cellar");
|
|
31241
31271
|
return cellarIndex >= 0 && parts[cellarIndex + 1] === "deepline" && parts.slice(cellarIndex + 3).includes("libexec");
|
|
31242
31272
|
}
|
|
31243
|
-
function resolvePersistentGlobalCommand(
|
|
31273
|
+
function resolvePersistentGlobalCommand(dependencies = {}) {
|
|
31274
|
+
const platform3 = dependencies.platform ?? process.platform;
|
|
31275
|
+
const run = dependencies.spawn ?? import_node_child_process4.spawnSync;
|
|
31276
|
+
const pathExists = dependencies.exists ?? import_node_fs18.existsSync;
|
|
31277
|
+
const pathClis = dependencies.pathClis ?? resolvePathCommands("deepline");
|
|
31244
31278
|
const homebrewCommand = pathClis.find(isHomebrewFormulaCommand);
|
|
31245
31279
|
if (homebrewCommand) return homebrewCommand;
|
|
31246
|
-
const
|
|
31280
|
+
const plan = resolveShellSpawn("npm", ["prefix", "-g"], platform3);
|
|
31281
|
+
const prefix = run(plan.command, plan.args, {
|
|
31282
|
+
encoding: "utf8",
|
|
31283
|
+
shell: plan.shell
|
|
31284
|
+
});
|
|
31247
31285
|
if (prefix.status !== 0) return null;
|
|
31248
31286
|
const root = String(prefix.stdout ?? "").trim();
|
|
31249
31287
|
if (!root) return null;
|
|
31250
|
-
const candidates =
|
|
31251
|
-
return candidates.find((candidate) => (
|
|
31288
|
+
const candidates = platform3 === "win32" ? [(0, import_node_path20.join)(root, "deepline.cmd"), (0, import_node_path20.join)(root, "deepline")] : [(0, import_node_path20.join)(root, "bin", "deepline")];
|
|
31289
|
+
return candidates.find((candidate) => pathExists(candidate)) ?? null;
|
|
31252
31290
|
}
|
|
31253
31291
|
function inspectGlobalCliAvailability(input2) {
|
|
31254
31292
|
const pathClis = input2?.pathClis ?? resolvePathCommands("deepline");
|
|
31255
|
-
const persistentPath = input2 && "persistentGlobalCli" in input2 ? input2.persistentGlobalCli ?? null : resolvePersistentGlobalCommand(pathClis);
|
|
31293
|
+
const persistentPath = input2 && "persistentGlobalCli" in input2 ? input2.persistentGlobalCli ?? null : resolvePersistentGlobalCommand({ pathClis });
|
|
31256
31294
|
const path = persistentPath ? pathClis.find(
|
|
31257
31295
|
(candidate) => pathsResolveToSameFile(candidate, persistentPath)
|
|
31258
31296
|
) ?? null : null;
|
|
@@ -32272,28 +32310,51 @@ async function fetchSkillsUpdate(baseUrl, localVersion) {
|
|
|
32272
32310
|
clearTimeout(timeout);
|
|
32273
32311
|
}
|
|
32274
32312
|
}
|
|
32275
|
-
function buildSkillsInstallArgs(baseUrl, skillNames = DEFAULT_SDK_SKILL_NAMES) {
|
|
32276
|
-
return buildSkillsAddArgs(baseUrl, sortedUniqueSkillNames(skillNames)
|
|
32313
|
+
function buildSkillsInstallArgs(baseUrl, skillNames = DEFAULT_SDK_SKILL_NAMES, agents) {
|
|
32314
|
+
return buildSkillsAddArgs(baseUrl, sortedUniqueSkillNames(skillNames), {
|
|
32315
|
+
agents
|
|
32316
|
+
});
|
|
32277
32317
|
}
|
|
32278
|
-
function buildBunxSkillsInstallArgs(baseUrl, skillNames) {
|
|
32318
|
+
function buildBunxSkillsInstallArgs(baseUrl, skillNames, agents) {
|
|
32279
32319
|
return buildSkillsAddArgs(baseUrl, sortedUniqueSkillNames(skillNames), {
|
|
32280
|
-
firstArg: "--bun"
|
|
32320
|
+
firstArg: "--bun",
|
|
32321
|
+
agents
|
|
32281
32322
|
});
|
|
32282
32323
|
}
|
|
32324
|
+
function resolveAutoSyncSkillAgents() {
|
|
32325
|
+
switch (detectAgentRuntime()) {
|
|
32326
|
+
case "codex":
|
|
32327
|
+
return ["codex"];
|
|
32328
|
+
case "claude_code":
|
|
32329
|
+
return ["claude-code"];
|
|
32330
|
+
case "cursor":
|
|
32331
|
+
return ["cursor"];
|
|
32332
|
+
case "gemini":
|
|
32333
|
+
return ["gemini-cli"];
|
|
32334
|
+
case "antigravity":
|
|
32335
|
+
return ["antigravity"];
|
|
32336
|
+
default:
|
|
32337
|
+
return [];
|
|
32338
|
+
}
|
|
32339
|
+
}
|
|
32283
32340
|
function hasCommand(command) {
|
|
32284
|
-
const
|
|
32341
|
+
const plan = resolveShellSpawn(command, ["--version"]);
|
|
32342
|
+
const result = (0, import_node_child_process6.spawnSync)(plan.command, plan.args, {
|
|
32285
32343
|
stdio: "ignore",
|
|
32286
|
-
shell:
|
|
32344
|
+
shell: plan.shell
|
|
32287
32345
|
});
|
|
32288
32346
|
return result.status === 0;
|
|
32289
32347
|
}
|
|
32290
32348
|
function shellQuote5(arg) {
|
|
32291
32349
|
return `'${arg.replace(/'/g, `'\\''`)}'`;
|
|
32292
32350
|
}
|
|
32293
|
-
function
|
|
32351
|
+
function resolveSkillsInstallSpawn(install, platform3 = process.platform) {
|
|
32352
|
+
return resolveShellSpawn(install.command, install.args, platform3);
|
|
32353
|
+
}
|
|
32354
|
+
function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NAMES, agents = DEFAULT_SKILL_AGENTS) {
|
|
32294
32355
|
const commands = [];
|
|
32295
32356
|
if (hasCommand("bunx")) {
|
|
32296
|
-
const bunxArgs = buildBunxSkillsInstallArgs(baseUrl, skillNames);
|
|
32357
|
+
const bunxArgs = buildBunxSkillsInstallArgs(baseUrl, skillNames, agents);
|
|
32297
32358
|
commands.push({
|
|
32298
32359
|
command: "bunx",
|
|
32299
32360
|
args: bunxArgs,
|
|
@@ -32301,7 +32362,7 @@ function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NA
|
|
|
32301
32362
|
});
|
|
32302
32363
|
}
|
|
32303
32364
|
if (hasCommand("npx")) {
|
|
32304
|
-
const npxArgs = buildSkillsInstallArgs(baseUrl, skillNames);
|
|
32365
|
+
const npxArgs = buildSkillsInstallArgs(baseUrl, skillNames, agents);
|
|
32305
32366
|
commands.push({
|
|
32306
32367
|
command: "npx",
|
|
32307
32368
|
args: npxArgs,
|
|
@@ -32312,9 +32373,11 @@ function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NA
|
|
|
32312
32373
|
}
|
|
32313
32374
|
function runOneSkillsInstall(install) {
|
|
32314
32375
|
return new Promise((resolve15) => {
|
|
32315
|
-
const
|
|
32376
|
+
const plan = resolveSkillsInstallSpawn(install);
|
|
32377
|
+
const child = (0, import_node_child_process6.spawn)(plan.command, plan.args, {
|
|
32316
32378
|
stdio: ["ignore", "ignore", "pipe"],
|
|
32317
|
-
env: process.env
|
|
32379
|
+
env: process.env,
|
|
32380
|
+
shell: plan.shell
|
|
32318
32381
|
});
|
|
32319
32382
|
let stderr = "";
|
|
32320
32383
|
child.stderr.on("data", (chunk) => {
|
|
@@ -32358,7 +32421,7 @@ ${details}` : ""}
|
|
|
32358
32421
|
);
|
|
32359
32422
|
return false;
|
|
32360
32423
|
}
|
|
32361
|
-
function runLegacySkillsCleanup() {
|
|
32424
|
+
function runLegacySkillsCleanup(agents) {
|
|
32362
32425
|
const candidates = hasCommand("bunx") ? [
|
|
32363
32426
|
{
|
|
32364
32427
|
command: "bunx",
|
|
@@ -32367,6 +32430,8 @@ function runLegacySkillsCleanup() {
|
|
|
32367
32430
|
"skills",
|
|
32368
32431
|
"remove",
|
|
32369
32432
|
"--global",
|
|
32433
|
+
"--agent",
|
|
32434
|
+
...agents,
|
|
32370
32435
|
"-y",
|
|
32371
32436
|
...LEGACY_SKILL_NAMES_TO_REMOVE
|
|
32372
32437
|
]
|
|
@@ -32378,6 +32443,8 @@ function runLegacySkillsCleanup() {
|
|
|
32378
32443
|
"skills",
|
|
32379
32444
|
"remove",
|
|
32380
32445
|
"--global",
|
|
32446
|
+
"--agent",
|
|
32447
|
+
...agents,
|
|
32381
32448
|
"-y",
|
|
32382
32449
|
...LEGACY_SKILL_NAMES_TO_REMOVE
|
|
32383
32450
|
]
|
|
@@ -32390,16 +32457,19 @@ function runLegacySkillsCleanup() {
|
|
|
32390
32457
|
"skills",
|
|
32391
32458
|
"remove",
|
|
32392
32459
|
"--global",
|
|
32460
|
+
"--agent",
|
|
32461
|
+
...agents,
|
|
32393
32462
|
"-y",
|
|
32394
32463
|
...LEGACY_SKILL_NAMES_TO_REMOVE
|
|
32395
32464
|
]
|
|
32396
32465
|
}
|
|
32397
32466
|
];
|
|
32398
32467
|
for (const candidate of candidates) {
|
|
32399
|
-
const
|
|
32468
|
+
const plan = resolveShellSpawn(candidate.command, candidate.args);
|
|
32469
|
+
const result = (0, import_node_child_process6.spawnSync)(plan.command, plan.args, {
|
|
32400
32470
|
stdio: "ignore",
|
|
32401
32471
|
env: process.env,
|
|
32402
|
-
shell:
|
|
32472
|
+
shell: plan.shell
|
|
32403
32473
|
});
|
|
32404
32474
|
if (result.status === 0) return;
|
|
32405
32475
|
}
|
|
@@ -32433,7 +32503,12 @@ async function syncSdkSkillsIfNeeded(baseUrl, options = {}) {
|
|
|
32433
32503
|
remoteSkillNames.length > 0 ? remoteSkillNames : DEFAULT_SDK_SKILL_NAMES
|
|
32434
32504
|
);
|
|
32435
32505
|
if (skillNames.length === 0) return;
|
|
32436
|
-
const
|
|
32506
|
+
const agents = resolveAutoSyncSkillAgents();
|
|
32507
|
+
if (agents.length === 0) {
|
|
32508
|
+
writeUnavailableSkillsNotice(baseUrl, update.remoteVersion, skillNames);
|
|
32509
|
+
return;
|
|
32510
|
+
}
|
|
32511
|
+
const installs = resolveSkillsInstallCommands(baseUrl, skillNames, agents);
|
|
32437
32512
|
if (installs.length === 0) {
|
|
32438
32513
|
writeUnavailableSkillsNotice(baseUrl, update.remoteVersion, skillNames);
|
|
32439
32514
|
return;
|
|
@@ -32441,7 +32516,7 @@ async function syncSdkSkillsIfNeeded(baseUrl, options = {}) {
|
|
|
32441
32516
|
writeSdkSkillsStatusLine("Deepline skills changed; syncing agent skills...");
|
|
32442
32517
|
const installed = await runSkillsInstall(installs);
|
|
32443
32518
|
if (!installed) return;
|
|
32444
|
-
runLegacySkillsCleanup();
|
|
32519
|
+
runLegacySkillsCleanup(agents);
|
|
32445
32520
|
writeLocalSkillsVersion(baseUrl, update.remoteVersion);
|
|
32446
32521
|
clearUnavailableSkillsNotice(baseUrl);
|
|
32447
32522
|
writeSdkSkillsStatusLine("Deepline agent skills are up to date.");
|
package/dist/cli/index.mjs
CHANGED
|
@@ -703,7 +703,7 @@ var SDK_RELEASE = {
|
|
|
703
703
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
704
704
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
705
705
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
706
|
-
version: "0.1.
|
|
706
|
+
version: "0.1.298",
|
|
707
707
|
contracts: {
|
|
708
708
|
api: {
|
|
709
709
|
name: "sdk-http-api",
|
|
@@ -29971,6 +29971,7 @@ var install_commands_default = {
|
|
|
29971
29971
|
|
|
29972
29972
|
// src/cli/install-commands.ts
|
|
29973
29973
|
var INSTALL_COMMANDS = install_commands_default;
|
|
29974
|
+
var DEFAULT_SKILL_AGENTS = INSTALL_COMMANDS.skills.default_agents;
|
|
29974
29975
|
var DEFAULT_V1_SKILL_NAMES = [
|
|
29975
29976
|
"build-tam",
|
|
29976
29977
|
"clay-to-deepline",
|
|
@@ -30007,9 +30008,10 @@ function skillsIndexUrl(baseUrl) {
|
|
|
30007
30008
|
function buildSkillsAddArgs(baseUrl, skillName, options = {}) {
|
|
30008
30009
|
const skillNames = Array.isArray(skillName) ? skillName : [skillName];
|
|
30009
30010
|
const [firstSkillName, ...extraSkillNames] = skillNames;
|
|
30011
|
+
const agents = options.agents ?? INSTALL_COMMANDS.skills.default_agents;
|
|
30010
30012
|
const values = {
|
|
30011
30013
|
skills_index_url: skillsIndexUrl(baseUrl),
|
|
30012
|
-
agents:
|
|
30014
|
+
agents: agents.join(" "),
|
|
30013
30015
|
skill_name: firstSkillName ?? ""
|
|
30014
30016
|
};
|
|
30015
30017
|
const rendered = INSTALL_COMMANDS.skills.npx_add_args_template.flatMap(
|
|
@@ -30017,10 +30019,13 @@ function buildSkillsAddArgs(baseUrl, skillName, options = {}) {
|
|
|
30017
30019
|
const next = index === 0 && options.firstArg ? options.firstArg : arg;
|
|
30018
30020
|
const value = renderTemplate(next, values);
|
|
30019
30021
|
if (arg === "{agents}") {
|
|
30020
|
-
return
|
|
30022
|
+
return agents;
|
|
30021
30023
|
}
|
|
30022
30024
|
if (arg === "{skill_name}") {
|
|
30023
|
-
return [
|
|
30025
|
+
return [
|
|
30026
|
+
value,
|
|
30027
|
+
...extraSkillNames.flatMap((name) => ["--skill", name])
|
|
30028
|
+
];
|
|
30024
30029
|
}
|
|
30025
30030
|
return value;
|
|
30026
30031
|
}
|
|
@@ -30041,6 +30046,29 @@ function sdkNpmGlobalInstallCommand() {
|
|
|
30041
30046
|
return INSTALL_COMMANDS.cli.sdk_npm_global;
|
|
30042
30047
|
}
|
|
30043
30048
|
|
|
30049
|
+
// src/cli/windows-arg-escape.ts
|
|
30050
|
+
var CMD_META_CHARS = /([()\][%!^"`<>&|;, *?])/g;
|
|
30051
|
+
function escapeCmdArgument(arg, forBatchFile = true) {
|
|
30052
|
+
let escaped = arg.replace(/(\\*)"/g, '$1$1\\"');
|
|
30053
|
+
escaped = escaped.replace(/(\\*)$/, "$1$1");
|
|
30054
|
+
escaped = `"${escaped}"`;
|
|
30055
|
+
escaped = escaped.replace(CMD_META_CHARS, "^$1");
|
|
30056
|
+
return forBatchFile ? escaped.replace(CMD_META_CHARS, "^$1") : escaped;
|
|
30057
|
+
}
|
|
30058
|
+
function escapeCmdCommand(command) {
|
|
30059
|
+
return command.replace(CMD_META_CHARS, "^$1");
|
|
30060
|
+
}
|
|
30061
|
+
function resolveShellSpawn(command, args, platform3 = process.platform) {
|
|
30062
|
+
if (platform3 !== "win32") {
|
|
30063
|
+
return { command, args: [...args], shell: false };
|
|
30064
|
+
}
|
|
30065
|
+
return {
|
|
30066
|
+
command: escapeCmdCommand(command),
|
|
30067
|
+
args: args.map((arg) => escapeCmdArgument(arg)),
|
|
30068
|
+
shell: true
|
|
30069
|
+
};
|
|
30070
|
+
}
|
|
30071
|
+
|
|
30044
30072
|
// src/cli/commands/skills.ts
|
|
30045
30073
|
var RUNTIME_TO_SKILLS_AGENT = {
|
|
30046
30074
|
antigravity: "antigravity",
|
|
@@ -30206,11 +30234,12 @@ function readSkillsInstallState(path) {
|
|
|
30206
30234
|
}
|
|
30207
30235
|
function runProcess(command, args, cwd) {
|
|
30208
30236
|
return new Promise((resolve15, reject) => {
|
|
30209
|
-
const
|
|
30237
|
+
const plan = resolveShellSpawn(command, args);
|
|
30238
|
+
const child = spawn2(plan.command, plan.args, {
|
|
30210
30239
|
cwd,
|
|
30211
30240
|
env: process.env,
|
|
30212
30241
|
stdio: ["ignore", "ignore", "pipe"],
|
|
30213
|
-
shell:
|
|
30242
|
+
shell: plan.shell
|
|
30214
30243
|
});
|
|
30215
30244
|
let stderr = "";
|
|
30216
30245
|
child.stderr.on("data", (chunk) => {
|
|
@@ -30752,9 +30781,10 @@ function installedPackageVersion(versionDir) {
|
|
|
30752
30781
|
function runCommand(command, args, env = process.env) {
|
|
30753
30782
|
return new Promise((resolveResult) => {
|
|
30754
30783
|
let output2 = "";
|
|
30755
|
-
const
|
|
30784
|
+
const plan = resolveShellSpawn(command, args);
|
|
30785
|
+
const child = spawn3(plan.command, plan.args, {
|
|
30756
30786
|
stdio: ["inherit", "pipe", "pipe"],
|
|
30757
|
-
shell:
|
|
30787
|
+
shell: plan.shell,
|
|
30758
30788
|
env
|
|
30759
30789
|
});
|
|
30760
30790
|
child.stdout?.on("data", (chunk) => {
|
|
@@ -31305,19 +31335,27 @@ function isHomebrewFormulaCommand(path) {
|
|
|
31305
31335
|
const cellarIndex = parts.lastIndexOf("Cellar");
|
|
31306
31336
|
return cellarIndex >= 0 && parts[cellarIndex + 1] === "deepline" && parts.slice(cellarIndex + 3).includes("libexec");
|
|
31307
31337
|
}
|
|
31308
|
-
function resolvePersistentGlobalCommand(
|
|
31338
|
+
function resolvePersistentGlobalCommand(dependencies = {}) {
|
|
31339
|
+
const platform3 = dependencies.platform ?? process.platform;
|
|
31340
|
+
const run = dependencies.spawn ?? spawnSync;
|
|
31341
|
+
const pathExists = dependencies.exists ?? existsSync13;
|
|
31342
|
+
const pathClis = dependencies.pathClis ?? resolvePathCommands("deepline");
|
|
31309
31343
|
const homebrewCommand = pathClis.find(isHomebrewFormulaCommand);
|
|
31310
31344
|
if (homebrewCommand) return homebrewCommand;
|
|
31311
|
-
const
|
|
31345
|
+
const plan = resolveShellSpawn("npm", ["prefix", "-g"], platform3);
|
|
31346
|
+
const prefix = run(plan.command, plan.args, {
|
|
31347
|
+
encoding: "utf8",
|
|
31348
|
+
shell: plan.shell
|
|
31349
|
+
});
|
|
31312
31350
|
if (prefix.status !== 0) return null;
|
|
31313
31351
|
const root = String(prefix.stdout ?? "").trim();
|
|
31314
31352
|
if (!root) return null;
|
|
31315
|
-
const candidates =
|
|
31316
|
-
return candidates.find((candidate) =>
|
|
31353
|
+
const candidates = platform3 === "win32" ? [join16(root, "deepline.cmd"), join16(root, "deepline")] : [join16(root, "bin", "deepline")];
|
|
31354
|
+
return candidates.find((candidate) => pathExists(candidate)) ?? null;
|
|
31317
31355
|
}
|
|
31318
31356
|
function inspectGlobalCliAvailability(input2) {
|
|
31319
31357
|
const pathClis = input2?.pathClis ?? resolvePathCommands("deepline");
|
|
31320
|
-
const persistentPath = input2 && "persistentGlobalCli" in input2 ? input2.persistentGlobalCli ?? null : resolvePersistentGlobalCommand(pathClis);
|
|
31358
|
+
const persistentPath = input2 && "persistentGlobalCli" in input2 ? input2.persistentGlobalCli ?? null : resolvePersistentGlobalCommand({ pathClis });
|
|
31321
31359
|
const path = persistentPath ? pathClis.find(
|
|
31322
31360
|
(candidate) => pathsResolveToSameFile(candidate, persistentPath)
|
|
31323
31361
|
) ?? null : null;
|
|
@@ -32343,28 +32381,51 @@ async function fetchSkillsUpdate(baseUrl, localVersion) {
|
|
|
32343
32381
|
clearTimeout(timeout);
|
|
32344
32382
|
}
|
|
32345
32383
|
}
|
|
32346
|
-
function buildSkillsInstallArgs(baseUrl, skillNames = DEFAULT_SDK_SKILL_NAMES) {
|
|
32347
|
-
return buildSkillsAddArgs(baseUrl, sortedUniqueSkillNames(skillNames)
|
|
32384
|
+
function buildSkillsInstallArgs(baseUrl, skillNames = DEFAULT_SDK_SKILL_NAMES, agents) {
|
|
32385
|
+
return buildSkillsAddArgs(baseUrl, sortedUniqueSkillNames(skillNames), {
|
|
32386
|
+
agents
|
|
32387
|
+
});
|
|
32348
32388
|
}
|
|
32349
|
-
function buildBunxSkillsInstallArgs(baseUrl, skillNames) {
|
|
32389
|
+
function buildBunxSkillsInstallArgs(baseUrl, skillNames, agents) {
|
|
32350
32390
|
return buildSkillsAddArgs(baseUrl, sortedUniqueSkillNames(skillNames), {
|
|
32351
|
-
firstArg: "--bun"
|
|
32391
|
+
firstArg: "--bun",
|
|
32392
|
+
agents
|
|
32352
32393
|
});
|
|
32353
32394
|
}
|
|
32395
|
+
function resolveAutoSyncSkillAgents() {
|
|
32396
|
+
switch (detectAgentRuntime()) {
|
|
32397
|
+
case "codex":
|
|
32398
|
+
return ["codex"];
|
|
32399
|
+
case "claude_code":
|
|
32400
|
+
return ["claude-code"];
|
|
32401
|
+
case "cursor":
|
|
32402
|
+
return ["cursor"];
|
|
32403
|
+
case "gemini":
|
|
32404
|
+
return ["gemini-cli"];
|
|
32405
|
+
case "antigravity":
|
|
32406
|
+
return ["antigravity"];
|
|
32407
|
+
default:
|
|
32408
|
+
return [];
|
|
32409
|
+
}
|
|
32410
|
+
}
|
|
32354
32411
|
function hasCommand(command) {
|
|
32355
|
-
const
|
|
32412
|
+
const plan = resolveShellSpawn(command, ["--version"]);
|
|
32413
|
+
const result = spawnSync2(plan.command, plan.args, {
|
|
32356
32414
|
stdio: "ignore",
|
|
32357
|
-
shell:
|
|
32415
|
+
shell: plan.shell
|
|
32358
32416
|
});
|
|
32359
32417
|
return result.status === 0;
|
|
32360
32418
|
}
|
|
32361
32419
|
function shellQuote5(arg) {
|
|
32362
32420
|
return `'${arg.replace(/'/g, `'\\''`)}'`;
|
|
32363
32421
|
}
|
|
32364
|
-
function
|
|
32422
|
+
function resolveSkillsInstallSpawn(install, platform3 = process.platform) {
|
|
32423
|
+
return resolveShellSpawn(install.command, install.args, platform3);
|
|
32424
|
+
}
|
|
32425
|
+
function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NAMES, agents = DEFAULT_SKILL_AGENTS) {
|
|
32365
32426
|
const commands = [];
|
|
32366
32427
|
if (hasCommand("bunx")) {
|
|
32367
|
-
const bunxArgs = buildBunxSkillsInstallArgs(baseUrl, skillNames);
|
|
32428
|
+
const bunxArgs = buildBunxSkillsInstallArgs(baseUrl, skillNames, agents);
|
|
32368
32429
|
commands.push({
|
|
32369
32430
|
command: "bunx",
|
|
32370
32431
|
args: bunxArgs,
|
|
@@ -32372,7 +32433,7 @@ function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NA
|
|
|
32372
32433
|
});
|
|
32373
32434
|
}
|
|
32374
32435
|
if (hasCommand("npx")) {
|
|
32375
|
-
const npxArgs = buildSkillsInstallArgs(baseUrl, skillNames);
|
|
32436
|
+
const npxArgs = buildSkillsInstallArgs(baseUrl, skillNames, agents);
|
|
32376
32437
|
commands.push({
|
|
32377
32438
|
command: "npx",
|
|
32378
32439
|
args: npxArgs,
|
|
@@ -32383,9 +32444,11 @@ function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NA
|
|
|
32383
32444
|
}
|
|
32384
32445
|
function runOneSkillsInstall(install) {
|
|
32385
32446
|
return new Promise((resolve15) => {
|
|
32386
|
-
const
|
|
32447
|
+
const plan = resolveSkillsInstallSpawn(install);
|
|
32448
|
+
const child = spawn5(plan.command, plan.args, {
|
|
32387
32449
|
stdio: ["ignore", "ignore", "pipe"],
|
|
32388
|
-
env: process.env
|
|
32450
|
+
env: process.env,
|
|
32451
|
+
shell: plan.shell
|
|
32389
32452
|
});
|
|
32390
32453
|
let stderr = "";
|
|
32391
32454
|
child.stderr.on("data", (chunk) => {
|
|
@@ -32429,7 +32492,7 @@ ${details}` : ""}
|
|
|
32429
32492
|
);
|
|
32430
32493
|
return false;
|
|
32431
32494
|
}
|
|
32432
|
-
function runLegacySkillsCleanup() {
|
|
32495
|
+
function runLegacySkillsCleanup(agents) {
|
|
32433
32496
|
const candidates = hasCommand("bunx") ? [
|
|
32434
32497
|
{
|
|
32435
32498
|
command: "bunx",
|
|
@@ -32438,6 +32501,8 @@ function runLegacySkillsCleanup() {
|
|
|
32438
32501
|
"skills",
|
|
32439
32502
|
"remove",
|
|
32440
32503
|
"--global",
|
|
32504
|
+
"--agent",
|
|
32505
|
+
...agents,
|
|
32441
32506
|
"-y",
|
|
32442
32507
|
...LEGACY_SKILL_NAMES_TO_REMOVE
|
|
32443
32508
|
]
|
|
@@ -32449,6 +32514,8 @@ function runLegacySkillsCleanup() {
|
|
|
32449
32514
|
"skills",
|
|
32450
32515
|
"remove",
|
|
32451
32516
|
"--global",
|
|
32517
|
+
"--agent",
|
|
32518
|
+
...agents,
|
|
32452
32519
|
"-y",
|
|
32453
32520
|
...LEGACY_SKILL_NAMES_TO_REMOVE
|
|
32454
32521
|
]
|
|
@@ -32461,16 +32528,19 @@ function runLegacySkillsCleanup() {
|
|
|
32461
32528
|
"skills",
|
|
32462
32529
|
"remove",
|
|
32463
32530
|
"--global",
|
|
32531
|
+
"--agent",
|
|
32532
|
+
...agents,
|
|
32464
32533
|
"-y",
|
|
32465
32534
|
...LEGACY_SKILL_NAMES_TO_REMOVE
|
|
32466
32535
|
]
|
|
32467
32536
|
}
|
|
32468
32537
|
];
|
|
32469
32538
|
for (const candidate of candidates) {
|
|
32470
|
-
const
|
|
32539
|
+
const plan = resolveShellSpawn(candidate.command, candidate.args);
|
|
32540
|
+
const result = spawnSync2(plan.command, plan.args, {
|
|
32471
32541
|
stdio: "ignore",
|
|
32472
32542
|
env: process.env,
|
|
32473
|
-
shell:
|
|
32543
|
+
shell: plan.shell
|
|
32474
32544
|
});
|
|
32475
32545
|
if (result.status === 0) return;
|
|
32476
32546
|
}
|
|
@@ -32504,7 +32574,12 @@ async function syncSdkSkillsIfNeeded(baseUrl, options = {}) {
|
|
|
32504
32574
|
remoteSkillNames.length > 0 ? remoteSkillNames : DEFAULT_SDK_SKILL_NAMES
|
|
32505
32575
|
);
|
|
32506
32576
|
if (skillNames.length === 0) return;
|
|
32507
|
-
const
|
|
32577
|
+
const agents = resolveAutoSyncSkillAgents();
|
|
32578
|
+
if (agents.length === 0) {
|
|
32579
|
+
writeUnavailableSkillsNotice(baseUrl, update.remoteVersion, skillNames);
|
|
32580
|
+
return;
|
|
32581
|
+
}
|
|
32582
|
+
const installs = resolveSkillsInstallCommands(baseUrl, skillNames, agents);
|
|
32508
32583
|
if (installs.length === 0) {
|
|
32509
32584
|
writeUnavailableSkillsNotice(baseUrl, update.remoteVersion, skillNames);
|
|
32510
32585
|
return;
|
|
@@ -32512,7 +32587,7 @@ async function syncSdkSkillsIfNeeded(baseUrl, options = {}) {
|
|
|
32512
32587
|
writeSdkSkillsStatusLine("Deepline skills changed; syncing agent skills...");
|
|
32513
32588
|
const installed = await runSkillsInstall(installs);
|
|
32514
32589
|
if (!installed) return;
|
|
32515
|
-
runLegacySkillsCleanup();
|
|
32590
|
+
runLegacySkillsCleanup(agents);
|
|
32516
32591
|
writeLocalSkillsVersion(baseUrl, update.remoteVersion);
|
|
32517
32592
|
clearUnavailableSkillsNotice(baseUrl);
|
|
32518
32593
|
writeSdkSkillsStatusLine("Deepline agent skills are up to date.");
|
package/dist/index.js
CHANGED
|
@@ -438,7 +438,7 @@ var SDK_RELEASE = {
|
|
|
438
438
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
439
439
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
440
440
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
441
|
-
version: "0.1.
|
|
441
|
+
version: "0.1.298",
|
|
442
442
|
contracts: {
|
|
443
443
|
api: {
|
|
444
444
|
name: "sdk-http-api",
|
package/dist/index.mjs
CHANGED
|
@@ -367,7 +367,7 @@ var SDK_RELEASE = {
|
|
|
367
367
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
368
368
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
369
369
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
370
|
-
version: "0.1.
|
|
370
|
+
version: "0.1.298",
|
|
371
371
|
contracts: {
|
|
372
372
|
api: {
|
|
373
373
|
name: "sdk-http-api",
|