sandboxedjs 0.1.51 → 0.1.53

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/agent.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as Container } from './container-Dg8NwBc7.cjs';
1
+ import { C as Container } from './container-B--ykWn3.cjs';
2
2
  import './vfs-DzEcPbMY.cjs';
3
3
 
4
4
  /**
package/dist/agent.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as Container } from './container-DBMPLbUu.js';
1
+ import { C as Container } from './container-BSW6jjlq.js';
2
2
  import './vfs-DzEcPbMY.js';
3
3
 
4
4
  /**
@@ -1053,7 +1053,7 @@ declare class Shell {
1053
1053
  declare const MANIFEST_FORMAT = "sandboxedjs-python-runtime";
1054
1054
  declare const MANIFEST_SCHEMA_VERSION = 1;
1055
1055
  /** Build profiles, as defined in docs/python/architecture.md. */
1056
- type PythonProfile = "core" | "threaded-fixed" | "threaded-dynamic";
1056
+ type PythonProfile = "core" | "threaded-fixed" | "dynamic";
1057
1057
  interface PythonCapabilities {
1058
1058
  /** Real Python threads. `core` builds have none, and must say so. */
1059
1059
  threads: boolean;
@@ -1101,6 +1101,54 @@ interface PythonRuntimeManifest {
1101
1101
  */
1102
1102
  declare function validateManifest(value: unknown): PythonRuntimeManifest;
1103
1103
 
1104
+ /**
1105
+ * Dependency resolution for the owned Python runtime.
1106
+ *
1107
+ * The installer this replaces walked candidate versions and downloaded a whole
1108
+ * wheel for each one just to read its `METADATA`. That is why it needed an
1109
+ * arbitrary cap on how many candidates it would try: without one, discovering
1110
+ * that a package's last forty releases all need the same unavailable native
1111
+ * extension cost forty multi-megabyte downloads, and the install looked hung
1112
+ * rather than failed. The cap made the symptom bearable and the cause worse --
1113
+ * a resolution that hit it reported a limit rather than the conflict, and a
1114
+ * legitimately deep graph failed for no reason.
1115
+ *
1116
+ * Three changes remove the need for it:
1117
+ *
1118
+ * * Dependency metadata is read from PEP 658 sidecars, so learning what a
1119
+ * release requires costs a few kilobytes rather than the wheel.
1120
+ * * Constraints propagate. A version excluded by an already-chosen package's
1121
+ * requirement is never fetched at all.
1122
+ * * Conflicts are learned. When a set of constraints proves unsatisfiable,
1123
+ * the proof is recorded, so the same subtree is not re-derived once per
1124
+ * parent version.
1125
+ *
1126
+ * What bounds the work now is a deadline and a cancellation signal, which are
1127
+ * honest limits: they say the search ran out of time, not that it ran out of
1128
+ * an arbitrary allowance.
1129
+ */
1130
+
1131
+ /**
1132
+ * One prebuilt SandboxedJs wheel, as published in a wheel index.
1133
+ *
1134
+ * `abiId` travels with the entry rather than being implied by the index it
1135
+ * came from. An index served for a different interpreter build would otherwise
1136
+ * look usable, and the wheel would fail at import rather than at resolution.
1137
+ */
1138
+ interface PrebuiltWheel {
1139
+ name: string;
1140
+ version: string;
1141
+ filename: string;
1142
+ sha256: string;
1143
+ abiId: string;
1144
+ requires: string[];
1145
+ }
1146
+ interface WheelIndex {
1147
+ /** Where `filename` is resolved against. */
1148
+ baseUrl: string;
1149
+ wheels: PrebuiltWheel[];
1150
+ }
1151
+
1104
1152
  /**
1105
1153
  * Which Python backend a container uses.
1106
1154
  *
@@ -1178,6 +1226,14 @@ interface PythonOptions {
1178
1226
  manifest?: PythonRuntimeManifest;
1179
1227
  /** Where the built process worker is served from, for hosts that must say. */
1180
1228
  workerUrl?: string;
1229
+ /**
1230
+ * Prebuilt wheels for this runtime's native ABI, which PyPI does not carry.
1231
+ *
1232
+ * Either the index itself, or the base URL its `index.json` is served from.
1233
+ * A package with a compiled extension cannot resolve without one, because
1234
+ * no published wheel targets wasm32-emscripten.
1235
+ */
1236
+ wheelIndex?: WheelIndex | string | null;
1181
1237
  }
1182
1238
  declare function configurePython(options?: PythonOptions): void;
1183
1239
  declare const isPythonAvailable: typeof isCPythonAvailable;
@@ -1053,7 +1053,7 @@ declare class Shell {
1053
1053
  declare const MANIFEST_FORMAT = "sandboxedjs-python-runtime";
1054
1054
  declare const MANIFEST_SCHEMA_VERSION = 1;
1055
1055
  /** Build profiles, as defined in docs/python/architecture.md. */
1056
- type PythonProfile = "core" | "threaded-fixed" | "threaded-dynamic";
1056
+ type PythonProfile = "core" | "threaded-fixed" | "dynamic";
1057
1057
  interface PythonCapabilities {
1058
1058
  /** Real Python threads. `core` builds have none, and must say so. */
1059
1059
  threads: boolean;
@@ -1101,6 +1101,54 @@ interface PythonRuntimeManifest {
1101
1101
  */
1102
1102
  declare function validateManifest(value: unknown): PythonRuntimeManifest;
1103
1103
 
1104
+ /**
1105
+ * Dependency resolution for the owned Python runtime.
1106
+ *
1107
+ * The installer this replaces walked candidate versions and downloaded a whole
1108
+ * wheel for each one just to read its `METADATA`. That is why it needed an
1109
+ * arbitrary cap on how many candidates it would try: without one, discovering
1110
+ * that a package's last forty releases all need the same unavailable native
1111
+ * extension cost forty multi-megabyte downloads, and the install looked hung
1112
+ * rather than failed. The cap made the symptom bearable and the cause worse --
1113
+ * a resolution that hit it reported a limit rather than the conflict, and a
1114
+ * legitimately deep graph failed for no reason.
1115
+ *
1116
+ * Three changes remove the need for it:
1117
+ *
1118
+ * * Dependency metadata is read from PEP 658 sidecars, so learning what a
1119
+ * release requires costs a few kilobytes rather than the wheel.
1120
+ * * Constraints propagate. A version excluded by an already-chosen package's
1121
+ * requirement is never fetched at all.
1122
+ * * Conflicts are learned. When a set of constraints proves unsatisfiable,
1123
+ * the proof is recorded, so the same subtree is not re-derived once per
1124
+ * parent version.
1125
+ *
1126
+ * What bounds the work now is a deadline and a cancellation signal, which are
1127
+ * honest limits: they say the search ran out of time, not that it ran out of
1128
+ * an arbitrary allowance.
1129
+ */
1130
+
1131
+ /**
1132
+ * One prebuilt SandboxedJs wheel, as published in a wheel index.
1133
+ *
1134
+ * `abiId` travels with the entry rather than being implied by the index it
1135
+ * came from. An index served for a different interpreter build would otherwise
1136
+ * look usable, and the wheel would fail at import rather than at resolution.
1137
+ */
1138
+ interface PrebuiltWheel {
1139
+ name: string;
1140
+ version: string;
1141
+ filename: string;
1142
+ sha256: string;
1143
+ abiId: string;
1144
+ requires: string[];
1145
+ }
1146
+ interface WheelIndex {
1147
+ /** Where `filename` is resolved against. */
1148
+ baseUrl: string;
1149
+ wheels: PrebuiltWheel[];
1150
+ }
1151
+
1104
1152
  /**
1105
1153
  * Which Python backend a container uses.
1106
1154
  *
@@ -1178,6 +1226,14 @@ interface PythonOptions {
1178
1226
  manifest?: PythonRuntimeManifest;
1179
1227
  /** Where the built process worker is served from, for hosts that must say. */
1180
1228
  workerUrl?: string;
1229
+ /**
1230
+ * Prebuilt wheels for this runtime's native ABI, which PyPI does not carry.
1231
+ *
1232
+ * Either the index itself, or the base URL its `index.json` is served from.
1233
+ * A package with a compiled extension cannot resolve without one, because
1234
+ * no published wheel targets wasm32-emscripten.
1235
+ */
1236
+ wheelIndex?: WheelIndex | string | null;
1181
1237
  }
1182
1238
  declare function configurePython(options?: PythonOptions): void;
1183
1239
  declare const isPythonAvailable: typeof isCPythonAvailable;