pyric-tools 0.1.0-alpha.7
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 +125 -0
- package/dist/auth/domains/handler.d.ts +6 -0
- package/dist/auth/domains/handler.d.ts.map +1 -0
- package/dist/auth/domains/handler.js +75 -0
- package/dist/auth/domains/handler.js.map +1 -0
- package/dist/auth/domains/spec.d.ts +25 -0
- package/dist/auth/domains/spec.d.ts.map +1 -0
- package/dist/auth/domains/spec.js +6 -0
- package/dist/auth/domains/spec.js.map +1 -0
- package/dist/auth/index.d.ts +34 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +30 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/mapper.d.ts +5 -0
- package/dist/auth/mapper.d.ts.map +1 -0
- package/dist/auth/mapper.js +49 -0
- package/dist/auth/mapper.js.map +1 -0
- package/dist/auth/provider/handler.d.ts +9 -0
- package/dist/auth/provider/handler.d.ts.map +1 -0
- package/dist/auth/provider/handler.js +128 -0
- package/dist/auth/provider/handler.js.map +1 -0
- package/dist/auth/provider/spec.d.ts +29 -0
- package/dist/auth/provider/spec.d.ts.map +1 -0
- package/dist/auth/provider/spec.js +12 -0
- package/dist/auth/provider/spec.js.map +1 -0
- package/dist/auth/resolver.d.ts +16 -0
- package/dist/auth/resolver.d.ts.map +1 -0
- package/dist/auth/resolver.js +32 -0
- package/dist/auth/resolver.js.map +1 -0
- package/dist/auth/tools.d.ts +23 -0
- package/dist/auth/tools.d.ts.map +1 -0
- package/dist/auth/tools.js +71 -0
- package/dist/auth/tools.js.map +1 -0
- package/dist/auth/types.d.ts +37 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +17 -0
- package/dist/auth/types.js.map +1 -0
- package/dist/bridge/client/bridge.d.ts +133 -0
- package/dist/bridge/client/bridge.d.ts.map +1 -0
- package/dist/bridge/client/bridge.js +430 -0
- package/dist/bridge/client/bridge.js.map +1 -0
- package/dist/bridge/client/dispatch.d.ts +49 -0
- package/dist/bridge/client/dispatch.d.ts.map +1 -0
- package/dist/bridge/client/dispatch.js +103 -0
- package/dist/bridge/client/dispatch.js.map +1 -0
- package/dist/bridge/client.d.ts +24 -0
- package/dist/bridge/client.d.ts.map +1 -0
- package/dist/bridge/client.js +26 -0
- package/dist/bridge/client.js.map +1 -0
- package/dist/bridge/protocol.d.ts +228 -0
- package/dist/bridge/protocol.d.ts.map +1 -0
- package/dist/bridge/protocol.js +131 -0
- package/dist/bridge/protocol.js.map +1 -0
- package/dist/bridge/server/audit.d.ts +19 -0
- package/dist/bridge/server/audit.d.ts.map +1 -0
- package/dist/bridge/server/audit.js +46 -0
- package/dist/bridge/server/audit.js.map +1 -0
- package/dist/bridge/server/bridge.d.ts +165 -0
- package/dist/bridge/server/bridge.d.ts.map +1 -0
- package/dist/bridge/server/bridge.js +410 -0
- package/dist/bridge/server/bridge.js.map +1 -0
- package/dist/bridge/server/confirm-policy.d.ts +56 -0
- package/dist/bridge/server/confirm-policy.d.ts.map +1 -0
- package/dist/bridge/server/confirm-policy.js +107 -0
- package/dist/bridge/server/confirm-policy.js.map +1 -0
- package/dist/bridge/server/confirm-prompt.d.ts +73 -0
- package/dist/bridge/server/confirm-prompt.d.ts.map +1 -0
- package/dist/bridge/server/confirm-prompt.js +199 -0
- package/dist/bridge/server/confirm-prompt.js.map +1 -0
- package/dist/bridge/server/confirm.d.ts +92 -0
- package/dist/bridge/server/confirm.d.ts.map +1 -0
- package/dist/bridge/server/confirm.js +210 -0
- package/dist/bridge/server/confirm.js.map +1 -0
- package/dist/bridge/server/headless.d.ts +36 -0
- package/dist/bridge/server/headless.d.ts.map +1 -0
- package/dist/bridge/server/headless.js +132 -0
- package/dist/bridge/server/headless.js.map +1 -0
- package/dist/bridge/server/json-schema-to-zod.d.ts +37 -0
- package/dist/bridge/server/json-schema-to-zod.d.ts.map +1 -0
- package/dist/bridge/server/json-schema-to-zod.js +93 -0
- package/dist/bridge/server/json-schema-to-zod.js.map +1 -0
- package/dist/bridge/server/local-bridge.d.ts +33 -0
- package/dist/bridge/server/local-bridge.d.ts.map +1 -0
- package/dist/bridge/server/local-bridge.js +42 -0
- package/dist/bridge/server/local-bridge.js.map +1 -0
- package/dist/bridge/server/logger.d.ts +28 -0
- package/dist/bridge/server/logger.d.ts.map +1 -0
- package/dist/bridge/server/logger.js +42 -0
- package/dist/bridge/server/logger.js.map +1 -0
- package/dist/bridge/server/mcp.d.ts +33 -0
- package/dist/bridge/server/mcp.d.ts.map +1 -0
- package/dist/bridge/server/mcp.js +159 -0
- package/dist/bridge/server/mcp.js.map +1 -0
- package/dist/bridge/server/peer.d.ts +39 -0
- package/dist/bridge/server/peer.d.ts.map +1 -0
- package/dist/bridge/server/peer.js +189 -0
- package/dist/bridge/server/peer.js.map +1 -0
- package/dist/bridge/server/standalone.d.ts +102 -0
- package/dist/bridge/server/standalone.d.ts.map +1 -0
- package/dist/bridge/server/standalone.js +352 -0
- package/dist/bridge/server/standalone.js.map +1 -0
- package/dist/bridge/server/tool-metadata.d.ts +38 -0
- package/dist/bridge/server/tool-metadata.d.ts.map +1 -0
- package/dist/bridge/server/tool-metadata.js +79 -0
- package/dist/bridge/server/tool-metadata.js.map +1 -0
- package/dist/bridge/server.d.ts +25 -0
- package/dist/bridge/server.d.ts.map +1 -0
- package/dist/bridge/server.js +23 -0
- package/dist/bridge/server.js.map +1 -0
- package/dist/cli/auth.d.ts +37 -0
- package/dist/cli/auth.d.ts.map +1 -0
- package/dist/cli/auth.js +119 -0
- package/dist/cli/auth.js.map +1 -0
- package/dist/cli/database-rules.d.ts +25 -0
- package/dist/cli/database-rules.d.ts.map +1 -0
- package/dist/cli/database-rules.js +215 -0
- package/dist/cli/database-rules.js.map +1 -0
- package/dist/cli/deploy-progress.d.ts +35 -0
- package/dist/cli/deploy-progress.d.ts.map +1 -0
- package/dist/cli/deploy-progress.js +69 -0
- package/dist/cli/deploy-progress.js.map +1 -0
- package/dist/cli/deploy.d.ts +81 -0
- package/dist/cli/deploy.d.ts.map +1 -0
- package/dist/cli/deploy.js +413 -0
- package/dist/cli/deploy.js.map +1 -0
- package/dist/cli/dev-runner.d.ts +112 -0
- package/dist/cli/dev-runner.d.ts.map +1 -0
- package/dist/cli/dev-runner.js +227 -0
- package/dist/cli/dev-runner.js.map +1 -0
- package/dist/cli/discover.d.ts +47 -0
- package/dist/cli/discover.d.ts.map +1 -0
- package/dist/cli/discover.js +77 -0
- package/dist/cli/discover.js.map +1 -0
- package/dist/cli/firebase-json.d.ts +66 -0
- package/dist/cli/firebase-json.d.ts.map +1 -0
- package/dist/cli/firebase-json.js +60 -0
- package/dist/cli/firebase-json.js.map +1 -0
- package/dist/cli/index.d.ts +55 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +500 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init-templates.d.ts +37 -0
- package/dist/cli/init-templates.d.ts.map +1 -0
- package/dist/cli/init-templates.js +638 -0
- package/dist/cli/init-templates.js.map +1 -0
- package/dist/cli/init.d.ts +124 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +423 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/login.d.ts +18 -0
- package/dist/cli/login.d.ts.map +1 -0
- package/dist/cli/login.js +59 -0
- package/dist/cli/login.js.map +1 -0
- package/dist/cli/mcp-proxy.d.ts +10 -0
- package/dist/cli/mcp-proxy.d.ts.map +1 -0
- package/dist/cli/mcp-proxy.js +126 -0
- package/dist/cli/mcp-proxy.js.map +1 -0
- package/dist/cli/parse-args.d.ts +20 -0
- package/dist/cli/parse-args.d.ts.map +1 -0
- package/dist/cli/parse-args.js +69 -0
- package/dist/cli/parse-args.js.map +1 -0
- package/dist/cli/rules.d.ts +40 -0
- package/dist/cli/rules.d.ts.map +1 -0
- package/dist/cli/rules.js +162 -0
- package/dist/cli/rules.js.map +1 -0
- package/dist/cli/scope.d.ts +38 -0
- package/dist/cli/scope.d.ts.map +1 -0
- package/dist/cli/scope.js +63 -0
- package/dist/cli/scope.js.map +1 -0
- package/dist/cli/serve.d.ts +122 -0
- package/dist/cli/serve.d.ts.map +1 -0
- package/dist/cli/serve.js +685 -0
- package/dist/cli/serve.js.map +1 -0
- package/dist/cli/snapshot.d.ts +22 -0
- package/dist/cli/snapshot.d.ts.map +1 -0
- package/dist/cli/snapshot.js +139 -0
- package/dist/cli/snapshot.js.map +1 -0
- package/dist/cli/verify.d.ts +23 -0
- package/dist/cli/verify.d.ts.map +1 -0
- package/dist/cli/verify.js +349 -0
- package/dist/cli/verify.js.map +1 -0
- package/dist/credentials/core/authorize.d.ts +22 -0
- package/dist/credentials/core/authorize.d.ts.map +1 -0
- package/dist/credentials/core/authorize.js +39 -0
- package/dist/credentials/core/authorize.js.map +1 -0
- package/dist/credentials/core/client.d.ts +14 -0
- package/dist/credentials/core/client.d.ts.map +1 -0
- package/dist/credentials/core/client.js +13 -0
- package/dist/credentials/core/client.js.map +1 -0
- package/dist/credentials/core/exchange.d.ts +24 -0
- package/dist/credentials/core/exchange.d.ts.map +1 -0
- package/dist/credentials/core/exchange.js +46 -0
- package/dist/credentials/core/exchange.js.map +1 -0
- package/dist/credentials/core/flow.d.ts +15 -0
- package/dist/credentials/core/flow.d.ts.map +1 -0
- package/dist/credentials/core/flow.js +40 -0
- package/dist/credentials/core/flow.js.map +1 -0
- package/dist/credentials/core/from-user-credential.d.ts +3 -0
- package/dist/credentials/core/from-user-credential.d.ts.map +1 -0
- package/dist/credentials/core/from-user-credential.js +19 -0
- package/dist/credentials/core/from-user-credential.js.map +1 -0
- package/dist/credentials/core/scopes.d.ts +26 -0
- package/dist/credentials/core/scopes.d.ts.map +1 -0
- package/dist/credentials/core/scopes.js +32 -0
- package/dist/credentials/core/scopes.js.map +1 -0
- package/dist/credentials/core/types.d.ts +72 -0
- package/dist/credentials/core/types.d.ts.map +1 -0
- package/dist/credentials/core/types.js +2 -0
- package/dist/credentials/core/types.js.map +1 -0
- package/dist/credentials/index.d.ts +14 -0
- package/dist/credentials/index.d.ts.map +1 -0
- package/dist/credentials/index.js +13 -0
- package/dist/credentials/index.js.map +1 -0
- package/dist/credentials/node/ensure-scope.d.ts +29 -0
- package/dist/credentials/node/ensure-scope.d.ts.map +1 -0
- package/dist/credentials/node/ensure-scope.js +42 -0
- package/dist/credentials/node/ensure-scope.js.map +1 -0
- package/dist/credentials/node/file-store.d.ts +4 -0
- package/dist/credentials/node/file-store.d.ts.map +1 -0
- package/dist/credentials/node/file-store.js +52 -0
- package/dist/credentials/node/file-store.js.map +1 -0
- package/dist/credentials/node/from-adc.d.ts +10 -0
- package/dist/credentials/node/from-adc.d.ts.map +1 -0
- package/dist/credentials/node/from-adc.js +60 -0
- package/dist/credentials/node/from-adc.js.map +1 -0
- package/dist/credentials/node/index.d.ts +10 -0
- package/dist/credentials/node/index.d.ts.map +1 -0
- package/dist/credentials/node/index.js +10 -0
- package/dist/credentials/node/index.js.map +1 -0
- package/dist/credentials/node/loopback-authorizer.d.ts +12 -0
- package/dist/credentials/node/loopback-authorizer.d.ts.map +1 -0
- package/dist/credentials/node/loopback-authorizer.js +61 -0
- package/dist/credentials/node/loopback-authorizer.js.map +1 -0
- package/dist/credentials/node/resolve-local-token.d.ts +20 -0
- package/dist/credentials/node/resolve-local-token.d.ts.map +1 -0
- package/dist/credentials/node/resolve-local-token.js +97 -0
- package/dist/credentials/node/resolve-local-token.js.map +1 -0
- package/dist/credentials/server/bff.d.ts +44 -0
- package/dist/credentials/server/bff.d.ts.map +1 -0
- package/dist/credentials/server/bff.js +43 -0
- package/dist/credentials/server/bff.js.map +1 -0
- package/dist/deploy/api-enablement.d.ts +45 -0
- package/dist/deploy/api-enablement.d.ts.map +1 -0
- package/dist/deploy/api-enablement.js +125 -0
- package/dist/deploy/api-enablement.js.map +1 -0
- package/dist/deploy/firestore/databases.d.ts +41 -0
- package/dist/deploy/firestore/databases.d.ts.map +1 -0
- package/dist/deploy/firestore/databases.js +63 -0
- package/dist/deploy/firestore/databases.js.map +1 -0
- package/dist/deploy/firestore/indexes.d.ts +120 -0
- package/dist/deploy/firestore/indexes.d.ts.map +1 -0
- package/dist/deploy/firestore/indexes.js +243 -0
- package/dist/deploy/firestore/indexes.js.map +1 -0
- package/dist/deploy/firestore/recipes.d.ts +21 -0
- package/dist/deploy/firestore/recipes.d.ts.map +1 -0
- package/dist/deploy/firestore/recipes.js +34 -0
- package/dist/deploy/firestore/recipes.js.map +1 -0
- package/dist/deploy/firestore/rules.d.ts +76 -0
- package/dist/deploy/firestore/rules.d.ts.map +1 -0
- package/dist/deploy/firestore/rules.js +180 -0
- package/dist/deploy/firestore/rules.js.map +1 -0
- package/dist/deploy/from-admin-app.d.ts +20 -0
- package/dist/deploy/from-admin-app.d.ts.map +1 -0
- package/dist/deploy/from-admin-app.js +18 -0
- package/dist/deploy/from-admin-app.js.map +1 -0
- package/dist/deploy/from-service-account.d.ts +29 -0
- package/dist/deploy/from-service-account.d.ts.map +1 -0
- package/dist/deploy/from-service-account.js +115 -0
- package/dist/deploy/from-service-account.js.map +1 -0
- package/dist/deploy/functions/bundle.d.ts +37 -0
- package/dist/deploy/functions/bundle.d.ts.map +1 -0
- package/dist/deploy/functions/bundle.js +181 -0
- package/dist/deploy/functions/bundle.js.map +1 -0
- package/dist/deploy/functions/core.d.ts +18 -0
- package/dist/deploy/functions/core.d.ts.map +1 -0
- package/dist/deploy/functions/core.js +211 -0
- package/dist/deploy/functions/core.js.map +1 -0
- package/dist/deploy/functions/iam.d.ts +17 -0
- package/dist/deploy/functions/iam.d.ts.map +1 -0
- package/dist/deploy/functions/iam.js +40 -0
- package/dist/deploy/functions/iam.js.map +1 -0
- package/dist/deploy/functions/operation.d.ts +39 -0
- package/dist/deploy/functions/operation.d.ts.map +1 -0
- package/dist/deploy/functions/operation.js +37 -0
- package/dist/deploy/functions/operation.js.map +1 -0
- package/dist/deploy/functions/spec.d.ts +69 -0
- package/dist/deploy/functions/spec.d.ts.map +1 -0
- package/dist/deploy/functions/spec.js +7 -0
- package/dist/deploy/functions/spec.js.map +1 -0
- package/dist/deploy/functions/types.d.ts +50 -0
- package/dist/deploy/functions/types.d.ts.map +1 -0
- package/dist/deploy/functions/types.js +3 -0
- package/dist/deploy/functions/types.js.map +1 -0
- package/dist/deploy/hosting/channels.d.ts +93 -0
- package/dist/deploy/hosting/channels.d.ts.map +1 -0
- package/dist/deploy/hosting/channels.js +134 -0
- package/dist/deploy/hosting/channels.js.map +1 -0
- package/dist/deploy/hosting/config.d.ts +28 -0
- package/dist/deploy/hosting/config.d.ts.map +1 -0
- package/dist/deploy/hosting/config.js +261 -0
- package/dist/deploy/hosting/config.js.map +1 -0
- package/dist/deploy/hosting/core.d.ts +38 -0
- package/dist/deploy/hosting/core.d.ts.map +1 -0
- package/dist/deploy/hosting/core.js +311 -0
- package/dist/deploy/hosting/core.js.map +1 -0
- package/dist/deploy/hosting/gzip.d.ts +11 -0
- package/dist/deploy/hosting/gzip.d.ts.map +1 -0
- package/dist/deploy/hosting/gzip.js +20 -0
- package/dist/deploy/hosting/gzip.js.map +1 -0
- package/dist/deploy/hosting/hash.d.ts +6 -0
- package/dist/deploy/hosting/hash.d.ts.map +1 -0
- package/dist/deploy/hosting/hash.js +17 -0
- package/dist/deploy/hosting/hash.js.map +1 -0
- package/dist/deploy/hosting/sites.d.ts +77 -0
- package/dist/deploy/hosting/sites.d.ts.map +1 -0
- package/dist/deploy/hosting/sites.js +73 -0
- package/dist/deploy/hosting/sites.js.map +1 -0
- package/dist/deploy/hosting/spec.d.ts +140 -0
- package/dist/deploy/hosting/spec.d.ts.map +1 -0
- package/dist/deploy/hosting/spec.js +8 -0
- package/dist/deploy/hosting/spec.js.map +1 -0
- package/dist/deploy/hosting/types.d.ts +71 -0
- package/dist/deploy/hosting/types.d.ts.map +1 -0
- package/dist/deploy/hosting/types.js +3 -0
- package/dist/deploy/hosting/types.js.map +1 -0
- package/dist/deploy/hosting/walk.d.ts +31 -0
- package/dist/deploy/hosting/walk.d.ts.map +1 -0
- package/dist/deploy/hosting/walk.js +167 -0
- package/dist/deploy/hosting/walk.js.map +1 -0
- package/dist/deploy/index.d.ts +51 -0
- package/dist/deploy/index.d.ts.map +1 -0
- package/dist/deploy/index.js +50 -0
- package/dist/deploy/index.js.map +1 -0
- package/dist/deploy/memoize-ttl.d.ts +58 -0
- package/dist/deploy/memoize-ttl.d.ts.map +1 -0
- package/dist/deploy/memoize-ttl.js +88 -0
- package/dist/deploy/memoize-ttl.js.map +1 -0
- package/dist/deploy/namespaces.d.ts +119 -0
- package/dist/deploy/namespaces.d.ts.map +1 -0
- package/dist/deploy/namespaces.js +192 -0
- package/dist/deploy/namespaces.js.map +1 -0
- package/dist/deploy/preflight.d.ts +119 -0
- package/dist/deploy/preflight.d.ts.map +1 -0
- package/dist/deploy/preflight.js +440 -0
- package/dist/deploy/preflight.js.map +1 -0
- package/dist/deploy/provider.d.ts +130 -0
- package/dist/deploy/provider.d.ts.map +1 -0
- package/dist/deploy/provider.js +21 -0
- package/dist/deploy/provider.js.map +1 -0
- package/dist/deploy/providers/database.d.ts +8 -0
- package/dist/deploy/providers/database.d.ts.map +1 -0
- package/dist/deploy/providers/database.js +37 -0
- package/dist/deploy/providers/database.js.map +1 -0
- package/dist/deploy/providers/firestore.d.ts +11 -0
- package/dist/deploy/providers/firestore.d.ts.map +1 -0
- package/dist/deploy/providers/firestore.js +43 -0
- package/dist/deploy/providers/firestore.js.map +1 -0
- package/dist/deploy/providers/functions.d.ts +9 -0
- package/dist/deploy/providers/functions.d.ts.map +1 -0
- package/dist/deploy/providers/functions.js +49 -0
- package/dist/deploy/providers/functions.js.map +1 -0
- package/dist/deploy/providers/hosting.d.ts +13 -0
- package/dist/deploy/providers/hosting.d.ts.map +1 -0
- package/dist/deploy/providers/hosting.js +149 -0
- package/dist/deploy/providers/hosting.js.map +1 -0
- package/dist/deploy/providers/storage.d.ts +9 -0
- package/dist/deploy/providers/storage.d.ts.map +1 -0
- package/dist/deploy/providers/storage.js +46 -0
- package/dist/deploy/providers/storage.js.map +1 -0
- package/dist/deploy/registry.d.ts +17 -0
- package/dist/deploy/registry.d.ts.map +1 -0
- package/dist/deploy/registry.js +15 -0
- package/dist/deploy/registry.js.map +1 -0
- package/dist/deploy/rtdb/rules.d.ts +21 -0
- package/dist/deploy/rtdb/rules.d.ts.map +1 -0
- package/dist/deploy/rtdb/rules.js +104 -0
- package/dist/deploy/rtdb/rules.js.map +1 -0
- package/dist/deploy/scope.d.ts +81 -0
- package/dist/deploy/scope.d.ts.map +1 -0
- package/dist/deploy/scope.js +44 -0
- package/dist/deploy/scope.js.map +1 -0
- package/dist/deploy/tools.d.ts +55 -0
- package/dist/deploy/tools.d.ts.map +1 -0
- package/dist/deploy/tools.js +329 -0
- package/dist/deploy/tools.js.map +1 -0
- package/dist/deploy/with-resolved-scope.d.ts +31 -0
- package/dist/deploy/with-resolved-scope.d.ts.map +1 -0
- package/dist/deploy/with-resolved-scope.js +73 -0
- package/dist/deploy/with-resolved-scope.js.map +1 -0
- package/dist/discover/concurrency.d.ts +42 -0
- package/dist/discover/concurrency.d.ts.map +1 -0
- package/dist/discover/concurrency.js +113 -0
- package/dist/discover/concurrency.js.map +1 -0
- package/dist/discover/crawler-adapter.d.ts +49 -0
- package/dist/discover/crawler-adapter.d.ts.map +1 -0
- package/dist/discover/crawler-adapter.js +92 -0
- package/dist/discover/crawler-adapter.js.map +1 -0
- package/dist/discover/crawler.d.ts +333 -0
- package/dist/discover/crawler.d.ts.map +1 -0
- package/dist/discover/crawler.js +764 -0
- package/dist/discover/crawler.js.map +1 -0
- package/dist/discover/findCollectionGroup.d.ts +80 -0
- package/dist/discover/findCollectionGroup.d.ts.map +1 -0
- package/dist/discover/findCollectionGroup.js +81 -0
- package/dist/discover/findCollectionGroup.js.map +1 -0
- package/dist/discover/index.d.ts +15 -0
- package/dist/discover/index.d.ts.map +1 -0
- package/dist/discover/index.js +24 -0
- package/dist/discover/index.js.map +1 -0
- package/dist/discover/merge.d.ts +108 -0
- package/dist/discover/merge.d.ts.map +1 -0
- package/dist/discover/merge.js +394 -0
- package/dist/discover/merge.js.map +1 -0
- package/dist/discover/rest-crawler-firestore.d.ts +51 -0
- package/dist/discover/rest-crawler-firestore.d.ts.map +1 -0
- package/dist/discover/rest-crawler-firestore.js +154 -0
- package/dist/discover/rest-crawler-firestore.js.map +1 -0
- package/dist/discover/session.d.ts +116 -0
- package/dist/discover/session.d.ts.map +1 -0
- package/dist/discover/session.js +331 -0
- package/dist/discover/session.js.map +1 -0
- package/dist/discover/tools.d.ts +59 -0
- package/dist/discover/tools.d.ts.map +1 -0
- package/dist/discover/tools.js +115 -0
- package/dist/discover/tools.js.map +1 -0
- package/dist/discover/types.d.ts +191 -0
- package/dist/discover/types.d.ts.map +1 -0
- package/dist/discover/types.js +12 -0
- package/dist/discover/types.js.map +1 -0
- package/dist/discover/wire.d.ts +81 -0
- package/dist/discover/wire.d.ts.map +1 -0
- package/dist/discover/wire.js +308 -0
- package/dist/discover/wire.js.map +1 -0
- package/dist/pkg-version.d.ts +2 -0
- package/dist/pkg-version.d.ts.map +1 -0
- package/dist/pkg-version.js +47 -0
- package/dist/pkg-version.js.map +1 -0
- package/dist/register/esm-exports.d.ts +26 -0
- package/dist/register/esm-exports.d.ts.map +1 -0
- package/dist/register/esm-exports.js +61 -0
- package/dist/register/esm-exports.js.map +1 -0
- package/dist/register/exempt.d.ts +11 -0
- package/dist/register/exempt.d.ts.map +1 -0
- package/dist/register/exempt.js +74 -0
- package/dist/register/exempt.js.map +1 -0
- package/dist/register/hooks.d.ts +13 -0
- package/dist/register/hooks.d.ts.map +1 -0
- package/dist/register/hooks.js +15 -0
- package/dist/register/hooks.js.map +1 -0
- package/dist/register/index.d.ts +5 -0
- package/dist/register/index.d.ts.map +1 -0
- package/dist/register/index.js +126 -0
- package/dist/register/index.js.map +1 -0
- package/dist/register/mapping.d.ts +17 -0
- package/dist/register/mapping.d.ts.map +1 -0
- package/dist/register/mapping.js +31 -0
- package/dist/register/mapping.js.map +1 -0
- package/dist/registry/admin-deps.d.ts +17 -0
- package/dist/registry/admin-deps.d.ts.map +1 -0
- package/dist/registry/admin-deps.js +68 -0
- package/dist/registry/admin-deps.js.map +1 -0
- package/dist/registry/compose.d.ts +68 -0
- package/dist/registry/compose.d.ts.map +1 -0
- package/dist/registry/compose.js +113 -0
- package/dist/registry/compose.js.map +1 -0
- package/dist/registry/index.d.ts +11 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +11 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/remote/index.d.ts +232 -0
- package/dist/remote/index.d.ts.map +1 -0
- package/dist/remote/index.js +719 -0
- package/dist/remote/index.js.map +1 -0
- package/dist/rtdb/rules-json.d.ts +8 -0
- package/dist/rtdb/rules-json.d.ts.map +1 -0
- package/dist/rtdb/rules-json.js +17 -0
- package/dist/rtdb/rules-json.js.map +1 -0
- package/dist/serve/bridge-mount.d.ts +38 -0
- package/dist/serve/bridge-mount.d.ts.map +1 -0
- package/dist/serve/bridge-mount.js +162 -0
- package/dist/serve/bridge-mount.js.map +1 -0
- package/dist/serve/bundler.d.ts +134 -0
- package/dist/serve/bundler.d.ts.map +1 -0
- package/dist/serve/bundler.js +452 -0
- package/dist/serve/bundler.js.map +1 -0
- package/dist/serve/capture-store.d.ts +27 -0
- package/dist/serve/capture-store.d.ts.map +1 -0
- package/dist/serve/capture-store.js +47 -0
- package/dist/serve/capture-store.js.map +1 -0
- package/dist/serve/discovery.d.ts +71 -0
- package/dist/serve/discovery.d.ts.map +1 -0
- package/dist/serve/discovery.js +158 -0
- package/dist/serve/discovery.js.map +1 -0
- package/dist/serve/docs-ui/_astro/_slug_.BsN3bPok.css +1 -0
- package/dist/serve/docs-ui/docs/_rhythm/index.html +99 -0
- package/dist/serve/docs-ui/docs/_rhythm.md +101 -0
- package/dist/serve/docs-ui/docs/index.html +1 -0
- package/dist/serve/docs-ui/docs/index.json +9914 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore/index.html +38 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-explanation-error-translation/index.html +57 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-explanation-error-translation.md +87 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-explanation-per-call-delegate/index.html +58 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-explanation-per-call-delegate.md +86 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-explanation-why-mirror-admin-shape/index.html +59 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-explanation-why-mirror-admin-shape.md +82 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-run-a-transaction/index.html +53 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-run-a-transaction.md +70 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-seed-and-set-rules/index.html +62 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-seed-and-set-rules.md +86 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-translate-denials/index.html +80 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-translate-denials.md +92 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-use-onsnapshot/index.html +57 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-use-onsnapshot.md +78 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-write-a-batch/index.html +50 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-write-a-batch.md +67 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-api/index.html +53 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-api.md +73 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-onsnapshot/index.html +68 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-onsnapshot.md +75 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-re-exported-types/index.html +76 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-re-exported-types.md +95 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-sandbox-firestore/index.html +40 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-sandbox-firestore.md +73 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-tutorials-01-first-admin-session/index.html +118 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-tutorials-01-first-admin-session.md +146 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore.md +49 -0
- package/dist/serve/docs-ui/docs/pyric-auth/index.html +64 -0
- package/dist/serve/docs-ui/docs/pyric-auth-compat/index.html +874 -0
- package/dist/serve/docs-ui/docs/pyric-auth-compat.md +265 -0
- package/dist/serve/docs-ui/docs/pyric-auth-reference-api/index.html +112 -0
- package/dist/serve/docs-ui/docs/pyric-auth-reference-api.md +129 -0
- package/dist/serve/docs-ui/docs/pyric-auth-reference-feature-matrix/index.html +781 -0
- package/dist/serve/docs-ui/docs/pyric-auth-reference-feature-matrix.md +198 -0
- package/dist/serve/docs-ui/docs/pyric-auth-reference-sandbox-test-driver/index.html +80 -0
- package/dist/serve/docs-ui/docs/pyric-auth-reference-sandbox-test-driver.md +107 -0
- package/dist/serve/docs-ui/docs/pyric-auth.md +84 -0
- package/dist/serve/docs-ui/docs/pyric-database/index.html +36 -0
- package/dist/serve/docs-ui/docs/pyric-database-compat/index.html +2428 -0
- package/dist/serve/docs-ui/docs/pyric-database-compat.md +850 -0
- package/dist/serve/docs-ui/docs/pyric-database-explanation-rules-authoring-and-deploy-are-separate/index.html +23 -0
- package/dist/serve/docs-ui/docs/pyric-database-explanation-rules-authoring-and-deploy-are-separate.md +29 -0
- package/dist/serve/docs-ui/docs/pyric-database-reference-rules-tooling/index.html +263 -0
- package/dist/serve/docs-ui/docs/pyric-database-reference-rules-tooling.md +288 -0
- package/dist/serve/docs-ui/docs/pyric-database-tutorials-01-author-rtdb-rules-with-constraints/index.html +116 -0
- package/dist/serve/docs-ui/docs/pyric-database-tutorials-01-author-rtdb-rules-with-constraints.md +142 -0
- package/dist/serve/docs-ui/docs/pyric-database.md +18 -0
- package/dist/serve/docs-ui/docs/pyric-firestore/index.html +54 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-compat/index.html +1345 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-compat.md +366 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-explanation-rules-tooling-is-separate/index.html +79 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-explanation-rules-tooling-is-separate.md +62 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-explanation-target-symbol-opacity/index.html +59 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-explanation-target-symbol-opacity.md +85 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-explanation-two-backends-one-surface/index.html +61 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-explanation-two-backends-one-surface.md +87 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-build-queries/index.html +105 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-build-queries.md +138 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-migrate-from-firebase-firestore/index.html +65 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-migrate-from-firebase-firestore.md +93 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-pick-a-backend/index.html +112 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-pick-a-backend.md +100 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-run-a-transaction/index.html +42 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-run-a-transaction.md +55 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-use-onsnapshot/index.html +61 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-use-onsnapshot.md +83 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-use-sandbox-ops/index.html +52 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-use-sandbox-ops.md +73 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-api/index.html +132 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-api.md +160 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-feature-matrix/index.html +793 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-feature-matrix.md +239 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-getfirestore/index.html +55 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-getfirestore.md +76 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-query-constraints/index.html +78 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-query-constraints.md +115 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-sandbox-ops/index.html +53 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-sandbox-ops.md +76 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-tool-factories/index.html +51 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-tool-factories.md +65 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-tutorials-01-write-a-sandbox-demo/index.html +127 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-tutorials-01-write-a-sandbox-demo.md +157 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-tutorials-02-swap-to-prod-backend/index.html +85 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-tutorials-02-swap-to-prod-backend.md +122 -0
- package/dist/serve/docs-ui/docs/pyric-firestore.md +69 -0
- package/dist/serve/docs-ui/docs/pyric-rules/index.html +93 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-agent-failure-modes/index.html +50 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-agent-failure-modes.md +74 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-lint-vs-validate-vs-simulate-vs-test/index.html +79 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-lint-vs-validate-vs-simulate-vs-test.md +69 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-runtime-budget-and-shared-gates/index.html +67 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-runtime-budget-and-shared-gates.md +71 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-sentinel-expression-engine/index.html +49 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-sentinel-expression-engine.md +70 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-simulator-vs-rules-test-api/index.html +96 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-simulator-vs-rules-test-api.md +76 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-the-2-plus-modules-extension/index.html +58 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-the-2-plus-modules-extension.md +75 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-value-wrappers-design/index.html +62 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-value-wrappers-design.md +80 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-why-this-package-exists/index.html +34 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-why-this-package-exists.md +43 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-compare-rulesets-for-weakening/index.html +54 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-compare-rulesets-for-weakening.md +69 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-inspect-rules-via-the-ast/index.html +89 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-inspect-rules-via-the-ast.md +113 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-lint-rules-source/index.html +50 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-lint-rules-source.md +73 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-pin-request-time/index.html +47 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-pin-request-time.md +58 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-register-tools-with-an-agent/index.html +61 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-register-tools-with-an-agent.md +78 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-resolve-module-imports/index.html +92 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-resolve-module-imports.md +93 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-simulate-rules-locally/index.html +89 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-simulate-rules-locally.md +117 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-test-rules-against-firebase/index.html +70 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-test-rules-against-firebase.md +93 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-api/index.html +129 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-api.md +176 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-ast/index.html +85 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-ast.md +105 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-errors/index.html +63 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-errors.md +89 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-lint-rules/index.html +148 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-lint-rules.md +159 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-simulator-context/index.html +66 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-simulator-context.md +98 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-stdlib-modules/index.html +239 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-stdlib-modules.md +135 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-test-case-schema/index.html +93 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-test-case-schema.md +109 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-validator-findings/index.html +86 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-validator-findings.md +113 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-value-wrappers/index.html +101 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-value-wrappers.md +134 -0
- package/dist/serve/docs-ui/docs/pyric-rules-tutorials-01-lint-your-first-rules-file/index.html +107 -0
- package/dist/serve/docs-ui/docs/pyric-rules-tutorials-01-lint-your-first-rules-file.md +142 -0
- package/dist/serve/docs-ui/docs/pyric-rules-tutorials-02-write-a-test-suite-for-your-rules/index.html +151 -0
- package/dist/serve/docs-ui/docs/pyric-rules-tutorials-02-write-a-test-suite-for-your-rules.md +194 -0
- package/dist/serve/docs-ui/docs/pyric-rules.md +88 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox/index.html +67 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-every-op-is-a-request/index.html +141 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-every-op-is-a-request.md +157 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-identity-is-a-context/index.html +66 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-identity-is-a-context.md +98 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-internal-adapter-protocol/index.html +71 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-internal-adapter-protocol.md +105 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-listener-re-evaluation/index.html +56 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-listener-re-evaluation.md +80 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-local-backend-vs-firestore-offline/index.html +64 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-local-backend-vs-firestore-offline.md +56 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-why-adapters-are-siblings/index.html +88 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-why-adapters-are-siblings.md +87 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-why-this-package-exists/index.html +69 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-why-this-package-exists.md +57 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-multiple-isolated-sandboxes/index.html +63 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-multiple-isolated-sandboxes.md +83 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-observe-events/index.html +159 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-observe-events.md +154 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-pick-an-adapter/index.html +79 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-pick-an-adapter.md +69 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-replay-events/index.html +89 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-replay-events.md +87 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-reset-between-tests/index.html +68 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-reset-between-tests.md +86 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-seed-data-and-rules/index.html +91 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-seed-data-and-rules.md +112 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-switch-users/index.html +50 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-switch-users.md +70 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-use-admin-reads/index.html +54 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-use-admin-reads.md +73 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-api/index.html +77 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-api.md +117 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-divergences/index.html +125 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-divergences.md +137 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-error-codes/index.html +110 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-error-codes.md +114 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-internal-protocol/index.html +72 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-internal-protocol.md +99 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-sandbox-and-context/index.html +90 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-sandbox-and-context.md +128 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-sandbox-event/index.html +146 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-sandbox-event.md +188 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-snapshot-and-admin/index.html +53 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-snapshot-and-admin.md +77 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-tutorials-01-your-first-sandbox-session/index.html +115 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-tutorials-01-your-first-sandbox-session.md +154 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-tutorials-02-use-the-sandbox-in-a-test-harness/index.html +191 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-tutorials-02-use-the-sandbox-in-a-test-harness.md +222 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-tutorials-03-build-a-traffic-monitor/index.html +163 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-tutorials-03-build-a-traffic-monitor.md +192 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox.md +63 -0
- package/dist/serve/docs-ui/docs/pyric-storage/index.html +65 -0
- package/dist/serve/docs-ui/docs/pyric-storage-compat/index.html +1076 -0
- package/dist/serve/docs-ui/docs/pyric-storage-compat.md +337 -0
- package/dist/serve/docs-ui/docs/pyric-storage-explanation-implementation-scope/index.html +63 -0
- package/dist/serve/docs-ui/docs/pyric-storage-explanation-implementation-scope.md +104 -0
- package/dist/serve/docs-ui/docs/pyric-storage-explanation-session-archive-use-case/index.html +58 -0
- package/dist/serve/docs-ui/docs/pyric-storage-explanation-session-archive-use-case.md +80 -0
- package/dist/serve/docs-ui/docs/pyric-storage-explanation-why-indexeddb/index.html +50 -0
- package/dist/serve/docs-ui/docs/pyric-storage-explanation-why-indexeddb.md +82 -0
- package/dist/serve/docs-ui/docs/pyric-storage-how-to-enforce-rules/index.html +104 -0
- package/dist/serve/docs-ui/docs/pyric-storage-how-to-enforce-rules.md +111 -0
- package/dist/serve/docs-ui/docs/pyric-storage-how-to-list-and-delete/index.html +53 -0
- package/dist/serve/docs-ui/docs/pyric-storage-how-to-list-and-delete.md +76 -0
- package/dist/serve/docs-ui/docs/pyric-storage-how-to-round-trip-metadata/index.html +77 -0
- package/dist/serve/docs-ui/docs/pyric-storage-how-to-round-trip-metadata.md +100 -0
- package/dist/serve/docs-ui/docs/pyric-storage-how-to-switch-backends/index.html +65 -0
- package/dist/serve/docs-ui/docs/pyric-storage-how-to-switch-backends.md +82 -0
- package/dist/serve/docs-ui/docs/pyric-storage-how-to-test-rule-expressions/index.html +70 -0
- package/dist/serve/docs-ui/docs/pyric-storage-how-to-test-rule-expressions.md +82 -0
- package/dist/serve/docs-ui/docs/pyric-storage-reference-api/index.html +92 -0
- package/dist/serve/docs-ui/docs/pyric-storage-reference-api.md +152 -0
- package/dist/serve/docs-ui/docs/pyric-storage-reference-error-codes/index.html +46 -0
- package/dist/serve/docs-ui/docs/pyric-storage-reference-error-codes.md +66 -0
- package/dist/serve/docs-ui/docs/pyric-storage-reference-rules-subset/index.html +73 -0
- package/dist/serve/docs-ui/docs/pyric-storage-reference-rules-subset.md +90 -0
- package/dist/serve/docs-ui/docs/pyric-storage-reference-storage-options/index.html +45 -0
- package/dist/serve/docs-ui/docs/pyric-storage-reference-storage-options.md +65 -0
- package/dist/serve/docs-ui/docs/pyric-storage-tutorials-01-upload-and-download/index.html +114 -0
- package/dist/serve/docs-ui/docs/pyric-storage-tutorials-01-upload-and-download.md +141 -0
- package/dist/serve/docs-ui/docs/pyric-storage.md +63 -0
- package/dist/serve/docs-ui/docs/pyric-tools/index.html +45 -0
- package/dist/serve/docs-ui/docs/pyric-tools-bridge/index.html +71 -0
- package/dist/serve/docs-ui/docs/pyric-tools-bridge.md +90 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy/index.html +59 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-explanation-primitives-vs-orchestrators/index.html +63 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-explanation-primitives-vs-orchestrators.md +83 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-explanation-token-caching/index.html +47 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-explanation-token-caching.md +70 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-explanation-why-no-firebase-cli/index.html +36 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-explanation-why-no-firebase-cli.md +50 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-explanation-why-this-package-exists/index.html +47 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-explanation-why-this-package-exists.md +60 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-build-projectscope-from-firebase-auth/index.html +55 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-build-projectscope-from-firebase-auth.md +68 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-build-projectscope-from-service-account/index.html +35 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-build-projectscope-from-service-account.md +52 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-bundle-and-deploy-a-function/index.html +81 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-bundle-and-deploy-a-function.md +98 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-deploy-firestore-indexes/index.html +71 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-deploy-firestore-indexes.md +91 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-deploy-firestore-rules/index.html +100 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-deploy-firestore-rules.md +105 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-deploy-hosting-rewrites/index.html +86 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-deploy-hosting-rewrites.md +92 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-deploy-realtime-database-rules/index.html +132 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-deploy-realtime-database-rules.md +165 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-deploy-to-a-preview-channel/index.html +46 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-deploy-to-a-preview-channel.md +62 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-handle-errors-and-outcomes/index.html +75 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-handle-errors-and-outcomes.md +94 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-provision-a-firestore-database/index.html +48 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-provision-a-firestore-database.md +65 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-register-tools-with-an-agent/index.html +65 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-how-to-register-tools-with-an-agent.md +82 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-reference-api/index.html +155 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-reference-api.md +190 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-reference-cli-agent-io/index.html +84 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-reference-cli-agent-io.md +66 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-reference-error-codes/index.html +71 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-reference-error-codes.md +102 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-reference-firestore-namespace/index.html +138 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-reference-firestore-namespace.md +175 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-reference-functions-namespace/index.html +105 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-reference-functions-namespace.md +133 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-reference-hosting-config/index.html +194 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-reference-hosting-config.md +95 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-reference-hosting-namespace/index.html +99 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-reference-hosting-namespace.md +126 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-reference-rtdb-namespace/index.html +110 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-reference-rtdb-namespace.md +133 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-reference-scope-and-outcome/index.html +68 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-reference-scope-and-outcome.md +88 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-reference-tool-factories/index.html +160 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-reference-tool-factories.md +104 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-tutorials-01-deploy-a-cloud-function/index.html +88 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy-tutorials-01-deploy-a-cloud-function.md +119 -0
- package/dist/serve/docs-ui/docs/pyric-tools-deploy.md +52 -0
- package/dist/serve/docs-ui/docs/pyric-tools-how-to-build-a-standalone-binary/index.html +92 -0
- package/dist/serve/docs-ui/docs/pyric-tools-how-to-build-a-standalone-binary.md +95 -0
- package/dist/serve/docs-ui/docs/pyric-tools-how-to-configure-auth-providers-and-domains/index.html +101 -0
- package/dist/serve/docs-ui/docs/pyric-tools-how-to-configure-auth-providers-and-domains.md +126 -0
- package/dist/serve/docs-ui/docs/pyric-tools-how-to-discover-a-schema-from-firestore/index.html +95 -0
- package/dist/serve/docs-ui/docs/pyric-tools-how-to-discover-a-schema-from-firestore.md +119 -0
- package/dist/serve/docs-ui/docs/pyric-tools-how-to-promote-sandbox-state-to-a-fixture/index.html +52 -0
- package/dist/serve/docs-ui/docs/pyric-tools-how-to-promote-sandbox-state-to-a-fixture.md +83 -0
- package/dist/serve/docs-ui/docs/pyric-tools-how-to-serve-persistence-and-multi-tab/index.html +232 -0
- package/dist/serve/docs-ui/docs/pyric-tools-how-to-serve-persistence-and-multi-tab.md +178 -0
- package/dist/serve/docs-ui/docs/pyric-tools-how-to-use-the-vite-plugin/index.html +340 -0
- package/dist/serve/docs-ui/docs/pyric-tools-how-to-use-the-vite-plugin.md +288 -0
- package/dist/serve/docs-ui/docs/pyric-tools-how-to-verify-against-a-captured-session/index.html +128 -0
- package/dist/serve/docs-ui/docs/pyric-tools-how-to-verify-against-a-captured-session.md +173 -0
- package/dist/serve/docs-ui/docs/pyric-tools-reference-cli/index.html +433 -0
- package/dist/serve/docs-ui/docs/pyric-tools-reference-cli.md +252 -0
- package/dist/serve/docs-ui/docs/pyric-tools-reference-verify/index.html +81 -0
- package/dist/serve/docs-ui/docs/pyric-tools-reference-verify.md +98 -0
- package/dist/serve/docs-ui/docs/pyric-tools-tutorials-getting-started/index.html +92 -0
- package/dist/serve/docs-ui/docs/pyric-tools-tutorials-getting-started.md +117 -0
- package/dist/serve/docs-ui/docs/pyric-tools-tutorials-server-adoption/index.html +221 -0
- package/dist/serve/docs-ui/docs/pyric-tools-tutorials-server-adoption.md +239 -0
- package/dist/serve/docs-ui/docs/pyric-tools-tutorials-wire-claude-code/index.html +205 -0
- package/dist/serve/docs-ui/docs/pyric-tools-tutorials-wire-claude-code.md +250 -0
- package/dist/serve/docs-ui/docs/pyric-tools.md +47 -0
- package/dist/serve/docs-ui/docs/ui/index.html +76 -0
- package/dist/serve/docs-ui/docs/ui-auth-authsigninhelper/index.html +194 -0
- package/dist/serve/docs-ui/docs/ui-auth-authsigninhelper.md +108 -0
- package/dist/serve/docs-ui/docs/ui-auth-authusers/index.html +258 -0
- package/dist/serve/docs-ui/docs/ui-auth-authusers.md +174 -0
- package/dist/serve/docs-ui/docs/ui-firestore-collectionlist/index.html +92 -0
- package/dist/serve/docs-ui/docs/ui-firestore-collectionlist.md +71 -0
- package/dist/serve/docs-ui/docs/ui-firestore-deletewithconfirm/index.html +128 -0
- package/dist/serve/docs-ui/docs/ui-firestore-deletewithconfirm.md +94 -0
- package/dist/serve/docs-ui/docs/ui-firestore-documenteditor/index.html +154 -0
- package/dist/serve/docs-ui/docs/ui-firestore-documenteditor.md +107 -0
- package/dist/serve/docs-ui/docs/ui-firestore-documentlist/index.html +132 -0
- package/dist/serve/docs-ui/docs/ui-firestore-documentlist.md +86 -0
- package/dist/serve/docs-ui/docs/ui-firestore-documentpreview/index.html +159 -0
- package/dist/serve/docs-ui/docs/ui-firestore-documentpreview.md +78 -0
- package/dist/serve/docs-ui/docs/ui-firestore-querybuilder/index.html +104 -0
- package/dist/serve/docs-ui/docs/ui-firestore-querybuilder.md +95 -0
- package/dist/serve/docs-ui/docs/ui-firestore-referencepicker/index.html +113 -0
- package/dist/serve/docs-ui/docs/ui-firestore-referencepicker.md +85 -0
- package/dist/serve/docs-ui/docs/ui-primitives-badge/index.html +56 -0
- package/dist/serve/docs-ui/docs/ui-primitives-badge.md +34 -0
- package/dist/serve/docs-ui/docs/ui-primitives-confirmdialog/index.html +140 -0
- package/dist/serve/docs-ui/docs/ui-primitives-confirmdialog.md +98 -0
- package/dist/serve/docs-ui/docs/ui-primitives-copybutton/index.html +58 -0
- package/dist/serve/docs-ui/docs/ui-primitives-copybutton.md +31 -0
- package/dist/serve/docs-ui/docs/ui-primitives-jsonview/index.html +58 -0
- package/dist/serve/docs-ui/docs/ui-primitives-jsonview.md +41 -0
- package/dist/serve/docs-ui/docs/ui-primitives-segmentedcontrol/index.html +70 -0
- package/dist/serve/docs-ui/docs/ui-primitives-segmentedcontrol.md +44 -0
- package/dist/serve/docs-ui/docs/ui-primitives-toast/index.html +87 -0
- package/dist/serve/docs-ui/docs/ui-primitives-toast.md +74 -0
- package/dist/serve/docs-ui/docs/ui-primitives-virtuallist/index.html +85 -0
- package/dist/serve/docs-ui/docs/ui-primitives-virtuallist.md +48 -0
- package/dist/serve/docs-ui/docs/ui-storage/index.html +154 -0
- package/dist/serve/docs-ui/docs/ui-storage-deleteselectionwithconfirm/index.html +127 -0
- package/dist/serve/docs-ui/docs/ui-storage-deleteselectionwithconfirm.md +83 -0
- package/dist/serve/docs-ui/docs/ui-storage-objectbrowser/index.html +137 -0
- package/dist/serve/docs-ui/docs/ui-storage-objectbrowser.md +84 -0
- package/dist/serve/docs-ui/docs/ui-storage-objectinspector/index.html +139 -0
- package/dist/serve/docs-ui/docs/ui-storage-objectinspector.md +87 -0
- package/dist/serve/docs-ui/docs/ui-storage-pathbreadcrumb/index.html +72 -0
- package/dist/serve/docs-ui/docs/ui-storage-pathbreadcrumb.md +51 -0
- package/dist/serve/docs-ui/docs/ui-storage-rules-aware-affordances/index.html +65 -0
- package/dist/serve/docs-ui/docs/ui-storage-rules-aware-affordances.md +53 -0
- package/dist/serve/docs-ui/docs/ui-storage-uploaddropzone/index.html +93 -0
- package/dist/serve/docs-ui/docs/ui-storage-uploaddropzone.md +72 -0
- package/dist/serve/docs-ui/docs/ui-storage-usestoragerulesgate/index.html +153 -0
- package/dist/serve/docs-ui/docs/ui-storage-usestoragerulesgate.md +105 -0
- package/dist/serve/docs-ui/docs/ui-storage.md +165 -0
- package/dist/serve/docs-ui/docs/ui-traffic/index.html +88 -0
- package/dist/serve/docs-ui/docs/ui-traffic-ruleheatmap/index.html +79 -0
- package/dist/serve/docs-ui/docs/ui-traffic-ruleheatmap.md +54 -0
- package/dist/serve/docs-ui/docs/ui-traffic-trafficdetail/index.html +78 -0
- package/dist/serve/docs-ui/docs/ui-traffic-trafficdetail.md +53 -0
- package/dist/serve/docs-ui/docs/ui-traffic-trafficlog/index.html +118 -0
- package/dist/serve/docs-ui/docs/ui-traffic-trafficlog.md +63 -0
- package/dist/serve/docs-ui/docs/ui-traffic-trafficstats/index.html +51 -0
- package/dist/serve/docs-ui/docs/ui-traffic-trafficstats.md +40 -0
- package/dist/serve/docs-ui/docs/ui-traffic.md +96 -0
- package/dist/serve/docs-ui/docs/ui.md +88 -0
- package/dist/serve/docs-ui/index.html +1 -0
- package/dist/serve/docs-ui/llms.txt +221 -0
- package/dist/serve/entries/app.d.ts +26 -0
- package/dist/serve/entries/app.d.ts.map +1 -0
- package/dist/serve/entries/app.js +51 -0
- package/dist/serve/entries/app.js.map +1 -0
- package/dist/serve/entries/auth-helper-core.d.ts +47 -0
- package/dist/serve/entries/auth-helper-core.d.ts.map +1 -0
- package/dist/serve/entries/auth-helper-core.js +121 -0
- package/dist/serve/entries/auth-helper-core.js.map +1 -0
- package/dist/serve/entries/auth-helper-dom.d.ts +14 -0
- package/dist/serve/entries/auth-helper-dom.d.ts.map +1 -0
- package/dist/serve/entries/auth-helper-dom.js +116 -0
- package/dist/serve/entries/auth-helper-dom.js.map +1 -0
- package/dist/serve/entries/auth.d.ts +62 -0
- package/dist/serve/entries/auth.d.ts.map +1 -0
- package/dist/serve/entries/auth.js +128 -0
- package/dist/serve/entries/auth.js.map +1 -0
- package/dist/serve/entries/bridge-url.d.ts +25 -0
- package/dist/serve/entries/bridge-url.d.ts.map +1 -0
- package/dist/serve/entries/bridge-url.js +30 -0
- package/dist/serve/entries/bridge-url.js.map +1 -0
- package/dist/serve/entries/database.d.ts +34 -0
- package/dist/serve/entries/database.d.ts.map +1 -0
- package/dist/serve/entries/database.js +42 -0
- package/dist/serve/entries/database.js.map +1 -0
- package/dist/serve/entries/firestore.d.ts +68 -0
- package/dist/serve/entries/firestore.d.ts.map +1 -0
- package/dist/serve/entries/firestore.js +115 -0
- package/dist/serve/entries/firestore.js.map +1 -0
- package/dist/serve/entries/init.d.ts +2 -0
- package/dist/serve/entries/init.d.ts.map +1 -0
- package/dist/serve/entries/init.js +14 -0
- package/dist/serve/entries/init.js.map +1 -0
- package/dist/serve/entries/keepalive.d.ts +20 -0
- package/dist/serve/entries/keepalive.d.ts.map +1 -0
- package/dist/serve/entries/keepalive.js +38 -0
- package/dist/serve/entries/keepalive.js.map +1 -0
- package/dist/serve/entries/runtime.d.ts +60 -0
- package/dist/serve/entries/runtime.d.ts.map +1 -0
- package/dist/serve/entries/runtime.js +555 -0
- package/dist/serve/entries/runtime.js.map +1 -0
- package/dist/serve/entries/session-store.d.ts +45 -0
- package/dist/serve/entries/session-store.d.ts.map +1 -0
- package/dist/serve/entries/session-store.js +71 -0
- package/dist/serve/entries/session-store.js.map +1 -0
- package/dist/serve/entries/storage.d.ts +23 -0
- package/dist/serve/entries/storage.d.ts.map +1 -0
- package/dist/serve/entries/storage.js +49 -0
- package/dist/serve/entries/storage.js.map +1 -0
- package/dist/serve/entries/tab-sync-wiring.d.ts +88 -0
- package/dist/serve/entries/tab-sync-wiring.d.ts.map +1 -0
- package/dist/serve/entries/tab-sync-wiring.js +217 -0
- package/dist/serve/entries/tab-sync-wiring.js.map +1 -0
- package/dist/serve/namespace.d.ts +93 -0
- package/dist/serve/namespace.d.ts.map +1 -0
- package/dist/serve/namespace.js +367 -0
- package/dist/serve/namespace.js.map +1 -0
- package/dist/serve/open-browser.d.ts +23 -0
- package/dist/serve/open-browser.d.ts.map +1 -0
- package/dist/serve/open-browser.js +58 -0
- package/dist/serve/open-browser.js.map +1 -0
- package/dist/serve/playground-ui/_astro/HomePage.BFOjZGZp.js +2 -0
- package/dist/serve/playground-ui/_astro/PlaygroundPage.3jki8il0.js +3300 -0
- package/dist/serve/playground-ui/_astro/PlaygroundPage.MhP_vFvK.css +32 -0
- package/dist/serve/playground-ui/_astro/TopBar.ChifCjLD.js +5025 -0
- package/dist/serve/playground-ui/_astro/client.D61DpmEZ.js +274 -0
- package/dist/serve/playground-ui/_astro/client.GCK88uRs.js +1 -0
- package/dist/serve/playground-ui/_astro/esbuild.BHljloGq.wasm +0 -0
- package/dist/serve/playground-ui/_astro/index.B9aLOeXL.js +29 -0
- package/dist/serve/playground-ui/_astro/index.BTKE7uRF.js +1227 -0
- package/dist/serve/playground-ui/_astro/index.BfCthstx.css +1 -0
- package/dist/serve/playground-ui/_astro/index.Mr0Dtjih.js +342 -0
- package/dist/serve/playground-ui/_astro/ort-wasm-simd-threaded.asyncify.DMmc6YqF.wasm +0 -0
- package/dist/serve/playground-ui/favicon.svg +4 -0
- package/dist/serve/playground-ui/index.html +2 -0
- package/dist/serve/playground-ui/playground/index.html +2 -0
- package/dist/serve/rules.d.ts +45 -0
- package/dist/serve/rules.d.ts.map +1 -0
- package/dist/serve/rules.js +139 -0
- package/dist/serve/rules.js.map +1 -0
- package/dist/serve/sandbox-marker.d.ts +9 -0
- package/dist/serve/sandbox-marker.d.ts.map +1 -0
- package/dist/serve/sandbox-marker.js +32 -0
- package/dist/serve/sandbox-marker.js.map +1 -0
- package/dist/serve/server.d.ts +135 -0
- package/dist/serve/server.d.ts.map +1 -0
- package/dist/serve/server.js +328 -0
- package/dist/serve/server.js.map +1 -0
- package/dist/serve/standalone-assets.d.ts +66 -0
- package/dist/serve/standalone-assets.d.ts.map +1 -0
- package/dist/serve/standalone-assets.js +144 -0
- package/dist/serve/standalone-assets.js.map +1 -0
- package/dist/serve/state-store.d.ts +45 -0
- package/dist/serve/state-store.d.ts.map +1 -0
- package/dist/serve/state-store.js +120 -0
- package/dist/serve/state-store.js.map +1 -0
- package/dist/serve/studio/disk-project-store.d.ts +9 -0
- package/dist/serve/studio/disk-project-store.d.ts.map +1 -0
- package/dist/serve/studio/disk-project-store.js +173 -0
- package/dist/serve/studio/disk-project-store.js.map +1 -0
- package/dist/serve/studio/disk-workspace.d.ts +14 -0
- package/dist/serve/studio/disk-workspace.d.ts.map +1 -0
- package/dist/serve/studio/disk-workspace.js +152 -0
- package/dist/serve/studio/disk-workspace.js.map +1 -0
- package/dist/serve/studio/index.d.ts +10 -0
- package/dist/serve/studio/index.d.ts.map +1 -0
- package/dist/serve/studio/index.js +9 -0
- package/dist/serve/studio/index.js.map +1 -0
- package/dist/serve/studio/routes.d.ts +40 -0
- package/dist/serve/studio/routes.d.ts.map +1 -0
- package/dist/serve/studio/routes.js +182 -0
- package/dist/serve/studio/routes.js.map +1 -0
- package/dist/serve/studio/store-types.d.ts +45 -0
- package/dist/serve/studio/store-types.d.ts.map +1 -0
- package/dist/serve/studio/store-types.js +11 -0
- package/dist/serve/studio/store-types.js.map +1 -0
- package/dist/serve/studio-ui/assets/RulesCodeEditor-Bncteb8z.js +23 -0
- package/dist/serve/studio-ui/assets/index-CmkJxFcG.js +4577 -0
- package/dist/serve/studio-ui/assets/index-DNK39P6C.css +1 -0
- package/dist/serve/studio-ui/assets/seed-Bab4ArXQ.js +2 -0
- package/dist/serve/studio-ui/index.html +32 -0
- package/dist/serve/studio-ui/pyric-logo.svg +76 -0
- package/dist/serve/vite-plugin.d.ts +57 -0
- package/dist/serve/vite-plugin.d.ts.map +1 -0
- package/dist/serve/vite-plugin.js +687 -0
- package/dist/serve/vite-plugin.js.map +1 -0
- package/dist/serve/worker/client.d.ts +668 -0
- package/dist/serve/worker/client.d.ts.map +1 -0
- package/dist/serve/worker/client.js +1635 -0
- package/dist/serve/worker/client.js.map +1 -0
- package/dist/serve/worker/entry.d.ts +40 -0
- package/dist/serve/worker/entry.d.ts.map +1 -0
- package/dist/serve/worker/entry.js +122 -0
- package/dist/serve/worker/entry.js.map +1 -0
- package/dist/serve/worker/host-auth.d.ts +47 -0
- package/dist/serve/worker/host-auth.d.ts.map +1 -0
- package/dist/serve/worker/host-auth.js +434 -0
- package/dist/serve/worker/host-auth.js.map +1 -0
- package/dist/serve/worker/host-context.d.ts +180 -0
- package/dist/serve/worker/host-context.d.ts.map +1 -0
- package/dist/serve/worker/host-context.js +45 -0
- package/dist/serve/worker/host-context.js.map +1 -0
- package/dist/serve/worker/host-events.d.ts +21 -0
- package/dist/serve/worker/host-events.d.ts.map +1 -0
- package/dist/serve/worker/host-events.js +87 -0
- package/dist/serve/worker/host-events.js.map +1 -0
- package/dist/serve/worker/host.d.ts +81 -0
- package/dist/serve/worker/host.d.ts.map +1 -0
- package/dist/serve/worker/host.js +1605 -0
- package/dist/serve/worker/host.js.map +1 -0
- package/dist/serve/worker/index.d.ts +22 -0
- package/dist/serve/worker/index.d.ts.map +1 -0
- package/dist/serve/worker/index.js +61 -0
- package/dist/serve/worker/index.js.map +1 -0
- package/dist/serve/worker/protocol.d.ts +955 -0
- package/dist/serve/worker/protocol.d.ts.map +1 -0
- package/dist/serve/worker/protocol.js +197 -0
- package/dist/serve/worker/protocol.js.map +1 -0
- package/dist/serve/worker/serve-init.d.ts +192 -0
- package/dist/serve/worker/serve-init.d.ts.map +1 -0
- package/dist/serve/worker/serve-init.js +555 -0
- package/dist/serve/worker/serve-init.js.map +1 -0
- package/dist/serve/writer-lock.d.ts +32 -0
- package/dist/serve/writer-lock.d.ts.map +1 -0
- package/dist/serve/writer-lock.js +43 -0
- package/dist/serve/writer-lock.js.map +1 -0
- package/dist/verify/cases.d.ts +37 -0
- package/dist/verify/cases.d.ts.map +1 -0
- package/dist/verify/cases.js +173 -0
- package/dist/verify/cases.js.map +1 -0
- package/dist/verify/fixture.d.ts +79 -0
- package/dist/verify/fixture.d.ts.map +1 -0
- package/dist/verify/fixture.js +114 -0
- package/dist/verify/fixture.js.map +1 -0
- package/dist/verify/index.d.ts +102 -0
- package/dist/verify/index.d.ts.map +1 -0
- package/dist/verify/index.js +318 -0
- package/dist/verify/index.js.map +1 -0
- package/dist/verify/tools.d.ts +7 -0
- package/dist/verify/tools.d.ts.map +1 -0
- package/dist/verify/tools.js +83 -0
- package/dist/verify/tools.js.map +1 -0
- package/dist/vite.d.ts +12 -0
- package/dist/vite.d.ts.map +1 -0
- package/dist/vite.js +16 -0
- package/dist/vite.js.map +1 -0
- package/package.json +127 -0
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `/__pyric/` reserved namespace — pyric's analog of firebase serve's
|
|
3
|
+
* `/__/firebase/` namespace:
|
|
4
|
+
*
|
|
5
|
+
* /__pyric/sdk/<file>.js the bundled SDK files (import-map targets +
|
|
6
|
+
* the injected init script + shared chunks)
|
|
7
|
+
* /__pyric/init.json the page init payload (rules, bridge URL) —
|
|
8
|
+
* fetched by the runtime chunk at module init
|
|
9
|
+
*
|
|
10
|
+
* Bridge routes (`/__pyric/mcp`, `/__pyric/sandbox`) mount here in P2.
|
|
11
|
+
*/
|
|
12
|
+
import { existsSync, statSync } from 'node:fs';
|
|
13
|
+
import { basename, extname, join } from 'node:path';
|
|
14
|
+
import { collectBody } from '../bridge/server/peer.js';
|
|
15
|
+
import { StateFileError } from './state-store.js';
|
|
16
|
+
import { createWriterLock } from './writer-lock.js';
|
|
17
|
+
import { createStudioRoutes } from './studio/index.js';
|
|
18
|
+
import { contentTypeFor, pipeFileToResponse, resolveStaticFile } from './server.js';
|
|
19
|
+
import { SANDBOX_BUILD_MARKER } from './sandbox-marker.js';
|
|
20
|
+
export function createEventHub() {
|
|
21
|
+
const clients = new Set();
|
|
22
|
+
return {
|
|
23
|
+
handle(req, res) {
|
|
24
|
+
res.writeHead(200, {
|
|
25
|
+
'content-type': 'text/event-stream',
|
|
26
|
+
'cache-control': 'no-store',
|
|
27
|
+
connection: 'keep-alive',
|
|
28
|
+
});
|
|
29
|
+
res.write(': connected\n\n');
|
|
30
|
+
clients.add(res);
|
|
31
|
+
req.on('close', () => clients.delete(res));
|
|
32
|
+
// A dying SSE socket must never surface an unhandled 'error' event
|
|
33
|
+
// (which would kill the whole serve process) — drop the client instead.
|
|
34
|
+
res.on('error', () => clients.delete(res));
|
|
35
|
+
},
|
|
36
|
+
broadcast(event, data) {
|
|
37
|
+
const frame = `event: ${event}\ndata: ${JSON.stringify(data)}\n\n`;
|
|
38
|
+
for (const res of clients) {
|
|
39
|
+
try {
|
|
40
|
+
res.write(frame);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
clients.delete(res); // half-closed socket in the close race window
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
clientCount: () => clients.size,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/** The page's persistence backend speaks this route:
|
|
51
|
+
* GET /__pyric/state → whole envelope (404 when absent)
|
|
52
|
+
* GET /__pyric/state?section=firestore → that section (404 when null)
|
|
53
|
+
* POST /__pyric/state?section=... → write the section (204; 423 if
|
|
54
|
+
* another tab holds the writer lock)
|
|
55
|
+
* DELETE /__pyric/state → release the writer lock (beacon)
|
|
56
|
+
* Writes carry `x-pyric-writer: <id>`; the first writer wins, others get 423
|
|
57
|
+
* and drop to read-only (pre-mortem #3). The firestore body is the sandbox
|
|
58
|
+
* persistence controller's own blob — stored verbatim, never interpreted. */
|
|
59
|
+
async function handleState(state, lock, req, res, url) {
|
|
60
|
+
const section = url.searchParams.get('section');
|
|
61
|
+
const writerId = req.headers['x-pyric-writer'] ?? '';
|
|
62
|
+
try {
|
|
63
|
+
if (req.method === 'GET') {
|
|
64
|
+
const value = section ? state.readSection(section) : state.load();
|
|
65
|
+
if (value === null) {
|
|
66
|
+
res.writeHead(404, { 'content-type': 'application/json' }).end('null');
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
res.writeHead(200, {
|
|
70
|
+
'content-type': 'application/json; charset=utf-8',
|
|
71
|
+
'cache-control': 'no-store',
|
|
72
|
+
// Lets `pyric snapshot` detect it scanned into a NEIGHBOR project's
|
|
73
|
+
// serve (pre-mortem #4) and warn instead of promoting the wrong DB.
|
|
74
|
+
'x-pyric-project-dir': state.projectDir,
|
|
75
|
+
});
|
|
76
|
+
res.end(JSON.stringify(value));
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (req.method === 'DELETE') {
|
|
80
|
+
if (writerId)
|
|
81
|
+
lock.release(writerId);
|
|
82
|
+
res.writeHead(204).end();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (req.method === 'PUT') {
|
|
86
|
+
// Lock heartbeat — refresh/claim WITHOUT writing state. 423 if another
|
|
87
|
+
// live tab holds it.
|
|
88
|
+
res.writeHead(lock.claim(writerId || 'anon', Date.now()) ? 204 : 423).end();
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (req.method === 'POST') {
|
|
92
|
+
if (section !== 'firestore' && section !== 'auth') {
|
|
93
|
+
res.writeHead(400).end('section must be firestore|auth');
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
// Single-writer: the first page to flush claims the lock; a different
|
|
97
|
+
// live page is refused (423) so it can't erase the writer's world.
|
|
98
|
+
if (!lock.claim(writerId || 'anon', Date.now())) {
|
|
99
|
+
res.writeHead(423, { 'content-type': 'text/plain' }).end(`another tab holds the persist writer lock (held by ${lock.holder()})`);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const body = await collectBody(req);
|
|
103
|
+
state.writeSection(section, body);
|
|
104
|
+
res.writeHead(204).end();
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
res.writeHead(405, { allow: 'GET, POST, DELETE' }).end('method not allowed');
|
|
108
|
+
}
|
|
109
|
+
catch (e) {
|
|
110
|
+
// StateFileError (corrupt/version) or bad body — surface, don't clobber.
|
|
111
|
+
res.writeHead(e instanceof StateFileError ? 409 : 400, { 'content-type': 'text/plain' });
|
|
112
|
+
res.end(e instanceof Error ? e.message : String(e));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Handle POST /__pyric/capture — the page pushes its full session fixture
|
|
117
|
+
* (JSON-serialized history + snapshot + rules) whenever the sandbox changes.
|
|
118
|
+
* The server writes it verbatim to `.pyric/last-session.json` so
|
|
119
|
+
* `pyric verify` can pick it up without any extra arguments.
|
|
120
|
+
*
|
|
121
|
+
* GET returns the current fixture JSON verbatim (200), or 404 when nothing
|
|
122
|
+
* has been captured yet. The served SharedWorker fetches this on boot to
|
|
123
|
+
* re-hydrate its in-memory event history after a worker death (Traffic /
|
|
124
|
+
* activity / metrics survive the refresh even though the worker restarted).
|
|
125
|
+
* Cheap + read-only.
|
|
126
|
+
*
|
|
127
|
+
* POST fails fast rather than silently swallowing write errors so the
|
|
128
|
+
* developer knows the capture is broken.
|
|
129
|
+
*
|
|
130
|
+
* We collect the RAW request body as a string rather than using
|
|
131
|
+
* `collectBody` (which parses JSON). The capture must be stored verbatim
|
|
132
|
+
* — re-serializing a parsed object would round-trip through JS values and
|
|
133
|
+
* could alter key order or lose whitespace, making the file differ from
|
|
134
|
+
* what the page intended to write.
|
|
135
|
+
*/
|
|
136
|
+
async function handleCapture(capture, req, res) {
|
|
137
|
+
if (req.method === 'GET') {
|
|
138
|
+
const body = capture.read();
|
|
139
|
+
if (body === null) {
|
|
140
|
+
res.writeHead(404, { 'content-type': 'application/json' }).end('null');
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
res.writeHead(200, {
|
|
144
|
+
'content-type': 'application/json; charset=utf-8',
|
|
145
|
+
'cache-control': 'no-store',
|
|
146
|
+
});
|
|
147
|
+
res.end(body);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (req.method !== 'POST') {
|
|
151
|
+
res.writeHead(405, { allow: 'GET, POST' }).end('method not allowed');
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
try {
|
|
155
|
+
const body = await new Promise((resolve, reject) => {
|
|
156
|
+
let raw = '';
|
|
157
|
+
req.setEncoding('utf8');
|
|
158
|
+
req.on('data', (chunk) => { raw += chunk; });
|
|
159
|
+
req.on('end', () => resolve(raw));
|
|
160
|
+
req.on('error', reject);
|
|
161
|
+
});
|
|
162
|
+
capture.write(body);
|
|
163
|
+
res.writeHead(204).end();
|
|
164
|
+
}
|
|
165
|
+
catch (e) {
|
|
166
|
+
res.writeHead(400, { 'content-type': 'text/plain' });
|
|
167
|
+
res.end(e instanceof Error ? e.message : String(e));
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
export function createPyricNamespace(opts) {
|
|
171
|
+
const writerLock = createWriterLock();
|
|
172
|
+
const studioRoutes = opts.studio ? createStudioRoutes(opts.studio) : null;
|
|
173
|
+
return (req, res, url) => {
|
|
174
|
+
if (studioRoutes &&
|
|
175
|
+
(url.pathname.startsWith('/__pyric/workspace') ||
|
|
176
|
+
url.pathname.startsWith('/__pyric/projects'))) {
|
|
177
|
+
return studioRoutes(req, res, url);
|
|
178
|
+
}
|
|
179
|
+
if (opts.state && url.pathname === '/__pyric/state') {
|
|
180
|
+
return handleState(opts.state, writerLock, req, res, url).then(() => true);
|
|
181
|
+
}
|
|
182
|
+
if (opts.capture && url.pathname === '/__pyric/capture') {
|
|
183
|
+
return handleCapture(opts.capture, req, res).then(() => true);
|
|
184
|
+
}
|
|
185
|
+
if (opts.events && url.pathname === '/__pyric/events') {
|
|
186
|
+
opts.events.handle(req, res);
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
if (url.pathname === '/__pyric/init.json') {
|
|
190
|
+
res.writeHead(200, { 'content-type': 'application/json; charset=utf-8', 'cache-control': 'no-store' });
|
|
191
|
+
res.end(JSON.stringify(opts.initPayload()));
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
if (url.pathname.startsWith('/__pyric/sdk/')) {
|
|
195
|
+
// basename() flattens any traversal attempt — the sdk dir is flat.
|
|
196
|
+
const file = join(opts.sdkDir, basename(url.pathname));
|
|
197
|
+
if (!existsSync(file)) {
|
|
198
|
+
res.writeHead(404).end('not found');
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
const type = file.endsWith('.map') ? 'application/json' : 'text/javascript; charset=utf-8';
|
|
202
|
+
// Immutable-friendly: bundle filenames are content-hashed chunks or
|
|
203
|
+
// cache-keyed outputs; still no-store in dev for simplicity.
|
|
204
|
+
res.writeHead(200, { 'content-type': type, 'cache-control': 'no-store' });
|
|
205
|
+
pipeFileToResponse(file, res);
|
|
206
|
+
return true;
|
|
207
|
+
}
|
|
208
|
+
if (opts.playgroundUiDir && (url.pathname === '/__pyric/playground' || url.pathname.startsWith('/__pyric/playground/'))) {
|
|
209
|
+
if (url.pathname === '/__pyric/playground') {
|
|
210
|
+
res.writeHead(301, { location: '/__pyric/playground/' }).end();
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
213
|
+
const rel = url.pathname.slice('/__pyric/playground'.length) || '/';
|
|
214
|
+
let file = resolveStaticFile(opts.playgroundUiDir, rel);
|
|
215
|
+
if (!file && !extname(rel))
|
|
216
|
+
file = resolveStaticFile(opts.playgroundUiDir, '/index.html');
|
|
217
|
+
if (!file) {
|
|
218
|
+
res.writeHead(404).end('not found');
|
|
219
|
+
return true;
|
|
220
|
+
}
|
|
221
|
+
res.writeHead(200, { 'content-type': contentTypeFor(file), 'cache-control': 'no-store' });
|
|
222
|
+
pipeFileToResponse(file, res);
|
|
223
|
+
return true;
|
|
224
|
+
}
|
|
225
|
+
// Embedded docs site (site-docs). MUST run BEFORE the general
|
|
226
|
+
// `/__pyric/ui/` studio handler below: that handler's SPA fallback answers
|
|
227
|
+
// every miss with Studio's index.html, which would swallow docs pages and
|
|
228
|
+
// (worse) return HTML for a missing docs asset. Built with base
|
|
229
|
+
// `/__pyric/ui/`, the docs output lives in TWO subtrees under the mount —
|
|
230
|
+
// pages/twins/index.json under `/__pyric/ui/docs/`, and shared assets at
|
|
231
|
+
// `/__pyric/ui/_astro/` (Astro's asset dir sits at the base root, not under
|
|
232
|
+
// `docs/`). We claim both; `_astro` is Astro-specific and never collides
|
|
233
|
+
// with Studio (Vite emits `/__pyric/ui/assets/`). No SPA fallback here — a
|
|
234
|
+
// genuinely missing docs page 404s (a broken doc link must fail loudly, not
|
|
235
|
+
// masquerade as another page). Directory-format pages (`<slug>/index.html`)
|
|
236
|
+
// and `bunx serve`-style extensionless→trailing-slash redirects are handled
|
|
237
|
+
// by resolveStaticFile + the directory redirect below.
|
|
238
|
+
if (opts.docsUiDir &&
|
|
239
|
+
(url.pathname === '/__pyric/ui/docs' ||
|
|
240
|
+
url.pathname.startsWith('/__pyric/ui/docs/') ||
|
|
241
|
+
url.pathname.startsWith('/__pyric/ui/_astro/'))) {
|
|
242
|
+
const rel = url.pathname.slice('/__pyric/ui'.length) || '/';
|
|
243
|
+
// `bunx serve` parity: an extensionless path that names a real directory
|
|
244
|
+
// (e.g. `/__pyric/ui/docs` or `/__pyric/ui/docs/<slug>`) redirects to the
|
|
245
|
+
// trailing-slash form so the directory's index.html loads with correct
|
|
246
|
+
// relative-URL resolution.
|
|
247
|
+
if (!rel.endsWith('/') && !extname(rel)) {
|
|
248
|
+
const dir = join(opts.docsUiDir, decodeURIComponent(rel));
|
|
249
|
+
if (existsSync(dir) && statSync(dir).isDirectory()) {
|
|
250
|
+
res.writeHead(301, { location: `${url.pathname}/` }).end();
|
|
251
|
+
return true;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
const file = resolveStaticFile(opts.docsUiDir, rel);
|
|
255
|
+
if (!file) {
|
|
256
|
+
res.writeHead(404).end('not found');
|
|
257
|
+
return true;
|
|
258
|
+
}
|
|
259
|
+
res.writeHead(200, { 'content-type': contentTypeFor(file), 'cache-control': 'no-store' });
|
|
260
|
+
pipeFileToResponse(file, res);
|
|
261
|
+
return true;
|
|
262
|
+
}
|
|
263
|
+
if (opts.studioUiDir &&
|
|
264
|
+
(url.pathname === '/__pyric/ui' || url.pathname.startsWith('/__pyric/ui/'))) {
|
|
265
|
+
// The built Pyric Studio app. Served verbatim (NOT through
|
|
266
|
+
// injectServeTags: that import-map/init injection is for sandbox pages,
|
|
267
|
+
// not Studio). Studio uses History-API routing under this mount, so any
|
|
268
|
+
// path that doesn't resolve to a real file falls back to index.html —
|
|
269
|
+
// INCLUDING paths with dots (deep links like /storage/uploads/logo.png).
|
|
270
|
+
// Only misses under Vite's content-hashed asset dir stay hard 404s, so a
|
|
271
|
+
// broken script/style URL fails loudly instead of returning HTML.
|
|
272
|
+
if (url.pathname === '/__pyric/ui') {
|
|
273
|
+
res.writeHead(301, { location: '/__pyric/ui/' }).end();
|
|
274
|
+
return true;
|
|
275
|
+
}
|
|
276
|
+
const rel = url.pathname.slice('/__pyric/ui'.length) || '/';
|
|
277
|
+
let file = resolveStaticFile(opts.studioUiDir, rel);
|
|
278
|
+
if (!file && !rel.startsWith('/assets/')) {
|
|
279
|
+
file = resolveStaticFile(opts.studioUiDir, '/index.html');
|
|
280
|
+
}
|
|
281
|
+
if (!file) {
|
|
282
|
+
res.writeHead(404).end('not found');
|
|
283
|
+
return true;
|
|
284
|
+
}
|
|
285
|
+
res.writeHead(200, { 'content-type': contentTypeFor(file), 'cache-control': 'no-store' });
|
|
286
|
+
pipeFileToResponse(file, res);
|
|
287
|
+
return true;
|
|
288
|
+
}
|
|
289
|
+
return false; // unknown /__pyric/* → caller 404s
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
// ─── HTML injection ───────────────────────────────────────────────────
|
|
293
|
+
/** The import-map targets. Spec → served URL. */
|
|
294
|
+
export function sdkImportMap() {
|
|
295
|
+
return {
|
|
296
|
+
'firebase/app': '/__pyric/sdk/app.js',
|
|
297
|
+
'firebase/auth': '/__pyric/sdk/auth.js',
|
|
298
|
+
'firebase/database': '/__pyric/sdk/database.js',
|
|
299
|
+
'firebase/firestore': '/__pyric/sdk/firestore.js',
|
|
300
|
+
'firebase/storage': '/__pyric/sdk/storage.js',
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Inject the import map + init script into an HTML document. The import map
|
|
305
|
+
* MUST precede any module script that imports a mapped specifier, so both
|
|
306
|
+
* tags go at the very start of `<head>` (fallbacks: after `<html>`, else
|
|
307
|
+
* prepended). Idempotent — a page already carrying the marker is untouched
|
|
308
|
+
* (matters when transformHtml runs over an SPA fallback repeatedly).
|
|
309
|
+
*/
|
|
310
|
+
export function injectServeTags(html, importMap = sdkImportMap(), workerVersion, forceInPage = false) {
|
|
311
|
+
const MARKER = 'data-pyric-serve';
|
|
312
|
+
if (html.includes(MARKER))
|
|
313
|
+
return html;
|
|
314
|
+
// A pyric SANDBOX BUILD (`vite build` under the pyricSandbox plugin's sandbox
|
|
315
|
+
// mode) already BUNDLES its own runtime + init chunk — injecting the import
|
|
316
|
+
// map + /__pyric/sdk/init.js on top would boot a SECOND runtime instance on
|
|
317
|
+
// the page (two banners, two bridge peer registrations, races between them).
|
|
318
|
+
// The bundle owns the sandbox for a marked page: it fetches
|
|
319
|
+
// /__pyric/init.json itself (worker path: the SharedWorker does; in-page
|
|
320
|
+
// path: the runtime does) and owns rules hot-reload the same way. The ONLY
|
|
321
|
+
// serve-time contribution left is the worker-version staleness stamp, which
|
|
322
|
+
// the bundled runtime reads from this meta to warn about a stale
|
|
323
|
+
// still-running SharedWorker.
|
|
324
|
+
if (html.includes(SANDBOX_BUILD_MARKER)) {
|
|
325
|
+
if (!workerVersion || html.includes('pyric-worker-v'))
|
|
326
|
+
return html;
|
|
327
|
+
const meta = `<meta name="pyric-worker-v" content="${workerVersion}" ${MARKER}>`;
|
|
328
|
+
const headTag = html.match(/<head[^>]*>/i);
|
|
329
|
+
if (headTag && headTag.index !== undefined) {
|
|
330
|
+
const at = headTag.index + headTag[0].length;
|
|
331
|
+
return html.slice(0, at) + meta + html.slice(at);
|
|
332
|
+
}
|
|
333
|
+
return meta + html;
|
|
334
|
+
}
|
|
335
|
+
// Stamp the worker's content hash so the page can DETECT staleness: a live
|
|
336
|
+
// SharedWorker survives serve restarts + reloads and can't hot-update, so it
|
|
337
|
+
// keeps running old code until every tab of the origin closes. The worker
|
|
338
|
+
// name is intentionally STABLE (one backend shared by all tabs), so rather
|
|
339
|
+
// than split tabs across versions, `runtime.ts` compares this served hash to
|
|
340
|
+
// the running worker's baked hash and warns the user to close all tabs.
|
|
341
|
+
const versionMeta = workerVersion
|
|
342
|
+
? `<meta name="pyric-worker-v" content="${workerVersion}" ${MARKER}>`
|
|
343
|
+
: '';
|
|
344
|
+
// `--bridge`: the MCP bridge peers with the IN-PAGE sandbox, so force the page
|
|
345
|
+
// off the default SharedWorker path. Otherwise the agent drives an empty
|
|
346
|
+
// in-page sandbox while the app's data lives in the worker. Set before any app
|
|
347
|
+
// code runs; mirrors the Vite plugin's transformIndexHtml.
|
|
348
|
+
const forceTag = forceInPage
|
|
349
|
+
? `<script ${MARKER}>globalThis.__PYRIC_FORCE_INPAGE__=true;</script>`
|
|
350
|
+
: '';
|
|
351
|
+
const tags = versionMeta +
|
|
352
|
+
forceTag +
|
|
353
|
+
`<script type="importmap" ${MARKER}>${JSON.stringify({ imports: importMap })}</script>` +
|
|
354
|
+
`<script type="module" src="/__pyric/sdk/init.js" ${MARKER}></script>`;
|
|
355
|
+
const head = html.match(/<head[^>]*>/i);
|
|
356
|
+
if (head && head.index !== undefined) {
|
|
357
|
+
const at = head.index + head[0].length;
|
|
358
|
+
return html.slice(0, at) + tags + html.slice(at);
|
|
359
|
+
}
|
|
360
|
+
const htmlTag = html.match(/<html[^>]*>/i);
|
|
361
|
+
if (htmlTag && htmlTag.index !== undefined) {
|
|
362
|
+
const at = htmlTag.index + htmlTag[0].length;
|
|
363
|
+
return html.slice(0, at) + tags + html.slice(at);
|
|
364
|
+
}
|
|
365
|
+
return tags + html;
|
|
366
|
+
}
|
|
367
|
+
//# sourceMappingURL=namespace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namespace.js","sourceRoot":"","sources":["../../src/serve/namespace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAsC,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAmB,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAA2B,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,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,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC3C,IAAI,OAAO,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAC3C,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAC7C,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,IAAI,GAAG,IAAI,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface AutoOpenContext {
|
|
2
|
+
/** `--json` is on (stdout is the agent contract — never pop a browser). */
|
|
3
|
+
json: boolean;
|
|
4
|
+
/** `--no-open` was passed. */
|
|
5
|
+
noOpen: boolean;
|
|
6
|
+
/** stdout is a TTY (interactive). Piped/redirected → false. */
|
|
7
|
+
isTTY: boolean;
|
|
8
|
+
/** process.env, read for CI detection. */
|
|
9
|
+
env: Record<string, string | undefined>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Pure decision: should `pyric dev` auto-open the browser? Factored out so
|
|
13
|
+
* the gating logic is unit-testable without spawning anything. Open only when
|
|
14
|
+
* interactive AND not explicitly suppressed AND not in CI.
|
|
15
|
+
*/
|
|
16
|
+
export declare function shouldAutoOpen(ctx: AutoOpenContext): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Open `url` in the default browser, best-effort. Resolves whether or not the
|
|
19
|
+
* open succeeded — callers must not let a missing `xdg-open` (headless Linux,
|
|
20
|
+
* containers) take down the dev server. Never throws.
|
|
21
|
+
*/
|
|
22
|
+
export declare function openBrowser(url: string): Promise<void>;
|
|
23
|
+
//# sourceMappingURL=open-browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-browser.d.ts","sourceRoot":"","sources":["../../src/serve/open-browser.ts"],"names":[],"mappings":"AAiBA,MAAM,WAAW,eAAe;IAC9B,2EAA2E;IAC3E,IAAI,EAAE,OAAO,CAAC;IACd,8BAA8B;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,+DAA+D;IAC/D,KAAK,EAAE,OAAO,CAAC;IACf,0CAA0C;IAC1C,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CACzC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAI5D;AAgBD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAStD"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Best-effort browser auto-open for `pyric dev`.
|
|
3
|
+
*
|
|
4
|
+
* The pyric sandbox is browser-resident: firestore/auth/persistence all run
|
|
5
|
+
* IN the served page, so a dev who never opens it sees data ops silently
|
|
6
|
+
* no-op. Opening the page on start (and the loud banner warning that pairs
|
|
7
|
+
* with it) removes that surprise. Opening is ALWAYS best-effort — a failed
|
|
8
|
+
* open must never fail `dev`; the URL is in the banner regardless.
|
|
9
|
+
*
|
|
10
|
+
* Auto-open is suppressed in the non-interactive paths where popping a
|
|
11
|
+
* browser is wrong or useless: `--json` (the agent/CI stdout contract),
|
|
12
|
+
* `--no-open`, no TTY (piped/redirected), and CI. `--no-open` is the manual
|
|
13
|
+
* escape hatch for an interactive shell that still doesn't want it.
|
|
14
|
+
*/
|
|
15
|
+
import { execFile } from 'node:child_process';
|
|
16
|
+
import { platform } from 'node:os';
|
|
17
|
+
/**
|
|
18
|
+
* Pure decision: should `pyric dev` auto-open the browser? Factored out so
|
|
19
|
+
* the gating logic is unit-testable without spawning anything. Open only when
|
|
20
|
+
* interactive AND not explicitly suppressed AND not in CI.
|
|
21
|
+
*/
|
|
22
|
+
export function shouldAutoOpen(ctx) {
|
|
23
|
+
if (ctx.json || ctx.noOpen || !ctx.isTTY)
|
|
24
|
+
return false;
|
|
25
|
+
if (ctx.env.CI)
|
|
26
|
+
return false; // common CI marker; covers GH Actions et al.
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
/** The platform command + leading args that open a URL in the default browser. */
|
|
30
|
+
function openCommand(url) {
|
|
31
|
+
switch (platform()) {
|
|
32
|
+
case 'darwin':
|
|
33
|
+
return { cmd: 'open', args: [url] };
|
|
34
|
+
case 'win32':
|
|
35
|
+
// `start` is a cmd builtin; the empty "" is the (ignored) window title
|
|
36
|
+
// so a URL with `&` isn't mis-parsed as the title.
|
|
37
|
+
return { cmd: 'cmd', args: ['/c', 'start', '""', url] };
|
|
38
|
+
default:
|
|
39
|
+
return { cmd: 'xdg-open', args: [url] };
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Open `url` in the default browser, best-effort. Resolves whether or not the
|
|
44
|
+
* open succeeded — callers must not let a missing `xdg-open` (headless Linux,
|
|
45
|
+
* containers) take down the dev server. Never throws.
|
|
46
|
+
*/
|
|
47
|
+
export function openBrowser(url) {
|
|
48
|
+
return new Promise((resolve) => {
|
|
49
|
+
const { cmd, args } = openCommand(url);
|
|
50
|
+
try {
|
|
51
|
+
execFile(cmd, args, () => resolve()); // ignore exit code/stderr
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
resolve(); // spawn itself threw (cmd missing) — swallow
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=open-browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-browser.js","sourceRoot":"","sources":["../../src/serve/open-browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EA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,a as lt,v as ct,n as Re,b as ne,W as A,R as B,A as se,l as je,e as dt,G as ut,j as t,c as pt,i as ft,d as mt,P as Pe,u as ht,f as xt,h as gt,k as te,m as he,o as bt,T as yt,M as Ae,p as wt,q as be,r as kt,S as jt,t as vt,w as Nt,x as St,y as Ct,z as It,B as Et,C as Rt,D as Pt,E as At,F as Tt,H as Dt,I as $t,J as Ht,K as Me}from"./TopBar.ChifCjLD.js";import{r as l}from"./index.B9aLOeXL.js";function Ot(){const[e,s]=l.useState(()=>Ee()),[n,r]=l.useState([]),[a,o]=l.useState(!0);return l.useEffect(()=>{const c=setInterval(()=>{const d=Ee();d!==e&&s(d)},500);return()=>clearInterval(c)},[e]),l.useEffect(()=>{let c=!1,d=null;return(async()=>(await it(),!c&&(d=lt(e,f=>{r(f),o(!1)}))))(),()=>{c=!0,d?.()}},[e]),{sessions:n,loading:a,userId:e}}const Te="playground-project",_e=new Set(["a","an","the","and","or","but","with","without","for","of","to","in","on","at","by","from","into","that","this","these","those","is","are","be","can","must","should","will","where","when","while","create","make","build","building","write","add","want","like","app","application","website","site","project","simple","basic","called","named","style","top-down","users","user","players","player","each","their","them","they","it","its","my","me","i","we","our","using","use","has","have","need","needs"]),ye=4,Mt=40;function _t(e){return e.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/[-.]{2,}/g,"-").replace(/^[-._]+|[-._]+$/g,"").slice(0,Mt).replace(/^[-._]+|[-._]+$/g,"")}function we(e){return e.toLowerCase().split(/\s+/).map(s=>s.replace(/^[^a-z0-9]+|[^a-z0-9]+$/g,"")).filter(Boolean)}function Ft(e){const s=e.match(/["“']([^"”']{2,60})["”']/);if(s){const a=we(s[1]).slice(0,ye);if(a.length>0)return a}const n=e.toLowerCase().match(/\b(?:called|named|titled)\s+(.{2,60})/);if(!n)return null;const r=[];for(const a of we(n[1]))if(_e.has(a)||(r.push(a),r.length===ye))break;return r.length>0?r:null}function Ut(e){const n=Ft(e)??we(e).filter(a=>!_e.has(a)).slice(0,ye),r=_t(n.join("-"));if(!r)return Te;try{return ct(r),r}catch{return Te}}async function xe(e,s){const n=await e.promises.readFile(s,"utf8");return typeof n=="string"?n:new TextDecoder().decode(n)}async function ge(e,s,n){const r=s.slice(0,s.lastIndexOf("/"));r&&await e.promises.mkdir(r,{recursive:!0}),await e.promises.writeFile(s,n)}function Lt(e,s){const n=`${s}/tests/`;if(e.startsWith(n))return`${A}/tests/${e.slice(n.length)}`;const r=e.split("/").pop()??e;return`${A}/tests/${r}`}async function Gt(e,s=ne()){const n=await xe(s,e.rulesPath),r=await xe(s,e.appEntryPath);await ge(s,B,n),await ge(s,se,r),Re(B,n),Re(se,r);for(const a of e.testPaths){const o=await xe(s,a);await ge(s,Lt(a,e.contentRoot),o)}return{rules:n,code:"",appSource:r}}const Wt=["next","@next/env","expo","@expo/metro-runtime","@remix-run/node","@remix-run/react","nuxt","@nuxt/kit","@angular/core","sveltekit","@sveltejs/kit"],Bt=new Set(["firestore.rules"]),Kt=[{rel:"src/App.tsx",kind:"playground-native"},{rel:"src/App.jsx",kind:"playground-native"},{rel:"src/generated/app-source.tsx",kind:"playground-template"},{rel:"public/app.js",kind:"pyric-init-web"}],zt="tests",De=new Set(["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","firebase/app","firebase/firestore","firebase/auth","firebase/database","firebase/storage","firebase/functions"]),Vt=/\b(?:import|export)\s+(?:[\w*{}\s,]+\s+from\s+)?['"]([^'"]+)['"]|require\s*\(\s*['"]([^'"]+)['"]\s*\)/g;function re(e,s){const n=e.split("/").filter(Boolean);for(const r of s.split("/"))if(!(!r||r===".")){if(r===".."){n.pop();continue}n.push(r)}return`/${n.join("/")}`}function qt(e){const s=e.lastIndexOf("/");return s<=0?"/":e.slice(0,s)}function Fe(e){return e.split("/").filter(Boolean).pop()??e}function Jt(e,s){const n=e.filter(c=>c===s||c.startsWith(`${s}/`));if(n.length===0)return s;const r=n.filter(c=>{const d=Fe(c);return d==="package.json"||Bt.has(d)});if(r.length===0)return s;r.sort((c,d)=>c.split("/").length-d.split("/").length);const a=r[0],o=qt(a);return o==="/"||!o.startsWith(s)?s:o}function Xt(e,s){const n=re(s,"firestore.rules");if(e.includes(n))return n;for(const r of e)if(Fe(r)==="firestore.rules")return r;return null}function Yt(e,s){for(const{rel:n,kind:r}of Kt){const a=re(s,n);if(e.includes(a))return{path:a,kind:r}}return null}function Qt(e,s){const n=`${re(s,zt)}/`;return e.filter(r=>r.startsWith(n)&&r.endsWith(".test.json")).sort()}function Zt(e,s,n,r){return s&&s!=="unknown"?s:e!==A?"nested-clone":n===B&&r===se?"playground-native":"unknown"}function es(e){const s=[],n=[];let r;try{r=JSON.parse(e)}catch{return n.push("package.json is present but not valid JSON — skipped framework check."),{blockers:s,warnings:n}}if(!r||typeof r!="object")return{blockers:s,warnings:n};const a={...r.dependencies??{},...r.devDependencies??{}};for(const o of Wt)o in a&&s.push(`package.json depends on "${o}" — playground supports a single-page React + Firestore rules workspace, not this framework stack.`);return"firebase"in a||n.push("package.json has no firebase dependency — app may still use canonical firebase/* imports."),{blockers:s,warnings:n}}function ts(e){const s=[],n=[],r=new Set;for(const a of e.matchAll(Vt)){const o=a[1]??a[2];if(!o||r.has(o)||(r.add(o),o.startsWith(".")||o.startsWith("/")))continue;if(o.startsWith("node:")){s.push(`App entry imports Node built-in "${o}" — not available in the browser preview.`);continue}if(o==="next"||o.startsWith("next/")||o.startsWith("@next/")){s.push(`App entry imports "${o}" — Next.js is not supported in the playground.`);continue}if(["fs","path","crypto","http","https","net","child_process","os"].includes(o)){s.push(`App entry imports Node module "${o}" — not available in the browser preview.`);continue}const d=o.split("/")[0]??o;De.has(o)||De.has(d)||o.startsWith("firebase/")||n.push(`App entry imports "${o}" — must be installed via the Packages tab (esm.sh) or use react/firebase/* / relative paths.`)}return{blockers:s,warnings:n}}function ss(e,s,n,r,a){return e.length>0||!r||!a?"red":n==="playground-native"&&s.length===0?"green":n==="pyric-init-web"?"red":"yellow"}async function ns(e,s){const n=s.root??A,r=[],a=[],o=Jt(e,n);o!==n&&a.push(`Project files live under ${o} — materialize will flatten into ${n}.`);const c=Xt(e,o),d=Yt(e,o),f=d?.path??null,w=Zt(o,d?.kind??null,c,f);c||r.push(`No firestore.rules found under ${o} — playground requires Firestore rules at ${B} after import.`),f?w==="pyric-init-web"&&r.push("Repo uses pyric init web (public/app.js) — playground preview requires a React TSX entry; import not supported yet."):r.push(`No supported app entry found — expected src/App.tsx (or src/App.jsx / src/generated/app-source.tsx) under ${o}.`);const N=re(o,"package.json");if(e.includes(N)){const x=await s.readFile(N);if(x){const v=es(x);r.push(...v.blockers),a.push(...v.warnings)}}if(f){const x=await s.readFile(f);if(x){const v=ts(x);r.push(...v.blockers),a.push(...v.warnings),/\bexport\s+default\b/.test(x)||a.push("App entry has no `export default` — preview expects a default-exported React component.")}else a.push(`Could not read app entry at ${f}.`)}const j=Qt(e,o);return{tier:ss(r,a,w,!!c,!!f),layout:w,blockers:r,warnings:a,mappings:c&&f?{contentRoot:o,rulesPath:c,appEntryPath:f,canonical:{rulesPath:B,appEntryPath:se},testPaths:j}:null}}async function rs(e={}){const s=e.root??A,n=e.listFiles??je,r=e.readFile??(async o=>{try{const c=await ne().promises.readFile(o,"utf8");return typeof c=="string"?c:new TextDecoder().decode(c)}catch{return null}}),a=await n(s);return ns(a,{root:s,readFile:r})}class ke extends Error{probe;constructor(s,n){super(s),this.name="WorkspaceImportError",this.probe=n}}const as=["green","yellow"];function $e(e){return{fullName:e.fullName,htmlUrl:"htmlUrl"in e&&e.htmlUrl?e.htmlUrl:`https://github.com/${e.fullName}`,cloneUrl:e.cloneUrl,defaultBranch:e.defaultBranch,private:e.private??!1,linkedAt:Date.now()}}function os(e){const s=/\.(tsx?|jsx?|mjs|cjs|vue|svelte|astro)$/i;for(const n of e){if(n.includes("/.git/"))continue;const r=(n.split("/").pop()??"").toLowerCase();if(r==="firestore.rules"||r==="package.json"||s.test(r))return!1}return!0}async function is(){const e=ne();try{await e.promises.lstat(A)}catch(r){if(r.code==="ENOENT")return;throw r}const n=(await je(A)).filter(r=>!r.includes("/.git/"));if(n.length>0)throw new Error(`Workspace already has ${n.length} file(s) — import requires an empty session workspace.`)}async function ls(e){const s=e.allowedTiers??as,n=d=>e.onProgress?.(d);n("Preparing workspace…"),await dt(e.sessionId),await is(),n("Cloning repository…"),await new ut(ne()).clone({url:e.repo.cloneUrl,dir:A,ref:e.repo.defaultBranch,depth:1,singleBranch:!0}),n("Checking compatibility…");const a=await rs(),o=(await je(A)).filter(d=>!d.includes("/.git/"));if(os(o))return n("Empty repo — starting a fresh workspace linked to it…"),{probe:a,workspace:{rules:"",code:"",appSource:""},githubRepo:$e(e.repo)};if(!s.includes(a.tier))throw new ke(a.blockers.length>0?a.blockers.join(`
|
|
2
|
+
`):`Import blocked — probe tier "${a.tier}" is not supported.`,a);if(!a.mappings)throw new ke("Import blocked — no file mappings discovered.",a);n("Materializing workspace…");const c=await Gt(a.mappings);return{probe:a,workspace:c,githubRepo:$e(e.repo)}}const Ue="your-account";function cs({className:e}){return t.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":!0,className:e,fill:"currentColor",children:t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.18.82.63-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.51-1.04 2.18-.82 2.18-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})})}function ds(e,s){const n=e?.trim()||Ue,r=s.trim()||"repo-name";return`github.com/${n}/${r}`}function Le(e){return e.createRepo?e.repoName.trim()?e.patPresent===!1?"Add a GitHub token in Settings to publish.":e.patPresent===null?"Checking GitHub token…":null:"Name your repo to continue.":null}function He(e){return Le(e)===null}function us({expanded:e,onExpandedChange:s,name:n,onNameChange:r,visibility:a,onVisibilityChange:o,nameSuggestion:c,githubLogin:d,patPresent:f,onOpenSettings:w}){const N=l.useId(),j=l.useRef(null),m=l.useRef(e),$=c!=null&&c.length>0&&c!==n.trim(),x=d?`${d}/`:`${Ue}/`;l.useEffect(()=>{if(e&&!m.current){const h=window.setTimeout(()=>j.current?.focus(),180);return m.current=e,()=>window.clearTimeout(h)}m.current=e},[e]);const v=()=>s(!0);return t.jsxs("div",{className:["w-full rounded-md border overflow-hidden","transition-[border-color,background-color] duration-200 ease-out",e?"border-[#3a3a48] bg-[#0f0f17]":"border-[#2a2a35] bg-[#0f0f17]/70 hover:border-[#3a3a48] hover:bg-[#0f0f17]"].join(" "),children:[t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5",children:[t.jsx(cs,{className:["h-4 w-4 shrink-0 transition-colors duration-200",e?"text-soft-white":"text-slate-gray"].join(" ")}),t.jsxs("div",{className:["relative flex flex-1 min-w-0 items-center",e?"min-h-[2.5rem]":"min-h-[1.25rem]",e?"":"cursor-pointer"].join(" "),role:e?void 0:"button",tabIndex:e?void 0:0,"aria-expanded":e,"aria-controls":N,onClick:e?void 0:v,onKeyDown:e?void 0:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),v())},children:[t.jsx("span",{className:["block w-full text-[12px] leading-snug transition-[opacity,transform] duration-200 ease-out",e?"opacity-0 -translate-y-0.5 pointer-events-none absolute inset-x-0 top-0":"opacity-100 translate-y-0 text-slate-gray hover:text-soft-white"].join(" "),children:"Create a GitHub repo for this project"}),t.jsxs("span",{className:["block w-full transition-[opacity,transform] duration-200 ease-out",e?"opacity-100 translate-y-0":"opacity-0 translate-y-0.5 pointer-events-none absolute inset-x-0 top-0"].join(" "),children:[t.jsx("span",{className:"text-[13px] font-medium text-soft-white leading-snug",children:"GitHub repo"}),t.jsx("span",{className:"block text-[11px] text-slate-gray mt-0.5 leading-snug",children:"Created empty when you start — push code from the playground later."})]})]}),t.jsx("button",{type:"button",onClick:()=>s(!1),tabIndex:e?0:-1,"aria-hidden":!e,className:["shrink-0 text-[11px] text-slate-gray hover:text-soft-white px-1","transition-opacity duration-200 ease-out",e?"opacity-100":"opacity-0 pointer-events-none"].join(" "),"aria-label":"Collapse GitHub repo section",children:"Hide"})]}),t.jsx("div",{id:N,className:"grid transition-[grid-template-rows] duration-300 ease-[cubic-bezier(0.4,0,0.2,1)]",style:{gridTemplateRows:e?"1fr":"0fr"},"aria-hidden":!e,children:t.jsx("div",{className:"overflow-hidden min-h-0",children:t.jsxs("div",{className:["px-3 pb-3 grid gap-3 border-t border-[#2a2a35]/60","transition-opacity duration-200 ease-out",e?"opacity-100 delay-75":"opacity-0"].join(" "),children:[t.jsxs("div",{className:"grid gap-2 pt-3",children:[t.jsxs("label",{className:"block text-[12px] text-slate-gray",children:["Repo name",t.jsxs("div",{className:"mt-1 flex rounded border border-[#2a2a35] bg-[#0f0f17] overflow-hidden focus-within:border-[#3a3a48] transition-colors duration-200",children:[t.jsx("span",{className:"shrink-0 px-2 py-1.5 font-mono text-[12px] text-slate-gray border-r border-[#2a2a35] bg-[#0a0a12] select-none","aria-hidden":!0,children:x}),t.jsx("input",{ref:j,value:n,onChange:h=>r(h.target.value),spellCheck:!1,autoComplete:"off",placeholder:"my-firebase-app",tabIndex:e?0:-1,className:"min-w-0 flex-1 bg-transparent px-2 py-1.5 font-mono text-[12px] text-soft-white outline-none"})]})]}),t.jsx("p",{className:"font-mono text-[11px] text-slate-gray truncate",children:ds(d,n)}),$?t.jsxs("button",{type:"button",onClick:()=>r(c),tabIndex:e?0:-1,className:"justify-self-start rounded-full border border-[#2a2a35] px-2.5 py-1 text-[11px] font-mono text-slate-gray hover:border-[#3a3a48] hover:text-soft-white transition-colors",children:["Suggested from your prompt: ",c]}):null,t.jsxs("fieldset",{className:"border-0 p-0",children:[t.jsx("legend",{className:"text-[12px] text-slate-gray mb-1.5",children:"Visibility"}),t.jsx("div",{className:"flex gap-2",children:["public","private"].map(h=>t.jsxs("label",{className:["flex-1 cursor-pointer rounded border px-2 py-1.5 text-center text-[12px] capitalize transition-colors",a===h?"border-soft-white/40 text-soft-white bg-soft-white/5":"border-[#2a2a35] text-slate-gray hover:border-[#3a3a48]"].join(" "),children:[t.jsx("input",{type:"radio",name:"repo-visibility",value:h,checked:a===h,onChange:()=>o(h),tabIndex:e?0:-1,className:"sr-only"}),h]},h))})]})]}),f===null?t.jsx("p",{className:"text-[11px] text-slate-gray",children:"Checking GitHub token…"}):f?t.jsxs("p",{className:"text-[11px] text-[#a4d4a8]",children:["Token configured",d?` · @${d}`:""]}):t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded border border-[#4a4030] bg-[#2a2418]/40 px-2.5 py-2",children:[t.jsx("p",{className:"text-[11px] text-[#e8d4a8]",children:"Add a GitHub token to publish"}),t.jsx("button",{type:"button",onClick:w,tabIndex:e?0:-1,className:"shrink-0 rounded px-2 py-1 text-[11px] font-medium bg-[#3a3428] text-soft-white hover:bg-[#4a4438] transition-colors",children:"Open Settings"})]})]})})})]})}function ps({className:e}){return t.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":!0,className:e,fill:"currentColor",children:t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.18.82.63-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.51-1.04 2.18-.82 2.18-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})})}function Ge(e){return e.importRepo?e.selectedCloneUrl.trim()?e.patPresent===!1?"Add a GitHub token in Settings to clone.":e.patPresent===null?"Checking GitHub token…":null:"Pick a repository to import.":null}function Oe(e){return Ge(e)===null}function fs({expanded:e,onExpandedChange:s,selectedCloneUrl:n,onSelectedCloneUrlChange:r,reposState:a,onReloadRepos:o,patPresent:c,githubLogin:d,onOpenSettings:f}){const w=l.useId(),N=l.useRef(e);l.useEffect(()=>{N.current=e},[e]);const j=()=>s(!0);return t.jsxs("div",{className:["w-full rounded-md border overflow-hidden","transition-[border-color,background-color] duration-200 ease-out",e?"border-[#3a3a48] bg-[#0f0f17]":"border-[#2a2a35] bg-[#0f0f17]/70 hover:border-[#3a3a48] hover:bg-[#0f0f17]"].join(" "),children:[t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5",children:[t.jsx(ps,{className:["h-4 w-4 shrink-0 transition-colors duration-200",e?"text-soft-white":"text-slate-gray"].join(" ")}),t.jsxs("div",{className:["relative flex flex-1 min-w-0 items-center",e?"min-h-[2.5rem]":"min-h-[1.25rem]",e?"":"cursor-pointer"].join(" "),role:e?void 0:"button",tabIndex:e?void 0:0,"aria-expanded":e,"aria-controls":w,onClick:e?void 0:j,onKeyDown:e?void 0:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),j())},children:[t.jsx("span",{className:["block w-full text-[12px] leading-snug transition-[opacity,transform] duration-200 ease-out",e?"opacity-0 -translate-y-0.5 pointer-events-none absolute inset-x-0 top-0":"opacity-100 translate-y-0 text-slate-gray hover:text-soft-white"].join(" "),children:"Import an existing GitHub repository"}),t.jsxs("span",{className:["block w-full transition-[opacity,transform] duration-200 ease-out",e?"opacity-100 translate-y-0":"opacity-0 translate-y-0.5 pointer-events-none absolute inset-x-0 top-0"].join(" "),children:[t.jsx("span",{className:"text-[13px] font-medium text-soft-white leading-snug",children:"Import from GitHub"}),t.jsx("span",{className:"block text-[11px] text-slate-gray mt-0.5 leading-snug",children:"Clone into the playground — we check Firestore rules + React entry before opening."})]})]}),t.jsx("button",{type:"button",onClick:()=>s(!1),tabIndex:e?0:-1,"aria-hidden":!e,className:["shrink-0 text-[11px] text-slate-gray hover:text-soft-white px-1","transition-opacity duration-200 ease-out",e?"opacity-100":"opacity-0 pointer-events-none"].join(" "),"aria-label":"Collapse GitHub import section",children:"Hide"})]}),t.jsx("div",{id:w,className:"grid transition-[grid-template-rows] duration-300 ease-[cubic-bezier(0.4,0,0.2,1)]",style:{gridTemplateRows:e?"1fr":"0fr"},"aria-hidden":!e,children:t.jsx("div",{className:"overflow-hidden min-h-0",children:t.jsx("div",{className:["px-3 pb-3 grid gap-3 border-t border-[#2a2a35]/60","transition-opacity duration-200 ease-out",e?"opacity-100 delay-75":"opacity-0"].join(" "),children:t.jsx("div",{className:"grid gap-2 pt-3",children:c===null?t.jsx("p",{className:"text-[11px] text-slate-gray",children:"Checking GitHub token…"}):c?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("p",{className:"text-[11px] text-[#a4d4a8]",children:["Token configured",d?` · @${d}`:""]}),t.jsx("button",{type:"button",onClick:o,tabIndex:e?0:-1,disabled:a.kind==="loading",className:"text-[11px] text-slate-gray hover:text-soft-white disabled:opacity-50",children:a.kind==="loading"?"Loading…":"Refresh repos"})]}),a.kind==="error"?t.jsx("p",{className:"text-[11px] text-[#f0a0a0]",children:a.message}):null,t.jsxs("label",{className:"block text-[12px] text-slate-gray",children:["Repository",t.jsxs("select",{value:n,onChange:m=>r(m.target.value),disabled:a.kind==="loading",tabIndex:e?0:-1,className:"mt-1 w-full rounded border border-[#2a2a35] bg-[#0f0f17] px-2 py-1.5 font-mono text-[12px] text-soft-white focus:outline-none focus:border-[#3a3a48]",children:[t.jsx("option",{value:"",children:"Select a repository…"}),(a.kind==="ready"?a.repos:[]).map(m=>t.jsxs("option",{value:m.cloneUrl,children:[m.fullName,m.private?" (private)":""]},m.fullName))]})]})]}):t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded border border-[#4a4030] bg-[#2a2418]/40 px-2.5 py-2",children:[t.jsx("p",{className:"text-[11px] text-[#e8d4a8]",children:"Add a GitHub token to import a repo"}),t.jsx("button",{type:"button",onClick:f,tabIndex:e?0:-1,className:"shrink-0 rounded px-2 py-1 text-[11px] font-medium bg-[#3a3428] text-soft-white hover:bg-[#4a4438] transition-colors",children:"Open Settings"})]})})})})})]})}pt();const ms="Ask about Firestore rules, data models, Auth, RTDB, or building an app… (add skills with the Skills chip below)";function vs(){const e=typeof window<"u"&&ft(window.location.search),s="/__pyric/playground/",{sessions:n,loading:r,userId:a}=Ot(),[o,c]=l.useState(""),[d,f]=l.useState([]),w=l.useCallback(i=>{f(u=>u.includes(i)?u.filter(p=>p!==i):[...u,i])},[]),N=l.useCallback(()=>f([]),[]),[j,m]=l.useState(!1),[$,x]=l.useState(null),[v,h]=l.useState(null),[I,K]=l.useState(!1),[k,M]=l.useState(!1),[E,ae]=l.useState(""),[g,_]=l.useState({kind:"idle"}),[oe,F]=l.useState(null),[ie,U]=l.useState(null),[S,z]=l.useState(""),[le,ce]=l.useState(null),[V,de]=l.useState("private"),[C,q]=l.useState(null),[J,H]=l.useState(null),X=l.useRef(!1),R=l.useCallback(i=>{if(K(i),i&&M(!1),!i)return;const u=Ut(o);ce(u),!X.current&&!S.trim()&&z(u)},[o,S]),ue=l.useCallback(async()=>{_({kind:"loading"});try{const i=await mt();_({kind:"ready",repos:i})}catch(i){_({kind:"error",message:i instanceof Error?i.message:String(i)})}},[]),We=l.useCallback(i=>{M(i),i&&(K(!1),U(null),g.kind==="idle"&&ue())},[ue,g.kind]),[Be,L]=l.useState(!1),[pe,Y]=l.useState(!1),[Ke,Q]=l.useState(!1),Z=l.useCallback(()=>{Y(!1),Q(!1),L(!0)},[]),ee=l.useCallback(()=>{L(!1),Q(!1),Y(!0)},[]),fe=l.useCallback(()=>{L(!1),Y(!1),Q(!0)},[]);l.useEffect(()=>{if(!e||typeof window>"u")return;const i=u=>{if(u.origin===window.location.origin&&It(u.data))switch(u.data.type){case"pyric:playground:open-keys":Z();break;case"pyric:playground:open-settings":ee();break;case"pyric:playground:open-account":fe();break;case"pyric:playground:set-model":{const p=he[u.data.providerId];if(!p)return;const b=p.models.some(y=>y.id===u.data.modelId)?u.data.modelId:p.defaultModelId;te.getState().setProvider(u.data.providerId,b),u.data.effort&&te.getState().setReasoningEffortForProvider(u.data.providerId,u.data.effort);break}}};return window.addEventListener("message",i),()=>window.removeEventListener("message",i)},[e,fe,Z,ee]);const[ze,Ve]=l.useState(0),qe=l.useCallback(i=>{let u=!1;for(const p of Pe){const b=i[p.id];b&&b.trim().length>0&&(p.byok.setKey(b),p.id==="ollama"&&(u=!0))}u&&ht.getState().refresh(),Ve(p=>p+1),L(!1)},[]);l.useEffect(()=>{let i=!1;return xt().then(u=>{i||q(!!u)}),()=>{i=!0}},[pe,I,k]),l.useEffect(()=>{if(!C){H(null);return}let i=!1;return gt().then(u=>{i||H(u.login)}).catch(()=>{i||H(null)}),()=>{i=!0}},[C,pe]);const[O,P]=l.useState({kind:"idle"}),D=l.useRef(null),G=te(i=>i.providerId),ve=te(i=>i.modelId);l.useEffect(()=>()=>D.current?.abort(),[]);const Ne=l.useMemo(()=>{const i=he[G];return i?i.byok.hasKey():!1},[G,ze]),Je=l.useCallback(async()=>{const i=o.trim();if(!i)return;const u=he[G];if(!u)return;const p=u.byok.getKey();if(!p){P({kind:"error",text:"",message:"Set an API key first (key icon, top right)."});return}D.current?.abort();const b=new AbortController;D.current=b,P({kind:"streaming",text:""});try{let y=!1,T="";for await(const me of bt({rawInput:i,providerId:G,modelId:ve,apiKey:p,activeSkillIds:d,signal:b.signal})){if(b.signal.aborted)return;y=!0,T+=me,P({kind:"streaming",text:T})}if(b.signal.aborted)return;if(!y){P({kind:"error",text:"",message:"Model returned no text. Try a different rough idea, or check your API key."});return}P({kind:"ready",text:T})}catch(y){if(b.signal.aborted)return;P({kind:"error",text:"",message:y instanceof Error?y.message:String(y)})}finally{D.current===b&&(D.current=null)}},[o,G,ve,d]),Xe=l.useCallback(()=>{D.current?.abort(),P({kind:"idle"})},[]),Ye=l.useCallback(()=>{(O.kind==="ready"||O.kind==="streaming")&&c(O.text),P({kind:"idle"})},[O]),Qe=l.useCallback(()=>{P({kind:"idle"})},[]),Se=async i=>{i?.preventDefault();const u=o.trim();if(!j&&!(!k&&!u)&&He({createRepo:I,repoName:S,patPresent:C})&&Oe({importRepo:k,selectedCloneUrl:E,patPresent:C})){D.current?.abort(),m(!0),F(null),x(null),U(null);try{const p=ws(),b=typeof window<"u"?At(window.location.search):"isolated";let y,T;if(k){const W=g.kind==="ready"?g.repos.find(ot=>ot.cloneUrl===E):void 0;if(!W)throw new Error("Selected repository not found — refresh the repo list.");const Ie=await ls({sessionId:p,repo:W,onProgress:F});T={version:1,workspace:Ie.workspace,conversation:[]},y=Ie.githubRepo}else I&&(y={...await Tt({name:S.trim(),visibility:V}),linkedAt:Date.now()}),T={version:1,workspace:{rules:"",code:"",appSource:""},conversation:[]};d.length>0&&(T.activeSkills=d);const me=u.slice(0,60).trim()||(k&&g.kind==="ready"?g.repos.find(W=>W.cloneUrl===E)?.fullName.slice(0,60)??"Imported session":"New session"),at=u.slice(0,120).trim()||(y?`Imported from ${y.fullName}`:"");await Dt(a,{id:p,title:me,preview:at,payload:T,githubRepo:y,sandboxMode:b}),u&&$t(p,u,"send"),await Ht(),window.location.href=Me(p,{base:s,embedded:e})}catch(p){if(m(!1),F(null),p instanceof ke){U(p.probe.blockers),x(p.message);return}x(p instanceof Error?p.message:String(p))}}},Ze=i=>{(i.metaKey||i.ctrlKey)&&i.key==="Enter"&&(i.preventDefault(),Se())},Ce=O.kind==="streaming",et=!Ce&&o.trim().length>0&&Ne,tt=He({createRepo:I,repoName:S,patPresent:C}),st=Oe({importRepo:k,selectedCloneUrl:E,patPresent:C}),nt=k?st:tt&&!!o.trim(),rt=k?Ge({importRepo:k,selectedCloneUrl:E,patPresent:C}):Le({createRepo:I,repoName:S,patPresent:C});return t.jsxs("div",{className:"min-h-screen flex flex-col bg-content-bg text-soft-white",children:[e?null:t.jsx(yt,{title:"home",homeHref:wt({base:s}),onOpenKeys:Z,onOpenSettings:ee,onOpenAccount:fe,children:t.jsx("div",{className:"hidden md:flex",children:t.jsx(Ae,{})})}),t.jsx("main",{className:"flex-1 overflow-y-auto custom-scrollbar px-4 sm:px-6 lg:px-10 py-10 sm:py-14",children:t.jsx("div",{className:"mx-auto w-full max-w-6xl",children:t.jsxs("div",{className:"grid gap-x-12 gap-y-8 lg:gap-x-16 lg:grid-cols-[minmax(0,1fr)_minmax(280px,400px)]",children:[t.jsxs("section",{children:[t.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[t.jsx("h2",{className:"text-[10px] font-mono uppercase tracking-wider text-slate-gray",children:"New session"}),o.trim().length>0?t.jsxs("span",{className:"text-[10px] font-mono text-slate-gray",children:[be(o)," ",be(o)===1?"word":"words"]}):null]}),t.jsx(hs,{prompt:o,onPromptChange:c,onSubmit:Se,onKeyDown:Ze,selectedSkills:d,onToggleSkill:w,onClearSkills:N,onEnhance:Je,onCancelEnhance:Xe,enhance:O,onAcceptEnhance:Ye,onDiscardEnhance:Qe,canEnhance:et,enhanceStreaming:Ce,hasKey:Ne,onOpenKeys:Z,onOpenSettings:ee,starting:j,canStart:nt,githubBlockReason:rt,error:$,createRepo:I,onCreateRepoChange:R,importRepo:k,onImportRepoChange:We,selectedCloneUrl:E,onSelectedCloneUrlChange:ae,reposState:g,onReloadRepos:ue,importBlockers:ie,startPhase:oe,repoName:S,onRepoNameChange:i=>{X.current=!0,z(i)},repoNameSuggestion:le,repoVisibility:V,onRepoVisibilityChange:de,githubLogin:J,patPresent:C})]}),t.jsxs("aside",{className:"min-w-0",children:[t.jsx("h2",{className:"mb-3 text-[10px] font-mono uppercase tracking-wider text-slate-gray",children:"Recent sessions"}),r?t.jsx("p",{className:"text-[12px] text-slate-gray",children:"Loading…"}):n.length===0?t.jsx("p",{className:"text-[12px] text-slate-gray",children:"No sessions yet. Start one on the left."}):t.jsx("ul",{className:"space-y-1.5 max-h-[40vh] overflow-y-auto custom-scrollbar pr-1 -mr-1 lg:max-h-none lg:overflow-visible lg:pr-0 lg:mr-0",children:n.map(i=>t.jsx(gs,{session:i,playgroundBase:s,embeddedInStudio:e,isConfirmingDelete:v===i.id,onConfirmDelete:()=>h(i.id),onCancelDelete:()=>h(null),onDelete:async()=>{h(null);try{await kt(a,i.id)}catch(u){x(u instanceof Error?u.message:String(u))}}},i.id))})]})]})})}),t.jsx(jt,{open:pe,onClose:()=>Y(!1)}),t.jsx(vt,{open:Ke,onClose:()=>Q(!1)}),t.jsxs(Nt,{open:Be,onClose:()=>L(!1),ariaLabel:"API keys",children:[t.jsxs("div",{className:e?"mb-4":"md:hidden mb-4",children:[t.jsx("p",{className:"text-[11px] uppercase tracking-wider text-slate-gray mb-2",children:"Active model"}),t.jsx(Ae,{})]}),t.jsx(St,{title:"API keys",subtitle:"Bring your own keys. Stored in this browser only — never sent to a server we control.",fields:Pe.map(i=>Ct(i)).filter(i=>i!==null),onSubmit:qe,submitLabel:"Save",footerText:"Update or remove anytime."})]})]})}function hs({prompt:e,onPromptChange:s,selectedSkills:n,onToggleSkill:r,onClearSkills:a,onSubmit:o,onKeyDown:c,onEnhance:d,onCancelEnhance:f,enhance:w,onAcceptEnhance:N,onDiscardEnhance:j,canEnhance:m,enhanceStreaming:$,hasKey:x,onOpenKeys:v,onOpenSettings:h,starting:I,canStart:K,githubBlockReason:k,error:M,createRepo:E,onCreateRepoChange:ae,importRepo:g,onImportRepoChange:_,selectedCloneUrl:oe,onSelectedCloneUrlChange:F,reposState:ie,onReloadRepos:U,importBlockers:S,startPhase:z,repoName:le,onRepoNameChange:ce,repoNameSuggestion:V,repoVisibility:de,onRepoVisibilityChange:C,githubLogin:q,patPresent:J}){const H=l.useRef(null);l.useLayoutEffect(()=>{const R=H.current;R&&(R.style.height="auto",R.style.height=`${Math.max(R.scrollHeight,160)}px`)},[e]);const X=l.useMemo(()=>Et(e),[e]);return t.jsxs("form",{onSubmit:o,className:["rounded-md border bg-sidebar-bg transition-colors","border-[#2a2a35] focus-within:border-[#4a4a58]","p-4 sm:p-5 grid gap-4"].join(" "),children:[t.jsx("div",{className:"relative",children:t.jsx(Rt,{textareaRef:H,value:e,onValueChange:s,matches:X,onKeyDown:c,placeholder:ms,rows:4,disabled:I,spellCheck:!1,ariaLabel:"New session prompt",textClassName:"text-[15px] leading-relaxed font-display min-h-[120px]",textareaClassName:"custom-scrollbar resize-none disabled:opacity-60"})}),t.jsx(Pt,{activeSkillIds:n,onToggleSkill:r,onClearSkills:a,className:"-mt-1"}),w.kind!=="idle"?t.jsx(xs,{enhance:w,onCancel:f,onAccept:N,onDiscard:j}):null,t.jsxs("div",{className:"border-t border-[#2a2a35] pt-3 grid gap-3",children:[t.jsxs(t.Fragment,{children:[t.jsx(fs,{expanded:g,onExpandedChange:_,selectedCloneUrl:oe,onSelectedCloneUrlChange:F,reposState:ie,onReloadRepos:U,githubLogin:q,patPresent:J,onOpenSettings:h}),t.jsx(us,{expanded:E,onExpandedChange:ae,name:le,onNameChange:ce,visibility:de,onVisibilityChange:C,nameSuggestion:V,githubLogin:q,patPresent:J,onOpenSettings:h})]}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[$?t.jsxs("button",{type:"button",onClick:f,className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full border border-[#5a4a4a] bg-[#3a2a2a]/40 text-[11px] font-mono uppercase tracking-wider text-[#f0a0a0] hover:bg-[#3a2a2a]/60 transition-colors",title:"Cancel enhancement",children:[t.jsx("span",{className:"material-symbols-outlined text-[14px] animate-pulse",children:"bolt"}),"Cancel enhance"]}):t.jsxs("button",{type:"button",onClick:x?d:v,disabled:x?!m:!1,className:["inline-flex items-center gap-2 px-3 py-1.5 rounded-full border","text-[11px] font-mono uppercase tracking-wider transition-colors",x&&m?"border-soft-white/40 text-soft-white hover:bg-soft-white/10":"border-[#2a2a35] text-slate-gray hover:text-soft-white hover:border-[#3a3a45] disabled:opacity-40 disabled:cursor-not-allowed"].join(" "),title:x?e.trim()?"Rewrite your rough idea into a well-shaped prompt. The original stays in the box; you choose whether to keep the enhanced version.":"Type something to enhance":"Set an API key first (click to open)",children:[t.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"auto_awesome"}),x?"Enhance":"Set API key to enhance"]}),t.jsxs("div",{className:"flex flex-col items-end gap-1",children:[(E||g)&&k?t.jsx("p",{className:"text-[11px] text-[#e8d4a8]",children:k}):null,t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsxs("span",{className:"text-[10px] font-mono text-slate-gray hidden sm:inline",children:[!g&&e.trim().length>0?"⌘ + Enter to start":"",g&&!e.trim()?"Optional prompt · ⌘ + Enter to import":""]}),t.jsx("button",{type:"submit",disabled:(g?!1:!e.trim())||I||!K,className:["px-4 py-1.5 rounded-full text-[12px] font-semibold","bg-soft-white text-content-bg hover:bg-soft-white/90","transition-colors disabled:opacity-40 disabled:cursor-not-allowed"].join(" "),children:I?z??(g?"Importing…":"Starting…"):g?"Import & start session":E?"Start session & create repo":"Start session"})]})]})]})]}),M?t.jsxs("div",{className:"grid gap-1",children:[t.jsxs("p",{className:"text-[11px] font-mono text-[#f0a0a0]",children:[g?"Import failed":"Failed to start session",": ",M]}),S&&S.length>0?t.jsx("ul",{className:"text-[11px] font-mono text-[#f0a0a0] list-disc pl-4 space-y-0.5",children:S.map(R=>t.jsx("li",{children:R},R))}):null]}):null]})}function xs({enhance:e,onCancel:s,onAccept:n,onDiscard:r}){const a=e.kind==="streaming",o=e.kind==="ready",c=e.kind==="error",d=e.kind==="streaming"||e.kind==="ready"?e.text:"",f=be(d);return t.jsxs("div",{className:"rounded-md border border-[#2a2a35] bg-[#0f0f17] p-4 grid gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-mono uppercase tracking-wider text-slate-gray",children:[t.jsx("span",{className:"material-symbols-outlined text-[14px] text-soft-white/70",children:"auto_awesome"}),t.jsx("span",{children:c?"Enhance failed":"Enhanced"}),a?t.jsx("span",{className:"text-[10px] text-slate-gray normal-case tracking-normal",children:"· streaming"}):o?t.jsxs("span",{className:"text-[10px] text-slate-gray normal-case tracking-normal",children:["· ",f," ",f===1?"word":"words"]}):null]}),c?t.jsx("p",{className:"text-[12px] font-mono text-[#f0a0a0] whitespace-pre-wrap",children:e.message}):t.jsx("p",{className:"text-[14px] leading-relaxed text-soft-white whitespace-pre-wrap min-h-[1.5em]",children:d||(a?"…":"")}),t.jsx("div",{className:"flex items-center justify-end gap-2 pt-1",children:a?t.jsx("button",{type:"button",onClick:s,className:"px-3 py-1 rounded text-[10px] font-mono uppercase tracking-wider bg-[#2a2a35] hover:bg-[#3a3a48] text-soft-white",children:"Cancel"}):t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:r,className:"px-3 py-1 rounded text-[10px] font-mono uppercase tracking-wider bg-[#2a2a35] hover:bg-[#3a3a48] text-slate-gray hover:text-soft-white",children:"Discard"}),o?t.jsx("button",{type:"button",onClick:n,className:"px-3 py-1 rounded text-[10px] font-mono uppercase tracking-wider bg-soft-white text-content-bg hover:bg-soft-white/90",children:"Use this"}):null]})})]})}function gs({session:e,playgroundBase:s,embeddedInStudio:n,isConfirmingDelete:r,onConfirmDelete:a,onCancelDelete:o,onDelete:c}){const d=Me(e.id,{base:s,embedded:n});return t.jsxs("li",{className:["flex items-center gap-3 px-3 py-2 rounded-md transition-colors",r?"bg-[#3a1f1f]/40 border border-[#5a2a2a]":"bg-[#0f0f17] border border-[#2a2a35] hover:border-[#3a3a48]"].join(" "),children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("a",{href:d,className:"block group","aria-label":`Open session: ${e.title}`,children:[t.jsx("div",{className:"text-[13px] text-soft-white truncate group-hover:underline",children:e.title}),e.preview?t.jsx("div",{className:"text-[11px] text-slate-gray truncate",children:e.preview}):null]}),t.jsxs("div",{className:"text-[10px] font-mono text-slate-gray mt-0.5",children:[bs(e.updatedAt),e.payloadSize>0?` · ${ys(e.payloadSize)}`:"",e.promotedTo?t.jsx("span",{className:"ml-2 text-[#a4d4a8]",children:"synced"}):null,e.githubRepo?t.jsxs(t.Fragment,{children:[" · ",t.jsxs("a",{href:e.githubRepo.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"text-[#a4c4f0] hover:underline",children:["github: ",e.githubRepo.fullName]})]}):null]})]}),t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:r?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:o,className:"px-2 py-1 rounded text-[10px] font-mono uppercase tracking-wider bg-[#2a2a35] hover:bg-[#3a3a48] text-soft-white",children:"Cancel"}),t.jsx("button",{type:"button",onClick:c,className:"px-2 py-1 rounded text-[10px] font-mono uppercase tracking-wider bg-[#5a2a2a] hover:bg-[#6a3030] text-[#f0a0a0]",children:"Delete"})]}):t.jsx("button",{type:"button",onClick:a,className:"px-2 py-1 rounded text-[10px] font-mono uppercase tracking-wider bg-[#2a2a35] hover:bg-[#3a3a48] text-slate-gray hover:text-soft-white","aria-label":`Delete session: ${e.title}`,children:"Delete"})})]})}function bs(e){const s=Date.now()-e;if(s<6e4)return`${Math.max(1,Math.floor(s/1e3))}s ago`;if(s<36e5)return`${Math.floor(s/6e4)}m ago`;if(s<864e5)return`${Math.floor(s/36e5)}h ago`;const n=Math.floor(s/864e5);return n<7?`${n}d ago`:new Date(e).toLocaleDateString()}function ys(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function ws(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Math.random().toString(36).slice(2)+Date.now().toString(36)}export{vs as HomePage};
|