@camstack/types 1.2.443 → 1.2.445
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/CHANGELOG.md +20 -0
- package/dist/addon.d.ts +5 -1
- package/dist/addon.js +21 -5
- package/dist/addon.mjs +17 -6
- package/dist/automation/export-entities.d.ts +98 -0
- package/dist/capabilities/capability-definition.d.ts +1 -1
- package/dist/capabilities/composer.cap.d.ts +34 -0
- package/dist/capabilities/consumables.cap.d.ts +4 -5
- package/dist/capabilities/core-blocks.cap.d.ts +244 -0
- package/dist/capabilities/device-export.cap.d.ts +111 -1
- package/dist/capabilities/index.d.ts +6 -4
- package/dist/capabilities/metrics-provider.cap.d.ts +16 -16
- package/dist/capabilities/nodes.cap.d.ts +2 -2
- package/dist/capabilities/pet-fountain.cap.d.ts +138 -0
- package/dist/capabilities/pipeline-executor.cap.d.ts +6 -22
- package/dist/capabilities/pipeline-orchestrator.cap.d.ts +2 -2
- package/dist/capabilities/pipeline-runner.cap.d.ts +2 -2
- package/dist/capabilities/pipeline-step-input.d.ts +33 -0
- package/dist/capabilities/server-management.cap.d.ts +28 -0
- package/dist/client.js +820 -799
- package/dist/client.mjs +820 -799
- package/dist/composition/composition-items.d.ts +3 -3
- package/dist/composition/composition-report.d.ts +17 -0
- package/dist/composition/composition.d.ts +68 -1
- package/dist/composition/index.d.ts +2 -0
- package/dist/composition/presets/pet-fountain.d.ts +36 -0
- package/dist/composition/validate-forward.d.ts +31 -0
- package/dist/{composition-C0dlyG9U.js → composition-CO6Sak-s.js} +49 -5
- package/dist/{composition-bIBW5_13.mjs → composition-kSuOifuG.mjs} +32 -6
- package/dist/device/cap-vocabulary/entries/appliances.d.ts +1 -1
- package/dist/device/device-control-resolution.d.ts +1 -1
- package/dist/device/device-type.d.ts +4 -0
- package/dist/{err-msg-BCdlR2Li.mjs → err-msg-DWXWc0Di.mjs} +4 -0
- package/dist/{err-msg-COHgq7Mb.js → err-msg-EJhsFHqa.js} +4 -0
- package/dist/generated/addon-api.d.ts +148 -32
- package/dist/generated/addon-cap-facts.d.ts +1 -1
- package/dist/generated/cap-status-types.d.ts +3 -1
- package/dist/generated/capability-router-map.d.ts +5 -2
- package/dist/generated/collection-array-methods.d.ts +2 -2
- package/dist/generated/customize-catalog.d.ts +1 -1
- package/dist/generated/device-local-state.d.ts +3 -0
- package/dist/generated/device-proxy.d.ts +3 -0
- package/dist/generated/device-scoped-caps.d.ts +1 -1
- package/dist/generated/history-catalog.d.ts +1 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/method-device-selectors.d.ts +1 -1
- package/dist/generated/runtime-state-durability.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1465 -603
- package/dist/index.mjs +1433 -592
- package/dist/interfaces/agent.d.ts +6 -2
- package/dist/interfaces/event-bus.d.ts +1 -1
- package/dist/node.js +2 -2
- package/dist/node.mjs +2 -2
- package/dist/{sleep-C_u6cEAJ.mjs → sleep-6eG9C8Xl.mjs} +223 -72
- package/dist/{sleep-E7qAQwTE.js → sleep-UXDHn-oJ.js} +246 -71
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.445] - 2026-10-29
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- server-management can read and set a node's launch overrides
|
|
15
|
+
|
|
16
|
+
## [1.2.444] - 2026-10-29
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- Device exporters can declare that they also expose actions and notification targets (device-export entity methods).
|
|
21
|
+
- A composed device of a new type can now be commanded: each method of its capability forwards to one method of a source device
|
|
22
|
+
- A pet fountain device type with a pet-fountain capability (water level, drinking totals, pump controls)
|
|
23
|
+
- A preset to build a pet fountain device from loose entities, with forwarded pump commands and a resettable filter
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- Node memory is nullable on the metrics and topology contracts: a failed read is unknown, not 0 or 100
|
|
28
|
+
- server-management gains getLaunchOverrides / setLaunchOverrides, the per-node heap-ceiling override
|
|
29
|
+
|
|
10
30
|
## [1.2.443] - 2026-10-29
|
|
11
31
|
|
|
12
32
|
### Added
|
package/dist/addon.d.ts
CHANGED
|
@@ -23,7 +23,11 @@ export { nodePin, readNodePin } from './cap-call-context.js';
|
|
|
23
23
|
export type { IAdminUiProvider } from './capabilities/admin-ui.cap.js';
|
|
24
24
|
export { adminUiCapability } from './capabilities/admin-ui.cap.js';
|
|
25
25
|
export { expandCapMethods } from './capabilities/capability-definition.js';
|
|
26
|
-
export { describeCustomActions } from './capabilities/custom-actions.js';
|
|
26
|
+
export { customAction, defineCustomActions, describeCustomActions, } from './capabilities/custom-actions.js';
|
|
27
|
+
export { PipelineRunResultBridge, PipelineStepInputSchema, } from './capabilities/pipeline-step-input.js';
|
|
28
|
+
export type { PipelineStepInputOutput } from './capabilities/pipeline-step-input.js';
|
|
29
|
+
export { defineRecordKinds } from './records/record-kind.js';
|
|
30
|
+
export { addonPagesSourceCapability } from './capabilities/addon-pages-source.cap.js';
|
|
27
31
|
export { CALLER_STAMPED_CAPABILITIES, withoutCallerStamp, } from './capabilities/caller-stamp.js';
|
|
28
32
|
export { deviceOpsCapability } from './capabilities/device-ops.cap.js';
|
|
29
33
|
export type { IViewerUiProvider } from './capabilities/viewer-ui.cap.js';
|
package/dist/addon.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_sleep = require("./sleep-
|
|
2
|
+
const require_sleep = require("./sleep-UXDHn-oJ.js");
|
|
3
3
|
const require_event_category = require("./event-category-E17zaHjN.js");
|
|
4
|
-
const require_err_msg = require("./err-msg-
|
|
4
|
+
const require_err_msg = require("./err-msg-EJhsFHqa.js");
|
|
5
5
|
//#region src/generated/cap-input-defaults.ts
|
|
6
6
|
/**
|
|
7
7
|
* AUTO-GENERATED by scripts/generate-cap-input-defaults.ts — DO NOT EDIT.
|
|
@@ -367,7 +367,7 @@ function materialise(defaults) {
|
|
|
367
367
|
* barrel (`ALL_CAPABILITY_DEFINITIONS`), which would cost ~144MB RSS per
|
|
368
368
|
* forked runner. See docs/decisions/adr-0028.md.
|
|
369
369
|
*
|
|
370
|
-
* Coverage: 28 collection caps,
|
|
370
|
+
* Coverage: 28 collection caps, 48 array methods.
|
|
371
371
|
*/
|
|
372
372
|
var COLLECTION_ARRAY_METHODS = Object.freeze({
|
|
373
373
|
"action-source": ["listActions"],
|
|
@@ -378,7 +378,12 @@ var COLLECTION_ARRAY_METHODS = Object.freeze({
|
|
|
378
378
|
"calendar-source": ["listCalendars", "listEvents"],
|
|
379
379
|
"custom-model-registry": ["listModels"],
|
|
380
380
|
"data-store-provider": ["histogram", "query"],
|
|
381
|
-
"device-export": [
|
|
381
|
+
"device-export": [
|
|
382
|
+
"listExposedDevices",
|
|
383
|
+
"listExposedEntities",
|
|
384
|
+
"listSupportedDeviceKinds",
|
|
385
|
+
"listSupportedEntityKinds"
|
|
386
|
+
],
|
|
382
387
|
"device-extension": ["listSlots", "listSources"],
|
|
383
388
|
"device-provider": ["discoverDevices", "getDevices"],
|
|
384
389
|
"device-removal-hook": ["listDeviceData"],
|
|
@@ -429,9 +434,15 @@ function isCollectionArrayMethodName(capName, method) {
|
|
|
429
434
|
* Per capability, the methods declared `optionalMethod` — the ones whose
|
|
430
435
|
* ABSENCE on a provider is a fact about that provider, not a bug.
|
|
431
436
|
*
|
|
432
|
-
* Coverage:
|
|
437
|
+
* Coverage: 3 caps, 11 methods.
|
|
433
438
|
*/
|
|
434
439
|
var PROVIDER_OPTIONAL_METHODS = Object.freeze({
|
|
440
|
+
"device-export": [
|
|
441
|
+
"exposeEntity",
|
|
442
|
+
"listExposedEntities",
|
|
443
|
+
"listSupportedEntityKinds",
|
|
444
|
+
"unexposeEntity"
|
|
445
|
+
],
|
|
435
446
|
"log-destination": [
|
|
436
447
|
"cancelRead",
|
|
437
448
|
"describeRead",
|
|
@@ -488,6 +499,8 @@ exports.PEER_BYTES_MAX_OUTSTANDING = require_sleep.PEER_BYTES_MAX_OUTSTANDING;
|
|
|
488
499
|
exports.PEER_BYTES_STALL_MS = require_sleep.PEER_BYTES_STALL_MS;
|
|
489
500
|
exports.PEER_BYTES_TICKET_TTL_MS = require_sleep.PEER_BYTES_TICKET_TTL_MS;
|
|
490
501
|
exports.PROVIDER_OPTIONAL_METHODS = PROVIDER_OPTIONAL_METHODS;
|
|
502
|
+
exports.PipelineRunResultBridge = require_sleep.PipelineRunResultBridge;
|
|
503
|
+
exports.PipelineStepInputSchema = require_sleep.PipelineStepInputSchema;
|
|
491
504
|
exports.PlaintextSecretError = require_sleep.PlaintextSecretError;
|
|
492
505
|
exports.RECORDS_ERROR_CODES = require_sleep.RECORDS_ERROR_CODES;
|
|
493
506
|
exports.RECORD_BATCH_MAX = require_sleep.RECORD_BATCH_MAX;
|
|
@@ -525,6 +538,7 @@ exports.StoredRecordKindDeclarationSchema = require_sleep.StoredRecordKindDeclar
|
|
|
525
538
|
exports.TransactRefusedError = require_sleep.TransactRefusedError;
|
|
526
539
|
exports.UnindexedFilterError = require_sleep.UnindexedFilterError;
|
|
527
540
|
exports.UnknownRecordKindError = require_sleep.UnknownRecordKindError;
|
|
541
|
+
exports.addonPagesSourceCapability = require_sleep.addonPagesSourceCapability;
|
|
528
542
|
exports.addonSliceHandleApi = require_sleep.addonSliceHandleApi;
|
|
529
543
|
exports.adminUiCapability = require_sleep.adminUiCapability;
|
|
530
544
|
exports.arrayItemFieldPath = require_sleep.arrayItemFieldPath;
|
|
@@ -543,7 +557,9 @@ exports.createEvent = require_sleep.createEvent;
|
|
|
543
557
|
exports.createEventBusSliceSource = require_sleep.createEventBusSliceSource;
|
|
544
558
|
exports.createRecordsAccess = require_sleep.createRecordsAccess;
|
|
545
559
|
exports.createSecretsAccess = require_sleep.createSecretsAccess;
|
|
560
|
+
exports.customAction = require_sleep.customAction;
|
|
546
561
|
exports.declarationsOf = require_sleep.declarationsOf;
|
|
562
|
+
exports.defineCustomActions = require_sleep.defineCustomActions;
|
|
547
563
|
exports.defineEntryKind = require_sleep.defineEntryKind;
|
|
548
564
|
exports.defineRecordKinds = require_sleep.defineRecordKinds;
|
|
549
565
|
exports.describeCustomActions = require_sleep.describeCustomActions;
|
package/dist/addon.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $
|
|
1
|
+
import { $n as RECORD_SECRET_COLLECTION_PREFIX, $r as SECRET_CLEAR, $t as entryBody, A as HF_REPO, An as RECORDS_ERROR_CODES, B as DEVICE_CHILDREN_BATCH_MAX, Bn as asRecordsError, C as addonSliceHandleApi, Cn as BatchTooLargeError, Dn as InvalidRecordError, En as ForeignSecretMarkerError, Fn as RecordsError, Fr as formatSecretScope, G as describeCustomActions, Gn as RECORD_DATABASES, H as withoutCallerStamp, Hn as RECORD_BATCH_MAX, Hr as createEvent, I as deviceOpsCapability, In as RevConflictError, Ir as globalSecretScope, Jn as RECORD_ID_MAX_LENGTH, Kn as RECORD_DEFAULT_MAX_DATA_BYTES, L as viewerUiCapability, Ln as TransactRefusedError, Lr as isSecretRef, M as CAP_ADVANCE_FIELDS, Mn as RecordSecretUnavailableError, Mr as SECRET_REF_SCHEME, Nn as RecordTooLargeError, Nr as arrayItemFieldPath, On as NoCallerError, P as CAP_STATE_LEAVES, Pn as RecordUniqueViolationError, Pr as buildSecretRef, Q as readNodePin, Qn as RECORD_QUERY_MAX, Qt as defineEntryKind, R as PipelineRunResultBridge, Rn as UnindexedFilterError, Rr as normalizeSecretOwner, Sn as isZodSecret, Sr as normalizeAddonInitResult, Tn as FilterRequiredError, U as customAction, Un as RECORD_BATCH_MAX_BYTES, Ur as emitReadiness, V as CALLER_STAMPED_CAPABILITIES, Vn as recordsErrorFromMessage, W as defineCustomActions, Wn as RECORD_CLASSES, Xn as RECORD_MAX_INDEXES, Y as addonPagesSourceCapability, Yn as RECORD_MAX_DATA_BYTES, Z as nodePin, Zn as RECORD_MAX_INDEX_FIELDS, Zt as makeInMemoryRecords, _ as readErrorI18n, _n as recordSecretCollection, _r as DATAPLANE_SECRET_HEADER, ai as makeSecretMarker, an as RecordKindDeclarationSchema, ar as MIN_SCRUBBED_LENGTH, b as isDeviceScopedCap, br as BaseAddon, c as asString, cn as StoredRecordKindDeclarationSchema, cr as knownSecretCount, d as parseJsonUnknown, dn as defineRecordKinds, dr as shortSecretRefHash, ei as classifySecretWrite, en as createRecordsAccess, er as RECORD_SETTINGS_MAX_ROWS, f as hfModelUrl, fn as REMOVE_LEAF, fr as PEER_BYTES_CHUNK_BYTES, g as ErrorI18nPayloadSchema, gn as recordArrayItemPath, gt as ReadinessTimeoutError, hn as parseSecretPath, hr as PEER_BYTES_TICKET_TTL_MS, ht as ReadinessRegistry, ii as isSecretMarkerLike, in as RecordIndexSchema, ir as createSecretsAccess, jn as RecordNotFoundError, kn as PlaintextSecretError, ln as assertValidDeclaration, lr as registerKnownSecret, mn as mapSecretLeaves, mr as PEER_BYTES_STALL_MS, mt as MODEL_FORMATS, ni as isSecretFieldView, nn as EntryDescriptorSchema, nr as resolveSecretViewsIn, o as asJsonObject, oi as toSecretFieldView, on as RecordKindNameSchema, or as clearKnownSecrets, p as BOOT_RECOVERY_BACKOFF_MS, pn as collectSecretLeaves, pr as PEER_BYTES_MAX_OUTSTANDING, q as adminUiCapability, qn as RECORD_DELETE_BATCH, r as maskUrlCredentials, ri as isSecretMarker, rn as RecordFieldPathSchema, rr as REVALIDATE_AFTER_MS, sn as RecordRetentionSchema, sr as forgetKnownSecret, st as expandCapMethods, t as sleep, ti as isSecretClear, tn as assertTransactScope, tr as RECORD_SWEEP_INTERVAL_MS, un as declarationsOf, ur as scrubKnownSecrets, vn as recordSecretRef, w as createEventBusSliceSource, wn as DeclarationRefusedError, x as createDeviceProxy, xn as collectZodSecretPaths, y as DEVICE_SCOPED_CAPS, yn as secretArrayPrefixes, yr as DisposerChain, yt as scopeKey, z as PipelineStepInputSchema, zn as UnknownRecordKindError, zr as parseSecretRef } from "./sleep-6eG9C8Xl.mjs";
|
|
2
2
|
import { t as EventCategory } from "./event-category-DmZDPDf_.mjs";
|
|
3
|
-
import { a as DeviceType, t as errMsg } from "./err-msg-
|
|
3
|
+
import { a as DeviceType, t as errMsg } from "./err-msg-DWXWc0Di.mjs";
|
|
4
4
|
//#region src/generated/cap-input-defaults.ts
|
|
5
5
|
/**
|
|
6
6
|
* AUTO-GENERATED by scripts/generate-cap-input-defaults.ts — DO NOT EDIT.
|
|
@@ -366,7 +366,7 @@ function materialise(defaults) {
|
|
|
366
366
|
* barrel (`ALL_CAPABILITY_DEFINITIONS`), which would cost ~144MB RSS per
|
|
367
367
|
* forked runner. See docs/decisions/adr-0028.md.
|
|
368
368
|
*
|
|
369
|
-
* Coverage: 28 collection caps,
|
|
369
|
+
* Coverage: 28 collection caps, 48 array methods.
|
|
370
370
|
*/
|
|
371
371
|
var COLLECTION_ARRAY_METHODS = Object.freeze({
|
|
372
372
|
"action-source": ["listActions"],
|
|
@@ -377,7 +377,12 @@ var COLLECTION_ARRAY_METHODS = Object.freeze({
|
|
|
377
377
|
"calendar-source": ["listCalendars", "listEvents"],
|
|
378
378
|
"custom-model-registry": ["listModels"],
|
|
379
379
|
"data-store-provider": ["histogram", "query"],
|
|
380
|
-
"device-export": [
|
|
380
|
+
"device-export": [
|
|
381
|
+
"listExposedDevices",
|
|
382
|
+
"listExposedEntities",
|
|
383
|
+
"listSupportedDeviceKinds",
|
|
384
|
+
"listSupportedEntityKinds"
|
|
385
|
+
],
|
|
381
386
|
"device-extension": ["listSlots", "listSources"],
|
|
382
387
|
"device-provider": ["discoverDevices", "getDevices"],
|
|
383
388
|
"device-removal-hook": ["listDeviceData"],
|
|
@@ -428,9 +433,15 @@ function isCollectionArrayMethodName(capName, method) {
|
|
|
428
433
|
* Per capability, the methods declared `optionalMethod` — the ones whose
|
|
429
434
|
* ABSENCE on a provider is a fact about that provider, not a bug.
|
|
430
435
|
*
|
|
431
|
-
* Coverage:
|
|
436
|
+
* Coverage: 3 caps, 11 methods.
|
|
432
437
|
*/
|
|
433
438
|
var PROVIDER_OPTIONAL_METHODS = Object.freeze({
|
|
439
|
+
"device-export": [
|
|
440
|
+
"exposeEntity",
|
|
441
|
+
"listExposedEntities",
|
|
442
|
+
"listSupportedEntityKinds",
|
|
443
|
+
"unexposeEntity"
|
|
444
|
+
],
|
|
434
445
|
"log-destination": [
|
|
435
446
|
"cancelRead",
|
|
436
447
|
"describeRead",
|
|
@@ -458,4 +469,4 @@ function isProviderOptionalMethodName(capName, method) {
|
|
|
458
469
|
return methods !== void 0 && methods.includes(method);
|
|
459
470
|
}
|
|
460
471
|
//#endregion
|
|
461
|
-
export { BOOT_RECOVERY_BACKOFF_MS, BaseAddon, BatchTooLargeError, CALLER_STAMPED_CAPABILITIES, CAP_ADVANCE_FIELDS, CAP_INPUT_DEFAULTS, CAP_STATE_LEAVES, COLLECTION_ARRAY_METHODS, DATAPLANE_SECRET_HEADER, DEVICE_CHILDREN_BATCH_MAX, DEVICE_SCOPED_CAPS, DeclarationRefusedError, DeviceType, DisposerChain, EntryDescriptorSchema, ErrorI18nPayloadSchema, EventCategory, FilterRequiredError, ForeignSecretMarkerError, HF_REPO, InvalidRecordError, MIN_SCRUBBED_LENGTH, MODEL_FORMATS, NoCallerError, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, PROVIDER_OPTIONAL_METHODS, PlaintextSecretError, RECORDS_ERROR_CODES, RECORD_BATCH_MAX, RECORD_BATCH_MAX_BYTES, RECORD_CLASSES, RECORD_DATABASES, RECORD_DEFAULT_MAX_DATA_BYTES, RECORD_DELETE_BATCH, RECORD_ID_MAX_LENGTH, RECORD_MAX_DATA_BYTES, RECORD_MAX_INDEXES, RECORD_MAX_INDEX_FIELDS, RECORD_QUERY_MAX, RECORD_SECRET_COLLECTION_PREFIX, RECORD_SETTINGS_MAX_ROWS, RECORD_SWEEP_INTERVAL_MS, REMOVE_LEAF, REVALIDATE_AFTER_MS, ReadinessRegistry, ReadinessTimeoutError, RecordFieldPathSchema, RecordIndexSchema, RecordKindDeclarationSchema, RecordKindNameSchema, RecordNotFoundError, RecordRetentionSchema, RecordSecretUnavailableError, RecordTooLargeError, RecordUniqueViolationError, RecordsError, RevConflictError, SECRET_CLEAR, SECRET_REF_SCHEME, StoredRecordKindDeclarationSchema, TransactRefusedError, UnindexedFilterError, UnknownRecordKindError, addonSliceHandleApi, adminUiCapability, arrayItemFieldPath, asJsonObject, asRecordsError, asString, assertTransactScope, assertValidDeclaration, buildSecretRef, classifySecretWrite, clearKnownSecrets, collectSecretLeaves, collectZodSecretPaths, createDeviceProxy, createEvent, createEventBusSliceSource, createRecordsAccess, createSecretsAccess, declarationsOf, defineEntryKind, defineRecordKinds, describeCustomActions, deviceOpsCapability, emitReadiness, entryBody, errMsg, expandCapMethods, forgetKnownSecret, formatSecretScope, globalSecretScope, hfModelUrl, isCollectionArrayMethodName, isDeviceScopedCap, isProviderOptionalMethodName, isSecretClear, isSecretFieldView, isSecretMarker, isSecretMarkerLike, isSecretRef, isZodSecret, knownSecretCount, makeInMemoryRecords, makeSecretMarker, mapSecretLeaves, maskUrlCredentials, nodePin, normalizeAddonInitResult, normalizeSecretOwner, parseJsonUnknown, parseSecretPath, parseSecretRef, readErrorI18n, readNodePin, recordArrayItemPath, recordSecretCollection, recordSecretRef, recordsErrorFromMessage, registerKnownSecret, resolveSecretViewsIn, scopeKey, scrubKnownSecrets, secretArrayPrefixes, shortSecretRefHash, sleep, toSecretFieldView, viewerUiCapability, withCapInputDefaults, withoutCallerStamp };
|
|
472
|
+
export { BOOT_RECOVERY_BACKOFF_MS, BaseAddon, BatchTooLargeError, CALLER_STAMPED_CAPABILITIES, CAP_ADVANCE_FIELDS, CAP_INPUT_DEFAULTS, CAP_STATE_LEAVES, COLLECTION_ARRAY_METHODS, DATAPLANE_SECRET_HEADER, DEVICE_CHILDREN_BATCH_MAX, DEVICE_SCOPED_CAPS, DeclarationRefusedError, DeviceType, DisposerChain, EntryDescriptorSchema, ErrorI18nPayloadSchema, EventCategory, FilterRequiredError, ForeignSecretMarkerError, HF_REPO, InvalidRecordError, MIN_SCRUBBED_LENGTH, MODEL_FORMATS, NoCallerError, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, PROVIDER_OPTIONAL_METHODS, PipelineRunResultBridge, PipelineStepInputSchema, PlaintextSecretError, RECORDS_ERROR_CODES, RECORD_BATCH_MAX, RECORD_BATCH_MAX_BYTES, RECORD_CLASSES, RECORD_DATABASES, RECORD_DEFAULT_MAX_DATA_BYTES, RECORD_DELETE_BATCH, RECORD_ID_MAX_LENGTH, RECORD_MAX_DATA_BYTES, RECORD_MAX_INDEXES, RECORD_MAX_INDEX_FIELDS, RECORD_QUERY_MAX, RECORD_SECRET_COLLECTION_PREFIX, RECORD_SETTINGS_MAX_ROWS, RECORD_SWEEP_INTERVAL_MS, REMOVE_LEAF, REVALIDATE_AFTER_MS, ReadinessRegistry, ReadinessTimeoutError, RecordFieldPathSchema, RecordIndexSchema, RecordKindDeclarationSchema, RecordKindNameSchema, RecordNotFoundError, RecordRetentionSchema, RecordSecretUnavailableError, RecordTooLargeError, RecordUniqueViolationError, RecordsError, RevConflictError, SECRET_CLEAR, SECRET_REF_SCHEME, StoredRecordKindDeclarationSchema, TransactRefusedError, UnindexedFilterError, UnknownRecordKindError, addonPagesSourceCapability, addonSliceHandleApi, adminUiCapability, arrayItemFieldPath, asJsonObject, asRecordsError, asString, assertTransactScope, assertValidDeclaration, buildSecretRef, classifySecretWrite, clearKnownSecrets, collectSecretLeaves, collectZodSecretPaths, createDeviceProxy, createEvent, createEventBusSliceSource, createRecordsAccess, createSecretsAccess, customAction, declarationsOf, defineCustomActions, defineEntryKind, defineRecordKinds, describeCustomActions, deviceOpsCapability, emitReadiness, entryBody, errMsg, expandCapMethods, forgetKnownSecret, formatSecretScope, globalSecretScope, hfModelUrl, isCollectionArrayMethodName, isDeviceScopedCap, isProviderOptionalMethodName, isSecretClear, isSecretFieldView, isSecretMarker, isSecretMarkerLike, isSecretRef, isZodSecret, knownSecretCount, makeInMemoryRecords, makeSecretMarker, mapSecretLeaves, maskUrlCredentials, nodePin, normalizeAddonInitResult, normalizeSecretOwner, parseJsonUnknown, parseSecretPath, parseSecretRef, readErrorI18n, readNodePin, recordArrayItemPath, recordSecretCollection, recordSecretRef, recordsErrorFromMessage, registerKnownSecret, resolveSecretViewsIn, scopeKey, scrubKnownSecrets, secretArrayPrefixes, shortSecretRefHash, sleep, toSecretFieldView, viewerUiCapability, withCapInputDefaults, withoutCallerStamp };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a device exporter (HomeKit, Alexa, Home Assistant) does with the
|
|
3
|
+
* non-device entities it may expose (D968): run an action, send through a
|
|
4
|
+
* notification target, drop what was deleted.
|
|
5
|
+
*
|
|
6
|
+
* One implementation, so the three exporters refuse and log the same way:
|
|
7
|
+
* - running goes through `actions.run` and RESPECTS its refusal — an action
|
|
8
|
+
* that is already running or in cooldown is logged with a named reason and
|
|
9
|
+
* never queued or retried (D391);
|
|
10
|
+
* - an exported action or target that no longer exists is dropped from the
|
|
11
|
+
* export, and the drop is logged.
|
|
12
|
+
*
|
|
13
|
+
* Actions are list entries, not devices (D954): the log tag is `actionId`,
|
|
14
|
+
* never `deviceId`.
|
|
15
|
+
*/
|
|
16
|
+
import type { IScopedLogger } from '../interfaces/logging.js';
|
|
17
|
+
import type { ActionRunResult } from './action.js';
|
|
18
|
+
import type { ExportEntityRef } from '../capabilities/device-export.cap.js';
|
|
19
|
+
import { NotificationSchema, type SendResult, type Target } from '../capabilities/notification-output.cap.js';
|
|
20
|
+
import type { z } from 'zod';
|
|
21
|
+
/** What an exporter needs to know about an action to offer it. */
|
|
22
|
+
export interface ExportableAction {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly name: string;
|
|
25
|
+
}
|
|
26
|
+
/** The slice of `ctx.api` the exporters use for non-device entities. */
|
|
27
|
+
export interface ExportEntityApi {
|
|
28
|
+
readonly actions: {
|
|
29
|
+
readonly list: {
|
|
30
|
+
query(input?: Record<string, never>): Promise<readonly ExportableAction[]>;
|
|
31
|
+
};
|
|
32
|
+
readonly run: {
|
|
33
|
+
mutate(input: {
|
|
34
|
+
readonly actionId: string;
|
|
35
|
+
}): Promise<ActionRunResult>;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
readonly notificationOutput: {
|
|
39
|
+
readonly listTargets: {
|
|
40
|
+
query(input?: Record<string, never>): Promise<readonly Target[]>;
|
|
41
|
+
};
|
|
42
|
+
readonly send: {
|
|
43
|
+
mutate(input: {
|
|
44
|
+
readonly targetId: string;
|
|
45
|
+
readonly addonId: string;
|
|
46
|
+
readonly notification: z.output<typeof NotificationSchema>;
|
|
47
|
+
}): Promise<SendResult>;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export type ExportActionRefusalReason = 'already-running' | 'cooldown' | 'not-found';
|
|
52
|
+
export type ExportedActionRun = {
|
|
53
|
+
readonly status: 'started';
|
|
54
|
+
} | {
|
|
55
|
+
readonly status: 'refused';
|
|
56
|
+
readonly reason: ExportActionRefusalReason;
|
|
57
|
+
} | {
|
|
58
|
+
readonly status: 'failed';
|
|
59
|
+
readonly message: string;
|
|
60
|
+
};
|
|
61
|
+
export interface RunExportedActionInput {
|
|
62
|
+
/** The exporter's own name, for the log line (`hap`, `alexa`, `ha`). */
|
|
63
|
+
readonly exporter: string;
|
|
64
|
+
readonly actionId: string;
|
|
65
|
+
}
|
|
66
|
+
export declare function runExportedAction(api: ExportEntityApi, log: IScopedLogger, input: RunExportedActionInput): Promise<ExportedActionRun>;
|
|
67
|
+
export type ExportTargetRefusalReason = 'target-gone' | 'target-disabled';
|
|
68
|
+
export type ExportedTargetSend = {
|
|
69
|
+
readonly status: 'sent';
|
|
70
|
+
} | {
|
|
71
|
+
readonly status: 'refused';
|
|
72
|
+
readonly reason: ExportTargetRefusalReason;
|
|
73
|
+
} | {
|
|
74
|
+
readonly status: 'failed';
|
|
75
|
+
readonly message: string;
|
|
76
|
+
};
|
|
77
|
+
export interface SendToExportedTargetInput {
|
|
78
|
+
readonly exporter: string;
|
|
79
|
+
readonly targetId: string;
|
|
80
|
+
readonly notification: z.input<typeof NotificationSchema>;
|
|
81
|
+
}
|
|
82
|
+
/** Send through one CamStack notification target on behalf of an exporter. */
|
|
83
|
+
export declare function sendToExportedTarget(api: ExportEntityApi, log: IScopedLogger, input: SendToExportedTargetInput): Promise<ExportedTargetSend>;
|
|
84
|
+
export interface LiveEntityIds {
|
|
85
|
+
readonly actionIds: ReadonlySet<string>;
|
|
86
|
+
readonly targetIds: ReadonlySet<string>;
|
|
87
|
+
}
|
|
88
|
+
export interface PrunedEntities {
|
|
89
|
+
readonly kept: readonly ExportEntityRef[];
|
|
90
|
+
readonly dropped: readonly ExportEntityRef[];
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Split an exporter's selection into what still exists and what was deleted.
|
|
94
|
+
* Devices are never judged here (their lifecycle is the tombstone, D865).
|
|
95
|
+
* Callers pass ids from a query that ANSWERED — an unanswered list must not
|
|
96
|
+
* reach this function (D49: a failed read changes nothing).
|
|
97
|
+
*/
|
|
98
|
+
export declare function pruneDeletedEntities(selection: readonly ExportEntityRef[], live: LiveEntityIds, log: IScopedLogger, exporter: string): PrunedEntities;
|
|
@@ -399,7 +399,7 @@ export declare const DEFAULT_RUNTIME_STATE_DURABILITY: RuntimeStateDurability;
|
|
|
399
399
|
* it. The symbol is the quantity's stored base (D944), including `µg/m³` and
|
|
400
400
|
* `m/s`. A per-device quantity (`numeric-sensor`) has no fixed unit.
|
|
401
401
|
*/
|
|
402
|
-
export type HistoryUnit = '%' | 'dBFS' | 'dBm' | '°C' | 'W' | 'kWh' | 'V' | 'A' | 'VA' | 'lx' | 'ppm' | 'ppb' | 'µg/m³' | 'hPa' | 'count' | 'ratio' | 'ms' | 's' | 'days' | 'bytes' | 'kbps' | 'fps' | 'm/s';
|
|
402
|
+
export type HistoryUnit = '%' | 'dBFS' | 'dBm' | '°C' | 'W' | 'kWh' | 'V' | 'A' | 'VA' | 'lx' | 'ppm' | 'ppb' | 'µg/m³' | 'hPa' | 'count' | 'ratio' | 'ms' | 's' | 'days' | 'bytes' | 'kbps' | 'fps' | 'm/s' | 'L';
|
|
403
403
|
/** Display label per {@link HistoryUnit}. */
|
|
404
404
|
export declare const HISTORY_UNIT_LABELS: Readonly<Record<HistoryUnit, string>>;
|
|
405
405
|
/** One `runtimeState` field recorded as a history series. */
|
|
@@ -190,6 +190,16 @@ export declare const ComposerBlockSchema: z.ZodObject<{
|
|
|
190
190
|
omit: "omit";
|
|
191
191
|
}>;
|
|
192
192
|
}, z.core.$strip>], "kind">>;
|
|
193
|
+
reset: z.ZodOptional<z.ZodObject<{
|
|
194
|
+
kind: z.ZodLiteral<"forward">;
|
|
195
|
+
source: z.ZodObject<{
|
|
196
|
+
addonId: z.ZodString;
|
|
197
|
+
stableId: z.ZodString;
|
|
198
|
+
}, z.core.$strip>;
|
|
199
|
+
cap: z.ZodString;
|
|
200
|
+
method: z.ZodString;
|
|
201
|
+
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../index.js").CompositionForwardArg, unknown, z.core.$ZodTypeInternals<import("../index.js").CompositionForwardArg, unknown>>>>;
|
|
202
|
+
}, z.core.$strip>>;
|
|
193
203
|
}, z.core.$strip>>>;
|
|
194
204
|
commands: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
195
205
|
kind: z.ZodLiteral<"forward">;
|
|
@@ -199,6 +209,7 @@ export declare const ComposerBlockSchema: z.ZodObject<{
|
|
|
199
209
|
}, z.core.$strip>;
|
|
200
210
|
cap: z.ZodString;
|
|
201
211
|
method: z.ZodString;
|
|
212
|
+
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../index.js").CompositionForwardArg, unknown, z.core.$ZodTypeInternals<import("../index.js").CompositionForwardArg, unknown>>>>;
|
|
202
213
|
}, z.core.$strip>, z.ZodObject<{
|
|
203
214
|
kind: z.ZodLiteral<"code">;
|
|
204
215
|
code: z.ZodString;
|
|
@@ -420,6 +431,16 @@ export declare const ComposerApplyInputSchema: z.ZodObject<{
|
|
|
420
431
|
omit: "omit";
|
|
421
432
|
}>;
|
|
422
433
|
}, z.core.$strip>], "kind">>;
|
|
434
|
+
reset: z.ZodOptional<z.ZodObject<{
|
|
435
|
+
kind: z.ZodLiteral<"forward">;
|
|
436
|
+
source: z.ZodObject<{
|
|
437
|
+
addonId: z.ZodString;
|
|
438
|
+
stableId: z.ZodString;
|
|
439
|
+
}, z.core.$strip>;
|
|
440
|
+
cap: z.ZodString;
|
|
441
|
+
method: z.ZodString;
|
|
442
|
+
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../index.js").CompositionForwardArg, unknown, z.core.$ZodTypeInternals<import("../index.js").CompositionForwardArg, unknown>>>>;
|
|
443
|
+
}, z.core.$strip>>;
|
|
423
444
|
}, z.core.$strip>>>;
|
|
424
445
|
commands: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
425
446
|
kind: z.ZodLiteral<"forward">;
|
|
@@ -429,6 +450,7 @@ export declare const ComposerApplyInputSchema: z.ZodObject<{
|
|
|
429
450
|
}, z.core.$strip>;
|
|
430
451
|
cap: z.ZodString;
|
|
431
452
|
method: z.ZodString;
|
|
453
|
+
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../index.js").CompositionForwardArg, unknown, z.core.$ZodTypeInternals<import("../index.js").CompositionForwardArg, unknown>>>>;
|
|
432
454
|
}, z.core.$strip>, z.ZodObject<{
|
|
433
455
|
kind: z.ZodLiteral<"code">;
|
|
434
456
|
code: z.ZodString;
|
|
@@ -683,6 +705,16 @@ export declare const composerCapability: {
|
|
|
683
705
|
omit: "omit";
|
|
684
706
|
}>;
|
|
685
707
|
}, z.core.$strip>], "kind">>;
|
|
708
|
+
reset: z.ZodOptional<z.ZodObject<{
|
|
709
|
+
kind: z.ZodLiteral<"forward">;
|
|
710
|
+
source: z.ZodObject<{
|
|
711
|
+
addonId: z.ZodString;
|
|
712
|
+
stableId: z.ZodString;
|
|
713
|
+
}, z.core.$strip>;
|
|
714
|
+
cap: z.ZodString;
|
|
715
|
+
method: z.ZodString;
|
|
716
|
+
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../index.js").CompositionForwardArg, unknown, z.core.$ZodTypeInternals<import("../index.js").CompositionForwardArg, unknown>>>>;
|
|
717
|
+
}, z.core.$strip>>;
|
|
686
718
|
}, z.core.$strip>>>;
|
|
687
719
|
commands: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
688
720
|
kind: z.ZodLiteral<"forward">;
|
|
@@ -692,6 +724,7 @@ export declare const composerCapability: {
|
|
|
692
724
|
}, z.core.$strip>;
|
|
693
725
|
cap: z.ZodString;
|
|
694
726
|
method: z.ZodString;
|
|
727
|
+
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../index.js").CompositionForwardArg, unknown, z.core.$ZodTypeInternals<import("../index.js").CompositionForwardArg, unknown>>>>;
|
|
695
728
|
}, z.core.$strip>, z.ZodObject<{
|
|
696
729
|
kind: z.ZodLiteral<"code">;
|
|
697
730
|
code: z.ZodString;
|
|
@@ -758,6 +791,7 @@ export declare const composerCapability: {
|
|
|
758
791
|
arrayPath: z.ZodString;
|
|
759
792
|
key: z.ZodString;
|
|
760
793
|
label: z.ZodString;
|
|
794
|
+
resettable: z.ZodOptional<z.ZodBoolean>;
|
|
761
795
|
}, z.core.$strip>>;
|
|
762
796
|
state: z.ZodEnum<{
|
|
763
797
|
fresh: "fresh";
|
|
@@ -197,15 +197,14 @@ export declare const consumablesCapability: {
|
|
|
197
197
|
}, z.core.$strip>, z.ZodVoid, "mutation">;
|
|
198
198
|
};
|
|
199
199
|
/**
|
|
200
|
-
* A
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
* commands (`forward`) arrive in slice 3 (D663).
|
|
200
|
+
* A consumable ADDED to an existing device (a graft) refuses `reset` by
|
|
201
|
+
* name: only a composed device of a NEW type forwards an item's reset to a
|
|
202
|
+
* source button, and marks that item `resettable` (D967).
|
|
204
203
|
*/
|
|
205
204
|
readonly composedMethods: {
|
|
206
205
|
readonly reset: {
|
|
207
206
|
readonly kind: 'refuse';
|
|
208
|
-
readonly reason: 'a
|
|
207
|
+
readonly reason: 'a consumable added to an existing device is not resettable — only a new composed device forwards a reset';
|
|
209
208
|
};
|
|
210
209
|
};
|
|
211
210
|
readonly status: {
|