@outfitter/contracts 0.4.0 → 0.4.1

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.
Files changed (39) hide show
  1. package/dist/actions.d.ts +4 -4
  2. package/dist/adapters.d.ts +1 -1
  3. package/dist/assert/index.d.ts +2 -2
  4. package/dist/capabilities.d.ts +1 -1
  5. package/dist/context.d.ts +4 -4
  6. package/dist/envelope.d.ts +2 -2
  7. package/dist/envelope.js +4 -4
  8. package/dist/errors.d.ts +1 -1
  9. package/dist/handler.d.ts +3 -3
  10. package/dist/index.d.ts +17 -17
  11. package/dist/index.js +40 -40
  12. package/dist/logging.d.ts +1 -1
  13. package/dist/recovery.d.ts +2 -2
  14. package/dist/redactor.d.ts +1 -1
  15. package/dist/resilience.d.ts +2 -2
  16. package/dist/result/index.d.ts +2 -2
  17. package/dist/result/utilities.d.ts +1 -1
  18. package/dist/schema.d.ts +1 -1
  19. package/dist/serialization.d.ts +2 -2
  20. package/dist/serialization.js +2 -2
  21. package/dist/shared/@outfitter/{contracts-ss9vjjft.d.ts → contracts-0akf2sm6.d.ts} +10 -10
  22. package/dist/shared/@outfitter/{contracts-25bkj17f.d.ts → contracts-1waabxbk.d.ts} +10 -10
  23. package/dist/shared/@outfitter/{contracts-j08e95jw.d.ts → contracts-31penhwa.d.ts} +1 -1
  24. package/dist/shared/@outfitter/{contracts-sf1z80yc.d.ts → contracts-56pcsavx.d.ts} +17 -17
  25. package/dist/shared/@outfitter/{contracts-btg89x4h.js → contracts-85nd53s9.js} +4 -4
  26. package/dist/shared/@outfitter/{contracts-bdwg55c5.d.ts → contracts-95cc3y06.d.ts} +13 -13
  27. package/dist/shared/@outfitter/{contracts-6j6z9dsd.d.ts → contracts-9wtm5nsw.d.ts} +1 -1
  28. package/dist/shared/@outfitter/{contracts-jggbn5tn.d.ts → contracts-e4m948m7.d.ts} +10 -10
  29. package/dist/shared/@outfitter/{contracts-evxky148.d.ts → contracts-k71jqd1m.d.ts} +1 -1
  30. package/dist/shared/@outfitter/{contracts-18vcxecr.d.ts → contracts-mmg0npfk.d.ts} +1 -1
  31. package/dist/validation.d.ts +2 -2
  32. package/package.json +3 -2
  33. package/dist/shared/@outfitter/{contracts-r35bn9p6.d.ts → contracts-3gswmhb1.d.ts} +2 -2
  34. package/dist/shared/@outfitter/{contracts-5k6q4n48.js → contracts-3wj7xghe.js} +5 -5
  35. package/dist/shared/@outfitter/{contracts-e70qdasg.d.ts → contracts-9yd4vrjg.d.ts} +12 -12
  36. package/dist/shared/@outfitter/{contracts-93dx53mt.d.ts → contracts-c2cfj172.d.ts} +32 -32
  37. package/dist/shared/@outfitter/{contracts-2g8r01zf.d.ts → contracts-rwzqy9rn.d.ts} +10 -10
  38. package/dist/shared/@outfitter/{contracts-hbbxbwkt.d.ts → contracts-t79engf9.d.ts} +21 -21
  39. package/dist/shared/@outfitter/{contracts-bb4hjt8g.d.ts → contracts-y8f0m1ze.d.ts} +1 -1
package/dist/actions.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { ACTION_SURFACES, ActionApiSpec, ActionCliInputContext, ActionCliOption, ActionCliSpec, ActionMcpSpec, ActionRegistry, ActionSpec, ActionSurface, ActionTrpcSpec, AnyActionSpec, DEFAULT_REGISTRY_SURFACES, HttpMethod, createActionRegistry, defineAction } from "./shared/@outfitter/contracts-sf1z80yc";
2
- import "./shared/@outfitter/contracts-ss9vjjft";
3
- import "./shared/@outfitter/contracts-r35bn9p6";
4
- import "./shared/@outfitter/contracts-2g8r01zf";
1
+ import { ACTION_SURFACES, ActionApiSpec, ActionCliInputContext, ActionCliOption, ActionCliSpec, ActionMcpSpec, ActionRegistry, ActionSpec, ActionSurface, ActionTrpcSpec, AnyActionSpec, DEFAULT_REGISTRY_SURFACES, HttpMethod, createActionRegistry, defineAction } from "./shared/@outfitter/contracts-56pcsavx.js";
2
+ import "./shared/@outfitter/contracts-0akf2sm6.js";
3
+ import "./shared/@outfitter/contracts-3gswmhb1.js";
4
+ import "./shared/@outfitter/contracts-rwzqy9rn.js";
5
5
  export { defineAction, createActionRegistry, HttpMethod, DEFAULT_REGISTRY_SURFACES, AnyActionSpec, ActionTrpcSpec, ActionSurface, ActionSpec, ActionRegistry, ActionMcpSpec, ActionCliSpec, ActionCliOption, ActionCliInputContext, ActionApiSpec, ACTION_SURFACES };
@@ -1,2 +1,2 @@
1
- import { AdapterAuthError, AuthAdapter, CacheAdapter, CacheError, IndexAdapter, IndexError, IndexStats, SearchOptions, SearchResult, StorageAdapter, StorageError } from "./shared/@outfitter/contracts-93dx53mt";
1
+ import { AdapterAuthError, AuthAdapter, CacheAdapter, CacheError, IndexAdapter, IndexError, IndexStats, SearchOptions, SearchResult, StorageAdapter, StorageError } from "./shared/@outfitter/contracts-c2cfj172.js";
2
2
  export { StorageError, StorageAdapter, SearchResult, SearchOptions, IndexStats, IndexError, IndexAdapter, CacheError, CacheAdapter, AuthAdapter, AdapterAuthError };
@@ -1,3 +1,3 @@
1
- import { NonEmptyArray, assertDefined, assertMatches, assertNonEmpty, isNonEmptyArray } from "../shared/@outfitter/contracts-18vcxecr";
2
- import "../shared/@outfitter/contracts-r35bn9p6";
1
+ import { NonEmptyArray, assertDefined, assertMatches, assertNonEmpty, isNonEmptyArray } from "../shared/@outfitter/contracts-mmg0npfk.js";
2
+ import "../shared/@outfitter/contracts-3gswmhb1.js";
3
3
  export { isNonEmptyArray, assertNonEmpty, assertMatches, assertDefined, NonEmptyArray };
@@ -1,2 +1,2 @@
1
- import { ACTION_CAPABILITIES, ActionCapability, CAPABILITY_SURFACES, CapabilitySurface, DEFAULT_ACTION_SURFACES, capability, capabilityAll, getActionsForSurface } from "./shared/@outfitter/contracts-bb4hjt8g";
1
+ import { ACTION_CAPABILITIES, ActionCapability, CAPABILITY_SURFACES, CapabilitySurface, DEFAULT_ACTION_SURFACES, capability, capabilityAll, getActionsForSurface } from "./shared/@outfitter/contracts-y8f0m1ze.js";
2
2
  export { getActionsForSurface, capabilityAll, capability, DEFAULT_ACTION_SURFACES, CapabilitySurface, CAPABILITY_SURFACES, ActionCapability, ACTION_CAPABILITIES };
