flyspace-cli 0.1.7 → 0.1.10

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.
@@ -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 byAgentName.get(agentName);
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
@@ -846,6 +843,8 @@ var CONTAINER_ENV_ALLOWLIST = [
846
843
  // Re-enables the Artifact tool, which the CLI's own backstop switches off for
847
844
  // SDK entrypoints. Set per-run in `runCli()`; carries no secret.
848
845
  "CLAUDE_CODE_ARTIFACT",
846
+ // Set per-run when the `agent-memory` Labs flag turns the CLI's own memory off.
847
+ "CLAUDE_CODE_DISABLE_AUTO_MEMORY",
849
848
  // Locale and proxy settings, which change behaviour but carry no secrets.
850
849
  "LANG",
851
850
  "LC_ALL",
@@ -1743,6 +1742,7 @@ function buildArgs(prompt, botName, options, resumeSessionId, isolatedStyle) {
1743
1742
  // cannot see that file, so a custom style's body is injected here instead.
1744
1743
  isolatedStyle?.builtIn ? void 0 : isolatedStyle?.body
1745
1744
  ),
1745
+ options.memoryPrompt,
1746
1746
  docsAccessPromptNote(options.docsAccess)
1747
1747
  ].filter(Boolean).join("\n\n---\n\n"),
1748
1748
  // A container or sandbox run inherits no user settings: CLAUDE_CONFIG_DIR
@@ -1786,6 +1786,10 @@ function recordUsage2(response, options) {
1786
1786
  isError: response.isError === true
1787
1787
  });
1788
1788
  }
1789
+ function pinnedClaudeConfigDir(dir) {
1790
+ if (!dir) return void 0;
1791
+ return resolvePath(dir.replace(/^~(?=\/|$)/, homedir3())) === resolvePath(homedir3(), ".claude") ? void 0 : dir;
1792
+ }
1789
1793
  function runCli(prompt, cwd, botName, options, claudeConfigDir, resumeSessionId, claudeCodeOauthToken) {
1790
1794
  return new Promise((resolve7, reject) => {
1791
1795
  const isolated = options.runtime === "container" || options.runtime === "sandbox";
@@ -1799,9 +1803,11 @@ function runCli(prompt, cwd, botName, options, claudeConfigDir, resumeSessionId,
1799
1803
  const env = resolveMiseEnv(cwd);
1800
1804
  env["FLYSPACE_SCRATCH_DIR"] = paths.SCRATCH_DIR;
1801
1805
  env["CLAUDE_CODE_ARTIFACT"] = "1";
1802
- if (claudeConfigDir) {
1803
- env["CLAUDE_CONFIG_DIR"] = claudeConfigDir;
1804
- }
1806
+ if (options.disableAutoMemory) env["CLAUDE_CODE_DISABLE_AUTO_MEMORY"] = "1";
1807
+ else delete env["CLAUDE_CODE_DISABLE_AUTO_MEMORY"];
1808
+ const pinnedDir = pinnedClaudeConfigDir(claudeConfigDir);
1809
+ if (pinnedDir) env["CLAUDE_CONFIG_DIR"] = pinnedDir;
1810
+ else delete env["CLAUDE_CONFIG_DIR"];
1805
1811
  if (claudeCodeOauthToken) {
1806
1812
  env["CLAUDE_CODE_OAUTH_TOKEN"] = claudeCodeOauthToken;
1807
1813
  } else {
@@ -5087,7 +5093,7 @@ async function summariseThreadTranscript(transcript, opts, deps = {}) {
5087
5093
 
5088
5094
  // src/claude/skills.ts
5089
5095
  import { existsSync as existsSync13, readdirSync as readdirSync3, readFileSync as readFileSync8, statSync as statSync6 } from "fs";
5090
- import { homedir as homedir4 } from "os";
5096
+ import { homedir as homedir5 } from "os";
5091
5097
  import { basename as basename2, dirname as dirname2, join as join9 } from "path";
5092
5098
  import yaml3 from "js-yaml";
5093
5099
 
@@ -5101,18 +5107,18 @@ import {
5101
5107
  statSync as statSync5,
5102
5108
  writeFileSync as writeFileSync4
5103
5109
  } from "fs";
5104
- import { homedir as homedir3 } from "os";
5110
+ import { homedir as homedir4 } from "os";
5105
5111
  import { join as join8, resolve as resolve6, sep as sep3 } from "path";
5106
5112
  import yaml2 from "js-yaml";
5107
5113
  var MAX_SKILL_BYTES = 2 * 1024 * 1024;
5108
5114
  var SKILL_NAME = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/;
5109
5115
  function expandHome(p) {
5110
- if (p === "~") return homedir3();
5111
- if (p.startsWith("~/")) return join8(homedir3(), p.slice(2));
5116
+ if (p === "~") return homedir4();
5117
+ if (p.startsWith("~/")) return join8(homedir4(), p.slice(2));
5112
5118
  return p;
5113
5119
  }
5114
5120
  function workspaceSkillsDir(configDir) {
5115
- return join8(configDir ? expandHome(configDir) : join8(homedir3(), ".claude"), "skills");
5121
+ return join8(configDir ? expandHome(configDir) : join8(homedir4(), ".claude"), "skills");
5116
5122
  }
5117
5123
  function channelSkillsDir(cwd) {
5118
5124
  return join8(cwd, ".claude", "skills");
@@ -5255,11 +5261,11 @@ function deleteSkillFile(dir, name) {
5255
5261
 
5256
5262
  // src/claude/skills.ts
5257
5263
  function defaultConfigDir() {
5258
- return join9(homedir4(), ".claude");
5264
+ return join9(homedir5(), ".claude");
5259
5265
  }
5260
5266
  function expandHome2(p) {
5261
- if (p === "~") return homedir4();
5262
- if (p.startsWith("~/")) return join9(homedir4(), p.slice(2));
5267
+ if (p === "~") return homedir5();
5268
+ if (p.startsWith("~/")) return join9(homedir5(), p.slice(2));
5263
5269
  return p;
5264
5270
  }
5265
5271
  function parseFrontmatter(file) {
@@ -8324,6 +8330,7 @@ export {
8324
8330
  getChannelRegistry,
8325
8331
  getProfileChannelRegistry,
8326
8332
  findChannelById,
8333
+ findChannelByAgentName,
8327
8334
  findChannel,
8328
8335
  startChannelRegistryPolling,
8329
8336
  isCwdUsable,
@@ -8360,6 +8367,7 @@ export {
8360
8367
  usageLimitedModels,
8361
8368
  buildSystemPrompt,
8362
8369
  docsAccessPromptNote,
8370
+ pinnedClaudeConfigDir,
8363
8371
  askClaude,
8364
8372
  getWorkspaceBySlug,
8365
8373
  getWorkspaceById,