@astrale-domains/services 0.2.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/README.md +37 -0
- package/dist/schema/application/functions.js +20 -0
- package/dist/schema/application/index.d.ts +391 -0
- package/dist/schema/application/index.js +10 -0
- package/dist/schema/deployment/asset.d.ts +29 -0
- package/dist/schema/deployment/asset.js +17 -0
- package/dist/schema/deployment/content.d.ts +12 -0
- package/dist/schema/deployment/content.js +15 -0
- package/dist/schema/deployment/index.d.ts +11 -0
- package/dist/schema/deployment/index.js +6 -0
- package/dist/schema/deployment/limits.d.ts +6 -0
- package/dist/schema/deployment/limits.js +7 -0
- package/dist/schema/deployment/module.d.ts +21 -0
- package/dist/schema/deployment/module.js +11 -0
- package/dist/schema/deployment/request.d.ts +172 -0
- package/dist/schema/deployment/request.js +33 -0
- package/dist/schema/deployment/result.d.ts +24 -0
- package/dist/schema/deployment/result.js +15 -0
- package/dist/schema/index.d.ts +5 -0
- package/dist/schema/index.js +3 -0
- package/dist/schema/service/class.d.ts +340 -0
- package/dist/schema/service/class.js +22 -0
- package/dist/schema/service/index.d.ts +4 -0
- package/dist/schema/service/index.js +4 -0
- package/dist/schema/service/methods.d.ts +135 -0
- package/dist/schema/service/methods.js +64 -0
- package/dist/schema/service/policies.d.ts +4 -0
- package/dist/schema/service/policies.js +12 -0
- package/dist/schema/service/relationships.d.ts +16 -0
- package/dist/schema/service/relationships.js +9 -0
- package/package.json +79 -0
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Services
|
|
2
|
+
|
|
3
|
+
`services.astrale.ai` turns an authored module artifact into an owner-scoped, Cloudflare-backed
|
|
4
|
+
Service. It keeps provider protocols behind a neutral SDK Integration and stores only admitted
|
|
5
|
+
deployment evidence in the graph.
|
|
6
|
+
|
|
7
|
+
## Model
|
|
8
|
+
|
|
9
|
+
- `Service` records one opaque provider name, its public coordinate, deployment mode, URL, state,
|
|
10
|
+
and deployment digest.
|
|
11
|
+
- `service_owned_by` connects the authenticated owner to each Service and governs graph visibility.
|
|
12
|
+
- secret values stay write-only at Cloudflare and never enter Astrale mutations or graph state.
|
|
13
|
+
- schedules remain provider state; only the owner may read or replace them.
|
|
14
|
+
- logs are remote evidence admitted by the Cloudflare Provider before a Workflow returns them.
|
|
15
|
+
|
|
16
|
+
`listServices` is a single-query Action. Deployment, secrets, schedules, logs, and deletion are
|
|
17
|
+
Workflows because they coordinate caller authorization with external effects. `service-hosting` is
|
|
18
|
+
the provider-neutral Integration contract; Cloudflare is its first Provider.
|
|
19
|
+
|
|
20
|
+
## Development
|
|
21
|
+
|
|
22
|
+
Copy `.env.example` to `.env.dev`, fill the Cloudflare values, then run:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
pnpm typecheck
|
|
26
|
+
pnpm test
|
|
27
|
+
pnpm lint
|
|
28
|
+
pnpm frontend:build
|
|
29
|
+
pnpm build
|
|
30
|
+
pnpm package
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The deployed module named by `entry` must be present in `modules`. Module contents use one Base64
|
|
34
|
+
string or bounded Base64 chunks when one string cannot cross the portable Value boundary; names are
|
|
35
|
+
unique and secrets use environment-variable identifiers. Plain and revisioned artifacts are
|
|
36
|
+
distinct modes and cannot replace each other at one Service record. Five-field cron expressions are
|
|
37
|
+
supported when `CLOUDFLARE_SCHEDULE_KV_ID` is configured.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { func } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export const serviceRecord = z.strictObject({
|
|
4
|
+
id: z.string().min(1),
|
|
5
|
+
name: z.string().min(1),
|
|
6
|
+
description: z.string(),
|
|
7
|
+
providerName: z.string().min(1),
|
|
8
|
+
coordinate: z.string().min(1),
|
|
9
|
+
url: z.string().min(1).optional(),
|
|
10
|
+
state: z.enum(['deploying', 'ready', 'failed']),
|
|
11
|
+
digest: z.string().min(1).optional(),
|
|
12
|
+
revision: z.string().optional(),
|
|
13
|
+
error: z.string().optional(),
|
|
14
|
+
});
|
|
15
|
+
export const listServices = func({
|
|
16
|
+
description: 'List Services visible to the authenticated caller.',
|
|
17
|
+
auth: 'authenticated',
|
|
18
|
+
input: z.strictObject({}),
|
|
19
|
+
output: z.array(serviceRecord),
|
|
20
|
+
});
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import type { schema as language } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { KernelSchema } from '@astrale-os/sdk/schema';
|
|
3
|
+
export declare const schema: import("@astrale-os/sdk/schema").DefinedSchema<"services.astrale.ai", import("@astrale-os/sdk/schema").ResolvedDomainOfInput<"services.astrale.ai", {
|
|
4
|
+
readonly dependencies: {
|
|
5
|
+
kernel: KernelSchema;
|
|
6
|
+
};
|
|
7
|
+
readonly classes: {
|
|
8
|
+
readonly CloudflareWorker: import("@astrale-os/sdk/schema").NodeClass<{
|
|
9
|
+
readonly depth: 1;
|
|
10
|
+
readonly abstract: false;
|
|
11
|
+
readonly extends: readonly [import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
|
|
12
|
+
readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Named"> & {
|
|
13
|
+
readonly origin: "kernel.astrale.ai";
|
|
14
|
+
};
|
|
15
|
+
readonly kind: 'node';
|
|
16
|
+
readonly abstract: true;
|
|
17
|
+
}, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Named"> & {
|
|
18
|
+
readonly origin: "kernel.astrale.ai";
|
|
19
|
+
}, "kernel.astrale.ai:class.Named", readonly [import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
|
|
20
|
+
readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
|
|
21
|
+
readonly origin: "kernel.astrale.ai";
|
|
22
|
+
};
|
|
23
|
+
readonly kind: 'node';
|
|
24
|
+
readonly abstract: true;
|
|
25
|
+
}, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
|
|
26
|
+
readonly origin: "kernel.astrale.ai";
|
|
27
|
+
}, "kernel.astrale.ai:class.Node", readonly import("@astrale-os/sdk/schema").AnyResolvedClass[], never, never, never, never, never, never>, ...never[]], import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "name", "kernel.astrale.ai:class.Named.property.name">, never, never, import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "name", "kernel.astrale.ai:class.Named.property.name">, never, never>, import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
|
|
28
|
+
readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Descriptable"> & {
|
|
29
|
+
readonly origin: "kernel.astrale.ai";
|
|
30
|
+
};
|
|
31
|
+
readonly kind: 'node';
|
|
32
|
+
readonly abstract: true;
|
|
33
|
+
}, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Descriptable"> & {
|
|
34
|
+
readonly origin: "kernel.astrale.ai";
|
|
35
|
+
}, "kernel.astrale.ai:class.Descriptable", readonly [import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
|
|
36
|
+
readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
|
|
37
|
+
readonly origin: "kernel.astrale.ai";
|
|
38
|
+
};
|
|
39
|
+
readonly kind: 'node';
|
|
40
|
+
readonly abstract: true;
|
|
41
|
+
}, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
|
|
42
|
+
readonly origin: "kernel.astrale.ai";
|
|
43
|
+
}, "kernel.astrale.ai:class.Node", readonly import("@astrale-os/sdk/schema").AnyResolvedClass[], never, never, never, never, never, never>, ...never[]], import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, false, "description", "kernel.astrale.ai:class.Descriptable.property.description">, never, never, import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, false, "description", "kernel.astrale.ai:class.Descriptable.property.description">, never, never>, import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
|
|
44
|
+
readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Timestamped"> & {
|
|
45
|
+
readonly origin: "kernel.astrale.ai";
|
|
46
|
+
};
|
|
47
|
+
readonly kind: 'node';
|
|
48
|
+
readonly abstract: true;
|
|
49
|
+
}, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Timestamped"> & {
|
|
50
|
+
readonly origin: "kernel.astrale.ai";
|
|
51
|
+
}, "kernel.astrale.ai:class.Timestamped", readonly [import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
|
|
52
|
+
readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
|
|
53
|
+
readonly origin: "kernel.astrale.ai";
|
|
54
|
+
};
|
|
55
|
+
readonly kind: 'node';
|
|
56
|
+
readonly abstract: true;
|
|
57
|
+
}, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
|
|
58
|
+
readonly origin: "kernel.astrale.ai";
|
|
59
|
+
}, "kernel.astrale.ai:class.Node", readonly import("@astrale-os/sdk/schema").AnyResolvedClass[], never, never, never, never, never, never>, ...never[]], import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "createdAt", "kernel.astrale.ai:class.Timestamped.property.createdAt"> | import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "updatedAt", "kernel.astrale.ai:class.Timestamped.property.updatedAt">, never, never, import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "createdAt", "kernel.astrale.ai:class.Timestamped.property.createdAt"> | import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "updatedAt", "kernel.astrale.ai:class.Timestamped.property.updatedAt">, never, never>];
|
|
60
|
+
readonly properties: {
|
|
61
|
+
readonly providerKey: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "providerKey", "self">;
|
|
62
|
+
readonly providerName: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "providerName", "self">;
|
|
63
|
+
readonly deploymentMode: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<"plain" | "revisioned", "plain" | "revisioned", true, "deploymentMode", "self">;
|
|
64
|
+
readonly url: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "url", "self">;
|
|
65
|
+
readonly state: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<"deploying" | "failed" | "ready", "deploying" | "failed" | "ready", true, "state", "self">;
|
|
66
|
+
readonly digest: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "digest", "self">;
|
|
67
|
+
readonly revision: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "revision", "self">;
|
|
68
|
+
readonly coordinate: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "coordinate", "self">;
|
|
69
|
+
readonly deploymentReceipt: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "deploymentReceipt", "self">;
|
|
70
|
+
readonly error: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "error", "self">;
|
|
71
|
+
};
|
|
72
|
+
readonly methods: {
|
|
73
|
+
readonly deploy: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
74
|
+
path: string;
|
|
75
|
+
name?: string | undefined;
|
|
76
|
+
entry?: string | undefined;
|
|
77
|
+
modules?: ({
|
|
78
|
+
contentBase64: string;
|
|
79
|
+
name: string;
|
|
80
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
81
|
+
} | {
|
|
82
|
+
contentBase64Chunks: string[];
|
|
83
|
+
name: string;
|
|
84
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
85
|
+
})[] | undefined;
|
|
86
|
+
revisioned?: {
|
|
87
|
+
revision: string;
|
|
88
|
+
release: {
|
|
89
|
+
entry: string;
|
|
90
|
+
modules: ({
|
|
91
|
+
contentBase64: string;
|
|
92
|
+
name: string;
|
|
93
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
94
|
+
} | {
|
|
95
|
+
contentBase64Chunks: string[];
|
|
96
|
+
name: string;
|
|
97
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
98
|
+
})[];
|
|
99
|
+
};
|
|
100
|
+
gateway: {
|
|
101
|
+
entry: string;
|
|
102
|
+
modules: ({
|
|
103
|
+
contentBase64: string;
|
|
104
|
+
name: string;
|
|
105
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
106
|
+
} | {
|
|
107
|
+
contentBase64Chunks: string[];
|
|
108
|
+
name: string;
|
|
109
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
110
|
+
})[];
|
|
111
|
+
};
|
|
112
|
+
} | undefined;
|
|
113
|
+
compatibilityDate?: string | undefined;
|
|
114
|
+
compatibilityFlags?: string[] | undefined;
|
|
115
|
+
serviceBindings?: {
|
|
116
|
+
name: string;
|
|
117
|
+
service: string;
|
|
118
|
+
}[] | undefined;
|
|
119
|
+
vars?: Record<string, string> | undefined;
|
|
120
|
+
secrets?: Record<string, string> | undefined;
|
|
121
|
+
assets?: {
|
|
122
|
+
files: ({
|
|
123
|
+
contentBase64: string;
|
|
124
|
+
path: string;
|
|
125
|
+
contentType?: string | undefined;
|
|
126
|
+
} | {
|
|
127
|
+
contentBase64Chunks: string[];
|
|
128
|
+
path: string;
|
|
129
|
+
contentType?: string | undefined;
|
|
130
|
+
})[];
|
|
131
|
+
notFound?: "404-page" | "none" | "single-page-application" | undefined;
|
|
132
|
+
runWorkerFirst?: boolean | undefined;
|
|
133
|
+
htmlHandling?: "none" | undefined;
|
|
134
|
+
} | undefined;
|
|
135
|
+
limits?: {
|
|
136
|
+
cpuMs?: number | undefined;
|
|
137
|
+
subrequests?: number | undefined;
|
|
138
|
+
} | undefined;
|
|
139
|
+
}, {
|
|
140
|
+
readonly mode: 'value';
|
|
141
|
+
readonly value: {
|
|
142
|
+
path: string;
|
|
143
|
+
url: string;
|
|
144
|
+
digest: string;
|
|
145
|
+
revision?: string | undefined;
|
|
146
|
+
state: "deploying" | "failed" | "ready";
|
|
147
|
+
error?: string | null | undefined;
|
|
148
|
+
functions: {
|
|
149
|
+
id: string;
|
|
150
|
+
path: string;
|
|
151
|
+
ref: string;
|
|
152
|
+
}[];
|
|
153
|
+
};
|
|
154
|
+
}, "authenticated", true, "default">>;
|
|
155
|
+
readonly setSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
156
|
+
name: string;
|
|
157
|
+
value: string;
|
|
158
|
+
}, {
|
|
159
|
+
readonly mode: 'value';
|
|
160
|
+
readonly value: {
|
|
161
|
+
name: string;
|
|
162
|
+
};
|
|
163
|
+
}, "authenticated", false, "default">>;
|
|
164
|
+
readonly deleteSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
165
|
+
name: string;
|
|
166
|
+
}, {
|
|
167
|
+
readonly mode: 'value';
|
|
168
|
+
readonly value: {
|
|
169
|
+
ok: true;
|
|
170
|
+
};
|
|
171
|
+
}, "authenticated", false, "default">>;
|
|
172
|
+
readonly secrets: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
173
|
+
readonly mode: 'value';
|
|
174
|
+
readonly value: string[];
|
|
175
|
+
}, "authenticated", false, "default">>;
|
|
176
|
+
readonly setSchedule: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
177
|
+
crons: string[];
|
|
178
|
+
}, {
|
|
179
|
+
readonly mode: 'value';
|
|
180
|
+
readonly value: {
|
|
181
|
+
crons: string[];
|
|
182
|
+
};
|
|
183
|
+
}, "authenticated", false, "default">>;
|
|
184
|
+
readonly schedules: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
185
|
+
readonly mode: 'value';
|
|
186
|
+
readonly value: string[];
|
|
187
|
+
}, "authenticated", false, "default">>;
|
|
188
|
+
readonly logs: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
189
|
+
tail?: number | undefined;
|
|
190
|
+
since?: number | undefined;
|
|
191
|
+
}, {
|
|
192
|
+
readonly mode: 'value';
|
|
193
|
+
readonly value: {
|
|
194
|
+
id: string;
|
|
195
|
+
ts: number;
|
|
196
|
+
level: string;
|
|
197
|
+
line: string;
|
|
198
|
+
}[];
|
|
199
|
+
}, "authenticated", false, "default">>;
|
|
200
|
+
readonly delete: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
201
|
+
readonly mode: 'value';
|
|
202
|
+
readonly value: {
|
|
203
|
+
ok: true;
|
|
204
|
+
};
|
|
205
|
+
}, "authenticated", false, "default">>;
|
|
206
|
+
};
|
|
207
|
+
readonly effectiveProperties: (import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "coordinate", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<"plain" | "revisioned", "plain" | "revisioned", true, "deploymentMode", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "deploymentReceipt", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "digest", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "error", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "providerKey", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "providerName", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "revision", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<"deploying" | "failed" | "ready", "deploying" | "failed" | "ready", true, "state", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "url", "self">) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, false> & {
|
|
208
|
+
readonly name: "description";
|
|
209
|
+
readonly key: "kernel.astrale.ai:class.Descriptable.property.description";
|
|
210
|
+
}) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
|
|
211
|
+
readonly name: "createdAt";
|
|
212
|
+
readonly key: "kernel.astrale.ai:class.Timestamped.property.createdAt";
|
|
213
|
+
}) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
|
|
214
|
+
readonly name: "name";
|
|
215
|
+
readonly key: "kernel.astrale.ai:class.Named.property.name";
|
|
216
|
+
}) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
|
|
217
|
+
readonly name: "updatedAt";
|
|
218
|
+
readonly key: "kernel.astrale.ai:class.Timestamped.property.updatedAt";
|
|
219
|
+
});
|
|
220
|
+
readonly effectiveInstanceMethods: import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
221
|
+
readonly mode: 'value';
|
|
222
|
+
readonly value: string[];
|
|
223
|
+
}, "authenticated", false, "default">>, "schedules", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
224
|
+
readonly mode: 'value';
|
|
225
|
+
readonly value: string[];
|
|
226
|
+
}, "authenticated", false, "default">>, "secrets", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
227
|
+
readonly mode: 'value';
|
|
228
|
+
readonly value: {
|
|
229
|
+
ok: true;
|
|
230
|
+
};
|
|
231
|
+
}, "authenticated", false, "default">>, "delete", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
232
|
+
name: string;
|
|
233
|
+
value: string;
|
|
234
|
+
}, {
|
|
235
|
+
readonly mode: 'value';
|
|
236
|
+
readonly value: {
|
|
237
|
+
name: string;
|
|
238
|
+
};
|
|
239
|
+
}, "authenticated", false, "default">>, "setSecret", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
240
|
+
name: string;
|
|
241
|
+
}, {
|
|
242
|
+
readonly mode: 'value';
|
|
243
|
+
readonly value: {
|
|
244
|
+
ok: true;
|
|
245
|
+
};
|
|
246
|
+
}, "authenticated", false, "default">>, "deleteSecret", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
247
|
+
crons: string[];
|
|
248
|
+
}, {
|
|
249
|
+
readonly mode: 'value';
|
|
250
|
+
readonly value: {
|
|
251
|
+
crons: string[];
|
|
252
|
+
};
|
|
253
|
+
}, "authenticated", false, "default">>, "setSchedule", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
254
|
+
tail?: number | undefined;
|
|
255
|
+
since?: number | undefined;
|
|
256
|
+
}, {
|
|
257
|
+
readonly mode: 'value';
|
|
258
|
+
readonly value: {
|
|
259
|
+
id: string;
|
|
260
|
+
ts: number;
|
|
261
|
+
level: string;
|
|
262
|
+
line: string;
|
|
263
|
+
}[];
|
|
264
|
+
}, "authenticated", false, "default">>, "logs", "self">;
|
|
265
|
+
readonly effectiveStaticMethods: import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
266
|
+
path: string;
|
|
267
|
+
name?: string | undefined;
|
|
268
|
+
entry?: string | undefined;
|
|
269
|
+
modules?: ({
|
|
270
|
+
contentBase64: string;
|
|
271
|
+
name: string;
|
|
272
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
273
|
+
} | {
|
|
274
|
+
contentBase64Chunks: string[];
|
|
275
|
+
name: string;
|
|
276
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
277
|
+
})[] | undefined;
|
|
278
|
+
revisioned?: {
|
|
279
|
+
revision: string;
|
|
280
|
+
release: {
|
|
281
|
+
entry: string;
|
|
282
|
+
modules: ({
|
|
283
|
+
contentBase64: string;
|
|
284
|
+
name: string;
|
|
285
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
286
|
+
} | {
|
|
287
|
+
contentBase64Chunks: string[];
|
|
288
|
+
name: string;
|
|
289
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
290
|
+
})[];
|
|
291
|
+
};
|
|
292
|
+
gateway: {
|
|
293
|
+
entry: string;
|
|
294
|
+
modules: ({
|
|
295
|
+
contentBase64: string;
|
|
296
|
+
name: string;
|
|
297
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
298
|
+
} | {
|
|
299
|
+
contentBase64Chunks: string[];
|
|
300
|
+
name: string;
|
|
301
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
302
|
+
})[];
|
|
303
|
+
};
|
|
304
|
+
} | undefined;
|
|
305
|
+
compatibilityDate?: string | undefined;
|
|
306
|
+
compatibilityFlags?: string[] | undefined;
|
|
307
|
+
serviceBindings?: {
|
|
308
|
+
name: string;
|
|
309
|
+
service: string;
|
|
310
|
+
}[] | undefined;
|
|
311
|
+
vars?: Record<string, string> | undefined;
|
|
312
|
+
secrets?: Record<string, string> | undefined;
|
|
313
|
+
assets?: {
|
|
314
|
+
files: ({
|
|
315
|
+
contentBase64: string;
|
|
316
|
+
path: string;
|
|
317
|
+
contentType?: string | undefined;
|
|
318
|
+
} | {
|
|
319
|
+
contentBase64Chunks: string[];
|
|
320
|
+
path: string;
|
|
321
|
+
contentType?: string | undefined;
|
|
322
|
+
})[];
|
|
323
|
+
notFound?: "404-page" | "none" | "single-page-application" | undefined;
|
|
324
|
+
runWorkerFirst?: boolean | undefined;
|
|
325
|
+
htmlHandling?: "none" | undefined;
|
|
326
|
+
} | undefined;
|
|
327
|
+
limits?: {
|
|
328
|
+
cpuMs?: number | undefined;
|
|
329
|
+
subrequests?: number | undefined;
|
|
330
|
+
} | undefined;
|
|
331
|
+
}, {
|
|
332
|
+
readonly mode: 'value';
|
|
333
|
+
readonly value: {
|
|
334
|
+
path: string;
|
|
335
|
+
url: string;
|
|
336
|
+
digest: string;
|
|
337
|
+
revision?: string | undefined;
|
|
338
|
+
state: "deploying" | "failed" | "ready";
|
|
339
|
+
error?: string | null | undefined;
|
|
340
|
+
functions: {
|
|
341
|
+
id: string;
|
|
342
|
+
path: string;
|
|
343
|
+
ref: string;
|
|
344
|
+
}[];
|
|
345
|
+
};
|
|
346
|
+
}, "authenticated", true, "default">>, "deploy", "self">;
|
|
347
|
+
}>;
|
|
348
|
+
readonly service_owned_by: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
|
|
349
|
+
readonly depth: 0;
|
|
350
|
+
readonly abstract: false;
|
|
351
|
+
readonly extends: readonly [];
|
|
352
|
+
readonly properties: never;
|
|
353
|
+
readonly source: {
|
|
354
|
+
readonly as: "owner";
|
|
355
|
+
readonly outgoing: "0..*";
|
|
356
|
+
};
|
|
357
|
+
readonly target: {
|
|
358
|
+
readonly as: "service";
|
|
359
|
+
readonly incoming: "1";
|
|
360
|
+
};
|
|
361
|
+
readonly constraints: Record<never, never>;
|
|
362
|
+
readonly effectiveProperties: never;
|
|
363
|
+
}>;
|
|
364
|
+
};
|
|
365
|
+
readonly policies: {
|
|
366
|
+
readonly ObserveService: import("@astrale-os/sdk/schema").Policy;
|
|
367
|
+
readonly TraverseOwnedService: import("@astrale-os/sdk/schema").Policy;
|
|
368
|
+
};
|
|
369
|
+
readonly functions: {
|
|
370
|
+
readonly listServices: import("@astrale-os/sdk/schema").Function<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
371
|
+
readonly mode: 'value';
|
|
372
|
+
readonly value: {
|
|
373
|
+
id: string;
|
|
374
|
+
name: string;
|
|
375
|
+
description: string;
|
|
376
|
+
providerName: string;
|
|
377
|
+
coordinate: string;
|
|
378
|
+
url?: string | undefined;
|
|
379
|
+
state: "deploying" | "failed" | "ready";
|
|
380
|
+
digest?: string | undefined;
|
|
381
|
+
revision?: string | undefined;
|
|
382
|
+
error?: string | undefined;
|
|
383
|
+
}[];
|
|
384
|
+
}, "authenticated", false, "default">>;
|
|
385
|
+
};
|
|
386
|
+
readonly views: {
|
|
387
|
+
application: import("@astrale-os/sdk/schema").View;
|
|
388
|
+
};
|
|
389
|
+
}>>;
|
|
390
|
+
export type ServicesSchema = typeof schema;
|
|
391
|
+
export type ServicesDomain = language.DomainOf<typeof schema>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { KernelSchema, defineSchema, view } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { CloudflareWorker, ObserveService, TraverseOwnedService, service_owned_by, } from '#schema/service';
|
|
3
|
+
import { listServices } from './functions.js';
|
|
4
|
+
export const schema = defineSchema('services.astrale.ai', {
|
|
5
|
+
dependencies: { kernel: KernelSchema },
|
|
6
|
+
classes: { CloudflareWorker, service_owned_by },
|
|
7
|
+
policies: { ObserveService, TraverseOwnedService },
|
|
8
|
+
functions: { listServices },
|
|
9
|
+
views: { application: view({}) },
|
|
10
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const assetFile: z.ZodUnion<readonly [z.ZodObject<{
|
|
3
|
+
contentBase64: z.ZodString;
|
|
4
|
+
path: z.ZodString;
|
|
5
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
7
|
+
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
8
|
+
path: z.ZodString;
|
|
9
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, z.core.$strict>]>;
|
|
11
|
+
export declare const assetBundle: z.ZodObject<{
|
|
12
|
+
files: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
13
|
+
contentBase64: z.ZodString;
|
|
14
|
+
path: z.ZodString;
|
|
15
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
17
|
+
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
18
|
+
path: z.ZodString;
|
|
19
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$strict>]>>;
|
|
21
|
+
notFound: z.ZodOptional<z.ZodEnum<{
|
|
22
|
+
"404-page": "404-page";
|
|
23
|
+
none: "none";
|
|
24
|
+
"single-page-application": "single-page-application";
|
|
25
|
+
}>>;
|
|
26
|
+
runWorkerFirst: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
htmlHandling: z.ZodOptional<z.ZodLiteral<"none">>;
|
|
28
|
+
}, z.core.$strict>;
|
|
29
|
+
export type AssetBundle = z.infer<typeof assetBundle>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { encodedContent, MAX_ASSET_BASE64_SIZE } from './content.js';
|
|
3
|
+
const fields = {
|
|
4
|
+
path: z.string().min(1).max(2_048),
|
|
5
|
+
contentType: z.string().min(1).max(256).optional(),
|
|
6
|
+
};
|
|
7
|
+
const content = encodedContent(MAX_ASSET_BASE64_SIZE);
|
|
8
|
+
export const assetFile = z.union([
|
|
9
|
+
z.strictObject({ ...fields, ...content.inline }),
|
|
10
|
+
z.strictObject({ ...fields, ...content.chunked }),
|
|
11
|
+
]);
|
|
12
|
+
export const assetBundle = z.strictObject({
|
|
13
|
+
files: z.array(assetFile).min(1).max(2_000),
|
|
14
|
+
notFound: z.enum(['none', '404-page', 'single-page-application']).optional(),
|
|
15
|
+
runWorkerFirst: z.boolean().optional(),
|
|
16
|
+
htmlHandling: z.literal('none').optional(),
|
|
17
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const PORTABLE_BASE64_CHUNK_SIZE: number;
|
|
3
|
+
export declare const MAX_MODULE_BASE64_SIZE: number;
|
|
4
|
+
export declare const MAX_ASSET_BASE64_SIZE: number;
|
|
5
|
+
export declare function encodedContent(maximumSize: number): Readonly<{
|
|
6
|
+
inline: {
|
|
7
|
+
contentBase64: z.ZodString;
|
|
8
|
+
};
|
|
9
|
+
chunked: {
|
|
10
|
+
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const PORTABLE_BASE64_CHUNK_SIZE = 512 * 1024;
|
|
3
|
+
export const MAX_MODULE_BASE64_SIZE = 10 * 1024 * 1024;
|
|
4
|
+
export const MAX_ASSET_BASE64_SIZE = 16 * 1024 * 1024;
|
|
5
|
+
export function encodedContent(maximumSize) {
|
|
6
|
+
return Object.freeze({
|
|
7
|
+
inline: { contentBase64: z.string().max(maximumSize) },
|
|
8
|
+
chunked: {
|
|
9
|
+
contentBase64Chunks: z
|
|
10
|
+
.array(z.string().min(1).max(PORTABLE_BASE64_CHUNK_SIZE))
|
|
11
|
+
.min(1)
|
|
12
|
+
.max(Math.ceil(maximumSize / PORTABLE_BASE64_CHUNK_SIZE)),
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { assetBundle, assetFile } from './asset.js';
|
|
2
|
+
export type { AssetBundle } from './asset.js';
|
|
3
|
+
export { MAX_ASSET_BASE64_SIZE, MAX_MODULE_BASE64_SIZE, PORTABLE_BASE64_CHUNK_SIZE, } from './content.js';
|
|
4
|
+
export { resourceLimits } from './limits.js';
|
|
5
|
+
export type { ResourceLimits } from './limits.js';
|
|
6
|
+
export { artifactModule } from './module.js';
|
|
7
|
+
export type { ArtifactModule } from './module.js';
|
|
8
|
+
export { artifact, deployServiceInput, revisionedDeployment } from './request.js';
|
|
9
|
+
export type { DeployServiceInput } from './request.js';
|
|
10
|
+
export { deployedFunction, deployServiceOutput } from './result.js';
|
|
11
|
+
export type { DeployServiceOutput } from './result.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { assetBundle, assetFile } from './asset.js';
|
|
2
|
+
export { MAX_ASSET_BASE64_SIZE, MAX_MODULE_BASE64_SIZE, PORTABLE_BASE64_CHUNK_SIZE, } from './content.js';
|
|
3
|
+
export { resourceLimits } from './limits.js';
|
|
4
|
+
export { artifactModule } from './module.js';
|
|
5
|
+
export { artifact, deployServiceInput, revisionedDeployment } from './request.js';
|
|
6
|
+
export { deployedFunction, deployServiceOutput } from './result.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const resourceLimits: z.ZodOptional<z.ZodObject<{
|
|
3
|
+
cpuMs: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
subrequests: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
}, z.core.$strict>>;
|
|
6
|
+
export type ResourceLimits = Exclude<z.infer<typeof resourceLimits>, undefined>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const artifactModule: z.ZodUnion<readonly [z.ZodObject<{
|
|
3
|
+
contentBase64: z.ZodString;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
6
|
+
data: "data";
|
|
7
|
+
esm: "esm";
|
|
8
|
+
text: "text";
|
|
9
|
+
wasm: "wasm";
|
|
10
|
+
}>>;
|
|
11
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
12
|
+
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
data: "data";
|
|
16
|
+
esm: "esm";
|
|
17
|
+
text: "text";
|
|
18
|
+
wasm: "wasm";
|
|
19
|
+
}>>;
|
|
20
|
+
}, z.core.$strict>]>;
|
|
21
|
+
export type ArtifactModule = z.infer<typeof artifactModule>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { encodedContent, MAX_MODULE_BASE64_SIZE } from './content.js';
|
|
3
|
+
const fields = {
|
|
4
|
+
name: z.string().min(1).max(256),
|
|
5
|
+
kind: z.enum(['esm', 'wasm', 'text', 'data']).optional(),
|
|
6
|
+
};
|
|
7
|
+
const content = encodedContent(MAX_MODULE_BASE64_SIZE);
|
|
8
|
+
export const artifactModule = z.union([
|
|
9
|
+
z.strictObject({ ...fields, ...content.inline }),
|
|
10
|
+
z.strictObject({ ...fields, ...content.chunked }),
|
|
11
|
+
]);
|