openpond 0.1.0 → 0.2.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.
Files changed (137) hide show
  1. package/README.md +4 -4
  2. package/dist/cache.d.ts +7 -10
  3. package/dist/chunks/{app-layer-XEYHFJHI.js → app-layer-F3CGXB33.js} +9 -7
  4. package/dist/chunks/{app-server-runtime-Y6MW4XCG.js → app-server-runtime-RHO5TFUC.js} +9 -7
  5. package/dist/chunks/{apps-GSXUDK6V.js → apps-L5XCL7QY.js} +12 -10
  6. package/dist/chunks/{chunk-J7PYGDRY.js → chunk-26AMV5ZI.js} +1 -1
  7. package/dist/chunks/{chunk-DNXBJZAU.js → chunk-3EB7I67T.js} +1 -1
  8. package/dist/chunks/{chunk-J3YDKJFD.js → chunk-3ELF4FXY.js} +19 -11
  9. package/dist/chunks/{chunk-HFPUR4CQ.js → chunk-3VEYNDHN.js} +10 -10
  10. package/dist/chunks/chunk-4KA25HUP.js +5648 -0
  11. package/dist/chunks/{chunk-EFET7LB7.js → chunk-6SMNG6YA.js} +62 -90
  12. package/dist/chunks/{chunk-N3TGCM7J.js → chunk-7RIGZB7N.js} +50 -37
  13. package/dist/chunks/{chunk-47EIAYI7.js → chunk-A6G3PFA5.js} +6 -4
  14. package/dist/chunks/{chunk-D7BO5Y5J.js → chunk-FJ2JGB2N.js} +31 -189
  15. package/dist/chunks/{chunk-WBAZFKC7.js → chunk-G65WAOJV.js} +2 -2
  16. package/dist/chunks/{chunk-CNTM26OW.js → chunk-K4TZEHAW.js} +16 -16
  17. package/dist/chunks/{chunk-AN2EYCN3.js → chunk-KCRCIQPD.js} +1 -5
  18. package/dist/chunks/chunk-OCBRPU2K.js +629 -0
  19. package/dist/chunks/{chunk-2JABRRNR.js → chunk-PS37DB5F.js} +1 -1
  20. package/dist/chunks/{chunk-TGM5IPYO.js → chunk-UZMVNKXM.js} +1 -1
  21. package/dist/chunks/{chunk-TZWAUV2L.js → chunk-VT6BLHMB.js} +10750 -1240
  22. package/dist/chunks/{chunk-5TKZBMQM.js → chunk-X6F4LBTQ.js} +102 -1
  23. package/dist/chunks/{chunk-6G6MDZLM.js → chunk-XA4KBDMY.js} +213 -999
  24. package/dist/chunks/chunk-ZNQEROWP.js +254 -0
  25. package/dist/chunks/{cli-L5VPOV6I.js → cli-D2MUUBEX.js} +7 -5
  26. package/dist/chunks/configuration-command-NR6JYIUD.js +187 -0
  27. package/dist/chunks/{continual-FYDKLCO7.js → continual-37CE4LLJ.js} +4 -4
  28. package/dist/chunks/{core-commands-MAN3CSJQ.js → core-commands-SWGIOZLW.js} +8 -6
  29. package/dist/chunks/database-DEYUZDIM.js +20 -0
  30. package/dist/chunks/{desktop-test-OE5SST2W.js → desktop-test-QOS7G5NE.js} +8 -6
  31. package/dist/chunks/dist-AKYCQNNF.js +187 -0
  32. package/dist/chunks/{extension-J3CIEDP4.js → extension-HJUJBQAD.js} +67 -730
  33. package/dist/chunks/{help-JNGJJFU5.js → help-J6PZ23IC.js} +1 -1
  34. package/dist/chunks/{opchat-6HEQJFLL.js → opchat-ABX5YBAT.js} +9 -7
  35. package/dist/chunks/{organizations-MWAPNOCK.js → organizations-CPNC47DO.js} +8 -6
  36. package/dist/chunks/{profile-P7HMONTZ.js → profile-Q3HB5MIO.js} +16 -14
  37. package/dist/chunks/{project-agent-2RAK7GAZ.js → project-agent-YHUBX4OR.js} +9 -7
  38. package/dist/chunks/{sandbox-command-G22CPFNK.js → sandbox-command-YFL5QTWX.js} +8 -6
  39. package/dist/chunks/{sandbox-template-S4WRUWJ6.js → sandbox-template-Z6P7NTNF.js} +12 -10
  40. package/dist/chunks/{src-BKBZ7WLO.js → src-7XEENEBI.js} +16 -12
  41. package/dist/chunks/{src-A6O6ZGIL.js → src-KBBIV4NT.js} +1338 -10969
  42. package/dist/chunks/{taskset-BMI7KOWP.js → taskset-2TRZBRRT.js} +1 -1
  43. package/dist/chunks/{teams-bot-5VBYEN7M.js → teams-bot-WD33NLH5.js} +7 -5
  44. package/dist/chunks/{training-UPVSGDTB.js → training-4XH37UZB.js} +1 -1
  45. package/dist/chunks/{workspaces-XM5BY3MO.js → workspaces-WG2MH2WE.js} +2 -2
  46. package/dist/cli.js +25 -17
  47. package/dist/client.d.ts +1 -1
  48. package/dist/config.d.ts +1 -0
  49. package/dist/index.js +20803 -15878
  50. package/dist/private-json-file.d.ts +1 -2
  51. package/dist/skills/openpond-desktop-harness/SKILL.md +1 -1
  52. package/dist/web/assets/App-C9aGkxVg.js +173 -0
  53. package/dist/web/assets/{AppDialog-CSXu5wRu.js → AppDialog-CK6_lg8c.js} +1 -1
  54. package/dist/web/assets/{AppTerminalPanel-y2bVL2RV.js → AppTerminalPanel-BKqgX4sd.js} +2 -2
  55. package/dist/web/assets/{AppsView-Bs9pwD2H.js → AppsView-B1NUuAIf.js} +1 -1
  56. package/dist/web/assets/{BrowserSidebar-CUgT5V1m.js → BrowserSidebar-DOvYxXeP.js} +1 -1
  57. package/dist/web/assets/{CartesianChart-DA85hfrP.js → CartesianChart-pOrYpzBr.js} +1 -1
  58. package/dist/web/assets/{CollaborationTabs-B8mlPhM3.js → CollaborationTabs-CgbR-MBJ.js} +1 -1
  59. package/dist/web/assets/{CommandMenu-EwUGCeC_.js → CommandMenu-CrIr4qUX.js} +1 -1
  60. package/dist/web/assets/{CommunityView-IHNq-YJz.js → CommunityView-CvAVQ_HZ.js} +1 -1
  61. package/dist/web/assets/{ComposerCreateImproveStrip-qOL2zA26.js → ComposerCreateImproveStrip-DybcKwwd.js} +1 -1
  62. package/dist/web/assets/GetStartedView-DVInkexN.js +1 -0
  63. package/dist/web/assets/{LabModelVersionDetailPage-BK0eoUlW.js → LabModelVersionDetailPage-NaaPElmM.js} +1 -1
  64. package/dist/web/assets/{LabSkillSidebar-CRPb4qBn.js → LabSkillSidebar-CuaYrtiu.js} +1 -1
  65. package/dist/web/assets/LabsRoute-BRR6x3SX.js +2 -0
  66. package/dist/web/assets/{MainChatThread-Cu6_UnNE.js → MainChatThread-BfkjCZB9.js} +2 -2
  67. package/dist/web/assets/MainPane-Gw-YK38n.js +8 -0
  68. package/dist/web/assets/{MarkdownText-N60tvLug.js → MarkdownText-DOlVQR8a.js} +1 -1
  69. package/dist/web/assets/{Messages-CYQFLElK.js → Messages-DMubppta.js} +6 -6
  70. package/dist/web/assets/{NativeSkillSidebar-zbx7WmOk.js → NativeSkillSidebar-DSFwZ-od.js} +1 -1
  71. package/dist/web/assets/{NewExperienceSwitcher-B0zev5Sx.js → NewExperienceSwitcher-Dj0ePIJ-.js} +1 -1
  72. package/dist/web/assets/{NewProjectDialog-lZlzrp-R.js → NewProjectDialog-B8NQV-Ji.js} +1 -1
  73. package/dist/web/assets/{OutputsPage-B4zYYUT5.js → OutputsPage-D_LDYTgV.js} +1 -1
  74. package/dist/web/assets/{ProjectsPage-97wgc84s.js → ProjectsPage-xjDYPc_W.js} +1 -1
  75. package/dist/web/assets/RightChatPanelStack-BktRQ9wg.js +1 -0
  76. package/dist/web/assets/{RightSidebarHomePanel-BUcWVJi-.js → RightSidebarHomePanel-j0VckZUu.js} +1 -1
  77. package/dist/web/assets/ScheduledWorkPage-1aT4bBY-.js +1 -0
  78. package/dist/web/assets/SettingsView-BSpuMDpv.js +9 -0
  79. package/dist/web/assets/SettingsView-CAH0vreE.css +1 -0
  80. package/dist/web/assets/{TeamChatView-Fj5_yjVE.js → TeamChatView-BPWJbDf1.js} +2 -2
  81. package/dist/web/assets/{TerminalOverlay-D2WBeJvp.js → TerminalOverlay-CrSwUk2d.js} +1 -1
  82. package/dist/web/assets/{TrainingCreationPanel-dYW_dh3M.js → TrainingCreationPanel-B4HMRwUg.js} +1 -1
  83. package/dist/web/assets/{TrainingDraftPanel-zeJWmmW6.js → TrainingDraftPanel-D4r1tN3I.js} +1 -1
  84. package/dist/web/assets/{UsageSettingsSection-B6SBqYuB.js → UsageSettingsSection-2aymqwIM.js} +1 -1
  85. package/dist/web/assets/{WorkSidebarPanel-BwbWKpOZ.js → WorkSidebarPanel-B0X0OiR6.js} +1 -1
  86. package/dist/web/assets/WorkspaceDiffPanel-Pg7GL0br.js +14 -0
  87. package/dist/web/assets/{WorkspaceEnvironmentMenu-D-3YGp06.js → WorkspaceEnvironmentMenu-OAfMEt7L.js} +3 -3
  88. package/dist/web/assets/{WorkspaceGitDialogs-BUbzUN4m.js → WorkspaceGitDialogs-YxcPH2Rq.js} +1 -1
  89. package/dist/web/assets/{WorkspaceMonacoEditor-CXPY7bBI.js → WorkspaceMonacoEditor-COKTiQZl.js} +3 -3
  90. package/dist/web/assets/{arrow-up-right-C7VWgGQP.js → arrow-up-right-_TX-awvK.js} +1 -1
  91. package/dist/web/assets/{chat-file-links-CqfMdhHQ.js → chat-file-links-CWLsRYvW.js} +1 -1
  92. package/dist/web/assets/chevron-up--mNnEqha.js +1 -0
  93. package/dist/web/assets/{clipboard-B-8k7mlT.js → clipboard-CyRSS8Sy.js} +1 -1
  94. package/dist/web/assets/{cloud-upload-CUVFzURz.js → cloud-upload-uBJBUYTy.js} +1 -1
  95. package/dist/web/assets/{cssMode-DYvfmqoL.js → cssMode-BrXSsZYs.js} +1 -1
  96. package/dist/web/assets/{folder-open-CnbcQIy8.js → folder-open-DktdZNW7.js} +1 -1
  97. package/dist/web/assets/{folder-plus-BOaLAKy4.js → folder-plus-DO06i9Vo.js} +1 -1
  98. package/dist/web/assets/{git-commit-horizontal-DQeHsooT.js → git-commit-horizontal-zFSIkPs7.js} +1 -1
  99. package/dist/web/assets/{htmlMode-BXEI-BVY.js → htmlMode-X9UMFkjt.js} +1 -1
  100. package/dist/web/assets/index-BEPmTPIA.js +1 -0
  101. package/dist/web/assets/{index-CGMb_VXm.css → index-ByQIHpc9.css} +1 -1
  102. package/dist/web/assets/{index-D-VK8mST.js → index-UOGdfLzi.js} +1 -1
  103. package/dist/web/assets/{info-DtzDuGLn.js → info-BEJXUqCD.js} +1 -1
  104. package/dist/web/assets/{jsonMode-Dosjh_hK.js → jsonMode-DIsB-j2E.js} +1 -1
  105. package/dist/web/assets/{lspLanguageFeatures-BNe-6FJA.js → lspLanguageFeatures-CmZ17KpA.js} +1 -1
  106. package/dist/web/assets/{minimize-2-DnxKN5oK.js → minimize-2-DumTpFtE.js} +1 -1
  107. package/dist/web/assets/{monaco.contribution-CfF-ajhi.js → monaco.contribution-D6w5PJji.js} +2 -2
  108. package/dist/web/assets/{monaco.contribution-ytyanGyj.js → monaco.contribution-DJ_NmcHu.js} +2 -2
  109. package/dist/web/assets/{monaco.contribution-CnkROzNv.js → monaco.contribution-LZEujgny.js} +2 -2
  110. package/dist/web/assets/{monaco.contribution-Dyns81H2.js → monaco.contribution-YVDfJcG4.js} +2 -2
  111. package/dist/web/assets/{play-B3o6IAQd.js → play-CLFeH7CU.js} +1 -1
  112. package/dist/web/assets/{python-B7zZ_9Z_.js → python-Djbda_qZ.js} +1 -1
  113. package/dist/web/assets/{refresh-cw-DSJZXa8S.js → refresh-cw-B4IpQ_7Q.js} +1 -1
  114. package/dist/web/assets/{save-iC-AXHN6.js → save-BbTHztnA.js} +1 -1
  115. package/dist/web/assets/{square-B2roZTxf.js → square-BJrVbmz6.js} +1 -1
  116. package/dist/web/assets/{toggleHighContrast-CjlV4YHK.js → toggleHighContrast-BopU5W9S.js} +1 -1
  117. package/dist/web/assets/{tsMode-XmKmSq0B.js → tsMode-CH_0_YDX.js} +1 -1
  118. package/dist/web/assets/{upload-BgHXNjfJ.js → upload-UumVeufu.js} +1 -1
  119. package/dist/web/assets/{useLocalAgentSchedules-CVJz0AMr.js → useLocalAgentSchedules-BRa23U7O.js} +1 -1
  120. package/dist/web/assets/{wifi-off-CneL8bDZ.js → wifi-off-BWJWivn6.js} +1 -1
  121. package/dist/web/assets/{workers-CT7VYBR5.js → workers-pTe8RvSI.js} +1 -1
  122. package/dist/web/assets/{yaml-CF8jchCz.js → yaml-DNLASORn.js} +1 -1
  123. package/dist/web/index.html +2 -2
  124. package/docs/command-reference.md +28 -2
  125. package/package.json +7 -5
  126. package/dist/chunks/chunk-P6JLLWMI.js +0 -238
  127. package/dist/web/assets/App-DfiCmBv6.js +0 -173
  128. package/dist/web/assets/GetStartedView-C2ypO0v7.js +0 -1
  129. package/dist/web/assets/LabsRoute-Bw-HD6QC.js +0 -2
  130. package/dist/web/assets/MainPane-k1iII9e9.js +0 -8
  131. package/dist/web/assets/RightChatPanelStack-I2znDCc7.js +0 -1
  132. package/dist/web/assets/ScheduledWorkPage-Bp-t0eVj.js +0 -1
  133. package/dist/web/assets/SettingsView-BRPrJuP5.css +0 -1
  134. package/dist/web/assets/SettingsView-C1xyn1Y4.js +0 -6
  135. package/dist/web/assets/WorkspaceDiffPanel-D9Kp0vFw.js +0 -14
  136. package/dist/web/assets/chevron-up-DD9Tei-Q.js +0 -1
  137. package/dist/web/assets/index-D-WCyNdJ.js +0 -1
