Releases: aiperceivable/apcore-typescript
Releases · aiperceivable/apcore-typescript
Release 0.14.1
Fixed
- Executor schema validation —
Executor.call()now accepts raw JSON Schema (e.g. fromzodToJsonSchema) asinputSchema/outputSchema, not just TypeBoxTSchema. Previously, passing raw JSON Schema caused TypeBoxValue.Check()to throw "Unknown type". The fix auto-converts viajsonSchemaToTypeBox()on first use and caches the result on the module object to avoid repeated conversion.
Release 0.14.0
Breaking Changes
- Middleware default priority changed from
0to100per PROTOCOL_SPEC §11.2. Middleware without explicit priority will now execute before priority-0 middleware.
Added
- Middleware priority —
Middlewarebase class now acceptspriority: number(default 0). Higher priority executes first; equal priority preserves registration order.BeforeMiddlewareandAfterMiddlewareadapters also acceptpriority. - Priority range validation —
RangeErrorthrown for values outside 0-1000
Release 0.13.1
Changed
- Rebrand: aipartnerup → aiperceivable
Release 0.13.0
Added
- Caching/pagination annotations —
ModuleAnnotationsgains 5 optional fields:cacheable,cacheTtl,cacheKeyFields,paginated,paginationStyle(backward compatible) paginationStyleunion — Typed as'cursor' | 'offset' | 'page'matching Python SDK and specsunsetDate— New field onModuleDescriptorandLLMExtensionsfor module deprecation lifecycleonSuspend()/onResume()lifecycle hooks — Optional methods onModuleinterface for state preservation during hot-reload; integrated into control module reload flow- MCP
_metaexport — Schema exporter includescacheable,cacheTtl,cacheKeyFields,paginated,paginationStylein_metasub-dict - Suspend/resume tests — 5 test cases in
test-control.test.tscovering happy path, null return, no hooks, error paths - README Links section — Footer with Documentation, Specification, GitHub, npm, Issues links
Changed
- Rebranded — "module development framework" → "module standard" in package.json, index.ts, README, and internal JSDoc
- README — Three-tier slogan/subtitle/definition format, annotation features in feature list
dictToAnnotations— Snake_case fallbacks for new fields (cache_ttl,cache_key_fields,pagination_style)- All sys-module annotations — Updated with new fields (9 modules across 5 files)
Release 0.12.0
Added
Module.preflight()— Optional method for domain-specific pre-execution warnings (spec §5.6)Module.describe()— Optional method returningModuleDescriptionfor LLM/AI tool discovery (spec §5.6)ModuleDescriptioninterface — Typed return type forModule.describe(), exported from package index
Changed
ExecutionCancelledErrornow extendsModuleError(was bareError) with error codeEXECUTION_CANCELLED, aligning with PROTOCOL_SPEC §8.7 error hierarchyErrorCodes— AddedEXECUTION_CANCELLEDconstant
Fixed
- Removed phantom CHANGELOG entry —
ModuleAnnotations.batchProcessing(v0.4.0) was never implemented
Release 0.11.0
Added
- Full lifecycle integration tests (
tests/integration/test-full-lifecycle.test.ts) — 8 tests covering the complete 11-step pipeline with all gates (ACL + Approval + Middleware + Schema validation) enabled simultaneously, nested module calls, sharedcontext.data, error propagation, schema validation, and safe hot-reload lifecycle.
System Modules — AI Bidirectional Introspection
Built-in system.* modules that allow AI agents to query, monitor
system.health.summary/system.health.module— Health status classification with error history integration.system.manifest.module/system.manifest.full— Module introspection and full registry manifest with filtering.system.usage.summary/system.usage.module— Usage statistics with hourly trend data.system.control.update_config— Runtime config hot-patching.system.control.reload_module— Hot-reload modules from disk.system.control.toggle_feature— Enable/disable modules at runtime.registerSysModules()— Auto-registration wiring for all system modules.
Observability
ErrorHistory— Ring buffer tracking recent errors with deduplication.ErrorHistoryMiddleware— Middleware recordingModuleErrordetails.UsageCollector/UsageMiddleware— Per-module call counting, latency histograms, and hourly trends.PlatformNotifyMiddleware— Threshold-based sensor emitting events on error rate spikes.
Event System
EventEmitter— Global event bus with async subscriber dispatch.WebhookSubscriber— HTTP POST event delivery with retry.A2ASubscriber— Agent-to-Agent protocol event bridge.
APCore Unified Client
APCore.on()/APCore.off()— Event subscription management via the unified client.APCore.disable()/APCore.enable()— Module toggle control via the unified client.
Registry
- Module toggle —
ToggleStatewithdisable()/enable(),ModuleDisabledErrorenforcement.
Examples
examples/directory — 7 runnable examples mirroring apcore-python: simple client, minimal module, readonly module, full-featured module with ContextLogger,module()function, and YAML binding with target function.
Fixed
- Stale
VERSIONconstant in built dist (0.9.0vs0.11.0). Rebuilt dist to matchpackage.json. - README architecture tree updated to include ~20 missing source files (
client.ts,events/,sys-modules/, etc.). - README error class count corrected to 35.
Release 0.10.0
Added
APCore Unified Client
APCore.stream()— Stream module output chunk by chunk via the unified client.APCore.validate()— Non-destructive preflight check via the unified client.APCore.describe()— Get module description info (for AI/LLM use).APCore.useBefore()— Add before function middleware via the unified client.APCore.useAfter()— Add after function middleware via the unified client.APCore.remove()— Remove middleware by identity via the unified client.
Module Interface
- Optional methods added to
Moduleinterface:stream?(),validate?(),onLoad?(),onUnload?().
Error Hierarchy
NotImplementedError— New error class forGENERAL_NOT_IMPLEMENTEDcode.DependencyNotFoundError— New error class forDEPENDENCY_NOT_FOUNDcode.
Changed
- APCore client now provides full feature parity with
Executor.
Release 0.9.0
Added
Enhanced Executor.validate() Preflight
PreflightCheckResult— New readonly interface representing a single preflight check result withcheck,passed, anderrorfields.PreflightResult— New readonly interface returned byExecutor.validate(), containing per-check results,requiresApprovalflag, and computederrorsarray. Duck-type compatible withValidationResult.createPreflightResult()— Factory function for constructingPreflightResultfrom a checks array.- Full 6-check preflight —
validate()now runs Steps 1–6 of the pipeline (module_id format, module lookup, call chain safety, ACL, approval detection, schema validation) without executing module code or middleware.
Changed
Executor Pipeline
- Step renumbering — Approval Gate renumbered from Step 4.5 to Step 5; all subsequent steps shifted +1 (now 11 clean steps).
validate()return type — Changed fromValidationResulttoPreflightResult. Backward compatible:.validand.errorsstill work identically for existing consumers.validate()signature — Added optionalcontextparameter for call-chain checks;inputsnow optional (defaults to{}).
Public API
- Exported
PreflightCheckResult,PreflightResult, andcreatePreflightResultfrom top-levelindex.ts.
Release 0.8.0
Added
Executor Enhancements
- Dual-timeout model — Global deadline enforcement (
executor.global_timeout) alongside per-module timeout. The shorter of the two is applied, preventing nested call chains from exceeding the global budget. - Error propagation (Algorithm A11) — All execution paths wrap exceptions via
propagateError(), ensuring middleware always receivesModuleErrorinstances with trace context.
Error System
- ErrorCodeRegistry — Custom module error codes are validated against framework prefixes and other modules to prevent collisions. Raises
ErrorCodeCollisionErroron conflict. - VersionIncompatibleError — New error class for SDK/config version mismatches with
negotiateVersion()utility. - MiddlewareChainError — Now explicitly
DEFAULT_RETRYABLE = falseper PROTOCOL_SPEC §8.6. - ErrorCodes — Added
VERSION_INCOMPATIBLEandERROR_CODE_COLLISIONconstants (34 total).
Utilities
guardCallChain()— Standalone Algorithm A20 implementation for call chain safety checks (depth, circular, frequency). Executor delegates to this utility instead of inline logic.propagateError()— Standalone Algorithm A11 implementation for error wrapping and trace context attachment.normalizeToCanonicalId()— Cross-language module ID normalization (Python snake_case, Go PascalCase, etc.).calculateSpecificity()— ACL pattern specificity scoring for deterministic rule ordering.
ACL Enhancements
- Audit logging —
ACLconstructor accepts optionalauditLoggercallback. All access decisions emitAuditEntrywith timestamp, caller/target IDs, matched rule, identity, and trace context. - Condition-based rules — ACL rules support
conditionsfor identity type, role, and call depth filtering.
Config System
- Full validation —
Config.validate()checks schema structure, value types, and range constraints. - Hot reload —
Config.reload()re-reads the YAML source and re-validates. - Environment overrides —
APCORE_*environment variables override config values (e.g.,APCORE_EXECUTOR_DEFAULT_TIMEOUT=5000). Config.fromDefaults()— Factory method for default configuration.
Middleware
- RetryMiddleware — Configurable retry with exponential/fixed backoff, jitter, and max delay. Only retries errors marked
retryable: true.
Context
- Generic
servicestyping —Context<T>supports typed dependency injection via theservicesfield.
Changed
Executor Internals
_checkSafety()now delegates to standaloneguardCallChain()instead of inline duplicated logic.- Global deadline set on root call only, propagated to child contexts via shared
data['_global_deadline'].
Public API
- Expanded
index.tsexports with new symbols:RetryMiddleware,RetryConfig,ErrorCodeRegistry,ErrorCodeCollisionError,VersionIncompatibleError,negotiateVersion,guardCallChain,propagateError,normalizeToCanonicalId,calculateSpecificity,AuditEntry.
Release 0.7.1
Release version 0.7.1