@parcha/agentrun-computer 0.1.0-beta.33 → 0.1.0-beta.34
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/README.md +169 -15
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +6 -3
- package/dist/browserbase.d.ts +3 -1
- package/dist/browserbase.js +3 -1
- package/dist/child.d.ts +2 -0
- package/dist/child.js +13 -2
- package/dist/chrome.d.ts +73 -0
- package/dist/chrome.js +224 -0
- package/dist/computerd-linux-amd64 +0 -0
- package/dist/computerd-linux-arm64 +0 -0
- package/dist/conformance/cases/gpu.d.ts +2 -0
- package/dist/conformance/cases/gpu.js +108 -0
- package/dist/conformance/cases/health.js +83 -3
- package/dist/conformance/cases/index.js +2 -0
- package/dist/conformance/cases/mount.d.ts +8 -1
- package/dist/conformance/cases/mount.js +4 -3
- package/dist/conformance/cases/provider.js +14 -0
- package/dist/conformance/cli.js +46 -7
- package/dist/conformance/local.d.ts +30 -0
- package/dist/conformance/local.js +36 -0
- package/dist/conformance/report.js +10 -5
- package/dist/conformance/runner.js +45 -13
- package/dist/conformance/types.d.ts +63 -16
- package/dist/daytona.d.ts +32 -3
- package/dist/daytona.js +96 -24
- package/dist/docker.d.ts +3 -1
- package/dist/docker.js +11 -3
- package/dist/drift.d.ts +3 -1
- package/dist/drift.js +9 -0
- package/dist/e2b.d.ts +3 -1
- package/dist/e2b.js +7 -4
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/dist/isolation.d.ts +0 -2
- package/dist/isolation.js +0 -16
- package/dist/kernel.d.ts +3 -1
- package/dist/kernel.js +3 -1
- package/dist/kinds.d.ts +10 -4
- package/dist/kinds.js +26 -6
- package/dist/labels.d.ts +6 -0
- package/dist/labels.js +26 -1
- package/dist/local-supervisor.d.ts +51 -0
- package/dist/local-supervisor.js +221 -0
- package/dist/local.d.ts +89 -0
- package/dist/local.js +472 -0
- package/dist/modal.d.ts +31 -4
- package/dist/modal.js +90 -30
- package/dist/orgo.d.ts +3 -1
- package/dist/orgo.js +14 -27
- package/dist/phone-harness.d.ts +3 -1
- package/dist/phone-harness.js +7 -4
- package/dist/protocol.d.ts +20 -0
- package/dist/protocol.js +9 -0
- package/dist/provider.d.ts +63 -3
- package/dist/provider.js +28 -0
- package/dist/providers.d.ts +7 -1
- package/dist/providers.js +1 -0
- package/package.json +1 -1
package/dist/provider.js
CHANGED
|
@@ -35,3 +35,31 @@ export function checkLifetime(lifetimeMs, { lifetime, maxLifetimeMs }) {
|
|
|
35
35
|
}
|
|
36
36
|
return [];
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* The one GPU rule every provider's check() shares, with no vendor call: no spec.gpu is no refusal; one given is an
|
|
40
|
+
* object of a declared type (capabilities().gpu.types) and a whole count from 1 to capabilities().gpu.max; a provider
|
|
41
|
+
* that declares no gpu refuses any. With `mount`, the spec's as given, a GPU computer takes only the kinds gpu.mounts
|
|
42
|
+
* names, where it names them. Serve's claim and readiness read the same rule, so a refusal reads alike wherever it is met.
|
|
43
|
+
*/
|
|
44
|
+
export function checkGpu(gpu, { gpu: offered }, mount) {
|
|
45
|
+
if (gpu === undefined)
|
|
46
|
+
return [];
|
|
47
|
+
const refuse = (message) => [{ field: "gpu", message }];
|
|
48
|
+
if (offered === undefined)
|
|
49
|
+
return refuse("this provider offers no GPU: ask a provider that declares one (capabilities().gpu) for a GPU computer");
|
|
50
|
+
if (typeof gpu !== "object" || gpu === null || Array.isArray(gpu))
|
|
51
|
+
return refuse("gpu is { type, count }: a GPU type this provider declares, and how many");
|
|
52
|
+
const { type, count } = gpu;
|
|
53
|
+
const types = offered.types.join(", ");
|
|
54
|
+
if (typeof type !== "string" || !offered.types.includes(type))
|
|
55
|
+
return refuse(`gpu.type ${JSON.stringify(type)} is not one this provider offers: ${types}`);
|
|
56
|
+
if (!Number.isSafeInteger(count) || count < 1 || count > offered.max) {
|
|
57
|
+
return refuse(`gpu.count ${JSON.stringify(count)} is not a whole number from 1 to ${offered.max}, the most GPUs this provider gives one computer`);
|
|
58
|
+
}
|
|
59
|
+
// A mount that is not an object with a kind (null among them) is checkMount's refusal; nothing is read from it here.
|
|
60
|
+
const kind = typeof mount === "object" && mount !== null ? mount.kind : undefined;
|
|
61
|
+
if (kind !== undefined && offered.mounts !== undefined && !offered.mounts.includes(kind)) {
|
|
62
|
+
return refuse(`a GPU computer here takes no ${String(kind)} mount: it is not proven on this provider's GPU computers yet; ask for a GPU computer without a mount, or a mount without a GPU`);
|
|
63
|
+
}
|
|
64
|
+
return [];
|
|
65
|
+
}
|
package/dist/providers.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RunFolder } from "./conformance/types.js";
|
|
2
2
|
import type { KindCapabilities } from "./kinds.js";
|
|
3
3
|
import type { MountKind } from "./mount.js";
|
|
4
|
-
import type { ComputerProvider } from "./provider.js";
|
|
4
|
+
import type { ComputerProvider, NetworkForm } from "./provider.js";
|
|
5
5
|
/** Where the conformance side reads its settings: process.env, or a record of the same shape. */
|
|
6
6
|
export type ProviderEnv = Readonly<Record<string, string | undefined>>;
|
|
7
7
|
/**
|
|
@@ -29,6 +29,11 @@ export interface ProviderModule {
|
|
|
29
29
|
* provider binds a local folder from the registry alone, without building one.
|
|
30
30
|
*/
|
|
31
31
|
readonly MOUNT: readonly MountKind[];
|
|
32
|
+
/**
|
|
33
|
+
* The network forms its computers make, the same as its provider's capabilities().network: a caller tells which
|
|
34
|
+
* provider takes an allowlist, or runs only on the vendor's own network, from the registry alone.
|
|
35
|
+
*/
|
|
36
|
+
readonly NETWORK: readonly NetworkForm[];
|
|
32
37
|
/**
|
|
33
38
|
* The machine kind and groups of each configuration it offers, as its built providers' capabilities() declare them:
|
|
34
39
|
* the kind registry's entry for it (PROVIDERS in kinds.ts) holds the same, and derives its setting kinds from them.
|
|
@@ -53,6 +58,7 @@ export declare const providers: {
|
|
|
53
58
|
e2b: () => Promise<typeof import("./e2b.js")>;
|
|
54
59
|
browserbase: () => Promise<typeof import("./browserbase.js")>;
|
|
55
60
|
kernel: () => Promise<typeof import("./kernel.js")>;
|
|
61
|
+
local: () => Promise<typeof import("./local.js")>;
|
|
56
62
|
"phone-harness": () => Promise<typeof import("./phone-harness.js")>;
|
|
57
63
|
orgo: () => Promise<typeof import("./orgo.js")>;
|
|
58
64
|
};
|
package/dist/providers.js
CHANGED
|
@@ -5,6 +5,7 @@ export const providers = {
|
|
|
5
5
|
e2b: () => import("./e2b.js"),
|
|
6
6
|
browserbase: () => import("./browserbase.js"),
|
|
7
7
|
kernel: () => import("./kernel.js"),
|
|
8
|
+
local: () => import("./local.js"),
|
|
8
9
|
"phone-harness": () => import("./phone-harness.js"),
|
|
9
10
|
orgo: () => import("./orgo.js"),
|
|
10
11
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parcha/agentrun-computer",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.34",
|
|
4
4
|
"description": "The open platform's computer protocol: a daemon in every computer, and one provisioner per vendor, starting with Docker.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agentrun",
|