@oxygen-agent/cli 1.1014.1895 → 1.1014.2040
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 +1 -1
- package/dist/auto-update.d.ts +1 -1
- package/dist/auto-update.js +3 -3
- package/dist/cli-install.d.ts +65 -0
- package/dist/cli-install.js +165 -0
- package/dist/command-families/tables/options.d.ts +1 -0
- package/dist/command-families/tables/register-automation.js +3 -1
- package/dist/commands/billing.js +1 -1
- package/dist/commands/managed-inboxes.js +6 -2
- package/dist/commands/observability.js +4 -4
- package/dist/commands/sequences.js +1 -1
- package/dist/commands/subscriptions.js +7 -5
- package/dist/commands/table-runs.js +10 -0
- package/dist/commands/tags.js +2 -2
- package/dist/commands/workflows.js +31 -10
- package/dist/http-client.d.ts +1 -1
- package/dist/http-client.js +1 -1
- package/dist/update.d.ts +4 -57
- package/dist/update.js +17 -163
- package/node_modules/@oxygen/formula/dist/cross-row-function.d.ts +13 -0
- package/node_modules/@oxygen/formula/dist/cross-row-function.js +1 -0
- package/node_modules/@oxygen/formula/dist/{refactor-internals → cross-row-functions}/novelty-score.d.ts +2 -0
- package/node_modules/@oxygen/formula/dist/{refactor-internals → cross-row-functions}/novelty-score.js +1 -0
- package/node_modules/@oxygen/formula/dist/cross-row-functions.generated.d.ts +3 -0
- package/node_modules/@oxygen/formula/dist/cross-row-functions.generated.js +3 -0
- package/node_modules/@oxygen/formula/dist/evaluate.d.ts +12 -1
- package/node_modules/@oxygen/formula/dist/evaluate.js +28 -3
- package/node_modules/@oxygen/recipe-sdk/dist/index.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/billing.d.ts +5 -1
- package/node_modules/@oxygen/shared/dist/billing.js +5 -1
- package/node_modules/@oxygen/shared/dist/capability-discovery-skill-audiences.generated.d.ts +30 -0
- package/node_modules/@oxygen/shared/dist/capability-discovery-skill-audiences.generated.js +33 -0
- package/node_modules/@oxygen/shared/dist/capability-discovery-skills.d.ts +39 -0
- package/node_modules/@oxygen/shared/dist/capability-discovery-skills.js +86 -0
- package/node_modules/@oxygen/shared/dist/capability-discovery-types.d.ts +93 -0
- package/node_modules/@oxygen/shared/dist/capability-discovery-types.js +1 -0
- package/node_modules/@oxygen/shared/dist/capability-discovery.d.ts +12 -270
- package/node_modules/@oxygen/shared/dist/capability-discovery.js +124 -3713
- package/node_modules/@oxygen/shared/dist/capability-intents/agency-directory.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/agency-directory.rules.js +5 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/agents.d.ts +10 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/agents.js +53 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/agents.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/agents.rules.js +25 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/billing-and-budgets.d.ts +31 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/billing-and-budgets.js +70 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/billing-and-budgets.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/billing-and-budgets.rules.js +85 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/collaboration.d.ts +9 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/collaboration.js +54 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/collaboration.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/collaboration.rules.js +28 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/connected-integrations.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/connected-integrations.rules.js +23 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/connected-linkedin.d.ts +43 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/connected-linkedin.js +90 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/connected-linkedin.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/connected-linkedin.rules.js +58 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/connected-whatsapp.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/connected-whatsapp.rules.js +14 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/geo.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/geo.rules.js +9 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/index.generated.d.ts +365 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/index.generated.js +90 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/knowledge-graph.d.ts +20 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/knowledge-graph.js +37 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/knowledge-graph.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/knowledge-graph.rules.js +43 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/linkedin-public-research.d.ts +4 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/linkedin-public-research.js +26 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/linkedin-public-research.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/linkedin-public-research.rules.js +42 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/messages.d.ts +6 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/messages.js +16 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/messages.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/messages.rules.js +68 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/normalize.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/normalize.js +4 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/platform-operations.d.ts +6 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/platform-operations.js +23 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/platform-operations.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/platform-operations.rules.js +25 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/posts.d.ts +1 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/posts.js +12 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/posts.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/posts.rules.js +20 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/publishing.d.ts +86 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/publishing.js +135 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/publishing.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/publishing.rules.js +89 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/read-inspection.d.ts +7 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/read-inspection.js +85 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/read-inspection.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/read-inspection.rules.js +28 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/recipes.d.ts +7 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/recipes.js +73 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/recipes.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/recipes.rules.js +36 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/records.d.ts +86 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/records.js +240 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/records.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/records.rules.js +71 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sending-infrastructure.d.ts +27 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sending-infrastructure.js +67 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sending-infrastructure.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sending-infrastructure.rules.js +115 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sequences.d.ts +71 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sequences.js +150 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sequences.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sequences.rules.js +149 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/signals.d.ts +42 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/signals.js +42 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/signals.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/signals.rules.js +47 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sourcing-and-provider-tools.d.ts +60 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sourcing-and-provider-tools.js +94 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sourcing-and-provider-tools.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sourcing-and-provider-tools.rules.js +94 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/tables.d.ts +196 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/tables.js +394 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/tables.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/tables.rules.js +384 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/tags.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/tags.rules.js +5 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/visual-rendering.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/visual-rendering.rules.js +8 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/workflows.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/workflows.js +20 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/workflows.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/workflows.rules.js +90 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/workspace-access.d.ts +59 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/workspace-access.js +121 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/workspace-access.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/workspace-access.rules.js +58 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/ads.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/ads.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/agency-directory.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/agency-directory.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/agents.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/agents.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/billing-and-budgets.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/billing-and-budgets.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/collaboration.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/collaboration.js +39 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/connected-integrations.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/connected-integrations.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/connected-linkedin.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/connected-linkedin.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/connected-whatsapp.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/connected-whatsapp.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/dashboards.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/dashboards.js +28 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/discovery-and-skills.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/discovery-and-skills.js +22 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/geo.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/geo.js +13 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/index.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/index.js +64 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/knowledge-graph.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/knowledge-graph.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/linkedin-public-research.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/linkedin-public-research.js +18 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/messages.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/messages.js +21 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/observability.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/observability.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/onboarding-and-copilot.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/onboarding-and-copilot.js +23 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/platform-operations.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/platform-operations.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/posts.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/posts.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/publishing.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/publishing.js +20 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/recipes.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/recipes.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/records.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/records.js +20 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/sending-infrastructure.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/sending-infrastructure.js +42 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/sequences.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/sequences.js +32 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/signals.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/signals.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/sourcing-and-provider-tools.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/sourcing-and-provider-tools.js +21 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/support-and-feedback.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/support-and-feedback.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/tables.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/tables.js +34 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/tags.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/tags.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/visual-rendering.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/visual-rendering.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/workflows.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/workflows.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/workspace-access.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/workspace-access.js +26 -0
- package/node_modules/@oxygen/shared/dist/cell-format.js +2 -2
- package/node_modules/@oxygen/shared/dist/collab.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/contracts/connectors.js +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/customer-operations.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/contracts/geo.js +1 -1
- package/node_modules/@oxygen/shared/dist/contracts/operations/agent-sessions.d.ts +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/agent-sessions.js +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/browser.d.ts +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/browser.js +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/clay-migration.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/clay-migration.js +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/connectors.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/connectors.js +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/geo.d.ts +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/geo.js +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/guided-activation.d.ts +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/guided-activation.js +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/index.generated.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/index.generated.js +26 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/reply-oxygent.d.ts +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/reply-oxygent.js +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/sender-limits.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/sender-limits.js +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/table-feed-update.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/table-feed-update.js +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/teammates.d.ts +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/teammates.js +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/workspace-pages.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/workspace-pages.js +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/workspace-skills.d.ts +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/workspace-skills.js +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations.d.ts +6 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations.js +7 -15
- package/node_modules/@oxygen/shared/dist/contracts/sender-limits.js +1 -0
- package/node_modules/@oxygen/shared/dist/diagnostic-storage-lock.js +33 -22
- package/node_modules/@oxygen/shared/dist/diagnostics.js +11 -8
- package/node_modules/@oxygen/shared/dist/dnc-identities.js +1 -1
- package/node_modules/@oxygen/shared/dist/error-redaction.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/error-redaction.js +2 -2
- package/node_modules/@oxygen/shared/dist/esp-contract.d.ts +133 -0
- package/node_modules/@oxygen/shared/dist/esp-contract.js +121 -0
- package/node_modules/@oxygen/shared/dist/first-month-offer-window.d.ts +3 -0
- package/node_modules/@oxygen/shared/dist/first-month-offer.d.ts +15 -7
- package/node_modules/@oxygen/shared/dist/first-month-offer.js +23 -9
- package/node_modules/@oxygen/shared/dist/{geo.js → geo/geo.js} +2 -2
- package/node_modules/@oxygen/shared/dist/guided-activation.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/index.d.ts +6 -5
- package/node_modules/@oxygen/shared/dist/index.js +7 -5
- package/node_modules/@oxygen/shared/dist/knowledge-bootstrap.js +1 -1
- package/node_modules/@oxygen/shared/dist/linkedin-connection-identity.js +1 -1
- package/node_modules/@oxygen/shared/dist/listed-website-platforms.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/listed-website-platforms.js +23 -1
- package/node_modules/@oxygen/shared/dist/{sending-domain-rollout.js → mailboxes/sending-domain-rollout.js} +1 -1
- package/node_modules/@oxygen/shared/dist/mcp-event-contract.js +1 -1
- package/node_modules/@oxygen/shared/dist/onboarding-leads.d.ts +67 -0
- package/node_modules/@oxygen/shared/dist/onboarding-leads.js +78 -0
- package/node_modules/@oxygen/shared/dist/otlp-log-sink.js +20 -0
- package/node_modules/@oxygen/shared/dist/plan-capabilities.js +1 -1
- package/node_modules/@oxygen/shared/dist/plan-limits.d.ts +2 -2
- package/node_modules/@oxygen/shared/dist/plan-limits.js +6 -7
- package/node_modules/@oxygen/shared/dist/{social-post-metrics-core.d.ts → posts/metrics-core.d.ts} +1 -1
- package/node_modules/@oxygen/shared/dist/{social-post-metrics-linkedin.d.ts → posts/metrics-linkedin.d.ts} +1 -1
- package/node_modules/@oxygen/shared/dist/{social-post-metrics-linkedin.js → posts/metrics-linkedin.js} +2 -2
- package/node_modules/@oxygen/shared/dist/{social-post-metrics-series.d.ts → posts/metrics-series.d.ts} +1 -1
- package/node_modules/@oxygen/shared/dist/{social-post-metrics-series.js → posts/metrics-series.js} +1 -1
- package/node_modules/@oxygen/shared/dist/{social-post-metrics-x.d.ts → posts/metrics-x.d.ts} +1 -1
- package/node_modules/@oxygen/shared/dist/{social-post-metrics-x.js → posts/metrics-x.js} +2 -2
- package/node_modules/@oxygen/shared/dist/{social-post-metrics.d.ts → posts/metrics.d.ts} +3 -3
- package/node_modules/@oxygen/shared/dist/{social-post-metrics.js → posts/metrics.js} +3 -3
- package/node_modules/@oxygen/shared/dist/recipient-provider.d.ts +2 -10
- package/node_modules/@oxygen/shared/dist/recipient-provider.js +1 -9
- package/node_modules/@oxygen/shared/dist/sending-domain-faults.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/sending-domain-faults.js +1 -1
- package/node_modules/@oxygen/shared/dist/sequence-internals/esp-policy.d.ts +2 -118
- package/node_modules/@oxygen/shared/dist/sequence-internals/esp-policy.js +2 -107
- package/node_modules/@oxygen/shared/dist/sequences.d.ts +0 -1
- package/node_modules/@oxygen/shared/dist/sequences.js +0 -2
- package/node_modules/@oxygen/shared/dist/{native-chat-discovery.d.ts → support/native-chat-discovery.d.ts} +1 -1
- package/node_modules/@oxygen/shared/dist/{native-chat-discovery.js → support/native-chat-discovery.js} +1 -1
- package/node_modules/@oxygen/shared/dist/suppression-entries.js +1 -1
- package/node_modules/@oxygen/shared/dist/table-field-types.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/table-field-types.js +2 -2
- package/node_modules/@oxygen/shared/dist/{column-output-fields.js → tables/column-output-fields.js} +4 -4
- package/node_modules/@oxygen/shared/dist/{tags.d.ts → tags/tags.d.ts} +1 -1
- package/node_modules/@oxygen/shared/dist/{tags.js → tags/tags.js} +1 -1
- package/node_modules/@oxygen/shared/dist/tenant-migration-names.d.ts +5 -0
- package/node_modules/@oxygen/shared/dist/tenant-migration-names.js +8 -0
- package/node_modules/@oxygen/shared/dist/ugc-amplification-identity.js +1 -1
- package/node_modules/@oxygen/shared/dist/version.generated.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/version.generated.js +1 -1
- package/node_modules/@oxygen/shared/dist/workspace-placement-bulk.d.ts +6 -0
- package/node_modules/@oxygen/shared/dist/workspace-placement-bulk.js +9 -2
- package/node_modules/@oxygen/shared/dist/workspace-placement-schedule.d.ts +44 -0
- package/node_modules/@oxygen/shared/dist/workspace-placement-schedule.js +90 -0
- package/node_modules/@oxygen/shared/dist/workspace-placement-view.d.ts +24 -0
- package/node_modules/@oxygen/shared/dist/workspace-placement-view.js +5 -4
- package/node_modules/@oxygen/shared/dist/workspace-placement.d.ts +4 -0
- package/node_modules/@oxygen/shared/dist/workspace-placement.js +7 -1
- package/node_modules/@oxygen/shared/package.json +0 -25
- package/node_modules/@oxygen/workflows/dist/cron.d.ts +42 -0
- package/node_modules/@oxygen/workflows/dist/cron.js +271 -0
- package/node_modules/@oxygen/workflows/dist/event-dispatch.d.ts +2 -1
- package/node_modules/@oxygen/workflows/dist/graph/condition.d.ts +3 -0
- package/node_modules/@oxygen/workflows/dist/graph/condition.js +19 -0
- package/node_modules/@oxygen/workflows/dist/graph/expression.d.ts +1 -2
- package/node_modules/@oxygen/workflows/dist/graph/expression.js +2 -19
- package/node_modules/@oxygen/workflows/dist/graph/lint.d.ts +1 -1
- package/node_modules/@oxygen/workflows/dist/graph/lint.js +4 -3
- package/node_modules/@oxygen/workflows/dist/graph/types.d.ts +4 -3
- package/node_modules/@oxygen/workflows/dist/index.d.ts +9 -1043
- package/node_modules/@oxygen/workflows/dist/index.js +11 -2124
- package/node_modules/@oxygen/workflows/dist/manifest-builders.d.ts +73 -0
- package/node_modules/@oxygen/workflows/dist/manifest-builders.js +102 -0
- package/node_modules/@oxygen/workflows/dist/manifest-guards.d.ts +16 -0
- package/node_modules/@oxygen/workflows/dist/manifest-guards.js +34 -0
- package/node_modules/@oxygen/workflows/dist/manifest-hash.d.ts +47 -0
- package/node_modules/@oxygen/workflows/dist/manifest-hash.js +102 -0
- package/node_modules/@oxygen/workflows/dist/manifest-lint.d.ts +17 -0
- package/node_modules/@oxygen/workflows/dist/manifest-lint.js +474 -0
- package/node_modules/@oxygen/workflows/dist/manifest-types.d.ts +256 -0
- package/node_modules/@oxygen/workflows/dist/manifest-types.js +9 -0
- package/node_modules/@oxygen/workflows/dist/manifest-validation.d.ts +75 -0
- package/node_modules/@oxygen/workflows/dist/manifest-validation.js +903 -0
- package/node_modules/@oxygen/workflows/dist/pure-function.d.ts +17 -0
- package/node_modules/@oxygen/workflows/dist/pure-function.js +130 -0
- package/node_modules/@oxygen/workflows/dist/refactor-internals/condition-comparison.d.ts +1 -17
- package/node_modules/@oxygen/workflows/dist/refactor-internals/condition-comparison.js +1 -93
- package/node_modules/@oxygen/workflows/dist/refactor-internals/condition-pattern.d.ts +16 -0
- package/node_modules/@oxygen/workflows/dist/refactor-internals/condition-pattern.js +92 -0
- package/node_modules/@oxygen/workflows/dist/workflow-schemas.d.ts +545 -0
- package/node_modules/@oxygen/workflows/dist/workflow-schemas.js +135 -0
- package/node_modules/@oxygen/workflows/package.json +4 -0
- package/package.json +1 -1
- /package/node_modules/@oxygen/shared/dist/{geo.d.ts → geo/geo.d.ts} +0 -0
- /package/node_modules/@oxygen/shared/dist/{sending-domain-rollout.d.ts → mailboxes/sending-domain-rollout.d.ts} +0 -0
- /package/node_modules/@oxygen/shared/dist/{attempt-provenance.d.ts → observability/attempt-provenance.d.ts} +0 -0
- /package/node_modules/@oxygen/shared/dist/{attempt-provenance.js → observability/attempt-provenance.js} +0 -0
- /package/node_modules/@oxygen/shared/dist/{linkedin-mentions.d.ts → posts/linkedin-mentions.d.ts} +0 -0
- /package/node_modules/@oxygen/shared/dist/{linkedin-mentions.js → posts/linkedin-mentions.js} +0 -0
- /package/node_modules/@oxygen/shared/dist/{linkedin-post-keywords.d.ts → posts/linkedin-post-keywords.d.ts} +0 -0
- /package/node_modules/@oxygen/shared/dist/{linkedin-post-keywords.js → posts/linkedin-post-keywords.js} +0 -0
- /package/node_modules/@oxygen/shared/dist/{linkedin-post-url.d.ts → posts/linkedin-post-url.d.ts} +0 -0
- /package/node_modules/@oxygen/shared/dist/{linkedin-post-url.js → posts/linkedin-post-url.js} +0 -0
- /package/node_modules/@oxygen/shared/dist/{social-post-metrics-core.js → posts/metrics-core.js} +0 -0
- /package/node_modules/@oxygen/shared/dist/{native-chat.d.ts → support/native-chat.d.ts} +0 -0
- /package/node_modules/@oxygen/shared/dist/{native-chat.js → support/native-chat.js} +0 -0
- /package/node_modules/@oxygen/shared/dist/{plain-support-events.d.ts → support/plain-support-events.d.ts} +0 -0
- /package/node_modules/@oxygen/shared/dist/{plain-support-events.js → support/plain-support-events.js} +0 -0
- /package/node_modules/@oxygen/shared/dist/{column-output-fields.d.ts → tables/column-output-fields.d.ts} +0 -0
- /package/node_modules/@oxygen/shared/dist/{linkedin-url.d.ts → tables/linkedin-url.d.ts} +0 -0
- /package/node_modules/@oxygen/shared/dist/{linkedin-url.js → tables/linkedin-url.js} +0 -0
- /package/node_modules/@oxygen/shared/dist/{select-options.d.ts → tables/select-options.d.ts} +0 -0
- /package/node_modules/@oxygen/shared/dist/{select-options.js → tables/select-options.js} +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The v1 pure-function sandbox: runs caller-provided transform code in `node:vm` with a timeout and a JSON-only result.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The ceiling of the legacy synchronous `node:vm` path below. It stays at 10 s
|
|
6
|
+
* (and its callers pass 1 s) when the typed Code node rose to 30 s (repricing
|
|
7
|
+
* 2026-09, decision L4.3; proposal P-49): this path runs on the worker's own
|
|
8
|
+
* event loop, so a long synchronous script would stall every other job and its
|
|
9
|
+
* queue lock renewal. The typed Code node runs in a separate microVM instead.
|
|
10
|
+
*/
|
|
11
|
+
export declare const PURE_WORKFLOW_FUNCTION_MAX_TIMEOUT_MS = 10000;
|
|
12
|
+
export declare function runPureWorkflowFunction(input: {
|
|
13
|
+
source: string;
|
|
14
|
+
context: Record<string, unknown>;
|
|
15
|
+
timeoutMs?: number;
|
|
16
|
+
maxOutputBytes?: number;
|
|
17
|
+
}): Promise<unknown>;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { WORKFLOW_CODE_V1_DEFAULT_OUTPUT_BYTES, WORKFLOW_CODE_V1_DEFAULT_TIMEOUT_MS, WORKFLOW_CODE_V1_MAX_OUTPUT_BYTES, WORKFLOW_CODE_V1_MIN_OUTPUT_BYTES, WORKFLOW_CODE_V1_MIN_TIMEOUT_MS } from "./graph/types.js";
|
|
2
|
+
import { validatePureFunctionSource } from "./manifest-validation.js";
|
|
3
|
+
import * as vm from "node:vm";
|
|
4
|
+
/**
|
|
5
|
+
* The v1 pure-function sandbox: runs caller-provided transform code in `node:vm` with a timeout and a JSON-only result.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* The ceiling of the legacy synchronous `node:vm` path below. It stays at 10 s
|
|
9
|
+
* (and its callers pass 1 s) when the typed Code node rose to 30 s (repricing
|
|
10
|
+
* 2026-09, decision L4.3; proposal P-49): this path runs on the worker's own
|
|
11
|
+
* event loop, so a long synchronous script would stall every other job and its
|
|
12
|
+
* queue lock renewal. The typed Code node runs in a separate microVM instead.
|
|
13
|
+
*/
|
|
14
|
+
export const PURE_WORKFLOW_FUNCTION_MAX_TIMEOUT_MS = 10_000;
|
|
15
|
+
export async function runPureWorkflowFunction(input) {
|
|
16
|
+
const timeoutMs = Math.max(WORKFLOW_CODE_V1_MIN_TIMEOUT_MS, Math.min(input.timeoutMs ?? WORKFLOW_CODE_V1_DEFAULT_TIMEOUT_MS, PURE_WORKFLOW_FUNCTION_MAX_TIMEOUT_MS));
|
|
17
|
+
const maxOutputBytes = Math.max(WORKFLOW_CODE_V1_MIN_OUTPUT_BYTES, Math.min(input.maxOutputBytes ?? WORKFLOW_CODE_V1_DEFAULT_OUTPUT_BYTES, WORKFLOW_CODE_V1_MAX_OUTPUT_BYTES));
|
|
18
|
+
const issues = [];
|
|
19
|
+
validatePureFunctionSource(input.source, "$.source", (path, code, message) => {
|
|
20
|
+
issues.push({ path, code, message });
|
|
21
|
+
});
|
|
22
|
+
if (issues.length > 0) {
|
|
23
|
+
const first = issues[0];
|
|
24
|
+
throw new Error(first ? `${first.code}: ${first.message}` : "Invalid workflow function source.");
|
|
25
|
+
}
|
|
26
|
+
// Cross the host/sandbox boundary as a JSON string, then parse INSIDE the
|
|
27
|
+
// vm context. If we passed the host object directly its prototype chain
|
|
28
|
+
// would point at the host's Object/Function, and the regex token blacklist
|
|
29
|
+
// is trivially bypassed (e.g. "con"+"structor") to reach
|
|
30
|
+
// __oxygen_context.constructor.constructor === host Function — which is
|
|
31
|
+
// not affected by the new context's codeGeneration setting and yields
|
|
32
|
+
// worker-process RCE. Parsing inside the context rebinds the prototype to
|
|
33
|
+
// the sandboxed Object, so the same walk reaches the sandboxed Function,
|
|
34
|
+
// which then trips contextCodeGeneration.strings=false below.
|
|
35
|
+
const context = toJsonValue(input.context, "context");
|
|
36
|
+
const contextJson = JSON.stringify(context);
|
|
37
|
+
const sandbox = Object.create(null);
|
|
38
|
+
sandbox.__oxygen_context_json = contextJson;
|
|
39
|
+
// Shadow dangerous globals on the sandbox surface. Defense-in-depth: the
|
|
40
|
+
// load-bearing block is contextCodeGeneration; this just removes the
|
|
41
|
+
// obvious top-level handles.
|
|
42
|
+
sandbox.Function = undefined;
|
|
43
|
+
sandbox.eval = undefined;
|
|
44
|
+
sandbox.setTimeout = undefined;
|
|
45
|
+
sandbox.setInterval = undefined;
|
|
46
|
+
sandbox.setImmediate = undefined;
|
|
47
|
+
sandbox.queueMicrotask = undefined;
|
|
48
|
+
sandbox.WebAssembly = undefined;
|
|
49
|
+
const script = new vm.Script('"use strict";\n'
|
|
50
|
+
+ 'const __oxygen_context = JSON.parse(__oxygen_context_json);\n'
|
|
51
|
+
+ `const __oxygen_fn = (${input.source});\n`
|
|
52
|
+
+ '__oxygen_fn(__oxygen_context);');
|
|
53
|
+
// Disable dynamic code generation in the sandboxed context. Combined with
|
|
54
|
+
// the JSON re-parse above, this means every prototype-walk path to
|
|
55
|
+
// Function — direct, via context.constructor.constructor, or any other
|
|
56
|
+
// reachable Function instance — throws EvalError when called with source.
|
|
57
|
+
try {
|
|
58
|
+
const result = script.runInNewContext(sandbox, {
|
|
59
|
+
timeout: timeoutMs,
|
|
60
|
+
contextCodeGeneration: {
|
|
61
|
+
strings: false,
|
|
62
|
+
wasm: false,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
const resolved = isPromiseLike(result)
|
|
66
|
+
? await withTimeout(result, timeoutMs)
|
|
67
|
+
: result;
|
|
68
|
+
return enforceJsonOutput(resolved, maxOutputBytes);
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
throw normalizeSandboxThrow(error);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// A throw from inside the vm sandbox is constructed with the sandbox realm's
|
|
75
|
+
// Error, so `error instanceof Error` is false in the host worker — and
|
|
76
|
+
// serializeOxygenError then drops the message and reports a generic
|
|
77
|
+
// "Workflow run failed.", leaving a failing transform/branch undebuggable.
|
|
78
|
+
// Reconstruct a host-realm Error preserving the user's message/name. Host-realm
|
|
79
|
+
// throws (vm timeout, enforceJsonOutput's workflow_output_too_large) already
|
|
80
|
+
// pass instanceof and are returned unchanged.
|
|
81
|
+
function normalizeSandboxThrow(error) {
|
|
82
|
+
if (error instanceof Error)
|
|
83
|
+
return error;
|
|
84
|
+
if (error && typeof error === "object") {
|
|
85
|
+
const record = error;
|
|
86
|
+
const message = typeof record.message === "string" && record.message
|
|
87
|
+
? record.message
|
|
88
|
+
: "Workflow function threw.";
|
|
89
|
+
const normalized = new Error(message);
|
|
90
|
+
if (typeof record.name === "string" && record.name)
|
|
91
|
+
normalized.name = record.name;
|
|
92
|
+
return normalized;
|
|
93
|
+
}
|
|
94
|
+
return new Error(typeof error === "string" && error ? error : "Workflow function threw a non-error value.");
|
|
95
|
+
}
|
|
96
|
+
function enforceJsonOutput(value, maxOutputBytes) {
|
|
97
|
+
const json = JSON.stringify(value);
|
|
98
|
+
if (json === undefined)
|
|
99
|
+
return null;
|
|
100
|
+
if (Buffer.byteLength(json) > maxOutputBytes) {
|
|
101
|
+
throw new Error("workflow_output_too_large: Workflow function output is too large.");
|
|
102
|
+
}
|
|
103
|
+
return JSON.parse(json);
|
|
104
|
+
}
|
|
105
|
+
function toJsonValue(value, label) {
|
|
106
|
+
const json = JSON.stringify(value);
|
|
107
|
+
if (json === undefined) {
|
|
108
|
+
throw new Error(`${label} must be JSON serializable.`);
|
|
109
|
+
}
|
|
110
|
+
return JSON.parse(json);
|
|
111
|
+
}
|
|
112
|
+
function isPromiseLike(value) {
|
|
113
|
+
return value !== null && typeof value === "object" && "then" in value
|
|
114
|
+
&& typeof value.then === "function";
|
|
115
|
+
}
|
|
116
|
+
async function withTimeout(promise, timeoutMs) {
|
|
117
|
+
let timer = null;
|
|
118
|
+
try {
|
|
119
|
+
return await Promise.race([
|
|
120
|
+
promise,
|
|
121
|
+
new Promise((_, reject) => {
|
|
122
|
+
timer = setTimeout(() => reject(new Error("workflow_function_timeout: Workflow function timed out.")), timeoutMs);
|
|
123
|
+
}),
|
|
124
|
+
]);
|
|
125
|
+
}
|
|
126
|
+
finally {
|
|
127
|
+
if (timer)
|
|
128
|
+
clearTimeout(timer);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import type { WorkflowCompareOp } from "../graph/types.js";
|
|
2
2
|
export declare function compareWorkflowConditionValues(left: unknown, op: WorkflowCompareOp, right: unknown): boolean;
|
|
3
|
-
/**
|
|
4
|
-
* Compile a `matches` pattern, or return null when it is unsafe or invalid.
|
|
5
|
-
*
|
|
6
|
-
* Choice: conservative STATIC REJECTION rather than a linear (Thompson NFA)
|
|
7
|
-
* matcher. A linear engine would be several hundred lines of new, security-load-
|
|
8
|
-
* bearing code in a module the browser also bundles, whereas the patterns real
|
|
9
|
-
* GTM authors write (domain suffixes, job-title keywords, ID formats) never need
|
|
10
|
-
* the constructs rejected here. Rejected: sources over 200 characters,
|
|
11
|
-
* lookaround, backreferences, and a quantified group whose body itself contains
|
|
12
|
-
* an unbounded quantifier — the `(a+)+` family that drives catastrophic
|
|
13
|
-
* backtracking. Everything else compiles as a normal RegExp.
|
|
14
|
-
*
|
|
15
|
-
* The linter calls this at authoring time and reports `invalid_condition`, so a
|
|
16
|
-
* rejected pattern is a lint error the author sees, not a silent run-time false.
|
|
17
|
-
*/
|
|
18
|
-
export declare function compileConditionPattern(pattern: string): RegExp | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { compileConditionPattern } from "./condition-pattern.js";
|
|
1
2
|
export function compareWorkflowConditionValues(left, op, right) {
|
|
2
3
|
switch (op) {
|
|
3
4
|
case "eq":
|
|
@@ -119,99 +120,6 @@ function textOf(value) {
|
|
|
119
120
|
return "";
|
|
120
121
|
}
|
|
121
122
|
}
|
|
122
|
-
// ---------------------------------------------------------------------------
|
|
123
|
-
// `matches`
|
|
124
|
-
// ---------------------------------------------------------------------------
|
|
125
|
-
const MAX_CONDITION_PATTERN_LENGTH = 200;
|
|
126
|
-
/**
|
|
127
|
-
* Compile a `matches` pattern, or return null when it is unsafe or invalid.
|
|
128
|
-
*
|
|
129
|
-
* Choice: conservative STATIC REJECTION rather than a linear (Thompson NFA)
|
|
130
|
-
* matcher. A linear engine would be several hundred lines of new, security-load-
|
|
131
|
-
* bearing code in a module the browser also bundles, whereas the patterns real
|
|
132
|
-
* GTM authors write (domain suffixes, job-title keywords, ID formats) never need
|
|
133
|
-
* the constructs rejected here. Rejected: sources over 200 characters,
|
|
134
|
-
* lookaround, backreferences, and a quantified group whose body itself contains
|
|
135
|
-
* an unbounded quantifier — the `(a+)+` family that drives catastrophic
|
|
136
|
-
* backtracking. Everything else compiles as a normal RegExp.
|
|
137
|
-
*
|
|
138
|
-
* The linter calls this at authoring time and reports `invalid_condition`, so a
|
|
139
|
-
* rejected pattern is a lint error the author sees, not a silent run-time false.
|
|
140
|
-
*/
|
|
141
|
-
export function compileConditionPattern(pattern) {
|
|
142
|
-
if (!isSafeRegExpSource(pattern))
|
|
143
|
-
return null;
|
|
144
|
-
try {
|
|
145
|
-
return new RegExp(pattern);
|
|
146
|
-
}
|
|
147
|
-
catch {
|
|
148
|
-
return null;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
function isSafeRegExpSource(source) {
|
|
152
|
-
if (!source || source.length > MAX_CONDITION_PATTERN_LENGTH)
|
|
153
|
-
return false;
|
|
154
|
-
if (/\(\?<?[=!]/.test(source))
|
|
155
|
-
return false; // lookahead / lookbehind
|
|
156
|
-
if (/\\[1-9]/.test(source))
|
|
157
|
-
return false; // backreference
|
|
158
|
-
return !hasNestedQuantifier(source);
|
|
159
|
-
}
|
|
160
|
-
function isUnboundedQuantifier(char) {
|
|
161
|
-
// `?` alone is bounded and cannot blow up; `*`, `+` and `{n,m}` can.
|
|
162
|
-
return char === "*" || char === "+" || char === "{";
|
|
163
|
-
}
|
|
164
|
-
function hasNestedQuantifier(source) {
|
|
165
|
-
// One frame per open group, plus a base frame for the top level. A frame is
|
|
166
|
-
// "quantified" once anything inside it repeats.
|
|
167
|
-
const stack = [{ quantified: false }];
|
|
168
|
-
let inCharacterClass = false;
|
|
169
|
-
let index = 0;
|
|
170
|
-
while (index < source.length) {
|
|
171
|
-
const char = source[index] ?? "";
|
|
172
|
-
if (char === "\\") {
|
|
173
|
-
index += 2;
|
|
174
|
-
continue;
|
|
175
|
-
}
|
|
176
|
-
if (inCharacterClass) {
|
|
177
|
-
if (char === "]")
|
|
178
|
-
inCharacterClass = false;
|
|
179
|
-
index += 1;
|
|
180
|
-
continue;
|
|
181
|
-
}
|
|
182
|
-
if (char === "[") {
|
|
183
|
-
inCharacterClass = true;
|
|
184
|
-
index += 1;
|
|
185
|
-
continue;
|
|
186
|
-
}
|
|
187
|
-
if (char === "(") {
|
|
188
|
-
stack.push({ quantified: false });
|
|
189
|
-
index += 1;
|
|
190
|
-
continue;
|
|
191
|
-
}
|
|
192
|
-
if (char === ")") {
|
|
193
|
-
index += 1;
|
|
194
|
-
// Unbalanced ")" — leave it to RegExp construction to reject.
|
|
195
|
-
if (stack.length === 1)
|
|
196
|
-
continue;
|
|
197
|
-
const frame = stack.pop();
|
|
198
|
-
const repeated = isUnboundedQuantifier(source[index] ?? "");
|
|
199
|
-
if (repeated && frame?.quantified === true)
|
|
200
|
-
return true;
|
|
201
|
-
const parent = stack[stack.length - 1];
|
|
202
|
-
if (parent && (repeated || frame?.quantified === true))
|
|
203
|
-
parent.quantified = true;
|
|
204
|
-
continue;
|
|
205
|
-
}
|
|
206
|
-
if (isUnboundedQuantifier(char)) {
|
|
207
|
-
const top = stack[stack.length - 1];
|
|
208
|
-
if (top)
|
|
209
|
-
top.quantified = true;
|
|
210
|
-
}
|
|
211
|
-
index += 1;
|
|
212
|
-
}
|
|
213
|
-
return false;
|
|
214
|
-
}
|
|
215
123
|
function matchesPattern(value, pattern) {
|
|
216
124
|
if (typeof pattern !== "string")
|
|
217
125
|
return false;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compile a `matches` pattern, or return null when it is unsafe or invalid.
|
|
3
|
+
*
|
|
4
|
+
* Choice: conservative STATIC REJECTION rather than a linear (Thompson NFA)
|
|
5
|
+
* matcher. A linear engine would be several hundred lines of new, security-load-
|
|
6
|
+
* bearing code in a module the browser also bundles, whereas the patterns real
|
|
7
|
+
* GTM authors write (domain suffixes, job-title keywords, ID formats) never need
|
|
8
|
+
* the constructs rejected here. Rejected: sources over 200 characters,
|
|
9
|
+
* lookaround, backreferences, and a quantified group whose body itself contains
|
|
10
|
+
* an unbounded quantifier — the `(a+)+` family that drives catastrophic
|
|
11
|
+
* backtracking. Everything else compiles as a normal RegExp.
|
|
12
|
+
*
|
|
13
|
+
* The linter calls this at authoring time and reports `invalid_condition`, so a
|
|
14
|
+
* rejected pattern is a lint error the author sees, not a silent run-time false.
|
|
15
|
+
*/
|
|
16
|
+
export declare function compileConditionPattern(pattern: string): RegExp | null;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// Safe `matches` pattern compilation, shared by run-time condition comparison
|
|
2
|
+
// and the linter. Browser-safe, with no imports.
|
|
3
|
+
const MAX_CONDITION_PATTERN_LENGTH = 200;
|
|
4
|
+
/**
|
|
5
|
+
* Compile a `matches` pattern, or return null when it is unsafe or invalid.
|
|
6
|
+
*
|
|
7
|
+
* Choice: conservative STATIC REJECTION rather than a linear (Thompson NFA)
|
|
8
|
+
* matcher. A linear engine would be several hundred lines of new, security-load-
|
|
9
|
+
* bearing code in a module the browser also bundles, whereas the patterns real
|
|
10
|
+
* GTM authors write (domain suffixes, job-title keywords, ID formats) never need
|
|
11
|
+
* the constructs rejected here. Rejected: sources over 200 characters,
|
|
12
|
+
* lookaround, backreferences, and a quantified group whose body itself contains
|
|
13
|
+
* an unbounded quantifier — the `(a+)+` family that drives catastrophic
|
|
14
|
+
* backtracking. Everything else compiles as a normal RegExp.
|
|
15
|
+
*
|
|
16
|
+
* The linter calls this at authoring time and reports `invalid_condition`, so a
|
|
17
|
+
* rejected pattern is a lint error the author sees, not a silent run-time false.
|
|
18
|
+
*/
|
|
19
|
+
export function compileConditionPattern(pattern) {
|
|
20
|
+
if (!isSafeRegExpSource(pattern))
|
|
21
|
+
return null;
|
|
22
|
+
try {
|
|
23
|
+
return new RegExp(pattern);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function isSafeRegExpSource(source) {
|
|
30
|
+
if (!source || source.length > MAX_CONDITION_PATTERN_LENGTH)
|
|
31
|
+
return false;
|
|
32
|
+
if (/\(\?<?[=!]/.test(source))
|
|
33
|
+
return false; // lookahead / lookbehind
|
|
34
|
+
if (/\\[1-9]/.test(source))
|
|
35
|
+
return false; // backreference
|
|
36
|
+
return !hasNestedQuantifier(source);
|
|
37
|
+
}
|
|
38
|
+
function isUnboundedQuantifier(char) {
|
|
39
|
+
// `?` alone is bounded and cannot blow up; `*`, `+` and `{n,m}` can.
|
|
40
|
+
return char === "*" || char === "+" || char === "{";
|
|
41
|
+
}
|
|
42
|
+
function hasNestedQuantifier(source) {
|
|
43
|
+
// One frame per open group, plus a base frame for the top level. A frame is
|
|
44
|
+
// "quantified" once anything inside it repeats.
|
|
45
|
+
const stack = [{ quantified: false }];
|
|
46
|
+
let inCharacterClass = false;
|
|
47
|
+
let index = 0;
|
|
48
|
+
while (index < source.length) {
|
|
49
|
+
const char = source[index] ?? "";
|
|
50
|
+
if (char === "\\") {
|
|
51
|
+
index += 2;
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
if (inCharacterClass) {
|
|
55
|
+
if (char === "]")
|
|
56
|
+
inCharacterClass = false;
|
|
57
|
+
index += 1;
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if (char === "[") {
|
|
61
|
+
inCharacterClass = true;
|
|
62
|
+
index += 1;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
if (char === "(") {
|
|
66
|
+
stack.push({ quantified: false });
|
|
67
|
+
index += 1;
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (char === ")") {
|
|
71
|
+
index += 1;
|
|
72
|
+
// Unbalanced ")" — leave it to RegExp construction to reject.
|
|
73
|
+
if (stack.length === 1)
|
|
74
|
+
continue;
|
|
75
|
+
const frame = stack.pop();
|
|
76
|
+
const repeated = isUnboundedQuantifier(source[index] ?? "");
|
|
77
|
+
if (repeated && frame?.quantified === true)
|
|
78
|
+
return true;
|
|
79
|
+
const parent = stack[stack.length - 1];
|
|
80
|
+
if (parent && (repeated || frame?.quantified === true))
|
|
81
|
+
parent.quantified = true;
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
if (isUnboundedQuantifier(char)) {
|
|
85
|
+
const top = stack[stack.length - 1];
|
|
86
|
+
if (top)
|
|
87
|
+
top.quantified = true;
|
|
88
|
+
}
|
|
89
|
+
index += 1;
|
|
90
|
+
}
|
|
91
|
+
return false;
|
|
92
|
+
}
|