@opengeni/runtime 0.2.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 (65) hide show
  1. package/dist/chunk-2PO56VAL.js +3478 -0
  2. package/dist/chunk-2PO56VAL.js.map +1 -0
  3. package/dist/index.d.ts +912 -0
  4. package/dist/index.js +3663 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/sandbox/index.d.ts +1738 -0
  7. package/dist/sandbox/index.js +187 -0
  8. package/dist/sandbox/index.js.map +1 -0
  9. package/package.json +49 -0
  10. package/src/bundled_hashicorp_terraform_skills/LICENSE +373 -0
  11. package/src/bundled_hashicorp_terraform_skills/README.md +18 -0
  12. package/src/bundled_hashicorp_terraform_skills/UPSTREAM_GIT_SHA +1 -0
  13. package/src/bundled_hashicorp_terraform_skills/azure-verified-modules/SKILL.md +613 -0
  14. package/src/bundled_hashicorp_terraform_skills/checkov/SKILL.md +43 -0
  15. package/src/bundled_hashicorp_terraform_skills/refactor-module/SKILL.md +538 -0
  16. package/src/bundled_hashicorp_terraform_skills/social-media-marketing/SKILL.md +35 -0
  17. package/src/bundled_hashicorp_terraform_skills/terraform-search-import/SKILL.md +372 -0
  18. package/src/bundled_hashicorp_terraform_skills/terraform-search-import/references/MANUAL-IMPORT.md +113 -0
  19. package/src/bundled_hashicorp_terraform_skills/terraform-search-import/scripts/list_resources.sh +38 -0
  20. package/src/bundled_hashicorp_terraform_skills/terraform-stacks/SKILL.md +480 -0
  21. package/src/bundled_hashicorp_terraform_skills/terraform-stacks/references/api-monitoring.md +543 -0
  22. package/src/bundled_hashicorp_terraform_skills/terraform-stacks/references/component-blocks.md +476 -0
  23. package/src/bundled_hashicorp_terraform_skills/terraform-stacks/references/deployment-blocks.md +391 -0
  24. package/src/bundled_hashicorp_terraform_skills/terraform-stacks/references/examples.md +1529 -0
  25. package/src/bundled_hashicorp_terraform_skills/terraform-stacks/references/linked-stacks.md +187 -0
  26. package/src/bundled_hashicorp_terraform_skills/terraform-stacks/references/troubleshooting.md +671 -0
  27. package/src/bundled_hashicorp_terraform_skills/terraform-style-guide/SKILL.md +353 -0
  28. package/src/bundled_hashicorp_terraform_skills/terraform-test/SKILL.md +451 -0
  29. package/src/bundled_hashicorp_terraform_skills/terraform-test/references/CI_CD.md +80 -0
  30. package/src/bundled_hashicorp_terraform_skills/terraform-test/references/EXAMPLES.md +314 -0
  31. package/src/bundled_hashicorp_terraform_skills/terraform-test/references/MOCK_PROVIDERS.md +171 -0
  32. package/src/codex-tool-search.ts +267 -0
  33. package/src/context-compaction.ts +538 -0
  34. package/src/history-sanitizer.ts +719 -0
  35. package/src/index.ts +3299 -0
  36. package/src/sandbox/capabilities.ts +69 -0
  37. package/src/sandbox/channel-a.ts +1031 -0
  38. package/src/sandbox/display-stack.ts +231 -0
  39. package/src/sandbox/errors.ts +34 -0
  40. package/src/sandbox/index.ts +832 -0
  41. package/src/sandbox/providers/blaxel.ts +35 -0
  42. package/src/sandbox/providers/cloudflare.ts +24 -0
  43. package/src/sandbox/providers/daytona.ts +34 -0
  44. package/src/sandbox/providers/docker.ts +17 -0
  45. package/src/sandbox/providers/e2b.ts +36 -0
  46. package/src/sandbox/providers/index.ts +107 -0
  47. package/src/sandbox/providers/local.ts +13 -0
  48. package/src/sandbox/providers/modal.ts +55 -0
  49. package/src/sandbox/providers/none.ts +13 -0
  50. package/src/sandbox/providers/runloop.ts +32 -0
  51. package/src/sandbox/providers/selfhosted.ts +96 -0
  52. package/src/sandbox/providers/types.ts +38 -0
  53. package/src/sandbox/providers/vercel.ts +29 -0
  54. package/src/sandbox/recording.ts +286 -0
  55. package/src/sandbox/routing/backend-resolver.ts +189 -0
  56. package/src/sandbox/routing/routing-session.ts +455 -0
  57. package/src/sandbox/select.ts +371 -0
  58. package/src/sandbox/selfhosted/capabilities.ts +255 -0
  59. package/src/sandbox/selfhosted/control-rpc.ts +351 -0
  60. package/src/sandbox/selfhosted/session.ts +930 -0
  61. package/src/sandbox/selfhosted/testing.ts +230 -0
  62. package/src/sandbox/stream-port.ts +185 -0
  63. package/src/sandbox/stream-token.ts +90 -0
  64. package/src/sandbox/terminal-server.ts +203 -0
  65. package/src/sandbox-computer.ts +835 -0
