ffp-sql-sandbox 0.1.0 → 0.1.2

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/INTEGRATION.md CHANGED
@@ -1,37 +1,37 @@
1
- # Integrating ffp-sql-sandbox with ChuTingzj/ai-bi
1
+ # Integrating ffp-sql-sandbox
2
2
 
3
- This repository does **not** wire the library into [ChuTingzj/ai-bi](https://github.com/ChuTingzj/ai-bi). Keep that as a follow-up PR in ai-bi after this package is a real dependency, tests are green, and there are no P0s.
3
+ This repository ships **library primitives only**. It does not embed a product UI, Nest module, or connection catalog. Wire `validateSql` / `executeSql` in the host application after this package is a real dependency, tests are green, and there are no P0s.
4
4
 
5
5
  ## Adapter shape
6
6
 
7
- Keep NestJS, `CryptoService`, and `DataSource` inside ai-bi. Do not leak those types into this library.
7
+ Keep framework DI, secret decryption, and ORM / data-source types in the host app. Do not leak those types into this library.
8
8
 
9
- Suggested adapter (ai-bi `SandboxService`):
9
+ Suggested host adapter:
10
10
 
11
- 1. Decrypt `dataSource.password` with the existing `CryptoService`.
11
+ 1. Decrypt the database password with the host app’s secret store.
12
12
  2. Call `validateSql` / `executeSql` from `ffp-sql-sandbox`.
13
- 3. Map `{ ok: true, data }` → the current `SandboxResult` / `QueryResult` shape (`success` / `columns`+`rows`).
13
+ 3. Map `{ ok: true, data }` → the host app’s query-result shape (`success` / `columns`+`rows`).
14
14
  4. Map `{ ok: false, code, error }` → `{ success: false, error }`.
15
15
 
16
- ## Host rewrite stays in ai-bi
16
+ ## Host rewrite stays in the caller
17
17
 
18
18
  `resolveSandboxDbHost` is **not** a public export of this package (on purpose).
19
19
 
20
- ai-bi may keep its private loopback → `host.docker.internal` helper for its own tests and Docker-on-Linux setups. If the adapter rewrites the host *before* calling `executeSql`, put the rewritten name on `hostAllowlist` as well.
20
+ The host app may keep a private loopback → `host.docker.internal` helper for its own tests and Docker-on-Linux setups. If the adapter rewrites the host *before* calling `executeSql`, put the rewritten name on `hostAllowlist` as well.
21
21
 
22
22
  Alternatively, pass the original host (`localhost`, `db.internal`, …) in `connection.host`, allowlist **that** name, and let this library apply a private rewrite after the allowlist check. Either way, user-controlled hosts must not bypass `hostAllowlist`.
23
23
 
24
- ## What not to copy from the old sandbox
24
+ ## What not to copy from a naive Docker sandbox
25
25
 
26
- | Old ai-bi behavior | v1 library |
26
+ | Naive sandbox | v1 library |
27
27
  | --- | --- |
28
- | `DB_PASS` / password in container `Env` | Forbidden. Password goes to tmpfs `/run/secrets/db_password`. |
28
+ | Password in container `Env` (`DB_PASS`, `PGPASSWORD`, …) | Forbidden. Password goes to tmpfs `/run/secrets/db_password`. |
29
29
  | `Cmd: [sql]` | SQL on stdin JSON. |
30
- | Floating `SANDBOX_IMAGE=ai-bi-sandbox:latest` | Default image digest-pinned; custom `image` is untrusted. |
30
+ | Floating image tag (`:latest`) | Default image digest-pinned; custom `image` is untrusted. |
31
31
  | Configurable validator prefixes/patterns | Not exposed. `validateSql(sql)` only. |
32
32
  | Wait for container + `logs()` then parse/truncate | Streaming attach; `maxRows` / `maxBytes` applied as data arrives. |
33
33
  | Regex as the security proof | Documented as fail-fast only. Proof is RO role + limits + allowlist. |
34
34
 
35
35
  ## Image
36
36
 
37
- Build `sandbox/Dockerfile` from this repo (or pull the published digest) and configure ai-bi to use `DEFAULT_SANDBOX_IMAGE` or an explicit digest-pinned ref. Do not default to `:latest`.
37
+ Build `sandbox/Dockerfile` from this repo (or pull the published digest) and configure the host app to use `DEFAULT_SANDBOX_IMAGE` or an explicit digest-pinned ref. Do not default to `:latest`.
package/README.md CHANGED
@@ -1,24 +1,48 @@
1
1
  # ffp-sql-sandbox
2
2
 
3
- Read-only SQL sandbox primitives for Node.js: fail-fast `validateSql` plus one-shot Docker `executeSql` with hard resource, row, byte, timeout, and host-allowlist limits.
3
+ **From First Principle** when an LLM (or any untrusted caller) wants to run SQL, don’t trust a clever prompt. Trust a small set of checks you can name, test, and refuse to weaken.
4
4
 
5
- This is the v1 library extracted from the sandbox ideas in [ChuTingzj/ai-bi](https://github.com/ChuTingzj/ai-bi) (`validateSql` + dockerode one-shot container) and redesigned around a stricter security model. It is **not** wired into ai-bi in this repository — see [INTEGRATION.md](./INTEGRATION.md).
6
-
7
- ## Install
5
+ `ffp-sql-sandbox` is a Node.js library for **read-only SQL execution with hard limits**: a fail-fast `validateSql`, plus a one-shot Docker `executeSql` that enforces resource caps, dual timeouts, streaming row/byte ceilings, and a required host allowlist.
8
6
 
9
7
  ```bash
10
8
  pnpm add ffp-sql-sandbox
11
9
  ```
12
10
 
13
- Docker is a **hard dependency** of `executeSql`. If the engine cannot be pinged, the call fails with `DOCKER_UNAVAILABLE` rather than falling back to in-process SQL.
11
+ Package: [npmjs.com/package/ffp-sql-sandbox](https://www.npmjs.com/package/ffp-sql-sandbox) · Org: [FFP Tech Lab](https://github.com/FFP-Tech-Lab)
14
12
 
15
- Build the runner image from `sandbox/Dockerfile` (digest-pinned `FROM`) and either publish it at the default ref below or pass `image` (untrusted override).
13
+ ---
16
14
 
17
- ```bash
18
- docker build -t ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner:v1 ./sandbox
19
- ```
15
+ ## Why this exists
16
+
17
+ Most “AI → SQL” stacks fail the same way: the model produces a string, something runs it, and safety is a pile of regexes plus hope. That feels productive until the first write, SSRF, or unbounded result set.
18
+
19
+ We built this library around a different bet:
20
+
21
+ 1. **Name the proof.** If you can’t point at *what* stops a mutation or an unbounded read, you don’t have a sandbox — you have vibes.
22
+ 2. **Keep the surface small.** Two calls. No query wizard, no schema sync, no NL layer. Host apps own product UX.
23
+ 3. **Refuse soft knobs that erase the threat model.** No “just allow this DML prefix.” No password in container env. No floating `:latest` as the default trust root.
24
+
25
+ FFP Tech Lab ships primitives you can reason about. This is one of them.
26
+
27
+ ---
28
+
29
+ ## Design principles
30
+
31
+ | Principle | What it means here |
32
+ | --- | --- |
33
+ | Proof over ceremony | Safety claims map to concrete mechanisms (read-only DB role, container limits, streaming caps, host allowlist) — not to `validateSql` returning `{ ok: true }`. |
34
+ | Fail closed | Empty allowlist denies all. Missing Docker fails loudly. Soft “fall back to in-process SQL” is not an option. |
35
+ | Streaming limits, not post-hoc truncate | `maxRows` / `maxBytes` apply as rows arrive. Buffering the full result and then slicing is not the limits implementation. |
36
+ | Secrets stay out of `Env` | The password goes to tmpfs (`/run/secrets/db_password`). SQL rides stdin JSON. `docker inspect` should not print credentials. |
37
+ | Honest non-goals | We do not claim absolute network isolation, a full SQL AST, or that regex is authorization. |
20
38
 
21
- ## Public API
39
+ `validateSql` is a **cheap fail-fast** for obvious writes and multi-statement junk — not the proof. Treat `{ ok: true }` as “not obviously broken,” never as “safe to run outside this sandbox.”
40
+
41
+ ---
42
+
43
+ ## Quick start
44
+
45
+ Docker is a **hard dependency** of `executeSql`.
22
46
 
23
47
  ```ts
24
48
  import {
@@ -28,92 +52,105 @@ import {
28
52
  DEFAULT_SANDBOX_IMAGE,
29
53
  } from 'ffp-sql-sandbox'
30
54
 
31
- validateSql(sql: string): { ok: true } | { ok: false; code: string; reason: string }
55
+ const check = validateSql('SELECT 1')
56
+ if (!check.ok) throw new Error(check.reason)
32
57
 
33
- executeSql(input: {
34
- sql: string
58
+ const result = await executeSql({
59
+ sql: 'SELECT 1 AS n',
35
60
  connection: {
36
- type: 'postgres' | 'mysql'
37
- host: string
38
- port: number
39
- user: string
40
- password: string // never placed in container Env
41
- database: string
42
- }
43
- hostAllowlist: string[] // required
44
- limits?: Partial<SandboxLimits>
45
- image?: string // untrusted override; default image is digest-pinned
46
- }): Promise<
47
- | { ok: true; data: { columns: string[]; rows: unknown[][]; truncated?: boolean } }
48
- | { ok: false; code: string; error: string }
49
- >
61
+ type: 'postgres', // or 'mysql'
62
+ host: 'db.internal',
63
+ port: 5432,
64
+ user: 'readonly_user',
65
+ password: process.env.DB_PASSWORD!,
66
+ database: 'app',
67
+ },
68
+ hostAllowlist: ['db.internal'],
69
+ // limits?: Partial<typeof DEFAULT_SANDBOX_LIMITS>
70
+ // image?: string // untrusted override; prefer DEFAULT_SANDBOX_IMAGE
71
+ })
72
+
73
+ if (!result.ok) {
74
+ console.error(result.code, result.error)
75
+ } else {
76
+ console.log(result.data.columns, result.data.rows)
77
+ }
50
78
  ```
51
79
 
52
- `validateSql` is fail-fast only. There are no `allowPrefixes` / `forbidPatterns` options.
80
+ Wire framework DI, secret decryption, and result mapping in the host — see [INTEGRATION.md](./INTEGRATION.md).
53
81
 
54
- `resolveSandboxDbHost` is **not** exported. Loopback rewrite for container DNS, if needed, stays private (and, for ai-bi, in the adapter — see INTEGRATION.md).
82
+ ### Runner image
55
83
 
56
- ## Non-goals
84
+ Default runner is on GHCR, digest-pinned as `DEFAULT_SANDBOX_IMAGE`:
57
85
 
58
- - Natural language → SQL, query guidance, schema sync, or an AST parser as a required v1 component
59
- - A multi-tenant auth / connection-pool product
60
- - Claiming absolute network isolation (the runner uses Docker `bridge` so it can reach the allowlisted database)
61
- - Exporting `resolveSandboxDbHost` as public API
62
- - Making `validateSql` a proof of safety (it is a cheap reject, not a guarantee)
86
+ ```bash
87
+ docker pull ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner@sha256:13cc50f33c2d00a9ae464f3742c49a18a6b2750fdc39c23d68022476c79171a9
88
+ # convenience tags (same image): :v1 and :0.1.0 image tags, not the npm package version
89
+ docker pull ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner:v1
90
+ ```
63
91
 
64
- ## Threat model
92
+ Local build is an **untrusted** override (`image` option) — pin and review if you use it:
65
93
 
66
- Proof that a query cannot mutate data or exfiltrate unbounded results does **not** come from regex. v1 proof is the combination of:
94
+ ```bash
95
+ docker build -t ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner:v1 ./sandbox
96
+ ```
67
97
 
68
- | Guard | What it actually does |
69
- | --- | --- |
70
- | 1. Read-only DB role | **Caller must connect as a read-only role** (and/or a `READ ONLY` transaction). The library also sets `statement_timeout` and *prefers* a read-only session (`SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY` on Postgres, `SET SESSION TRANSACTION READ ONLY` on MySQL) when the dialect allows it. If that `SET` is ignored or the role can override it, the database role is still the real write barrier. |
71
- | 2. Container limits + dual timeout | Memory, nano-CPUs, PID cap, dropped capabilities. **Dual timeout**: the runner sets DB `statement_timeout` / `MAX_EXECUTION_TIME` to `timeoutMs`, and the host kills the container after `timeoutMs + 2000ms` if it is still running. |
72
- | 3. Streaming `maxRows` / `maxBytes` | The runner applies limits **as rows arrive** and stops/cancels instead of buffering the full result. The host consumer is a backstop on the live Docker attach stream. **Demux-then-truncate of a completed log buffer is not the limits implementation.** |
73
- | 4. `connection.host` allowlist | SSRF defense. `hostAllowlist` is required. Hosts not on the list are rejected **before** any container is created. No arbitrary hosts, no glob, no CIDR in v1 — exact match after trim + case-insensitive compare. |
98
+ ---
74
99
 
75
- Passwords are written to a **tmpfs** file at `/run/secrets/db_password` inside the container (mode/uid for the `node` user). They are **never** placed in container `Env` (no `DB_PASS`, `PGPASSWORD`, or `MYSQL_PWD`). SQL is sent on stdin JSON, not `Cmd`, so `docker inspect` does not show the password.
100
+ ## What actually provides the proof
76
101
 
77
- ### Default image vs custom image
102
+ | Guard | Role |
103
+ | --- | --- |
104
+ | 1. Read-only DB role | **You** connect as a read-only role (and/or `READ ONLY` transaction). The runner also prefers a read-only session and sets `statement_timeout` / `MAX_EXECUTION_TIME`. The role is still the real write barrier. |
105
+ | 2. Container limits + dual timeout | Memory, CPU, PID caps. DB timeout **and** host kill at `timeoutMs + 2000ms`. |
106
+ | 3. Streaming `maxRows` / `maxBytes` | Stop as data arrives; result may set `truncated: true`. |
107
+ | 4. `hostAllowlist` | Required. Exact match (trim, case-insensitive). Empty list → deny all. Checked **before** any container is created (SSRF). |
78
108
 
79
- | Image | Trust |
109
+ ### Default limits
110
+
111
+ | Limit | Default |
80
112
  | --- | --- |
81
- | `DEFAULT_SANDBOX_IMAGE` (`…@sha256:…`) | Digest-pinned default. Treat as the supported runner. |
82
- | `image` override | **Untrusted.** Allowed so callers can build locally, but a custom image can ignore streaming caps, log secrets, or exfiltrate. Pin and review your own image if you override. |
113
+ | `timeoutMs` | `10000` |
114
+ | `memoryMb` | `128` |
115
+ | `nanoCpus` | `500000000` (0.5 CPU) |
116
+ | `maxRows` | `1000` |
117
+ | `maxBytes` | `1000000` |
83
118
 
84
- The Dockerfile `FROM` line is also digest-pinned (`node:22-bookworm-slim@sha256:83f487e0a63425e5b4d146fb5e5be574bcbe1b7b843d3ebafdd95eaf7767a7e5`).
119
+ ### `hostAllowlist`
85
120
 
86
- Until GHCR publish, `DEFAULT_SANDBOX_IMAGE` is a **content digest** of the v1 runner files, not a registry-pullable image. `executeSql` without `image` will return `IMAGE_UNAVAILABLE` if that digest is not present locally. Build `sandbox/Dockerfile` and pass `image` (untrusted override), or `docker load` / retag the digest-pinned image. After the first registry push, replace the constant with `docker buildx imagetools inspect` output.
121
+ - Required on every `executeSql` call.
122
+ - Allowlist the host string you pass in `connection.host`.
123
+ - The library may privately rewrite loopback (`localhost`, `127.0.0.1`, …) to `host.docker.internal` *after* the allowlist check. That helper is **not** a public export.
87
124
 
88
- ## Default limits
125
+ ### Default image vs custom `image`
89
126
 
90
- | Limit | Default | Role |
91
- | --- | --- | --- |
92
- | `timeoutMs` | `10000` | DB `statement_timeout` / `MAX_EXECUTION_TIME`, plus container kill at `timeoutMs + 2000` |
93
- | `memoryMb` | `128` | Container memory (and memory-swap) cap |
94
- | `nanoCpus` | `500000000` (0.5 CPU) | Container CFS quota |
95
- | `maxRows` | `1000` | Streaming row cap; result may set `truncated: true` |
96
- | `maxBytes` | `1000000` | Streaming serialized-row / stdout byte cap; result may set `truncated: true` |
127
+ | Image | Trust |
128
+ | --- | --- |
129
+ | `DEFAULT_SANDBOX_IMAGE` (`…@sha256:…`) | Supported, digest-pinned runner. |
130
+ | `image` override | **Untrusted.** A custom image can ignore caps or leak secrets. |
97
131
 
98
- ## `hostAllowlist` contract
132
+ ---
99
133
 
100
- - Required on every `executeSql` call.
101
- - Empty list → `HOST_NOT_ALLOWED` (deny all).
102
- - Compared against the **caller-supplied** `connection.host` (trimmed, case-insensitive). The library may rewrite loopback (`localhost`, `127.0.0.1`, `::1`, `0.0.0.0`) to `host.docker.internal` *after* the allowlist check so the container can reach a DB on the Docker host. That rewrite is private and not a public API.
103
- - Put the host you actually pass in on the list (e.g. `db.internal` or `localhost`). Do not accept user-controlled hosts without your own allowlist.
134
+ ## Non-goals
104
135
 
105
- ## `validateSql` is fail-fast only (known bypasses)
136
+ - Natural language SQL, guidance UIs, or schema sync
137
+ - A full SQL AST as a v1 requirement
138
+ - Multi-tenant auth / connection-pool product
139
+ - Claiming absolute network isolation (bridge networking reaches the allowlisted DB by design)
140
+ - Exporting host-rewrite helpers as public API
141
+ - Treating `validateSql` as authorization
106
142
 
107
- `validateSql` is a cheap prefix + keyword + multi-statement reject. **Do not treat a `{ ok: true }` as authorization to run SQL outside this sandbox.** Known classes:
143
+ ### Known `validateSql` bypass classes (fail-fast only)
108
144
 
109
- | Class | Example | Notes |
145
+ | Class | Example | Real guard |
110
146
  | --- | --- | --- |
111
- | Writes that still look like `SELECT` | `SELECT … INTO …`, `SELECT pg_file_write(...)` | Prefix allowlist does not model Postgres side effects. **Read-only role** is the guard. |
112
- | False positives | `SELECT * FROM t WHERE action = 'UPDATE'` | Keyword scan is not an AST. Fail-fast, not completeness. |
113
- | Comment / encoding tricks | Leading `--` comments, Unicode homoglyphs | Rejected or missed; not a parser. |
114
- | Expensive reads | `SELECT * FROM huge_table` | Allowed by regex; stopped by timeout + `maxRows`/`maxBytes` + role. |
115
- | Multi-statement via protocol | Driver-level stacked queries if the runner used a naive exec | Runner sends a single query text; DB role + `READ ONLY` still apply. |
116
- | Network | `dblink`, `http` FDW, `LOAD_FILE` | Allowlist is on `connection.host`, not on SQL-level network functions. Use a locked-down role. |
147
+ | Writes that look like `SELECT` | `SELECT … INTO …`, side-effect functions | Read-only role |
148
+ | Keyword false positives | `… WHERE action = 'UPDATE'` | Not an AST |
149
+ | Comment / encoding tricks | Leading `--`, homoglyphs | Not a parser |
150
+ | Expensive reads | `SELECT * FROM huge_table` | Timeout + streaming caps + role |
151
+ | SQL-level network | `dblink`, FDW, `LOAD_FILE` | Locked-down role (allowlist is on `connection.host`) |
152
+
153
+ ---
117
154
 
118
155
  ## Error codes
119
156
 
@@ -126,19 +163,54 @@ Until GHCR publish, `DEFAULT_SANDBOX_IMAGE` is a **content digest** of the v1 ru
126
163
  | `DOCKER_UNAVAILABLE` | `executeSql` |
127
164
  | `TIMEOUT` | `executeSql` |
128
165
  | `INVALID_LIMITS` | `executeSql` |
129
- | `IMAGE_UNPINNED` | `executeSql` (default image missing digest) |
130
- | `IMAGE_UNAVAILABLE` | `executeSql` (image missing locally / not pullable; default digest is unpublished until GHCR) |
166
+ | `IMAGE_UNPINNED` | `executeSql` |
167
+ | `IMAGE_UNAVAILABLE` | `executeSql` |
131
168
  | `UNSUPPORTED_DIALECT` | `executeSql` |
132
169
  | `EXECUTION_FAILED` | `executeSql` |
133
170
 
171
+ ---
172
+
134
173
  ## Scripts
135
174
 
136
175
  ```bash
137
- pnpm test # node:test via tsx
176
+ pnpm test
138
177
  pnpm typecheck
139
178
  pnpm build
140
179
  ```
141
180
 
181
+ ---
182
+
183
+ ## Release
184
+
185
+ Library (npm) and runner image (GHCR) use **separate** workflows.
186
+
187
+ ### npm
188
+
189
+ Workflow: [`.github/workflows/publish-npm.yml`](./.github/workflows/publish-npm.yml).
190
+
191
+ 1. Bump `version` in `package.json` (keep in sync with the git tag).
192
+ 2. Repo secret **`NPM_TOKEN`**: npm granular token with publish + bypass 2FA.
193
+ 3. Merge to `main`, then `git tag vX.Y.Z && git push origin vX.Y.Z` (or `workflow_dispatch` / GitHub Release).
194
+ 4. Already-published versions are skipped (no force republish).
195
+
196
+ Published versions: [npm](https://www.npmjs.com/package/ffp-sql-sandbox).
197
+
198
+ ### GHCR runner
199
+
200
+ Workflow: [`.github/workflows/publish-runner.yml`](./.github/workflows/publish-runner.yml).
201
+
202
+ - Triggers on `sandbox/**` changes to `main` or `workflow_dispatch`.
203
+ - Pushes `ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner:v1` (and a convenience tag such as `:0.1.0` for the image line — **not** the npm semver).
204
+ - After a runner change, update `DEFAULT_SANDBOX_IMAGE` to the new digest from the job summary.
205
+
206
+ Org package visibility must allow public packages for anonymous `docker pull`. If pull returns unauthorized, check [org Packages settings](https://github.com/orgs/FFP-Tech-Lab/packages) and the package’s visibility.
207
+
208
+ ---
209
+
142
210
  ## License
143
211
 
144
- MIT. The GitHub repository may stay private until the org publishes it; that does not change the source license.
212
+ MIT.
213
+
214
+ ---
215
+
216
+ *Built at [FFP Tech Lab](https://github.com/FFP-Tech-Lab) — From First Principle: build from fundamentals, ship with clarity.*
@@ -185,7 +185,7 @@ function isImageUnavailableError(err) {
185
185
  }
186
186
  function imageUnavailableMessage(request) {
187
187
  if (request.usingDefaultImage) {
188
- return `Default sandbox image is not pullable (${request.image}). Until GHCR publish, build sandbox/Dockerfile locally and pass image: '<tag-or-id>' (untrusted override), or docker load/tag the digest-pinned image.`;
188
+ return `Default sandbox image is not pullable (${request.image}). Pull ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner@sha256:<digest> (or :v1), or build sandbox/Dockerfile locally and pass image: '<tag-or-id>' (untrusted override). If docker pull is unauthorized, the GHCR package may still be private.`;
189
189
  }
190
190
  return `Sandbox image not found: ${request.image}. Build or pull it before calling executeSql.`;
191
191
  }
@@ -1 +1 @@
1
- {"version":3,"file":"docker-executor.js","sourceRoot":"","sources":["../src/docker-executor.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EACL,WAAW,GAGZ,MAAM,mBAAmB,CAAC;AAK3B,MAAM,uBAAuB,GAAG,KAAK,CAAC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AG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC7D,OAAO,CACL,MAAM,KAAK,GAAG;QACd,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC;QAC1B,2BAA2B,CAAC,IAAI,CAAC,GAAG,CAAC,CACtC,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,OAAyB;IACxD,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;QAC9B,OAAO,0CAA0C,OAAO,CAAC,KAAK,8OAA8O,CAAC;IAC/S,CAAC;IACD,OAAO,4BAA4B,OAAO,CAAC,KAAK,+CAA+C,CAAC;AAClG,CAAC"}
package/dist/image.d.ts CHANGED
@@ -1,16 +1,11 @@
1
1
  /**
2
2
  * Default runner image. Digest-pinned in code; do not use a floating tag.
3
3
  *
4
- * This pin is the v1 identity of `sandbox/Dockerfile`. It is **not** a
5
- * GHCR-pullable digest until the runner is published. `executeSql` without
6
- * `image` returns `IMAGE_UNAVAILABLE` if Docker cannot find it. After the
7
- * first GHCR publish, replace this with `docker buildx imagetools inspect`.
8
- * Custom `image` overrides are untrusted.
9
- *
10
- * Content identity (sha256 of the runner files at this freeze):
11
- * sandbox/Dockerfile + execute.js + stream-limit.js + session-setup.js +
12
- * secrets.js + events.js + package.json.
4
+ * Published to GHCR as `ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner`
5
+ * (`:v1`, `:0.1.0`, and this digest). `executeSql` without `image` returns
6
+ * `IMAGE_UNAVAILABLE` if Docker cannot pull or find it. Custom `image`
7
+ * overrides are untrusted.
13
8
  */
14
- export declare const DEFAULT_SANDBOX_IMAGE = "ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner@sha256:861dd5eb53f5c3eb468b73b6068385f0688910fc10ba68610d20bb3de9f78952";
9
+ export declare const DEFAULT_SANDBOX_IMAGE = "ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner@sha256:13cc50f33c2d00a9ae464f3742c49a18a6b2750fdc39c23d68022476c79171a9";
15
10
  export declare function isDigestPinnedImage(image: string): boolean;
16
11
  //# sourceMappingURL=image.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,wHACqF,CAAC;AAExH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE1D"}
1
+ {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,wHACqF,CAAC;AAExH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE1D"}
package/dist/image.js CHANGED
@@ -2,17 +2,12 @@ const DIGEST_PINNED = /^.+@sha256:[a-f0-9]{64}$/i;
2
2
  /**
3
3
  * Default runner image. Digest-pinned in code; do not use a floating tag.
4
4
  *
5
- * This pin is the v1 identity of `sandbox/Dockerfile`. It is **not** a
6
- * GHCR-pullable digest until the runner is published. `executeSql` without
7
- * `image` returns `IMAGE_UNAVAILABLE` if Docker cannot find it. After the
8
- * first GHCR publish, replace this with `docker buildx imagetools inspect`.
9
- * Custom `image` overrides are untrusted.
10
- *
11
- * Content identity (sha256 of the runner files at this freeze):
12
- * sandbox/Dockerfile + execute.js + stream-limit.js + session-setup.js +
13
- * secrets.js + events.js + package.json.
5
+ * Published to GHCR as `ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner`
6
+ * (`:v1`, `:0.1.0`, and this digest). `executeSql` without `image` returns
7
+ * `IMAGE_UNAVAILABLE` if Docker cannot pull or find it. Custom `image`
8
+ * overrides are untrusted.
14
9
  */
15
- export const DEFAULT_SANDBOX_IMAGE = 'ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner@sha256:861dd5eb53f5c3eb468b73b6068385f0688910fc10ba68610d20bb3de9f78952';
10
+ export const DEFAULT_SANDBOX_IMAGE = 'ghcr.io/ffp-tech-lab/ffp-sql-sandbox-runner@sha256:13cc50f33c2d00a9ae464f3742c49a18a6b2750fdc39c23d68022476c79171a9';
16
11
  export function isDigestPinnedImage(image) {
17
12
  return DIGEST_PINNED.test(image.trim());
18
13
  }
package/dist/image.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"image.js","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAG,2BAA2B,CAAC;AAElD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAChC,qHAAqH,CAAC;AAExH,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC/C,OAAO,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;AAC1C,CAAC"}
1
+ {"version":3,"file":"image.js","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAG,2BAA2B,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAChC,qHAAqH,CAAC;AAExH,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC/C,OAAO,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;AAC1C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ffp-sql-sandbox",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Read-only SQL sandbox primitives: fail-fast validateSql + Docker executeSql with hard limits",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -22,16 +22,13 @@
22
22
  "engines": {
23
23
  "node": ">=20"
24
24
  },
25
- "packageManager": "pnpm@10.33.3",
26
25
  "repository": {
27
26
  "type": "git",
28
27
  "url": "git+https://github.com/FFP-Tech-Lab/ffp-sql-sandbox.git"
29
28
  },
30
- "scripts": {
31
- "build": "tsc -p tsconfig.build.json",
32
- "typecheck": "tsc -p tsconfig.json --noEmit",
33
- "test": "tsx --test test/**/*.test.ts",
34
- "prepack": "pnpm build"
29
+ "publishConfig": {
30
+ "access": "public",
31
+ "registry": "https://registry.npmjs.org/"
35
32
  },
36
33
  "dependencies": {
37
34
  "dockerode": "^4.0.7"
@@ -41,5 +38,10 @@
41
38
  "@types/node": "^22.18.0",
42
39
  "tsx": "^4.20.5",
43
40
  "typescript": "^5.9.2"
41
+ },
42
+ "scripts": {
43
+ "build": "tsc -p tsconfig.build.json",
44
+ "typecheck": "tsc -p tsconfig.json --noEmit",
45
+ "test": "tsx --test test/**/*.test.ts"
44
46
  }
45
- }
47
+ }