package/dist/context.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { CreateContextOptions, createContext, generateRequestId } from "./shared/@outfitter/contracts-25bkj17f";
2
- import "./shared/@outfitter/contracts-ss9vjjft";
3
- import "./shared/@outfitter/contracts-r35bn9p6";
4
- import "./shared/@outfitter/contracts-2g8r01zf";
1
+ import { CreateContextOptions, createContext, generateRequestId } from "./shared/@outfitter/contracts-1waabxbk.js";
2
+ import "./shared/@outfitter/contracts-0akf2sm6.js";
3
+ import "./shared/@outfitter/contracts-3gswmhb1.js";
4
+ import "./shared/@outfitter/contracts-rwzqy9rn.js";
5
5
  export { generateRequestId, createContext, CreateContextOptions };
@@ -1,3 +1,3 @@
1
- import { Envelope, EnvelopeMeta, ErrorEnvelope, HttpResponse, PaginationMeta, SuccessEnvelope, toEnvelope, toHttpResponse } from "./shared/@outfitter/contracts-jggbn5tn";
2
- import "./shared/@outfitter/contracts-r35bn9p6";
1
+ import { Envelope, EnvelopeMeta, ErrorEnvelope, HttpResponse, PaginationMeta, SuccessEnvelope, toEnvelope, toHttpResponse } from "./shared/@outfitter/contracts-e4m948m7.js";
2
+ import "./shared/@outfitter/contracts-3gswmhb1.js";
3
3
  export { toHttpResponse, toEnvelope, SuccessEnvelope, PaginationMeta, HttpResponse, ErrorEnvelope, EnvelopeMeta, Envelope };
package/dist/envelope.js CHANGED
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  toEnvelope,
4
4
  toHttpResponse
5
- } from "./shared/@outfitter/contracts-btg89x4h.js";
6
- import"./shared/@outfitter/contracts-5k6q4n48.js";
7
- import"./shared/@outfitter/contracts-agmt8915.js";
8
- import"./shared/@outfitter/contracts-phjhz5q3.js";
5
+ } from "./shared/@outfitter/contracts-85nd53s9.js";
6
+ import"./shared/@outfitter/contracts-3wj7xghe.js";
9
7
  import"./shared/@outfitter/contracts-s15x2rs4.js";
8
+ import"./shared/@outfitter/contracts-phjhz5q3.js";
9
+ import"./shared/@outfitter/contracts-agmt8915.js";
10
10
  export {
11
11
  toHttpResponse,
12
12
  toEnvelope
package/dist/errors.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { AlreadyExistsError, AmbiguousError, AnyKitError, AssertionError, AuthError, CancelledError, ConflictError, ERROR_CODES, ErrorCategory, ErrorCode, InternalError, KitErrorProps, NetworkError, NotFoundError, OutfitterError, PermissionError, RateLimitError, SerializedError, TimeoutError, ValidationError, exitCodeMap, getExitCode, getStatusCode, statusCodeMap } from "./shared/@outfitter/contracts-r35bn9p6";
1
+ import { AlreadyExistsError, AmbiguousError, AnyKitError, AssertionError, AuthError, CancelledError, ConflictError, ERROR_CODES, ErrorCategory, ErrorCode, InternalError, KitErrorProps, NetworkError, NotFoundError, OutfitterError, PermissionError, RateLimitError, SerializedError, TimeoutError, ValidationError, exitCodeMap, getExitCode, getStatusCode, statusCodeMap } from "./shared/@outfitter/contracts-3gswmhb1.js";
2
2
  export { statusCodeMap, getStatusCode, getExitCode, exitCodeMap, ValidationError, TimeoutError, SerializedError, RateLimitError, PermissionError, OutfitterError, NotFoundError, NetworkError, KitErrorProps, InternalError, ErrorCode, ErrorCategory, ERROR_CODES, ConflictError, CancelledError, AuthError, AssertionError, AnyKitError, AmbiguousError, AlreadyExistsError };
package/dist/handler.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Handler, HandlerContext, ResolvedConfig, SyncHandler } from "./shared/@outfitter/contracts-ss9vjjft";
2
- import "./shared/@outfitter/contracts-r35bn9p6";
3
- import { Logger } from "./shared/@outfitter/contracts-2g8r01zf";
1
+ import { Handler, HandlerContext, ResolvedConfig, SyncHandler } from "./shared/@outfitter/contracts-0akf2sm6.js";
2
+ import "./shared/@outfitter/contracts-3gswmhb1.js";
3
+ import { Logger } from "./shared/@outfitter/contracts-rwzqy9rn.js";
4
4
  export { SyncHandler, ResolvedConfig, Logger, HandlerContext, Handler };
