pyric 0.1.0-alpha.21 → 0.1.0-alpha.24
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 +12 -4
- package/dist/ai/activity.d.ts +9 -0
- package/dist/ai/activity.d.ts.map +1 -0
- package/dist/ai/activity.js +45 -0
- package/dist/ai/activity.js.map +1 -0
- package/dist/ai/broker/broker.d.ts +25 -0
- package/dist/ai/broker/broker.d.ts.map +1 -1
- package/dist/ai/broker/broker.js +46 -42
- package/dist/ai/broker/broker.js.map +1 -1
- package/dist/ai/broker/gemini-engine.d.ts +7 -0
- package/dist/ai/broker/gemini-engine.d.ts.map +1 -1
- package/dist/ai/broker/gemini-engine.js +15 -0
- package/dist/ai/broker/gemini-engine.js.map +1 -1
- package/dist/ai/broker/index.d.ts +1 -1
- package/dist/ai/broker/index.d.ts.map +1 -1
- package/dist/ai/broker/index.js.map +1 -1
- package/dist/ai/broker/openai-engine.d.ts.map +1 -1
- package/dist/ai/broker/openai-engine.js +7 -3
- package/dist/ai/broker/openai-engine.js.map +1 -1
- package/dist/ai/broker/scripted-engine.d.ts +9 -1
- package/dist/ai/broker/scripted-engine.d.ts.map +1 -1
- package/dist/ai/broker/scripted-engine.js +14 -5
- package/dist/ai/broker/scripted-engine.js.map +1 -1
- package/dist/ai/broker/types.d.ts +6 -2
- package/dist/ai/broker/types.d.ts.map +1 -1
- package/dist/ai/events.d.ts +12 -0
- package/dist/ai/events.d.ts.map +1 -0
- package/dist/ai/events.js +17 -0
- package/dist/ai/events.js.map +1 -0
- package/dist/ai/generation-enums.d.ts +43 -0
- package/dist/ai/generation-enums.d.ts.map +1 -0
- package/dist/ai/generation-enums.js +37 -0
- package/dist/ai/generation-enums.js.map +1 -0
- package/dist/ai/index.d.ts +1 -0
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +1 -0
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/instances.d.ts +6 -0
- package/dist/ai/instances.d.ts.map +1 -1
- package/dist/ai/instances.js +20 -2
- package/dist/ai/instances.js.map +1 -1
- package/dist/ai/internal.d.ts +3 -0
- package/dist/ai/internal.d.ts.map +1 -1
- package/dist/ai/internal.js +3 -0
- package/dist/ai/internal.js.map +1 -1
- package/dist/ai/sandbox-plane.d.ts.map +1 -1
- package/dist/ai/sandbox-plane.js +23 -8
- package/dist/ai/sandbox-plane.js.map +1 -1
- package/dist/ai/scripting.d.ts +20 -2
- package/dist/ai/scripting.d.ts.map +1 -1
- package/dist/ai/scripting.js +30 -3
- package/dist/ai/scripting.js.map +1 -1
- package/dist/app/internal.d.ts +1 -0
- package/dist/app/internal.d.ts.map +1 -1
- package/dist/app/internal.js +1 -0
- package/dist/app/internal.js.map +1 -1
- package/dist/auth/email-link.d.ts +8 -1
- package/dist/auth/email-link.d.ts.map +1 -1
- package/dist/auth/email-link.js +29 -20
- package/dist/auth/email-link.js.map +1 -1
- package/dist/auth/events.d.ts +12 -0
- package/dist/auth/events.d.ts.map +1 -0
- package/dist/auth/events.js +18 -0
- package/dist/auth/events.js.map +1 -0
- package/dist/auth/factor-id.d.ts +7 -0
- package/dist/auth/factor-id.d.ts.map +1 -0
- package/dist/auth/factor-id.js +6 -0
- package/dist/auth/factor-id.js.map +1 -0
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +1 -0
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/instances.d.ts.map +1 -1
- package/dist/auth/instances.js +13 -1
- package/dist/auth/instances.js.map +1 -1
- package/dist/auth/internal.d.ts +20 -0
- package/dist/auth/internal.d.ts.map +1 -0
- package/dist/auth/internal.js +19 -0
- package/dist/auth/internal.js.map +1 -0
- package/dist/auth/modular.d.ts +9 -0
- package/dist/auth/modular.d.ts.map +1 -1
- package/dist/auth/modular.js +20 -0
- package/dist/auth/modular.js.map +1 -1
- package/dist/auth/reauth.js +3 -2
- package/dist/auth/reauth.js.map +1 -1
- package/dist/auth/sandbox/default-avatar.d.ts +64 -0
- package/dist/auth/sandbox/default-avatar.d.ts.map +1 -0
- package/dist/auth/sandbox/default-avatar.js +118 -0
- package/dist/auth/sandbox/default-avatar.js.map +1 -0
- package/dist/auth/sandbox/driver.d.ts +36 -0
- package/dist/auth/sandbox/driver.d.ts.map +1 -1
- package/dist/auth/sandbox/driver.js +47 -0
- package/dist/auth/sandbox/driver.js.map +1 -1
- package/dist/auth/sandbox/project-store.d.ts +0 -1
- package/dist/auth/sandbox/project-store.d.ts.map +1 -1
- package/dist/auth/sandbox/project-store.js +0 -1
- package/dist/auth/sandbox/project-store.js.map +1 -1
- package/dist/auth/sandbox-backend-types.d.ts +34 -20
- package/dist/auth/sandbox-backend-types.d.ts.map +1 -1
- package/dist/auth/sandbox-backend-types.js +2 -3
- package/dist/auth/sandbox-backend-types.js.map +1 -1
- package/dist/auth/sandbox-backend.d.ts +98 -20
- package/dist/auth/sandbox-backend.d.ts.map +1 -1
- package/dist/auth/sandbox-backend.js +403 -96
- package/dist/auth/sandbox-backend.js.map +1 -1
- package/dist/auth/seed-user.d.ts +38 -0
- package/dist/auth/seed-user.d.ts.map +1 -0
- package/dist/auth/seed-user.js +2 -0
- package/dist/auth/seed-user.js.map +1 -0
- package/dist/auth/tokens.d.ts +6 -1
- package/dist/auth/tokens.d.ts.map +1 -1
- package/dist/auth/tokens.js +19 -17
- package/dist/auth/tokens.js.map +1 -1
- package/dist/auth/types.d.ts +13 -1
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/auth/types.js.map +1 -1
- package/dist/database/activity-coverage.d.ts +9 -0
- package/dist/database/activity-coverage.d.ts.map +1 -0
- package/dist/database/activity-coverage.js +11 -0
- package/dist/database/activity-coverage.js.map +1 -0
- package/dist/database/connection-lifecycle.d.ts +3 -0
- package/dist/database/connection-lifecycle.d.ts.map +1 -1
- package/dist/database/connection-lifecycle.js +54 -23
- package/dist/database/connection-lifecycle.js.map +1 -1
- package/dist/database/events.d.ts +12 -0
- package/dist/database/events.d.ts.map +1 -0
- package/dist/database/events.js +10 -0
- package/dist/database/events.js.map +1 -0
- package/dist/database/instances.d.ts +7 -7
- package/dist/database/instances.d.ts.map +1 -1
- package/dist/database/instances.js +35 -13
- package/dist/database/instances.js.map +1 -1
- package/dist/database/internal/query-projection.d.ts +102 -0
- package/dist/database/internal/query-projection.d.ts.map +1 -0
- package/dist/database/internal/query-projection.js +293 -0
- package/dist/database/internal/query-projection.js.map +1 -0
- package/dist/database/internal.d.ts +2 -0
- package/dist/database/internal.d.ts.map +1 -1
- package/dist/database/internal.js +2 -0
- package/dist/database/internal.js.map +1 -1
- package/dist/database/listeners.d.ts.map +1 -1
- package/dist/database/listeners.js +165 -37
- package/dist/database/listeners.js.map +1 -1
- package/dist/database/operations.d.ts.map +1 -1
- package/dist/database/operations.js +77 -50
- package/dist/database/operations.js.map +1 -1
- package/dist/database/replay.d.ts.map +1 -1
- package/dist/database/replay.js +6 -2
- package/dist/database/replay.js.map +1 -1
- package/dist/database/routing.d.ts +4 -0
- package/dist/database/routing.d.ts.map +1 -1
- package/dist/database/routing.js.map +1 -1
- package/dist/database/sandbox/backend-for.d.ts +4 -3
- package/dist/database/sandbox/backend-for.d.ts.map +1 -1
- package/dist/database/sandbox/backend-for.js +130 -24
- package/dist/database/sandbox/backend-for.js.map +1 -1
- package/dist/database/sandbox/backend-state.d.ts +7 -0
- package/dist/database/sandbox/backend-state.d.ts.map +1 -1
- package/dist/database/sandbox/backend-state.js +15 -1
- package/dist/database/sandbox/backend-state.js.map +1 -1
- package/dist/database/sandbox/backend.d.ts +2 -1
- package/dist/database/sandbox/backend.d.ts.map +1 -1
- package/dist/database/sandbox/backend.js +3 -3
- package/dist/database/sandbox/backend.js.map +1 -1
- package/dist/database/sandbox/child-listeners.d.ts +5 -0
- package/dist/database/sandbox/child-listeners.d.ts.map +1 -1
- package/dist/database/sandbox/child-listeners.js +34 -14
- package/dist/database/sandbox/child-listeners.js.map +1 -1
- package/dist/database/sandbox/listener-types.d.ts +5 -0
- package/dist/database/sandbox/listener-types.d.ts.map +1 -1
- package/dist/database/sandbox/operation-events.d.ts +5 -0
- package/dist/database/sandbox/operation-events.d.ts.map +1 -1
- package/dist/database/sandbox/operation-events.js +18 -3
- package/dist/database/sandbox/operation-events.js.map +1 -1
- package/dist/database/sandbox/persistence-state.d.ts.map +1 -1
- package/dist/database/sandbox/persistence-state.js +1 -8
- package/dist/database/sandbox/persistence-state.js.map +1 -1
- package/dist/database/sandbox/priority-writes.js +2 -2
- package/dist/database/sandbox/priority-writes.js.map +1 -1
- package/dist/database/sandbox/query.d.ts +2 -101
- package/dist/database/sandbox/query.d.ts.map +1 -1
- package/dist/database/sandbox/query.js +1 -225
- package/dist/database/sandbox/query.js.map +1 -1
- package/dist/database/sandbox/rules-eval.d.ts +28 -0
- package/dist/database/sandbox/rules-eval.d.ts.map +1 -1
- package/dist/database/sandbox/rules-eval.js +136 -9
- package/dist/database/sandbox/rules-eval.js.map +1 -1
- package/dist/database/sandbox/transactions.d.ts.map +1 -1
- package/dist/database/sandbox/transactions.js +17 -38
- package/dist/database/sandbox/transactions.js.map +1 -1
- package/dist/database/sandbox/value-listeners.d.ts +11 -1
- package/dist/database/sandbox/value-listeners.d.ts.map +1 -1
- package/dist/database/sandbox/value-listeners.js +65 -27
- package/dist/database/sandbox/value-listeners.js.map +1 -1
- package/dist/database/sandbox/write-plane.d.ts.map +1 -1
- package/dist/database/sandbox/write-plane.js +30 -22
- package/dist/database/sandbox/write-plane.js.map +1 -1
- package/dist/database/sdk-activity.d.ts +5 -0
- package/dist/database/sdk-activity.d.ts.map +1 -0
- package/dist/database/sdk-activity.js +20 -0
- package/dist/database/sdk-activity.js.map +1 -0
- package/dist/database/transactions.d.ts.map +1 -1
- package/dist/database/transactions.js +7 -3
- package/dist/database/transactions.js.map +1 -1
- package/dist/database/types.d.ts +9 -1
- package/dist/database/types.d.ts.map +1 -1
- package/dist/database/types.js.map +1 -1
- package/dist/deferred/entry.d.ts +6 -3
- package/dist/deferred/entry.d.ts.map +1 -1
- package/dist/deferred/entry.js +13 -10
- package/dist/deferred/entry.js.map +1 -1
- package/dist/firestore/activity-coverage.d.ts +9 -0
- package/dist/firestore/activity-coverage.d.ts.map +1 -0
- package/dist/firestore/activity-coverage.js +9 -0
- package/dist/firestore/activity-coverage.js.map +1 -0
- package/dist/firestore/aggregates.d.ts.map +1 -1
- package/dist/firestore/aggregates.js +32 -10
- package/dist/firestore/aggregates.js.map +1 -1
- package/dist/firestore/bytes.d.ts +13 -0
- package/dist/firestore/bytes.d.ts.map +1 -0
- package/dist/firestore/bytes.js +51 -0
- package/dist/firestore/bytes.js.map +1 -0
- package/dist/firestore/converter-method.d.ts +11 -0
- package/dist/firestore/converter-method.d.ts.map +1 -0
- package/dist/firestore/converter-method.js +39 -0
- package/dist/firestore/converter-method.js.map +1 -0
- package/dist/firestore/errors.d.ts.map +1 -1
- package/dist/firestore/errors.js +4 -0
- package/dist/firestore/errors.js.map +1 -1
- package/dist/firestore/field-values.d.ts +3 -36
- package/dist/firestore/field-values.d.ts.map +1 -1
- package/dist/firestore/field-values.js +3 -136
- package/dist/firestore/field-values.js.map +1 -1
- package/dist/firestore/geo-point.d.ts +15 -0
- package/dist/firestore/geo-point.d.ts.map +1 -0
- package/dist/firestore/geo-point.js +50 -0
- package/dist/firestore/geo-point.js.map +1 -0
- package/dist/firestore/index.d.ts +1 -1
- package/dist/firestore/index.d.ts.map +1 -1
- package/dist/firestore/index.js +1 -1
- package/dist/firestore/index.js.map +1 -1
- package/dist/firestore/instances.d.ts.map +1 -1
- package/dist/firestore/instances.js +23 -2
- package/dist/firestore/instances.js.map +1 -1
- package/dist/firestore/internal/document-data.d.ts +3 -0
- package/dist/firestore/internal/document-data.d.ts.map +1 -0
- package/dist/firestore/internal/document-data.js +10 -0
- package/dist/firestore/internal/document-data.js.map +1 -0
- package/dist/firestore/internal/index.d.ts +3 -0
- package/dist/firestore/internal/index.d.ts.map +1 -1
- package/dist/firestore/internal/index.js +5 -0
- package/dist/firestore/internal/index.js.map +1 -1
- package/dist/firestore/internal/value-codec.d.ts +16 -61
- package/dist/firestore/internal/value-codec.d.ts.map +1 -1
- package/dist/firestore/internal/value-codec.js +137 -82
- package/dist/firestore/internal/value-codec.js.map +1 -1
- package/dist/firestore/internal/value-depth.d.ts +3 -0
- package/dist/firestore/internal/value-depth.d.ts.map +1 -0
- package/dist/firestore/internal/value-depth.js +19 -0
- package/dist/firestore/internal/value-depth.js.map +1 -0
- package/dist/firestore/listeners.d.ts +18 -1
- package/dist/firestore/listeners.d.ts.map +1 -1
- package/dist/firestore/listeners.js +60 -21
- package/dist/firestore/listeners.js.map +1 -1
- package/dist/firestore/persistence.d.ts +0 -9
- package/dist/firestore/persistence.d.ts.map +1 -1
- package/dist/firestore/persistence.js +23 -9
- package/dist/firestore/persistence.js.map +1 -1
- package/dist/firestore/plain-object.d.ts +3 -0
- package/dist/firestore/plain-object.d.ts.map +1 -0
- package/dist/firestore/plain-object.js +9 -0
- package/dist/firestore/plain-object.js.map +1 -0
- package/dist/firestore/query-constraints.d.ts.map +1 -1
- package/dist/firestore/query-constraints.js +4 -3
- package/dist/firestore/query-constraints.js.map +1 -1
- package/dist/firestore/reads.d.ts +9 -7
- package/dist/firestore/reads.d.ts.map +1 -1
- package/dist/firestore/reads.js +74 -36
- package/dist/firestore/reads.js.map +1 -1
- package/dist/firestore/refs.d.ts +2 -1
- package/dist/firestore/refs.d.ts.map +1 -1
- package/dist/firestore/refs.js +37 -24
- package/dist/firestore/refs.js.map +1 -1
- package/dist/firestore/sandbox/activity-query-display.d.ts +67 -0
- package/dist/firestore/sandbox/activity-query-display.d.ts.map +1 -0
- package/dist/firestore/sandbox/activity-query-display.js +119 -0
- package/dist/firestore/sandbox/activity-query-display.js.map +1 -0
- package/dist/firestore/sandbox/admin-compat/batch.d.ts +4 -8
- package/dist/firestore/sandbox/admin-compat/batch.d.ts.map +1 -1
- package/dist/firestore/sandbox/admin-compat/batch.js +27 -19
- package/dist/firestore/sandbox/admin-compat/batch.js.map +1 -1
- package/dist/firestore/sandbox/admin-compat/query-comparison.d.ts.map +1 -1
- package/dist/firestore/sandbox/admin-compat/query-comparison.js +8 -3
- package/dist/firestore/sandbox/admin-compat/query-comparison.js.map +1 -1
- package/dist/firestore/sandbox/admin-compat/query.d.ts +8 -0
- package/dist/firestore/sandbox/admin-compat/query.d.ts.map +1 -1
- package/dist/firestore/sandbox/admin-compat/query.js +44 -5
- package/dist/firestore/sandbox/admin-compat/query.js.map +1 -1
- package/dist/firestore/sandbox/admin-compat/read-translation.d.ts.map +1 -1
- package/dist/firestore/sandbox/admin-compat/read-translation.js +18 -9
- package/dist/firestore/sandbox/admin-compat/read-translation.js.map +1 -1
- package/dist/firestore/sandbox/admin-compat/transaction.d.ts +2 -2
- package/dist/firestore/sandbox/admin-compat/transaction.d.ts.map +1 -1
- package/dist/firestore/sandbox/admin-compat/transaction.js +13 -4
- package/dist/firestore/sandbox/admin-compat/transaction.js.map +1 -1
- package/dist/firestore/sandbox/admin-compat/types.d.ts +6 -33
- package/dist/firestore/sandbox/admin-compat/types.d.ts.map +1 -1
- package/dist/firestore/sandbox/admin-compat/types.js +1 -76
- package/dist/firestore/sandbox/admin-compat/types.js.map +1 -1
- package/dist/firestore/sandbox/atomic-state.d.ts +4 -0
- package/dist/firestore/sandbox/atomic-state.d.ts.map +1 -0
- package/dist/firestore/sandbox/atomic-state.js +105 -0
- package/dist/firestore/sandbox/atomic-state.js.map +1 -0
- package/dist/firestore/sandbox/atomic-write-pipeline.d.ts +3 -2
- package/dist/firestore/sandbox/atomic-write-pipeline.d.ts.map +1 -1
- package/dist/firestore/sandbox/atomic-write-pipeline.js +128 -58
- package/dist/firestore/sandbox/atomic-write-pipeline.js.map +1 -1
- package/dist/firestore/sandbox/batch-write-executor.d.ts.map +1 -1
- package/dist/firestore/sandbox/batch-write-executor.js +54 -28
- package/dist/firestore/sandbox/batch-write-executor.js.map +1 -1
- package/dist/firestore/sandbox/converters/user-timestamp.d.ts +6 -40
- package/dist/firestore/sandbox/converters/user-timestamp.d.ts.map +1 -1
- package/dist/firestore/sandbox/converters/user-timestamp.js +20 -43
- package/dist/firestore/sandbox/converters/user-timestamp.js.map +1 -1
- package/dist/firestore/sandbox/document-copy.d.ts +4 -0
- package/dist/firestore/sandbox/document-copy.d.ts.map +1 -0
- package/dist/firestore/sandbox/document-copy.js +28 -0
- package/dist/firestore/sandbox/document-copy.js.map +1 -0
- package/dist/firestore/sandbox/document-store.d.ts +99 -0
- package/dist/firestore/sandbox/document-store.d.ts.map +1 -0
- package/dist/firestore/sandbox/document-store.js +2 -0
- package/dist/firestore/sandbox/document-store.js.map +1 -0
- package/dist/firestore/sandbox/errors.d.ts +4 -1
- package/dist/firestore/sandbox/errors.d.ts.map +1 -1
- package/dist/firestore/sandbox/errors.js +2 -25
- package/dist/firestore/sandbox/errors.js.map +1 -1
- package/dist/firestore/sandbox/event-log.d.ts +22 -4
- package/dist/firestore/sandbox/event-log.d.ts.map +1 -1
- package/dist/firestore/sandbox/event-log.js +66 -6
- package/dist/firestore/sandbox/event-log.js.map +1 -1
- package/dist/firestore/sandbox/field-merge.d.ts.map +1 -1
- package/dist/firestore/sandbox/field-merge.js +10 -20
- package/dist/firestore/sandbox/field-merge.js.map +1 -1
- package/dist/firestore/sandbox/history-controls.d.ts +1 -1
- package/dist/firestore/sandbox/history-controls.d.ts.map +1 -1
- package/dist/firestore/sandbox/history-controls.js +1 -1
- package/dist/firestore/sandbox/history-controls.js.map +1 -1
- package/dist/firestore/sandbox/list-query-proof.d.ts +4 -1
- package/dist/firestore/sandbox/list-query-proof.d.ts.map +1 -1
- package/dist/firestore/sandbox/list-query-proof.js +32 -96
- package/dist/firestore/sandbox/list-query-proof.js.map +1 -1
- package/dist/firestore/sandbox/listener-dispatch.d.ts +26 -1
- package/dist/firestore/sandbox/listener-dispatch.d.ts.map +1 -1
- package/dist/firestore/sandbox/listener-dispatch.js +58 -5
- package/dist/firestore/sandbox/listener-dispatch.js.map +1 -1
- package/dist/firestore/sandbox/local-environment.d.ts +16 -2
- package/dist/firestore/sandbox/local-environment.d.ts.map +1 -1
- package/dist/firestore/sandbox/local-environment.js +33 -9
- package/dist/firestore/sandbox/local-environment.js.map +1 -1
- package/dist/firestore/sandbox/local-state.d.ts +5 -99
- package/dist/firestore/sandbox/local-state.d.ts.map +1 -1
- package/dist/firestore/sandbox/local-state.js +64 -117
- package/dist/firestore/sandbox/local-state.js.map +1 -1
- package/dist/firestore/sandbox/query-execution.d.ts +4 -1
- package/dist/firestore/sandbox/query-execution.d.ts.map +1 -1
- package/dist/firestore/sandbox/query-execution.js +51 -26
- package/dist/firestore/sandbox/query-execution.js.map +1 -1
- package/dist/firestore/sandbox/query-operand-equality.d.ts.map +1 -1
- package/dist/firestore/sandbox/query-operand-equality.js +50 -14
- package/dist/firestore/sandbox/query-operand-equality.js.map +1 -1
- package/dist/firestore/sandbox/query-operators.d.ts +4 -0
- package/dist/firestore/sandbox/query-operators.d.ts.map +1 -0
- package/dist/firestore/sandbox/query-operators.js +17 -0
- package/dist/firestore/sandbox/query-operators.js.map +1 -0
- package/dist/firestore/sandbox/query-value-registry.d.ts +1 -1
- package/dist/firestore/sandbox/query-value-registry.d.ts.map +1 -1
- package/dist/firestore/sandbox/query-value-registry.js +3 -1
- package/dist/firestore/sandbox/query-value-registry.js.map +1 -1
- package/dist/firestore/sandbox/request-events.d.ts +3 -0
- package/dist/firestore/sandbox/request-events.d.ts.map +1 -1
- package/dist/firestore/sandbox/request-events.js +4 -0
- package/dist/firestore/sandbox/request-events.js.map +1 -1
- package/dist/firestore/sandbox/rules-evidence.d.ts +7 -0
- package/dist/firestore/sandbox/rules-evidence.d.ts.map +1 -0
- package/dist/firestore/sandbox/rules-evidence.js +87 -0
- package/dist/firestore/sandbox/rules-evidence.js.map +1 -0
- package/dist/firestore/sandbox/rules-list-authorizer.d.ts +13 -1
- package/dist/firestore/sandbox/rules-list-authorizer.d.ts.map +1 -1
- package/dist/firestore/sandbox/rules-list-authorizer.js +53 -74
- package/dist/firestore/sandbox/rules-list-authorizer.js.map +1 -1
- package/dist/firestore/sandbox/rules-operation-reader.d.ts +8 -1
- package/dist/firestore/sandbox/rules-operation-reader.d.ts.map +1 -1
- package/dist/firestore/sandbox/rules-operation-reader.js +13 -5
- package/dist/firestore/sandbox/rules-operation-reader.js.map +1 -1
- package/dist/firestore/sandbox/rules-read-engine.d.ts +8 -1
- package/dist/firestore/sandbox/rules-read-engine.d.ts.map +1 -1
- package/dist/firestore/sandbox/rules-read-engine.js +21 -10
- package/dist/firestore/sandbox/rules-read-engine.js.map +1 -1
- package/dist/firestore/sandbox/rules-state.d.ts +5 -0
- package/dist/firestore/sandbox/rules-state.d.ts.map +1 -1
- package/dist/firestore/sandbox/rules-state.js +16 -0
- package/dist/firestore/sandbox/rules-state.js.map +1 -1
- package/dist/firestore/sandbox/snapshot-listeners.d.ts +9 -1
- package/dist/firestore/sandbox/snapshot-listeners.d.ts.map +1 -1
- package/dist/firestore/sandbox/snapshot-listeners.js.map +1 -1
- package/dist/firestore/sandbox/transaction-merge.d.ts +2 -33
- package/dist/firestore/sandbox/transaction-merge.d.ts.map +1 -1
- package/dist/firestore/sandbox/transaction-merge.js +19 -7
- package/dist/firestore/sandbox/transaction-merge.js.map +1 -1
- package/dist/firestore/sandbox/transaction-types.d.ts +11 -21
- package/dist/firestore/sandbox/transaction-types.d.ts.map +1 -1
- package/dist/firestore/sandbox/transaction-types.js.map +1 -1
- package/dist/firestore/sandbox/transaction-write-executor.d.ts +2 -1
- package/dist/firestore/sandbox/transaction-write-executor.d.ts.map +1 -1
- package/dist/firestore/sandbox/transaction-write-executor.js +110 -69
- package/dist/firestore/sandbox/transaction-write-executor.js.map +1 -1
- package/dist/firestore/sandbox/transaction.d.ts +3 -2
- package/dist/firestore/sandbox/transaction.d.ts.map +1 -1
- package/dist/firestore/sandbox/transaction.js +23 -6
- package/dist/firestore/sandbox/transaction.js.map +1 -1
- package/dist/firestore/sandbox/value-resolver.d.ts +1 -8
- package/dist/firestore/sandbox/value-resolver.d.ts.map +1 -1
- package/dist/firestore/sandbox/value-resolver.js +2 -13
- package/dist/firestore/sandbox/value-resolver.js.map +1 -1
- package/dist/firestore/sandbox/write-engine.d.ts +5 -1
- package/dist/firestore/sandbox/write-engine.d.ts.map +1 -1
- package/dist/firestore/sandbox/write-engine.js +14 -7
- package/dist/firestore/sandbox/write-engine.js.map +1 -1
- package/dist/firestore/sandbox/write-runtime.d.ts +12 -4
- package/dist/firestore/sandbox/write-runtime.d.ts.map +1 -1
- package/dist/firestore/sandbox/write-runtime.js +72 -38
- package/dist/firestore/sandbox/write-runtime.js.map +1 -1
- package/dist/firestore/sandbox/writes.d.ts +3 -1
- package/dist/firestore/sandbox/writes.d.ts.map +1 -1
- package/dist/firestore/sdk-activity.d.ts +8 -0
- package/dist/firestore/sdk-activity.d.ts.map +1 -0
- package/dist/firestore/sdk-activity.js +23 -0
- package/dist/firestore/sdk-activity.js.map +1 -0
- package/dist/firestore/snapshots.d.ts +18 -2
- package/dist/firestore/snapshots.d.ts.map +1 -1
- package/dist/firestore/snapshots.js +69 -16
- package/dist/firestore/snapshots.js.map +1 -1
- package/dist/firestore/state.d.ts +8 -3
- package/dist/firestore/state.d.ts.map +1 -1
- package/dist/firestore/state.js +30 -13
- package/dist/firestore/state.js.map +1 -1
- package/dist/firestore/timestamp.d.ts +28 -0
- package/dist/firestore/timestamp.d.ts.map +1 -0
- package/dist/firestore/timestamp.js +80 -0
- package/dist/firestore/timestamp.js.map +1 -0
- package/dist/firestore/tools.d.ts.map +1 -1
- package/dist/firestore/tools.js +2 -4
- package/dist/firestore/tools.js.map +1 -1
- package/dist/firestore/transactions.d.ts.map +1 -1
- package/dist/firestore/transactions.js +76 -3
- package/dist/firestore/transactions.js.map +1 -1
- package/dist/firestore/types.d.ts +26 -5
- package/dist/firestore/types.d.ts.map +1 -1
- package/dist/firestore/types.js.map +1 -1
- package/dist/firestore/vector-value.d.ts +11 -0
- package/dist/firestore/vector-value.d.ts.map +1 -0
- package/dist/firestore/vector-value.js +51 -0
- package/dist/firestore/vector-value.js.map +1 -0
- package/dist/firestore/writes.d.ts +0 -7
- package/dist/firestore/writes.d.ts.map +1 -1
- package/dist/firestore/writes.js +42 -25
- package/dist/firestore/writes.js.map +1 -1
- package/dist/functions/events.d.ts +12 -0
- package/dist/functions/events.d.ts.map +1 -0
- package/dist/functions/events.js +10 -0
- package/dist/functions/events.js.map +1 -0
- package/dist/messaging/broker/broker.d.ts +43 -30
- package/dist/messaging/broker/broker.d.ts.map +1 -1
- package/dist/messaging/broker/broker.js +148 -43
- package/dist/messaging/broker/broker.js.map +1 -1
- package/dist/messaging/broker/delivery-history.d.ts +5 -0
- package/dist/messaging/broker/delivery-history.d.ts.map +1 -0
- package/dist/messaging/broker/delivery-history.js +46 -0
- package/dist/messaging/broker/delivery-history.js.map +1 -0
- package/dist/messaging/broker/index.d.ts +2 -1
- package/dist/messaging/broker/index.d.ts.map +1 -1
- package/dist/messaging/broker/index.js +7 -0
- package/dist/messaging/broker/index.js.map +1 -1
- package/dist/messaging/broker/persistence.d.ts +12 -0
- package/dist/messaging/broker/persistence.d.ts.map +1 -0
- package/dist/messaging/broker/persistence.js +42 -0
- package/dist/messaging/broker/persistence.js.map +1 -0
- package/dist/messaging/broker/types.d.ts +44 -0
- package/dist/messaging/broker/types.d.ts.map +1 -1
- package/dist/messaging/broker/types.js +10 -1
- package/dist/messaging/broker/types.js.map +1 -1
- package/dist/messaging/events.d.ts +12 -0
- package/dist/messaging/events.d.ts.map +1 -0
- package/dist/messaging/events.js +19 -0
- package/dist/messaging/events.js.map +1 -0
- package/dist/rules/api/case-types.d.ts +7 -0
- package/dist/rules/api/case-types.d.ts.map +1 -1
- package/dist/rules/api/rtdb.d.ts.map +1 -1
- package/dist/rules/api/rtdb.js +20 -7
- package/dist/rules/api/rtdb.js.map +1 -1
- package/dist/rules/grammar/parse-error-wording.d.ts +31 -0
- package/dist/rules/grammar/parse-error-wording.d.ts.map +1 -0
- package/dist/rules/grammar/parse-error-wording.js +86 -0
- package/dist/rules/grammar/parse-error-wording.js.map +1 -0
- package/dist/rules/indexes/query-analysis.d.ts +33 -0
- package/dist/rules/indexes/query-analysis.d.ts.map +1 -0
- package/dist/rules/indexes/query-analysis.js +153 -0
- package/dist/rules/indexes/query-analysis.js.map +1 -0
- package/dist/rules/indexes/service-query.d.ts +48 -0
- package/dist/rules/indexes/service-query.d.ts.map +1 -0
- package/dist/rules/indexes/service-query.js +60 -0
- package/dist/rules/indexes/service-query.js.map +1 -0
- package/dist/rules/internal/index.d.ts +4 -0
- package/dist/rules/internal/index.d.ts.map +1 -1
- package/dist/rules/internal/index.js +10 -0
- package/dist/rules/internal/index.js.map +1 -1
- package/dist/rules/modules/rules-capabilities.generated.d.ts +1 -1
- package/dist/rules/modules/rules-capabilities.generated.js +1 -1
- package/dist/rules/modules/rules-capabilities.generated.js.map +1 -1
- package/dist/rules/rtdb/constraints/atoms.d.ts.map +1 -1
- package/dist/rules/rtdb/constraints/atoms.js +7 -7
- package/dist/rules/rtdb/constraints/atoms.js.map +1 -1
- package/dist/rules/rtdb/constraints/data.d.ts +2 -2
- package/dist/rules/rtdb/constraints/data.d.ts.map +1 -1
- package/dist/rules/rtdb/constraints/data.js +4 -4
- package/dist/rules/rtdb/constraints/data.js.map +1 -1
- package/dist/rules/rtdb/constraints/document.d.ts.map +1 -1
- package/dist/rules/rtdb/constraints/document.js +6 -2
- package/dist/rules/rtdb/constraints/document.js.map +1 -1
- package/dist/rules/rtdb/constraints/policies.d.ts +2 -2
- package/dist/rules/rtdb/constraints/policies.d.ts.map +1 -1
- package/dist/rules/rtdb/constraints/policies.js +3 -3
- package/dist/rules/rtdb/constraints/policies.js.map +1 -1
- package/dist/rules/rtdb/constraints/schema.js +3 -3
- package/dist/rules/rtdb/constraints/schema.js.map +1 -1
- package/dist/rules/rtdb/grammar/RtdbExpr.ohm +1 -3
- package/dist/rules/rtdb/grammar/RtdbExpr.ohm.generated.d.ts +1 -1
- package/dist/rules/rtdb/grammar/RtdbExpr.ohm.generated.d.ts.map +1 -1
- package/dist/rules/rtdb/grammar/RtdbExpr.ohm.generated.js +1 -3
- package/dist/rules/rtdb/grammar/RtdbExpr.ohm.generated.js.map +1 -1
- package/dist/rules/rtdb/grammar/linter.d.ts.map +1 -1
- package/dist/rules/rtdb/grammar/linter.js +28 -30
- package/dist/rules/rtdb/grammar/linter.js.map +1 -1
- package/dist/rules/rtdb/grammar/simulator.d.ts +15 -1
- package/dist/rules/rtdb/grammar/simulator.d.ts.map +1 -1
- package/dist/rules/rtdb/grammar/simulator.js +93 -65
- package/dist/rules/rtdb/grammar/simulator.js.map +1 -1
- package/dist/rules/rtdb/grammar/validator.d.ts.map +1 -1
- package/dist/rules/rtdb/grammar/validator.js +25 -26
- package/dist/rules/rtdb/grammar/validator.js.map +1 -1
- package/dist/rules/rtdb/simulation/handler.d.ts.map +1 -1
- package/dist/rules/rtdb/simulation/handler.js +136 -32
- package/dist/rules/rtdb/simulation/handler.js.map +1 -1
- package/dist/rules/rtdb/simulation/spec.d.ts +95 -5
- package/dist/rules/rtdb/simulation/spec.d.ts.map +1 -1
- package/dist/rules/rtdb/simulation/spec.js +22 -1
- package/dist/rules/rtdb/simulation/spec.js.map +1 -1
- package/dist/rules/rtdb/types.d.ts +18 -18
- package/dist/rules/simulator/evaluator.js +35 -69
- package/dist/rules/simulator/evaluator.js.map +1 -1
- package/dist/rules/simulator/handler.d.ts.map +1 -1
- package/dist/rules/simulator/handler.js +12 -3
- package/dist/rules/simulator/handler.js.map +1 -1
- package/dist/rules/simulator/mapdiff.d.ts +2 -0
- package/dist/rules/simulator/mapdiff.d.ts.map +1 -1
- package/dist/rules/simulator/mapdiff.js +7 -5
- package/dist/rules/simulator/mapdiff.js.map +1 -1
- package/dist/rules/simulator/query-proof-residual.d.ts +11 -0
- package/dist/rules/simulator/query-proof-residual.d.ts.map +1 -0
- package/dist/rules/simulator/query-proof-residual.js +177 -0
- package/dist/rules/simulator/query-proof-residual.js.map +1 -0
- package/dist/rules/simulator/query-proof.d.ts +21 -47
- package/dist/rules/simulator/query-proof.d.ts.map +1 -1
- package/dist/rules/simulator/query-proof.js +78 -13
- package/dist/rules/simulator/query-proof.js.map +1 -1
- package/dist/rules/simulator/request-path.d.ts +26 -0
- package/dist/rules/simulator/request-path.d.ts.map +1 -0
- package/dist/rules/simulator/request-path.js +36 -0
- package/dist/rules/simulator/request-path.js.map +1 -0
- package/dist/rules/simulator/trace-recorder.d.ts +1 -0
- package/dist/rules/simulator/trace-recorder.d.ts.map +1 -1
- package/dist/rules/simulator/trace-recorder.js +4 -0
- package/dist/rules/simulator/trace-recorder.js.map +1 -1
- package/dist/rules/simulator/wrappers/timestamp.d.ts +6 -0
- package/dist/rules/simulator/wrappers/timestamp.d.ts.map +1 -1
- package/dist/rules/simulator/wrappers/timestamp.js +8 -1
- package/dist/rules/simulator/wrappers/timestamp.js.map +1 -1
- package/dist/rules/simulator-tools-impl.d.ts.map +1 -1
- package/dist/rules/simulator-tools-impl.js +6 -3
- package/dist/rules/simulator-tools-impl.js.map +1 -1
- package/dist/rules/stdlib-tools.js +4 -4
- package/dist/rules/stdlib-tools.js.map +1 -1
- package/dist/rules/test/spec.d.ts +4 -4
- package/dist/sandbox/active-listeners.d.ts +69 -0
- package/dist/sandbox/active-listeners.d.ts.map +1 -0
- package/dist/sandbox/active-listeners.js +159 -0
- package/dist/sandbox/active-listeners.js.map +1 -0
- package/dist/sandbox/admin-firestore/error-translation.d.ts.map +1 -1
- package/dist/sandbox/admin-firestore/error-translation.js +15 -2
- package/dist/sandbox/admin-firestore/error-translation.js.map +1 -1
- package/dist/sandbox/admin-firestore/listeners.d.ts +0 -25
- package/dist/sandbox/admin-firestore/listeners.d.ts.map +1 -1
- package/dist/sandbox/admin-firestore/listeners.js +26 -2
- package/dist/sandbox/admin-firestore/listeners.js.map +1 -1
- package/dist/sandbox/admin-firestore/remote/listeners.d.ts.map +1 -1
- package/dist/sandbox/admin-firestore/remote/listeners.js +50 -29
- package/dist/sandbox/admin-firestore/remote/listeners.js.map +1 -1
- package/dist/sandbox/admin-firestore/remote/value-codec.d.ts +5 -12
- package/dist/sandbox/admin-firestore/remote/value-codec.d.ts.map +1 -1
- package/dist/sandbox/admin-firestore/remote/value-codec.js +7 -14
- package/dist/sandbox/admin-firestore/remote/value-codec.js.map +1 -1
- package/dist/sandbox/admin-firestore/remote/wire-types.d.ts +2 -0
- package/dist/sandbox/admin-firestore/remote/wire-types.d.ts.map +1 -1
- package/dist/sandbox/attribution/attribution-mode.d.ts +36 -0
- package/dist/sandbox/attribution/attribution-mode.d.ts.map +1 -0
- package/dist/sandbox/attribution/attribution-mode.js +68 -0
- package/dist/sandbox/attribution/attribution-mode.js.map +1 -0
- package/dist/sandbox/attribution/effect-regions.d.ts +37 -0
- package/dist/sandbox/attribution/effect-regions.d.ts.map +1 -0
- package/dist/sandbox/attribution/effect-regions.js +114 -0
- package/dist/sandbox/attribution/effect-regions.js.map +1 -0
- package/dist/sandbox/attribution/element-selector.d.ts +42 -0
- package/dist/sandbox/attribution/element-selector.d.ts.map +1 -0
- package/dist/sandbox/attribution/element-selector.js +109 -0
- package/dist/sandbox/attribution/element-selector.js.map +1 -0
- package/dist/sandbox/attribution/listener-owners.d.ts +111 -0
- package/dist/sandbox/attribution/listener-owners.d.ts.map +1 -0
- package/dist/sandbox/attribution/listener-owners.js +215 -0
- package/dist/sandbox/attribution/listener-owners.js.map +1 -0
- package/dist/sandbox/branches/engine.d.ts +129 -0
- package/dist/sandbox/branches/engine.d.ts.map +1 -0
- package/dist/sandbox/branches/engine.js +280 -0
- package/dist/sandbox/branches/engine.js.map +1 -0
- package/dist/sandbox/branches/index.d.ts +12 -139
- package/dist/sandbox/branches/index.d.ts.map +1 -1
- package/dist/sandbox/branches/index.js +8 -390
- package/dist/sandbox/branches/index.js.map +1 -1
- package/dist/sandbox/branches/promotion.d.ts +27 -0
- package/dist/sandbox/branches/promotion.d.ts.map +1 -0
- package/dist/sandbox/branches/promotion.js +160 -0
- package/dist/sandbox/branches/promotion.js.map +1 -0
- package/dist/sandbox/branches/state-diff.d.ts +66 -0
- package/dist/sandbox/branches/state-diff.d.ts.map +1 -0
- package/dist/sandbox/branches/state-diff.js +270 -0
- package/dist/sandbox/branches/state-diff.js.map +1 -0
- package/dist/sandbox/branches/store.d.ts +64 -0
- package/dist/sandbox/branches/store.d.ts.map +1 -0
- package/dist/sandbox/branches/store.js +264 -0
- package/dist/sandbox/branches/store.js.map +1 -0
- package/dist/sandbox/checkpoints/capture.d.ts +39 -0
- package/dist/sandbox/checkpoints/capture.d.ts.map +1 -0
- package/dist/sandbox/checkpoints/capture.js +69 -0
- package/dist/sandbox/checkpoints/capture.js.map +1 -0
- package/dist/sandbox/checkpoints/directory-backend.d.ts +30 -0
- package/dist/sandbox/checkpoints/directory-backend.d.ts.map +1 -0
- package/dist/sandbox/checkpoints/directory-backend.js +98 -0
- package/dist/sandbox/checkpoints/directory-backend.js.map +1 -0
- package/dist/sandbox/checkpoints/index.d.ts +15 -0
- package/dist/sandbox/checkpoints/index.d.ts.map +1 -0
- package/dist/sandbox/checkpoints/index.js +13 -0
- package/dist/sandbox/checkpoints/index.js.map +1 -0
- package/dist/sandbox/checkpoints/record-backend.d.ts +25 -0
- package/dist/sandbox/checkpoints/record-backend.d.ts.map +1 -0
- package/dist/sandbox/checkpoints/record-backend.js +81 -0
- package/dist/sandbox/checkpoints/record-backend.js.map +1 -0
- package/dist/sandbox/checkpoints/saved-states.d.ts +35 -0
- package/dist/sandbox/checkpoints/saved-states.d.ts.map +1 -0
- package/dist/sandbox/checkpoints/saved-states.js +47 -0
- package/dist/sandbox/checkpoints/saved-states.js.map +1 -0
- package/dist/sandbox/checkpoints/types.d.ts +84 -0
- package/dist/sandbox/checkpoints/types.d.ts.map +1 -0
- package/dist/sandbox/checkpoints/types.js +51 -0
- package/dist/sandbox/checkpoints/types.js.map +1 -0
- package/dist/sandbox/checkpoints/validation.d.ts +3 -0
- package/dist/sandbox/checkpoints/validation.d.ts.map +1 -0
- package/dist/sandbox/checkpoints/validation.js +99 -0
- package/dist/sandbox/checkpoints/validation.js.map +1 -0
- package/dist/sandbox/clock.d.ts +121 -0
- package/dist/sandbox/clock.d.ts.map +1 -0
- package/dist/sandbox/clock.js +167 -0
- package/dist/sandbox/clock.js.map +1 -0
- package/dist/sandbox/full-state.d.ts +160 -0
- package/dist/sandbox/full-state.d.ts.map +1 -0
- package/dist/sandbox/full-state.js +267 -0
- package/dist/sandbox/full-state.js.map +1 -0
- package/dist/sandbox/index.d.ts +13 -6
- package/dist/sandbox/index.d.ts.map +1 -1
- package/dist/sandbox/index.js +23 -9
- package/dist/sandbox/index.js.map +1 -1
- package/dist/sandbox/internal/ai-evidence.d.ts +27 -0
- package/dist/sandbox/internal/ai-evidence.d.ts.map +1 -0
- package/dist/sandbox/internal/ai-evidence.js +29 -0
- package/dist/sandbox/internal/ai-evidence.js.map +1 -0
- package/dist/sandbox/internal/event-history.d.ts +32 -0
- package/dist/sandbox/internal/event-history.d.ts.map +1 -0
- package/dist/sandbox/internal/event-history.js +199 -0
- package/dist/sandbox/internal/event-history.js.map +1 -0
- package/dist/sandbox/internal/history-integrity.d.ts +3 -0
- package/dist/sandbox/internal/history-integrity.d.ts.map +1 -0
- package/dist/sandbox/internal/history-integrity.js +12 -0
- package/dist/sandbox/internal/history-integrity.js.map +1 -0
- package/dist/sandbox/internal/history-retention.d.ts +6 -0
- package/dist/sandbox/internal/history-retention.d.ts.map +1 -0
- package/dist/sandbox/internal/history-retention.js +12 -0
- package/dist/sandbox/internal/history-retention.js.map +1 -0
- package/dist/sandbox/internal/index.d.ts +27 -0
- package/dist/sandbox/internal/index.d.ts.map +1 -1
- package/dist/sandbox/internal/index.js +26 -0
- package/dist/sandbox/internal/index.js.map +1 -1
- package/dist/sandbox/internal/observation-history.d.ts +6 -0
- package/dist/sandbox/internal/observation-history.d.ts.map +1 -0
- package/dist/sandbox/internal/observation-history.js +6 -0
- package/dist/sandbox/internal/observation-history.js.map +1 -0
- package/dist/sandbox/internal/observation-payload.d.ts +6 -0
- package/dist/sandbox/internal/observation-payload.d.ts.map +1 -0
- package/dist/sandbox/internal/observation-payload.js +24 -0
- package/dist/sandbox/internal/observation-payload.js.map +1 -0
- package/dist/sandbox/internal/provenance.d.ts +0 -1
- package/dist/sandbox/internal/provenance.d.ts.map +1 -1
- package/dist/sandbox/internal/provenance.js +6 -0
- package/dist/sandbox/internal/provenance.js.map +1 -1
- package/dist/sandbox/internal/root.d.ts +2 -1
- package/dist/sandbox/internal/root.d.ts.map +1 -1
- package/dist/sandbox/internal/root.js +2 -2
- package/dist/sandbox/internal/root.js.map +1 -1
- package/dist/sandbox/internal/rules-evidence-retention.d.ts +11 -0
- package/dist/sandbox/internal/rules-evidence-retention.d.ts.map +1 -0
- package/dist/sandbox/internal/rules-evidence-retention.js +27 -0
- package/dist/sandbox/internal/rules-evidence-retention.js.map +1 -0
- package/dist/sandbox/internal/sandbox-impl.d.ts +40 -33
- package/dist/sandbox/internal/sandbox-impl.d.ts.map +1 -1
- package/dist/sandbox/internal/sandbox-impl.js +83 -40
- package/dist/sandbox/internal/sandbox-impl.js.map +1 -1
- package/dist/sandbox/internal/sdk-activity.d.ts +112 -0
- package/dist/sandbox/internal/sdk-activity.d.ts.map +1 -0
- package/dist/sandbox/internal/sdk-activity.js +240 -0
- package/dist/sandbox/internal/sdk-activity.js.map +1 -0
- package/dist/sandbox/internal/sdk-coverage.d.ts +10 -0
- package/dist/sandbox/internal/sdk-coverage.d.ts.map +1 -0
- package/dist/sandbox/internal/sdk-coverage.js +21 -0
- package/dist/sandbox/internal/sdk-coverage.js.map +1 -0
- package/dist/sandbox/internal/sdk-observation.d.ts +32 -0
- package/dist/sandbox/internal/sdk-observation.d.ts.map +1 -0
- package/dist/sandbox/internal/sdk-observation.js +29 -0
- package/dist/sandbox/internal/sdk-observation.js.map +1 -0
- package/dist/sandbox/internal/sdk-rates.d.ts +97 -0
- package/dist/sandbox/internal/sdk-rates.d.ts.map +1 -0
- package/dist/sandbox/internal/sdk-rates.js +187 -0
- package/dist/sandbox/internal/sdk-rates.js.map +1 -0
- package/dist/sandbox/internal/sdk-write-activity.d.ts +5 -0
- package/dist/sandbox/internal/sdk-write-activity.d.ts.map +1 -0
- package/dist/sandbox/internal/sdk-write-activity.js +13 -0
- package/dist/sandbox/internal/sdk-write-activity.js.map +1 -0
- package/dist/sandbox/internal/state-schemas.d.ts +120 -0
- package/dist/sandbox/internal/state-schemas.d.ts.map +1 -0
- package/dist/sandbox/internal/state-schemas.js +42 -0
- package/dist/sandbox/internal/state-schemas.js.map +1 -0
- package/dist/sandbox/internal/state-values.d.ts +6 -0
- package/dist/sandbox/internal/state-values.d.ts.map +1 -0
- package/dist/sandbox/internal/state-values.js +15 -0
- package/dist/sandbox/internal/state-values.js.map +1 -0
- package/dist/sandbox/internal/storage-activity.d.ts +13 -0
- package/dist/sandbox/internal/storage-activity.d.ts.map +1 -0
- package/dist/sandbox/internal/storage-activity.js +48 -0
- package/dist/sandbox/internal/storage-activity.js.map +1 -0
- package/dist/sandbox/internal/usage-evidence.d.ts +24 -0
- package/dist/sandbox/internal/usage-evidence.d.ts.map +1 -0
- package/dist/sandbox/internal/usage-evidence.js +56 -0
- package/dist/sandbox/internal/usage-evidence.js.map +1 -0
- package/dist/sandbox/operation-record.d.ts +20 -1
- package/dist/sandbox/operation-record.d.ts.map +1 -1
- package/dist/sandbox/operation-record.js +100 -4
- package/dist/sandbox/operation-record.js.map +1 -1
- package/dist/sandbox/persistence/changed-buckets.d.ts +19 -0
- package/dist/sandbox/persistence/changed-buckets.d.ts.map +1 -0
- package/dist/sandbox/persistence/changed-buckets.js +72 -0
- package/dist/sandbox/persistence/changed-buckets.js.map +1 -0
- package/dist/sandbox/persistence/chunk-format.d.ts +27 -1
- package/dist/sandbox/persistence/chunk-format.d.ts.map +1 -1
- package/dist/sandbox/persistence/chunk-format.js +37 -25
- package/dist/sandbox/persistence/chunk-format.js.map +1 -1
- package/dist/sandbox/persistence/controller.d.ts.map +1 -1
- package/dist/sandbox/persistence/controller.js +91 -36
- package/dist/sandbox/persistence/controller.js.map +1 -1
- package/dist/sandbox/persistence/import-bundle.d.ts +8 -0
- package/dist/sandbox/persistence/import-bundle.d.ts.map +1 -0
- package/dist/sandbox/persistence/import-bundle.js +66 -0
- package/dist/sandbox/persistence/import-bundle.js.map +1 -0
- package/dist/sandbox/persistence/serialize.d.ts +1 -1
- package/dist/sandbox/persistence/serialize.d.ts.map +1 -1
- package/dist/sandbox/persistence/serialize.js +16 -11
- package/dist/sandbox/persistence/serialize.js.map +1 -1
- package/dist/sandbox/persistence/types.d.ts +4 -0
- package/dist/sandbox/persistence/types.d.ts.map +1 -1
- package/dist/sandbox/persistence/validate-services.d.ts +7 -0
- package/dist/sandbox/persistence/validate-services.d.ts.map +1 -0
- package/dist/sandbox/persistence/validate-services.js +73 -0
- package/dist/sandbox/persistence/validate-services.js.map +1 -0
- package/dist/sandbox/remote.d.ts +6 -0
- package/dist/sandbox/remote.d.ts.map +1 -1
- package/dist/sandbox/remote.js.map +1 -1
- package/dist/sandbox/replay/index.d.ts +1 -1
- package/dist/sandbox/replay/index.d.ts.map +1 -1
- package/dist/sandbox/replay/index.js +18 -8
- package/dist/sandbox/replay/index.js.map +1 -1
- package/dist/sandbox/types/errors.d.ts +3 -1
- package/dist/sandbox/types/errors.d.ts.map +1 -1
- package/dist/sandbox/types/errors.js +0 -4
- package/dist/sandbox/types/errors.js.map +1 -1
- package/dist/sandbox/types/events.d.ts +105 -76
- package/dist/sandbox/types/events.d.ts.map +1 -1
- package/dist/sandbox/types/events.js +0 -5
- package/dist/sandbox/types/events.js.map +1 -1
- package/dist/sandbox/types/index.d.ts +2 -1
- package/dist/sandbox/types/index.d.ts.map +1 -1
- package/dist/sandbox/types/index.js +1 -0
- package/dist/sandbox/types/index.js.map +1 -1
- package/dist/sandbox/types/operation.d.ts +13 -4
- package/dist/sandbox/types/operation.d.ts.map +1 -1
- package/dist/sandbox/types/persistence.d.ts +2 -2
- package/dist/sandbox/types/query-proof.d.ts +25 -0
- package/dist/sandbox/types/query-proof.d.ts.map +1 -0
- package/dist/sandbox/types/query-proof.js +2 -0
- package/dist/sandbox/types/query-proof.js.map +1 -0
- package/dist/sandbox/types/request-observation.d.ts +19 -0
- package/dist/sandbox/types/request-observation.d.ts.map +1 -0
- package/dist/sandbox/types/request-observation.js +13 -0
- package/dist/sandbox/types/request-observation.js.map +1 -0
- package/dist/sandbox/types/rules-evidence.d.ts +48 -0
- package/dist/sandbox/types/rules-evidence.d.ts.map +1 -0
- package/dist/sandbox/types/rules-evidence.js +2 -0
- package/dist/sandbox/types/rules-evidence.js.map +1 -0
- package/dist/sandbox/types/service-event-record.d.ts +30 -0
- package/dist/sandbox/types/service-event-record.d.ts.map +1 -0
- package/dist/sandbox/types/service-event-record.js +13 -0
- package/dist/sandbox/types/service-event-record.js.map +1 -0
- package/dist/sandbox/types/service-event-records.d.ts +64 -0
- package/dist/sandbox/types/service-event-records.d.ts.map +1 -0
- package/dist/sandbox/types/service-event-records.js +31 -0
- package/dist/sandbox/types/service-event-records.js.map +1 -0
- package/dist/sandbox/types/service-mutation-event.d.ts +88 -0
- package/dist/sandbox/types/service-mutation-event.d.ts.map +1 -0
- package/dist/sandbox/types/service-mutation-event.js +2 -0
- package/dist/sandbox/types/service-mutation-event.js.map +1 -0
- package/dist/storage/activity-coverage.d.ts +9 -0
- package/dist/storage/activity-coverage.d.ts.map +1 -0
- package/dist/storage/activity-coverage.js +9 -0
- package/dist/storage/activity-coverage.js.map +1 -0
- package/dist/storage/base64.d.ts +14 -0
- package/dist/storage/base64.d.ts.map +1 -0
- package/dist/storage/base64.js +34 -0
- package/dist/storage/base64.js.map +1 -0
- package/dist/storage/download.d.ts +12 -4
- package/dist/storage/download.d.ts.map +1 -1
- package/dist/storage/download.js +19 -6
- package/dist/storage/download.js.map +1 -1
- package/dist/storage/enforce.d.ts +13 -2
- package/dist/storage/enforce.d.ts.map +1 -1
- package/dist/storage/enforce.js +21 -3
- package/dist/storage/enforce.js.map +1 -1
- package/dist/storage/errors.d.ts +29 -5
- package/dist/storage/errors.d.ts.map +1 -1
- package/dist/storage/errors.js +28 -0
- package/dist/storage/errors.js.map +1 -1
- package/dist/storage/events.d.ts +12 -0
- package/dist/storage/events.d.ts.map +1 -0
- package/dist/storage/events.js +10 -0
- package/dist/storage/events.js.map +1 -0
- package/dist/storage/index.d.ts +7 -7
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +7 -5
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.d.ts +10 -1
- package/dist/storage/internal.d.ts.map +1 -1
- package/dist/storage/internal.js +9 -1
- package/dist/storage/internal.js.map +1 -1
- package/dist/storage/metadata.d.ts +19 -0
- package/dist/storage/metadata.d.ts.map +1 -1
- package/dist/storage/metadata.js +50 -19
- package/dist/storage/metadata.js.map +1 -1
- package/dist/storage/observed.d.ts +16 -0
- package/dist/storage/observed.d.ts.map +1 -0
- package/dist/storage/observed.js +17 -0
- package/dist/storage/observed.js.map +1 -0
- package/dist/storage/persistence.d.ts +157 -20
- package/dist/storage/persistence.d.ts.map +1 -1
- package/dist/storage/persistence.js +423 -53
- package/dist/storage/persistence.js.map +1 -1
- package/dist/storage/reference.d.ts +3 -1
- package/dist/storage/reference.d.ts.map +1 -1
- package/dist/storage/reference.js +3 -2
- package/dist/storage/reference.js.map +1 -1
- package/dist/storage/remote-bytes.d.ts +44 -0
- package/dist/storage/remote-bytes.d.ts.map +1 -0
- package/dist/storage/remote-bytes.js +97 -0
- package/dist/storage/remote-bytes.js.map +1 -0
- package/dist/storage/resumable.d.ts.map +1 -1
- package/dist/storage/resumable.js +16 -0
- package/dist/storage/resumable.js.map +1 -1
- package/dist/storage/rules-resolution.d.ts +13 -1
- package/dist/storage/rules-resolution.d.ts.map +1 -1
- package/dist/storage/rules-resolution.js +28 -0
- package/dist/storage/rules-resolution.js.map +1 -1
- package/dist/storage/sandbox/persistence-state.d.ts +25 -0
- package/dist/storage/sandbox/persistence-state.d.ts.map +1 -0
- package/dist/storage/sandbox/persistence-state.js +53 -0
- package/dist/storage/sandbox/persistence-state.js.map +1 -0
- package/dist/storage/sandbox/rules-bindings.d.ts +15 -0
- package/dist/storage/sandbox/rules-bindings.d.ts.map +1 -0
- package/dist/storage/sandbox/rules-bindings.js +69 -0
- package/dist/storage/sandbox/rules-bindings.js.map +1 -0
- package/dist/storage/sandbox/rules-collection-methods.d.ts +3 -0
- package/dist/storage/sandbox/rules-collection-methods.d.ts.map +1 -0
- package/dist/storage/sandbox/rules-collection-methods.js +149 -0
- package/dist/storage/sandbox/rules-collection-methods.js.map +1 -0
- package/dist/storage/sandbox/rules-evaluator.d.ts +2 -2
- package/dist/storage/sandbox/rules-evaluator.d.ts.map +1 -1
- package/dist/storage/sandbox/rules-evaluator.js +51 -129
- package/dist/storage/sandbox/rules-evaluator.js.map +1 -1
- package/dist/storage/sandbox/rules-firestore-lookup.d.ts +25 -0
- package/dist/storage/sandbox/rules-firestore-lookup.d.ts.map +1 -0
- package/dist/storage/sandbox/rules-firestore-lookup.js +94 -0
- package/dist/storage/sandbox/rules-firestore-lookup.js.map +1 -0
- package/dist/storage/sandbox/rules-hashing-methods.d.ts +16 -0
- package/dist/storage/sandbox/rules-hashing-methods.d.ts.map +1 -0
- package/dist/storage/sandbox/rules-hashing-methods.js +41 -0
- package/dist/storage/sandbox/rules-hashing-methods.js.map +1 -0
- package/dist/storage/sandbox/rules-method-calls.d.ts +40 -0
- package/dist/storage/sandbox/rules-method-calls.d.ts.map +1 -0
- package/dist/storage/sandbox/rules-method-calls.js +47 -0
- package/dist/storage/sandbox/rules-method-calls.js.map +1 -0
- package/dist/storage/sandbox/rules-methods.d.ts +11 -12
- package/dist/storage/sandbox/rules-methods.d.ts.map +1 -1
- package/dist/storage/sandbox/rules-methods.js +62 -359
- package/dist/storage/sandbox/rules-methods.js.map +1 -1
- package/dist/storage/sandbox/rules-operators.d.ts +32 -0
- package/dist/storage/sandbox/rules-operators.d.ts.map +1 -0
- package/dist/storage/sandbox/rules-operators.js +85 -0
- package/dist/storage/sandbox/rules-operators.js.map +1 -0
- package/dist/storage/sandbox/rules-string-methods.d.ts +3 -0
- package/dist/storage/sandbox/rules-string-methods.d.ts.map +1 -0
- package/dist/storage/sandbox/rules-string-methods.js +199 -0
- package/dist/storage/sandbox/rules-string-methods.js.map +1 -0
- package/dist/storage/sandbox/rules-time-methods.d.ts +25 -0
- package/dist/storage/sandbox/rules-time-methods.d.ts.map +1 -0
- package/dist/storage/sandbox/rules-time-methods.js +89 -0
- package/dist/storage/sandbox/rules-time-methods.js.map +1 -0
- package/dist/storage/sandbox/rules-values.d.ts +6 -0
- package/dist/storage/sandbox/rules-values.d.ts.map +1 -1
- package/dist/storage/sandbox/rules-values.js +29 -2
- package/dist/storage/sandbox/rules-values.js.map +1 -1
- package/dist/storage/sandbox/rules.d.ts +25 -13
- package/dist/storage/sandbox/rules.d.ts.map +1 -1
- package/dist/storage/sandbox/rules.js +19 -10
- package/dist/storage/sandbox/rules.js.map +1 -1
- package/dist/storage/sandbox/running-service.d.ts +65 -0
- package/dist/storage/sandbox/running-service.d.ts.map +1 -0
- package/dist/storage/sandbox/running-service.js +30 -0
- package/dist/storage/sandbox/running-service.js.map +1 -0
- package/dist/storage/service.d.ts +46 -28
- package/dist/storage/service.d.ts.map +1 -1
- package/dist/storage/service.js +169 -57
- package/dist/storage/service.js.map +1 -1
- package/dist/storage/string-format.d.ts +9 -0
- package/dist/storage/string-format.d.ts.map +1 -0
- package/dist/storage/string-format.js +8 -0
- package/dist/storage/string-format.js.map +1 -0
- package/dist/storage/upload.d.ts +2 -1
- package/dist/storage/upload.d.ts.map +1 -1
- package/dist/storage/upload.js +6 -2
- package/dist/storage/upload.js.map +1 -1
- package/dist/storage/url.d.ts +18 -0
- package/dist/storage/url.d.ts.map +1 -0
- package/dist/storage/url.js +84 -0
- package/dist/storage/url.js.map +1 -0
- package/package.json +17 -1
- package/src/ai/activity.ts +43 -0
- package/src/ai/broker/broker.ts +59 -6
- package/src/ai/broker/gemini-engine.ts +16 -0
- package/src/ai/broker/index.ts +1 -1
- package/src/ai/broker/openai-engine.ts +6 -3
- package/src/ai/broker/scripted-engine.ts +16 -5
- package/src/ai/broker/types.ts +6 -2
- package/src/ai/events.ts +29 -0
- package/src/ai/generation-enums.ts +48 -0
- package/src/ai/index.ts +9 -0
- package/src/ai/instances.ts +22 -2
- package/src/ai/internal.ts +5 -0
- package/src/ai/sandbox-plane.ts +23 -8
- package/src/ai/scripting.ts +42 -7
- package/src/app/internal.ts +1 -0
- package/src/auth/email-link.ts +32 -21
- package/src/auth/events.ts +29 -0
- package/src/auth/factor-id.ts +7 -0
- package/src/auth/index.ts +2 -0
- package/src/auth/instances.ts +13 -1
- package/src/auth/internal.ts +24 -0
- package/src/auth/modular.ts +27 -0
- package/src/auth/reauth.ts +3 -2
- package/src/auth/sandbox/default-avatar.ts +177 -0
- package/src/auth/sandbox/driver.ts +54 -0
- package/src/auth/sandbox/project-store.ts +0 -2
- package/src/auth/sandbox-backend-types.ts +31 -20
- package/src/auth/sandbox-backend.ts +400 -94
- package/src/auth/seed-user.ts +38 -0
- package/src/auth/tokens.ts +21 -18
- package/src/auth/types.ts +13 -1
- package/src/database/activity-coverage.ts +10 -0
- package/src/database/connection-lifecycle.ts +53 -24
- package/src/database/events.ts +20 -0
- package/src/database/instances.ts +52 -21
- package/src/database/internal/query-projection.ts +333 -0
- package/src/database/internal.ts +2 -0
- package/src/database/listeners.ts +162 -44
- package/src/database/operations.ts +73 -50
- package/src/database/replay.ts +6 -2
- package/src/database/routing.ts +4 -0
- package/src/database/sandbox/backend-for.ts +145 -25
- package/src/database/sandbox/backend-state.ts +15 -1
- package/src/database/sandbox/backend.ts +4 -2
- package/src/database/sandbox/child-listeners.ts +32 -13
- package/src/database/sandbox/listener-types.ts +5 -0
- package/src/database/sandbox/operation-events.ts +23 -9
- package/src/database/sandbox/persistence-state.ts +4 -11
- package/src/database/sandbox/priority-writes.ts +2 -2
- package/src/database/sandbox/query.ts +13 -268
- package/src/database/sandbox/rules-eval.ts +144 -10
- package/src/database/sandbox/transactions.ts +17 -39
- package/src/database/sandbox/value-listeners.ts +66 -23
- package/src/database/sandbox/write-plane.ts +29 -22
- package/src/database/sdk-activity.ts +26 -0
- package/src/database/transactions.ts +15 -11
- package/src/database/types.ts +12 -1
- package/src/deferred/entry.ts +16 -10
- package/src/firestore/activity-coverage.ts +8 -0
- package/src/firestore/aggregates.ts +17 -9
- package/src/firestore/bytes.ts +56 -0
- package/src/firestore/converter-method.ts +49 -0
- package/src/firestore/errors.ts +8 -0
- package/src/firestore/field-values.ts +3 -158
- package/src/firestore/geo-point.ts +56 -0
- package/src/firestore/index.ts +1 -1
- package/src/firestore/instances.ts +23 -2
- package/src/firestore/internal/document-data.ts +9 -0
- package/src/firestore/internal/index.ts +7 -0
- package/src/firestore/internal/value-codec.ts +150 -83
- package/src/firestore/internal/value-depth.ts +19 -0
- package/src/firestore/listeners.ts +60 -18
- package/src/firestore/persistence.ts +14 -9
- package/src/firestore/plain-object.ts +7 -0
- package/src/firestore/query-constraints.ts +4 -8
- package/src/firestore/reads.ts +81 -48
- package/src/firestore/refs.ts +56 -41
- package/src/firestore/sandbox/activity-query-display.ts +138 -0
- package/src/firestore/sandbox/admin-compat/batch.ts +26 -19
- package/src/firestore/sandbox/admin-compat/query-comparison.ts +9 -8
- package/src/firestore/sandbox/admin-compat/query.ts +46 -12
- package/src/firestore/sandbox/admin-compat/read-translation.ts +18 -6
- package/src/firestore/sandbox/admin-compat/transaction.ts +14 -4
- package/src/firestore/sandbox/admin-compat/types.ts +6 -88
- package/src/firestore/sandbox/atomic-state.ts +112 -0
- package/src/firestore/sandbox/atomic-write-pipeline.ts +129 -77
- package/src/firestore/sandbox/batch-write-executor.ts +51 -29
- package/src/firestore/sandbox/converters/user-timestamp.ts +19 -42
- package/src/firestore/sandbox/document-copy.ts +27 -0
- package/src/firestore/sandbox/document-store.ts +108 -0
- package/src/firestore/sandbox/errors.ts +5 -1
- package/src/firestore/sandbox/event-log.ts +72 -7
- package/src/firestore/sandbox/field-merge.ts +10 -19
- package/src/firestore/sandbox/history-controls.ts +1 -1
- package/src/firestore/sandbox/list-query-proof.ts +43 -72
- package/src/firestore/sandbox/listener-dispatch.ts +59 -4
- package/src/firestore/sandbox/local-environment.ts +35 -7
- package/src/firestore/sandbox/local-state.ts +72 -232
- package/src/firestore/sandbox/query-execution.ts +56 -34
- package/src/firestore/sandbox/query-operand-equality.ts +57 -14
- package/src/firestore/sandbox/query-operators.ts +20 -0
- package/src/firestore/sandbox/query-value-registry.ts +3 -2
- package/src/firestore/sandbox/request-events.ts +5 -0
- package/src/firestore/sandbox/rules-evidence.ts +94 -0
- package/src/firestore/sandbox/rules-list-authorizer.ts +62 -107
- package/src/firestore/sandbox/rules-operation-reader.ts +11 -4
- package/src/firestore/sandbox/rules-read-engine.ts +19 -8
- package/src/firestore/sandbox/rules-state.ts +21 -0
- package/src/firestore/sandbox/snapshot-listeners.ts +12 -1
- package/src/firestore/sandbox/transaction-merge.ts +33 -20
- package/src/firestore/sandbox/transaction-types.ts +11 -21
- package/src/firestore/sandbox/transaction-write-executor.ts +103 -69
- package/src/firestore/sandbox/transaction.ts +24 -7
- package/src/firestore/sandbox/value-resolver.ts +2 -13
- package/src/firestore/sandbox/write-engine.ts +13 -5
- package/src/firestore/sandbox/write-runtime.ts +68 -40
- package/src/firestore/sandbox/writes.ts +3 -1
- package/src/firestore/sdk-activity.ts +31 -0
- package/src/firestore/snapshots.ts +84 -18
- package/src/firestore/state.ts +34 -14
- package/src/firestore/timestamp.ts +86 -0
- package/src/firestore/tools.ts +3 -3
- package/src/firestore/transactions.ts +88 -8
- package/src/firestore/types.ts +26 -5
- package/src/firestore/vector-value.ts +54 -0
- package/src/firestore/writes.ts +53 -43
- package/src/functions/events.ts +27 -0
- package/src/messaging/broker/broker.test.ts +114 -0
- package/src/messaging/broker/broker.ts +152 -65
- package/src/messaging/broker/delivery-history.ts +49 -0
- package/src/messaging/broker/index.ts +11 -0
- package/src/messaging/broker/persistence.ts +54 -0
- package/src/messaging/broker/types.ts +50 -0
- package/src/messaging/events.ts +29 -0
- package/src/rules/api/case-types.ts +7 -0
- package/src/rules/api/rtdb.ts +15 -7
- package/src/rules/grammar/parse-error-wording.ts +98 -0
- package/src/rules/indexes/query-analysis.ts +136 -0
- package/src/rules/indexes/service-query.ts +69 -0
- package/src/rules/internal/index.ts +16 -0
- package/src/rules/modules/rules-capabilities.generated.ts +1 -1
- package/src/rules/rtdb/constraints/atoms.spec.ts +7 -7
- package/src/rules/rtdb/constraints/atoms.ts +7 -7
- package/src/rules/rtdb/constraints/data.ts +4 -4
- package/src/rules/rtdb/constraints/document.ts +4 -2
- package/src/rules/rtdb/constraints/game.spec.ts +4 -4
- package/src/rules/rtdb/constraints/policies.spec.ts +5 -5
- package/src/rules/rtdb/constraints/policies.ts +4 -4
- package/src/rules/rtdb/constraints/schema.ts +3 -3
- package/src/rules/rtdb/grammar/RtdbExpr.ohm +1 -3
- package/src/rules/rtdb/grammar/RtdbExpr.ohm.generated.ts +1 -3
- package/src/rules/rtdb/grammar/linter.ts +34 -30
- package/src/rules/rtdb/grammar/simulator.ts +112 -74
- package/src/rules/rtdb/grammar/validator.ts +30 -26
- package/src/rules/rtdb/simulation/handler.ts +139 -36
- package/src/rules/rtdb/simulation/spec.ts +24 -1
- package/src/rules/simulator/evaluator.ts +34 -41
- package/src/rules/simulator/handler.ts +12 -3
- package/src/rules/simulator/mapdiff.ts +7 -5
- package/src/rules/simulator/query-proof-residual.ts +209 -0
- package/src/rules/simulator/query-proof.ts +53 -27
- package/src/rules/simulator/request-path.ts +39 -0
- package/src/rules/simulator/trace-recorder.ts +3 -0
- package/src/rules/simulator/wrappers/timestamp.ts +8 -1
- package/src/rules/simulator-tools-impl.ts +6 -3
- package/src/rules/stdlib-tools.ts +4 -4
- package/src/sandbox/active-listeners.ts +245 -0
- package/src/sandbox/admin-firestore/error-translation.ts +16 -2
- package/src/sandbox/admin-firestore/listeners.ts +26 -1
- package/src/sandbox/admin-firestore/remote/listeners.ts +50 -32
- package/src/sandbox/admin-firestore/remote/value-codec.ts +7 -14
- package/src/sandbox/admin-firestore/remote/wire-types.ts +3 -0
- package/src/sandbox/attribution/attribution-mode.ts +74 -0
- package/src/sandbox/attribution/effect-regions.ts +130 -0
- package/src/sandbox/attribution/element-selector.ts +118 -0
- package/src/sandbox/attribution/listener-owners.ts +277 -0
- package/src/sandbox/branches/engine.ts +362 -0
- package/src/sandbox/branches/index.ts +12 -448
- package/src/sandbox/branches/promotion.ts +207 -0
- package/src/sandbox/branches/state-diff.ts +333 -0
- package/src/sandbox/branches/store.ts +317 -0
- package/src/sandbox/checkpoints/capture.ts +77 -0
- package/src/sandbox/checkpoints/directory-backend.ts +110 -0
- package/src/sandbox/checkpoints/index.ts +32 -0
- package/src/sandbox/checkpoints/record-backend.ts +109 -0
- package/src/sandbox/checkpoints/saved-states.ts +72 -0
- package/src/sandbox/checkpoints/types.ts +115 -0
- package/src/sandbox/checkpoints/validation.ts +102 -0
- package/src/sandbox/clock.ts +205 -0
- package/src/sandbox/full-state.ts +403 -0
- package/src/sandbox/index.ts +53 -10
- package/src/sandbox/internal/ai-evidence.ts +38 -0
- package/src/sandbox/internal/event-history.ts +193 -0
- package/src/sandbox/internal/history-integrity.ts +12 -0
- package/src/sandbox/internal/history-retention.ts +16 -0
- package/src/sandbox/internal/index.ts +65 -0
- package/src/sandbox/internal/observation-history.ts +5 -0
- package/src/sandbox/internal/observation-payload.ts +18 -0
- package/src/sandbox/internal/provenance.ts +5 -0
- package/src/sandbox/internal/root.ts +3 -2
- package/src/sandbox/internal/rules-evidence-retention.ts +28 -0
- package/src/sandbox/internal/sandbox-impl.ts +91 -45
- package/src/sandbox/internal/sdk-activity.ts +291 -0
- package/src/sandbox/internal/sdk-coverage.ts +28 -0
- package/src/sandbox/internal/sdk-observation.ts +62 -0
- package/src/sandbox/internal/sdk-rates.ts +240 -0
- package/src/sandbox/internal/sdk-write-activity.ts +14 -0
- package/src/sandbox/internal/state-schemas.ts +47 -0
- package/src/sandbox/internal/state-values.ts +20 -0
- package/src/sandbox/internal/storage-activity.ts +43 -0
- package/src/sandbox/internal/usage-evidence.ts +77 -0
- package/src/sandbox/operation-record.ts +107 -4
- package/src/sandbox/persistence/changed-buckets.ts +61 -0
- package/src/sandbox/persistence/chunk-format.ts +39 -27
- package/src/sandbox/persistence/controller.ts +85 -33
- package/src/sandbox/persistence/import-bundle.ts +64 -0
- package/src/sandbox/persistence/serialize.ts +16 -10
- package/src/sandbox/persistence/types.ts +4 -0
- package/src/sandbox/persistence/validate-services.ts +70 -0
- package/src/sandbox/remote.ts +7 -0
- package/src/sandbox/replay/index.ts +15 -8
- package/src/sandbox/types/errors.ts +3 -1
- package/src/sandbox/types/events.ts +118 -75
- package/src/sandbox/types/index.ts +12 -0
- package/src/sandbox/types/operation.ts +14 -4
- package/src/sandbox/types/persistence.ts +2 -2
- package/src/sandbox/types/query-proof.ts +26 -0
- package/src/sandbox/types/request-observation.ts +25 -0
- package/src/sandbox/types/rules-evidence.ts +37 -0
- package/src/sandbox/types/service-event-record.ts +34 -0
- package/src/sandbox/types/service-event-records.ts +42 -0
- package/src/sandbox/types/service-mutation-event.ts +93 -0
- package/src/storage/activity-coverage.ts +8 -0
- package/src/storage/base64.ts +35 -0
- package/src/storage/download.ts +19 -6
- package/src/storage/enforce.ts +26 -4
- package/src/storage/errors.ts +29 -14
- package/src/storage/events.ts +21 -0
- package/src/storage/index.ts +7 -7
- package/src/storage/internal.ts +21 -0
- package/src/storage/metadata.ts +68 -19
- package/src/storage/observed.ts +16 -0
- package/src/storage/persistence.ts +574 -66
- package/src/storage/reference.ts +6 -3
- package/src/storage/remote-bytes.ts +122 -0
- package/src/storage/resumable.ts +16 -3
- package/src/storage/rules-resolution.ts +43 -1
- package/src/storage/sandbox/persistence-state.ts +71 -0
- package/src/storage/sandbox/rules-bindings.ts +69 -0
- package/src/storage/sandbox/rules-collection-methods.ts +161 -0
- package/src/storage/sandbox/rules-evaluator.ts +65 -142
- package/src/storage/sandbox/rules-firestore-lookup.ts +112 -0
- package/src/storage/sandbox/rules-hashing-methods.ts +50 -0
- package/src/storage/sandbox/rules-method-calls.ts +67 -0
- package/src/storage/sandbox/rules-methods.ts +63 -404
- package/src/storage/sandbox/rules-operators.ts +93 -0
- package/src/storage/sandbox/rules-string-methods.ts +214 -0
- package/src/storage/sandbox/rules-time-methods.ts +98 -0
- package/src/storage/sandbox/rules-values.ts +20 -1
- package/src/storage/sandbox/rules.ts +27 -14
- package/src/storage/sandbox/running-service.ts +52 -0
- package/src/storage/service.ts +196 -85
- package/src/storage/string-format.ts +8 -0
- package/src/storage/upload.ts +8 -3
- package/src/storage/url.ts +106 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turning a DOM element into a string that names it again later.
|
|
3
|
+
*
|
|
4
|
+
* Two callers want slightly different things, so this file offers two
|
|
5
|
+
* entry points over one identity ladder:
|
|
6
|
+
*
|
|
7
|
+
* - {@link ownerSelectorFor} is for an element the caller handed to pyric as
|
|
8
|
+
* a listener's owner. The caller asked to be identified, so an element with
|
|
9
|
+
* no identity of its own is GIVEN one: a generated `data-pyric-owner`
|
|
10
|
+
* attribute that survives re-render and makes the selector stable.
|
|
11
|
+
* - {@link regionSelectorFor} is for an element pyric observed a callback
|
|
12
|
+
* mutating. Observation must not change the page, so an element with no
|
|
13
|
+
* identity of its own gets a structural path instead of a new attribute.
|
|
14
|
+
*
|
|
15
|
+
* Both prefer, in order: the element's `id`, then an existing
|
|
16
|
+
* `data-pyric-owner`, then their respective fallback.
|
|
17
|
+
*/
|
|
18
|
+
/** The attribute pyric reads, and mints, to name an owning element. */
|
|
19
|
+
export const OWNER_ATTRIBUTE = 'data-pyric-owner';
|
|
20
|
+
let mintedOwnerCount = 0;
|
|
21
|
+
/** `true` when `value` responds to the element methods this file calls. */
|
|
22
|
+
export function isSelectableElement(value) {
|
|
23
|
+
if (value === null || typeof value !== 'object')
|
|
24
|
+
return false;
|
|
25
|
+
const candidate = value;
|
|
26
|
+
if (typeof candidate.getAttribute !== 'function')
|
|
27
|
+
return false;
|
|
28
|
+
return typeof candidate.tagName === 'string';
|
|
29
|
+
}
|
|
30
|
+
/** The element's lower-case tag name, or `'element'` when it reports none. */
|
|
31
|
+
export function tagNameOf(element) {
|
|
32
|
+
const tag = element.tagName;
|
|
33
|
+
if (typeof tag !== 'string' || tag.length === 0)
|
|
34
|
+
return 'element';
|
|
35
|
+
return tag.toLowerCase();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A selector the element already earns on its own: its `id`, or a
|
|
39
|
+
* `data-pyric-owner` someone already set. `undefined` when it has neither.
|
|
40
|
+
*/
|
|
41
|
+
function existingIdentitySelector(element) {
|
|
42
|
+
const id = element.id;
|
|
43
|
+
if (typeof id === 'string' && id.length > 0)
|
|
44
|
+
return `#${id}`;
|
|
45
|
+
const owner = element.getAttribute(OWNER_ATTRIBUTE);
|
|
46
|
+
if (typeof owner === 'string' && owner.length > 0) {
|
|
47
|
+
return `[${OWNER_ATTRIBUTE}="${owner}"]`;
|
|
48
|
+
}
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
/** Position of `element` among its parent's children, 1-based. */
|
|
52
|
+
function childIndexOf(element) {
|
|
53
|
+
const parent = element.parentElement;
|
|
54
|
+
if (!parent)
|
|
55
|
+
return 1;
|
|
56
|
+
const siblings = parent.children;
|
|
57
|
+
if (!siblings)
|
|
58
|
+
return 1;
|
|
59
|
+
for (let index = 0; index < siblings.length; index += 1) {
|
|
60
|
+
if (siblings[index] === element)
|
|
61
|
+
return index + 1;
|
|
62
|
+
}
|
|
63
|
+
return 1;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* A structural path from the nearest identified ancestor down to `element`,
|
|
67
|
+
* such as `#board > div:nth-child(2) > li:nth-child(3)`. Walks at most eight
|
|
68
|
+
* levels so a deep tree produces a bounded string rather than the whole
|
|
69
|
+
* document path.
|
|
70
|
+
*/
|
|
71
|
+
function structuralPathFor(element) {
|
|
72
|
+
const steps = [];
|
|
73
|
+
let current = element;
|
|
74
|
+
let depth = 0;
|
|
75
|
+
while (current && depth < 8) {
|
|
76
|
+
const identity = existingIdentitySelector(current);
|
|
77
|
+
if (identity !== undefined) {
|
|
78
|
+
steps.unshift(identity);
|
|
79
|
+
return steps.join(' > ');
|
|
80
|
+
}
|
|
81
|
+
steps.unshift(`${tagNameOf(current)}:nth-child(${childIndexOf(current)})`);
|
|
82
|
+
current = current.parentElement;
|
|
83
|
+
depth += 1;
|
|
84
|
+
}
|
|
85
|
+
return steps.join(' > ');
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Name an element the caller nominated as a listener's owner, minting a
|
|
89
|
+
* `data-pyric-owner` attribute when it has no identity of its own.
|
|
90
|
+
*/
|
|
91
|
+
export function ownerSelectorFor(element) {
|
|
92
|
+
const existing = existingIdentitySelector(element);
|
|
93
|
+
if (existing !== undefined)
|
|
94
|
+
return existing;
|
|
95
|
+
mintedOwnerCount += 1;
|
|
96
|
+
const minted = `${tagNameOf(element)}-${mintedOwnerCount.toString(36)}`;
|
|
97
|
+
element.setAttribute(OWNER_ATTRIBUTE, minted);
|
|
98
|
+
return `[${OWNER_ATTRIBUTE}="${minted}"]`;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Name an element a callback mutated, without writing to the document.
|
|
102
|
+
*/
|
|
103
|
+
export function regionSelectorFor(element) {
|
|
104
|
+
const existing = existingIdentitySelector(element);
|
|
105
|
+
if (existing !== undefined)
|
|
106
|
+
return existing;
|
|
107
|
+
return structuralPathFor(element);
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=element-selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-selector.js","sourceRoot":"","sources":["../../../src/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AAO,CAAC,CAAC;IACnD,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC;IAC5C,gBAAgB,IAAI,CAAC,CAAC;IACtB,MAAM,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;IACxE,OAAO,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAC9C,OAAO,IAAI,eAAe,KAAK,MAAM,IAAI,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAA0B;IAC1D,MAAM,QAAQ,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;IACnD,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC;IAC5C,OAAO,iBAAiB,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deriving a listener's owners at the moment it attaches.
|
|
3
|
+
*
|
|
4
|
+
* Two owners can be known at attach time and no later:
|
|
5
|
+
*
|
|
6
|
+
* - the creation `frame`, read from a stack captured on the attaching call
|
|
7
|
+
* stack. Once the listener is registered the caller's stack is gone, so
|
|
8
|
+
* this has to happen here, and it costs exactly one `Error` construction
|
|
9
|
+
* per attach, never one per delivery.
|
|
10
|
+
* - the caller's `tag`, taken from the `owner` listen option. That option is
|
|
11
|
+
* pyric's own extension to `SnapshotListenOptions` and `ListenOptions`; the
|
|
12
|
+
* Firebase SDKs have no such field and ignore it.
|
|
13
|
+
*
|
|
14
|
+
* The third owner kind, `regions`, is a property of a delivery rather than of
|
|
15
|
+
* an attach, and lives in `effect-regions.ts`.
|
|
16
|
+
*/
|
|
17
|
+
import type { ListenerOwner } from '../types/events.js';
|
|
18
|
+
import { type SelectableElement } from './element-selector.js';
|
|
19
|
+
/**
|
|
20
|
+
* The input form of a `component` owner, as a framework binding builds it.
|
|
21
|
+
*
|
|
22
|
+
* It differs from the recorded {@link ListenerOwner} `component` form in one
|
|
23
|
+
* field: `element` is the live DOM element, not a selector for it. The
|
|
24
|
+
* binding hands the element over and this module derives the selector,
|
|
25
|
+
* exactly as it does for an element hint, so that the selector rules live in
|
|
26
|
+
* one place and the binding never has to import pyric at runtime. Owners are
|
|
27
|
+
* serialized into events, so the element itself is never kept on the
|
|
28
|
+
* recorded owner.
|
|
29
|
+
*/
|
|
30
|
+
export interface ComponentOwnerInput {
|
|
31
|
+
kind: 'component';
|
|
32
|
+
/** The component function's name, read from the render-phase stack. */
|
|
33
|
+
name: string;
|
|
34
|
+
/** The chain of enclosing component frames, outermost first. */
|
|
35
|
+
path?: string[];
|
|
36
|
+
/** The component's root element, when the binding's ref was attached. */
|
|
37
|
+
element?: SelectableElement;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* What a caller may pass as a listener's `owner`: a name, the DOM element the
|
|
41
|
+
* listener feeds, a fully-built {@link ListenerOwner} record, or a
|
|
42
|
+
* {@link ComponentOwnerInput}. The last two forms are for a framework binding
|
|
43
|
+
* (`@pyric/ui`'s `useListenerOwner`) that has already identified the owning
|
|
44
|
+
* component and wants it recorded as a `component` owner rather than wrapped
|
|
45
|
+
* in a `tag`.
|
|
46
|
+
*/
|
|
47
|
+
export type ListenerOwnerHint = string | SelectableElement | ListenerOwner | ComponentOwnerInput;
|
|
48
|
+
/**
|
|
49
|
+
* Parse one V8 stack line into a `frame` owner. Both formats the runtime
|
|
50
|
+
* emits are handled: `at fn (/path/file.ts:12:5)` and `at /path/file.ts:12:5`.
|
|
51
|
+
* Anything else (a header line, a `native` frame, a runtime with a different
|
|
52
|
+
* stack format) returns `undefined` and is skipped.
|
|
53
|
+
*/
|
|
54
|
+
export declare function parseStackFrame(line: string): ListenerOwner | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* The first frame outside pyric's own files, read from `stack`. Exported for
|
|
57
|
+
* the test, which supplies a synthetic stack rather than a real one.
|
|
58
|
+
*/
|
|
59
|
+
export declare function callerFrameFromStack(stack: string): ListenerOwner | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Capture the frame that created a listener. `undefined` when attribution is
|
|
62
|
+
* off, when the runtime produced no stack, or when every frame on it belongs
|
|
63
|
+
* to pyric.
|
|
64
|
+
*/
|
|
65
|
+
export declare function captureCreationFrame(): ListenerOwner | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Build the explicit owner from whatever the caller passed as `owner`. A
|
|
68
|
+
* string is the name of a `tag` owner verbatim; an element contributes its
|
|
69
|
+
* tag name plus a selector that finds it again; an owner record (a framework
|
|
70
|
+
* binding's `component` owner) is recorded as it stands, except that a live
|
|
71
|
+
* element on a `component` owner is reduced to a selector here. Unlike frame
|
|
72
|
+
* capture this is not gated on the attribution switch: the caller asked for
|
|
73
|
+
* it by name.
|
|
74
|
+
*/
|
|
75
|
+
export declare function tagOwnerFor(hint: ListenerOwnerHint | undefined): ListenerOwner | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* The internal listen option that carries owners a caller already recorded.
|
|
78
|
+
*
|
|
79
|
+
* It exists for one caller: a client that reaches the sandbox across a port
|
|
80
|
+
* rather than calling it in the same context. The served page runs the
|
|
81
|
+
* sandbox in a SharedWorker, so an attach inside the worker sees a
|
|
82
|
+
* worker-bundle frame, no `owner` hint, and no DOM. That client derives the
|
|
83
|
+
* owners on the page, where all three are real, and hands them over here.
|
|
84
|
+
*
|
|
85
|
+
* The option is reached through `pyric/sandbox/internal` and is not part of
|
|
86
|
+
* any mirrored Firebase surface. The public `owner` hint is unchanged: a
|
|
87
|
+
* caller still passes a name, an element, or a component record, and the
|
|
88
|
+
* sandbox still derives the owners itself when no `owners` arrive.
|
|
89
|
+
*/
|
|
90
|
+
export interface RecordedListenerOwners {
|
|
91
|
+
readonly owners?: readonly ListenerOwner[];
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Both attribution inputs a listen call can carry: the caller's `owner` hint
|
|
95
|
+
* and, for a caller on the other side of a port, the owners it already
|
|
96
|
+
* recorded. Backends that take attribution as one argument take this.
|
|
97
|
+
*/
|
|
98
|
+
export interface ListenerAttribution extends RecordedListenerOwners {
|
|
99
|
+
readonly owner?: ListenerOwnerHint;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Every owner known at attach time, in a stable order: frame first, then tag.
|
|
103
|
+
* Returns `undefined` rather than an empty array so an event with no
|
|
104
|
+
* attribution omits the field entirely.
|
|
105
|
+
*
|
|
106
|
+
* `recorded` owners replace both: the caller derived them where the calling
|
|
107
|
+
* frame and the DOM exist, so deriving them again here would only describe
|
|
108
|
+
* this context.
|
|
109
|
+
*/
|
|
110
|
+
export declare function listenerAttachOwners(hint?: ListenerOwnerHint, recorded?: readonly ListenerOwner[]): ListenerOwner[] | undefined;
|
|
111
|
+
//# sourceMappingURL=listener-owners.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listener-owners.d.ts","sourceRoot":"","sources":["../../../src/sandbox/attribution/listener-owners.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;;;;GAUG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,WAAW,CAAC;IAClB,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,yEAAyE;IACzE,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,iBAAiB,GACjB,aAAa,GACb,mBAAmB,CAAC;AA2FxB;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAuBvE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAS7E;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,aAAa,GAAG,SAAS,CAKhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAS1F;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;CAC5C;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAoB,SAAQ,sBAAsB;IACjE,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC;CACpC;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,CAAC,EAAE,iBAAiB,EACxB,QAAQ,CAAC,EAAE,SAAS,aAAa,EAAE,GAClC,aAAa,EAAE,GAAG,SAAS,CAS7B"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deriving a listener's owners at the moment it attaches.
|
|
3
|
+
*
|
|
4
|
+
* Two owners can be known at attach time and no later:
|
|
5
|
+
*
|
|
6
|
+
* - the creation `frame`, read from a stack captured on the attaching call
|
|
7
|
+
* stack. Once the listener is registered the caller's stack is gone, so
|
|
8
|
+
* this has to happen here, and it costs exactly one `Error` construction
|
|
9
|
+
* per attach, never one per delivery.
|
|
10
|
+
* - the caller's `tag`, taken from the `owner` listen option. That option is
|
|
11
|
+
* pyric's own extension to `SnapshotListenOptions` and `ListenOptions`; the
|
|
12
|
+
* Firebase SDKs have no such field and ignore it.
|
|
13
|
+
*
|
|
14
|
+
* The third owner kind, `regions`, is a property of a delivery rather than of
|
|
15
|
+
* an attach, and lives in `effect-regions.ts`.
|
|
16
|
+
*/
|
|
17
|
+
import { listenerAttributionEnabled } from './attribution-mode.js';
|
|
18
|
+
import { isSelectableElement, ownerSelectorFor, tagNameOf, } from './element-selector.js';
|
|
19
|
+
/** `true` when `value` is already an owner record rather than a name or an
|
|
20
|
+
* element to derive one from. */
|
|
21
|
+
function isOwnerRecord(value) {
|
|
22
|
+
if (value === null || typeof value !== 'object')
|
|
23
|
+
return false;
|
|
24
|
+
return 'kind' in value && typeof value.kind === 'string';
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Turn an owner record into its recorded form. A `component` owner carrying a
|
|
28
|
+
* live element has that element replaced by a selector; a `component` owner
|
|
29
|
+
* whose `element` is not a selectable element drops the field. Every other
|
|
30
|
+
* owner kind is already in recorded form and passes through unchanged.
|
|
31
|
+
*/
|
|
32
|
+
function recordedOwner(value) {
|
|
33
|
+
if (value.kind !== 'component')
|
|
34
|
+
return value;
|
|
35
|
+
const owner = {
|
|
36
|
+
kind: 'component',
|
|
37
|
+
name: value.name,
|
|
38
|
+
};
|
|
39
|
+
if (value.path !== undefined && value.path.length > 0)
|
|
40
|
+
owner.path = value.path;
|
|
41
|
+
const element = value.element;
|
|
42
|
+
if (typeof element === 'string') {
|
|
43
|
+
owner.element = element;
|
|
44
|
+
}
|
|
45
|
+
else if (element !== undefined && isSelectableElement(element)) {
|
|
46
|
+
owner.element = ownerSelectorFor(element);
|
|
47
|
+
owner.tag = tagNameOf(element);
|
|
48
|
+
}
|
|
49
|
+
return owner;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Pyric's own root directory, derived from this module's own location.
|
|
53
|
+
*
|
|
54
|
+
* A frame is "pyric's own" when its path starts here. Deriving the root from
|
|
55
|
+
* `import.meta.url` rather than hardcoding `packages/pyric` makes the test
|
|
56
|
+
* work for both trees the mirror ships from: under source this resolves to
|
|
57
|
+
* `.../packages/pyric/src`, and under a build to `.../pyric/dist`. Either way
|
|
58
|
+
* it is the directory that contains every pyric file that could appear on the
|
|
59
|
+
* stack between the caller and the attach.
|
|
60
|
+
*/
|
|
61
|
+
const PYRIC_ROOT = pyricRoot();
|
|
62
|
+
function pyricRoot() {
|
|
63
|
+
// This file sits at `<root>/sandbox/attribution/listener-owners.{ts,js}`,
|
|
64
|
+
// so the root is three path segments up. A bundler that inlines this module
|
|
65
|
+
// into one artifact leaves `import.meta.url` undefined; there is then no
|
|
66
|
+
// pyric directory to recognize, and frame filtering falls back to the
|
|
67
|
+
// `node_modules` test alone.
|
|
68
|
+
const here = importMetaUrl();
|
|
69
|
+
if (here === undefined)
|
|
70
|
+
return '';
|
|
71
|
+
const withoutFile = here.slice(0, here.lastIndexOf('/'));
|
|
72
|
+
const withoutAttribution = withoutFile.slice(0, withoutFile.lastIndexOf('/'));
|
|
73
|
+
const withoutSandbox = withoutAttribution.slice(0, withoutAttribution.lastIndexOf('/'));
|
|
74
|
+
return stripFileScheme(withoutSandbox);
|
|
75
|
+
}
|
|
76
|
+
/** This module's own URL, or `undefined` inside a bundle that erased it. */
|
|
77
|
+
function importMetaUrl() {
|
|
78
|
+
try {
|
|
79
|
+
const url = import.meta.url;
|
|
80
|
+
if (typeof url !== 'string')
|
|
81
|
+
return undefined;
|
|
82
|
+
return url;
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function stripFileScheme(url) {
|
|
89
|
+
if (url.startsWith('file://'))
|
|
90
|
+
return url.slice('file://'.length);
|
|
91
|
+
return url;
|
|
92
|
+
}
|
|
93
|
+
/** A frame inside pyric itself, or inside an installed dependency. */
|
|
94
|
+
function isInternalFrame(file) {
|
|
95
|
+
if (file.includes('/node_modules/'))
|
|
96
|
+
return true;
|
|
97
|
+
if (PYRIC_ROOT.length > 0 && file.startsWith(`${PYRIC_ROOT}/`))
|
|
98
|
+
return true;
|
|
99
|
+
// Source and built SDK copies share the page journal. Its registration frame
|
|
100
|
+
// can therefore come from the sibling tree during workspace development.
|
|
101
|
+
const sibling = PYRIC_ROOT.endsWith('/src') ? `${PYRIC_ROOT.slice(0, -4)}/dist`
|
|
102
|
+
: PYRIC_ROOT.endsWith('/dist') ? `${PYRIC_ROOT.slice(0, -5)}/src` : '';
|
|
103
|
+
if (sibling && file.startsWith(`${sibling}/`))
|
|
104
|
+
return true;
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
const FRAME_WITH_FUNCTION = /^\s*at\s+(.+?)\s+\((.+):(\d+):(\d+)\)\s*$/;
|
|
108
|
+
const FRAME_WITHOUT_FUNCTION = /^\s*at\s+(.+):(\d+):(\d+)\s*$/;
|
|
109
|
+
/**
|
|
110
|
+
* Parse one V8 stack line into a `frame` owner. Both formats the runtime
|
|
111
|
+
* emits are handled: `at fn (/path/file.ts:12:5)` and `at /path/file.ts:12:5`.
|
|
112
|
+
* Anything else (a header line, a `native` frame, a runtime with a different
|
|
113
|
+
* stack format) returns `undefined` and is skipped.
|
|
114
|
+
*/
|
|
115
|
+
export function parseStackFrame(line) {
|
|
116
|
+
const named = FRAME_WITH_FUNCTION.exec(line);
|
|
117
|
+
if (named) {
|
|
118
|
+
const owner = {
|
|
119
|
+
kind: 'frame',
|
|
120
|
+
file: stripFileScheme(named[2]),
|
|
121
|
+
line: Number(named[3]),
|
|
122
|
+
column: Number(named[4]),
|
|
123
|
+
function: named[1],
|
|
124
|
+
};
|
|
125
|
+
return owner;
|
|
126
|
+
}
|
|
127
|
+
const bare = FRAME_WITHOUT_FUNCTION.exec(line);
|
|
128
|
+
if (bare) {
|
|
129
|
+
const owner = {
|
|
130
|
+
kind: 'frame',
|
|
131
|
+
file: stripFileScheme(bare[1]),
|
|
132
|
+
line: Number(bare[2]),
|
|
133
|
+
column: Number(bare[3]),
|
|
134
|
+
};
|
|
135
|
+
return owner;
|
|
136
|
+
}
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* The first frame outside pyric's own files, read from `stack`. Exported for
|
|
141
|
+
* the test, which supplies a synthetic stack rather than a real one.
|
|
142
|
+
*/
|
|
143
|
+
export function callerFrameFromStack(stack) {
|
|
144
|
+
for (const line of stack.split('\n')) {
|
|
145
|
+
const frame = parseStackFrame(line);
|
|
146
|
+
if (frame === undefined)
|
|
147
|
+
continue;
|
|
148
|
+
if (frame.kind !== 'frame')
|
|
149
|
+
continue;
|
|
150
|
+
if (isInternalFrame(frame.file))
|
|
151
|
+
continue;
|
|
152
|
+
return frame;
|
|
153
|
+
}
|
|
154
|
+
return undefined;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Capture the frame that created a listener. `undefined` when attribution is
|
|
158
|
+
* off, when the runtime produced no stack, or when every frame on it belongs
|
|
159
|
+
* to pyric.
|
|
160
|
+
*/
|
|
161
|
+
export function captureCreationFrame() {
|
|
162
|
+
if (!listenerAttributionEnabled())
|
|
163
|
+
return undefined;
|
|
164
|
+
const stack = new Error().stack;
|
|
165
|
+
if (typeof stack !== 'string')
|
|
166
|
+
return undefined;
|
|
167
|
+
return callerFrameFromStack(stack);
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Build the explicit owner from whatever the caller passed as `owner`. A
|
|
171
|
+
* string is the name of a `tag` owner verbatim; an element contributes its
|
|
172
|
+
* tag name plus a selector that finds it again; an owner record (a framework
|
|
173
|
+
* binding's `component` owner) is recorded as it stands, except that a live
|
|
174
|
+
* element on a `component` owner is reduced to a selector here. Unlike frame
|
|
175
|
+
* capture this is not gated on the attribution switch: the caller asked for
|
|
176
|
+
* it by name.
|
|
177
|
+
*/
|
|
178
|
+
export function tagOwnerFor(hint) {
|
|
179
|
+
if (hint === undefined)
|
|
180
|
+
return undefined;
|
|
181
|
+
if (typeof hint === 'string') {
|
|
182
|
+
if (hint.length === 0)
|
|
183
|
+
return undefined;
|
|
184
|
+
return { kind: 'tag', name: hint };
|
|
185
|
+
}
|
|
186
|
+
if (isOwnerRecord(hint))
|
|
187
|
+
return recordedOwner(hint);
|
|
188
|
+
if (!isSelectableElement(hint))
|
|
189
|
+
return undefined;
|
|
190
|
+
return { kind: 'tag', name: tagNameOf(hint), element: ownerSelectorFor(hint) };
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Every owner known at attach time, in a stable order: frame first, then tag.
|
|
194
|
+
* Returns `undefined` rather than an empty array so an event with no
|
|
195
|
+
* attribution omits the field entirely.
|
|
196
|
+
*
|
|
197
|
+
* `recorded` owners replace both: the caller derived them where the calling
|
|
198
|
+
* frame and the DOM exist, so deriving them again here would only describe
|
|
199
|
+
* this context.
|
|
200
|
+
*/
|
|
201
|
+
export function listenerAttachOwners(hint, recorded) {
|
|
202
|
+
if (recorded !== undefined && recorded.length > 0)
|
|
203
|
+
return [...recorded];
|
|
204
|
+
const owners = [];
|
|
205
|
+
const frame = captureCreationFrame();
|
|
206
|
+
if (frame !== undefined)
|
|
207
|
+
owners.push(frame);
|
|
208
|
+
const tag = tagOwnerFor(hint);
|
|
209
|
+
if (tag !== undefined)
|
|
210
|
+
owners.push(tag);
|
|
211
|
+
if (owners.length === 0)
|
|
212
|
+
return undefined;
|
|
213
|
+
return owners;
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=listener-owners.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listener-owners.js","sourceRoot":"","sources":["../../../src/sandbox/attribution/listener-owners.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,SAAS,GAEV,MAAM,uBAAuB,CAAC;AAqC/B;kCACkC;AAClC,SAAS,aAAa,CACpB,KAAwB;IAExB,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC9D,OAAO,MAAM,IAAI,KAAK,IAAI,OAAQ,KAA2B,CAAC,IAAI,KAAK,QAAQ,CAAC;AAClF,CAAC;AAED;;;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CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC;IACxE,MAAM,MAAM,GAAoB,EAAE,CAAC;IACnC,MAAM,KAAK,GAAG,oBAAoB,EAAE,CAAC;IACrC,IAAI,KAAK,KAAK,SAAS;QAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,GAAG,KAAK,SAAS;QAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC1C,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Branches: fork, apply, diff, promote, discard.
|
|
3
|
+
*
|
|
4
|
+
* A branch is an isolated sandbox seeded from a {@link FullSandboxState}, plus
|
|
5
|
+
* the events applied to it since the fork. The mental model:
|
|
6
|
+
*
|
|
7
|
+
* const branch = await fork(await captureFullState(live), candidateRules);
|
|
8
|
+
* apply(branch, agentPlanEvents);
|
|
9
|
+
* const changes = await diff(branch, live);
|
|
10
|
+
* await promote(branch, live);
|
|
11
|
+
* // ...or...
|
|
12
|
+
* discard(branch);
|
|
13
|
+
*
|
|
14
|
+
* What a branch carries. Everything the sandbox holds: Firestore documents,
|
|
15
|
+
* the Realtime Database tree, Storage objects with their bytes and metadata,
|
|
16
|
+
* auth accounts, and the three rule sources. A branch that silently held only
|
|
17
|
+
* Firestore would report a clean diff over state it never looked at, so the
|
|
18
|
+
* fork seeds from a full state and the promotion lands one.
|
|
19
|
+
*
|
|
20
|
+
* Why these are asynchronous. Storage objects live behind an asynchronous
|
|
21
|
+
* backend, so any operation that reads or writes the whole sandbox is
|
|
22
|
+
* asynchronous too. `apply` and `discard` touch neither, so they stay
|
|
23
|
+
* synchronous.
|
|
24
|
+
*
|
|
25
|
+
* Diff honesty. Every difference is a `real-divergence`. A branch carries no
|
|
26
|
+
* captured write metadata that could license sentinel or auto-id drift, so
|
|
27
|
+
* that is the correct classification for state against state. Each record also
|
|
28
|
+
* names its service and the path or uid it concerns.
|
|
29
|
+
*
|
|
30
|
+
* Promotion honesty. A promotion writes the delta between the state the branch
|
|
31
|
+
* forked from and the state it holds now, so state on the target that the
|
|
32
|
+
* branch never touched survives. It is atomic from the caller's point of view:
|
|
33
|
+
* the target's full state is captured first, and any throw restores that
|
|
34
|
+
* capture, rethrows the original error, and leaves the branch undiscarded.
|
|
35
|
+
*/
|
|
36
|
+
import { type DatabaseRuleset, type FullSandboxState } from '../full-state.js';
|
|
37
|
+
import type { SandboxEvent } from '../types/events.js';
|
|
38
|
+
import type { LocalSandbox } from '../types/service.js';
|
|
39
|
+
import { type BranchDivergence } from './state-diff.js';
|
|
40
|
+
/**
|
|
41
|
+
* Rule sources a fork installs on the branch in place of the ones the state
|
|
42
|
+
* carries. Each is independent: naming one replaces that service's rules and
|
|
43
|
+
* leaves the other two as the forked state had them.
|
|
44
|
+
*/
|
|
45
|
+
export interface BranchCandidateRules {
|
|
46
|
+
/** Firestore Security Rules source to run the branch under. */
|
|
47
|
+
firestore?: string;
|
|
48
|
+
/** Realtime Database ruleset to run the branch under. */
|
|
49
|
+
database?: DatabaseRuleset;
|
|
50
|
+
/** Storage Security Rules source to run the branch under. */
|
|
51
|
+
storage?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* An isolated experiment seeded from a {@link FullSandboxState}.
|
|
55
|
+
*
|
|
56
|
+
* A branch owns its own {@link LocalSandbox}, fully isolated from the source:
|
|
57
|
+
* separate environment, separate event history, separate service backends.
|
|
58
|
+
*/
|
|
59
|
+
export interface Branch {
|
|
60
|
+
/** The branch's own sandbox. Read it directly, or through `captureFullState`. */
|
|
61
|
+
readonly sandbox: LocalSandbox;
|
|
62
|
+
/** The candidate rules the fork installed, so a store can rebuild the branch. */
|
|
63
|
+
readonly candidateRules: BranchCandidateRules;
|
|
64
|
+
/** The full state this branch was forked from. The baseline a promotion is a delta against. */
|
|
65
|
+
readonly base: FullSandboxState;
|
|
66
|
+
/** Events applied since the fork, in order. */
|
|
67
|
+
readonly events: SandboxEvent[];
|
|
68
|
+
/** Set by {@link discard} and by a completed {@link promote}. */
|
|
69
|
+
discarded: boolean;
|
|
70
|
+
}
|
|
71
|
+
/** What a branch can be compared against: a live sandbox, or a captured state. */
|
|
72
|
+
export type DiffTarget = LocalSandbox | FullSandboxState;
|
|
73
|
+
/**
|
|
74
|
+
* Fork a new branch from a captured full state.
|
|
75
|
+
*
|
|
76
|
+
* The branch's sandbox reads identically to the state it was forked from in
|
|
77
|
+
* every service, and writes on it never reach the source.
|
|
78
|
+
*
|
|
79
|
+
* @param base The baseline, typically `await captureFullState(live)`.
|
|
80
|
+
* @param candidate Rule sources to run the branch under in place of the
|
|
81
|
+
* baseline's. A string is read as a Realtime Database ruleset
|
|
82
|
+
* when it parses as JSON with a `rules` key, and as Firestore
|
|
83
|
+
* rules otherwise. An object names each service explicitly.
|
|
84
|
+
*/
|
|
85
|
+
export declare function fork(base: FullSandboxState, candidate?: string | BranchCandidateRules): Promise<Branch>;
|
|
86
|
+
/**
|
|
87
|
+
* Apply a stream of events to a branch by re-issuing their writes against the
|
|
88
|
+
* branch's current state.
|
|
89
|
+
*
|
|
90
|
+
* This is the per-write re-issue logic `replay()` runs (filter to writes,
|
|
91
|
+
* honour `autoId` and the pinned `requestTime`, prefer the pre-resolution
|
|
92
|
+
* `request.resourceData` so sentinels re-resolve), applied incrementally on
|
|
93
|
+
* the branch's existing environment rather than on a fresh empty sandbox. The
|
|
94
|
+
* applied events are folded into `branch.events` so a store can rebuild the
|
|
95
|
+
* branch from its base and its log.
|
|
96
|
+
*
|
|
97
|
+
* @returns the same branch, mutated in place, for chaining.
|
|
98
|
+
*/
|
|
99
|
+
export declare function apply(branch: Branch, events: readonly SandboxEvent[]): Branch;
|
|
100
|
+
/**
|
|
101
|
+
* Every difference between a branch's current state and a reference, across
|
|
102
|
+
* every service. Each record names its service and the path or uid it
|
|
103
|
+
* concerns, with the reference's value as `before` and the branch's as
|
|
104
|
+
* `after`.
|
|
105
|
+
*
|
|
106
|
+
* @param branch The experiment.
|
|
107
|
+
* @param target A live sandbox, or a state captured from one.
|
|
108
|
+
*/
|
|
109
|
+
export declare function diff(branch: Branch, target: DiffTarget): Promise<BranchDivergence[]>;
|
|
110
|
+
/**
|
|
111
|
+
* Land a branch's changes on a target, across every service.
|
|
112
|
+
*
|
|
113
|
+
* Atomic from the caller's point of view: the target's full state is captured
|
|
114
|
+
* before the first write, and any throw restores that capture, rethrows the
|
|
115
|
+
* original error, and leaves the branch undiscarded so the caller can inspect
|
|
116
|
+
* or retry it. On success the branch is spent and its sandbox is disposed.
|
|
117
|
+
*
|
|
118
|
+
* When the restore itself throws the target is not atomic any more, and the
|
|
119
|
+
* error says so: it carries the promotion's message first and the restore's
|
|
120
|
+
* after it, because a caller reading it needs to know both what failed and
|
|
121
|
+
* that the target still holds part of the change.
|
|
122
|
+
*/
|
|
123
|
+
export declare function promote(branch: Branch, target: LocalSandbox): Promise<void>;
|
|
124
|
+
/**
|
|
125
|
+
* Discard a branch: drop its sandbox and mark it spent. The target is never
|
|
126
|
+
* touched, because nothing was promoted. Idempotent.
|
|
127
|
+
*/
|
|
128
|
+
export declare function discard(branch: Branch): void;
|
|
129
|
+
//# sourceMappingURL=engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../src/sandbox/branches/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAMH,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACtB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAE,YAAY,EAAqB,MAAM,oBAAoB,CAAC;AAC1E,OAAO,KAAK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