@stackbone/cli 0.2.5 → 0.2.6

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.
@@ -0,0 +1,59 @@
1
+ -- 0024_browser_auth_profiles.sql — persistent, encrypted browser auth profiles
2
+ -- for deep-agent browser tools (STA-99).
3
+ --
4
+ -- A browsing agent gets a fresh browser context per chat session, so it starts
5
+ -- logged out of every site every conversation. This table lets a successful
6
+ -- login be captured once and reused: the browser's serialized Playwright
7
+ -- `storageState` (cookies + per-origin localStorage) is encrypted and stored
8
+ -- keyed by (site origin, identity); every new browser context for that origin
9
+ -- starts with the state injected — already authenticated, no fresh login.
10
+ --
11
+ -- Rides the SAME secrets machinery as `stackbone_platform.secrets`, not a new
12
+ -- crypto path: it lives in the agent's OWN platform database (so scoping is
13
+ -- physical — a different install is a different DB + a different per-agent
14
+ -- `STACKBONE_SECRET_KEY`, and a row is unreachable/undecryptable from any other
15
+ -- install or org) and uses the identical `@stackbone/crypto` libsodium envelope
16
+ -- (`version` / `nonce` / `ciphertext`). Storage state is credential-equivalent
17
+ -- (a leaked cookie is a leaked password), which is exactly why it never sits in
18
+ -- plaintext and never leaves the install's database.
19
+ --
20
+ -- Identity model v1 is agent-owned: one identity per site per install (the
21
+ -- agent's own account). The `identity` column defaults to 'agent' and the
22
+ -- UNIQUE (origin, identity) key future-proofs per-identity profiles without a
23
+ -- rewrite when per-end-user identities arrive.
24
+
25
+ CREATE TABLE IF NOT EXISTS stackbone_platform.browser_auth_profiles (
26
+ id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
27
+ -- The site origin the profile authenticates, canonicalized to
28
+ -- `<scheme>://<host>[:<port>]` (e.g. `https://tutorbird.com`). The primary
29
+ -- half of the identity key.
30
+ origin text NOT NULL,
31
+ -- Which identity on that site this profile is for. v1 is always 'agent'
32
+ -- (the agent's own account); the column exists so per-end-user identities
33
+ -- are a non-breaking addition, never a rewrite.
34
+ identity text NOT NULL DEFAULT 'agent',
35
+ -- Crypto envelope, identical to `stackbone_platform.secrets`. The plaintext
36
+ -- is the JSON-serialized Playwright storageState; the cipher is the shared
37
+ -- libsodium `crypto_secretbox` keyed by the per-agent `STACKBONE_SECRET_KEY`.
38
+ version text NOT NULL DEFAULT 'v1' CHECK (version IN ('v1')),
39
+ nonce bytea NOT NULL,
40
+ ciphertext bytea NOT NULL,
41
+ -- Set when the agent landed unauthenticated despite an injected profile, so
42
+ -- exactly one re-login runs under the per-identity mutex and refreshes it.
43
+ stale boolean NOT NULL DEFAULT false,
44
+ created_at timestamptz NOT NULL DEFAULT now(),
45
+ updated_at timestamptz NOT NULL DEFAULT now()
46
+ );
47
+
48
+ -- One profile per (origin, identity): the login flow upserts on this key so a
49
+ -- re-login rotates the state in place rather than accumulating rows.
50
+ CREATE UNIQUE INDEX IF NOT EXISTS browser_auth_profiles_origin_identity_idx
51
+ ON stackbone_platform.browser_auth_profiles (origin, identity);
52
+
53
+ -- The operator list surface orders newest-first.
54
+ CREATE INDEX IF NOT EXISTS browser_auth_profiles_updated_at_idx
55
+ ON stackbone_platform.browser_auth_profiles (updated_at DESC);
56
+
57
+ -- Storage state is credential material — keep it out of reach of the read-only
58
+ -- SQL Explorer role exactly like `secrets` (0011).
59
+ REVOKE ALL ON stackbone_platform.browser_auth_profiles FROM stackbone_viewer;
@@ -0,0 +1,9 @@
1
+ -- 0025_trigger_subscriptions_mapping_graph.sql — add mapping_graph column to trigger_subscriptions
2
+ -- The visual node editor authors an event→input mapping as a graph and COMPILES it to the
3
+ -- existing JSONata `mapping` string on the client. `mapping_graph` persists that graph opaquely
4
+ -- so the editor can re-open and keep editing; the runtime NEVER reads it (the forwarder still
5
+ -- evaluates only `mapping`). Nullable for backward compatibility and for code-mode detach, where
6
+ -- editing the raw JSONata clears the graph back to null.
7
+
8
+ ALTER TABLE stackbone_platform.trigger_subscriptions
9
+ ADD COLUMN IF NOT EXISTS mapping_graph jsonb;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackbone/cli",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "license": "UNLICENSED",
5
5
  "type": "module",
6
6
  "bin": {
@@ -37,6 +37,7 @@
37
37
  "postgres": "^3.4.9",
38
38
  "semver": "^7.7.4",
39
39
  "tar": "^7.5.13",
40
+ "unpdf": "^0.12.1",
40
41
  "yaml": "^2.8.3",
41
42
  "zod": "^4.3.6"
42
43
  }
Binary file
Binary file