gipity 1.1.35 → 1.1.36

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.
@@ -50,7 +50,7 @@ export const deployCommand = new Command('deploy')
50
50
  .option('--yes-destructive', 'Allow pending prod migrations that destroy data (DROP TABLE/COLUMN, TRUNCATE, DELETE without WHERE, column type changes)')
51
51
  .option('--plan', 'Show the pending migrations this deploy would run (and where each already ran), without deploying')
52
52
  .option('--source-dir <dir>', 'Source directory to deploy from')
53
- .option('--only <phases>', 'Run only specific phases, comma-separated, matched by gipity.yaml phase name or type: files/static, database/sql, functions, workflows, services, jobs, records, realtime, env, auth_branding')
53
+ .option('--only <phases>', 'Run only specific phases, comma-separated, matched by gipity.yaml phase name or type: files/static, database/sql, functions, workflows, services, jobs, records, realtime, env, auth_branding, auth')
54
54
  .option('--force', 'Re-run all phases (ignore checksums) and bypass the sync bulk-deletion guard')
55
55
  .option('--no-sync', 'Skip sync-up before deploy')
56
56
  .option('--optimize', 'Bundle and minify the JS/CSS with Vite (off by default: files upload as-is, so prod serves what you verified). Only bundles <script type="module"> references, and page eval import() of an app module then loads a separate copy')
@@ -1,6 +1,7 @@
1
- import { readFileSync } from 'fs';
1
+ import { readFileSync, writeFileSync, existsSync } from 'fs';
2
+ import { join } from 'path';
2
3
  import { get, put, del } from '../api.js';
3
- import { requireConfig } from '../config.js';
4
+ import { requireConfig, getProjectRoot } from '../config.js';
4
5
  import { error as clrError, muted, success, warning, bold } from '../colors.js';
5
6
  import { run, printResult } from '../helpers/index.js';
6
7
  const AUTH_MODES = ['gipity', 'app', 'both'];
@@ -135,8 +136,14 @@ See: gipity skill read steam-game`)
135
136
  }
136
137
  const res = await put(`/projects/${config.projectGuid}`, body);
137
138
  const lines = [];
138
- if (body.auth_mode)
139
+ if (body.auth_mode) {
139
140
  lines.push(success(`Sign-in set to "${body.auth_mode}".`));
141
+ // gipity.yaml is the source of truth (deploys apply it), so keep it in step.
142
+ const root = getProjectRoot();
143
+ if (root && writeYamlAuthMode(join(root, 'gipity.yaml'), body.auth_mode)) {
144
+ lines.push(muted('gipity.yaml: auth.mode updated (deploys apply it).'));
145
+ }
146
+ }
140
147
  if (body.unique_player_names !== undefined) {
141
148
  lines.push(success(`Unique names ${body.unique_player_names ? 'on' : 'off'}.`));
142
149
  const sharing = res.data.players_sharing_names ?? 0;
@@ -218,4 +225,20 @@ See: gipity skill read steam-game`)
218
225
  printResult(lines.join('\n'), opts, res.data);
219
226
  }));
220
227
  }
228
+ /** Write `auth: { mode }` into gipity.yaml, the app's source of truth for its
229
+ * sign-in mode (every deploy applies it). A text edit, so comments survive:
230
+ * replace an existing top-level `auth:` block, or append one. Returns false
231
+ * when the project has no gipity.yaml. Exported for tests. */
232
+ export function writeYamlAuthMode(yamlPath, mode) {
233
+ if (!existsSync(yamlPath))
234
+ return false;
235
+ const text = readFileSync(yamlPath, 'utf-8');
236
+ const block = `auth:\n mode: ${mode}\n`;
237
+ const existing = /^auth:[^\n]*\n(?:[ \t]+[^\n]*\n|[ \t]*\n)*/m;
238
+ const next = existing.test(text)
239
+ ? text.replace(existing, block)
240
+ : `${text.replace(/\n*$/, '\n')}\n# Who signs in to the app: gipity | app (its own users, incl. guests) | both\n${block}`;
241
+ writeFileSync(yamlPath, next);
242
+ return true;
243
+ }
221
244
  //# sourceMappingURL=project-auth.js.map
package/dist/index.js CHANGED
@@ -39226,7 +39226,7 @@ async function printPlan(appGuid2, env, json) {
39226
39226
  console.log(warning("A prod deploy stops on the destructive statements above until you pass --yes-destructive."));
39227
39227
  }
39228
39228
  }
