@noodleseed/one 0.46.0 → 0.48.0
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/dist/commands/assistant-ops.d.ts.map +1 -1
- package/dist/commands/assistant-ops.js +65 -1
- package/dist/commands/assistant-ops.js.map +1 -1
- package/dist/commands/auth-ops.d.ts.map +1 -1
- package/dist/commands/auth-ops.js +28 -4
- package/dist/commands/auth-ops.js.map +1 -1
- package/dist/commands/billing-enforcement-ops.d.ts +2 -0
- package/dist/commands/billing-enforcement-ops.d.ts.map +1 -0
- package/dist/commands/billing-enforcement-ops.js +312 -0
- package/dist/commands/billing-enforcement-ops.js.map +1 -0
- package/dist/commands/billing-metering-ops.d.ts +2 -0
- package/dist/commands/billing-metering-ops.d.ts.map +1 -0
- package/dist/commands/billing-metering-ops.js +128 -0
- package/dist/commands/billing-metering-ops.js.map +1 -0
- package/dist/commands/billing-metering-validation-ops.d.ts +2 -0
- package/dist/commands/billing-metering-validation-ops.d.ts.map +1 -0
- package/dist/commands/billing-metering-validation-ops.js +186 -0
- package/dist/commands/billing-metering-validation-ops.js.map +1 -0
- package/dist/commands/billing-ops.d.ts.map +1 -1
- package/dist/commands/billing-ops.js +6 -0
- package/dist/commands/billing-ops.js.map +1 -1
- package/dist/commands/catalog-data-resources.d.ts.map +1 -1
- package/dist/commands/catalog-data-resources.js +25 -4
- package/dist/commands/catalog-data-resources.js.map +1 -1
- package/dist/commands/catalog-render.d.ts.map +1 -1
- package/dist/commands/catalog-render.js +7 -5
- package/dist/commands/catalog-render.js.map +1 -1
- package/dist/commands/deploy-ops.d.ts.map +1 -1
- package/dist/commands/deploy-ops.js +10 -1
- package/dist/commands/deploy-ops.js.map +1 -1
- package/dist/commands/deploy-output.d.ts.map +1 -1
- package/dist/commands/deploy-output.js +4 -0
- package/dist/commands/deploy-output.js.map +1 -1
- package/dist/commands/deploy-version-resolution.d.ts +1 -0
- package/dist/commands/deploy-version-resolution.d.ts.map +1 -1
- package/dist/commands/deploy-version-resolution.js +8 -0
- package/dist/commands/deploy-version-resolution.js.map +1 -1
- package/dist/commands/mcp-apps-chatgpt.d.ts +7 -0
- package/dist/commands/mcp-apps-chatgpt.d.ts.map +1 -0
- package/dist/commands/mcp-apps-chatgpt.js +143 -0
- package/dist/commands/mcp-apps-chatgpt.js.map +1 -0
- package/dist/commands/mcp-apps.d.ts.map +1 -1
- package/dist/commands/mcp-apps.js +2 -114
- package/dist/commands/mcp-apps.js.map +1 -1
- package/dist/deploy-payload-size.d.ts +3 -0
- package/dist/deploy-payload-size.d.ts.map +1 -0
- package/dist/deploy-payload-size.js +29 -0
- package/dist/deploy-payload-size.js.map +1 -0
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +19 -8
- package/dist/deploy.js.map +1 -1
- package/dist/sdk-version-skew.d.ts +3 -0
- package/dist/sdk-version-skew.d.ts.map +1 -0
- package/dist/sdk-version-skew.js +34 -0
- package/dist/sdk-version-skew.js.map +1 -0
- package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js +3 -3
- package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.js +10 -2
- package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
- package/node_modules/@noodle-borg/authoring/dist/server.d.ts +5 -0
- package/node_modules/@noodle-borg/authoring/dist/server.d.ts.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/server.js +1 -0
- package/node_modules/@noodle-borg/authoring/dist/server.js.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/artifact/types.d.ts +7 -1
- package/node_modules/@noodle-borg/compiler/dist/artifact/types.d.ts.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/artifact/types.js +4 -1
- package/node_modules/@noodle-borg/compiler/dist/artifact/types.js.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/compile.d.ts.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/compile.js +3 -0
- package/node_modules/@noodle-borg/compiler/dist/compile.js.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts +12 -0
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js +7 -0
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/mapping.d.ts.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/mapping.js +40 -1
- package/node_modules/@noodle-borg/protocol/dist/mapping.js.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/sdk-server.d.ts.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/sdk-server.js +109 -1
- package/node_modules/@noodle-borg/protocol/dist/sdk-server.js.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/tool-interaction.d.ts +10 -3
- package/node_modules/@noodle-borg/protocol/dist/tool-interaction.d.ts.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/tool-interaction.js +69 -5
- package/node_modules/@noodle-borg/protocol/dist/tool-interaction.js.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/widget/action-wiring-bootstrap.d.ts +3 -0
- package/node_modules/@noodle-borg/protocol/dist/widget/action-wiring-bootstrap.d.ts.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/widget/action-wiring-bootstrap.js +17 -0
- package/node_modules/@noodle-borg/protocol/dist/widget/action-wiring-bootstrap.js.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/widget/bootstrap.d.ts.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/widget/bootstrap.js +8 -16
- package/node_modules/@noodle-borg/protocol/dist/widget/bootstrap.js.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/widget/interaction-bootstrap.d.ts +3 -0
- package/node_modules/@noodle-borg/protocol/dist/widget/interaction-bootstrap.d.ts.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/widget/interaction-bootstrap.js +177 -0
- package/node_modules/@noodle-borg/protocol/dist/widget/interaction-bootstrap.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/enforcement-profile.d.ts +96 -0
- package/node_modules/@noodle-borg/service/dist/billing/enforcement-profile.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/enforcement-profile.js +198 -0
- package/node_modules/@noodle-borg/service/dist/billing/enforcement-profile.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/integration.d.ts +25 -2
- package/node_modules/@noodle-borg/service/dist/billing/integration.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/integration.js +51 -5
- package/node_modules/@noodle-borg/service/dist/billing/integration.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/meter-capacity.d.ts +77 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-capacity.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-capacity.js +202 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-capacity.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-live-validation-contract.d.ts +8 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-live-validation-contract.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-live-validation-contract.js +93 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-live-validation-contract.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-live-validation.d.ts +76 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-live-validation.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-live-validation.js +233 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-live-validation.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-readiness-health.d.ts +89 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-readiness-health.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-readiness-health.js +191 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-readiness-health.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-readiness.d.ts +99 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-readiness.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-readiness.js +136 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-readiness.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-runtime-config.d.ts +9 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-runtime-config.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-runtime-config.js +24 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-runtime-config.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-validation-epoch.d.ts +75 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-validation-epoch.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-validation-epoch.js +127 -0
- package/node_modules/@noodle-borg/service/dist/billing/meter-validation-epoch.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-profile-schema.d.ts +4 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-profile-schema.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-profile-schema.js +107 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-profile-schema.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-profile.d.ts +18 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-profile.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-profile.js +341 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-profile.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-clock.d.ts +3 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-clock.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-clock.js +9 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-clock.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-epoch-fixtures.d.ts +13 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-epoch-fixtures.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-epoch-fixtures.js +102 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-epoch-fixtures.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-epochs.d.ts +41 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-epochs.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-epochs.js +289 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-epochs.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-evidence-retention.d.ts +16 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-evidence-retention.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-evidence-retention.js +126 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-evidence-retention.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-live-validation.d.ts +33 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-live-validation.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-live-validation.js +436 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-live-validation.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-maintenance.d.ts +26 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-maintenance.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-maintenance.js +146 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-maintenance.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-partition.d.ts +8 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-partition.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-partition.js +42 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-partition.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-prepare-preflight.d.ts +8 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-prepare-preflight.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-prepare-preflight.js +44 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-prepare-preflight.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-readiness-live.d.ts +13 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-readiness-live.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-readiness-live.js +189 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-readiness-live.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-readiness.d.ts +18 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-readiness.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-readiness.js +342 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-readiness.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-reconciliation.d.ts +27 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-reconciliation.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-reconciliation.js +304 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-reconciliation.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-retention.d.ts +22 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-retention.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-retention.js +224 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-retention.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-runtime.d.ts +33 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-runtime.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-runtime.js +173 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-runtime.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-scheduler-schema.d.ts +7 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-scheduler-schema.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-scheduler-schema.js +50 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-scheduler-schema.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-scheduler-store.d.ts +34 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-scheduler-store.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-scheduler-store.js +157 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-scheduler-store.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-scheduler.d.ts +56 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-scheduler.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-scheduler.js +264 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-scheduler.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-schema.d.ts +6 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-schema.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-schema.js +414 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-schema.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-validation.d.ts +43 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-validation.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-validation.js +321 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-validation.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-window-lock.d.ts +10 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-window-lock.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-window-lock.js +13 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-window-lock.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-window-schema.d.ts +6 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-window-schema.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-window-schema.js +248 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-window-schema.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-writer-compaction.d.ts +29 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-writer-compaction.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-writer-compaction.js +240 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-writer-compaction.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-writer-health-schema.d.ts +4 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-writer-health-schema.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-writer-health-schema.js +140 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-writer-health-schema.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-migration.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-migration.js +4 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-migration.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-schema.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-schema.js +6 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-schema.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres.js +3 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/service-meter-runtime.d.ts +7 -0
- package/node_modules/@noodle-borg/service/dist/billing/service-meter-runtime.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/service-meter-runtime.js +19 -0
- package/node_modules/@noodle-borg/service/dist/billing/service-meter-runtime.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/shadow-meter.d.ts +9 -4
- package/node_modules/@noodle-borg/service/dist/billing/shadow-meter.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/shadow-meter.js +34 -95
- package/node_modules/@noodle-borg/service/dist/billing/shadow-meter.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/usage-identity.d.ts +14 -0
- package/node_modules/@noodle-borg/service/dist/billing/usage-identity.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/usage-identity.js +87 -0
- package/node_modules/@noodle-borg/service/dist/billing/usage-identity.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/usage-observer.d.ts +6 -0
- package/node_modules/@noodle-borg/service/dist/billing/usage-observer.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/usage-observer.js +26 -0
- package/node_modules/@noodle-borg/service/dist/billing/usage-observer.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing-public.d.ts +16 -0
- package/node_modules/@noodle-borg/service/dist/billing-public.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing-public.js +15 -0
- package/node_modules/@noodle-borg/service/dist/billing-public.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/customer-verifier.d.ts +1 -0
- package/node_modules/@noodle-borg/service/dist/customer-verifier.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/customer-verifier.js +15 -0
- package/node_modules/@noodle-borg/service/dist/customer-verifier.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/http-util.d.ts +13 -0
- package/node_modules/@noodle-borg/service/dist/http-util.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/http-util.js +42 -2
- package/node_modules/@noodle-borg/service/dist/http-util.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/index.d.ts +2 -7
- package/node_modules/@noodle-borg/service/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/index.js +1 -6
- package/node_modules/@noodle-borg/service/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/main.js +3 -0
- package/node_modules/@noodle-borg/service/dist/main.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/options.d.ts +18 -0
- package/node_modules/@noodle-borg/service/dist/options.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/persistence-options.d.ts +4 -0
- package/node_modules/@noodle-borg/service/dist/persistence-options.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/persistence-options.js +22 -0
- package/node_modules/@noodle-borg/service/dist/persistence-options.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/assistant-dispatch.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/assistant-dispatch.js +10 -1
- package/node_modules/@noodle-borg/service/dist/routes/assistant-dispatch.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/assistant.d.ts +2 -0
- package/node_modules/@noodle-borg/service/dist/routes/assistant.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/assistant.js +85 -0
- package/node_modules/@noodle-borg/service/dist/routes/assistant.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/billing-enforcement-cohort.d.ts +17 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-enforcement-cohort.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-enforcement-cohort.js +145 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-enforcement-cohort.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-meter-readiness.d.ts +15 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-meter-readiness.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-meter-readiness.js +78 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-meter-readiness.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-meter-validation.d.ts +15 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-meter-validation.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-meter-validation.js +108 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-meter-validation.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/commercial-dispatch.d.ts +6 -0
- package/node_modules/@noodle-borg/service/dist/routes/commercial-dispatch.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/commercial-dispatch.js +99 -0
- package/node_modules/@noodle-borg/service/dist/routes/commercial-dispatch.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/commercial-service-deps.d.ts +25 -0
- package/node_modules/@noodle-borg/service/dist/routes/commercial-service-deps.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/commercial-service-deps.js +35 -0
- package/node_modules/@noodle-borg/service/dist/routes/commercial-service-deps.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/control-plane.js +3 -3
- package/node_modules/@noodle-borg/service/dist/routes/control-plane.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/serve-options.d.ts +93 -0
- package/node_modules/@noodle-borg/service/dist/serve-options.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/serve-options.js +2 -0
- package/node_modules/@noodle-borg/service/dist/serve-options.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/serve.d.ts +2 -92
- package/node_modules/@noodle-borg/service/dist/serve.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/serve.js +64 -59
- package/node_modules/@noodle-borg/service/dist/serve.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.d.ts +22 -0
- package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.js +51 -0
- package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/service.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/service.js +10 -21
- package/node_modules/@noodle-borg/service/dist/service.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/cloudsql-pool.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/cloudsql-pool.js +7 -1
- package/node_modules/@noodle-borg/service/dist/store/cloudsql-pool.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-billing.d.ts +6 -2
- package/node_modules/@noodle-borg/service/dist/store/postgres-billing.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-billing.js +11 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-billing.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** CSP-safe form and action listener wiring spliced into the shared widget bootstrap. */
|
|
2
|
+
export const WIDGET_ACTION_WIRING_SOURCE = `
|
|
3
|
+
function wireActions(root) {
|
|
4
|
+
root = root || document;
|
|
5
|
+
for (const form of root.querySelectorAll('form')) {
|
|
6
|
+
if (form.hasAttribute('data-noodle-wired')) continue;
|
|
7
|
+
form.setAttribute('data-noodle-wired', '');
|
|
8
|
+
form.addEventListener('submit', (event) => event.preventDefault());
|
|
9
|
+
}
|
|
10
|
+
for (const el of root.querySelectorAll('[data-action]')) {
|
|
11
|
+
if (el.hasAttribute('data-noodle-wired')) continue;
|
|
12
|
+
el.setAttribute('data-noodle-wired', '');
|
|
13
|
+
el.addEventListener('click', () => actOnce(el));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
//# sourceMappingURL=action-wiring-bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-wiring-bootstrap.js","sourceRoot":"","sources":["../../src/widget/action-wiring-bootstrap.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,MAAM,CAAC,MAAM,2BAA2B,GAAW;;;;;;;;;;;;;;CAclD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/widget/bootstrap.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/widget/bootstrap.ts"],"names":[],"mappings":"AASA,uEAAuE;AACvE,eAAO,MAAM,uBAAuB,EAAE,MA4wBrC,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { WIDGET_ACTION_WIRING_SOURCE } from './action-wiring-bootstrap.js';
|
|
1
2
|
import { WIDGET_FLOW_SOURCE } from './flow-bootstrap.js';
|
|
2
3
|
import { WIDGET_FORMAT_SOURCE } from './format-bootstrap.js';
|
|
3
4
|
import { WIDGET_HANDOFF_SOURCE } from './handoff-bootstrap.js';
|
|
5
|
+
import { WIDGET_INTERACTION_SOURCE } from './interaction-bootstrap.js';
|
|
4
6
|
import { WIDGET_MODEL_CONTEXT_SOURCE } from './model-context-bootstrap.js';
|
|
5
7
|
import { OPENAI_WIDGET_BRIDGE_SOURCE } from './openai-bridge.js';
|
|
6
8
|
import { WIDGET_REACT_BRIDGE_SOURCE } from './react-bridge-bootstrap.js';
|
|
@@ -12,10 +14,10 @@ ${OPENAI_WIDGET_BRIDGE_SOURCE}
|
|
|
12
14
|
const oai = globalThis.openai;
|
|
13
15
|
const MAX_RENDERED_ITEMS = 50;
|
|
14
16
|
let app;
|
|
15
|
-
if (
|
|
16
|
-
app = makeOpenAiApp(oai);
|
|
17
|
-
} else if (E && E.App) {
|
|
17
|
+
if (E && E.App) {
|
|
18
18
|
app = new E.App({ name: 'noodle-widget', version: '1' }, {}, { autoResize: true });
|
|
19
|
+
} else if (oai && typeof oai.callTool === 'function') {
|
|
20
|
+
app = makeOpenAiApp(oai);
|
|
19
21
|
} else {
|
|
20
22
|
return;
|
|
21
23
|
}
|
|
@@ -288,6 +290,7 @@ ${WIDGET_FORMAT_SOURCE}
|
|
|
288
290
|
function bind(data) {
|
|
289
291
|
if (data == null) return;
|
|
290
292
|
globalThis.__noodleData = data;
|
|
293
|
+
renderInteractionCard(data);
|
|
291
294
|
renderCollections(data);
|
|
292
295
|
renderTables(data);
|
|
293
296
|
renderScope(document, data);
|
|
@@ -412,6 +415,7 @@ ${WIDGET_FORMAT_SOURCE}
|
|
|
412
415
|
}
|
|
413
416
|
}
|
|
414
417
|
${WIDGET_FLOW_SOURCE}
|
|
418
|
+
${WIDGET_INTERACTION_SOURCE}
|
|
415
419
|
function actionContext(el) {
|
|
416
420
|
const data = globalThis.__noodleData;
|
|
417
421
|
const itemRoot = el && el.closest ? el.closest('[data-collection-generated]') : null;
|
|
@@ -767,19 +771,7 @@ ${WIDGET_HANDOFF_SOURCE}
|
|
|
767
771
|
}
|
|
768
772
|
}
|
|
769
773
|
}
|
|
770
|
-
|
|
771
|
-
root = root || document;
|
|
772
|
-
for (const form of root.querySelectorAll('form')) {
|
|
773
|
-
if (form.hasAttribute('data-noodle-wired')) continue;
|
|
774
|
-
form.setAttribute('data-noodle-wired', '');
|
|
775
|
-
form.addEventListener('submit', (event) => event.preventDefault());
|
|
776
|
-
}
|
|
777
|
-
for (const el of root.querySelectorAll('[data-action]')) {
|
|
778
|
-
if (el.hasAttribute('data-noodle-wired')) continue;
|
|
779
|
-
el.setAttribute('data-noodle-wired', '');
|
|
780
|
-
el.addEventListener('click', () => actOnce(el));
|
|
781
|
-
}
|
|
782
|
-
}
|
|
774
|
+
${WIDGET_ACTION_WIRING_SOURCE}
|
|
783
775
|
|
|
784
776
|
// Register handlers BEFORE connect() so no one-shot host notification is missed.
|
|
785
777
|
app.ontoolresult = (p) => bind(fromResult(p));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../src/widget/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAEzE,uEAAuE;AACvE,MAAM,CAAC,MAAM,uBAAuB,GAAW;;EAE7C,2BAA2B;;;;;;;;;;;;EAY3B,2BAA2B;EAC3B,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwJ1B,oBAAoB
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../src/widget/bootstrap.ts"],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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoPrB,2BAA2B;;;;;;;;;;;;;;;;CAgB5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction-bootstrap.d.ts","sourceRoot":"","sources":["../../src/widget/interaction-bootstrap.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,eAAO,MAAM,yBAAyB,EAAE,MA8KvC,CAAC"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/** Portable, business-user input card for recoverable `ctx.elicit` results. */
|
|
2
|
+
export const WIDGET_INTERACTION_SOURCE = `
|
|
3
|
+
function removeInteractionCard() {
|
|
4
|
+
const existing = document.getElementById('noodle-interaction-card');
|
|
5
|
+
if (existing) existing.remove();
|
|
6
|
+
}
|
|
7
|
+
function interactionLabel(name, schema) {
|
|
8
|
+
if (schema && typeof schema.title === 'string') return schema.title;
|
|
9
|
+
return String(name).replace(/[_-]+/g, ' ').replace(/(^|\\s)\\S/g, (c) => c.toUpperCase());
|
|
10
|
+
}
|
|
11
|
+
function addInteractionChoice(select, value, label) {
|
|
12
|
+
const option = document.createElement('option');
|
|
13
|
+
option.value = String(value);
|
|
14
|
+
option.textContent = String(label);
|
|
15
|
+
select.appendChild(option);
|
|
16
|
+
}
|
|
17
|
+
function interactionControl(name, schema, required) {
|
|
18
|
+
let control;
|
|
19
|
+
const choices = Array.isArray(schema.enum)
|
|
20
|
+
? schema.enum.map((value) => ({ value, label: value }))
|
|
21
|
+
: Array.isArray(schema.oneOf)
|
|
22
|
+
? schema.oneOf.map((choice) => ({ value: choice.const, label: choice.title }))
|
|
23
|
+
: null;
|
|
24
|
+
if (schema.type === 'array') {
|
|
25
|
+
control = document.createElement('div');
|
|
26
|
+
control.setAttribute('role', 'group');
|
|
27
|
+
const itemChoices = schema.items && Array.isArray(schema.items.enum)
|
|
28
|
+
? schema.items.enum.map((value) => ({ value, label: value }))
|
|
29
|
+
: schema.items && Array.isArray(schema.items.anyOf)
|
|
30
|
+
? schema.items.anyOf.map((choice) => ({ value: choice.const, label: choice.title }))
|
|
31
|
+
: [];
|
|
32
|
+
for (const choice of itemChoices) {
|
|
33
|
+
const optionLabel = document.createElement('label');
|
|
34
|
+
optionLabel.style.cssText = 'display:flex;align-items:center;gap:8px;font-weight:400';
|
|
35
|
+
const checkbox = document.createElement('input');
|
|
36
|
+
checkbox.type = 'checkbox';
|
|
37
|
+
checkbox.value = String(choice.value);
|
|
38
|
+
checkbox.checked = Array.isArray(schema.default) && schema.default.includes(choice.value);
|
|
39
|
+
optionLabel.append(checkbox, document.createTextNode(String(choice.label)));
|
|
40
|
+
control.appendChild(optionLabel);
|
|
41
|
+
}
|
|
42
|
+
control.dataset.minItems = String(typeof schema.minItems === 'number' ? schema.minItems : required ? 1 : 0);
|
|
43
|
+
if (typeof schema.maxItems === 'number') control.dataset.maxItems = String(schema.maxItems);
|
|
44
|
+
} else if (choices) {
|
|
45
|
+
control = document.createElement('select');
|
|
46
|
+
addInteractionChoice(control, '', 'Choose an option');
|
|
47
|
+
for (const choice of choices) addInteractionChoice(control, choice.value, choice.label);
|
|
48
|
+
} else if (schema.type === 'boolean') {
|
|
49
|
+
control = document.createElement('input');
|
|
50
|
+
control.type = 'checkbox';
|
|
51
|
+
} else if (schema.type === 'number' || schema.type === 'integer') {
|
|
52
|
+
control = document.createElement('input');
|
|
53
|
+
control.type = 'number';
|
|
54
|
+
if (schema.type === 'integer') control.step = '1';
|
|
55
|
+
if (typeof schema.minimum === 'number') control.min = String(schema.minimum);
|
|
56
|
+
if (typeof schema.maximum === 'number') control.max = String(schema.maximum);
|
|
57
|
+
} else {
|
|
58
|
+
control = document.createElement('input');
|
|
59
|
+
control.type = schema.format === 'email' ? 'email' : schema.format === 'date' ? 'date' : schema.format === 'date-time' ? 'datetime-local' : 'text';
|
|
60
|
+
if (typeof schema.minLength === 'number') control.minLength = schema.minLength;
|
|
61
|
+
if (typeof schema.maxLength === 'number') control.maxLength = schema.maxLength;
|
|
62
|
+
}
|
|
63
|
+
control.name = name;
|
|
64
|
+
control.required = required && control.type !== 'checkbox' && schema.type !== 'array';
|
|
65
|
+
if (schema.default !== undefined && schema.type !== 'array') {
|
|
66
|
+
if (control.type === 'checkbox') control.checked = Boolean(schema.default);
|
|
67
|
+
else control.value = String(schema.default);
|
|
68
|
+
}
|
|
69
|
+
return control;
|
|
70
|
+
}
|
|
71
|
+
function interactionValue(control, schema) {
|
|
72
|
+
if (schema.type === 'array') {
|
|
73
|
+
return Array.from(control.querySelectorAll('input[type="checkbox"]:checked')).map((item) => item.value);
|
|
74
|
+
}
|
|
75
|
+
if (schema.type === 'boolean') return Boolean(control.checked);
|
|
76
|
+
if (schema.type === 'number' || schema.type === 'integer') return Number(control.value);
|
|
77
|
+
return control.value;
|
|
78
|
+
}
|
|
79
|
+
function renderInteractionCard(data) {
|
|
80
|
+
const request = data && data.code === 'interaction_unavailable' && data.interaction === 'input'
|
|
81
|
+
? data.request
|
|
82
|
+
: null;
|
|
83
|
+
const interaction = data && data._meta && data._meta.noodle && data._meta.noodle.interaction;
|
|
84
|
+
if (!request || !interaction || typeof interaction.tool !== 'string') {
|
|
85
|
+
removeInteractionCard();
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
removeInteractionCard();
|
|
89
|
+
const schema = request.requestedSchema || {};
|
|
90
|
+
const properties = schema.properties || {};
|
|
91
|
+
const required = Array.isArray(schema.required) ? schema.required : [];
|
|
92
|
+
const card = document.createElement('section');
|
|
93
|
+
card.id = 'noodle-interaction-card';
|
|
94
|
+
card.setAttribute('role', 'region');
|
|
95
|
+
card.setAttribute('aria-label', 'Details needed');
|
|
96
|
+
card.style.cssText = 'box-sizing:border-box;margin:12px;padding:20px;border:1px solid var(--color-border-secondary,#d8dee8);border-radius:16px;background:var(--color-background-primary,#fff);color:var(--color-text-primary,#172033);box-shadow:0 10px 30px rgba(23,32,51,.10);font:14px/1.45 system-ui,sans-serif';
|
|
97
|
+
const eyebrow = document.createElement('div');
|
|
98
|
+
eyebrow.textContent = 'DETAILS NEEDED';
|
|
99
|
+
eyebrow.style.cssText = 'margin-bottom:6px;color:var(--color-text-secondary,#667085);font-size:11px;font-weight:700;letter-spacing:.08em';
|
|
100
|
+
const title = document.createElement('h2');
|
|
101
|
+
title.textContent = 'A few details before we continue';
|
|
102
|
+
title.style.cssText = 'margin:0 0 6px;font-size:18px;line-height:1.3';
|
|
103
|
+
const message = document.createElement('p');
|
|
104
|
+
message.textContent = typeof request.message === 'string' ? request.message : 'Please complete the details below.';
|
|
105
|
+
message.style.cssText = 'margin:0 0 16px;color:var(--color-text-secondary,#475467)';
|
|
106
|
+
const form = document.createElement('form');
|
|
107
|
+
form.style.cssText = 'display:grid;gap:14px';
|
|
108
|
+
const controls = {};
|
|
109
|
+
for (const name of Object.keys(properties)) {
|
|
110
|
+
const fieldSchema = properties[name] || {};
|
|
111
|
+
const field = document.createElement('label');
|
|
112
|
+
field.style.cssText = 'display:grid;gap:6px;font-weight:600';
|
|
113
|
+
const label = document.createElement('span');
|
|
114
|
+
label.textContent = interactionLabel(name, fieldSchema) + (required.includes(name) ? ' *' : '');
|
|
115
|
+
const control = interactionControl(name, fieldSchema, required.includes(name));
|
|
116
|
+
control.style.cssText = control.type === 'checkbox'
|
|
117
|
+
? 'width:18px;height:18px'
|
|
118
|
+
: 'box-sizing:border-box;width:100%;min-height:42px;padding:9px 11px;border:1px solid var(--color-border-secondary,#cbd5e1);border-radius:10px;background:var(--color-background-primary,#fff);color:inherit;font:inherit';
|
|
119
|
+
controls[name] = { control, schema: fieldSchema };
|
|
120
|
+
field.append(label, control);
|
|
121
|
+
if (typeof fieldSchema.description === 'string') {
|
|
122
|
+
const hint = document.createElement('small');
|
|
123
|
+
hint.textContent = fieldSchema.description;
|
|
124
|
+
hint.style.cssText = 'color:var(--color-text-secondary,#667085);font-weight:400';
|
|
125
|
+
field.appendChild(hint);
|
|
126
|
+
}
|
|
127
|
+
form.appendChild(field);
|
|
128
|
+
}
|
|
129
|
+
const submit = document.createElement('button');
|
|
130
|
+
submit.id = 'noodle-interaction-submit';
|
|
131
|
+
submit.type = 'submit';
|
|
132
|
+
submit.textContent = 'Continue';
|
|
133
|
+
submit.style.cssText = 'min-height:42px;padding:9px 16px;border:0;border-radius:10px;background:var(--color-background-accent,#2563eb);color:var(--color-text-on-accent,#fff);font:inherit;font-weight:700;cursor:pointer';
|
|
134
|
+
form.appendChild(submit);
|
|
135
|
+
form.addEventListener('submit', (event) => {
|
|
136
|
+
event.preventDefault();
|
|
137
|
+
if (typeof form.reportValidity === 'function' && !form.reportValidity()) return;
|
|
138
|
+
const content = {};
|
|
139
|
+
for (const name of Object.keys(controls)) {
|
|
140
|
+
const item = controls[name];
|
|
141
|
+
const value = interactionValue(item.control, item.schema);
|
|
142
|
+
if (item.schema.type === 'array') {
|
|
143
|
+
const minItems = Number(item.control.dataset.minItems || 0);
|
|
144
|
+
const maxItems = item.control.dataset.maxItems ? Number(item.control.dataset.maxItems) : Infinity;
|
|
145
|
+
if (value.length < minItems || value.length > maxItems) {
|
|
146
|
+
status('Choose the requested number of options before continuing.');
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
content[name] = value;
|
|
151
|
+
}
|
|
152
|
+
const args = Object.assign({}, globalThis.__noodleInput || {});
|
|
153
|
+
delete args.__noodleInteraction;
|
|
154
|
+
const responses = Object.assign({}, interaction.responses || {}, {
|
|
155
|
+
[request.id]: { action: 'accept', content },
|
|
156
|
+
});
|
|
157
|
+
submit.disabled = true;
|
|
158
|
+
submit.setAttribute('aria-busy', 'true');
|
|
159
|
+
submit.textContent = 'Continuing…';
|
|
160
|
+
Promise.resolve(app.callServerTool({
|
|
161
|
+
name: interaction.tool,
|
|
162
|
+
arguments: args,
|
|
163
|
+
_meta: { noodle: { interaction: { responses } } },
|
|
164
|
+
}))
|
|
165
|
+
.then((result) => bind(fromResult(result)))
|
|
166
|
+
.catch(() => status('We could not continue. Please review the details and try again.'))
|
|
167
|
+
.then(() => {
|
|
168
|
+
submit.disabled = false;
|
|
169
|
+
submit.removeAttribute('aria-busy');
|
|
170
|
+
submit.textContent = 'Continue';
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
card.append(eyebrow, title, message, form);
|
|
174
|
+
document.body.prepend(card);
|
|
175
|
+
}
|
|
176
|
+
`;
|
|
177
|
+
//# sourceMappingURL=interaction-bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction-bootstrap.js","sourceRoot":"","sources":["../../src/widget/interaction-bootstrap.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,MAAM,CAAC,MAAM,yBAAyB,GAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8KhD,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { AuditEventInput } from '@noodle-borg/module';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { ControlPlaneIdentity } from '../auth/deploy-gate.js';
|
|
4
|
+
export declare const BILLING_ENFORCEMENT_PROFILE_SCHEMA_VERSION = 1;
|
|
5
|
+
export declare const BILLING_ENFORCEMENT_COHORT_KIND: "legacy_internal_v1";
|
|
6
|
+
export declare const LEGACY_INTERNAL_ENFORCEMENT_PROFILE: "legacy_internal_exempt";
|
|
7
|
+
export declare const POST_SEAL_ENFORCEMENT_PROFILE: "enforced";
|
|
8
|
+
export type BillingEnforcementProfileMode = typeof LEGACY_INTERNAL_ENFORCEMENT_PROFILE | typeof POST_SEAL_ENFORCEMENT_PROFILE;
|
|
9
|
+
export type BillingEnforcementCohortKind = typeof BILLING_ENFORCEMENT_COHORT_KIND;
|
|
10
|
+
export type BillingEnforcementProfileSource = 'legacy_cohort_seal' | 'post_seal_account';
|
|
11
|
+
export declare const BillingEnforcementCohortSealRequestSchema: z.ZodObject<{
|
|
12
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
13
|
+
cohortKind: z.ZodLiteral<"legacy_internal_v1">;
|
|
14
|
+
legacyAccountProfile: z.ZodLiteral<"legacy_internal_exempt">;
|
|
15
|
+
postSealAccountProfile: z.ZodLiteral<"enforced">;
|
|
16
|
+
reason: z.ZodString;
|
|
17
|
+
idempotencyKey: z.ZodString;
|
|
18
|
+
confirmed: z.ZodLiteral<true>;
|
|
19
|
+
}, z.core.$strict>;
|
|
20
|
+
export declare const BillingEnforcementCohortSealResponseSchema: z.ZodObject<{
|
|
21
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
22
|
+
cohortKind: z.ZodLiteral<"legacy_internal_v1">;
|
|
23
|
+
state: z.ZodLiteral<"sealed">;
|
|
24
|
+
replayed: z.ZodBoolean;
|
|
25
|
+
sealId: z.ZodString;
|
|
26
|
+
sealedAt: z.ZodISODateTime;
|
|
27
|
+
legacyAccountProfile: z.ZodLiteral<"legacy_internal_exempt">;
|
|
28
|
+
postSealAccountProfile: z.ZodLiteral<"enforced">;
|
|
29
|
+
billingAccountCount: z.ZodNumber;
|
|
30
|
+
profiledAccountCount: z.ZodNumber;
|
|
31
|
+
legacyInternalExemptAccountCount: z.ZodNumber;
|
|
32
|
+
enforcedAccountCount: z.ZodNumber;
|
|
33
|
+
unprofiledAccountCount: z.ZodNumber;
|
|
34
|
+
billingAttributionComplete: z.ZodLiteral<true>;
|
|
35
|
+
attributionBlockerCount: z.ZodLiteral<0>;
|
|
36
|
+
activationState: z.ZodLiteral<"not_active">;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
export declare const BillingEnforcementCohortStatusResponseSchema: z.ZodObject<{
|
|
39
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
40
|
+
cohortKind: z.ZodLiteral<"legacy_internal_v1">;
|
|
41
|
+
state: z.ZodEnum<{
|
|
42
|
+
sealed: "sealed";
|
|
43
|
+
unsealed: "unsealed";
|
|
44
|
+
}>;
|
|
45
|
+
sealId: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
|
|
46
|
+
sealedAt: z.ZodUnion<readonly [z.ZodISODateTime, z.ZodNull]>;
|
|
47
|
+
legacyAccountProfile: z.ZodLiteral<"legacy_internal_exempt">;
|
|
48
|
+
postSealAccountProfile: z.ZodLiteral<"enforced">;
|
|
49
|
+
billingAccountCount: z.ZodNumber;
|
|
50
|
+
profiledAccountCount: z.ZodNumber;
|
|
51
|
+
legacyInternalExemptAccountCount: z.ZodNumber;
|
|
52
|
+
enforcedAccountCount: z.ZodNumber;
|
|
53
|
+
unprofiledAccountCount: z.ZodNumber;
|
|
54
|
+
billingAttributionComplete: z.ZodBoolean;
|
|
55
|
+
attributionBlockerCount: z.ZodNumber;
|
|
56
|
+
}, z.core.$strict>;
|
|
57
|
+
export type BillingEnforcementCohortSealRequest = z.infer<typeof BillingEnforcementCohortSealRequestSchema>;
|
|
58
|
+
export type BillingEnforcementCohortSealResponse = z.infer<typeof BillingEnforcementCohortSealResponseSchema>;
|
|
59
|
+
export type BillingEnforcementCohortStatusResponse = z.infer<typeof BillingEnforcementCohortStatusResponseSchema>;
|
|
60
|
+
export interface BillingAccountEnforcementProfileRecord {
|
|
61
|
+
readonly schemaVersion: 1;
|
|
62
|
+
readonly billingAccountId: string;
|
|
63
|
+
readonly version: number;
|
|
64
|
+
readonly mode: BillingEnforcementProfileMode;
|
|
65
|
+
readonly cohortKind: BillingEnforcementCohortKind;
|
|
66
|
+
readonly cohortSealId: string;
|
|
67
|
+
readonly source: BillingEnforcementProfileSource;
|
|
68
|
+
readonly effectiveFrom: string;
|
|
69
|
+
readonly createdAt: string;
|
|
70
|
+
}
|
|
71
|
+
export interface BillingEnforcementProfileStore {
|
|
72
|
+
/** PostgreSQL stores persist seal success audits with the classification transaction. */
|
|
73
|
+
readonly successAuditMode?: 'transactional';
|
|
74
|
+
getEnforcementCohortStatus(): Promise<BillingEnforcementCohortStatusResponse>;
|
|
75
|
+
sealEnforcementCohort(input: {
|
|
76
|
+
readonly request: BillingEnforcementCohortSealRequest;
|
|
77
|
+
readonly actor: ControlPlaneIdentity;
|
|
78
|
+
readonly service: string;
|
|
79
|
+
}): Promise<BillingEnforcementCohortSealResponse>;
|
|
80
|
+
getActiveBillingAccountEnforcementProfile(billingAccountId: string): Promise<BillingAccountEnforcementProfileRecord | undefined>;
|
|
81
|
+
}
|
|
82
|
+
export type BillingEnforcementCohortConflictCode = 'idempotency_key_conflict' | 'enforcement_cohort_already_sealed' | 'billing_attribution_incomplete' | 'enforcement_profile_state_conflict' | 'serialization_conflict';
|
|
83
|
+
export declare class BillingEnforcementCohortConflictError extends Error {
|
|
84
|
+
readonly code: BillingEnforcementCohortConflictCode;
|
|
85
|
+
constructor(code: BillingEnforcementCohortConflictCode, message: string);
|
|
86
|
+
}
|
|
87
|
+
export declare function parseBillingEnforcementCohortSealRequest(value: unknown): BillingEnforcementCohortSealRequest;
|
|
88
|
+
export declare function billingEnforcementCohortRequestFingerprint(input: {
|
|
89
|
+
readonly action: 'seal';
|
|
90
|
+
readonly request: BillingEnforcementCohortSealRequest;
|
|
91
|
+
readonly actor: Pick<ControlPlaneIdentity, 'subject' | 'email'>;
|
|
92
|
+
readonly service: string;
|
|
93
|
+
}): string;
|
|
94
|
+
export declare function billingEnforcementCohortSuccessAudit(response: BillingEnforcementCohortSealResponse, actor: Pick<ControlPlaneIdentity, 'subject' | 'email'>): AuditEventInput;
|
|
95
|
+
export declare function normalizeBillingEnforcementServiceUrl(value: string): string;
|
|
96
|
+
//# sourceMappingURL=enforcement-profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enforcement-profile.d.ts","sourceRoot":"","sources":["../../src/billing/enforcement-profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGnE,eAAO,MAAM,0CAA0C,IAAI,CAAC;AAC5D,eAAO,MAAM,+BAA+B,EAAG,oBAA6B,CAAC;AAC7E,eAAO,MAAM,mCAAmC,EAAG,wBAAiC,CAAC;AACrF,eAAO,MAAM,6BAA6B,EAAG,UAAmB,CAAC;AAEjE,MAAM,MAAM,6BAA6B,GACrC,OAAO,mCAAmC,GAC1C,OAAO,6BAA6B,CAAC;AACzC,MAAM,MAAM,4BAA4B,GAAG,OAAO,+BAA+B,CAAC;AAClF,MAAM,MAAM,+BAA+B,GAAG,oBAAoB,GAAG,mBAAmB,CAAC;AAUzF,eAAO,MAAM,yCAAyC;;;;;;;;kBAQpD,CAAC;AAEH,eAAO,MAAM,0CAA0C;;;;;;;;;;;;;;;;;kBAmBnB,CAAC;AAErC,eAAO,MAAM,4CAA4C;;;;;;;;;;;;;;;;;;kBAsCrD,CAAC;AAEL,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,yCAAyC,CACjD,CAAC;AACF,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CACxD,OAAO,0CAA0C,CAClD,CAAC;AACF,MAAM,MAAM,sCAAsC,GAAG,CAAC,CAAC,KAAK,CAC1D,OAAO,4CAA4C,CACpD,CAAC;AAEF,MAAM,WAAW,sCAAsC;IACrD,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC;IAC1B,QAAQ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AAO,EAAE,mCAAmC,CAAC;IACtD,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,oBAAoB,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC;IAChE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,GAAG,MAAM,CAQT;AAED,wBAAgB,oCAAoC,CAClD,QAAQ,EAAE,oCAAoC,EAC9C,KAAK,EAAE,IAAI,CAAC,oBAAoB,EAAE,SAAS,GAAG,OAAO,CAAC,GACrD,eAAe,CAyBjB;AAED,wBAAgB,qCAAqC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAa3E"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { billingContentChecksum } from './model.js';
|
|
3
|
+
export const BILLING_ENFORCEMENT_PROFILE_SCHEMA_VERSION = 1;
|
|
4
|
+
export const BILLING_ENFORCEMENT_COHORT_KIND = 'legacy_internal_v1';
|
|
5
|
+
export const LEGACY_INTERNAL_ENFORCEMENT_PROFILE = 'legacy_internal_exempt';
|
|
6
|
+
export const POST_SEAL_ENFORCEMENT_PROFILE = 'enforced';
|
|
7
|
+
const scalarSchema = (label, max) => z
|
|
8
|
+
.string()
|
|
9
|
+
.trim()
|
|
10
|
+
.min(1, `${label} is required`)
|
|
11
|
+
.max(max, `${label} must be ${max} characters or fewer`)
|
|
12
|
+
.refine((value) => !hasControlCharacters(value), `${label} cannot contain control characters`);
|
|
13
|
+
export const BillingEnforcementCohortSealRequestSchema = z.strictObject({
|
|
14
|
+
schemaVersion: z.literal(BILLING_ENFORCEMENT_PROFILE_SCHEMA_VERSION),
|
|
15
|
+
cohortKind: z.literal(BILLING_ENFORCEMENT_COHORT_KIND),
|
|
16
|
+
legacyAccountProfile: z.literal(LEGACY_INTERNAL_ENFORCEMENT_PROFILE),
|
|
17
|
+
postSealAccountProfile: z.literal(POST_SEAL_ENFORCEMENT_PROFILE),
|
|
18
|
+
reason: scalarSchema('reason', 512),
|
|
19
|
+
idempotencyKey: scalarSchema('idempotencyKey', 256),
|
|
20
|
+
confirmed: z.literal(true),
|
|
21
|
+
});
|
|
22
|
+
export const BillingEnforcementCohortSealResponseSchema = z
|
|
23
|
+
.strictObject({
|
|
24
|
+
schemaVersion: z.literal(BILLING_ENFORCEMENT_PROFILE_SCHEMA_VERSION),
|
|
25
|
+
cohortKind: z.literal(BILLING_ENFORCEMENT_COHORT_KIND),
|
|
26
|
+
state: z.literal('sealed'),
|
|
27
|
+
replayed: z.boolean(),
|
|
28
|
+
sealId: scalarSchema('sealId', 128),
|
|
29
|
+
sealedAt: z.iso.datetime({ offset: true }),
|
|
30
|
+
legacyAccountProfile: z.literal(LEGACY_INTERNAL_ENFORCEMENT_PROFILE),
|
|
31
|
+
postSealAccountProfile: z.literal(POST_SEAL_ENFORCEMENT_PROFILE),
|
|
32
|
+
billingAccountCount: z.number().int().nonnegative(),
|
|
33
|
+
profiledAccountCount: z.number().int().nonnegative(),
|
|
34
|
+
legacyInternalExemptAccountCount: z.number().int().nonnegative(),
|
|
35
|
+
enforcedAccountCount: z.number().int().nonnegative(),
|
|
36
|
+
unprofiledAccountCount: z.number().int().nonnegative(),
|
|
37
|
+
billingAttributionComplete: z.literal(true),
|
|
38
|
+
attributionBlockerCount: z.literal(0),
|
|
39
|
+
activationState: z.literal('not_active'),
|
|
40
|
+
})
|
|
41
|
+
.superRefine(validateSealResponse);
|
|
42
|
+
export const BillingEnforcementCohortStatusResponseSchema = z
|
|
43
|
+
.strictObject({
|
|
44
|
+
schemaVersion: z.literal(BILLING_ENFORCEMENT_PROFILE_SCHEMA_VERSION),
|
|
45
|
+
cohortKind: z.literal(BILLING_ENFORCEMENT_COHORT_KIND),
|
|
46
|
+
state: z.enum(['unsealed', 'sealed']),
|
|
47
|
+
sealId: z.union([scalarSchema('sealId', 128), z.null()]),
|
|
48
|
+
sealedAt: z.union([z.iso.datetime({ offset: true }), z.null()]),
|
|
49
|
+
legacyAccountProfile: z.literal(LEGACY_INTERNAL_ENFORCEMENT_PROFILE),
|
|
50
|
+
postSealAccountProfile: z.literal(POST_SEAL_ENFORCEMENT_PROFILE),
|
|
51
|
+
billingAccountCount: z.number().int().nonnegative(),
|
|
52
|
+
profiledAccountCount: z.number().int().nonnegative(),
|
|
53
|
+
legacyInternalExemptAccountCount: z.number().int().nonnegative(),
|
|
54
|
+
enforcedAccountCount: z.number().int().nonnegative(),
|
|
55
|
+
unprofiledAccountCount: z.number().int().nonnegative(),
|
|
56
|
+
billingAttributionComplete: z.boolean(),
|
|
57
|
+
attributionBlockerCount: z.number().int().nonnegative(),
|
|
58
|
+
})
|
|
59
|
+
.superRefine((response, context) => {
|
|
60
|
+
const hasSealIdentity = response.sealedAt !== null && response.sealId !== null;
|
|
61
|
+
const hasNoSealIdentity = response.sealedAt === null && response.sealId === null;
|
|
62
|
+
if ((response.state === 'sealed' && !hasSealIdentity) ||
|
|
63
|
+
(response.state === 'unsealed' && !hasNoSealIdentity)) {
|
|
64
|
+
context.addIssue({
|
|
65
|
+
code: 'custom',
|
|
66
|
+
path: ['sealedAt'],
|
|
67
|
+
message: 'sealId and sealedAt must be present exactly when the cohort is sealed',
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
validateAggregateCounts(response, context);
|
|
71
|
+
if (response.billingAttributionComplete !== (response.attributionBlockerCount === 0)) {
|
|
72
|
+
context.addIssue({
|
|
73
|
+
code: 'custom',
|
|
74
|
+
path: ['billingAttributionComplete'],
|
|
75
|
+
message: 'billingAttributionComplete must match attributionBlockerCount',
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
export class BillingEnforcementCohortConflictError extends Error {
|
|
80
|
+
code;
|
|
81
|
+
constructor(code, message) {
|
|
82
|
+
super(message);
|
|
83
|
+
this.name = 'BillingEnforcementCohortConflictError';
|
|
84
|
+
this.code = code;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
export function parseBillingEnforcementCohortSealRequest(value) {
|
|
88
|
+
const result = BillingEnforcementCohortSealRequestSchema.safeParse(value);
|
|
89
|
+
if (!result.success) {
|
|
90
|
+
throw new Error(`invalid billing enforcement cohort seal: ${z.prettifyError(result.error)}`);
|
|
91
|
+
}
|
|
92
|
+
return result.data;
|
|
93
|
+
}
|
|
94
|
+
export function billingEnforcementCohortRequestFingerprint(input) {
|
|
95
|
+
return billingContentChecksum({
|
|
96
|
+
schemaVersion: input.request.schemaVersion,
|
|
97
|
+
action: input.action,
|
|
98
|
+
request: input.request,
|
|
99
|
+
actor: { subject: input.actor.subject, email: input.actor.email },
|
|
100
|
+
service: normalizeBillingEnforcementServiceUrl(input.service),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
export function billingEnforcementCohortSuccessAudit(response, actor) {
|
|
104
|
+
return {
|
|
105
|
+
eventType: 'billing.enforcement.cohort.sealed',
|
|
106
|
+
org: 'platform',
|
|
107
|
+
actorSubject: actor.subject,
|
|
108
|
+
actorEmail: actor.email,
|
|
109
|
+
decision: 'allow',
|
|
110
|
+
status: response.replayed ? 200 : 201,
|
|
111
|
+
details: {
|
|
112
|
+
cohortKind: response.cohortKind,
|
|
113
|
+
state: response.state,
|
|
114
|
+
replayed: response.replayed,
|
|
115
|
+
sealId: response.sealId,
|
|
116
|
+
billingAccountCount: response.billingAccountCount,
|
|
117
|
+
profiledAccountCount: response.profiledAccountCount,
|
|
118
|
+
legacyInternalExemptAccountCount: response.legacyInternalExemptAccountCount,
|
|
119
|
+
enforcedAccountCount: response.enforcedAccountCount,
|
|
120
|
+
unprofiledAccountCount: response.unprofiledAccountCount,
|
|
121
|
+
billingAttributionComplete: response.billingAttributionComplete,
|
|
122
|
+
attributionBlockerCount: response.attributionBlockerCount,
|
|
123
|
+
legacyAccountProfile: response.legacyAccountProfile,
|
|
124
|
+
postSealAccountProfile: response.postSealAccountProfile,
|
|
125
|
+
activationState: response.activationState,
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
export function normalizeBillingEnforcementServiceUrl(value) {
|
|
130
|
+
const parsed = new URL(value);
|
|
131
|
+
if ((parsed.protocol !== 'https:' && parsed.protocol !== 'http:') ||
|
|
132
|
+
parsed.username !== '' ||
|
|
133
|
+
parsed.password !== '' ||
|
|
134
|
+
parsed.pathname !== '/' ||
|
|
135
|
+
parsed.search !== '' ||
|
|
136
|
+
parsed.hash !== '') {
|
|
137
|
+
throw new Error('billing enforcement service must be an HTTP(S) origin');
|
|
138
|
+
}
|
|
139
|
+
return parsed.origin;
|
|
140
|
+
}
|
|
141
|
+
function hasControlCharacters(value) {
|
|
142
|
+
return [...value].some((character) => {
|
|
143
|
+
const code = character.charCodeAt(0);
|
|
144
|
+
return code <= 0x1f || code === 0x7f;
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
function validateAggregateCounts(response, context) {
|
|
148
|
+
if (response.billingAccountCount !==
|
|
149
|
+
response.legacyInternalExemptAccountCount +
|
|
150
|
+
response.enforcedAccountCount +
|
|
151
|
+
response.unprofiledAccountCount) {
|
|
152
|
+
context.addIssue({
|
|
153
|
+
code: 'custom',
|
|
154
|
+
path: ['billingAccountCount'],
|
|
155
|
+
message: 'billingAccountCount must equal the enforcement profile classification counts',
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
if (response.profiledAccountCount !==
|
|
159
|
+
response.legacyInternalExemptAccountCount + response.enforcedAccountCount) {
|
|
160
|
+
context.addIssue({
|
|
161
|
+
code: 'custom',
|
|
162
|
+
path: ['profiledAccountCount'],
|
|
163
|
+
message: 'profiledAccountCount must equal the active enforcement profile counts',
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function validateSealResponse(response, context) {
|
|
168
|
+
validateAggregateCounts(response, context);
|
|
169
|
+
if (response.unprofiledAccountCount !== 0) {
|
|
170
|
+
context.addIssue({
|
|
171
|
+
code: 'custom',
|
|
172
|
+
path: ['unprofiledAccountCount'],
|
|
173
|
+
message: 'a sealed cohort cannot contain an unprofiled billing account',
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
if (response.profiledAccountCount !== response.billingAccountCount) {
|
|
177
|
+
context.addIssue({
|
|
178
|
+
code: 'custom',
|
|
179
|
+
path: ['profiledAccountCount'],
|
|
180
|
+
message: 'every billing account must be profiled when the cohort is sealed',
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
if (response.legacyInternalExemptAccountCount !== response.billingAccountCount) {
|
|
184
|
+
context.addIssue({
|
|
185
|
+
code: 'custom',
|
|
186
|
+
path: ['legacyInternalExemptAccountCount'],
|
|
187
|
+
message: 'every account in the sealed launch cohort must be legacy internal exempt',
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
if (response.enforcedAccountCount !== 0) {
|
|
191
|
+
context.addIssue({
|
|
192
|
+
code: 'custom',
|
|
193
|
+
path: ['enforcedAccountCount'],
|
|
194
|
+
message: 'the immutable seal result cannot contain a post-seal enforced account',
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
//# sourceMappingURL=enforcement-profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enforcement-profile.js","sourceRoot":"","sources":["../../src/billing/enforcement-profile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEpD,MAAM,CAAC,MAAM,0CAA0C,GAAG,CAAC,CAAC;AAC5D,MAAM,CAAC,MAAM,+BAA+B,GAAG,oBAA6B,CAAC;AAC7E,MAAM,CAAC,MAAM,mCAAmC,GAAG,wBAAiC,CAAC;AACrF,MAAM,CAAC,MAAM,6BAA6B,GAAG,UAAmB,CAAC;AAQjE,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,EAAE,CAClD,CAAC;KACE,MAAM,EAAE;KACR,IAAI,EAAE;KACN,GAAG,CAAC,CAAC,EAAE,GAAG,KAA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AC;YAChC,OAAO,EAAE,8DAA8D;SACxE,CAAC,CAAC;IACL,CAAC;IACD,IAAI,QAAQ,CAAC,oBAAoB,KAAK,QAAQ,CAAC,mBAAmB,EAAE,CAAC;QACnE,OAAO,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,sBAAsB,CAAC;YAC9B,OAAO,EAAE,kEAAkE;SAC5E,CAAC,CAAC;IACL,CAAC;IACD,IAAI,QAAQ,CAAC,gCAAgC,KAAK,QAAQ,CAAC,mBAAmB,EAAE,CAAC;QAC/E,OAAO,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,kCAAkC,CAAC;YAC1C,OAAO,EAAE,0EAA0E;SACpF,CAAC,CAAC;IACL,CAAC;IACD,IAAI,QAAQ,CAAC,oBAAoB,KAAK,CAAC,EAAE,CAAC;QACxC,OAAO,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,sBAAsB,CAAC;YAC9B,OAAO,EAAE,uEAAuE;SACjF,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type HostedToolDispatchHook, type Logger } from '@noodle-borg/transport-http';
|
|
2
|
+
import type { Pool } from 'pg';
|
|
3
|
+
import type { BillingMeterReadinessStore } from './meter-readiness.js';
|
|
4
|
+
import type { BillingMeterLiveRuntimeExpectation } from './meter-readiness-health.js';
|
|
5
|
+
import type { BillingMeterValidationEpochStore } from './meter-validation-epoch.js';
|
|
6
|
+
import type { BillingMeterValidationEpochPreparePreflight } from './postgres-meter-epochs.js';
|
|
7
|
+
import { type BillingUsageObserver } from './usage-observer.js';
|
|
2
8
|
import type { BillingUsageStore } from './usage-store.js';
|
|
3
9
|
interface BillingUsageIntegration {
|
|
4
10
|
readonly dispatch?: HostedToolDispatchHook;
|
|
@@ -7,7 +13,24 @@ interface BillingUsageIntegration {
|
|
|
7
13
|
readonly clock?: () => Date;
|
|
8
14
|
};
|
|
9
15
|
}
|
|
16
|
+
interface BillingServiceIntegrationOptions {
|
|
17
|
+
readonly billingUsageHmacKey?: string;
|
|
18
|
+
readonly clock?: () => Date;
|
|
19
|
+
readonly logger?: Logger;
|
|
20
|
+
readonly validationRuntime?: BillingMeterLiveRuntimeExpectation;
|
|
21
|
+
}
|
|
10
22
|
/** Keep optional shadow wiring and the matching read projection on one service-owned switch. */
|
|
11
|
-
export declare function billingUsageIntegration(store: BillingUsageStore, hmacKey: string | undefined, clock: (() => Date) | undefined, logger: Logger): BillingUsageIntegration;
|
|
23
|
+
export declare function billingUsageIntegration(store: BillingUsageStore, hmacKey: string | undefined, clock: (() => Date) | undefined, logger: Logger, observerOverride?: BillingUsageObserver): BillingUsageIntegration;
|
|
24
|
+
/** Keep Postgres-only readiness loading out of the lightweight in-memory service path. */
|
|
25
|
+
export declare function createPostgresBillingMeterReadinessStore(pool: Pool, options: BillingServiceIntegrationOptions): Promise<BillingMeterReadinessStore>;
|
|
26
|
+
/** Keep the Postgres-only validation lifecycle out of the lightweight in-memory service path. */
|
|
27
|
+
export declare function createPostgresBillingMeterValidationEpochStore(pool: Pool, options: {
|
|
28
|
+
readonly billingUsageHmacKey?: string;
|
|
29
|
+
readonly releaseSha?: string;
|
|
30
|
+
/** Foundation checks run before writer-session baselines in the same lifecycle transaction. */
|
|
31
|
+
readonly foundationPreflight?: BillingMeterValidationEpochPreparePreflight;
|
|
32
|
+
}): Promise<BillingMeterValidationEpochStore>;
|
|
33
|
+
/** Start optional v1 shadow observation without duplicating its configuration guard in the server. */
|
|
34
|
+
export declare function startConfiguredShadowBillingObservation(store: BillingUsageStore, options: BillingServiceIntegrationOptions): Promise<void>;
|
|
12
35
|
export {};
|
|
13
36
|
//# sourceMappingURL=integration.d.ts.map
|