package/dist/index.d.ts CHANGED
@@ -1,20 +1,20 @@
1
- import "./shared/@outfitter/contracts-qaccq0gf";
2
- import { combine2, combine3, expect, orElse, unwrapOrElse } from "./shared/@outfitter/contracts-ar0etwtx";
3
- import { ACTION_SURFACES, ActionApiSpec, ActionCliInputContext, ActionCliOption, ActionCliSpec, ActionMcpSpec, ActionRegistry, ActionSpec, ActionSurface, ActionTrpcSpec, AnyActionSpec, DEFAULT_REGISTRY_SURFACES, HttpMethod, createActionRegistry, defineAction } from "./shared/@outfitter/contracts-sf1z80yc";
4
- import { ACTION_CAPABILITIES, ActionCapability, CAPABILITY_SURFACES, CapabilitySurface, DEFAULT_ACTION_SURFACES, capability, capabilityAll, getActionsForSurface } from "./shared/@outfitter/contracts-bb4hjt8g";
5
- import { SerializeErrorOptions, deserializeError, safeParse, safeStringify, serializeError } from "./shared/@outfitter/contracts-j08e95jw";
6
- import { JsonSchema, zodToJsonSchema } from "./shared/@outfitter/contracts-hbbxbwkt";
7
- import { CreateContextOptions, createContext, generateRequestId } from "./shared/@outfitter/contracts-25bkj17f";
8
- import { NonEmptyArray, assertDefined, assertMatches, assertNonEmpty, isNonEmptyArray } from "./shared/@outfitter/contracts-18vcxecr";
9
- import { Envelope, EnvelopeMeta, ErrorEnvelope, HttpResponse, PaginationMeta, SuccessEnvelope, toEnvelope, toHttpResponse } from "./shared/@outfitter/contracts-jggbn5tn";
10
- import { AdapterAuthError, AuthAdapter, CacheAdapter, CacheError, IndexAdapter, IndexError, IndexStats, SearchOptions, SearchResult, StorageAdapter, StorageError } from "./shared/@outfitter/contracts-93dx53mt";
11
- import { BackoffOptions, getBackoffDelay, isRecoverable, isRetryable, shouldRetry } from "./shared/@outfitter/contracts-evxky148";
12
- import { RetryOptions, TimeoutOptions, retry, withTimeout } from "./shared/@outfitter/contracts-bdwg55c5";
13
- import { createValidator, validateInput } from "./shared/@outfitter/contracts-6j6z9dsd";
14
- import { Handler, HandlerContext, ResolvedConfig, SyncHandler } from "./shared/@outfitter/contracts-ss9vjjft";
15
- import { AlreadyExistsError, AmbiguousError, AnyKitError, AssertionError, AuthError, CancelledError, ConflictError, ERROR_CODES, ErrorCategory, ErrorCode, InternalError, KitErrorProps, NetworkError, NotFoundError, OutfitterError, PermissionError, RateLimitError, SerializedError, TimeoutError, ValidationError, exitCodeMap, getExitCode, getStatusCode, statusCodeMap } from "./shared/@outfitter/contracts-r35bn9p6";
16
- import { LogLevel, LogMetadata, LogMethod, Logger, LoggerAdapter, LoggerFactory, LoggerFactoryConfig, createLoggerFactory } from "./shared/@outfitter/contracts-2g8r01zf";
17
- import { DEFAULT_PATTERNS, DEFAULT_SENSITIVE_KEYS, RedactionCallback, RedactionEvent, Redactor, RedactorConfig, createRedactor } from "./shared/@outfitter/contracts-e70qdasg";
1
+ import "./shared/@outfitter/contracts-qaccq0gf.js";
2
+ import { NonEmptyArray, assertDefined, assertMatches, assertNonEmpty, isNonEmptyArray } from "./shared/@outfitter/contracts-mmg0npfk.js";
3
+ import { createValidator, validateInput } from "./shared/@outfitter/contracts-9wtm5nsw.js";
4
+ import { ACTION_CAPABILITIES, ActionCapability, CAPABILITY_SURFACES, CapabilitySurface, DEFAULT_ACTION_SURFACES, capability, capabilityAll, getActionsForSurface } from "./shared/@outfitter/contracts-y8f0m1ze.js";
5
+ import { DEFAULT_PATTERNS, DEFAULT_SENSITIVE_KEYS, RedactionCallback, RedactionEvent, Redactor, RedactorConfig, createRedactor } from "./shared/@outfitter/contracts-9yd4vrjg.js";
6
+ import { BackoffOptions, getBackoffDelay, isRecoverable, isRetryable, shouldRetry } from "./shared/@outfitter/contracts-k71jqd1m.js";
7
+ import { JsonSchema, zodToJsonSchema } from "./shared/@outfitter/contracts-t79engf9.js";
8
+ import { ACTION_SURFACES, ActionApiSpec, ActionCliInputContext, ActionCliOption, ActionCliSpec, ActionMcpSpec, ActionRegistry, ActionSpec, ActionSurface, ActionTrpcSpec, AnyActionSpec, DEFAULT_REGISTRY_SURFACES, HttpMethod, createActionRegistry, defineAction } from "./shared/@outfitter/contracts-56pcsavx.js";
9
+ import { RetryOptions, TimeoutOptions, retry, withTimeout } from "./shared/@outfitter/contracts-95cc3y06.js";
10
+ import { combine2, combine3, expect, orElse, unwrapOrElse } from "./shared/@outfitter/contracts-ar0etwtx.js";
11
+ import { AdapterAuthError, AuthAdapter, CacheAdapter, CacheError, IndexAdapter, IndexError, IndexStats, SearchOptions, SearchResult, StorageAdapter, StorageError } from "./shared/@outfitter/contracts-c2cfj172.js";
12
+ import { Envelope, EnvelopeMeta, ErrorEnvelope, HttpResponse, PaginationMeta, SuccessEnvelope, toEnvelope, toHttpResponse } from "./shared/@outfitter/contracts-e4m948m7.js";
13
+ import { SerializeErrorOptions, deserializeError, safeParse, safeStringify, serializeError } from "./shared/@outfitter/contracts-31penhwa.js";
14
+ import { CreateContextOptions, createContext, generateRequestId } from "./shared/@outfitter/contracts-1waabxbk.js";
15
+ import { Handler, HandlerContext, ResolvedConfig, SyncHandler } from "./shared/@outfitter/contracts-0akf2sm6.js";
16
+ import { AlreadyExistsError, AmbiguousError, AnyKitError, AssertionError, AuthError, CancelledError, ConflictError, ERROR_CODES, ErrorCategory, ErrorCode, InternalError, KitErrorProps, NetworkError, NotFoundError, OutfitterError, PermissionError, RateLimitError, SerializedError, TimeoutError, ValidationError, exitCodeMap, getExitCode, getStatusCode, statusCodeMap } from "./shared/@outfitter/contracts-3gswmhb1.js";
17
+ import { LogLevel, LogMetadata, LogMethod, Logger, LoggerAdapter, LoggerFactory, LoggerFactoryConfig, createLoggerFactory } from "./shared/@outfitter/contracts-rwzqy9rn.js";
18
18
  import { TaggedErrorClass } from "better-result";
19
19
  import { Result, TaggedError } from "better-result";
20
20
  export { zodToJsonSchema, withTimeout, validateInput, unwrapOrElse, toHttpResponse, toEnvelope, statusCodeMap, shouldRetry, serializeError, safeStringify, safeParse, retry, orElse, isRetryable, isRecoverable, isNonEmptyArray, getStatusCode, getExitCode, getBackoffDelay, getActionsForSurface, generateRequestId, expect, exitCodeMap, deserializeError, defineAction, createValidator, createRedactor, createLoggerFactory, createContext, createActionRegistry, combine3, combine2, capabilityAll, capability, assertNonEmpty, assertMatches, assertDefined, ValidationError, TimeoutOptions, TimeoutError, TaggedErrorClass, TaggedError, SyncHandler, SuccessEnvelope, StorageError, StorageAdapter, SerializedError, SerializeErrorOptions, SearchResult, SearchOptions, RetryOptions, Result, ResolvedConfig, RedactorConfig, Redactor, RedactionEvent, RedactionCallback, RateLimitError, PermissionError, PaginationMeta, OutfitterError, NotFoundError, NonEmptyArray, NetworkError, LoggerFactoryConfig, LoggerFactory, LoggerAdapter, Logger, LogMethod, LogMetadata, LogLevel, KitErrorProps, JsonSchema, InternalError, IndexStats, IndexError, IndexAdapter, HttpResponse, HttpMethod, HandlerContext, Handler, ErrorEnvelope, ErrorCode, ErrorCategory, EnvelopeMeta, Envelope, ERROR_CODES, DEFAULT_SENSITIVE_KEYS, DEFAULT_REGISTRY_SURFACES, DEFAULT_PATTERNS, DEFAULT_ACTION_SURFACES, CreateContextOptions, ConflictError, CapabilitySurface, CancelledError, CacheError, CacheAdapter, CAPABILITY_SURFACES, BackoffOptions, AuthError, AuthAdapter, AssertionError, AnyKitError, AnyActionSpec, AmbiguousError, AlreadyExistsError, AdapterAuthError, ActionTrpcSpec, ActionSurface, ActionSpec, ActionRegistry, ActionMcpSpec, ActionCliSpec, ActionCliOption, ActionCliInputContext, ActionCapability, ActionApiSpec, ACTION_SURFACES, ACTION_CAPABILITIES };
package/dist/index.js CHANGED
@@ -1,18 +1,15 @@
1
1
  // @bun
2
2
  import"./shared/@outfitter/contracts-37gpc56f.js";