39229
- var deployCommand = new Command("deploy").description("Deploy the app to prod, or to an environment (created on first deploy)").argument("[env]", "prod, or an environment name (dev, staging, ...). Omitted: prod while the app has no environments; once it has any, name one").option("--yes-destructive", "Allow pending prod migrations that destroy data (DROP TABLE/COLUMN, TRUNCATE, DELETE without WHERE, column type changes)").option("--plan", "Show the pending migrations this deploy would run (and where each already ran), without deploying").option("--source-dir <dir>", "Source directory to deploy from").option("--only <phases>", "Run only specific phases, comma-separated, matched by gipity.yaml phase name or type: files/static, database/sql, functions, workflows, services, jobs, records, realtime, env, auth_branding").option("--force", "Re-run all phases (ignore checksums) and bypass the sync bulk-deletion guard").option("--no-sync", "Skip sync-up before deploy").option("--optimize", 'Bundle and minify the JS/CSS with Vite (off by default: files upload as-is, so prod serves what you verified). Only bundles <script type="module"> references, and page eval import() of an app module then loads a separate copy').option("--json", "Output as JSON").option("--inspect [path]", "After a successful deploy, run `page inspect` on the deployed URL (or URL + path) in the same command - one build-loop step instead of two. With --json, emits two JSON lines: deploy, then inspect.").option("--wait <ms>", "With --inspect: sleep this many ms before capturing (max 30000)").option("--wait-for <selector>", "With --inspect: wait until this CSS selector appears before capturing (deterministic; the app's own ready signal)").option("--wait-timeout <ms>", "With --inspect: max ms to wait for --wait-for before giving up", "5000").action((envArg, opts) => run("Deploy", async () => {
39229
+ var deployCommand = new Command("deploy").description("Deploy the app to prod, or to an environment (created on first deploy)").argument("[env]", "prod, or an environment name (dev, staging, ...). Omitted: prod while the app has no environments; once it has any, name one").option("--yes-destructive", "Allow pending prod migrations that destroy data (DROP TABLE/COLUMN, TRUNCATE, DELETE without WHERE, column type changes)").option("--plan", "Show the pending migrations this deploy would run (and where each already ran), without deploying").option("--source-dir <dir>", "Source directory to deploy from").option("--only <phases>", "Run only specific phases, comma-separated, matched by gipity.yaml phase name or type: files/static, database/sql, functions, workflows, services, jobs, records, realtime, env, auth_branding, auth").option("--force", "Re-run all phases (ignore checksums) and bypass the sync bulk-deletion guard").option("--no-sync", "Skip sync-up before deploy").option("--optimize", 'Bundle and minify the JS/CSS with Vite (off by default: files upload as-is, so prod serves what you verified). Only bundles <script type="module"> references, and page eval import() of an app module then loads a separate copy').option("--json", "Output as JSON").option("--inspect [path]", "After a successful deploy, run `page inspect` on the deployed URL (or URL + path) in the same command - one build-loop step instead of two. With --json, emits two JSON lines: deploy, then inspect.").option("--wait <ms>", "With --inspect: sleep this many ms before capturing (max 30000)").option("--wait-for <selector>", "With --inspect: wait until this CSS selector appears before capturing (deterministic; the app's own ready signal)").option("--wait-timeout <ms>", "With --inspect: max ms to wait for --wait-for before giving up", "5000").action((envArg, opts) => run("Deploy", async () => {
39230
39230
  const env = envArg ?? getEnvOption();
39231
39231
  if (opts.plan) {
39232
39232
  await printPlan(requireConfig2().projectGuid, env ?? "prod", !!opts.json);
@@ -40101,14 +40101,15 @@ init_config();
40101
40101
  init_setup();
40102
40102
  init_colors();
40103
40103
  init_utils();
40104
- import { join as join19 } from "path";
40104
+ import { join as join20 } from "path";
40105
40105
  import { mkdirSync as mkdirSync11 } from "fs";
40106
40106
 
40107
40107
  // src/commands/project-auth.ts
40108
40108
  init_api();
40109
40109
  init_config();
40110
40110
  init_colors();
40111
- import { readFileSync as readFileSync18 } from "fs";
40111
+ import { readFileSync as readFileSync18, writeFileSync as writeFileSync12, existsSync as existsSync15 } from "fs";
40112
+ import { join as join19 } from "path";
40112
40113
  var AUTH_MODES = ["gipity", "app", "both"];
40113
40114
  var PROVIDERS = ["google", "apple", "discord"];
40114
40115
  var PROVIDER_LABEL = { google: "Google", apple: "Apple", discord: "Discord" };
@@ -40228,7 +40229,13 @@ See: gipity skill read steam-game`).option("--unique-names <on|off>", "Require u
40228
40229
  }
40229
40230
  const res = await put(`/projects/${config.projectGuid}`, body);
40230
40231
  const lines = [];
40231
- if (body.auth_mode) lines.push(success(`Sign-in set to "${body.auth_mode}".`));
40232
+ if (body.auth_mode) {
40233
+ lines.push(success(`Sign-in set to "${body.auth_mode}".`));
40234
+ const root = getProjectRoot();
40235
+ if (root && writeYamlAuthMode(join19(root, "gipity.yaml"), body.auth_mode)) {
40236
+ lines.push(muted("gipity.yaml: auth.mode updated (deploys apply it)."));
40237
+ }
40238
+ }
40232
40239
  if (body.unique_player_names !== void 0) {
40233
40240
  lines.push(success(`Unique names ${body.unique_player_names ? "on" : "off"}.`));
40234
40241
  const sharing = res.data.players_sharing_names ?? 0;
@@ -40285,13 +40292,26 @@ See: gipity skill read steam-game`).option("--unique-names <on|off>", "Require u
40285
40292
  printResult(lines.join("\n"), opts, res.data);
40286
40293
  }));
40287
40294
  }
40295
+ function writeYamlAuthMode(yamlPath, mode) {
40296
+ if (!existsSync15(yamlPath)) return false;
40297
+ const text = readFileSync18(yamlPath, "utf-8");
40298
+ const block = `auth:
40299
+ mode: ${mode}
40300
+ `;
40301
+ const existing = /^auth:[^\n]*\n(?:[ \t]+[^\n]*\n|[ \t]*\n)*/m;
40302
+ const next = existing.test(text) ? text.replace(existing, block) : `${text.replace(/\n*$/, "\n")}
40303
+ # Who signs in to the app: gipity | app (its own users, incl. guests) | both
40304
+ ${block}`;
40305
+ writeFileSync12(yamlPath, next);
40306
+ return true;
40307
+ }
40288
40308
 
40289
40309
  // src/commands/project-users.ts
40290
40310
  init_api();
40291
40311
  init_config();
40292
40312
  init_colors();
40293
40313
  init_utils();
40294
- import { writeFileSync as writeFileSync12 } from "fs";
40314
+ import { writeFileSync as writeFileSync13 } from "fs";
40295
40315
  var EXPORT_PAGE_SIZE = 500;
40296
40316
  function fail2(msg) {
40297
40317
  console.error(error(msg));
@@ -40368,7 +40388,7 @@ email code, Steam or a guest device. They belong to the app, not to Gipity.
40368
40388
  process.stdout.write(out);
40369
40389
  return;
40370
40390
  }
40371
- writeFileSync12(opts.output, out);
40391
+ writeFileSync13(opts.output, out);
40372
40392
  printResult(success(`Exported ${all.length} user${all.length === 1 ? "" : "s"} to ${opts.output}.`), opts, { file: opts.output, count: all.length, format: opts.format });
40373
40393
  }));
