flyspace-cli 0.1.7 → 0.1.9
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/{chunk-BZYTXXF7.js → chunk-JG6LNX5D.js} +21 -17
- package/dist/cli.js +806 -184
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -348,7 +348,6 @@ function rowToChannel(row) {
|
|
|
348
348
|
var registry = [];
|
|
349
349
|
var byId = /* @__PURE__ */ new Map();
|
|
350
350
|
var byExternalId = /* @__PURE__ */ new Map();
|
|
351
|
-
var byAgentName = /* @__PURE__ */ new Map();
|
|
352
351
|
var changeListeners2 = /* @__PURE__ */ new Set();
|
|
353
352
|
var lastSnapshot2;
|
|
354
353
|
function indexRegistry(list) {
|
|
@@ -357,9 +356,6 @@ function indexRegistry(list) {
|
|
|
357
356
|
byExternalId = new Map(
|
|
358
357
|
list.filter((c) => !!c.externalChannelId).map((c) => [c.externalChannelId, c])
|
|
359
358
|
);
|
|
360
|
-
byAgentName = new Map(
|
|
361
|
-
list.filter((c) => !!c.agentName).map((c) => [c.agentName, c])
|
|
362
|
-
);
|
|
363
359
|
}
|
|
364
360
|
async function refreshChannelRegistry() {
|
|
365
361
|
const { data, error } = await getSupabaseClient().from("channels").select("*").order("position", { ascending: true });
|
|
@@ -401,7 +397,7 @@ function findChannelByExternalId(externalId) {
|
|
|
401
397
|
return byExternalId.get(externalId);
|
|
402
398
|
}
|
|
403
399
|
function findChannelByAgentName(agentName) {
|
|
404
|
-
return
|
|
400
|
+
return getProfileChannelRegistry().find((c) => c.agentName === agentName);
|
|
405
401
|
}
|
|
406
402
|
function findChannel(ref) {
|
|
407
403
|
if (!ref) return void 0;
|
|
@@ -762,7 +758,8 @@ function loadEffectiveAutomations() {
|
|
|
762
758
|
// src/claude/agent.ts
|
|
763
759
|
import { spawn } from "child_process";
|
|
764
760
|
import { existsSync as existsSync8, readFileSync as readFileSync3, statSync as statSync3 } from "fs";
|
|
765
|
-
import { resolve as resolve4 } from "path";
|
|
761
|
+
import { resolve as resolve4, resolve as resolvePath } from "path";
|
|
762
|
+
import { homedir as homedir3 } from "os";
|
|
766
763
|
import { randomUUID } from "crypto";
|
|
767
764
|
|
|
768
765
|
// src/claude/container.ts
|
|
@@ -1743,6 +1740,7 @@ function buildArgs(prompt, botName, options, resumeSessionId, isolatedStyle) {
|
|
|
1743
1740
|
// cannot see that file, so a custom style's body is injected here instead.
|
|
1744
1741
|
isolatedStyle?.builtIn ? void 0 : isolatedStyle?.body
|
|
1745
1742
|
),
|
|
1743
|
+
options.memoryPrompt,
|
|
1746
1744
|
docsAccessPromptNote(options.docsAccess)
|
|
1747
1745
|
].filter(Boolean).join("\n\n---\n\n"),
|
|
1748
1746
|
// A container or sandbox run inherits no user settings: CLAUDE_CONFIG_DIR
|
|
@@ -1786,6 +1784,10 @@ function recordUsage2(response, options) {
|
|
|
1786
1784
|
isError: response.isError === true
|
|
1787
1785
|
});
|
|
1788
1786
|
}
|
|
1787
|
+
function pinnedClaudeConfigDir(dir) {
|
|
1788
|
+
if (!dir) return void 0;
|
|
1789
|
+
return resolvePath(dir.replace(/^~(?=\/|$)/, homedir3())) === resolvePath(homedir3(), ".claude") ? void 0 : dir;
|
|
1790
|
+
}
|
|
1789
1791
|
function runCli(prompt, cwd, botName, options, claudeConfigDir, resumeSessionId, claudeCodeOauthToken) {
|
|
1790
1792
|
return new Promise((resolve7, reject) => {
|
|
1791
1793
|
const isolated = options.runtime === "container" || options.runtime === "sandbox";
|
|
@@ -1799,9 +1801,9 @@ function runCli(prompt, cwd, botName, options, claudeConfigDir, resumeSessionId,
|
|
|
1799
1801
|
const env = resolveMiseEnv(cwd);
|
|
1800
1802
|
env["FLYSPACE_SCRATCH_DIR"] = paths.SCRATCH_DIR;
|
|
1801
1803
|
env["CLAUDE_CODE_ARTIFACT"] = "1";
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1804
|
+
const pinnedDir = pinnedClaudeConfigDir(claudeConfigDir);
|
|
1805
|
+
if (pinnedDir) env["CLAUDE_CONFIG_DIR"] = pinnedDir;
|
|
1806
|
+
else delete env["CLAUDE_CONFIG_DIR"];
|
|
1805
1807
|
if (claudeCodeOauthToken) {
|
|
1806
1808
|
env["CLAUDE_CODE_OAUTH_TOKEN"] = claudeCodeOauthToken;
|
|
1807
1809
|
} else {
|
|
@@ -5087,7 +5089,7 @@ async function summariseThreadTranscript(transcript, opts, deps = {}) {
|
|
|
5087
5089
|
|
|
5088
5090
|
// src/claude/skills.ts
|
|
5089
5091
|
import { existsSync as existsSync13, readdirSync as readdirSync3, readFileSync as readFileSync8, statSync as statSync6 } from "fs";
|
|
5090
|
-
import { homedir as
|
|
5092
|
+
import { homedir as homedir5 } from "os";
|
|
5091
5093
|
import { basename as basename2, dirname as dirname2, join as join9 } from "path";
|
|
5092
5094
|
import yaml3 from "js-yaml";
|
|
5093
5095
|
|
|
@@ -5101,18 +5103,18 @@ import {
|
|
|
5101
5103
|
statSync as statSync5,
|
|
5102
5104
|
writeFileSync as writeFileSync4
|
|
5103
5105
|
} from "fs";
|
|
5104
|
-
import { homedir as
|
|
5106
|
+
import { homedir as homedir4 } from "os";
|
|
5105
5107
|
import { join as join8, resolve as resolve6, sep as sep3 } from "path";
|
|
5106
5108
|
import yaml2 from "js-yaml";
|
|
5107
5109
|
var MAX_SKILL_BYTES = 2 * 1024 * 1024;
|
|
5108
5110
|
var SKILL_NAME = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/;
|
|
5109
5111
|
function expandHome(p) {
|
|
5110
|
-
if (p === "~") return
|
|
5111
|
-
if (p.startsWith("~/")) return join8(
|
|
5112
|
+
if (p === "~") return homedir4();
|
|
5113
|
+
if (p.startsWith("~/")) return join8(homedir4(), p.slice(2));
|
|
5112
5114
|
return p;
|
|
5113
5115
|
}
|
|
5114
5116
|
function workspaceSkillsDir(configDir) {
|
|
5115
|
-
return join8(configDir ? expandHome(configDir) : join8(
|
|
5117
|
+
return join8(configDir ? expandHome(configDir) : join8(homedir4(), ".claude"), "skills");
|
|
5116
5118
|
}
|
|
5117
5119
|
function channelSkillsDir(cwd) {
|
|
5118
5120
|
return join8(cwd, ".claude", "skills");
|
|
@@ -5255,11 +5257,11 @@ function deleteSkillFile(dir, name) {
|
|
|
5255
5257
|
|
|
5256
5258
|
// src/claude/skills.ts
|
|
5257
5259
|
function defaultConfigDir() {
|
|
5258
|
-
return join9(
|
|
5260
|
+
return join9(homedir5(), ".claude");
|
|
5259
5261
|
}
|
|
5260
5262
|
function expandHome2(p) {
|
|
5261
|
-
if (p === "~") return
|
|
5262
|
-
if (p.startsWith("~/")) return join9(
|
|
5263
|
+
if (p === "~") return homedir5();
|
|
5264
|
+
if (p.startsWith("~/")) return join9(homedir5(), p.slice(2));
|
|
5263
5265
|
return p;
|
|
5264
5266
|
}
|
|
5265
5267
|
function parseFrontmatter(file) {
|
|
@@ -8324,6 +8326,7 @@ export {
|
|
|
8324
8326
|
getChannelRegistry,
|
|
8325
8327
|
getProfileChannelRegistry,
|
|
8326
8328
|
findChannelById,
|
|
8329
|
+
findChannelByAgentName,
|
|
8327
8330
|
findChannel,
|
|
8328
8331
|
startChannelRegistryPolling,
|
|
8329
8332
|
isCwdUsable,
|
|
@@ -8360,6 +8363,7 @@ export {
|
|
|
8360
8363
|
usageLimitedModels,
|
|
8361
8364
|
buildSystemPrompt,
|
|
8362
8365
|
docsAccessPromptNote,
|
|
8366
|
+
pinnedClaudeConfigDir,
|
|
8363
8367
|
askClaude,
|
|
8364
8368
|
getWorkspaceBySlug,
|
|
8365
8369
|
getWorkspaceById,
|