3
3
  import {
4
- combine2,
5
- combine3,
6
- expect,
7
- orElse,
8
- unwrapOrElse
9
- } from "./shared/@outfitter/contracts-zx72gyh1.js";
4
+ assertDefined,
5
+ assertMatches,
6
+ assertNonEmpty,
7
+ isNonEmptyArray
8
+ } from "./shared/@outfitter/contracts-cp5c6dws.js";
10
9
  import {
11
- ACTION_SURFACES,
12
- DEFAULT_REGISTRY_SURFACES,
13
- createActionRegistry,
14
- defineAction
15
- } from "./shared/@outfitter/contracts-q0v44kef.js";
10
+ createValidator,
11
+ validateInput
12
+ } from "./shared/@outfitter/contracts-0snpmkdt.js";
16
13
  import {
17
14
  ACTION_CAPABILITIES,
18
15
  CAPABILITY_SURFACES,
@@ -21,43 +18,47 @@ import {
21
18
  capabilityAll,
22
19
  getActionsForSurface
23
20
  } from "./shared/@outfitter/contracts-d0tq2adf.js";
21
+ import {
22
+ getBackoffDelay,
23
+ isRecoverable,
24
+ isRetryable,
25
+ shouldRetry
26
+ } from "./shared/@outfitter/contracts-4zaj7ejb.js";
24
27
  import {
25
28
  zodToJsonSchema
26
29
  } from "./shared/@outfitter/contracts-wfht4q2b.js";
27
30
  import {
28
- assertDefined,
29
- assertMatches,
30
- assertNonEmpty,
31
- isNonEmptyArray
32
- } from "./shared/@outfitter/contracts-cp5c6dws.js";
31
+ ACTION_SURFACES,
32
+ DEFAULT_REGISTRY_SURFACES,
33
+ createActionRegistry,
34
+ defineAction
35
+ } from "./shared/@outfitter/contracts-q0v44kef.js";
36
+ import {
37
+ retry,
38
+ withTimeout
39
+ } from "./shared/@outfitter/contracts-r21yet6j.js";
40
+ import {
41
+ combine2,
42
+ combine3,
43
+ expect,
44
+ orElse,
45
+ unwrapOrElse
46
+ } from "./shared/@outfitter/contracts-zx72gyh1.js";
33
47
  import {
34
48
  toEnvelope,
35
49
  toHttpResponse
36
- } from "./shared/@outfitter/contracts-btg89x4h.js";
50
+ } from "./shared/@outfitter/contracts-85nd53s9.js";
37
51
  import {
38
52
  deserializeError,
39
53
  safeParse,
40
54
  safeStringify,
41
55
  serializeError
42
- } from "./shared/@outfitter/contracts-5k6q4n48.js";
43
- import {
44
- createContext,
45
- generateRequestId
46
- } from "./shared/@outfitter/contracts-agmt8915.js";
47
- import {
48
- getBackoffDelay,
49
- isRecoverable,
50
- isRetryable,
51
- shouldRetry
52
- } from "./shared/@outfitter/contracts-4zaj7ejb.js";
53
- import {
54
- retry,
55
- withTimeout
56
- } from "./shared/@outfitter/contracts-r21yet6j.js";
56
+ } from "./shared/@outfitter/contracts-3wj7xghe.js";
57
57
  import {
58
- createValidator,
59
- validateInput
60
- } from "./shared/@outfitter/contracts-0snpmkdt.js";
58
+ DEFAULT_PATTERNS,
59
+ DEFAULT_SENSITIVE_KEYS,
60
+ createRedactor
61
+ } from "./shared/@outfitter/contracts-s15x2rs4.js";
61
62
  import {
62
63
  AlreadyExistsError,
63
64
  AmbiguousError,
@@ -78,14 +79,13 @@ import {
78
79
  getStatusCode,
79
80
  statusCodeMap
80
81
  } from "./shared/@outfitter/contracts-phjhz5q3.js";
82
+ import {
83
+ createContext,
84
+ generateRequestId
85
+ } from "./shared/@outfitter/contracts-agmt8915.js";
81
86
  import {
82
87
  createLoggerFactory
83
88
  } from "./shared/@outfitter/contracts-sm6vak1a.js";
84
- import {
85
- DEFAULT_PATTERNS,
86
- DEFAULT_SENSITIVE_KEYS,
87
- createRedactor
88
- } from "./shared/@outfitter/contracts-s15x2rs4.js";
89
89
 
90
90
  // packages/contracts/src/index.ts
91
91
  import { Result, TaggedError } from "better-result";
package/dist/logging.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { LogLevel, LogMetadata, LogMethod, Logger, LoggerAdapter, LoggerFactory, LoggerFactoryConfig, createLoggerFactory } from "./shared/@outfitter/contracts-2g8r01zf";
1
+ import { LogLevel, LogMetadata, LogMethod, Logger, LoggerAdapter, LoggerFactory, LoggerFactoryConfig, createLoggerFactory } from "./shared/@outfitter/contracts-rwzqy9rn.js";
2
2
  export { createLoggerFactory, LoggerFactoryConfig, LoggerFactory, LoggerAdapter, Logger, LogMethod, LogMetadata, LogLevel };
@@ -1,3 +1,3 @@
1
- import { BackoffOptions, getBackoffDelay, isRecoverable, isRetryable, shouldRetry } from "./shared/@outfitter/contracts-evxky148";
2
- import "./shared/@outfitter/contracts-r35bn9p6";
1
+ import { BackoffOptions, getBackoffDelay, isRecoverable, isRetryable, shouldRetry } from "./shared/@outfitter/contracts-k71jqd1m.js";
2
+ import "./shared/@outfitter/contracts-3gswmhb1.js";
3
3
  export { shouldRetry, isRetryable, isRecoverable, getBackoffDelay, BackoffOptions };
@@ -1,2 +1,2 @@
1
- import { DEFAULT_PATTERNS, DEFAULT_SENSITIVE_KEYS, RedactionCallback, RedactionEvent, Redactor, RedactorConfig, createRedactor } from "./shared/@outfitter/contracts-e70qdasg";
1
+ import { DEFAULT_PATTERNS, DEFAULT_SENSITIVE_KEYS, RedactionCallback, RedactionEvent, Redactor, RedactorConfig, createRedactor } from "./shared/@outfitter/contracts-9yd4vrjg.js";
2
2
  export { createRedactor, RedactorConfig, Redactor, RedactionEvent, RedactionCallback, DEFAULT_SENSITIVE_KEYS, DEFAULT_PATTERNS };
@@ -1,3 +1,3 @@
1
- import { RetryOptions, TimeoutOptions, retry, withTimeout } from "./shared/@outfitter/contracts-bdwg55c5";
2
- import "./shared/@outfitter/contracts-r35bn9p6";
1
+ import { RetryOptions, TimeoutOptions, retry, withTimeout } from "./shared/@outfitter/contracts-95cc3y06.js";
2
+ import "./shared/@outfitter/contracts-3gswmhb1.js";
3
3
  export { withTimeout, retry, TimeoutOptions, RetryOptions };
@@ -1,3 +1,3 @@
1
- import "../shared/@outfitter/contracts-qaccq0gf";
2
- import { combine2, combine3, expect, orElse, unwrapOrElse } from "../shared/@outfitter/contracts-ar0etwtx";
1
+ import "../shared/@outfitter/contracts-qaccq0gf.js";
2
+ import { combine2, combine3, expect, orElse, unwrapOrElse } from "../shared/@outfitter/contracts-ar0etwtx.js";
3
3
  export { unwrapOrElse, orElse, expect, combine3, combine2 };
@@ -1,2 +1,2 @@
1
- import { combine2, combine3, expect, orElse, unwrapOrElse } from "../shared/@outfitter/contracts-ar0etwtx";
1
+ import { combine2, combine3, expect, orElse, unwrapOrElse } from "../shared/@outfitter/contracts-ar0etwtx.js";
2
2
  export { unwrapOrElse, orElse, expect, combine3, combine2 };
package/dist/schema.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { JsonSchema, zodToJsonSchema } from "./shared/@outfitter/contracts-hbbxbwkt";
1
+ import { JsonSchema, zodToJsonSchema } from "./shared/@outfitter/contracts-t79engf9.js";
2
2
  export { zodToJsonSchema, JsonSchema };
@@ -1,3 +1,3 @@
1
- import { SerializeErrorOptions, deserializeError, safeParse, safeStringify, serializeError } from "./shared/@outfitter/contracts-j08e95jw";
2
- import "./shared/@outfitter/contracts-r35bn9p6";
1
+ import { SerializeErrorOptions, deserializeError, safeParse, safeStringify, serializeError } from "./shared/@outfitter/contracts-31penhwa.js";
2
+ import "./shared/@outfitter/contracts-3gswmhb1.js";
3
3
  export { serializeError, safeStringify, safeParse, deserializeError, SerializeErrorOptions };
@@ -4,9 +4,9 @@ import {
4
4
  safeParse,
5
5
  safeStringify,
6
6
  serializeError
7
- } from "./shared/@outfitter/contracts-5k6q4n48.js";
8
- import"./shared/@outfitter/contracts-phjhz5q3.js";
7
+ } from "./shared/@outfitter/contracts-3wj7xghe.js";
9
8
  import"./shared/@outfitter/contracts-s15x2rs4.js";
