@astrale-os/kernel-core 0.9.0-beta.54 → 0.9.0-beta.55

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.
Files changed (50) hide show
  1. package/dist/auth/authority/admission/admission.d.ts +2 -0
  2. package/dist/auth/authority/admission/admission.js +4 -0
  3. package/dist/auth/authority/admission/index.d.ts +1 -1
  4. package/dist/auth/authority/admission/index.js +1 -1
  5. package/dist/auth/authority/index.d.ts +2 -0
  6. package/dist/auth/authority/index.js +2 -0
  7. package/dist/auth/authority/normalization/index.d.ts +1 -1
  8. package/dist/auth/authority/normalization/index.js +1 -1
  9. package/dist/auth/authority/normalization/normalize.d.ts +2 -0
  10. package/dist/auth/authority/normalization/normalize.js +4 -0
  11. package/dist/auth/authority/prepare-grant-body.d.ts +4 -0
  12. package/dist/auth/authority/prepare-grant-body.js +27 -0
  13. package/dist/callable/contract/body.d.ts +10 -0
  14. package/dist/callable/contract/body.js +7 -0
  15. package/dist/callable/contract/index.d.ts +2 -1
  16. package/dist/callable/contract/index.js +1 -1
  17. package/dist/callable/contract/output.d.ts +8 -0
  18. package/dist/callable/index.d.ts +2 -1
  19. package/dist/callable/index.js +1 -0
  20. package/dist/schema/callables/function.d.ts +259 -259
  21. package/dist/schema/domain/domain.d.ts +30 -30
  22. package/dist/schema/identity/identity.d.ts +2 -2
  23. package/dist/schema/kernel/schema.d.ts +936 -888
  24. package/dist/schema/kernel/schema.js +2 -0
  25. package/dist/schema/kernel/syscalls/contracts/blob.d.ts +21 -0
  26. package/dist/schema/kernel/syscalls/contracts/blob.js +16 -0
  27. package/dist/schema/kernel/syscalls/contracts/delegate.d.ts +1 -1
  28. package/dist/schema/kernel/syscalls/contracts/delegate.js +2 -1
  29. package/dist/schema/kernel/syscalls/contracts/index.d.ts +1 -0
  30. package/dist/schema/kernel/syscalls/contracts/index.js +1 -0
  31. package/dist/schema/kernel/syscalls/declarations/delegate.d.ts +1 -1
  32. package/dist/schema/kernel/syscalls/declarations/download.d.ts +7 -0
  33. package/dist/schema/kernel/syscalls/declarations/download.js +10 -0
  34. package/dist/schema/kernel/syscalls/declarations/index.d.ts +21 -1
  35. package/dist/schema/kernel/syscalls/declarations/index.js +4 -0
  36. package/dist/schema/kernel/syscalls/declarations/mutate.d.ts +23 -23
  37. package/dist/schema/kernel/syscalls/declarations/upload.d.ts +15 -0
  38. package/dist/schema/kernel/syscalls/declarations/upload.js +10 -0
  39. package/dist/schema/kernel/syscalls/descriptors/functions.d.ts +2 -0
  40. package/dist/schema/kernel/syscalls/descriptors/functions.js +2 -0
  41. package/dist/schema/kernel/syscalls/descriptors/identity.d.ts +1 -1
  42. package/dist/schema/kernel/syscalls/descriptors/index.d.ts +1 -1
  43. package/dist/schema/kernel/syscalls/descriptors/index.js +1 -1
  44. package/dist/schema/kernel/syscalls/index.d.ts +1 -1
  45. package/dist/schema/kernel/syscalls/index.js +1 -1
  46. package/dist/schema/kernel/syscalls/references/functions.d.ts +10 -0
  47. package/dist/schema/kernel/syscalls/references/functions.js +2 -0
  48. package/dist/schema/kernel/syscalls/references/index.d.ts +1 -1
  49. package/dist/schema/kernel/syscalls/references/index.js +1 -1
  50. package/package.json +2 -2
