pyric-admin 0.1.0-alpha.18 → 0.1.0-alpha.20

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 CHANGED
@@ -26,17 +26,22 @@ Antigravity CLI and OpenCode use the standalone skill installer:
26
26
 
27
27
  ```bash
28
28
  # Antigravity CLI
29
- npx skills add https://github.com/davideast/pyric/tree/main/pyric-plugin/skills/pyric-start --agent antigravity-cli
29
+ npx skills add https://github.com/davideast/pyric/tree/main/pyric-plugin/skills/pyric --agent antigravity-cli
30
30
 
31
31
  # OpenCode
32
- npx skills add https://github.com/davideast/pyric/tree/main/pyric-plugin/skills/pyric-start --agent opencode
32
+ npx skills add https://github.com/davideast/pyric/tree/main/pyric-plugin/skills/pyric --agent opencode
33
33
  ```
34
34
 
35
- Then ask your agent:
35
+ Then invoke the skill:
36
36
 
37
- ```text
38
- Use the pyric-start skill to set up and run Pyric in this project.
39
- ```
37
+ | Agent | Enter |
38
+ |---|---|
39
+ | Codex | `$pyric` |
40
+ | Claude Code | `/pyric:pyric` |
41
+ | Antigravity CLI | `/pyric` |
42
+ | OpenCode | `/pyric` |
43
+
44
+ The leading `$` or `/` is part of the command.
40
45
 
41
46
  The skill chooses the project launcher, starts one local sandbox bridge, opens the application, and confirms that the browser sandbox is connected.
42
47
 
@@ -79,9 +84,9 @@ npm run dev
79
84
 
80
85
  During `vite dev`, the plugin swaps supported `firebase/*` modules at resolution time. The backend runs in a SharedWorker, so tabs on the same development origin use one local backend. Browser-local persistence uses IndexedDB.
81
86
 
82
- Pyric Studio is available on the Vite origin at `/__pyric/ui/`. It opens the same backend used by the application.
87
+ Pyric Studio is available on the Vite origin at `/__pyric/ui/studio`. It opens the same backend used by the application.
83
88
 
84
- For a static application or a Node process, `pyric dev` provides the same development-only package swap without the Vite plugin. The [CLI reference](packages/cli/docs/reference/cli.md) documents those paths and every command.
89
+ For a static application or a Node process, `pyric sandbox` provides the same development-only package swap without the Vite plugin. The [CLI reference](packages/site-docs/src/content/reference/cli.md) documents those paths and every command.
85
90
 
86
91
  ## Keep using official Firebase SDKs
87
92
 
@@ -109,7 +114,7 @@ Pyric documents the parts that differ locally, including supported behavior, Sec
109
114
 
110
115
  ## Monitor the local environment in Pyric Studio
111
116
 
112
- Pyric Studio shows local data, requests, authentication state, Security Rules verdicts, and denied operations. Open `/__pyric/ui/` on the development server and reproduce the failure. A denied request includes the path and verdict needed to correct the rule or the application code.
117
+ Pyric Studio shows local data, requests, authentication state, Security Rules verdicts, and denied operations. Open `/__pyric/ui/studio` on the development server and reproduce the failure. A denied request includes the path and verdict needed to correct the rule or the application code.
113
118
 
114
119
  <img width="1512" height="947" alt="image" src="https://github.com/user-attachments/assets/cb4a219c-c5f0-4fb7-8904-996416c0a79c" />