9
+ import"./shared/@outfitter/contracts-phjhz5q3.js";
10
10
  export {
11
11
  serializeError,
12
12
  safeStringify,
@@ -1,5 +1,5 @@
1
- import { OutfitterError } from "./contracts-r35bn9p6";
2
- import { Logger } from "./contracts-2g8r01zf";
1
+ import { OutfitterError } from "./contracts-3gswmhb1.js";
2
+ import { Logger } from "./contracts-rwzqy9rn.js";
3
3
  import { Result } from "better-result";
4
4
  /**
5
5
  * Resolved configuration interface.
@@ -21,20 +21,20 @@ interface ResolvedConfig {
21
21
  * ```
22
22
  */
23
23
  interface HandlerContext {
24
- /** Abort signal for cancellation propagation */
25
- signal?: AbortSignal;
26
- /** Unique request identifier for tracing (UUIDv7) */
27
- requestId: string;
28
- /** Structured logger with automatic redaction */
29
- logger: Logger;
30
24
  /** Resolved configuration values */
31
25
  config?: ResolvedConfig;
32
- /** Workspace root path, if detected */
33
- workspaceRoot?: string;
34
26
  /** Current working directory */
35
27
  cwd: string;
36
28
  /** Environment variables (filtered, redacted) */
37
29
  env: Record<string, string | undefined>;
30
+ /** Structured logger with automatic redaction */
31
+ logger: Logger;
32
+ /** Unique request identifier for tracing (UUIDv7) */
33
+ requestId: string;
34
+ /** Abort signal for cancellation propagation */
35
+ signal?: AbortSignal;
36
+ /** Workspace root path, if detected */
37
+ workspaceRoot?: string;
38
38
  }
39
39
  /**
40
40
  * Handler - transport-agnostic domain logic unit.
@@ -1,23 +1,23 @@
1
- import { HandlerContext, ResolvedConfig } from "./contracts-ss9vjjft";
2
- import { Logger } from "./contracts-2g8r01zf";
1
+ import { HandlerContext, ResolvedConfig } from "./contracts-0akf2sm6.js";
2
+ import { Logger } from "./contracts-rwzqy9rn.js";
3
3
  /**
4
4
  * Options for creating a handler context.
5
5
  */
6
6
  interface CreateContextOptions {
7
- /** Logger instance (uses no-op logger if not provided) */
8
- logger?: Logger;
9
7
  /** Resolved configuration */
10
8
  config?: ResolvedConfig;
11
- /** Abort signal for cancellation */
12
- signal?: AbortSignal;
13
- /** Explicit request ID (generates UUIDv7 if not provided) */
14
- requestId?: string;
15
- /** Workspace root path */
16
- workspaceRoot?: string;
17
9
  /** Current working directory (defaults to process.cwd()) */
18
10
  cwd?: string;
19
11
  /** Environment variables to include */
20
12
  env?: Record<string, string | undefined>;
13
+ /** Logger instance (uses no-op logger if not provided) */
14
+ logger?: Logger;
15
+ /** Explicit request ID (generates UUIDv7 if not provided) */
16
+ requestId?: string;
17
+ /** Abort signal for cancellation */
18
+ signal?: AbortSignal;
19
+ /** Workspace root path */
20
+ workspaceRoot?: string;
21
21
  }
22
22
  /**
23
23
  * Create a HandlerContext for a new request.
@@ -1,4 +1,4 @@
1
- import { OutfitterError, SerializedError, ValidationError } from "./contracts-r35bn9p6";
1
+ import { OutfitterError, SerializedError, ValidationError } from "./contracts-3gswmhb1.js";
2
2
  import { Result } from "better-result";
3
3
  import { z } from "zod";
4
4
  /**
@@ -1,13 +1,13 @@
1
- import { Handler, SyncHandler } from "./contracts-ss9vjjft";
2
- import { OutfitterError } from "./contracts-r35bn9p6";
1
+ import { Handler, SyncHandler } from "./contracts-0akf2sm6.js";
2
+ import { OutfitterError } from "./contracts-3gswmhb1.js";
3
3
  import { z } from "zod";
4
4
  declare const ACTION_SURFACES: readonly ["cli", "mcp", "api", "server"];
5
5
  type ActionSurface = (typeof ACTION_SURFACES)[number];
6
6
  declare const DEFAULT_REGISTRY_SURFACES: readonly ActionSurface[];
7
7
  interface ActionCliOption {
8
- readonly flags: string;
9
- readonly description: string;
10
8
  readonly defaultValue?: string | boolean | string[];
9
+ readonly description: string;
10
+ readonly flags: string;
11
11
  readonly required?: boolean;
12
12
  }
13
13
  interface ActionCliInputContext {
@@ -15,18 +15,18 @@ interface ActionCliInputContext {
15
15
  readonly flags: Record<string, unknown>;
16
16
  }
17
17
  interface ActionCliSpec<TInput = unknown> {
18
- readonly group?: string;
18
+ readonly aliases?: readonly string[];
19
19
  readonly command?: string;
20
20
  readonly description?: string;
21
- readonly aliases?: readonly string[];
22
- readonly options?: readonly ActionCliOption[];
21
+ readonly group?: string;
23
22
  readonly mapInput?: (context: ActionCliInputContext) => TInput;
23
+ readonly options?: readonly ActionCliOption[];
24
24
  }
25
25
  interface ActionMcpSpec<TInput = unknown> {
26
- readonly tool?: string;
27
- readonly description?: string;
28
26
  readonly deferLoading?: boolean;
27
+ readonly description?: string;
29
28
  readonly mapInput?: (input: unknown) => TInput;
29
+ readonly tool?: string;
30
30
  }
31
31
  type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
32
32
  interface ActionApiSpec {
@@ -42,15 +42,15 @@ interface ActionSpec<
42
42
  TOutput,
43
43
  TError extends OutfitterError = OutfitterError
44
44
  > {
45
- readonly id: string;
45
+ readonly api?: ActionApiSpec;
46
+ readonly cli?: ActionCliSpec<TInput>;
46
47
  readonly description?: string;
47
- readonly surfaces?: readonly ActionSurface[];
48
- readonly input: z.ZodType<TInput>;
49
- readonly output?: z.ZodType<TOutput>;
50
48
  readonly handler: Handler<TInput, TOutput, TError> | SyncHandler<TInput, TOutput, TError>;
51
- readonly cli?: ActionCliSpec<TInput>;
49
+ readonly id: string;
50
+ readonly input: z.ZodType<TInput>;
52
51
  readonly mcp?: ActionMcpSpec<TInput>;
53
- readonly api?: ActionApiSpec;
52
+ readonly output?: z.ZodType<TOutput>;
53
+ readonly surfaces?: readonly ActionSurface[];
54
54
  readonly trpc?: ActionTrpcSpec;
55
55
  }
56
56
  type AnyActionSpec = ActionSpec<unknown, unknown, OutfitterError>;
@@ -60,9 +60,9 @@ interface ActionRegistry {
60
60
  TOutput,
61
61
  TError extends OutfitterError = OutfitterError
62
62
  >(action: ActionSpec<TInput, TOutput, TError>): ActionRegistry;
63
- list(): AnyActionSpec[];
64
- get(id: string): AnyActionSpec | undefined;
65
63
  forSurface(surface: ActionSurface): AnyActionSpec[];
64
+ get(id: string): AnyActionSpec | undefined;
65
+ list(): AnyActionSpec[];
66
66
  }
67
67
  declare function defineAction<
68
68
  TInput,
@@ -1,13 +1,13 @@
1
1
  // @bun
2
2
  import {
3
3
  serializeError
4
- } from "./contracts-5k6q4n48.js";
5
- import {
6
- generateRequestId
7
- } from "./contracts-agmt8915.js";
4
+ } from "./contracts-3wj7xghe.js";
8
5
  import {
9
6
  statusCodeMap
10
7
  } from "./contracts-phjhz5q3.js";
8
+ import {
9
+ generateRequestId
10
+ } from "./contracts-agmt8915.js";
11
11
 
12
12
  // packages/contracts/src/envelope.ts
13
13
  function buildMeta(overrides) {
@@ -1,34 +1,34 @@
1
- import { OutfitterError, TimeoutError } from "./contracts-r35bn9p6";
1
+ import { OutfitterError, TimeoutError } from "./contracts-3gswmhb1.js";
2
2
  import { Result } from "better-result";
3
3
  /**
4
4
  * Options for retry behavior.
5
5
  */
6
6
  interface RetryOptions {
7
- /** Maximum number of retry attempts (default: 3) */
8
- maxAttempts?: number;
9
- /** Initial delay in milliseconds (default: 1000) */
10
- initialDelayMs?: number;
11
- /** Maximum delay in milliseconds (default: 30000) */
12
- maxDelayMs?: number;
13
7
  /** Exponential backoff multiplier (default: 2) */
14
8
  backoffMultiplier?: number;
15
- /** Whether to add jitter to delays (default: true) */
16
- jitter?: boolean;
9
+ /** Initial delay in milliseconds (default: 1000) */
10
+ initialDelayMs?: number;
17
11
  /** Predicate to determine if error is retryable */
18
12
  isRetryable?: (error: OutfitterError) => boolean;
19
- /** Abort signal for cancellation */
20
- signal?: AbortSignal;
13
+ /** Whether to add jitter to delays (default: true) */
14
+ jitter?: boolean;
15
+ /** Maximum number of retry attempts (default: 3) */
16
+ maxAttempts?: number;
17
+ /** Maximum delay in milliseconds (default: 30000) */
18
+ maxDelayMs?: number;
21
19
  /** Callback invoked before each retry */
22
20
  onRetry?: (attempt: number, error: OutfitterError, delayMs: number) => void;
21
+ /** Abort signal for cancellation */
22
+ signal?: AbortSignal;
23
23
  }
24
24
  /**
25
25
  * Options for timeout behavior.
26
26
  */
27
27
  interface TimeoutOptions {
28
- /** Timeout duration in milliseconds */
29
- timeoutMs: number;
30
28
  /** Operation name for error context */
31
29
  operation?: string;
30
+ /** Timeout duration in milliseconds */
31
+ timeoutMs: number;
32
32
  }
33
33
  /**
34
34
  * Retry an async operation with exponential backoff.
@@ -1,4 +1,4 @@
1
- import { ValidationError } from "./contracts-r35bn9p6";
1
+ import { ValidationError } from "./contracts-3gswmhb1.js";
2
2
  import { Result } from "better-result";
3
3
  import { z } from "zod";
4
4
  /**
@@ -1,45 +1,45 @@
1
- import { OutfitterError, SerializedError } from "./contracts-r35bn9p6";
1
+ import { OutfitterError, SerializedError } from "./contracts-3gswmhb1.js";
2
2
  import { Result } from "better-result";
3
3
  /**
4
4
  * Metadata attached to every response envelope.
5
5
  */
6
6
  interface EnvelopeMeta {
7
+ /** Operation duration in milliseconds */
8
+ durationMs?: number;
7
9
  /** Unique request identifier for tracing */
8
10
  requestId: string;
9
11
  /** ISO timestamp of response generation */
10
12
  timestamp: string;
11
- /** Operation duration in milliseconds */
12
- durationMs?: number;
13
13
  }
14
14
  /**
15
15
  * Pagination metadata for list responses.
16
16
  */
17
17
  interface PaginationMeta {
18
- /** Total number of items (if known) */
19
- total?: number;
20
18
  /** Number of items returned */
21
19
  count: number;
22
- /** Cursor for next page (null if no more pages) */
23
- nextCursor: string | null;
24
20
  /** Whether more pages exist */
25
21
  hasMore: boolean;
22
+ /** Cursor for next page (null if no more pages) */
23
+ nextCursor: string | null;
24
+ /** Total number of items (if known) */
25
+ total?: number;
26
26
  }
27
27
  /**
28
28
  * Success envelope structure.
29
29
  */
30
30
  interface SuccessEnvelope<T> {
31
- ok: true;
32
31
  data: T;
33
32
  meta: EnvelopeMeta;
33
+ ok: true;
34
34
  pagination?: PaginationMeta;
35
35
  }
36
36
  /**
37
37
  * Error envelope structure.
38
38
  */
39
39
  interface ErrorEnvelope {
40
- ok: false;
41
40
  error: SerializedError;
42
41
  meta: EnvelopeMeta;
42
+ ok: false;
43
43
  }
44
44
  /**
45
45
  * Response envelope - consistent wrapper for all handler responses.
@@ -49,8 +49,8 @@ type Envelope<T> = SuccessEnvelope<T> | ErrorEnvelope;
49
49
  * HTTP-style response with status code.
50
50
  */
51
51
  interface HttpResponse<T> {
52
- status: number;
53
52
  body: Envelope<T>;
53
+ status: number;
54
54
  }
55
55
  /**
56
56
  * Convert a Result to a response envelope.
@@ -1,4 +1,4 @@
1
- import { ErrorCategory } from "./contracts-r35bn9p6";
1
+ import { ErrorCategory } from "./contracts-3gswmhb1.js";
2
2
  /**
3
3
  * Backoff strategy configuration options
4
4
  */
@@ -1,4 +1,4 @@
1
- import { AssertionError } from "./contracts-r35bn9p6";
1
+ import { AssertionError } from "./contracts-3gswmhb1.js";
2
2
  import { Result } from "better-result";
3
3
  /**
4
4
  * Array type guaranteed to have at least one element.
@@ -1,3 +1,3 @@
1
- import { createValidator, validateInput } from "./shared/@outfitter/contracts-6j6z9dsd";
2
- import "./shared/@outfitter/contracts-r35bn9p6";
1
+ import { createValidator, validateInput } from "./shared/@outfitter/contracts-9wtm5nsw.js";
2
+ import "./shared/@outfitter/contracts-3gswmhb1.js";
3
3
  export { validateInput, createValidator };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@outfitter/contracts",
3
3
  "description": "Result/Error patterns, error taxonomy, and handler contracts for Outfitter",
4
- "version": "0.4.0",
4
+ "version": "0.4.1",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -126,7 +126,8 @@
126
126
  "lint:fix": "biome lint --write ./src",
127
127
  "test": "bun test",
128
128
  "typecheck": "tsc --noEmit",
129
- "clean": "rm -rf dist"
129
+ "clean": "rm -rf dist",
130
+ "prepublishOnly": "bun ../../scripts/check-publish-manifest.ts"
130
131
  },
131
132
  "dependencies": {
132
133
  "better-result": "^2.5.0",
@@ -90,17 +90,17 @@ type ErrorCode = (typeof ERROR_CODES)[keyof typeof ERROR_CODES][keyof (typeof ER
90
90
  interface SerializedError {
91
91
  _tag: string;
92
92
  category: ErrorCategory;
93
- message: string;
94
93
  context?: Record<string, unknown>;
94
+ message: string;
95
95
  }
96
96
  /**
97
97
  * Base interface for OutfitterError properties.
98
98
  * All concrete error classes must include these fields.
99
99
  */
100
100
  interface KitErrorProps {
101
- message: string;
102
101
  category: ErrorCategory;
103
102
  context?: Record<string, unknown>;
103
+ message: string;
104
104
  }
105
105
  /**
106
106
  * Get CLI exit code for an error category.
@@ -1,4 +1,9 @@
1
1
  // @bun
2
+ import {
3
+ DEFAULT_PATTERNS,
4
+ DEFAULT_SENSITIVE_KEYS,
5
+ createRedactor
6
+ } from "./contracts-s15x2rs4.js";
2
7
  import {
3
8
  AlreadyExistsError,
4
9
  AmbiguousError,
@@ -14,11 +19,6 @@ import {
14
19
  TimeoutError,
15
20
  ValidationError
16
21
  } from "./contracts-phjhz5q3.js";
17
- import {
18
- DEFAULT_PATTERNS,
19
- DEFAULT_SENSITIVE_KEYS,
20
- createRedactor
21
- } from "./contracts-s15x2rs4.js";
22
22
 
23
23
  // packages/contracts/src/serialization.ts
24
24
  import { Result } from "better-result";
@@ -2,25 +2,25 @@
2
2
  * Configuration for creating a redactor.
3
3
  */
4
4
  interface RedactorConfig {
5
- /** Regex patterns to match and redact */
6
- patterns: RegExp[];
5
+ /** Whether to redact recursively in nested objects (default: true) */
6
+ deep?: boolean;
7
7
  /** Object keys whose values should always be redacted */
8
8
  keys: string[];
9
+ /** Regex patterns to match and redact */
10
+ patterns: RegExp[];
9
11
  /** Replacement string (default: "[REDACTED]") */
10
12
  replacement?: string;
11
- /** Whether to redact recursively in nested objects (default: true) */
12
- deep?: boolean;
13
13
  }
14
14
  /**
15
15
  * Redaction event for audit logging.
16
16
  */
17
17
  interface RedactionEvent {
18
- /** Type of redaction applied */
19
- redactedBy: "pattern" | "key";
20
18
  /** Identifier of the pattern/key that matched */
21
19
  matcher: string;
22
20
  /** Location in the object path (e.g., "config.auth.apiKey") */
23
21
  path: string;
22
+ /** Type of redaction applied */
23
+ redactedBy: "pattern" | "key";
24
24
  }
25
25
  /**
26
26
  * Callback for redaction events.
@@ -49,16 +49,16 @@ type RedactionCallback = (event: RedactionEvent) => void;
49
49
  * ```
50
50
  */
51
51
  interface Redactor {
52
- /** Redact sensitive values from an object (deep) */
53
- redact<T>(value: T): T;
54
- /** Redact sensitive values from a string */
55
- redactString(value: string): string;
56
- /** Check if a key name is sensitive */
57
- isSensitiveKey(key: string): boolean;
58
52
  /** Add a pattern at runtime */
59
53
  addPattern(pattern: RegExp): void;
60
54
  /** Add a sensitive key at runtime */
61
55
  addSensitiveKey(key: string): void;
56
+ /** Check if a key name is sensitive */
57
+ isSensitiveKey(key: string): boolean;
58
+ /** Redact sensitive values from an object (deep) */
59
+ redact<T>(value: T): T;
60
+ /** Redact sensitive values from a string */
61
+ redactString(value: string): string;
62
62
  }
63
63
  /**
64
64
  * Default patterns for common secrets.
@@ -6,39 +6,39 @@ import { Result } from "better-result";
6
6
  /** Error during indexing operations */
7
7
  interface IndexError {
8
8
  readonly _tag: "IndexError";
9
- readonly message: string;
10
9
  readonly cause?: unknown;
10
+ readonly message: string;
11
11
  }
12
12
  /** Error during cache operations */
13
13
  interface CacheError {
14
14
  readonly _tag: "CacheError";
15
- readonly message: string;
16
15
  readonly cause?: unknown;
16
+ readonly message: string;
17
17
  }
18
18
  /** Error during auth/credential operations */
19
19
  interface AdapterAuthError {
20
20
  readonly _tag: "AdapterAuthError";
21
- readonly message: string;
22
21
  readonly cause?: unknown;
22
+ readonly message: string;
23
23
  }
24
24
  /** Error during storage operations */
25
25
  interface StorageError {
26
26
  readonly _tag: "StorageError";
27
- readonly message: string;
28
27
  readonly cause?: unknown;
28
+ readonly message: string;
29
29
  }
30
30
  /**
31
31
  * Search options for index adapter.
32
32
  */
33
33
  interface SearchOptions {
34
+ /** Fields to boost in relevance scoring */
35
+ boostFields?: string[];
36
+ /** Field-specific filters */
37
+ filters?: Record<string, unknown>;
34
38
  /** Maximum results to return */
35
39
  limit?: number;
36
40
  /** Offset for pagination */
37
41
  offset?: number;
38
- /** Field-specific filters */
39
- filters?: Record<string, unknown>;
40
- /** Fields to boost in relevance scoring */
41
- boostFields?: string[];
42
42
  }
43
43
  /**
44
44
  * Search result from index adapter.
@@ -50,10 +50,10 @@ interface SearchResult<T> {
50
50
  score: number;
51
51
  highlights?: Record<string, string[]>;
52
52
  }>;
53
- /** Total number of matches (for pagination) */
54
- total: number;
55
53
  /** Search execution time in milliseconds */
56
54
  took: number;
55
+ /** Total number of matches (for pagination) */
56
+ total: number;
57
57
  }
