Commit Graph

9 Commits

Author SHA1 Message Date
854d5c7f3f Merge branch 'feat/openapi-envelope-integration' 2026-05-11 01:55:26 +00:00
3f6bfe4972 Merge branch 'feat/response-envelope-types' 2026-05-11 01:55:23 +00:00
f3dac704a7 Merge branch 'feat/bug-pendingrequestmap-type-conflict' 2026-05-11 01:55:20 +00:00
9f4d2fb5f7 fix(PendingRequestMap): resolve type name conflict between env.ts interface and call.ts class
- Remove PendingRequestMap interface from env.ts (had reduced signature missing deadline, identity typed as unknown)
- Add CallMap interface in env.ts with full call() signature matching the class
- Update EnvOptions.callMap to use CallMap type
- Export PendingRequestMap class directly (remove PendingRequestMapClass alias)
- Export CallMap type from index.ts instead of old PendingRequestMap interface
2026-05-11 01:54:04 +00:00
c2c640f480 feat(openapi-envelope): update from_openapi handler to use httpEnvelope and CallError
Handler returns httpEnvelope(data, { statusCode, headers, contentType }) instead of raw response data.
HTTP errors throw CallError('EXECUTION_ERROR', ...) instead of plain Error.
Added tests for envelope wrapping and CallError behavior.
2026-05-11 01:52:09 +00:00
ac28c9308c fix(checkAccess): deny access when resourceType set but identity.resources undefined
The resource access check in checkAccess() was bypassed when identity.resources
was undefined because the condition  evaluated to false, falling through to .

Changed to  with an explicit
 check inside the block, implementing
default-deny semantics per ADR-006.

Added 7 test cases covering:
- undefined resources with resourceType set (denied)
- empty resources with resourceType set (denied)
- non-matching resource type (denied)
- matching type but wrong action (denied)
- matching type and action (granted)
- no resourceType/resourceAction set (granted)
- matching resources with extra scopes (granted)
2026-05-11 01:50:12 +00:00
15a558bace feat(response-envelope-types): add ResponseEnvelope types, schemas, factories, detection, and unwrap 2026-05-11 01:47:26 +00:00
4f11f8e7a0 Separate handler from spec in OperationRegistry, update pubsub API
- Split OperationRegistry into separate specs and handlers maps
- Add registerSpec(), registerHandler(), getHandler() methods
- register() still accepts IOperationDefinition (backward compatible)
- execute() now requires both spec and handler, throws if missing
- Update @alkdev/pubsub integration for v0.1.0 API:
  - subscribe(type, id) now requires id parameter (use  for all events)
  - publish(type, id, payload) now requires 3 args
  - Events unwrapped from EventEnvelope via .payload
- Update buildCallHandler to use getSpec() + getHandler() separately
- Update subscribe.ts to use getHandler()
- Update buildEnv to use getAllSpecs() instead of list()
- Update scanner to validate against OperationSpecSchema
- Update from_mcp and from_openapi to use OperationSpec & { handler } types
- Remove OperationDefinitionSchema from public exports
- Add 7 new registry tests for handler separation
2026-05-09 08:25:59 +00:00
29f0dd7af0 Initial package implementation: operations registry, call protocol, and adapters
Extracted from alkhub_ts packages/core/operations/ and packages/core/mcp/.
- Runtime-agnostic (injected fs/env deps, no Deno globals)
- Direct @logtape/logtape import instead of logger wrapper
- PendingRequestMap with pubsub-wired call protocol
- Peer-dep isolation for MCP adapter (sub-path export)
- Schema const naming convention (XSchema + X type alias)
- 68 tests passing, build + lint + test all green
2026-04-30 12:34:26 +00:00