openpond 0.0.30-bootstrap.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 (193) hide show
  1. package/CHANGELOG.md +128 -0
  2. package/LICENSE +21 -0
  3. package/README.md +162 -0
  4. package/RELEASE.md +20 -0
  5. package/dist/api/core.d.ts +22 -0
  6. package/dist/api/deployments.d.ts +30 -0
  7. package/dist/api/types.d.ts +624 -0
  8. package/dist/api.d.ts +90 -0
  9. package/dist/cache.d.ts +22 -0
  10. package/dist/chunks/app-layer-YKXEQGOW.js +163 -0
  11. package/dist/chunks/apps-GGSIN2ZF.js +539 -0
  12. package/dist/chunks/chunk-3CC6MH35.js +1663 -0
  13. package/dist/chunks/chunk-3Y4EL3P6.js +1090 -0
  14. package/dist/chunks/chunk-4HYJG2JE.js +3875 -0
  15. package/dist/chunks/chunk-5G4E547X.js +294 -0
  16. package/dist/chunks/chunk-74O6FGVN.js +598 -0
  17. package/dist/chunks/chunk-AUJLPKGI.js +632 -0
  18. package/dist/chunks/chunk-BYAPLT37.js +744 -0
  19. package/dist/chunks/chunk-FUP7EGT7.js +1845 -0
  20. package/dist/chunks/chunk-I6HN3ZGW.js +88 -0
  21. package/dist/chunks/chunk-KRKGHVMQ.js +294 -0
  22. package/dist/chunks/chunk-LHYK6QO2.js +1300 -0
  23. package/dist/chunks/chunk-NLBKZZEK.js +224 -0
  24. package/dist/chunks/chunk-OG75GMVO.js +1 -0
  25. package/dist/chunks/chunk-Q57SVPEH.js +11663 -0
  26. package/dist/chunks/chunk-UACZUFIA.js +47 -0
  27. package/dist/chunks/chunk-VQX33YAG.js +5135 -0
  28. package/dist/chunks/chunk-W5GKHH77.js +168 -0
  29. package/dist/chunks/chunk-WYDVQOBL.js +17581 -0
  30. package/dist/chunks/chunk-XSAXENQD.js +4167 -0
  31. package/dist/chunks/chunk-Y6G6WRTG.js +210 -0
  32. package/dist/chunks/cli-NVKNE4AZ.js +11 -0
  33. package/dist/chunks/cli-X3HPLSOV.js +19 -0
  34. package/dist/chunks/core-commands-IM2UKLU4.js +41 -0
  35. package/dist/chunks/extend-YXCBULPO.js +84 -0
  36. package/dist/chunks/harness-GMK6IY2U.js +140 -0
  37. package/dist/chunks/help-LMH5FGT2.js +65 -0
  38. package/dist/chunks/opchat-BWXZ32GX.js +169 -0
  39. package/dist/chunks/organizations-4ISQRGMQ.js +738 -0
  40. package/dist/chunks/profile-NLDZDT3L.js +1110 -0
  41. package/dist/chunks/project-agent-ZPVO25HA.js +892 -0
  42. package/dist/chunks/sandbox-command-5GFJ2U3V.js +1652 -0
  43. package/dist/chunks/sandbox-template-LZN4F55Z.js +1646 -0
  44. package/dist/chunks/src-3RBI4DNN.js +3595 -0
  45. package/dist/chunks/src-EYXQS6XD.js +73427 -0
  46. package/dist/chunks/teams-bot-WP3FHKGA.js +137 -0
  47. package/dist/cli.js +77 -0
  48. package/dist/client-types.d.ts +222 -0
  49. package/dist/client.d.ts +19 -0
  50. package/dist/config.d.ts +184 -0
  51. package/dist/hosted-chat.d.ts +162 -0
  52. package/dist/index.d.ts +5 -0
  53. package/dist/index.js +25481 -0
  54. package/dist/indicators.d.ts +38 -0
  55. package/dist/opchat-smoke.d.ts +47 -0
  56. package/dist/private-json-file.d.ts +3 -0
  57. package/dist/profile/local-profile-types.d.ts +160 -0
  58. package/dist/profile/local-profile.d.ts +69 -0
  59. package/dist/profile/profile-catalog.d.ts +14 -0
  60. package/dist/profile/profile-git.d.ts +17 -0
  61. package/dist/profile/profile-promotion.d.ts +21 -0
  62. package/dist/profile/profile-setup-gate.d.ts +22 -0
  63. package/dist/profile/profile-skills.d.ts +30 -0
  64. package/dist/profile/profile-source-upload.d.ts +29 -0
  65. package/dist/profile/source-upload-cache.d.ts +29 -0
  66. package/dist/sandbox/async-request-options.d.ts +2 -0
  67. package/dist/sandbox/client-handles.d.ts +113 -0
  68. package/dist/sandbox/client.d.ts +348 -0
  69. package/dist/sandbox/runtime-handle.d.ts +36 -0
  70. package/dist/sandbox/sandbox-instance-client.d.ts +72 -0
  71. package/dist/sandbox/smoke.d.ts +3 -0
  72. package/dist/sandbox/stream.d.ts +7 -0
  73. package/dist/sandbox/types/billing.d.ts +176 -0
  74. package/dist/sandbox/types/client.d.ts +103 -0
  75. package/dist/sandbox/types/core.d.ts +140 -0
  76. package/dist/sandbox/types/index.d.ts +14 -0
  77. package/dist/sandbox/types/io.d.ts +240 -0
  78. package/dist/sandbox/types/microsoft-teams-bot.d.ts +51 -0
  79. package/dist/sandbox/types/org-project-agent.d.ts +610 -0
  80. package/dist/sandbox/types/record.d.ts +53 -0
  81. package/dist/sandbox/types/responses.d.ts +295 -0
  82. package/dist/sandbox/types/runtime-profiles.d.ts +15 -0
  83. package/dist/sandbox/types/runtime.d.ts +152 -0
  84. package/dist/sandbox/types/schedules.d.ts +141 -0
  85. package/dist/sandbox/types/snapshots.d.ts +205 -0
  86. package/dist/sandbox/types/workflow-modes.d.ts +1 -0
  87. package/dist/sandbox/types/workload-sources.d.ts +20 -0
  88. package/dist/sandbox/url.d.ts +2 -0
  89. package/dist/sandbox-template/manifest.d.ts +304 -0
  90. package/dist/sandbox-template/manifest.js +18381 -0
  91. package/dist/skills/openpond-cli/SKILL.md +49 -0
  92. package/dist/skills/openpond-desktop-harness/SKILL.md +113 -0
  93. package/dist/skills/openpond-desktop-harness/agents/openai.yaml +4 -0
  94. package/dist/skills/openpond-taskset-authoring/SKILL.md +38 -0
  95. package/dist/skills/openpond-taskset-authoring/references/graders-and-rewards.md +11 -0
  96. package/dist/skills/openpond-taskset-authoring/references/method-selection.md +12 -0
  97. package/dist/skills/openpond-taskset-authoring/references/privacy-and-provenance.md +8 -0
  98. package/dist/skills/openpond-taskset-authoring/references/task-design.md +13 -0
  99. package/dist/stream.d.ts +20 -0
  100. package/dist/types.d.ts +57 -0
  101. package/dist/urls.d.ts +4 -0
  102. package/dist/web/assets/AppsView-Bu-Nc3Ew.js +1 -0
  103. package/dist/web/assets/AppsView-DIhprTIC.css +1 -0
  104. package/dist/web/assets/BrowserSidebar-CCguQ-DR.js +1 -0
  105. package/dist/web/assets/BrowserSidebar-D9i7gQzw.css +1 -0
  106. package/dist/web/assets/CloudWorkView-DNoPIlMj.css +1 -0
  107. package/dist/web/assets/CloudWorkView-Dr3xqLE5.js +1 -0
  108. package/dist/web/assets/CommandMenu-CnodJFHD.js +1 -0
  109. package/dist/web/assets/CommandMenu-hNQCm8mw.css +1 -0
  110. package/dist/web/assets/CommunityView-CIbjNUZr.js +1 -0
  111. package/dist/web/assets/CommunityView-DSik4sd2.css +1 -0
  112. package/dist/web/assets/GetStartedView-C3ZrnEz5.css +1 -0
  113. package/dist/web/assets/GetStartedView-C8nyH_PT.js +1 -0
  114. package/dist/web/assets/LabsExtensions-GtJzxDnK.js +1 -0
  115. package/dist/web/assets/LabsProfile-DG7rWYur.js +1 -0
  116. package/dist/web/assets/LabsRoute-D6MDHBzq.js +2 -0
  117. package/dist/web/assets/LabsRoute-TEt9j1vB.css +1 -0
  118. package/dist/web/assets/LabsSignals-BfsDN86w.js +1 -0
  119. package/dist/web/assets/LabsSignals-D6iA6Ryl.css +1 -0
  120. package/dist/web/assets/NewProjectDialog-CaKiCoVS.js +1 -0
  121. package/dist/web/assets/ProfileSettingsSection-DTQS2DVL.css +1 -0
  122. package/dist/web/assets/ProfileSettingsSection-DxEzoF3K.js +1 -0
  123. package/dist/web/assets/ProfileView-CEscW7Ru.js +1 -0
  124. package/dist/web/assets/SettingsView-DwbGu8Kj.css +1 -0
  125. package/dist/web/assets/SettingsView-JIRR_FO4.js +63 -0
  126. package/dist/web/assets/TeamChatView-B5M1ThhJ.js +3 -0
  127. package/dist/web/assets/TeamChatView-Bx44q3WV.css +1 -0
  128. package/dist/web/assets/TerminalOverlay-C1iP4OS1.js +19 -0
  129. package/dist/web/assets/TerminalOverlay-DwBiZLwk.css +1 -0
  130. package/dist/web/assets/TrainingSettingsSection-BDYvI2te.js +1 -0
  131. package/dist/web/assets/TrainingView-CoCFK6W3.js +5 -0
  132. package/dist/web/assets/WorkspaceDiffPanel-CMxKQeo7.js +14 -0
  133. package/dist/web/assets/WorkspaceEnvironmentMenu-B8JJbwIz.js +32 -0
  134. package/dist/web/assets/WorkspaceEnvironmentMenu-DGIFdG3o.css +1 -0
  135. package/dist/web/assets/WorkspaceGitDialogs-B4sp9BGn.js +1 -0
  136. package/dist/web/assets/WorkspaceMonacoEditor-BBqimG5X.js +845 -0
  137. package/dist/web/assets/WorkspaceMonacoEditor-BwKcXIZw.css +1 -0
  138. package/dist/web/assets/boxes-DAaDUabq.js +1 -0
  139. package/dist/web/assets/codicon-ngg6Pgfi.ttf +0 -0
  140. package/dist/web/assets/css.worker-DBVD8oXr.js +93 -0
  141. package/dist/web/assets/cssMode-CBF1mieJ.js +1 -0
  142. package/dist/web/assets/dockerfile-BG73LgW2.js +1 -0
  143. package/dist/web/assets/editor.worker-CdQrwHl8.js +26 -0
  144. package/dist/web/assets/git-commit-horizontal-CAickXpN.js +1 -0
  145. package/dist/web/assets/git-dialogs-BZDqS1eT.css +1 -0
  146. package/dist/web/assets/html.worker-CwpTb9lJ.js +470 -0
  147. package/dist/web/assets/htmlMode-2u8OHtWO.js +1 -0
  148. package/dist/web/assets/index-BdY6A-YN.css +1 -0
  149. package/dist/web/assets/index-CU2qhUYV.js +195 -0
  150. package/dist/web/assets/index-Dz2B3-4C.js +1 -0
  151. package/dist/web/assets/info-CQNTh78o.js +1 -0
  152. package/dist/web/assets/json.worker-BoL8UZqY.js +58 -0
  153. package/dist/web/assets/jsonMode-C4CWXViX.js +7 -0
  154. package/dist/web/assets/lspLanguageFeatures-CBs_BOlB.js +4 -0
  155. package/dist/web/assets/markdown-BFxVWTOG.js +1 -0
  156. package/dist/web/assets/monaco.contribution-C1LUxAKf.js +2 -0
  157. package/dist/web/assets/monaco.contribution-Cpf6dWsh.js +2 -0
  158. package/dist/web/assets/monaco.contribution-lOXpG2xQ.js +2 -0
  159. package/dist/web/assets/monaco.contribution-sd3cFkcN.js +2 -0
  160. package/dist/web/assets/monitor-DsIswrMV.js +1 -0
  161. package/dist/web/assets/play-CeRw21NV.js +1 -0
  162. package/dist/web/assets/python-CXYq3BUl.js +1 -0
  163. package/dist/web/assets/refresh-cw-N5b_6AP5.js +1 -0
  164. package/dist/web/assets/reply-BSKjZrJg.js +1 -0
  165. package/dist/web/assets/save-D0oHH1a3.js +1 -0
  166. package/dist/web/assets/settings-lists-BEg6LMcy.css +1 -0
  167. package/dist/web/assets/shell-DiJ1NA_G.js +1 -0
  168. package/dist/web/assets/toggleHighContrast-B7NOMXDY.css +1 -0
  169. package/dist/web/assets/toggleHighContrast-DRjlcwes.js +62 -0
  170. package/dist/web/assets/training-model-data-BPrc68VG.js +1 -0
  171. package/dist/web/assets/ts.worker-BH9nVgjN.js +67718 -0
  172. package/dist/web/assets/tsMode-x-1A7ZcB.js +11 -0
  173. package/dist/web/assets/wifi-off-Dt52ofzh.js +1 -0
  174. package/dist/web/assets/workers-Ciff6Dzi.js +1 -0
  175. package/dist/web/assets/yaml-CB67Kxnz.js +1 -0
  176. package/dist/web/connected-apps/github.svg +3 -0
  177. package/dist/web/connected-apps/google.svg +6 -0
  178. package/dist/web/connected-apps/linear.svg +3 -0
  179. package/dist/web/connected-apps/microsoft.svg +6 -0
  180. package/dist/web/connected-apps/notion.svg +3 -0
  181. package/dist/web/connected-apps/openpond-mcp.svg +4 -0
  182. package/dist/web/connected-apps/slack.svg +6 -0
  183. package/dist/web/connected-apps/x.svg +3 -0
  184. package/dist/web/favicon-16x16.png +0 -0
  185. package/dist/web/favicon-32x32.png +0 -0
  186. package/dist/web/index.html +16 -0
  187. package/dist/web/openpond-icon.png +0 -0
  188. package/dist/web/openpond-wordlogo-white.png +0 -0
  189. package/dist/web/tokens/eth.svg +1 -0
  190. package/dist/web/tokens/usdc.svg +1 -0
  191. package/docs/agent-edit-check-status-json.md +132 -0
  192. package/docs/command-reference.md +695 -0
  193. package/package.json +84 -0
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: openpond-cli
3
+ description: Use the OpenPond CLI to create repos, watch deployments, and run tools without the web UI.
4
+ metadata:
5
+ short-description: OpenPond CLI workflows
6
+ ---
7
+
8
+ # OpenPond CLI
9
+
10
+ Use this skill when an agent needs to create or manage OpenPond apps via the CLI, without MCP.
11
+
12
+ ## Quick setup
13
+
14
+ - Install: `npm i -g openpond` (or `npx --package openpond openpond <cmd>`)
15
+ - Auth: run `openpond login` or set `OPENPOND_API_KEY`
16
+ - Non-interactive login: `openpond login --api-key opk_...`
17
+
18
+ ## Common workflows
19
+
20
+ - Create OpenPond repo and attach remote:
21
+ - `openpond repo create --name my-repo --path .`
22
+ - Non-interactive push (tokenized remote):
23
+ - `openpond repo create --name my-repo --path . --token`
24
+ - `git add . && git commit -m "init"`
25
+ - `openpond repo push --path . --branch main`
26
+ - `openpond repo push` reads `.git/config`, temporarily tokenizes `origin`, and restores it after push.
27
+ - Watch deployments:
28
+ - `openpond deploy watch handle/repo --branch main`
29
+ - List and run tools:
30
+ - `openpond tool list handle/repo`
31
+ - `openpond tool run handle/repo myTool --body '{"foo":"bar"}'`
32
+ - Account-level APIs:
33
+ - `openpond apps list [--handle <handle>] [--refresh]`
34
+ - `openpond apps tools`
35
+ - `openpond apps performance --app-id app_123`
36
+ - `openpond apps agent create --prompt "Build a daily digest agent"`
37
+
38
+ ## OpenTool passthrough
39
+
40
+ Use the CLI to run OpenTool commands via `npx`:
41
+
42
+ - `openpond opentool init --dir .`
43
+ - `openpond opentool validate --input tools`
44
+ - `openpond opentool build --input tools --output dist`
45
+
46
+ ## Config and URLs
47
+
48
+ - Optional env vars: `OPENPOND_BASE_URL`, `OPENPOND_API_URL`, `OPENPOND_TOOL_URL`, `OPENPOND_API_KEY`
49
+ - Cache file: `~/.openpond/cache.json` (auto-refreshes on next use)
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: openpond-desktop-harness
3
+ description: Author, run, debug, or extend OpenPond verifiable desktop harness scenarios for the Electron desktop app, multi-turn chat, runtime events, renderer UX, subagent lifecycle/running/handoff/blocker behavior, scripted provider models, or JSON/screenshot proof. Use when Codex is asked to add desktop harness coverage, validate UI/UX behavior through the harness, update tests under tests/desktop-scenarios, or use openpond harness desktop run.
4
+ ---
5
+
6
+ # OpenPond Desktop Harness
7
+
8
+ ## Overview
9
+
10
+ Use the desktop harness to prove real OpenPond desktop behavior with runtime events, bootstrap/store state, CDP-rendered UI assertions, and screenshot/JSON artifacts. Prefer typed server setup and event waits over blind pointer automation, but use visible renderer actions for UX-critical flows.
11
+
12
+ ## First Files To Read
13
+
14
+ - `docs/working-docs/agent-harness/2026-07-08-verifiable-desktop-harness.md`: current phased plan, status, evidence, and boundaries.
15
+ - `tests/desktop-scenarios/README.md`: implemented scenario list, artifact convention, and useful commands.
16
+ - `scripts/desktop-harness/types.ts`: scenario and harness API contract.
17
+ - `tests/desktop-scenarios/helpers.ts`: shared scripted model setup, subagent preference setup, event parsing, renderer waits, and sidebar helpers.
18
+ - One nearby scenario in `tests/desktop-scenarios/*.ts` that matches the behavior being added.
19
+
20
+ ## Workflow
21
+
22
+ 1. Inspect existing harness code before editing. Reuse `harness.api`, `harness.events`, `harness.renderer`, and helpers instead of adding one-off polling or DOM code in scenarios.
23
+ 2. Decide what the scenario proves:
24
+ - Use server APIs for setup-heavy state such as sessions, preferences, provider overrides, long histories, or fixture workspaces.
25
+ - Use visible renderer actions for UX behavior such as composer submission, session selection, child row expansion, right-sidebar interaction, and rendered receipts.
26
+ - Use runtime/bootstrap assertions for correctness: event names, turn ids, run ids, parent/child linkage, pending approvals, blocked/completed states, and persisted sessions.
27
+ 3. If provider decisions must be deterministic, use the development-only OpenPond scripted models gated by `OPENPOND_HARNESS_SCRIPTED_MODELS=1`; isolated harness launch enables this gate.
28
+ 4. Add or update a scenario under `tests/desktop-scenarios/` with `desktopScenario({ name, mode, timeoutMs, run })`.
29
+ 5. Record durable proof with `harness.recordAssertion`, `harness.recordMetadata`, and `await harness.screenshot(...)`.
30
+ 6. Run focused unit tests first, then the scenario in isolated desktop mode, and update the working doc validation/progress sections with exact commands. Use packaged mode only when a packaged app artifact already exists.
31
+
32
+ ## Scenario Pattern
33
+
34
+ ```ts
35
+ import { desktopScenario } from "../../scripts/desktop-harness/scenario";
36
+ import {
37
+ registerScriptedOpenPondModel,
38
+ reloadRenderer,
39
+ waitForCompletedTurn,
40
+ } from "./helpers";
41
+
42
+ const modelRef = {
43
+ providerId: "openpond" as const,
44
+ modelId: "openpond-scripted-chat-two-turns",
45
+ };
46
+
47
+ export default desktopScenario({
48
+ name: "my-desktop-proof",
49
+ mode: "isolated",
50
+ timeoutMs: 120_000,
51
+ async run(harness) {
52
+ await registerScriptedOpenPondModel(harness, modelRef);
53
+ const session = await harness.api.createSession({
54
+ provider: "openpond",
55
+ modelRef,
56
+ title: harness.uniqueTitle("my-desktop-proof"),
57
+ cwd: harness.repoRoot,
58
+ });
59
+
60
+ await reloadRenderer(harness);
61
+ await harness.renderer.selectSession(session.id);
62
+ await harness.renderer.submitComposer("Exercise the behavior through the real composer.");
63
+
64
+ const start = await harness.events.waitForName(session.id, "turn.started");
65
+ await waitForCompletedTurn(harness, session.id, start, "turn completion");
66
+ await harness.renderer.assertText("expected visible response");
67
+
68
+ harness.recordAssertion("expectedResponseVisible", true);
69
+ harness.recordMetadata({ parentSessionId: session.id });
70
+ await harness.screenshot("my-desktop-proof-complete");
71
+ },
72
+ });
73
+ ```
74
+
75
+ ## Commands
76
+
77
+ Use the script runner during harness development:
78
+
79
+ ```bash
80
+ pnpm exec vitest run tests/desktop-harness-runner.test.ts tests/scripted-chat-provider.test.ts
81
+ pnpm exec tsx scripts/desktop-harness.ts run tests/desktop-scenarios/chat-two-turns.ts --isolated --timeout-ms 120000 --artifacts-dir tmp/desktop-harness/chat-two-turns --json tmp/desktop-harness/chat-two-turns/report.json
82
+ pnpm exec tsx scripts/desktop-harness.ts run tests/desktop-scenarios/chat-two-turns.ts tests/desktop-scenarios/subagent-visible-lifecycle.ts tests/desktop-scenarios/subagent-running-state.ts tests/desktop-scenarios/subagent-handoff-parent-wake.ts tests/desktop-scenarios/subagent-blocked-approval.ts tests/desktop-scenarios/goal-scoped-subagent-details.ts tests/desktop-scenarios/context-compaction-followup.ts --isolated --timeout-ms 150000 --artifacts-dir tmp/desktop-harness/desktop-scenarios --json tmp/desktop-harness/desktop-scenarios/report.json
83
+ pnpm exec tsx scripts/desktop-harness-report.ts summarize tmp/desktop-harness/desktop-scenarios/report.json --json tmp/desktop-harness/release-proof/summary.json --markdown tmp/desktop-harness/release-proof/summary.md
84
+ ```
85
+
86
+ Use the CLI wrapper when validating the installed/source CLI entrypoint:
87
+
88
+ ```bash
89
+ pnpm --dir apps/cli cli harness desktop run tests/fixtures/desktop-harness/pass-scenario.ts --none --artifacts-dir tmp/desktop-harness/cli-wrapper --json tmp/desktop-harness/cli-wrapper/report.json
90
+ openpond harness desktop run tests/desktop-scenarios/chat-two-turns.ts --isolated --json tmp/desktop-harness/chat-two-turns/report.json
91
+ openpond harness desktop attach tests/desktop-scenarios/chat-two-turns.ts --server http://127.0.0.1:17874 --devtools-port 9333 --token-file tmp/token
92
+ openpond harness desktop run tests/desktop-scenarios/chat-two-turns.ts --packaged --app release/linux-unpacked/openpond --json tmp/desktop-harness/packaged-chat/report.json
93
+ ```
94
+
95
+ ## Proof Rules
96
+
97
+ - Every product-behavior scenario should assert runtime evidence and rendered UI evidence.
98
+ - Prefer `harness.events.waitFor*` for runtime state, not fixed sleeps.
99
+ - Prefer visible text, ARIA labels, and stable product semantics for renderer assertions. Add `data-testid` only after semantic selectors are inadequate.
100
+ - Keep screenshots and JSON reports under `tmp/desktop-harness/<purpose>/`.
101
+ - Do not put secrets, cookies, OAuth tokens, raw `.env` values, provider keys, or storage state in logs, metadata, screenshots, reports, or docs.
102
+ - Do not make live provider calls part of default correctness proof. Add live-provider variants only as opt-in proof.
103
+ - Do not bypass the real turn runner, event bus, store, bootstrap projection, or renderer when a scenario claims desktop product behavior proof.
104
+
105
+ ## Common Scenario Targets
106
+
107
+ - Multi-turn chat: visible composer submit, assistant deltas, completed turns, persisted bootstrap session.
108
+ - Subagent lifecycle: `openpond_subagent_start`, `join`, `subagent.completed`, parent receipt, child sidebar grouping, child conversation text.
109
+ - Running state: delayed child execution, parent activity running row, sidebar running indicator, final completion.
110
+ - Handoff: child `openpond_subagent_send_message`, parent wake metadata, one child start, no duplicate child run.
111
+ - Blocker/approval: blocked runtime event and visible blocked UI, no accidental completion, no unexpected pending approval.
112
+ - Goal-scoped subagents: active Goal strip, right-sidebar Goal details, subagent counts, child `parentGoalId`.
113
+ - Context compaction: manual compaction status divider, summary event metadata, usage record, and post-compaction follow-up turn.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "OpenPond Desktop Harness"
3
+ short_description: "Author and run desktop harness scenarios"
4
+ default_prompt: "Use $openpond-desktop-harness to add or validate an OpenPond desktop harness scenario."
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: openpond-taskset-authoring
3
+ description: Turn consented OpenPond conversations and traces into provider-neutral Tasksets, executable graders, baseline plans, readiness reports, and inspectable SFT handoffs.
4
+ metadata:
5
+ short-description: Author training Tasksets
6
+ ---
7
+
8
+ # OpenPond Taskset Authoring
9
+
10
+ Use this skill when `/train`, the Training page, a selected conversation, or a Task Miner suggestion asks you to define a learnable capability.
11
+
12
+ ## Required workflow
13
+
14
+ 1. Inspect only the explicitly selected evidence. Cite source IDs; never copy unrelated conversation history.
15
+ 2. Separate policy-visible input from privileged outcome and grader state.
16
+ 3. Inventory existing demonstrations, corrections, preferences, labels, feedback, and verifiable rewards. Historical assistant messages are candidate outcomes, not automatically approved demonstrations. Do not fabricate expert approval.
17
+ 4. Diagnose the stable behavior separately from changing knowledge, required runtime context, and tool use. Recommend `no_training`, prompting, or retrieval when weights are not the right intervention.
18
+ 5. Draft one provider-neutral `TaskDesignProposal` with a bounded objective and a typed capability diagnosis. Only training-eligible proposals include task instances, split-cluster keys, graders, calibration fixtures, and assumptions. Keep the user-facing name and objective natural: describe the repeated job and desired outcome in one or two short sentences.
19
+ 6. Ask a question only for a blocking ambiguity: objective, consent, success signal, privacy/licensing boundary, or mutually exclusive interpretations.
20
+ 7. Prefer deterministic graders. A model judge must be declared, pinned, calibrated, versioned, and recorded; it is not deterministic.
21
+ 8. Run validation, positive/negative/boundary/adversarial grader fixtures, baselines, leakage checks, and reward-hacking checks.
22
+ 9. Materialize only after approval, then show the generated diff and readiness blockers.
23
+ 10. Training requires a separate approval for destination, method, model, data export, retention, and budget.
24
+
25
+ Never put source IDs, hashes, cluster keys, split-placement rules, consent boilerplate, privileged expected values, encodings, or grader implementation details in the proposal name or objective. Keep those details in source references, policy boundaries, grader configuration, assumptions, warnings, and generated code.
26
+
27
+ Treat synthetic smoke fixtures as diagnostics, not representative business tasks. When the only evidence is a trivial fixed response or exact string, recommend `no_training`, explain that application logic or prompting is sufficient, and still use a short human description if a diagnostic Taskset is explicitly requested.
28
+
29
+ Label every proposed example as `extracted`, `corrected`, `synthetic`, or `expert_authored`. Extracted examples must exactly match their cited source turn. Corrected and synthetic examples must remain visibly transformed and may not be represented as expert-approved merely because an authoring model produced them.
30
+
31
+ Use `Create with defaults` when evidence is sufficient. Record reversible assumptions and proceed to the single materialization approval. Use `Customize` for a conversational design pass.
32
+
33
+ Read only the reference needed for the current decision:
34
+
35
+ - Task reconstruction and split isolation: `references/task-design.md`
36
+ - Graders, reward eligibility, and calibration: `references/graders-and-rewards.md`
37
+ - Method selection and readiness: `references/method-selection.md`
38
+ - Privacy, consent, and provenance: `references/privacy-and-provenance.md`
@@ -0,0 +1,11 @@
1
+ # Graders and rewards
2
+
3
+ - Prefer exact, schema, file, diff, test, runtime-event, and final-state graders.
4
+ - Compose graders with explicit weights and hard gates. Infrastructure failures receive no reward.
5
+ - Generated verifier code runs without network or broad credentials and has a strict timeout.
6
+ - A generated verifier exports one function that receives `{ task, attempt }`. Read policy input from `task.input`, the privileged expected outcome from `task.expectedOutput`, the candidate from `attempt.output`, and infrastructure state from `attempt.infrastructureError`. Flat `input`, `expectedOutput`, `output`, and `infrastructureError` aliases are also available, but new verifier code should use the nested form.
7
+ - Return `{ passed, score, feedback, evidenceRefs? }`. `reason` is accepted as a feedback alias, but new verifier code should return `feedback`.
8
+ - Test positive, negative, boundary, adversarial, prompt-injection, leakage, and infrastructure-failure fixtures.
9
+ - A model judge records provider/model, configuration, rubric version, evidence, structured score, rationale, and calibration status.
10
+ - Only frozen graders that pass calibration and hacking tests may be marked reward-eligible.
11
+ - SFT uses graders for baselines and frozen evaluation, not as optimizer reward.
@@ -0,0 +1,12 @@
1
+ # Method selection
2
+
3
+ - Changing facts and internal documents: retrieval/context.
4
+ - Approved input-output demonstrations: SFT.
5
+ - Corrections or chosen/rejected pairs: SFT and/or preference tuning.
6
+ - Stable exact labels: classification/SFT; consider RL only after baseline evidence.
7
+ - Reliable scalar reward with non-trivial baseline variance: GRPO/RFT.
8
+ - Runtime, test, or reviewer feedback on policy attempts: SDPO when a proven backend supports it.
9
+ - Teacher-only demonstrations: SDFT/OPSD when the teacher surface exposes the required signal.
10
+ - Long processes with tools and state: agentic RL environment.
11
+
12
+ The initially executable OpenPond recipe is LoRA SFT. Other methods remain recommendations until a real destination proves their execution contract.
@@ -0,0 +1,8 @@
1
+ # Privacy and provenance
2
+
3
+ - Require source consent before authoring and separate disclosure approval before a hosted model reads source content.
4
+ - Show the analysis provider/model, exact source scope, and whether raw or transformed evidence leaves the machine.
5
+ - Block unresolved secrets, licensing violations, hidden grader leakage, and unapproved connected-app data.
6
+ - Record source hashes, model/config, skill hash, prompt/template version, SDK version, source commit, assumptions, and repair history.
7
+ - Keep the authoring transcript separate from the typed proposal and approved materialized Taskset.
8
+ - Training export is a later approval and contains only approved transformed assets.
@@ -0,0 +1,13 @@
1
+ # Task design
2
+
3
+ - Define the work from the starting state available to the policy, not from the original chat's hidden future.
4
+ - Preserve a source-cluster key for semantically related examples. One cluster may appear in exactly one split.
5
+ - Frozen evaluation examples may never be used as demonstrations, prompt exemplars, repair context, or judge calibration data.
6
+ - Store transformed task inputs and content-addressed source references. Do not place raw unrelated chats in a Taskset.
7
+ - Treat source conversations as evidence. Select only successful, context-complete outcomes; reject stale or contradictory answers and label every repaired or synthetic example.
8
+ - Separate stable behavior from changing facts before selecting a training method. A repeated subject is not automatically a repeated learnable job.
9
+ - Stateful tasks declare create/reset/step/grade/cleanup, timeouts, deterministic seeds when possible, tool scopes, and network policy.
10
+ - A Taskset can target chat, one agent, multiple agents, or a custom harness. Do not force it into an Agent SDK project.
11
+ - Write names and objectives for the person reviewing the Taskset. Describe the capability and outcome, not its storage or evaluation machinery.
12
+ - Keep source IDs, hashes, cluster keys, split rules, privileged targets, encodings, and grader mechanics out of user-facing names and objectives.
13
+ - Mark synthetic fixed-output smoke cases as diagnostics and prefer `no_training`; do not present them as discovered organizational workflows.
@@ -0,0 +1,20 @@
1
+ import type { ResponseItem } from "./types.js";
2
+ export type StreamCallbacks = {
3
+ onTextDelta?: (delta: string) => void;
4
+ onReasoningDelta?: (delta: string) => void;
5
+ onConversationId?: (id: string) => void;
6
+ onItems?: (items: ResponseItem[]) => void;
7
+ onUsage?: (usage: {
8
+ promptTokens?: number;
9
+ completionTokens?: number;
10
+ totalTokens?: number;
11
+ }) => void;
12
+ shouldStop?: () => boolean;
13
+ onStop?: () => void;
14
+ };
15
+ export declare function normalizeDataFrames(raw: unknown): {
16
+ conversationId?: string;
17
+ items: ResponseItem[];
18
+ };
19
+ export declare function consumeStream(response: Response, callbacks: StreamCallbacks): Promise<void>;
20
+ export declare function formatStreamItem(item: ResponseItem): string | null;
@@ -0,0 +1,57 @@
1
+ export type ResponseItem = {
2
+ type: string;
3
+ [key: string]: unknown;
4
+ };
5
+ export type ResponseMessageItem = ResponseItem & {
6
+ type: "message";
7
+ role: "user" | "assistant" | "system";
8
+ content: Array<{
9
+ type: "markdown" | "text" | "json";
10
+ text: string;
11
+ }>;
12
+ };
13
+ export type ToolCallItem = ResponseItem & {
14
+ type: "tool_call";
15
+ callId?: string;
16
+ name: string;
17
+ args?: Record<string, unknown>;
18
+ };
19
+ export type ToolOutputItem = ResponseItem & {
20
+ type: "tool_output";
21
+ callId?: string;
22
+ name?: string;
23
+ ok: boolean;
24
+ output?: unknown;
25
+ error?: string;
26
+ };
27
+ export type UsageInfo = {
28
+ promptTokens?: number;
29
+ completionTokens?: number;
30
+ totalTokens?: number;
31
+ };
32
+ export type TemplateBootstrap = {
33
+ name?: string;
34
+ description?: string;
35
+ templateRepoUrl?: string;
36
+ templateBranch?: string;
37
+ envVars?: Record<string, string>;
38
+ };
39
+ export type ChatRequestBody = {
40
+ input: ResponseItem[];
41
+ mode: "general" | "builder";
42
+ executionMode?: "local" | "hosted";
43
+ conversationId?: string | null;
44
+ appId?: string | null;
45
+ template?: TemplateBootstrap;
46
+ streamDeployLogs?: boolean;
47
+ userId?: string;
48
+ teamId?: string;
49
+ action?: "tool_result";
50
+ toolResult?: {
51
+ toolName: string;
52
+ callId?: string;
53
+ output?: unknown;
54
+ ok?: boolean;
55
+ error?: string;
56
+ };
57
+ };
package/dist/urls.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export declare const DEFAULT_OPENPOND_WEB_BASE_URL = "https://openpond.ai";
2
+ export declare const DEFAULT_OPENPOND_API_BASE_URL = "https://api.openpond.ai";
3
+ export declare const DEFAULT_OPENPOND_OPCHAT_API_BASE_URL = "https://api.openpond.ai/opchat/v1";
4
+ export declare const DEFAULT_OPENPOND_CHAT_API_BASE_URL = "https://api.openpond.ai/opchat/v1";
@@ -0,0 +1 @@
1
+ import{r,b3 as b,m as L,j as e,S as I,aS as k,X as P,b4 as E,R as F,E as U,b5 as R,b6 as T}from"./index-CU2qhUYV.js";const D=["For agents","Featured","Productivity","Developer tools"],M=new Set(["slack","google","github","mcp"]);function J({account:s,connection:n,defaultTeamId:a,onToast:o}){const[c,f]=r.useState(null),[p,v]=r.useState(""),[i,y]=r.useState("For agents"),[u,h]=r.useState(()=>b()),[g,d]=r.useState("idle"),[S,x]=r.useState(null),w=s?.baseUrl??s?.activeProfile?.baseUrl??null,C=O(a,S),N=r.useMemo(()=>u.filter(t=>z(t,i)).filter(t=>q(t,p)),[i,p,u]);r.useEffect(()=>{let t=!0;return n?(d("loading"),L.connectedAppStatus(n,{status:"all"}).then(l=>{t&&(h(l.apps),x(l.teamId?.trim()||null),d("ready"))}).catch(l=>{t&&(console.warn("Unable to load connected app status.",l),h(b()),x(null),d("error"))}),()=>{t=!1}):(h(b()),d("idle"),x(null),()=>{t=!1})},[n]);function A(t){const l=R({appId:t.id,baseUrl:w,teamId:C});V(l).catch(j=>{o?.(j instanceof Error?j.message:String(j),"error")})}return e.jsxs("section",{className:"connected-apps-view","aria-label":"Apps",children:[e.jsxs("div",{className:"connected-apps-header",children:[e.jsxs("div",{children:[e.jsx("h1",{children:"Apps"}),e.jsx("p",{children:"Connect apps that agents can use for chat, knowledge, files, and workflow actions."})]}),e.jsxs("label",{className:"connected-apps-search",children:[e.jsx(I,{size:15}),e.jsx("input",{"aria-label":"Search apps",onChange:t=>v(t.target.value),placeholder:"Search apps",type:"search",value:p})]})]}),e.jsxs("div",{className:`connected-apps-status-strip ${g}`,children:[e.jsx("span",{children:W(g)}),e.jsxs("span",{children:[X(u)," connected"]})]}),e.jsxs("section",{className:"connected-apps-hero","aria-label":"App context",children:[e.jsxs("div",{className:"connected-apps-hero-copy",children:[e.jsx("span",{className:"connected-apps-hero-icon",children:e.jsx(m,{appId:"github"})}),e.jsx("h2",{children:"Work with your apps"}),e.jsx("p",{children:"Bring repositories, documents, chat, calendars, and custom MCP tools into OpenPond."})]}),e.jsxs("div",{className:"connected-apps-context-card","aria-hidden":"true",children:[e.jsx("strong",{children:"Agent context"}),e.jsxs("div",{children:[e.jsx("span",{className:"files",children:"Files"}),e.jsx("span",{className:"chat",children:"Chat"}),e.jsx("span",{className:"oauth",children:"OAuth"}),e.jsx("span",{className:"mcp",children:"MCP"})]})]})]}),e.jsx("div",{className:"connected-apps-filters",role:"tablist","aria-label":"App categories",children:D.map(t=>e.jsx("button",{"aria-selected":i===t,className:i===t?"active":"",onClick:()=>y(t),role:"tab",type:"button",children:t},t))}),e.jsxs("div",{className:"connected-apps-list",children:[N.map(t=>e.jsx(_,{app:t,onSelect:()=>f(t)},t.id)),N.length===0?e.jsx("div",{className:"connected-apps-empty",children:"No apps match the current search."}):null]}),c?e.jsx($,{app:c,onClose:()=>f(null),onInstall:()=>A(c)}):null]})}function O(s,n){const a=s?.trim();return a||n?.trim()||null}function _({app:s,onSelect:n}){return e.jsxs("button",{className:"connected-app-row",onClick:n,type:"button",children:[e.jsxs("span",{className:"connected-app-row-main",children:[e.jsx(m,{appId:s.id}),e.jsxs("span",{className:"connected-app-copy",children:[e.jsxs("span",{className:"connected-app-title",children:[e.jsx("strong",{children:s.label}),e.jsxs("span",{children:[s.shortLabel!==s.label?s.shortLabel:s.category," / ",s.setupSurfaceLabel]})]}),e.jsx("span",{children:s.description}),e.jsxs("span",{className:"connected-app-capability-row",children:[s.capabilityLabels.slice(0,2).map(a=>e.jsx("span",{children:a},a)),s.capabilityLabels.length>2?e.jsxs("span",{children:["+",s.capabilityLabels.length-2]}):null]})]})]}),e.jsx("span",{className:`connected-app-status-pill ${s.status}`,children:s.statusLabel}),e.jsx(k,{size:16})]})}function $({app:s,onClose:n,onInstall:a}){const o=s.connections.filter(c=>c.status==="active");return e.jsx("div",{className:"connected-app-dialog-backdrop",role:"presentation",onMouseDown:c=>{c.target===c.currentTarget&&n()},children:e.jsxs("section",{className:"connected-app-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"connected-app-dialog-title",children:[e.jsx("button",{className:"connected-app-dialog-close",type:"button","aria-label":"Close app details",onClick:n,children:e.jsx(P,{size:17})}),e.jsxs("div",{className:"connected-app-dialog-identity",children:[e.jsx("span",{className:"openpond-mark",children:e.jsx("img",{alt:"",src:E})}),e.jsxs("span",{className:"connection-dots","aria-hidden":"true",children:[e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{})]}),e.jsx(m,{appId:s.id})]}),e.jsxs("h2",{id:"connected-app-dialog-title",children:["Connect ",s.label]}),e.jsxs("div",{className:"connected-app-approval",children:[e.jsx(F,{size:16}),e.jsx("span",{children:s.statusLabel})]}),e.jsxs("div",{className:"connected-app-dialog-body",children:[e.jsxs("section",{children:[e.jsx("h3",{children:s.setupSurfaceLabel}),e.jsx("p",{children:"The web flow shows the provider account, workspace, and requested access before anything is connected."})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"Connected account"}),e.jsx("p",{children:G(o)})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"Available capabilities"}),e.jsx("div",{className:"connected-app-dialog-capabilities",children:s.capabilities.map(c=>e.jsx("span",{children:c.label},c.id))})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"Sandbox lease policy"}),e.jsx("p",{children:s.leasePolicy.leaseable?`Leaseable for ${s.leasePolicy.defaultTtlSeconds??0} seconds with scoped proxy access.`:"Managed as setup or tool discovery; no OAuth lease is required."})]})]}),e.jsxs("button",{className:"connected-app-dialog-primary",type:"button",onClick:a,children:[e.jsx("span",{children:s.installLabel}),e.jsx(U,{size:15})]})]})})}function m({appId:s}){return e.jsx("span",{className:`connected-app-icon app-${s}`,children:e.jsx("img",{alt:"",src:B(s)})})}function z(s,n){return n==="For agents"?!0:n==="Featured"?M.has(s.id):n==="Productivity"?s.category==="Productivity"||s.category==="Chat":s.category==="Developer tools"||s.id==="mcp"}function q(s,n){const a=n.trim().toLowerCase();return a?[s.id,s.label,s.shortLabel,s.category,s.description,s.providerFamily,s.setupSurface].some(o=>o.toLowerCase().includes(a)):!0}function B(s){return T(s)}async function V(s){const n=window.openpond?.browser;if(n){const a=await n.openExternal({conversationId:"connected-apps",url:s});if(!a.ok)throw new Error(a.error??"Unable to open app setup.");return}window.open(s,"_blank","noopener,noreferrer")}function W(s){return s==="loading"?"Checking connections":s==="ready"?"Connection status current":s==="error"?"Connection status unavailable":"Connection status pending"}function X(s){return s.filter(n=>n.connected).length}function G(s){return s.length===0?"No active OAuth connection for this setup surface.":s.map(n=>{const a=n.accountLabel??"Connected account";return n.workspaceLabel?`${a} / ${n.workspaceLabel}`:a}).join(", ")}export{J as AppsView,_ as ConnectedAppRow,O as connectedAppSetupTeamId};
@@ -0,0 +1 @@
1
+ .connected-apps-view{display:grid;align-content:start;gap:20px;width:min(960px,calc(100% - 72px));min-width:0;justify-self:center;padding:42px 0 40px}.connected-apps-header{display:grid;grid-template-columns:minmax(0,1fr) 230px;align-items:start;gap:24px;min-width:0}.connected-apps-header h1,.connected-apps-hero h2{margin:0;color:#f4f4f5;letter-spacing:0}.connected-apps-header h1{font-size:24px;line-height:1.15;font-weight:650}.connected-apps-header p{margin:6px 0 0;color:#9b9b9b;font-size:14px;line-height:1.45}.connected-apps-search{position:relative;display:grid;min-width:0}.connected-apps-search svg{position:absolute;left:13px;top:50%;color:#6f6f6f;transform:translateY(-50%);pointer-events:none}.connected-apps-search input{width:100%;height:38px;min-width:0;border:1px solid rgba(255,255,255,.11);border-radius:999px;background:#050505;color:#f3f3f3;padding:0 14px 0 38px;font-size:13px;outline:none}.connected-apps-search input:focus{border-color:#ffffff3d}.connected-apps-status-strip{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:34px;border:1px solid rgba(255,255,255,.08);border-radius:8px;background:#ffffff09;color:#a4a4a4;padding:7px 11px;font-size:12px}.connected-apps-status-strip.ready span:last-child{color:#64d790}.connected-apps-status-strip.error span:first-child{color:#ffb66d}.connected-apps-hero{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:40px;min-width:0;overflow:hidden;border-radius:24px;background:linear-gradient(135deg,#a76b42,#8fb7d9 48%,#38a39d);padding:28px 32px}.connected-apps-hero-copy{display:grid;align-content:start;gap:0;max-width:390px;color:#fff}.connected-apps-hero-icon,.connected-apps-context-card,.connected-app-icon{display:grid;place-items:center}.connected-apps-hero-icon{width:44px;height:44px;border-radius:999px;background:#fff}.connected-apps-hero-icon .connected-app-icon{background:transparent}.connected-apps-hero h2{margin-top:46px;font-size:24px;line-height:1.2;font-weight:560}.connected-apps-hero p{margin:12px 0 0;color:#ffffffe6;font-size:14px;line-height:1.45}.connected-apps-context-card{align-content:start;justify-items:stretch;min-height:190px;border-radius:18px;background:#ffffffe6;color:#111;padding:18px;box-shadow:0 20px 42px #0000002e}.connected-apps-context-card strong{font-size:14px;line-height:1.2}.connected-apps-context-card div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:18px;font-size:12px}.connected-apps-context-card span{min-width:0;border-radius:7px;padding:8px 11px;color:#111}.connected-apps-context-card .files{background:#dff0fb}.connected-apps-context-card .chat{background:#cef8df}.connected-apps-context-card .oauth{background:#fff2bd}.connected-apps-context-card .mcp{background:#ece6fb}.connected-apps-filters{display:flex;flex-wrap:wrap;gap:10px}.connected-apps-filters button{height:36px;border:0;border-radius:999px;background:transparent;color:#d1d1d1;padding:0 17px;font-size:14px}.connected-apps-filters button:hover{background:#ffffff0f}.connected-apps-filters button.active{background:#ffffff1a;color:#fff}.connected-apps-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:44px;row-gap:2px;min-width:0}.connected-app-row{display:grid;grid-template-columns:minmax(0,1fr) max-content 20px;align-items:center;gap:14px;min-height:88px;min-width:0;border:0;border-radius:8px;background:transparent;color:inherit;padding:8px 6px;text-align:left;transition:background-color .14s ease}.connected-app-row:hover,.connected-app-row:focus-visible{background:#ffffff0e;outline:none}.connected-app-row>svg{color:#686868}.connected-app-row-main{display:grid;grid-template-columns:44px minmax(0,1fr);align-items:center;gap:16px;min-width:0}.connected-app-icon{width:44px;height:44px;border-radius:999px;background:#050505}.connected-app-icon img{display:block;width:18px;height:18px;object-fit:contain}.connected-app-icon.app-google img,.connected-app-icon.app-slack img,.connected-app-icon.app-slack_oauth img,.connected-app-icon.app-microsoft_teams img,.connected-app-icon.app-microsoft_teams_oauth img{width:19px;height:19px}.connected-app-icon.app-mcp{background:#0f172a}.connected-app-icon.app-mcp img{width:22px;height:22px}.connected-app-copy,.connected-app-title{display:block;min-width:0}.connected-app-title{color:#f4f4f5;font-size:14px;line-height:1.25;font-weight:520}.connected-app-title strong,.connected-app-title span,.connected-app-copy>span:nth-child(2){display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.connected-app-title span{margin-top:1px;color:#777;font-size:11px;font-weight:450}.connected-app-copy>span:nth-child(2){margin-top:3px;color:#777;font-size:13px;line-height:1.25}.connected-app-capability-row{display:flex;flex-wrap:wrap;gap:5px;margin-top:7px}.connected-app-capability-row span,.connected-app-dialog-capabilities span{max-width:100%;min-width:0;overflow:hidden;border:1px solid rgba(255,255,255,.08);border-radius:999px;background:#ffffff0a;color:#a7a7a7;padding:3px 7px;text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:1.2}.connected-app-status-pill{min-width:86px;border-radius:999px;background:#ffffff0d;color:#a9a9a9;padding:5px 9px;text-align:center;white-space:nowrap;font-size:11px;line-height:1.2}.connected-app-status-pill.connected{background:#40c97821;color:#72df9b}.connected-app-status-pill.disconnected{background:#ffffff0a;color:#9d9d9d}.connected-apps-empty{grid-column:1 / -1;min-height:80px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.08);border-radius:8px;color:#888;font-size:13px}.connected-app-dialog-backdrop{position:fixed;inset:0;z-index:80;display:grid;place-items:center;background:#000000ad;padding:20px}.connected-app-dialog{position:relative;display:grid;gap:18px;width:min(480px,100%);max-height:calc(100vh - 40px);overflow:auto;border:1px solid rgba(255,255,255,.08);border-radius:18px;background:#292929;color:#f5f5f5;padding:32px 24px 24px;box-shadow:0 26px 70px #00000073}.connected-app-dialog-close{position:absolute;top:14px;right:14px;display:inline-grid;place-items:center;width:28px;height:28px;border:1px solid rgba(255,255,255,.1);border-radius:7px;background:#ffffff08;color:#b8b8b8;padding:0}.connected-app-dialog-close:hover{background:#ffffff0f;color:#fff}.connected-app-dialog-close:focus-visible{outline:2px solid rgba(255,255,255,.24);outline-offset:2px}.connected-app-dialog-identity,.connection-dots,.connected-app-approval,.connected-app-dialog-primary{display:flex;align-items:center;justify-content:center}.connected-app-dialog-identity{gap:14px;padding-top:2px}.openpond-mark{display:grid;place-items:center;width:56px;height:56px;border-radius:10px;background:#050505}.openpond-mark img{width:34px;height:34px;object-fit:contain}.connected-app-dialog-identity .connected-app-icon{width:56px;height:56px;border-radius:10px}.connected-app-dialog-identity .connected-app-icon img{width:25px;height:25px}.connection-dots{gap:5px}.connection-dots span{width:5px;height:5px;border-radius:999px;background:#ffffff29}.connected-app-dialog h2{margin:0;text-align:center;color:#fff;font-size:20px;line-height:1.2;letter-spacing:0}.connected-app-approval{gap:7px;color:#35d680;font-size:14px}.connected-app-dialog-body{overflow:hidden;border:1px solid rgba(255,255,255,.09);border-radius:14px}.connected-app-dialog-body section{padding:14px 16px}.connected-app-dialog-body section+section{border-top:1px solid rgba(255,255,255,.08)}.connected-app-dialog-body h3{margin:0 0 6px;color:#f0f0f0;font-size:13px;font-weight:650}.connected-app-dialog-body p{margin:0;color:#b8b8b8;font-size:12px;line-height:1.45}.connected-app-dialog-capabilities{display:flex;flex-wrap:wrap;gap:6px}.connected-app-dialog-primary{gap:7px;height:38px;border:0;border-radius:999px;background:#f5f5f5;color:#222;font-size:14px}.connected-app-dialog-primary:hover{background:#dedede}@media(max-width:840px){.connected-apps-view{width:min(100% - 28px,680px);padding-top:24px}.connected-apps-header,.connected-apps-hero,.connected-apps-list{grid-template-columns:minmax(0,1fr)}.connected-app-row{grid-template-columns:minmax(0,1fr) 20px}.connected-app-status-pill{grid-column:1 / -1;width:fit-content;margin-left:60px}.connected-apps-context-card{display:none}.connected-apps-hero h2{margin-top:30px}}
@@ -0,0 +1 @@
1
+ import{r as c,b7 as v,j as a,aJ as f,X as k,h as j,U as C,aG as g,ap as B,E as y,aM as N}from"./index-CU2qhUYV.js";import{R as T}from"./refresh-cw-N5b_6AP5.js";const x=[];function P(r){const e=window.openpond?.browser,[b,l]=c.useState(()=>({conversationId:r,activeTabId:null,tabs:x}));c.useEffect(()=>{if(l({conversationId:r,activeTabId:null,tabs:x}),!e)return;let s=!1;e.getState({conversationId:r}).then(o=>{s||l(o)});const n=e.onState(o=>{o.conversationId===r&&l(o)});return()=>{s=!0,n()}},[e,r]);const u=c.useMemo(()=>b.tabs.find(s=>s.id===b.activeTabId)??null,[b.activeTabId,b.tabs]),t=c.useCallback(async(s,n={})=>{if(!e)return!1;const o=v(s,{explicitFile:n.explicitFile});return o?(n.newTab?await e.newTab({conversationId:r,url:o,explicitFile:n.explicitFile}):await e.open({conversationId:r,url:o,explicitFile:n.explicitFile}),!0):!1},[e,r]),i=u?{conversationId:r,tabId:u.id}:null;return{activeTab:u,available:!!e,bridge:e,state:b,back:()=>e&&i?e.back(i):Promise.resolve({ok:!1}),clearData:()=>e?e.clearData({conversationId:r}):Promise.resolve({ok:!1}),closeTab:s=>e?e.closeTab({conversationId:r,tabId:s}):Promise.resolve({ok:!1}),forward:()=>e&&i?e.forward(i):Promise.resolve({ok:!1}),newTab:s=>e?e.newTab({conversationId:r,url:s}):Promise.resolve({ok:!1}),open:t,openExternal:()=>e&&i?e.openExternal(i):Promise.resolve({ok:!1}),reload:()=>e&&i?e.reload(i):Promise.resolve({ok:!1}),snapshot:(s={})=>e?e.snapshot({conversationId:r,...s}):Promise.resolve({ok:!1,output:"Desktop browser bridge unavailable."}),moveCursor:s=>e?e.moveCursor({conversationId:r,...s}):Promise.resolve({ok:!1,output:"Desktop browser bridge unavailable."}),click:s=>e?e.click({conversationId:r,...s}):Promise.resolve({ok:!1,output:"Desktop browser bridge unavailable."}),typeText:s=>e?e.typeText({conversationId:r,...s}):Promise.resolve({ok:!1,output:"Desktop browser bridge unavailable."}),key:s=>e?e.key({conversationId:r,...s}):Promise.resolve({ok:!1,output:"Desktop browser bridge unavailable."}),scroll:s=>e?e.scroll({conversationId:r,...s}):Promise.resolve({ok:!1,output:"Desktop browser bridge unavailable."}),selectTab:s=>e?e.selectTab({conversationId:r,tabId:s}):Promise.resolve({ok:!1}),setBounds:s=>e?e.setBounds({conversationId:r,bounds:s}):Promise.resolve({ok:!1}),stop:()=>e&&i?e.stop(i):Promise.resolve({ok:!1})}}function E({activeTabId:r,tabs:e,onCloseTab:b,onNewTab:l,onSelectTab:u}){return a.jsxs("div",{className:"browser-tabs",role:"tablist","aria-label":"Browser tabs",children:[e.map(t=>a.jsxs("div",{className:`browser-tab ${t.id===r?"active":""}`,children:[a.jsx("span",{className:"browser-tab-favicon","aria-hidden":"true",children:t.faviconUrl?a.jsx("img",{alt:"",referrerPolicy:"no-referrer",src:t.faviconUrl}):a.jsx(f,{size:13})}),a.jsx("button",{type:"button",className:"browser-tab-main",role:"tab","aria-selected":t.id===r,title:t.url,onClick:()=>u(t.id),children:R(t)}),a.jsx("button",{type:"button",className:"browser-tab-close",title:"Close tab","aria-label":"Close tab",onClick:()=>b(t.id),children:a.jsx(k,{size:12})})]},t.id)),a.jsx("button",{type:"button",className:"browser-tab-add",title:"New tab","aria-label":"New tab",onClick:l,children:a.jsx(j,{size:14})})]})}function R(r){if(r.title?.trim())return r.title.trim();try{return new URL(r.url).host||r.url}catch{return r.url||"New tab"}}function z({activeTab:r,available:e,onBack:b,onClearData:l,onForward:u,onNavigate:t,onOpenExternal:i,onReload:s,onStop:n}){const[o,d]=c.useState(""),[p,m]=c.useState(!1);c.useEffect(()=>{d(r?.url??"")},[r?.url]);function h(w){w.preventDefault(),t(o)}return a.jsxs("div",{className:"browser-toolbar",children:[a.jsxs("div",{className:"browser-nav-actions",children:[a.jsx("button",{type:"button",title:"Back","aria-label":"Back",disabled:!r?.canGoBack,onClick:b,children:a.jsx(C,{size:15})}),a.jsx("button",{type:"button",title:"Forward","aria-label":"Forward",disabled:!r?.canGoForward,onClick:u,children:a.jsx(g,{size:15})}),a.jsx("button",{type:"button",title:r?.loading?"Stop":"Reload","aria-label":r?.loading?"Stop":"Reload",disabled:!r,onClick:r?.loading?n:s,children:r?.loading?a.jsx(B,{size:13}):a.jsx(T,{size:14})})]}),a.jsx("form",{className:"browser-address-form",onSubmit:h,children:a.jsx("input",{"aria-label":"Browser address",disabled:!e,placeholder:e?"Search or enter address":"Desktop browser unavailable",spellCheck:!1,value:o,onChange:w=>d(w.target.value)})}),a.jsxs("div",{className:"browser-panel-actions",children:[a.jsx("button",{type:"button",title:"Open external","aria-label":"Open external",disabled:!r,onClick:i,children:a.jsx(y,{size:14})}),a.jsxs("div",{className:"browser-menu-anchor",children:[a.jsx("button",{type:"button",title:"Browser actions","aria-label":"Browser actions",onClick:()=>m(w=>!w),children:a.jsx(N,{size:15})}),p&&a.jsx("div",{className:"browser-options-menu",role:"menu",children:a.jsx("button",{type:"button",role:"menuitem",onClick:()=>{m(!1),l()},children:"Clear Browser Data..."})})]})]})]})}function D({active:r,onBounds:e}){const b=c.useRef(null),l=c.useRef(null),u=c.useRef(null),t=c.useCallback(n=>{const o=n?`${n.x}:${n.y}:${n.width}:${n.height}`:"null";l.current!==o&&(l.current=o,e(n))},[e]),i=c.useCallback(()=>{const n=b.current;if(!r||!n){t(null);return}const o=n.getBoundingClientRect(),d=Math.max(0,Math.round(o.width)),p=Math.max(0,Math.round(o.height));if(d===0||p===0){t(null);return}t({x:Math.round(o.left),y:Math.round(o.top),width:d,height:p})},[r,t]),s=c.useCallback(()=>{u.current===null&&(u.current=window.requestAnimationFrame(()=>{u.current=null,i()}))},[i]);return c.useLayoutEffect(()=>{l.current=null,i();const n=b.current;if(!r||!n)return t(null),()=>t(null);const o=new ResizeObserver(s);return o.observe(n),window.addEventListener("resize",s),window.addEventListener("scroll",s,!0),()=>{u.current!==null&&(window.cancelAnimationFrame(u.current),u.current=null),o.disconnect(),window.removeEventListener("resize",s),window.removeEventListener("scroll",s,!0),t(null)}},[r,t,i,s]),a.jsx("div",{className:"browser-viewport",ref:b})}function L({conversationId:r,expanded:e,onResizeStart:b}){const l=P(r),u=c.useCallback(s=>{window.openpond?.browser?.setBounds({conversationId:r,bounds:s})},[r]),t=c.useCallback(s=>{l.open(s,{explicitFile:!0})},[l]),i=c.useCallback(()=>{window.confirm("Clear browser data for this conversation? Tabs, cookies, cache, and local storage for this conversation will be removed.")&&l.clearData()},[l]);return a.jsxs("aside",{className:`workspace-diff-panel browser-sidebar-panel ${e?"expanded":""}`,"aria-label":"Browser",children:[!e&&a.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize browser panel",onPointerDown:b}),a.jsx(E,{activeTabId:l.state.activeTabId,tabs:l.state.tabs,onCloseTab:s=>{l.closeTab(s)},onNewTab:()=>{l.newTab()},onSelectTab:s=>{l.selectTab(s)}}),a.jsx(z,{activeTab:l.activeTab,available:l.available,onBack:()=>{l.back()},onClearData:i,onForward:()=>{l.forward()},onNavigate:t,onOpenExternal:()=>{l.openExternal()},onReload:()=>{l.reload()},onStop:()=>{l.stop()}}),a.jsxs("div",{className:"browser-content",children:[l.available?l.state.tabs.length===0?a.jsxs("div",{className:"browser-empty-state",children:[a.jsx(f,{size:18}),a.jsx("span",{children:"Enter a URL to open a browser tab for this conversation."})]}):null:a.jsxs("div",{className:"browser-empty-state",children:[a.jsx(f,{size:18}),a.jsx("span",{children:"Desktop browser bridge unavailable."})]}),a.jsx(D,{active:l.available&&l.state.tabs.length>0,onBounds:u})]})]})}export{L as BrowserSidebar};
@@ -0,0 +1 @@
1
+ .browser-sidebar-panel{grid-template-rows:41px 42px minmax(0,1fr)}.browser-tabs,.browser-toolbar,.browser-nav-actions,.browser-panel-actions{display:flex;align-items:center;min-width:0}.browser-tabs{gap:6px;border-bottom:1px solid var(--border);padding:0 10px 0 12px}.browser-tab{display:grid;grid-template-columns:16px minmax(0,1fr) 22px;gap:5px;align-items:center;min-width:96px;max-width:178px;height:29px;padding:0 4px 0 8px;border-radius:7px;color:#a5a5a5;font-size:11px}.browser-tab.active,.browser-tab:hover,.browser-tab-add:hover,.browser-toolbar button:hover:not(:disabled){color:#f1f1f1;background:#ffffff12}.browser-tab-main,.browser-tab-close,.browser-tab-add,.browser-toolbar button{border:0;background:transparent;color:inherit}.browser-tab-main{min-width:0;height:100%;overflow:hidden;padding:0;text-align:left;text-overflow:ellipsis;white-space:nowrap}.browser-tab-favicon{display:grid;place-items:center;width:16px;height:16px;color:#8e8e8e}.browser-tab-favicon img{width:14px;height:14px;border-radius:3px}.browser-tab-add,.browser-toolbar button{display:grid;place-items:center;width:27px;height:27px;border-radius:7px;padding:0}.browser-tab-close{display:grid;place-items:center;width:22px;height:22px;border-radius:6px;padding:0}.browser-tab-close:hover{background:#ffffff14}.browser-toolbar{gap:8px;border-bottom:1px solid var(--border);padding:0 10px 0 12px}.browser-nav-actions,.browser-panel-actions{gap:4px;color:#aaa}.browser-toolbar button:disabled{opacity:.38}.browser-address-form{flex:1;min-width:0}.browser-address-form input{width:100%;height:28px;border:1px solid rgba(255,255,255,.08);border-radius:7px;background:#ffffff0f;color:#f2f2f2;padding:0 10px;font:inherit;font-size:12px}.browser-content{position:relative;min-width:0;min-height:0;background:#0c0c0c}.browser-viewport{position:absolute;inset:0}.browser-empty-state{position:absolute;inset:0;z-index:1;display:grid;place-items:center;gap:8px;color:#8f8f8f;font-size:12px;text-align:center;padding:24px}.browser-menu-anchor{position:relative;display:grid}.browser-options-menu{position:absolute;bottom:32px;right:0;z-index:75;width:190px;border:1px solid rgba(255,255,255,.08);border-radius:8px;background:#2a2a2a;padding:7px;box-shadow:0 18px 44px #00000070}.browser-options-menu button{display:flex;align-items:center;justify-content:flex-start;width:100%;height:30px;padding:0 8px;font-size:12px}
@@ -0,0 +1 @@
1
+ .cloud-work-view{min-width:0;min-height:0;background:var(--bg);color:var(--text)}.cloud-work-view.home{display:grid;place-items:start center;overflow:auto;padding:72px 24px 48px}.cloud-home-shell{display:grid;width:min(692px,100%);gap:28px}.cloud-home-shell h1{margin:0;text-align:center;font-size:30px;font-weight:500}.cloud-home-composer,.cloud-thread-composer{position:relative;display:grid;border-radius:22px;background:#242424;box-shadow:0 0 0 1px #ffffff0a}.cloud-home-composer{min-height:90px;padding:16px 16px 12px}.cloud-home-composer textarea,.cloud-thread-composer textarea{min-width:0;resize:none;border:0;outline:0;background:transparent;color:var(--text);font:inherit}.cloud-home-composer textarea::placeholder,.cloud-thread-composer textarea::placeholder{color:#9b9b9b}.cloud-home-composer-actions{display:flex;align-items:center;gap:10px;min-width:0}.cloud-composer-selects{display:flex;align-items:center;flex:1 1 auto;min-width:0;gap:4px}.cloud-composer-selects .dropdown-select{justify-self:auto}.cloud-composer-selects .dropdown-trigger{max-width:174px}.cloud-composer-selects .cloud-project-select .dropdown-trigger{max-width:210px}.cloud-composer-plus,.cloud-composer-mic,.cloud-composer-submit{display:inline-grid;place-items:center;border:0;color:var(--muted)}.cloud-composer-plus,.cloud-composer-mic,.cloud-composer-submit{width:34px;height:34px;border-radius:17px;background:transparent}.cloud-composer-plus:hover,.cloud-composer-plus.active,.cloud-composer-mic:hover,.cloud-composer-submit:not(:disabled):hover{color:var(--text);background:#ffffff14}.cloud-composer-submit{margin-left:auto;background:#ffffff1f;color:var(--text)}.cloud-home-composer-actions .cloud-composer-submit{margin-left:0}.cloud-composer-submit:disabled{opacity:.45}.cloud-composer-options{position:absolute;z-index:20;left:16px;bottom:calc(100% + 10px);display:grid;min-width:min(360px,calc(100vw - 48px));gap:8px;border-radius:12px;background:#2e2e2e;box-shadow:0 18px 44px #00000075;padding:10px}.cloud-composer-options.thread-options{bottom:calc(100% + 8px)}.cloud-composer-options label,.cloud-composer-options button{display:grid;grid-template-columns:92px minmax(0,1fr);align-items:center;gap:10px;min-height:36px;border:0;border-radius:8px;background:transparent;color:var(--muted-strong);padding:0 8px;text-align:left}.cloud-composer-options button{grid-template-columns:18px minmax(0,1fr)}.cloud-composer-options button:hover:not(:disabled){background:#ffffff14;color:var(--text)}.cloud-composer-options select{min-width:0;height:30px;border:1px solid rgba(255,255,255,.12);border-radius:8px;background:#1f1f1f;color:var(--text);padding:0 8px}.cloud-task-list-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid rgba(255,255,255,.1)}.cloud-task-tabs{display:inline-flex;gap:18px}.cloud-task-tabs button{min-height:34px;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--muted);padding:0}.cloud-task-tabs button.active{border-bottom-color:var(--text);color:var(--text)}.cloud-task-search{display:inline-flex;align-items:center;gap:8px;color:var(--muted)}.cloud-task-search input{width:120px;border:0;outline:0;background:transparent;color:var(--text)}.cloud-task-list{display:grid}.cloud-task-row{display:grid;gap:4px;min-height:66px;border:0;border-bottom:1px solid rgba(255,255,255,.06);background:transparent;color:var(--text);padding:12px;text-align:left;content-visibility:auto;contain-intrinsic-size:66px}.cloud-task-row:hover{background:#ffffff0d}.cloud-task-row small,.cloud-empty,.cloud-muted{color:var(--muted)}.cloud-empty{padding:22px 12px}.cloud-work-view.thread{display:grid;grid-template-rows:minmax(0,1fr) auto;overflow:hidden}.cloud-thread-body{min-height:0;overflow:auto;padding:22px max(48px,calc((100% - 960px)/2)) 132px;scrollbar-color:rgba(255,255,255,.24) transparent;scrollbar-width:thin}.cloud-thread-body::-webkit-scrollbar{width:9px}.cloud-thread-body::-webkit-scrollbar-track{background:transparent}.cloud-thread-body::-webkit-scrollbar-thumb{border:2px solid transparent;border-radius:999px;background:#ffffff2e;background-clip:padding-box}.cloud-thread-body::-webkit-scrollbar-thumb:hover{background:#ffffff57;background-clip:padding-box}.cloud-thread-timeline{display:grid;width:100%;max-width:960px;margin:0 auto;gap:22px}.cloud-thread-inline-nav{display:inline-flex;align-items:center;flex-wrap:wrap;justify-self:start;gap:8px;color:var(--muted);font-size:12px}.cloud-thread-inline-nav button{display:inline-flex;align-items:center;gap:5px;height:28px;border:0;border-radius:14px;background:transparent;color:inherit;padding:0 8px 0 6px;font:inherit}.cloud-thread-inline-nav button:hover{background:#ffffff14;color:var(--text)}.cloud-thread-inline-nav>span{min-width:0;max-width:min(280px,100%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cloud-message{display:grid;gap:8px;justify-self:start;max-width:min(960px,100%);color:#f4f4f5;word-break:break-word;font-size:14px;line-height:1.65;content-visibility:auto;contain-intrinsic-size:120px}.cloud-message.user{justify-self:end;max-width:min(620px,72%);border-radius:20px;background:#242424;color:#fff;padding:10px 15px;line-height:1.55;contain-intrinsic-size:72px}.cloud-message.assistant,.cloud-message.system,.cloud-message.task,.cloud-message.runtime{border-radius:0;background:transparent;padding:0}.cloud-message p,.cloud-activity p{margin:0;white-space:pre-wrap}.cloud-worked-line{display:inline-flex;align-items:center;flex-wrap:wrap;justify-self:start;gap:8px;color:var(--muted-strong);font-size:13px}.cloud-worked-line button{display:inline-flex;align-items:center;gap:4px;height:24px;border:1px solid rgba(255,255,255,.12);border-radius:6px;background:#ffffff0a;color:var(--text);padding:0 8px;font:inherit}.cloud-worked-line button:hover:not(:disabled){background:#ffffff14}.cloud-worked-line button:disabled{cursor:default;opacity:.5}.cloud-work-boundary-strip{display:flex;flex-wrap:wrap;align-items:center;gap:12px;width:min(960px,100%);border:1px solid rgba(255,255,255,.1);border-radius:8px;background:#ffffff09;color:var(--text);padding:10px 12px}.cloud-work-boundary-strip>div:first-child{display:grid;flex:1 1 220px;min-width:0;gap:2px}.cloud-work-boundary-strip span{font-size:13px;font-weight:650}.cloud-work-boundary-strip small{min-width:0;color:var(--muted);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cloud-work-boundary-chips{display:flex;flex:1 1 260px;flex-wrap:wrap;justify-content:flex-end;gap:6px;min-width:0}.cloud-work-boundary-chips span{border-radius:999px;background:#ffffff14;color:var(--muted-strong);padding:3px 7px;font-size:11px;font-weight:600}.cloud-work-boundary-strip button{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;gap:5px;height:28px;border:1px solid rgba(255,255,255,.12);border-radius:6px;background:#ffffff0f;color:var(--text);padding:0 9px;font:inherit;font-size:12px}.cloud-work-boundary-strip button:hover{background:#ffffff1a}.cloud-work-boundary-strip button:disabled{cursor:default;opacity:.55}.cloud-work-boundary-strip button:disabled:hover{background:#ffffff0f}.cloud-activity{display:grid;gap:8px;justify-self:start;max-width:min(960px,100%);border-left:2px solid rgba(255,255,255,.12);color:#f4f4f5;padding-left:14px;font-size:14px;line-height:1.55;content-visibility:auto;contain-intrinsic-size:96px}.cloud-activity span{color:var(--muted);font-size:12px;text-transform:capitalize}.cloud-create-plan-review{display:grid;gap:14px;justify-self:stretch;max-width:min(960px,100%);border:1px solid rgba(255,255,255,.1);border-radius:8px;background:#202020;padding:14px;content-visibility:auto;contain-intrinsic-size:360px}.cloud-create-plan-heading{display:flex;align-items:center;gap:10px;min-width:0}.cloud-create-plan-heading>svg{flex:0 0 auto;color:#b8d7ff}.cloud-create-plan-heading div,.cloud-create-plan-copy section,.cloud-create-plan-grid section{display:grid;gap:4px;min-width:0}.cloud-create-plan-heading span,.cloud-create-plan-copy span,.cloud-create-plan-grid span{color:#f4f4f5;font-size:13px;font-weight:600}.cloud-create-plan-heading small,.cloud-create-plan-copy p,.cloud-create-plan-grid small{min-width:0;margin:0;color:#b6b6b6;font-size:12px;line-height:1.45}.cloud-create-plan-copy{display:grid;gap:10px}.cloud-create-plan-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px}.cloud-create-plan-grid ul{display:grid;gap:7px;margin:0;padding:0;list-style:none}.cloud-create-plan-grid li{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;min-width:0}.cloud-create-plan-grid code{overflow:hidden;border-radius:5px;background:#ffffff0f;color:#ececec;padding:3px 5px;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px}.cloud-create-plan-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.cloud-create-plan-actions button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:30px;border:1px solid rgba(255,255,255,.12);border-radius:7px;background:#ffffff0e;color:#ececec;padding:0 10px;font-size:12px}.cloud-create-plan-actions button:first-child{border-color:#fff3;background:#ffffff1f;color:#f4f4f5}.cloud-create-plan-actions button:first-child:hover:not(:disabled){border-color:#ffffff47;background:#ffffff2e}.cloud-create-plan-actions button:hover:not(:disabled){background:#ffffff1a}.cloud-create-plan-actions button:disabled{cursor:default;opacity:.52}.cloud-thread-composer{grid-template-columns:auto minmax(0,1fr) auto auto;grid-template-rows:auto auto;align-items:center;gap:0 7px;width:min(736px,calc(100% - 80px));min-height:111px;margin:0 auto 12px;border-radius:21px;background:#2b2b2b;padding:0 12px 10px}.cloud-thread-composer textarea{grid-column:1 / -1;width:calc(100% + 24px);height:66px;min-height:66px;max-height:253px;margin:0 -12px;overflow-y:hidden;border-radius:21px 21px 0 0;color:#f7f7f7;padding:15px 14px 6px;line-height:1.45;scrollbar-color:rgba(255,255,255,.24) transparent;scrollbar-width:thin}.cloud-thread-composer textarea::placeholder{color:#858585}.cloud-thread-composer textarea::-webkit-scrollbar{width:9px}.cloud-thread-composer textarea::-webkit-scrollbar-track,.cloud-thread-composer textarea::-webkit-scrollbar-corner{background:transparent}.cloud-thread-composer textarea::-webkit-scrollbar-thumb{border:2px solid transparent;border-radius:999px;background:#ffffff2e;background-clip:padding-box}.cloud-thread-composer textarea::-webkit-scrollbar-thumb:hover{background:#ffffff57;background-clip:padding-box}.cloud-thread-composer .cloud-composer-plus,.cloud-thread-composer .cloud-composer-mic{width:29px;height:29px;border-radius:15px}.cloud-thread-composer .cloud-composer-plus{grid-column:1;grid-row:2}.cloud-thread-composer .cloud-composer-mic{grid-column:3;grid-row:2}.cloud-thread-composer .cloud-composer-submit{grid-column:4;grid-row:2;width:30px;height:30px;margin-left:0;border-radius:15px;background:#a7a7a7;color:#202020}.cloud-thread-composer .cloud-composer-submit:not(:disabled):hover{background:#efefef}.cloud-error{width:min(692px,100%);margin:0 auto;border-radius:10px;background:#ff4b4b1a;color:#ff9b9b;padding:10px 12px}@media(max-width:720px){.cloud-work-view.home{padding:48px 16px 32px}.cloud-home-shell h1{font-size:24px}.cloud-task-list-toolbar{align-items:stretch;flex-direction:column;gap:8px}.cloud-task-tabs{justify-content:space-between}.cloud-home-composer-actions{flex-wrap:wrap}.cloud-composer-selects{order:3;flex-basis:100%}.cloud-composer-selects .dropdown-select{flex:1 1 0}.cloud-composer-selects .dropdown-trigger{max-width:none}.cloud-thread-body{padding:18px 20px}.cloud-thread-timeline{gap:18px}.cloud-work-boundary-strip{align-items:stretch}.cloud-work-boundary-chips{justify-content:flex-start}.cloud-work-boundary-strip button{justify-self:start}.cloud-create-plan-grid{grid-template-columns:minmax(0,1fr)}.cloud-create-plan-actions button{flex:1 1 132px}.cloud-thread-composer{width:calc(100% - 24px)}}
@@ -0,0 +1 @@
1
+ import{r as u,a8 as ye,j as e,U as Ne,b as I,ap as ee,h as H,b8 as ne,b9 as se,D as te,A as ke,ba as Pe,S as Se,K as le,aB as F,aC as Ae,X as we,bb as ae,bc as Re,bd as Te}from"./index-CU2qhUYV.js";import{P as _e}from"./play-CeRw21NV.js";function ze(n,t){return t==="archive"?!!n.archivedAt:t==="reviews"?n.status==="needs_review":!n.archivedAt}function $e(n){return n==="backlog"?"Task":n==="needs_review"?"Review":n.replace(/_/g," ")}function Me(n,t){const a=n.get(t);return a?.organizationName?`${a.organizationName} / ${a.name}`:a?.name??"Cloud Project"}function Oe(n){const t=n.filter(a=>!ie(a));return t.find(a=>a.role==="user")??t[0]??null}function ie(n){return n.metadata.source==="openpond_app_cloud_create_pipeline_link"||n.metadata.hidden===!0}function Ee(n){return n.adapter.kind==="local"?"Local profile":n.adapter.kind==="promote_local_to_hosted"?"Local to hosted":"Hosted profile"}function Le(n){return n?.plan?.checks?.length?n.plan.checks.map(t=>({name:t.name,command:t.command})):[{name:"inspect",command:"pnpm agent:inspect"},{name:"build",command:"pnpm build"},{name:"validate",command:"pnpm agent:validate"},{name:"eval",command:"pnpm agent:eval"}]}function De(n){return n?.plan?.requirements?.map(t=>({name:t.name,detail:[t.kind.replace(/_/g," "),t.status,t.detail].filter(Boolean).join(" / ")}))??[]}function He(n){const t=n?.workflowCapture;return t?[{name:"Actions",values:t.profileActions},{name:"Providers",values:t.externalProviders},{name:"Side effects",values:t.sideEffects},{name:"Files",values:t.files},{name:"Artifacts",values:t.outputArtifacts},{name:"Traces",values:t.traceRefs},{name:"Channels",values:t.channelTargets}].flatMap(({name:a,values:d})=>d.length?[{name:a,detail:d.join(", ")}]:[]):[]}function Fe(n,t){if(t?.plan?.sourcePlan?.length)return t.plan.sourcePlan;const a=n.operation==="edit"?"update":"create",d=n.targetAgent.agentId??Re(n.objective);return[{path:Te(d),operation:a,reason:n.objective},{path:"settings/profile.yaml",operation:"update",reason:"Expose the default chat action through the hosted profile catalog."}]}function Ke({workItem:n,detail:t,actionBusy:a,localProjectName:d,onApplyLocalPatch:x,onShowFiles:c}){const j=Xe(n,t),o=n.status==="needs_review"&&!!(d&&x);return e.jsxs("article",{className:"cloud-work-boundary-strip",children:[e.jsxs("div",{children:[e.jsx("span",{children:Ve(n)}),e.jsx("small",{children:Ue(n)})]}),e.jsx("div",{className:"cloud-work-boundary-chips",children:j.map(m=>e.jsx("span",{children:m},m))}),n.status==="needs_review"?e.jsxs("button",{type:"button",onClick:()=>{x&&x()},disabled:a||!o,title:o?`Apply to ${d}`:"Link this Cloud Project to a local checkout before applying locally.",children:[e.jsx(le,{size:13}),e.jsx("span",{children:o?"Apply locally":"No local checkout"})]}):null,c?e.jsxs("button",{type:"button",onClick:c,children:[e.jsx(F,{size:13}),e.jsx("span",{children:"Files"})]}):null]})}function Ve(n){return n.status==="needs_review"?"Cloud patch ready":n.status==="queued"||n.status==="running"?"Running in Cloud":n.status==="failed"?"Cloud task failed":"Cloud task"}function Ue(n){return n.status==="needs_review"?"Review files and apply locally only when ready.":n.status==="queued"||n.status==="running"?"The local checkout is unchanged while the sandbox works.":n.status==="failed"?"Open files/logs to inspect the remote run before retrying.":"Cloud changes stay remote until an explicit apply or pull action."}function Xe(n,t){const a=[n.status.replace(/_/g," ")];return n.sourceRef&&a.push(n.sourceRef),n.latestSandboxId&&a.push("sandbox"),n.latestTaskRunId&&a.push("task run"),t?.activity.length&&a.push(`${t.activity.length} log${t.activity.length===1?"":"s"}`),n.status==="needs_review"&&a.push("patch only"),a.push("local unchanged"),a}function Ge({request:n,snapshot:t,actionBusy:a,onApprove:d,onEdit:x,onCancel:c}){const j=t?.state??"awaiting_plan_approval",o=t?.plan??null,m=Le(t),v=De(t),y=He(t),k=Fe(n,t),h=Ae(o?.metadata),P=n.scope.targetProject?.name??n.scope.targetProject?.id??"Profile source",S=!!o&&j==="awaiting_plan_approval"&&(o?.status==="draft"||o?.status==="pending_approval"),A=(j==="planning"||j==="awaiting_plan_approval")&&(o?.status==="draft"||o?.status==="pending_approval");return e.jsxs("article",{className:"cloud-create-plan-review",children:[e.jsxs("div",{className:"cloud-create-plan-heading",children:[e.jsx(F,{size:16}),e.jsxs("div",{children:[e.jsx("span",{children:"Agent plan review"}),e.jsxs("small",{children:[n.operation," / ",Ee(n)," / ",j.replace(/_/g," ")]})]})]}),e.jsxs("div",{className:"cloud-create-plan-copy",children:[e.jsxs("section",{children:[e.jsx("span",{children:"Objective"}),e.jsx("p",{children:n.objective})]}),e.jsxs("section",{children:[e.jsx("span",{children:"Target"}),e.jsx("p",{children:P})]}),o?.capturedContextSummary?e.jsxs("section",{children:[e.jsx("span",{children:"Captured context"}),e.jsx("p",{children:o.capturedContextSummary})]}):n.context.targetRepoAssumptions.length?e.jsxs("section",{children:[e.jsx("span",{children:"Captured context"}),e.jsx("p",{children:n.context.targetRepoAssumptions.join("; ")})]}):null,n.context.attachments.length?e.jsxs("section",{children:[e.jsx("span",{children:"Inputs"}),e.jsx("p",{children:n.context.attachments.map(l=>l.name).join(", ")})]}):null,n.context.apps.length?e.jsxs("section",{children:[e.jsx("span",{children:"Apps"}),e.jsx("p",{children:n.context.apps.map(l=>l.name).join(", ")})]}):null,n.context.tools.length?e.jsxs("section",{children:[e.jsx("span",{children:"Tools"}),e.jsx("p",{children:n.context.tools.map(l=>l.name).join(", ")})]}):null,h?e.jsxs("section",{children:[e.jsx("span",{children:"Action shape"}),e.jsxs("p",{children:[h.label,": ",h.detail]})]}):null]}),e.jsxs("div",{className:"cloud-create-plan-grid",children:[h?e.jsxs("section",{children:[e.jsx("span",{children:"Actions"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("code",{children:h.defaultActionKey??"chat"}),e.jsx("small",{children:h.label})]}),h.directActionHint?e.jsxs("li",{children:[e.jsx("code",{children:"direct action"}),e.jsx("small",{children:h.directActionHint})]}):null]})]}):null,e.jsxs("section",{children:[e.jsx("span",{children:"Source plan"}),e.jsx("ul",{children:k.map(l=>e.jsxs("li",{children:[e.jsx("code",{children:l.path}),e.jsx("small",{children:l.operation})]},`${l.operation}:${l.path}`))})]}),e.jsxs("section",{children:[e.jsx("span",{children:"Checks"}),e.jsx("ul",{children:m.map(l=>e.jsxs("li",{children:[e.jsx("code",{children:l.name}),e.jsx("small",{children:l.command})]},`${l.name}:${l.command}`))})]}),v.length?e.jsxs("section",{children:[e.jsx("span",{children:"Requirements"}),e.jsx("ul",{children:v.map(l=>e.jsxs("li",{children:[e.jsx("code",{children:l.name}),e.jsx("small",{children:l.detail})]},`${l.name}:${l.detail}`))})]}):null,y.length?e.jsxs("section",{children:[e.jsx("span",{children:"Workflow evidence"}),e.jsx("ul",{children:y.map(l=>e.jsxs("li",{children:[e.jsx("code",{children:l.name}),e.jsx("small",{children:l.detail})]},`${l.name}:${l.detail}`))})]}):null]}),e.jsxs("div",{className:"cloud-create-plan-actions",children:[e.jsxs("button",{type:"button",onClick:d,disabled:a||!S,children:[e.jsx(le,{size:14}),e.jsx("span",{children:"Confirm plan"})]}),e.jsxs("button",{type:"button",onClick:x,disabled:a||!A,children:[e.jsx(F,{size:14}),e.jsx("span",{children:"Edit plan"})]}),e.jsxs("button",{type:"button",onClick:c,disabled:a,children:[e.jsx(we,{size:14}),e.jsx("span",{children:"Cancel"})]})]})]})}function Ye({projects:n,workItems:t,selectedWorkItem:a,detail:d,loading:x,actionBusy:c,connection:j,error:o,model:m,showToast:v,onBack:y,onModelChange:k,onSetupCloudProject:h,onCreateWork:P,onSelectWorkItem:S,onSendMessage:A,onHandleBackground:l,onCancelCreatePlan:ce,onCancelTask:K,localProjectName:oe,onApplyLocalPatch:re,onShowFiles:w}){const[N,R]=u.useState(""),[b,g]=u.useState(""),V=u.useRef(null),T=u.useRef(null),[de,U]=u.useState(0),[ue,_]=u.useState(0),[X,z]=u.useState(!1),[G,J]=u.useState(!1),[C,$]=u.useState("tasks"),[M,pe]=u.useState(""),[Q,he]=u.useState(()=>n[0]?.id??""),O=u.useMemo(()=>new Map(n.map(s=>[s.id,s])),[n]),f=O.has(Q)?Q:n[0]?.id??"",xe=ye("openpond",m),je=u.useMemo(()=>n.length?n.map(s=>({value:s.id,label:s.organizationName?`${s.organizationName} / ${s.name}`:s.name,shortLabel:s.name,description:s.sourceLabel??s.defaultBranch??void 0})):[{value:"",label:"No Cloud Project"}],[n]),Y=u.useMemo(()=>{const s=M.trim().toLowerCase();return t.filter(r=>ze(r,C)?s?r.title.toLowerCase().includes(s):!0:!1)},[M,C,t]);async function Z(){const s=N.trim();!s||!f||c||(await P({projectId:f,prompt:s}),R(""),z(!1))}async function B(){const s=b.trim();!s||c||(await A(s),g(""))}async function me(){const s=b.trim();await l(s||null),g(""),J(!1)}function E(s){U(s.selectionStart??s.value.length)}function L(s){_(s.selectionStart??s.value.length)}function fe(s){const r=V.current,p=ae(N,s,r?.selectionStart??de);R(p.value),U(p.cursorIndex),window.requestAnimationFrame(()=>{r?.focus(),r?.setSelectionRange(p.cursorIndex,p.cursorIndex)})}function ve(s){const r=T.current,p=ae(b,s,r?.selectionStart??ue);g(p.value),_(p.cursorIndex),window.requestAnimationFrame(()=>{r?.focus(),r?.setSelectionRange(p.cursorIndex,p.cursorIndex)})}function be(){g(s=>s||"Revise plan: "),window.requestAnimationFrame(()=>{const s=T.current,r=s?.value.length??0;s?.focus(),s?.setSelectionRange(r,r),_(r)})}if(a){const s=d?.messages??[],r=d?.activity??[],p=d?.createPipelineRequest??a.createPipelineRequest??null,ge=d?.createPipeline??a.createPipeline??null,W=Oe(s),D=W?.body??a.title,Ce=O.get(a.projectId)??null,q=a.status==="queued"||a.status==="running";return e.jsxs("section",{className:"cloud-work-view thread",children:[e.jsx("div",{className:"cloud-thread-body",children:e.jsxs("div",{className:"cloud-thread-timeline",children:[e.jsxs("div",{className:"cloud-thread-inline-nav",children:[e.jsxs("button",{type:"button",onClick:y,children:[e.jsx(Ne,{size:15}),e.jsx("span",{children:"All tasks"})]}),e.jsx("span",{children:Ce?.name??"Cloud Project"}),a.sourceRef?e.jsx("span",{children:a.sourceRef}):null,w?e.jsx("button",{type:"button",onClick:w,children:e.jsx("span",{children:"Files"})}):null]}),D&&e.jsx("article",{className:"cloud-message user",children:e.jsx("p",{children:D})}),e.jsxs("div",{className:"cloud-worked-line",children:[e.jsx("span",{children:$e(a.status)}),e.jsx("span",{children:I(a.updatedAt)}),q&&e.jsxs("button",{type:"button",onClick:()=>{K()},disabled:c,children:[e.jsx(ee,{size:12}),e.jsx("span",{children:"Stop task"})]})]}),e.jsx(Ke,{workItem:a,detail:d,actionBusy:c,localProjectName:oe,onApplyLocalPatch:re,onShowFiles:w}),p?e.jsx(Ge,{request:p,snapshot:ge,actionBusy:c,onApprove:()=>{l(null)},onEdit:be,onCancel:()=>{ce()}}):null,s.filter(i=>i.id!==W?.id).filter(i=>!ie(i)).map(i=>e.jsx("article",{className:`cloud-message ${i.role}`,children:e.jsx("p",{children:i.body})},i.id)),r.map(i=>e.jsxs("article",{className:"cloud-activity",children:[e.jsx("span",{children:i.kind.replace(/_/g," ")}),e.jsx("p",{children:i.summary})]},i.id)),!x&&s.length===0&&r.length===0&&!D&&e.jsx("p",{className:"cloud-muted",children:"No messages yet."})]})}),e.jsxs("div",{className:"cloud-thread-composer",children:[e.jsx("button",{type:"button",className:`cloud-composer-plus ${G?"active":""}`,onClick:()=>J(i=>!i),title:"Cloud task options",children:e.jsx(H,{size:18})}),G&&e.jsxs("div",{className:"cloud-composer-options thread-options",children:[e.jsxs("button",{type:"button",onClick:()=>{me()},disabled:c,children:[e.jsx(_e,{size:14}),e.jsx("span",{children:"Handle in background"})]}),q&&e.jsxs("button",{type:"button",onClick:()=>{K()},disabled:c,children:[e.jsx(ee,{size:14}),e.jsx("span",{children:"Stop task"})]})]}),e.jsx("textarea",{ref:T,value:b,rows:1,placeholder:"Request changes or ask a question",onChange:i=>{g(i.target.value),L(i.currentTarget)},onClick:i=>L(i.currentTarget),onSelect:i=>L(i.currentTarget),onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),B())}}),e.jsx(ne,{buttonClassName:"cloud-composer-mic-button",connection:j,disabled:c,iconSize:17,wrapperClassName:"cloud-composer-mic",showToast:v,onTranscript:ve}),e.jsx("button",{type:"button",className:"cloud-composer-submit",disabled:!b.trim()||c,onClick:()=>{B()},title:"Send",children:e.jsx(se,{size:17})})]}),o&&e.jsx("div",{className:"cloud-error",children:o})]})}return e.jsx("section",{className:"cloud-work-view home",children:e.jsxs("div",{className:"cloud-home-shell",children:[e.jsx("h1",{children:"What should we change next?"}),e.jsxs("div",{className:"cloud-home-composer",children:[e.jsx("textarea",{ref:V,value:N,rows:2,placeholder:"Describe a task",onChange:s=>{R(s.target.value),E(s.currentTarget)},onClick:s=>E(s.currentTarget),onSelect:s=>E(s.currentTarget),onKeyDown:s=>{s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),Z())}}),e.jsxs("div",{className:"cloud-home-composer-actions",children:[e.jsx("button",{type:"button",className:`cloud-composer-plus ${X?"active":""}`,onClick:()=>z(s=>!s),title:"Cloud task options",children:e.jsx(H,{size:18})}),e.jsxs("div",{className:"cloud-composer-selects",children:[e.jsx(te,{compact:!0,className:"cloud-project-select",disabled:c||n.length===0,label:"Cloud Project",options:je,placement:"top",value:f,onChange:he}),e.jsx(te,{compact:!0,className:"cloud-model-select",disabled:c,label:"Model",options:ke("openpond"),placement:"top",value:xe,onChange:k})]}),e.jsx(ne,{buttonClassName:"cloud-composer-mic-button",connection:j,disabled:c,iconSize:17,wrapperClassName:"cloud-composer-mic",showToast:v,onTranscript:fe}),e.jsx("button",{type:"button",className:"cloud-composer-submit",disabled:!N.trim()||!f||c,onClick:()=>{Z()},title:"Handle in background",children:e.jsx(se,{size:17})})]}),X&&e.jsxs("div",{className:"cloud-composer-options",children:[e.jsxs("button",{type:"button",onClick:()=>z(!1),disabled:c,children:[e.jsx(H,{size:14}),e.jsx("span",{children:"New task"})]}),e.jsxs("button",{type:"button",onClick:()=>h(f),disabled:!f||c,children:[e.jsx(Pe,{size:14}),e.jsx("span",{children:"Create environment"})]})]})]}),e.jsxs("div",{className:"cloud-task-list-toolbar",children:[e.jsxs("div",{className:"cloud-task-tabs",role:"tablist","aria-label":"Cloud tasks",children:[e.jsx("button",{type:"button",className:C==="tasks"?"active":"",onClick:()=>$("tasks"),children:"Tasks"}),e.jsx("button",{type:"button",className:C==="reviews"?"active":"",onClick:()=>$("reviews"),children:"Code reviews"}),e.jsx("button",{type:"button",className:C==="archive"?"active":"",onClick:()=>$("archive"),children:"Archive"})]}),e.jsxs("label",{className:"cloud-task-search",children:[e.jsx(Se,{size:17}),e.jsx("input",{value:M,placeholder:"Search",onChange:s=>pe(s.target.value)})]})]}),e.jsxs("div",{className:"cloud-task-list",children:[Y.map(s=>e.jsxs("button",{type:"button",className:"cloud-task-row",onClick:()=>S(s),children:[e.jsx("span",{children:s.title}),e.jsxs("small",{children:[I(s.updatedAt)," · ",Me(O,s.projectId)]})]},s.id)),!x&&Y.length===0&&e.jsx("p",{className:"cloud-empty",children:n.length?"No tasks yet":"Create or link a Cloud Project before starting a task"}),x&&e.jsx("p",{className:"cloud-empty",children:"Loading tasks..."})]}),o&&e.jsx("div",{className:"cloud-error",children:o})]})})}export{Ye as CloudWorkView};
@@ -0,0 +1 @@
1
+ import{r as j,j as e,S as g,a as b,i as f,C,F as P,P as k,M,b as v,c as S}from"./index-CU2qhUYV.js";function E({open:a,query:r,projects:c,sessions:o,onQueryChange:n,onClose:d,onNewChat:x,onOpenProject:u,onOpenSession:p}){const t=r.trim().toLowerCase(),l=j.useMemo(()=>w(o,t,10),[t,o]),i=j.useMemo(()=>L(c,t,8),[t,c]);if(!a)return null;const N=()=>{const s=i[0];if(s){u(s);return}const m=l[0];m&&p(m)};return e.jsx("div",{className:"command-overlay",role:"presentation",onMouseDown:d,children:e.jsxs("section",{className:"command-menu",role:"dialog","aria-modal":"true","aria-label":"Search chats and projects",onMouseDown:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"command-input-row",children:[e.jsx(g,{size:17}),e.jsx("input",{autoFocus:!0,value:r,onChange:s=>n(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),N()),s.key==="Escape"&&(s.preventDefault(),d())},placeholder:"Search chats and projects"}),e.jsx("kbd",{children:"Esc"})]}),e.jsxs("div",{className:"command-results",children:[e.jsxs("button",{className:"command-result command-create",onClick:x,children:[e.jsx(b,{size:15}),e.jsx("span",{children:"New local task"}),e.jsx("small",{children:"General"})]}),e.jsxs(h,{label:"Projects",children:[i.map(s=>e.jsxs("button",{className:"command-result",onClick:()=>u(s),children:[f(s)?e.jsx(C,{size:15}):e.jsx(P,{size:15}),e.jsx("span",{children:s.project.name}),e.jsx("small",{children:z(s)})]},s.project.id)),i.length===0&&e.jsx("div",{className:"command-empty",children:"No projects found"})]}),e.jsxs(h,{label:"Chats",children:[l.map(s=>e.jsxs("button",{className:"command-result",onClick:()=>p(s),children:[s.pinned?e.jsx(k,{size:15}):e.jsx(M,{size:15}),e.jsx("span",{children:s.title}),e.jsx("small",{children:s.appName??v(s.updatedAt)})]},s.id)),l.length===0&&e.jsx("div",{className:"command-empty",children:"No chats found"})]})]})]})})}function w(a,r,c){const o=[];for(const n of a)if((!r||`${n.title} ${n.appName??""}`.toLowerCase().includes(r))&&(o.push(n),o.length>=c))break;return o}function L(a,r,c){const o=[];for(const n of a)if((!r||$(n).toLowerCase().includes(r))&&(o.push(n),o.length>=c))break;return o}function $(a){return S(a)?`${a.project.name} ${a.project.path} ${a.project.workspacePath}`:`${a.project.name} ${a.project.sourceLabel??""} ${a.project.organizationName??""}`}function z(a){return f(a)?a.project.organizationName??"Cloud Project":a.project.linkedOpenPondApp?"OpenPond project":a.project.source==="git"?"Local Git":"Local folder"}function h({label:a,children:r}){return e.jsxs("div",{className:"command-group",children:[e.jsx("div",{className:"command-group-label",children:a}),r]})}export{E as CommandMenu};
@@ -0,0 +1 @@
1
+ .command-overlay{position:fixed;z-index:40;inset:0;display:grid;place-items:start center;padding:16vh 18px 18px;background:#00000057;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.command-menu{display:grid;width:min(620px,calc(100vw - 36px));max-height:min(620px,calc(100vh - 80px));overflow:hidden;border:1px solid rgba(255,255,255,.1);border-radius:18px;background:#202020;box-shadow:0 24px 70px #0000007a}
@@ -0,0 +1 @@
1
+ import{r as l,j as e,X as Y,bl as Q,bm as Z,bn as ee,b9 as se,bo as ne,bp as te,a as ie,T as ae,aP as H,bq as q,J as le}from"./index-CU2qhUYV.js";import{S as re,W as oe,B as ce}from"./wifi-off-Dt52ofzh.js";import{R as O}from"./refresh-cw-N5b_6AP5.js";import{R as de}from"./reply-BSKjZrJg.js";const me=2e4,E=10,ue=12*1024*1024,he=new Set(["image/png","image/jpeg","image/webp","image/gif"]);function ye(s){const[n,m]=l.useState(""),[a,y]=l.useState(0),[c,u]=l.useState([]),[b,i]=l.useState(null),[f,h]=l.useState(!1),[p,C]=l.useState([]),[N,v]=l.useState(0),[M,r]=l.useState(null),k=l.useRef(null),R=l.useRef(null),I=l.useRef(c);I.current=c;const g=l.useMemo(()=>ge(n,a),[n,a]),S=g?`${g.start}:${g.end}:${g.query}`:null,L=g?.query??null,w=l.useMemo(()=>{if(!g)return[];const t=new Map;for(const d of[...s.members,...p])t.set(d.userId,d);const o=g.query.toLowerCase();return[...t.values()].filter(d=>`${d.handle??""} ${d.name??""}`.toLowerCase().includes(o)).slice(0,8)},[g,s.members,p]),D=!!(g&&S!==M&&w.length>0),T=!!(s.disabled||s.busy||f),B=!T&&(!!n.trim()||c.length>0);l.useEffect(()=>{if(L==null){C([]);return}let t=!0;const o=window.setTimeout(()=>{s.onSearchMembers(L).then(d=>{t&&C(d)},()=>{t&&C([])})},150);return()=>{t=!1,window.clearTimeout(o)}},[L,s.onSearchMembers]),l.useEffect(()=>{v(0)},[S]),l.useEffect(()=>()=>F(I.current),[]);async function U(t){if(t?.preventDefault(),!!B){i(null),h(!0);try{const o=await Promise.all(c.map(ne));if(!await s.onSend({body:n,mentionUserIds:xe(n,s.members),attachments:o,replyToMessageId:s.replyTo?.id??null}))return;F(c),m(""),y(0),u([]),s.onCancelReply()}catch(o){i(o instanceof Error?o.message:String(o))}finally{h(!1)}}}function X(t){if(D){if(t.key==="ArrowDown"){t.preventDefault(),v(o=>(o+1)%w.length);return}if(t.key==="ArrowUp"){t.preventDefault(),v(o=>(o-1+w.length)%w.length);return}if(t.key==="Enter"||t.key==="Tab"){t.preventDefault(),$(w[N]??w[0]);return}if(t.key==="Escape"){t.preventDefault(),r(S);return}}t.key!=="Enter"||t.shiftKey||t.nativeEvent.isComposing||(t.preventDefault(),U())}function V(t){if(!t)return;i(null);const o=Math.max(0,E-c.length);if(o===0){i(`You can attach up to ${E} images.`),A();return}const d=[...t],j=d.slice(0,o),z=j.find(x=>!he.has(x.type)),P=j.find(x=>x.size<=0||x.size>ue);if(z){i(`${z.name} is not a supported image type.`),A();return}if(P){i(`${P.name} must be smaller than 12 MB.`),A();return}const W=j.map(x=>({id:te(),file:x,name:x.name,mediaType:x.type,sizeBytes:x.size,kind:"image",previewUrl:URL.createObjectURL(x)}));u(x=>[...x,...W]),d.length>o&&i(`Only ${E} images can be attached to one message.`),A()}function G(t){u(o=>{const d=o.find(j=>j.id===t);return d?.previewUrl&&URL.revokeObjectURL(d.previewUrl),o.filter(j=>j.id!==t)})}function A(){k.current&&(k.current.value="")}function $(t){if(!g)return;const o=`@${J(t)} `,d=`${n.slice(0,g.start)}${o}${n.slice(g.end)}`,j=g.start+o.length;m(d),y(j),r(null),window.requestAnimationFrame(()=>R.current?.focusAtPromptIndex(j))}return e.jsxs("form",{className:`composer dock community-composer${c.length>0?" has-attachments":""}${b?" has-attachment-error":""}`,onSubmit:U,children:[s.replyTo?e.jsxs("div",{className:"community-composer-reply",children:[e.jsxs("span",{children:[e.jsx("strong",{children:"Replying to"}),s.replyTo.body.slice(0,100)||"message"]}),e.jsx("button",{type:"button","aria-label":"Cancel reply",onClick:s.onCancelReply,children:e.jsx(Y,{size:13})})]}):null,D?e.jsx("div",{className:"community-mention-menu",role:"listbox","aria-label":"Community members",children:w.map((t,o)=>e.jsxs("button",{type:"button",role:"option","aria-selected":o===N,onMouseDown:d=>d.preventDefault(),onClick:()=>$(t),children:[e.jsx("strong",{children:t.name??t.handle??"Community member"}),t.handle?e.jsxs("small",{children:["@",t.handle]}):null]},t.userId))}):null,e.jsxs("div",{className:"composer-input-shell",children:[c.length>0?e.jsx("div",{className:"composer-attachments","aria-label":"Selected attachments",children:c.map(t=>e.jsx(Q,{attachment:t,onRemove:()=>G(t.id)},t.id))}):null,b?e.jsx("div",{className:"composer-attachment-error",role:"status",children:b}):null,e.jsx("div",{className:"composer-textarea-frame",onClick:t=>{t.target===t.currentTarget&&R.current?.focusAtPromptIndex(a)},children:e.jsx(Z,{ref:R,disabled:T,onCursorChange:y,onKeyDown:X,onPromptChange:(t,o)=>{const d=t.slice(0,me);m(d),y(Math.min(o,d.length))},onTokenPositionChange:()=>{},placeholder:s.disabled?"Accept the community rules to post":"Message community",prompt:n,token:null})}),e.jsxs("div",{className:"composer-primary-controls team-chat-composer-controls",children:[e.jsx("input",{ref:k,className:"composer-file-input",hidden:!0,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",multiple:!0,onChange:t=>V(t.currentTarget.files)}),e.jsx("button",{type:"button",className:"composer-icon","aria-label":"Attach images",disabled:T||c.length>=E,onClick:()=>k.current?.click(),children:e.jsx(ee,{size:17})}),e.jsx("div",{className:"composer-spacer"}),e.jsx("button",{type:"submit",className:"send-button","aria-label":"Send message",disabled:!B,children:e.jsx(se,{size:17})})]})]})]})}function ge(s,n=s.length){const m=Math.max(0,Math.min(n,s.length)),a=/(?:^|\s)@([\w-]*)$/.exec(s.slice(0,m));return!a||a.index==null?null:{start:a.index+a[0].indexOf("@"),end:m,query:a[1]??""}}function xe(s,n){const m=new Set([...s.matchAll(/(?:^|\s)@([\w-]+)/g)].map(a=>a[1]?.toLowerCase()));return n.filter(a=>m.has(J(a).toLowerCase())).map(a=>a.userId)}function J(s){return s.handle??s.name?.replace(/[^\w-]/g,"")??s.userId}function F(s){for(const n of s)n.previewUrl&&URL.revokeObjectURL(n.previewUrl)}function be(s){const[n,m]=l.useState(!1),[a,y]=l.useState(s.message.body),c=s.message.refs.find(i=>i.refType==="message_reply"),u=c?s.messagesById.get(c.refId)??null:null,b=u?.authorUserId?s.membersById.get(u.authorUserId)??null:null;return e.jsxs("article",{className:`community-message${s.own?" own":""}`,id:`community-message-${s.message.id}`,children:[e.jsx("div",{className:"community-avatar",children:fe(s.author?.name??s.author?.handle??"?")}),e.jsxs("div",{className:"community-message-content",children:[e.jsxs("header",{children:[e.jsx("strong",{children:s.author?.name??s.author?.handle??"Community member"}),e.jsx("time",{dateTime:s.message.createdAt,children:je(s.message.createdAt)}),s.message.editedAt?e.jsx("span",{children:"edited"}):null,s.message.deletedAt?null:e.jsxs("div",{className:"community-message-actions",children:[e.jsx("button",{type:"button","aria-label":"Reply",onClick:()=>s.onReply(s.message),children:e.jsx(de,{size:13})}),s.own?e.jsx("button",{type:"button","aria-label":"Edit",onClick:()=>m(!0),children:e.jsx(ie,{size:13})}):null,s.own?e.jsx("button",{type:"button","aria-label":"Delete",onClick:()=>{s.onDelete(s.message.id)},children:e.jsx(ae,{size:13})}):null]})]}),c?e.jsxs("button",{type:"button",className:"community-reply-quote",onClick:()=>document.getElementById(`community-message-${c.refId}`)?.scrollIntoView({behavior:"smooth",block:"center"}),children:[e.jsx("strong",{children:b?.name??"Community member"}),e.jsx("span",{children:u?.deletedAt?"Message deleted":u?.body??String(c.preview.body??"Earlier message")})]}):null,n?e.jsxs("form",{className:"community-message-edit",onSubmit:i=>{i.preventDefault(),s.onEdit(s.message.id,a).then(f=>{f&&m(!1)})},children:[e.jsx("textarea",{autoFocus:!0,value:a,onChange:i=>y(i.currentTarget.value)}),e.jsxs("div",{children:[e.jsx("button",{type:"button",onClick:()=>m(!1),children:"Cancel"}),e.jsx("button",{type:"submit",disabled:!a.trim(),children:"Save"})]})]}):s.message.deletedAt?e.jsx("div",{className:"community-message-deleted",children:"Message deleted"}):e.jsx(H,{content:s.message.body}),!s.message.deletedAt&&s.message.attachments.length>0?e.jsx("div",{className:"community-message-attachments",children:s.message.attachments.map(i=>s.attachmentsAccessible?e.jsxs("button",{type:"button",onClick:()=>{s.onDownloadAttachment(i.id)},children:[e.jsx("span",{children:i.name}),e.jsx("small",{children:K(i.sizeBytes)})]},i.id):e.jsxs("div",{className:"community-attachment-placeholder",children:[e.jsx("span",{children:i.name}),e.jsxs("small",{children:["Join to view · ",K(i.sizeBytes)]})]},i.id))}):null]})]})}function fe(s){return s.split(/\s+/).slice(0,2).map(n=>n[0]?.toUpperCase()??"").join("")||"?"}function je(s){const n=new Date(s);return Number.isNaN(n.getTime())?"":n.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}function K(s){return s<1024?`${s} B`:s<1024*1024?`${Math.round(s/1024)} KB`:`${(s/1024/1024).toFixed(1)} MB`}function pe(s){const[n,m]=l.useState(!1),a=l.useRef(null),y=l.useRef(s.onClose);l.useEffect(()=>m(!1),[s.rules.id]),l.useEffect(()=>{y.current=s.onClose},[s.onClose]),l.useEffect(()=>{const u=document.activeElement instanceof HTMLElement?document.activeElement:null,b=a.current,i=()=>[...b?.querySelectorAll('button:not([disabled]), input:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')??[]];i()[0]?.focus();const f=h=>{if(h.key==="Escape"){h.preventDefault(),y.current();return}if(h.key!=="Tab")return;const p=i();if(p.length===0){h.preventDefault(),b?.focus();return}const C=p[0],N=p.at(-1);h.shiftKey&&document.activeElement===C?(h.preventDefault(),N.focus()):!h.shiftKey&&document.activeElement===N&&(h.preventDefault(),C.focus())};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f),u?.focus()}},[]);const c=s.mode!=="review";return e.jsx("div",{className:"community-dialog-backdrop",role:"presentation",onMouseDown:s.onClose,children:e.jsxs("section",{ref:a,className:"community-rules-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"community-rules-title",tabIndex:-1,onMouseDown:u=>u.stopPropagation(),children:[e.jsxs("header",{children:[e.jsxs("div",{children:[e.jsxs("small",{children:["Community rules · version ",s.rules.version]}),e.jsx("h2",{id:"community-rules-title",children:s.rules.title})]}),e.jsx("button",{type:"button","aria-label":"Close rules",onClick:s.onClose,children:e.jsx(Y,{size:16})})]}),e.jsx("div",{className:"community-rules-body",children:e.jsx(H,{content:s.rules.bodyMarkdown})}),s.error?e.jsx("div",{className:"community-state error",role:"alert",children:s.error}):null,e.jsxs("footer",{children:[c?e.jsxs("label",{className:"community-rules-acceptance",children:[e.jsx("input",{type:"checkbox",checked:n,onChange:u=>m(u.currentTarget.checked)}),e.jsx("span",{children:"I have read and agree to follow these rules."})]}):e.jsx("span",{}),e.jsxs("div",{children:[e.jsx("button",{type:"button",className:"secondary",onClick:s.onClose,children:"Cancel"}),c?e.jsx("button",{type:"button",disabled:!n||s.busy,onClick:()=>{s.onAccept().then(u=>{u&&s.onClose()})},children:s.busy?"Saving…":s.mode==="join"?"Agree and join":"Accept updated rules"}):null]})]})]})})}function ke({communities:s,chat:n,currentUserId:m}){const[a,y]=l.useState(null),[c,u]=l.useState(null),b=l.useRef(null),i=s.preview,f=i?.membership?.status==="active",h=!!i?.capabilities.requiresRulesAcceptance,p=l.useMemo(()=>new Map(n.members.map(r=>[r.userId,r])),[n.members]),C=l.useMemo(()=>new Map(n.messages.map(r=>[r.id,r])),[n.messages]),N=n.messages.at(-1)?.sequence??0;if(l.useEffect(()=>{const r=b.current;r&&(r.scrollTop=r.scrollHeight)},[n.selectedChannelId,N]),l.useEffect(()=>{u(null),h&&i?.currentRules&&y("reaccept")},[i?.currentRules,h]),!s.selectedSummary)return e.jsx("section",{className:"community-empty-page",children:e.jsxs("div",{className:"community-discovery-card",children:[e.jsx(q,{size:30}),e.jsx("h1",{children:"Discover communities"}),e.jsx("p",{children:s.discoveryLoading&&s.items.length===0?"Finding communities…":"Preview public conversations and join after accepting each community's rules."}),s.discoveryError?e.jsx("div",{className:"community-state error",children:s.discoveryError}):null,s.items.length>0?e.jsx("div",{className:"community-discovery-list",children:s.items.map(r=>e.jsxs("button",{type:"button",onClick:()=>s.selectCommunity(r.id),children:[e.jsx(_,{name:r.displayName,imageUrl:r.imageUrl}),e.jsxs("span",{children:[e.jsx("strong",{children:r.displayName}),e.jsx("small",{children:r.description})]}),e.jsx("em",{children:r.membership?.status==="active"?"Joined":r.featuredAt?"Featured":`${r.memberCount.toLocaleString()} members`})]},r.id))}):s.discoveryLoading?null:e.jsx("div",{className:"community-state",children:"No public communities are available yet."}),e.jsxs("div",{className:"community-discovery-actions",children:[e.jsxs("button",{type:"button",onClick:()=>{s.refresh()},disabled:s.discoveryLoading,children:[e.jsx(O,{size:14})," Refresh"]}),s.nextCursor?e.jsx("button",{type:"button",className:"secondary",onClick:()=>{s.loadMore()},disabled:s.discoveryLoading,children:"Load more"}):null]})]})});if(!i&&s.previewLoading)return e.jsx("section",{className:"community-empty-page",children:e.jsxs("div",{className:"community-empty-card",children:[e.jsx("span",{className:"community-spinner"})," Loading community…"]})});if(!i)return e.jsx("section",{className:"community-empty-page",children:e.jsxs("div",{className:"community-empty-card",children:[e.jsx("h1",{children:s.selectedSummary.displayName}),e.jsx("div",{className:"community-state error",children:s.previewError??"This community preview is unavailable."}),e.jsxs("button",{type:"button",onClick:()=>s.selectCommunity(s.selectedSummary.id),children:[e.jsx(O,{size:14})," Retry preview"]})]})});const v=i.currentRules,M=s.membershipError?.message??null;return e.jsxs("section",{className:"community-view",children:[e.jsxs("header",{className:"community-header",children:[e.jsxs("div",{className:"community-heading",children:[e.jsx(_,{name:i.displayName,imageUrl:i.imageUrl}),e.jsxs("div",{children:[e.jsx("small",{children:i.displayName}),e.jsx("h1",{children:n.selectedChannel?`# ${n.selectedChannel.displayName}`:i.displayName}),e.jsx("p",{children:n.selectedChannel?.topic||i.description})]})]}),e.jsxs("div",{className:"community-header-actions",children:[e.jsxs("span",{className:"community-member-count",children:[e.jsx(q,{size:14})," ",i.memberCount.toLocaleString()]}),v?e.jsxs("button",{type:"button",className:"secondary",onClick:()=>y("review"),children:[e.jsx(re,{size:14})," Rules"]}):null,f?e.jsx(ve,{mode:i.membership?.notificationMode??"mentions",busy:s.membershipBusy,onMode:s.updateNotifications,onLeave:s.leave}):null]})]}),e.jsxs("div",{className:"community-chat-main conversation-surface-main",children:[e.jsxs("div",{className:"community-chat-notices",children:[f?h?e.jsxs("div",{className:"community-preview-banner warning",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"The rules have changed"}),e.jsx("span",{children:"Accept the current rules to continue reading live updates and posting."})]}),e.jsx("button",{type:"button",disabled:!v||s.membershipBusy,onClick:()=>y("reaccept"),children:"Review updated rules"})]}):null:e.jsxs("div",{className:"community-preview-banner",children:[e.jsxs("div",{children:[e.jsxs("strong",{children:["Previewing ",i.displayName]}),e.jsx("span",{children:"Read the public conversation, then accept the rules to join and post."})]}),e.jsx("button",{type:"button",disabled:!v||s.membershipBusy,onClick:()=>y("join"),children:"Join community"})]}),n.realtimeError&&f&&!h?e.jsxs("div",{className:"community-realtime-state",children:[e.jsx(oe,{size:14}),e.jsx("span",{children:"Live updates are reconnecting. Loaded messages are still available."})]}):null,n.lostMembership?e.jsx("div",{className:"community-state error",children:"Your membership changed. Refresh the community before continuing."}):null,n.channelsError?e.jsxs("div",{className:"community-state error",children:["Channels: ",n.channelsError," ",e.jsx("button",{type:"button",onClick:()=>{n.loadChannels()},children:"Retry"})]}):null,M?e.jsx("div",{className:"community-state error",role:"alert",children:M}):null]}),e.jsxs("div",{className:"community-message-pane conversation-message-scroll",ref:b,role:"log","aria-live":"polite","aria-relevant":"additions text","aria-busy":n.messagesLoading,"aria-label":n.selectedChannel?`${i.displayName}, ${n.selectedChannel.displayName}`:i.displayName,tabIndex:0,children:[n.hasMoreBefore?e.jsx("button",{type:"button",className:"community-load-older",disabled:n.olderMessagesLoading,onClick:()=>{n.loadOlder()},children:n.olderMessagesLoading?"Loading…":"Load earlier messages"}):null,n.messagesLoading&&n.messages.length===0?e.jsx("div",{className:"community-message-state",children:"Loading messages…"}):null,n.messagesError?e.jsxs("div",{className:"community-message-state error",children:["Could not load messages: ",n.messagesError," ",e.jsx("button",{type:"button",onClick:()=>{n.loadMessages()},children:"Retry"})]}):null,!n.messagesLoading&&!n.messagesError&&n.messages.length===0?e.jsx("div",{className:"community-message-state",children:"No messages in this channel yet."}):null,n.messages.map(r=>e.jsx(be,{message:r,author:r.authorUserId?p.get(r.authorUserId)??null:null,own:r.authorUserId===m,attachmentsAccessible:!n.previewMode,membersById:p,messagesById:C,onReply:u,onEdit:n.editMessage,onDelete:n.deleteMessage,onDownloadAttachment:n.downloadAttachment},r.id))]}),f?e.jsxs("div",{className:"community-composer-wrap conversation-composer-shell",children:[n.actionError?e.jsx("div",{className:"community-composer-action-error",children:n.actionError}):null,n.failedSend?e.jsxs("div",{className:"community-failed-send",children:[e.jsxs("span",{children:["Message not sent. ",n.failedSend.message]}),e.jsx("button",{type:"button",disabled:n.sending,onClick:()=>{n.retrySend()},children:"Retry"}),e.jsx("button",{type:"button",onClick:n.dismissFailedSend,children:"Dismiss"})]}):null,e.jsx(ye,{members:n.members,replyTo:c,busy:n.sending,disabled:h||n.lostMembership||!n.selectedChannel||n.selectedChannel.postingPolicy==="admins"&&i.membership?.role==="member",onCancelReply:()=>u(null),onSearchMembers:n.searchMembers,onSend:n.sendMessage})]}):null]}),a&&v?e.jsx(pe,{rules:v,mode:a,busy:s.membershipBusy,error:M,onAccept:a==="join"?s.join:s.acceptRules,onClose:()=>y(null)}):null]})}function ve(s){const[n,m]=l.useState(!1);return e.jsxs("div",{className:"community-membership-menu",children:[e.jsxs("button",{type:"button",className:"secondary","aria-expanded":n,onClick:()=>m(a=>!a),children:[s.mode==="none"?e.jsx(le,{size:14}):e.jsx(ce,{size:14})," Joined"]}),n?e.jsxs("div",{className:"community-membership-popover",children:[e.jsx("strong",{children:"Notifications"}),["mentions","all","none"].map(a=>e.jsxs("label",{children:[e.jsx("input",{type:"radio",name:"community-notifications",checked:s.mode===a,disabled:s.busy,onChange:()=>{s.onMode(a)}})," ",a==="mentions"?"Mentions":a==="all"?"All messages":"Nothing"]},a)),e.jsx("button",{type:"button",className:"danger",disabled:s.busy,onClick:()=>{window.confirm("Leave this community? You can join again later by accepting the current rules.")&&s.onLeave().then(a=>{a&&m(!1)})},children:"Leave community"})]}):null]})}function _({name:s,imageUrl:n}){return n?e.jsx("img",{className:"community-icon",src:n,alt:""}):e.jsx("span",{className:"community-icon fallback",children:s.slice(0,2).toUpperCase()})}export{ke as CommunityView};
@@ -0,0 +1 @@
1
+ .main-pane.community-active{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);min-height:0;overflow:hidden}.main-pane.community-active>.community-view,.main-pane.community-active>.community-empty-page{grid-column:1;grid-row:1}.community-view{display:grid;grid-template-rows:auto minmax(0,1fr);width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;background:var(--bg);color:var(--text)}.community-chat-main{--conversation-surface-rows: auto minmax(0, 1fr) auto;overflow:hidden}.community-chat-notices{grid-row:1;max-height:38vh;overflow-y:auto}.community-chat-notices:empty{display:none}.community-message-pane{grid-row:2}.community-composer-wrap{grid-row:3}.community-header{display:flex;min-width:0;min-height:74px;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid var(--border);background:var(--bg);padding:12px 20px}.community-heading,.community-header-actions,.community-heading>div,.community-member-count,.community-preview-banner,.community-realtime-state,.community-rules-dialog>header,.community-rules-dialog>footer,.community-rules-dialog footer>div{display:flex;align-items:center}.community-heading{min-width:0;gap:12px}.community-heading>div{min-width:0;align-items:flex-start;flex-direction:column}.community-heading small{color:var(--muted);font-size:11px}.community-heading h1{margin:0;color:var(--text);font-size:16px;line-height:1.3}.community-heading p{max-width:650px;overflow:hidden;margin:2px 0 0;color:var(--muted);font-size:12px;text-overflow:ellipsis;white-space:nowrap}.community-icon{width:38px;height:38px;flex:0 0 auto;border-radius:8px;object-fit:cover}.community-icon.fallback{display:grid;place-items:center;background:#29433b;color:#d1fae5;font-size:12px;font-weight:700}.community-header-actions{flex:0 0 auto;gap:8px}.community-member-count{gap:5px;color:var(--muted);padding:6px 8px;font-size:12px}.community-header button,.community-preview-banner button,.community-empty-card button,.community-discovery-card button,.community-rules-dialog button{display:inline-flex;min-height:29px;align-items:center;gap:6px;border:0;border-radius:7px;background:#e8e8e8;color:#181818;padding:6px 10px;font:inherit;font-size:12px;font-weight:600;cursor:pointer}.community-header button:hover:not(:disabled),.community-preview-banner button:hover:not(:disabled),.community-empty-card button:hover:not(:disabled),.community-discovery-card button:hover:not(:disabled),.community-rules-dialog button:hover:not(:disabled){background:#fff}.community-header button.secondary,.community-rules-dialog button.secondary,.community-discovery-actions .secondary{border:1px solid var(--border);background:#242424;color:var(--text)}.community-header button.secondary:hover:not(:disabled),.community-rules-dialog button.secondary:hover:not(:disabled),.community-discovery-actions .secondary:hover:not(:disabled){background:#2d2d2d}.community-header button:disabled,.community-preview-banner button:disabled,.community-empty-card button:disabled,.community-discovery-card button:disabled,.community-rules-dialog button:disabled{cursor:default;opacity:.5}.community-preview-banner{justify-content:space-between;gap:20px;border-bottom:1px solid rgba(45,212,191,.24);background:#2dd4bf12;padding:10px 20px}.community-preview-banner.warning{border-color:#f59e0b4d;background:#f59e0b14}.community-preview-banner>div{display:flex;flex-direction:column;gap:2px}.community-preview-banner strong,.community-preview-banner span{font-size:12px}.community-preview-banner span{color:var(--muted-strong)}.community-realtime-state{gap:7px;border-bottom:1px solid rgba(234,179,8,.18);background:#eab30812;color:#eab308;padding:7px 20px;font-size:12px}.community-state{margin:8px 20px 0;border-radius:7px;padding:8px 10px;color:var(--muted-strong);font-size:12px}.community-chat-notices .community-state{margin:0;border-bottom:1px solid rgba(248,113,113,.2);border-radius:0;padding:8px 20px}.community-state.error,.community-message-state.error,.community-composer-action-error{background:#ef44441a;color:#fca5a5}.community-state button,.community-message-state button{margin-left:8px;border:0;background:transparent;color:inherit;padding:0;text-decoration:underline}.community-message-pane{outline:none}.community-message-pane:focus-visible{box-shadow:inset 0 0 0 2px #2dd4bf59}.community-message-state{display:grid;min-height:180px;place-items:center;border-radius:8px;color:var(--muted);padding:28px;font-size:13px;text-align:center}.community-load-older{display:block;min-height:28px;margin:0 auto 10px;border:0;border-radius:5px;background:transparent;color:#67d4c0;padding:0 8px;font-size:11px}.community-load-older:hover:not(:disabled){background:#2dd4bf17}.community-load-older:disabled{opacity:.55}.community-message{position:relative;display:grid;grid-template-columns:34px minmax(0,1fr);gap:10px;padding:8px 6px}.community-message:hover{background:#ffffff06}.community-avatar{display:grid;width:34px;height:34px;place-items:center;border-radius:6px;background:#29433b;color:#d1fae5;font-size:11px;font-weight:700}.community-message-content{min-width:0;color:#e8e8e8;font-size:13px;line-height:1.5}.community-message-content>header{display:flex;min-height:20px;align-items:baseline;gap:7px}.community-message-content>header strong{color:var(--text);font-size:13px}.community-message-content>header time,.community-message-content>header>span{color:#777;font-size:10px}.community-message-content .markdown-message{overflow-wrap:anywhere;color:#e8e8e8;font-size:13px;line-height:1.5}.community-message-content .markdown-paragraph{margin:2px 0}.community-message-actions{display:inline-flex;gap:2px;margin-left:auto;opacity:0}.community-message:hover .community-message-actions,.community-message-actions:focus-within{opacity:1}.community-message-actions button{display:inline-grid;width:25px;height:25px;place-items:center;border:0;border-radius:5px;background:transparent;color:var(--muted)}.community-message-actions button:hover{background:#ffffff14;color:var(--text)}.community-message-actions button:focus-visible,.community-reply-quote:focus-visible,.community-load-older:focus-visible{outline:2px solid #67d4c0;outline-offset:2px}.community-reply-quote{display:grid;width:min(520px,100%);min-width:0;margin:3px 0 5px;border:0;border-left:3px solid #2dd4bf;border-radius:4px;background:#2dd4bf13;color:var(--muted-strong);padding:6px 9px;text-align:left}.community-reply-quote:hover{background:#2dd4bf1f}.community-reply-quote strong{overflow:hidden;color:#67d4c0;font-size:11px;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}.community-reply-quote span{overflow:hidden;font-size:11px;line-height:1.4;text-overflow:ellipsis;white-space:nowrap}.community-message-deleted{color:#777;font-size:12px;font-style:italic}.community-message-edit textarea{width:100%;min-height:72px;resize:vertical;border:1px solid rgba(45,212,191,.45);border-radius:6px;background:#191919;color:var(--text);padding:8px;font:inherit}.community-message-edit>div{display:flex;justify-content:flex-end;gap:6px;margin-top:5px}.community-message-edit button{min-height:27px;border:1px solid var(--border);border-radius:5px;background:#202020;color:var(--text);padding:0 9px;font-size:11px}.community-message-attachments{display:flex;flex-wrap:wrap;gap:7px;margin-top:7px}.community-message-attachments button,.community-attachment-placeholder{display:flex;max-width:240px;flex-direction:column;align-items:flex-start;border:1px solid var(--border);border-radius:7px;background:#1b1b1b;color:var(--text);padding:8px 10px}.community-attachment-placeholder{opacity:.7}.community-message-attachments span{max-width:210px;overflow:hidden;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.community-message-attachments small{color:var(--muted)}.community-composer-wrap{min-width:0}.community-composer-reply{display:grid;grid-template-columns:minmax(0,1fr) auto;min-height:48px;align-items:center;gap:9px;margin-bottom:6px;border:1px solid var(--border);border-left:3px solid #2dd4bf;border-radius:7px;background:#1d2422;color:#67d4c0;padding:5px 7px 5px 10px}.community-composer-reply>span{display:grid;min-width:0;overflow:hidden;color:var(--muted-strong);font-size:11px;text-overflow:ellipsis;white-space:nowrap}.community-composer-reply strong{color:#67d4c0}.community-composer-reply button{display:inline-grid;width:25px;height:25px;place-items:center;border:0;border-radius:5px;background:transparent;color:var(--muted)}.community-composer-reply button:hover,.community-composer-reply button:focus-visible{outline:0;background:#ffffff14;color:var(--text)}.community-composer-action-error,.community-failed-send{margin-bottom:6px;border:1px solid rgba(248,113,113,.25);border-radius:7px;padding:7px 9px;font-size:11px}.community-failed-send{display:flex;align-items:center;gap:7px;background:#ef44441a;color:#fca5a5}.community-failed-send span{flex:1}.community-failed-send button{border:0;background:transparent;color:inherit;padding:0;text-decoration:underline}.community-mention-menu{position:absolute;z-index:12;right:0;bottom:calc(100% + 6px);left:0;max-height:min(320px,42vh);overflow-y:auto;border:1px solid var(--border);border-radius:9px;background:#222;padding:5px;box-shadow:0 12px 30px #00000061}.community-mention-menu button{display:flex;width:100%;min-height:32px;align-items:center;justify-content:space-between;border:0;border-radius:5px;background:transparent;color:var(--text);padding:0 9px;font-size:12px}.community-mention-menu button:hover,.community-mention-menu button[aria-selected=true]{background:#2dd4bf1f;color:#a7f3d0}.community-mention-menu small{color:var(--muted)}.community-membership-menu{position:relative}.community-membership-popover{position:absolute;z-index:5;top:calc(100% + 6px);right:0;display:flex;width:210px;flex-direction:column;gap:8px;border:1px solid var(--border);border-radius:9px;background:#222;padding:10px;box-shadow:0 12px 32px #0006}.community-membership-popover>strong{color:var(--muted-strong);font-size:11px}.community-membership-popover label{font-size:12px}.community-membership-popover input{accent-color:#2dd4bf}.community-membership-popover button.danger{justify-content:center;margin-top:4px;background:#ef444424;color:#fca5a5}.community-dialog-backdrop{position:fixed;z-index:30;inset:0;display:grid;place-items:center;background:#0000009e;padding:30px}.community-rules-dialog{display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;width:min(720px,100%);max-height:min(780px,calc(100vh - 60px));overflow:hidden;border:1px solid var(--border);border-radius:14px;background:#191919;box-shadow:0 24px 70px #0000008c}.community-rules-dialog>header{justify-content:space-between;gap:20px;border-bottom:1px solid var(--border);padding:16px 18px}.community-rules-dialog>header small{color:var(--muted)}.community-rules-dialog h2{margin:2px 0 0;font-size:17px}.community-rules-dialog>header button{min-height:29px;padding:7px;background:transparent;color:var(--text)}.community-rules-body{overflow-y:auto;padding:18px 22px}.community-rules-dialog>footer{align-items:flex-end;justify-content:space-between;gap:16px;border-top:1px solid var(--border);padding:14px 18px}.community-rules-dialog footer>div{gap:7px}.community-rules-acceptance{display:flex;max-width:400px;align-items:flex-start;gap:8px;color:var(--muted-strong);font-size:12px}.community-rules-acceptance input{accent-color:#2dd4bf}.community-empty-page{display:grid;width:100%;height:100%;min-width:0;min-height:0;place-items:center;overflow:hidden;background:var(--bg);padding:30px}.community-empty-card{display:flex;width:min(480px,100%);flex-direction:column;align-items:center;gap:10px;color:var(--muted);text-align:center}.community-empty-card h1,.community-discovery-card>h1{margin:0;color:var(--text)}.community-empty-card p{margin:0}.community-discovery-card{display:flex;width:min(760px,100%);max-height:100%;min-height:0;flex-direction:column;align-items:center;gap:12px;color:var(--muted)}.community-discovery-card>p{max-width:580px;margin:0;text-align:center}.community-discovery-list{display:grid;width:100%;min-height:0;gap:7px;overflow-y:auto;padding:2px}.community-discovery-list>button{display:grid;grid-template-columns:auto minmax(0,1fr) auto;width:100%;align-items:center;gap:12px;border:1px solid var(--border);background:#202020;color:var(--text);padding:11px;text-align:left}.community-discovery-list>button:hover:not(:disabled){border-color:#ffffff26;background:#282828}.community-discovery-list>button>span{display:flex;min-width:0;flex-direction:column;gap:3px}.community-discovery-list small{overflow:hidden;color:var(--muted);text-overflow:ellipsis;white-space:nowrap}.community-discovery-list em{color:#67d4c0;font-size:11px;font-style:normal}.community-discovery-actions{display:flex;gap:8px}.community-spinner{width:20px;height:20px;border:2px solid #454545;border-top-color:#2dd4bf;border-radius:50%;animation:community-spin .8s linear infinite}@keyframes community-spin{to{transform:rotate(360deg)}}@media(max-width:720px){.community-header{align-items:flex-start}.community-member-count{display:none}.community-preview-banner{align-items:flex-start;flex-direction:column;gap:8px}.community-discovery-list>button{grid-template-columns:auto minmax(0,1fr)}.community-discovery-list em{display:none}.community-rules-dialog>footer{align-items:stretch;flex-direction:column}}