@@ -30,6 +30,44 @@ import {
30
30
  import {
31
31
  yaml
32
32
  } from "./chunk-X7ZG4TSW.js";
33
+ import {
34
+ AppPreferencesSchema,
35
+ ChatModelRefSchema,
36
+ ChatProviderSchema,
37
+ CodexPermissionModeSchema,
38
+ CodexReasoningEffortSchema,
39
+ ContextCompactionPreferencesSchema,
40
+ DEFAULT_CHAT_PROVIDER,
41
+ DEFAULT_OPENPOND_COMMAND_ACCESS_MODE,
42
+ OpenPondCommandAccessModeSchema,
43
+ PERSONALIZATION_TEMPLATES,
44
+ PersonalizationSettingsSchema,
45
+ PersonalizationTemplateIdSchema,
46
+ ProviderIdSchema,
47
+ ProviderSettingsSchema,
48
+ ProviderSettingsUpdateSchema,
49
+ SUBAGENT_RUNTIME_EVENT_NAMES,
50
+ ServerStatusSchema,
51
+ SidebarSectionsCollapsedSchema,
52
+ SubagentDelegationModeSchema,
53
+ SubagentPreferencesSchema,
54
+ SubagentRoleIdSchema,
55
+ TrainingPreferencesSchema,
56
+ WorkspaceEditorPreferencesSchema,
57
+ WorkspaceKindSchema,
58
+ initializeHome,
59
+ readAccountConfiguration,
60
+ readCache,
61
+ updateAccountConfiguration,
62
+ withFileLock,
63
+ writeCache
64
+ } from "./chunk-4KA25HUP.js";
65
+ import {
66
+ getLocalRecord,
67
+ putLocalRecord,
68
+ resolveOpenPondHome,
69
+ storagePaths
70
+ } from "./chunk-ZNQEROWP.js";
33
71
  import {
34
72
  DEFAULT_OPENPOND_API_BASE_URL,
35
73
  DEFAULT_OPENPOND_WEB_BASE_URL,
@@ -257,97 +295,14 @@ function sha256Hex(contents) {
257
295
 
258
296
  // ../../packages/cloud/dist/profile/local-profile.js
259
297
  import { createRequire } from "node:module";
260
- import { createHash as createHash3, randomUUID as randomUUID3 } from "node:crypto";
298
+ import { createHash as createHash3, randomUUID as randomUUID2 } from "node:crypto";
261
299
  import { spawn as spawn2 } from "node:child_process";
262
300
  import { existsSync as existsSync4 } from "node:fs";
263
301
  import { cp, mkdir, readFile as readFile5, readdir as readdir2, rename, rm as rm2, symlink, writeFile as writeFile2 } from "node:fs/promises";
264
- import path8 from "node:path";
302
+ import path7 from "node:path";
265
303
 
266
304
  // ../../packages/cloud/dist/config.js
267
- import { promises as fs2 } from "node:fs";
268
- import path3 from "node:path";
269
-
270
- // ../../packages/cloud/dist/private-json-file.js
271
- import { randomUUID } from "node:crypto";
272
- import { promises as fs } from "node:fs";
273
- import os from "node:os";
274
305
  import path2 from "node:path";
275
- var LOCK_WAIT_TIMEOUT_MS = 1e4;
276
- var STALE_LOCK_MS = 6e4;
277
- function openPondConfigDirectory() {
278
- const override = process.env.OPENPOND_CONFIG_DIR?.trim();
279
- return override || path2.join(os.homedir(), ".openpond");
280
- }
281
- async function writePrivateJsonFile(filePath, value) {
282
- await withPrivateJsonFileLock(filePath, () => writePrivateJsonFileUnlocked(filePath, value));
283
- }
284
- async function updatePrivateJsonFile(filePath, fallback, update) {
285
- return withPrivateJsonFileLock(filePath, async () => {
286
- const current = await readJsonFile(filePath, fallback);
287
- const next = await update(current);
288
- await writePrivateJsonFileUnlocked(filePath, next);
289
- return next;
290
- });
291
- }
292
- async function writePrivateJsonFileUnlocked(filePath, value) {
293
- const directory = path2.dirname(filePath);
294
- await fs.mkdir(directory, { recursive: true, mode: 448 });
295
- await fs.chmod(directory, 448).catch(() => void 0);
296
- const temporaryPath = `${filePath}.${process.pid}.${randomUUID()}.tmp`;
297
- try {
298
- await fs.writeFile(temporaryPath, JSON.stringify(value, null, 2), {
299
- encoding: "utf-8",
300
- mode: 384
301
- });
302
- await fs.rename(temporaryPath, filePath);
303
- await fs.chmod(filePath, 384).catch(() => void 0);
304
- } finally {
305
- await fs.rm(temporaryPath, { force: true }).catch(() => void 0);
306
- }
307
- }
308
- async function withPrivateJsonFileLock(filePath, operation) {
309
- const directory = path2.dirname(filePath);
310
- await fs.mkdir(directory, { recursive: true, mode: 448 });
311
- await fs.chmod(directory, 448).catch(() => void 0);
312
- const lockPath = `${filePath}.lock`;
313
- const deadline = Date.now() + LOCK_WAIT_TIMEOUT_MS;
314
- while (true) {
315
- try {
316
- await fs.mkdir(lockPath, { mode: 448 });
317
- break;
318
- } catch (error) {
319
- if (error.code !== "EEXIST")
320
- throw error;
321
- await removeStaleLock(lockPath);
322
- if (Date.now() >= deadline)
323
- throw new Error(`Timed out waiting for private file lock: ${filePath}`);
324
- await new Promise((resolve) => setTimeout(resolve, 20 + Math.floor(Math.random() * 30)));
325
- }
326
- }
327
- try {
328
- return await operation();
329
- } finally {
330
- await fs.rm(lockPath, { recursive: true, force: true }).catch(() => void 0);
331
- }
332
- }
333
- async function readJsonFile(filePath, fallback) {
334
- try {
335
- return JSON.parse(await fs.readFile(filePath, "utf8"));
336
- } catch (error) {
337
- if (error.code === "ENOENT")
338
- return fallback();
339
- throw error;
340
- }
341
- }
342
- async function removeStaleLock(lockPath) {
343
- const stats = await fs.stat(lockPath).catch(() => null);
344
- if (stats && Date.now() - stats.mtimeMs > STALE_LOCK_MS) {
345
- await fs.rm(lockPath, { recursive: true, force: true });
346
- }
347
- }
348
-
349
- // ../../packages/cloud/dist/config.js
350
- var GLOBAL_CONFIG_FILENAME = "config.json";
351
306
  var DEFAULT_ACCOUNT_HANDLE = "default";
352
307
  var ACCOUNT_SCOPED_KEYS = [
353
308
  "apiKey",
@@ -358,22 +313,6 @@ var ACCOUNT_SCOPED_KEYS = [
358
313
  "appId",
359
314
  "conversationId"
360
315
  ];
361
- function getGlobalConfigPath() {
362
- return path3.join(openPondConfigDirectory(), GLOBAL_CONFIG_FILENAME);
363
- }
364
- async function loadConfigFile(filePath) {
365
- try {
366
- const raw = await fs2.readFile(filePath, "utf-8");
367
- return JSON.parse(raw);
368
- } catch (error) {
369
- if (error.code === "ENOENT")
370
- return {};
371
- if (error instanceof SyntaxError) {
372
- throw new Error(`OpenPond config is malformed JSON: ${filePath}`, { cause: error });
373
- }
374
- throw error;
375
- }
376
- }
377
316
  function hasOwn(value, key) {
378
317
  return Object.prototype.hasOwnProperty.call(value, key);
379
318
  }
@@ -500,7 +439,7 @@ function sanitizeLocalOpenPondProfile(value) {
500
439
  return [];
501
440
  const rawEntry = value2;
502
441
  const source = rawEntry.source === "github" || rawEntry.source === "openpond_git" ? rawEntry.source : "local";
503
- const repositoryId = typeof rawEntry.repositoryId === "string" && rawEntry.repositoryId.trim() ? rawEntry.repositoryId.trim() : path3.resolve(entry.repoPath);
442
+ const repositoryId = typeof rawEntry.repositoryId === "string" && rawEntry.repositoryId.trim() ? rawEntry.repositoryId.trim() : path2.resolve(entry.repoPath);
504
443
  return [{
505
444
  source,
506
445
  repositoryId,
@@ -933,26 +872,19 @@ function applyTopLevelPatch(global, source) {
933
872
  }
934
873
  }
935
874
  }
936
- async function writeGlobalConfig(next) {
937
- await writePrivateJsonFile(getGlobalConfigPath(), next);
938
- }
939
875
  async function updateGlobalConfig(update) {
940
- try {
941
- return await updatePrivateJsonFile(getGlobalConfigPath(), () => ({}), (raw) => {
942
- const current = normalizeGlobalConfig(raw);
943
- update(current);
944
- return current;
945
- });
946
- } catch (error) {
947
- if (error instanceof SyntaxError) {
948
- throw new Error(`OpenPond config is malformed JSON: ${getGlobalConfigPath()}`, { cause: error });
949
- }
950
- throw error;
951
- }
876
+ const home = resolveOpenPondHome();
877
+ await initializeHome(home);
878
+ return await updateAccountConfiguration(home, (raw) => {
879
+ const current = normalizeGlobalConfig(raw);
880
+ update(current);
881
+ return current;
882
+ });
952
883
  }
953
884
  async function loadGlobalConfig() {
954
- const raw = await loadConfigFile(getGlobalConfigPath());
955
- return normalizeGlobalConfig(raw);
885
+ const home = resolveOpenPondHome();
886
+ await initializeHome(home);
887
+ return normalizeGlobalConfig(await readAccountConfiguration(home));
956
888
  }
957
889
  async function listConfiguredProfiles() {
958
890
  const global = await loadGlobalConfig();
@@ -1031,12 +963,6 @@ async function saveProfileApiKey(input) {
1031
963
  }
1032
964
  return saved;
1033
965
  }
1034
- async function saveConfig(next) {
1035
- const global = normalizeGlobalConfig(next);
1036
- applyTopLevelPatch(global, next);
1037
- applyAccountPatch(global, next, { undefinedDeletes: true });
1038
- await writeGlobalConfig(global);
1039
- }
1040
966
  async function saveGlobalConfig(next) {
1041
967
  await updateGlobalConfig((current) => {
1042
968
  applyTopLevelPatch(current, next);
@@ -1104,7 +1030,7 @@ function emptyProfileSummary(error = null) {
1104
1030
  // ../../packages/cloud/dist/profile/profile-catalog.js
1105
1031
  import { existsSync as existsSync2 } from "node:fs";
1106
1032
  import { readFile as readFile2, stat as stat2 } from "node:fs/promises";
1107
- import path4 from "node:path";
1033
+ import path3 from "node:path";
1108
1034
  var AGENT_MANIFEST_PATH = ".openpond/agent-manifest.json";
1109
1035
  var ACTION_REGISTRY_PATH = ".openpond/action-registry.json";
1110
1036
  var SOURCE_UPLOAD_METADATA_PATH = ".openpond/source-upload-metadata.json";
@@ -1163,10 +1089,10 @@ async function loadProfileActionCatalogForSources(sources) {
1163
1089
  }
1164
1090
  async function loadProfileActionCatalogSource(source) {
1165
1091
  const sourcePath = source.sourcePath;
1166
- const manifestPath = path4.join(sourcePath, AGENT_MANIFEST_PATH);
1167
- const registryPath = path4.join(sourcePath, ACTION_REGISTRY_PATH);
1168
- const sourceUploadMetadataPath = path4.join(sourcePath, SOURCE_UPLOAD_METADATA_PATH);
1169
- const agentPackageOriginPath = path4.join(sourcePath, AGENT_PACKAGE_ORIGIN_PATH);
1092
+ const manifestPath = path3.join(sourcePath, AGENT_MANIFEST_PATH);
1093
+ const registryPath = path3.join(sourcePath, ACTION_REGISTRY_PATH);
1094
+ const sourceUploadMetadataPath = path3.join(sourcePath, SOURCE_UPLOAD_METADATA_PATH);
1095
+ const agentPackageOriginPath = path3.join(sourcePath, AGENT_PACKAGE_ORIGIN_PATH);
1170
1096
  try {
1171
1097
  const manifest = await readJsonIfExists(manifestPath);
1172
1098
  const registry = await readJsonIfExists(registryPath);
@@ -1502,10 +1428,10 @@ function text3(value) {
1502
1428
 
1503
1429
  // ../../packages/cloud/dist/profile/profile-git.js
1504
1430
  import { spawn } from "node:child_process";
1505
- import { randomUUID as randomUUID2 } from "node:crypto";
1431
+ import { randomUUID } from "node:crypto";
1506
1432
  import { existsSync as existsSync3 } from "node:fs";
1507
1433
  import { readFile as readFile3, rm, writeFile } from "node:fs/promises";
1508
- import path5 from "node:path";
1434
+ import path4 from "node:path";
1509
1435
  var PROFILE_REPO_GITIGNORE = [
1510
1436
  "**/node_modules/",
1511
1437
  "**/.bun/",
@@ -1519,13 +1445,13 @@ var PROFILE_REPO_GITIGNORE = [
1519
1445
  ""
1520
1446
  ].join("\n");
1521
1447
  async function ensureProfileGitRepo(repoPath) {
1522
- if (!existsSync3(path5.join(repoPath, ".git"))) {
1448
+ if (!existsSync3(path4.join(repoPath, ".git"))) {
1523
1449
  const init = await runGitCommand(repoPath, ["init", "-b", "main"]);
1524
1450
  if (init.code !== 0) {
1525
1451
  throw new Error(gitFailureMessage("git init", init));
1526
1452
  }
1527
1453
  }
1528
- const gitignorePath = path5.join(repoPath, ".gitignore");
1454
+ const gitignorePath = path4.join(repoPath, ".gitignore");
1529
1455
  if (!existsSync3(gitignorePath)) {
1530
1456
  await writeFile(gitignorePath, PROFILE_REPO_GITIGNORE, "utf8");
1531
1457
  } else {
@@ -1563,7 +1489,7 @@ async function ensureProfileGitignoreRules(gitignorePath) {
1563
1489
  `, "utf8");
1564
1490
  }
1565
1491
  async function loadProfileGitState(repoPath) {
1566
- if (!existsSync3(path5.join(repoPath, ".git"))) {
1492
+ if (!existsSync3(path4.join(repoPath, ".git"))) {
1567
1493
  return {
1568
1494
  isRepo: false,
1569
1495
  branch: null,
@@ -1674,7 +1600,7 @@ async function commitProfileBenchmarkRef(input) {
1674
1600
  if (new Set(files.map((file) => file.path)).size !== files.length) {
1675
1601
  throw new Error("A Profile benchmark commit cannot contain duplicate paths.");
1676
1602
  }
1677
- const indexPath = path5.join(input.repoPath, ".git", `openpond-benchmark-index-${randomUUID2()}`);
1603
+ const indexPath = path4.join(input.repoPath, ".git", `openpond-benchmark-index-${randomUUID()}`);
1678
1604
  const env = {
1679
1605
  ...process.env,
1680
1606
  GIT_INDEX_FILE: indexPath,
@@ -1828,18 +1754,20 @@ async function requireGitSuccess(repoPath, args, label, options = {}) {
1828
1754
 
1829
1755
  // ../../packages/cloud/dist/profile/profile-source-upload.js
1830
1756
  import { stat as stat3 } from "node:fs/promises";
1831
- import path7 from "node:path";
1757
+ import path6 from "node:path";
1832
1758
 
1833
1759
  // ../../packages/cloud/dist/profile/source-upload-cache.js
1834
1760
  import { createHash as createHash2 } from "node:crypto";
1835
1761
  import { readFile as readFile4 } from "node:fs/promises";
1836
- import path6 from "node:path";
1762
+ import path5 from "node:path";
1837
1763
  var SOURCE_UPLOAD_CACHE_PATH = ".openpond/source-upload-cache.json";
1838
1764
  var SOURCE_UPLOAD_CACHE_SCHEMA = "openpond.source-upload-cache.v1";
1839
1765
  async function readSourceUploadCache(rootPath) {
1840
1766
  try {
1841
- const raw = await readFile4(path6.join(rootPath, SOURCE_UPLOAD_CACHE_PATH), "utf8");
1842
- const parsed = JSON.parse(raw);
1767
+ const stored = await readCache(resolveOpenPondHome(), "source-upload.v1", sourceScope(rootPath));
1768
+ const parsed = stored?.payload;
1769
+ if (!parsed)
1770
+ return /* @__PURE__ */ new Map();
1843
1771
  if (parsed.schema !== SOURCE_UPLOAD_CACHE_SCHEMA || !parsed.entries) {
1844
1772
  return /* @__PURE__ */ new Map();
1845
1773
  }
@@ -1855,9 +1783,11 @@ async function readSourceUploadCache(rootPath) {
1855
1783
  }
1856
1784
  }
1857
1785
  async function materializeSourceUploadFile(file, cache) {
1858
- const cacheKey = cacheKeyForFile(file);
1786
+ const contents = await readFile4(file.absolutePath);
1787
+ const sha256 = createHash2("sha256").update(contents).digest("hex");
1788
+ const cacheKey = cacheKeyForFile({ ...file, sha256 });
1859
1789
  const cached = cache.get(cacheKey);
1860
- if (cached) {
1790
+ if (cached && cached.sha256 === sha256 && createHash2("sha256").update(Buffer.from(cached.contentsBase64, "base64")).digest("hex") === sha256) {
1861
1791
  return {
1862
1792
  file,
1863
1793
  entry: {
@@ -1868,7 +1798,6 @@ async function materializeSourceUploadFile(file, cache) {
1868
1798
  sha256: cached.sha256
1869
1799
  };
1870
1800
  }
1871
- const contents = await readFile4(file.absolutePath);
1872
1801
  return {
1873
1802
  file,
1874
1803
  entry: {
@@ -1876,7 +1805,7 @@ async function materializeSourceUploadFile(file, cache) {
1876
1805
  type: "file",
1877
1806
  contentsBase64: contents.toString("base64")
1878
1807
  },
1879
- sha256: createHash2("sha256").update(contents).digest("hex")
1808
+ sha256
1880
1809
  };
1881
1810
  }
1882
1811
  async function writeSourceUploadCache(rootPath, files) {
@@ -1892,15 +1821,14 @@ async function writeSourceUploadCache(rootPath, files) {
1892
1821
  };
1893
1822
  entries[cacheKeyForFile(cacheEntry)] = cacheEntry;
1894
1823
  }
1895
- const cachePath = path6.join(rootPath, SOURCE_UPLOAD_CACHE_PATH);
1896
- await writePrivateJsonFile(cachePath, {
1824
+ await writeCache(resolveOpenPondHome(), "source-upload.v1", sourceScope(rootPath), {
1897
1825
  schema: SOURCE_UPLOAD_CACHE_SCHEMA,
1898
1826
  generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
1899
1827
  entries
1900
1828
  });
1901
1829
  }
1902
1830
  function cacheKeyForFile(input) {
1903
- return `${input.path}\0${input.size}\0${input.mtimeMs}\0${input.ctimeMs}`;
1831
+ return `${input.path}\0${input.sha256}`;
1904
1832
  }
1905
1833
  function isCacheEntry(value) {
1906
1834
  if (!value || typeof value !== "object" || Array.isArray(value))
@@ -1908,6 +1836,9 @@ function isCacheEntry(value) {
1908
1836
  const record2 = value;
1909
1837
  return typeof record2.path === "string" && typeof record2.size === "number" && typeof record2.mtimeMs === "number" && typeof record2.ctimeMs === "number" && typeof record2.sha256 === "string" && typeof record2.contentsBase64 === "string";
1910
1838
  }
1839
+ function sourceScope(rootPath) {
1840
+ return createHash2("sha256").update(path5.resolve(rootPath)).digest("hex");
1841
+ }
1911
1842
 
1912
1843
  // ../../packages/cloud/dist/profile/profile-source-upload.js
1913
1844
  var PROFILE_SOURCE_UPLOAD_MAX_FILES = 1500;
@@ -1940,8 +1871,8 @@ async function collectProfileSourceUploadEntries(repoPath) {
1940
1871
  throw new Error(`Too many profile source files to upload: ${sourcePaths.length} > ${PROFILE_SOURCE_UPLOAD_MAX_FILES}`);
1941
1872
  }
1942
1873
  const filesToUpload = (await mapWithConcurrency(sourcePaths, PROFILE_SOURCE_UPLOAD_CONCURRENCY, async (sourcePath) => {
1943
- const absolutePath = path7.resolve(repoPath, sourcePath);
1944
- const relative = path7.relative(repoPath, absolutePath).replace(/\\/g, "/");
1874
+ const absolutePath = path6.resolve(repoPath, sourcePath);
1875
+ const relative = path6.relative(repoPath, absolutePath).replace(/\\/g, "/");
1945
1876
  if (!isSafeProfileSourcePath(relative)) {
1946
1877
  throw new Error(`Profile source path escapes repo: ${sourcePath}`);
1947
1878
  }
@@ -1993,7 +1924,7 @@ async function mapWithConcurrency(items, concurrency, mapper) {
1993
1924
  return results;
1994
1925
  }
1995
1926
  function isSafeProfileSourcePath(filePath) {
1996
- return filePath.length > 0 && !filePath.includes("\0") && !path7.isAbsolute(filePath) && !filePath.split(/[\\/]+/).some((part) => !part || part === "." || part === "..");
1927
+ return filePath.length > 0 && !filePath.includes("\0") && !path6.isAbsolute(filePath) && !filePath.split(/[\\/]+/).some((part) => !part || part === "." || part === "..");
1997
1928
  }
1998
1929
  function shouldSkipProfileSourcePath(filePath) {
1999
1930
  return filePath.split(/[\\/]+/).some((segment, index, segments) => {
@@ -2139,11 +2070,11 @@ function mergeProfileRepoManifestEntry(existing, profilePath) {
2139
2070
  function mergeActiveLocalProfileConfig(existing, repoPath, profile) {
2140
2071
  const previousEntries = profileConfigEntries(existing);
2141
2072
  if (existing) {
2142
- const previousIndex = previousEntries.findIndex((entry) => path8.resolve(entry.repoPath) === path8.resolve(existing.repoPath) && entry.profile === existing.profile);
2073
+ const previousIndex = previousEntries.findIndex((entry) => path7.resolve(entry.repoPath) === path7.resolve(existing.repoPath) && entry.profile === existing.profile);
2143
2074
  const previousEntry = {
2144
2075
  source: previousEntries[previousIndex]?.source ?? "local",
2145
- repositoryId: previousEntries[previousIndex]?.repositoryId ?? path8.resolve(existing.repoPath),
2146
- repoPath: path8.resolve(existing.repoPath),
2076
+ repositoryId: previousEntries[previousIndex]?.repositoryId ?? path7.resolve(existing.repoPath),
2077
+ repoPath: path7.resolve(existing.repoPath),
2147
2078
  profile: existing.profile,
2148
2079
  ...existing.lastCheck ? { lastCheck: existing.lastCheck } : {},
2149
2080
  ...existing.lastPush ? { lastPush: existing.lastPush } : {}
@@ -2153,17 +2084,17 @@ function mergeActiveLocalProfileConfig(existing, repoPath, profile) {
2153
2084
  else
2154
2085
  previousEntries.push(previousEntry);
2155
2086
  }
2156
- const targetIndex = previousEntries.findIndex((entry) => path8.resolve(entry.repoPath) === path8.resolve(repoPath) && entry.profile === profile);
2087
+ const targetIndex = previousEntries.findIndex((entry) => path7.resolve(entry.repoPath) === path7.resolve(repoPath) && entry.profile === profile);
2157
2088
  const target = targetIndex >= 0 ? previousEntries[targetIndex] : {
2158
2089
  source: "local",
2159
- repositoryId: path8.resolve(repoPath),
2160
- repoPath: path8.resolve(repoPath),
2090
+ repositoryId: path7.resolve(repoPath),
2091
+ repoPath: path7.resolve(repoPath),
2161
2092
  profile
2162
2093
  };
2163
2094
  if (targetIndex < 0)
2164
2095
  previousEntries.push(target);
2165
2096
  const next = {
2166
- repoPath: path8.resolve(repoPath),
2097
+ repoPath: path7.resolve(repoPath),
2167
2098
  profile,
2168
2099
  mode: "local",
2169
2100
  profiles: previousEntries,
@@ -2176,11 +2107,11 @@ function profileConfigEntries(config) {
2176
2107
  if (!config)
2177
2108
  return [];
2178
2109
  const configured = config.profiles?.map((entry) => ({ ...entry })) ?? [];
2179
- if (!configured.some((entry) => path8.resolve(entry.repoPath) === path8.resolve(config.repoPath) && entry.profile === config.profile)) {
2110
+ if (!configured.some((entry) => path7.resolve(entry.repoPath) === path7.resolve(config.repoPath) && entry.profile === config.profile)) {
2180
2111
  configured.push({
2181
2112
  source: "local",
2182
- repositoryId: path8.resolve(config.repoPath),
2183
- repoPath: path8.resolve(config.repoPath),
2113
+ repositoryId: path7.resolve(config.repoPath),
2114
+ repoPath: path7.resolve(config.repoPath),
2184
2115
  profile: config.profile,
2185
2116
  ...config.lastCheck ? { lastCheck: config.lastCheck } : {},
2186
2117
  ...config.lastPush ? { lastPush: config.lastPush } : {}
@@ -2190,7 +2121,7 @@ function profileConfigEntries(config) {
2190
2121
  }
2191
2122
  var require2 = createRequire(import.meta.url);
2192
2123
  function defaultLocalProfileRepoPath() {
2193
- return path8.join(openPondConfigDirectory(), "profiles", "default-repo");
2124
+ return path7.join(resolveOpenPondHome(), "library", "profiles", "default-repo");
2194
2125
  }
2195
2126
  function emptyProfileState(error = null) {
2196
2127
  return {
@@ -2216,14 +2147,14 @@ function emptyProfileState(error = null) {
2216
2147
  };
2217
2148
  }
2218
2149
  async function initLocalProfileRepo(input = {}) {
2219
- const repoPath = path8.resolve(input.repoPath ?? defaultLocalProfileRepoPath());
2150
+ const repoPath = path7.resolve(input.repoPath ?? defaultLocalProfileRepoPath());
2220
2151
  const profile = normalizeProfileName(input.profile);
2221
- const profilePath = path8.join("profiles", profile);
2222
- const profileSourcePath2 = path8.join(repoPath, profilePath);
2152
+ const profilePath = path7.join("profiles", profile);
2153
+ const profileSourcePath2 = path7.join(repoPath, profilePath);
2223
2154
  const template = input.template ?? "blank-agent";
2224
2155
  const blankProfile = template === "blank-profile";
2225
2156
  await mkdir(repoPath, { recursive: true });
2226
- const manifestAlreadyExists = existsSync4(path8.join(repoPath, PROFILE_REPO_MANIFEST));
2157
+ const manifestAlreadyExists = existsSync4(path7.join(repoPath, PROFILE_REPO_MANIFEST));
2227
2158
  const manifest = await readProfileManifest(repoPath).catch(() => defaultProfileManifest(profile, profilePath));
2228
2159
  if (blankProfile && manifestAlreadyExists && manifest.profiles[profile]) {
2229
2160
  throw new Error(`Profile "${profile}" already exists in ${repoPath}.`);
@@ -2250,7 +2181,7 @@ async function initLocalProfileRepo(input = {}) {
2250
2181
  return loadOpenPondProfileState();
2251
2182
  }
2252
2183
  async function loadLocalProfileRepo(repoPathInput, profileInput, identity) {
2253
- const repoPath = path8.resolve(repoPathInput);
2184
+ const repoPath = path7.resolve(repoPathInput);
2254
2185
  const manifest = await readProfileManifest(repoPath);
2255
2186
  const profile = normalizeProfileName(profileInput ?? manifest.defaultProfile);
2256
2187
  profileSourcePath(manifest, repoPath, profile);
@@ -2261,7 +2192,7 @@ async function loadLocalProfileRepo(repoPathInput, profileInput, identity) {
2261
2192
  return loadOpenPondProfileState();
2262
2193
  }
2263
2194
  async function registerLocalProfileRepo(repoPathInput, profileInput, identity) {
2264
- const repoPath = path8.resolve(repoPathInput);
2195
+ const repoPath = path7.resolve(repoPathInput);
2265
2196
  const manifest = await readProfileManifest(repoPath);
2266
2197
  const profile = normalizeProfileName(profileInput ?? manifest.defaultProfile);
2267
2198
  profileSourcePath(manifest, repoPath, profile);
@@ -2285,7 +2216,7 @@ async function registerLocalProfileRepo(repoPathInput, profileInput, identity) {
2285
2216
  function applyProfileIdentity(config, repoPath, profile, identity) {
2286
2217
  if (!identity)
2287
2218
  return;
2288
- config.profiles = profileConfigEntries(config).map((entry) => path8.resolve(entry.repoPath) === repoPath && entry.profile === profile ? {
2219
+ config.profiles = profileConfigEntries(config).map((entry) => path7.resolve(entry.repoPath) === repoPath && entry.profile === profile ? {
2289
2220
  ...entry,
2290
2221
  source: identity.source,
2291
2222
  repositoryId: identity.repositoryId
@@ -2331,15 +2262,15 @@ async function installAgentPackageIntoActiveProfile(input) {
2331
2262
  const active = await requireActiveLocalProfile();
2332
2263
  const profileSourcePath2 = active.state.sourcePath;
2333
2264
  await ensureProfileDependencies(profileSourcePath2);
2334
- const agentsRoot = path8.join(profileSourcePath2, "agents");
2265
+ const agentsRoot = path7.join(profileSourcePath2, "agents");
2335
2266
  await mkdir(agentsRoot, { recursive: true });
2336
- const target = path8.join(agentsRoot, agentPackage.agentId);
2267
+ const target = path7.join(agentsRoot, agentPackage.agentId);
2337
2268
  const targetExists = existsSync4(target);
2338
2269
  if (targetExists && input.overwrite !== true) {
2339
2270
  throw new Error(`Agent "${agentPackage.agentId}" already exists. Confirm replacement to install this version.`);
2340
2271
  }
2341
- const temporary = path8.join(agentsRoot, `.${agentPackage.agentId}.${randomUUID3()}.installing`);
2342
- const backup = path8.join(agentsRoot, `.${agentPackage.agentId}.${randomUUID3()}.backup`);
2272
+ const temporary = path7.join(agentsRoot, `.${agentPackage.agentId}.${randomUUID2()}.installing`);
2273
+ const backup = path7.join(agentsRoot, `.${agentPackage.agentId}.${randomUUID2()}.backup`);
2343
2274
  const manifest = await readProfileManifest(active.config.repoPath);
2344
2275
  const originalManifest = JSON.stringify(manifest);
2345
2276
  let movedExisting = false;
@@ -2397,7 +2328,7 @@ async function loadOpenPondProfileState() {
2397
2328
  function openPondProfileRef(input) {
2398
2329
  return {
2399
2330
  source: input.source ?? "local",
2400
- repositoryId: input.repositoryId?.trim() || path8.resolve(input.repoPath),
2331
+ repositoryId: input.repositoryId?.trim() || path7.resolve(input.repoPath),
2401
2332
  profileId: input.profile
2402
2333
  };
2403
2334
  }
@@ -2426,8 +2357,8 @@ async function loadOpenPondProfileLibrary() {
2426
2357
  lastUsed: openPondProfileRef({
2427
2358
  repoPath: active.repoPath,
2428
2359
  profile: active.profile,
2429
- source: profileConfigEntries(active).find((entry) => path8.resolve(entry.repoPath) === path8.resolve(active.repoPath) && entry.profile === active.profile)?.source,
2430
- repositoryId: profileConfigEntries(active).find((entry) => path8.resolve(entry.repoPath) === path8.resolve(active.repoPath) && entry.profile === active.profile)?.repositoryId
2360
+ source: profileConfigEntries(active).find((entry) => path7.resolve(entry.repoPath) === path7.resolve(active.repoPath) && entry.profile === active.profile)?.source,
2361
+ repositoryId: profileConfigEntries(active).find((entry) => path7.resolve(entry.repoPath) === path7.resolve(active.repoPath) && entry.profile === active.profile)?.repositoryId
2431
2362
  }),
2432
2363
  profiles
2433
2364
  };
@@ -2467,8 +2398,8 @@ async function removeOpenPondProfile(ref) {
2467
2398
  await saveGlobalConfig({ openpondProfile: null });
2468
2399
  return { lastUsed: null, profiles: [] };
2469
2400
  }
2470
- const currentRemoved = path8.resolve(config.repoPath) === path8.resolve(profileConfigEntries(config).find((candidate) => candidate.source === ref.source && candidate.repositoryId === ref.repositoryId && candidate.profile === ref.profileId)?.repoPath ?? "") && config.profile === ref.profileId;
2471
- const next = currentRemoved ? remaining[0] : remaining.find((entry) => path8.resolve(entry.repoPath) === path8.resolve(config.repoPath) && entry.profile === config.profile) ?? remaining[0];
2401
+ const currentRemoved = path7.resolve(config.repoPath) === path7.resolve(profileConfigEntries(config).find((candidate) => candidate.source === ref.source && candidate.repositoryId === ref.repositoryId && candidate.profile === ref.profileId)?.repoPath ?? "") && config.profile === ref.profileId;
2402
+ const next = currentRemoved ? remaining[0] : remaining.find((entry) => path7.resolve(entry.repoPath) === path7.resolve(config.repoPath) && entry.profile === config.profile) ?? remaining[0];
2472
2403
  await saveGlobalConfig({
2473
2404
  openpondProfile: {
2474
2405
  repoPath: next.repoPath,
@@ -2519,7 +2450,7 @@ async function loadOpenPondProfileStateForConfig(active) {
2519
2450
  repoPath: active.repoPath,
2520
2451
  activeProfile: active.profile,
2521
2452
  sourcePath,
2522
- manifestPath: path8.join(active.repoPath, PROFILE_REPO_MANIFEST),
2453
+ manifestPath: path7.join(active.repoPath, PROFILE_REPO_MANIFEST),
2523
2454
  agents,
2524
2455
  skills: skillResult.skills,
2525
2456
  evals,
@@ -2543,7 +2474,7 @@ async function loadOpenPondProfileStateForConfig(active) {
2543
2474
  repoPath: active.repoPath,
2544
2475
  activeProfile: active.profile,
2545
2476
  sourcePath: null,
2546
- manifestPath: path8.join(active.repoPath, PROFILE_REPO_MANIFEST),
2477
+ manifestPath: path7.join(active.repoPath, PROFILE_REPO_MANIFEST),
2547
2478
  agents: [],
2548
2479
  skills: [],
2549
2480
  evals: [],
@@ -2577,11 +2508,11 @@ async function runProfileSdkCommand(input) {
2577
2508
  const active = await requireActiveLocalProfile();
2578
2509
  const requestedRunArgs = input.command === "run" ? input.args ?? [] : [];
2579
2510
  const selectedAction = input.command === "run" ? active.state.actionCatalog.find((action) => action.id === requestedRunArgs[0]) : null;
2580
- const cwd = path8.resolve(input.cwd ?? selectedAction?.sourcePath ?? active.state.sourcePath);
2511
+ const cwd = path7.resolve(input.cwd ?? selectedAction?.sourcePath ?? active.state.sourcePath);
2581
2512
  const runArgs = input.command === "run" ? runCommandArgs(cwd, input.args ?? [], selectedAction?.sourceActionId ?? null) : null;
2582
2513
  if (input.command === "run" && runArgs) {
2583
2514
  const actionId = runArgs[0];
2584
- const catalog = path8.resolve(active.state.sourcePath) === cwd ? {
2515
+ const catalog = path7.resolve(active.state.sourcePath) === cwd ? {
2585
2516
  actionCatalog: active.state.actionCatalog,
2586
2517
  sourceSetupRequirements: active.state.sourceSetupRequirements
2587
2518
  } : await loadProfileActionCatalog(cwd);
@@ -2608,7 +2539,7 @@ async function runProfileSdkCommand(input) {
2608
2539
  return result;
2609
2540
  }
2610
2541
  async function runAgentSdkProjectCommand(input) {
2611
- const cwd = path8.resolve(input.cwd);
2542
+ const cwd = path7.resolve(input.cwd);
2612
2543
  const cli = resolveAgentSdkCliLaunch();
2613
2544
  const args = input.command === "run" ? [...cli.args, input.command, ...input.args ?? []] : [...cli.args, input.command, "--cwd", cwd, ...input.args ?? []];
2614
2545
  const result = await spawnCommand(cli.command, args, {
@@ -2657,7 +2588,7 @@ async function runProfileCheck(kind) {
2657
2588
  async function runProfileCheckForSource(input) {
2658
2589
  const args = input.command === "inspect" || input.command === "validate" || input.command === "eval" ? ["--json"] : [];
2659
2590
  if (input.sourceCount > 1) {
2660
- const label = path8.relative(input.profileSourcePath, input.source.sourcePath) || ".";
2591
+ const label = path7.relative(input.profileSourcePath, input.source.sourcePath) || ".";
2661
2592
  console.log(`
2662
2593
  [profile:${input.source.agentId}] ${input.command} ${label}`);
2663
2594
  }
@@ -2698,7 +2629,7 @@ async function saveProfilePushStatus(status) {
2698
2629
  const config = (await loadGlobalConfig()).openpondProfile;
2699
2630
  if (!config)
2700
2631
  return;
2701
- const profiles = profileConfigEntries(config).map((entry) => path8.resolve(entry.repoPath) === path8.resolve(config.repoPath) && entry.profile === config.profile ? { ...entry, lastPush: status } : entry);
2632
+ const profiles = profileConfigEntries(config).map((entry) => path7.resolve(entry.repoPath) === path7.resolve(config.repoPath) && entry.profile === config.profile ? { ...entry, lastPush: status } : entry);
2702
2633
  await saveGlobalConfig({
2703
2634
  openpondProfile: {
2704
2635
  ...config,
@@ -2719,7 +2650,7 @@ async function saveProfileCheckStatus(command, exitCode) {
2719
2650
  exitCode,
2720
2651
  sourceHead
2721
2652
  };
2722
- const profiles = profileConfigEntries(config).map((entry) => path8.resolve(entry.repoPath) === path8.resolve(config.repoPath) && entry.profile === config.profile ? { ...entry, lastCheck } : entry);
2653
+ const profiles = profileConfigEntries(config).map((entry) => path7.resolve(entry.repoPath) === path7.resolve(config.repoPath) && entry.profile === config.profile ? { ...entry, lastCheck } : entry);
2723
2654
  await saveGlobalConfig({
2724
2655
  openpondProfile: {
2725
2656
  ...config,
@@ -2734,7 +2665,7 @@ async function ensureProfileSource(profileSourcePath2, template, force) {
2734
2665
  if (entries.length > 0 && !force)
2735
2666
  return;
2736
2667
  const sdkRoot = resolveAgentSdkRoot();
2737
- const templateDir = path8.join(sdkRoot, "templates", template);
2668
+ const templateDir = path7.join(sdkRoot, "templates", template);
2738
2669
  if (!existsSync4(templateDir)) {
2739
2670
  throw new Error(`Unknown agent template "${template}".`);
2740
2671
  }
@@ -2746,7 +2677,7 @@ async function ensureProfileSource(profileSourcePath2, template, force) {
2746
2677
  await rewriteTemplateSdkDependency(profileSourcePath2, sdkRoot);
2747
2678
  }
2748
2679
  async function ensureProfileScaffoldFiles(repoPath, profileSourcePath2, profile, options = {}) {
2749
- await mkdir(path8.join(repoPath, "profiles"), { recursive: true });
2680
+ await mkdir(path7.join(repoPath, "profiles"), { recursive: true });
2750
2681
  for (const dir of [
2751
2682
  "agents",
2752
2683
  "skills",
@@ -2758,9 +2689,9 @@ async function ensureProfileScaffoldFiles(repoPath, profileSourcePath2, profile,
2758
2689
  "settings",
2759
2690
  "traces"
2760
2691
  ]) {
2761
- await mkdir(path8.join(profileSourcePath2, dir), { recursive: true });
2692
+ await mkdir(path7.join(profileSourcePath2, dir), { recursive: true });
2762
2693
  }
2763
- const profileManifestPath = path8.join(profileSourcePath2, PROFILE_MANIFEST);
2694
+ const profileManifestPath = path7.join(profileSourcePath2, PROFILE_MANIFEST);
2764
2695
  if (!existsSync4(profileManifestPath)) {
2765
2696
  const agentLines = options.includeDefaultAgent === false ? ["agents: []"] : [
2766
2697
  "agents:",
@@ -2775,13 +2706,13 @@ async function ensureProfileScaffoldFiles(repoPath, profileSourcePath2, profile,
2775
2706
  ""
2776
2707
  ].join("\n"), "utf8");
2777
2708
  }
2778
- const lockPath = path8.join(profileSourcePath2, "openpond.lock");
2709
+ const lockPath = path7.join(profileSourcePath2, "openpond.lock");
2779
2710
  if (!existsSync4(lockPath)) {
2780
2711
  await writeFile2(lockPath, "# OpenPond profile lockfile placeholder\n", "utf8");
2781
2712
  }
2782
2713
  }
2783
2714
  async function rewriteTemplateSdkDependency(profileSourcePath2, sdkRoot) {
2784
- const packageJsonPath = path8.join(profileSourcePath2, "package.json");
2715
+ const packageJsonPath = path7.join(profileSourcePath2, "package.json");
2785
2716
  const raw = await readFile5(packageJsonPath, "utf8");
2786
2717
  const packageJson = JSON.parse(raw);
2787
2718
  packageJson.dependencies = {
@@ -2792,22 +2723,22 @@ async function rewriteTemplateSdkDependency(profileSourcePath2, sdkRoot) {
2792
2723
  `, "utf8");
2793
2724
  }
2794
2725
  async function ensureProfileDependencies(profileSourcePath2) {
2795
- if (!existsSync4(path8.join(profileSourcePath2, "package.json")))
2726
+ if (!existsSync4(path7.join(profileSourcePath2, "package.json")))
2796
2727
  return;
2797
2728
  const sdkRoot = resolveAgentSdkRoot();
2798
2729
  await ensureAgentSdkBuilt(sdkRoot);
2799
- const nodeModulesPath = path8.join(profileSourcePath2, "node_modules");
2800
- const sdkLinkPath = path8.join(nodeModulesPath, "openpond-agent-sdk");
2730
+ const nodeModulesPath = path7.join(profileSourcePath2, "node_modules");
2731
+ const sdkLinkPath = path7.join(nodeModulesPath, "openpond-agent-sdk");
2801
2732
  await mkdir(nodeModulesPath, { recursive: true });
2802
2733
  if (!existsSync4(sdkLinkPath)) {
2803
2734
  await symlink(sdkRoot, sdkLinkPath, "dir");
2804
2735
  }
2805
2736
  }
2806
2737
  async function ensureAgentSdkBuilt(sdkRoot) {
2807
- if (existsSync4(path8.join(sdkRoot, "dist", "cli.js")) && existsSync4(path8.join(sdkRoot, "dist", "primitives", "index.js"))) {
2738
+ if (existsSync4(path7.join(sdkRoot, "dist", "cli.js")) && existsSync4(path7.join(sdkRoot, "dist", "primitives", "index.js"))) {
2808
2739
  return;
2809
2740
  }
2810
- const buildScript = path8.join(sdkRoot, "scripts", "build.ts");
2741
+ const buildScript = path7.join(sdkRoot, "scripts", "build.ts");
2811
2742
  if (!existsSync4(buildScript)) {
2812
2743
  throw new Error(`Resolved openpond-agent-sdk at ${sdkRoot}, but built SDK files are missing.`);
2813
2744
  }
@@ -2842,7 +2773,7 @@ function profileCatalogSources(input) {
2842
2773
  ];
2843
2774
  return agents.map((agent) => ({
2844
2775
  agentId: agent.id,
2845
- sourcePath: agent.id === DEFAULT_PROFILE_AGENT ? input.profileSourcePath : path8.join(input.profileSourcePath, "agents", agent.id),
2776
+ sourcePath: agent.id === DEFAULT_PROFILE_AGENT ? input.profileSourcePath : path7.join(input.profileSourcePath, "agents", agent.id),
2846
2777
  preferred: agent.id === defaultAgent
2847
2778
  }));
2848
2779
  }
@@ -2850,25 +2781,25 @@ async function loadProfileEvals(profileSourcePath2, sources) {
2850
2781
  const evals = /* @__PURE__ */ new Map();
2851
2782
  const roots = [
2852
2783
  {
2853
- root: path8.join(profileSourcePath2, "evals"),
2784
+ root: path7.join(profileSourcePath2, "evals"),
2854
2785
  agentId: null
2855
2786
  },
2856
2787
  ...sources.flatMap((source) => [
2857
2788
  {
2858
- root: path8.join(source.sourcePath, "agent", "evals"),
2789
+ root: path7.join(source.sourcePath, "agent", "evals"),
2859
2790
  agentId: source.agentId
2860
2791
  },
2861
- { root: path8.join(source.sourcePath, "evals"), agentId: source.agentId }
2792
+ { root: path7.join(source.sourcePath, "evals"), agentId: source.agentId }
2862
2793
  ])
2863
2794
  ];
2864
2795
  for (const entry of roots) {
2865
2796
  for (const sourcePath of await listEvalSourceFiles(entry.root)) {
2866
- const relativePath = path8.relative(profileSourcePath2, sourcePath).split(path8.sep).join("/");
2797
+ const relativePath = path7.relative(profileSourcePath2, sourcePath).split(path7.sep).join("/");
2867
2798
  if (evals.has(relativePath))
2868
2799
  continue;
2869
2800
  evals.set(relativePath, {
2870
2801
  id: relativePath,
2871
- name: path8.basename(sourcePath).replace(/\.eval\.[^.]+$/i, "").replace(/\.[^.]+$/i, ""),
2802
+ name: path7.basename(sourcePath).replace(/\.eval\.[^.]+$/i, "").replace(/\.[^.]+$/i, ""),
2872
2803
  path: relativePath,
2873
2804
  agentId: entry.agentId,
2874
2805
  sourcePath
@@ -2882,7 +2813,7 @@ async function listEvalSourceFiles(root) {
2882
2813
  return [];
2883
2814
  const files = [];
2884
2815
  for (const entry of await readdir2(root, { withFileTypes: true })) {
2885
- const sourcePath = path8.join(root, entry.name);
2816
+ const sourcePath = path7.join(root, entry.name);
2886
2817
  if (entry.isDirectory()) {
2887
2818
  files.push(...await listEvalSourceFiles(sourcePath));
2888
2819
  } else if (entry.isFile() && /\.eval\.(?:[cm]?[jt]sx?)$/i.test(entry.name)) {
@@ -3115,7 +3046,7 @@ function defaultProfileManifest(profile, profilePath) {
3115
3046
  };
3116
3047
  }
3117
3048
  async function readProfileManifest(repoPath) {
3118
- const manifestPath = path8.join(repoPath, PROFILE_REPO_MANIFEST);
3049
+ const manifestPath = path7.join(repoPath, PROFILE_REPO_MANIFEST);
3119
3050
  const raw = await readFile5(manifestPath, "utf8");
3120
3051
  const parsed = JSON.parse(raw);
3121
3052
  if (parsed.schema !== "openpond.profileRepo.v1" || !parsed.profiles || typeof parsed.profiles !== "object") {
@@ -3124,15 +3055,15 @@ async function readProfileManifest(repoPath) {
3124
3055
  return parsed;
3125
3056
  }
3126
3057
  async function writeProfileManifest(repoPath, manifest) {
3127
- await writeFile2(path8.join(repoPath, PROFILE_REPO_MANIFEST), `${JSON.stringify(manifest, null, 2)}
3058
+ await writeFile2(path7.join(repoPath, PROFILE_REPO_MANIFEST), `${JSON.stringify(manifest, null, 2)}
3128
3059
  `, "utf8");
3129
3060
  }
3130
3061
  function profileSourcePath(manifest, repoPath, profile) {
3131
3062
  const profileConfig = manifest.profiles[profile];
3132
3063
  if (!profileConfig) {
3133
- throw new Error(`Profile "${profile}" was not found in ${path8.join(repoPath, PROFILE_REPO_MANIFEST)}.`);
3064
+ throw new Error(`Profile "${profile}" was not found in ${path7.join(repoPath, PROFILE_REPO_MANIFEST)}.`);
3134
3065
  }
3135
- const sourcePath = path8.resolve(repoPath, profileConfig.path);
3066
+ const sourcePath = path7.resolve(repoPath, profileConfig.path);
3136
3067
  if (!existsSync4(sourcePath)) {
3137
3068
  throw new Error(`Profile source path does not exist: ${sourcePath}`);
3138
3069
  }
@@ -3166,11 +3097,11 @@ async function materializeAgentPackage(target, agentPackage) {
3166
3097
  await mkdir(target, { recursive: true, mode: 448 });
3167
3098
  for (const file of agentPackage.source.files) {
3168
3099
  const relativePath = normalizeAgentPackagePath(file.path);
3169
- const destination = path8.resolve(target, relativePath);
3170
- if (!destination.startsWith(`${path8.resolve(target)}${path8.sep}`)) {
3100
+ const destination = path7.resolve(target, relativePath);
3101
+ if (!destination.startsWith(`${path7.resolve(target)}${path7.sep}`)) {
3171
3102
  throw new Error("Agent package source path escapes its install root.");
3172
3103
  }
3173
- await mkdir(path8.dirname(destination), { recursive: true, mode: 448 });
3104
+ await mkdir(path7.dirname(destination), { recursive: true, mode: 448 });
3174
3105
  let bytes = Buffer.from(file.contentsBase64, "base64");
3175
3106
  if (relativePath === "package.json") {
3176
3107
  const packageJson = JSON.parse(bytes.toString("utf8"));
@@ -3183,8 +3114,8 @@ async function materializeAgentPackage(target, agentPackage) {
3183
3114
  }
3184
3115
  await writeFile2(destination, bytes, { mode: 384, flag: "wx" });
3185
3116
  }
3186
- const provenancePath = path8.join(target, ".openpond", "agent-package-origin.json");
3187
- await mkdir(path8.dirname(provenancePath), { recursive: true, mode: 448 });
3117
+ const provenancePath = path7.join(target, ".openpond", "agent-package-origin.json");
3118
+ await mkdir(path7.dirname(provenancePath), { recursive: true, mode: 448 });
3188
3119
  await writeFile2(provenancePath, `${JSON.stringify({
3189
3120
  schema: "openpond.agent-package-origin.v1",
3190
3121
  agentId: agentPackage.agentId,
@@ -3197,7 +3128,7 @@ async function materializeAgentPackage(target, agentPackage) {
3197
3128
  }
3198
3129
  function normalizeAgentPackagePath(value) {
3199
3130
  const normalized = value.trim().replaceAll("\\", "/");
3200
- const clean = path8.posix.normalize(normalized);
3131
+ const clean = path7.posix.normalize(normalized);
3201
3132
  if (!clean || clean === "." || clean === ".." || clean.startsWith("/") || clean.startsWith("../") || clean.split("/").some((part) => part === "..")) {
3202
3133
  throw new Error(`Agent package contains an invalid source path: ${value}.`);
3203
3134
  }
@@ -3215,14 +3146,14 @@ function sortAgentPackageJson(value) {
3215
3146
  }
3216
3147
  function resolveAgentSdkRoot() {
3217
3148
  const packageJsonPath = require2.resolve("openpond-agent-sdk/package.json");
3218
- return path8.dirname(packageJsonPath);
3149
+ return path7.dirname(packageJsonPath);
3219
3150
  }
3220
3151
  function resolveAgentSdkCliLaunch() {
3221
3152
  const sdkRoot = resolveAgentSdkRoot();
3222
- const distCli = path8.join(sdkRoot, "dist", "cli.js");
3153
+ const distCli = path7.join(sdkRoot, "dist", "cli.js");
3223
3154
  if (existsSync4(distCli))
3224
3155
  return { command: process.execPath, args: [distCli] };
3225
- const sourceCli = path8.join(sdkRoot, "src", "cli.ts");
3156
+ const sourceCli = path7.join(sdkRoot, "src", "cli.ts");
3226
3157
  if (existsSync4(sourceCli)) {
3227
3158
  return {
3228
3159
  command: process.execPath,
@@ -3232,7 +3163,7 @@ function resolveAgentSdkCliLaunch() {
3232
3163
  throw new Error(`openpond-agent CLI was not found under ${sdkRoot}`);
3233
3164
  }
3234
3165
  function resolveTsxCli(packageRoot) {
3235
- return createRequire(path8.join(packageRoot, "package.json")).resolve("tsx/cli");
3166
+ return createRequire(path7.join(packageRoot, "package.json")).resolve("tsx/cli");
3236
3167
  }
3237
3168
  async function spawnCommand(command, args, options = {}) {
3238
3169
  return new Promise((resolve, reject) => {
@@ -3441,7 +3372,7 @@ var GithubExtensionError = class extends Error {
3441
3372
 
3442
3373
  // ../../packages/cloud/dist/extensions/github-source.js
3443
3374
  import { createHash as createHash4 } from "node:crypto";
3444
- import path9 from "node:path";
3375
+ import path8 from "node:path";
3445
3376
  var DEFAULT_REF = "HEAD";
3446
3377
  var MAX_EXTENSION_SKILLS = 64;
3447
3378
  var MAX_EXTENSION_FILES = 512;
@@ -3569,7 +3500,7 @@ async function buildPreview(source, fetchImpl, githubToken) {
3569
3500
  }
3570
3501
  function previewSkill(skillPackage, contents) {
3571
3502
  const parsed = parseProfileSkillMarkdown(contents);
3572
- const directoryName = skillPackage.root === "." ? null : path9.posix.basename(skillPackage.root);
3503
+ const directoryName = skillPackage.root === "." ? null : path8.posix.basename(skillPackage.root);
3573
3504
  const name = parsed.name ?? directoryName ?? "invalid-skill";
3574
3505
  const messages = [...parsed.messages];
3575
3506
  if (!SKILL_NAME_PATTERN.test(name))
@@ -3598,9 +3529,9 @@ function discoverSkillPackages(tree) {
3598
3529
  const skillEntries = tree.filter((entry) => entry.type === "blob" && entry.path.endsWith("/SKILL.md"));
3599
3530
  const standardEntries = skillEntries.filter((entry) => isStandardAgentSkillsPath(entry.path));
3600
3531
  const discoveredEntries = standardEntries.length > 0 ? standardEntries : skillEntries;
3601
- const roots = new Set(discoveredEntries.map((entry) => path9.posix.dirname(entry.path)));
3532
+ const roots = new Set(discoveredEntries.map((entry) => path8.posix.dirname(entry.path)));
3602
3533
  for (const entry of discoveredEntries) {
3603
- const root = path9.posix.dirname(entry.path);
3534
+ const root = path8.posix.dirname(entry.path);
3604
3535
  if ([...roots].some((candidate) => candidate !== root && root.startsWith(`${candidate}/`)))
3605
3536
  continue;
3606
3537
  entries.push({ root, entry });
@@ -3807,16 +3738,16 @@ function invalidSource(source) {
3807
3738
  }
3808
3739
 
3809
3740
  // ../../packages/cloud/dist/extensions/extension-manager.js
3810
- import { createHash as createHash5, randomUUID as randomUUID4 } from "node:crypto";
3741
+ import { createHash as createHash5, randomUUID as randomUUID3 } from "node:crypto";
3811
3742
  import { existsSync as existsSync5 } from "node:fs";
3812
3743
  import { mkdir as mkdir2, readFile as readFile6, rename as rename2, rm as rm3, stat as stat4, writeFile as writeFile3 } from "node:fs/promises";
3813
- import path10 from "node:path";
3744
+ import path9 from "node:path";
3814
3745
  var REGISTRY_SCHEMA_VERSION = 1;
3815
- var OPERATION_LOCK_STALE_MS = 2 * 60 * 1e3;
3816
3746
  var OPERATION_LOCK_TIMEOUT_MS = 15e3;
3817
3747
  function createGithubExtensionManager(options = {}) {
3818
- const rootPath = path10.resolve(options.rootPath ?? path10.join(openPondConfigDirectory(), "extensions"));
3819
- const registryPath = path10.join(rootPath, "registry.json");
3748
+ const home = path9.resolve(options.home ?? options.rootPath ?? resolveOpenPondHome());
3749
+ const rootPath = path9.resolve(options.rootPath ?? path9.join(home, "library", "extensions"));
3750
+ const registryPath = storagePaths(home).database;
3820
3751
  const github = createGithubSourceClient({
3821
3752
  fetch: options.fetch,
3822
3753
  githubToken: options.githubToken
@@ -3824,7 +3755,7 @@ function createGithubExtensionManager(options = {}) {
3824
3755
  const now = options.now ?? (() => /* @__PURE__ */ new Date());
3825
3756
  async function list() {
3826
3757
  try {
3827
- const registry = await readRegistry(registryPath);
3758
+ const registry = await readRegistry(home);
3828
3759
  const extensions = await Promise.all(registry.extensions.map((extension) => hydrateExtension(rootPath, extension)));
3829
3760
  markInstalledSkillConflicts(extensions, await reservedSkillNames(options.reservedSkillNames));
3830
3761
  return {
@@ -3844,7 +3775,7 @@ function createGithubExtensionManager(options = {}) {
3844
3775
  }
3845
3776
  async function preview(request) {
3846
3777
  const resolution = await github.resolve(request);
3847
- const registry = await readRegistry(registryPath);
3778
+ const registry = await readRegistry(home);
3848
3779
  const existing = registry.extensions.find((extension) => extension.id === resolution.preview.id) ?? null;
3849
3780
  assertSkillNamesAvailable(resolution.preview, registry.extensions.filter((extension) => extension.id !== existing?.id), await reservedSkillNames(options.reservedSkillNames));
3850
3781
  return resolution.preview;
@@ -3852,7 +3783,7 @@ function createGithubExtensionManager(options = {}) {
3852
3783
  async function add(request) {
3853
3784
  const identity = parseGithubExtensionSource(request.source);
3854
3785
  return withExtensionLock(rootPath, identity.id, async () => {
3855
- const registry = await readRegistry(registryPath);
3786
+ const registry = await readRegistry(home);
3856
3787
  if (registry.extensions.some((extension) => extension.id === identity.id)) {
3857
3788
  throw new GithubExtensionError(`${identity.owner}/${identity.repo} is already installed.`, {
3858
3789
  code: "extension_already_installed",
@@ -3872,7 +3803,7 @@ function createGithubExtensionManager(options = {}) {
3872
3803
  });
3873
3804
  try {
3874
3805
  const reserved = await reservedSkillNames(options.reservedSkillNames);
3875
- await writeRegistry(registryPath, now, (current) => ({
3806
+ await writeRegistry(home, now, (current) => ({
3876
3807
  ...current,
3877
3808
  extensions: appendInstalledExtension(current, installed, reserved)
3878
3809
  }));
@@ -3887,7 +3818,7 @@ function createGithubExtensionManager(options = {}) {
3887
3818
  async function update(request) {
3888
3819
  const identity = parseGithubExtensionSource(request.source);
3889
3820
  return withExtensionLock(rootPath, identity.id, async () => {
3890
- const registry = await readRegistry(registryPath);
3821
+ const registry = await readRegistry(home);
3891
3822
  const existing = requireInstalled(registry, identity.id);
3892
3823
  const resolution = await github.resolve({
3893
3824
  source: existing.repositoryUrl,
@@ -3907,7 +3838,7 @@ function createGithubExtensionManager(options = {}) {
3907
3838
  });
3908
3839
  try {
3909
3840
  const reserved = await reservedSkillNames(options.reservedSkillNames);
3910
- await writeRegistry(registryPath, now, (current) => ({
3841
+ await writeRegistry(home, now, (current) => ({
3911
3842
  ...current,
3912
3843
  extensions: replaceInstalledExtension(current, installed, reserved)
3913
3844
  }));
@@ -3943,20 +3874,20 @@ function createGithubExtensionManager(options = {}) {
3943
3874
  }
3944
3875
  async function inspect(source) {
3945
3876
  const identity = parseGithubExtensionSource(source);
3946
- const registry = await readRegistry(registryPath);
3877
+ const registry = await readRegistry(home);
3947
3878
  return hydrateExtension(rootPath, requireInstalled(registry, identity.id));
3948
3879
  }
3949
3880
  async function remove(source) {
3950
3881
  const identity = parseGithubExtensionSource(source);
3951
3882
  return withExtensionLock(rootPath, identity.id, async () => {
3952
- const registry = await readRegistry(registryPath);
3883
+ const registry = await readRegistry(home);
3953
3884
  const existing = requireInstalled(registry, identity.id);
3954
3885
  const target = extensionDirectory(rootPath, identity.owner, identity.repo);
3955
- const trash = `${target}.${randomUUID4()}.remove`;
3886
+ const trash = `${target}.${randomUUID3()}.remove`;
3956
3887
  if (existsSync5(target))
3957
3888
  await rename2(target, trash);
3958
3889
  try {
3959
- await writeRegistry(registryPath, now, (current) => ({
3890
+ await writeRegistry(home, now, (current) => ({
3960
3891
  ...current,
3961
3892
  extensions: current.extensions.filter((extension) => extension.id !== existing.id)
3962
3893
  }));
@@ -4017,7 +3948,7 @@ function createGithubExtensionManager(options = {}) {
4017
3948
  sourcePath: match.extension.sourcePath,
4018
3949
  sourceHash,
4019
3950
  charCount: markdown.length,
4020
- packagePath: path10.dirname(absolutePath),
3951
+ packagePath: path9.dirname(absolutePath),
4021
3952
  resourceFiles: match.skill.resourceFiles
4022
3953
  };
4023
3954
  }
@@ -4026,22 +3957,22 @@ function createGithubExtensionManager(options = {}) {
4026
3957
  async function materializeExtension(input) {
4027
3958
  const preview = input.resolution.preview;
4028
3959
  const target = extensionDirectory(input.rootPath, preview.owner, preview.repo);
4029
- const temporary = `${target}.${randomUUID4()}.install`;
3960
+ const temporary = `${target}.${randomUUID3()}.install`;
4030
3961
  const backup = backupDirectory(input.rootPath, preview.id);
4031
- const current = path10.join(temporary, "current");
3962
+ const current = path9.join(temporary, "current");
4032
3963
  await rm3(temporary, { recursive: true, force: true });
4033
3964
  await rm3(backup, { recursive: true, force: true });
4034
3965
  await mkdir2(current, { recursive: true, mode: 448 });
4035
3966
  try {
4036
3967
  await input.github.download(input.resolution, async (relativePath, bytes, executable) => {
4037
3968
  const destination = safeDestination(current, relativePath);
4038
- await mkdir2(path10.dirname(destination), { recursive: true, mode: 448 });
3969
+ await mkdir2(path9.dirname(destination), { recursive: true, mode: 448 });
4039
3970
  await writeFile3(destination, bytes, { mode: executable ? 448 : 384 });
4040
3971
  });
4041
3972
  const extension = installedExtension(preview, target, input.installedAt, input.updatedAt);
4042
- await writeFile3(path10.join(temporary, "extension.json"), `${JSON.stringify(extension, null, 2)}
3973
+ await writeFile3(path9.join(temporary, "extension.json"), `${JSON.stringify(extension, null, 2)}
4043
3974
  `, { mode: 384 });
4044
- await mkdir2(path10.dirname(target), { recursive: true, mode: 448 });
3975
+ await mkdir2(path9.dirname(target), { recursive: true, mode: 448 });
4045
3976
  if (existsSync5(target))
4046
3977
  await rename2(target, backup);
4047
3978
  await rename2(temporary, target);
@@ -4054,16 +3985,16 @@ async function materializeExtension(input) {
4054
3985
  }
4055
3986
  }
4056
3987
  function installedExtension(preview, target, installedAt, updatedAt) {
4057
- const sourcePath = path10.join(target, "current");
3988
+ const sourcePath = path9.join(target, "current");
4058
3989
  return {
4059
3990
  ...preview,
4060
3991
  sourcePath,
4061
- readmePath: preview.readmePath ? path10.join(sourcePath, preview.readmePath) : null,
3992
+ readmePath: preview.readmePath ? path9.join(sourcePath, preview.readmePath) : null,
4062
3993
  installedAt,
4063
3994
  updatedAt,
4064
3995
  skills: preview.skills.map((skill) => ({
4065
3996
  ...skill,
4066
- sourcePath: path10.join(sourcePath, skill.relativePath)
3997
+ sourcePath: path9.join(sourcePath, skill.relativePath)
4067
3998
  }))
4068
3999
  };
4069
4000
  }
@@ -4080,18 +4011,18 @@ async function rollbackMaterialization(rootPath, id) {
4080
4011
  }
4081
4012
  async function hydrateExtension(rootPath, extension) {
4082
4013
  const target = extensionDirectory(rootPath, extension.owner, extension.repo);
4083
- const sourcePath = path10.join(target, "current");
4084
- const present = (await stat4(path10.join(target, "extension.json")).catch(() => null))?.isFile() ?? false;
4014
+ const sourcePath = path9.join(target, "current");
4015
+ const present = (await stat4(path9.join(target, "extension.json")).catch(() => null))?.isFile() ?? false;
4085
4016
  const validationMessages = extension.validationMessages.filter((message) => message !== "Installed files are missing.");
4086
4017
  if (!present)
4087
4018
  validationMessages.push("Installed files are missing.");
4088
4019
  return {
4089
4020
  ...extension,
4090
4021
  sourcePath,
4091
- readmePath: extension.readmePath ? path10.join(sourcePath, path10.basename(extension.readmePath)) : null,
4022
+ readmePath: extension.readmePath ? path9.join(sourcePath, path9.basename(extension.readmePath)) : null,
4092
4023
  skills: extension.skills.map((skill) => ({
4093
4024
  ...skill,
4094
- sourcePath: path10.join(sourcePath, skill.relativePath)
4025
+ sourcePath: path9.join(sourcePath, skill.relativePath)
4095
4026
  })),
4096
4027
  validationStatus: validationMessages.length === 0 ? "valid" : "error",
4097
4028
  validationMessages
@@ -4162,29 +4093,20 @@ function requireInstalled(registry, id) {
4162
4093
  status: 404
4163
4094
  });
4164
4095
  }
4165
- async function readRegistry(registryPath) {
4166
- try {
4167
- const parsed = JSON.parse(await readFile6(registryPath, "utf8"));
4168
- if (parsed.schemaVersion !== REGISTRY_SCHEMA_VERSION || !Array.isArray(parsed.extensions)) {
4169
- throw new Error("Extension registry has an unsupported format.");
4170
- }
4171
- return {
4172
- schemaVersion: REGISTRY_SCHEMA_VERSION,
4173
- updatedAt: typeof parsed.updatedAt === "string" ? parsed.updatedAt : null,
4174
- extensions: parsed.extensions.filter(isStoredExtension)
4175
- };
4176
- } catch (error) {
4177
- if (error.code === "ENOENT")
4178
- return emptyRegistry();
4179
- throw error;
4180
- }
4181
- }
4182
- async function writeRegistry(registryPath, now, update) {
4183
- await updatePrivateJsonFile(registryPath, emptyRegistry, (current) => ({
4184
- ...update(normalizeRegistry(current)),
4185
- schemaVersion: REGISTRY_SCHEMA_VERSION,
4186
- updatedAt: now().toISOString()
4187
- }));
4096
+ async function readRegistry(home) {
4097
+ const value = getLocalRecord(home, "extension_installations", "registry")?.value;
4098
+ if (!value)
4099
+ return emptyRegistry();
4100
+ if (value.schemaVersion !== REGISTRY_SCHEMA_VERSION || !Array.isArray(value.extensions) || !value.extensions.every(isStoredExtension))
4101
+ throw new Error("Extension registry has an unsupported format.");
4102
+ return normalizeRegistry(value);
4103
+ }
4104
+ async function writeRegistry(home, now, update) {
4105
+ await withFileLock(path9.join(storagePaths(home).runtime, "extension-registry"), async () => {
4106
+ const current = getLocalRecord(home, "extension_installations", "registry");
4107
+ const next = update(await readRegistry(home));
4108
+ putLocalRecord(home, "extension_installations", "registry", { ...next, schemaVersion: REGISTRY_SCHEMA_VERSION, updatedAt: now().toISOString() }, current?.revision ?? null);
4109
+ });
4188
4110
  }
4189
4111
  function normalizeRegistry(value) {
4190
4112
  return {
@@ -4203,13 +4125,13 @@ function isStoredExtension(value) {
4203
4125
  return extension.source === "github" && typeof extension.id === "string" && typeof extension.owner === "string" && typeof extension.repo === "string" && typeof extension.repositoryUrl === "string" && typeof extension.requestedRef === "string" && typeof extension.resolvedCommit === "string" && Array.isArray(extension.skills);
4204
4126
  }
4205
4127
  function safeDestination(root, relativePath) {
4206
- if (path10.isAbsolute(relativePath) || relativePath.split(/[\\/]/).includes("..")) {
4128
+ if (path9.isAbsolute(relativePath) || relativePath.split(/[\\/]/).includes("..")) {
4207
4129
  throw new GithubExtensionError(`Unsafe extension path: ${relativePath}`, {
4208
4130
  code: "extension_unsafe_path"
4209
4131
  });
4210
4132
  }
4211
- const destination = path10.resolve(root, ...relativePath.split("/"));
4212
- const prefix = `${path10.resolve(root)}${path10.sep}`;
4133
+ const destination = path9.resolve(root, ...relativePath.split("/"));
4134
+ const prefix = `${path9.resolve(root)}${path9.sep}`;
4213
4135
  if (!destination.startsWith(prefix)) {
4214
4136
  throw new GithubExtensionError(`Unsafe extension path: ${relativePath}`, {
4215
4137
  code: "extension_unsafe_path"
@@ -4218,7 +4140,7 @@ function safeDestination(root, relativePath) {
4218
4140
  return destination;
4219
4141
  }
4220
4142
  function extensionDirectory(rootPath, owner, repo) {
4221
- return path10.join(rootPath, "github", owner, repo);
4143
+ return path9.join(rootPath, "github", owner, repo);
4222
4144
  }
4223
4145
  function backupDirectory(rootPath, id) {
4224
4146
  const identity = parseGithubExtensionSource(id.replace(/^github:/, ""));
@@ -4226,42 +4148,14 @@ function backupDirectory(rootPath, id) {
4226
4148
  }
4227
4149
  async function withExtensionLock(rootPath, id, operation) {
4228
4150
  const safeId = id.replace(/[^a-z0-9.-]+/gi, "-");
4229
- const lockPath = path10.join(rootPath, ".locks", `${safeId}.lock`);
4230
- await mkdir2(path10.dirname(lockPath), { recursive: true, mode: 448 });
4231
- const deadline = Date.now() + OPERATION_LOCK_TIMEOUT_MS;
4232
- while (true) {
4233
- try {
4234
- await mkdir2(lockPath, { mode: 448 });
4235
- break;
4236
- } catch (error) {
4237
- if (error.code !== "EEXIST")
4238
- throw error;
4239
- const lockStat = await stat4(lockPath).catch(() => null);
4240
- if (lockStat && Date.now() - lockStat.mtimeMs > OPERATION_LOCK_STALE_MS) {
4241
- await rm3(lockPath, { recursive: true, force: true });
4242
- continue;
4243
- }
4244
- if (Date.now() >= deadline) {
4245
- throw new GithubExtensionError(`Timed out waiting for extension operation: ${id}`, {
4246
- code: "extension_operation_busy",
4247
- status: 409
4248
- });
4249
- }
4250
- await new Promise((resolve) => setTimeout(resolve, 30));
4251
- }
4252
- }
4253
- try {
4254
- return await operation();
4255
- } finally {
4256
- await rm3(lockPath, { recursive: true, force: true });
4257
- }
4151
+ return withFileLock(path9.join(rootPath, ".locks", safeId), operation, OPERATION_LOCK_TIMEOUT_MS);
4258
4152
  }
4259
4153
  function extensionSort(left, right) {
4260
4154
  return left.id.localeCompare(right.id);
4261
4155
  }
4262
4156
 
4263
4157
  // ../../packages/cloud/dist/profile/hosted-run-idempotency.js
4264
- import { createHash as createHash6, randomUUID as randomUUID5 } from "node:crypto";
4158
+ import { createHash as createHash6, randomUUID as randomUUID4 } from "node:crypto";
4265
4159
  function buildHostedRunIdempotencyKey(input) {
4266
4160
  const explicit = input.explicitKey?.trim();
4267
4161
  if (explicit)
@@ -4272,7 +4166,7 @@ function buildHostedRunIdempotencyKey(input) {
4272
4166
  const base = `profile-push-run:${input.localHead}:${sourceHead}:${input.runtimeAgentId}:${targetProjectId}:${inputHash}`;
4273
4167
  if (!input.retry)
4274
4168
  return base;
4275
- return `${base}:retry:${(input.randomId ?? randomUUID5)()}`;
4169
+ return `${base}:retry:${(input.randomId ?? randomUUID4)()}`;
4276
4170
  }
4277
4171
  function hashStableJson(value) {
4278
4172
  return createHash6("sha256").update(stableJsonStringify(value)).digest("hex");
@@ -4521,654 +4415,6 @@ function sidebarFileBookmarkId(input) {
4521
4415
  ].join(":");
4522
4416
  }
4523
4417
 
4524
- // ../../packages/contracts/dist/providers.js
4525
- var PROVIDER_IDS = [
4526
- "openpond",
4527
- "codex",
4528
- "anthropic",
4529
- "openai",
4530
- "xai",
4531
- "google",
4532
- "openrouter",
4533
- "deepseek",
4534
- "zai",
4535
- "moonshot",
4536
- "together",
4537
- "groq",
4538
- "custom-openai-compatible"
4539
- ];
4540
- var ProviderIdSchema = external_exports.enum(PROVIDER_IDS);
4541
- var ProviderLifecycleStatusSchema = external_exports.enum([
4542
- "active",
4543
- "preview",
4544
- "planned",
4545
- "deprecated"
4546
- ]);
4547
- var ProviderCredentialModeSchema = external_exports.enum([
4548
- "openpond-account",
4549
- "openpond-managed",
4550
- "codex-login",
4551
- "chatgpt-subscription",
4552
- "local-byok",
4553
- "hosted-byok",
4554
- "custom"
4555
- ]);
4556
- var ProviderCredentialSourceSchema = external_exports.enum([
4557
- "none",
4558
- "local_secret",
4559
- "env",
4560
- "openpond_account",
4561
- "codex_login",
4562
- "chatgpt_subscription",
4563
- "hosted"
4564
- ]);
4565
- var ProviderCredentialStatusSchema = external_exports.object({
4566
- connected: external_exports.boolean().default(false),
4567
- source: ProviderCredentialSourceSchema.default("none"),
4568
- redacted: external_exports.string().nullable().default(null),
4569
- lastValidatedAt: external_exports.string().nullable().default(null),
4570
- lastError: external_exports.string().nullable().default(null)
4571
- });
4572
- var ProviderRoutingSchema = external_exports.object({
4573
- hostedOpChat: external_exports.boolean().default(false),
4574
- localRuntime: external_exports.boolean().default(true),
4575
- localByok: external_exports.boolean().default(false),
4576
- hostedByok: external_exports.boolean().default(false)
4577
- });
4578
- var ProviderModelDiscoverySchema = external_exports.enum([
4579
- "hosted",
4580
- "provider",
4581
- "manual",
4582
- "none"
4583
- ]);
4584
- var ProviderCapabilitiesSchema = external_exports.object({
4585
- chatCompletions: external_exports.boolean().default(true),
4586
- streaming: external_exports.boolean().default(true),
4587
- modelDiscovery: ProviderModelDiscoverySchema.default("none"),
4588
- toolCalling: external_exports.boolean().default(false),
4589
- reasoning: external_exports.boolean().default(false),
4590
- imageInput: external_exports.boolean().default(false),
4591
- structuredOutput: external_exports.boolean().default(false)
4592
- });
4593
- var ProviderModelSourceSchema = external_exports.enum([
4594
- "hosted",
4595
- "provider",
4596
- "curated",
4597
- "manual",
4598
- "cache"
4599
- ]);
4600
- var ProviderModelCapabilitiesSchema = external_exports.object({
4601
- streaming: external_exports.boolean().default(true),
4602
- toolCalling: external_exports.boolean().default(false),
4603
- reasoning: external_exports.boolean().default(false),
4604
- vision: external_exports.boolean().default(false),
4605
- structuredOutput: external_exports.boolean().default(false)
4606
- });
4607
- var ProviderModelSchema = external_exports.object({
4608
- id: external_exports.string().trim().min(1).max(300),
4609
- providerId: ProviderIdSchema,
4610
- displayName: external_exports.string().trim().min(1).max(300),
4611
- contextWindow: external_exports.number().int().positive().nullable().default(null),
4612
- outputLimit: external_exports.number().int().positive().nullable().default(null),
4613
- lifecycleStatus: ProviderLifecycleStatusSchema.default("active"),
4614
- source: ProviderModelSourceSchema,
4615
- capabilities: ProviderModelCapabilitiesSchema.default(() => ProviderModelCapabilitiesSchema.parse({})),
4616
- raw: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
4617
- });
4618
- var ProviderModelCacheSchema = external_exports.object({
4619
- providerId: ProviderIdSchema,
4620
- models: external_exports.array(ProviderModelSchema).default([]),
4621
- fetchedAt: external_exports.string().nullable().default(null),
4622
- lastError: external_exports.string().nullable().default(null),
4623
- source: external_exports.enum(["none", "hosted", "provider", "curated", "manual"]).default("none")
4624
- });
4625
- var ProviderConfigSchema = external_exports.object({
4626
- enabled: external_exports.boolean().default(false),
4627
- baseUrl: external_exports.string().trim().min(1).max(2048).nullable().default(null),
4628
- defaultModel: external_exports.string().trim().min(1).max(300).nullable().default(null),
4629
- modelOverrides: external_exports.array(external_exports.string().trim().min(1).max(300)).max(500).default([]),
4630
- updatedAt: external_exports.string().nullable().default(null)
4631
- });
4632
- var ProviderConfigPatchSchema = external_exports.object({
4633
- enabled: external_exports.boolean().optional(),
4634
- baseUrl: external_exports.string().trim().min(1).max(2048).nullable().optional(),
4635
- defaultModel: external_exports.string().trim().min(1).max(300).nullable().optional(),
4636
- modelOverrides: external_exports.array(external_exports.string().trim().min(1).max(300)).max(500).optional()
4637
- });
4638
- var ProviderCatalogModelSchema = external_exports.object({
4639
- id: external_exports.string().trim().min(1).max(300),
4640
- displayName: external_exports.string().trim().min(1).max(300),
4641
- contextWindow: external_exports.number().int().positive().nullable().optional(),
4642
- outputLimit: external_exports.number().int().positive().nullable().optional(),
4643
- lifecycleStatus: ProviderLifecycleStatusSchema.optional(),
4644
- capabilities: ProviderModelCapabilitiesSchema.partial().optional()
4645
- });
4646
- var ProviderCatalogProviderSchema = external_exports.object({
4647
- id: ProviderIdSchema,
4648
- displayName: external_exports.string().trim().min(1).max(160),
4649
- lifecycleStatus: ProviderLifecycleStatusSchema.default("active"),
4650
- credentialModes: external_exports.array(ProviderCredentialModeSchema).default([]),
4651
- routing: ProviderRoutingSchema,
4652
- capabilities: ProviderCapabilitiesSchema,
4653
- defaultEnabled: external_exports.boolean().optional(),
4654
- defaultBaseUrl: external_exports.string().trim().min(1).max(2048).nullable().optional(),
4655
- defaultModel: external_exports.string().trim().min(1).max(300).nullable().optional(),
4656
- modelCacheSource: external_exports.enum(["none", "hosted", "provider", "curated", "manual"]),
4657
- models: external_exports.array(ProviderCatalogModelSchema).default([])
4658
- });
4659
- var ProviderCatalogSchema = external_exports.object({
4660
- version: external_exports.literal(1).default(1),
4661
- generatedAt: external_exports.string().datetime(),
4662
- providers: external_exports.array(ProviderCatalogProviderSchema)
4663
- });
4664
- var ProviderStatusSchema = external_exports.object({
4665
- id: ProviderIdSchema,
4666
- displayName: external_exports.string().trim().min(1).max(160),
4667
- lifecycleStatus: ProviderLifecycleStatusSchema.default("active"),
4668
- credentialModes: external_exports.array(ProviderCredentialModeSchema).default([]),
4669
- routing: ProviderRoutingSchema.default(() => ProviderRoutingSchema.parse({})),
4670
- capabilities: ProviderCapabilitiesSchema.default(() => ProviderCapabilitiesSchema.parse({})),
4671
- credential: ProviderCredentialStatusSchema.default(() => ProviderCredentialStatusSchema.parse({})),
4672
- enabled: external_exports.boolean().default(false),
4673
- available: external_exports.boolean().default(false),
4674
- defaultModel: external_exports.string().trim().min(1).max(300).nullable().default(null),
4675
- modelIds: external_exports.array(external_exports.string().trim().min(1).max(300)).max(1e3).default([]),
4676
- lastError: external_exports.string().nullable().default(null)
4677
- });
4678
- var ProviderSettingsSchema = external_exports.object({
4679
- version: external_exports.literal(1).default(1),
4680
- providers: external_exports.record(external_exports.string(), ProviderConfigSchema).default({}),
4681
- statuses: external_exports.record(external_exports.string(), ProviderStatusSchema).default({}),
4682
- modelCaches: external_exports.record(external_exports.string(), ProviderModelCacheSchema).default({}),
4683
- updatedAt: external_exports.string().nullable().default(null)
4684
- });
4685
- var ChatModelRefSchema = external_exports.object({
4686
- providerId: ProviderIdSchema,
4687
- modelId: external_exports.string().trim().min(1).max(300)
4688
- });
4689
- var ProviderSettingsUpdateSchema = external_exports.object({
4690
- providers: external_exports.record(external_exports.string(), ProviderConfigPatchSchema).optional()
4691
- });
4692
- var ProviderCredentialWriteRequestSchema = external_exports.object({
4693
- source: external_exports.enum(["local_secret", "env"]).default("local_secret"),
4694
- value: external_exports.string().min(1).max(2e4).optional(),
4695
- envVar: external_exports.string().trim().min(1).max(160).optional()
4696
- }).superRefine((value, context) => {
4697
- if (value.source === "env" && !value.envVar) {
4698
- context.addIssue({
4699
- code: "custom",
4700
- path: ["envVar"],
4701
- message: "envVar is required when provider credential source is env."
4702
- });
4703
- }
4704
- if (value.source === "local_secret" && !value.value) {
4705
- context.addIssue({
4706
- code: "custom",
4707
- path: ["value"],
4708
- message: "value is required when provider credential source is local_secret."
4709
- });
4710
- }
4711
- });
4712
- var ProviderCredentialDeleteRequestSchema = external_exports.object({
4713
- source: external_exports.enum(["local_secret", "env", "chatgpt_subscription"]).optional()
4714
- });
4715
- var ProviderValidationRequestSchema = external_exports.object({
4716
- modelId: external_exports.string().trim().min(1).max(300).optional(),
4717
- baseUrl: external_exports.string().trim().min(1).max(2048).optional()
4718
- });
4719
- var ProviderModelsRequestSchema = external_exports.object({
4720
- query: external_exports.string().trim().max(200).optional(),
4721
- refresh: external_exports.boolean().default(false),
4722
- limit: external_exports.number().int().positive().max(500).default(100)
4723
- });
4724
- var ProviderModelsRefreshRequestSchema = external_exports.object({
4725
- query: external_exports.string().trim().max(200).optional(),
4726
- force: external_exports.boolean().default(false)
4727
- });
4728
-
4729
- // ../../packages/contracts/dist/subagents.js
4730
- var SUBAGENT_BUILT_IN_ROLE_IDS = [
4731
- "coding",
4732
- "research",
4733
- "review",
4734
- "test",
4735
- "docs",
4736
- "planner",
4737
- "summarizer"
4738
- ];
4739
- var SubagentBuiltInRoleIdSchema = external_exports.enum(SUBAGENT_BUILT_IN_ROLE_IDS);
4740
- var SubagentRoleIdSchema = external_exports.string().trim().min(1).max(80).regex(/^[a-z][a-z0-9_-]*$/);
4741
- var SubagentIsolationModeSchema = external_exports.enum(["none", "worktree", "copy_on_write"]);
4742
- var SubagentToolPolicySchema = external_exports.enum(["read_only", "workspace_write", "full_tools"]);
4743
- var SubagentPeerMessagesSchema = external_exports.enum(["disabled", "parent_scoped"]);
4744
- var SubagentDelegationModeSchema = external_exports.enum(["manual", "balanced", "proactive"]);
4745
- var SubagentRunStatusSchema = external_exports.enum([
4746
- "queued",
4747
- "running",
4748
- "completed",
4749
- "failed",
4750
- "cancelled",
4751
- "needs_resume"
4752
- ]);
4753
- var SUBAGENT_RUNTIME_EVENT_NAMES = [
4754
- "subagent.started",
4755
- "subagent.reported",
4756
- "subagent.completed",
4757
- "subagent.progress",
4758
- "subagent.failed",
4759
- "subagent.cancelled",
4760
- "subagent.cleanup",
4761
- "subagent.workspace_retained",
4762
- "subagent.workspace_retention_expiring",
4763
- "subagent.archived",
4764
- "subagent.message"
4765
- ];
4766
- var SubagentRuntimeEventNameSchema = external_exports.enum(SUBAGENT_RUNTIME_EVENT_NAMES);
4767
- var SUBAGENT_ROLE_PRESETS = [
4768
- {
4769
- id: "coding",
4770
- label: "Coding",
4771
- description: "Make scoped code changes and return patch, diff, and test evidence.",
4772
- defaultToolPolicy: "full_tools"
4773
- },
4774
- {
4775
- id: "research",
4776
- label: "Research",
4777
- description: "Inspect docs, code, web or repo context and return cited findings.",
4778
- defaultToolPolicy: "full_tools"
4779
- },
4780
- {
4781
- id: "review",
4782
- label: "Review",
4783
- description: "Inspect diffs or implementation plans and return ranked findings.",
4784
- defaultToolPolicy: "full_tools"
4785
- },
4786
- {
4787
- id: "test",
4788
- label: "Test",
4789
- description: "Run or design validation in isolation and return command evidence.",
4790
- defaultToolPolicy: "full_tools"
4791
- },
4792
- {
4793
- id: "docs",
4794
- label: "Docs",
4795
- description: "Update or draft project documentation in an isolated target.",
4796
- defaultToolPolicy: "full_tools"
4797
- },
4798
- {
4799
- id: "planner",
4800
- label: "Planner",
4801
- description: "Decompose a goal into child assignments and context packs.",
4802
- defaultToolPolicy: "full_tools"
4803
- },
4804
- {
4805
- id: "summarizer",
4806
- label: "Summarizer",
4807
- description: "Compact transcripts, child results, and goal state for parent context.",
4808
- defaultToolPolicy: "full_tools"
4809
- }
4810
- ];
4811
- var SubagentRoleSettingsSchema = external_exports.object({
4812
- id: SubagentRoleIdSchema,
4813
- enabled: external_exports.boolean().default(true),
4814
- modelRef: ChatModelRefSchema.nullable().default(null),
4815
- isolationMode: SubagentIsolationModeSchema.default("none"),
4816
- maxConcurrentRuns: external_exports.number().int().min(1).max(16).default(1),
4817
- toolPolicy: SubagentToolPolicySchema.default("read_only"),
4818
- background: external_exports.boolean().default(true),
4819
- peerMessages: SubagentPeerMessagesSchema.default("parent_scoped")
4820
- });
4821
- var SubagentPreferencesSchema = external_exports.object({
4822
- enabled: external_exports.boolean().default(true),
4823
- workspaceDefaultsVersion: external_exports.literal(1).default(1),
4824
- toolDefaultsVersion: external_exports.literal(1).default(1),
4825
- delegationMode: SubagentDelegationModeSchema.default("manual"),
4826
- defaultModelRef: ChatModelRefSchema.nullable().default(null),
4827
- roles: external_exports.array(SubagentRoleSettingsSchema).max(64).default(() => defaultSubagentRoleSettings()),
4828
- maxConcurrentRuns: external_exports.number().int().min(1).max(32).default(4),
4829
- maxConcurrentRunsPerProvider: external_exports.number().int().min(1).max(32).nullable().default(2),
4830
- maxConcurrentRunsPerWorkspaceTarget: external_exports.number().int().min(1).max(32).nullable().default(1)
4831
- }).transform((preferences) => ({
4832
- ...preferences,
4833
- roles: normalizeSubagentRoleSettings(preferences.roles)
4834
- }));
4835
- var SubagentRefSchema = external_exports.object({
4836
- kind: external_exports.enum(["session", "turn", "file", "diff", "artifact"]),
4837
- id: external_exports.string().trim().min(1).max(500),
4838
- label: external_exports.string().trim().min(1).max(500)
4839
- });
4840
- var SubagentEvidenceRetentionPolicySchema = external_exports.object({
4841
- kind: external_exports.enum(["retain_with_parent"]).default("retain_with_parent"),
4842
- messageRetentionDays: external_exports.number().int().min(1).max(3650).nullable().default(null),
4843
- artifactRetentionDays: external_exports.number().int().min(1).max(3650).nullable().default(null),
4844
- cleanupAfterExpiry: external_exports.boolean().default(false)
4845
- }).default(() => ({
4846
- kind: "retain_with_parent",
4847
- messageRetentionDays: null,
4848
- artifactRetentionDays: null,
4849
- cleanupAfterExpiry: false
4850
- }));
4851
- var SubagentProgressPhaseSchema = external_exports.enum(["orient", "edit", "validate", "report"]);
4852
- var SubagentValidationAttemptSchema = external_exports.object({
4853
- command: external_exports.string().trim().min(1).max(2e3),
4854
- status: external_exports.enum(["passed", "failed", "unknown"]).default("unknown"),
4855
- exitCode: external_exports.number().int().nullable().default(null),
4856
- outputSummary: external_exports.string().trim().max(5e3).nullable().default(null),
4857
- startedAt: external_exports.string().nullable().default(null),
4858
- completedAt: external_exports.string().nullable().default(null)
4859
- });
4860
- var SubagentProgressSchema = external_exports.object({
4861
- phase: SubagentProgressPhaseSchema.default("orient"),
4862
- inspectedFiles: external_exports.array(external_exports.string().trim().min(1).max(1e3)).max(500).default([]),
4863
- inspectedResources: external_exports.array(external_exports.string().trim().min(1).max(1e3)).max(500).default([]),
4864
- repeatedSearches: external_exports.array(external_exports.string().trim().min(1).max(1e3)).max(200).default([]),
4865
- repeatedReads: external_exports.array(external_exports.string().trim().min(1).max(1e3)).max(200).default([]),
4866
- repeatedCommands: external_exports.array(external_exports.string().trim().min(1).max(1e3)).max(200).default([]),
4867
- changedFiles: external_exports.array(external_exports.string().trim().min(1).max(1e3)).max(500).default([]),
4868
- patchRefs: external_exports.array(SubagentRefSchema).max(100).default([]),
4869
- validationAttempts: external_exports.array(SubagentValidationAttemptSchema).max(100).default([]),
4870
- latestMeaningfulActivity: external_exports.string().trim().max(5e3).nullable().default(null),
4871
- currentBlocker: external_exports.string().trim().max(5e3).nullable().default(null),
4872
- updatedAt: external_exports.string().nullable().default(null)
4873
- }).default(() => ({
4874
- phase: "orient",
4875
- inspectedFiles: [],
4876
- inspectedResources: [],
4877
- repeatedSearches: [],
4878
- repeatedReads: [],
4879
- repeatedCommands: [],
4880
- changedFiles: [],
4881
- patchRefs: [],
4882
- validationAttempts: [],
4883
- latestMeaningfulActivity: null,
4884
- currentBlocker: null,
4885
- updatedAt: null
4886
- }));
4887
- var SubagentReportSchema = external_exports.object({
4888
- summary: external_exports.string().trim().max(2e4).default(""),
4889
- findings: external_exports.array(external_exports.string().trim().min(1).max(5e3)).max(200).default([]),
4890
- artifacts: external_exports.array(SubagentRefSchema).max(200).default([]),
4891
- patchRef: SubagentRefSchema.nullable().default(null),
4892
- diffRef: SubagentRefSchema.nullable().default(null),
4893
- testsRun: external_exports.array(external_exports.string().trim().min(1).max(2e3)).max(100).default([]),
4894
- blockers: external_exports.array(external_exports.string().trim().min(1).max(5e3)).max(100).default([]),
4895
- confidence: external_exports.enum(["low", "medium", "high"]).nullable().default(null),
4896
- followUpNeeded: external_exports.boolean().default(false)
4897
- });
4898
- var SubagentRunSchema = external_exports.object({
4899
- id: external_exports.string().trim().min(1).max(200),
4900
- parentSessionId: external_exports.string().trim().min(1).max(200),
4901
- parentTurnId: external_exports.string().trim().min(1).max(200).nullable().default(null),
4902
- childSessionId: external_exports.string().trim().min(1).max(200).nullable().default(null),
4903
- roleId: SubagentRoleIdSchema,
4904
- objective: external_exports.string().trim().min(1).max(5e4),
4905
- modelRef: ChatModelRefSchema.nullable().default(null),
4906
- isolationMode: SubagentIsolationModeSchema.default("none"),
4907
- toolPolicy: SubagentToolPolicySchema.default("read_only"),
4908
- background: external_exports.boolean().default(true),
4909
- peerMessages: SubagentPeerMessagesSchema.default("parent_scoped"),
4910
- status: SubagentRunStatusSchema.default("queued"),
4911
- progress: SubagentProgressSchema,
4912
- evidenceRetention: SubagentEvidenceRetentionPolicySchema,
4913
- createdAt: external_exports.string(),
4914
- startedAt: external_exports.string().nullable().default(null),
4915
- completedAt: external_exports.string().nullable().default(null),
4916
- updatedAt: external_exports.string().nullable().default(null),
4917
- error: external_exports.string().nullable().default(null),
4918
- report: SubagentReportSchema.nullable().default(null),
4919
- metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional().default({})
4920
- });
4921
- var SubagentLifecycleActionSchema = external_exports.enum(["cleanup", "archive", "cleanup_and_archive"]);
4922
- var SubagentLifecycleActionRequestSchema = external_exports.object({
4923
- action: SubagentLifecycleActionSchema,
4924
- reason: external_exports.string().trim().min(1).max(2e3).nullable().default(null)
4925
- });
4926
- var SubagentLifecycleActionResponseSchema = external_exports.object({
4927
- action: SubagentLifecycleActionSchema,
4928
- run: SubagentRunSchema,
4929
- workspaceCleanup: external_exports.record(external_exports.string(), external_exports.unknown()).nullable().default(null),
4930
- sessionArchive: external_exports.record(external_exports.string(), external_exports.unknown()).nullable().default(null),
4931
- nextStep: external_exports.string()
4932
- });
4933
- var SubagentMessageKindSchema = external_exports.enum([
4934
- "question",
4935
- "answer",
4936
- "handoff",
4937
- "artifact",
4938
- "status",
4939
- "blocker"
4940
- ]);
4941
- var SubagentMessagePrioritySchema = external_exports.enum(["normal", "interrupt"]);
4942
- var SubagentMessageDeliverySchema = external_exports.object({
4943
- status: external_exports.enum(["pending", "delivered", "undelivered"]).default("pending"),
4944
- deliveredRunIds: external_exports.array(external_exports.string().trim().min(1).max(200)).max(200).default([]),
4945
- acknowledgedRunIds: external_exports.array(external_exports.string().trim().min(1).max(200)).max(200).default([]),
4946
- deliveredParentSessionId: external_exports.string().trim().min(1).max(200).nullable().default(null),
4947
- acknowledgedParentSessionId: external_exports.string().trim().min(1).max(200).nullable().default(null),
4948
- wakeRequestedParentSessionId: external_exports.string().trim().min(1).max(200).nullable().default(null),
4949
- wakeQueuedParentSessionId: external_exports.string().trim().min(1).max(200).nullable().default(null),
4950
- wakeDeferredParentSessionId: external_exports.string().trim().min(1).max(200).nullable().default(null),
4951
- wakeParentReason: external_exports.string().trim().min(1).max(1e3).nullable().default(null),
4952
- wakeRequestedRunIds: external_exports.array(external_exports.string().trim().min(1).max(200)).max(200).default([]),
4953
- wakeInterruptedRunIds: external_exports.array(external_exports.string().trim().min(1).max(200)).max(200).default([]),
4954
- wakeDeferredRunIds: external_exports.array(external_exports.string().trim().min(1).max(200)).max(200).default([]),
4955
- reason: external_exports.string().trim().min(1).max(1e3).nullable().default(null)
4956
- });
4957
- var SubagentMessageSchema = external_exports.object({
4958
- id: external_exports.string().trim().min(1).max(200),
4959
- fromRunId: external_exports.string().trim().min(1).max(200),
4960
- toRunId: external_exports.string().trim().min(1).max(200).nullable().default(null),
4961
- toRole: SubagentRoleIdSchema.nullable().default(null),
4962
- kind: SubagentMessageKindSchema,
4963
- priority: SubagentMessagePrioritySchema.optional(),
4964
- body: external_exports.string().trim().min(1).max(5e4),
4965
- refs: external_exports.array(SubagentRefSchema).max(100).default([]),
4966
- delivery: SubagentMessageDeliverySchema.optional(),
4967
- createdAt: external_exports.string()
4968
- });
4969
- function defaultSubagentRoleSettings() {
4970
- return SUBAGENT_ROLE_PRESETS.map((preset) => SubagentRoleSettingsSchema.parse({
4971
- id: preset.id,
4972
- toolPolicy: preset.defaultToolPolicy
4973
- }));
4974
- }
4975
- function normalizeSubagentRoleSettings(roles) {
4976
- const builtIns = defaultSubagentRoleSettings();
4977
- const roleById = new Map(builtIns.map((role) => [role.id, role]));
4978
- const customRoles = [];
4979
- for (const role of roles ?? []) {
4980
- const normalized = SubagentRoleSettingsSchema.parse(role);
4981
- if (roleById.has(normalized.id)) {
4982
- roleById.set(normalized.id, normalized);
4983
- } else {
4984
- customRoles.push(normalized);
4985
- }
4986
- }
4987
- return [...builtIns.map((role) => roleById.get(role.id) ?? role), ...customRoles];
4988
- }
4989
-
4990
- // ../../packages/contracts/dist/settings.js
4991
- var DEFAULT_CODEX_CHAT_MODEL = "gpt-5.6-sol";
4992
- var DEFAULT_OPENPOND_CHAT_MODEL = "openpond-chat";
4993
- var DEFAULT_HARNESS_REFINER_MODEL = "accounts/fireworks/models/deepseek-v4-flash";
4994
- var DEFAULT_CHAT_PROVIDER = "openpond";
4995
- var DEFAULT_CHAT_MODEL = DEFAULT_OPENPOND_CHAT_MODEL;
4996
- var DEFAULT_CODEX_PERMISSION_MODE = "default";
4997
- var DEFAULT_CODEX_REASONING_EFFORT = "high";
4998
- var DEFAULT_OPENPOND_COMMAND_ACCESS_MODE = "ask";
4999
- var ChatProviderSchema = ProviderIdSchema;
5000
- var CodexPermissionModeSchema = external_exports.enum(["default", "auto-review", "full-access"]);
5001
- var OpenPondCommandAccessModeSchema = external_exports.enum(["ask", "full-access", "disabled"]);
5002
- var CodexReasoningEffortSchema = external_exports.enum(["low", "medium", "high", "xhigh"]);
5003
- var WorkspaceKindSchema = external_exports.enum([
5004
- "sandbox_app",
5005
- "local_project",
5006
- "sandbox",
5007
- "sandbox_template"
5008
- ]);
5009
- var HostedContextProviderSchema = external_exports.enum(["openpond"]);
5010
- var ContextUsageSourceSchema = external_exports.enum(["provider_usage", "provider_tokenizer", "model_family", "heuristic"]);
5011
- var ContextUsageSnapshotSchema = external_exports.object({
5012
- provider: ChatProviderSchema,
5013
- model: external_exports.string().min(1),
5014
- usedTokens: external_exports.number().int().nonnegative(),
5015
- maxContextTokens: external_exports.number().int().positive(),
5016
- usableContextTokens: external_exports.number().int().positive(),
5017
- percentFull: external_exports.number().min(0).max(100),
5018
- source: ContextUsageSourceSchema,
5019
- updatedAtEventId: external_exports.string().nullable()
5020
- });
5021
- var SidebarSectionsCollapsedSchema = external_exports.object({
5022
- pinned: external_exports.boolean().default(false),
5023
- projects: external_exports.boolean().default(false),
5024
- cloudProjects: external_exports.boolean().default(false),
5025
- chats: external_exports.boolean().default(false),
5026
- savedForLater: external_exports.boolean().default(true)
5027
- });
5028
- var WorkspaceLspGlobalModeSchema = external_exports.enum(["auto", "off"]);
5029
- var WorkspaceLspLanguageIdSchema = external_exports.enum(["typescript", "python", "rust"]);
5030
- var WorkspaceLspLanguageModeSchema = external_exports.enum(["auto", "disabled", "custom"]);
5031
- var WorkspaceLspLanguagePreferenceSchema = external_exports.object({
5032
- mode: WorkspaceLspLanguageModeSchema.default("auto"),
5033
- customCommand: external_exports.string().trim().max(4096).default("")
5034
- });
5035
- var WorkspaceEditorPreferencesSchema = external_exports.object({
5036
- languageServers: WorkspaceLspGlobalModeSchema.default("auto"),
5037
- diagnosticsWhileEditing: external_exports.boolean().default(true),
5038
- checkOnSave: external_exports.boolean().default(true),
5039
- languages: external_exports.object({
5040
- typescript: WorkspaceLspLanguagePreferenceSchema.optional().default(() => WorkspaceLspLanguagePreferenceSchema.parse({})),
5041
- python: WorkspaceLspLanguagePreferenceSchema.optional().default(() => WorkspaceLspLanguagePreferenceSchema.parse({})),
5042
- rust: WorkspaceLspLanguagePreferenceSchema.optional().default(() => WorkspaceLspLanguagePreferenceSchema.parse({}))
5043
- }).optional().default(() => ({
5044
- typescript: WorkspaceLspLanguagePreferenceSchema.parse({}),
5045
- python: WorkspaceLspLanguagePreferenceSchema.parse({}),
5046
- rust: WorkspaceLspLanguagePreferenceSchema.parse({})
5047
- }))
5048
- });
5049
- var WorkspaceLspSettingsStatusSchema = external_exports.object({
5050
- language: WorkspaceLspLanguageIdSchema,
5051
- label: external_exports.string(),
5052
- mode: WorkspaceLspLanguageModeSchema,
5053
- status: external_exports.enum(["found", "missing", "disabled", "error"]),
5054
- command: external_exports.string().nullable(),
5055
- message: external_exports.string().nullable()
5056
- });
5057
- var WorkspaceLspSettingsStatusResponseSchema = external_exports.object({
5058
- settings: WorkspaceEditorPreferencesSchema,
5059
- languages: external_exports.array(WorkspaceLspSettingsStatusSchema),
5060
- updatedAt: external_exports.string()
5061
- });
5062
- var WorkspaceLspRuntimeClientStatusSchema = external_exports.object({
5063
- id: external_exports.string(),
5064
- root: external_exports.string(),
5065
- status: external_exports.enum(["starting", "connected", "unavailable", "error"]),
5066
- message: external_exports.string().nullable().optional().default(null),
5067
- openedDocuments: external_exports.number().int().nonnegative(),
5068
- pendingRequests: external_exports.number().int().nonnegative(),
5069
- lastUsedAt: external_exports.string(),
5070
- stderrTail: external_exports.string()
5071
- });
5072
- var WorkspaceLspRuntimeStatusResponseSchema = external_exports.object({
5073
- clients: external_exports.array(WorkspaceLspRuntimeClientStatusSchema),
5074
- maxClients: external_exports.number().int().positive(),
5075
- idleTimeoutMs: external_exports.number().int().positive(),
5076
- updatedAt: external_exports.string()
5077
- });
5078
- var ContextCompactionPreferencesSchema = external_exports.object({
5079
- autoEnabled: external_exports.boolean().default(true),
5080
- triggerPercent: external_exports.number().int().min(50).max(95).default(85),
5081
- summaryModel: external_exports.enum(["same_model"]).default("same_model")
5082
- });
5083
- var TrainingPreferencesSchema = external_exports.object({
5084
- defaultModelRef: ChatModelRefSchema.nullable().default(null),
5085
- creationMode: external_exports.enum(["defaults", "customize"]).default("customize"),
5086
- autoApproveEvidence: external_exports.boolean().default(false)
5087
- });
5088
- var AppPreferencesSchema = external_exports.object({
5089
- defaultChatProvider: ChatProviderSchema.default(DEFAULT_CHAT_PROVIDER),
5090
- defaultChatModel: external_exports.string().min(1).default(DEFAULT_CHAT_MODEL),
5091
- defaultChatModelRef: ChatModelRefSchema.nullable().optional(),
5092
- subagents: SubagentPreferencesSchema.optional().default(() => SubagentPreferencesSchema.parse({})),
5093
- codexPermissionMode: CodexPermissionModeSchema.default(DEFAULT_CODEX_PERMISSION_MODE),
5094
- codexReasoningEffort: CodexReasoningEffortSchema.default(DEFAULT_CODEX_REASONING_EFFORT),
5095
- openPondCommandAccessMode: OpenPondCommandAccessModeSchema.default(DEFAULT_OPENPOND_COMMAND_ACCESS_MODE),
5096
- defaultBranchPrefix: external_exports.string().trim().max(48).default("feat/"),
5097
- defaultNewProjectDirectory: external_exports.string().trim().max(4096).default(""),
5098
- defaultTeamId: external_exports.string().trim().max(191).nullable().default(null),
5099
- advancedWorkspaceControls: external_exports.boolean().default(false),
5100
- steerActiveResponses: external_exports.boolean().default(true),
5101
- contextCompaction: ContextCompactionPreferencesSchema.optional().default(() => ContextCompactionPreferencesSchema.parse({})),
5102
- training: TrainingPreferencesSchema.optional().default(() => TrainingPreferencesSchema.parse({})),
5103
- sidebarWidth: external_exports.number().int().min(244).max(560).default(332),
5104
- diffPanelWidth: external_exports.number().int().min(320).max(2400).default(560),
5105
- sidebarSectionsCollapsed: SidebarSectionsCollapsedSchema.optional().default(() => SidebarSectionsCollapsedSchema.parse({})),
5106
- editor: WorkspaceEditorPreferencesSchema.optional().default(() => WorkspaceEditorPreferencesSchema.parse({}))
5107
- });
5108
- var DEFAULT_PERSONALIZATION_TEMPLATE_ID = "default";
5109
- var PERSONALIZATION_TEMPLATES = [
5110
- {
5111
- id: "default",
5112
- name: "Balanced",
5113
- source: "built_in",
5114
- description: "Clear, useful, and concise.",
5115
- content: "You are OpenPond Chat, a clear and useful AI assistant.\nBe concise, accurate, and direct.\nDo not use emojis.\nAsk only when missing information would materially change the answer.\nPrioritize practical next steps."
5116
- },
5117
- {
5118
- id: "pragmatic",
5119
- name: "Pragmatic",
5120
- source: "built_in",
5121
- description: "Direct, practical, and engineering-minded.",
5122
- content: "You are a pragmatic AI assistant with strong engineering judgment.\nBe direct, concrete, and outcome-focused.\nDo not use emojis.\nPrefer simple working solutions over clever abstractions.\nCall out weak assumptions plainly."
5123
- },
5124
- {
5125
- id: "friendly",
5126
- name: "Friendly",
5127
- source: "built_in",
5128
- description: "Warm, conversational, and approachable.",
5129
- content: "You are a friendly AI assistant.\nUse a warm, conversational tone without filler.\nDo not use emojis.\nExplain decisions clearly and keep the user moving.\nBe patient when clarifying tradeoffs."
5130
- },
5131
- {
5132
- id: "formal",
5133
- name: "Formal",
5134
- source: "built_in",
5135
- description: "Polished, careful, and professional.",
5136
- content: "You are a formal AI assistant.\nUse precise, professional language.\nDo not use emojis.\nStructure answers clearly and avoid casual phrasing.\nState uncertainty and assumptions explicitly."
5137
- },
5138
- {
5139
- id: "technical",
5140
- name: "Technical",
5141
- source: "built_in",
5142
- description: "Precise, detailed, and implementation-focused.",
5143
- content: "You are a technical AI assistant.\nPrioritize correctness, implementation detail, and edge cases.\nDo not use emojis.\nUse concise explanations, but include necessary specifics.\nSurface risks, constraints, and verification steps."
5144
- }
5145
- ];
5146
- var PersonalizationTemplateIdSchema = external_exports.string().trim().min(1).max(120);
5147
- var PersonalizationTemplateSchema = external_exports.object({
5148
- id: PersonalizationTemplateIdSchema,
5149
- name: external_exports.string(),
5150
- source: external_exports.enum(["built_in", "custom"]).default("custom"),
5151
- description: external_exports.string(),
5152
- content: external_exports.string()
5153
- });
5154
- var PersonalizationSettingsSchema = external_exports.object({
5155
- activeTemplateId: PersonalizationTemplateIdSchema.default(DEFAULT_PERSONALIZATION_TEMPLATE_ID),
5156
- customized: external_exports.boolean().default(false),
5157
- soul: external_exports.string(),
5158
- soulPath: external_exports.string().nullable(),
5159
- updatedAt: external_exports.string().nullable(),
5160
- templates: external_exports.array(PersonalizationTemplateSchema).default(() => [...PERSONALIZATION_TEMPLATES])
5161
- });
5162
- var ServerStatusSchema = external_exports.object({
5163
- id: external_exports.string(),
5164
- host: external_exports.string(),
5165
- port: external_exports.number(),
5166
- startedAt: external_exports.string(),
5167
- storePath: external_exports.string(),
5168
- version: external_exports.string(),
5169
- runtimeVersion: external_exports.string()
5170
- });
5171
-
5172
4418
  // ../../packages/contracts/dist/create-pipeline.js
5173
4419
  var NullableStringSchema = external_exports.string().trim().min(1).nullable();
5174
4420
  var MetadataSchema = external_exports.record(external_exports.string(), external_exports.unknown()).default({});
@@ -6354,6 +5600,7 @@ var ReorderSidebarAppsRequestSchema = external_exports.object({
6354
5600
  appIds: external_exports.array(external_exports.string()).min(1)
6355
5601
  });
6356
5602
  var UpdateAppPreferencesRequestSchema = external_exports.object({
5603
+ expectedRevision: external_exports.string().optional(),
6357
5604
  defaultChatProvider: ChatProviderSchema.optional(),
6358
5605
  defaultChatModel: external_exports.string().min(1).optional(),
6359
5606
  defaultChatModelRef: ChatModelRefSchema.nullable().optional(),
@@ -7379,6 +6626,7 @@ var BootstrapPayloadSchema = external_exports.object({
7379
6626
  server: ServerStatusSchema,
7380
6627
  account: AccountStateSchema,
7381
6628
  codex: CodexStatusSchema,
6629
+ configuration: external_exports.object({ rawRevision: external_exports.string(), effectiveRevision: external_exports.string(), sources: external_exports.array(external_exports.object({ layer: external_exports.string(), path: external_exports.string(), revision: external_exports.string() })), provenance: external_exports.record(external_exports.string(), external_exports.object({ layer: external_exports.string(), path: external_exports.string(), revision: external_exports.string() })) }).optional(),
7382
6630
  preferences: AppPreferencesSchema.optional().default(() => AppPreferencesSchema.parse({})),
7383
6631
  providers: ProviderSettingsSchema.optional().default(() => ProviderSettingsSchema.parse({})),
7384
6632
  personalization: PersonalizationSettingsSchema.optional().default(() => PersonalizationSettingsSchema.parse({
@@ -8013,6 +7261,9 @@ var LocalAgentScheduleSchema = external_exports.object({
8013
7261
  var LocalAgentScheduleRunSchema = external_exports.object({
8014
7262
  id: external_exports.string(),
8015
7263
  scheduleId: external_exports.string(),
7264
+ definitionSnapshot: LocalAgentScheduleSchema.optional(),
7265
+ configurationSnapshot: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
7266
+ inputSnapshot: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
8016
7267
  localProjectId: external_exports.string(),
8017
7268
  scheduleName: external_exports.string(),
8018
7269
  scheduledFor: external_exports.string(),
@@ -8182,6 +7433,8 @@ var ChatWorkflowSchema = external_exports.object({
8182
7433
  updatedAt: external_exports.string()
8183
7434
  });
8184
7435
  var ChatWorkflowRunSchema = external_exports.object({
7436
+ definitionSnapshot: ChatWorkflowSchema.optional(),
7437
+ configurationSnapshot: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
8185
7438
  id: external_exports.string(),
8186
7439
  workflowId: external_exports.string(),
8187
7440
  sessionId: external_exports.string(),
@@ -13938,12 +13191,12 @@ var ResolvedTrainingPlanSchema = external_exports.object({
13938
13191
  ["compute", plan.compute, plan.manifest.computeTarget],
13939
13192
  ["engine", plan.engine, plan.manifest.engine]
13940
13193
  ];
13941
- for (const [path11, actual, expected] of exactBindings) {
13194
+ for (const [path10, actual, expected] of exactBindings) {
13942
13195
  if (JSON.stringify(actual) !== JSON.stringify(expected)) {
13943
13196
  context.addIssue({
13944
13197
  code: "custom",
13945
- path: [path11],
13946
- message: `${path11} must exactly match the Harness Run Manifest`
13198
+ path: [path10],
13199
+ message: `${path10} must exactly match the Harness Run Manifest`
13947
13200
  });
13948
13201
  }
13949
13202
  }
@@ -14165,11 +13418,11 @@ export {
14165
13418
  updateAppCodeVisibility,
14166
13419
  getAppEnvironment,
14167
13420
  getOpenPondAccount,
13421
+ updateGlobalConfig,
14168
13422
  loadGlobalConfig,
14169
13423
  listConfiguredProfiles,
14170
13424
  setActiveProfile,
14171
13425
  saveProfileApiKey,
14172
- saveConfig,
14173
13426
  executeConnectedAppToolCall,
14174
13427
  GithubExtensionError,
14175
13428
  parseProfileSkillMarkdown,
@@ -14205,29 +13458,6 @@ export {
14205
13458
  commitActiveProfileChanges,
14206
13459
  saveProfilePushStatus,
14207
13460
  runProfileSkillCommand,
14208
- PROVIDER_IDS,
14209
- ProviderIdSchema,
14210
- ProviderCredentialStatusSchema,
14211
- ProviderCapabilitiesSchema,
14212
- ProviderModelSchema,
14213
- ProviderModelCacheSchema,
14214
- ProviderConfigSchema,
14215
- ProviderCatalogProviderSchema,
14216
- ProviderCatalogSchema,
14217
- ProviderStatusSchema,
14218
- ProviderSettingsSchema,
14219
- ChatModelRefSchema,
14220
- ProviderCredentialWriteRequestSchema,
14221
- ProviderCredentialDeleteRequestSchema,
14222
- ProviderValidationRequestSchema,
14223
- ProviderModelsRequestSchema,
14224
- ProviderModelsRefreshRequestSchema,
14225
- SUBAGENT_ROLE_PRESETS,
14226
- SubagentProgressSchema,
14227
- SubagentRunSchema,
14228
- SubagentLifecycleActionRequestSchema,
14229
- SubagentMessageDeliverySchema,
14230
- SubagentMessageSchema,
14231
13461
  SessionUserQuestionSchema,
14232
13462
  SessionUserQuestionResolutionSchema,
14233
13463
  TerminalScopeSchema,
@@ -14252,23 +13482,6 @@ export {
14252
13482
  normalizeSidebarFilePath,
14253
13483
  sidebarFileBookmarkId,
14254
13484
  AccountStateSchema,
14255
- DEFAULT_CODEX_CHAT_MODEL,
14256
- DEFAULT_OPENPOND_CHAT_MODEL,
14257
- DEFAULT_HARNESS_REFINER_MODEL,
14258
- DEFAULT_CHAT_PROVIDER,
14259
- DEFAULT_CODEX_REASONING_EFFORT,
14260
- DEFAULT_OPENPOND_COMMAND_ACCESS_MODE,
14261
- ChatProviderSchema,
14262
- OpenPondCommandAccessModeSchema,
14263
- CodexReasoningEffortSchema,
14264
- ContextUsageSnapshotSchema,
14265
- WorkspaceEditorPreferencesSchema,
14266
- WorkspaceLspSettingsStatusResponseSchema,
14267
- WorkspaceLspRuntimeStatusResponseSchema,
14268
- AppPreferencesSchema,
14269
- DEFAULT_PERSONALIZATION_TEMPLATE_ID,
14270
- PERSONALIZATION_TEMPLATES,
14271
- PersonalizationSettingsSchema,
14272
13485
  ExperienceSchema,
14273
13486
  DEFAULT_SESSION_EXPERIENCE,
14274
13487
  CreateImproveEvidenceSnapshotSchema,
@@ -14342,6 +13555,7 @@ export {
14342
13555
  HostedSavedWorkResponseSchema,
14343
13556
  CreateHostedSavedWorkRequestSchema,
14344
13557
  UpdateHostedSavedWorkRequestSchema,
13558
+ ChatWorkflowSchema,
14345
13559
  CreateChatWorkflowRequestSchema,
14346
13560
  UpdateChatWorkflowRequestSchema,
14347
13561
  TeamChatMemberSchema,