@opengeni/runtime 0.6.1 → 0.7.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.
- package/dist/{chunk-DYBF7ZEB.js → chunk-RYDCVTMW.js} +1958 -207
- package/dist/chunk-RYDCVTMW.js.map +1 -0
- package/dist/{index-BTo_bZvN.d.ts → index-DIiiwQY2.d.ts} +689 -52
- package/dist/index.d.ts +296 -123
- package/dist/index.js +1907 -809
- package/dist/index.js.map +1 -1
- package/dist/sandbox/index.d.ts +1 -1
- package/dist/sandbox/index.js +79 -3
- package/package.json +21 -20
- package/src/codex-tool-search.ts +185 -31
- package/src/context-compaction.ts +78 -243
- package/src/history-sanitizer.ts +172 -20
- package/src/index.ts +2687 -920
- package/src/metrics.ts +28 -2
- package/src/sandbox/capabilities.ts +12 -3
- package/src/sandbox/channel-a.ts +420 -72
- package/src/sandbox/display-stack.ts +18 -4
- package/src/sandbox/errors.ts +13 -0
- package/src/sandbox/index.ts +398 -112
- package/src/sandbox/op-correlation.ts +70 -0
- package/src/sandbox/providers/index.ts +9 -3
- package/src/sandbox/providers/modal.ts +84 -14
- package/src/sandbox/providers/selfhosted.ts +1 -4
- package/src/sandbox/recording.ts +146 -90
- package/src/sandbox/routing/backend-resolver.ts +144 -10
- package/src/sandbox/routing/routing-session.ts +129 -25
- package/src/sandbox/select.ts +60 -8
- package/src/sandbox/selfhosted/capabilities.ts +59 -25
- package/src/sandbox/selfhosted/control-rpc.ts +160 -28
- package/src/sandbox/selfhosted/fault-rendering.ts +226 -0
- package/src/sandbox/selfhosted/op-observer.ts +54 -0
- package/src/sandbox/selfhosted/op-stream.ts +801 -0
- package/src/sandbox/selfhosted/op-testing.ts +468 -0
- package/src/sandbox/selfhosted/op-transport.ts +151 -0
- package/src/sandbox/selfhosted/retry-policy.ts +177 -0
- package/src/sandbox/selfhosted/session.ts +498 -55
- package/src/sandbox/selfhosted/testing.ts +60 -19
- package/src/sandbox/stream-port.ts +17 -5
- package/src/sandbox/stream-token.ts +8 -2
- package/src/sandbox/terminal-server.ts +18 -4
- package/src/sandbox-computer.ts +332 -70
- package/src/usage-telemetry.ts +73 -0
- package/dist/chunk-DYBF7ZEB.js.map +0 -1
- package/src/image-history.ts +0 -149
- package/src/screenshot-omitted-card.ts +0 -15
package/src/metrics.ts
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
export type RuntimeMetricsHooks = {
|
|
2
|
-
onModelCall?: (input: {
|
|
3
|
-
|
|
2
|
+
onModelCall?: (input: {
|
|
3
|
+
provider: string;
|
|
4
|
+
outcome: "completed" | "failed";
|
|
5
|
+
durationSeconds: number;
|
|
6
|
+
}) => void;
|
|
7
|
+
onSandboxCreate?: (input: {
|
|
8
|
+
backend: string;
|
|
9
|
+
outcome: "completed" | "failed";
|
|
10
|
+
durationSeconds: number;
|
|
11
|
+
}) => void;
|
|
4
12
|
onSandboxWarmingTimeout?: (input: { backend: string }) => void;
|
|
13
|
+
/**
|
|
14
|
+
* One completed Connected Machine (selfhosted) control op — the out-of-band
|
|
15
|
+
* telemetry twin of the in-band fault rendering. `code` is the typed wire-code
|
|
16
|
+
* NAME on a failure (bounded label cardinality); `healed` marks a success that
|
|
17
|
+
* only landed after ≥1 retry (the leading indicator of the next unhealed fault);
|
|
18
|
+
* `replyBytes` is set only on a payload-wall fault. Wired from the runtime's
|
|
19
|
+
* `SelfhostedOpObserver` seam.
|
|
20
|
+
*/
|
|
21
|
+
onSandboxOp?: (input: {
|
|
22
|
+
backend: string;
|
|
23
|
+
op: string;
|
|
24
|
+
outcome: "ok" | "failed";
|
|
25
|
+
code?: string;
|
|
26
|
+
healed: boolean;
|
|
27
|
+
retries: number;
|
|
28
|
+
durationSeconds: number;
|
|
29
|
+
replyBytes?: number;
|
|
30
|
+
}) => void;
|
|
5
31
|
};
|
|
@@ -35,20 +35,29 @@ export function assertDescriptorRegistryInvariants(): void {
|
|
|
35
35
|
|
|
36
36
|
// DesktopStream implies a non-"none" port-exposure mechanism (split-plane B
|
|
37
37
|
// needs a way to surface 6080 to a viewer).
|
|
38
|
-
if (
|
|
38
|
+
if (
|
|
39
|
+
descriptor.capabilities.DesktopStream.available &&
|
|
40
|
+
descriptor.portExposure.kind === "none"
|
|
41
|
+
) {
|
|
39
42
|
throw new Error(`"${backend}" claims DesktopStream but portExposure.kind=none`);
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
// DesktopStream implies a transport, and a desktop transport implies the
|
|
43
46
|
// capability is available (no half-declared desktop rows).
|
|
44
|
-
if (
|
|
47
|
+
if (
|
|
48
|
+
descriptor.capabilities.DesktopStream.available &&
|
|
49
|
+
descriptor.capabilities.DesktopStream.transport === null
|
|
50
|
+
) {
|
|
45
51
|
throw new Error(`"${backend}" claims DesktopStream but transport is null`);
|
|
46
52
|
}
|
|
47
53
|
|
|
48
54
|
// Recording feasibility is the same Xvfb display as DesktopStream: a desktop
|
|
49
55
|
// backend MUST be able to x11grab; a non-desktop backend MUST NOT claim it
|
|
50
56
|
// (Recording.available == DesktopStream.available && os==linux — Part D).
|
|
51
|
-
if (
|
|
57
|
+
if (
|
|
58
|
+
descriptor.capabilities.DesktopStream.available !==
|
|
59
|
+
descriptor.capabilities.Recording.available
|
|
60
|
+
) {
|
|
52
61
|
throw new Error(
|
|
53
62
|
`"${backend}" Recording.available (${descriptor.capabilities.Recording.available}) must equal DesktopStream.available (${descriptor.capabilities.DesktopStream.available})`,
|
|
54
63
|
);
|