115
120
 
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Root `firebase-admin` compatibility facade.
3
+ *
4
+ * Implements top-level service accessors (admin.firestore(), admin.auth(), etc.)
5
+ * and re-exports app lifecycle helpers so standard `import admin from 'firebase-admin'`
6
+ * and `const admin = require('firebase-admin')` work out of the box in the sandbox.
7
+ */
8
+ import * as appModule from './app/index.js';
9
+ export declare const credential: {
10
+ cert: typeof appModule.cert;
11
+ applicationDefault: typeof appModule.applicationDefault;
12
+ refreshToken: (token: string) => {
13
+ [x: symbol]: string;
14
+ token: string;
15
+ };
16
+ };
17
+ export declare const firestore: (app?: appModule.PyricAdminApp) => import("pyric/sandbox/admin-firestore").SandboxFirestore;
18
+ export declare const auth: (app?: appModule.PyricAdminApp) => import("./auth/types.js").Auth;
19
+ export declare const database: (app?: appModule.PyricAdminApp) => import("./database/index.js").Database;
20
+ export declare const storage: (app?: appModule.PyricAdminApp) => import("./storage/index.js").Storage;
21
+ export declare const messaging: (app?: appModule.PyricAdminApp) => import("./messaging/index.js").Messaging;
22
+ declare const admin: {
23
+ credential: {
24
+ cert: typeof appModule.cert;
25
+ applicationDefault: typeof appModule.applicationDefault;
26
+ refreshToken: (token: string) => {
27
+ [x: symbol]: string;
28
+ token: string;
29
+ };
30
+ };
31
+ firestore: (app?: appModule.PyricAdminApp) => import("pyric/sandbox/admin-firestore").SandboxFirestore;
32
+ auth: (app?: appModule.PyricAdminApp) => import("./auth/types.js").Auth;
33
+ database: (app?: appModule.PyricAdminApp) => import("./database/index.js").Database;
34
+ storage: (app?: appModule.PyricAdminApp) => import("./storage/index.js").Storage;
35
+ messaging: (app?: appModule.PyricAdminApp) => import("./messaging/index.js").Messaging;
36
+ applicationDefault(): never;
37
+ cert(serviceAccountPathOrObject: unknown): object;
38
+ initializeApp(config?: appModule.InitializeAdminAppConfig | Record<string, unknown>, name?: string): appModule.PyricAdminApp;
39
+ getApp(name?: string): appModule.PyricAdminApp;
40
+ getApps(): appModule.PyricAdminApp[];
41
+ deleteApp(app: appModule.PyricAdminApp): Promise<void>;
42
+ isSandboxAdminApp(app: appModule.PyricAdminApp): app is appModule.SandboxAdminApp;
43
+ ADMIN_APP_TARGET: typeof appModule.ADMIN_APP_TARGET;
44
+ DEFAULT_APP_NAME: "[DEFAULT]";
45
+ };
46
+ export default admin;
47
+ //# sourceMappingURL=admin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAO5C,eAAO,MAAM,UAAU;;;0BAGC,MAAM;;;;CAI7B,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,MAAM,SAAS,CAAC,aAAa,6DAAsB,CAAC;AAC9E,eAAO,MAAM,IAAI,GAAI,MAAM,SAAS,CAAC,aAAa,mCAAiB,CAAC;AACpE,eAAO,MAAM,QAAQ,GAAI,MAAM,SAAS,CAAC,aAAa,2CAAqB,CAAC;AAC5E,eAAO,MAAM,OAAO,GAAI,MAAM,SAAS,CAAC,aAAa,yCAAoB,CAAC;AAC1E,eAAO,MAAM,SAAS,GAAI,MAAM,SAAS,CAAC,aAAa,6CAAsB,CAAC;AAE9E,QAAA,MAAM,KAAK;;;;8BAZa,MAAM;;;;;sBAME,SAAS,CAAC,aAAa;iBAC5B,SAAS,CAAC,aAAa;qBACnB,SAAS,CAAC,aAAa;oBACxB,SAAS,CAAC,aAAa;sBACrB,SAAS,CAAC,aAAa;;;;;;;;;;CAUtD,CAAC;AAEF,eAAe,KAAK,CAAC"}
package/dist/admin.js ADDED
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Root `firebase-admin` compatibility facade.
3
+ *
4
+ * Implements top-level service accessors (admin.firestore(), admin.auth(), etc.)
5
+ * and re-exports app lifecycle helpers so standard `import admin from 'firebase-admin'`
6
+ * and `const admin = require('firebase-admin')` work out of the box in the sandbox.
7
+ */
8
+ import * as appModule from './app/index.js';
9
+ import { getFirestore } from './firestore/index.js';
10
+ import { getAuth } from './auth/index.js';
11
+ import { getDatabase } from './database/index.js';
12
+ import { getStorage } from './storage/index.js';
13
+ import { getMessaging } from './messaging/index.js';
14
+ export const credential = {
15
+ cert: appModule.cert,
16
+ applicationDefault: appModule.applicationDefault,
17
+ refreshToken: (token) => ({
18
+ [Symbol.for('pyric.admin.credential')]: 'refreshToken',
19
+ token,
20
+ }),
21
+ };
22
+ export const firestore = (app) => getFirestore(app);
23
+ export const auth = (app) => getAuth(app);
24
+ export const database = (app) => getDatabase(app);
25
+ export const storage = (app) => getStorage(app);
26
+ export const messaging = (app) => getMessaging(app);
27
+ const admin = {
28
+ ...appModule,
29
+ credential,
30
+ firestore,
31
+ auth,
32
+ database,
33
+ storage,
34
+ messaging,
35
+ };
36
+ export default admin;
37
+ //# sourceMappingURL=admin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin.js","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,SAAS,CAAC,IAAI;IACpB,kBAAkB,EAAE,SAAS,CAAC,kBAAkB;IAChD,YAAY,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC;QAChC,CAAC,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC,EAAE,cAAc;QACtD,KAAK;KACN,CAAC;CACH,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAA6B,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;AAC9E,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,GAA6B,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACpE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAA6B,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;AAC5E,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAA6B,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAA6B,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;AAE9E,MAAM,KAAK,GAAG;IACZ,GAAG,SAAS;IACZ,UAAU;IACV,SAAS;IACT,IAAI;IACJ,QAAQ;IACR,OAAO;IACP,SAAS;CACV,CAAC;AAEF,eAAe,KAAK,CAAC"}
package/dist/app/index.js CHANGED
@@ -126,7 +126,7 @@ function initializeAmbientApp(name) {
126
126
  const env = process.env.PYRIC_SANDBOX;
127
127
  if (env === undefined || env.trim() === '') {
128
128
  throw new Error('pyric-admin/app is a sandbox-only mirror and no sandbox is active. ' +
129
- 'Run under `pyric dev`, set PYRIC_SANDBOX with @pyric/cli/register, ' +
129
+ 'Run under `pyric sandbox`, set PYRIC_SANDBOX with @pyric/cli/register, ' +
130
130
  'or load firebase-admin/app without Pyric activation for production.');
131
131
  }
132
132
  const opts = parsePyricSandboxEnv(env);
@@ -140,7 +140,7 @@ function initializeAmbientApp(name) {
140
140
  if (typeof factory !== 'function') {
141
141
  throw new Error(`pyric-admin: PYRIC_SANDBOX=${env} is set but no remote sandbox ` +
142
142
  "factory is installed (globalThis[Symbol.for('pyric.remote.sandboxFactory')] is absent). " +
143
- 'Run your server under `pyric dev`, or add `--import @pyric/cli/register` to NODE_OPTIONS.');
143
+ 'Run your server under `pyric sandbox`, or add `--import @pyric/cli/register` to NODE_OPTIONS.');
144
144
  }
145
145
  const sandbox = factory(opts);
146
146
  process.stderr.write(`pyric: firebase-admin routed to sandbox${opts.url !== undefined ? ` at ${opts.url}` : ''}\n`);
@@ -156,13 +156,13 @@ function parsePyricSandboxEnv(env) {
156
156
  const url = value.slice('remote:'.length).trim();
157
157
  if (url === '') {
158
158
  throw new Error('pyric-admin: PYRIC_SANDBOX=remote: has an empty url. Use ' +
159
- 'PYRIC_SANDBOX=remote to auto-discover the running `pyric dev`, ' +
159
+ 'PYRIC_SANDBOX=remote to auto-discover the running `pyric sandbox`, ' +
160
160
  'or PYRIC_SANDBOX=remote:<url> with the host url.');
161
161
  }
162
162
  return { url };
163
163
  }
164
164
  throw new Error(`pyric-admin: unrecognized PYRIC_SANDBOX value "${env}". Supported ` +
165
- 'values: "1", "true", "remote" (auto-discover the running `pyric dev`), or "remote:<url>".');
165
+ 'values: "1", "true", "remote" (auto-discover the running `pyric sandbox`), or "remote:<url>".');
166
166
  }
