@agent-surface/core 0.16.0 → 0.17.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 +2 -2
- package/dist/explain.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +331 -59
- package/dist/index.js.map +1 -1
- package/dist/{registry-CWjIFWHV.d.ts → registry-QvbeJMRD.d.ts} +21 -29
- package/package.json +2 -2
|
@@ -720,7 +720,7 @@ type AgentCapabilityDescriptorUnion = AgentObservationDescriptor | AgentActionDe
|
|
|
720
720
|
declare function matchesScope(type: string, scope: string[] | undefined): boolean;
|
|
721
721
|
|
|
722
722
|
/** Contract format emitted by @agent-surface/compiler. */
|
|
723
|
-
declare const CAPABILITY_CONTRACT_FORMAT_VERSION:
|
|
723
|
+
declare const CAPABILITY_CONTRACT_FORMAT_VERSION: 4;
|
|
724
724
|
type CapabilityContractKind = "observation" | "action" | "procedure" | "external";
|
|
725
725
|
interface CapabilityPolicyAttachment {
|
|
726
726
|
name: string;
|
|
@@ -758,22 +758,12 @@ interface CapabilityContractManifest {
|
|
|
758
758
|
/** sha256 of the canonical manifest payload without this field. */
|
|
759
759
|
hash: string;
|
|
760
760
|
}
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
761
|
+
declare const CAPABILITY_AUTHORITY_TYPE: unique symbol;
|
|
762
|
+
/** Immutable runtime source of truth. Only objects minted here are accepted. */
|
|
763
|
+
interface CapabilityAuthority {
|
|
764
|
+
readonly manifest: CapabilityContractManifest;
|
|
765
|
+
readonly [CAPABILITY_AUTHORITY_TYPE]: true;
|
|
766
766
|
}
|
|
767
|
-
interface CompiledComponentProvenance {
|
|
768
|
-
manifestHash: string;
|
|
769
|
-
declarationId: string;
|
|
770
|
-
capabilities: Record<string, CompiledCapabilityToken>;
|
|
771
|
-
}
|
|
772
|
-
/** Shared across duplicate copies of core in a bundle. Not enumerable/serializable. */
|
|
773
|
-
declare const COMPILED_CAPABILITY_PROVENANCE: unique symbol;
|
|
774
|
-
type ProvenanceCarrier = {
|
|
775
|
-
[COMPILED_CAPABILITY_PROVENANCE]?: CompiledComponentProvenance | CompiledCapabilityToken;
|
|
776
|
-
};
|
|
777
767
|
interface AgentObservationContract<TOut extends JsonValue> {
|
|
778
768
|
description: string;
|
|
779
769
|
output: AgentSchema<TOut>;
|
|
@@ -848,7 +838,7 @@ interface AgentComponentContract<TObservations extends Record<string, AgentObser
|
|
|
848
838
|
* Compiler macro. The second argument is injected by @agent-surface/compiler;
|
|
849
839
|
* author code must never supply it.
|
|
850
840
|
*/
|
|
851
|
-
declare function defineAgentComponentContract<TObservations extends Record<string, AgentObservationContract<any>> = Record<never, never>, TActions extends Record<string, AgentActionContract<any, any>> = Record<never, never>>(definition: AgentComponentContractDefinition<TObservations, TActions
|
|
841
|
+
declare function defineAgentComponentContract<TObservations extends Record<string, AgentObservationContract<any>> = Record<never, never>, TActions extends Record<string, AgentActionContract<any, any>> = Record<never, never>>(definition: AgentComponentContractDefinition<TObservations, TActions>): AgentComponentContract<TObservations, TActions>;
|
|
852
842
|
interface ExternalAgentToolContractDefinition<TIn extends JsonValue, TOut extends JsonValue> {
|
|
853
843
|
id: string;
|
|
854
844
|
description: string;
|
|
@@ -869,17 +859,16 @@ interface AgentProcedureContractDefinition<TIn extends JsonValue, TOut extends J
|
|
|
869
859
|
policies?: CapabilityPolicyAttachment[];
|
|
870
860
|
tags?: string[];
|
|
871
861
|
}
|
|
872
|
-
interface AgentProcedureContract<TIn extends JsonValue, TOut extends JsonValue>
|
|
862
|
+
interface AgentProcedureContract<TIn extends JsonValue, TOut extends JsonValue> {
|
|
873
863
|
readonly kind: "agent-procedure-contract";
|
|
874
864
|
readonly definition: AgentProcedureContractDefinition<TIn, TOut>;
|
|
875
865
|
}
|
|
876
|
-
declare function defineAgentProcedureContract<TIn extends JsonValue, TOut extends JsonValue = JsonValue>(definition: AgentProcedureContractDefinition<TIn, TOut
|
|
866
|
+
declare function defineAgentProcedureContract<TIn extends JsonValue, TOut extends JsonValue = JsonValue>(definition: AgentProcedureContractDefinition<TIn, TOut>): AgentProcedureContract<TIn, TOut>;
|
|
877
867
|
interface CompiledExternalAgentTool<TIn extends JsonValue = JsonValue, TOut extends JsonValue = JsonValue> {
|
|
878
868
|
name: string;
|
|
879
869
|
description: string;
|
|
880
870
|
inputSchema: JsonSchema;
|
|
881
871
|
execute(input: TIn): TOut | Promise<TOut>;
|
|
882
|
-
[COMPILED_CAPABILITY_PROVENANCE]: CompiledCapabilityToken;
|
|
883
872
|
}
|
|
884
873
|
interface ExternalAgentToolContract<TIn extends JsonValue, TOut extends JsonValue> {
|
|
885
874
|
readonly kind: "external-agent-tool-contract";
|
|
@@ -888,16 +877,19 @@ interface ExternalAgentToolContract<TIn extends JsonValue, TOut extends JsonValu
|
|
|
888
877
|
execute(input: TIn): TOut | Promise<TOut>;
|
|
889
878
|
}): CompiledExternalAgentTool<TIn, TOut>;
|
|
890
879
|
}
|
|
891
|
-
declare function defineExternalAgentToolContract<TIn extends JsonValue, TOut extends JsonValue = JsonValue>(definition: ExternalAgentToolContractDefinition<TIn, TOut
|
|
892
|
-
|
|
893
|
-
declare function
|
|
894
|
-
/**
|
|
895
|
-
declare function
|
|
880
|
+
declare function defineExternalAgentToolContract<TIn extends JsonValue, TOut extends JsonValue = JsonValue>(definition: ExternalAgentToolContractDefinition<TIn, TOut>): ExternalAgentToolContract<TIn, TOut>;
|
|
881
|
+
/** Preserve compiler proof while an adapter replaces handlers with latest-ref delegates. */
|
|
882
|
+
declare function deriveAgentComponentBinding(source: AgentComponentDefinition, derived: AgentComponentDefinition): AgentComponentDefinition;
|
|
883
|
+
/** Bind a compiled procedure contract to its contextual runtime definition. */
|
|
884
|
+
declare function authorizeAgentProcedureBinding(contract: AgentProcedureContract<any, any>, definition: AgentComponentDefinition): AgentComponentDefinition;
|
|
885
|
+
declare function createCapabilityAuthority(manifest: CapabilityContractManifest): CapabilityAuthority;
|
|
886
|
+
/** Mandatory runtime authority check used by every registry registration. */
|
|
887
|
+
declare function assertDefinitionAuthorized(definition: AgentComponentDefinition, authority: CapabilityAuthority): void;
|
|
896
888
|
interface AgentExposureGateway {
|
|
897
889
|
expose<T extends CompiledExternalAgentTool>(tools: readonly T[]): T[];
|
|
898
890
|
}
|
|
899
891
|
/** Final provider/MCP boundary: arbitrary tool objects cannot pass. */
|
|
900
|
-
declare function createAgentExposureGateway(
|
|
892
|
+
declare function createAgentExposureGateway(authority: CapabilityAuthority): AgentExposureGateway;
|
|
901
893
|
|
|
902
894
|
interface RegistrationCandidate {
|
|
903
895
|
definition: AgentComponentDefinition;
|
|
@@ -923,8 +915,8 @@ interface RegistryOptions {
|
|
|
923
915
|
limits?: Partial<AgentSurfaceLimits>;
|
|
924
916
|
/** Injectable clock (docs/08 determinism); default Date.now. */
|
|
925
917
|
now?: () => number;
|
|
926
|
-
/** Compiler-generated runtime
|
|
927
|
-
|
|
918
|
+
/** Compiler-generated runtime source of truth. Required outside repository tests. */
|
|
919
|
+
authority?: CapabilityAuthority;
|
|
928
920
|
}
|
|
929
921
|
interface AgentRegistrationHandle {
|
|
930
922
|
readonly registrationId: string;
|
|
@@ -956,4 +948,4 @@ interface AgentSurfaceRegistry {
|
|
|
956
948
|
}
|
|
957
949
|
declare function createAgentSurfaceRegistry(options?: RegistryOptions): AgentSurfaceRegistry;
|
|
958
950
|
|
|
959
|
-
export { type AgentSurfaceLimits as $, type AgentRouteInfo as A, type AgentObservationContract as B, type AgentObservationDefinition as C, type DiscoveryDecision as D, type AgentObservationDescriptor as E, type AgentPolicy as F, type AgentPolicyContext as G, type AgentProcedureBinding as H, type AgentProcedureBindingRuntimeConfig as I, type JsonSchema as J, type AgentProcedureContract as K, type AgentProcedureContractDefinition as L, type AgentProcedureDescriptor as M, type AgentProcedureEffect as N, type AgentProcedureExecutor as O, type AgentProcedureRefDescriptor as P, type AgentReadContext as Q, type AgentRegistrationHandle as R, type SnapshotContext as S, type AgentSchema as T, type Unsubscribe as U, AgentSchemaError as V, type AgentSchemaIssue as W, AgentSurfaceDefinitionError as X, type AgentSurfaceDefinitionErrorCode as Y, AgentSurfaceError as Z, type AgentSurfaceEvent as _, type AgentConsumer as a, type AgentSurfaceSnapshot as a0, type AuditEvent as a1, type AuditSink as a2, CAPABILITY_CONTRACT_FORMAT_VERSION as a3,
|
|
951
|
+
export { type AgentSurfaceLimits as $, type AgentRouteInfo as A, type AgentObservationContract as B, type AgentObservationDefinition as C, type DiscoveryDecision as D, type AgentObservationDescriptor as E, type AgentPolicy as F, type AgentPolicyContext as G, type AgentProcedureBinding as H, type AgentProcedureBindingRuntimeConfig as I, type JsonSchema as J, type AgentProcedureContract as K, type AgentProcedureContractDefinition as L, type AgentProcedureDescriptor as M, type AgentProcedureEffect as N, type AgentProcedureExecutor as O, type AgentProcedureRefDescriptor as P, type AgentReadContext as Q, type AgentRegistrationHandle as R, type SnapshotContext as S, type AgentSchema as T, type Unsubscribe as U, AgentSchemaError as V, type AgentSchemaIssue as W, AgentSurfaceDefinitionError as X, type AgentSurfaceDefinitionErrorCode as Y, AgentSurfaceError as Z, type AgentSurfaceEvent as _, type AgentConsumer as a, type AgentSurfaceSnapshot as a0, type AuditEvent as a1, type AuditSink as a2, CAPABILITY_CONTRACT_FORMAT_VERSION as a3, CONFIRMATION_ESCALATION as a4, type CapabilityAuthority as a5, type CapabilityContractEntry as a6, type CapabilityContractKind as a7, type CapabilityContractManifest as a8, type CapabilityPolicyAttachment as a9, defineAgentComponentContract as aA, defineAgentProcedureContract as aB, defineExternalAgentToolContract as aC, deriveAgentComponentBinding as aD, emptyObjectSchema as aE, environment as aF, evaluateDiscovery as aG, fromJsonSchema as aH, fromStandardSchema as aI, hasPermission as aJ, isAgentSurfaceError as aK, memoryAuditSink as aL, observation as aM, observationContract as aN, rateLimit as aO, requireConfirmation as aP, tenantBoundary as aQ, validateComponentDefinition as aR, validateJsonSchemaDocument as aS, validateValueAgainstSchema as aT, type CompiledExternalAgentTool as aa, type ConfirmationController as ab, type ConfirmationEscalation as ac, DEFAULT_LIMITS as ad, type ExternalAgentToolContract as ae, type ExternalAgentToolContractDefinition as af, type ExternalCapabilityContractDigest as ag, type InvokeOptions as ah, type PendingConfirmation as ai, type PreconditionFailure as aj, type ProcedureCallInfo as ak, type RegistrationCandidate as al, type RegistryOptions as am, type StandardSchemaV1 as an, action as ao, actionContract as ap, assertDefinitionAuthorized as aq, audit as ar, authenticated as as, authorizeAgentProcedureBinding as at, composeInvokeChain as au, consoleAuditSink as av, createAgentExposureGateway as aw, createAgentSurfaceRegistry as ax, createCapabilityAuthority as ay, defineAgentComponent as az, type AgentSurfaceRegistry as b, type JsonValue as c, type AgentInvocationResult as d, AGENT_CAPABILITY_ERROR_CODES as e, type AgentActionContext as f, type AgentActionContract as g, type AgentActionDefinition as h, type AgentActionDescriptor as i, type AgentAuthorizationContext as j, type AgentCapabilityDescriptorUnion as k, type AgentCapabilityErrorCode as l, matchesScope as m, type AgentCapabilityErrorPayload as n, type AgentComponentContract as o, type AgentComponentContractDefinition as p, type AgentComponentDefinition as q, type AgentComponentDescriptor as r, type AgentComponentRuntimeBindings as s, type AgentConcurrency as t, type AgentEffect as u, type AgentEnvironment as v, type AgentErrorRetry as w, type AgentExposureGateway as x, type AgentInvocation as y, type AgentInvocationPolicyContext as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-surface/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "Framework-agnostic registry, types, policies, errors, snapshot, invocation for frontend agent surfaces",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"size-limit": [
|
|
59
59
|
{
|
|
60
60
|
"path": "dist/index.js",
|
|
61
|
-
"limit": "
|
|
61
|
+
"limit": "22 kB"
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
"path": "dist/explain.js",
|