@segmentstream/ontology 0.0.0-stage → 0.92.1
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/LICENSE +201 -0
- package/NOTICE +2 -0
- package/README.md +1655 -2
- package/dist/action.d.ts +193 -0
- package/dist/action.js +41 -0
- package/dist/agent-chat.d.ts +44 -0
- package/dist/agent-chat.js +91 -0
- package/dist/agent-task-contract.d.ts +64 -0
- package/dist/agent-task-contract.js +15 -0
- package/dist/agent-task.d.ts +39 -0
- package/dist/agent-task.js +112 -0
- package/dist/analyze.d.ts +215 -0
- package/dist/analyze.js +2438 -0
- package/dist/app-feedback.d.ts +167 -0
- package/dist/app-feedback.js +176 -0
- package/dist/authoring-input.d.ts +3 -0
- package/dist/authoring-input.js +107 -0
- package/dist/authoring-names.d.ts +4 -0
- package/dist/authoring-names.js +13 -0
- package/dist/authoring-records.d.ts +35 -0
- package/dist/authoring-records.js +264 -0
- package/dist/authoring.d.ts +15 -0
- package/dist/authoring.js +331 -0
- package/dist/bin/check.d.ts +30 -0
- package/dist/bin/check.js +99 -0
- package/dist/bin/load.d.ts +48 -0
- package/dist/bin/load.js +139 -0
- package/dist/bin/main.d.ts +31 -0
- package/dist/bin/main.js +121 -0
- package/dist/bin/migrate.d.ts +57 -0
- package/dist/bin/migrate.js +170 -0
- package/dist/bin/output.d.ts +31 -0
- package/dist/bin/output.js +84 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +31 -0
- package/dist/blob.d.ts +52 -0
- package/dist/blob.js +87 -0
- package/dist/channel-session.d.ts +16 -0
- package/dist/channel-session.js +16 -0
- package/dist/chat.d.ts +43 -0
- package/dist/chat.js +34 -0
- package/dist/confirmation.d.ts +46 -0
- package/dist/confirmation.js +41 -0
- package/dist/connection.d.ts +213 -0
- package/dist/connection.js +289 -0
- package/dist/deployment.d.ts +35 -0
- package/dist/deployment.js +76 -0
- package/dist/diagnostics.d.ts +27 -0
- package/dist/diagnostics.js +106 -0
- package/dist/emails.d.ts +70 -0
- package/dist/emails.js +221 -0
- package/dist/entity.d.ts +331 -0
- package/dist/entity.js +153 -0
- package/dist/errors.d.ts +154 -0
- package/dist/errors.js +109 -0
- package/dist/feedback-config.d.ts +24 -0
- package/dist/feedback-config.js +126 -0
- package/dist/files.d.ts +39 -0
- package/dist/files.js +4 -0
- package/dist/groups.d.ts +95 -0
- package/dist/groups.js +280 -0
- package/dist/index.d.ts +109 -0
- package/dist/index.js +70 -0
- package/dist/internal/diagnostics.js +594 -0
- package/dist/legacy.d.ts +160 -0
- package/dist/legacy.js +270 -0
- package/dist/manifest-compatibility.d.ts +8 -0
- package/dist/manifest-compatibility.js +87 -0
- package/dist/manifest.d.ts +3329 -0
- package/dist/manifest.js +757 -0
- package/dist/me.d.ts +46 -0
- package/dist/me.js +109 -0
- package/dist/metric-filters.d.ts +48 -0
- package/dist/metric-filters.js +252 -0
- package/dist/metric-routes.d.ts +132 -0
- package/dist/metric-routes.js +498 -0
- package/dist/metric.d.ts +172 -0
- package/dist/metric.js +132 -0
- package/dist/migrate/apply.d.ts +94 -0
- package/dist/migrate/apply.js +526 -0
- package/dist/migrate/errors.d.ts +46 -0
- package/dist/migrate/errors.js +38 -0
- package/dist/migrate/index.d.ts +10 -0
- package/dist/migrate/index.js +7 -0
- package/dist/migrate/model.d.ts +2311 -0
- package/dist/migrate/model.js +148 -0
- package/dist/migrate/plan.d.ts +51 -0
- package/dist/migrate/plan.js +1856 -0
- package/dist/migrate/preview.d.ts +13 -0
- package/dist/migrate/preview.js +65 -0
- package/dist/migrate/storage.d.ts +226 -0
- package/dist/migrate/storage.js +774 -0
- package/dist/model-metrics.d.ts +22 -0
- package/dist/model-metrics.js +545 -0
- package/dist/names.d.ts +49 -0
- package/dist/names.js +110 -0
- package/dist/navigation-artifact.d.ts +13 -0
- package/dist/navigation-artifact.js +11 -0
- package/dist/navigation-catalog.d.ts +55 -0
- package/dist/navigation-catalog.js +297 -0
- package/dist/nitro-navigation.d.ts +3 -0
- package/dist/nitro-navigation.js +64 -0
- package/dist/nitro-workflows.d.ts +108 -0
- package/dist/nitro-workflows.js +286 -0
- package/dist/nitro.d.ts +40 -0
- package/dist/nitro.js +50 -0
- package/dist/ontology.d.ts +41 -0
- package/dist/ontology.js +46 -0
- package/dist/permissions.d.ts +198 -0
- package/dist/permissions.js +272 -0
- package/dist/property.d.ts +188 -0
- package/dist/property.js +301 -0
- package/dist/query.d.ts +245 -0
- package/dist/query.js +615 -0
- package/dist/relationship.d.ts +99 -0
- package/dist/relationship.js +33 -0
- package/dist/render.d.ts +81 -0
- package/dist/render.js +512 -0
- package/dist/replication/baseline.d.ts +51 -0
- package/dist/replication/baseline.js +215 -0
- package/dist/replication/bigquery.d.ts +37 -0
- package/dist/replication/bigquery.js +211 -0
- package/dist/replication/coverage.d.ts +14 -0
- package/dist/replication/coverage.js +53 -0
- package/dist/replication/evolution.d.ts +25 -0
- package/dist/replication/evolution.js +184 -0
- package/dist/replication/identities.d.ts +6 -0
- package/dist/replication/identities.js +47 -0
- package/dist/replication/legacy-baseline.d.ts +27 -0
- package/dist/replication/legacy-baseline.js +109 -0
- package/dist/replication/legacy-store.d.ts +19 -0
- package/dist/replication/legacy-store.js +63 -0
- package/dist/replication/lineage.d.ts +36 -0
- package/dist/replication/lineage.js +72 -0
- package/dist/replication/migrate.d.ts +21 -0
- package/dist/replication/migrate.js +84 -0
- package/dist/replication/model.d.ts +52 -0
- package/dist/replication/model.js +99 -0
- package/dist/replication/scans.d.ts +34 -0
- package/dist/replication/scans.js +158 -0
- package/dist/replication/schema.d.ts +11 -0
- package/dist/replication/schema.js +226 -0
- package/dist/replication/shadow-schema.d.ts +4 -0
- package/dist/replication/shadow-schema.js +61 -0
- package/dist/replication/shadow.d.ts +127 -0
- package/dist/replication/shadow.js +614 -0
- package/dist/replication/source-replacement.d.ts +33 -0
- package/dist/replication/source-replacement.js +76 -0
- package/dist/replication/store.d.ts +36 -0
- package/dist/replication/store.js +382 -0
- package/dist/replication/transaction.d.ts +23 -0
- package/dist/replication/transaction.js +88 -0
- package/dist/role.d.ts +61 -0
- package/dist/role.js +76 -0
- package/dist/runtime/action-deadlocks.d.ts +21 -0
- package/dist/runtime/action-deadlocks.js +130 -0
- package/dist/runtime/action-transactions.d.ts +35 -0
- package/dist/runtime/action-transactions.js +54 -0
- package/dist/runtime/agent-counters.d.ts +26 -0
- package/dist/runtime/agent-counters.js +98 -0
- package/dist/runtime/agent-tasks.d.ts +63 -0
- package/dist/runtime/agent-tasks.js +120 -0
- package/dist/runtime/agents.d.ts +15 -0
- package/dist/runtime/agents.js +457 -0
- package/dist/runtime/batch-diagnostics.d.ts +22 -0
- package/dist/runtime/batch-diagnostics.js +89 -0
- package/dist/runtime/batch.d.ts +52 -0
- package/dist/runtime/batch.js +534 -0
- package/dist/runtime/channel-session-revocation.d.ts +3 -0
- package/dist/runtime/channel-session-revocation.js +5 -0
- package/dist/runtime/channel-sessions.d.ts +4 -0
- package/dist/runtime/channel-sessions.js +61 -0
- package/dist/runtime/confirmations.d.ts +29 -0
- package/dist/runtime/confirmations.js +57 -0
- package/dist/runtime/cursor.d.ts +23 -0
- package/dist/runtime/cursor.js +100 -0
- package/dist/runtime/deployment.d.ts +7 -0
- package/dist/runtime/deployment.js +4 -0
- package/dist/runtime/errors.d.ts +118 -0
- package/dist/runtime/errors.js +109 -0
- package/dist/runtime/federation-tables.d.ts +2 -0
- package/dist/runtime/federation-tables.js +20 -0
- package/dist/runtime/federation.d.ts +42 -0
- package/dist/runtime/federation.js +222 -0
- package/dist/runtime/files.d.ts +39 -0
- package/dist/runtime/files.js +44 -0
- package/dist/runtime/generated-actions.d.ts +37 -0
- package/dist/runtime/generated-actions.js +307 -0
- package/dist/runtime/history.d.ts +91 -0
- package/dist/runtime/history.js +77 -0
- package/dist/runtime/ids.d.ts +6 -0
- package/dist/runtime/ids.js +39 -0
- package/dist/runtime/member-tables.d.ts +8 -0
- package/dist/runtime/member-tables.js +33 -0
- package/dist/runtime/member-writes.d.ts +78 -0
- package/dist/runtime/member-writes.js +202 -0
- package/dist/runtime/metric-query.d.ts +19 -0
- package/dist/runtime/metric-query.js +411 -0
- package/dist/runtime/model.d.ts +67 -0
- package/dist/runtime/model.js +150 -0
- package/dist/runtime/new-user-hook.d.ts +6 -0
- package/dist/runtime/new-user-hook.js +37 -0
- package/dist/runtime/oauth.d.ts +9 -0
- package/dist/runtime/oauth.js +299 -0
- package/dist/runtime/pipeline.d.ts +155 -0
- package/dist/runtime/pipeline.js +597 -0
- package/dist/runtime/postgres-tls.d.ts +10 -0
- package/dist/runtime/postgres-tls.js +14 -0
- package/dist/runtime/principals.d.ts +302 -0
- package/dist/runtime/principals.js +1307 -0
- package/dist/runtime/reads.d.ts +55 -0
- package/dist/runtime/reads.js +313 -0
- package/dist/runtime/records.d.ts +42 -0
- package/dist/runtime/records.js +245 -0
- package/dist/runtime/resolve-agent-identity.d.ts +6 -0
- package/dist/runtime/resolve-agent-identity.js +181 -0
- package/dist/runtime/service-binding.d.ts +18 -0
- package/dist/runtime/service-binding.js +266 -0
- package/dist/runtime/sign-in-links.d.ts +68 -0
- package/dist/runtime/sign-in-links.js +147 -0
- package/dist/runtime/sql-runtime.d.ts +131 -0
- package/dist/runtime/sql-runtime.js +362 -0
- package/dist/runtime/statement.d.ts +18 -0
- package/dist/runtime/statement.js +31 -0
- package/dist/runtime/user-identities.d.ts +66 -0
- package/dist/runtime/user-identities.js +106 -0
- package/dist/runtime/user-identity-sql.d.ts +86 -0
- package/dist/runtime/user-identity-sql.js +297 -0
- package/dist/runtime/user-roles.d.ts +16 -0
- package/dist/runtime/user-roles.js +32 -0
- package/dist/runtime/validation.d.ts +16 -0
- package/dist/runtime/validation.js +26 -0
- package/dist/runtime/where.d.ts +57 -0
- package/dist/runtime/where.js +404 -0
- package/dist/runtime/workflow-admission.d.ts +49 -0
- package/dist/runtime/workflow-admission.js +92 -0
- package/dist/runtime/workflow-argument-codec.d.ts +10 -0
- package/dist/runtime/workflow-argument-codec.js +120 -0
- package/dist/runtime/workflow-arguments.d.ts +17 -0
- package/dist/runtime/workflow-arguments.js +99 -0
- package/dist/runtime/workflow-starts.d.ts +203 -0
- package/dist/runtime/workflow-starts.js +493 -0
- package/dist/runtime/workflow-users.d.ts +9 -0
- package/dist/runtime/workflow-users.js +17 -0
- package/dist/runtime/workload.d.ts +25 -0
- package/dist/runtime/workload.js +24 -0
- package/dist/runtime/writes.d.ts +108 -0
- package/dist/runtime/writes.js +491 -0
- package/dist/runtime-source.d.ts +22 -0
- package/dist/runtime-source.js +28 -0
- package/dist/runtime.d.ts +310 -0
- package/dist/runtime.js +31 -0
- package/dist/server.d.ts +23 -0
- package/dist/server.js +107 -0
- package/dist/service/agent/attachments.d.ts +33 -0
- package/dist/service/agent/attachments.js +228 -0
- package/dist/service/agent/authentication.d.ts +22 -0
- package/dist/service/agent/authentication.js +58 -0
- package/dist/service/agent/confirmations.d.ts +5 -0
- package/dist/service/agent/confirmations.js +73 -0
- package/dist/service/agent/conversation-routes.d.ts +14 -0
- package/dist/service/agent/conversation-routes.js +45 -0
- package/dist/service/agent/conversations.d.ts +40 -0
- package/dist/service/agent/conversations.js +69 -0
- package/dist/service/agent/files.d.ts +12 -0
- package/dist/service/agent/files.js +69 -0
- package/dist/service/agent/protocol.d.ts +90 -0
- package/dist/service/agent/protocol.js +114 -0
- package/dist/service/agent/server.d.ts +28 -0
- package/dist/service/agent/server.js +374 -0
- package/dist/service/agent/task-caller.d.ts +21 -0
- package/dist/service/agent/task-caller.js +35 -0
- package/dist/service/agent/task-start.d.ts +53 -0
- package/dist/service/agent/task-start.js +161 -0
- package/dist/service/agent/tasks.d.ts +40 -0
- package/dist/service/agent/tasks.js +155 -0
- package/dist/service/api.d.ts +50 -0
- package/dist/service/api.js +288 -0
- package/dist/service/authentication.d.ts +227 -0
- package/dist/service/authentication.js +767 -0
- package/dist/service/caller-context.d.ts +24 -0
- package/dist/service/caller-context.js +6 -0
- package/dist/service/catalog.d.ts +42 -0
- package/dist/service/catalog.js +66 -0
- package/dist/service/channel/provider.d.ts +10 -0
- package/dist/service/channel/provider.js +1 -0
- package/dist/service/channel/providers/telegram.d.ts +18 -0
- package/dist/service/channel/providers/telegram.js +108 -0
- package/dist/service/channel/sessions.d.ts +5 -0
- package/dist/service/channel/sessions.js +53 -0
- package/dist/service/channel/sign-in.d.ts +7 -0
- package/dist/service/channel/sign-in.js +78 -0
- package/dist/service/chat/archive.d.ts +64 -0
- package/dist/service/chat/archive.js +62 -0
- package/dist/service/chat/attribution.d.ts +26 -0
- package/dist/service/chat/attribution.js +28 -0
- package/dist/service/chat/delivery.d.ts +18 -0
- package/dist/service/chat/delivery.js +251 -0
- package/dist/service/chat/diagnostics.d.ts +2 -0
- package/dist/service/chat/diagnostics.js +35 -0
- package/dist/service/chat/envelope.d.ts +96 -0
- package/dist/service/chat/envelope.js +39 -0
- package/dist/service/chat/idempotency.d.ts +19 -0
- package/dist/service/chat/idempotency.js +37 -0
- package/dist/service/chat/providers/telegram.d.ts +36 -0
- package/dist/service/chat/providers/telegram.js +133 -0
- package/dist/service/chat/reads.d.ts +25 -0
- package/dist/service/chat/reads.js +75 -0
- package/dist/service/chat/resolve.d.ts +34 -0
- package/dist/service/chat/resolve.js +150 -0
- package/dist/service/chat/routes.d.ts +23 -0
- package/dist/service/chat/routes.js +75 -0
- package/dist/service/chat/schemas.d.ts +43 -0
- package/dist/service/chat/schemas.js +31 -0
- package/dist/service/config.d.ts +218 -0
- package/dist/service/config.js +265 -0
- package/dist/service/connection-stream.d.ts +10 -0
- package/dist/service/connection-stream.js +191 -0
- package/dist/service/connections.d.ts +60 -0
- package/dist/service/connections.js +271 -0
- package/dist/service/decisions.d.ts +35 -0
- package/dist/service/decisions.js +63 -0
- package/dist/service/descriptions.d.ts +8 -0
- package/dist/service/descriptions.js +20 -0
- package/dist/service/discovery-schemas.d.ts +92 -0
- package/dist/service/discovery-schemas.js +59 -0
- package/dist/service/discovery-search.d.ts +30 -0
- package/dist/service/discovery-search.js +95 -0
- package/dist/service/discovery.d.ts +37 -0
- package/dist/service/discovery.js +436 -0
- package/dist/service/docs.d.ts +9 -0
- package/dist/service/docs.js +197 -0
- package/dist/service/errors.d.ts +145 -0
- package/dist/service/errors.js +704 -0
- package/dist/service/federation-provider.d.ts +36 -0
- package/dist/service/federation-provider.js +110 -0
- package/dist/service/federation-server.d.ts +20 -0
- package/dist/service/federation-server.js +249 -0
- package/dist/service/federation-status.d.ts +40 -0
- package/dist/service/federation-status.js +151 -0
- package/dist/service/handlers.d.ts +18 -0
- package/dist/service/handlers.js +287 -0
- package/dist/service/mcp/confirmation.d.ts +68 -0
- package/dist/service/mcp/confirmation.js +178 -0
- package/dist/service/mcp/find-input.d.ts +12 -0
- package/dist/service/mcp/find-input.js +122 -0
- package/dist/service/mcp/input-schema.d.ts +6 -0
- package/dist/service/mcp/input-schema.js +126 -0
- package/dist/service/mcp/listing.d.ts +26 -0
- package/dist/service/mcp/listing.js +92 -0
- package/dist/service/mcp/metric-tools.d.ts +85 -0
- package/dist/service/mcp/metric-tools.js +258 -0
- package/dist/service/mcp/request-log.d.ts +5 -0
- package/dist/service/mcp/request-log.js +53 -0
- package/dist/service/mcp/runtime-policy.d.ts +27 -0
- package/dist/service/mcp/runtime-policy.js +62 -0
- package/dist/service/mcp/server.d.ts +52 -0
- package/dist/service/mcp/server.js +861 -0
- package/dist/service/mcp/tools.d.ts +99 -0
- package/dist/service/mcp/tools.js +938 -0
- package/dist/service/member-file-routes.d.ts +22 -0
- package/dist/service/member-file-routes.js +52 -0
- package/dist/service/member-files.d.ts +245 -0
- package/dist/service/member-files.js +258 -0
- package/dist/service/metric-query-platform.d.ts +77 -0
- package/dist/service/metric-query-platform.js +198 -0
- package/dist/service/metric-query-scopes.d.ts +43 -0
- package/dist/service/metric-query-scopes.js +147 -0
- package/dist/service/metric-query.d.ts +48 -0
- package/dist/service/metric-query.js +200 -0
- package/dist/service/name-suggestions.d.ts +3 -0
- package/dist/service/name-suggestions.js +38 -0
- package/dist/service/navigation-schemas.d.ts +80 -0
- package/dist/service/navigation-schemas.js +49 -0
- package/dist/service/navigation.d.ts +20 -0
- package/dist/service/navigation.js +165 -0
- package/dist/service/oauth/protocol.d.ts +70 -0
- package/dist/service/oauth/protocol.js +157 -0
- package/dist/service/oauth/refresh-replay.d.ts +2 -0
- package/dist/service/oauth/refresh-replay.js +20 -0
- package/dist/service/oauth/server.d.ts +28 -0
- package/dist/service/oauth/server.js +769 -0
- package/dist/service/operations.d.ts +170 -0
- package/dist/service/operations.js +392 -0
- package/dist/service/plan.d.ts +57 -0
- package/dist/service/plan.js +96 -0
- package/dist/service/rate-limit.d.ts +22 -0
- package/dist/service/rate-limit.js +52 -0
- package/dist/service/record-reads.d.ts +21 -0
- package/dist/service/record-reads.js +155 -0
- package/dist/service/replication.d.ts +5 -0
- package/dist/service/replication.js +39 -0
- package/dist/service/runtime-contract.d.ts +508 -0
- package/dist/service/runtime-contract.js +18 -0
- package/dist/service/runtime-identity.d.ts +71 -0
- package/dist/service/runtime-identity.js +122 -0
- package/dist/service/schemas.d.ts +961 -0
- package/dist/service/schemas.js +639 -0
- package/dist/service/service.d.ts +21 -0
- package/dist/service/service.js +526 -0
- package/dist/service/warehouse-platform.d.ts +17 -0
- package/dist/service/warehouse-platform.js +122 -0
- package/dist/service/warehouse-query.d.ts +24 -0
- package/dist/service/warehouse-query.js +280 -0
- package/dist/service/webhooks.d.ts +106 -0
- package/dist/service/webhooks.js +233 -0
- package/dist/service/workflow-admission-provider.d.ts +31 -0
- package/dist/service/workflow-admission-provider.js +205 -0
- package/dist/service/workflow-argument-serialization.d.ts +2 -0
- package/dist/service/workflow-argument-serialization.js +14 -0
- package/dist/service/workflow-callback.d.ts +22 -0
- package/dist/service/workflow-callback.js +75 -0
- package/dist/service/workflow-deployment.d.ts +8 -0
- package/dist/service/workflow-deployment.js +131 -0
- package/dist/service/workflow-diagnostics.d.ts +23 -0
- package/dist/service/workflow-diagnostics.js +263 -0
- package/dist/service/workflow-errors.d.ts +26 -0
- package/dist/service/workflow-errors.js +181 -0
- package/dist/service/workflow-logging.d.ts +2 -0
- package/dist/service/workflow-logging.js +50 -0
- package/dist/service/workflow-queue-fence.d.ts +6 -0
- package/dist/service/workflow-queue-fence.js +66 -0
- package/dist/service/workflows.d.ts +200 -0
- package/dist/service/workflows.js +1549 -0
- package/dist/sign-in.d.ts +58 -0
- package/dist/sign-in.js +57 -0
- package/dist/source.d.ts +30 -0
- package/dist/source.js +107 -0
- package/dist/start-recovery-contract.d.ts +49 -0
- package/dist/start-recovery-contract.js +26 -0
- package/dist/start-recovery.d.ts +27 -0
- package/dist/start-recovery.js +81 -0
- package/dist/storage/api.d.ts +4 -0
- package/dist/storage/api.js +40 -0
- package/dist/storage/attachments.d.ts +146 -0
- package/dist/storage/attachments.js +733 -0
- package/dist/storage/authorization.d.ts +38 -0
- package/dist/storage/authorization.js +83 -0
- package/dist/storage/file-access.d.ts +17 -0
- package/dist/storage/file-access.js +8 -0
- package/dist/storage/limits.d.ts +12 -0
- package/dist/storage/limits.js +17 -0
- package/dist/storage/maintenance-auth.d.ts +20 -0
- package/dist/storage/maintenance-auth.js +24 -0
- package/dist/storage/maintenance.d.ts +11 -0
- package/dist/storage/maintenance.js +67 -0
- package/dist/storage/neon.d.ts +4 -0
- package/dist/storage/neon.js +318 -0
- package/dist/storage/operator.d.ts +11 -0
- package/dist/storage/operator.js +30 -0
- package/dist/storage/provider.d.ts +93 -0
- package/dist/storage/provider.js +36 -0
- package/dist/storage/sessions.d.ts +184 -0
- package/dist/storage/sessions.js +688 -0
- package/dist/storage/tables.d.ts +54 -0
- package/dist/storage/tables.js +205 -0
- package/dist/storage/transfers.d.ts +16 -0
- package/dist/storage/transfers.js +153 -0
- package/dist/storage/writes.d.ts +7 -0
- package/dist/storage/writes.js +88 -0
- package/dist/telegram.d.ts +35 -0
- package/dist/telegram.js +173 -0
- package/dist/user-identity.d.ts +28 -0
- package/dist/user-identity.js +106 -0
- package/dist/user.d.ts +75 -0
- package/dist/user.js +111 -0
- package/dist/warehouse-backed.d.ts +6 -0
- package/dist/warehouse-backed.js +495 -0
- package/dist/webhook-token.d.ts +11 -0
- package/dist/webhook-token.js +18 -0
- package/dist/webhooks.d.ts +40 -0
- package/dist/webhooks.js +55 -0
- package/dist/wire.d.ts +10 -0
- package/dist/wire.js +35 -0
- package/dist/workflow-runtime.d.ts +116 -0
- package/dist/workflow-runtime.js +109 -0
- package/dist/workflow-topics.d.ts +28 -0
- package/dist/workflow-topics.js +28 -0
- package/dist/workflow.d.ts +284 -0
- package/dist/workflow.js +259 -0
- package/dist/workflows.d.ts +24 -0
- package/dist/workflows.js +18 -0
- package/package.json +127 -4
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { AnyEntity } from "./entity.js";
|
|
2
|
+
export declare const RelationshipTypeId: unique symbol;
|
|
3
|
+
export declare const ON_DELETE: readonly ["setNull", "cascade", "restrict"];
|
|
4
|
+
/** What happens to the declaring record when the record it points at is deleted. */
|
|
5
|
+
export type OnDelete = (typeof ON_DELETE)[number];
|
|
6
|
+
/**
|
|
7
|
+
* `() => Entity`, for entities in files that import each other. It is typed as `Function` on purpose:
|
|
8
|
+
* a call signature would make TypeScript infer the thunk's return type while it infers the type of the
|
|
9
|
+
* entity that declares the relationship, which is circular when the two entities refer to each other.
|
|
10
|
+
* `defineOntology` checks that the thunk returns an entity.
|
|
11
|
+
*/
|
|
12
|
+
export type LazyEntity = Function;
|
|
13
|
+
/** Where a relationship points: an entity, a thunk returning one, or an entity name. */
|
|
14
|
+
export type EntityTarget = AnyEntity | LazyEntity | string;
|
|
15
|
+
/**
|
|
16
|
+
* The name of the entity a target points at, as far as its type shows: the given name, or the
|
|
17
|
+
* entity's name. A thunk is a `Function`, whose `name` is any string, so its target stays unknown.
|
|
18
|
+
*/
|
|
19
|
+
type TargetName<Target> = Target extends string ? Target : Target extends {
|
|
20
|
+
readonly name: infer Name extends string;
|
|
21
|
+
} ? Name : string;
|
|
22
|
+
/** Names a relationship in both directions, for example `["is owned by", "owns"]`. */
|
|
23
|
+
export type Phrase = readonly [forward: string, inverse: string];
|
|
24
|
+
/**
|
|
25
|
+
* A many-to-one relationship. Between stored entities it is declared on the side that holds the key
|
|
26
|
+
* (`owner_id` on `lead`). When either end is warehouse-backed it is value-matched: it declares `on`,
|
|
27
|
+
* one pair of an own property and a target property, and has no key column, delete rule or
|
|
28
|
+
* optionality of its own.
|
|
29
|
+
*/
|
|
30
|
+
export interface OneRelationship<Optional extends boolean = boolean, Matched extends boolean = boolean, Target extends string = string> {
|
|
31
|
+
readonly [RelationshipTypeId]: typeof RelationshipTypeId;
|
|
32
|
+
readonly cardinality: "one";
|
|
33
|
+
readonly on?: Readonly<Record<string, string>>;
|
|
34
|
+
readonly target: EntityTarget;
|
|
35
|
+
readonly optional: Optional;
|
|
36
|
+
readonly inverse: string;
|
|
37
|
+
/** As declared. A stored → stored relationship without one restricts deletes. */
|
|
38
|
+
readonly onDelete?: OnDelete;
|
|
39
|
+
readonly phrase?: Phrase;
|
|
40
|
+
readonly description: string;
|
|
41
|
+
/**
|
|
42
|
+
* Exists only in the type: whether `on` was given, which makes the relationship value-matched.
|
|
43
|
+
* Value-matched relationships add no `<relationship>Id` to records and inputs.
|
|
44
|
+
*/
|
|
45
|
+
readonly "~ontology.matched": Matched;
|
|
46
|
+
/**
|
|
47
|
+
* Exists only in the type: the target entity's name when the target was given as an entity or a
|
|
48
|
+
* name, and `string` for a thunk. Typed metric query clients resolve relationship paths with it.
|
|
49
|
+
*/
|
|
50
|
+
readonly "~ontology.target": Target;
|
|
51
|
+
}
|
|
52
|
+
/** A plain many-to-many relationship, stored in a hidden join table. It never carries properties. */
|
|
53
|
+
export interface ManyRelationship {
|
|
54
|
+
readonly [RelationshipTypeId]: typeof RelationshipTypeId;
|
|
55
|
+
readonly cardinality: "many";
|
|
56
|
+
readonly target: EntityTarget;
|
|
57
|
+
readonly inverse: string;
|
|
58
|
+
readonly phrase?: Phrase;
|
|
59
|
+
readonly description: string;
|
|
60
|
+
readonly ordered: boolean;
|
|
61
|
+
}
|
|
62
|
+
export type AnyRelationship = OneRelationship | ManyRelationship;
|
|
63
|
+
export interface OneOptions {
|
|
64
|
+
/**
|
|
65
|
+
* The property pair a relationship with a warehouse-backed end matches on: `{ ownProperty:
|
|
66
|
+
* targetProperty }`. Required for those relationships and refused between stored entities.
|
|
67
|
+
*/
|
|
68
|
+
readonly on?: Readonly<Record<string, string>>;
|
|
69
|
+
/** The record may point at nothing: the key column is nullable. Stored → stored only. */
|
|
70
|
+
readonly optional?: boolean;
|
|
71
|
+
/** The name of the relationship as seen from the target, for example `ownedLeads` on `user`. */
|
|
72
|
+
readonly inverse: string;
|
|
73
|
+
/** What deleting the target does to this record, `restrict` by default. Stored → stored only. */
|
|
74
|
+
readonly onDelete?: OnDelete;
|
|
75
|
+
readonly phrase?: Phrase;
|
|
76
|
+
readonly description: string;
|
|
77
|
+
}
|
|
78
|
+
export interface ManyOptions {
|
|
79
|
+
readonly inverse: string;
|
|
80
|
+
readonly phrase?: Phrase;
|
|
81
|
+
readonly description: string;
|
|
82
|
+
/** Keep the order in which records were linked. */
|
|
83
|
+
readonly ordered?: boolean;
|
|
84
|
+
}
|
|
85
|
+
type IsOptional<O> = O extends {
|
|
86
|
+
readonly optional: true;
|
|
87
|
+
} ? true : false;
|
|
88
|
+
type IsMatched<O> = O extends {
|
|
89
|
+
readonly on: Readonly<Record<string, string>>;
|
|
90
|
+
} ? true : false;
|
|
91
|
+
declare function one<const Target extends EntityTarget, const O extends OneOptions>(target: Target, options: O): OneRelationship<IsOptional<O>, IsMatched<O>, TargetName<Target>>;
|
|
92
|
+
declare function many(target: EntityTarget, options: ManyOptions): ManyRelationship;
|
|
93
|
+
/** Relationship constructors. */
|
|
94
|
+
export declare const rel: {
|
|
95
|
+
readonly one: typeof one;
|
|
96
|
+
readonly many: typeof many;
|
|
97
|
+
};
|
|
98
|
+
export declare function isRelationship(value: unknown): value is AnyRelationship;
|
|
99
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const RelationshipTypeId = Symbol.for("@segmentstream/ontology/Relationship");
|
|
2
|
+
export const ON_DELETE = ["setNull", "cascade", "restrict"];
|
|
3
|
+
function one(target, options) {
|
|
4
|
+
// `onDelete` stays absent unless declared, so that check can refuse it where it means nothing.
|
|
5
|
+
const relationship = {
|
|
6
|
+
[RelationshipTypeId]: RelationshipTypeId,
|
|
7
|
+
cardinality: "one",
|
|
8
|
+
target,
|
|
9
|
+
optional: options.optional === true,
|
|
10
|
+
inverse: options.inverse,
|
|
11
|
+
...(options.onDelete !== undefined ? { onDelete: options.onDelete } : {}),
|
|
12
|
+
...(options.on !== undefined ? { on: options.on } : {}),
|
|
13
|
+
...(options.phrase !== undefined ? { phrase: options.phrase } : {}),
|
|
14
|
+
description: options.description,
|
|
15
|
+
};
|
|
16
|
+
return relationship;
|
|
17
|
+
}
|
|
18
|
+
function many(target, options) {
|
|
19
|
+
return {
|
|
20
|
+
[RelationshipTypeId]: RelationshipTypeId,
|
|
21
|
+
cardinality: "many",
|
|
22
|
+
target,
|
|
23
|
+
inverse: options.inverse,
|
|
24
|
+
...(options.phrase !== undefined ? { phrase: options.phrase } : {}),
|
|
25
|
+
description: options.description,
|
|
26
|
+
ordered: options.ordered === true,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/** Relationship constructors. */
|
|
30
|
+
export const rel = { one, many };
|
|
31
|
+
export function isRelationship(value) {
|
|
32
|
+
return typeof value === "object" && value !== null && RelationshipTypeId in value;
|
|
33
|
+
}
|
package/dist/render.d.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { ActionManifest, EntityManifest, MetricManifest, ModelMetricManifest, OntologyManifest } from "./manifest.js";
|
|
2
|
+
export interface RenderOptions {
|
|
3
|
+
/**
|
|
4
|
+
* The permissions of the reader. Only the actions these permissions may run are listed, and only
|
|
5
|
+
* the metrics and routes of entities they may read. Without it, every action is listed with the
|
|
6
|
+
* permission it requires and the roles that grant it, and every metric and route.
|
|
7
|
+
*/
|
|
8
|
+
readonly as?: ReadonlyArray<string>;
|
|
9
|
+
}
|
|
10
|
+
/** What an action of the manifest requires; version 1 manifests leave it implicit. */
|
|
11
|
+
export declare function actionPermission(entity: string, action: ActionManifest): string;
|
|
12
|
+
/**
|
|
13
|
+
* A metric's description followed by its conditions and balance note, as `describe`, the MCP
|
|
14
|
+
* metric list and the console show it: `Revenue of won orders. Where status = "won".`
|
|
15
|
+
*/
|
|
16
|
+
export declare function metricDescription(entity: EntityManifest, metric: MetricManifest): string;
|
|
17
|
+
/**
|
|
18
|
+
* Renders the catalog as prose for agents and people: each entity with its properties, both
|
|
19
|
+
* directions of its relationships and its actions, then the roles with their permissions and the
|
|
20
|
+
* `where`, in wire form, of each scoped one. Without a reader, each action and each entity's reads
|
|
21
|
+
* say which permission they require and which roles grant it; with one, only the actions the reader
|
|
22
|
+
* may run are listed. A pure function of the manifest, so the console, the CLI and the service
|
|
23
|
+
* describe the same ontology.
|
|
24
|
+
*/
|
|
25
|
+
export declare function renderCatalog(manifest: OntologyManifest, options?: RenderOptions): string;
|
|
26
|
+
/**
|
|
27
|
+
* The catalog as `describe` answers a reader: {@link renderCatalog} with the reader's permissions,
|
|
28
|
+
* or everything without them.
|
|
29
|
+
*/
|
|
30
|
+
export declare function describeCatalog(manifest: OntologyManifest, permissions?: ReadonlyArray<string>): string;
|
|
31
|
+
/** A metric as metric queries name it: `<entity>.<metric>`. */
|
|
32
|
+
export interface NamedMetric {
|
|
33
|
+
readonly name: string;
|
|
34
|
+
readonly entity: EntityManifest;
|
|
35
|
+
readonly metric: MetricManifest;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* An entity a metric entity reaches, and the shortest routes there the reader may follow:
|
|
39
|
+
* `product.region`. `ambiguous` when the resolver finds several shortest routes, readable or not,
|
|
40
|
+
* so a request must write the route.
|
|
41
|
+
*/
|
|
42
|
+
export interface Reach {
|
|
43
|
+
readonly target: string;
|
|
44
|
+
readonly routes: ReadonlyArray<string>;
|
|
45
|
+
readonly ambiguous: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The rule every surface repeats (docs/ontology-aggregates-spec.md, "Three ways to ask"), naming
|
|
49
|
+
* the tool that computes metrics.
|
|
50
|
+
*/
|
|
51
|
+
export declare const RECORDS_OR_METRIC_QUERIES = "look at or change records through find and actions; count, sum or compare through query_metrics";
|
|
52
|
+
/**
|
|
53
|
+
* Every metric of the entities the reader may read, warehouse-backed and stored alike, in
|
|
54
|
+
* declaration order. Without permissions, every metric.
|
|
55
|
+
*/
|
|
56
|
+
export declare function metricsFor(manifest: OntologyManifest, permissions?: ReadonlyArray<string>): ReadonlyArray<NamedMetric>;
|
|
57
|
+
/**
|
|
58
|
+
* The metrics of the model whose every input entity the reader may read, in declaration order.
|
|
59
|
+
* Reading a model metric is reading its inputs. Without permissions, every one.
|
|
60
|
+
*/
|
|
61
|
+
export declare function modelMetricsFor(manifest: OntologyManifest, permissions?: ReadonlyArray<string>): ReadonlyArray<ModelMetricManifest>;
|
|
62
|
+
/**
|
|
63
|
+
* A metric of the model as `describe`, the MCP tool and the instructions show it: its description,
|
|
64
|
+
* the entity metrics it reads and how their properties align. `Ordered over planned units. Reads
|
|
65
|
+
* sales.ordered and plans.planned_units; sales.order_date aligns with plans.month.`
|
|
66
|
+
*/
|
|
67
|
+
export declare function modelMetricDescription(metric: ModelMetricManifest): string;
|
|
68
|
+
/**
|
|
69
|
+
* The entities one entity reaches, with the shortest routes to each: exactly the routes metric query
|
|
70
|
+
* resolution weighs ({@link shortestRoutesFrom}). Only then is the reader applied: a target they may
|
|
71
|
+
* not read is left out, and so is any route through an entity they may not read, which the service
|
|
72
|
+
* would refuse. A target keeps `ambiguous` from before that filter, so a route is never shown as the
|
|
73
|
+
* only one when the resolver would ask for it to be written.
|
|
74
|
+
*/
|
|
75
|
+
export declare function reachesOf(manifest: OntologyManifest, from: string, permissions?: ReadonlyArray<string>): ReadonlyArray<Reach>;
|
|
76
|
+
/**
|
|
77
|
+
* The metric query part of the catalog's prose: every metric the reader may read, model-wide, the
|
|
78
|
+
* metrics of the model whose every input they may read, and per metric entity the entities it
|
|
79
|
+
* reaches. Empty when the reader may read no metric.
|
|
80
|
+
*/
|
|
81
|
+
export declare function renderMetricQueries(manifest: OntologyManifest, permissions?: ReadonlyArray<string>): string;
|