@opengeni/runtime 0.7.0 → 0.11.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 (49) hide show
  1. package/THIRD_PARTY_NOTICES +32 -0
  2. package/dist/agent-UMUIWWD2.js +8 -0
  3. package/dist/agent-UMUIWWD2.js.map +1 -0
  4. package/dist/chunk-4YJ5Z52Z.js +1789 -0
  5. package/dist/chunk-4YJ5Z52Z.js.map +1 -0
  6. package/dist/chunk-DPULLAJG.js +215 -0
  7. package/dist/chunk-DPULLAJG.js.map +1 -0
  8. package/dist/chunk-K4V4QYCL.js +37683 -0
  9. package/dist/chunk-K4V4QYCL.js.map +1 -0
  10. package/dist/chunk-PZ5AY32C.js +10 -0
  11. package/dist/chunk-PZ5AY32C.js.map +1 -0
  12. package/dist/chunk-YUAFQEFY.js +21522 -0
  13. package/dist/chunk-YUAFQEFY.js.map +1 -0
  14. package/dist/{index-DIiiwQY2.d.ts → index-D6yi-JcU.d.ts} +138 -15
  15. package/dist/index.d.ts +333 -122
  16. package/dist/index.js +8260 -349
  17. package/dist/index.js.map +1 -1
  18. package/dist/localSources-T3HZ6KY4.js +15 -0
  19. package/dist/localSources-T3HZ6KY4.js.map +1 -0
  20. package/dist/sandbox/index.d.ts +1 -1
  21. package/dist/sandbox/index.js +42 -5
  22. package/dist/skill-library.d.ts +74 -0
  23. package/dist/skill-library.js +18 -0
  24. package/dist/skill-library.js.map +1 -0
  25. package/package.json +13 -5
  26. package/src/bundled_hashicorp_terraform_skills/README.md +3 -3
  27. package/src/bundled_hashicorp_terraform_skills/checkov/SKILL.md +1 -1
  28. package/src/context-compaction.ts +421 -24
  29. package/src/history-sanitizer.ts +14 -5
  30. package/src/index.ts +1451 -304
  31. package/src/sandbox/channel-a.ts +535 -97
  32. package/src/sandbox/index.ts +36 -2
  33. package/src/sandbox/routing/routing-session.ts +10 -2
  34. package/src/sandbox/run-credentials.ts +818 -0
  35. package/src/sandbox/select.ts +3 -3
  36. package/src/sandbox/selfhosted/capabilities.ts +1 -1
  37. package/src/sandbox/selfhosted/op-stream.ts +40 -0
  38. package/src/sandbox/selfhosted/op-testing.ts +50 -3
  39. package/src/sandbox/selfhosted/session.ts +17 -4
  40. package/src/sandbox/selfhosted/testing.ts +1 -1
  41. package/src/sandbox/stream-port.ts +1 -1
  42. package/src/sandbox/stream-token.ts +1 -1
  43. package/src/sandbox/terminal-server.ts +6 -2
  44. package/src/sandbox/toolspace-token.ts +147 -0
  45. package/src/sandbox/turn-tool-cancellation.ts +940 -0
  46. package/src/skill-library.ts +323 -0
  47. package/dist/chunk-RYDCVTMW.js +0 -5531
  48. package/dist/chunk-RYDCVTMW.js.map +0 -1
  49. /package/src/{bundled_hashicorp_terraform_skills → bundled_skill_library}/azure-verified-modules/SKILL.md +0 -0
@@ -1,7 +1,7 @@
1
1
  // @opengeni/runtime/sandbox — the agent-loop-free sandbox leaf.
2
2
  //
3
3
  // This module is the load-bearing pre-req for the API-direct control plane
4
- // (docs/design/sandbox-surfacing). It exposes the sandbox client factory plus
4
+ // (docs/connected-machines.md). It exposes the sandbox client factory plus
5
5
  // the resume / recovery-envelope helpers that the API needs to touch a box by
6
6
  // id (resume-by-id, file/exec/port ops) WITHOUT importing the @openai/agents
7
7
  // agent-loop graph.
@@ -125,6 +125,39 @@ export {
125
125
  type EnsureTerminalServerResult,
126
126
  } from "./terminal-server";
127
127
 
