maestro-core 0.1.0

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 (70) hide show
  1. package/README.md +55 -0
  2. package/dist/adapters/ai-sdk.d.ts +60 -0
  3. package/dist/adapters/ai-sdk.d.ts.map +1 -0
  4. package/dist/adapters/ai-sdk.js +86 -0
  5. package/dist/adapters/ai-sdk.js.map +1 -0
  6. package/dist/adapters/mcp-server.d.ts +37 -0
  7. package/dist/adapters/mcp-server.d.ts.map +1 -0
  8. package/dist/adapters/mcp-server.js +99 -0
  9. package/dist/adapters/mcp-server.js.map +1 -0
  10. package/dist/cache-control.d.ts +78 -0
  11. package/dist/cache-control.d.ts.map +1 -0
  12. package/dist/cache-control.js +57 -0
  13. package/dist/cache-control.js.map +1 -0
  14. package/dist/context.d.ts +62 -0
  15. package/dist/context.d.ts.map +1 -0
  16. package/dist/context.js +2 -0
  17. package/dist/context.js.map +1 -0
  18. package/dist/envelope.d.ts +36 -0
  19. package/dist/envelope.d.ts.map +1 -0
  20. package/dist/envelope.js +9 -0
  21. package/dist/envelope.js.map +1 -0
  22. package/dist/index.d.ts +7 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +8 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/ports/audit-store.d.ts +33 -0
  27. package/dist/ports/audit-store.d.ts.map +1 -0
  28. package/dist/ports/audit-store.js +2 -0
  29. package/dist/ports/audit-store.js.map +1 -0
  30. package/dist/ports/clock.d.ts +22 -0
  31. package/dist/ports/clock.d.ts.map +1 -0
  32. package/dist/ports/clock.js +16 -0
  33. package/dist/ports/clock.js.map +1 -0
  34. package/dist/ports/index.d.ts +9 -0
  35. package/dist/ports/index.d.ts.map +1 -0
  36. package/dist/ports/index.js +4 -0
  37. package/dist/ports/index.js.map +1 -0
  38. package/dist/ports/key-provider.d.ts +18 -0
  39. package/dist/ports/key-provider.d.ts.map +1 -0
  40. package/dist/ports/key-provider.js +2 -0
  41. package/dist/ports/key-provider.js.map +1 -0
  42. package/dist/ports/logger.d.ts +25 -0
  43. package/dist/ports/logger.d.ts.map +1 -0
  44. package/dist/ports/logger.js +22 -0
  45. package/dist/ports/logger.js.map +1 -0
  46. package/dist/ports/memory-store.d.ts +32 -0
  47. package/dist/ports/memory-store.d.ts.map +1 -0
  48. package/dist/ports/memory-store.js +2 -0
  49. package/dist/ports/memory-store.js.map +1 -0
  50. package/dist/ports/quota-store.d.ts +63 -0
  51. package/dist/ports/quota-store.d.ts.map +1 -0
  52. package/dist/ports/quota-store.js +2 -0
  53. package/dist/ports/quota-store.js.map +1 -0
  54. package/dist/ports/telemetry-sink.d.ts +71 -0
  55. package/dist/ports/telemetry-sink.d.ts.map +1 -0
  56. package/dist/ports/telemetry-sink.js +11 -0
  57. package/dist/ports/telemetry-sink.js.map +1 -0
  58. package/dist/ports/turn-store.d.ts +62 -0
  59. package/dist/ports/turn-store.d.ts.map +1 -0
  60. package/dist/ports/turn-store.js +2 -0
  61. package/dist/ports/turn-store.js.map +1 -0
  62. package/dist/safe-tool.d.ts +38 -0
  63. package/dist/safe-tool.d.ts.map +1 -0
  64. package/dist/safe-tool.js +16 -0
  65. package/dist/safe-tool.js.map +1 -0
  66. package/dist/tool.d.ts +86 -0
  67. package/dist/tool.d.ts.map +1 -0
  68. package/dist/tool.js +11 -0
  69. package/dist/tool.js.map +1 -0
  70. package/package.json +83 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC/E,OAAO,EACH,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,eAAe,EACf,KAAK,YAAY,EACjB,KAAK,QAAQ,GAChB,MAAM,WAAW,CAAA;AAGlB,OAAO,EACH,qBAAqB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,GACtB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACH,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,GACzB,MAAM,gBAAgB,CAAA;AAGvB,cAAc,kBAAkB,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ export { err, isOk, ok } from './envelope.js';