58
58
  /**
59
59
  * Index statistics.
@@ -61,10 +61,10 @@ interface SearchResult<T> {
61
61
  interface IndexStats {
62
62
  /** Total documents indexed */
63
63
  documentCount: number;
64
- /** Index size in bytes (if available) */
65
- sizeBytes?: number;
66
64
  /** Last update timestamp */
67
65
  lastUpdated: Date | null;
66
+ /** Index size in bytes (if available) */
67
+ sizeBytes?: number;
68
68
  }
69
69
  /**
70
70
  * Index adapter - pluggable full-text search backends.
@@ -86,14 +86,14 @@ interface IndexStats {
86
86
  * ```
87
87
  */
88
88
  interface IndexAdapter<T> {
89
+ /** Clear all indexed documents */
90
+ clear(): Promise<Result<void, IndexError>>;
89
91
  /** Add or update documents in the index */
90
92
  index(items: T[]): Promise<Result<void, IndexError>>;
91
- /** Full-text search with optional filters */
92
- search(query: string, options?: SearchOptions): Promise<Result<SearchResult<T>, IndexError>>;
93
93
  /** Remove documents by ID */
94
94
  remove(ids: string[]): Promise<Result<void, IndexError>>;
95
- /** Clear all indexed documents */
96
- clear(): Promise<Result<void, IndexError>>;
95
+ /** Full-text search with optional filters */
96
+ search(query: string, options?: SearchOptions): Promise<Result<SearchResult<T>, IndexError>>;
97
97
  /** Get index statistics */
98
98
  stats(): Promise<Result<IndexStats, IndexError>>;
99
99
  }
