openpond-sdk 0.0.1

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 (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +127 -0
  3. package/dist/index.js +2635 -0
  4. package/dist/index.js.map +7 -0
  5. package/dist/types/packages/cloud/src/api/core.d.ts +23 -0
  6. package/dist/types/packages/cloud/src/api/core.d.ts.map +1 -0
  7. package/dist/types/packages/cloud/src/api/vercel-protection.d.ts +2 -0
  8. package/dist/types/packages/cloud/src/api/vercel-protection.d.ts.map +1 -0
  9. package/dist/types/packages/cloud/src/hosted-chat.d.ts +163 -0
  10. package/dist/types/packages/cloud/src/hosted-chat.d.ts.map +1 -0
  11. package/dist/types/packages/cloud/src/sandbox/async-request-options.d.ts +3 -0
  12. package/dist/types/packages/cloud/src/sandbox/async-request-options.d.ts.map +1 -0
  13. package/dist/types/packages/cloud/src/sandbox/client-handles.d.ts +101 -0
  14. package/dist/types/packages/cloud/src/sandbox/client-handles.d.ts.map +1 -0
  15. package/dist/types/packages/cloud/src/sandbox/client.d.ts +327 -0
  16. package/dist/types/packages/cloud/src/sandbox/client.d.ts.map +1 -0
  17. package/dist/types/packages/cloud/src/sandbox/runtime-handle.d.ts +37 -0
  18. package/dist/types/packages/cloud/src/sandbox/runtime-handle.d.ts.map +1 -0
  19. package/dist/types/packages/cloud/src/sandbox/sandbox-instance-client.d.ts +73 -0
  20. package/dist/types/packages/cloud/src/sandbox/sandbox-instance-client.d.ts.map +1 -0
  21. package/dist/types/packages/cloud/src/sandbox/smoke.d.ts +4 -0
  22. package/dist/types/packages/cloud/src/sandbox/smoke.d.ts.map +1 -0
  23. package/dist/types/packages/cloud/src/sandbox/stream.d.ts +8 -0
  24. package/dist/types/packages/cloud/src/sandbox/stream.d.ts.map +1 -0
  25. package/dist/types/packages/cloud/src/sandbox/types/billing.d.ts +177 -0
  26. package/dist/types/packages/cloud/src/sandbox/types/billing.d.ts.map +1 -0
  27. package/dist/types/packages/cloud/src/sandbox/types/client.d.ts +104 -0
  28. package/dist/types/packages/cloud/src/sandbox/types/client.d.ts.map +1 -0
  29. package/dist/types/packages/cloud/src/sandbox/types/core.d.ts +141 -0
  30. package/dist/types/packages/cloud/src/sandbox/types/core.d.ts.map +1 -0
  31. package/dist/types/packages/cloud/src/sandbox/types/index.d.ts +15 -0
  32. package/dist/types/packages/cloud/src/sandbox/types/index.d.ts.map +1 -0
  33. package/dist/types/packages/cloud/src/sandbox/types/io.d.ts +241 -0
  34. package/dist/types/packages/cloud/src/sandbox/types/io.d.ts.map +1 -0
  35. package/dist/types/packages/cloud/src/sandbox/types/microsoft-teams-bot.d.ts +52 -0
  36. package/dist/types/packages/cloud/src/sandbox/types/microsoft-teams-bot.d.ts.map +1 -0
  37. package/dist/types/packages/cloud/src/sandbox/types/org-project-agent.d.ts +524 -0
  38. package/dist/types/packages/cloud/src/sandbox/types/org-project-agent.d.ts.map +1 -0
  39. package/dist/types/packages/cloud/src/sandbox/types/record.d.ts +54 -0
  40. package/dist/types/packages/cloud/src/sandbox/types/record.d.ts.map +1 -0
  41. package/dist/types/packages/cloud/src/sandbox/types/responses.d.ts +296 -0
  42. package/dist/types/packages/cloud/src/sandbox/types/responses.d.ts.map +1 -0
  43. package/dist/types/packages/cloud/src/sandbox/types/runtime-environments.d.ts +3 -0
  44. package/dist/types/packages/cloud/src/sandbox/types/runtime-environments.d.ts.map +1 -0
  45. package/dist/types/packages/cloud/src/sandbox/types/runtime-profiles.d.ts +16 -0
  46. package/dist/types/packages/cloud/src/sandbox/types/runtime-profiles.d.ts.map +1 -0
  47. package/dist/types/packages/cloud/src/sandbox/types/runtime.d.ts +153 -0
  48. package/dist/types/packages/cloud/src/sandbox/types/runtime.d.ts.map +1 -0
  49. package/dist/types/packages/cloud/src/sandbox/types/schedules.d.ts +142 -0
  50. package/dist/types/packages/cloud/src/sandbox/types/schedules.d.ts.map +1 -0
  51. package/dist/types/packages/cloud/src/sandbox/types/snapshots.d.ts +206 -0
  52. package/dist/types/packages/cloud/src/sandbox/types/snapshots.d.ts.map +1 -0
  53. package/dist/types/packages/cloud/src/sandbox/types/workflow-modes.d.ts +2 -0
  54. package/dist/types/packages/cloud/src/sandbox/types/workflow-modes.d.ts.map +1 -0
  55. package/dist/types/packages/cloud/src/sandbox/types/workload-sources.d.ts +21 -0
  56. package/dist/types/packages/cloud/src/sandbox/types/workload-sources.d.ts.map +1 -0
  57. package/dist/types/packages/cloud/src/sandbox/url.d.ts +3 -0
  58. package/dist/types/packages/cloud/src/sandbox/url.d.ts.map +1 -0
  59. package/dist/types/packages/cloud/src/urls.d.ts +5 -0
  60. package/dist/types/packages/cloud/src/urls.d.ts.map +1 -0
  61. package/dist/types/packages/sdk/src/index.d.ts +17 -0
  62. package/dist/types/packages/sdk/src/index.d.ts.map +1 -0
  63. package/dist/types/packages/sdk/src/types.d.ts +11 -0
  64. package/dist/types/packages/sdk/src/types.d.ts.map +1 -0
  65. package/dist/types/packages/sdk/src/work.d.ts +71 -0
  66. package/dist/types/packages/sdk/src/work.d.ts.map +1 -0
  67. package/package.json +50 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) OpenPond
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,127 @@
1
+ # `openpond-sdk`
2
+
3
+ The OpenPond SDK is the server-side TypeScript client for running agentic work in OpenPond sandboxes. It gives Node.js applications, Next.js route handlers, workers, and backend services a small API for creating sandboxes, executing commands, managing files and runtimes, and running a model/tool loop in a persistent workspace.
4
+
5
+ OpenPond is an open-source agent orchestration system for doing durable work with any model, provider, or subscription. The desktop app, CLI/TUI, and this SDK live in the same repository and share the sandbox client implementation. Desktop builds use the workspace source directly; installing this package from npm is only for external applications.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install openpond-sdk
11
+ ```
12
+
13
+ Node.js 22.14 or newer is required. This package is server-only: never expose an OpenPond API key in browser code or a `NEXT_PUBLIC_*` environment variable.
14
+
15
+ ## Next.js route handler
16
+
17
+ ```ts
18
+ // app/api/work/route.ts
19
+ import { createOpenPondClient } from "openpond-sdk";
20
+
21
+ export const runtime = "nodejs";
22
+ export const maxDuration = 800;
23
+
24
+ const openpond = createOpenPondClient({
25
+ apiKey: process.env.OPENPOND_API_KEY!,
26
+ baseUrl: process.env.OPENPOND_API_URL,
27
+ });
28
+
29
+ export async function POST(request: Request) {
30
+ const { prompt, sandboxId } = await request.json();
31
+ const result = await openpond.work.run({ prompt, sandboxId });
32
+ return Response.json(result);
33
+ }
34
+ ```
35
+
36
+ `work.run` creates a sandbox when `sandboxId` is omitted. Pass the returned ID into the next turn to continue in the same filesystem. Use `onEvent` to stream sandbox, model, and command progress to a client.
37
+
38
+ Work requires a real `remote-firecracker` runtime. It fails closed if an environment returns the simulator or a nominal remote sandbox responds with a non-executing command marker, so an accepted command can never be mistaken for actual filesystem work.
39
+
40
+ ## Raw sandbox API
41
+
42
+ ```ts
43
+ import { createOpenPondClient } from "openpond-sdk";
44
+
45
+ const openpond = createOpenPondClient({
46
+ apiKey: process.env.OPENPOND_API_KEY!,
47
+ });
48
+
49
+ const sandbox = await openpond.sandboxes.create(
50
+ {
51
+ repo: "https://github.com/octocat/Hello-World",
52
+ budget: { maxUsd: "0.25" },
53
+ },
54
+ { async: true },
55
+ );
56
+
57
+ const result = await openpond.sandboxes.exec(sandbox.id, {
58
+ command: "git status --short",
59
+ timeoutSeconds: 60,
60
+ });
61
+
62
+ console.log(result.command.output);
63
+ ```
64
+
65
+ The package also exports `createOpenPondSandboxClient`, all public sandbox input and response types, and the OpChat helpers used by the Work loop.
66
+
67
+ ## Staging
68
+
69
+ Use a server-only environment file while developing:
70
+
71
+ ```dotenv
72
+ OPENPOND_API_KEY=opk_...
73
+ OPENPOND_API_URL=https://staging-api.openpond.ai
74
+ ```
75
+
76
+ If the staging deployment has Vercel protection enabled, also set `VERCEL_AUTOMATION_BYPASS_SECRET`. The SDK only sends that bypass header to OpenPond staging hosts.
77
+
78
+ ## Lifecycle and cleanup
79
+
80
+ Work sandboxes remain available so conversations can continue. Delete them when a conversation is removed or expires:
81
+
82
+ ```ts
83
+ await openpond.work.deleteSandbox(sandboxId);
84
+ ```
85
+
86
+ Use conservative budgets and application-level retention. API keys, provider credentials, and bypass secrets must remain in server-side configuration.
87
+
88
+ ## Development
89
+
90
+ From the OpenPond monorepo:
91
+
92
+ ```bash
93
+ pnpm sdk:check
94
+ ```
95
+
96
+ The package has an independent version and release workflow. Updating `openpond-sdk` does not change the desktop, CLI, or TUI version.
97
+
98
+ ## Maintainer release setup
99
+
100
+ The first release requires a one-time npm bootstrap because npm trusted publishing can only be configured after the package exists. After the feature PR is merged, run these commands from a clean, current `master` checkout:
101
+
102
+ ```bash
103
+ pnpm sdk:check
104
+ npm login
105
+ npm publish ./packages/sdk --access public --ignore-scripts --provenance=false
106
+ npm install --global npm@^11.15.0
107
+ npm trust github openpond-sdk \
108
+ --repo openpond/openpond \
109
+ --file release-sdk.yml \
110
+ --environment npm-production \
111
+ --allow-publish
112
+ npm trust list openpond-sdk
113
+ gh workflow run release-sdk.yml --ref master
114
+ ```
115
+
116
+ The GitHub `npm-production` environment already used by the OpenPond CLI can be reused. The trust record is package-specific, so `openpond-sdk` still needs its own entry.
117
+
118
+ The final command dispatches the idempotent recovery path once: npm publication is already complete, so the workflow only creates the missing `sdk-v0.0.1` tag and GitHub release. It does not attempt to republish the immutable version.
119
+
120
+ After bootstrap, prepare releases independently:
121
+
122
+ ```bash
123
+ pnpm release:sdk:patch
124
+ # or release:sdk:minor / release:sdk:major
125
+ ```
126
+
127
+ That command creates an SDK-only release PR. Merging it triggers `release-sdk.yml`; desktop and CLI releases continue to use the existing `pnpm release:patch` command and workflow.