2
+ export { defineAgentTool, } from './tool.js';
3
+ // Cross-cutting kernel utilities
4
+ export { applyCacheBreakpoints, } from './cache-control.js';
5
+ export { captureToolException, } from './safe-tool.js';
6
+ // Ports re-exported at root for ergonomic single-import setups
7
+ export * from './ports/index.js';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAoC,MAAM,eAAe,CAAA;AAC/E,OAAO,EAGH,eAAe,GAGlB,MAAM,WAAW,CAAA;AAElB,iCAAiC;AACjC,OAAO,EACH,qBAAqB,GAGxB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACH,oBAAoB,GAGvB,MAAM,gBAAgB,CAAA;AAEvB,+DAA+D;AAC/D,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Append-only log of individual tool calls. The kernel writes one row
3
+ * per `execute` invocation (success, error, exception). Hosts use this
4
+ * for governance, abuse review, and cost attribution rollups.
5
+ *
6
+ * `recordToolCall` may return before the row is durable — the kernel
7
+ * calls it as fire-and-forget (`void store.recordToolCall(...)`) so a
8
+ * slow audit write does not stall the chat turn.
9
+ */
10
+ export interface ToolCallAudit {
11
+ toolName: string;
12
+ transport: string;
13
+ actor: string;
14
+ tenantId: string;
15
+ principalId: string | null;
16
+ requestId: string | null;
17
+ /** Tool input as the model passed it. JSON-serializable. */
18
+ input: unknown;
19
+ /** Compact result — full envelope payloads can be huge; the model output is in TurnStore. */
20
+ output: {
21
+ ok: true;
22
+ } | {
23
+ ok: false;
24
+ code: string;
25
+ message: string;
26
+ };
27
+ durationMs: number;
28
+ createdAt: Date;
29
+ }
30
+ export interface AuditStore {
31
+ recordToolCall(audit: ToolCallAudit): Promise<void>;
32
+ }
33
+ //# sourceMappingURL=audit-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-store.d.ts","sourceRoot":"","sources":["../../src/ports/audit-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,4DAA4D;IAC5D,KAAK,EAAE,OAAO,CAAA;IACd,6FAA6F;IAC7F,MAAM,EACA;QAAE,EAAE,EAAE,IAAI,CAAA;KAAE,GACZ;QAAE,EAAE,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;IAClD,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,IAAI,CAAA;CAClB;AAED,MAAM,WAAW,UAAU;IACvB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACtD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=audit-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-store.js","sourceRoot":"","sources":["../../src/ports/audit-store.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Time-source port. The kernel routes every "now" through this so
3
+ * tests can advance time deterministically without mocking
4
+ * `global.Date`. Production hosts wire `SystemClock`.
5
+ *
6
+ * Hard rule: NO code under `src/` may call `new Date()` /
7
+ * `Date.now()` directly outside of `SystemClock`. Use the injected
8
+ * clock or accept a `Date` argument.
9
+ */
10
+ export interface Clock {
11
+ now(): Date;
12
+ }
13
+ export declare class SystemClock implements Clock {
14
+ now(): Date;
15
+ }
16
+ /** Test helper — returns a fixed instant, never advances. */
17
+ export declare class FixedClock implements Clock {
18
+ private readonly fixed;
19
+ constructor(fixed: Date);
20
+ now(): Date;
21
+ }
22
+ //# sourceMappingURL=clock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../../src/ports/clock.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,KAAK;IAClB,GAAG,IAAI,IAAI,CAAA;CACd;AAED,qBAAa,WAAY,YAAW,KAAK;IACrC,GAAG,IAAI,IAAI;CAGd;AAED,6DAA6D;AAC7D,qBAAa,UAAW,YAAW,KAAK;IACxB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,IAAI;IAExC,GAAG,IAAI,IAAI;CAGd"}
@@ -0,0 +1,16 @@
1
+ export class SystemClock {
2
+ now() {
3
+ return new Date();
4
+ }
5
+ }
6
+ /** Test helper — returns a fixed instant, never advances. */
7
+ export class FixedClock {
8
+ fixed;
9
+ constructor(fixed) {
10
+ this.fixed = fixed;
11
+ }
12
+ now() {
13
+ return this.fixed;
14
+ }
15
+ }
16
+ //# sourceMappingURL=clock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clock.js","sourceRoot":"","sources":["../../src/ports/clock.ts"],"names":[],"mappings":"AAaA,MAAM,OAAO,WAAW;IACpB,GAAG;QACC,OAAO,IAAI,IAAI,EAAE,CAAA;IACrB,CAAC;CACJ;AAED,6DAA6D;AAC7D,MAAM,OAAO,UAAU;IACU;IAA7B,YAA6B,KAAW;QAAX,UAAK,GAAL,KAAK,CAAM;IAAG,CAAC;IAE5C,GAAG;QACC,OAAO,IAAI,CAAC,KAAK,CAAA;IACrB,CAAC;CACJ"}
@@ -0,0 +1,9 @@
1
+ export type { AuditStore, ToolCallAudit } from './audit-store.js';
2
+ export { type Clock, FixedClock, SystemClock } from './clock.js';
3
+ export { ConsoleLogger, type Logger, SilentLogger } from './logger.js';
4
+ export type { MemoryRecord, MemoryScope, MemoryStore } from './memory-store.js';
5
+ export type { ModelKeyProvider, ModelProvider } from './key-provider.js';
6
+ export type { Ceilings, QuotaState, QuotaStore, QuotaUsage, QuotaWindow, } from './quota-store.js';
7
+ export { NoopTelemetrySink, type TelemetryEvent, type TelemetrySink } from './telemetry-sink.js';
8
+ export type { TurnRecord, TurnStore } from './turn-store.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ports/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACjE,OAAO,EAAE,KAAK,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAChE,OAAO,EAAE,aAAa,EAAE,KAAK,MAAM,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACtE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/E,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACxE,YAAY,EACR,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,GACd,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,iBAAiB,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAChG,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA"}
@@ -0,0 +1,4 @@
1
+ export { FixedClock, SystemClock } from './clock.js';
2
+ export { ConsoleLogger, SilentLogger } from './logger.js';
3
+ export { NoopTelemetrySink } from './telemetry-sink.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ports/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAChE,OAAO,EAAE,aAAa,EAAe,YAAY,EAAE,MAAM,aAAa,CAAA;AAUtE,OAAO,EAAE,iBAAiB,EAA2C,MAAM,qBAAqB,CAAA"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Returns the model-provider API key the kernel should use for a given
3
+ * call. The host wires this from `process.env`, a secrets manager, or
4
+ * a per-tenant BYO-key table.
5
+ *
6
+ * Why a port: secret-fetch is host-defined (env layout, rotation
7
+ * cadence, multi-key load balancing). Kernel must not assume any of it.
8
+ */
9
+ export type ModelProvider = 'anthropic' | 'openai';
10
+ export interface ModelKeyProvider {
11
+ /**
12
+ * Resolve the key for the given provider. `tenantId` is passed so
13
+ * BYO-key hosts can return per-tenant keys; hosts with a single
14
+ * platform key can ignore it.
15
+ */
16
+ getKey(provider: ModelProvider, tenantId?: string): Promise<string>;
17
+ }
18
+ //# sourceMappingURL=key-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key-provider.d.ts","sourceRoot":"","sources":["../../src/ports/key-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,QAAQ,CAAA;AAElD,MAAM,WAAW,gBAAgB;IAC7B;;;;OAIG;IACH,MAAM,CAAC,QAAQ,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;CACtE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=key-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key-provider.js","sourceRoot":"","sources":["../../src/ports/key-provider.ts"],"names":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Structured-logging port. Default `ConsoleLogger` is fine for dev;
3
+ * hosts wire pino / winston / Sentry breadcrumbs in production by
4
+ * implementing this interface.
5
+ */
6
+ export interface Logger {
7
+ debug(msg: string, meta?: object): void;
8
+ info(msg: string, meta?: object): void;
9
+ warn(msg: string, meta?: object): void;
10
+ error(msg: string, meta?: object): void;
11
+ }
12
+ export declare class ConsoleLogger implements Logger {
13
+ debug(msg: string, meta?: object): void;
14
+ info(msg: string, meta?: object): void;
15
+ warn(msg: string, meta?: object): void;
16
+ error(msg: string, meta?: object): void;
17
+ }
18
+ /** Test helper — discards everything. */
19
+ export declare class SilentLogger implements Logger {
20
+ debug(): void;
21
+ info(): void;
22
+ warn(): void;
23
+ error(): void;
24
+ }
25
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/ports/logger.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,MAAM;IACnB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtC,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1C;AAED,qBAAa,aAAc,YAAW,MAAM;IACxC,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAGvC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAGtC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAGtC,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;CAG1C;AAED,yCAAyC;AACzC,qBAAa,YAAa,YAAW,MAAM;IACvC,KAAK,IAAI,IAAI;IACb,IAAI,IAAI,IAAI;IACZ,IAAI,IAAI,IAAI;IACZ,KAAK,IAAI,IAAI;CAChB"}
@@ -0,0 +1,22 @@
1
+ export class ConsoleLogger {
2
+ debug(msg, meta) {
3
+ meta ? console.debug(msg, meta) : console.debug(msg);
4
+ }
5
+ info(msg, meta) {
6
+ meta ? console.info(msg, meta) : console.info(msg);
7
+ }
8
+ warn(msg, meta) {
9
+ meta ? console.warn(msg, meta) : console.warn(msg);
10
+ }
11
+ error(msg, meta) {
12
+ meta ? console.error(msg, meta) : console.error(msg);
13
+ }
14
+ }
15
+ /** Test helper — discards everything. */
16
+ export class SilentLogger {
17
+ debug() { }
18
+ info() { }
19
+ warn() { }
20
+ error() { }
21
+ }
22
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/ports/logger.ts"],"names":[],"mappings":"AAYA,MAAM,OAAO,aAAa;IACtB,KAAK,CAAC,GAAW,EAAE,IAAa;QAC5B,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACxD,CAAC;IACD,IAAI,CAAC,GAAW,EAAE,IAAa;QAC3B,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACtD,CAAC;IACD,IAAI,CAAC,GAAW,EAAE,IAAa;QAC3B,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACtD,CAAC;IACD,KAAK,CAAC,GAAW,EAAE,IAAa;QAC5B,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACxD,CAAC;CACJ;AAED,yCAAyC;AACzC,MAAM,OAAO,YAAY;IACrB,KAAK,KAAU,CAAC;IAChB,IAAI,KAAU,CAAC;IACf,IAAI,KAAU,CAAC;IACf,KAAK,KAAU,CAAC;CACnB"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Per-principal long-lived facts that should travel between threads
3
+ * within the same tenant. The model uses `saveMemoryTool` /
4
+ * `forgetMemoryTool` to write here; the kernel loads relevant entries
5
+ * into the system prompt.
6
+ *
7
+ * Scopes are intentionally narrow — never sweep across tenants. A
8
+ * sibling host may add an extra `namespace` axis for in-tenant
9
+ * partitioning (e.g. `'preferences'` vs `'facts'`).
10
+ */
11
+ export interface MemoryScope {
12
+ tenantId: string;
13
+ principalId: string | null;
14
+ /** Optional sub-scope. Hosts that don't need it leave undefined. */
15
+ namespace?: string;
16
+ }
17
+ export interface MemoryRecord {
18
+ id: string;
19
+ scope: MemoryScope;
20
+ /** The fact, free-form natural language. */
21
+ fact: string;
22
+ /** Where the fact came from — usually a tool name or `'system'`. */
23
+ source: string;
24
+ createdAt: Date;
25
+ updatedAt: Date;
26
+ }
27
+ export interface MemoryStore {
28
+ load(scope: MemoryScope): Promise<MemoryRecord[]>;
29
+ save(scope: MemoryScope, fact: string, source: string): Promise<MemoryRecord>;
30
+ forget(scope: MemoryScope, factId: string): Promise<void>;
31
+ }
32
+ //# sourceMappingURL=memory-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-store.d.ts","sourceRoot":"","sources":["../../src/ports/memory-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,WAAW,CAAA;IAClB,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAA;IACZ,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,IAAI,CAAA;IACf,SAAS,EAAE,IAAI,CAAA;CAClB;AAED,MAAM,WAAW,WAAW;IACxB,IAAI,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAA;IACjD,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;IAC7E,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=memory-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-store.js","sourceRoot":"","sources":["../../src/ports/memory-store.ts"],"names":[],"mappings":""}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Per-tenant rate-limit and cost ceiling enforcement.
3
+ *
4
+ * Boundary of responsibility:
5
+ * - Kernel owns the WINDOW ARITHMETIC (sliding window math, day
6
+ * rollover, soft-cap warnings, `AiQuotaDeniedError`).
7
+ * - Host owns the CEILING DERIVATION (plan-tier → numbers). Kernel
8
+ * does not know what a "plan" is.
9
+ *
10
+ * `getCeilings` is called on every turn — keep it cheap (cache inside
11
+ * the host impl). `check` returns current consumption; `record`
12
+ * appends to the ledger (or telemetry) post-call.
13
+ */
14
+ export type QuotaWindow = 'min' | 'hour' | 'day' | 'month';
15
+ export interface Ceilings {
16
+ /** Max input tokens per window. Undefined = unbounded. */
17
+ maxTokensIn?: number;
18
+ /** Max output tokens per window. Undefined = unbounded. */
19
+ maxTokensOut?: number;
20
+ /** Max LLM calls per window. Undefined = unbounded. */
21
+ maxCallsPerWindow?: number;
22
+ /** Max spend per window, in USD micro-dollars (integer). Undefined = unbounded. */
23
+ maxUsdMicro?: number;
24
+ }
25
+ export interface QuotaState {
26
+ ceilings: Ceilings;
27
+ used: {
28
+ tokensIn: number;
29
+ tokensOut: number;
30
+ calls: number;
31
+ usdMicro: number;
32
+ };
33
+ windowStart: Date;
34
+ windowEnd: Date;
35
+ }
36
+ export interface QuotaUsage {
37
+ tenantId: string;
38
+ surface: string;
39
+ tokensIn: number;
40
+ tokensOut: number;
41
+ cacheReadTokens: number;
42
+ cacheWriteTokens: number;
43
+ /** USD cost in micro-dollars (integer). */
44
+ costUsdMicro: number;
45
+ modelId: string;
46
+ occurredAt: Date;
47
+ }
48
+ export interface QuotaStore {
49
+ /** Plan-derived ceilings for the requested surface + window. */
50
+ getCeilings(query: {
51
+ tenantId: string;
52
+ surface: string;
53
+ window: QuotaWindow;
54
+ }): Promise<Ceilings>;
55
+ /** Current consumption against ceilings for the current window. */
56
+ check(query: {
57
+ tenantId: string;
58
+ surface: string;
59
+ }): Promise<QuotaState>;
60
+ /** Append-only ledger write, called post-LLM-call. */
61
+ record(usage: QuotaUsage): Promise<void>;
62
+ }
63
+ //# sourceMappingURL=quota-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quota-store.d.ts","sourceRoot":"","sources":["../../src/ports/quota-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,CAAA;AAE1D,MAAM,WAAW,QAAQ;IACrB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,uDAAuD;IACvD,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,mFAAmF;IACnF,WAAW,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,UAAU;IACvB,QAAQ,EAAE,QAAQ,CAAA;IAClB,IAAI,EAAE;QACF,QAAQ,EAAE,MAAM,CAAA;QAChB,SAAS,EAAE,MAAM,CAAA;QACjB,KAAK,EAAE,MAAM,CAAA;QACb,QAAQ,EAAE,MAAM,CAAA;KACnB,CAAA;IACD,WAAW,EAAE,IAAI,CAAA;IACjB,SAAS,EAAE,IAAI,CAAA;CAClB;AAED,MAAM,WAAW,UAAU;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;IACxB,2CAA2C;IAC3C,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,IAAI,CAAA;CACnB;AAED,MAAM,WAAW,UAAU;IACvB,gEAAgE;IAChE,WAAW,CAAC,KAAK,EAAE;QACf,QAAQ,EAAE,MAAM,CAAA;QAChB,OAAO,EAAE,MAAM,CAAA;QACf,MAAM,EAAE,WAAW,CAAA;KACtB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;IAErB,mEAAmE;IACnE,KAAK,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAExE,sDAAsD;IACtD,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=quota-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quota-store.js","sourceRoot":"","sources":["../../src/ports/quota-store.ts"],"names":[],"mappings":""}
@@ -0,0 +1,71 @@
1
+ import type { QuotaWindow } from './quota-store.js';
2
+ /**
3
+ * Best-effort observability events. Kernel emits these as a batched
4
+ * fire-and-forget stream. Hosts ship to: maestro-plane, Sentry, OTel,
5
+ * Datadog, or a no-op for self-hosted-only setups.
6
+ *
7
+ * Contract: emit MUST eventually settle (resolve or reject). The
8
+ * kernel will not block a chat turn on this — slow emits just back up
9
+ * the in-memory queue and eventually drop after retries.
10
+ */
11
+ export type TelemetryEvent = {
12
+ type: 'turn.finalized';
13
+ turnId: string;
14
+ threadId: string;
15
+ tenantId: string;
16
+ modelId: string;
17
+ tier: 'fast' | 'smart';
18
+ tokensIn: number;
19
+ tokensOut: number;
20
+ cacheReadTokens: number;
21
+ cacheWriteTokens: number;
22
+ /** USD cost in micro-dollars (integer). */
23
+ costUsdMicro: number;
24
+ durationMs: number;
25
+ occurredAt: Date;
26
+ } | {
27
+ type: 'tool.called';
28
+ toolName: string;
29
+ tenantId: string;
30
+ transport: string;
31
+ actor: string;
32
+ durationMs: number;
33
+ ok: boolean;
34
+ errorCode?: string;
35
+ occurredAt: Date;
36
+ } | {
37
+ type: 'quota.consumed';
38
+ tenantId: string;
39
+ surface: string;
40
+ window: QuotaWindow;
41
+ used: number;
42
+ ceiling: number;
43
+ denied: boolean;
44
+ occurredAt: Date;
45
+ } | {
46
+ type: 'model.failover';
47
+ tenantId: string;
48
+ from: string;
49
+ to: string;
50
+ reason: string;
51
+ occurredAt: Date;
52
+ } | {
53
+ type: 'empty.recovery';
54
+ tenantId: string;
55
+ surface: string;
56
+ mode: string;
57
+ occurredAt: Date;
58
+ };
59
+ export interface TelemetrySink {
60
+ /** Batched async send. Implementations should handle batching + retries internally. */
61
+ emit(events: TelemetryEvent[]): Promise<void>;
62
+ }
63
+ /**
64
+ * Default sink — drops everything. Used when the host doesn't want
65
+ * telemetry (single-tenant deploy, dev environment, before maestro-plane
66
+ * exists). Kernel always works with this wired.
67
+ */
68
+ export declare class NoopTelemetrySink implements TelemetrySink {
69
+ emit(): Promise<void>;
70
+ }
71
+ //# sourceMappingURL=telemetry-sink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-sink.d.ts","sourceRoot":"","sources":["../../src/ports/telemetry-sink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GACpB;IACI,IAAI,EAAE,gBAAgB,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;IACxB,2CAA2C;IAC3C,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,IAAI,CAAA;CACnB,GACD;IACI,IAAI,EAAE,aAAa,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,EAAE,EAAE,OAAO,CAAA;IACX,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,IAAI,CAAA;CACnB,GACD;IACI,IAAI,EAAE,gBAAgB,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,WAAW,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,UAAU,EAAE,IAAI,CAAA;CACnB,GACD;IACI,IAAI,EAAE,gBAAgB,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,IAAI,CAAA;CACnB,GACD;IACI,IAAI,EAAE,gBAAgB,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,IAAI,CAAA;CACnB,CAAA;AAEP,MAAM,WAAW,aAAa;IAC1B,uFAAuF;IACvF,IAAI,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAChD;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,YAAW,aAAa;IAC7C,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAG9B"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Default sink — drops everything. Used when the host doesn't want
3
+ * telemetry (single-tenant deploy, dev environment, before maestro-plane
4
+ * exists). Kernel always works with this wired.
5
+ */
6
+ export class NoopTelemetrySink {
7
+ async emit() {
8
+ // Intentionally empty.
9
+ }
10
+ }
11
+ //# sourceMappingURL=telemetry-sink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-sink.js","sourceRoot":"","sources":["../../src/ports/telemetry-sink.ts"],"names":[],"mappings":"AAsEA;;;;GAIG;AACH,MAAM,OAAO,iBAAiB;IAC1B,KAAK,CAAC,IAAI;QACN,uBAAuB;IAC3B,CAAC;CACJ"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Persists chat-turn rows. The kernel writes one row per user turn and
3
+ * one per assistant turn, updates it as the turn completes, and reads
4
+ * history when assembling the next prompt.
5
+ *
6
+ * Why this is a port (not direct Prisma):
7
+ * - Each host has a different schema. Barbeiro's `HelpChatMessage` has
8
+ * help-specific fields (`surface`, `articleSlug`, `gap_reason`) a
9
+ * sibling product won't share. The port lets each host map
10
+ * `TurnRecord` → its own table.
11
+ * - This is the test seam. Unit tests get an in-memory implementation;
12
+ * integration tests get a real DB. Prisma-direct = every test needs
13
+ * a DB up.
14
+ */
15
+ export interface TurnRecord {
16
+ /** Host-generated id (cuid/uuid). */
17
+ id: string;
18
+ /** Thread the turn belongs to. */
19
+ threadId: string;
20
+ /** Tenant scope (same as `BaseToolContext.tenantId`). */
21
+ tenantId: string;
22
+ /** Conversation role. */
23
+ role: 'user' | 'assistant' | 'system' | 'tool';
24
+ /** JSON-serializable payload — host renders it. */
25
+ content: unknown;
26
+ /** Turn lifecycle state. */
27
+ status: 'pending' | 'completed' | 'failed' | 'aborted';
28
+ /** Optional metering metadata (filled in by `runChatTurn`). */
29
+ modelId?: string;
30
+ tokensIn?: number;
31
+ tokensOut?: number;
32
+ cacheReadTokens?: number;
33
+ cacheWriteTokens?: number;
34
+ /** USD cost in micro-dollars (integer) — avoids float drift in aggregates. */
35
+ costUsdMicro?: number;
36
+ durationMs?: number;
37
+ error?: {
38
+ code: string;
39
+ message: string;
40
+ };
41
+ /** Host-attached extras. Kernel does not interpret. */
42
+ metadata?: Record<string, unknown>;
43
+ createdAt: Date;
44
+ updatedAt: Date;
45
+ }
46
+ export interface TurnStore {
47
+ /**
48
+ * Insert or update a turn by `id`. Called multiple times per turn:
49
+ * once on dispatch (status=pending), once on completion or failure.
50
+ */
51
+ upsert(turn: TurnRecord): Promise<void>;
52
+ /** Recent history for prompt assembly, oldest-first. */
53
+ loadHistory(threadId: string, limit?: number): Promise<TurnRecord[]>;
54
+ /** Terminal mark — kernel calls this when the model call rejects. */
55
+ markFailed(turnId: string, error: {
56
+ code: string;
57
+ message: string;
58
+ }): Promise<void>;
59
+ /** Terminal mark — kernel calls this on abort signal. */
60
+ markAborted(turnId: string, reason: string): Promise<void>;
61
+ }
62
+ //# sourceMappingURL=turn-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turn-store.d.ts","sourceRoot":"","sources":["../../src/ports/turn-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,UAAU;IACvB,qCAAqC;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,yDAAyD;IACzD,QAAQ,EAAE,MAAM,CAAA;IAChB,yBAAyB;IACzB,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,CAAA;IAC9C,mDAAmD;IACnD,OAAO,EAAE,OAAO,CAAA;IAChB,4BAA4B;IAC5B,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAA;IAEtD,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,8EAA8E;IAC9E,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;IAEzC,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAElC,SAAS,EAAE,IAAI,CAAA;IACf,SAAS,EAAE,IAAI,CAAA;CAClB;AAED,MAAM,WAAW,SAAS;IACtB;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEvC,wDAAwD;IACxD,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IAEpE,qEAAqE;IACrE,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEnF,yDAAyD;IACzD,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC7D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=turn-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turn-store.js","sourceRoot":"","sources":["../../src/ports/turn-store.ts"],"names":[],"mappings":""}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Capture a tool-execute exception so observability tooling (Sentry,
3
+ * OTel, Datadog, custom) sees a uniform alert without each adapter
4
+ * inventing its own catch block.
5
+ *
6
+ * The kernel does NOT depend on a specific observability SDK. Hosts
7
+ * wire one by passing an `onError` callback to the adapter builders;
8
+ * the adapter calls this helper to format the tags and invoke the
9
+ * callback.
10
+ *
11
+ * Important: the throw is intentionally NOT swallowed by the adapter
12
+ * that calls this helper. AI SDK / MCP need the rejection to mark
13
+ * the tool result as `error` so the model sees it and can recover.
14
+ * Swallowing would surface as the assistant continuing as if the tool
15
+ * had succeeded.
16
+ */
17
+ export interface ToolExceptionTags {
18
+ /** Tool that threw. */
19
+ toolName: string;
20
+ /** Surface invoking the tool. */
21
+ transport: string;
22
+ /** Who authorised the call. */
23
+ actor: string;
24
+ /** Tenant scope. */
25
+ tenantId: string;
26
+ /** Principal id if known, else null. */
27
+ principalId?: string | null;
28
+ /** Trace id, if any. */
29
+ requestId?: string | null;
30
+ }
31
+ export type ToolExceptionHandler = (error: unknown, tags: ToolExceptionTags) => void;
32
+ /**
33
+ * Invoke the host's observability handler, if provided, with structured
34
+ * tags. Errors thrown by the handler itself are swallowed — observability
35
+ * must never break the chat turn.
36
+ */
37
+ export declare function captureToolException(error: unknown, tags: ToolExceptionTags, onError?: ToolExceptionHandler): void;
38
+ //# sourceMappingURL=safe-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safe-tool.d.ts","sourceRoot":"","sources":["../src/safe-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,iBAAiB;IAC9B,uBAAuB;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,wCAAwC;IACxC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC5B;AAED,MAAM,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAA;AAEpF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAChC,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,iBAAiB,EACvB,OAAO,CAAC,EAAE,oBAAoB,GAC/B,IAAI,CAON"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Invoke the host's observability handler, if provided, with structured
3
+ * tags. Errors thrown by the handler itself are swallowed — observability
4
+ * must never break the chat turn.
5
+ */
6
+ export function captureToolException(error, tags, onError) {
7
+ if (!onError)
8
+ return;
9
+ try {
10
+ onError(error, tags);
11
+ }
12
+ catch {
13
+ // Intentional swallow — see doc above.
14
+ }
15
+ }
16
+ //# sourceMappingURL=safe-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safe-tool.js","sourceRoot":"","sources":["../src/safe-tool.ts"],"names":[],"mappings":"AAiCA;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAChC,KAAc,EACd,IAAuB,EACvB,OAA8B;IAE9B,IAAI,CAAC,OAAO;QAAE,OAAM;IACpB,IAAI,CAAC;QACD,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IACxB,CAAC;IAAC,MAAM,CAAC;QACL,uCAAuC;IAC3C,CAAC;AACL,CAAC"}