openpond 0.0.65 → 0.0.67

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 (97) hide show
  1. package/dist/chunks/{app-layer-NCSTDSNQ.js → app-layer-MAATABDM.js} +2 -2
  2. package/dist/chunks/{app-server-runtime-6PDQHOBE.js → app-server-runtime-CJFOO54B.js} +7 -7
  3. package/dist/chunks/{apps-HEG7FEEV.js → apps-L23POEUT.js} +2 -2
  4. package/dist/chunks/{chunk-EWP6VGHP.js → chunk-2N57HMVR.js} +1 -1
  5. package/dist/chunks/{chunk-BRLUAT6S.js → chunk-42WUHGKD.js} +61 -3
  6. package/dist/chunks/{chunk-HJJYGJ36.js → chunk-7OQFWODA.js} +2414 -1044
  7. package/dist/chunks/{chunk-JMHOO2IG.js → chunk-BPII37IS.js} +46 -4
  8. package/dist/chunks/{chunk-OYWTQABY.js → chunk-CWCMYSX2.js} +8 -0
  9. package/dist/chunks/{chunk-TW4YWBQR.js → chunk-DEEQG5MY.js} +1 -1
  10. package/dist/chunks/{chunk-B63GTC7F.js → chunk-J3PSR6F6.js} +3 -3
  11. package/dist/chunks/{chunk-U345JN44.js → chunk-MHUN6LXO.js} +1 -1
  12. package/dist/chunks/{chunk-6FZNXLVN.js → chunk-RN7MVPC6.js} +44 -4
  13. package/dist/chunks/{chunk-WT3THPTX.js → chunk-XIFRFL4T.js} +39 -34
  14. package/dist/chunks/{chunk-LNYGV6AM.js → chunk-Z3SXHGOC.js} +1 -1
  15. package/dist/chunks/{cli-CQOUYUQ4.js → cli-6N2QZCOF.js} +6 -6
  16. package/dist/chunks/{core-commands-Y4ZMQXO4.js → core-commands-5TW5I3Z6.js} +3 -3
  17. package/dist/chunks/{desktop-test-YRFKONLO.js → desktop-test-JG6XDUTT.js} +2 -2
  18. package/dist/chunks/{extension-4MFKIC6Q.js → extension-UUM4ELAF.js} +46 -4
  19. package/dist/chunks/{help-STXVR4NO.js → help-JFQVVETR.js} +1 -1
  20. package/dist/chunks/{opchat-CCVKI5GH.js → opchat-3772JCGJ.js} +2 -2
  21. package/dist/chunks/{organizations-AS76SGLP.js → organizations-USWBONDO.js} +4 -4
  22. package/dist/chunks/{profile-QNWDNZY3.js → profile-2MYIXRUK.js} +2 -2
  23. package/dist/chunks/{project-agent-GPZL7KAL.js → project-agent-VDKGFG5V.js} +2 -2
  24. package/dist/chunks/{sandbox-command-LC63MMAA.js → sandbox-command-M5W3VWVP.js} +2 -2
  25. package/dist/chunks/{sandbox-template-FPQLZ4IP.js → sandbox-template-25SKARVM.js} +3 -3
  26. package/dist/chunks/{src-ESTRZ2YU.js → src-7RDE5SYD.js} +262 -35
  27. package/dist/chunks/{src-6NIBZPH2.js → src-KYP4COYD.js} +3 -3
  28. package/dist/chunks/{teams-bot-YTX7IC2J.js → teams-bot-BJJISVOG.js} +2 -2
  29. package/dist/chunks/{workspaces-ODK2CTFF.js → workspaces-EQTHCFVV.js} +2 -2
  30. package/dist/cli.js +13 -13
  31. package/dist/hosted-chat.d.ts +15 -0
  32. package/dist/profile/local-profile-types.d.ts +2 -0
  33. package/dist/web/assets/{AppDialog-DacC7BcY.js → AppDialog-B8HYaM0m.js} +1 -1
  34. package/dist/web/assets/{AppsView-mkeAkrvr.js → AppsView-DzVZTM0y.js} +1 -1
  35. package/dist/web/assets/{BrowserSidebar-1aEC6gsF.js → BrowserSidebar-BobBdHTm.js} +1 -1
  36. package/dist/web/assets/{CommandMenu-BN6J3ecV.js → CommandMenu-pp69WTbf.js} +1 -1
  37. package/dist/web/assets/{CommunityView-B2v9Q4cw.js → CommunityView-D1V7y3l5.js} +1 -1
  38. package/dist/web/assets/{ComposerCreateImproveStrip-BH8Ath1h.js → ComposerCreateImproveStrip-Dv5RKQaG.js} +1 -1
  39. package/dist/web/assets/{GetStartedView-B-R-KSva.js → GetStartedView-DXmHN_BA.js} +1 -1
  40. package/dist/web/assets/{LabModelVersionDetailPage-Bhfa7T00.js → LabModelVersionDetailPage-BDN4AQVt.js} +1 -1
  41. package/dist/web/assets/{LabSkillSidebar-CbYdG0RN.js → LabSkillSidebar-DYR_pq0Q.js} +1 -1
  42. package/dist/web/assets/{LabsRoute-DFV5vV6Z.js → LabsRoute-CFXaPC-i.js} +3 -3
  43. package/dist/web/assets/{MainChatThread-COiXI7ri.js → MainChatThread-C1XrdeAC.js} +2 -2
  44. package/dist/web/assets/{MainPane-CQCLhV5C.js → MainPane-D8Mu6Nf3.js} +3 -3
  45. package/dist/web/assets/{MarkdownText-R3MC5S30.js → MarkdownText-D5-tAHVZ.js} +1 -1
  46. package/dist/web/assets/{Messages-DpZ8mIz8.js → Messages-CWoU5OZ2.js} +1 -1
  47. package/dist/web/assets/{NativeSkillSidebar-BfcMqLHA.js → NativeSkillSidebar-cKgCM5s9.js} +1 -1
  48. package/dist/web/assets/{NewProjectDialog-DqTX1Eeo.js → NewProjectDialog-B4wrkUrZ.js} +1 -1
  49. package/dist/web/assets/{OutputsPage-DfZYswx2.js → OutputsPage-DoJz_FcJ.js} +1 -1
  50. package/dist/web/assets/{RightChatPanelStack-DH8QjiDY.js → RightChatPanelStack-goxULcZy.js} +1 -1
  51. package/dist/web/assets/{ScheduledWorkPage-DkaVUnwj.js → ScheduledWorkPage-DLtJnU9O.js} +1 -1
  52. package/dist/web/assets/{SettingsView-StVFsSJ6.js → SettingsView-M-_wJvH1.js} +3 -3
  53. package/dist/web/assets/{TeamChatView-CqZOnQh2.js → TeamChatView-Cst9bXqE.js} +1 -1
  54. package/dist/web/assets/{TerminalOverlay-CnFv6FZT.js → TerminalOverlay-72oJPCbi.js} +1 -1
  55. package/dist/web/assets/{TrainingCreationPanel-CWzyzmyT.js → TrainingCreationPanel-BK8T_q3X.js} +1 -1
  56. package/dist/web/assets/{TrainingDraftPanel-BVHx0HZ0.js → TrainingDraftPanel-DSZ8e9ve.js} +1 -1
  57. package/dist/web/assets/UsageSettingsSection-Co0UH4EJ.js +59 -0
  58. package/dist/web/assets/{WorkspaceDiffPanel-DUCjD1GA.js → WorkspaceDiffPanel-OcpOQdEE.js} +3 -3
  59. package/dist/web/assets/{WorkspaceEnvironmentMenu-DHGrt_ie.js → WorkspaceEnvironmentMenu-Cg_VY5XS.js} +1 -1
  60. package/dist/web/assets/{WorkspaceGitDialogs-hI57yjPL.js → WorkspaceGitDialogs-ApPWIEpT.js} +1 -1
  61. package/dist/web/assets/{WorkspaceMonacoEditor-DPv-1uO6.js → WorkspaceMonacoEditor-CxD40rNT.js} +3 -3
  62. package/dist/web/assets/{arrow-up-right-BDcNd1rt.js → arrow-up-right-DtR75sMi.js} +1 -1
  63. package/dist/web/assets/{chevron-up-XTMMnfnf.js → chevron-up-DH33C_vT.js} +1 -1
  64. package/dist/web/assets/{cloud-upload-D6bS8rS2.js → cloud-upload-Cp4pi0X7.js} +1 -1
  65. package/dist/web/assets/{cssMode-CvN9o8bP.js → cssMode-CJPZShEy.js} +1 -1
  66. package/dist/web/assets/{folder-open-8C5l7A93.js → folder-open-hEq-0bAV.js} +1 -1
  67. package/dist/web/assets/{folder-plus-B9Wqb9yd.js → folder-plus-ClgoqsjW.js} +1 -1
  68. package/dist/web/assets/{git-branch-C45ve7zh.js → git-branch-CLBU2IM9.js} +1 -1
  69. package/dist/web/assets/{git-commit-horizontal-CGoLIyKK.js → git-commit-horizontal-CpOgDvCh.js} +1 -1
  70. package/dist/web/assets/{htmlMode-DxLP6j5r.js → htmlMode-fp60PdLB.js} +1 -1
  71. package/dist/web/assets/{index-LrGasYyx.js → index-2rbiOiLR.js} +54 -53
  72. package/dist/web/assets/index-BWqDWo3b.js +1 -0
  73. package/dist/web/assets/{info-DTObFlHw.js → info-D3L7JgSo.js} +1 -1
  74. package/dist/web/assets/{jsonMode-C3_fOSJu.js → jsonMode-9tQDt87U.js} +1 -1
  75. package/dist/web/assets/{lspLanguageFeatures-0c-UKStE.js → lspLanguageFeatures-DhOXsUmI.js} +1 -1
  76. package/dist/web/assets/{monaco.contribution-CF1DgPPC.js → monaco.contribution-BCc7daQX.js} +2 -2
  77. package/dist/web/assets/{monaco.contribution-Cb7KlQ6G.js → monaco.contribution-BPct5K1-.js} +2 -2
  78. package/dist/web/assets/{monaco.contribution-Dsug_FPj.js → monaco.contribution-D3sQBkAF.js} +2 -2
  79. package/dist/web/assets/{monaco.contribution-CFLEc9Ly.js → monaco.contribution-DRNDpuUQ.js} +2 -2
  80. package/dist/web/assets/{play-Cbsyrwkw.js → play-DUBpqm-k.js} +1 -1
  81. package/dist/web/assets/{python-DVcVB2lF.js → python-CO5ats2F.js} +1 -1
  82. package/dist/web/assets/{refresh-cw-ChUK_QfF.js → refresh-cw-D7OfmCic.js} +1 -1
  83. package/dist/web/assets/{save-Doep-KC7.js → save-CJN-WmnU.js} +1 -1
  84. package/dist/web/assets/{square-B5q2aneb.js → square-Bx9UTvNe.js} +1 -1
  85. package/dist/web/assets/{toggleHighContrast-CTZp7RE7.js → toggleHighContrast-7mdj7cLQ.js} +1 -1
  86. package/dist/web/assets/{tsMode-GfNadOOB.js → tsMode-qx-y8781.js} +1 -1
  87. package/dist/web/assets/{upload-DcewuCTa.js → upload-Bp6EKIYv.js} +1 -1
  88. package/dist/web/assets/{useLocalAgentSchedules-BwltnId8.js → useLocalAgentSchedules-CZ1tgG1x.js} +1 -1
  89. package/dist/web/assets/{wifi-off-cXPyKIzd.js → wifi-off-DovWnIF6.js} +1 -1
  90. package/dist/web/assets/{workers-CP6kCS63.js → workers-DC-vdMwa.js} +1 -1
  91. package/dist/web/assets/{yaml-w0GP6yKf.js → yaml-Bu611qJb.js} +1 -1
  92. package/dist/web/connected-apps/turnkey.svg +3 -0
  93. package/dist/web/index.html +1 -1
  94. package/docs/command-reference.md +19 -1
  95. package/package.json +1 -1
  96. package/dist/web/assets/UsageSettingsSection-Bdvm66WK.js +0 -59
  97. package/dist/web/assets/index-BYgrO3wt.js +0 -1
