@spacefast/common 0.0.11 → 0.0.12
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/agents/connect-targets.d.ts +4 -4
- package/dist/agents/connect-targets.js +3 -3
- package/dist/agents/private-key-oauth.d.ts +37 -0
- package/dist/agents/private-key-oauth.js +158 -0
- package/dist/config/domains.js +1 -1
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.js +1 -0
- package/dist/config/postgres-budget.d.ts +126 -0
- package/dist/config/postgres-budget.js +135 -0
- package/dist/config/postgres-budget.json +50 -0
- package/dist/contracts/access.d.ts +42 -24
- package/dist/contracts/access.js +73 -34
- package/dist/contracts/activity.d.ts +1 -1
- package/dist/contracts/activity.js +5 -5
- package/dist/contracts/api-keys.d.ts +53 -45
- package/dist/contracts/api-keys.js +1 -0
- package/dist/contracts/archives.d.ts +8 -8
- package/dist/contracts/builds.d.ts +8 -8
- package/dist/contracts/builds.js +28 -48
- package/dist/contracts/channels.js +1 -2
- package/dist/contracts/comments.d.ts +55 -19
- package/dist/contracts/comments.js +56 -17
- package/dist/contracts/common.d.ts +4 -3
- package/dist/contracts/common.js +2 -0
- package/dist/contracts/deployments.d.ts +3 -3
- package/dist/contracts/device-auth.d.ts +14 -12
- package/dist/contracts/docs.d.ts +5 -5
- package/dist/contracts/domains.d.ts +261 -1330
- package/dist/contracts/domains.js +39 -301
- package/dist/contracts/email-preferences.d.ts +50 -0
- package/dist/contracts/email-preferences.js +44 -0
- package/dist/contracts/enums.d.ts +1 -1
- package/dist/contracts/error-code-meta.d.ts +84 -15
- package/dist/contracts/error-code-meta.js +28 -4
- package/dist/contracts/error-codes.d.ts +1 -1
- package/dist/contracts/error-codes.js +24 -6
- package/dist/contracts/events.d.ts +13 -13
- package/dist/contracts/feature-lifecycle.d.ts +644 -2
- package/dist/contracts/feature-lifecycle.js +685 -2
- package/dist/contracts/features.d.ts +236 -24
- package/dist/contracts/features.js +3 -272
- package/dist/contracts/ids.d.ts +1 -2
- package/dist/contracts/ids.js +1 -2
- package/dist/contracts/internal.d.ts +3 -3
- package/dist/contracts/mcp.d.ts +6 -6
- package/dist/contracts/me.js +1 -1
- package/dist/contracts/mounts.d.ts +142 -0
- package/dist/contracts/mounts.js +56 -0
- package/dist/contracts/oauth-resources.d.ts +5 -5
- package/dist/contracts/oauth-resources.js +1 -0
- package/dist/contracts/operations.d.ts +2 -2
- package/dist/contracts/pages.d.ts +2 -2
- package/dist/contracts/pages.js +8 -3
- package/dist/contracts/plan-policy.d.ts +1 -1
- package/dist/contracts/platform.d.ts +3 -3
- package/dist/contracts/resources.d.ts +12 -20
- package/dist/contracts/resources.js +13 -37
- package/dist/contracts/runtime-api.d.ts +330 -16
- package/dist/contracts/runtime-api.js +58 -14
- package/dist/contracts/sf-config-v1.js +1 -1
- package/dist/contracts/sites.d.ts +12 -12
- package/dist/contracts/sites.js +18 -11
- package/dist/contracts/space-config.d.ts +2 -3
- package/dist/contracts/space-config.js +3 -1
- package/dist/contracts/spaces.d.ts +143 -102
- package/dist/contracts/spaces.js +109 -43
- package/dist/contracts/superadmin-emails.d.ts +25 -1
- package/dist/contracts/superadmin-emails.js +10 -15
- package/dist/contracts/superadmin-runtime.d.ts +2 -2
- package/dist/contracts/superadmin-spaces.d.ts +6 -14
- package/dist/contracts/tags.d.ts +43 -13
- package/dist/contracts/tags.js +195 -11
- package/dist/contracts/transfers.d.ts +1 -1
- package/dist/contracts/variables.d.ts +4 -4
- package/dist/contracts/variables.js +4 -3
- package/dist/contracts/webhooks.d.ts +2 -2
- package/dist/contracts/zero.d.ts +329 -7
- package/dist/contracts/zero.js +121 -2
- package/dist/dashboard-paths/index.d.ts +1 -1
- package/dist/docs/agent-setup.d.ts +4 -2
- package/dist/docs/agent-setup.js +15 -7
- package/dist/docs/agent-solutions.js +1 -1
- package/dist/docs/catalog.d.ts +8 -10
- package/dist/docs/catalog.js +8 -10
- package/dist/docs/error-docs.js +86 -18
- package/dist/utils/access-grant.d.ts +14 -0
- package/dist/utils/access-grant.js +88 -0
- package/dist/utils/access-match.d.ts +7 -0
- package/dist/utils/access-match.fixtures.json +513 -0
- package/dist/utils/access-match.js +32 -16
- package/dist/utils/access-verdict.fixtures.json +421 -0
- package/dist/utils/credential-policy.d.ts +1 -1
- package/dist/utils/dns-instructions.d.ts +29 -0
- package/dist/utils/dns-instructions.js +78 -0
- package/dist/utils/domain-diagnostics.d.ts +29 -0
- package/dist/utils/domain-diagnostics.js +63 -0
- package/dist/utils/egress-policy.fixtures.json +51 -0
- package/dist/utils/id-hints.d.ts +1 -0
- package/dist/utils/id-hints.js +55 -13
- package/dist/utils/page-colors.d.ts +50 -0
- package/dist/utils/page-colors.js +167 -0
- package/dist/utils/page-fonts.d.ts +2 -0
- package/dist/utils/page-fonts.js +4 -0
- package/dist/utils/pages.d.ts +8 -1
- package/dist/utils/pages.js +123 -37
- package/dist/utils/production-runtime.d.ts +18 -0
- package/dist/utils/production-runtime.js +28 -0
- package/dist/utils/query-keys.d.ts +6 -7
- package/dist/utils/query-keys.js +11 -12
- package/dist/utils/sf-config-v1.fixtures.json +9 -0
- package/dist/utils/sf-config-v1.js +28 -19
- package/dist/utils/source-archive-policy.d.ts +2 -0
- package/dist/utils/source-archive-policy.js +2 -0
- package/dist/utils/static-runtime-policy.fixtures.json +57 -0
- package/dist/utils/static-runtime-policy.js +1 -1
- package/package.json +5 -4
- package/dist/contracts/annotations.d.ts +0 -327
- package/dist/contracts/annotations.js +0 -235
- package/dist/contracts/generated-feature-launch-entries.d.ts +0 -2
- package/dist/contracts/generated-feature-launch-entries.js +0 -518
- package/dist/contracts/publishes.d.ts +0 -135
- package/dist/contracts/publishes.js +0 -162
package/dist/contracts/zero.d.ts
CHANGED
|
@@ -43,8 +43,8 @@ export declare const zeroRuntimeKindSchema: z.ZodEnum<{
|
|
|
43
43
|
}>;
|
|
44
44
|
export type ZeroRuntimeKind = z.infer<typeof zeroRuntimeKindSchema>;
|
|
45
45
|
export declare const zeroHttpMethodSchema: z.ZodEnum<{
|
|
46
|
-
PUT: "PUT";
|
|
47
46
|
POST: "POST";
|
|
47
|
+
PUT: "PUT";
|
|
48
48
|
GET: "GET";
|
|
49
49
|
HEAD: "HEAD";
|
|
50
50
|
PATCH: "PATCH";
|
|
@@ -53,8 +53,8 @@ export declare const zeroHttpMethodSchema: z.ZodEnum<{
|
|
|
53
53
|
}>;
|
|
54
54
|
export declare const zeroEndpointSchema: z.ZodObject<{
|
|
55
55
|
method: z.ZodEnum<{
|
|
56
|
-
PUT: "PUT";
|
|
57
56
|
POST: "POST";
|
|
57
|
+
PUT: "PUT";
|
|
58
58
|
GET: "GET";
|
|
59
59
|
HEAD: "HEAD";
|
|
60
60
|
PATCH: "PATCH";
|
|
@@ -64,6 +64,7 @@ export declare const zeroEndpointSchema: z.ZodObject<{
|
|
|
64
64
|
path: z.ZodString;
|
|
65
65
|
}, z.core.$strict>;
|
|
66
66
|
export type ZeroEndpoint = z.infer<typeof zeroEndpointSchema>;
|
|
67
|
+
export declare function zeroEndpointRoutesAmbiguous(left: ZeroEndpoint, right: ZeroEndpoint): boolean;
|
|
67
68
|
export declare const zeroTableColumnSchema: z.ZodObject<{
|
|
68
69
|
name: z.ZodString;
|
|
69
70
|
type: z.ZodEnum<{
|
|
@@ -136,6 +137,31 @@ export declare const zeroRuntimeRunSourceSchema: z.ZodObject<{
|
|
|
136
137
|
db: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
137
138
|
}, z.core.$strict>;
|
|
138
139
|
export type ZeroRuntimeRunSource = z.infer<typeof zeroRuntimeRunSourceSchema>;
|
|
140
|
+
export declare const zeroRuntimeEndpointSourceSchema: z.ZodObject<{
|
|
141
|
+
method: z.ZodEnum<{
|
|
142
|
+
POST: "POST";
|
|
143
|
+
PUT: "PUT";
|
|
144
|
+
GET: "GET";
|
|
145
|
+
HEAD: "HEAD";
|
|
146
|
+
PATCH: "PATCH";
|
|
147
|
+
DELETE: "DELETE";
|
|
148
|
+
OPTIONS: "OPTIONS";
|
|
149
|
+
}>;
|
|
150
|
+
path: z.ZodString;
|
|
151
|
+
endpointId: z.ZodString;
|
|
152
|
+
source: z.ZodString;
|
|
153
|
+
schemaHash: z.ZodOptional<z.ZodString>;
|
|
154
|
+
capabilities: z.ZodDefault<z.ZodObject<{
|
|
155
|
+
db: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
156
|
+
fetch: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
157
|
+
auth: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
158
|
+
env: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
159
|
+
realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
160
|
+
logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
161
|
+
}, z.core.$strip>>;
|
|
162
|
+
db: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
163
|
+
}, z.core.$strict>;
|
|
164
|
+
export type ZeroRuntimeEndpointSource = z.infer<typeof zeroRuntimeEndpointSourceSchema>;
|
|
139
165
|
export declare const zeroMigrationOperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
140
166
|
op: z.ZodLiteral<"create_table">;
|
|
141
167
|
table: z.ZodString;
|
|
@@ -410,8 +436,8 @@ export declare const zeroCapsuleArtifactSchema: z.ZodObject<{
|
|
|
410
436
|
mutations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
411
437
|
endpoints: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
412
438
|
method: z.ZodEnum<{
|
|
413
|
-
PUT: "PUT";
|
|
414
439
|
POST: "POST";
|
|
440
|
+
PUT: "PUT";
|
|
415
441
|
GET: "GET";
|
|
416
442
|
HEAD: "HEAD";
|
|
417
443
|
PATCH: "PATCH";
|
|
@@ -571,8 +597,8 @@ export declare const zeroRuntimeFinalizePayloadSchema: z.ZodObject<{
|
|
|
571
597
|
mutations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
572
598
|
endpoints: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
573
599
|
method: z.ZodEnum<{
|
|
574
|
-
PUT: "PUT";
|
|
575
600
|
POST: "POST";
|
|
601
|
+
PUT: "PUT";
|
|
576
602
|
GET: "GET";
|
|
577
603
|
HEAD: "HEAD";
|
|
578
604
|
PATCH: "PATCH";
|
|
@@ -686,6 +712,30 @@ export declare const zeroRuntimeFinalizePayloadSchema: z.ZodObject<{
|
|
|
686
712
|
size: z.ZodNumber;
|
|
687
713
|
contentBase64: z.ZodString;
|
|
688
714
|
}, z.core.$strict>>>;
|
|
715
|
+
endpointSources: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
716
|
+
method: z.ZodEnum<{
|
|
717
|
+
POST: "POST";
|
|
718
|
+
PUT: "PUT";
|
|
719
|
+
GET: "GET";
|
|
720
|
+
HEAD: "HEAD";
|
|
721
|
+
PATCH: "PATCH";
|
|
722
|
+
DELETE: "DELETE";
|
|
723
|
+
OPTIONS: "OPTIONS";
|
|
724
|
+
}>;
|
|
725
|
+
path: z.ZodString;
|
|
726
|
+
endpointId: z.ZodString;
|
|
727
|
+
source: z.ZodString;
|
|
728
|
+
schemaHash: z.ZodOptional<z.ZodString>;
|
|
729
|
+
capabilities: z.ZodDefault<z.ZodObject<{
|
|
730
|
+
db: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
731
|
+
fetch: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
732
|
+
auth: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
733
|
+
env: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
734
|
+
realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
735
|
+
logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
736
|
+
}, z.core.$strip>>;
|
|
737
|
+
db: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
738
|
+
}, z.core.$strict>>>;
|
|
689
739
|
runSources: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
690
740
|
runId: z.ZodString;
|
|
691
741
|
source: z.ZodString;
|
|
@@ -786,6 +836,253 @@ export declare const zeroRuntimeFinalizePayloadSchema: z.ZodObject<{
|
|
|
786
836
|
}, z.core.$strict>>;
|
|
787
837
|
}, z.core.$strict>;
|
|
788
838
|
export type ZeroRuntimeFinalizePayload = z.infer<typeof zeroRuntimeFinalizePayloadSchema>;
|
|
839
|
+
export declare const zeroRuntimeConfigSchema: z.ZodObject<{
|
|
840
|
+
auth: z.ZodDefault<z.ZodObject<{
|
|
841
|
+
provider: z.ZodDefault<z.ZodLiteral<"wpcom">>;
|
|
842
|
+
signInPath: z.ZodDefault<z.ZodNullable<z.ZodLiteral<"/__spacefast/zero/auth/wpcom/start">>>;
|
|
843
|
+
signInUrl: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
844
|
+
signOutPath: z.ZodDefault<z.ZodNullable<z.ZodLiteral<"/__spacefast/zero/auth/sign-out">>>;
|
|
845
|
+
signOutUrl: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
846
|
+
returnToParam: z.ZodDefault<z.ZodString>;
|
|
847
|
+
}, z.core.$strict>>;
|
|
848
|
+
variables: z.ZodObject<{
|
|
849
|
+
source: z.ZodLiteral<"stattic-variables">;
|
|
850
|
+
names: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
851
|
+
}, z.core.$strict>;
|
|
852
|
+
realtime: z.ZodObject<{
|
|
853
|
+
mode: z.ZodEnum<{
|
|
854
|
+
"stattic-central": "stattic-central";
|
|
855
|
+
"spacefast-cast": "spacefast-cast";
|
|
856
|
+
"local-dev": "local-dev";
|
|
857
|
+
}>;
|
|
858
|
+
centralUrl: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
859
|
+
replayUrl: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
860
|
+
castResourceKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
861
|
+
eventCallback: z.ZodOptional<z.ZodObject<{
|
|
862
|
+
url: z.ZodString;
|
|
863
|
+
token: z.ZodString;
|
|
864
|
+
}, z.core.$strict>>;
|
|
865
|
+
}, z.core.$strict>;
|
|
866
|
+
runtimeKind: z.ZodLiteral<"zero">;
|
|
867
|
+
migrations: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
868
|
+
format: z.ZodLiteral<"stattic.zero.migrations.v1">;
|
|
869
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
870
|
+
safe: "safe";
|
|
871
|
+
drop: "drop";
|
|
872
|
+
rename: "rename";
|
|
873
|
+
}>>;
|
|
874
|
+
schemaHash: z.ZodString;
|
|
875
|
+
operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
876
|
+
op: z.ZodLiteral<"create_table">;
|
|
877
|
+
table: z.ZodString;
|
|
878
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
879
|
+
op: z.ZodLiteral<"add_column">;
|
|
880
|
+
table: z.ZodString;
|
|
881
|
+
column: z.ZodObject<{
|
|
882
|
+
name: z.ZodString;
|
|
883
|
+
type: z.ZodEnum<{
|
|
884
|
+
string: "string";
|
|
885
|
+
number: "number";
|
|
886
|
+
boolean: "boolean";
|
|
887
|
+
json: "json";
|
|
888
|
+
}>;
|
|
889
|
+
nullable: z.ZodDefault<z.ZodBoolean>;
|
|
890
|
+
default: z.ZodOptional<z.ZodUnknown>;
|
|
891
|
+
}, z.core.$strict>;
|
|
892
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
893
|
+
op: z.ZodLiteral<"add_index">;
|
|
894
|
+
table: z.ZodString;
|
|
895
|
+
columns: z.ZodArray<z.ZodString>;
|
|
896
|
+
unique: z.ZodDefault<z.ZodBoolean>;
|
|
897
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
898
|
+
op: z.ZodLiteral<"drop_table">;
|
|
899
|
+
table: z.ZodString;
|
|
900
|
+
explicit: z.ZodLiteral<"drop">;
|
|
901
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
902
|
+
op: z.ZodLiteral<"drop_column">;
|
|
903
|
+
table: z.ZodString;
|
|
904
|
+
column: z.ZodString;
|
|
905
|
+
explicit: z.ZodLiteral<"drop">;
|
|
906
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
907
|
+
op: z.ZodLiteral<"rename_table">;
|
|
908
|
+
from: z.ZodString;
|
|
909
|
+
to: z.ZodString;
|
|
910
|
+
explicit: z.ZodLiteral<"rename">;
|
|
911
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
912
|
+
op: z.ZodLiteral<"rename_column">;
|
|
913
|
+
table: z.ZodString;
|
|
914
|
+
from: z.ZodString;
|
|
915
|
+
to: z.ZodString;
|
|
916
|
+
explicit: z.ZodLiteral<"rename">;
|
|
917
|
+
}, z.core.$strict>], "op">>;
|
|
918
|
+
}, z.core.$strict>>>;
|
|
919
|
+
install: z.ZodObject<{
|
|
920
|
+
runtimeKind: z.ZodLiteral<"zero">;
|
|
921
|
+
engine: z.ZodLiteral<"quickjs-rust">;
|
|
922
|
+
storageRoot: z.ZodLiteral<"__spacefast/zero">;
|
|
923
|
+
artifactPath: z.ZodLiteral<"__spacefast/zero/artifact.json">;
|
|
924
|
+
configPath: z.ZodLiteral<"__spacefast/zero/config.json">;
|
|
925
|
+
binary: z.ZodObject<{
|
|
926
|
+
path: z.ZodLiteral<"__spacefast/zero/bin/stattic-zero-runner">;
|
|
927
|
+
compatibilityTarget: z.ZodObject<{
|
|
928
|
+
profile: z.ZodLiteral<"wpcloud-linux-x86_64-gnu-v1">;
|
|
929
|
+
os: z.ZodLiteral<"linux">;
|
|
930
|
+
cpu: z.ZodLiteral<"x86_64">;
|
|
931
|
+
libc: z.ZodLiteral<"glibc">;
|
|
932
|
+
linking: z.ZodLiteral<"dynamic">;
|
|
933
|
+
requireExecutableBit: z.ZodLiteral<true>;
|
|
934
|
+
}, z.core.$strict>;
|
|
935
|
+
sha256: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
936
|
+
required: z.ZodLiteral<true>;
|
|
937
|
+
}, z.core.$strict>;
|
|
938
|
+
mysql: z.ZodObject<{
|
|
939
|
+
migrateAtFinalize: z.ZodLiteral<true>;
|
|
940
|
+
blockIncompatibleRollback: z.ZodLiteral<true>;
|
|
941
|
+
}, z.core.$strict>;
|
|
942
|
+
realtime: z.ZodObject<{
|
|
943
|
+
production: z.ZodLiteral<"stattic-central">;
|
|
944
|
+
local: z.ZodLiteral<"foreground-cli-ws">;
|
|
945
|
+
}, z.core.$strict>;
|
|
946
|
+
}, z.core.$strict>;
|
|
947
|
+
artifact: z.ZodObject<{
|
|
948
|
+
format: z.ZodLiteral<"stattic.zero.capsule.v1">;
|
|
949
|
+
appName: z.ZodString;
|
|
950
|
+
serverRuntime: z.ZodLiteral<"quickjs-rust">;
|
|
951
|
+
client: z.ZodObject<{
|
|
952
|
+
bundlePath: z.ZodString;
|
|
953
|
+
basePathAware: z.ZodDefault<z.ZodBoolean>;
|
|
954
|
+
}, z.core.$strict>;
|
|
955
|
+
server: z.ZodObject<{
|
|
956
|
+
bundlePath: z.ZodString;
|
|
957
|
+
schema: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
958
|
+
name: z.ZodString;
|
|
959
|
+
columns: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
960
|
+
name: z.ZodString;
|
|
961
|
+
type: z.ZodEnum<{
|
|
962
|
+
string: "string";
|
|
963
|
+
number: "number";
|
|
964
|
+
boolean: "boolean";
|
|
965
|
+
json: "json";
|
|
966
|
+
}>;
|
|
967
|
+
nullable: z.ZodDefault<z.ZodBoolean>;
|
|
968
|
+
default: z.ZodOptional<z.ZodUnknown>;
|
|
969
|
+
}, z.core.$strict>>>;
|
|
970
|
+
}, z.core.$strict>>>;
|
|
971
|
+
queries: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
972
|
+
mutations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
973
|
+
endpoints: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
974
|
+
method: z.ZodEnum<{
|
|
975
|
+
POST: "POST";
|
|
976
|
+
PUT: "PUT";
|
|
977
|
+
GET: "GET";
|
|
978
|
+
HEAD: "HEAD";
|
|
979
|
+
PATCH: "PATCH";
|
|
980
|
+
DELETE: "DELETE";
|
|
981
|
+
OPTIONS: "OPTIONS";
|
|
982
|
+
}>;
|
|
983
|
+
path: z.ZodString;
|
|
984
|
+
}, z.core.$strict>>>;
|
|
985
|
+
sockets: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
986
|
+
}, z.core.$strict>;
|
|
987
|
+
db: z.ZodObject<{
|
|
988
|
+
backend: z.ZodLiteral<"wpcloud-mysql">;
|
|
989
|
+
migrations: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
990
|
+
op: z.ZodLiteral<"create_table">;
|
|
991
|
+
table: z.ZodString;
|
|
992
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
993
|
+
op: z.ZodLiteral<"add_column">;
|
|
994
|
+
table: z.ZodString;
|
|
995
|
+
column: z.ZodObject<{
|
|
996
|
+
name: z.ZodString;
|
|
997
|
+
type: z.ZodEnum<{
|
|
998
|
+
string: "string";
|
|
999
|
+
number: "number";
|
|
1000
|
+
boolean: "boolean";
|
|
1001
|
+
json: "json";
|
|
1002
|
+
}>;
|
|
1003
|
+
nullable: z.ZodDefault<z.ZodBoolean>;
|
|
1004
|
+
default: z.ZodOptional<z.ZodUnknown>;
|
|
1005
|
+
}, z.core.$strict>;
|
|
1006
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1007
|
+
op: z.ZodLiteral<"add_index">;
|
|
1008
|
+
table: z.ZodString;
|
|
1009
|
+
columns: z.ZodArray<z.ZodString>;
|
|
1010
|
+
unique: z.ZodDefault<z.ZodBoolean>;
|
|
1011
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1012
|
+
op: z.ZodLiteral<"drop_table">;
|
|
1013
|
+
table: z.ZodString;
|
|
1014
|
+
explicit: z.ZodLiteral<"drop">;
|
|
1015
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1016
|
+
op: z.ZodLiteral<"drop_column">;
|
|
1017
|
+
table: z.ZodString;
|
|
1018
|
+
column: z.ZodString;
|
|
1019
|
+
explicit: z.ZodLiteral<"drop">;
|
|
1020
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1021
|
+
op: z.ZodLiteral<"rename_table">;
|
|
1022
|
+
from: z.ZodString;
|
|
1023
|
+
to: z.ZodString;
|
|
1024
|
+
explicit: z.ZodLiteral<"rename">;
|
|
1025
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1026
|
+
op: z.ZodLiteral<"rename_column">;
|
|
1027
|
+
table: z.ZodString;
|
|
1028
|
+
from: z.ZodString;
|
|
1029
|
+
to: z.ZodString;
|
|
1030
|
+
explicit: z.ZodLiteral<"rename">;
|
|
1031
|
+
}, z.core.$strict>], "op">>>;
|
|
1032
|
+
}, z.core.$strict>;
|
|
1033
|
+
realtime: z.ZodObject<{
|
|
1034
|
+
mode: z.ZodEnum<{
|
|
1035
|
+
"stattic-central": "stattic-central";
|
|
1036
|
+
"spacefast-cast": "spacefast-cast";
|
|
1037
|
+
"local-dev": "local-dev";
|
|
1038
|
+
}>;
|
|
1039
|
+
mutationEvents: z.ZodDefault<z.ZodBoolean>;
|
|
1040
|
+
}, z.core.$strict>;
|
|
1041
|
+
limits: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1042
|
+
futureCapabilities: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
1043
|
+
ai: "ai";
|
|
1044
|
+
blob: "blob";
|
|
1045
|
+
"generalized-js": "generalized-js";
|
|
1046
|
+
}>>>;
|
|
1047
|
+
sourceManifest: z.ZodObject<{
|
|
1048
|
+
entries: z.ZodObject<{
|
|
1049
|
+
client: z.ZodLiteral<"client/index.tsx">;
|
|
1050
|
+
server: z.ZodLiteral<"server/index.ts">;
|
|
1051
|
+
}, z.core.$strict>;
|
|
1052
|
+
sourceRoot: z.ZodString;
|
|
1053
|
+
files: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1054
|
+
path: z.ZodString;
|
|
1055
|
+
size: z.ZodNumber;
|
|
1056
|
+
sha256: z.ZodString;
|
|
1057
|
+
}, z.core.$strict>>>;
|
|
1058
|
+
env: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
1059
|
+
file: z.ZodLiteral<".env.zero.server">;
|
|
1060
|
+
names: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1061
|
+
}, z.core.$strip>>>;
|
|
1062
|
+
sourceConfig: z.ZodDefault<z.ZodObject<{
|
|
1063
|
+
configFile: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
1064
|
+
path: z.ZodLiteral<"zero.json">;
|
|
1065
|
+
appName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
1066
|
+
deployId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
1067
|
+
name: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
1068
|
+
title: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
1069
|
+
}, z.core.$strip>>>;
|
|
1070
|
+
deployFile: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
1071
|
+
path: z.ZodLiteral<".zero/deploy.json">;
|
|
1072
|
+
keys: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1073
|
+
}, z.core.$strip>>>;
|
|
1074
|
+
}, z.core.$strip>>;
|
|
1075
|
+
}, z.core.$strict>;
|
|
1076
|
+
}, z.core.$strict>;
|
|
1077
|
+
inspect: z.ZodDefault<z.ZodObject<{
|
|
1078
|
+
policy: z.ZodDefault<z.ZodEnum<{
|
|
1079
|
+
public: "public";
|
|
1080
|
+
private: "private";
|
|
1081
|
+
}>>;
|
|
1082
|
+
}, z.core.$strict>>;
|
|
1083
|
+
variableValues: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1084
|
+
}, z.core.$strict>;
|
|
1085
|
+
export type ZeroRuntimeConfig = z.infer<typeof zeroRuntimeConfigSchema>;
|
|
789
1086
|
export declare const zeroDeployMetadataSchema: z.ZodObject<{
|
|
790
1087
|
artifactId: z.ZodOptional<z.ZodString>;
|
|
791
1088
|
finalize: z.ZodObject<{
|
|
@@ -846,8 +1143,8 @@ export declare const zeroDeployMetadataSchema: z.ZodObject<{
|
|
|
846
1143
|
mutations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
847
1144
|
endpoints: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
848
1145
|
method: z.ZodEnum<{
|
|
849
|
-
PUT: "PUT";
|
|
850
1146
|
POST: "POST";
|
|
1147
|
+
PUT: "PUT";
|
|
851
1148
|
GET: "GET";
|
|
852
1149
|
HEAD: "HEAD";
|
|
853
1150
|
PATCH: "PATCH";
|
|
@@ -961,6 +1258,30 @@ export declare const zeroDeployMetadataSchema: z.ZodObject<{
|
|
|
961
1258
|
size: z.ZodNumber;
|
|
962
1259
|
contentBase64: z.ZodString;
|
|
963
1260
|
}, z.core.$strict>>>;
|
|
1261
|
+
endpointSources: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1262
|
+
method: z.ZodEnum<{
|
|
1263
|
+
POST: "POST";
|
|
1264
|
+
PUT: "PUT";
|
|
1265
|
+
GET: "GET";
|
|
1266
|
+
HEAD: "HEAD";
|
|
1267
|
+
PATCH: "PATCH";
|
|
1268
|
+
DELETE: "DELETE";
|
|
1269
|
+
OPTIONS: "OPTIONS";
|
|
1270
|
+
}>;
|
|
1271
|
+
path: z.ZodString;
|
|
1272
|
+
endpointId: z.ZodString;
|
|
1273
|
+
source: z.ZodString;
|
|
1274
|
+
schemaHash: z.ZodOptional<z.ZodString>;
|
|
1275
|
+
capabilities: z.ZodDefault<z.ZodObject<{
|
|
1276
|
+
db: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1277
|
+
fetch: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1278
|
+
auth: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1279
|
+
env: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1280
|
+
realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1281
|
+
logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1282
|
+
}, z.core.$strip>>;
|
|
1283
|
+
db: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1284
|
+
}, z.core.$strict>>>;
|
|
964
1285
|
runSources: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
965
1286
|
runId: z.ZodString;
|
|
966
1287
|
source: z.ZodString;
|
|
@@ -1108,8 +1429,8 @@ export declare const zeroInspectResponseSchema: z.ZodObject<{
|
|
|
1108
1429
|
mutations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1109
1430
|
endpoints: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1110
1431
|
method: z.ZodEnum<{
|
|
1111
|
-
PUT: "PUT";
|
|
1112
1432
|
POST: "POST";
|
|
1433
|
+
PUT: "PUT";
|
|
1113
1434
|
GET: "GET";
|
|
1114
1435
|
HEAD: "HEAD";
|
|
1115
1436
|
PATCH: "PATCH";
|
|
@@ -1191,8 +1512,8 @@ export declare const zeroInspectPublicResponseSchema: z.ZodObject<{
|
|
|
1191
1512
|
mutations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1192
1513
|
endpoints: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1193
1514
|
method: z.ZodEnum<{
|
|
1194
|
-
PUT: "PUT";
|
|
1195
1515
|
POST: "POST";
|
|
1516
|
+
PUT: "PUT";
|
|
1196
1517
|
GET: "GET";
|
|
1197
1518
|
HEAD: "HEAD";
|
|
1198
1519
|
PATCH: "PATCH";
|
|
@@ -1519,6 +1840,7 @@ export declare function createZeroRuntimeFinalizePayload(input: {
|
|
|
1519
1840
|
artifact: z.input<typeof zeroCapsuleArtifactSchema>;
|
|
1520
1841
|
bundles?: z.input<typeof zeroRuntimeBundleSchema>[];
|
|
1521
1842
|
staticFiles?: z.input<typeof zeroRuntimeStaticFileSchema>[];
|
|
1843
|
+
endpointSources?: z.input<typeof zeroRuntimeEndpointSourceSchema>[];
|
|
1522
1844
|
runSources?: z.input<typeof zeroRuntimeRunSourceSchema>[];
|
|
1523
1845
|
migrations?: z.input<typeof zeroMigrationPlanSchema> | null;
|
|
1524
1846
|
runnerSha256?: string | null;
|
package/dist/contracts/zero.js
CHANGED
|
@@ -54,13 +54,58 @@ const zeroEnvNameSchema = z
|
|
|
54
54
|
.max(ZERO_ENV_NAME_MAX_BYTES)
|
|
55
55
|
.regex(/^[A-Za-z_][A-Za-z0-9_]*$/)
|
|
56
56
|
.refine((name) => !ZERO_ENV_RESERVED_PREFIXES.some((prefix) => name.toUpperCase().startsWith(prefix)), { message: "Zero env variable name uses a reserved prefix." });
|
|
57
|
+
function hasWellFormedUnicode(value) {
|
|
58
|
+
for (let index = 0; index < value.length; index++) {
|
|
59
|
+
const codeUnit = value.charCodeAt(index);
|
|
60
|
+
if (codeUnit >= 0xd800 && codeUnit <= 0xdbff) {
|
|
61
|
+
if (index + 1 >= value.length)
|
|
62
|
+
return false;
|
|
63
|
+
const next = value.charCodeAt(index + 1);
|
|
64
|
+
if (next < 0xdc00 || next > 0xdfff)
|
|
65
|
+
return false;
|
|
66
|
+
index++;
|
|
67
|
+
}
|
|
68
|
+
else if (codeUnit >= 0xdc00 && codeUnit <= 0xdfff) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
function hasNoAsciiControlCharacters(value) {
|
|
75
|
+
for (let index = 0; index < value.length; index++) {
|
|
76
|
+
const codeUnit = value.charCodeAt(index);
|
|
77
|
+
if (codeUnit <= 0x1f || codeUnit === 0x7f)
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
57
82
|
const zeroRoutePathSchema = z
|
|
58
83
|
.string()
|
|
59
84
|
.min(1)
|
|
60
85
|
.max(2048)
|
|
61
86
|
.startsWith("/")
|
|
62
|
-
.refine(
|
|
63
|
-
message: "Zero capsule routes must
|
|
87
|
+
.refine(hasWellFormedUnicode, {
|
|
88
|
+
message: "Zero capsule routes must contain well-formed Unicode.",
|
|
89
|
+
})
|
|
90
|
+
.refine((path) => path.normalize("NFC") === path, {
|
|
91
|
+
message: "Zero capsule routes must use NFC-normalized Unicode.",
|
|
92
|
+
})
|
|
93
|
+
.refine(hasNoAsciiControlCharacters, {
|
|
94
|
+
message: "Zero capsule routes must not contain ASCII control characters.",
|
|
95
|
+
})
|
|
96
|
+
.refine((path) => !path.includes("//") &&
|
|
97
|
+
!path.includes("\\") &&
|
|
98
|
+
!path.includes("*") &&
|
|
99
|
+
!path.includes("?") &&
|
|
100
|
+
!path.includes("#") &&
|
|
101
|
+
!path.endsWith("/") &&
|
|
102
|
+
path
|
|
103
|
+
.split("/")
|
|
104
|
+
.every((segment, index, segments) => segment !== "." &&
|
|
105
|
+
segment !== ".." &&
|
|
106
|
+
segment !== ":" &&
|
|
107
|
+
(segment !== ":splat" || index === segments.length - 1)), {
|
|
108
|
+
message: "Zero capsule routes must be absolute app paths without empty, traversal, unnamed parameter, * wildcard, non-terminal splat, \\, ?, or # segments.",
|
|
64
109
|
})
|
|
65
110
|
.refine((path) => !ZERO_RESERVED_APP_ROUTE_PATHS.some((reservedPath) => path === reservedPath), {
|
|
66
111
|
message: "Zero capsule route is reserved by the Zero app shell.",
|
|
@@ -89,6 +134,49 @@ export const zeroEndpointSchema = z
|
|
|
89
134
|
path: zeroRoutePathSchema,
|
|
90
135
|
})
|
|
91
136
|
.strict();
|
|
137
|
+
function zeroEndpointRouteMatchShape(path) {
|
|
138
|
+
const segments = [];
|
|
139
|
+
let score = 0;
|
|
140
|
+
let splat = false;
|
|
141
|
+
for (const segment of path.replace(/^\/+|\/+$/g, "").split("/")) {
|
|
142
|
+
if (!segment)
|
|
143
|
+
continue;
|
|
144
|
+
if (segment === ":splat") {
|
|
145
|
+
score += 1;
|
|
146
|
+
splat = true;
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
if (segment.startsWith(":")) {
|
|
150
|
+
segments.push(null);
|
|
151
|
+
score += 2;
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
segments.push(segment);
|
|
155
|
+
score += 10;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return { score, segments, splat };
|
|
159
|
+
}
|
|
160
|
+
export function zeroEndpointRoutesAmbiguous(left, right) {
|
|
161
|
+
const methodsOverlap = left.method === right.method ||
|
|
162
|
+
(left.method === "GET" && right.method === "HEAD") ||
|
|
163
|
+
(left.method === "HEAD" && right.method === "GET");
|
|
164
|
+
if (!methodsOverlap)
|
|
165
|
+
return false;
|
|
166
|
+
const leftShape = zeroEndpointRouteMatchShape(left.path);
|
|
167
|
+
const rightShape = zeroEndpointRouteMatchShape(right.path);
|
|
168
|
+
if (leftShape.score !== rightShape.score)
|
|
169
|
+
return false;
|
|
170
|
+
if (!leftShape.splat && leftShape.segments.length < rightShape.segments.length)
|
|
171
|
+
return false;
|
|
172
|
+
if (!rightShape.splat && rightShape.segments.length < leftShape.segments.length)
|
|
173
|
+
return false;
|
|
174
|
+
return Array.from({ length: Math.min(leftShape.segments.length, rightShape.segments.length) }, (_, index) => index).every((index) => {
|
|
175
|
+
const segment = leftShape.segments[index];
|
|
176
|
+
const other = rightShape.segments[index];
|
|
177
|
+
return segment === null || other === null || segment === other;
|
|
178
|
+
});
|
|
179
|
+
}
|
|
92
180
|
function zeroDefaultMatchesColumnType(column, ctx) {
|
|
93
181
|
if (!Object.prototype.hasOwnProperty.call(column, "default") || column.default === null) {
|
|
94
182
|
return;
|
|
@@ -201,6 +289,20 @@ export const zeroRuntimeRunSourceSchema = z
|
|
|
201
289
|
db: z.record(z.string(), z.unknown()).optional(),
|
|
202
290
|
})
|
|
203
291
|
.strict();
|
|
292
|
+
export const zeroRuntimeEndpointSourceSchema = z
|
|
293
|
+
.object({
|
|
294
|
+
method: zeroHttpMethodSchema,
|
|
295
|
+
path: zeroRoutePathSchema,
|
|
296
|
+
endpointId: z.string().min(1).max(256),
|
|
297
|
+
source: z
|
|
298
|
+
.string()
|
|
299
|
+
.min(1)
|
|
300
|
+
.max(2 * 1024 * 1024),
|
|
301
|
+
schemaHash: z.string().min(1).max(256).optional(),
|
|
302
|
+
capabilities: zeroRuntimeRunSourceSchema.shape.capabilities,
|
|
303
|
+
db: z.record(z.string(), z.unknown()).optional(),
|
|
304
|
+
})
|
|
305
|
+
.strict();
|
|
204
306
|
export const zeroMigrationOperationSchema = z.discriminatedUnion("op", [
|
|
205
307
|
z
|
|
206
308
|
.object({
|
|
@@ -470,6 +572,7 @@ export const zeroRuntimeFinalizePayloadSchema = z
|
|
|
470
572
|
artifact: zeroCapsuleArtifactSchema,
|
|
471
573
|
bundles: z.array(zeroRuntimeBundleSchema).max(8).default([]),
|
|
472
574
|
staticFiles: z.array(zeroRuntimeStaticFileSchema).max(16).default([]),
|
|
575
|
+
endpointSources: z.array(zeroRuntimeEndpointSourceSchema).max(128).default([]),
|
|
473
576
|
runSources: z.array(zeroRuntimeRunSourceSchema).max(128).default([]),
|
|
474
577
|
migrations: zeroMigrationPlanSchema.nullable().default(null),
|
|
475
578
|
variables: z
|
|
@@ -519,6 +622,21 @@ export const zeroRuntimeFinalizePayloadSchema = z
|
|
|
519
622
|
.default({ policy: "private" }),
|
|
520
623
|
})
|
|
521
624
|
.strict();
|
|
625
|
+
export const zeroRuntimeConfigSchema = zeroRuntimeFinalizePayloadSchema
|
|
626
|
+
.pick({
|
|
627
|
+
runtimeKind: true,
|
|
628
|
+
install: true,
|
|
629
|
+
artifact: true,
|
|
630
|
+
migrations: true,
|
|
631
|
+
variables: true,
|
|
632
|
+
realtime: true,
|
|
633
|
+
auth: true,
|
|
634
|
+
inspect: true,
|
|
635
|
+
})
|
|
636
|
+
.extend({
|
|
637
|
+
variableValues: z.record(z.string(), z.string()).default({}),
|
|
638
|
+
})
|
|
639
|
+
.strict();
|
|
522
640
|
export const zeroDeployMetadataSchema = z
|
|
523
641
|
.object({
|
|
524
642
|
artifactId: z.string().min(1).optional(),
|
|
@@ -735,6 +853,7 @@ export function createZeroRuntimeFinalizePayload(input) {
|
|
|
735
853
|
artifact,
|
|
736
854
|
bundles: input.bundles ?? [],
|
|
737
855
|
staticFiles: input.staticFiles ?? [],
|
|
856
|
+
endpointSources: input.endpointSources ?? [],
|
|
738
857
|
runSources: input.runSources ?? [],
|
|
739
858
|
migrations: input.migrations ?? null,
|
|
740
859
|
variables: {
|
|
@@ -17,7 +17,7 @@ export type TeamSlugRouteReservation = (typeof TEAM_SLUG_ROUTE_RESERVATIONS)[num
|
|
|
17
17
|
export type SpaceSlugRouteReservation = (typeof SPACE_SLUG_ROUTE_RESERVATIONS)[number];
|
|
18
18
|
export declare const TEAM_SLUG_ROUTE_RESERVATION_SET: ReadonlySet<string>;
|
|
19
19
|
export declare const SPACE_SLUG_ROUTE_RESERVATION_SET: ReadonlySet<string>;
|
|
20
|
-
export type SpaceSettingsDestination = "access" | "advanced" | "
|
|
20
|
+
export type SpaceSettingsDestination = "access" | "advanced" | "builds" | "integrations" | "integrations/add" | "source-builds";
|
|
21
21
|
export type TeamSettingsDestination = "access" | "audit" | "developer" | "developer/agents" | "developer/environment-variables" | "developer/handoffs" | "developer/service-tokens" | "developer/webhooks" | "integrations";
|
|
22
22
|
export declare function teamPath(teamSlug: string): string;
|
|
23
23
|
export declare function spacePath(teamSlug: string, spaceSlug: string): string;
|
|
@@ -31,10 +31,12 @@ export type AgentHandoff = Readonly<{
|
|
|
31
31
|
}>;
|
|
32
32
|
/**
|
|
33
33
|
* The single shared grammar for handoff links:
|
|
34
|
-
*
|
|
34
|
+
* `<app-origin>/agent/<documentId>#<secret>`. The document ID must match
|
|
35
35
|
* `[A-Za-z0-9_-]{1,512}` and the secret `[A-Za-z0-9_-]{16,512}` (the minimum keeps secrets
|
|
36
36
|
* high-entropy and makes the public-projection leak check meaningful); the two must differ;
|
|
37
|
-
* queries and embedded credentials are forbidden
|
|
37
|
+
* queries and embedded credentials are forbidden. The URL must sit exactly on the caller's
|
|
38
|
+
* configured HTTP(S) app origin; that origin pin enforces scheme, hostname, and port without a
|
|
39
|
+
* second host allowlist that would reject legitimate dev or container origins.
|
|
38
40
|
* Normalization is part of the contract: the input is WHATWG-URL-normalized first (backslashes,
|
|
39
41
|
* dot segments, stray tab/CR/LF, empty userinfo, case, default ports), the grammar is enforced on
|
|
40
42
|
* the normalized URL, and only the reconstructed canonical URL ever leaves this function.
|