@usesigil/kit 0.8.1 → 0.11.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.
- package/README.md +350 -164
- package/dist/alt-config.d.ts +4 -2
- package/dist/alt-config.d.ts.map +1 -1
- package/dist/alt-config.js +4 -2
- package/dist/alt-config.js.map +1 -1
- package/dist/alt-loader.d.ts.map +1 -1
- package/dist/alt-loader.js +2 -1
- package/dist/alt-loader.js.map +1 -1
- package/dist/balance-tracker.d.ts.map +1 -1
- package/dist/balance-tracker.js +2 -1
- package/dist/balance-tracker.js.map +1 -1
- package/dist/create-vault.d.ts +40 -3
- package/dist/create-vault.d.ts.map +1 -1
- package/dist/create-vault.js +52 -18
- package/dist/create-vault.js.map +1 -1
- package/dist/dashboard/discover.d.ts.map +1 -1
- package/dist/dashboard/discover.js +2 -1
- package/dist/dashboard/discover.js.map +1 -1
- package/dist/dashboard/from-json.d.ts +1 -0
- package/dist/dashboard/from-json.d.ts.map +1 -1
- package/dist/dashboard/from-json.js +3 -1
- package/dist/dashboard/from-json.js.map +1 -1
- package/dist/dashboard/mutations.d.ts.map +1 -1
- package/dist/dashboard/mutations.js +2 -1
- package/dist/dashboard/mutations.js.map +1 -1
- package/dist/dashboard/reads.d.ts.map +1 -1
- package/dist/dashboard/reads.js +5 -4
- package/dist/dashboard/reads.js.map +1 -1
- package/dist/errors/codes.d.ts +8 -2
- package/dist/errors/codes.d.ts.map +1 -1
- package/dist/errors/codes.js +6 -0
- package/dist/errors/codes.js.map +1 -1
- package/dist/errors/context.d.ts +17 -1
- package/dist/errors/context.d.ts.map +1 -1
- package/dist/errors/public.d.ts +24 -0
- package/dist/errors/public.d.ts.map +1 -0
- package/dist/errors/public.js +30 -0
- package/dist/errors/public.js.map +1 -0
- package/dist/errors/walk.d.ts.map +1 -1
- package/dist/errors/walk.js +2 -1
- package/dist/errors/walk.js.map +1 -1
- package/dist/helpers/ata.d.ts +73 -0
- package/dist/helpers/ata.d.ts.map +1 -0
- package/dist/helpers/ata.js +107 -0
- package/dist/helpers/ata.js.map +1 -0
- package/dist/helpers/parse-usd.d.ts +43 -0
- package/dist/helpers/parse-usd.d.ts.map +1 -0
- package/dist/helpers/parse-usd.js +81 -0
- package/dist/helpers/parse-usd.js.map +1 -0
- package/dist/helpers/validate-cap-aggregate.d.ts +41 -0
- package/dist/helpers/validate-cap-aggregate.d.ts.map +1 -0
- package/dist/helpers/validate-cap-aggregate.js +61 -0
- package/dist/helpers/validate-cap-aggregate.js.map +1 -0
- package/dist/hooks.d.ts +114 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +118 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.d.ts +17 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -17
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +77 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +153 -0
- package/dist/logger.js.map +1 -0
- package/dist/plugin.d.ts +110 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +119 -0
- package/dist/plugin.js.map +1 -0
- package/dist/presets.d.ts +73 -6
- package/dist/presets.d.ts.map +1 -1
- package/dist/presets.js +75 -6
- package/dist/presets.js.map +1 -1
- package/dist/priority-fees.d.ts.map +1 -1
- package/dist/priority-fees.js +3 -2
- package/dist/priority-fees.js.map +1 -1
- package/dist/react/index.d.ts +69 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +118 -0
- package/dist/react/index.js.map +1 -0
- package/dist/seal.d.ts +113 -15
- package/dist/seal.d.ts.map +1 -1
- package/dist/seal.js +269 -10
- package/dist/seal.js.map +1 -1
- package/dist/shield.d.ts.map +1 -1
- package/dist/shield.js +8 -7
- package/dist/shield.js.map +1 -1
- package/dist/sigil.d.ts +187 -0
- package/dist/sigil.d.ts.map +1 -0
- package/dist/sigil.js +194 -0
- package/dist/sigil.js.map +1 -0
- package/dist/tee/verify.d.ts.map +1 -1
- package/dist/tee/verify.js +6 -5
- package/dist/tee/verify.js.map +1 -1
- package/dist/transaction-executor.d.ts.map +1 -1
- package/dist/transaction-executor.js +3 -2
- package/dist/transaction-executor.js.map +1 -1
- package/dist/types.d.ts +3 -31
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +45 -106
- package/dist/types.js.map +1 -1
- package/dist/vault-handle.d.ts +123 -0
- package/dist/vault-handle.d.ts.map +1 -0
- package/dist/vault-handle.js +136 -0
- package/dist/vault-handle.js.map +1 -0
- package/dist/x402/shielded-fetch.d.ts.map +1 -1
- package/dist/x402/shielded-fetch.js +7 -4
- package/dist/x402/shielded-fetch.js.map +1 -1
- package/package.json +21 -3
package/dist/index.js
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
// @usesigil/kit — Kit-native SDK for Sigil
|
|
2
2
|
// ESM-only, zero web3.js dependency
|
|
3
3
|
// ─── Generated Client ─────────────────────────────────────────────────────────
|
|
4
|
-
export * from "./generated/index.js";
|
|
5
|
-
// ─── Type Constants + Permissions ─────────────────────────────────────────────
|
|
6
4
|
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
// `
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
5
|
+
// v0.9.0 barrel surgery (A12): was `export * from "./generated/index.js"`
|
|
6
|
+
// which pulled ~500 Codama exports (37 instruction builders + 60+ event/
|
|
7
|
+
// struct types + 82 hex error constants) into the root barrel. Consumers
|
|
8
|
+
// should go through `seal()` / `createSigilClient()` / `createVault()` for
|
|
9
|
+
// instruction building, and `SIGIL_PROGRAM_ADDRESS` (re-exported from
|
|
10
|
+
// `types.js` below) for the program ID. Account decoders stay public —
|
|
11
|
+
// they're the supported way to parse vault state fetched from an RPC.
|
|
12
|
+
export * from "./generated/accounts/index.js";
|
|
13
|
+
// ─── Type Constants + Capability ──────────────────────────────────────────────
|
|
14
|
+
//
|
|
15
|
+
// Legacy 21-bit permission bitmasks and their helpers (`SWAP_ONLY`,
|
|
16
|
+
// `PERPS_ONLY`, `TRANSFER_ONLY`, `ESCROW_ONLY`, `PERPS_FULL`,
|
|
17
|
+
// `ACTION_PERMISSION_MAP`, `hasPermission`, `permissionsToStrings`,
|
|
18
|
+
// `stringsToPermissions`, `PermissionBuilder`) were DELETED in the A11
|
|
19
|
+
// cleanup — they encoded a pre-v6 permission model the on-chain program no
|
|
20
|
+
// longer supports. Use {@link FULL_CAPABILITY} (2n) for operator agents and
|
|
21
|
+
// put granular per-action restrictions in `InstructionConstraints`.
|
|
18
22
|
export {
|
|
19
23
|
// Program
|
|
20
24
|
SIGIL_PROGRAM_ADDRESS,
|
|
@@ -102,9 +106,28 @@ export { seal, createSigilClient,
|
|
|
102
106
|
/** @deprecated Use createSigilClient(). Removed at v1.0. */
|
|
103
107
|
SigilClient, replaceAgentAtas, } from "./seal.js";
|
|
104
108
|
// ─── Create Vault ──────────────────────────────────────────────────────────
|
|
109
|
+
// ─── Sprint 2: Sigil Facade + SigilVault + Hooks + Plugins ──────────────────
|
|
110
|
+
export { Sigil } from "./sigil.js";
|
|
111
|
+
export { SigilVault } from "./vault-handle.js";
|
|
112
|
+
export { composeHooks, invokeHook, newCorrelationId } from "./hooks.js";
|
|
113
|
+
export { runPlugins, validatePluginList } from "./plugin.js";
|
|
105
114
|
export { createVault, createAndSendVault } from "./create-vault.js";
|
|
106
115
|
// ─── Vault Presets ───────────────────────────────────────────────────────────
|
|
107
|
-
export { VAULT_PRESETS, getPreset, listPresets, presetToCreateVaultFields,
|
|
116
|
+
export { VAULT_PRESETS, getPreset, listPresets, presetToCreateVaultFields,
|
|
117
|
+
// v0.9.0 A10: orthogonal SAFETY_PRESETS for timelock + cap defaults.
|
|
118
|
+
SAFETY_PRESETS, applySafetyPreset, requireResolvedSafetyPreset, } from "./presets.js";
|
|
119
|
+
// ─── v0.9.0 helpers (A3, A4, A9) ────────────────────────────────────────────
|
|
120
|
+
// Strict USD parser, policy-gated ATA builder, aggregate cap validator.
|
|
121
|
+
export { parseUsd } from "./helpers/parse-usd.js";
|
|
122
|
+
export { initializeVaultAtas, } from "./helpers/ata.js";
|
|
123
|
+
export { validateAgentCapAggregate, } from "./helpers/validate-cap-aggregate.js";
|
|
124
|
+
// ─── v0.9.0 logger (A5) ─────────────────────────────────────────────────────
|
|
125
|
+
// SigilLogger interface + NOOP_LOGGER default + createConsoleLogger opt-in.
|
|
126
|
+
// setSigilModuleLogger / getSigilModuleLogger are for SDK internals; the
|
|
127
|
+
// consumer-facing install point is SigilClient.create(config.logger).
|
|
128
|
+
export { NOOP_LOGGER, createConsoleLogger, resolveLogger, setSigilModuleLogger, getSigilModuleLogger, } from "./logger.js";
|
|
129
|
+
// ─── v0.9.0 genesis hash constants (A7) ─────────────────────────────────────
|
|
130
|
+
export { SOLANA_DEVNET_GENESIS_HASH, SOLANA_MAINNET_GENESIS_HASH, } from "./seal.js";
|
|
108
131
|
// ─── Owner Transaction ───────────────────────────────────────────────────────
|
|
109
132
|
export { buildOwnerTransaction } from "./owner-transaction.js";
|
|
110
133
|
// ─── Inscribe / withVault ─────────────────────────────────────────────────────
|
|
@@ -143,9 +166,11 @@ export { KNOWN_PROTOCOLS, KNOWN_TOKENS, SYSTEM_PROGRAMS, getTokenInfo, getProtoc
|
|
|
143
166
|
// Internally the class is still called `SigilError`; the rename happens at
|
|
144
167
|
// the public export boundary. Internal code in sdk/kit/src/ continues to
|
|
145
168
|
// use `SigilError`. Targeted full rename for a follow-up cleanup PR.
|
|
146
|
-
|
|
147
|
-
//
|
|
148
|
-
|
|
169
|
+
// v0.9.0 A12: the 49 `SIGIL_ERROR__*` code constants are no longer
|
|
170
|
+
// re-exported from the root barrel — import them from the `./errors`
|
|
171
|
+
// subpath: `import { SIGIL_ERROR__SDK__CAP_EXCEEDED } from "@usesigil/kit/errors"`.
|
|
172
|
+
// Error classes + domain-union types stay at root for catch-block narrowing.
|
|
173
|
+
export { SigilError as SigilKitError, SigilShieldError, SigilTeeError, SigilX402Error, SigilComposeError, SigilSdkDomainError, SigilRpcError, SIGIL_KIT_VERSION, walk as walkSigilCause, } from "./errors/index.js";
|
|
149
174
|
// ─── Dashboard / Owner Client ────────────────────────────────────────────────
|
|
150
175
|
// Re-exported from the dashboard subpath for convenience. Consumers preferring
|
|
151
176
|
// a single import path can use these; the dashboard subpath remains the
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,oCAAoC;AAEpC,iFAAiF;AACjF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,oCAAoC;AAEpC,iFAAiF;AACjF,EAAE;AACF,0EAA0E;AAC1E,yEAAyE;AACzE,yEAAyE;AACzE,2EAA2E;AAC3E,sEAAsE;AACtE,uEAAuE;AACvE,sEAAsE;AACtE,cAAc,+BAA+B,CAAC;AAE9C,iFAAiF;AACjF,EAAE;AACF,oEAAoE;AACpE,8DAA8D;AAC9D,oEAAoE;AACpE,uEAAuE;AACvE,2EAA2E;AAC3E,4EAA4E;AAC5E,oEAAoE;AACpE,OAAO;AACL,UAAU;AACV,qBAAqB;AACrB,gBAAgB;AAChB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB;AACjB,MAAM;AACN,YAAY,EAKZ,GAAG,EACH,UAAU,EACV,IAAI;AACJ,cAAc;AACd,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,gBAAgB;AAChB,SAAS;AACT,mBAAmB;AACnB,8DAA8D;AAC9D,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,8BAA8B,EAC9B,sBAAsB;AACtB,qDAAqD;AACrD,mBAAmB;AAEnB,WAAW;AACX,gBAAgB;AAChB,eAAe;AACf,cAA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AWvB,MAAM,mBAAmB,CAAC;AA8C3B,gFAAgF;AAChF,+EAA+E;AAC/E,wEAAwE;AACxE,0EAA0E;AAC1E,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGtE,+EAA+E;AAC/E,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,oBAAoB,GACrB,MAAM,sBAAsB,CAAC"}
|
package/dist/logger.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SigilLogger — pluggable structured logger for `@usesigil/kit`.
|
|
3
|
+
*
|
|
4
|
+
* Every internal `console.warn` / `console.error` / `console.debug` in the
|
|
5
|
+
* SDK routes through an injected `SigilLogger`. Consumers embedding the
|
|
6
|
+
* SDK into their own application decide where that output goes — a
|
|
7
|
+
* Pino/Bunyan/Winston instance, an OpenTelemetry span, a custom appender,
|
|
8
|
+
* or the bundled `NOOP_LOGGER` that discards everything.
|
|
9
|
+
*
|
|
10
|
+
* Default behavior: `NOOP_LOGGER`. No output is emitted unless the
|
|
11
|
+
* consumer explicitly opts in. This matters because the SDK is embedded
|
|
12
|
+
* in TEE-signed agent workflows where stray stdout/stderr can leak
|
|
13
|
+
* sensitive fields (vault addresses, mint addresses, cap values) to
|
|
14
|
+
* unintended destinations.
|
|
15
|
+
*
|
|
16
|
+
* For local development and test suites, `createConsoleLogger()` returns
|
|
17
|
+
* a drop-in forwarder that emits to `console.*`.
|
|
18
|
+
*
|
|
19
|
+
* Rationale: see the plan in
|
|
20
|
+
* `.claude/worktrees/<wt>/Plans/recursive-snuggling-reddy.md` step A5.
|
|
21
|
+
* This replaces raw `console.*` calls scattered across 13 files.
|
|
22
|
+
*/
|
|
23
|
+
/** Structured logger interface. All methods are side-effect-only. */
|
|
24
|
+
export interface SigilLogger {
|
|
25
|
+
/** Diagnostic messages — verbose, disabled by default. */
|
|
26
|
+
debug(message: string, context?: Record<string, unknown>): void;
|
|
27
|
+
/** Informational messages — nominal operational events. */
|
|
28
|
+
info(message: string, context?: Record<string, unknown>): void;
|
|
29
|
+
/** Warnings — unexpected but recoverable conditions. */
|
|
30
|
+
warn(message: string, context?: Record<string, unknown>): void;
|
|
31
|
+
/**
|
|
32
|
+
* Errors — failures the caller should know about. The `err` parameter
|
|
33
|
+
* is the originating exception, if any; it is logged separately from
|
|
34
|
+
* `context` to encourage structured-field reporting.
|
|
35
|
+
*/
|
|
36
|
+
error(message: string, err?: unknown, context?: Record<string, unknown>): void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* `NOOP_LOGGER` — discards every log call. Exported as a `const` so
|
|
40
|
+
* consumers may pass it explicitly; also used internally as the fallback
|
|
41
|
+
* when a `SigilClient` / `OwnerClient` is constructed without a logger.
|
|
42
|
+
*/
|
|
43
|
+
export declare const NOOP_LOGGER: SigilLogger;
|
|
44
|
+
/**
|
|
45
|
+
* `createConsoleLogger` — opt-in logger that forwards to `console.*`.
|
|
46
|
+
*
|
|
47
|
+
* Use in test suites and development when you want SDK output on stderr/
|
|
48
|
+
* stdout. Not the default, because production consumers should inject
|
|
49
|
+
* their own structured logger (pino, bunyan, otel, etc.) rather than
|
|
50
|
+
* rely on `console`.
|
|
51
|
+
*/
|
|
52
|
+
export declare function createConsoleLogger(): SigilLogger;
|
|
53
|
+
/**
|
|
54
|
+
* Internal helper: if the caller supplied a logger, use it; otherwise
|
|
55
|
+
* return the no-op default. All public SDK entry points (SigilClient,
|
|
56
|
+
* OwnerClient, seal, shielded-fetch, etc.) should call this once during
|
|
57
|
+
* construction so the rest of the module can assume a non-null logger.
|
|
58
|
+
*
|
|
59
|
+
* Marked public so subpackages (dashboard, custody) can reuse the same
|
|
60
|
+
* resolution rule.
|
|
61
|
+
*/
|
|
62
|
+
export declare function resolveLogger(logger: SigilLogger | undefined): SigilLogger;
|
|
63
|
+
/**
|
|
64
|
+
* Set the module-level logger used by leaf SDK utilities that don't
|
|
65
|
+
* accept a per-call logger parameter.
|
|
66
|
+
*
|
|
67
|
+
* Called by `SigilClient.create()` / `new SigilClient()` / `OwnerClient`
|
|
68
|
+
* constructors when `config.logger` is provided, so an application's
|
|
69
|
+
* chosen logger reaches every corner of the SDK.
|
|
70
|
+
*/
|
|
71
|
+
export declare function setSigilModuleLogger(logger: SigilLogger): void;
|
|
72
|
+
/**
|
|
73
|
+
* Read the current module-level logger. Internal SDK sites that cannot
|
|
74
|
+
* thread a per-call logger should call this to emit warnings/errors.
|
|
75
|
+
*/
|
|
76
|
+
export declare function getSigilModuleLogger(): SigilLogger;
|
|
77
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,qEAAqE;AACrE,MAAM,WAAW,WAAW;IAC1B,0DAA0D;IAC1D,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAChE,2DAA2D;IAC3D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC/D,wDAAwD;IACxD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC/D;;;;OAIG;IACH,KAAK,CACH,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,OAAO,EACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,IAAI,CAAC;CACT;AAQD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,WAKxB,CAAC;AAMH;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,IAAI,WAAW,CA6CjD;AAMD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,WAAW,CAE1E;AAuBD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAE9D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,WAAW,CAElD"}
|
package/dist/logger.js
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SigilLogger — pluggable structured logger for `@usesigil/kit`.
|
|
3
|
+
*
|
|
4
|
+
* Every internal `console.warn` / `console.error` / `console.debug` in the
|
|
5
|
+
* SDK routes through an injected `SigilLogger`. Consumers embedding the
|
|
6
|
+
* SDK into their own application decide where that output goes — a
|
|
7
|
+
* Pino/Bunyan/Winston instance, an OpenTelemetry span, a custom appender,
|
|
8
|
+
* or the bundled `NOOP_LOGGER` that discards everything.
|
|
9
|
+
*
|
|
10
|
+
* Default behavior: `NOOP_LOGGER`. No output is emitted unless the
|
|
11
|
+
* consumer explicitly opts in. This matters because the SDK is embedded
|
|
12
|
+
* in TEE-signed agent workflows where stray stdout/stderr can leak
|
|
13
|
+
* sensitive fields (vault addresses, mint addresses, cap values) to
|
|
14
|
+
* unintended destinations.
|
|
15
|
+
*
|
|
16
|
+
* For local development and test suites, `createConsoleLogger()` returns
|
|
17
|
+
* a drop-in forwarder that emits to `console.*`.
|
|
18
|
+
*
|
|
19
|
+
* Rationale: see the plan in
|
|
20
|
+
* `.claude/worktrees/<wt>/Plans/recursive-snuggling-reddy.md` step A5.
|
|
21
|
+
* This replaces raw `console.*` calls scattered across 13 files.
|
|
22
|
+
*/
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
// NOOP logger — zero-output default
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
const noop = () => undefined;
|
|
27
|
+
/**
|
|
28
|
+
* `NOOP_LOGGER` — discards every log call. Exported as a `const` so
|
|
29
|
+
* consumers may pass it explicitly; also used internally as the fallback
|
|
30
|
+
* when a `SigilClient` / `OwnerClient` is constructed without a logger.
|
|
31
|
+
*/
|
|
32
|
+
export const NOOP_LOGGER = Object.freeze({
|
|
33
|
+
debug: noop,
|
|
34
|
+
info: noop,
|
|
35
|
+
warn: noop,
|
|
36
|
+
error: noop,
|
|
37
|
+
});
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
39
|
+
// Console logger — opt-in forwarder to `console.*`
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
/**
|
|
42
|
+
* `createConsoleLogger` — opt-in logger that forwards to `console.*`.
|
|
43
|
+
*
|
|
44
|
+
* Use in test suites and development when you want SDK output on stderr/
|
|
45
|
+
* stdout. Not the default, because production consumers should inject
|
|
46
|
+
* their own structured logger (pino, bunyan, otel, etc.) rather than
|
|
47
|
+
* rely on `console`.
|
|
48
|
+
*/
|
|
49
|
+
export function createConsoleLogger() {
|
|
50
|
+
return {
|
|
51
|
+
debug: (message, context) => {
|
|
52
|
+
if (context !== undefined) {
|
|
53
|
+
// eslint-disable-next-line no-console
|
|
54
|
+
console.debug(message, context);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
// eslint-disable-next-line no-console
|
|
58
|
+
console.debug(message);
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
info: (message, context) => {
|
|
62
|
+
if (context !== undefined) {
|
|
63
|
+
// eslint-disable-next-line no-console
|
|
64
|
+
console.info(message, context);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
// eslint-disable-next-line no-console
|
|
68
|
+
console.info(message);
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
warn: (message, context) => {
|
|
72
|
+
if (context !== undefined) {
|
|
73
|
+
// eslint-disable-next-line no-console
|
|
74
|
+
console.warn(message, context);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
// eslint-disable-next-line no-console
|
|
78
|
+
console.warn(message);
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
error: (message, err, context) => {
|
|
82
|
+
if (err !== undefined && context !== undefined) {
|
|
83
|
+
// eslint-disable-next-line no-console
|
|
84
|
+
console.error(message, err, context);
|
|
85
|
+
}
|
|
86
|
+
else if (err !== undefined) {
|
|
87
|
+
// eslint-disable-next-line no-console
|
|
88
|
+
console.error(message, err);
|
|
89
|
+
}
|
|
90
|
+
else if (context !== undefined) {
|
|
91
|
+
// eslint-disable-next-line no-console
|
|
92
|
+
console.error(message, context);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
// eslint-disable-next-line no-console
|
|
96
|
+
console.error(message);
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
// resolveLogger — internal helper for SDK entry points
|
|
103
|
+
// ---------------------------------------------------------------------------
|
|
104
|
+
/**
|
|
105
|
+
* Internal helper: if the caller supplied a logger, use it; otherwise
|
|
106
|
+
* return the no-op default. All public SDK entry points (SigilClient,
|
|
107
|
+
* OwnerClient, seal, shielded-fetch, etc.) should call this once during
|
|
108
|
+
* construction so the rest of the module can assume a non-null logger.
|
|
109
|
+
*
|
|
110
|
+
* Marked public so subpackages (dashboard, custody) can reuse the same
|
|
111
|
+
* resolution rule.
|
|
112
|
+
*/
|
|
113
|
+
export function resolveLogger(logger) {
|
|
114
|
+
return logger ?? NOOP_LOGGER;
|
|
115
|
+
}
|
|
116
|
+
// ---------------------------------------------------------------------------
|
|
117
|
+
// Module-level logger — leaf-utility fallback
|
|
118
|
+
// ---------------------------------------------------------------------------
|
|
119
|
+
//
|
|
120
|
+
// Some SDK internals (walk(), alt-loader, balance-tracker, dashboard
|
|
121
|
+
// reads, etc.) are called from deep in the stack where threading a
|
|
122
|
+
// per-call `logger` argument would require signature changes across
|
|
123
|
+
// many consumers. For these sites, the SDK uses a module-level logger
|
|
124
|
+
// that SigilClient / OwnerClient constructors set from config.logger
|
|
125
|
+
// during initialization.
|
|
126
|
+
//
|
|
127
|
+
// Default: NOOP_LOGGER — nothing is emitted until a consumer opts in.
|
|
128
|
+
//
|
|
129
|
+
// Trade-off: this is module-local mutable state. Tests that want to
|
|
130
|
+
// observe warnings should call `setSigilModuleLogger` in `beforeEach`
|
|
131
|
+
// and reset with `setSigilModuleLogger(NOOP_LOGGER)` in `afterEach`.
|
|
132
|
+
// The state is process-wide, so parallel test suites must NOT share a
|
|
133
|
+
// worker unless all cooperate on the reset.
|
|
134
|
+
let _sigilModuleLogger = NOOP_LOGGER;
|
|
135
|
+
/**
|
|
136
|
+
* Set the module-level logger used by leaf SDK utilities that don't
|
|
137
|
+
* accept a per-call logger parameter.
|
|
138
|
+
*
|
|
139
|
+
* Called by `SigilClient.create()` / `new SigilClient()` / `OwnerClient`
|
|
140
|
+
* constructors when `config.logger` is provided, so an application's
|
|
141
|
+
* chosen logger reaches every corner of the SDK.
|
|
142
|
+
*/
|
|
143
|
+
export function setSigilModuleLogger(logger) {
|
|
144
|
+
_sigilModuleLogger = logger;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Read the current module-level logger. Internal SDK sites that cannot
|
|
148
|
+
* thread a per-call logger should call this to emit warnings/errors.
|
|
149
|
+
*/
|
|
150
|
+
export function getSigilModuleLogger() {
|
|
151
|
+
return _sigilModuleLogger;
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAsBH,8EAA8E;AAC9E,oCAAoC;AACpC,8EAA8E;AAE9E,MAAM,IAAI,GAAG,GAAS,EAAE,CAAC,SAAS,CAAC;AAEnC;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAgB,MAAM,CAAC,MAAM,CAAC;IACpD,KAAK,EAAE,IAAI;IAC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AE,GAAG,EAAE,OAAO,CAAC,CAAC;YACvC,CAAC;iBAAM,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;gBAC7B,sCAAsC;gBACtC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;YAC9B,CAAC;iBAAM,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBACjC,sCAAsC;gBACtC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAClC,CAAC;iBAAM,CAAC;gBACN,sCAAsC;gBACtC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACzB,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,uDAAuD;AACvD,8EAA8E;AAE9E;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,MAA+B;IAC3D,OAAO,MAAM,IAAI,WAAW,CAAC;AAC/B,CAAC;AAED,8EAA8E;AAC9E,8CAA8C;AAC9C,8EAA8E;AAC9E,EAAE;AACF,qEAAqE;AACrE,mEAAmE;AACnE,oEAAoE;AACpE,sEAAsE;AACtE,qEAAqE;AACrE,yBAAyB;AACzB,EAAE;AACF,sEAAsE;AACtE,EAAE;AACF,oEAAoE;AACpE,sEAAsE;AACtE,qEAAqE;AACrE,sEAAsE;AACtE,4CAA4C;AAE5C,IAAI,kBAAkB,GAAgB,WAAW,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAmB;IACtD,kBAAkB,GAAG,MAAM,CAAC;AAC9B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,kBAAkB,CAAC;AAC5B,CAAC"}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SigilPolicyPlugin — consumer-supplied policy checks that run inside
|
|
3
|
+
* the `seal()` pre-flight.
|
|
4
|
+
*
|
|
5
|
+
* Plugins are the **rejection surface** of the SDK — distinct from
|
|
6
|
+
* `SealHooks`, which are observe-only. A plugin's `check()` returns
|
|
7
|
+
* either `{ allow: true }` or `{ allow: false, reason, code? }`; the
|
|
8
|
+
* first rejection short-circuits and `seal()` throws
|
|
9
|
+
* `SigilSdkDomainError(SIGIL_ERROR__SDK__PLUGIN_REJECTED)`.
|
|
10
|
+
*
|
|
11
|
+
* Run order inside `seal()`:
|
|
12
|
+
* 1. Parameter validation (basic shape checks)
|
|
13
|
+
* 2. `hooks.onBeforeBuild` — may abort cleanly via `{ skipSeal: true }`
|
|
14
|
+
* 3. **Plugin checks** — first `{ allow: false }` throws
|
|
15
|
+
* 4. `resolveVaultState` + capability check + constraint check
|
|
16
|
+
* 5. Transaction assembly
|
|
17
|
+
*
|
|
18
|
+
* Plugins see the vault's resolved on-chain state if they need it, but
|
|
19
|
+
* they MUST NOT perform their own RPC calls — they receive the
|
|
20
|
+
* pre-resolved state as context. Async plugin `check()` is supported
|
|
21
|
+
* for cases where the plugin delegates to an external service
|
|
22
|
+
* (feature-flag servers, compliance APIs) but the plugin runner will
|
|
23
|
+
* log a warning if any plugin takes >1s.
|
|
24
|
+
*
|
|
25
|
+
* Consumer-supplied logger + hooks still fire around plugin execution
|
|
26
|
+
* (a rejecting plugin triggers `onError` before the throw propagates).
|
|
27
|
+
*/
|
|
28
|
+
import type { Address, Instruction } from "./kit-adapter.js";
|
|
29
|
+
import type { SigilSdkErrorCode } from "./errors/codes.js";
|
|
30
|
+
/**
|
|
31
|
+
* Read-only data surface passed to every plugin `check()` call. The
|
|
32
|
+
* plugin runner populates this once per `seal()` invocation and shares
|
|
33
|
+
* it across all plugins; plugins must treat everything as immutable.
|
|
34
|
+
*/
|
|
35
|
+
export interface PluginContext {
|
|
36
|
+
readonly vault: Address;
|
|
37
|
+
readonly agent: Address;
|
|
38
|
+
readonly tokenMint: Address;
|
|
39
|
+
readonly amount: bigint;
|
|
40
|
+
readonly network: "devnet" | "mainnet";
|
|
41
|
+
readonly instructions: readonly Instruction[];
|
|
42
|
+
/** Stable ID for this `seal()` invocation — matches `SealHookContext.correlationId`. */
|
|
43
|
+
readonly correlationId: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Successful plugin check. May carry advisory metadata that downstream
|
|
47
|
+
* plugins or hooks can observe via `SealHooks.onBeforeSign`.
|
|
48
|
+
*/
|
|
49
|
+
export interface PluginAllow {
|
|
50
|
+
readonly allow: true;
|
|
51
|
+
/** Optional metadata (flag names, rule IDs, etc.) for downstream visibility. */
|
|
52
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Rejection result. `reason` must be a human-readable string; `code`
|
|
56
|
+
* is optional but recommended for machine-readable catch blocks.
|
|
57
|
+
*/
|
|
58
|
+
export interface PluginReject {
|
|
59
|
+
readonly allow: false;
|
|
60
|
+
readonly reason: string;
|
|
61
|
+
readonly code?: SigilSdkErrorCode;
|
|
62
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
63
|
+
}
|
|
64
|
+
export type PluginResult = PluginAllow | PluginReject;
|
|
65
|
+
export interface SigilPolicyPlugin {
|
|
66
|
+
/**
|
|
67
|
+
* Display name used in logs + the rejection error's context. Must be
|
|
68
|
+
* unique per plugin instance — the runner enforces this via config
|
|
69
|
+
* validation.
|
|
70
|
+
*/
|
|
71
|
+
readonly name: string;
|
|
72
|
+
/**
|
|
73
|
+
* Observe-only lifecycle: called once when the plugin is registered
|
|
74
|
+
* on a `SigilClient` / `Sigil` facade. Use for opening connections,
|
|
75
|
+
* prewarming caches, etc. Throws during init fail the client
|
|
76
|
+
* construction with `SIGIL_ERROR__SDK__INVALID_CONFIG`.
|
|
77
|
+
*/
|
|
78
|
+
readonly init?: () => void | Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Policy check. Returns `{ allow: true }` to continue or
|
|
81
|
+
* `{ allow: false, reason, code? }` to reject. Must not throw under
|
|
82
|
+
* normal operation — the plugin runner treats a throw as a hard
|
|
83
|
+
* rejection with the error message as the reason.
|
|
84
|
+
*/
|
|
85
|
+
check(ctx: PluginContext): PluginResult | Promise<PluginResult>;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Run every plugin's `check()` in registration order. Returns on the
|
|
89
|
+
* first rejection with a `SigilSdkDomainError`; otherwise returns
|
|
90
|
+
* successfully. Plugins that take >1 second log a warning via the
|
|
91
|
+
* module logger.
|
|
92
|
+
*
|
|
93
|
+
* Throws:
|
|
94
|
+
* - `SigilSdkDomainError(SIGIL_ERROR__SDK__PLUGIN_REJECTED)` on first
|
|
95
|
+
* plugin that returns `{ allow: false }` OR throws.
|
|
96
|
+
*
|
|
97
|
+
* @internal — consumers invoke this via `seal()` / `SigilClient`.
|
|
98
|
+
*/
|
|
99
|
+
export declare function runPlugins(plugins: readonly SigilPolicyPlugin[] | undefined, ctx: PluginContext): Promise<void>;
|
|
100
|
+
/**
|
|
101
|
+
* Validate a plugin list at client-construction time. Rejects:
|
|
102
|
+
* - Non-array input
|
|
103
|
+
* - Duplicate plugin names
|
|
104
|
+
* - Plugins without `name` or `check`
|
|
105
|
+
*
|
|
106
|
+
* Called by `createSigilClient` / `Sigil.quickstart` / `Sigil.fromVault`
|
|
107
|
+
* when `config.plugins` is present.
|
|
108
|
+
*/
|
|
109
|
+
export declare function validatePluginList(plugins: unknown): asserts plugins is readonly SigilPolicyPlugin[];
|
|
110
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAU3D;;;;GAIG;AACH,MAAM,W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U,CAC9B,OAAO,EAAE,SAAS,iBAAiB,EAAE,GAAG,SAAS,EACjD,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,IAAI,CAAC,CAiDf;AAID;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,OAAO,IAAI,SAAS,iBAAiB,EAAE,CA+CjD"}
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SigilPolicyPlugin — consumer-supplied policy checks that run inside
|
|
3
|
+
* the `seal()` pre-flight.
|
|
4
|
+
*
|
|
5
|
+
* Plugins are the **rejection surface** of the SDK — distinct from
|
|
6
|
+
* `SealHooks`, which are observe-only. A plugin's `check()` returns
|
|
7
|
+
* either `{ allow: true }` or `{ allow: false, reason, code? }`; the
|
|
8
|
+
* first rejection short-circuits and `seal()` throws
|
|
9
|
+
* `SigilSdkDomainError(SIGIL_ERROR__SDK__PLUGIN_REJECTED)`.
|
|
10
|
+
*
|
|
11
|
+
* Run order inside `seal()`:
|
|
12
|
+
* 1. Parameter validation (basic shape checks)
|
|
13
|
+
* 2. `hooks.onBeforeBuild` — may abort cleanly via `{ skipSeal: true }`
|
|
14
|
+
* 3. **Plugin checks** — first `{ allow: false }` throws
|
|
15
|
+
* 4. `resolveVaultState` + capability check + constraint check
|
|
16
|
+
* 5. Transaction assembly
|
|
17
|
+
*
|
|
18
|
+
* Plugins see the vault's resolved on-chain state if they need it, but
|
|
19
|
+
* they MUST NOT perform their own RPC calls — they receive the
|
|
20
|
+
* pre-resolved state as context. Async plugin `check()` is supported
|
|
21
|
+
* for cases where the plugin delegates to an external service
|
|
22
|
+
* (feature-flag servers, compliance APIs) but the plugin runner will
|
|
23
|
+
* log a warning if any plugin takes >1s.
|
|
24
|
+
*
|
|
25
|
+
* Consumer-supplied logger + hooks still fire around plugin execution
|
|
26
|
+
* (a rejecting plugin triggers `onError` before the throw propagates).
|
|
27
|
+
*/
|
|
28
|
+
import { SigilSdkDomainError } from "./errors/sdk.js";
|
|
29
|
+
import { SIGIL_ERROR__SDK__PLUGIN_REJECTED, SIGIL_ERROR__SDK__INVALID_CONFIG, } from "./errors/codes.js";
|
|
30
|
+
import { getSigilModuleLogger } from "./logger.js";
|
|
31
|
+
// ─── Plugin runner ──────────────────────────────────────────────────────────
|
|
32
|
+
/**
|
|
33
|
+
* Run every plugin's `check()` in registration order. Returns on the
|
|
34
|
+
* first rejection with a `SigilSdkDomainError`; otherwise returns
|
|
35
|
+
* successfully. Plugins that take >1 second log a warning via the
|
|
36
|
+
* module logger.
|
|
37
|
+
*
|
|
38
|
+
* Throws:
|
|
39
|
+
* - `SigilSdkDomainError(SIGIL_ERROR__SDK__PLUGIN_REJECTED)` on first
|
|
40
|
+
* plugin that returns `{ allow: false }` OR throws.
|
|
41
|
+
*
|
|
42
|
+
* @internal — consumers invoke this via `seal()` / `SigilClient`.
|
|
43
|
+
*/
|
|
44
|
+
export async function runPlugins(plugins, ctx) {
|
|
45
|
+
if (!plugins || plugins.length === 0)
|
|
46
|
+
return;
|
|
47
|
+
for (const plugin of plugins) {
|
|
48
|
+
const start = Date.now();
|
|
49
|
+
let result;
|
|
50
|
+
try {
|
|
51
|
+
result = await plugin.check(ctx);
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
const message = err instanceof Error ? err.message : String(err ?? "unknown");
|
|
55
|
+
throw new SigilSdkDomainError(SIGIL_ERROR__SDK__PLUGIN_REJECTED, `Plugin "${plugin.name}" threw during check(): ${message}`, {
|
|
56
|
+
cause: err,
|
|
57
|
+
context: {
|
|
58
|
+
plugin: plugin.name,
|
|
59
|
+
reason: message,
|
|
60
|
+
correlationId: ctx.correlationId,
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
const elapsedMs = Date.now() - start;
|
|
65
|
+
if (elapsedMs > 1000) {
|
|
66
|
+
getSigilModuleLogger().warn(`[SigilPolicyPlugin] "${plugin.name}" took ${elapsedMs}ms — plugin checks should be fast`, { plugin: plugin.name, elapsedMs });
|
|
67
|
+
}
|
|
68
|
+
if (!result.allow) {
|
|
69
|
+
throw new SigilSdkDomainError(SIGIL_ERROR__SDK__PLUGIN_REJECTED, `Plugin "${plugin.name}" rejected the operation: ${result.reason}`, {
|
|
70
|
+
context: {
|
|
71
|
+
plugin: plugin.name,
|
|
72
|
+
reason: result.reason,
|
|
73
|
+
code: result.code,
|
|
74
|
+
metadata: result.metadata,
|
|
75
|
+
correlationId: ctx.correlationId,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// ─── Plugin list validation ─────────────────────────────────────────────────
|
|
82
|
+
/**
|
|
83
|
+
* Validate a plugin list at client-construction time. Rejects:
|
|
84
|
+
* - Non-array input
|
|
85
|
+
* - Duplicate plugin names
|
|
86
|
+
* - Plugins without `name` or `check`
|
|
87
|
+
*
|
|
88
|
+
* Called by `createSigilClient` / `Sigil.quickstart` / `Sigil.fromVault`
|
|
89
|
+
* when `config.plugins` is present.
|
|
90
|
+
*/
|
|
91
|
+
export function validatePluginList(plugins) {
|
|
92
|
+
if (!Array.isArray(plugins)) {
|
|
93
|
+
throw new SigilSdkDomainError(SIGIL_ERROR__SDK__INVALID_CONFIG, `SigilClientConfig.plugins must be an array of SigilPolicyPlugin (received ${typeof plugins})`, { context: { field: "plugins", expected: "SigilPolicyPlugin[]" } });
|
|
94
|
+
}
|
|
95
|
+
const names = new Set();
|
|
96
|
+
for (let i = 0; i < plugins.length; i++) {
|
|
97
|
+
const p = plugins[i];
|
|
98
|
+
if (!p || typeof p !== "object") {
|
|
99
|
+
throw new SigilSdkDomainError(SIGIL_ERROR__SDK__INVALID_CONFIG, `Plugin at index ${i} is not an object (received ${typeof p})`, { context: { field: `plugins[${i}]`, expected: "object" } });
|
|
100
|
+
}
|
|
101
|
+
const pluginObj = p;
|
|
102
|
+
if (typeof pluginObj.name !== "string" || pluginObj.name.length === 0) {
|
|
103
|
+
throw new SigilSdkDomainError(SIGIL_ERROR__SDK__INVALID_CONFIG, `Plugin at index ${i} is missing a non-empty string "name"`, { context: { field: `plugins[${i}].name`, expected: "string" } });
|
|
104
|
+
}
|
|
105
|
+
if (typeof pluginObj.check !== "function") {
|
|
106
|
+
throw new SigilSdkDomainError(SIGIL_ERROR__SDK__INVALID_CONFIG, `Plugin "${pluginObj.name}" is missing a check() function`, {
|
|
107
|
+
context: {
|
|
108
|
+
field: `plugins[${pluginObj.name}].check`,
|
|
109
|
+
expected: "function",
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
if (names.has(pluginObj.name)) {
|
|
114
|
+
throw new SigilSdkDomainError(SIGIL_ERROR__SDK__INVALID_CONFIG, `Duplicate plugin name "${pluginObj.name}" — plugin names must be unique per client`, { context: { field: "plugins[].name", expected: "unique" } });
|
|
115
|
+
}
|
|
116
|
+
names.add(pluginObj.name);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACL,iCAAiC,EACjC,gCAAgC,GACjC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAwEnD,+EAA+E;AAE/E;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,OAAiD,EACjD,GAAkB;IAElB,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAE7C,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,KAA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