openpond 0.0.64 → 0.0.66

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-XWIG4OWY.js → app-server-runtime-OW2IOMTR.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-JMHOO2IG.js → chunk-BPII37IS.js} +46 -4
  7. package/dist/chunks/{chunk-OYWTQABY.js → chunk-CWCMYSX2.js} +8 -0
  8. package/dist/chunks/{chunk-THYIAXOB.js → chunk-K37ACPJQ.js} +3 -3
  9. package/dist/chunks/{chunk-HM6Z3PEC.js → chunk-KVUB7HLM.js} +2600 -1169
  10. package/dist/chunks/{chunk-U345JN44.js → chunk-MHUN6LXO.js} +1 -1
  11. package/dist/chunks/{chunk-6FZNXLVN.js → chunk-RN7MVPC6.js} +44 -4
  12. package/dist/chunks/{chunk-C7TOCBGY.js → chunk-TRRJ6Z4L.js} +1 -1
  13. package/dist/chunks/{chunk-WT3THPTX.js → chunk-XIFRFL4T.js} +39 -34
  14. package/dist/chunks/{chunk-57XKCMOZ.js → chunk-ZE7MWXEL.js} +1 -1
  15. package/dist/chunks/{cli-3BI2QBI2.js → cli-HEL47VQ3.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-6NIBZPH2.js → src-KYP4COYD.js} +3 -3
  27. package/dist/chunks/{src-DQFVZZUR.js → src-S77UAM5T.js} +267 -91
  28. package/dist/chunks/{teams-bot-YTX7IC2J.js → teams-bot-BJJISVOG.js} +2 -2
  29. package/dist/chunks/{workspaces-IXF7MIQV.js → workspaces-OXDJN23P.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
@@ -26,6 +26,7 @@ import {
26
26
  createCloudConnectedAppToolExecutor,
27
27
  createCrossSystemExpertBootstrapService,
28
28
  createEvidenceSnapshot,
29
+ createHostedSavedWork,
29
30
  createHostedTurnHelpers,
30
31
  createImproveLimit,
31
32
  createImproveTargetKind,
@@ -53,6 +54,7 @@ import {
53
54
  createWebFetchModelToolDefinition,
54
55
  createWebSearchExecutorFromEnv,
55
56
  createWebSearchModelToolDefinition,
57
+ deleteHostedSavedWork,
56
58
  ensureCapabilityToken,
57
59
  ensureLocalHarnessRunOverlay,
58
60
  ensureSelectedLocalHarnessWorkspace,
@@ -74,6 +76,7 @@ import {
74
76
  isBundledAuthoringSkillName,
75
77
  isOpenAiCompatibleProviderId,
76
78
  linkHarnessReviewTaskset,
79
+ listHostedSavedWork,
77
80
  listOpenAiCompatibleProviderModels,
78
81
  listSandboxIntegrationConnections,
79
82
  loadBundledAuthoringSkills,
@@ -107,7 +110,6 @@ import {
107
110
  readChatAttachmentTextFile,
108
111
  readTasksetAuthoringProfileSkill,
109
112
  recordLocalHarnessImprovementBoundary,
110
- requestOpenPondPublicApi,
111
113
  requireQualifiedModelImprovement,
112
114
  resolveBenchmarkUpstreamModel,
113
115
  resolveContextCompactionAdapter,
@@ -121,6 +123,7 @@ import {
121
123
  retryableHostedError,
122
124
  reviewSelectedLocalHarnessEvaluation,
123
125
  runHostedContextCompaction,
126
+ runHostedSavedWork,
124
127
  runLocalHarnessEvaluationBaseline,
125
128
  runLocalHarnessRefinerWorker,
126
129
  safeChatAttachmentPathSegment,
@@ -135,6 +138,7 @@ import {
135
138
  stringValue,
136
139
  trimOutput,
137
140
  trustedProviderContextLimit,
141
+ updateHostedSavedWork,
138
142
  uploadLocalProjectCloudSource,
139
143
  upsertInternalSandboxProject,
140
144
  validateOpenAiCompatibleProvider,
@@ -143,7 +147,7 @@ import {
143
147
  workspaceHasHead,
144
148
  workspaceToolExperienceBlocker,
145
149
  writeWorkspaceFile
146
- } from "./chunk-HM6Z3PEC.js";
150
+ } from "./chunk-KVUB7HLM.js";
147
151
  import {
148
152
  appWorkspacePaths,
149
153
  checkWorkspaceGitAvailability,
@@ -169,14 +173,14 @@ import {
169
173
  runCommand,
170
174
  startMacOSCommandLineToolsInstall,
171
175
  workspaceImageContentType
172
- } from "./chunk-57XKCMOZ.js";
176
+ } from "./chunk-ZE7MWXEL.js";
173
177
  import {
174
178
  runOpenPondServerCli
175
- } from "./chunk-THYIAXOB.js";
179
+ } from "./chunk-K37ACPJQ.js";
176
180
  import {
177
181
  createAppServer,
178
182
  runAgentCompaction
179
- } from "./chunk-OYWTQABY.js";
183
+ } from "./chunk-CWCMYSX2.js";
180
184
  import {
181
185
  APP_PREFERENCES_CACHE_KEY,
182
186
  APP_PREFERENCES_CACHE_TYPE,
@@ -188,7 +192,7 @@ import {
188
192
  isCliEntrypoint,
189
193
  now,
190
194
  textFromUnknown
191
- } from "./chunk-C7TOCBGY.js";
195
+ } from "./chunk-TRRJ6Z4L.js";
192
196
  import {
193
197
  createOpenPondRepoApp,
194
198
  getBundledRuntimeVersion,
@@ -202,7 +206,7 @@ import {
202
206
  streamOpenPondHostedChatTurn,
203
207
  switchOpenPondAccount,
204
208
  updateOpenPondAccountConfig
205
- } from "./chunk-BRLUAT6S.js";
209
+ } from "./chunk-42WUHGKD.js";
206
210
  import {
207
211
  AccountStateSchema,
208
212
  AdapterValidationReceiptSchema,
@@ -256,7 +260,6 @@ import {
256
260
  GithubExtensionError,
257
261
  HarnessRunManifestContentSchema,
258
262
  HarnessRunManifestSchema,
259
- HostedSavedWorkResponseSchema,
260
263
  HuggingFaceDatasetInspectionSchema,
261
264
  HuggingFaceDatasetLocatorSchema,
262
265
  HuggingFaceDatasetSourceRefSchema,
@@ -435,7 +438,7 @@ import {
435
438
  workFormatCapabilityForContentType,
436
439
  workspacePathFromLocalPathWorkspaceId,
437
440
  writeSourceUploadCache
438
- } from "./chunk-JMHOO2IG.js";
441
+ } from "./chunk-BPII37IS.js";
439
442
  import "./chunk-QETF6ILG.js";
440
443
  import {
441
444
  ArtifactManifestSchema,
@@ -481,7 +484,7 @@ import {
481
484
  workEvidenceReceiptRef,
482
485
  workSourceOpaqueRef,
483
486
  workWorkspaceOpaqueRef
484
- } from "./chunk-6FZNXLVN.js";
487
+ } from "./chunk-RN7MVPC6.js";
485
488
  import {
486
489
  external_exports,
487
490
  yaml
@@ -2734,7 +2737,7 @@ var require_websocket = __commonJS({
2734
2737
  var http = __require("http");
2735
2738
  var net = __require("net");
2736
2739
  var tls = __require("tls");
2737
- var { randomBytes: randomBytes2, createHash: createHash17 } = __require("crypto");
2740
+ var { randomBytes: randomBytes3, createHash: createHash17 } = __require("crypto");
2738
2741
  var { Duplex, Readable } = __require("stream");
2739
2742
  var { URL: URL2 } = __require("url");
2740
2743
  var PerMessageDeflate2 = require_permessage_deflate();
@@ -3272,7 +3275,7 @@ var require_websocket = __commonJS({
3272
3275
  }
3273
3276
  }
3274
3277
  const defaultPort = isSecure ? 443 : 80;
3275
- const key = randomBytes2(16).toString("base64");
3278
+ const key = randomBytes3(16).toString("base64");
3276
3279
  const request = isSecure ? https.request : http.request;
3277
3280
  const protocolSet = /* @__PURE__ */ new Set();
3278
3281
  let perMessageDeflate;
@@ -14556,6 +14559,10 @@ function codexContextUsageRecord(input) {
14556
14559
  durationMs: 0,
14557
14560
  firstTokenMs: null,
14558
14561
  promptTokens: null,
14562
+ cachedPromptTokens: null,
14563
+ uncachedPromptTokens: null,
14564
+ cacheWritePromptTokens: null,
14565
+ cacheTelemetrySource: null,
14559
14566
  completionTokens: null,
14560
14567
  totalTokens: input.usageSnapshot.usedTokens,
14561
14568
  errorType: null,
@@ -16100,6 +16107,51 @@ function stringMetadata(value) {
16100
16107
  return typeof value === "string" && value.trim() ? value.trim() : null;
16101
16108
  }
16102
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
+
16103
16155
  // ../server/src/openpond/provider-diagnostics.ts
16104
16156
  import { Buffer as Buffer2 } from "node:buffer";
16105
16157
  var ProviderDiagnosticsTracker = class {
@@ -22055,6 +22107,15 @@ async function buildPublicationPlan(request) {
22055
22107
  };
22056
22108
  if (manifestIndex >= 0) files[manifestIndex] = manifestFile;
22057
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);
22058
22119
  files.sort((left, right) => left.relativePath.localeCompare(right.relativePath));
22059
22120
  const existingTarget = await resolveExistingTarget(request);
22060
22121
  const sourceHash = createHash5("sha256");
@@ -22095,7 +22156,13 @@ async function resolveExistingTarget(request) {
22095
22156
  if (request.target.provider === "github") {
22096
22157
  const owner = request.target.owner?.trim() || await githubLogin();
22097
22158
  const fullName = `${owner}/${request.target.repository}`;
22098
- 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
+ ]);
22099
22166
  if (result.code !== 0) return null;
22100
22167
  const parsed = JSON.parse(result.stdout);
22101
22168
  return {
@@ -22103,7 +22170,8 @@ async function resolveExistingTarget(request) {
22103
22170
  repository: request.target.repository,
22104
22171
  remoteUrl: `${parsed.url ?? `https://github.com/${fullName}`}.git`,
22105
22172
  webUrl: parsed.url ?? `https://github.com/${fullName}`,
22106
- defaultBranch: parsed.defaultBranchRef?.name || "master"
22173
+ defaultBranch: parsed.defaultBranchRef?.name || "master",
22174
+ visibility: typeof parsed.isPrivate === "boolean" ? parsed.isPrivate ? "private" : "public" : void 0
22107
22175
  };
22108
22176
  }
22109
22177
  const apps = await loadOpenPondApps({ limit: 100 });
@@ -22141,14 +22209,9 @@ async function publishToGitHub(exportPath, request, existing) {
22141
22209
  await runRequired("gh", ["auth", "setup-git"]);
22142
22210
  await runRequired("git", ["remote", "add", "origin", existing.remoteUrl], exportPath);
22143
22211
  await runRequired("git", ["push", "--force", "origin", `HEAD:${existing.defaultBranch}`], exportPath);
22144
- await runRequired("gh", [
22145
- "repo",
22146
- "edit",
22147
- fullName,
22148
- "--visibility",
22149
- request.target.visibility,
22150
- "--accept-visibility-change-consequences"
22151
- ]);
22212
+ if (existing.visibility !== request.target.visibility) {
22213
+ await updateGitHubRepositoryVisibility(fullName, request.target.visibility);
22214
+ }
22152
22215
  }
22153
22216
  return {
22154
22217
  owner,
@@ -22199,6 +22262,22 @@ async function githubLogin() {
22199
22262
  }
22200
22263
  return result.stdout.trim();
22201
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
+ }
22202
22281
  function tokenizedRemote(remoteUrl, token) {
22203
22282
  const url = new URL(remoteUrl);
22204
22283
  url.username = "x-access-token";
@@ -22228,6 +22307,13 @@ function normalizePath(value) {
22228
22307
  function profilePublicationRelativePath(profileRoot, childPath) {
22229
22308
  return normalizePath(path18.posix.join(profileRoot || ".", normalizePath(childPath)));
22230
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
+ }
22231
22317
  async function runRequired(command, args, cwd, env) {
22232
22318
  const result = await runCommand4(command, args, cwd, env);
22233
22319
  if (result.code !== 0) throw new Error(result.stderr.trim() || result.stdout.trim() || `${command} failed.`);
@@ -22347,21 +22433,24 @@ async function runGit(args) {
22347
22433
  function createProfilePayloads(deps) {
22348
22434
  const { appendRuntimeEvent } = deps;
22349
22435
  async function profileCurrentPayload() {
22350
- return loadOpenPondProfileState();
22436
+ return profileStateForClient(await loadOpenPondProfileState());
22351
22437
  }
22352
22438
  async function profileCatalogPayload() {
22353
- return loadOpenPondProfileLibrary();
22439
+ return profileLibraryForClient(await loadOpenPondProfileLibrary());
22354
22440
  }
22355
22441
  async function profileSelectPayload(payload) {
22356
22442
  const input = asRecord(payload);
22357
22443
  const ref = OpenPondProfileRefSchema.parse(input.ref ?? input);
22358
22444
  const profile = await selectOpenPondProfile(ref);
22359
- return { profile, library: await loadOpenPondProfileLibrary() };
22445
+ return {
22446
+ profile: profileStateForClient(profile),
22447
+ library: profileLibraryForClient(await loadOpenPondProfileLibrary())
22448
+ };
22360
22449
  }
22361
22450
  async function profileRemovePayload(payload) {
22362
22451
  const input = asRecord(payload);
22363
22452
  const ref = OpenPondProfileRefSchema.parse(input.ref ?? input);
22364
- return removeOpenPondProfile(ref);
22453
+ return profileLibraryForClient(await removeOpenPondProfile(ref));
22365
22454
  }
22366
22455
  async function profilePublicationPreviewPayload(payload) {
22367
22456
  return previewOpenPondProfilePublication(payload);
@@ -22389,13 +22478,19 @@ function createProfilePayloads(deps) {
22389
22478
  url: stringValue(input.url),
22390
22479
  profile: stringValue(input.profile)
22391
22480
  });
22392
- return { profile: state, library: await loadOpenPondProfileLibrary() };
22481
+ return {
22482
+ profile: profileStateForClient(state),
22483
+ library: profileLibraryForClient(await loadOpenPondProfileLibrary())
22484
+ };
22393
22485
  }
22394
22486
  async function profileUpdatePayload(payload) {
22395
22487
  const input = asRecord(payload);
22396
22488
  const ref = OpenPondProfileRefSchema.parse(input.ref ?? input);
22397
22489
  const state = await updateInstalledOpenPondProfile(ref);
22398
- return { profile: state, library: await loadOpenPondProfileLibrary() };
22490
+ return {
22491
+ profile: profileStateForClient(state),
22492
+ library: profileLibraryForClient(await loadOpenPondProfileLibrary())
22493
+ };
22399
22494
  }
22400
22495
  async function profileInitPayload(payload) {
22401
22496
  const input = asRecord(payload);
@@ -22414,7 +22509,7 @@ function createProfilePayloads(deps) {
22414
22509
  output: `Initialized OpenPond profile ${state.activeProfile ?? "default"}.`
22415
22510
  })
22416
22511
  );
22417
- return state;
22512
+ return profileStateForClient(state);
22418
22513
  }
22419
22514
  async function profileLoadPayload(payload) {
22420
22515
  const input = asRecord(payload);
@@ -22433,7 +22528,7 @@ function createProfilePayloads(deps) {
22433
22528
  output: `Loaded OpenPond profile ${state.activeProfile ?? "default"}.`
22434
22529
  })
22435
22530
  );
22436
- return state;
22531
+ return profileStateForClient(state);
22437
22532
  }
22438
22533
  async function profileCheckPayload(payload) {
22439
22534
  const input = asRecord(payload);
@@ -22449,7 +22544,7 @@ function createProfilePayloads(deps) {
22449
22544
  output: `Profile check completed for ${kind}.`
22450
22545
  })
22451
22546
  );
22452
- return state;
22547
+ return profileStateForClient(state);
22453
22548
  }
22454
22549
  async function profileRenameAgentPayload(agentId, payload) {
22455
22550
  const input = asRecord(payload);
@@ -22465,7 +22560,7 @@ function createProfilePayloads(deps) {
22465
22560
  output: `Renamed Profile agent ${agentId} to ${name.trim()}.`
22466
22561
  })
22467
22562
  );
22468
- return state;
22563
+ return profileStateForClient(state);
22469
22564
  }
22470
22565
  async function profileCommitPayload(payload) {
22471
22566
  const input = asRecord(payload);
@@ -23667,7 +23762,7 @@ function createServerPayloads(deps) {
23667
23762
  version,
23668
23763
  runtimeVersion
23669
23764
  },
23670
- account: openPond.account,
23765
+ account: accountStateForClient(openPond.account),
23671
23766
  codex,
23672
23767
  preferences,
23673
23768
  providers,
@@ -23675,8 +23770,8 @@ function createServerPayloads(deps) {
23675
23770
  apps: openPond.apps,
23676
23771
  localProjects: linkedLocalProjects,
23677
23772
  cloudProjects,
23678
- profile,
23679
- profileLibrary,
23773
+ profile: profileStateForClient(profile),
23774
+ profileLibrary: profileLibraryForClient(profileLibrary),
23680
23775
  codexPersonalSkills,
23681
23776
  extensionCatalog,
23682
23777
  codexHistorySessions: validBootstrapSessions(
@@ -24483,7 +24578,8 @@ async function usageSummaryPayload(input) {
24483
24578
  commands: commandBreakdowns(records),
24484
24579
  routes: routeBreakdowns(records),
24485
24580
  statuses: statusBreakdowns(records),
24486
- sources: sourceBreakdowns(records)
24581
+ sources: sourceBreakdowns(records),
24582
+ cohorts: cacheCohortBreakdowns(records)
24487
24583
  };
24488
24584
  return UsageSummaryResponseSchema.parse(response);
24489
24585
  }
@@ -24571,6 +24667,7 @@ function usageTotals(records, rangeEnd) {
24571
24667
  failedRequests,
24572
24668
  missingUsageRequests,
24573
24669
  promptTokens: nullableTokenTotal(totals.promptTokens, totals.promptTokenRows),
24670
+ ...cacheTotals(totals),
24574
24671
  completionTokens: nullableTokenTotal(totals.completionTokens, totals.completionTokenRows),
24575
24672
  totalTokens: nullableTokenTotal(totals.totalTokens, totals.totalTokenRows),
24576
24673
  averageLatencyMs: average(totals.durations),
@@ -24751,11 +24848,53 @@ function sourceBreakdowns(records) {
24751
24848
  ...breakdownTotals(totals)
24752
24849
  })).sort(breakdownSort);
24753
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
+ }
24754
24883
  function accumulator() {
24755
24884
  return {
24756
24885
  requests: 0,
24757
24886
  promptTokens: 0,
24758
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,
24759
24898
  completionTokens: 0,
24760
24899
  completionTokenRows: 0,
24761
24900
  totalTokens: 0,
@@ -24773,6 +24912,26 @@ function addRecord(accumulator2, record11) {
24773
24912
  accumulator2.promptTokens += record11.promptTokens;
24774
24913
  accumulator2.promptTokenRows += 1;
24775
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
+ }
24776
24935
  if (record11.completionTokens !== null) {
24777
24936
  accumulator2.completionTokens += record11.completionTokens;
24778
24937
  accumulator2.completionTokenRows += 1;
@@ -24795,6 +24954,7 @@ function breakdownTotals(accumulator2) {
24795
24954
  return {
24796
24955
  requests: accumulator2.requests,
24797
24956
  promptTokens: nullableTokenTotal(accumulator2.promptTokens, accumulator2.promptTokenRows),
24957
+ ...cacheTotals(accumulator2),
24798
24958
  completionTokens: nullableTokenTotal(accumulator2.completionTokens, accumulator2.completionTokenRows),
24799
24959
  totalTokens: nullableTokenTotal(accumulator2.totalTokens, accumulator2.totalTokenRows),
24800
24960
  averageLatencyMs: average(accumulator2.durations),
@@ -24807,10 +24967,47 @@ function breakdownTotals(accumulator2) {
24807
24967
  lastSeenAt: accumulator2.lastSeenAt ?? (/* @__PURE__ */ new Date(0)).toISOString()
24808
24968
  };
24809
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
+ }
24810
25000
  function failureRate(failures, requests) {
24811
25001
  if (requests <= 0) return 0;
24812
25002
  return Number((failures / requests).toFixed(4));
24813
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
+ }
24814
25011
  function nullableTokenTotal(total, rows) {
24815
25012
  return rows > 0 ? total : null;
24816
25013
  }
@@ -28544,12 +28741,39 @@ function normalizeRoutePath(pathValue) {
28544
28741
  }
28545
28742
 
28546
28743
  // ../server/src/api/static-web.ts
28744
+ import { randomBytes as randomBytes2 } from "node:crypto";
28547
28745
  import { createReadStream as createReadStream5 } from "node:fs";
28548
28746
  import { promises as fs12 } from "node:fs";
28549
28747
  import path24 from "node:path";
28550
28748
  var API_PATH_PREFIXES = ["/v1/"];
28551
28749
  var API_PATHS = /* @__PURE__ */ new Set(["/health"]);
28552
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
+ }
28553
28777
  var MIME_TYPES = {
28554
28778
  ".css": "text/css; charset=utf-8",
28555
28779
  ".gif": "image/gif",
@@ -28604,6 +28828,7 @@ function cacheControl(filePath) {
28604
28828
  }
28605
28829
  function sendFile(request, response, filePath, stat7) {
28606
28830
  response.writeHead(200, {
28831
+ ...staticSecurityHeaders(),
28607
28832
  "Content-Length": stat7.size,
28608
28833
  "Content-Type": contentType(filePath),
28609
28834
  "Cache-Control": cacheControl(filePath)
@@ -28628,8 +28853,9 @@ async function sendIndex({
28628
28853
  token
28629
28854
  }) {
28630
28855
  let html = await fs12.readFile(indexPath, "utf8");
28856
+ const nonce = randomBytes2(18).toString("base64url");
28631
28857
  if (isLoopbackHost(requestUrl.hostname)) {
28632
- const connectionScript = `<script>window.__OPENPOND_WEB_CONNECTION__=${escapeScriptJson(
28858
+ const connectionScript = `<script nonce="${nonce}">window.__OPENPOND_WEB_CONNECTION__=${escapeScriptJson(
28633
28859
  JSON.stringify({
28634
28860
  serverUrl: requestUrl.origin,
28635
28861
  token
@@ -28641,6 +28867,7 @@ ${html}`;
28641
28867
  }
28642
28868
  const body = Buffer.from(html, "utf8");
28643
28869
  response.writeHead(200, {
28870
+ ...indexSecurityHeaders(nonce),
28644
28871
  "Content-Length": body.byteLength,
28645
28872
  "Content-Type": "text/html; charset=utf-8",
28646
28873
  "Cache-Control": "no-cache"
@@ -28653,6 +28880,7 @@ ${html}`;
28653
28880
  }
28654
28881
  function sendNotFound(response) {
28655
28882
  response.writeHead(404, {
28883
+ ...staticSecurityHeaders(),
28656
28884
  "Content-Type": "text/plain; charset=utf-8",
28657
28885
  "Cache-Control": "no-cache"
28658
28886
  });
@@ -35717,60 +35945,6 @@ function createServerWorkspaceWorkflows(deps) {
35717
35945
  };
35718
35946
  }
35719
35947
 
35720
- // ../server/src/openpond/saved-work.ts
35721
- async function listHostedSavedWork() {
35722
- const payload = HostedSavedWorkResponseSchema.parse(
35723
- await requestOpenPondPublicApi({ path: "/saved-work" })
35724
- );
35725
- return {
35726
- ...payload,
35727
- webBaseUrl: hostedWebBaseUrl()
35728
- };
35729
- }
35730
- async function createHostedSavedWork(input) {
35731
- const body = CreateHostedSavedWorkRequestSchema.parse(input);
35732
- return requestOpenPondPublicApi({
35733
- path: "/saved-work",
35734
- method: "POST",
35735
- body
35736
- });
35737
- }
35738
- async function updateHostedSavedWork(scheduleId, input) {
35739
- const body = UpdateHostedSavedWorkRequestSchema.parse(input);
35740
- return requestOpenPondPublicApi({
35741
- path: `/saved-work/schedules/${encodeURIComponent(scheduleId)}`,
35742
- method: "PATCH",
35743
- body
35744
- });
35745
- }
35746
- async function deleteHostedSavedWork(scheduleId) {
35747
- return requestOpenPondPublicApi({
35748
- path: `/saved-work/schedules/${encodeURIComponent(scheduleId)}`,
35749
- method: "DELETE"
35750
- });
35751
- }
35752
- async function runHostedSavedWork(scheduleId, clientRequestId) {
35753
- return requestOpenPondPublicApi({
35754
- path: `/saved-work/schedules/${encodeURIComponent(scheduleId)}/run`,
35755
- method: "POST",
35756
- body: { clientRequestId }
35757
- });
35758
- }
35759
- function hostedWebBaseUrl(env = process.env) {
35760
- const configured = env.OPENPOND_HOSTED_WEB_URL?.trim() || env.OPENPOND_SANDBOX_BASE_URL?.trim() || env.OPENPOND_API_URL?.trim() || env.OPENPOND_SANDBOX_API_URL?.trim() || "https://api.openpond.ai";
35761
- const url = new URL(configured);
35762
- if (url.hostname === "staging-api.openpond.ai" || url.hostname.endsWith(".staging-api.openpond.ai")) {
35763
- return "https://staging.openpond.ai";
35764
- }
35765
- if (url.hostname === "api.openpond.ai" || url.hostname.endsWith(".api.openpond.ai")) {
35766
- return "https://openpond.ai";
35767
- }
35768
- url.pathname = "";
35769
- url.search = "";
35770
- url.hash = "";
35771
- return url.origin;
35772
- }
35773
-
35774
35948
  // ../server/src/remote-access/tailscale.ts
35775
35949
  import { execFile as execFile5 } from "node:child_process";
35776
35950
  import { existsSync as existsSync11 } from "node:fs";
@@ -53944,6 +54118,7 @@ async function createOpenPondServer(options = {}) {
53944
54118
  messages: input.messages,
53945
54119
  tools: input.tools,
53946
54120
  toolChoice: input.toolChoice,
54121
+ maxOutputTokens: input.maxOutputTokens,
53947
54122
  requestId: input.requestId,
53948
54123
  signal: input.signal,
53949
54124
  saveChatGptSubscriptionCredential: async (providerId, credential) => {
@@ -54291,6 +54466,7 @@ async function createOpenPondServer(options = {}) {
54291
54466
  sourceEventCount: result.sourceEventCount,
54292
54467
  preservedEventCount: result.preservedEventCount,
54293
54468
  fileLedger: result.fileLedger,
54469
+ continuationCapsule: result.continuationCapsule,
54294
54470
  inputTokensBefore: result.inputTokensBefore,
54295
54471
  inputTokensAfter: result.inputTokensAfter,
54296
54472
  maxContextTokens: result.maxContextTokens,