@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.
- package/dist/auth/authority/admission/admission.d.ts +2 -0
- package/dist/auth/authority/admission/admission.js +4 -0
- package/dist/auth/authority/admission/index.d.ts +1 -1
- package/dist/auth/authority/admission/index.js +1 -1
- package/dist/auth/authority/index.d.ts +2 -0
- package/dist/auth/authority/index.js +2 -0
- package/dist/auth/authority/normalization/index.d.ts +1 -1
- package/dist/auth/authority/normalization/index.js +1 -1
- package/dist/auth/authority/normalization/normalize.d.ts +2 -0
- package/dist/auth/authority/normalization/normalize.js +4 -0
- package/dist/auth/authority/prepare-grant-body.d.ts +4 -0
- package/dist/auth/authority/prepare-grant-body.js +27 -0
- package/dist/callable/contract/body.d.ts +10 -0
- package/dist/callable/contract/body.js +7 -0
- package/dist/callable/contract/index.d.ts +2 -1
- package/dist/callable/contract/index.js +1 -1
- package/dist/callable/contract/output.d.ts +8 -0
- package/dist/callable/index.d.ts +2 -1
- package/dist/callable/index.js +1 -0
- package/dist/schema/callables/function.d.ts +259 -259
- package/dist/schema/domain/domain.d.ts +30 -30
- package/dist/schema/identity/identity.d.ts +2 -2
- package/dist/schema/kernel/schema.d.ts +936 -888
- package/dist/schema/kernel/schema.js +2 -0
- package/dist/schema/kernel/syscalls/contracts/blob.d.ts +21 -0
- package/dist/schema/kernel/syscalls/contracts/blob.js +16 -0
- package/dist/schema/kernel/syscalls/contracts/delegate.d.ts +1 -1
- package/dist/schema/kernel/syscalls/contracts/delegate.js +2 -1
- package/dist/schema/kernel/syscalls/contracts/index.d.ts +1 -0
- package/dist/schema/kernel/syscalls/contracts/index.js +1 -0
- package/dist/schema/kernel/syscalls/declarations/delegate.d.ts +1 -1
- package/dist/schema/kernel/syscalls/declarations/download.d.ts +7 -0
- package/dist/schema/kernel/syscalls/declarations/download.js +10 -0
- package/dist/schema/kernel/syscalls/declarations/index.d.ts +21 -1
- package/dist/schema/kernel/syscalls/declarations/index.js +4 -0
- package/dist/schema/kernel/syscalls/declarations/mutate.d.ts +23 -23
- package/dist/schema/kernel/syscalls/declarations/upload.d.ts +15 -0
- package/dist/schema/kernel/syscalls/declarations/upload.js +10 -0
- package/dist/schema/kernel/syscalls/descriptors/functions.d.ts +2 -0
- package/dist/schema/kernel/syscalls/descriptors/functions.js +2 -0
- package/dist/schema/kernel/syscalls/descriptors/identity.d.ts +1 -1
- package/dist/schema/kernel/syscalls/descriptors/index.d.ts +1 -1
- package/dist/schema/kernel/syscalls/descriptors/index.js +1 -1
- package/dist/schema/kernel/syscalls/index.d.ts +1 -1
- package/dist/schema/kernel/syscalls/index.js +1 -1
- package/dist/schema/kernel/syscalls/references/functions.d.ts +10 -0
- package/dist/schema/kernel/syscalls/references/functions.js +2 -0
- package/dist/schema/kernel/syscalls/references/index.d.ts +1 -1
- package/dist/schema/kernel/syscalls/references/index.js +1 -1
- package/package.json +2 -2
|
@@ -9,3 +9,5 @@ export declare const limits: {
|
|
|
9
9
|
};
|
|
10
10
|
export declare const MAX_BOOLEAN_OPERANDS: 512;
|
|
11
11
|
export declare function admitAuthorityExpr(input: portable.Value): AuthorityExpr;
|
|
12
|
+
/** Internal constructor admission: the outer Grant binds subject, but no local escapes into it. */
|
|
13
|
+
export declare function admitGrantBody(input: portable.Value): AuthorityExpr;
|
|
@@ -14,6 +14,10 @@ export const MAX_BOOLEAN_OPERANDS = limits.operandsPerExpression;
|
|
|
14
14
|
export function admitAuthorityExpr(input) {
|
|
15
15
|
return admit(input, '/predicate', new Set(), false, 0);
|
|
16
16
|
}
|
|
17
|
+
/** Internal constructor admission: the outer Grant binds subject, but no local escapes into it. */
|
|
18
|
+
export function admitGrantBody(input) {
|
|
19
|
+
return admit(input, '/predicate/where', new Set(), true, 1);
|
|
20
|
+
}
|
|
17
21
|
function admit(input, path, locals, subjectBound, depth) {
|
|
18
22
|
if (depth > limits.expressionDepth)
|
|
19
23
|
invalid(path, 'Authority expression exceeds its depth limit');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { admitAuthorityExpr, limits } from './admission.js';
|
|
1
|
+
export { admitAuthorityExpr, admitGrantBody, limits } from './admission.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { admitAuthorityExpr, limits } from './admission.js';
|
|
1
|
+
export { admitAuthorityExpr, admitGrantBody, limits } from './admission.js';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { accept } from './accept.js';
|
|
2
2
|
export { isCanonical } from './canonical.js';
|
|
3
|
+
export { ownsCanonical } from './ownership.optimization.js';
|
|
4
|
+
export { prepareGrantBody } from './prepare-grant-body.js';
|
|
3
5
|
export { limits } from './admission/index.js';
|
|
4
6
|
export { canonicalize } from './normalization/index.js';
|
|
5
7
|
export { AUTHORITY_PREDICATE_VERSION } from './language/index.js';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { accept } from './accept.js';
|
|
2
2
|
export { isCanonical } from './canonical.js';
|
|
3
|
+
export { ownsCanonical } from './ownership.optimization.js';
|
|
4
|
+
export { prepareGrantBody } from './prepare-grant-body.js';
|
|
3
5
|
export { limits } from './admission/index.js';
|
|
4
6
|
export { canonicalize } from './normalization/index.js';
|
|
5
7
|
export { AUTHORITY_PREDICATE_VERSION } from './language/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { canonicalize, canonicalizeAdmitted } from './normalize.js';
|
|
1
|
+
export { canonicalize, canonicalizeAdmitted, normalizeGrantBodyAdmitted } from './normalize.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { canonicalize, canonicalizeAdmitted } from './normalize.js';
|
|
1
|
+
export { canonicalize, canonicalizeAdmitted, normalizeGrantBodyAdmitted } from './normalize.js';
|
|
@@ -2,3 +2,5 @@ import type { AuthorityExpr, AuthorityPredicate } from '../language/index.js';
|
|
|
2
2
|
/** Validate and canonicalize one authority expression into its versioned crossing envelope. */
|
|
3
3
|
export declare function canonicalize(expr: AuthorityExpr): AuthorityPredicate;
|
|
4
4
|
export declare function canonicalizeAdmitted(expr: AuthorityExpr): AuthorityPredicate;
|
|
5
|
+
/** Internal scoped normalization; this body is not a closed owned authority expression. */
|
|
6
|
+
export declare function normalizeGrantBodyAdmitted(expr: AuthorityExpr): AuthorityExpr;
|
|
@@ -19,6 +19,10 @@ export function canonicalizeAdmitted(expr) {
|
|
|
19
19
|
predicate: normalize(expr, '/predicate', new Set(), false),
|
|
20
20
|
}));
|
|
21
21
|
}
|
|
22
|
+
/** Internal scoped normalization; this body is not a closed owned authority expression. */
|
|
23
|
+
export function normalizeGrantBodyAdmitted(expr) {
|
|
24
|
+
return normalize(expr, '/predicate/where', new Set(), true);
|
|
25
|
+
}
|
|
22
26
|
function normalize(expr, path, locals, subjectBound) {
|
|
23
27
|
if (ownsExpression(expr))
|
|
24
28
|
return expr;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Grant } from '../grant/index.js';
|
|
2
|
+
import type { AuthorityExpr, AuthorityPredicate } from './language/index.js';
|
|
3
|
+
/** Prepare one body in a fresh Grant subject scope, independently of any concrete Grant. */
|
|
4
|
+
export declare function prepareGrantBody(where: AuthorityExpr): (grant: Grant) => AuthorityPredicate;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as portable from '@astrale-os/kernel-dsl/value';
|
|
2
|
+
import { accept as acceptGrant, canonicalize as canonicalizeGrant } from '../grant/index.js';
|
|
3
|
+
import { admitGrantBody } from './admission/index.js';
|
|
4
|
+
import { AUTHORITY_PREDICATE_VERSION } from './language/index.js';
|
|
5
|
+
import { normalizeGrantBodyAdmitted } from './normalization/index.js';
|
|
6
|
+
import { ownCanonical } from './ownership.optimization.js';
|
|
7
|
+
/** Prepare one body in a fresh Grant subject scope, independently of any concrete Grant. */
|
|
8
|
+
export function prepareGrantBody(where) {
|
|
9
|
+
const admitted = admitGrantBody(portable.acceptForRead(where));
|
|
10
|
+
const body = portable.acceptImmutable(normalizeGrantBodyAdmitted(admitted));
|
|
11
|
+
return grantBinder(body);
|
|
12
|
+
}
|
|
13
|
+
// A distinct closure scope retains only the normalized body, never an initial Grant or caller input.
|
|
14
|
+
function grantBinder(where) {
|
|
15
|
+
return (grant) => {
|
|
16
|
+
// Charge the entire expression on every binding, including the body and its outer container.
|
|
17
|
+
const value = portable.acceptForRead({ op: 'grant', grant, where });
|
|
18
|
+
return ownCanonical(Object.freeze({
|
|
19
|
+
version: AUTHORITY_PREDICATE_VERSION,
|
|
20
|
+
predicate: Object.freeze({
|
|
21
|
+
op: 'grant',
|
|
22
|
+
grant: canonicalizeGrant(acceptGrant(value.grant)),
|
|
23
|
+
where,
|
|
24
|
+
}),
|
|
25
|
+
}));
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** One root invocation's already bounded, single-consumer binary request body. */
|
|
2
|
+
export interface BinaryRequestBody {
|
|
3
|
+
readonly body: ReadableStream<Uint8Array>;
|
|
4
|
+
readonly length: number;
|
|
5
|
+
}
|
|
6
|
+
/** The streamed request ended early or exceeded its declared Content-Length. */
|
|
7
|
+
export declare class BinaryBodyLengthError extends Error {
|
|
8
|
+
readonly name = "BinaryBodyLengthError";
|
|
9
|
+
constructor();
|
|
10
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { CallOf } from './call.js';
|
|
2
|
+
export { BinaryBodyLengthError, type BinaryRequestBody } from './body.js';
|
|
2
3
|
export type { InputOf } from './input.js';
|
|
3
|
-
export type { BinaryOutput, BufferedBinaryResult, OutputContractOf, OutputOf, StreamingBinaryResult, TypedCallableOutput, } from './output.js';
|
|
4
|
+
export type { BinaryOutput, BinaryDeliveryBudget, BufferedBinaryResult, OutputContractOf, OutputOf, StreamingBinaryResult, TypedCallableOutput, } from './output.js';
|
|
4
5
|
export type { CallableSignature } from './signature.js';
|
|
5
6
|
export type { Callable, SignatureOf } from './witness.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { BinaryBodyLengthError } from './body.js';
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { SignatureOf } from './witness.js';
|
|
2
|
+
/** Optional owner-selected lifetime for a large HTTP binary result. */
|
|
3
|
+
export interface BinaryDeliveryBudget {
|
|
4
|
+
readonly maximumDurationMs: number;
|
|
5
|
+
readonly idleTimeoutMs: number;
|
|
6
|
+
}
|
|
2
7
|
export interface BufferedBinaryResult {
|
|
3
8
|
readonly body: Uint8Array;
|
|
4
9
|
readonly mediaType: string;
|
|
@@ -7,6 +12,9 @@ export interface BufferedBinaryResult {
|
|
|
7
12
|
}
|
|
8
13
|
export interface StreamingBinaryResult {
|
|
9
14
|
readonly body: AsyncIterable<Uint8Array>;
|
|
15
|
+
/** Exact byte length; HTTP aborts delivery if the stream differs. */
|
|
16
|
+
readonly length?: number;
|
|
17
|
+
readonly delivery?: BinaryDeliveryBudget;
|
|
10
18
|
readonly mediaType: string;
|
|
11
19
|
readonly status?: number;
|
|
12
20
|
readonly headers?: Readonly<Record<string, string>>;
|
package/dist/callable/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { BinaryBodyLengthError } from './contract/index.js';
|
|
2
|
+
export type { BinaryOutput, BinaryDeliveryBudget, BinaryRequestBody, BufferedBinaryResult, Callable, CallableSignature, CallOf, InputOf, OutputContractOf, OutputOf, SignatureOf, StreamingBinaryResult, TypedCallableOutput, } from './contract/index.js';
|
|
2
3
|
export { Target, targetPath, type Call, type CallableResult } from './invocation/index.js';
|
package/dist/callable/index.js
CHANGED