167
167
  function isSandboxConfig(config) {
168
168
  return typeof config === 'object' && config !== null && 'sandbox' in config;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/app/index.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E,OAAO,EAAE,IAAI,EAAE,CAAC;AAC1D,CAAC;AAED,SAAS,oBAAoB,CAAC,GAAW;IACvC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IACzB,MAAM,iBAAiB,GAAG,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,MAAM,CAAC;IAClF,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAChC,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;QACjD,IAAI,GAAG,KAAK,EAAE,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CACb,2DAA2D;gBACzD,qEAAqE;gBACrE,kDAAkD,CACrD,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,GAAG,EAAE,CAAC;IACjB,CAAC;IACD,MAAM,IAAI,KAAK,CACb,kDAAkD,GAAG,eAAe;QAClE,+FAA+F,CAClG,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,MAAe;IACtC,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,SAAS,IAAI,MAAM,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,GAAkB;IAClD,OAAO,GAAG,CAAC,gBAAgB,CAAC,KAAK,SAAS,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Root `pyric-admin` entry point — pure re-export barrel.
3
+ *
4
+ * Exposes the root admin facade and modular app exports.
5
+ */
6
+ export * from './app/index.js';
7
+ export * from './admin.js';
8
+ export { default } from './admin.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Root `pyric-admin` entry point — pure re-export barrel.
3
+ *
4
+ * Exposes the root admin facade and modular app exports.
5
+ */
6
+ export * from './app/index.js';
7
+ export * from './admin.js';
8
+ export { default } from './admin.js';
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pyric-admin",
3
- "version": "0.1.0-alpha.18",
3
+ "version": "0.1.0-alpha.20",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "https://pyric.dev",
6
6
  "repository": {
@@ -13,7 +13,13 @@
13
13
  },
14
14
  "description": "Firebase Admin-shaped adapters for the Pyric development sandbox.",
15
15
  "type": "module",
16
+ "main": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
16
18
  "exports": {
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "import": "./dist/index.js"
22
+ },
17
23
  "./app": {
18
24
  "types": "./dist/app/index.d.ts",
19
25
  "import": "./dist/app/index.js"
@@ -51,10 +57,10 @@
51
57
  "typecheck": "bun x tsc -p tsconfig.json --noEmit"
52
58
  },
53
59
  "dependencies": {
54
- "pyric": "^0.1.0-alpha.18"
60
+ "pyric": "^0.1.0-alpha.20"
55
61
  },
56
62
  "devDependencies": {
57
- "@types/bun": "latest",
63
+ "@types/bun": "1.3.14",
58
64
  "firebase-admin": "^13.0.0",
59
65
  "typescript": "^5.7.0",
60
66
  "fake-indexeddb": "^6.0.0"
package/src/admin.ts ADDED
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Root `firebase-admin` compatibility facade.
3
+ *
4
+ * Implements top-level service accessors (admin.firestore(), admin.auth(), etc.)
5
+ * and re-exports app lifecycle helpers so standard `import admin from 'firebase-admin'`
6
+ * and `const admin = require('firebase-admin')` work out of the box in the sandbox.
7
+ */
8
+ import * as appModule from './app/index.js';
9
+ import { getFirestore } from './firestore/index.js';
10
+ import { getAuth } from './auth/index.js';
11
+ import { getDatabase } from './database/index.js';
12
+ import { getStorage } from './storage/index.js';
13
+ import { getMessaging } from './messaging/index.js';
14
+
15
+ export const credential = {
16
+ cert: appModule.cert,
17
+ applicationDefault: appModule.applicationDefault,
18
+ refreshToken: (token: string) => ({
19
+ [Symbol.for('pyric.admin.credential')]: 'refreshToken',
20
+ token,
21
+ }),
22
+ };
23
+
24
+ export const firestore = (app?: appModule.PyricAdminApp) => getFirestore(app);
25
+ export const auth = (app?: appModule.PyricAdminApp) => getAuth(app);
26
+ export const database = (app?: appModule.PyricAdminApp) => getDatabase(app);
27
+ export const storage = (app?: appModule.PyricAdminApp) => getStorage(app);
28
+ export const messaging = (app?: appModule.PyricAdminApp) => getMessaging(app);
29
+
30
+ const admin = {
31
+ ...appModule,
32
+ credential,
33
+ firestore,
34
+ auth,
35
+ database,
36
+ storage,
37
+ messaging,
38
+ };
39
+
40
+ export default admin;
package/src/app/index.ts CHANGED
@@ -179,7 +179,7 @@ function initializeAmbientApp(name: string): PyricAdminApp {
179
179
  if (env === undefined || env.trim() === '') {
180
180
  throw new Error(
181
181
  'pyric-admin/app is a sandbox-only mirror and no sandbox is active. ' +
182
- 'Run under `pyric dev`, set PYRIC_SANDBOX with @pyric/cli/register, ' +
182
+ 'Run under `pyric sandbox`, set PYRIC_SANDBOX with @pyric/cli/register, ' +
183
183
  'or load firebase-admin/app without Pyric activation for production.',
184
184
  );
185
185
  }
@@ -201,7 +201,7 @@ function initializeAmbientApp(name: string): PyricAdminApp {
201
201
  throw new Error(
202
202
  `pyric-admin: PYRIC_SANDBOX=${env} is set but no remote sandbox ` +
203
203
  "factory is installed (globalThis[Symbol.for('pyric.remote.sandboxFactory')] is absent). " +
204
- 'Run your server under `pyric dev`, or add `--import @pyric/cli/register` to NODE_OPTIONS.',
204
+ 'Run your server under `pyric sandbox`, or add `--import @pyric/cli/register` to NODE_OPTIONS.',
205
205
  );
206
206
  }
207
207
 
@@ -223,7 +223,7 @@ function parsePyricSandboxEnv(env: string): RemoteSandboxFactoryOptions {
223
223
  if (url === '') {
224
224
  throw new Error(
225
225
  'pyric-admin: PYRIC_SANDBOX=remote: has an empty url. Use ' +
226
- 'PYRIC_SANDBOX=remote to auto-discover the running `pyric dev`, ' +
226
+ 'PYRIC_SANDBOX=remote to auto-discover the running `pyric sandbox`, ' +
227
227
  'or PYRIC_SANDBOX=remote:<url> with the host url.',
228
228
  );
229
229
  }
@@ -231,7 +231,7 @@ function parsePyricSandboxEnv(env: string): RemoteSandboxFactoryOptions {
231
231
  }
232
232
  throw new Error(
233
233
  `pyric-admin: unrecognized PYRIC_SANDBOX value "${env}". Supported ` +
234
- 'values: "1", "true", "remote" (auto-discover the running `pyric dev`), or "remote:<url>".',
234
+ 'values: "1", "true", "remote" (auto-discover the running `pyric sandbox`), or "remote:<url>".',
235
235
  );
236
236
  }
237
237
 
package/src/index.ts ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Root `pyric-admin` entry point — pure re-export barrel.
3
+ *
4
+ * Exposes the root admin facade and modular app exports.
5
+ */
6
+ export * from './app/index.js';
7
+ export * from './admin.js';
8
+ export { default } from './admin.js';
package/README.md.orig DELETED
@@ -1,50 +0,0 @@
1
- # `pyric-admin`
2
-
3
- Firebase Admin-shaped adapters for a Pyric sandbox.
4
-
5
- Use these subpaths when tests, development servers, or scripts need
6
- `firebase-admin` ergonomics against local or browser-hosted sandbox state. In
7
- activated development, `@pyric/cli/register` resolves canonical
8
- `firebase-admin/*` imports here. With activation absent, production execution
9
- loads `firebase-admin` directly.
10
-
11
- > **Alpha.** These are best-effort mirror contracts of `firebase-admin`. Read
12
- > the conformance matrices and service references for implemented behaviour and
13
- > explicit gaps.
14
-
15
- ## Subpaths
16
-
17
- | Subpath | Sandbox surface |
18
- |---|---|
19
- | `pyric-admin/app` | Admin app registry and sandbox binding |
20
- | `pyric-admin/firestore` | Admin Firestore shape |
21
- | `pyric-admin/auth` | Admin Auth shape |
22
- | `pyric-admin/database` | Admin Realtime Database shape |
23
- | `pyric-admin/storage` | Admin Storage shape |
24
- | `pyric-admin/messaging` | Admin Cloud Messaging send plane |
25
-
26
- ## Explicit sandbox setup
27
-
28
- ```ts
29
- import { initializeApp } from 'pyric-admin/app';
30
- import { initializeSandbox } from 'pyric/sandbox';
31
- import { getFirestore } from 'pyric-admin/firestore';
32
-
33
- const app = initializeApp({ sandbox: initializeSandbox() });
34
- const db = getFirestore(app);
35
-
36
- await db.collection('posts').doc('hello').set({ title: 'Hello' });
37
- ```
38
-
39
- For unchanged server source, keep `firebase-admin/*` imports and run the
40
- development command through `pyric dev`. Production runs the same source
41
- without sandbox activation and therefore resolves Firebase Admin directly.
42
-
43
- ## Documentation
44
-
45
- - [App registry and activation](docs/app/)
46
- - [Firestore](docs/firestore/)
47
- - [Auth API](https://pyric.dev/docs/pyric-admin-auth-reference-api/)
48
- - [Realtime Database API](https://pyric.dev/docs/pyric-admin-database-reference-api/)
49
- - [Storage API](https://pyric.dev/docs/pyric-admin-storage-reference-api/)
50
- - [Messaging API](https://pyric.dev/docs/pyric-admin-messaging-reference-api/)