128
+ // Host-owned rotating run credentials. Material lives outside the persisted
129
+ // workspace/manifest and is activated atomically per session generation.
130
+ export {
131
+ RunCredentialValidationError,
132
+ normalizeRunCredentialsResolution,
133
+ runCredentialRoot,
134
+ runCredentialPointerFile,
135
+ materializeRunCredentials,
136
+ clearRunCredentials,
137
+ clearRunCredentialsForAttempt,
138
+ withRunCredentialEnvironment,
139
+ withRunCredentialsSession,
140
+ withRunCredentialsClient,
141
+ type RunCredentialExpectedScope,
142
+ type NormalizedRunCredentialMaterial,
143
+ type RunCredentialCommandSession,
144
+ type RunCredentialCommandRunner,
145
+ type RunCredentialSessionReady,
146
+ type MaterializeRunCredentialsOptions,
147
+ } from "./run-credentials";
148
+
149
+ // Session-specific Toolspace token routing. The manifest retains one stable
150
+ // legacy pointer for warm-box env parity; every session command selects its own
151
+ // hashed token file off-manifest.
152
+ export {
153
+ ToolspaceTokenPathError,
154
+ toolspaceTokenFileForSession,
155
+ toolspaceTokenFileFromEnvironment,
156
+ withToolspaceTokenEnvironment,
157
+ withToolspaceTokenSession,
158
+ withToolspaceTokenClient,
159
+ } from "./toolspace-token";
160
+
128
161
  // The Channel-B pixel DATA PLANE (P4.2). Resolves the provider's scoped tunnel
129
162
  // for port 6080 (client → provider-tunnel direct), assembles the WS URL, and
130
163
  // mints the scoped stream token. Called API-direct on the resumed handle.
@@ -164,12 +197,13 @@ export {
164
197
  export {
165
198
  SandboxChannelAService,
166
199
  ChannelAValidationError,
200
+ ChannelAUnavailableError,
167
201
  ChannelAConflictError,
168
202
  ChannelANotFoundError,
169
203
  ChannelAUnsupportedError,
170
204
  stripExecBanner,
171
205
  parseExecBannerSessionId,
172
- isWorkspaceEscapeError,
206
+ parseExecBannerExitCode,
173
207
  isExecSessionLostBanner,
174
208
  assertSafeRelPath,
175
209
  parsePorcelainV2,
@@ -1,6 +1,6 @@
1
1
  // `RoutingSandboxSession` — the per-session hot-swap routing proxy (M7).
2
2
  //
3
- // THE load-bearing SDK finding (dossier §10.3 / §20-M7): when a box is injected
3
+ // THE load-bearing SDK finding: when a box is injected
4
4
  // NON-OWNED into a turn (`ownedSandbox.session`), the agent SDK's sandbox
5
5
  // capabilities bind to that ONE session OBJECT ONCE and call ITS methods
6
6
  // (`exec`/`execCommand`/`readFile`/`listDir`/`resolveExposedPort`/…) per tool
@@ -10,7 +10,7 @@
10
10
  // per-session active pointer `(active_sandbox_id, active_epoch)` and DISPATCHES
11
11
  // to the CURRENTLY-active backend session (Modal or selfhosted).
12
12
  //
13
- // The contract (dossier §10.3):
13
+ // The contract:
14
14
  // - ONE stable object implementing the `SandboxSessionLike` structural surface.
15
15
  // - On EVERY op, re-read `(activeSandboxId, activeEpoch)` via `readPointer`.
16
16
  // - Cache the resolved backend session keyed by `activeEpoch`; when the epoch
@@ -58,6 +58,7 @@ export interface RoutableBackendSession {
58
58
  exec?(args: unknown): Promise<unknown>;
59
59
  execCommand?(args: unknown): Promise<string>;
60
60
  writeStdin?(args: unknown): Promise<string>;
61
+ cancelExecCommand?(opId: string): Promise<boolean>;
61
62
  readFile?(args: unknown): Promise<string | Uint8Array>;
62
63
  writeFile?(args: unknown): Promise<unknown>;
63
64
  createEditor?(runAs?: string): unknown;
@@ -430,6 +431,13 @@ export class RoutingSandboxSession implements RoutableBackendSession {
430
431
  });
431
432
  }
432
433
 
434
+ async cancelExecCommand(opId: string): Promise<boolean> {
435
+ return await this.dispatch("cancelExecCommand", async (session) => {
436
+ if (!session.cancelExecCommand) return false;
437
+ return await session.cancelExecCommand(opId);
438
+ });
439
+ }
440
+
433
441
  async readFile(args: unknown): Promise<string | Uint8Array> {
434
442
  return this.dispatch("readFile", async (s) => {
435
443
  if (!s.readFile) {