@@ -0,0 +1,69 @@
1
+ // Capability-descriptor access + boot-time registry invariants (module 03 §2.3).
2
+ //
3
+ // The CapabilityDescriptor type and the CAPABILITY_DESCRIPTORS table-as-data
4
+ // live in @opengeni/contracts (NOT here) so config can read them without an
5
+ // import cycle through runtime (ledger CR8). This module re-exports them for the
6
+ // registry's convenience and owns the boot-time self-test that keeps the table
7
+ // honest as providers are added.
8
+
9
+ import {
10
+ CAPABILITY_DESCRIPTORS,
11
+ DESKTOP_STREAM_PORT,
12
+ SandboxBackend,
13
+ type CapabilityDescriptor,
14
+ } from "@opengeni/contracts";
15
+
16
+ export { CAPABILITY_DESCRIPTORS, DESKTOP_STREAM_PORT };
17
+ export type { CapabilityDescriptor };
18
+
19
+ /**
20
+ * Descriptor-table invariants, asserted once at registry build (and from a unit
21
+ * test). This is the guardrail that keeps the static matrix internally coherent.
22
+ * It validates the descriptor data only; the descriptor.backendId === SDK
23
+ * client.backendId assertion (the deferred-from-P0.1 check) lives in
24
+ * providers/index.ts because it must construct the real SDK clients.
25
+ */
26
+ export function assertDescriptorRegistryInvariants(): void {
27
+ for (const backend of SandboxBackend.options) {
28
+ const descriptor = CAPABILITY_DESCRIPTORS[backend];
29
+ if (!descriptor) {
30
+ throw new Error(`No CapabilityDescriptor for backend "${backend}"`);
31
+ }
32
+ if (descriptor.backend !== backend) {
33
+ throw new Error(`Descriptor.backend mismatch for "${backend}" (got "${descriptor.backend}")`);
34
+ }
35
+
36
+ // DesktopStream implies a non-"none" port-exposure mechanism (split-plane B
37
+ // needs a way to surface 6080 to a viewer).
38
+ if (descriptor.capabilities.DesktopStream.available && descriptor.portExposure.kind === "none") {
39
+ throw new Error(`"${backend}" claims DesktopStream but portExposure.kind=none`);
40
+ }
41
+
42
+ // DesktopStream implies a transport, and a desktop transport implies the
43
+ // capability is available (no half-declared desktop rows).
44
+ if (descriptor.capabilities.DesktopStream.available && descriptor.capabilities.DesktopStream.transport === null) {
45
+ throw new Error(`"${backend}" claims DesktopStream but transport is null`);
46
+ }
47
+
48
+ // Recording feasibility is the same Xvfb display as DesktopStream: a desktop
49
+ // backend MUST be able to x11grab; a non-desktop backend MUST NOT claim it
50
+ // (Recording.available == DesktopStream.available && os==linux — Part D).
51
+ if (descriptor.capabilities.DesktopStream.available !== descriptor.capabilities.Recording.available) {
52
+ throw new Error(
53
+ `"${backend}" Recording.available (${descriptor.capabilities.Recording.available}) must equal DesktopStream.available (${descriptor.capabilities.DesktopStream.available})`,
54
+ );
55
+ }
56
+
57
+ // Persistable backends are the only ones the lease can re-establish from an
58
+ // envelope — they must carry a real snapshot mechanism.
59
+ if (descriptor.persistable && descriptor.snapshot.kind === "none") {
60
+ throw new Error(`"${backend}" persistable but snapshot.kind=none`);
61
+ }
62
+
63
+ // A nativeBucketMount backend must be desktop/headless-tier real (modal):
64
+ // a dev/none tier cannot own a provider bucket mount.
65
+ if (descriptor.nativeBucketMount && (descriptor.tier === "dev" || descriptor.tier === "none")) {
66
+ throw new Error(`"${backend}" claims nativeBucketMount on tier=${descriptor.tier}`);
67
+ }
68
+ }
69
+ }