@@ -113,18 +113,18 @@ interface IndexAdapter<T> {
113
113
  * ```
114
114
  */
115
115
  interface CacheAdapter<T> {
116
- /** Get cached value, null if not found or expired */
117
- get(key: string): Promise<Result<T | null, CacheError>>;
118
- /** Set value with optional TTL in seconds */
119
- set(key: string, value: T, ttlSeconds?: number): Promise<Result<void, CacheError>>;
120
- /** Delete cached value, returns true if existed */
121
- delete(key: string): Promise<Result<boolean, CacheError>>;
122
116
  /** Clear all cached values */
123
117
  clear(): Promise<Result<void, CacheError>>;
124
- /** Check if key exists (without retrieving value) */
125
- has(key: string): Promise<Result<boolean, CacheError>>;
118
+ /** Delete cached value, returns true if existed */
119
+ delete(key: string): Promise<Result<boolean, CacheError>>;
120
+ /** Get cached value, null if not found or expired */
121
+ get(key: string): Promise<Result<T | null, CacheError>>;
126
122
  /** Get multiple values at once */
127
123
  getMany(keys: string[]): Promise<Result<Map<string, T>, CacheError>>;
124
+ /** Check if key exists (without retrieving value) */
125
+ has(key: string): Promise<Result<boolean, CacheError>>;
126
+ /** Set value with optional TTL in seconds */
127
+ set(key: string, value: T, ttlSeconds?: number): Promise<Result<void, CacheError>>;
128
128
  }
129
129
  /**
130
130
  * Auth adapter - pluggable credential storage.
@@ -140,14 +140,14 @@ interface CacheAdapter<T> {
140
140
  * ```
141
141
  */
142
142
  interface AuthAdapter {
143
- /** Retrieve credential by key */
144
- get(key: string): Promise<Result<string | null, AdapterAuthError>>;
145
- /** Store credential */
146
- set(key: string, value: string): Promise<Result<void, AdapterAuthError>>;
147
143
  /** Remove credential */
148
144
  delete(key: string): Promise<Result<boolean, AdapterAuthError>>;
145
+ /** Retrieve credential by key */
146
+ get(key: string): Promise<Result<string | null, AdapterAuthError>>;
149
147
  /** List available credential keys (not values) */
150
148
  list(): Promise<Result<string[], AdapterAuthError>>;
149
+ /** Store credential */
150
+ set(key: string, value: string): Promise<Result<void, AdapterAuthError>>;
151
151
  }
152
152
  /**
153
153
  * Storage adapter - pluggable blob/file storage.
@@ -163,20 +163,20 @@ interface AuthAdapter {
163
163
  * ```
164
164
  */
165
165
  interface StorageAdapter {
166
- /** Read file contents */
167
- read(path: string): Promise<Result<Uint8Array, StorageError>>;
168
- /** Write file contents */
169
- write(path: string, data: Uint8Array): Promise<Result<void, StorageError>>;
170
166
  /** Delete file */
171
167
  delete(path: string): Promise<Result<boolean, StorageError>>;
172
168
  /** Check if file exists */
173
169
  exists(path: string): Promise<Result<boolean, StorageError>>;
174
170
  /** List files in directory */
175
171
  list(prefix: string): Promise<Result<string[], StorageError>>;
172
+ /** Read file contents */
173
+ read(path: string): Promise<Result<Uint8Array, StorageError>>;
176
174
  /** Get file metadata (size, modified time) */
177
175
  stat(path: string): Promise<Result<{
178
176
  size: number;
179
177
  modifiedAt: Date;
180
178
  } | null, StorageError>>;
179
+ /** Write file contents */
180
+ write(path: string, data: Uint8Array): Promise<Result<void, StorageError>>;
181
181
  }
182
182
  export { IndexError, CacheError, AdapterAuthError, StorageError, SearchOptions, SearchResult, IndexStats, IndexAdapter, CacheAdapter, AuthAdapter, StorageAdapter };
@@ -26,13 +26,13 @@ interface LogMethod {
26
26
  * Logger interface for handler contexts and cross-package contracts.
27
27
  */
28
28
  interface Logger {
29
- trace: LogMethod;
29
+ child(context: LogMetadata): Logger;
30
30
  debug: LogMethod;
31
- info: LogMethod;
32
- warn: LogMethod;
33
31
  error: LogMethod;
34
32
  fatal: LogMethod;
35
- child(context: LogMetadata): Logger;
33
+ info: LogMethod;
34
+ trace: LogMethod;
35
+ warn: LogMethod;
36
36
  }
37
37
  /**
38
38
  * Configuration passed through the logger factory to backend adapters.
@@ -40,14 +40,14 @@ interface Logger {
40
40
  * `backend` carries adapter-specific configuration in a strongly typed way.
41
41
  */
42
42
  interface LoggerFactoryConfig<TBackendOptions = unknown> {
43
- /** Logger category/name identifying the source (e.g., "cli", "mcp") */
44
- name: string;
45
- /** Minimum level to emit */
46
- level?: LogLevel;
47
- /** Static context attached to every emitted record */
48
- context?: LogMetadata;
49
43
  /** Adapter-specific backend options */
50
44
  backend?: TBackendOptions;
45
+ /** Static context attached to every emitted record */
46
+ context?: LogMetadata;
47
+ /** Minimum level to emit */
48
+ level?: LogLevel;
49
+ /** Logger category/name identifying the source (e.g., "cli", "mcp") */
50
+ name: string;
51
51
  }
52
52
  /**
53
53
  * Backend adapter contract used by the logger factory.
@@ -3,31 +3,31 @@ import { z } from "zod";
3
3
  * JSON Schema representation.
4
4
  */
5
5
  interface JsonSchema {
6
- type?: string;
7
- properties?: Record<string, JsonSchema>;
8
- required?: string[];
9
- items?: JsonSchema | JsonSchema[];
10
- description?: string;
6
+ $defs?: Record<string, JsonSchema>;
7
+ $ref?: string;
8
+ $schema?: string;
9
+ additionalProperties?: boolean | JsonSchema;
10
+ allOf?: JsonSchema[];
11
+ anyOf?: JsonSchema[];
12
+ const?: unknown;
11
13
  default?: unknown;
12
- minimum?: number;
13
- maximum?: number;
14
- exclusiveMinimum?: number;
14
+ definitions?: Record<string, JsonSchema>;
15
+ description?: string;
16
+ enum?: unknown[];
15
17
  exclusiveMaximum?: number;
16
- minLength?: number;
17
- maxLength?: number;
18
- pattern?: string;
18
+ exclusiveMinimum?: number;
19
19
  format?: string;
20
- enum?: unknown[];
21
- const?: unknown;
22
- anyOf?: JsonSchema[];
23
- oneOf?: JsonSchema[];
24
- allOf?: JsonSchema[];
20
+ items?: JsonSchema | JsonSchema[];
21
+ maximum?: number;
22
+ maxLength?: number;
23
+ minimum?: number;
24
+ minLength?: number;
25
25
  not?: JsonSchema | Record<string, never>;
26
- $ref?: string;
27
- $schema?: string;
28
- $defs?: Record<string, JsonSchema>;
29
- definitions?: Record<string, JsonSchema>;
30
- additionalProperties?: boolean | JsonSchema;
26
+ oneOf?: JsonSchema[];
27
+ pattern?: string;
28
+ properties?: Record<string, JsonSchema>;
29
+ required?: string[];
30
+ type?: string;
31
31
  }
32
32
  /**
33
33
  * Convert a Zod schema to JSON Schema format.
@@ -8,8 +8,8 @@
8
8
  declare const CAPABILITY_SURFACES: readonly ["cli", "mcp", "api", "server"];
9
9
  type CapabilitySurface = (typeof CAPABILITY_SURFACES)[number];
10
10
  interface ActionCapability {
11
- surfaces: readonly CapabilitySurface[];
12
11
  notes?: string;
12
+ surfaces: readonly CapabilitySurface[];
13
13
  }
14
14
  declare const DEFAULT_ACTION_SURFACES: readonly ["cli", "mcp"];
15
15
  declare function capability(surfaces?: readonly CapabilitySurface[], notes?: string): ActionCapability;