@@ -147,7 +147,7 @@ import {
147
147
  workspaceHasHead,
148
148
  workspaceToolExperienceBlocker,
149
149
  writeWorkspaceFile
150
- } from "./chunk-HJJYGJ36.js";
150
+ } from "./chunk-7OQFWODA.js";
151
151
  import {
152
152
  appWorkspacePaths,
153
153
  checkWorkspaceGitAvailability,
@@ -173,14 +173,14 @@ import {
173
173
  runCommand,
174
174
  startMacOSCommandLineToolsInstall,
175
175
  workspaceImageContentType
176
- } from "./chunk-LNYGV6AM.js";
176
+ } from "./chunk-Z3SXHGOC.js";
177
177
  import {
178
178
  runOpenPondServerCli
179
- } from "./chunk-B63GTC7F.js";
179
+ } from "./chunk-J3PSR6F6.js";
180
180
  import {
181
181
  createAppServer,
182
182
  runAgentCompaction
183
- } from "./chunk-OYWTQABY.js";
183
+ } from "./chunk-CWCMYSX2.js";
184
184
  import {
185
185
  APP_PREFERENCES_CACHE_KEY,
186
186
  APP_PREFERENCES_CACHE_TYPE,
@@ -192,7 +192,7 @@ import {
192
192
  isCliEntrypoint,
193
193
  now,
194
194
  textFromUnknown
195
- } from "./chunk-TW4YWBQR.js";
195
+ } from "./chunk-DEEQG5MY.js";
196
196
  import {
197
197
  createOpenPondRepoApp,
198
198
  getBundledRuntimeVersion,
@@ -206,7 +206,7 @@ import {
206
206
  streamOpenPondHostedChatTurn,
207
207
  switchOpenPondAccount,
208
208
  updateOpenPondAccountConfig
209
- } from "./chunk-BRLUAT6S.js";
209
+ } from "./chunk-42WUHGKD.js";
210
210
  import {
211
211
  AccountStateSchema,
212
212
  AdapterValidationReceiptSchema,
@@ -438,7 +438,7 @@ import {
438
438
  workFormatCapabilityForContentType,
439
439
  workspacePathFromLocalPathWorkspaceId,
440
440
  writeSourceUploadCache
441
- } from "./chunk-JMHOO2IG.js";
441
+ } from "./chunk-BPII37IS.js";
442
442
  import "./chunk-QETF6ILG.js";