40374
40394
  users.command("delete <userGuid>").description("Erase a user and everything the app keeps for them (runs the app's user_deleted hooks)").option("--json", "Output as JSON").action((userGuid, opts) => run("Delete", async () => {
@@ -40440,7 +40460,7 @@ projectCommand.command("create <name>").description("Create a project").option("
40440
40460
  }
40441
40461
  const res = await post("/projects", body);
40442
40462
  const project = res.data;
40443
- const dir = join19(getProjectsRoot(), project.slug);
40463
+ const dir = join20(getProjectsRoot(), project.slug);
40444
40464
  mkdirSync11(dir, { recursive: true });
40445
40465
  const accountSlug = await getAccountSlug();
40446
40466
  const { applied } = await finalizeLocalProject({
@@ -40509,8 +40529,8 @@ registerUsersCommand(projectCommand);
40509
40529
  // src/commands/workflow.ts
40510
40530
  init_api();
40511
40531
  init_config();
40512
- import { existsSync as existsSync15, mkdirSync as mkdirSync12, readFileSync as readFileSync19, writeFileSync as writeFileSync13 } from "fs";
40513
- import { isAbsolute, join as join20, resolve as resolve13 } from "path";
40532
+ import { existsSync as existsSync16, mkdirSync as mkdirSync12, readFileSync as readFileSync19, writeFileSync as writeFileSync14 } from "fs";
40533
+ import { isAbsolute, join as join21, resolve as resolve13 } from "path";
40514
40534
  init_colors();
40515
40535
  function mergedOpts(cmd) {
40516
40536
  return cmd.optsWithGlobals();
@@ -40717,8 +40737,8 @@ steps:
40717
40737
  tools: [memory, db_query]
40718
40738
  `;
40719
40739
  function readWorkflowYaml(from) {
40720
- const candidates = isAbsolute(from) ? [from] : [resolve13(from), ...getProjectRoot() ? [join20(getProjectRoot(), from)] : []];
40721
- const found = candidates.find((p) => existsSync15(p));
40740
+ const candidates = isAbsolute(from) ? [from] : [resolve13(from), ...getProjectRoot() ? [join21(getProjectRoot(), from)] : []];
40741
+ const found = candidates.find((p) => existsSync16(p));
40722
40742
  if (!found) throw new Error(`No workflow file at ${from}.`);
40723
40743
  return readFileSync19(found, "utf-8");
40724
40744
  }
@@ -40731,10 +40751,10 @@ workflowCommand.command("create").description("Create a workflow from a YAML fil
40731
40751
  if (opts.heartbeat) {
40732
40752
  from = HEARTBEAT_PATH;
40733
40753
  const root = getProjectRoot();
40734
- const local = join20(root, HEARTBEAT_PATH);
40735
- if (!existsSync15(local)) {
40736
- mkdirSync12(join20(root, "workflows"), { recursive: true });
40737
- writeFileSync13(local, HEARTBEAT_YAML);
40754
+ const local = join21(root, HEARTBEAT_PATH);
40755
+ if (!existsSync16(local)) {
40756
+ mkdirSync12(join21(root, "workflows"), { recursive: true });
40757
+ writeFileSync14(local, HEARTBEAT_YAML);
40738
40758
  }
40739
40759
  await pushFile(local);
40740
40760
  }
@@ -41314,8 +41334,8 @@ storageCommand.command("retention").description("View or adjust your file versio
41314
41334
  init_platform();
41315
41335
  init_auth();
41316
41336
  init_api();
41317
- import { join as join22, dirname as dirname12, resolve as resolve14, basename as basename6, sep as sep6 } from "path";
41318
- import { existsSync as existsSync17, mkdirSync as mkdirSync14, readFileSync as readFileSync21, writeFileSync as writeFileSync15, renameSync as renameSync2, readdirSync as readdirSync8, statSync as statSync8 } from "fs";
41337
+ import { join as join23, dirname as dirname12, resolve as resolve14, basename as basename6, sep as sep6 } from "path";
41338
+ import { existsSync as existsSync18, mkdirSync as mkdirSync14, readFileSync as readFileSync21, writeFileSync as writeFileSync16, renameSync as renameSync2, readdirSync as readdirSync8, statSync as statSync8 } from "fs";
41319
41339
  import { homedir as homedir15 } from "os";
41320
41340
  import { fileURLToPath as fileURLToPath2 } from "url";
41321
41341
  import { randomUUID } from "crypto";
@@ -41675,12 +41695,12 @@ init_claude_setup();
41675
41695
  init_agents();
41676
41696
 
41677
41697
  // src/prefs.ts
41678
- import { existsSync as existsSync16, mkdirSync as mkdirSync13, readFileSync as readFileSync20, writeFileSync as writeFileSync14 } from "fs";
41698
+ import { existsSync as existsSync17, mkdirSync as mkdirSync13, readFileSync as readFileSync20, writeFileSync as writeFileSync15 } from "fs";
41679
41699
  import { homedir as homedir14 } from "os";
41680
- import { join as join21 } from "path";
41681
- var PREFS_PATH = join21(homedir14(), ".gipity", "prefs.json");
41700
+ import { join as join22 } from "path";
41701
+ var PREFS_PATH = join22(homedir14(), ".gipity", "prefs.json");
41682
41702
  function readPrefs() {
41683
- if (!existsSync16(PREFS_PATH)) return {};
41703
+ if (!existsSync17(PREFS_PATH)) return {};
41684
41704
  try {
41685
41705
  const parsed = JSON.parse(readFileSync20(PREFS_PATH, "utf-8"));
41686
41706
  return {
@@ -41694,8 +41714,8 @@ function writePrefs(update) {
41694
41714
  try {
41695
41715
  const current = readPrefs();
41696
41716
  const next = { ...current, ...update };
41697
- mkdirSync13(join21(homedir14(), ".gipity"), { recursive: true });
41698
- writeFileSync14(PREFS_PATH, JSON.stringify(next, null, 2) + "\n");
41717
+ mkdirSync13(join22(homedir14(), ".gipity"), { recursive: true });
41718
+ writeFileSync15(PREFS_PATH, JSON.stringify(next, null, 2) + "\n");
41699
41719
  } catch {
41700
41720
  }
41701
41721
  }
@@ -41705,8 +41725,8 @@ init_setup();
41705
41725
  var __clDir = dirname12(fileURLToPath2(import.meta.url));
41706
41726
  function readOwnPkg(fromDir) {
41707
41727
  for (let d = fromDir; ; d = dirname12(d)) {
41708
- const p = join22(d, "package.json");
41709
- if (existsSync17(p)) {
41728
+ const p = join23(d, "package.json");
41729
+ if (existsSync18(p)) {
41710
41730
  try {
41711
41731
  const pkg2 = JSON.parse(readFileSync21(p, "utf-8"));
41712
41732
  if (pkg2.name === "gipity") return pkg2;
@@ -41762,7 +41782,7 @@ function localFsFallback(dir) {
41762
41782
  let isDir = false;
41763
41783
  let size = 0;
41764
41784
  try {
41765
- const st2 = statSync8(join22(d, name));
41785
+ const st2 = statSync8(join23(d, name));
41766
41786
  isDir = st2.isDirectory();
41767
41787
  size = st2.isFile() ? st2.size : 0;
41768
41788
  } catch {
@@ -41771,7 +41791,7 @@ function localFsFallback(dir) {
41771
41791
  if (isDir) {
41772
41792
  folderCount++;
41773
41793
  if (depth === 0) topLevelEntries.push(`${name}/`);
41774
- walk(join22(d, name), depth + 1);
41794
+ walk(join23(d, name), depth + 1);
41775
41795
  } else {
41776
41796
  fileCount++;
41777
41797
  totalBytes += size;
@@ -41804,8 +41824,8 @@ function hasStreamJsonFlag(args) {
41804
41824
  }
41805
41825
  function markFolderTrusted(dir) {
41806
41826
  try {
41807
- const file = join22(homedir15(), ".claude.json");
41808
- const cfg = existsSync17(file) ? JSON.parse(readFileSync21(file, "utf-8")) : {};
41827
+ const file = join23(homedir15(), ".claude.json");
41828
+ const cfg = existsSync18(file) ? JSON.parse(readFileSync21(file, "utf-8")) : {};
41809
41829
  if (typeof cfg !== "object" || cfg === null) return;
41810
41830
  if (typeof cfg.projects !== "object" || cfg.projects === null) cfg.projects = {};
41811
41831
  const entry = typeof cfg.projects[dir] === "object" && cfg.projects[dir] !== null ? cfg.projects[dir] : {};
@@ -41813,7 +41833,7 @@ function markFolderTrusted(dir) {
41813
41833
  entry.hasTrustDialogAccepted = true;
41814
41834
  cfg.projects[dir] = entry;
41815
41835
  const tmp = `${file}.gipity-tmp`;
41816
- writeFileSync15(tmp, JSON.stringify(cfg, null, 2));
41836
+ writeFileSync16(tmp, JSON.stringify(cfg, null, 2));
41817
41837
  renameSync2(tmp, file);
41818
41838
  } catch {
41819
41839
  }
@@ -41924,7 +41944,7 @@ async function runLaunch(cmdName, cmdCfg, opts) {
41924
41944
  let existing = getConfig();
41925
41945
  let forceAdoptCwd = false;
41926
41946
  if (existing && !opts.newProject && !opts.project && !nonInteractive) {
41927
- const cwdHasConfig = existsSync17(resolve14(process.cwd(), ".gipity.json"));
41947
+ const cwdHasConfig = existsSync18(resolve14(process.cwd(), ".gipity.json"));
41928
41948
  if (!cwdHasConfig && isLikelyEmpty(process.cwd())) {
41929
41949
  const ancestorRoot = dirname12(getConfigPath());
41930
41950
  console.log(` ${bold("You are inside an existing Gipity project.")}
@@ -41973,7 +41993,7 @@ async function runLaunch(cmdName, cmdCfg, opts) {
41973
41993
  }
41974
41994
  project = found;
41975
41995
  }
41976
- const projectDir2 = opts.here ? process.cwd() : join22(getProjectsRoot(), project.slug);
41996
+ const projectDir2 = opts.here ? process.cwd() : join23(getProjectsRoot(), project.slug);
41977
41997
  mkdirSync14(projectDir2, { recursive: true });
41978
41998
  process.chdir(projectDir2);
41979
41999
  clearConfigCache();
@@ -42088,7 +42108,7 @@ async function runLaunch(cmdName, cmdCfg, opts) {
42088
42108
  } else {
42089
42109
  project = result.project;
42090
42110
  isNewProject = result.kind === "create-new";
42091
- const projectDir2 = join22(getProjectsRoot(), project.slug);
42111
+ const projectDir2 = join23(getProjectsRoot(), project.slug);
42092
42112
  mkdirSync14(projectDir2, { recursive: true });
42093
42113
  process.chdir(projectDir2);
42094
42114
  clearConfigCache();
@@ -42479,8 +42499,8 @@ ${doneLine}
42479
42499
  });
42480
42500
  }
42481
42501
  function flushHeadlessCapture(adapter, sessionId, convGuid) {
42482
- const runner = join22(__clDir, "..", "hooks", "capture-runner.js");
42483
- if (!existsSync17(runner)) return;
42502
+ const runner = join23(__clDir, "..", "hooks", "capture-runner.js");
42503
+ if (!existsSync18(runner)) return;
42484
42504
  const payload = JSON.stringify({ session_id: sessionId, cwd: process.cwd() });
42485
42505
  const env = { ...process.env, GIPITY_CONVERSATION_GUID: convGuid };
42486
42506
  for (const event of ["session-start", "stop"]) {
@@ -44734,11 +44754,11 @@ jobCommand.command("cancel <runGuid>").description("Cancel a queued or running j
44734
44754
  }
44735
44755
  }));
44736
44756
  jobCommand.command("run-local <name>").description("Run the job in a local Docker container against your local filesystem (no platform round-trip)").option("--image <image>", "Docker image to run inside", "easyclaw/sandbox:latest").option("--no-deps", "Skip pip/npm install even if a deps file is present").option("--json", "Capture the job's output and print one JSON result (exitCode, stdout, stderr) instead of streaming it").action(async (name, opts) => {
44737
- const { existsSync: existsSync27, statSync: statSync12 } = await import("node:fs");
44738
- const { resolve: resolve21, join: join32 } = await import("node:path");
44757
+ const { existsSync: existsSync28, statSync: statSync12 } = await import("node:fs");
44758
+ const { resolve: resolve21, join: join33 } = await import("node:path");
44739
44759
  const { spawnCommand: spawnCommand2, spawnSyncCommand: spawnSyncCommand2 } = await Promise.resolve().then(() => (init_platform(), platform_exports));
44740
44760
  const jobDir = resolve21(process.cwd(), "jobs", name);
44741
- if (!existsSync27(jobDir) || !statSync12(jobDir).isDirectory()) {
44761
+ if (!existsSync28(jobDir) || !statSync12(jobDir).isDirectory()) {
44742
44762
  console.error(error(`jobs/${name}/ not found in current directory`));
44743
44763
  process.exit(1);
44744
44764
  }
@@ -44759,7 +44779,7 @@ jobCommand.command("run-local <name>").description("Run the job in a local Docke
44759
44779
  },
44760
44780
  { file: "main.sh", runtime: "bash", entry: "bash" }
44761
44781
  ];
44762
- const picked = variants.find((v7) => existsSync27(join32(jobDir, v7.file)));
44782
+ const picked = variants.find((v7) => existsSync28(join33(jobDir, v7.file)));
44763
44783
  if (!picked) {
44764
44784
  console.error(error(`No main.py / main.js / main.sh found under jobs/${name}/`));
44765
44785
  process.exit(1);
@@ -44784,7 +44804,7 @@ jobCommand.command("run-local <name>").description("Run the job in a local Docke
44784
44804
  "-v",
44785
44805
  `${jobDir}:/work`
44786
44806
  ];
44787
- const needsDeps = opts.deps !== false && picked.depsFile && picked.installCmd && existsSync27(join32(jobDir, picked.depsFile));
44807
+ const needsDeps = opts.deps !== false && picked.depsFile && picked.installCmd && existsSync28(join33(jobDir, picked.depsFile));
44788
44808
  const handlerCmd = `${picked.entry} /work/${picked.file}`;
44789
44809
  let shellCmd;
44790
44810
  if (needsDeps && picked.installCmd) {
@@ -44958,7 +44978,7 @@ emailCommand.command("log").description("Recent email() sends and skipped attemp
44958
44978
  init_api();
44959
44979
  init_config();
44960
44980
  init_colors();
44961
- import { mkdirSync as mkdirSync15, writeFileSync as writeFileSync16, readFileSync as readFileSync22 } from "fs";
44981
+ import { mkdirSync as mkdirSync15, writeFileSync as writeFileSync17, readFileSync as readFileSync22 } from "fs";
44962
44982
  import { resolve as resolvePath2, dirname as dirname13, relative as relative5, isAbsolute as isAbsolute2, basename as basename7 } from "path";
44963
44983
 
44964
44984
  // src/commands/generate-async.ts
@@ -45265,7 +45285,7 @@ async function downloadFile(url, filename, explicit) {
45265
45285
  const outPath = explicit ? filename : correctExtension(filename, buffer);
45266
45286
  if (explicit) noteFormatMismatch(filename, buffer);
45267
45287
  ensureOutputDir(outPath);
45268
- writeFileSync16(outPath, buffer);
45288
+ writeFileSync17(outPath, buffer);
45269
45289
  const savedPath = resolvePath2(outPath);
45270
45290
  await pushGenerated(savedPath);
45271
45291
  return savedPath;
@@ -45769,14 +45789,14 @@ Examples:
45769
45789
  init_api();
45770
45790
  init_config();
45771
45791
  init_colors();
45772
- import { existsSync as existsSync18, readFileSync as readFileSync24 } from "fs";
45773
- import { join as join23 } from "path";
45792
+ import { existsSync as existsSync19, readFileSync as readFileSync24 } from "fs";
45793
+ import { join as join24 } from "path";
45774
45794
  function readInstalledKitReadme(name) {
45775
45795
  const root = getProjectRoot() ?? process.cwd();
45776
- const kitDir = join23(root, "src", "packages", name);
45777
- if (!existsSync18(join23(kitDir, "package.json"))) return null;
45778
- const readme = join23(kitDir, "README.md");
45779
- return existsSync18(readme) ? readFileSync24(readme, "utf-8") : null;
45796
+ const kitDir = join24(root, "src", "packages", name);
45797
+ if (!existsSync19(join24(kitDir, "package.json"))) return null;
45798
+ const readme = join24(kitDir, "README.md");
45799
+ return existsSync19(readme) ? readFileSync24(readme, "utf-8") : null;
45780
45800
  }
45781
45801
  function slugify2(title) {
45782
45802
  return title.toLowerCase().replace(/[`*_]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
@@ -46071,7 +46091,7 @@ var domainCommand = new Command("domain").description("Manage custom domains").a
46071
46091
  }));
46072
46092
 
46073
46093
  // src/commands/realtime.ts
46074
- import { existsSync as existsSync19 } from "fs";
46094
+ import { existsSync as existsSync20 } from "fs";
46075
46095
  import { dirname as dirname14, resolve as resolve15 } from "path";
46076
46096
  import { fileURLToPath as fileURLToPath3, pathToFileURL } from "url";
46077
46097
  init_api();
@@ -46080,7 +46100,7 @@ init_colors();
46080
46100
  function hasDeployManifest() {
46081
46101
  const cfgPath = getConfigPath();
46082
46102
  if (!cfgPath) return false;
46083
- return existsSync19(resolve15(dirname14(cfgPath), "gipity.yaml"));
46103
+ return existsSync20(resolve15(dirname14(cfgPath), "gipity.yaml"));
46084
46104
  }
46085
46105
  var roomCommand = new Command("room").description("Manage realtime rooms").argument("[action]", "list | create | delete | info", "list").argument("[name]", "room name (for create | delete | info)").addOption(new Option("--type <type>", "Room type for create").choices(["state", "relay"]).default("state")).addOption(new Option("--auth <level>", "Auth level for create").choices(["public", "user"]).default("public")).option("--max-clients <n>", "max clients for create (1-200)").option("--seat-hold <seconds>", "create: how long a dropped client keeps its seat (0-300, default 30)").option("--host-hold <seconds>", "create: how long the host role waits for a dropped or reloading host (0-600, default 60)").option("--host-handoff", "create: move the host role to another player when the host is gone").option("--host-grace <seconds>", "create: with handoff, how long the host may be unreachable before the role moves (1-60, default 5)").option("--server-channels <names>", "create: comma-separated channels only the app's functions may publish on (realtime.publish)").option("--json", "Output as JSON").action((action, name, opts) => run("Realtime room", async () => {
46086
46106
  const config = requireConfig2();
@@ -46171,7 +46191,7 @@ var roomCommand = new Command("room").description("Manage realtime rooms").argum
46171
46191
  function benchModulePath() {
46172
46192
  const here = dirname14(fileURLToPath3(import.meta.url));
46173
46193
  for (const candidate of [resolve15(here, "realtime-bench.js"), resolve15(here, "..", "realtime-bench.js")]) {
46174
- if (existsSync19(candidate)) return pathToFileURL(candidate).href;
46194
+ if (existsSync20(candidate)) return pathToFileURL(candidate).href;
46175
46195
  }
46176
46196
  throw new Error("realtime-bench.js is missing from this CLI build; reinstall the gipity CLI");
46177
46197
  }
@@ -46560,27 +46580,27 @@ var locationCommand = new Command("location").description("Show location").argum
46560
46580
  }));
46561
46581
 
46562
46582
  // src/commands/doctor.ts
46563
- import { existsSync as existsSync21, readFileSync as readFileSync26, statSync as statSync9 } from "fs";
46564
- import { join as join25, resolve as resolve17 } from "path";
46583
+ import { existsSync as existsSync22, readFileSync as readFileSync26, statSync as statSync9 } from "fs";
46584
+ import { join as join26, resolve as resolve17 } from "path";
46565
46585
  import { homedir as homedir17 } from "os";
46566
46586
 
46567
46587
  // src/updater/state.ts
46568
- import { readFileSync as readFileSync25, writeFileSync as writeFileSync17, mkdirSync as mkdirSync16, existsSync as existsSync20 } from "fs";
46569
- import { dirname as dirname15, join as join24, resolve as resolve16 } from "path";
46588
+ import { readFileSync as readFileSync25, writeFileSync as writeFileSync18, mkdirSync as mkdirSync16, existsSync as existsSync21 } from "fs";
46589
+ import { dirname as dirname15, join as join25, resolve as resolve16 } from "path";
46570
46590
  import { homedir as homedir16 } from "os";
46571
46591
  import { fileURLToPath as fileURLToPath4 } from "url";
46572
- var GIPITY_DIR = join24(homedir16(), ".gipity");
46573
- var LOCAL_DIR = join24(GIPITY_DIR, "local");
46574
- var LOCAL_PKG_DIR = join24(LOCAL_DIR, "node_modules", "gipity");
46575
- var LOCAL_ENTRY = join24(LOCAL_PKG_DIR, "dist", "index.js");
46576
- var STATE_FILE = join24(GIPITY_DIR, "update-state.json");
46577
- var SETTINGS_FILE = join24(GIPITY_DIR, "settings.json");
46578
- var UPDATE_LOG = join24(GIPITY_DIR, "update.log");
46592
+ var GIPITY_DIR = join25(homedir16(), ".gipity");
46593
+ var LOCAL_DIR = join25(GIPITY_DIR, "local");
46594
+ var LOCAL_PKG_DIR = join25(LOCAL_DIR, "node_modules", "gipity");
46595
+ var LOCAL_ENTRY = join25(LOCAL_PKG_DIR, "dist", "index.js");
46596
+ var STATE_FILE = join25(GIPITY_DIR, "update-state.json");
46597
+ var SETTINGS_FILE = join25(GIPITY_DIR, "settings.json");
46598
+ var UPDATE_LOG = join25(GIPITY_DIR, "update.log");
46579
46599
  function findPkgRoot() {
46580
46600
  let dir = dirname15(fileURLToPath4(import.meta.url));
46581
46601
  for (; ; ) {
46582
46602
  try {
46583
- if (JSON.parse(readFileSync25(join24(dir, "package.json"), "utf-8")).name === "gipity") return dir;
46603
+ if (JSON.parse(readFileSync25(join25(dir, "package.json"), "utf-8")).name === "gipity") return dir;
46584
46604
  } catch {
46585
46605
  }
46586
46606
  const up2 = dirname15(dir);
@@ -46590,7 +46610,7 @@ function findPkgRoot() {
46590
46610
  }
46591
46611
  var PKG_ROOT = findPkgRoot();
46592
46612
  function isDevLink() {
46593
- return existsSync20(join24(PKG_ROOT, "src"));
46613
+ return existsSync21(join25(PKG_ROOT, "src"));
46594
46614
  }
46595
46615
  var DEFAULT_STATE = {
46596
46616
  installedVersion: null,
@@ -46605,7 +46625,7 @@ function ensureDir() {
46605
46625
  mkdirSync16(GIPITY_DIR, { recursive: true });
46606
46626
  }
46607
46627
  function readState() {
46608
- if (!existsSync20(STATE_FILE)) return { ...DEFAULT_STATE };
46628
+ if (!existsSync21(STATE_FILE)) return { ...DEFAULT_STATE };
46609
46629
  try {
46610
46630
  return { ...DEFAULT_STATE, ...JSON.parse(readFileSync25(STATE_FILE, "utf-8")) };
46611
46631
  } catch {
@@ -46614,10 +46634,10 @@ function readState() {
46614
46634
  }
46615
46635
  function writeState(state) {
46616
46636
  ensureDir();
46617
- writeFileSync17(STATE_FILE, JSON.stringify(state, null, 2));
46637
+ writeFileSync18(STATE_FILE, JSON.stringify(state, null, 2));
46618
46638
  }
46619
46639
  function readSettings() {
46620
- if (!existsSync20(SETTINGS_FILE)) return { ...DEFAULT_SETTINGS };
46640
+ if (!existsSync21(SETTINGS_FILE)) return { ...DEFAULT_SETTINGS };
46621
46641
  try {
46622
46642
  return { ...DEFAULT_SETTINGS, ...JSON.parse(readFileSync25(SETTINGS_FILE, "utf-8")) };
46623
46643
  } catch {
@@ -46653,8 +46673,8 @@ function versionManagerNode(execPath, env = process.env, home = homedir17()) {
46653
46673
  return null;
46654
46674
  }
46655
46675
  function localVersion() {
46656
- const pkgPath = join25(LOCAL_PKG_DIR, "package.json");
46657
- if (!existsSync21(pkgPath)) return null;
46676
+ const pkgPath = join26(LOCAL_PKG_DIR, "package.json");
46677
+ if (!existsSync22(pkgPath)) return null;
46658
46678
  try {
46659
46679
  return JSON.parse(readFileSync26(pkgPath, "utf-8")).version ?? null;
46660
46680
  } catch {
@@ -46679,7 +46699,7 @@ function rel(t) {
46679
46699
  }
46680
46700
  function relayAutostartInstalled() {
46681
46701
  try {
46682
- return existsSync21(planFor({ cliPath: resolveCliPath() }).path);
46702
+ return existsSync22(planFor({ cliPath: resolveCliPath() }).path);
46683
46703
  } catch (err) {
46684
46704
  if (err instanceof UnsupportedPlatformError) return null;
46685
46705
  return null;
@@ -46722,7 +46742,7 @@ function gatherEnv(opts = {}) {
46722
46742
  const cli = {
46723
46743
  shim_version: shimVersion(),
46724
46744
  local_version: localVersion(),
46725
- local_install_ok: existsSync21(LOCAL_ENTRY),
46745
+ local_install_ok: existsSync22(LOCAL_ENTRY),
46726
46746
  auto_updates: !dis.disabled,
46727
46747
  updates_disabled_reason: dis.disabled ? dis.reason ?? null : null,
46728
46748
  last_check_at: updState.lastCheckAt,
@@ -46754,7 +46774,7 @@ var doctorCommand = new Command("doctor").description("Check install + environme
46754
46774
  if (env.claude.installed && !env.claude.authenticated) {
46755
46775
  console.log(`${muted(" ")} ${warning("Claude Code is not logged in. Run `claude auth login` and sign in.")}`);
46756
46776
  }
46757
- if (existsSync21(resolve17(process.cwd(), ".codex", "hooks.json"))) {
46777
+ if (existsSync22(resolve17(process.cwd(), ".codex", "hooks.json"))) {
46758
46778
  console.log(`${muted("codex hooks ")} ${warning("written")} - session capture needs a one-time approval: run /hooks inside Codex in this project`);
46759
46779
  }
46760
46780
  const buildReady = env.node.ok && env.gipity.logged_in;
@@ -46763,7 +46783,7 @@ var doctorCommand = new Command("doctor").description("Check install + environme
46763
46783
  const settings = readSettings();
46764
46784
  const dis = updatesDisabled();
46765
46785
  const local = localVersion();
46766
- const localOk = existsSync21(LOCAL_ENTRY);
46786
+ const localOk = existsSync22(LOCAL_ENTRY);
46767
46787
  console.log("");
46768
46788
  console.log(bold("CLI install"));
46769
46789
  console.log(`${muted("shim version ")} ${shimVersion()}`);
@@ -46771,11 +46791,11 @@ var doctorCommand = new Command("doctor").description("Check install + environme
46771
46791
  console.log(`${muted("local install ")} ${LOCAL_PKG_DIR}`);
46772
46792
  console.log("");
46773
46793
  console.log(`${muted("auto-updates ")} ${dis.disabled ? warning(`disabled (${dis.reason})`) : success("enabled")}`);
46774
- console.log(`${muted("settings file ")} ${existsSync21(SETTINGS_FILE) ? SETTINGS_FILE : dim("(default)")} autoUpdates=${settings.autoUpdates}`);
46794
+ console.log(`${muted("settings file ")} ${existsSync22(SETTINGS_FILE) ? SETTINGS_FILE : dim("(default)")} autoUpdates=${settings.autoUpdates}`);
46775
46795
  console.log(`${muted("last check ")} ${rel(state.lastCheckAt)}`);
46776
46796
  console.log(`${muted("last error ")} ${state.lastError ? error(state.lastError) : dim("none")}`);
46777
- console.log(`${muted("state file ")} ${existsSync21(STATE_FILE) ? STATE_FILE : dim("(none yet)")}`);
46778
- console.log(`${muted("update log ")} ${existsSync21(UPDATE_LOG) ? `${UPDATE_LOG} (${statSync9(UPDATE_LOG).size} bytes)` : dim("(none yet)")}`);
46797
+ console.log(`${muted("state file ")} ${existsSync22(STATE_FILE) ? STATE_FILE : dim("(none yet)")}`);
46798
+ console.log(`${muted("update log ")} ${existsSync22(UPDATE_LOG) ? `${UPDATE_LOG} (${statSync9(UPDATE_LOG).size} bytes)` : dim("(none yet)")}`);
46779
46799
  console.log("");
46780
46800
  console.log(dim("Force an update with: gipity update"));
46781
46801
  });
@@ -46784,10 +46804,10 @@ var doctorCommand = new Command("doctor").description("Check install + environme
46784
46804
  import { appendFileSync } from "fs";
46785
46805
 
46786
46806
  // src/updater/install.ts
46787
- import { existsSync as existsSync22, mkdirSync as mkdirSync17, rmSync as rmSync2, statSync as statSync10, unlinkSync as unlinkSync6, writeFileSync as writeFileSync18 } from "fs";
46788
- import { dirname as dirname16, join as join26 } from "path";
46807
+ import { existsSync as existsSync23, mkdirSync as mkdirSync17, rmSync as rmSync2, statSync as statSync10, unlinkSync as unlinkSync6, writeFileSync as writeFileSync19 } from "fs";
46808
+ import { dirname as dirname16, join as join27 } from "path";
46789
46809
  init_platform();
46790
- var UPDATE_LOCK = join26(GIPITY_DIR, "update.lock");
46810
+ var UPDATE_LOCK = join27(GIPITY_DIR, "update.lock");
46791
46811
  var LOCK_STALE_MS2 = 10 * 60 * 1e3;
46792
46812
  function npmInstallGipity(version) {
46793
46813
  ensureLocalTree();
@@ -46797,7 +46817,7 @@ function npmInstallGipity(version) {
46797
46817
  encoding: "utf-8"
46798
46818
  });
46799
46819
  return {
46800
- ok: res.status === 0 && existsSync22(LOCAL_ENTRY),
46820
+ ok: res.status === 0 && existsSync23(LOCAL_ENTRY),
46801
46821
  status: res.status,
46802
46822
  stderr: (res.stderr || "").toString(),
46803
46823
  spawnError: res.error
@@ -46809,27 +46829,27 @@ function isWedged(stderr) {
46809
46829
  }
46810
46830
  function ensureLocalTree(dir = LOCAL_DIR) {
46811
46831
  mkdirSync17(dir, { recursive: true });
46812
- const pkgJson = join26(dir, "package.json");
46813
- if (!existsSync22(pkgJson)) {
46814
- writeFileSync18(pkgJson, JSON.stringify({ name: "gipity-local", private: true, version: "0.0.0" }, null, 2));
46832
+ const pkgJson = join27(dir, "package.json");
46833
+ if (!existsSync23(pkgJson)) {
46834
+ writeFileSync19(pkgJson, JSON.stringify({ name: "gipity-local", private: true, version: "0.0.0" }, null, 2));
46815
46835
  }
46816
46836
  }
46817
46837
  function resetLocalTree(dir = LOCAL_DIR) {
46818
46838
  mkdirSync17(dir, { recursive: true });
46819
- rmSync2(join26(dir, "node_modules"), { recursive: true, force: true });
46820
- rmSync2(join26(dir, "package-lock.json"), { force: true });
46821
- writeFileSync18(join26(dir, "package.json"), JSON.stringify({ name: "gipity-local", private: true, version: "0.0.0" }, null, 2));
46839
+ rmSync2(join27(dir, "node_modules"), { recursive: true, force: true });
46840
+ rmSync2(join27(dir, "package-lock.json"), { force: true });
46841
+ writeFileSync19(join27(dir, "package.json"), JSON.stringify({ name: "gipity-local", private: true, version: "0.0.0" }, null, 2));
46822
46842
  }
46823
46843
  function acquireUpdateLock(lockPath2 = UPDATE_LOCK) {
46824
46844
  mkdirSync17(dirname16(lockPath2), { recursive: true });
46825
46845
  try {
46826
- writeFileSync18(lockPath2, String(process.pid), { flag: "wx" });
46846
+ writeFileSync19(lockPath2, String(process.pid), { flag: "wx" });
46827
46847
  return true;
46828
46848
  } catch {
46829
46849
  try {
46830
46850
  if (Date.now() - statSync10(lockPath2).mtimeMs > LOCK_STALE_MS2) {
46831
46851
  unlinkSync6(lockPath2);
46832
- writeFileSync18(lockPath2, String(process.pid), { flag: "wx" });
46852
+ writeFileSync19(lockPath2, String(process.pid), { flag: "wx" });
46833
46853
  return true;
46834
46854
  }
46835
46855
  } catch {
@@ -46994,17 +47014,17 @@ var updateCommand = new Command("update").description("Update the CLI").option("
46994
47014
  init_api();
46995
47015
  init_utils();
46996
47016
  init_colors();
46997
- import { existsSync as existsSync25, readFileSync as readFileSync29, unlinkSync as unlinkSync9 } from "fs";
47017
+ import { existsSync as existsSync26, readFileSync as readFileSync29, unlinkSync as unlinkSync9 } from "fs";
46998
47018
  import { spawn as spawn2 } from "child_process";
46999
47019
 
47000
47020
  // src/relay/daemon.ts
47001
47021
  init_platform();
47002
47022
  init_config();
47003
- import { appendFileSync as appendFileSync3, mkdirSync as mkdirSync19, existsSync as existsSync24, readFileSync as readFileSync28, writeFileSync as writeFileSync19, chmodSync as chmodSync4, closeSync as closeSync4, openSync as openSync4, unlinkSync as unlinkSync8 } from "fs";
47023
+ import { appendFileSync as appendFileSync3, mkdirSync as mkdirSync19, existsSync as existsSync25, readFileSync as readFileSync28, writeFileSync as writeFileSync20, chmodSync as chmodSync4, closeSync as closeSync4, openSync as openSync4, unlinkSync as unlinkSync8 } from "fs";
47004
47024
  import { stat, readFile } from "fs/promises";
47005
47025
  import { createInterface as createInterface2 } from "readline";
47006
47026
  import { homedir as homedir19, hostname as hostname6, platform as osPlatform3, loadavg as loadavg2, freemem as freemem2, totalmem as totalmem2, cpus as cpus2 } from "os";
47007
- import { join as join29 } from "path";
47027
+ import { join as join30 } from "path";
47008
47028
  init_setup();
47009
47029
  init_auth();
47010
47030
  init_api();
@@ -47764,7 +47784,7 @@ init_agents();
47764
47784
  init_claude_setup();
47765
47785
  import { cpus, freemem, totalmem, loadavg, release, uptime, homedir as homedir18 } from "os";
47766
47786
  import { statfsSync, readdirSync as readdirSync9 } from "fs";
47767
- import { join as join27 } from "path";
47787
+ import { join as join28 } from "path";
47768
47788
  var PROBE_TIMEOUT_MS = 4e3;
47769
47789
  function parseVersion(out) {
47770
47790
  const m = out.match(/\d+\.\d+(?:\.\d+)?(?:[-.\w]*)?/);
@@ -47831,7 +47851,7 @@ async function detectGpu() {
47831
47851
  function diskUsage() {
47832
47852
  try {
47833
47853
  if (typeof statfsSync !== "function") return void 0;
47834
- const st2 = statfsSync(join27(homedir18(), "GipityProjects"), { bigint: false });
47854
+ const st2 = statfsSync(join28(homedir18(), "GipityProjects"), { bigint: false });
47835
47855
  if (!st2 || !st2.bsize) return void 0;
47836
47856
  return { total: st2.bsize * st2.blocks, free: st2.bsize * st2.bavail };
47837
47857
  } catch {
@@ -47845,7 +47865,7 @@ function diskUsage() {
47845
47865
  }
47846
47866
  function localProjectCount() {
47847
47867
  try {
47848
- return readdirSync9(join27(homedir18(), "GipityProjects"), { withFileTypes: true }).filter((e) => e.isDirectory() && !e.name.startsWith(".")).length;
47868
+ return readdirSync9(join28(homedir18(), "GipityProjects"), { withFileTypes: true }).filter((e) => e.isDirectory() && !e.name.startsWith(".")).length;
47849
47869
  } catch {
47850
47870
  return void 0;
47851
47871
  }
@@ -48302,7 +48322,7 @@ var SessionPool = class {
48302
48322
  init_config();
48303
48323
  init_api();
48304
48324
  init_agents();
48305
- var RELAY_LOG_PATH = join29(homedir19(), ".gipity", "relay.log");
48325
+ var RELAY_LOG_PATH = join30(homedir19(), ".gipity", "relay.log");
48306
48326
  var HEARTBEAT_INTERVAL_MS = parseInt(process.env.GIPITY_RELAY_HEARTBEAT_MS || "60000", 10);
48307
48327
  var DIAGNOSTICS_INTERVAL_MS = parseInt(process.env.GIPITY_RELAY_DIAGNOSTICS_MS || String(24 * 60 * 60 * 1e3), 10);
48308
48328
  var LONG_POLL_TIMEOUT_MS = parseInt(process.env.GIPITY_RELAY_POLL_TIMEOUT_MS || "35000", 10);
@@ -48410,7 +48430,7 @@ function lockLogPerms(dir, file) {
48410
48430
  chmodSync4(dir, 448);
48411
48431
  } catch {
48412
48432
  }
48413
- if (!existsSync24(file)) {
48433
+ if (!existsSync25(file)) {
48414
48434
  try {
48415
48435
  closeSync4(openSync4(file, "a", 384));
48416
48436
  } catch {
@@ -48427,7 +48447,7 @@ function log2(level, msg, extra) {
48427
48447
  const pretty = `${C7.dim(hhmmss())} ${badge(level)} ${C7.bold(msg)}${formatExtra(extra)}`;
48428
48448
  process.stderr.write(pretty + "\n");
48429
48449
  try {
48430
- const dir = join29(homedir19(), ".gipity");
48450
+ const dir = join30(homedir19(), ".gipity");
48431
48451
  mkdirSync19(dir, { recursive: true });
48432
48452
  lockLogPerms(dir, RELAY_LOG_PATH);
48433
48453
  const json = JSON.stringify({ ts: (/* @__PURE__ */ new Date()).toISOString(), level, msg, ...extra ?? {} });
@@ -48859,7 +48879,7 @@ function isSafeSessionId(s) {
48859
48879
  function transcriptPathFor(cwd, sessionId) {
48860
48880
  if (!isSafeSessionId(sessionId)) return null;
48861
48881
  const slug = cwd.replace(/[^a-zA-Z0-9]/g, "-");
48862
- return join29(homedir19(), ".claude", "projects", slug, `${sessionId}.jsonl`);
48882
+ return join30(homedir19(), ".claude", "projects", slug, `${sessionId}.jsonl`);
48863
48883
  }
48864
48884
  function formatDuration(ms2) {
48865
48885
  const totalSec = ms2 / 1e3;
@@ -49323,9 +49343,9 @@ async function resolveCwdForProject(d) {
49323
49343
  throw new Error(`Invalid project slug: ${JSON.stringify(d.project_slug)}`);
49324
49344
  }
49325
49345
  const root = getProjectsRoot();
49326
- const path5 = join29(root, d.project_slug);
49327
- const configPath = join29(path5, ".gipity.json");
49328
- if (existsSync24(configPath)) {
49346
+ const path5 = join30(root, d.project_slug);
49347
+ const configPath = join30(path5, ".gipity.json");
49348
+ if (existsSync25(configPath)) {
49329
49349
  try {
49330
49350
  const cfg = JSON.parse(readFileSync28(configPath, "utf-8"));
49331
49351
  if (cfg.projectGuid === d.project_guid) return { cwd: path5, bootstrapped: false };
@@ -49341,7 +49361,7 @@ async function resolveCwdForProject(d) {
49341
49361
  log2("info", "bootstrapping new project dir", { slug: d.project_slug, path: path5 });
49342
49362
  mkdirSync19(path5, { recursive: true });
49343
49363
  const apiBase2 = getApiBaseOverride() || DEFAULT_API_BASE;
49344
- writeFileSync19(configPath, JSON.stringify({
49364
+ writeFileSync20(configPath, JSON.stringify({
49345
49365
  projectGuid: d.project_guid,
49346
49366
  projectSlug: d.project_slug,
49347
49367
  accountSlug: d.account_slug,
@@ -49461,7 +49481,7 @@ async function spawnSync2(cwd, timeoutMs, onSpawn) {
49461
49481
  } catch {
49462
49482
  }
49463
49483
  try {
49464
- unlinkSync8(join29(cwd, ".gipity", "sync.lock"));
49484
+ unlinkSync8(join30(cwd, ".gipity", "sync.lock"));
49465
49485
  } catch {
49466
49486
  }
49467
49487
  finish(() => reject(new Error(`timed out after ${Math.round(timeoutMs / 1e3)}s`)));
@@ -49906,7 +49926,7 @@ relayCommand.command("run").description("Run the background service").option("-v
49906
49926
  });
49907
49927
  relayCommand.command("stop").description("Stop the background service").option("--force", "Force-stop if it doesn't exit cleanly within 5s").action(async (opts) => {
49908
49928
  const pidPath = getDaemonPidPath();
49909
- if (!existsSync25(pidPath)) {
49929
+ if (!existsSync26(pidPath)) {
49910
49930
  console.log(muted("Background service isn't running."));
49911
49931
  return;
49912
49932
  }
@@ -50058,7 +50078,7 @@ relayCommand.command("revoke").description("Revoke and forget this device").acti
50058
50078
  } catch {
50059
50079
  }
50060
50080
  const pidPath = getDaemonPidPath();
50061
- if (existsSync25(pidPath)) {
50081
+ if (existsSync26(pidPath)) {
50062
50082
  const pid = parseInt(readFileSync29(pidPath, "utf-8").trim(), 10);
50063
50083
  if (pid && !isNaN(pid)) {
50064
50084
  try {
@@ -50072,7 +50092,7 @@ relayCommand.command("revoke").description("Revoke and forget this device").acti
50072
50092
  });
50073
50093
  relayCommand.command("log").description("Tail the service log").option("-n, --lines <n>", "How many lines to print (default 100)", "100").option("-f, --follow", "Follow the log like `tail -f`").action((opts) => {
50074
50094
  const path5 = RELAY_LOG_PATH;
50075
- if (!existsSync25(path5)) {
50095
+ if (!existsSync26(path5)) {
50076
50096
  console.log(muted("No log file yet. Start the service with `gipity relay run` (or install it)."));
50077
50097
  return;
50078
50098
  }
@@ -50254,17 +50274,17 @@ init_api();
50254
50274
  init_auth();
50255
50275
  init_utils();
50256
50276
  init_colors();
50257
- import { existsSync as existsSync26, rmSync as rmSync4, unlinkSync as unlinkSync10, readFileSync as readFileSync30, writeFileSync as writeFileSync20 } from "fs";
50277
+ import { existsSync as existsSync27, rmSync as rmSync4, unlinkSync as unlinkSync10, readFileSync as readFileSync30, writeFileSync as writeFileSync21 } from "fs";
50258
50278
  import { homedir as homedir20, platform as osPlatform4 } from "os";
50259
- import { join as join30, resolve as resolve19 } from "path";
50279
+ import { join as join31, resolve as resolve19 } from "path";
50260
50280
  init_agents();
50261
50281
  function removeInstallerPathLines() {
50262
50282
  if (osPlatform4() === "win32") return [];
50263
50283
  const marker = "# Added by the Gipity installer";
50264
50284
  const touched = [];
50265
50285
  for (const name of [".bashrc", ".zshrc", ".profile"]) {
50266
- const rc2 = join30(homedir20(), name);
50267
- if (!existsSync26(rc2)) continue;
50286
+ const rc2 = join31(homedir20(), name);
50287
+ if (!existsSync27(rc2)) continue;
50268
50288
  let text;
50269
50289
  try {
50270
50290
  text = readFileSync30(rc2, "utf-8");
@@ -50277,7 +50297,7 @@ function removeInstallerPathLines() {
50277
50297
  );
50278
50298
  if (kept.length === lines.length) continue;
50279
50299
  try {
50280
- writeFileSync20(rc2, kept.join("\n"));
50300
+ writeFileSync21(rc2, kept.join("\n"));
50281
50301
  touched.push(rc2);
50282
50302
  } catch {
50283
50303
  }
@@ -50323,7 +50343,7 @@ function removeServiceUnit() {
50323
50343
  const r = spawnSyncCommand(argv2[0], argv2.slice(1), { stdio: "ignore" });
50324
50344
  if (r.status !== 0) allOk = false;
50325
50345
  }
50326
- if (existsSync26(plan2.path)) {
50346
+ if (existsSync27(plan2.path)) {
50327
50347
  try {
50328
50348
  unlinkSync10(plan2.path);
50329
50349
  } catch {
@@ -50353,9 +50373,9 @@ var uninstallCommand = new Command("uninstall").description("Uninstall Gipity").
50353
50373
  const say = (line) => {
50354
50374
  if (!opts.json) console.log(line);
50355
50375
  };
50356
- const gipityDir = join30(homedir20(), ".gipity");
50357
- const launcherBin = join30(gipityDir, "launcher", "bin", "gipity");
50358
- const installedViaLauncher = existsSync26(launcherBin);
50376
+ const gipityDir = join31(homedir20(), ".gipity");
50377
+ const launcherBin = join31(gipityDir, "launcher", "bin", "gipity");
50378
+ const installedViaLauncher = existsSync27(launcherBin);
50359
50379
  say(`${bold("Gipity uninstall")} - this will:`);
50360
50380
  say(`\u2022 Stop the running relay daemon (if any)`);
50361
50381
  say(`\u2022 Remove the OS autostart service (launchd / systemd / Task Scheduler)`);
@@ -50397,7 +50417,7 @@ var uninstallCommand = new Command("uninstall").description("Uninstall Gipity").
50397
50417
  say(`${muted("No Gipity entries in any detected coding agent.")}`);
50398
50418
  }
50399
50419
  let gipityDirRemoved = false;
50400
- if (existsSync26(gipityDir)) {
50420
+ if (existsSync27(gipityDir)) {
50401
50421
  try {
50402
50422
  rmSync4(gipityDir, { recursive: true, force: true });
50403
50423
  gipityDirRemoved = true;
@@ -50975,7 +50995,7 @@ function resolveTarget(argv2, program3) {
50975
50995
 
50976
50996
  // src/trace.ts
50977
50997
  import { openSync as openSync5, writeSync, mkdirSync as mkdirSync20 } from "fs";
50978
- import { join as join31 } from "path";
50998
+ import { join as join32 } from "path";
50979
50999
  import { homedir as homedir21 } from "os";
50980
51000
  var TRACE_KEY = /* @__PURE__ */ Symbol.for("gipity.traceOutput");
50981
51001
  function installOutputTrace(label2) {
@@ -50987,10 +51007,10 @@ function installOutputTrace(label2) {
50987
51007
  existing.emit({ event: "reenter", label: label2 });
50988
51008
  return;
50989
51009
  }
50990
- const dir = join31(process.env.GIPITY_DIR || join31(homedir21(), ".gipity"), "trace");
51010
+ const dir = join32(process.env.GIPITY_DIR || join32(homedir21(), ".gipity"), "trace");
50991
51011
  mkdirSync20(dir, { recursive: true });
50992
51012
  const stamp = (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace("T", "_").replace(/:/g, "-");
50993
- const fd2 = openSync5(join31(dir, `${stamp}-pid${process.pid}.jsonl`), "a");
51013
+ const fd2 = openSync5(join32(dir, `${stamp}-pid${process.pid}.jsonl`), "a");
50994
51014
  const emit = (rec) => {
50995
51015
  try {
50996
51016
  writeSync(fd2, JSON.stringify({ t: (/* @__PURE__ */ new Date()).toISOString(), ...rec }) + "\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gipity",
3
- "version": "1.1.35",
3
+ "version": "1.1.36",
4
4
  "description": "The full-stack platform tuned for AI agents. Database, storage, auth, functions, deploy, and drop-in kits - all agent-tuned. Pair with Claude Code or use standalone.",
5
5
  "bin": {
6
6
  "gipity": "dist/updater/shim.js",