@@ -71,6 +71,8 @@ export const AuthorityRelations = Object.freeze({
71
71
  export const KernelRootFunctions = Object.freeze([
72
72
  K.functions.query,
73
73
  K.functions.mutate,
74
+ K.functions.upload,
75
+ K.functions.download,
74
76
  K.functions.register,
75
77
  K.functions.install,
76
78
  K.functions.uninstall,
@@ -0,0 +1,21 @@
1
+ export declare const MAXIMUM_BLOB_BYTES = 104857600;
2
+ export declare const blobSlot: import("zod").ZodObject<{
3
+ node: import("zod").ZodString;
4
+ property: import("zod").ZodString;
5
+ }, import("zod/v4/core").$strict>;
6
+ export declare const uploadInput: import("zod").ZodObject<{
7
+ mediaType: import("zod").ZodString;
8
+ }, import("zod/v4/core").$strict>;
9
+ export declare const uploadOutput: import("zod").ZodObject<{
10
+ receipt: import("zod").ZodString;
11
+ ref: import("zod").ZodObject<{
12
+ digest: import("zod").ZodString;
13
+ mediaType: import("zod").ZodString;
14
+ size: import("zod").ZodNumber;
15
+ }, import("zod/v4/core").$strict>;
16
+ expiresAt: import("zod").ZodString;
17
+ }, import("zod/v4/core").$strict>;
18
+ export declare const downloadInput: import("zod").ZodObject<{
19
+ node: import("zod").ZodString;
20
+ property: import("zod").ZodString;
21
+ }, import("zod/v4/core").$strict>;
@@ -0,0 +1,16 @@
1
+ import { patterns } from '@astrale-os/kernel-dsl/v1/addressing';
2
+ import { fullMatch } from '@astrale-os/kernel-dsl/v1/value/full-match';
3
+ import { strictObject, string } from 'zod';
4
+ import { artifactRef } from './installation.js';
5
+ export const MAXIMUM_BLOB_BYTES = 104_857_600;
6
+ export const blobSlot = strictObject({
7
+ node: string().check(fullMatch('[A-Za-z0-9._-]{1,255}')),
8
+ property: string().check(fullMatch(patterns.propertyKeyFullMatch)),
9
+ });
10
+ export const uploadInput = strictObject({ mediaType: string().min(1) });
11
+ export const uploadOutput = strictObject({
12
+ receipt: string().min(1),
13
+ ref: artifactRef,
14
+ expiresAt: string().min(1),
15
+ });
16
+ export const downloadInput = blobSlot;
@@ -2,6 +2,6 @@ export declare const delegateInput: import("zod").ZodObject<{
2
2
  principal: import("zod").ZodString;
3
3
  audience: import("zod").ZodString;
4
4
  ttlSeconds: import("zod").ZodNumber;
5
- attenuation: import("zod").ZodUnknown;
5
+ attenuation: import("zod").ZodOptional<import("zod").ZodUnknown>;
6
6
  }, import("zod/v4/core").$strict>;
7
7
  export declare const delegateOutput: import("zod").ZodString;
@@ -4,6 +4,7 @@ export const delegateInput = strictObject({
4
4
  principal: text,
5
5
  audience: text,
6
6
  ttlSeconds: number().int().min(1),
7
- attenuation: unknownSchema(),
7
+ /** Optional; absence means the self expression. */
8
+ attenuation: unknownSchema().optional(),
8
9
  });
9
10
  export const delegateOutput = text;
@@ -1,4 +1,5 @@
1
1
  export { admitInput, admitOutput } from './admit.js';
2
+ export { blobSlot, downloadInput, MAXIMUM_BLOB_BYTES, uploadInput, uploadOutput } from './blob.js';
2
3
  export { MAXIMUM_CHECKS, canInput, canOutput } from './can.js';
3
4
  export { delegateInput, delegateOutput } from './delegate.js';
4
5
  export { installInput, installReceipt, type DomainRequest, type InstallInput, type InstallReceipt, } from './install.js';
@@ -1,4 +1,5 @@
1
1
  export { admitInput, admitOutput } from './admit.js';
2
+ export { blobSlot, downloadInput, MAXIMUM_BLOB_BYTES, uploadInput, uploadOutput } from './blob.js';
2
3
  export { MAXIMUM_CHECKS, canInput, canOutput } from './can.js';
3
4
  export { delegateInput, delegateOutput } from './delegate.js';
4
5
  export { installInput, installReceipt, } from './install.js';
@@ -3,7 +3,7 @@ export declare const Delegate: builder.Method<builder.CallableProjection<{
3
3
  principal: string;
4
4
  audience: string;
5
5
  ttlSeconds: number;
6
- attenuation: unknown;
6
+ attenuation?: unknown;
7
7
  }, {
8
8
  readonly mode: 'value';
9
9
  readonly value: string;
@@ -0,0 +1,7 @@
1
+ import { type builder } from '@astrale-os/kernel-dsl/v1';
2
+ export declare const Download: builder.Function<builder.CallableProjection<{
3
+ node: string;
4
+ property: string;
5
+ }, {
6
+ readonly mode: 'binary';
7
+ }, "authorized", false, false>>;
@@ -0,0 +1,10 @@
1
+ import { func, output } from '@astrale-os/kernel-dsl/v1';
2
+ import { downloadInput } from '../contracts/index.js';
3
+ import { usePolicy } from './use-policy.js';
4
+ export const Download = func({
5
+ description: 'Stream an application blob from an authorized Node property.',
6
+ auth: 'authorized',
7
+ policy: usePolicy(() => Download),
8
+ input: downloadInput,
9
+ output: output.binary(),
10
+ });
@@ -223,6 +223,26 @@ export declare const Functions: Readonly<{
223
223
  };
224
224
  };
225
225
  }, "authorized", false, false>>;
226
+ upload: builder.Function<builder.CallableProjection<import("@astrale-os/kernel-dsl/v1").BinaryInputProjection<{
227
+ mediaType: string;
228
+ }>, {
229
+ readonly mode: 'value';
230
+ readonly value: {
231
+ receipt: string;
232
+ ref: {
233
+ digest: string;
234
+ mediaType: string;
235
+ size: number;
236
+ };
237
+ expiresAt: string;
238
+ };
239
+ }, "authorized", false, false>>;
240
+ download: builder.Function<builder.CallableProjection<{
241
+ node: string;
242
+ property: string;
243
+ }, {
244
+ readonly mode: 'binary';
245
+ }, "authorized", false, false>>;
226
246
  mutate: builder.Function<builder.CallableProjection<{
227
247
  ast: {
228
248
  format: "astrale.graph.mutation";
@@ -572,7 +592,7 @@ export declare const IdentityMethods: Readonly<{
572
592
  principal: string;
573
593
  audience: string;
574
594
  ttlSeconds: number;
575
- attenuation: unknown;
595
+ attenuation?: unknown;
576
596
  }, {
577
597
  readonly mode: 'value';
578
598
  readonly value: string;
@@ -1,6 +1,7 @@
1
1
  import { Admit } from './admit.js';
2
2
  import { Can } from './can.js';
3
3
  import { Delegate } from './delegate.js';
4
+ import { Download } from './download.js';
4
5
  import { Impersonate } from './impersonate.js';
5
6
  import { Install } from './install.js';
6
7
  import { Introspect } from './introspect.js';
@@ -10,11 +11,14 @@ import { Mutate } from './mutate.js';
10
11
  import { Query } from './query.js';
11
12
  import { Register } from './register.js';
12
13
  import { Uninstall } from './uninstall.js';
14
+ import { Upload } from './upload.js';
13
15
  import { ViewResolve } from './view-resolve.js';
14
16
  import { Whoami } from './whoami.js';
15
17
  import { Whois } from './whois.js';
16
18
  export const Functions = Object.freeze({
17
19
  query: Query,
20
+ upload: Upload,
21
+ download: Download,
18
22
  mutate: Mutate,
19
23
  register: Register,
20
24
  install: Install,
@@ -155,29 +155,6 @@ export declare const Mutate: builder.Function<builder.CallableProjection<{
155
155
  };
156
156
  })[];
157
157
  operations: ({
158
- op: "edge.update";
159
- edge: {
160
- source: string;
161
- target: string;
162
- class: string;
163
- };
164
- slug: unknown;
165
- props?: {
166
- set: Record<string, unknown>;
167
- unset: string[];
168
- } | undefined;
169
- } | {
170
- op: "edge.update";
171
- edge: {
172
- source: string;
173
- target: string;
174
- class: string;
175
- };
176
- props: {
177
- set: Record<string, unknown>;
178
- unset: string[];
179
- };
180
- } | {
181
158
  op: "node.create";
182
159
  as: string;
183
160
  class: string;
@@ -205,6 +182,29 @@ export declare const Mutate: builder.Function<builder.CallableProjection<{
205
182
  };
206
183
  slug?: unknown;
207
184
  props: Record<string, unknown>;
185
+ } | {
186
+ op: "edge.update";
187
+ edge: {
188
+ source: string;
189
+ target: string;
190
+ class: string;
191
+ };
192
+ slug: unknown;
193
+ props?: {
194
+ set: Record<string, unknown>;
195
+ unset: string[];
196
+ } | undefined;
197
+ } | {
198
+ op: "edge.update";
199
+ edge: {
200
+ source: string;
201
+ target: string;
202
+ class: string;
203
+ };
204
+ props: {
205
+ set: Record<string, unknown>;
206
+ unset: string[];
207
+ };
208
208
  } | {
209
209
  op: "edge.delete";
210
210
  edge: {
@@ -0,0 +1,15 @@
1
+ import { type builder } from '@astrale-os/kernel-dsl/v1';
2
+ export declare const Upload: builder.Function<builder.CallableProjection<import("@astrale-os/kernel-dsl/v1").BinaryInputProjection<{
3
+ mediaType: string;
4
+ }>, {
5
+ readonly mode: 'value';
6
+ readonly value: {
7
+ receipt: string;
8
+ ref: {
9
+ digest: string;
10
+ mediaType: string;
11
+ size: number;
12
+ };
13
+ expiresAt: string;
14
+ };
15
+ }, "authorized", false, false>>;
@@ -0,0 +1,10 @@
1
+ import { func, input } from '@astrale-os/kernel-dsl/v1';
2
+ import { MAXIMUM_BLOB_BYTES, uploadInput, uploadOutput } from '../contracts/index.js';
3
+ import { usePolicy } from './use-policy.js';
4
+ export const Upload = func({
5
+ description: 'Store application bytes in an upload receipt.',
6
+ auth: 'authorized',
7
+ policy: usePolicy(() => Upload),
8
+ input: input.binary(uploadInput, { maximumBytes: MAXIMUM_BLOB_BYTES }),
9
+ output: uploadOutput,
10
+ });
@@ -7,3 +7,5 @@ export declare const install: FunctionSyscall<'kernel.astrale.ai', 'install', ty
7
7
  export declare const introspect: FunctionSyscall<'kernel.astrale.ai', 'introspect', typeof K.functions.introspect>;
8
8
  export declare const uninstall: FunctionSyscall<'kernel.astrale.ai', 'uninstall', typeof K.functions.uninstall>;
9
9
  export declare const journal: FunctionSyscall<'kernel.astrale.ai', 'journal', typeof K.functions.journal>;
10
+ export declare const upload: FunctionSyscall<'kernel.astrale.ai', 'upload', typeof K.functions.upload>;
11
+ export declare const download: FunctionSyscall<'kernel.astrale.ai', 'download', typeof K.functions.download>;
@@ -8,3 +8,5 @@ export const install = functionSyscall(references.install, K.functions.install);
8
8
  export const introspect = functionSyscall(references.introspect, K.functions.introspect);
9
9
  export const uninstall = functionSyscall(references.uninstall, K.functions.uninstall);
10
10
  export const journal = functionSyscall(references.journal, K.functions.journal);
11
+ export const upload = functionSyscall(references.upload, K.functions.upload);
12
+ export const download = functionSyscall(references.download, K.functions.download);
@@ -6,7 +6,7 @@ export declare const delegate: import("./model.js").MethodSyscall<Readonly<{
6
6
  principal: string;
7
7
  audience: string;
8
8
  ttlSeconds: number;
9
- attenuation: unknown;
9
+ attenuation?: unknown;
10
10
  }, {
11
11
  readonly mode: 'value';
12
12
  readonly value: string;
@@ -1,5 +1,5 @@
1
1
  export type { FunctionSyscall, MethodSyscall, Syscall, SyscallRef } from './model.js';
2
- export { install, introspect, journal, mutate, register, query, uninstall } from './functions.js';
2
+ export { download, install, introspect, journal, mutate, register, query, uninstall, upload, } from './functions.js';
3
3
  export * as identity from './identity.js';
4
4
  export * as function from './function.js';
5
5
  export * as view from './view.js';
@@ -1,4 +1,4 @@
1
- export { install, introspect, journal, mutate, register, query, uninstall } from './functions.js';
1
+ export { download, install, introspect, journal, mutate, register, query, uninstall, upload, } from './functions.js';
2
2
  export * as identity from './identity.js';
3
3
  export * as function from './function.js';
4
4
  export * as view from './view.js';
@@ -1,4 +1,4 @@
1
1
  export type { FunctionSyscall, MethodSyscall, Syscall, SyscallRef } from './descriptors/index.js';
2
2
  export * as references from './references/index.js';
3
- export { install, introspect, journal, mutate, register, query, uninstall, } from './descriptors/index.js';
3
+ export { download, install, introspect, journal, mutate, register, query, uninstall, upload, } from './descriptors/index.js';
4
4
  export { function, identity, view } from './descriptors/index.js';
@@ -1,3 +1,3 @@
1
1
  export * as references from './references/index.js';
2
- export { install, introspect, journal, mutate, register, query, uninstall, } from './descriptors/index.js';
2
+ export { download, install, introspect, journal, mutate, register, query, uninstall, upload, } from './descriptors/index.js';
3
3
  export { function, identity, view } from './descriptors/index.js';
@@ -33,3 +33,13 @@ export declare const journal: Readonly<{
33
33
  kind: 'function';
34
34
  name: "journal";
35
35
  }>;
36
+ export declare const upload: Readonly<{
37
+ origin: 'kernel.astrale.ai';
38
+ kind: 'function';
39
+ name: "upload";
40
+ }>;
41
+ export declare const download: Readonly<{
42
+ origin: 'kernel.astrale.ai';
43
+ kind: 'function';
44
+ name: "download";
45
+ }>;
@@ -10,3 +10,5 @@ export const install = functionRef('install');
10
10
  export const introspect = functionRef('introspect');
11
11
  export const uninstall = functionRef('uninstall');
12
12
  export const journal = functionRef('journal');
13
+ export const upload = functionRef('upload');
14
+ export const download = functionRef('download');
@@ -1,5 +1,5 @@
1
1
  export type { FunctionRef, SyscallRef } from './reference.js';
2
- export { install, introspect, journal, mutate, register, query, uninstall } from './functions.js';
2
+ export { download, install, introspect, journal, mutate, register, query, uninstall, upload, } from './functions.js';
3
3
  export * as identity from './identity.js';
4
4
  export * as function from './function.js';
5
5
  export * as view from './view.js';
@@ -1,4 +1,4 @@
1
- export { install, introspect, journal, mutate, register, query, uninstall } from './functions.js';
1
+ export { download, install, introspect, journal, mutate, register, query, uninstall, upload, } from './functions.js';
2
2
  export * as identity from './identity.js';
3
3
  export * as function from './function.js';
4
4
  export * as view from './view.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-os/kernel-core",
3
- "version": "0.9.0-beta.54",
3
+ "version": "0.9.0-beta.55",
4
4
  "description": "Astrale Kernel Core - Types, Invariants, and Pure Logic",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -160,7 +160,7 @@
160
160
  "access": "public"
161
161
  },
162
162
  "dependencies": {
163
- "@astrale-os/kernel-dsl": "0.2.0-beta.39",
163
+ "@astrale-os/kernel-dsl": "0.2.0-beta.40",
164
164
  "@noble/hashes": "2.3.0",
165
165
  "@types/json-schema": "^7.0.15",
166
166
  "dequal": "2.0.3"