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
@@ -3,6 +3,16 @@ import {
3
3
  DEFAULT_OPENPOND_API_BASE_URL,
4
4
  DEFAULT_OPENPOND_WEB_BASE_URL
5
5
  } from "./chunk-KSRWKXRB.js";
6
+ import {
7
+ initializeHome,
8
+ readAccountConfiguration,
9
+ readCache,
10
+ updateAccountConfiguration,
11
+ writeCache
12
+ } from "./chunk-4KA25HUP.js";
13
+ import {
14
+ resolveOpenPondHome
15
+ } from "./chunk-ZNQEROWP.js";
6
16
 
7
17
  // ../../packages/cloud/src/api/core.ts
8
18
  var DEFAULT_API_TIMEOUT_MS = 3e4;
@@ -614,87 +624,7 @@ async function executeHostedTool(baseUrl, token, payload) {
614
624
  }
615
625
 
616
626
  // ../../packages/cloud/src/config.ts
617
- import { promises as fs2 } from "node:fs";
618
- import path2 from "node:path";
619
-
620
- // ../../packages/cloud/src/private-json-file.ts
621
- import { randomUUID } from "node:crypto";
622
- import { promises as fs } from "node:fs";
623
- import os from "node:os";
624
627
  import path from "node:path";
625
- var LOCK_WAIT_TIMEOUT_MS = 1e4;
626
- var STALE_LOCK_MS = 6e4;
627
- function openPondConfigDirectory() {
628
- const override = process.env.OPENPOND_CONFIG_DIR?.trim();
629
- return override || path.join(os.homedir(), ".openpond");
630
- }
631
- async function writePrivateJsonFile(filePath, value) {
632
- await withPrivateJsonFileLock(filePath, () => writePrivateJsonFileUnlocked(filePath, value));
633
- }
634
- async function updatePrivateJsonFile(filePath, fallback, update) {
635
- return withPrivateJsonFileLock(filePath, async () => {
636
- const current = await readJsonFile(filePath, fallback);
637
- const next = await update(current);
638
- await writePrivateJsonFileUnlocked(filePath, next);
639
- return next;
640
- });
641
- }
642
- async function writePrivateJsonFileUnlocked(filePath, value) {
643
- const directory = path.dirname(filePath);
644
- await fs.mkdir(directory, { recursive: true, mode: 448 });
645
- await fs.chmod(directory, 448).catch(() => void 0);
646
- const temporaryPath = `${filePath}.${process.pid}.${randomUUID()}.tmp`;
647
- try {
648
- await fs.writeFile(temporaryPath, JSON.stringify(value, null, 2), {
649
- encoding: "utf-8",
650
- mode: 384
651
- });
652
- await fs.rename(temporaryPath, filePath);
653
- await fs.chmod(filePath, 384).catch(() => void 0);
654
- } finally {
655
- await fs.rm(temporaryPath, { force: true }).catch(() => void 0);
656
- }
657
- }
658
- async function withPrivateJsonFileLock(filePath, operation) {
659
- const directory = path.dirname(filePath);
660
- await fs.mkdir(directory, { recursive: true, mode: 448 });
661
- await fs.chmod(directory, 448).catch(() => void 0);
662
- const lockPath = `${filePath}.lock`;
663
- const deadline = Date.now() + LOCK_WAIT_TIMEOUT_MS;
664
- while (true) {
665
- try {
666
- await fs.mkdir(lockPath, { mode: 448 });
667
- break;
668
- } catch (error) {
669
- if (error.code !== "EEXIST") throw error;
670
- await removeStaleLock(lockPath);
671
- if (Date.now() >= deadline) throw new Error(`Timed out waiting for private file lock: ${filePath}`);
672
- await new Promise((resolve) => setTimeout(resolve, 20 + Math.floor(Math.random() * 30)));
673
- }
674
- }
675
- try {
676
- return await operation();
677
- } finally {
678
- await fs.rm(lockPath, { recursive: true, force: true }).catch(() => void 0);
679
- }
680
- }
681
- async function readJsonFile(filePath, fallback) {
682
- try {
683
- return JSON.parse(await fs.readFile(filePath, "utf8"));
684
- } catch (error) {
685
- if (error.code === "ENOENT") return fallback();
686
- throw error;
687
- }
688
- }
689
- async function removeStaleLock(lockPath) {
690
- const stats = await fs.stat(lockPath).catch(() => null);
691
- if (stats && Date.now() - stats.mtimeMs > STALE_LOCK_MS) {
692
- await fs.rm(lockPath, { recursive: true, force: true });
693
- }
694
- }
695
-
696
- // ../../packages/cloud/src/config.ts
697
- var GLOBAL_CONFIG_FILENAME = "config.json";
698
628
  var DEFAULT_ACCOUNT_HANDLE = "default";
