Skip to content

Releases: aiperceivable/apcore-typescript

Release 0.14.1

29 Mar 10:53

Choose a tag to compare

Fixed

  • Executor schema validationExecutor.call() now accepts raw JSON Schema (e.g. from zodToJsonSchema) as inputSchema/outputSchema, not just TypeBox TSchema. Previously, passing raw JSON Schema caused TypeBox Value.Check() to throw "Unknown type". The fix auto-converts via jsonSchemaToTypeBox() on first use and caches the result on the module object to avoid repeated conversion.

Release 0.14.0

25 Mar 02:18

Choose a tag to compare

Breaking Changes

  • Middleware default priority changed from 0 to 100 per PROTOCOL_SPEC §11.2. Middleware without explicit priority will now execute before priority-0 middleware.

Added

  • Middleware priorityMiddleware base class now accepts priority: number (default 0). Higher priority executes first; equal priority preserves registration order. BeforeMiddleware and AfterMiddleware adapters also accept priority.
  • Priority range validationRangeError thrown for values outside 0-1000

Release 0.13.1

22 Mar 12:56

Choose a tag to compare

Changed

  • Rebrand: aipartnerup → aiperceivable

Release 0.13.0

12 Mar 06:50

Choose a tag to compare

Added

  • Caching/pagination annotationsModuleAnnotations gains 5 optional fields: cacheable, cacheTtl, cacheKeyFields, paginated, paginationStyle (backward compatible)
  • paginationStyle union — Typed as 'cursor' | 'offset' | 'page' matching Python SDK and spec
  • sunsetDate — New field on ModuleDescriptor and LLMExtensions for module deprecation lifecycle
  • onSuspend() / onResume() lifecycle hooks — Optional methods on Module interface for state preservation during hot-reload; integrated into control module reload flow
  • MCP _meta export — Schema exporter includes cacheable, cacheTtl, cacheKeyFields, paginated, paginationStyle in _meta sub-dict
  • Suspend/resume tests — 5 test cases in test-control.test.ts covering 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

11 Mar 08:48

Choose a tag to compare

Added

  • Module.preflight() — Optional method for domain-specific pre-execution warnings (spec §5.6)
  • Module.describe() — Optional method returning ModuleDescription for LLM/AI tool discovery (spec §5.6)
  • ModuleDescription interface — Typed return type for Module.describe(), exported from package index

Changed

  • ExecutionCancelledError now extends ModuleError (was bare Error) with error code EXECUTION_CANCELLED, aligning with PROTOCOL_SPEC §8.7 error hierarchy
  • ErrorCodes — Added EXECUTION_CANCELLED constant

Fixed

  • Removed phantom CHANGELOG entryModuleAnnotations.batchProcessing (v0.4.0) was never implemented

Release 0.11.0

09 Mar 11:40

Choose a tag to compare

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, shared context.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 recording ModuleError details.
  • 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 toggleToggleState with disable()/enable(), ModuleDisabledError enforcement.

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 VERSION constant in built dist (0.9.0 vs 0.11.0). Rebuilt dist to match package.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

08 Mar 03:03

Choose a tag to compare

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 Module interface: stream?(), validate?(), onLoad?(), onUnload?().

Error Hierarchy

  • NotImplementedError — New error class for GENERAL_NOT_IMPLEMENTED code.
  • DependencyNotFoundError — New error class for DEPENDENCY_NOT_FOUND code.

Changed

  • APCore client now provides full feature parity with Executor.

Release 0.9.0

06 Mar 08:47

Choose a tag to compare

Added

Enhanced Executor.validate() Preflight

  • PreflightCheckResult — New readonly interface representing a single preflight check result with check, passed, and error fields.
  • PreflightResult — New readonly interface returned by Executor.validate(), containing per-check results, requiresApproval flag, and computed errors array. Duck-type compatible with ValidationResult.
  • createPreflightResult() — Factory function for constructing PreflightResult from a checks array.
  • Full 6-check preflightvalidate() 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 from ValidationResult to PreflightResult. Backward compatible: .valid and .errors still work identically for existing consumers.
  • validate() signature — Added optional context parameter for call-chain checks; inputs now optional (defaults to {}).

Public API

  • Exported PreflightCheckResult, PreflightResult, and createPreflightResult from top-level index.ts.

Release 0.8.0

06 Mar 06:02

Choose a tag to compare

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 receives ModuleError instances with trace context.

Error System

  • ErrorCodeRegistry — Custom module error codes are validated against framework prefixes and other modules to prevent collisions. Raises ErrorCodeCollisionError on conflict.
  • VersionIncompatibleError — New error class for SDK/config version mismatches with negotiateVersion() utility.
  • MiddlewareChainError — Now explicitly DEFAULT_RETRYABLE = false per PROTOCOL_SPEC §8.6.
  • ErrorCodes — Added VERSION_INCOMPATIBLE and ERROR_CODE_COLLISION constants (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 loggingACL constructor accepts optional auditLogger callback. All access decisions emit AuditEntry with timestamp, caller/target IDs, matched rule, identity, and trace context.
  • Condition-based rules — ACL rules support conditions for identity type, role, and call depth filtering.

Config System

  • Full validationConfig.validate() checks schema structure, value types, and range constraints.
  • Hot reloadConfig.reload() re-reads the YAML source and re-validates.
  • Environment overridesAPCORE_* 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 services typingContext<T> supports typed dependency injection via the services field.

Changed

Executor Internals

  • _checkSafety() now delegates to standalone guardCallChain() 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.ts exports with new symbols: RetryMiddleware, RetryConfig, ErrorCodeRegistry, ErrorCodeCollisionError, VersionIncompatibleError, negotiateVersion, guardCallChain, propagateError, normalizeToCanonicalId, calculateSpecificity, AuditEntry.

Release 0.7.1

02 Mar 10:46

Choose a tag to compare

Release version 0.7.1