@jaromil/gestalt 0.18.1 → 0.19.0

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/lib/gestalt.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // GESTALT_CLI_VERSION='0.18.1'
2
+ // GESTALT_CLI_VERSION='0.19.0'
3
3
  // GESTALT_UPDATED_MANAGER_API='1'
4
4
  /*! tuiuiu.js
5
5
  MIT License
@@ -10379,7 +10379,7 @@ var init_yaml = __esm({
10379
10379
 
10380
10380
  // src/cli/skill-profiles/store.ts
10381
10381
  import { randomUUID as randomUUID10 } from "node:crypto";
10382
- import { mkdir as mkdir6, readFile as readFile11, readdir as readdir3, rename as rename7, rm as rm6, writeFile as writeFile4 } from "node:fs/promises";
10382
+ import { mkdir as mkdir7, readFile as readFile11, readdir as readdir3, rename as rename7, rm as rm6, writeFile as writeFile4 } from "node:fs/promises";
10383
10383
  import path28 from "node:path";
10384
10384
  var FileSkillProfiles;
10385
10385
  var init_store = __esm({
@@ -10446,7 +10446,7 @@ var init_store = __esm({
10446
10446
  await storage.replaceFile(file, bytes);
10447
10447
  return;
10448
10448
  }
10449
- await mkdir6(this.root, { recursive: true, mode: 448 });
10449
+ await mkdir7(this.root, { recursive: true, mode: 448 });
10450
10450
  await this.checkRoot();
10451
10451
  const temporary = path28.join(this.root, `.profile-${randomUUID10()}.tmp`);
10452
10452
  await writeFile4(temporary, bytes, { flag: "wx", mode: 384 });
@@ -35830,7 +35830,7 @@ async function runCli(invocation, streams, metadata, handlers = {}) {
35830
35830
  import path19 from "node:path";
35831
35831
 
35832
35832
  // src/cli/setup/agents.ts
35833
- import { readFile as readFile3, realpath as realpath5, rename as rename3, rm, unlink as unlink3 } from "node:fs/promises";
35833
+ import { mkdir as mkdir3, readFile as readFile3, realpath as realpath5, rename as rename3, rm, stat as stat3, unlink as unlink3 } from "node:fs/promises";
35834
35834
  import path10 from "node:path";
35835
35835
  import { pathToFileURL } from "node:url";
35836
35836
 
@@ -36824,7 +36824,7 @@ function managedMcpOverrides(config, baseline, owner) {
36824
36824
  }
36825
36825
 
36826
36826
  // src/cli/setup/configuration.mjs
36827
- function permissionConfiguration(source, homeReadRoots, temporaryRoot = "/tmp") {
36827
+ function permissionConfiguration(source, homeReadRoots, temporaryRoot = "/tmp", cacheRoots = []) {
36828
36828
  parse(source);
36829
36829
  const newline = source.match(/\r\n|\n|\r/)?.[0] ?? "\n";
36830
36830
  const retained = [];
@@ -36860,6 +36860,8 @@ function permissionConfiguration(source, homeReadRoots, temporaryRoot = "/tmp")
36860
36860
  'approval_policy = "never"',
36861
36861
  'default_permissions = "workspace-git"'
36862
36862
  ];
36863
+ const writeRoots = /* @__PURE__ */ new Set([temporaryRoot, ...cacheRoots]);
36864
+ for (const path31 of homeReadRoots) writeRoots.delete(path31);
36863
36865
  const profile = [
36864
36866
  "[permissions.workspace-git]",
36865
36867
  'description = "Workspace and Git writable with local test support"',
@@ -36871,7 +36873,7 @@ function permissionConfiguration(source, homeReadRoots, temporaryRoot = "/tmp")
36871
36873
  "allow_local_binding = true",
36872
36874
  "",
36873
36875
  "[permissions.workspace-git.filesystem]",
36874
- `${JSON.stringify(temporaryRoot)} = "write"`,
36876
+ ...[...writeRoots].map((path31) => `${JSON.stringify(path31)} = "write"`),
36875
36877
  ...homeReadRoots.map((path31) => `${JSON.stringify(path31)} = "read"`),
36876
36878
  "",
36877
36879
  '[permissions.workspace-git.filesystem.":workspace_roots"]',
@@ -37114,12 +37116,26 @@ async function setupAgents(context, _mode, extraSkills) {
37114
37116
  const configFile = path10.join(codexHome, "config.toml");
37115
37117
  const normalize2 = async () => {
37116
37118
  const before = await readProfile(configFile), source = before?.bytes.toString("utf8") ?? "";
37117
- const temporaryRoot = process.platform === "win32" ? path10.join(context.environment.LOCALAPPDATA || path10.join(userHome, "AppData/Local"), "Temp") : "/tmp";
37118
- const output = permissionConfiguration(
37119
- approvalConfiguration(source, manager, codexHome),
37120
- [.../* @__PURE__ */ new Set([codexHome, gestaltHome, path10.join(userHome, ".agents"), path10.join(userHome, ".local"), path10.join(userHome, ".config")])],
37121
- temporaryRoot
37122
- );
37119
+ const { LOCALAPPDATA, XDG_CACHE_HOME, XDG_RUNTIME_DIR } = context.environment;
37120
+ const windows = process.platform === "win32";
37121
+ const localAppData = LOCALAPPDATA || path10.join(userHome, "AppData/Local");
37122
+ const temporaryRoot = windows ? path10.join(localAppData, "Temp") : "/tmp";
37123
+ const cacheHome = windows ? localAppData : XDG_CACHE_HOME && path10.isAbsolute(XDG_CACHE_HOME) ? XDG_CACHE_HOME : path10.join(userHome, process.platform === "darwin" ? "Library/Caches" : ".cache");
37124
+ const legacyCache = path10.join(userHome, ".ccache");
37125
+ const legacy = await stat3(legacyCache).catch((error) => {
37126
+ if (!absent2(error)) throw error;
37127
+ });
37128
+ const cacheDir = legacy?.isDirectory() ? legacyCache : path10.join(cacheHome, "ccache");
37129
+ const cacheRoots = [cacheDir];
37130
+ if (!windows && XDG_RUNTIME_DIR && path10.isAbsolute(XDG_RUNTIME_DIR))
37131
+ cacheRoots.push(path10.join(XDG_RUNTIME_DIR, "ccache-tmp"));
37132
+ const readRoots = [.../* @__PURE__ */ new Set([codexHome, gestaltHome, ...[".agents", ".local", ".config"].map((name2) => path10.join(userHome, name2))])];
37133
+ const output = permissionConfiguration(approvalConfiguration(source, manager, codexHome), readRoots, temporaryRoot, cacheRoots);
37134
+ if (!readRoots.includes(cacheDir)) {
37135
+ await mkdir3(cacheDir, { recursive: true, mode: 448 }).catch((error) => {
37136
+ if (!["EACCES", "EPERM", "EROFS", "ENOTDIR", "EEXIST"].includes(error.code ?? "")) throw error;
37137
+ });
37138
+ }
37123
37139
  await replaceProfile(codexStorage, configFile, Buffer.from(output), before);
37124
37140
  };
37125
37141
  const unlisten = context.listen();
@@ -37363,7 +37379,7 @@ async function installMobile(context, explicit = false) {
37363
37379
  }
37364
37380
 
37365
37381
  // src/cli/setup/manager-update.ts
37366
- import { chmod as chmod2, lstat as lstat7, mkdir as mkdir3, mkdtemp, readFile as readFile5, rename as rename5, rm as rm3, writeFile } from "node:fs/promises";
37382
+ import { chmod as chmod2, lstat as lstat7, mkdir as mkdir4, mkdtemp, readFile as readFile5, rename as rename5, rm as rm3, writeFile } from "node:fs/promises";
37367
37383
  import { tmpdir } from "node:os";
37368
37384
  import path12 from "node:path";
37369
37385
  import { fileURLToPath as fileURLToPath3, pathToFileURL as pathToFileURL2 } from "node:url";
@@ -37383,7 +37399,7 @@ async function updateManager(context, originalArgv, resumed) {
37383
37399
  if (!current) throw new Error(`could not resolve manager executable: ${target}`);
37384
37400
  const lockRoot = path12.join(directory, ".gestalt-manager-update.lock");
37385
37401
  if (process.platform === "win32") await windowsSystem({ operation: "create-directory", path: lockRoot });
37386
- else await mkdir3(lockRoot, { mode: 448 });
37402
+ else await mkdir4(lockRoot, { mode: 448 });
37387
37403
  const storage = await NativePrivateStorage.open(lockRoot, context.paths.unixProbe, context.windowsReadHelper);
37388
37404
  const lockIdentity = await lstat7(lockRoot, { bigint: true });
37389
37405
  const scratch = await mkdtemp(path12.join(tmpdir(), "gestalt-update."));
@@ -37605,7 +37621,7 @@ function retireManagedConfiguration(selectedCodex, selectedHome, manager) {
37605
37621
  }
37606
37622
 
37607
37623
  // src/cli/setup/restart.ts
37608
- import { lstat as lstat8, open as open3, readFile as readFile6, rmdir as rmdir2, stat as stat3, unlink as unlink4 } from "node:fs/promises";
37624
+ import { lstat as lstat8, open as open3, readFile as readFile6, rmdir as rmdir2, stat as stat4, unlink as unlink4 } from "node:fs/promises";
37609
37625
  import path13 from "node:path";
37610
37626
  import { setTimeout as delay } from "node:timers/promises";
37611
37627
  init_context();
@@ -37668,7 +37684,7 @@ async function restartWorker(context, args, update) {
37668
37684
  const record2 = bytes.toString("utf8").slice(0, -1).split("\0");
37669
37685
  const cwd = record2.shift();
37670
37686
  const argv = retiredRestartArguments(record2);
37671
- if (!path13.isAbsolute(cwd) || !(await stat3(cwd)).isDirectory()) throw new Error(`the Gestalt Mobile restart directory is invalid: ${cwd}`);
37687
+ if (!path13.isAbsolute(cwd) || !(await stat4(cwd)).isDirectory()) throw new Error(`the Gestalt Mobile restart directory is invalid: ${cwd}`);
37672
37688
  if (await update(worker, component2, extra === "true")) return 0;
37673
37689
  await relayContext(worker, relay, descriptor);
37674
37690
  if (!(await readFile6(descriptor)).equals(bytes)) throw new Error("the Gestalt Mobile restart descriptor changed during update; relay preserved");
@@ -38374,12 +38390,12 @@ init_skills_owner();
38374
38390
  // src/cli/runtime/skills-transfer.ts
38375
38391
  import path21 from "node:path";
38376
38392
  import { randomUUID as randomUUID8 } from "node:crypto";
38377
- import { cp as cp2, link, lstat as lstat11, mkdir as mkdir5, readFile as readFile9, readdir as readdir2, realpath as realpath9, rename as rename6, rm as rm5, symlink, unlink as unlink5, writeFile as writeFile3 } from "node:fs/promises";
38393
+ import { cp as cp2, link, lstat as lstat11, mkdir as mkdir6, readFile as readFile9, readdir as readdir2, realpath as realpath9, rename as rename6, rm as rm5, symlink, unlink as unlink5, writeFile as writeFile3 } from "node:fs/promises";
38378
38394
 
38379
38395
  // src/cli/platform/archive.ts
38380
38396
  init_windows_system();
38381
38397
  import { constants as constants4 } from "node:fs";
38382
- import { lstat as lstat10, open as open4, readdir, mkdir as mkdir4, realpath as realpath8, writeFile as writeFile2 } from "node:fs/promises";
38398
+ import { lstat as lstat10, open as open4, readdir, mkdir as mkdir5, realpath as realpath8, writeFile as writeFile2 } from "node:fs/promises";
38383
38399
  import path20 from "node:path";
38384
38400
  import { gunzipSync, gzipSync } from "node:zlib";
38385
38401
  var maximumArchive = 64 * 1024 * 1024;
@@ -38503,7 +38519,7 @@ var NativeArchives = class {
38503
38519
  for (const part of relative.split("/").filter(Boolean)) {
38504
38520
  cursor = path20.join(cursor, part);
38505
38521
  try {
38506
- await mkdir4(cursor, { mode: 448 });
38522
+ await mkdir5(cursor, { mode: 448 });
38507
38523
  } catch (error) {
38508
38524
  if (error.code !== "EEXIST") throw error;
38509
38525
  }
@@ -38639,11 +38655,11 @@ async function exportSkills(context, argv) {
38639
38655
  let skillCount = 0, profileCount = 0;
38640
38656
  const temporary = path21.join(parent, `.gestalt-skills-${randomUUID8()}.tar.gz`);
38641
38657
  try {
38642
- await mkdir5(bundle, { mode: 448 });
38658
+ await mkdir6(bundle, { mode: 448 });
38643
38659
  for (let index = 0; index < categories.length; index++) {
38644
38660
  context.check();
38645
38661
  const source = destinations[index], destination = path21.join(bundle, categories[index]);
38646
- await mkdir5(destination, { mode: 448 });
38662
+ await mkdir6(destination, { mode: 448 });
38647
38663
  const info = await optionalStat(source);
38648
38664
  if (!info) continue;
38649
38665
  if (!info.isDirectory() || info.isSymbolicLink()) throw new Error(`skill root must be a directory without links: ${source}`);
@@ -39837,7 +39853,7 @@ function packagedWindowsHelper() {
39837
39853
  async function continueUpdatedManager(invocation, streams, options) {
39838
39854
  if (options.commands?.apiVersion !== 1 || typeof options.commands.launch !== "function" || !options.signal || invocation.argv[0] !== "__updated-manager") throw new Error("invalid managed updated-manager handoff");
39839
39855
  let unknown = false;
39840
- const metadata = { version: "0.18.1", help: "Usage: gestalt <command> [options]\n\nManage Gestalt Agents and Gestalt Mobile in isolated, user-owned directories.\n\nCommands:\n install [--extra-skills] Install or reconcile Agents, optional skills, and Mobile.\n agents install, update Install or reconcile Agents and context-mode only.\n update [COMPONENT] [--extra-skills]\n Update all installed managed components (default).\n update-restart [COMPONENT] [--extra-skills]\n Update from a live Mobile session, then restart Mobile.\n cli [--] [args...] Start Codex with ~/.codex-gestalt as CODEX_HOME.\n mobile [--] [args...] Start the managed Gestalt Mobile executable.\n scratch inspect --cwd ROOT --owner ID\n Inspect an empty Mobile containment fence (read-only).\n scratch recover --cwd ROOT --owner ID --expect TOKEN --confirm-quiescent\n Offline recovery after all owner processes have stopped.\n playwright install [VERSION] Install MCP; add missing system Chrome on Debian amd64.\n playwright update [VERSION] Stage, verify and activate an explicit package update.\n playwright version [--json] Read versioned installation metadata.\n playwright doctor [--json] [--launch] [--executable-path PATH] Check package and Chrome; optionally test a local page.\n playwright mcp --cwd ROOT Managed headless stdio (workspace profile).\n serena install Install private uv, Python 3.13 and tested Serena.\n serena update [VERSION] Validate and activate a release; retain prior tooling.\n serena version, -V Read installed package metadata without creating state.\n serena doctor [--cwd ROOT] Check install, sandbox, MCP tools and optional language readiness.\n serena index --cwd ROOT Explicit native symbol/cache warmup for one project.\n serena mcp --cwd ROOT Confined workspace MCP; always Codex context and editing mode.\n path [NAME|--json] Print managed executable and runtime paths.\n skills install, update Maintain the optional Dyne.org skill collection only.\n skills status [--json] Read installed version, revision and integrity.\n skills-export [ARCHIVE] Export installed skills and skill profiles.\n skills-import ARCHIVE Import a skills archive into this installation.\n doctor [--cwd ROOT] Check prerequisites and installation.\n version Print manager and detected component versions.\n help Show this help.\n\nUpdate components (also accepted as --component COMPONENT):\n all Gestalt core plus installed Serena and Playwright (default).\n gestalt Manager, Agents, Mobile, and context-mode runtime.\n serena Latest stable Serena and its private uv/Python tooling.\n playwright Stable Playwright MCP package; Chrome is externally maintained.\n\nOptional components absent from this installation are skipped by 'all'.\nSelecting serena or playwright explicitly installs or updates that component only.\n--extra-skills applies only to all or gestalt; it adds curated third-party skills.\nNode, npm, Codex, Kimi, and system language servers are externally maintained.\n\nEnvironment:\n CODEX_HOME Isolated Codex home (default: ~/.codex-gestalt).\n GESTALT_HOME Runtime and Mobile root (default: ~/.gestalt).\n GESTALT_INSTALL_BASE_URL Manager update source (default: https://dyne.github.io/gestalt).\n GESTALT_MARKETPLACE Marketplace source (default: dyne/gestalt-agents).\n GESTALT_MARKETPLACE_NAME Codex checkout name (default: dyne-gestalt-agents).\n GESTALT_MOBILE_VERSION npm version or tag (default: latest).\n GESTALT_SKILLS_SOURCE Collection source override (always unverified).\n GESTALT_SKILLS_REF Collection Git ref or immutable revision (default: main).\n" };
39856
+ const metadata = { version: "0.19.0", help: "Usage: gestalt <command> [options]\n\nManage Gestalt Agents and Gestalt Mobile in isolated, user-owned directories.\n\nCommands:\n install [--extra-skills] Install or reconcile Agents, optional skills, and Mobile.\n agents install, update Install or reconcile Agents and context-mode only.\n update [COMPONENT] [--extra-skills]\n Update all installed managed components (default).\n update-restart [COMPONENT] [--extra-skills]\n Update from a live Mobile session, then restart Mobile.\n cli [--] [args...] Start Codex with ~/.codex-gestalt as CODEX_HOME.\n mobile [--] [args...] Start the managed Gestalt Mobile executable.\n Workspace defaults to ~/gestalt; override with --cwd ROOT.\n scratch inspect --cwd ROOT --owner ID\n Inspect an empty Mobile containment fence (read-only).\n scratch recover --cwd ROOT --owner ID --expect TOKEN --confirm-quiescent\n Offline recovery after all owner processes have stopped.\n playwright install [VERSION] Install MCP; add missing system Chrome on Debian amd64.\n playwright update [VERSION] Stage, verify and activate an explicit package update.\n playwright version [--json] Read versioned installation metadata.\n playwright doctor [--json] [--launch] [--executable-path PATH] Check package and Chrome; optionally test a local page.\n playwright mcp --cwd ROOT Managed headless stdio (workspace profile).\n serena install Install private uv, Python 3.13 and tested Serena.\n serena update [VERSION] Validate and activate a release; retain prior tooling.\n serena version, -V Read installed package metadata without creating state.\n serena doctor [--cwd ROOT] Check install, sandbox, MCP tools and optional language readiness.\n serena index --cwd ROOT Explicit native symbol/cache warmup for one project.\n serena mcp --cwd ROOT Confined workspace MCP; always Codex context and editing mode.\n path [NAME|--json] Print managed executable and runtime paths.\n skills install, update Maintain the optional Dyne.org skill collection only.\n skills status [--json] Read installed version, revision and integrity.\n skills-export [ARCHIVE] Export installed skills and skill profiles.\n skills-import ARCHIVE Import a skills archive into this installation.\n doctor [--cwd ROOT] Check prerequisites and installation.\n version Print manager and detected component versions.\n help Show this help.\n\nUpdate components (also accepted as --component COMPONENT):\n all Gestalt core plus installed Serena and Playwright (default).\n gestalt Manager, Agents, Mobile, and context-mode runtime.\n serena Latest stable Serena and its private uv/Python tooling.\n playwright Stable Playwright MCP package; Chrome is externally maintained.\n\nOptional components absent from this installation are skipped by 'all'.\nSelecting serena or playwright explicitly installs or updates that component only.\n--extra-skills applies only to all or gestalt; it adds curated third-party skills.\nNode, npm, Codex, Kimi, and system language servers are externally maintained.\n\nEnvironment:\n CODEX_HOME Isolated Codex home (default: ~/.codex-gestalt).\n GESTALT_HOME Runtime and Mobile root (default: ~/.gestalt).\n GESTALT_INSTALL_BASE_URL Manager update source (default: https://dyne.github.io/gestalt).\n GESTALT_MARKETPLACE Marketplace source (default: dyne/gestalt-agents).\n GESTALT_MARKETPLACE_NAME Codex checkout name (default: dyne-gestalt-agents).\n GESTALT_MOBILE_VERSION npm version or tag (default: latest).\n GESTALT_SKILLS_SOURCE Collection source override (always unverified).\n GESTALT_SKILLS_REF Collection Git ref or immutable revision (default: main).\n" };
39841
39857
  const status = await runCli(
39842
39858
  { argv: [...invocation.argv], cwd: invocation.cwd, environment: { ...invocation.environment } },
39843
39859
  streams,
@@ -39884,7 +39900,7 @@ async function main2() {
39884
39900
  const selected = selectInteractiveRuntime({ legacyManager: fileURLToPath7(new URL("./legacy/gestalt", import.meta.url)) });
39885
39901
  if (selected.kind === "unix-compatibility") selected.exec({ argv, cwd: process.cwd(), environment });
39886
39902
  }
39887
- const metadata = { version: "0.18.1", help: "Usage: gestalt <command> [options]\n\nManage Gestalt Agents and Gestalt Mobile in isolated, user-owned directories.\n\nCommands:\n install [--extra-skills] Install or reconcile Agents, optional skills, and Mobile.\n agents install, update Install or reconcile Agents and context-mode only.\n update [COMPONENT] [--extra-skills]\n Update all installed managed components (default).\n update-restart [COMPONENT] [--extra-skills]\n Update from a live Mobile session, then restart Mobile.\n cli [--] [args...] Start Codex with ~/.codex-gestalt as CODEX_HOME.\n mobile [--] [args...] Start the managed Gestalt Mobile executable.\n scratch inspect --cwd ROOT --owner ID\n Inspect an empty Mobile containment fence (read-only).\n scratch recover --cwd ROOT --owner ID --expect TOKEN --confirm-quiescent\n Offline recovery after all owner processes have stopped.\n playwright install [VERSION] Install MCP; add missing system Chrome on Debian amd64.\n playwright update [VERSION] Stage, verify and activate an explicit package update.\n playwright version [--json] Read versioned installation metadata.\n playwright doctor [--json] [--launch] [--executable-path PATH] Check package and Chrome; optionally test a local page.\n playwright mcp --cwd ROOT Managed headless stdio (workspace profile).\n serena install Install private uv, Python 3.13 and tested Serena.\n serena update [VERSION] Validate and activate a release; retain prior tooling.\n serena version, -V Read installed package metadata without creating state.\n serena doctor [--cwd ROOT] Check install, sandbox, MCP tools and optional language readiness.\n serena index --cwd ROOT Explicit native symbol/cache warmup for one project.\n serena mcp --cwd ROOT Confined workspace MCP; always Codex context and editing mode.\n path [NAME|--json] Print managed executable and runtime paths.\n skills install, update Maintain the optional Dyne.org skill collection only.\n skills status [--json] Read installed version, revision and integrity.\n skills-export [ARCHIVE] Export installed skills and skill profiles.\n skills-import ARCHIVE Import a skills archive into this installation.\n doctor [--cwd ROOT] Check prerequisites and installation.\n version Print manager and detected component versions.\n help Show this help.\n\nUpdate components (also accepted as --component COMPONENT):\n all Gestalt core plus installed Serena and Playwright (default).\n gestalt Manager, Agents, Mobile, and context-mode runtime.\n serena Latest stable Serena and its private uv/Python tooling.\n playwright Stable Playwright MCP package; Chrome is externally maintained.\n\nOptional components absent from this installation are skipped by 'all'.\nSelecting serena or playwright explicitly installs or updates that component only.\n--extra-skills applies only to all or gestalt; it adds curated third-party skills.\nNode, npm, Codex, Kimi, and system language servers are externally maintained.\n\nEnvironment:\n CODEX_HOME Isolated Codex home (default: ~/.codex-gestalt).\n GESTALT_HOME Runtime and Mobile root (default: ~/.gestalt).\n GESTALT_INSTALL_BASE_URL Manager update source (default: https://dyne.github.io/gestalt).\n GESTALT_MARKETPLACE Marketplace source (default: dyne/gestalt-agents).\n GESTALT_MARKETPLACE_NAME Codex checkout name (default: dyne-gestalt-agents).\n GESTALT_MOBILE_VERSION npm version or tag (default: latest).\n GESTALT_SKILLS_SOURCE Collection source override (always unverified).\n GESTALT_SKILLS_REF Collection Git ref or immutable revision (default: main).\n" };
39903
+ const metadata = { version: "0.19.0", help: "Usage: gestalt <command> [options]\n\nManage Gestalt Agents and Gestalt Mobile in isolated, user-owned directories.\n\nCommands:\n install [--extra-skills] Install or reconcile Agents, optional skills, and Mobile.\n agents install, update Install or reconcile Agents and context-mode only.\n update [COMPONENT] [--extra-skills]\n Update all installed managed components (default).\n update-restart [COMPONENT] [--extra-skills]\n Update from a live Mobile session, then restart Mobile.\n cli [--] [args...] Start Codex with ~/.codex-gestalt as CODEX_HOME.\n mobile [--] [args...] Start the managed Gestalt Mobile executable.\n Workspace defaults to ~/gestalt; override with --cwd ROOT.\n scratch inspect --cwd ROOT --owner ID\n Inspect an empty Mobile containment fence (read-only).\n scratch recover --cwd ROOT --owner ID --expect TOKEN --confirm-quiescent\n Offline recovery after all owner processes have stopped.\n playwright install [VERSION] Install MCP; add missing system Chrome on Debian amd64.\n playwright update [VERSION] Stage, verify and activate an explicit package update.\n playwright version [--json] Read versioned installation metadata.\n playwright doctor [--json] [--launch] [--executable-path PATH] Check package and Chrome; optionally test a local page.\n playwright mcp --cwd ROOT Managed headless stdio (workspace profile).\n serena install Install private uv, Python 3.13 and tested Serena.\n serena update [VERSION] Validate and activate a release; retain prior tooling.\n serena version, -V Read installed package metadata without creating state.\n serena doctor [--cwd ROOT] Check install, sandbox, MCP tools and optional language readiness.\n serena index --cwd ROOT Explicit native symbol/cache warmup for one project.\n serena mcp --cwd ROOT Confined workspace MCP; always Codex context and editing mode.\n path [NAME|--json] Print managed executable and runtime paths.\n skills install, update Maintain the optional Dyne.org skill collection only.\n skills status [--json] Read installed version, revision and integrity.\n skills-export [ARCHIVE] Export installed skills and skill profiles.\n skills-import ARCHIVE Import a skills archive into this installation.\n doctor [--cwd ROOT] Check prerequisites and installation.\n version Print manager and detected component versions.\n help Show this help.\n\nUpdate components (also accepted as --component COMPONENT):\n all Gestalt core plus installed Serena and Playwright (default).\n gestalt Manager, Agents, Mobile, and context-mode runtime.\n serena Latest stable Serena and its private uv/Python tooling.\n playwright Stable Playwright MCP package; Chrome is externally maintained.\n\nOptional components absent from this installation are skipped by 'all'.\nSelecting serena or playwright explicitly installs or updates that component only.\n--extra-skills applies only to all or gestalt; it adds curated third-party skills.\nNode, npm, Codex, Kimi, and system language servers are externally maintained.\n\nEnvironment:\n CODEX_HOME Isolated Codex home (default: ~/.codex-gestalt).\n GESTALT_HOME Runtime and Mobile root (default: ~/.gestalt).\n GESTALT_INSTALL_BASE_URL Manager update source (default: https://dyne.github.io/gestalt).\n GESTALT_MARKETPLACE Marketplace source (default: dyne/gestalt-agents).\n GESTALT_MARKETPLACE_NAME Codex checkout name (default: dyne-gestalt-agents).\n GESTALT_MOBILE_VERSION npm version or tag (default: latest).\n GESTALT_SKILLS_SOURCE Collection source override (always unverified).\n GESTALT_SKILLS_REF Collection Git ref or immutable revision (default: main).\n" };
39888
39904
  const ownershipHelper = packagedWindowsHelper();
39889
39905
  return runCli(
39890
39906
  { argv, cwd: process.cwd(), environment },
@@ -3,7 +3,7 @@
3
3
  set -Eeuo pipefail
4
4
  IFS=$'\n\t'
5
5
 
6
- readonly GESTALT_CLI_VERSION='0.18.1'
6
+ readonly GESTALT_CLI_VERSION='0.19.0'
7
7
  readonly DEFAULT_INSTALL_BASE_URL='https://dyne.github.io/gestalt'
8
8
  readonly DEFAULT_MARKETPLACE='dyne/gestalt-agents'
9
9
  readonly DEFAULT_MARKETPLACE_NAME='dyne-gestalt-agents'
@@ -836,6 +836,7 @@ Commands:
836
836
  Update from a live Mobile session, then restart Mobile.
837
837
  cli [--] [args...] Start Codex with ~/.codex-gestalt as CODEX_HOME.
838
838
  mobile [--] [args...] Start the managed Gestalt Mobile executable.
839
+ Workspace defaults to ~/gestalt; override with --cwd ROOT.
839
840
  scratch inspect --cwd ROOT --owner ID
840
841
  Inspect an empty Mobile containment fence (read-only).
841
842
  scratch recover --cwd ROOT --owner ID --expect TOKEN --confirm-quiescent
@@ -3339,14 +3340,24 @@ configure_codex_permissions() {
3339
3340
 
3340
3341
  node --input-type=module - \
3341
3342
  "$config_path" "${BASH_SOURCE[0]}" "$codex_home" "$gestalt_home" "$HOME/.agents" \
3342
- "$HOME/.local" "$HOME/.config" <<'NODE'
3343
+ "$HOME/.local" "$HOME/.config" "$HOME" <<'NODE'
3343
3344
  import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from 'node:fs';
3344
- import { dirname } from 'node:path';
3345
+ import { dirname, isAbsolute, join } from 'node:path';
3345
3346
  import { runInNewContext } from 'node:vm';
3346
3347
 
3347
3348
  const configPath = process.argv[2];
3348
3349
  const managerPath = process.argv[3];
3349
- const homeReadRoots = [...new Set(process.argv.slice(4))];
3350
+ const homeReadRoots = [...new Set(process.argv.slice(4, -1))];
3351
+ const userHome = process.argv.at(-1);
3352
+ const { XDG_CACHE_HOME, XDG_RUNTIME_DIR } = process.env;
3353
+ const legacyCache = join(userHome, '.ccache');
3354
+ const cacheHome = isAbsolute(XDG_CACHE_HOME || '') ? XDG_CACHE_HOME
3355
+ : join(userHome, process.platform === 'darwin' ? 'Library/Caches' : '.cache');
3356
+ const cacheDir = statSync(legacyCache, { throwIfNoEntry: false })?.isDirectory()
3357
+ ? legacyCache : join(cacheHome, 'ccache');
3358
+ const writeRoots = new Set(['/tmp', cacheDir]);
3359
+ if (isAbsolute(XDG_RUNTIME_DIR || '')) writeRoots.add(join(XDG_RUNTIME_DIR, 'ccache-tmp'));
3360
+ for (const root of homeReadRoots) writeRoots.delete(root);
3350
3361
  const bundle = readFileSync(managerPath, 'utf8').match(/^\/\/ BEGIN BUNDLED PROFILE TOML PARSER\n([\s\S]*?)^\/\/ END BUNDLED PROFILE TOML PARSER/m);
3351
3362
  if (!bundle) throw new Error('Bundled TOML parser missing');
3352
3363
  const { parse } = runInNewContext(bundle[1] + '\ngestaltProfileToml');
@@ -3396,7 +3407,7 @@ const profile = [
3396
3407
  'allow_local_binding = true',
3397
3408
  '',
3398
3409
  '[permissions.workspace-git.filesystem]',
3399
- '"/tmp" = "write"',
3410
+ ...[...writeRoots].map((path) => `${JSON.stringify(path)} = "write"`),
3400
3411
  ...homeReadRoots.map((path) => `${JSON.stringify(path)} = "read"`),
3401
3412
  '',
3402
3413
  '[permissions.workspace-git.filesystem.":workspace_roots"]',
@@ -3414,6 +3425,13 @@ if (before && !/[\r\n]$/.test(before)) before += newline;
3414
3425
  const output = root.join(newline) + newline + before +
3415
3426
  profile.filter(line => line !== '').join(newline) + newline + retained.slice(position).join('');
3416
3427
  parse(output);
3428
+ if (writeRoots.has(cacheDir)) {
3429
+ // Codex needs an existing mount target for writes beneath a read-only home.
3430
+ try { mkdirSync(cacheDir, { recursive: true, mode: 0o700 }); }
3431
+ catch (error) {
3432
+ if (!['EACCES', 'EPERM', 'EROFS', 'ENOTDIR', 'EEXIST'].includes(error.code)) throw error;
3433
+ }
3434
+ }
3417
3435
  if (output === source) process.exit(0);
3418
3436
 
3419
3437
  mkdirSync(dirname(configPath), { recursive: true });
@@ -4087,6 +4105,10 @@ command_update_restart_worker() {
4087
4105
  restart_args=(${migrated_restart_args[@]+"${migrated_restart_args[@]}"})
4088
4106
  [[ $restart_cwd == /* && -d $restart_cwd ]] ||
4089
4107
  die "the Gestalt Mobile restart directory is invalid: $restart_cwd"
4108
+ # Older descriptors without --cwd used the recorded working directory.
4109
+ if mobile_workspace_is_implicit ${restart_args[@]+"${restart_args[@]}"}; then
4110
+ restart_args+=(--cwd "$restart_cwd")
4111
+ fi
4090
4112
  [[ $worker_extra_skills == false || $worker_extra_skills == true ]] ||
4091
4113
  die 'the update-restart worker received an invalid setup mode'
4092
4114
  if [[ $worker_extra_skills == true ]]; then
@@ -5335,6 +5357,18 @@ process.on('SIGTERM',()=>stop(143));process.on('SIGINT',()=>stop(130));
5335
5357
  NODE
5336
5358
  }
5337
5359
 
5360
+ mobile_workspace_is_implicit() {
5361
+ [[ ${1:-} != trace ]] || return 1
5362
+ while (($#)); do
5363
+ case $1 in
5364
+ --cwd | --cwd=* | --help | --version | --) return 1 ;;
5365
+ --skills) [[ ${2:-} != list ]] || return 1 ;;
5366
+ esac
5367
+ shift
5368
+ done
5369
+ return 0
5370
+ }
5371
+
5338
5372
  command_mobile() {
5339
5373
  local mobile_restart_dir mobile_restart_state mobile_restart_staged restart_cwd
5340
5374
  local context_mode_runtime context_mode_plugin_root gestalt_plugin_root
@@ -5349,6 +5383,12 @@ command_mobile() {
5349
5383
  --xerj | --xerj=*) die 'Xerj has been retired; omit --xerj when starting Mobile. Run gestalt update before restarting older generated launchers.' ;;
5350
5384
  esac
5351
5385
  done
5386
+ if mobile_workspace_is_implicit ${forwarded_args[@]+"${forwarded_args[@]}"}; then
5387
+ local -r mobile_workspace=$HOME/gestalt
5388
+ (umask 077; mkdir -p -- "$mobile_workspace") ||
5389
+ die "could not create the default Mobile workspace: $mobile_workspace"
5390
+ forwarded_args+=(--cwd "$mobile_workspace")
5391
+ fi
5352
5392
  if [[ ! -x $mobile_bin ]]; then
5353
5393
  log 'Gestalt Mobile is not installed; installing it now'
5354
5394
  install_mobile
@@ -2,7 +2,7 @@
2
2
  "source": "src/cli/platform/native/owned-process.c",
3
3
  "license": "MIT (full license in source)",
4
4
  "sourceSha256": "8b8499245e4213e3e842497f815d4b0d19685bcd806b461fdacb66119500ad58",
5
- "artifactSha256": "e7bf178c8c19d7e6ef9e7005b28339e1e2041fee7188a4126730df04f6431947",
5
+ "artifactSha256": "a8b197f02986127e59b11ab4c655d24cdd37b1e7b56845d27487f27939d38488",
6
6
  "platform": "win32",
7
7
  "architecture": "x64",
8
8
  "node": "v24.22.3",
@@ -23,7 +23,7 @@
23
23
  "advapi32.lib",
24
24
  "netapi32.lib"
25
25
  ],
26
- "observedAt": "2026-11-23T07:18:44.884Z",
26
+ "observedAt": "2026-11-24T00:57:33.383Z",
27
27
  "sourceInputs": [
28
28
  {
29
29
  "path": "src/cli/platform/native/owned-process.c",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jaromil/gestalt",
3
3
  "type": "module",
4
- "version": "0.18.1",
4
+ "version": "0.19.0",
5
5
  "description": "Manage Gestalt's isolated Codex profile, agent skills and Mobile installation",
6
6
  "license": "AGPL-3.0-or-later",
7
7
  "author": "Dyne.org foundation",
@@ -44,5 +44,5 @@
44
44
  "access": "public",
45
45
  "registry": "https://registry.npmjs.org/"
46
46
  },
47
- "gitHead": "42e48ca2fa173ac06cccdbd3d9b35efdd8fb3ea6"
47
+ "gitHead": "5509e32f208c786fd264860e14f3818370b98419"
48
48
  }