443
443
  import {
444
444
  ArtifactManifestSchema,
@@ -484,7 +484,7 @@ import {
484
484
  workEvidenceReceiptRef,
485
485
  workSourceOpaqueRef,
486
486
  workWorkspaceOpaqueRef
487
- } from "./chunk-6FZNXLVN.js";
487
+ } from "./chunk-RN7MVPC6.js";
488
488
  import {
489
489
  external_exports,
490
490
  yaml
@@ -2737,7 +2737,7 @@ var require_websocket = __commonJS({
2737
2737
  var http = __require("http");
2738
2738
  var net = __require("net");
2739
2739
  var tls = __require("tls");
2740
- var { randomBytes: randomBytes2, createHash: createHash17 } = __require("crypto");
2740
+ var { randomBytes: randomBytes3, createHash: createHash17 } = __require("crypto");
2741
2741
  var { Duplex, Readable } = __require("stream");
2742
2742
  var { URL: URL2 } = __require("url");
2743
2743
  var PerMessageDeflate2 = require_permessage_deflate();
@@ -3275,7 +3275,7 @@ var require_websocket = __commonJS({
3275
3275
  }
3276
3276
  }
3277
3277
  const defaultPort = isSecure ? 443 : 80;
3278
- const key = randomBytes2(16).toString("base64");
3278
+ const key = randomBytes3(16).toString("base64");
3279
3279
  const request = isSecure ? https.request : http.request;
3280
3280
  const protocolSet = /* @__PURE__ */ new Set();
3281
3281
  let perMessageDeflate;
@@ -14559,6 +14559,10 @@ function codexContextUsageRecord(input) {
14559
14559
  durationMs: 0,
14560
14560
  firstTokenMs: null,
14561
14561
  promptTokens: null,
14562
+ cachedPromptTokens: null,
14563
+ uncachedPromptTokens: null,
14564
+ cacheWritePromptTokens: null,
14565
+ cacheTelemetrySource: null,
14562
14566
  completionTokens: null,
14563
14567
  totalTokens: input.usageSnapshot.usedTokens,
14564
14568
  errorType: null,
@@ -16103,6 +16107,51 @@ function stringMetadata(value) {
16103
16107
  return typeof value === "string" && value.trim() ? value.trim() : null;
16104
16108
  }
16105
16109
 
16110
+ // ../server/src/api/client-payload-projection.ts
16111
+ var MAX_INLINE_AVATAR_URL_CHARS = 8192;
16112
+ function avatarUrlForClient(value) {
16113
+ if (!value?.startsWith("data:")) return value;
16114
+ return value.length <= MAX_INLINE_AVATAR_URL_CHARS ? value : null;
16115
+ }
16116
+ function accountStateForClient(account) {
16117
+ return {
16118
+ ...account,
16119
+ avatarUrl: avatarUrlForClient(account.avatarUrl),
16120
+ accounts: account.accounts.map((candidate2) => ({
16121
+ ...candidate2,
16122
+ avatarUrl: avatarUrlForClient(candidate2.avatarUrl)
16123
+ })),
16124
+ profile: account.profile ? {
16125
+ ...account.profile,
16126
+ image: avatarUrlForClient(account.profile.image)
16127
+ } : account.profile
16128
+ };
16129
+ }
16130
+ function profileStateForClient(profile) {
16131
+ return {
16132
+ ...profile,
16133
+ git: profile.git ? {
16134
+ ...profile.git,
16135
+ fileCount: profile.git.fileCount ?? profile.git.files.length,
16136
+ files: []
16137
+ } : null,
16138
+ diff: {
16139
+ ...profile.diff,
16140
+ fileCount: profile.diff.fileCount ?? profile.diff.files.length,
16141
+ files: []
16142
+ }
16143
+ };
16144
+ }
16145
+ function profileLibraryForClient(library) {
16146
+ return {
16147
+ ...library,
16148
+ profiles: library.profiles.map((entry) => ({
16149
+ ...entry,
16150
+ state: profileStateForClient(entry.state)
16151
+ }))
16152
+ };
16153
+ }
16154
+
16106
16155
  // ../server/src/openpond/provider-diagnostics.ts
16107
16156
  import { Buffer as Buffer2 } from "node:buffer";
16108
16157
  var ProviderDiagnosticsTracker = class {
@@ -22058,6 +22107,15 @@ async function buildPublicationPlan(request) {
22058
22107
  };
22059
22108
  if (manifestIndex >= 0) files[manifestIndex] = manifestFile;
22060
22109
  else files.push(manifestFile);
22110
+ const gitignoreFile = {
22111
+ sourcePath: null,
22112
+ relativePath: ".gitignore",
22113
+ contents: Buffer.from(profilePublicationGitignoreContents(profileRoot)),
22114
+ category: "settings"
22115
+ };
22116
+ const gitignoreIndex = files.findIndex((file) => file.relativePath === ".gitignore");
22117
+ if (gitignoreIndex >= 0) files[gitignoreIndex] = gitignoreFile;
22118
+ else files.push(gitignoreFile);
22061
22119
  files.sort((left, right) => left.relativePath.localeCompare(right.relativePath));
22062
22120
  const existingTarget = await resolveExistingTarget(request);
22063
22121
  const sourceHash = createHash5("sha256");
@@ -22098,7 +22156,13 @@ async function resolveExistingTarget(request) {
22098
22156
  if (request.target.provider === "github") {
22099
22157
  const owner = request.target.owner?.trim() || await githubLogin();
22100
22158
  const fullName = `${owner}/${request.target.repository}`;
22101
- const result = await runCommand4("gh", ["repo", "view", fullName, "--json", "url,defaultBranchRef"]);
22159
+ const result = await runCommand4("gh", [
22160
+ "repo",
22161
+ "view",
22162
+ fullName,
22163
+ "--json",
22164
+ "url,defaultBranchRef,isPrivate"
22165
+ ]);
22102
22166
  if (result.code !== 0) return null;
22103
22167
  const parsed = JSON.parse(result.stdout);
22104
22168
  return {
@@ -22106,7 +22170,8 @@ async function resolveExistingTarget(request) {
22106
22170
  repository: request.target.repository,
22107
22171
  remoteUrl: `${parsed.url ?? `https://github.com/${fullName}`}.git`,
22108
22172
  webUrl: parsed.url ?? `https://github.com/${fullName}`,
22109
- defaultBranch: parsed.defaultBranchRef?.name || "master"
22173
+ defaultBranch: parsed.defaultBranchRef?.name || "master",
22174
+ visibility: typeof parsed.isPrivate === "boolean" ? parsed.isPrivate ? "private" : "public" : void 0
22110
22175
  };
22111
22176
  }
22112
22177
  const apps = await loadOpenPondApps({ limit: 100 });
@@ -22144,14 +22209,9 @@ async function publishToGitHub(exportPath, request, existing) {
22144
22209
  await runRequired("gh", ["auth", "setup-git"]);
22145
22210
  await runRequired("git", ["remote", "add", "origin", existing.remoteUrl], exportPath);
22146
22211
  await runRequired("git", ["push", "--force", "origin", `HEAD:${existing.defaultBranch}`], exportPath);
22147
- await runRequired("gh", [
22148
- "repo",
22149
- "edit",
22150
- fullName,
22151
- "--visibility",
22152
- request.target.visibility,
22153
- "--accept-visibility-change-consequences"
22154
- ]);
22212
+ if (existing.visibility !== request.target.visibility) {
22213
+ await updateGitHubRepositoryVisibility(fullName, request.target.visibility);
22214
+ }
22155
22215
  }
22156
22216
  return {
22157
22217
  owner,
@@ -22202,6 +22262,22 @@ async function githubLogin() {
22202
22262
  }
22203
22263
  return result.stdout.trim();
22204
22264
  }
22265
+ async function updateGitHubRepositoryVisibility(fullName, visibility) {
22266
+ const args = [
22267
+ "repo",
22268
+ "edit",
22269
+ fullName,
22270
+ "--visibility",
22271
+ visibility,
22272
+ "--accept-visibility-change-consequences"
22273
+ ];
22274
+ const result = await runCommand4("gh", args);
22275
+ if (result.code === 0) return;
22276
+ if (!result.stderr.includes("unknown flag: --accept-visibility-change-consequences")) {
22277
+ throw new Error(result.stderr.trim() || result.stdout.trim() || "gh repo edit failed.");
22278
+ }
22279
+ await runRequired("gh", args.filter((arg) => arg !== "--accept-visibility-change-consequences"));
22280
+ }
22205
22281
  function tokenizedRemote(remoteUrl, token) {
22206
22282
  const url = new URL(remoteUrl);
22207
22283
  url.username = "x-access-token";
@@ -22231,6 +22307,13 @@ function normalizePath(value) {
22231
22307
  function profilePublicationRelativePath(profileRoot, childPath) {
22232
22308
  return normalizePath(path18.posix.join(profileRoot || ".", normalizePath(childPath)));
22233
22309
  }
22310
+ function profilePublicationGitignoreContents(profileRoot) {
22311
+ return [
22312
+ "# Generated OpenPond runtime state is local to each installation.",
22313
+ `${profilePublicationRelativePath(profileRoot, ".openpond")}/`,
22314
+ ""
22315
+ ].join("\n");
22316
+ }
22234
22317
  async function runRequired(command, args, cwd, env) {
22235
22318
  const result = await runCommand4(command, args, cwd, env);
22236
22319
  if (result.code !== 0) throw new Error(result.stderr.trim() || result.stdout.trim() || `${command} failed.`);
@@ -22350,21 +22433,24 @@ async function runGit(args) {
22350
22433
  function createProfilePayloads(deps) {
22351
22434
  const { appendRuntimeEvent } = deps;
22352
22435
  async function profileCurrentPayload() {
22353
- return loadOpenPondProfileState();
22436
+ return profileStateForClient(await loadOpenPondProfileState());
22354
22437
  }
22355
22438
  async function profileCatalogPayload() {
22356
- return loadOpenPondProfileLibrary();
22439
+ return profileLibraryForClient(await loadOpenPondProfileLibrary());
22357
22440
  }
22358
22441
  async function profileSelectPayload(payload) {
22359
22442
  const input = asRecord(payload);
22360
22443
  const ref = OpenPondProfileRefSchema.parse(input.ref ?? input);
22361
22444
  const profile = await selectOpenPondProfile(ref);
22362
- return { profile, library: await loadOpenPondProfileLibrary() };
22445
+ return {
22446
+ profile: profileStateForClient(profile),
22447
+ library: profileLibraryForClient(await loadOpenPondProfileLibrary())
22448
+ };
22363
22449
  }
22364
22450
  async function profileRemovePayload(payload) {
22365
22451
  const input = asRecord(payload);
22366
22452
  const ref = OpenPondProfileRefSchema.parse(input.ref ?? input);
22367
- return removeOpenPondProfile(ref);
22453
+ return profileLibraryForClient(await removeOpenPondProfile(ref));
22368
22454
  }
22369
22455
  async function profilePublicationPreviewPayload(payload) {
22370
22456
  return previewOpenPondProfilePublication(payload);
@@ -22392,13 +22478,19 @@ function createProfilePayloads(deps) {
22392
22478
  url: stringValue(input.url),
22393
22479
  profile: stringValue(input.profile)
22394
22480
  });
22395
- return { profile: state, library: await loadOpenPondProfileLibrary() };
22481
+ return {
22482
+ profile: profileStateForClient(state),
22483
+ library: profileLibraryForClient(await loadOpenPondProfileLibrary())
22484
+ };
22396
22485
  }
22397
22486
  async function profileUpdatePayload(payload) {
22398
22487
  const input = asRecord(payload);
22399
22488
  const ref = OpenPondProfileRefSchema.parse(input.ref ?? input);
22400
22489
  const state = await updateInstalledOpenPondProfile(ref);
22401
- return { profile: state, library: await loadOpenPondProfileLibrary() };
22490
+ return {
22491
+ profile: profileStateForClient(state),
22492
+ library: profileLibraryForClient(await loadOpenPondProfileLibrary())
22493
+ };
22402
22494
  }
22403
22495
  async function profileInitPayload(payload) {
22404
22496
  const input = asRecord(payload);
@@ -22417,7 +22509,7 @@ function createProfilePayloads(deps) {
22417
22509
  output: `Initialized OpenPond profile ${state.activeProfile ?? "default"}.`
22418
22510
  })
22419
22511
  );
22420
- return state;
22512
+ return profileStateForClient(state);
22421
22513
  }
22422
22514
  async function profileLoadPayload(payload) {
22423
22515
  const input = asRecord(payload);
@@ -22436,7 +22528,7 @@ function createProfilePayloads(deps) {
22436
22528
  output: `Loaded OpenPond profile ${state.activeProfile ?? "default"}.`
22437
22529
  })
22438
22530
  );
22439
- return state;
22531
+ return profileStateForClient(state);
22440
22532
  }
22441
22533
  async function profileCheckPayload(payload) {
22442
22534
  const input = asRecord(payload);
@@ -22452,7 +22544,7 @@ function createProfilePayloads(deps) {
22452
22544
  output: `Profile check completed for ${kind}.`
22453
22545
  })
22454
22546
  );
22455
- return state;
22547
+ return profileStateForClient(state);
22456
22548
  }
22457
22549
  async function profileRenameAgentPayload(agentId, payload) {
22458
22550
  const input = asRecord(payload);
@@ -22468,7 +22560,7 @@ function createProfilePayloads(deps) {
22468
22560
  output: `Renamed Profile agent ${agentId} to ${name.trim()}.`
22469
22561
  })
22470
22562
  );
22471
- return state;
22563
+ return profileStateForClient(state);
22472
22564
  }
22473
22565
  async function profileCommitPayload(payload) {
22474
22566
  const input = asRecord(payload);
@@ -23670,7 +23762,7 @@ function createServerPayloads(deps) {
23670
23762
  version,
23671
23763
  runtimeVersion
23672
23764
  },
23673
- account: openPond.account,
23765
+ account: accountStateForClient(openPond.account),
23674
23766
  codex,
23675
23767
  preferences,
23676
23768
  providers,
@@ -23678,8 +23770,8 @@ function createServerPayloads(deps) {
23678
23770
  apps: openPond.apps,
23679
23771
  localProjects: linkedLocalProjects,
23680
23772
  cloudProjects,
23681
- profile,
23682
- profileLibrary,
23773
+ profile: profileStateForClient(profile),
23774
+ profileLibrary: profileLibraryForClient(profileLibrary),
23683
23775
  codexPersonalSkills,
23684
23776
  extensionCatalog,
23685
23777
  codexHistorySessions: validBootstrapSessions(
@@ -24486,7 +24578,8 @@ async function usageSummaryPayload(input) {
24486
24578
  commands: commandBreakdowns(records),
24487
24579
  routes: routeBreakdowns(records),
24488
24580
  statuses: statusBreakdowns(records),
24489
- sources: sourceBreakdowns(records)
24581
+ sources: sourceBreakdowns(records),
24582
+ cohorts: cacheCohortBreakdowns(records)
24490
24583
  };
24491
24584
  return UsageSummaryResponseSchema.parse(response);
24492
24585
  }
@@ -24574,6 +24667,7 @@ function usageTotals(records, rangeEnd) {
24574
24667
  failedRequests,
24575
24668
  missingUsageRequests,
24576
24669
  promptTokens: nullableTokenTotal(totals.promptTokens, totals.promptTokenRows),
24670
+ ...cacheTotals(totals),
24577
24671
  completionTokens: nullableTokenTotal(totals.completionTokens, totals.completionTokenRows),
24578
24672
  totalTokens: nullableTokenTotal(totals.totalTokens, totals.totalTokenRows),
24579
24673
  averageLatencyMs: average(totals.durations),
@@ -24754,11 +24848,53 @@ function sourceBreakdowns(records) {
24754
24848
  ...breakdownTotals(totals)
24755
24849
  })).sort(breakdownSort);
24756
24850
  }
24851
+ function cacheCohortBreakdowns(records) {
24852
+ const groups = /* @__PURE__ */ new Map();
24853
+ for (const record11 of records) {
24854
+ const cohort = cacheCohortForRequest(record11);
24855
+ const totals = groups.get(cohort) ?? accumulator();
24856
+ addRecord(totals, record11);
24857
+ groups.set(cohort, totals);
24858
+ }
24859
+ return [...groups.entries()].map(([cohort, totals]) => ({
24860
+ cohort,
24861
+ ...breakdownTotals(totals)
24862
+ })).sort(breakdownSort);
24863
+ }
24864
+ function cacheCohortForRequest(record11) {
24865
+ switch (record11.requestKind) {
24866
+ case "chat_turn":
24867
+ case "slash_command":
24868
+ case "create_improve_planner":
24869
+ return "foreground";
24870
+ case "tool_loop":
24871
+ return "tool_loop";
24872
+ case "context_compaction":
24873
+ return "compaction";
24874
+ case "subagent":
24875
+ return "subagent";
24876
+ case "harness_refiner":
24877
+ return "refiner";
24878
+ case "codex_context":
24879
+ case "other":
24880
+ return "other";
24881
+ }
24882
+ }
24757
24883
  function accumulator() {
24758
24884
  return {
24759
24885
  requests: 0,
24760
24886
  promptTokens: 0,
24761
24887
  promptTokenRows: 0,
24888
+ cacheTelemetryRequests: 0,
24889
+ cacheHitRequests: 0,
24890
+ cachedPromptTokens: 0,
24891
+ cachedPromptTokenRows: 0,
24892
+ uncachedPromptTokens: 0,
24893
+ uncachedPromptTokenRows: 0,
24894
+ cacheWritePromptTokens: 0,
24895
+ cacheWritePromptTokenRows: 0,
24896
+ cacheRateCachedTokens: 0,
24897
+ cacheRatePromptTokens: 0,
24762
24898
  completionTokens: 0,
24763
24899
  completionTokenRows: 0,
24764
24900
  totalTokens: 0,
@@ -24776,6 +24912,26 @@ function addRecord(accumulator2, record11) {
24776
24912
  accumulator2.promptTokens += record11.promptTokens;
24777
24913
  accumulator2.promptTokenRows += 1;
24778
24914
  }
24915
+ if (record11.cacheTelemetrySource !== null && record11.promptTokens !== null) {
24916
+ accumulator2.cacheTelemetryRequests += 1;
24917
+ if ((record11.cachedPromptTokens ?? 0) > 0) accumulator2.cacheHitRequests += 1;
24918
+ }
24919
+ if (record11.cachedPromptTokens !== null) {
24920
+ accumulator2.cachedPromptTokens += record11.cachedPromptTokens;
24921
+ accumulator2.cachedPromptTokenRows += 1;
24922
+ }
24923
+ if (record11.uncachedPromptTokens !== null) {
24924
+ accumulator2.uncachedPromptTokens += record11.uncachedPromptTokens;
24925
+ accumulator2.uncachedPromptTokenRows += 1;
24926
+ }
24927
+ if (record11.cacheWritePromptTokens !== null) {
24928
+ accumulator2.cacheWritePromptTokens += record11.cacheWritePromptTokens;
24929
+ accumulator2.cacheWritePromptTokenRows += 1;
24930
+ }
24931
+ if (record11.cachedPromptTokens !== null && record11.uncachedPromptTokens !== null) {
24932
+ accumulator2.cacheRateCachedTokens += record11.cachedPromptTokens;
24933
+ accumulator2.cacheRatePromptTokens += record11.cachedPromptTokens + record11.uncachedPromptTokens;
24934
+ }
24779
24935
  if (record11.completionTokens !== null) {
24780
24936
  accumulator2.completionTokens += record11.completionTokens;
24781
24937
  accumulator2.completionTokenRows += 1;
@@ -24798,6 +24954,7 @@ function breakdownTotals(accumulator2) {
24798
24954
  return {
24799
24955
  requests: accumulator2.requests,
24800
24956
  promptTokens: nullableTokenTotal(accumulator2.promptTokens, accumulator2.promptTokenRows),
24957
+ ...cacheTotals(accumulator2),
24801
24958
  completionTokens: nullableTokenTotal(accumulator2.completionTokens, accumulator2.completionTokenRows),
24802
24959
  totalTokens: nullableTokenTotal(accumulator2.totalTokens, accumulator2.totalTokenRows),
24803
24960
  averageLatencyMs: average(accumulator2.durations),
@@ -24810,10 +24967,47 @@ function breakdownTotals(accumulator2) {
24810
24967
  lastSeenAt: accumulator2.lastSeenAt ?? (/* @__PURE__ */ new Date(0)).toISOString()
24811
24968
  };
24812
24969
  }
24970
+ function cacheTotals(accumulator2) {
24971
+ return {
24972
+ cacheTelemetryRequests: accumulator2.cacheTelemetryRequests,
24973
+ cacheHitRequests: accumulator2.cacheHitRequests,
24974
+ cachedPromptTokens: nullableTokenTotal(
24975
+ accumulator2.cachedPromptTokens,
24976
+ accumulator2.cachedPromptTokenRows
24977
+ ),
24978
+ uncachedPromptTokens: nullableTokenTotal(
24979
+ accumulator2.uncachedPromptTokens,
24980
+ accumulator2.uncachedPromptTokenRows
24981
+ ),
24982
+ cacheWritePromptTokens: nullableTokenTotal(
24983
+ accumulator2.cacheWritePromptTokens,
24984
+ accumulator2.cacheWritePromptTokenRows
24985
+ ),
24986
+ cacheHitRate: ratioOrNull(
24987
+ accumulator2.cacheRateCachedTokens,
24988
+ accumulator2.cacheRatePromptTokens
24989
+ ),
24990
+ cacheRequestHitRate: ratioOrNull(
24991
+ accumulator2.cacheHitRequests,
24992
+ accumulator2.cacheTelemetryRequests
24993
+ ),
24994
+ cacheTelemetryCoverage: ratioOrZero(
24995
+ accumulator2.cacheTelemetryRequests,
24996
+ accumulator2.promptTokenRows
24997
+ )
24998
+ };
24999
+ }
24813
25000
  function failureRate(failures, requests) {
24814
25001
  if (requests <= 0) return 0;
24815
25002
  return Number((failures / requests).toFixed(4));
24816
25003
  }
25004
+ function ratioOrNull(numerator, denominator) {
25005
+ if (denominator <= 0) return null;
25006
+ return Number((numerator / denominator).toFixed(4));
25007
+ }
25008
+ function ratioOrZero(numerator, denominator) {
25009
+ return ratioOrNull(numerator, denominator) ?? 0;
25010
+ }
24817
25011
  function nullableTokenTotal(total, rows) {
24818
25012
  return rows > 0 ? total : null;
24819
25013
  }
@@ -28547,12 +28741,39 @@ function normalizeRoutePath(pathValue) {
28547
28741
  }
28548
28742
 
28549
28743
  // ../server/src/api/static-web.ts
28744
+ import { randomBytes as randomBytes2 } from "node:crypto";
28550
28745
  import { createReadStream as createReadStream5 } from "node:fs";
28551
28746
  import { promises as fs12 } from "node:fs";
28552
28747
  import path24 from "node:path";
28553
28748
  var API_PATH_PREFIXES = ["/v1/"];
28554
28749
  var API_PATHS = /* @__PURE__ */ new Set(["/health"]);
28555
28750
  var ONE_YEAR_SECONDS = 31536e3;
28751
+ function staticSecurityHeaders() {
28752
+ return {
28753
+ "Referrer-Policy": "no-referrer",
28754
+ "X-Content-Type-Options": "nosniff",
28755
+ "X-Frame-Options": "DENY"
28756
+ };
28757
+ }
28758
+ function indexSecurityHeaders(nonce) {
28759
+ return {
28760
+ ...staticSecurityHeaders(),
28761
+ "Content-Security-Policy": [
28762
+ "default-src 'self'",
28763
+ `script-src 'self' 'nonce-${nonce}'`,
28764
+ "style-src 'self' 'unsafe-inline'",
28765
+ "img-src 'self' data: blob: https:",
28766
+ "font-src 'self' data:",
28767
+ "media-src 'self' data: blob: https:",
28768
+ "connect-src 'self' http: https: ws: wss:",
28769
+ "worker-src 'self' blob:",
28770
+ "object-src 'none'",
28771
+ "base-uri 'none'",
28772
+ "frame-ancestors 'none'",
28773
+ "form-action 'self'"
28774
+ ].join("; ")
28775
+ };
28776
+ }
28556
28777
  var MIME_TYPES = {
28557
28778
  ".css": "text/css; charset=utf-8",
28558
28779
  ".gif": "image/gif",
@@ -28607,6 +28828,7 @@ function cacheControl(filePath) {
28607
28828
  }
28608
28829
  function sendFile(request, response, filePath, stat7) {
28609
28830
  response.writeHead(200, {
28831
+ ...staticSecurityHeaders(),
28610
28832
  "Content-Length": stat7.size,
28611
28833
  "Content-Type": contentType(filePath),
28612
28834
  "Cache-Control": cacheControl(filePath)
@@ -28631,8 +28853,9 @@ async function sendIndex({
28631
28853
  token
28632
28854
  }) {
28633
28855
  let html = await fs12.readFile(indexPath, "utf8");
28856
+ const nonce = randomBytes2(18).toString("base64url");
28634
28857
  if (isLoopbackHost(requestUrl.hostname)) {
28635
- const connectionScript = `<script>window.__OPENPOND_WEB_CONNECTION__=${escapeScriptJson(
28858
+ const connectionScript = `<script nonce="${nonce}">window.__OPENPOND_WEB_CONNECTION__=${escapeScriptJson(
28636
28859
  JSON.stringify({
28637
28860
  serverUrl: requestUrl.origin,
28638
28861
  token
@@ -28644,6 +28867,7 @@ ${html}`;
28644
28867
  }
28645
28868
  const body = Buffer.from(html, "utf8");
28646
28869
  response.writeHead(200, {
28870
+ ...indexSecurityHeaders(nonce),
28647
28871
  "Content-Length": body.byteLength,
28648
28872
  "Content-Type": "text/html; charset=utf-8",
28649
28873
  "Cache-Control": "no-cache"
@@ -28656,6 +28880,7 @@ ${html}`;
28656
28880
  }
28657
28881
  function sendNotFound(response) {
28658
28882
  response.writeHead(404, {
28883
+ ...staticSecurityHeaders(),
28659
28884
  "Content-Type": "text/plain; charset=utf-8",
28660
28885
  "Cache-Control": "no-cache"
28661
28886
  });
@@ -53893,6 +54118,7 @@ async function createOpenPondServer(options = {}) {
53893
54118
  messages: input.messages,
53894
54119
  tools: input.tools,
53895
54120
  toolChoice: input.toolChoice,
54121
+ maxOutputTokens: input.maxOutputTokens,
53896
54122
  requestId: input.requestId,
53897
54123
  signal: input.signal,
53898
54124
  saveChatGptSubscriptionCredential: async (providerId, credential) => {
@@ -54240,6 +54466,7 @@ async function createOpenPondServer(options = {}) {
54240
54466
  sourceEventCount: result.sourceEventCount,
54241
54467
  preservedEventCount: result.preservedEventCount,
54242
54468
  fileLedger: result.fileLedger,
54469
+ continuationCapsule: result.continuationCapsule,
54243
54470
  inputTokensBefore: result.inputTokensBefore,
54244
54471
  inputTokensAfter: result.inputTokensAfter,
54245
54472
  maxContextTokens: result.maxContextTokens,
@@ -3,7 +3,7 @@ import { createRequire as __openpondCreateRequire } from "node:module"; var requ
3
3
  import {
4
4
  createReadyLineParser,
5
5
  openUrlWithSystemBrowser
6
- } from "./chunk-BRLUAT6S.js";
6
+ } from "./chunk-42WUHGKD.js";
7
7
  import {
8
8
  ApprovalSchema,
9
9
  ContextUsageSnapshotSchema,
@@ -12,12 +12,12 @@ import {
12
12
  DEFAULT_OPENPOND_CHAT_MODEL,
13
13
  DEFAULT_OPENPOND_COMMAND_ACCESS_MODE,
14
14
  OpenPondCommandAccessModeSchema
15
- } from "./chunk-JMHOO2IG.js";
15
+ } from "./chunk-BPII37IS.js";
16
16
  import {
17
17
  CONNECTED_APP_CATALOG,
18
18
  buildConnectedAppInstallUrl,
19
19
  connectedAppById
20
- } from "./chunk-6FZNXLVN.js";
20
+ } from "./chunk-RN7MVPC6.js";
21
21
  import "./chunk-WYDVQOBL.js";
22
22
  import "./chunk-JGOP4GCK.js";
23
23
  import "./chunk-UACZUFIA.js";
@@ -2,9 +2,9 @@ import { createRequire as __openpondCreateRequire } from "node:module"; var requ
2
2
  import {
3
3
  resolveSandboxClient
4
4
  } from "./chunk-J2REM7LE.js";
5
- import "./chunk-U345JN44.js";
5
+ import "./chunk-MHUN6LXO.js";
6
6
  import "./chunk-SMNFI2FU.js";
7
- import "./chunk-WT3THPTX.js";
7
+ import "./chunk-XIFRFL4T.js";
8
8
  import "./chunk-K4JEWEJQ.js";
9
9
  import "./chunk-JGOP4GCK.js";
10
10
  import "./chunk-DBHSOTYZ.js";
@@ -45,8 +45,8 @@ import {
45
45
  truncatePatch,
46
46
  uniqueSortedPaths,
47
47
  workspaceImageContentType
48
- } from "./chunk-LNYGV6AM.js";
49
- import "./chunk-TW4YWBQR.js";
48
+ } from "./chunk-Z3SXHGOC.js";
49
+ import "./chunk-DEEQG5MY.js";
50
50
  import "./chunk-UACZUFIA.js";
51
51
  export {
52
52
  MACOS_GIT_MISSING_DEVELOPER_TOOLS_ERROR,