699
629
  var ACCOUNT_SCOPED_KEYS = [
700
630
  "apiKey",
@@ -705,21 +635,6 @@ var ACCOUNT_SCOPED_KEYS = [
705
635
  "appId",
706
636
  "conversationId"
707
637
  ];
708
- function getGlobalConfigPath() {
709
- return path2.join(openPondConfigDirectory(), GLOBAL_CONFIG_FILENAME);
710
- }
711
- async function loadConfigFile(filePath) {
712
- try {
713
- const raw = await fs2.readFile(filePath, "utf-8");
714
- return JSON.parse(raw);
715
- } catch (error) {
716
- if (error.code === "ENOENT") return {};
717
- if (error instanceof SyntaxError) {
718
- throw new Error(`OpenPond config is malformed JSON: ${filePath}`, { cause: error });
719
- }
720
- throw error;
721
- }
722
- }
723
638
  function hasOwn(value, key) {
724
639
  return Object.prototype.hasOwnProperty.call(value, key);
725
640
  }
@@ -843,7 +758,7 @@ function sanitizeLocalOpenPondProfile(value) {
843
758
  if (!entry) return [];
844
759
  const rawEntry = value2;
845
760
  const source = rawEntry.source === "github" || rawEntry.source === "openpond_git" ? rawEntry.source : "local";
846
- const repositoryId = typeof rawEntry.repositoryId === "string" && rawEntry.repositoryId.trim() ? rawEntry.repositoryId.trim() : path2.resolve(entry.repoPath);
761
+ const repositoryId = typeof rawEntry.repositoryId === "string" && rawEntry.repositoryId.trim() ? rawEntry.repositoryId.trim() : path.resolve(entry.repoPath);
847
762
  return [{
848
763
  source,
849
764
  repositoryId,
@@ -1266,22 +1181,18 @@ function applyTopLevelPatch(global, source) {
1266
1181
  }
1267
1182
  }
1268
1183
  async function updateGlobalConfig(update) {
1269
- try {
1270
- return await updatePrivateJsonFile(getGlobalConfigPath(), () => ({}), (raw) => {
1271
- const current = normalizeGlobalConfig(raw);
1272
- update(current);
1273
- return current;
1274
- });
1275
- } catch (error) {
1276
- if (error instanceof SyntaxError) {
1277
- throw new Error(`OpenPond config is malformed JSON: ${getGlobalConfigPath()}`, { cause: error });
1278
- }
1279
- throw error;
1280
- }
1184
+ const home = resolveOpenPondHome();
1185
+ await initializeHome(home);
1186
+ return await updateAccountConfiguration(home, (raw) => {
1187
+ const current = normalizeGlobalConfig(raw);
1188
+ update(current);
1189
+ return current;
1190
+ });
1281
1191
  }
1282
1192
  async function loadGlobalConfig() {
1283
- const raw = await loadConfigFile(getGlobalConfigPath());
1284
- return normalizeGlobalConfig(raw);
1193
+ const home = resolveOpenPondHome();
1194
+ await initializeHome(home);
1195
+ return normalizeGlobalConfig(await readAccountConfiguration(home));
1285
1196
  }
1286
1197
  async function loadConfig(options = {}) {
1287
1198
  const global = await loadGlobalConfig();
@@ -1389,93 +1300,27 @@ async function saveGlobalConfig(next) {
1389
1300
  }
1390
1301
 
1391
1302
  // ../../packages/cloud/src/cache.ts
1392
- import { promises as fs3 } from "node:fs";
1393
1303
  import { createHash } from "node:crypto";
1394
- import path3 from "node:path";
1395
- var CACHE_FILENAME = "cache.json";
1396
1304
  var DEFAULT_CACHE_TTL_MS = 60 * 60 * 1e3;
1397
- function getCachePath() {
1398
- return path3.join(openPondConfigDirectory(), CACHE_FILENAME);
1305
+ function buildCacheKey(scope) {
1306
+ return createHash("sha256").update(JSON.stringify([scope.apiBase.replace(/\/$/, ""), scope.apiKey.trim()])).digest("hex");
1399
1307
  }
1400
- function buildCacheKey(apiBase, apiKey) {
1401
- const credentialHash = createHash("sha256").update(apiKey.trim()).digest("hex");
1402
- try {
1403
- const host = new URL(apiBase).host;
1404
- return `${host}:${credentialHash}`;
1405
- } catch {
1406
- return `${apiBase}:${credentialHash}`;
1407
- }
1408
- }
1409
- function isFresh(updatedAt, ttlMs) {
1410
- const timestamp = Date.parse(updatedAt);
1411
- if (Number.isNaN(timestamp)) {
1412
- return false;
1413
- }
1414
- return Date.now() - timestamp < ttlMs;
1415
- }
1416
- async function loadCache() {
1417
- try {
1418
- const raw = await fs3.readFile(getCachePath(), "utf-8");
1419
- const parsed = JSON.parse(raw);
1420
- if (!parsed || typeof parsed !== "object" || !parsed.byKey) {
1421
- return emptyCacheStore();
1422
- }
1423
- return parsed;
1424
- } catch {
1425
- return emptyCacheStore();
1426
- }
1427
- }
1428
- function emptyCacheStore() {
1429
- return { version: 1, byKey: {} };
1308
+ async function cached(namespace, params) {
1309
+ const entry = await readCache(resolveOpenPondHome(), namespace, buildCacheKey(params), { allowStale: true });
1310
+ if (!entry || Date.now() - Date.parse(entry.updatedAt) >= (params.ttlMs ?? DEFAULT_CACHE_TTL_MS)) return null;
1311
+ return entry.payload;
1430
1312
  }
1431
1313
  async function getCachedApps(params) {
1432
- const ttlMs = params.ttlMs ?? DEFAULT_CACHE_TTL_MS;
1433
- const store = await loadCache();
1434
- const cacheKey = buildCacheKey(params.apiBase, params.apiKey);
1435
- const entry = store.byKey[cacheKey]?.apps;
1436
- if (!entry || !isFresh(entry.updatedAt, ttlMs)) {
1437
- return null;
1438
- }
1439
- return Array.isArray(entry.items) ? entry.items : null;
1314
+ return cached("cloud.apps", params);
1440
1315
  }
1441
1316
  async function setCachedApps(params) {
1442
- await mutateCache((store) => {
1443
- const cacheKey = buildCacheKey(params.apiBase, params.apiKey);
1444
- const bucket = store.byKey[cacheKey] || {};
1445
- bucket.apps = {
1446
- items: params.apps,
1447
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
1448
- };
1449
- store.byKey[cacheKey] = bucket;
1450
- });
1317
+ await writeCache(resolveOpenPondHome(), "cloud.apps", buildCacheKey(params), params.apps);
1451
1318
  }
1452
1319
  async function getCachedTools(params) {
1453
- const ttlMs = params.ttlMs ?? DEFAULT_CACHE_TTL_MS;
1454
- const store = await loadCache();
1455
- const cacheKey = buildCacheKey(params.apiBase, params.apiKey);
1456
- const entry = store.byKey[cacheKey]?.tools;
1457
- if (!entry || !isFresh(entry.updatedAt, ttlMs)) {
1458
- return null;
1459
- }
1460
- return Array.isArray(entry.items) ? entry.items : null;
1320
+ return cached("cloud.tools", params);
1461
1321
  }
1462
1322
  async function setCachedTools(params) {
1463
- await mutateCache((store) => {
1464
- const cacheKey = buildCacheKey(params.apiBase, params.apiKey);
1465
- const bucket = store.byKey[cacheKey] || {};
1466
- bucket.tools = {
1467
- items: params.tools,
1468
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
1469
- };
1470
- store.byKey[cacheKey] = bucket;
1471
- });
1472
- }
1473
- async function mutateCache(mutate) {
1474
- await updatePrivateJsonFile(getCachePath(), emptyCacheStore, (raw) => {
1475
- const store = raw && typeof raw === "object" && raw.byKey ? raw : emptyCacheStore();
1476
- mutate(store);
1477
- return store;
1478
- });
1323
+ await writeCache(resolveOpenPondHome(), "cloud.tools", buildCacheKey(params), params.tools);
1479
1324
  }
1480
1325
 
1481
1326
  // ../../packages/cloud/src/sandbox/types/runtime-profiles.ts
@@ -1513,9 +1358,6 @@ export {
1513
1358
  submitBacktestTx,
1514
1359
  submitBacktestDetail,
1515
1360
  executeHostedTool,
1516
- openPondConfigDirectory,
1517
- writePrivateJsonFile,
1518
- updatePrivateJsonFile,
1519
1361
  loadGlobalConfig,
1520
1362
  loadConfig,
1521
1363
  listConfiguredProfiles,
@@ -3,7 +3,7 @@ import {
3
3
  materializeSourceUploadFile,
4
4
  readSourceUploadCache,
5
5
  writeSourceUploadCache
6
- } from "./chunk-J3YDKJFD.js";
6
+ } from "./chunk-3ELF4FXY.js";
7
7
  import {
8
8
  formatSandboxTemplateDiagnostics,
9
9
  validateSandboxTemplateYaml
@@ -15,7 +15,7 @@ import {
15
15
  parseSandboxRuntimePromotionPolicyOption,
16
16
  parseSandboxWorkflowModeOption,
17
17
  runProcessCommand
18
- } from "./chunk-HFPUR4CQ.js";
18
+ } from "./chunk-3VEYNDHN.js";
19
19
  import {
20
20
  optionString,
21
21
  optionalJsonObject,
@@ -15,20 +15,7 @@ import {
15
15
  resolveRepoUrl,
16
16
  runCommand,
17
17
  warnOnRepoHostMismatch
18
- } from "./chunk-HFPUR4CQ.js";
19
- import {
20
- normalizeTemplateRepoUrl,
21
- resolveApiBaseUrlOption,
22
- resolveBaseUrl,
23
- resolveBaseUrlOption,
24
- resolveChatApiBaseUrlOption,
25
- resolvePublicApiBaseUrl
26
- } from "./chunk-SMNFI2FU.js";
27
- import {
28
- compareSemver,
29
- fetchLatestNpmVersion,
30
- getInstalledCliVersion
31
- } from "./chunk-N3TGCM7J.js";
18
+ } from "./chunk-3VEYNDHN.js";
32
19
  import {
33
20
  checkOpenPondApiHealth,
34
21
  createHeadlessApps,
@@ -45,7 +32,20 @@ import {
45
32
  saveProfileApiKey,
46
33
  setActiveProfile,
47
34
  submitBacktestRun
48
- } from "./chunk-D7BO5Y5J.js";
35
+ } from "./chunk-FJ2JGB2N.js";
36
+ import {
37
+ normalizeTemplateRepoUrl,
38
+ resolveApiBaseUrlOption,
39
+ resolveBaseUrl,
40
+ resolveBaseUrlOption,
41
+ resolveChatApiBaseUrlOption,
42
+ resolvePublicApiBaseUrl
43
+ } from "./chunk-SMNFI2FU.js";
44
+ import {
45
+ compareSemver,
46
+ fetchLatestNpmVersion,
47
+ getInstalledCliVersion
48
+ } from "./chunk-7RIGZB7N.js";
49
49
  import {
50
50
  parseBooleanOption,
51
51
  parseJsonOption,
@@ -106,7 +106,7 @@ async function runLogin(options) {
106
106
  chatApiBaseUrl: config.chatApiBaseUrl,
107
107
  setActive: true
108
108
  });
109
- console.log("saved api key to ~/.openpond/config.json");
109
+ console.log("Saved account credentials to the encrypted OpenPond credential store.");
110
110
  }
111
111
  async function runProfiles(options, rest) {
112
112
  const subcommand = rest[0] || "list";
@@ -3,10 +3,8 @@ import { createRequire as __openpondCreateRequire } from "node:module"; var requ
3
3
  // ../server/src/constants.ts
4
4
  var DEFAULT_HOST = "127.0.0.1";
5
5
  var DEFAULT_PORT = 17874;
6
- var VERSION = "0.1.0";
6
+ var VERSION = "0.2.0";
7
7
  var HOSTED_CHAT_SYSTEM_PROMPT = "You are OpenPond Chat. Respond in the user's language. If the user's latest message is language-neutral, ambiguous, or only a short test, respond in English. Be concise and directly answer the latest request. Do not use emojis. Use Markdown when it improves scanability. If you emit reasoning or thinking content, keep it sparse and user-readable: at most one short sentence for major progress, decisions, or blockers. Omit reasoning for routine searches, reads, tool calls, and obvious next steps. Do not restate the user request, narrate every action, or include code blocks, code excerpts, diffs, raw tool payloads, or markdown examples in reasoning. Put necessary code or exact snippets only in the final assistant answer. When the user asks to show or preview an image that is available as a workspace path or signed image URL, use Markdown image syntax like ![description](path-or-url) instead of a bare path or raw HTML. For workspace-backed answers, use a Codex-style shape: brief outcome first, then Changed Files if files changed, then Verification if checks ran. End with a concise final answer that summarizes the result and verification when relevant. Do not mention raw tool JSON, internal repo paths, or origin/remote URLs unless the user explicitly asks for them or they are necessary to explain a git/deploy failure.";
8
- var APP_PREFERENCES_CACHE_TYPE = "app_preferences";
9
- var APP_PREFERENCES_CACHE_KEY = "global";
10
8
 
11
9
  // ../server/src/utils.ts
12
10
  import { randomUUID } from "node:crypto";
@@ -59,8 +57,6 @@ export {
59
57
  DEFAULT_PORT,
60
58
  VERSION,
61
59
  HOSTED_CHAT_SYSTEM_PROMPT,
62
- APP_PREFERENCES_CACHE_TYPE,
63
- APP_PREFERENCES_CACHE_KEY,
64
60
  now,
65
61
  textFromUnknown,
66
62
  extractDelta,