@trigguard/intent-sdk
Advanced tools
| /** | ||
| * Delegation chain-of-custody client — `client.delegate(...)`. | ||
| * | ||
| * Delegating work to another agent is itself a governed action. It routes to an | ||
| * `agent.*` surface and is authorized by the gateway, which enforces dual | ||
| * (egress + ingress) authorization, depth limits, loop detection, cross-org and | ||
| * vendor rules, capability checks, and now expiry — see | ||
| * packages/trigguard-cloud/delegation/delegationAuthority.ts. The SDK never | ||
| * authorizes locally. | ||
| * | ||
| * Chain-of-custody fields travel under `context.delegation` (the wire shape the | ||
| * gateway's extractDelegationContext reads), preserving: | ||
| * - identity → callerAgent / targetAgent (and orgs) | ||
| * - intent → action (delegation kind) + scope (the capability delegated) | ||
| * - scope → scope → inner_surface (capability the target may exercise) | ||
| * - expiry → expiresAt → expires_at (ISO 8601 or epoch ms) | ||
| * - audit → delegationChain (prior hops) + parentExecutionId | ||
| */ | ||
| import type { AuthorizeParams, AuthorizeResult } from "@trigguard/execution-sdk"; | ||
| /** The act of delegating maps to one of these registered `agent.*` surfaces. */ | ||
| export declare const DELEGATION_KIND_TO_SURFACE: { | ||
| readonly delegate: "agent.delegate"; | ||
| readonly invoke: "agent.invoke"; | ||
| readonly handoff: "agent.handoff"; | ||
| readonly coordinate: "agent.coordinate"; | ||
| }; | ||
| export type DelegationKind = keyof typeof DELEGATION_KIND_TO_SURFACE; | ||
| export declare function surfaceForDelegationKind(kind: string): string | undefined; | ||
| export interface DelegateParams { | ||
| /** Identity: the agent initiating the delegation. */ | ||
| callerAgent: string; | ||
| /** Identity: the agent receiving the delegation. */ | ||
| targetAgent: string; | ||
| /** Scope: the capability/surface the target may exercise (e.g. "deploy.release"). */ | ||
| scope?: string; | ||
| /** Delegation kind → `agent.<kind>` surface (default "delegate"). */ | ||
| kind?: DelegationKind; | ||
| targetVendor?: string; | ||
| /** Expiry: ISO-8601 string or epoch milliseconds. */ | ||
| expiresAt?: string | number; | ||
| delegationDepth?: number; | ||
| /** Audit: prior hops in the delegation chain. */ | ||
| delegationChain?: string[]; | ||
| parentExecutionId?: string; | ||
| sessionParent?: string; | ||
| callerOrg?: string; | ||
| targetOrg?: string; | ||
| /** Extra execution context (merged; delegation fields land under context.delegation). */ | ||
| context?: Record<string, unknown>; | ||
| actor?: string; | ||
| sessionId?: string; | ||
| executionMode?: AuthorizeParams["executionMode"]; | ||
| } | ||
| export type DelegationClient = { | ||
| delegate: (params: DelegateParams) => Promise<AuthorizeResult>; | ||
| }; | ||
| type Authorizer = (params: AuthorizeParams) => Promise<AuthorizeResult>; | ||
| /** | ||
| * Build a delegation client over an execution-sdk `authorize` function. Maps the | ||
| * delegation kind to an `agent.*` surface and forwards chain-of-custody fields | ||
| * under `context.delegation` for the gateway to authorize. | ||
| */ | ||
| export declare function createDelegationClient(authorize: Authorizer): DelegationClient; | ||
| export {}; | ||
| //# sourceMappingURL=delegation.d.ts.map |
| {"version":3,"file":"delegation.d.ts","sourceRoot":"","sources":["../src/delegation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEjF,gFAAgF;AAChF,eAAO,MAAM,0BAA0B;;;;;CAK7B,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,0BAA0B,CAAC;AAErE,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEzE;AAED,MAAM,WAAW,cAAc;IAC7B,qDAAqD;IACrD,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,qFAAqF;IACrF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iDAAiD;IACjD,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yFAAyF;IACzF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;CAClD;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;CAChE,CAAC;AAEF,KAAK,UAAU,GAAG,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;AAsBxE;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,UAAU,GAAG,gBAAgB,CAsB9E"} |
| /** The act of delegating maps to one of these registered `agent.*` surfaces. */ | ||
| export const DELEGATION_KIND_TO_SURFACE = { | ||
| delegate: "agent.delegate", | ||
| invoke: "agent.invoke", | ||
| handoff: "agent.handoff", | ||
| coordinate: "agent.coordinate", | ||
| }; | ||
| export function surfaceForDelegationKind(kind) { | ||
| return DELEGATION_KIND_TO_SURFACE[kind]; | ||
| } | ||
| function buildDelegationBlock(params) { | ||
| const block = { | ||
| caller_agent: params.callerAgent, | ||
| target_agent: params.targetAgent, | ||
| }; | ||
| if (params.scope !== undefined) { | ||
| block.inner_surface = params.scope; | ||
| block.delegation_action = params.scope; | ||
| } | ||
| if (params.targetVendor !== undefined) | ||
| block.target_vendor = params.targetVendor; | ||
| if (params.expiresAt !== undefined) | ||
| block.expires_at = params.expiresAt; | ||
| if (params.delegationDepth !== undefined) | ||
| block.delegation_depth = params.delegationDepth; | ||
| if (params.delegationChain !== undefined) | ||
| block.delegation_chain = params.delegationChain; | ||
| if (params.parentExecutionId !== undefined) | ||
| block.parent_execution_id = params.parentExecutionId; | ||
| if (params.sessionParent !== undefined) | ||
| block.session_parent = params.sessionParent; | ||
| if (params.callerOrg !== undefined) | ||
| block.caller_org = params.callerOrg; | ||
| if (params.targetOrg !== undefined) | ||
| block.target_org = params.targetOrg; | ||
| return block; | ||
| } | ||
| /** | ||
| * Build a delegation client over an execution-sdk `authorize` function. Maps the | ||
| * delegation kind to an `agent.*` surface and forwards chain-of-custody fields | ||
| * under `context.delegation` for the gateway to authorize. | ||
| */ | ||
| export function createDelegationClient(authorize) { | ||
| const delegate = (params) => { | ||
| if (!params || !params.callerAgent || !params.targetAgent) { | ||
| throw new Error("delegate() requires callerAgent and targetAgent"); | ||
| } | ||
| const kind = params.kind ?? "delegate"; | ||
| const surface = DELEGATION_KIND_TO_SURFACE[kind]; | ||
| if (!surface) { | ||
| throw new Error(`Unknown delegation kind: ${String(kind)}`); | ||
| } | ||
| const delegationBlock = buildDelegationBlock(params); | ||
| const mergedContext = { ...(params.context ?? {}), delegation: delegationBlock }; | ||
| return authorize({ | ||
| surface, | ||
| actorId: params.actor ?? params.callerAgent, | ||
| context: mergedContext, | ||
| sessionId: params.sessionId, | ||
| executionMode: params.executionMode, | ||
| }); | ||
| }; | ||
| return { delegate }; | ||
| } |
| /** | ||
| * Memory governance client — `memory.authorize()` and per-operation helpers. | ||
| * | ||
| * Every memory mutation is a governed action: it routes to a canonical | ||
| * `memory.*` execution surface and is authorized by the gateway (PDP) exactly | ||
| * like any other surface. Unverified memory never becomes operational knowledge; | ||
| * promotion must carry evidence the policy can evaluate. | ||
| * | ||
| * Governance fields travel under `context.memory` so they reach the gateway | ||
| * (receipt-service/memoryReceipt.ts) without polluting the execution-context hash | ||
| * preimage (repository/commit/workflow/environment/artifact). The Python SDK | ||
| * (sdk/python/trigguard/memory.py) uses the same wire shape. | ||
| * | ||
| * See protocol/execution-surfaces.json, contracts/memory_receipt_v1.json, and | ||
| * docs/architecture/RFC_VERIFIED_MEMORY_GOVERNANCE.md. | ||
| */ | ||
| import type { AuthorizeParams, AuthorizeResult } from "@trigguard/execution-sdk"; | ||
| export declare const MEMORY_OPERATION_TO_SURFACE: { | ||
| readonly read: "memory.read"; | ||
| readonly write: "memory.write"; | ||
| readonly verify: "memory.verify"; | ||
| readonly promote: "memory.promote"; | ||
| readonly archive: "memory.archive"; | ||
| readonly delete: "memory.delete"; | ||
| }; | ||
| export type MemoryOperation = keyof typeof MEMORY_OPERATION_TO_SURFACE; | ||
| export declare function surfaceForMemoryOperation(operation: string): string | undefined; | ||
| /** Governance fields the client assembles into `context.memory`. */ | ||
| export interface MemoryGovernanceFields { | ||
| memoryId?: string; | ||
| evidenceRefs?: string[]; | ||
| /** Confidence before the operation (maps to `confidenceBefore`). */ | ||
| confidence?: number; | ||
| confidenceAfter?: number; | ||
| /** Lifecycle stage before the operation (maps to `lifecycleStageBefore`). */ | ||
| lifecycleStage?: string; | ||
| lifecycleStageAfter?: string; | ||
| version?: number; | ||
| source?: string; | ||
| identity?: Record<string, unknown>; | ||
| model?: string; | ||
| agentId?: string; | ||
| previousReceiptHash?: string; | ||
| } | ||
| /** Per-operation params — the surface is derived from the operation. */ | ||
| export type MemoryAuthorizeParams = Omit<AuthorizeParams, "surface"> & MemoryGovernanceFields; | ||
| type Authorizer = (params: AuthorizeParams) => Promise<AuthorizeResult>; | ||
| export type MemoryClient = { | ||
| /** Authorize any memory operation; surface is derived from the operation. */ | ||
| authorize: (operation: MemoryOperation, params?: MemoryAuthorizeParams) => Promise<AuthorizeResult>; | ||
| read: (params?: MemoryAuthorizeParams) => Promise<AuthorizeResult>; | ||
| write: (params?: MemoryAuthorizeParams) => Promise<AuthorizeResult>; | ||
| verify: (params?: MemoryAuthorizeParams) => Promise<AuthorizeResult>; | ||
| promote: (params?: MemoryAuthorizeParams) => Promise<AuthorizeResult>; | ||
| archive: (params?: MemoryAuthorizeParams) => Promise<AuthorizeResult>; | ||
| delete: (params?: MemoryAuthorizeParams) => Promise<AuthorizeResult>; | ||
| }; | ||
| /** | ||
| * Build a memory client over an execution-sdk `authorize` function. Thin and | ||
| * additive: it maps the operation to a `memory.*` surface and forwards governance | ||
| * fields (evidence refs, confidence, lifecycle stage) under `context.memory`. | ||
| */ | ||
| export declare function createMemoryClient(authorize: Authorizer): MemoryClient; | ||
| export {}; | ||
| //# sourceMappingURL=memory.d.ts.map |
| {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEjF,eAAO,MAAM,2BAA2B;;;;;;;CAO9B,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,2BAA2B,CAAC;AAEvE,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE/E;AAED,oEAAoE;AACpE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,6EAA6E;IAC7E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,wEAAwE;AACxE,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,GAAG,sBAAsB,CAAC;AAE9F,KAAK,UAAU,GAAG,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;AAExE,MAAM,MAAM,YAAY,GAAG;IACzB,6EAA6E;IAC7E,SAAS,EAAE,CAAC,SAAS,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,qBAAqB,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IACpG,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,qBAAqB,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IACnE,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,qBAAqB,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IACpE,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,qBAAqB,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IACrE,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,qBAAqB,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IACtE,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,qBAAqB,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IACtE,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,qBAAqB,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;CACtE,CAAC;AAsBF;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,UAAU,GAAG,YAAY,CAiDtE"} |
| export const MEMORY_OPERATION_TO_SURFACE = { | ||
| read: "memory.read", | ||
| write: "memory.write", | ||
| verify: "memory.verify", | ||
| promote: "memory.promote", | ||
| archive: "memory.archive", | ||
| delete: "memory.delete", | ||
| }; | ||
| export function surfaceForMemoryOperation(operation) { | ||
| return MEMORY_OPERATION_TO_SURFACE[operation]; | ||
| } | ||
| function buildMemoryBlock(operation, fields) { | ||
| const block = { operation }; | ||
| if (fields.memoryId !== undefined) | ||
| block.memoryId = fields.memoryId; | ||
| if (fields.evidenceRefs !== undefined) | ||
| block.evidenceRefs = fields.evidenceRefs; | ||
| if (fields.confidence !== undefined) | ||
| block.confidenceBefore = fields.confidence; | ||
| if (fields.confidenceAfter !== undefined) | ||
| block.confidenceAfter = fields.confidenceAfter; | ||
| if (fields.lifecycleStage !== undefined) | ||
| block.lifecycleStageBefore = fields.lifecycleStage; | ||
| if (fields.lifecycleStageAfter !== undefined) | ||
| block.lifecycleStageAfter = fields.lifecycleStageAfter; | ||
| if (fields.version !== undefined) | ||
| block.version = fields.version; | ||
| if (fields.source !== undefined) | ||
| block.source = fields.source; | ||
| if (fields.identity !== undefined) | ||
| block.identity = fields.identity; | ||
| if (fields.model !== undefined) | ||
| block.model = fields.model; | ||
| if (fields.agentId !== undefined) | ||
| block.agentId = fields.agentId; | ||
| if (fields.previousReceiptHash !== undefined) | ||
| block.previousReceiptHash = fields.previousReceiptHash; | ||
| return block; | ||
| } | ||
| /** | ||
| * Build a memory client over an execution-sdk `authorize` function. Thin and | ||
| * additive: it maps the operation to a `memory.*` surface and forwards governance | ||
| * fields (evidence refs, confidence, lifecycle stage) under `context.memory`. | ||
| */ | ||
| export function createMemoryClient(authorize) { | ||
| const run = (operation, params = {}) => { | ||
| const surface = MEMORY_OPERATION_TO_SURFACE[operation]; | ||
| if (!surface) { | ||
| throw new Error(`Unknown memory operation: ${String(operation)}`); | ||
| } | ||
| const { memoryId, evidenceRefs, confidence, confidenceAfter, lifecycleStage, lifecycleStageAfter, version, source, identity, model, agentId, previousReceiptHash, context, ...rest } = params; | ||
| const memoryBlock = buildMemoryBlock(operation, { | ||
| memoryId, | ||
| evidenceRefs, | ||
| confidence, | ||
| confidenceAfter, | ||
| lifecycleStage, | ||
| lifecycleStageAfter, | ||
| version, | ||
| source, | ||
| identity, | ||
| model, | ||
| agentId, | ||
| previousReceiptHash, | ||
| }); | ||
| const mergedContext = { ...(context ?? {}), memory: memoryBlock }; | ||
| return authorize({ ...rest, surface, context: mergedContext }); | ||
| }; | ||
| return { | ||
| authorize: run, | ||
| read: (params) => run("read", params), | ||
| write: (params) => run("write", params), | ||
| verify: (params) => run("verify", params), | ||
| promote: (params) => run("promote", params), | ||
| archive: (params) => run("archive", params), | ||
| delete: (params) => run("delete", params), | ||
| }; | ||
| } |
+8
-0
| import { createExecutionClient, type AuthorizeResult, type ExecutionClientOptions, type ExecutionContext } from "@trigguard/execution-sdk"; | ||
| import { type IntentName } from "./intents.js"; | ||
| import { type MemoryClient } from "./memory.js"; | ||
| import { type DelegationClient } from "./delegation.js"; | ||
| export { INTENT_TO_SURFACE, surfaceForIntent, type IntentName } from "./intents.js"; | ||
| export { MEMORY_OPERATION_TO_SURFACE, surfaceForMemoryOperation, createMemoryClient, type MemoryOperation, type MemoryAuthorizeParams, type MemoryGovernanceFields, type MemoryClient, } from "./memory.js"; | ||
| export { DELEGATION_KIND_TO_SURFACE, surfaceForDelegationKind, createDelegationClient, type DelegationKind, type DelegateParams, type DelegationClient, } from "./delegation.js"; | ||
| export type { AuthorizeResult, ExecutionClientOptions, ExecutionContext } from "@trigguard/execution-sdk"; | ||
@@ -11,2 +15,6 @@ type IntentClient = { | ||
| decide: ReturnType<typeof createExecutionClient>["decide"]; | ||
| /** Memory governance: `client.memory.authorize("write", …)` and helpers. */ | ||
| memory: MemoryClient; | ||
| /** Delegation chain-of-custody: `client.delegate({ callerAgent, targetAgent, scope, expiresAt })`. */ | ||
| delegate: DelegationClient["delegate"]; | ||
| }; | ||
@@ -13,0 +21,0 @@ /** |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAElE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AACpF,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE1G,KAAK,YAAY,GAAG;KACjB,CAAC,IAAI,UAAU,GAAG,CAAC,OAAO,CAAC,EAAE,gBAAgB,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC;CAChG,GAAG;IACF,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,gBAAgB,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IAC5G,SAAS,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,WAAW,CAAC,CAAC;IACjE,MAAM,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,QAAQ,CAAC,CAAC;CAC5D,CAAC;AAEF;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,sBAAsB,GAC7B,YAAY,CA0Bd"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEhF,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,EACzB,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,YAAY,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,EACtB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE1G,KAAK,YAAY,GAAG;KACjB,CAAC,IAAI,UAAU,GAAG,CAAC,OAAO,CAAC,EAAE,gBAAgB,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC;CAChG,GAAG;IACF,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,gBAAgB,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IAC5G,SAAS,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,WAAW,CAAC,CAAC;IACjE,MAAM,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC3D,4EAA4E;IAC5E,MAAM,EAAE,YAAY,CAAC;IACrB,sGAAsG;IACtG,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;CACxC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,sBAAsB,GAC7B,YAAY,CA4Bd"} |
+6
-0
| import { createExecutionClient, } from "@trigguard/execution-sdk"; | ||
| import { INTENT_TO_SURFACE } from "./intents.js"; | ||
| import { createMemoryClient } from "./memory.js"; | ||
| import { createDelegationClient } from "./delegation.js"; | ||
| export { INTENT_TO_SURFACE, surfaceForIntent } from "./intents.js"; | ||
| export { MEMORY_OPERATION_TO_SURFACE, surfaceForMemoryOperation, createMemoryClient, } from "./memory.js"; | ||
| export { DELEGATION_KIND_TO_SURFACE, surfaceForDelegationKind, createDelegationClient, } from "./delegation.js"; | ||
| /** | ||
@@ -21,2 +25,4 @@ * High-level client: each intent method calls `POST /execute` with the mapped surface | ||
| decide: client.decide, | ||
| memory: createMemoryClient(client.authorize), | ||
| delegate: createDelegationClient(client.authorize).delegate, | ||
| }; | ||
@@ -23,0 +29,0 @@ Object.keys(INTENT_TO_SURFACE).forEach((name) => { |
@@ -8,6 +8,6 @@ /** | ||
| readonly exportData: "data.export"; | ||
| readonly dataExport: "dataExport"; | ||
| readonly dataExport: "data.export"; | ||
| readonly chargePayment: "payment.execute"; | ||
| readonly writeProduction: "production.write"; | ||
| readonly accessSecrets: "secrets.access"; | ||
| readonly accessSecrets: "secret.read"; | ||
| readonly migrateDatabase: "database.migrate"; | ||
@@ -14,0 +14,0 @@ readonly publishArtifact: "artifact.publish"; |
+2
-2
@@ -8,6 +8,6 @@ /** | ||
| exportData: "data.export", | ||
| dataExport: "dataExport", | ||
| dataExport: "data.export", | ||
| chargePayment: "payment.execute", | ||
| writeProduction: "production.write", | ||
| accessSecrets: "secrets.access", | ||
| accessSecrets: "secret.read", | ||
| migrateDatabase: "database.migrate", | ||
@@ -14,0 +14,0 @@ publishArtifact: "artifact.publish", |
+3
-2
| { | ||
| "name": "@trigguard/intent-sdk", | ||
| "version": "0.1.2", | ||
| "version": "0.2.0", | ||
| "description": "Intent-oriented API: maps developer intents to execution surfaces; uses @trigguard/execution-sdk", | ||
@@ -18,2 +18,3 @@ "type": "module", | ||
| "build": "tsc -p tsconfig.json", | ||
| "prepack": "npm run build", | ||
| "pretest": "npm run build", | ||
@@ -24,3 +25,3 @@ "test": "node --test test/*.test.mjs", | ||
| "dependencies": { | ||
| "@trigguard/execution-sdk": "*" | ||
| "@trigguard/execution-sdk": "^0.1.3" | ||
| }, | ||
@@ -27,0 +28,0 @@ "devDependencies": { |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
23153
247.02%14
75%369
334.12%1
-50%1
Infinity%1
Infinity%