@camstack/types 1.1.20 → 1.1.22
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/addon/base-addon.d.ts +30 -4
- package/dist/addon/per-node-store.d.ts +68 -0
- package/dist/addon.js +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/capabilities/camera-streams.cap.d.ts +5 -5
- package/dist/capabilities/decoder.cap.d.ts +2 -0
- package/dist/capabilities/device-manager.cap.d.ts +269 -6
- package/dist/capabilities/index.d.ts +3 -1
- package/dist/capabilities/metrics-provider.cap.d.ts +2 -2
- package/dist/capabilities/motion-detection.cap.d.ts +20 -2
- package/dist/capabilities/pet-feeder.cap.d.ts +185 -0
- package/dist/capabilities/pipeline-executor.cap.d.ts +29 -2
- package/dist/capabilities/pipeline-orchestrator.cap.d.ts +7 -3
- package/dist/capabilities/platform-probe.cap.d.ts +1 -1
- package/dist/capabilities/schemas/streaming-shared.d.ts +2 -2
- package/dist/capabilities/stream-broker.cap.d.ts +1 -1
- package/dist/device/device-management.d.ts +61 -2
- package/dist/device/device-type.d.ts +8 -1
- package/dist/device/index.d.ts +1 -1
- package/dist/expression/ast.d.ts +56 -0
- package/dist/expression/builtins.d.ts +19 -0
- package/dist/expression/compile.d.ts +17 -0
- package/dist/expression/errors.d.ts +16 -0
- package/dist/expression/evaluator.d.ts +14 -0
- package/dist/expression/index.d.ts +25 -0
- package/dist/expression/limits.d.ts +30 -0
- package/dist/expression/link-expression.d.ts +44 -0
- package/dist/expression/parser.d.ts +12 -0
- package/dist/expression/tokenizer.d.ts +38 -0
- package/dist/generated/addon-api.d.ts +616 -12
- package/dist/generated/cap-status-types.d.ts +3 -1
- package/dist/generated/capability-router-map.d.ts +5 -2
- package/dist/generated/device-local-state.d.ts +3 -0
- package/dist/generated/device-proxy.d.ts +4 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1555 -37
- package/dist/index.mjs +1523 -38
- package/dist/interfaces/addon.d.ts +15 -2
- package/dist/interfaces/agent.d.ts +14 -0
- package/dist/interfaces/config-ui.d.ts +19 -1
- package/dist/interfaces/pipeline-executor-capability.d.ts +10 -0
- package/dist/{sleep-BabrCASa.js → sleep-B8cp-HUn.js} +193 -7
- package/dist/{sleep-MHm--th-.mjs → sleep-BiDFW0E7.mjs} +193 -7
- package/dist/units/convert.d.ts +49 -0
- package/dist/units/index.d.ts +8 -0
- package/dist/units/unit-table.d.ts +270 -0
- package/package.json +1 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type ExpressionEvalOptions } from './evaluator.js';
|
|
2
|
+
import type { ExpressionValue } from './ast.js';
|
|
3
|
+
/** The `now` epoch-ms binding is auto-injected into every evaluation and is a
|
|
4
|
+
* reserved binding name (authors may not rebind it). */
|
|
5
|
+
export declare const EXPRESSION_INJECTED_NOW = "now";
|
|
6
|
+
/**
|
|
7
|
+
* Coerce an untrusted `getByPath` / mirror read to an `ExpressionValue`.
|
|
8
|
+
* Non-primitive values (objects, arrays, `undefined`, functions, bigint,
|
|
9
|
+
* symbol) and non-finite numbers become `undefined` so the caller can apply
|
|
10
|
+
* its binding-miss policy (→ `null`). `null` itself is a valid value.
|
|
11
|
+
*/
|
|
12
|
+
export declare function toExpressionValue(raw: unknown): ExpressionValue | undefined;
|
|
13
|
+
/** Shape the author-time validator accepts (structural subset of a
|
|
14
|
+
* `DeviceLinkExpressionSource`). */
|
|
15
|
+
export interface ExpressionSourceInput {
|
|
16
|
+
readonly expr: string;
|
|
17
|
+
readonly bindings: Readonly<Record<string, unknown>>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Author-time validation. Returns `null` when the source is valid, else a
|
|
21
|
+
* human-readable error message. Checks: the expression compiles; binding count
|
|
22
|
+
* is within `MAX_EXPRESSION_BINDINGS`; every binding name is a legal identifier,
|
|
23
|
+
* is not reserved (`now`/keywords) and does not shadow a builtin; and every
|
|
24
|
+
* FREE identifier of the AST is covered by a binding or the injected `now`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function validateExpressionSource(src: ExpressionSourceInput): string | null;
|
|
27
|
+
/** Result of a link-expression evaluation — `ok` carries the value, the error
|
|
28
|
+
* branch carries a reason the async channel can log while the sync channel
|
|
29
|
+
* silently skips. */
|
|
30
|
+
export type EvaluateLinkExpressionResult = {
|
|
31
|
+
readonly ok: true;
|
|
32
|
+
readonly value: ExpressionValue;
|
|
33
|
+
} | {
|
|
34
|
+
readonly ok: false;
|
|
35
|
+
readonly error: string;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Shared read-path evaluation for BOTH resolver channels. Builds a null-proto
|
|
39
|
+
* scope from `bindingValues` plus the injected `now` (supplied by the caller
|
|
40
|
+
* for determinism/testability), compiles via the LRU, and evaluates. Any
|
|
41
|
+
* failure (parse or eval) returns `{ ok: false }` — the caller treats that as
|
|
42
|
+
* "skip this link".
|
|
43
|
+
*/
|
|
44
|
+
export declare function evaluateLinkExpression(expr: string, bindingValues: Readonly<Record<string, ExpressionValue>>, now: number, opts?: ExpressionEvalOptions): EvaluateLinkExpressionResult;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ExpressionNode } from './ast.js';
|
|
2
|
+
export interface ParsedExpression {
|
|
3
|
+
readonly ast: ExpressionNode;
|
|
4
|
+
/** Free identifiers referenced by the expression (NOT callees). */
|
|
5
|
+
readonly identifiers: ReadonlySet<string>;
|
|
6
|
+
/** Builtin function names called by the expression. */
|
|
7
|
+
readonly callees: ReadonlySet<string>;
|
|
8
|
+
readonly nodeCount: number;
|
|
9
|
+
}
|
|
10
|
+
/** Tokenize + parse `source` into a validated `ParsedExpression`. Throws
|
|
11
|
+
* `ExpressionParseError` on any lexical or grammatical failure. */
|
|
12
|
+
export declare function parseExpression(source: string): ParsedExpression;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** The fixed punctuator set of the language. */
|
|
2
|
+
export type Punctuator = '(' | ')' | ',' | '?' | ':' | '+' | '-' | '*' | '/' | '%' | '!' | '<' | '<=' | '>' | '>=' | '==' | '!=' | '&&' | '||';
|
|
3
|
+
/** The three value keywords. */
|
|
4
|
+
export type Keyword = 'true' | 'false' | 'null';
|
|
5
|
+
export interface NumberToken {
|
|
6
|
+
readonly type: 'number';
|
|
7
|
+
readonly value: number;
|
|
8
|
+
readonly pos: number;
|
|
9
|
+
}
|
|
10
|
+
export interface StringToken {
|
|
11
|
+
readonly type: 'string';
|
|
12
|
+
readonly value: string;
|
|
13
|
+
readonly pos: number;
|
|
14
|
+
}
|
|
15
|
+
export interface IdentifierToken {
|
|
16
|
+
readonly type: 'identifier';
|
|
17
|
+
readonly name: string;
|
|
18
|
+
readonly pos: number;
|
|
19
|
+
}
|
|
20
|
+
export interface KeywordToken {
|
|
21
|
+
readonly type: 'keyword';
|
|
22
|
+
readonly keyword: Keyword;
|
|
23
|
+
readonly pos: number;
|
|
24
|
+
}
|
|
25
|
+
export interface PunctToken {
|
|
26
|
+
readonly type: 'punct';
|
|
27
|
+
readonly punct: Punctuator;
|
|
28
|
+
readonly pos: number;
|
|
29
|
+
}
|
|
30
|
+
export interface EofToken {
|
|
31
|
+
readonly type: 'eof';
|
|
32
|
+
readonly pos: number;
|
|
33
|
+
}
|
|
34
|
+
export type Token = NumberToken | StringToken | IdentifierToken | KeywordToken | PunctToken | EofToken;
|
|
35
|
+
/** Tokenize `source` into a flat token list ending with a single `eof` token.
|
|
36
|
+
* Throws `ExpressionParseError` on any illegal character or unterminated
|
|
37
|
+
* string. */
|
|
38
|
+
export declare function tokenize(source: string): readonly Token[];
|