@substrat-run/control-plane-api 0.148.0 → 0.149.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/api.d.ts +19 -11
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +321 -93
- package/dist/api.js.map +1 -1
- package/dist/attachment-sweep.d.ts +29 -0
- package/dist/attachment-sweep.d.ts.map +1 -0
- package/dist/attachment-sweep.js +66 -0
- package/dist/attachment-sweep.js.map +1 -0
- package/dist/browser.d.ts +3 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +3 -0
- package/dist/browser.js.map +1 -1
- package/dist/cf-observability.d.ts.map +1 -1
- package/dist/cf-observability.js +3 -1
- package/dist/cf-observability.js.map +1 -1
- package/dist/deploy.d.ts +25 -11
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +32 -17
- package/dist/deploy.js.map +1 -1
- package/dist/index.d.ts +9 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/observability.d.ts +28 -0
- package/dist/observability.d.ts.map +1 -1
- package/dist/observability.js +35 -0
- package/dist/observability.js.map +1 -1
- package/dist/platform-entry.generated.d.ts +1 -1
- package/dist/platform-entry.generated.d.ts.map +1 -1
- package/dist/platform-entry.generated.js +2 -2
- package/dist/platform-entry.generated.js.map +1 -1
- package/dist/platform-scope-stores.d.ts +12 -12
- package/dist/platform-scope-stores.d.ts.map +1 -1
- package/dist/platform-scope-stores.js +21 -21
- package/dist/platform-scope-stores.js.map +1 -1
- package/dist/scope-copy-cleanup.d.ts +1 -1
- package/dist/scope-copy-cleanup.d.ts.map +1 -1
- package/dist/scope-copy-cleanup.js.map +1 -1
- package/dist/staff-client.d.ts +10 -2
- package/dist/staff-client.d.ts.map +1 -1
- package/dist/staff-client.js +6 -1
- package/dist/staff-client.js.map +1 -1
- package/dist/store-entry.d.ts +19 -19
- package/dist/store-entry.d.ts.map +1 -1
- package/dist/store-entry.generated.d.ts +16 -16
- package/dist/store-entry.generated.d.ts.map +1 -1
- package/dist/store-entry.generated.js +19 -19
- package/dist/store-entry.generated.js.map +1 -1
- package/dist/store-entry.js +43 -43
- package/dist/store-entry.js.map +1 -1
- package/dist/store-rebuild.d.ts +142 -0
- package/dist/store-rebuild.d.ts.map +1 -0
- package/dist/store-rebuild.js +223 -0
- package/dist/store-rebuild.js.map +1 -0
- package/dist/store-releases.d.ts +60 -49
- package/dist/store-releases.d.ts.map +1 -1
- package/dist/store-releases.js +134 -100
- package/dist/store-releases.js.map +1 -1
- package/dist/store-script.d.ts +37 -19
- package/dist/store-script.d.ts.map +1 -1
- package/dist/store-script.js +38 -23
- package/dist/store-script.js.map +1 -1
- package/dist/vertical-client.d.ts +29 -2
- package/dist/vertical-client.d.ts.map +1 -1
- package/dist/vertical-client.js +48 -2
- package/dist/vertical-client.js.map +1 -1
- package/package.json +6 -6
package/dist/deploy.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ADMISSIBLE_BINDING_TYPES, assertDeclaredScopeStores, PLATFORM_BINDING_PREFIX, scopeStoreScriptName,
|
|
1
|
+
import { ADMISSIBLE_BINDING_TYPES, assertDeclaredScopeStores, PLATFORM_BINDING_PREFIX, scopeStoreScriptName, STORE_DRIVERS, storeNamesOfBindings, substratError, verticalScriptStem, } from '@substrat-run/contracts';
|
|
2
|
+
import { MIGRATIONS_DIGEST_BINDING, migrationSetDigest } from '@substrat-run/kernel';
|
|
2
3
|
/**
|
|
3
4
|
* The deploy seam (self-serve-deploy.md). A `substrat push` uploads a *built* worker
|
|
4
5
|
* bundle; this layer forwards it to the platform's runtime (a Workers-for-Platforms
|
|
@@ -58,30 +59,30 @@ const NAMED_REFUSALS = {
|
|
|
58
59
|
*/
|
|
59
60
|
export { scopeStoreScriptName };
|
|
60
61
|
/**
|
|
61
|
-
* Which store scripts a vertical's stores need (#2210). One script per (
|
|
62
|
-
* by every binding of that
|
|
63
|
-
* a new release of the
|
|
62
|
+
* Which store scripts a vertical's stores need (#2210). One script per (driver, vertical), shared
|
|
63
|
+
* by every binding of that driver, named by {@link scopeStoreScriptName}, which carries no release:
|
|
64
|
+
* a new release of the driver is uploaded into the same name. A driver that is not in `drivers` is
|
|
64
65
|
* refused. The default registry is empty. The upload itself is `createScopeStoreEnsurer`.
|
|
65
66
|
*/
|
|
66
67
|
export function scopeStoreUploadPlan(input) {
|
|
67
|
-
const
|
|
68
|
+
const drivers = input.drivers ?? STORE_DRIVERS;
|
|
68
69
|
const scripts = [];
|
|
69
70
|
const seen = new Set();
|
|
70
71
|
for (const store of input.stores) {
|
|
71
|
-
const
|
|
72
|
-
if (!
|
|
73
|
-
throw substratError('forbidden', `deploy refused: scope store '${store.binding}' declares
|
|
74
|
-
`A store
|
|
72
|
+
const driver = drivers.find((candidate) => candidate.driver === store.driver);
|
|
73
|
+
if (!driver) {
|
|
74
|
+
throw substratError('forbidden', `deploy refused: scope store '${store.binding}' declares driver '${store.driver}', which is not registered. ` +
|
|
75
|
+
`A store driver is platform code, registered in this repo.`);
|
|
75
76
|
}
|
|
76
|
-
if (seen.has(
|
|
77
|
+
if (seen.has(driver.driver))
|
|
77
78
|
continue;
|
|
78
|
-
seen.add(
|
|
79
|
+
seen.add(driver.driver);
|
|
79
80
|
scripts.push({
|
|
80
|
-
|
|
81
|
-
releases:
|
|
81
|
+
driver: driver.driver,
|
|
82
|
+
releases: driver.releases,
|
|
82
83
|
vertical: input.vertical,
|
|
83
|
-
scriptName: scopeStoreScriptName(input.vertical,
|
|
84
|
-
className:
|
|
84
|
+
scriptName: scopeStoreScriptName(input.vertical, driver.driver),
|
|
85
|
+
className: driver.className,
|
|
85
86
|
});
|
|
86
87
|
}
|
|
87
88
|
return { scripts, bindings: [] };
|
|
@@ -90,13 +91,27 @@ export function scopeStoreUploadPlan(input) {
|
|
|
90
91
|
* The bindings a vertical's upload carries (#2210), the per-version push and the serving upload
|
|
91
92
|
* alike: the version's own declared bindings, then the platform's (the serving upload's
|
|
92
93
|
* ledger-derived stores; none on a push). A declared scope store adds none (RFC scope-stores §10.2, L1):
|
|
93
|
-
* its
|
|
94
|
+
* its driver is still checked against `drivers`, so a version whose driver is not registered is
|
|
94
95
|
* refused here as at push.
|
|
95
96
|
*/
|
|
96
97
|
export function verticalUploadBindings(input) {
|
|
97
|
-
const plan = scopeStoreUploadPlan({ vertical: input.vertical, stores: input.manifest.scopeStores,
|
|
98
|
+
const plan = scopeStoreUploadPlan({ vertical: input.vertical, stores: input.manifest.scopeStores, drivers: input.drivers });
|
|
98
99
|
return [...input.manifest.bindings, ...input.platformBindings, ...plan.bindings];
|
|
99
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* The platform binding that hands a script the migration set digest of the version it deploys
|
|
103
|
+
* (#2349): the integrity check a scope host makes before it applies a migration compares the
|
|
104
|
+
* migrations its bundle registers with these. A version whose migrations the control plane does
|
|
105
|
+
* not hold (`null`: the push left them out of its manifest) gets no binding, so its scopes
|
|
106
|
+
* compare nothing — the promote gate already asks for the acknowledgement on such a version.
|
|
107
|
+
* `plain_text`, like `SUBSTRAT_VERSION_ID`, so an in-place serve replaces it with the served
|
|
108
|
+
* version's rather than keeping the outgoing one.
|
|
109
|
+
*/
|
|
110
|
+
export async function migrationsDigestBindings(migrations) {
|
|
111
|
+
if (migrations === null)
|
|
112
|
+
return [];
|
|
113
|
+
return [{ type: 'plain_text', name: MIGRATIONS_DIGEST_BINDING, text: await migrationSetDigest(migrations) }];
|
|
114
|
+
}
|
|
100
115
|
/**
|
|
101
116
|
* The §4 sandbox contract. Throws a `forbidden` `substratError` (403 — the upload is well-formed
|
|
102
117
|
* and still refused) if a declared binding is not one of the vertical's OWN admissible
|
package/dist/deploy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB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AI,CAAC,OAAO,CAAC,CAAC;IACnC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;AAC1C,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,8 @@ export { mintPushToken, verifyPushToken, pushTokenBuilderAuth, pushActorFor } fr
|
|
|
13
13
|
export { mintTenantToken, verifyTenantToken, tenantTokenAuth } from './tenant-token.js';
|
|
14
14
|
export type { PlatformActorAuth, StaffIdentity, StaffSessionReader, StaffActorResolver, BuilderIdentity, BuilderAuth, TenantServiceIdentity, TenantServiceAuth, Principal, } from './auth.js';
|
|
15
15
|
export * from './browser.js';
|
|
16
|
-
export { VerticalClient, AUDITED_CALL_DEADLINE_MS } from './vertical-client.js';
|
|
16
|
+
export { VerticalClient, AUDITED_CALL_DEADLINE_MS, isRouteMiss } from './vertical-client.js';
|
|
17
|
+
export { sweepScopeAttachments, type AttachmentSweepReach } from './attachment-sweep.js';
|
|
17
18
|
export { assertNoUnreachableScopeCopies, claimScopeScriptReap, drainScopeScriptCopies, retryScopeScriptCopy, retryScopeScriptCopies, reapScopeScriptCopies, settleExpiredScopeScriptCopies, sweepScopeScriptCopies, } from './scope-copy-cleanup.js';
|
|
18
19
|
export { BIRTH_WINDOW_MS, backfillScopeScriptCopies, type CopyBackfillPage, } from './scope-copy-backfill.js';
|
|
19
20
|
export { scopeDeployment, versionReachedAt } from './scope-deployment.js';
|
|
@@ -32,20 +33,21 @@ export { callPlatformScopeStore, callPlatformScopeStoreAt, platformScopeStoresFo
|
|
|
32
33
|
export { assertSandboxContract, deployManifest, deploymentRefFor, stableDeploymentRefFor, nextMigrationTag, DeployUploadError, upstreamStatusOf, } from './deploy.js';
|
|
33
34
|
export type { DeployVerticalFn, FetchVerticalAssetFn, FetchVerticalModulesFn, RecoverAssetContentFn, VerticalBundle, DeclaredBinding, DeployManifest, } from './deploy.js';
|
|
34
35
|
export { createWfpUploader, createWfpModulesFetcher, createWfpBindingsPatcher } from './wfp.js';
|
|
35
|
-
export { createScopeStoreEnsurer, createStoreCanaryEnsurer, STORE_BUILD_VAR, STORE_RELEASE_VAR } from './store-script.js';
|
|
36
|
-
export {
|
|
37
|
-
export type
|
|
36
|
+
export { createScopeStoreEnsurer, createStoreCanaryEnsurer, STORE_BUILD_VAR, STORE_RELEASE_VAR, storePlatformFingerprint } from './store-script.js';
|
|
37
|
+
export { STORE_REBUILD_PASS_SUBREQUESTS, runStoreFleetRebuild, storeRebuildBudget, storeRebuildStatus, type StoreDriverRebuildPass, } from './store-rebuild.js';
|
|
38
|
+
export { ROLLOUT_WALKS_PER_REQUEST, ROLLOUT_HOLD_TTL_MS, ROLLOUT_VERTICALS_PER_REQUEST, canaryObjectName, canaryStoreRelease, decodeStoreDriverRelease, runStoreDriverRollout, storeDriverRelease, storeReleaseKey, storedReleaseLoader, type CanaryCall, type StoreDriverRolloutDeps, type StoreDriverRolloutResult, type StoreReleaseBytes, } from './store-releases.js';
|
|
39
|
+
export type { ScopeStoreEnsurerOptions, StoreCanaryTarget, StoreDriverReleaseArtifact } from './store-script.js';
|
|
38
40
|
export { withPlatformEntry, platformEntrySkipReason, platformSweeperDecision, PLATFORM_ENTRY_MODULE, PLATFORM_SWEEPER_MODULE, } from './platform-entry.js';
|
|
39
41
|
export { withStoreEntry, withPythonStoreEntry, STORE_ENTRY_MODULE, STORE_ENTRY_PYTHON_MODULE, STORE_ENTRY_PYTHON_SOURCE, STORE_ENTRY_PYTHON_VERIFIER_SOURCE, STORE_OBJECT_CLASS, STORE_RESERVED_MODULES, STORE_VERIFIER_MODULE, } from './store-entry.js';
|
|
40
|
-
export type { StoreEntryOptions,
|
|
42
|
+
export type { StoreEntryOptions, PythonStoreDriverRelease, PythonStoreScript } from './store-entry.js';
|
|
41
43
|
export type { WfpUploaderOptions, PatchScriptBindingsFn, ScriptBindingSpec, D1BindingSpec, R2BindingSpec, } from './wfp.js';
|
|
42
44
|
export { blobStoreBindings, collectBlobStoreHandles, collectTenantStoreHandles, tenantStoreBindings, } from './tenant-stores.js';
|
|
43
45
|
export { auditedChange, settleUnrecordedOutcomes, supersededUnknowns, withAuditedOutcomes, OUTCOME_CONFLICT_LOG, MALFORMED_OPERATION_ID_LOG, SETTLE_GRACE_MS, UNRECORDED_OUTCOME_LOG, } from './audited-change.js';
|
|
44
46
|
export type { AuditedChange, AuditedChangeSpec, AuditedRow, SettleAdmin, SettleOptions, SettleResult } from './audited-change.js';
|
|
45
47
|
export { createCustomHostnameProvisioner, mapCfStatus, extractRecords, reconcilePendingHostnames, isCustomHostname, validateBindableHostname, } from './custom-hostnames.js';
|
|
46
48
|
export type { CustomHostnameProvisioner, CustomHostnameProvisionerOptions, CustomHostnameIssuance, ReconcileHostnamesResult, } from './custom-hostnames.js';
|
|
47
|
-
export type { ObservabilityReader, ServiceMetricsRow, RecentLogEvent, TenantMetricsBucket, ConnectorCallsBucket, RequestFacetKey, RequestWhere, TenantRequestScope, RequestLevelCounts, RequestVolume, RequestVolumeBucket, RequestFacets, RequestFacetValue, RequestRecord, InvocationKind, LogPattern, LogPatterns, LogPatternLevel, } from './observability.js';
|
|
48
|
-
export { TENANT_SERIES_SCOPE_CAP, TENANT_METRICS_LIMIT, REQUEST_FACET_KEYS, REQUEST_FACET_TOP, LOG_PATTERN_TOP, INVOCATION_KINDS, invocationKindOf, } from './observability.js';
|
|
49
|
+
export type { ObservabilityReader, ServiceMetricsRow, RecentLogEvent, TenantMetricsBucket, ConnectorCallsBucket, RequestFacetKey, RequestWhere, TenantRequestScope, RequestLevelCounts, RequestVolume, RequestVolumeBucket, RequestFacets, RequestFacetValue, RequestRecord, OutboundCall, InvocationKind, LogPattern, LogPatterns, LogPatternLevel, } from './observability.js';
|
|
50
|
+
export { TENANT_SERIES_SCOPE_CAP, TENANT_METRICS_LIMIT, REQUEST_FACET_KEYS, REQUEST_FACET_TOP, LOG_PATTERN_TOP, INVOCATION_KINDS, invocationKindOf, outboundCallsOf, } from './observability.js';
|
|
49
51
|
export { STORAGE_PAGE_DEFAULT, STORAGE_PAGE_MAX, STORAGE_READ_CONCURRENCY, readStoragePage, } from './storage-meter.js';
|
|
50
52
|
export type { StoragePageInput, StorageScope } from './storage-meter.js';
|
|
51
53
|
export type { PlatformRuntime } from './platform-runtime.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC5E,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,2BAA2B,EAC3B,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACjH,YAAY,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACrG,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC7F,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACzE,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC3H,OAAO,EACL,yBAAyB,EAC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4B,EAI5B,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAG/D,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAI7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAM3F,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC3E,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACnG,YAAY,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,8 @@ export { mintTenantToken, verifyTenantToken, tenantTokenAuth } from './tenant-to
|
|
|
10
10
|
// The console's staff surface (#971). Browser-safe, so it is ALSO a subpath of its own
|
|
11
11
|
// (`./browser`): a bundler resolving the root entry would pull the whole server.
|
|
12
12
|
export * from './browser.js';
|
|
13
|
-
export { VerticalClient, AUDITED_CALL_DEADLINE_MS } from './vertical-client.js';
|
|
13
|
+
export { VerticalClient, AUDITED_CALL_DEADLINE_MS, isRouteMiss } from './vertical-client.js';
|
|
14
|
+
export { sweepScopeAttachments } from './attachment-sweep.js';
|
|
14
15
|
export { assertNoUnreachableScopeCopies, claimScopeScriptReap, drainScopeScriptCopies, retryScopeScriptCopy, retryScopeScriptCopies, reapScopeScriptCopies, settleExpiredScopeScriptCopies, sweepScopeScriptCopies, } from './scope-copy-cleanup.js';
|
|
15
16
|
export { BIRTH_WINDOW_MS, backfillScopeScriptCopies, } from './scope-copy-backfill.js';
|
|
16
17
|
export { scopeDeployment, versionReachedAt } from './scope-deployment.js';
|
|
@@ -28,14 +29,15 @@ export { isTerminalDispatchFailure, isTerminalProviderError, providerErrorStatus
|
|
|
28
29
|
export { callPlatformScopeStore, callPlatformScopeStoreAt, platformScopeStoresFor, runningVersionStoresOf, scopeStoresOf, unrouteScope, unreachablePlatformScopeStores, declaredStoresOf, } from './platform-scope-stores.js';
|
|
29
30
|
export { assertSandboxContract, deployManifest, deploymentRefFor, stableDeploymentRefFor, nextMigrationTag, DeployUploadError, upstreamStatusOf, } from './deploy.js';
|
|
30
31
|
export { createWfpUploader, createWfpModulesFetcher, createWfpBindingsPatcher } from './wfp.js';
|
|
31
|
-
export { createScopeStoreEnsurer, createStoreCanaryEnsurer, STORE_BUILD_VAR, STORE_RELEASE_VAR } from './store-script.js';
|
|
32
|
-
export {
|
|
32
|
+
export { createScopeStoreEnsurer, createStoreCanaryEnsurer, STORE_BUILD_VAR, STORE_RELEASE_VAR, storePlatformFingerprint } from './store-script.js';
|
|
33
|
+
export { STORE_REBUILD_PASS_SUBREQUESTS, runStoreFleetRebuild, storeRebuildBudget, storeRebuildStatus, } from './store-rebuild.js';
|
|
34
|
+
export { ROLLOUT_WALKS_PER_REQUEST, ROLLOUT_HOLD_TTL_MS, ROLLOUT_VERTICALS_PER_REQUEST, canaryObjectName, canaryStoreRelease, decodeStoreDriverRelease, runStoreDriverRollout, storeDriverRelease, storeReleaseKey, storedReleaseLoader, } from './store-releases.js';
|
|
33
35
|
export { withPlatformEntry, platformEntrySkipReason, platformSweeperDecision, PLATFORM_ENTRY_MODULE, PLATFORM_SWEEPER_MODULE, } from './platform-entry.js';
|
|
34
36
|
export { withStoreEntry, withPythonStoreEntry, STORE_ENTRY_MODULE, STORE_ENTRY_PYTHON_MODULE, STORE_ENTRY_PYTHON_SOURCE, STORE_ENTRY_PYTHON_VERIFIER_SOURCE, STORE_OBJECT_CLASS, STORE_RESERVED_MODULES, STORE_VERIFIER_MODULE, } from './store-entry.js';
|
|
35
37
|
export { blobStoreBindings, collectBlobStoreHandles, collectTenantStoreHandles, tenantStoreBindings, } from './tenant-stores.js';
|
|
36
38
|
export { auditedChange, settleUnrecordedOutcomes, supersededUnknowns, withAuditedOutcomes, OUTCOME_CONFLICT_LOG, MALFORMED_OPERATION_ID_LOG, SETTLE_GRACE_MS, UNRECORDED_OUTCOME_LOG, } from './audited-change.js';
|
|
37
39
|
export { createCustomHostnameProvisioner, mapCfStatus, extractRecords, reconcilePendingHostnames, isCustomHostname, validateBindableHostname, } from './custom-hostnames.js';
|
|
38
|
-
export { TENANT_SERIES_SCOPE_CAP, TENANT_METRICS_LIMIT, REQUEST_FACET_KEYS, REQUEST_FACET_TOP, LOG_PATTERN_TOP, INVOCATION_KINDS, invocationKindOf, } from './observability.js';
|
|
40
|
+
export { TENANT_SERIES_SCOPE_CAP, TENANT_METRICS_LIMIT, REQUEST_FACET_KEYS, REQUEST_FACET_TOP, LOG_PATTERN_TOP, INVOCATION_KINDS, invocationKindOf, outboundCallsOf, } from './observability.js';
|
|
39
41
|
export { STORAGE_PAGE_DEFAULT, STORAGE_PAGE_MAX, STORAGE_READ_CONCURRENCY, readStoragePage, } from './storage-meter.js';
|
|
40
42
|
export { createCfDoNamespaceReader, namespacesForScript } from './do-namespaces.js';
|
|
41
43
|
export { createCfObservabilityReader } from './cf-observability.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EAC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1G,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAStE,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,4BAA4B;AAC5B,iFAAiF;AACjF,mFAAmF;AACnF,gFAAgF;AAChF,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,kFAAkF;AAClF,iFAAiF;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAI/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,yFAAyF;AACzF,yFAAyF;AACzF,oFAAoF;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE7D,uFAAuF;AACvF,yFAAyF;AACzF,uFAAuF;AACvF,yFAAyF;AACzF,+EAA+E;AAC/E,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG3E,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/observability.d.ts
CHANGED
|
@@ -370,7 +370,35 @@ export interface RequestRecord {
|
|
|
370
370
|
attempt: number | null;
|
|
371
371
|
/** #1901: a schedule run's lateness against its due time, in milliseconds. */
|
|
372
372
|
latenessMs: number | null;
|
|
373
|
+
/**
|
|
374
|
+
* #2192: the outbound `fetch` calls the request made, as the line names them (host, redacted
|
|
375
|
+
* path, method, status, outcome, timing). `[]` when the line names none — a request that made
|
|
376
|
+
* no call, or a line written before the field existed.
|
|
377
|
+
*/
|
|
378
|
+
outboundCalls: OutboundCall[];
|
|
379
|
+
/** #2192: calls past the line's cap, counted rather than named. `0` when none were dropped. */
|
|
380
|
+
outboundCallsDropped: number;
|
|
373
381
|
}
|
|
382
|
+
/** #2192: one outbound call on a request's line — the kernel's `OutboundCallLine`, as read back. */
|
|
383
|
+
export interface OutboundCall {
|
|
384
|
+
host: string;
|
|
385
|
+
path: string;
|
|
386
|
+
method: string;
|
|
387
|
+
status: number | null;
|
|
388
|
+
/** `ok`, `http-error`, `refused` (the platform's egress refusal), `timeout`, `aborted` or `failed`. */
|
|
389
|
+
outcome: string;
|
|
390
|
+
durationMs: number;
|
|
391
|
+
/** Milliseconds from the request's start to the call. */
|
|
392
|
+
atMs: number;
|
|
393
|
+
/** A `failed` call's error class, when the line names one. */
|
|
394
|
+
reason?: string;
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* #2192: the outbound calls of a raw line's `outboundCalls`, keeping only entries of the line's
|
|
398
|
+
* shape. The line is written by the platform's entry, but a vertical's own code can print a
|
|
399
|
+
* line of the same shape, so the read takes nothing on trust beyond the field types.
|
|
400
|
+
*/
|
|
401
|
+
export declare function outboundCallsOf(v: unknown): OutboundCall[];
|
|
374
402
|
/** The levels a `ctx.log` line is written at. */
|
|
375
403
|
export type LogPatternLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
376
404
|
/** One template and the lines written from it (#1747). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observability.d.ts","sourceRoot":"","sources":["../src/observability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,mEAAmE;AACnE,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,mFAAmF;IACnF,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACn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QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAC;CACvG"}
|
package/dist/observability.js
CHANGED
|
@@ -47,6 +47,41 @@ export function invocationKindOf(v) {
|
|
|
47
47
|
}
|
|
48
48
|
/** How many values one facet lists, most frequent first. */
|
|
49
49
|
export const REQUEST_FACET_TOP = 10;
|
|
50
|
+
/**
|
|
51
|
+
* #2192: the outbound calls of a raw line's `outboundCalls`, keeping only entries of the line's
|
|
52
|
+
* shape. The line is written by the platform's entry, but a vertical's own code can print a
|
|
53
|
+
* line of the same shape, so the read takes nothing on trust beyond the field types.
|
|
54
|
+
*/
|
|
55
|
+
export function outboundCallsOf(v) {
|
|
56
|
+
if (!Array.isArray(v))
|
|
57
|
+
return [];
|
|
58
|
+
const calls = [];
|
|
59
|
+
for (const c of v) {
|
|
60
|
+
if (typeof c !== 'object' || c === null)
|
|
61
|
+
continue;
|
|
62
|
+
const e = c;
|
|
63
|
+
if (typeof e['host'] !== 'string' ||
|
|
64
|
+
typeof e['path'] !== 'string' ||
|
|
65
|
+
typeof e['method'] !== 'string' ||
|
|
66
|
+
!(typeof e['status'] === 'number' || e['status'] === null) ||
|
|
67
|
+
typeof e['outcome'] !== 'string' ||
|
|
68
|
+
typeof e['durationMs'] !== 'number' ||
|
|
69
|
+
typeof e['atMs'] !== 'number') {
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
calls.push({
|
|
73
|
+
host: e['host'],
|
|
74
|
+
path: e['path'],
|
|
75
|
+
method: e['method'],
|
|
76
|
+
status: e['status'],
|
|
77
|
+
outcome: e['outcome'],
|
|
78
|
+
durationMs: e['durationMs'],
|
|
79
|
+
atMs: e['atMs'],
|
|
80
|
+
...(typeof e['reason'] === 'string' ? { reason: e['reason'] } : {}),
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return calls;
|
|
84
|
+
}
|
|
50
85
|
/** How many templates the pattern read lists. */
|
|
51
86
|
export const LOG_PATTERN_TOP = 50;
|
|
52
87
|
//# sourceMappingURL=observability.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observability.js","sourceRoot":"","sources":["../src/observability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAwLH;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AA+BxC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC;AAE/H;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,CAAU,CAAC;AAG7E,uDAAuD;AACvD,MAAM,UAAU,gBAAgB,CAAC,CAAU;IACzC,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,SAAS,CAAC;AAC/E,CAAC;AAiGD,4DAA4D;AAC5D,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"observability.js","sourceRoot":"","sources":["../src/observability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAwLH;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AA+BxC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAU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f,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;YACf,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC;YACnB,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAkB;YACpC,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC;YACrB,UAAU,EAAE,CAAC,CAAC,YAAY,CAAC;YAC3B,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;YACf,GAAG,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACpE,CAAC,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAgCD,iDAAiD;AACjD,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
export declare const PLATFORM_ENTRY_MODULE = "substrat-platform-entry.js";
|
|
8
8
|
/** The import specifier the uploader replaces with `./<the bundle's entry>`. */
|
|
9
9
|
export declare const PLATFORM_ENTRY_PLACEHOLDER = "__SUBSTRAT_VERTICAL_ENTRY__";
|
|
10
|
-
/** The entry itself —
|
|
10
|
+
/** The entry itself — 19418 bytes of ESM. */
|
|
11
11
|
export declare const PLATFORM_ENTRY_SOURCE: string;
|
|
12
12
|
/**
|
|
13
13
|
* #2245: the entry's `node:async_hooks` import, as it appears in `PLATFORM_ENTRY_SOURCE`, and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-entry.generated.d.ts","sourceRoot":"","sources":["../src/platform-entry.generated.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,+BAA+B,CAAC;AAElE,gFAAgF;AAChF,eAAO,MAAM,0BAA0B,gCAAgC,CAAC;AAExE,6CAA6C;AAC7C,eAAO,MAAM,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"platform-entry.generated.d.ts","sourceRoot":"","sources":["../src/platform-entry.generated.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,+BAA+B,CAAC;AAElE,gFAAgF;AAChF,eAAO,MAAM,0BAA0B,gCAAgC,CAAC;AAExE,6CAA6C;AAC7C,eAAO,MAAM,qBAAqB,EAAE,MAAktnB,CAAC;AAEvvnB;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,4DAA4D,CAAC;AACnG,eAAO,MAAM,2BAA2B,yCAAyC,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,iCAAiC,CAAC;AAEtE,8CAA8C;AAC9C,eAAO,MAAM,uBAAuB,EAAE,MAA60T,CAAC"}
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
export const PLATFORM_ENTRY_MODULE = 'substrat-platform-entry.js';
|
|
10
10
|
/** The import specifier the uploader replaces with `./<the bundle's entry>`. */
|
|
11
11
|
export const PLATFORM_ENTRY_PLACEHOLDER = '__SUBSTRAT_VERTICAL_ENTRY__';
|
|
12
|
-
/** The entry itself —
|
|
13
|
-
export const PLATFORM_ENTRY_SOURCE = "// substrat-platform-entry.ts\nimport { AsyncLocalStorage } from \"node:async_hooks\";\n\n// packages/contracts/dist/invocation-record.js\nvar INVOCATION_RECORD_HEADER = \"x-substrat-invocation-record\";\nvar REQUEST_ID_HEADER = \"x-substrat-request-id\";\nvar INVOCATION_RECORD_FIELD_MAX = 128;\nvar FIELDS = [\"operation\", \"problemCode\", \"principalKind\"];\nfunction encodeInvocationRecord(record) {\n const params = new URLSearchParams();\n for (const key of FIELDS) {\n const v = record[key];\n if (typeof v === \"string\" && v !== \"\")\n params.set(key, v.slice(0, INVOCATION_RECORD_FIELD_MAX));\n }\n const value = params.toString();\n return value === \"\" ? null : value;\n}\nvar FIELD_COVERAGE_HEADER = \"x-substrat-field-coverage\";\nfunction invocationLevelOf(status, threw, problemCode) {\n if (threw || status === null || status >= 500)\n return \"error\";\n if (status >= 400)\n return \"warn\";\n if (problemCode)\n return \"warn\";\n return \"info\";\n}\n\n// packages/kernel/dist/invocation-line.js\nfunction invocationLine(f) {\n const emitted = f.emitted;\n return {\n substrat: \"invocation\",\n ...f.kind ? { kind: f.kind } : {},\n tenantId: f.tenantId,\n scopeId: f.scopeId,\n vertical: f.vertical ?? null,\n surface: f.surface ?? null,\n method: f.method ?? null,\n path: f.path ?? null,\n status: f.status ?? null,\n threw: f.threw,\n durationMs: f.durationMs,\n invocationId: f.invocationId,\n level: f.level,\n operation: f.operation ?? null,\n problemCode: f.problemCode ?? null,\n principalKind: f.principalKind ?? null,\n eventCount: emitted ? emitted.total : null,\n eventTypes: emitted ? distinct(emitted.events.map((e) => e.type)) : [],\n entities: emitted && f.withEntities !== false ? distinct(emitted.events.map((e) => e.entity)) : [],\n versionId: f.versionId ?? null,\n ...f.outputFields ? { outputFields: f.outputFields, ...f.fieldCoverageId ? { fieldCoverageId: f.fieldCoverageId } : {} } : {},\n ...f.storeCalls && f.storeCalls.length > 0 ? { storeCalls: f.storeCalls } : {},\n ...f.storeCallsDropped ? { storeCallsDropped: f.storeCallsDropped } : {},\n ...f.async ?? {}\n };\n}\nvar STORE_CALL_LOG_CAP = 16;\nfunction tallyStoreCall(tally, call) {\n const calls = tally.storeCalls ?? (tally.storeCalls = []);\n if (calls.length < STORE_CALL_LOG_CAP) {\n calls.push({ binding: call.binding, operation: call.operation, outcome: call.outcome, durationMs: call.durationMs });\n } else {\n tally.storeCallsDropped = (tally.storeCallsDropped ?? 0) + 1;\n }\n}\nvar STORE_CALL_SINK_KEY = \"substrat.store-call-sink\";\nfunction distinct(values) {\n return [...new Set(values)];\n}\n\n// packages/kernel/dist/ulid.js\nvar B32 = \"0123456789ABCDEFGHJKMNPQRSTVWXYZ\";\nvar MAX_ULID_TIME = 2 ** 48 - 1;\nvar ULID_SHAPE = /^[0-9A-HJKMNP-TV-Z]{26}$/;\nvar unencodable = (t) => `not an encodable ULID instant: ${t} (want 0..${MAX_ULID_TIME})`;\nfunction encodeTime(time) {\n let ts = \"\";\n let t = time;\n for (let i = 0; i < 10; i++) {\n ts = B32[t % 32] + ts;\n t = Math.floor(t / 32);\n }\n return ts;\n}\nfunction createUlid() {\n let lastTime = -1;\n const lastRand = new Array(16).fill(0);\n function freshRandom() {\n const bytes = crypto.getRandomValues(new Uint8Array(16));\n for (let i = 0; i < 16; i++)\n lastRand[i] = bytes[i] % 32;\n }\n function incrementRandom() {\n for (let i = 15; i >= 0; i--) {\n if (lastRand[i] < 31) {\n lastRand[i]++;\n return true;\n }\n lastRand[i] = 0;\n }\n return false;\n }\n const mint = ((now = Date.now()) => {\n if (!Number.isSafeInteger(now))\n throw new RangeError(unencodable(now));\n let time = now;\n if (time <= lastTime) {\n time = lastTime;\n if (!incrementRandom()) {\n time = lastTime + 1;\n freshRandom();\n }\n } else {\n freshRandom();\n }\n if (time < 0 || time > MAX_ULID_TIME)\n throw new RangeError(unencodable(time));\n lastTime = time;\n let r = \"\";\n for (const d of lastRand)\n r += B32[d];\n return encodeTime(time) + r;\n });\n mint.seedFrom = (id) => {\n const time = ulidTime(id);\n if (time < lastTime)\n return;\n const rand = [];\n for (const ch of id.slice(10))\n rand.push(B32.indexOf(ch));\n if (time === lastTime) {\n let ahead = false;\n for (let i = 0; i < 16; i++) {\n if (rand[i] !== lastRand[i]) {\n ahead = rand[i] > lastRand[i];\n break;\n }\n }\n if (!ahead)\n return;\n }\n lastTime = time;\n for (let i = 0; i < 16; i++)\n lastRand[i] = rand[i];\n };\n return mint;\n}\nvar processUlid = createUlid();\nfunction ulid(now = Date.now()) {\n return processUlid(now);\n}\nfunction ulidTime(id) {\n if (!ULID_SHAPE.test(id))\n throw new Error(`not a ULID: ${id}`);\n let t = 0;\n for (const ch of id.slice(0, 10))\n t = t * 32 + B32.indexOf(ch);\n if (t > MAX_ULID_TIME)\n throw new Error(`not a ULID: ${id}`);\n return t;\n}\n\n// packages/contracts/dist/wire-auth.js\nfunction secretMatches(presented, expected) {\n const given = presented ?? \"\";\n let diff = given.length ^ expected.length | (given.length === 0 ? 1 : 0);\n for (let i = 0; i < expected.length; i++) {\n diff |= (i < given.length ? given.charCodeAt(i) : 0) ^ expected.charCodeAt(i);\n }\n return diff === 0;\n}\n\n// packages/vertical-host/src/routed-node.ts\nvar ROUTED_ID = /^[0-9A-HJKMNP-TV-Z]{26}$/;\nvar RouterAssertionError = class extends Error {\n};\nfunction readRoutedNode(headers, options = {}) {\n const rawTenant = headers.get(\"x-substrat-tenant\");\n const rawScope = headers.get(\"x-substrat-scope\");\n if (!rawTenant && !rawScope) return null;\n const { expectedSecret, allowUnsigned = false } = options;\n if (expectedSecret) {\n if (!secretMatches(headers.get(\"x-substrat-router\"), expectedSecret)) {\n throw new RouterAssertionError(\"router assertion is not signed by a known router\");\n }\n } else if (!allowUnsigned) {\n throw new RouterAssertionError(\n \"router assertion cannot be verified: this worker has no ROUTER_SECRET configured\"\n );\n }\n if (!rawTenant || !rawScope) {\n throw new RouterAssertionError(\"router assertion is incomplete\");\n }\n if (!ROUTED_ID.test(rawTenant) || !ROUTED_ID.test(rawScope)) {\n throw new RouterAssertionError(\"router assertion carries a malformed id\");\n }\n return {\n tenantId: rawTenant,\n scopeId: rawScope,\n surface: headers.get(\"x-substrat-surface\") ?? \"app\",\n verticalSlug: headers.get(\"x-substrat-vertical\")\n };\n}\n\n// packages/vertical-host/src/invocation-log.ts\nfunction builtinAsyncLocalStorage() {\n try {\n const proc = globalThis.process;\n const mod = proc?.getBuiltinModule?.(\"node:async_hooks\");\n return typeof mod?.AsyncLocalStorage === \"function\" ? mod.AsyncLocalStorage : void 0;\n } catch {\n return void 0;\n }\n}\nfunction storeCallSlot(provided) {\n try {\n const g = globalThis;\n const key = Symbol.for(STORE_CALL_SINK_KEY);\n const existing = g[key];\n if (typeof existing?.run === \"function\" && typeof existing.current === \"function\") return existing;\n const Als = provided ?? builtinAsyncLocalStorage();\n if (!Als) return void 0;\n const storage = new Als();\n const slot = {\n current() {\n const tally = storage.getStore();\n return tally ? (call) => tallyStoreCall(tally, call) : void 0;\n },\n run: (tally, fn) => storage.run(tally, fn)\n };\n g[key] = slot;\n return slot;\n } catch {\n return void 0;\n }\n}\nfunction runRecordingStoreCalls(record, provided, fn) {\n const slot = storeCallSlot(provided);\n return slot ? slot.run(record, fn) : fn();\n}\nfunction versionIdOf(env) {\n const v = env?.SUBSTRAT_VERSION_ID;\n return typeof v === \"string\" && v.length > 0 ? v : null;\n}\nvar UPLOAD_LINK_SECRET_SEGMENT = /^(\\/api\\/attachment-uploads\\/[^/]+\\/[^/]+\\/)[^/]+/;\nvar redactUploadLinkSecret = (pathname) => pathname.replace(UPLOAD_LINK_SECRET_SEGMENT, \"$1[redacted]\");\nfunction pathOf(url) {\n try {\n return redactUploadLinkSecret(new URL(url).pathname);\n } catch {\n return \"/\";\n }\n}\nvar STAMPS = /* @__PURE__ */ Symbol.for(\"substrat.invocation-stamp\");\nfunction stamps() {\n const g = globalThis;\n return g[STAMPS] ??= /* @__PURE__ */ new WeakMap();\n}\nfunction invocationStampOf(request) {\n return stamps().get(request);\n}\nfunction withRequestId(response, id) {\n const headers = response?.headers;\n try {\n headers?.set?.(REQUEST_ID_HEADER, id);\n return response;\n } catch {\n }\n try {\n const r = response;\n if (r.status === 101) return response;\n const copy = new Response(r.body, r);\n copy.headers.set(REQUEST_ID_HEADER, id);\n return copy;\n } catch {\n return response;\n }\n}\nfunction beginStamp(request, env, options) {\n const stamp = { invocationId: ulid(), record: {} };\n const fieldCoverageId = armedFieldCoverageId(request.headers, env, options);\n if (fieldCoverageId) stamp.fieldCoverageId = fieldCoverageId;\n stamps().set(request, stamp);\n return stamp;\n}\nfunction armedFieldCoverageId(headers, env, options) {\n let id;\n try {\n id = headers.get(FIELD_COVERAGE_HEADER);\n } catch {\n return void 0;\n }\n if (id === null || !ROUTED_ID.test(id)) return void 0;\n return routedNodeOrNull(headers, env, options) !== null ? id : void 0;\n}\nfunction writeInvocationLine(stamp, done, options) {\n try {\n writeLineOrThrow(stamp, done, options);\n } catch (e) {\n try {\n console.log(JSON.stringify({ substrat: \"invocation-log-fault\", detail: String(e) }));\n } catch {\n }\n }\n}\nfunction writeLineOrThrow(stamp, done, options) {\n const node = routedNodeOrNull(done.request.headers, done.env, options);\n if (!node) return;\n const { record, invocationId } = stamp;\n const line = invocationLine({\n tenantId: node.tenantId,\n scopeId: node.scopeId,\n vertical: node.verticalSlug,\n surface: node.surface,\n method: done.request.method,\n path: pathOf(done.request.url),\n status: done.status,\n threw: done.threw,\n durationMs: Date.now() - done.started,\n invocationId,\n level: invocationLevelOf(done.status, done.threw, record.problemCode),\n operation: record.operation,\n problemCode: record.problemCode,\n principalKind: record.principalKind,\n ...record.emitted ? { emitted: record.emitted } : {},\n versionId: versionIdOf(done.env),\n ...record.outputFields ? { outputFields: record.outputFields } : {},\n ...stamp.fieldCoverageId ? { fieldCoverageId: stamp.fieldCoverageId } : {},\n ...record.storeCalls && record.storeCalls.length > 0 ? { storeCalls: record.storeCalls } : {},\n ...record.storeCallsDropped ? { storeCallsDropped: record.storeCallsDropped } : {}\n });\n console.log(JSON.stringify(line));\n}\nvar OTHER_HANDLERS = [\"scheduled\", \"queue\", \"email\", \"tail\", \"trace\", \"alarm\", \"test\"];\nfunction withInvocationLog(worker, options = {}) {\n const inner = worker?.fetch;\n if (typeof inner !== \"function\") return worker;\n const wrapped = {\n async fetch(request, env, ctx) {\n if (invocationStampOf(request)) return inner.call(worker, request, env, ctx);\n const started = Date.now();\n const stamp = beginStamp(request, env, options);\n let status = null;\n let threw = false;\n try {\n const response = withRequestId(\n await runRecordingStoreCalls(stamp.record, options.asyncLocalStorage, () => inner.call(worker, request, env, ctx)),\n stamp.invocationId\n );\n status = response.status;\n handRecordToRouter(response, stamp.record, request, env, options);\n return response;\n } catch (e) {\n threw = true;\n throw e;\n } finally {\n writeInvocationLine(stamp, { request, env, status, threw, started }, options);\n }\n }\n };\n for (const name of OTHER_HANDLERS) {\n const h = worker[name];\n if (typeof h === \"function\") wrapped[name] = h.bind(worker);\n }\n return wrapped;\n}\nfunction handRecordToRouter(response, record, request, env, options) {\n try {\n const value = encodeInvocationRecord(record);\n if (value === null || !routedNodeOrNull(request.headers, env, options)) return;\n response.headers?.set?.(\n INVOCATION_RECORD_HEADER,\n value\n );\n } catch {\n }\n}\nfunction routedNodeOrNull(headers, env, options) {\n try {\n return readRoutedNode(headers, {\n expectedSecret: options.routerSecret?.(env),\n allowUnsigned: options.allowUnsigned?.(env) ?? false\n });\n } catch (e) {\n if (!(e instanceof RouterAssertionError)) console.log(JSON.stringify({ substrat: \"invocation-log-fault\", detail: String(e) }));\n return null;\n }\n}\n\n// substrat-platform-entry.ts\nimport * as vertical from \"__SUBSTRAT_VERTICAL_ENTRY__\";\nexport * from \"__SUBSTRAT_VERTICAL_ENTRY__\";\nvar substrat_platform_entry_default = withInvocationLog(vertical.default, {\n routerSecret: (env) => env.ROUTER_SECRET,\n allowUnsigned: (env) => env.ALLOW_DEV_NODE === \"true\",\n asyncLocalStorage: AsyncLocalStorage\n});\nexport {\n substrat_platform_entry_default as default\n};\n";
|
|
12
|
+
/** The entry itself — 19418 bytes of ESM. */
|
|
13
|
+
export const PLATFORM_ENTRY_SOURCE = "// substrat-platform-entry.ts\nimport { AsyncLocalStorage } from \"node:async_hooks\";\n\n// packages/contracts/dist/invocation-record.js\nvar INVOCATION_RECORD_HEADER = \"x-substrat-invocation-record\";\nvar REQUEST_ID_HEADER = \"x-substrat-request-id\";\nvar INVOCATION_RECORD_FIELD_MAX = 128;\nvar FIELDS = [\"operation\", \"problemCode\", \"principalKind\"];\nfunction encodeInvocationRecord(record2) {\n const params = new URLSearchParams();\n for (const key of FIELDS) {\n const v = record2[key];\n if (typeof v === \"string\" && v !== \"\")\n params.set(key, v.slice(0, INVOCATION_RECORD_FIELD_MAX));\n }\n const value = params.toString();\n return value === \"\" ? null : value;\n}\nvar FIELD_COVERAGE_HEADER = \"x-substrat-field-coverage\";\nfunction invocationLevelOf(status, threw, problemCode) {\n if (threw || status === null || status >= 500)\n return \"error\";\n if (status >= 400)\n return \"warn\";\n if (problemCode)\n return \"warn\";\n return \"info\";\n}\n\n// packages/kernel/dist/invocation-line.js\nfunction invocationLine(f) {\n const emitted = f.emitted;\n return {\n substrat: \"invocation\",\n ...f.kind ? { kind: f.kind } : {},\n tenantId: f.tenantId,\n scopeId: f.scopeId,\n vertical: f.vertical ?? null,\n surface: f.surface ?? null,\n method: f.method ?? null,\n path: f.path ?? null,\n status: f.status ?? null,\n threw: f.threw,\n durationMs: f.durationMs,\n invocationId: f.invocationId,\n level: f.level,\n operation: f.operation ?? null,\n problemCode: f.problemCode ?? null,\n principalKind: f.principalKind ?? null,\n eventCount: emitted ? emitted.total : null,\n eventTypes: emitted ? distinct(emitted.events.map((e) => e.type)) : [],\n entities: emitted && f.withEntities !== false ? distinct(emitted.events.map((e) => e.entity)) : [],\n versionId: f.versionId ?? null,\n ...f.outputFields ? { outputFields: f.outputFields, ...f.fieldCoverageId ? { fieldCoverageId: f.fieldCoverageId } : {} } : {},\n ...f.storeCalls && f.storeCalls.length > 0 ? { storeCalls: f.storeCalls } : {},\n ...f.storeCallsDropped ? { storeCallsDropped: f.storeCallsDropped } : {},\n ...f.outboundCalls && f.outboundCalls.length > 0 ? { outboundCalls: f.outboundCalls } : {},\n ...f.outboundCallsDropped ? { outboundCallsDropped: f.outboundCallsDropped } : {},\n ...f.parentInvocationId ? { parentInvocationId: f.parentInvocationId, ...f.parentScopeId ? { parentScopeId: f.parentScopeId } : {} } : {},\n ...f.async ?? {}\n };\n}\nvar STORE_CALL_LOG_CAP = 16;\nfunction tallyStoreCall(tally, call) {\n const calls = tally.storeCalls ?? (tally.storeCalls = []);\n if (calls.length < STORE_CALL_LOG_CAP) {\n calls.push({ binding: call.binding, operation: call.operation, outcome: call.outcome, durationMs: call.durationMs });\n } else {\n tally.storeCallsDropped = (tally.storeCallsDropped ?? 0) + 1;\n }\n}\nvar OUTBOUND_CALL_LOG_CAP = 16;\nfunction tallyOutboundCall(tally, call) {\n const calls = tally.outboundCalls ?? (tally.outboundCalls = []);\n if (calls.length < OUTBOUND_CALL_LOG_CAP) {\n calls.push({\n host: call.host,\n path: call.path,\n method: call.method,\n status: call.status,\n outcome: call.outcome,\n durationMs: call.durationMs,\n atMs: call.atMs,\n ...call.reason !== void 0 ? { reason: call.reason } : {}\n });\n } else {\n tally.outboundCallsDropped = (tally.outboundCallsDropped ?? 0) + 1;\n }\n}\nvar STORE_CALL_SINK_KEY = \"substrat.store-call-sink\";\nfunction distinct(values) {\n return [...new Set(values)];\n}\n\n// packages/kernel/dist/ulid.js\nvar B32 = \"0123456789ABCDEFGHJKMNPQRSTVWXYZ\";\nvar MAX_ULID_TIME = 2 ** 48 - 1;\nvar ULID_SHAPE = /^[0-9A-HJKMNP-TV-Z]{26}$/;\nvar unencodable = (t) => `not an encodable ULID instant: ${t} (want 0..${MAX_ULID_TIME})`;\nfunction encodeTime(time) {\n let ts = \"\";\n let t = time;\n for (let i = 0; i < 10; i++) {\n ts = B32[t % 32] + ts;\n t = Math.floor(t / 32);\n }\n return ts;\n}\nfunction createUlid() {\n let lastTime = -1;\n const lastRand = new Array(16).fill(0);\n function freshRandom() {\n const bytes = crypto.getRandomValues(new Uint8Array(16));\n for (let i = 0; i < 16; i++)\n lastRand[i] = bytes[i] % 32;\n }\n function incrementRandom() {\n for (let i = 15; i >= 0; i--) {\n if (lastRand[i] < 31) {\n lastRand[i]++;\n return true;\n }\n lastRand[i] = 0;\n }\n return false;\n }\n const mint = ((now = Date.now()) => {\n if (!Number.isSafeInteger(now))\n throw new RangeError(unencodable(now));\n let time = now;\n if (time <= lastTime) {\n time = lastTime;\n if (!incrementRandom()) {\n time = lastTime + 1;\n freshRandom();\n }\n } else {\n freshRandom();\n }\n if (time < 0 || time > MAX_ULID_TIME)\n throw new RangeError(unencodable(time));\n lastTime = time;\n let r = \"\";\n for (const d of lastRand)\n r += B32[d];\n return encodeTime(time) + r;\n });\n mint.seedFrom = (id) => {\n const time = ulidTime(id);\n if (time < lastTime)\n return;\n const rand = [];\n for (const ch of id.slice(10))\n rand.push(B32.indexOf(ch));\n if (time === lastTime) {\n let ahead = false;\n for (let i = 0; i < 16; i++) {\n if (rand[i] !== lastRand[i]) {\n ahead = rand[i] > lastRand[i];\n break;\n }\n }\n if (!ahead)\n return;\n }\n lastTime = time;\n for (let i = 0; i < 16; i++)\n lastRand[i] = rand[i];\n };\n return mint;\n}\nvar processUlid = createUlid();\nfunction ulid(now = Date.now()) {\n return processUlid(now);\n}\nfunction ulidTime(id) {\n if (!ULID_SHAPE.test(id))\n throw new Error(`not a ULID: ${id}`);\n let t = 0;\n for (const ch of id.slice(0, 10))\n t = t * 32 + B32.indexOf(ch);\n if (t > MAX_ULID_TIME)\n throw new Error(`not a ULID: ${id}`);\n return t;\n}\n\n// packages/vertical-host/src/outbound-calls.ts\nvar EGRESS_REFUSAL_HEADER = \"x-substrat-egress\";\nvar STORE_CALL_HOST = \"store.substrat.internal\";\nvar REDACTED = \"[redacted]\";\nvar PATH_MAX = 200;\nvar WORDS = /^[a-z]{1,16}(?:[-_][a-z]{1,16}){0,3}$/;\nvar WORDS_WITH_EXTENSION = /^[a-z]{1,16}(?:[-_][a-z]{1,16}){0,3}\\.[a-z][a-z0-9]{0,4}$/;\nvar SEGMENT_MAX = 40;\nvar SMALL_INTEGER = /^[0-9]{1,10}$/;\nvar VERSION = /^v[0-9]{1,3}(?:\\.[0-9]{1,3}){0,2}$/;\nfunction keepsSegment(segment) {\n if (segment.length > SEGMENT_MAX) return false;\n return segment === \"\" || WORDS.test(segment) || WORDS_WITH_EXTENSION.test(segment) || SMALL_INTEGER.test(segment) || VERSION.test(segment);\n}\nfunction redactOutboundPath(pathname) {\n const path = pathname.split(\"/\").map((segment) => keepsSegment(segment) ? segment : REDACTED).join(\"/\");\n return path.length > PATH_MAX ? `${path.slice(0, PATH_MAX)}…` : path;\n}\nvar ERROR_CLASS = /^[A-Z][A-Za-z]{0,30}(?:Error|Exception)$/;\nfunction errorName(e) {\n const name = e?.name;\n return typeof name === \"string\" && ERROR_CLASS.test(name) ? name : \"Error\";\n}\nfunction answeredOutcome(response) {\n if (response.status === 403 && response.headers?.get?.(EGRESS_REFUSAL_HEADER) === \"refused\") return \"refused\";\n return response.status >= 400 ? \"http-error\" : \"ok\";\n}\nfunction rejectedOutcome(e) {\n const name = errorName(e);\n if (name === \"TimeoutError\") return { outcome: \"timeout\" };\n if (name === \"AbortError\") return { outcome: \"aborted\" };\n return { outcome: \"failed\", reason: name };\n}\nvar SINCE = /* @__PURE__ */ Symbol.for(\"substrat.outbound-since\");\nfunction sinceMap() {\n const g = globalThis;\n return g[SINCE] ??= /* @__PURE__ */ new WeakMap();\n}\nfunction markRequestStart(recording, started) {\n try {\n sinceMap().set(recording, started);\n } catch {\n }\n}\nfunction destinationOf(input, init) {\n const fromRequest = typeof input === \"object\" && input !== null && !(input instanceof URL);\n const raw = fromRequest ? input.url : input;\n let url;\n try {\n url = new URL(String(raw));\n } catch {\n return null;\n }\n const initMethod = init?.method;\n const requestMethod = fromRequest ? input.method : void 0;\n const method = typeof initMethod === \"string\" ? initMethod : typeof requestMethod === \"string\" ? requestMethod : \"GET\";\n return { url, method: method.toUpperCase().slice(0, 16) };\n}\nfunction record(recording, destination, startedAt, end) {\n try {\n const call = {\n host: destination.url.host.toLowerCase(),\n path: redactOutboundPath(destination.url.pathname),\n method: destination.method,\n status: end.status,\n outcome: end.outcome,\n durationMs: Math.max(0, Date.now() - startedAt),\n atMs: Math.max(0, startedAt - (sinceMap().get(recording) ?? startedAt)),\n ...end.reason !== void 0 ? { reason: end.reason } : {}\n };\n tallyOutboundCall(recording, call);\n } catch {\n }\n}\nvar WRAPPED = /* @__PURE__ */ Symbol.for(\"substrat.outbound-fetch\");\nvar IN_CALL = /* @__PURE__ */ Symbol.for(\"substrat.outbound-fetch.in-call\");\nfunction recordingFetch(original, current) {\n const wrapped = function fetch(input, init) {\n const g = globalThis;\n if (g[IN_CALL] === true) return original.call(globalThis, input, init);\n let recording;\n let destination = null;\n try {\n recording = current();\n if (recording) destination = destinationOf(input, init);\n } catch {\n recording = void 0;\n }\n if (!recording || !destination || destination.url.hostname.toLowerCase() === STORE_CALL_HOST) {\n return original.call(globalThis, input, init);\n }\n const rec = recording;\n const dest = destination;\n const startedAt = Date.now();\n let pending;\n g[IN_CALL] = true;\n try {\n pending = original.call(globalThis, input, init);\n } finally {\n g[IN_CALL] = false;\n }\n return pending.then(\n (response) => {\n let status = null;\n let outcome = \"failed\";\n try {\n status = response.status;\n outcome = answeredOutcome(response);\n } catch {\n }\n record(rec, dest, startedAt, { status, outcome });\n return response;\n },\n (e) => {\n let end = { outcome: \"failed\", reason: \"Error\" };\n try {\n end = rejectedOutcome(e);\n } catch {\n }\n record(rec, dest, startedAt, { status: null, ...end });\n throw e;\n }\n );\n };\n Object.defineProperty(wrapped, WRAPPED, { value: true });\n return wrapped;\n}\nfunction installOutboundRecorder(current) {\n try {\n const g = globalThis;\n const existing = g.fetch;\n if (typeof existing !== \"function\" || existing[WRAPPED]) return;\n g.fetch = recordingFetch(existing, current);\n } catch {\n }\n}\n\n// packages/contracts/dist/wire-auth.js\nfunction secretMatches(presented, expected) {\n const given = presented ?? \"\";\n let diff = given.length ^ expected.length | (given.length === 0 ? 1 : 0);\n for (let i = 0; i < expected.length; i++) {\n diff |= (i < given.length ? given.charCodeAt(i) : 0) ^ expected.charCodeAt(i);\n }\n return diff === 0;\n}\n\n// packages/vertical-host/src/routed-node.ts\nvar ROUTED_ID = /^[0-9A-HJKMNP-TV-Z]{26}$/;\nvar RouterAssertionError = class extends Error {\n};\nfunction readRoutedNode(headers, options = {}) {\n const rawTenant = headers.get(\"x-substrat-tenant\");\n const rawScope = headers.get(\"x-substrat-scope\");\n if (!rawTenant && !rawScope) return null;\n const { expectedSecret, allowUnsigned = false } = options;\n if (expectedSecret) {\n if (!secretMatches(headers.get(\"x-substrat-router\"), expectedSecret)) {\n throw new RouterAssertionError(\"router assertion is not signed by a known router\");\n }\n } else if (!allowUnsigned) {\n throw new RouterAssertionError(\n \"router assertion cannot be verified: this worker has no ROUTER_SECRET configured\"\n );\n }\n if (!rawTenant || !rawScope) {\n throw new RouterAssertionError(\"router assertion is incomplete\");\n }\n if (!ROUTED_ID.test(rawTenant) || !ROUTED_ID.test(rawScope)) {\n throw new RouterAssertionError(\"router assertion carries a malformed id\");\n }\n return {\n tenantId: rawTenant,\n scopeId: rawScope,\n surface: headers.get(\"x-substrat-surface\") ?? \"app\",\n verticalSlug: headers.get(\"x-substrat-vertical\")\n };\n}\n\n// packages/vertical-host/src/invocation-log.ts\nfunction builtinAsyncLocalStorage() {\n try {\n const proc = globalThis.process;\n const mod = proc?.getBuiltinModule?.(\"node:async_hooks\");\n return typeof mod?.AsyncLocalStorage === \"function\" ? mod.AsyncLocalStorage : void 0;\n } catch {\n return void 0;\n }\n}\nfunction storeCallSlot(provided) {\n try {\n const g = globalThis;\n const key = Symbol.for(STORE_CALL_SINK_KEY);\n const existing = g[key];\n if (typeof existing?.run === \"function\" && typeof existing.current === \"function\") return existing;\n const Als = provided ?? builtinAsyncLocalStorage();\n if (!Als) return void 0;\n const storage = new Als();\n const slot = {\n current() {\n const tally = storage.getStore()?.tally;\n return tally ? (call) => tallyStoreCall(tally, call) : void 0;\n },\n invocationId: () => storage.getStore()?.invocationId,\n run: (tally, fn, invocationId) => storage.run({ tally, invocationId }, fn),\n recording: () => storage.getStore()?.tally\n };\n g[key] = slot;\n return slot;\n } catch {\n return void 0;\n }\n}\nfunction currentRecording() {\n const slot = globalThis[Symbol.for(STORE_CALL_SINK_KEY)];\n return typeof slot?.recording === \"function\" ? slot.recording() : void 0;\n}\nfunction runRecording(stamp, started, provided, fn) {\n const slot = storeCallSlot(provided);\n if (!slot) return fn();\n markRequestStart(stamp.record, started);\n installOutboundRecorder(currentRecording);\n return slot.run(stamp.record, fn, stamp.invocationId);\n}\nfunction versionIdOf(env) {\n const v = env?.SUBSTRAT_VERSION_ID;\n return typeof v === \"string\" && v.length > 0 ? v : null;\n}\nvar UPLOAD_LINK_LOG_SECRET_PREFIX = \"sbup_\";\nvar UPLOAD_LINK_SECRET_SEGMENT = /^(\\/api\\/attachment-uploads\\/[^/]+\\/[^/]+\\/)[^/]+/;\nvar SECRET_SHAPED_SEGMENT = new RegExp(`(^|/)${UPLOAD_LINK_LOG_SECRET_PREFIX}[^/]*`, \"g\");\nvar redactUploadLinkSecret = (pathname) => pathname.replace(UPLOAD_LINK_SECRET_SEGMENT, \"$1[redacted]\").replace(SECRET_SHAPED_SEGMENT, \"$1[redacted]\");\nfunction pathOf(url) {\n try {\n return redactUploadLinkSecret(new URL(url).pathname);\n } catch {\n return \"/\";\n }\n}\nvar STAMPS = /* @__PURE__ */ Symbol.for(\"substrat.invocation-stamp\");\nfunction stamps() {\n const g = globalThis;\n return g[STAMPS] ??= /* @__PURE__ */ new WeakMap();\n}\nfunction invocationStampOf(request) {\n return stamps().get(request);\n}\nfunction withRequestId(response, id) {\n const headers = response?.headers;\n try {\n headers?.set?.(REQUEST_ID_HEADER, id);\n return response;\n } catch {\n }\n try {\n const r = response;\n if (r.status === 101) return response;\n const copy = new Response(r.body, r);\n copy.headers.set(REQUEST_ID_HEADER, id);\n return copy;\n } catch {\n return response;\n }\n}\nfunction beginStamp(request, env, options) {\n const stamp = { invocationId: ulid(), record: {} };\n const fieldCoverageId = armedFieldCoverageId(request.headers, env, options);\n if (fieldCoverageId) stamp.fieldCoverageId = fieldCoverageId;\n stamps().set(request, stamp);\n return stamp;\n}\nfunction armedFieldCoverageId(headers, env, options) {\n let id;\n try {\n id = headers.get(FIELD_COVERAGE_HEADER);\n } catch {\n return void 0;\n }\n if (id === null || !ROUTED_ID.test(id)) return void 0;\n return routedNodeOrNull(headers, env, options) !== null ? id : void 0;\n}\nfunction writeInvocationLine(stamp, done, options) {\n try {\n writeLineOrThrow(stamp, done, options);\n } catch (e) {\n try {\n console.log(JSON.stringify({ substrat: \"invocation-log-fault\", detail: String(e) }));\n } catch {\n }\n }\n}\nfunction writeLineOrThrow(stamp, done, options) {\n const node = routedNodeOrNull(done.request.headers, done.env, options);\n if (!node) return;\n const { record: record2, invocationId } = stamp;\n const line = invocationLine({\n tenantId: node.tenantId,\n scopeId: node.scopeId,\n vertical: node.verticalSlug,\n surface: node.surface,\n method: done.request.method,\n path: pathOf(done.request.url),\n status: done.status,\n threw: done.threw,\n durationMs: Date.now() - done.started,\n invocationId,\n level: invocationLevelOf(done.status, done.threw, record2.problemCode),\n operation: record2.operation,\n problemCode: record2.problemCode,\n principalKind: record2.principalKind,\n ...record2.emitted ? { emitted: record2.emitted } : {},\n versionId: versionIdOf(done.env),\n ...record2.outputFields ? { outputFields: record2.outputFields } : {},\n ...stamp.fieldCoverageId ? { fieldCoverageId: stamp.fieldCoverageId } : {},\n ...record2.storeCalls && record2.storeCalls.length > 0 ? { storeCalls: record2.storeCalls } : {},\n ...record2.storeCallsDropped ? { storeCallsDropped: record2.storeCallsDropped } : {},\n ...record2.outboundCalls && record2.outboundCalls.length > 0 ? { outboundCalls: record2.outboundCalls } : {},\n ...record2.outboundCallsDropped ? { outboundCallsDropped: record2.outboundCallsDropped } : {}\n });\n console.log(JSON.stringify(line));\n}\nvar OTHER_HANDLERS = [\"scheduled\", \"queue\", \"email\", \"tail\", \"trace\", \"alarm\", \"test\"];\nfunction withInvocationLog(worker, options = {}) {\n const inner = worker?.fetch;\n if (typeof inner !== \"function\") return worker;\n const wrapped = {\n async fetch(request, env, ctx) {\n if (invocationStampOf(request)) return inner.call(worker, request, env, ctx);\n const started = Date.now();\n const stamp = beginStamp(request, env, options);\n let status = null;\n let threw = false;\n try {\n const response = withRequestId(\n await runRecording(stamp, started, options.asyncLocalStorage, () => inner.call(worker, request, env, ctx)),\n stamp.invocationId\n );\n status = response.status;\n handRecordToRouter(response, stamp.record, request, env, options);\n return response;\n } catch (e) {\n threw = true;\n throw e;\n } finally {\n writeInvocationLine(stamp, { request, env, status, threw, started }, options);\n }\n }\n };\n for (const name of OTHER_HANDLERS) {\n const h = worker[name];\n if (typeof h === \"function\") wrapped[name] = h.bind(worker);\n }\n return wrapped;\n}\nfunction handRecordToRouter(response, record2, request, env, options) {\n try {\n const value = encodeInvocationRecord(record2);\n if (value === null || !routedNodeOrNull(request.headers, env, options)) return;\n response.headers?.set?.(\n INVOCATION_RECORD_HEADER,\n value\n );\n } catch {\n }\n}\nfunction routedNodeOrNull(headers, env, options) {\n try {\n return readRoutedNode(headers, {\n expectedSecret: options.routerSecret?.(env),\n allowUnsigned: options.allowUnsigned?.(env) ?? false\n });\n } catch (e) {\n if (!(e instanceof RouterAssertionError)) console.log(JSON.stringify({ substrat: \"invocation-log-fault\", detail: String(e) }));\n return null;\n }\n}\n\n// substrat-platform-entry.ts\nimport * as vertical from \"__SUBSTRAT_VERTICAL_ENTRY__\";\nexport * from \"__SUBSTRAT_VERTICAL_ENTRY__\";\nvar substrat_platform_entry_default = withInvocationLog(vertical.default, {\n routerSecret: (env) => env.ROUTER_SECRET,\n allowUnsigned: (env) => env.ALLOW_DEV_NODE === \"true\",\n asyncLocalStorage: AsyncLocalStorage\n});\nexport {\n substrat_platform_entry_default as default\n};\n";
|
|
14
14
|
/**
|
|
15
15
|
* #2245: the entry's `node:async_hooks` import, as it appears in `PLATFORM_ENTRY_SOURCE`, and
|
|
16
16
|
* the line the uploader puts in its place for a script that can have no `AsyncLocalStorage`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-entry.generated.js","sourceRoot":"","sources":["../src/platform-entry.generated.ts"],"names":[],"mappings":"AAAA,8KAA8K;AAC9K,sEAAsE;AAEtE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,4BAA4B,CAAC;AAElE,gFAAgF;AAChF,MAAM,CAAC,MAAM,0BAA0B,GAAG,6BAA6B,CAAC;AAExE,6CAA6C;AAC7C,MAAM,CAAC,MAAM,qBAAqB,GAAW,
|
|
1
|
+
{"version":3,"file":"platform-entry.generated.js","sourceRoot":"","sources":["../src/platform-entry.generated.ts"],"names":[],"mappings":"AAAA,8KAA8K;AAC9K,sEAAsE;AAEtE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,4BAA4B,CAAC;AAElE,gFAAgF;AAChF,MAAM,CAAC,MAAM,0BAA0B,GAAG,6BAA6B,CAAC;AAExE,6CAA6C;AAC7C,MAAM,CAAC,MAAM,qBAAqB,GAAW,ysnBAAysnB,CAAC;AAEvvnB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,yDAAyD,CAAC;AACnG,MAAM,CAAC,MAAM,2BAA2B,GAAG,sCAAsC,CAAC;AAElF;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,8BAA8B,CAAC;AAEtE,8CAA8C;AAC9C,MAAM,CAAC,MAAM,uBAAuB,GAAW,o0TAAo0T,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type PlatformActorId, type ReservedStoreOperation, type Scope, type ScopeDumpTable, type
|
|
1
|
+
import { type PlatformActorId, type ReservedStoreOperation, type Scope, type ScopeDumpTable, type StoreDriverRegistration } from '@substrat-run/contracts';
|
|
2
2
|
import { type HostAdmin } from '@substrat-run/kernel';
|
|
3
3
|
/**
|
|
4
4
|
* A reserved scope-store call, made by the control plane straight at the store
|
|
@@ -13,7 +13,7 @@ export interface PlatformScopeStoreDispatch {
|
|
|
13
13
|
}
|
|
14
14
|
export interface PlatformScopeStoreTarget {
|
|
15
15
|
readonly vertical: string;
|
|
16
|
-
readonly
|
|
16
|
+
readonly driver: string;
|
|
17
17
|
readonly tenantId: string;
|
|
18
18
|
readonly scopeId: string;
|
|
19
19
|
readonly binding: string;
|
|
@@ -21,7 +21,7 @@ export interface PlatformScopeStoreTarget {
|
|
|
21
21
|
/** One declared binding, as a version manifest lists it. */
|
|
22
22
|
export interface DeclaredScopeStore {
|
|
23
23
|
readonly binding: string;
|
|
24
|
-
readonly
|
|
24
|
+
readonly driver: string;
|
|
25
25
|
}
|
|
26
26
|
export interface PlatformScopeStores {
|
|
27
27
|
exportStores(input: {
|
|
@@ -31,7 +31,7 @@ export interface PlatformScopeStores {
|
|
|
31
31
|
stores: readonly DeclaredScopeStore[];
|
|
32
32
|
}): Promise<{
|
|
33
33
|
binding: string;
|
|
34
|
-
|
|
34
|
+
driver: string;
|
|
35
35
|
tables: ScopeDumpTable[];
|
|
36
36
|
}[]>;
|
|
37
37
|
importStores(input: {
|
|
@@ -40,7 +40,7 @@ export interface PlatformScopeStores {
|
|
|
40
40
|
vertical: string;
|
|
41
41
|
stores: readonly {
|
|
42
42
|
binding: string;
|
|
43
|
-
|
|
43
|
+
driver: string;
|
|
44
44
|
tables: ScopeDumpTable[];
|
|
45
45
|
}[];
|
|
46
46
|
}): Promise<void>;
|
|
@@ -104,7 +104,7 @@ export declare function unrouteScope(admin: Pick<HostAdmin, 'listHostnames' | 'u
|
|
|
104
104
|
* ordinary install whose store the router serves. A pin that names another script than the
|
|
105
105
|
* pointer's is unknown, as #2242's erasure gate has it.
|
|
106
106
|
*
|
|
107
|
-
* The gate is `mayHoldScopeStores`: with no
|
|
107
|
+
* The gate is `mayHoldScopeStores`: with no driver registered nothing can hold a store, and the
|
|
108
108
|
* answer is none. Otherwise a version that cannot be named, a manifest that cannot be read, or one
|
|
109
109
|
* the gate says may hold a store without naming it refuses (503), rather than let a backup, a
|
|
110
110
|
* wipe, a replay or an erasure skip a store that may hold data.
|
|
@@ -112,7 +112,7 @@ export declare function unrouteScope(admin: Pick<HostAdmin, 'listHostnames' | 'u
|
|
|
112
112
|
* `running` is a resolution the caller already holds (`runningVersionOf`), so a caller that fences
|
|
113
113
|
* on the version reads it once and judges the stores against the same read.
|
|
114
114
|
*/
|
|
115
|
-
export declare function runningVersionStoresOf(admin: Pick<HostAdmin, 'verticalServing' | 'versionManifest'>, actor: PlatformActorId, scope: Pick<Scope, 'id' | 'vertical' | 'verticalVersionId' | 'servingRef'>,
|
|
115
|
+
export declare function runningVersionStoresOf(admin: Pick<HostAdmin, 'verticalServing' | 'versionManifest'>, actor: PlatformActorId, scope: Pick<Scope, 'id' | 'vertical' | 'verticalVersionId' | 'servingRef'>, drivers?: readonly StoreDriverRegistration[], running?: RunningVersion): Promise<DeclaredScopeStore[]>;
|
|
116
116
|
/**
|
|
117
117
|
* What the lifecycle reaches for a scope (#2286, L17): the running version's stores
|
|
118
118
|
* (`runningVersionStoresOf`, which still fails closed first), and every binding any version of its
|
|
@@ -120,17 +120,17 @@ export declare function runningVersionStoresOf(admin: Pick<HostAdmin, 'verticalS
|
|
|
120
120
|
* and the meter reach `all`, so an object under a binding a later version dropped is still
|
|
121
121
|
* reached. A restore imports only into `running` (L8).
|
|
122
122
|
*
|
|
123
|
-
* A binding keeps its
|
|
124
|
-
* running version whose
|
|
123
|
+
* A binding keeps its driver for the life of the vertical, since publish refuses a driver change; a
|
|
124
|
+
* running version whose driver disagrees with the record, or a record that cannot be read,
|
|
125
125
|
* refuses (503).
|
|
126
126
|
*/
|
|
127
|
-
export declare function scopeStoreReachOf(admin: Pick<HostAdmin, 'verticalServing' | 'versionManifest' | 'verticalScopeStores'>, actor: PlatformActorId, scope: Pick<Scope, 'id' | 'vertical' | 'verticalVersionId' | 'servingRef'>,
|
|
127
|
+
export declare function scopeStoreReachOf(admin: Pick<HostAdmin, 'verticalServing' | 'versionManifest' | 'verticalScopeStores'>, actor: PlatformActorId, scope: Pick<Scope, 'id' | 'vertical' | 'verticalVersionId' | 'servingRef'>, drivers?: readonly StoreDriverRegistration[], running?: RunningVersion): Promise<{
|
|
128
128
|
running: DeclaredScopeStore[];
|
|
129
129
|
all: DeclaredScopeStore[];
|
|
130
130
|
}>;
|
|
131
131
|
/** `scopeStoreReachOf`'s `all`: every store the lifecycle reaches for a scope (#2286). */
|
|
132
|
-
export declare function scopeStoresOf(admin: Pick<HostAdmin, 'verticalServing' | 'versionManifest' | 'verticalScopeStores'>, actor: PlatformActorId, scope: Pick<Scope, 'id' | 'vertical' | 'verticalVersionId' | 'servingRef'>,
|
|
133
|
-
/** Sign the envelope and POST the reserved operation at that
|
|
132
|
+
export declare function scopeStoresOf(admin: Pick<HostAdmin, 'verticalServing' | 'versionManifest' | 'verticalScopeStores'>, actor: PlatformActorId, scope: Pick<Scope, 'id' | 'vertical' | 'verticalVersionId' | 'servingRef'>, drivers?: readonly StoreDriverRegistration[], running?: RunningVersion): Promise<DeclaredScopeStore[]>;
|
|
133
|
+
/** Sign the envelope and POST the reserved operation at that driver's script. */
|
|
134
134
|
export declare function callPlatformScopeStore(dispatch: PlatformScopeStoreDispatch, target: PlatformScopeStoreTarget, operation: ReservedStoreOperation, input?: unknown): Promise<unknown>;
|
|
135
135
|
/**
|
|
136
136
|
* The same call at a named script and object: the platform's canary (#2300), which no
|