SharedOS API / @aicoo/sharedos-contracts
@aicoo/sharedos-contracts
Strict, JSON-safe SharedOS protocol schemas and TypeScript types.
npm install @aicoo/sharedos-contracts@next
Use this package for addresses, capabilities, messages, resources, tools, runtime manifests/events/outcomes, execution results, and HTTP wire contracts. External boundaries should parse untrusted values with the exported schemas rather than relying on type casts.
Tool definitions include a logical namespace, source, read/write catalog class,
and exact capability requirement. Access contexts carry the trusted effective
namespace selection; ToolNamespaceUpdateSchema defines portable, idempotent
enable/disable patches.
SharedOS is currently an 0.x prerelease.
Interfaces
JsonObject
Defined in: json.ts:4
Indexable
[
key:string]:JsonValue
Type Aliases
AccessContext
AccessContext =
z.infer<typeofAccessContextSchema>>
Defined in: access.ts:30
Address
Address =
z.infer<typeofAddressSchema>>
Defined in: address.ts:33
AgentAddress
AgentAddress =
z.infer<typeofAgentAddressSchema>>
Defined in: address.ts:13
AgentCard
AgentCard =
z.infer<typeofAgentCardSchema>>
Defined in: card.ts:107
AgentCardView
AgentCardView =
z.infer<typeofAgentCardViewSchema>>
Defined in: card.ts:31
AuthorizationDecision
AuthorizationDecision =
z.infer<typeofAuthorizationDecisionSchema>>
Defined in: access.ts:72
Capability
Capability =
z.infer<typeofCapabilitySchema>>
Defined in: capability.ts:46
CapabilityConstraints
CapabilityConstraints =
z.infer<typeofCapabilityConstraintsSchema>>
Defined in: capability.ts:71
CapabilityGrant
CapabilityGrant =
z.infer<typeofCapabilityGrantSchema>>
Defined in: capability.ts:142
CapabilityRequest
CapabilityRequest =
z.infer<typeofCapabilityRequestSchema>>
Defined in: capability.ts:104
CapabilityRequirement
CapabilityRequirement =
z.infer<typeofCapabilityRequirementSchema>>
Defined in: capability.ts:152
ContextCapsule
ContextCapsule =
z.infer<typeofContextCapsuleSchema>>
Defined in: context-capsule.ts:99
ContextCapsuleItem
ContextCapsuleItem =
z.infer<typeofContextCapsuleItemSchema>>
Defined in: context-capsule.ts:87
ContextCapsuleItemKind
ContextCapsuleItemKind = typeof
CONTEXT_CAPSULE_ITEM_KINDS[number]
Defined in: context-capsule.ts:46
ContextCapsulePreview
ContextCapsulePreview =
z.infer<typeofContextCapsulePreviewSchema>>
Defined in: context-capsule.ts:124
ContextCapsulePreviewItem
ContextCapsulePreviewItem =
z.infer<typeofContextCapsulePreviewItemSchema>>
Defined in: context-capsule.ts:125
ContextCapsuleValidation
ContextCapsuleValidation = {
ok:true;value:ContextCapsule; } | {error:ProtocolError;ok:false; }
Defined in: context-capsule.ts:127
EnabledToolNamespaces
EnabledToolNamespaces =
z.infer<typeofEnabledToolNamespacesSchema>>
Defined in: tool.ts:63
Escalation
Escalation =
z.infer<typeofEscalationSchema>>
Defined in: execution.ts:93
ExecutionEvent
ExecutionEvent =
z.infer<typeofExecutionEventSchema>>
Defined in: execution.ts:56
ExecutionOptions
ExecutionOptions =
z.infer<typeofExecutionOptionsSchema>>
Defined in: execution.ts:23
ExecutionRequest
ExecutionRequest =
z.infer<typeofExecutionRequestSchema>>
Defined in: execution.ts:40
ExecutionResult
ExecutionResult =
z.infer<typeofExecutionResultSchema>>
Defined in: execution.ts:128
GroupAddress
GroupAddress =
z.infer<typeofGroupAddressSchema>>
Defined in: address.ts:18
HumanAddress
HumanAddress =
z.infer<typeofHumanAddressSchema>>
Defined in: address.ts:8
Identifier
Identifier =
z.infer<typeofIdentifierSchema>>
Defined in: common.ts:9
JsonArray
JsonArray =
JsonValue[]
Defined in: json.ts:7
JsonPrimitive
JsonPrimitive =
string|number|boolean|null
Defined in: json.ts:3
JsonValue
JsonValue =
JsonPrimitive|JsonObject|JsonArray
Defined in: json.ts:8
MessageDeliveryResult
MessageDeliveryResult =
z.infer<typeofMessageDeliveryResultSchema>>
Defined in: message.ts:94
MessageEnvelope
MessageEnvelope =
z.infer<typeofMessageEnvelopeSchema>>
Defined in: message.ts:41
MessageProvenance
MessageProvenance =
z.infer<typeofMessageProvenanceSchema>>
Defined in: message.ts:20
MessageRequestArguments
MessageRequestArguments =
z.infer<typeofMessageRequestArgumentsSchema>>
Defined in: message.ts:72
ProtocolError
ProtocolError =
z.infer<typeofProtocolErrorSchema>>
Defined in: protocol-error.ts:16
ProtocolVersion
ProtocolVersion =
z.infer<typeofProtocolVersionSchema>>
Defined in: common.ts:5
PublishedToolAnnotations
PublishedToolAnnotations =
z.infer<typeofPublishedToolAnnotationsSchema>>
Defined in: tool.ts:164
PublishedToolDefinition
PublishedToolDefinition =
z.infer<typeofPublishedToolDefinitionSchema>>
Defined in: tool.ts:200
PublishedToolMetadata
PublishedToolMetadata =
z.infer<typeofPublishedToolMetadataSchema>>
Defined in: tool.ts:173
ReachResult
ReachResult =
z.infer<typeofReachResultSchema>>
Defined in: capability.ts:211
ReachSummary
ReachSummary =
z.infer<typeofReachSummarySchema>>
Defined in: card.ts:49
ReachUnavailableReason
ReachUnavailableReason =
z.infer<typeofReachUnavailableReasonSchema>>
Defined in: capability.ts:196
RemoteExecutionRequest
RemoteExecutionRequest =
z.infer<typeofRemoteExecutionRequestSchema>>
Defined in: http.ts:18
RemoteResourceOperation
RemoteResourceOperation =
z.infer<typeofRemoteResourceOperationSchema>>
Defined in: http.ts:11
ResourceOperation
ResourceOperation =
z.infer<typeofResourceOperationSchema>>
Defined in: resource.ts:21
ResourceReach
ResourceReach =
z.infer<typeofResourceReachSchema>>
Defined in: capability.ts:177
ResourceRef
ResourceRef =
z.infer<typeofResourceRefSchema>>
Defined in: capability.ts:35
ResourceResult
ResourceResult =
z.infer<typeofResourceResultSchema>>
Defined in: resource.ts:44
RuntimeEvent
RuntimeEvent =
z.infer<typeofRuntimeEventSchema>>
Defined in: runtime.ts:27
RuntimeManifest
RuntimeManifest =
z.infer<typeofRuntimeManifestSchema>>
Defined in: runtime.ts:17
RuntimeTurnOutcome
RuntimeTurnOutcome =
z.infer<typeofRuntimeTurnOutcomeSchema>>
Defined in: runtime.ts:59
ServiceAddress
ServiceAddress =
z.infer<typeofServiceAddressSchema>>
Defined in: address.ts:23
SharedOSApiErrorResponse
SharedOSApiErrorResponse =
z.infer<typeofSharedOSApiErrorResponseSchema>>
Defined in: http.ts:39
SharedOSHealth
SharedOSHealth =
z.infer<typeofSharedOSHealthSchema>>
Defined in: http.ts:26
SharedOSToolCatalog
SharedOSToolCatalog =
z.infer<typeofSharedOSToolCatalogSchema>>
Defined in: tool.ts:237
Timestamp
Timestamp =
z.infer<typeofTimestampSchema>>
Defined in: common.ts:13
ToolAnnotations
ToolAnnotations =
z.infer<typeofToolAnnotationsSchema>>
Defined in: tool.ts:108
ToolCall
ToolCall =
z.infer<typeofToolCallSchema>>
Defined in: tool.ts:360
ToolClass
ToolClass =
z.infer<typeofToolClassSchema>>
Defined in: tool.ts:253
ToolDefinition
ToolDefinition =
z.infer<typeofToolDefinitionSchema>>
Defined in: tool.ts:142
ToolName
ToolName =
z.infer<typeofToolNameSchema>>
Defined in: tool.ts:35
ToolNamespace
ToolNamespace =
z.infer<typeofToolNamespaceSchema>>
Defined in: tool.ts:39
ToolNamespaceCatalog
ToolNamespaceCatalog =
z.infer<typeofToolNamespaceCatalogSchema>>
Defined in: tool.ts:348
ToolNamespaceDescriptor
ToolNamespaceDescriptor =
z.infer<typeofToolNamespaceDescriptorSchema>>
Defined in: tool.ts:310
ToolNamespaceUpdate
ToolNamespaceUpdate =
z.infer<typeofToolNamespaceUpdateSchema>>
Defined in: tool.ts:98
ToolPolicy
ToolPolicy =
z.infer<typeofToolPolicySchema>>
Defined in: tool.ts:291
ToolReadWrite
ToolReadWrite =
z.infer<typeofToolReadWriteSchema>>
Defined in: tool.ts:50
ToolResult
ToolResult =
z.infer<typeofToolResultSchema>>
Defined in: tool.ts:384
ToolSource
ToolSource =
z.infer<typeofToolSourceSchema>>
Defined in: tool.ts:46
Variables
AccessContextSchema
constAccessContextSchema:ZodObject<{actor:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;authority:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;enabledToolNamespaces:ZodEffects<ZodArray<ZodString,"many">>,string[],string[]>;namespaceId:ZodString;now:ZodString;owner:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;purpose:ZodString;traceId:ZodString; },"strict",ZodTypeAny, {actor: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };authority: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };enabledToolNamespaces:string[];namespaceId:string;now:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;traceId:string; }, {actor: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };authority: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };enabledToolNamespaces:string[];namespaceId:string;now:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;traceId:string; }>
Defined in: access.ts:17
The identity, purpose, time, and tool-namespace inputs to a permission decision.
An access context deliberately carries no authority. Grants are loaded by the
kernel from a trusted GrantSource at the moment of the decision, so a
caller cannot present, extend, or replay authority by constructing a context.
AddressSchema
constAddressSchema:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>
Defined in: address.ts:26
A structured protocol address; no string suffix or prefix parsing is needed.
AGENT_CARD_VIEWS
constAGENT_CARD_VIEWS: readonly ["reach","identity","namespaces"]
Defined in: card.ts:27
The named shapes an agent card is served in.
A card is a view rather than a record, so these are not filters applied to one object on the way out: each name is a separate resource a reader is authorized for, and each answers a different question.
reach— identity together with the resources the subject can be asked about. This is the card the directory exists for.identity— the subject and nothing else. The narrowing that drops reach entirely, for a reader allowed to learn that an agent is addressable without learning what it holds.namespaces— identity together with which namespaces the subject reaches and how many entries in each, with no paths. A coarser answer thanreachand a distinct view for the reason ADR 0021 gives: projection is field-level, so a field that means something different depending on who reads it is the record shape a view exists to refuse.
Every view is bounded the same way. See AgentCardSchema.
AgentAddressSchema
constAgentAddressSchema:ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>
Defined in: address.ts:10
AgentCardSchema
constAgentCardSchema:ZodDiscriminatedUnion<"view", [ZodObject<{namespaceId:ZodString;reach:ZodArray<ZodObject<{actions:ZodArray<ZodString,"many">>;namespace:ZodString;path:ZodArray<ZodString,"many">>;scope:ZodEnum<["exact","descendants"]>; },"strict",ZodTypeAny, {actions:string[];namespace:string;path:string[];scope:"exact"|"descendants"; }, {actions:string[];namespace:string;path:string[];scope:"exact"|"descendants"; }>,"many">>;readAt:ZodString;subject:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;view:ZodLiteral<"reach">>; },"strict",ZodTypeAny, {namespaceId:string;reach:object[];readAt:string;subject: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };view:"reach"; }, {namespaceId:string;reach:object[];readAt:string;subject: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };view:"reach"; }>,ZodObject<{namespaceId:ZodString;readAt:ZodString;subject:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;view:ZodLiteral<"identity">>; },"strict",ZodTypeAny, {namespaceId:string;readAt:string;subject: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };view:"identity"; }, {namespaceId:string;readAt:string;subject: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };view:"identity"; }>,ZodObject<{namespaceId:ZodString;namespaces:ZodArray<ZodObject<{actions:ZodArray<ZodString,"many">>;entries:ZodNumber;namespace:ZodString; },"strict",ZodTypeAny, {actions:string[];entries:number;namespace:string; }, {actions:string[];entries:number;namespace:string; }>,"many">>;readAt:ZodString;subject:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;view:ZodLiteral<"namespaces">>; },"strict",ZodTypeAny, {namespaceId:string;namespaces:object[];readAt:string;subject: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };view:"namespaces"; }, {namespaceId:string;namespaces:object[];readAt:string;subject: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };view:"namespaces"; }>]>
Defined in: card.ts:89
The kernel's description of one agent: identity, computed reach, and nothing a product would want to put beside them.
Reach is derived when the card is read, from the grants in force at that instant, and is never stored. A stored reach would be the one description of authority in SharedOS that nothing invalidates: revocation, purpose withdrawal, expiry and a spent budget all work by not matching at the next decision, and a column is outside all of them.
A card is bounded by one authority and one world. It shows what the subject reaches under the authority the reader is operating under, inside the reader's namespace — not the subject's whole life. It is therefore a lower bound on truth and never an upper one, which is what makes it safe to serve to a model: it omits authority the reader's authority did not issue, and an over-wide entry permits nothing because every operation is authorized independently.
Display names, avatars, handles, skills and protocol bindings are absent on purpose. The test is not whether a field is useful but whether it is authority: reach is what the kernel decides against, and a display name is not. A host composes those around this answer. See ADR 0021.
AgentCardViewSchema
constAgentCardViewSchema:ZodEnum<["reach","identity","namespaces"]>
Defined in: card.ts:29
AuthorizationDecisionSchema
constAuthorizationDecisionSchema:ZodObject<{allowed:ZodBoolean;matchedGrantId:ZodOptional<ZodString>>;metadata:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;reasonCode:ZodString;requiredAuthority:ZodOptional<ZodObject<{capabilities:ZodArray<ZodObject<{actions:ZodArray<ZodString,"many">>;resource:ZodObject<{namespace:ZodString;owner:ZodOptional<...>;path:ZodArray<..., ...>; },"strict",ZodTypeAny, {namespace:string;owner?: ... | ... | ... | ... | ...;path: ...[]; }, {namespace:string;owner?: ... | ... | ... | ... | ...;path: ...[]; }>;scope:ZodEnum<["exact","descendants"]>; },"strict",ZodTypeAny, {actions:string[];resource: {namespace:string;owner?: {kind: ...;userId: ...; } | {agentId: ...;kind: ...; } | {conversationId: ...;kind: ...; } | {kind: ...;serviceId: ...; };path:string[]; };scope:"exact"|"descendants"; }, {actions:string[];resource: {namespace:string;owner?: {kind: ...;userId: ...; } | {agentId: ...;kind: ...; } | {conversationId: ...;kind: ...; } | {kind: ...;serviceId: ...; };path:string[]; };scope:"exact"|"descendants"; }>,"many">>;constraints:ZodOptional<ZodEffects<ZodObject<{delegationDepth:ZodOptional<ZodNumber>>;expiresAt:ZodOptional<ZodString>>;maxUses:ZodOptional<ZodNumber>>;notBefore:ZodOptional<ZodString>>;purposes:ZodOptional<ZodArray<..., ...>>; },"strict",ZodTypeAny, {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?: ...[]; }, {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?: ...[]; }>, {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; }, {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; }>>;id:ZodString;metadata:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;namespaceId:ZodString;owner:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;purpose:ZodString;requestedAt:ZodString;requester:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>; },"strict",ZodTypeAny, {capabilities:object[];constraints?: {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; };id:string;metadata?:JsonObject;namespaceId:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;requestedAt:string;requester: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; }; }, {capabilities:object[];constraints?: {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; };id:string;metadata?:JsonObject;namespaceId:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;requestedAt:string;requester: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; }; }>>; },"strict",ZodTypeAny, {allowed:boolean;matchedGrantId?:string;metadata?:JsonObject;reasonCode:string;requiredAuthority?: {capabilities:object[];constraints?: {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; };id:string;metadata?:JsonObject;namespaceId:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;requestedAt:string;requester: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; }; }; }, {allowed:boolean;matchedGrantId?:string;metadata?:JsonObject;reasonCode:string;requiredAuthority?: {capabilities:object[];constraints?: {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; };id:string;metadata?:JsonObject;namespaceId:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;requestedAt:string;requester: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; }; }; }>
Defined in: access.ts:33
A portable explanation of one authorization check.
CapabilityConstraintsSchema
constCapabilityConstraintsSchema:ZodEffects<ZodObject<{delegationDepth:ZodOptional<ZodNumber>>;expiresAt:ZodOptional<ZodString>>;maxUses:ZodOptional<ZodNumber>>;notBefore:ZodOptional<ZodString>>;purposes:ZodOptional<ZodArray<ZodString,"many">>>>; },"strict",ZodTypeAny, {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; }, {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; }>, {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; }, {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; }>
Defined in: capability.ts:48
CapabilityGrantSchema
constCapabilityGrantSchema:ZodEffects<ZodObject<{capabilities:ZodArray<ZodObject<{actions:ZodArray<ZodString,"many">>;resource:ZodObject<{namespace:ZodString;owner:ZodOptional<ZodDiscriminatedUnion<"kind", [..., ..., ..., ...]>>;path:ZodArray<ZodString,"many">>; },"strict",ZodTypeAny, {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }, {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }>;scope:ZodEnum<["exact","descendants"]>; },"strict",ZodTypeAny, {actions:string[];resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; };scope:"exact"|"descendants"; }, {actions:string[];resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; };scope:"exact"|"descendants"; }>,"many">>;constraints:ZodEffects<ZodObject<{delegationDepth:ZodOptional<ZodNumber>>;expiresAt:ZodOptional<ZodString>>;maxUses:ZodOptional<ZodNumber>>;notBefore:ZodOptional<ZodString>>;purposes:ZodOptional<ZodArray<ZodString,"many">>>>; },"strict",ZodTypeAny, {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; }, {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; }>, {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; }, {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; }>;id:ZodString;issuedAt:ZodString;issuer:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;metadata:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;namespaceId:ZodString;parentGrantId:ZodOptional<ZodString>>;revokedAt:ZodOptional<ZodString>>;subject:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>; },"strict",ZodTypeAny, {capabilities:object[];constraints: {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; };id:string;issuedAt:string;issuer: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };metadata?:JsonObject;namespaceId:string;parentGrantId?:string;revokedAt?:string;subject: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; }; }, {capabilities:object[];constraints: {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; };id:string;issuedAt:string;issuer: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };metadata?:JsonObject;namespaceId:string;parentGrantId?:string;revokedAt?:string;subject: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; }; }>, {capabilities:object[];constraints: {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; };id:string;issuedAt:string;issuer: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };metadata?:JsonObject;namespaceId:string;parentGrantId?:string;revokedAt?:string;subject: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; }; }, {capabilities:object[];constraints: {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; };id:string;issuedAt:string;issuer: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };metadata?:JsonObject;namespaceId:string;parentGrantId?:string;revokedAt?:string;subject: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; }; }>
Defined in: capability.ts:118
Authority issued to one subject and bounded by explicit constraints.
A grant that was derived from another grant names its immediate ancestor in
parentGrantId. The link is a claim, not proof: SharedOS resolves and
validates the complete chain before the grant may authorize anything.
deriveGrant in @aicoo/sharedos-core is the supported way to produce one.
It only ever emits this single link: a chain embedded in the grant would be
provenance the presenter controls, and the ancestors are re-resolved from the
issuing store at every decision instead.
CapabilityRequestSchema
constCapabilityRequestSchema:ZodObject<{capabilities:ZodArray<ZodObject<{actions:ZodArray<ZodString,"many">>;resource:ZodObject<{namespace:ZodString;owner:ZodOptional<ZodDiscriminatedUnion<"kind", [ZodObject<..., ..., ..., ..., ...>,ZodObject<..., ..., ..., ..., ...>,ZodObject<..., ..., ..., ..., ...>,ZodObject<..., ..., ..., ..., ...>]>>;path:ZodArray<ZodString,"many">>; },"strict",ZodTypeAny, {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }, {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }>;scope:ZodEnum<["exact","descendants"]>; },"strict",ZodTypeAny, {actions:string[];resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; };scope:"exact"|"descendants"; }, {actions:string[];resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; };scope:"exact"|"descendants"; }>,"many">>;constraints:ZodOptional<ZodEffects<ZodObject<{delegationDepth:ZodOptional<ZodNumber>>;expiresAt:ZodOptional<ZodString>>;maxUses:ZodOptional<ZodNumber>>;notBefore:ZodOptional<ZodString>>;purposes:ZodOptional<ZodArray<ZodString,"many">>>>; },"strict",ZodTypeAny, {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; }, {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; }>, {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; }, {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; }>>;id:ZodString;metadata:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;namespaceId:ZodString;owner:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;purpose:ZodString;requestedAt:ZodString;requester:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>; },"strict",ZodTypeAny, {capabilities:object[];constraints?: {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; };id:string;metadata?:JsonObject;namespaceId:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;requestedAt:string;requester: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; }; }, {capabilities:object[];constraints?: {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; };id:string;metadata?:JsonObject;namespaceId:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;requestedAt:string;requester: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; }; }>
Defined in: capability.ts:90
A request for authority. A request is not itself proof of authority.
Two places produce one and none accepts one as input. A denial that matched no grant describes what would have satisfied it, and an escalation may carry that description on to whoever resolves it. Both are descriptions: turning one into usable authority is the host's issuing workflow, which ends in a grant the next turn loads (ADR 0019).
id, namespaceId, requester, owner, and requestedAt are minted by the
kernel from the trusted access context, whatever a caller wrote: a request
the caller authored would be a caller-chosen correlation for a decision the
kernel made. id is derived from the ask -- namespace, requester, owner,
purpose, constraints, capabilities -- rather than generated, so the same ask
describes itself the same way twice, and requestedAt is left out of it so
the identifier survives across turns.
CapabilityRequirementSchema
constCapabilityRequirementSchema:ZodObject<{action:ZodString;resource:ZodObject<{namespace:ZodString;owner:ZodOptional<ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>>;path:ZodArray<ZodString,"many">>; },"strict",ZodTypeAny, {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }, {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }>; },"strict",ZodTypeAny, {action:string;resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }; }, {action:string;resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }; }>
Defined in: capability.ts:145
The exact capability a tool invocation requires.
CapabilitySchema
constCapabilitySchema:ZodObject<{actions:ZodArray<ZodString,"many">>;resource:ZodObject<{namespace:ZodString;owner:ZodOptional<ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>>;path:ZodArray<ZodString,"many">>; },"strict",ZodTypeAny, {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }, {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }>;scope:ZodEnum<["exact","descendants"]>; },"strict",ZodTypeAny, {actions:string[];resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; };scope:"exact"|"descendants"; }, {actions:string[];resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; };scope:"exact"|"descendants"; }>
Defined in: capability.ts:38
A positive capability. SharedOS is deny-by-default when no grant matches.
CONTEXT_CAPSULE_ITEM_KINDS
constCONTEXT_CAPSULE_ITEM_KINDS: readonly ["requirement","diff","file_excerpt","error","test_output","decision","freeform"]
Defined in: context-capsule.ts:36
What a capsule item is, so a reviewer can judge it without reading it.
ContextCapsuleItemSchema
constContextCapsuleItemSchema:ZodObject<{content:ZodString;kind:ZodEnum<["requirement","diff","file_excerpt","error","test_output","decision","freeform"]>;label:ZodString;sha256:ZodString;sourcePath:ZodOptional<ZodString>>; },"strict",ZodTypeAny, {content:string;kind:"error"|"requirement"|"diff"|"file_excerpt"|"test_output"|"decision"|"freeform";label:string;sha256:string;sourcePath?:string; }, {content:string;kind:"error"|"requirement"|"diff"|"file_excerpt"|"test_output"|"decision"|"freeform";label:string;sha256:string;sourcePath?:string; }>
Defined in: context-capsule.ts:76
ContextCapsulePreviewItemSchema
constContextCapsulePreviewItemSchema:ZodObject<{contentBytes:ZodNumber;kind:ZodString;label:ZodString;sha256:ZodString;sourcePath:ZodOptional<ZodString>>; },"strict",ZodTypeAny, {contentBytes:number;kind:string;label:string;sha256:string;sourcePath?:string; }, {contentBytes:number;kind:string;label:string;sha256:string;sourcePath?:string; }>
Defined in: context-capsule.ts:101
ContextCapsulePreviewSchema
constContextCapsulePreviewSchema:ZodObject<{items:ZodArray<ZodObject<{contentBytes:ZodNumber;kind:ZodString;label:ZodString;sha256:ZodString;sourcePath:ZodOptional<ZodString>>; },"strict",ZodTypeAny, {contentBytes:number;kind:string;label:string;sha256:string;sourcePath?:string; }, {contentBytes:number;kind:string;label:string;sha256:string;sourcePath?:string; }>,"many">>;limitations:ZodArray<ZodString,"many">>;summary:ZodString; },"strict",ZodTypeAny, {items:object[];limitations:string[];summary:string; }, {items:object[];limitations:string[];summary:string; }>
Defined in: context-capsule.ts:116
The disclosure-free projection of a capsule. It contains every field a reviewer needs and no item content, so it is safe to render in an approval prompt, persist alongside a pending request, or send to a client.
ContextCapsuleSchema
constContextCapsuleSchema:ZodObject<{items:ZodArray<ZodObject<{content:ZodString;kind:ZodEnum<["requirement","diff","file_excerpt","error","test_output","decision","freeform"]>;label:ZodString;sha256:ZodString;sourcePath:ZodOptional<ZodString>>; },"strict",ZodTypeAny, {content:string;kind:"error"|"requirement"|"diff"|"file_excerpt"|"test_output"|"decision"|"freeform";label:string;sha256:string;sourcePath?:string; }, {content:string;kind:"error"|"requirement"|"diff"|"file_excerpt"|"test_output"|"decision"|"freeform";label:string;sha256:string;sourcePath?:string; }>,"many">>;limitations:ZodArray<ZodString,"many">>;objective:ZodString;summary:ZodString; },"strict",ZodTypeAny, {items:object[];limitations:string[];objective:string;summary:string; }, {items:object[];limitations:string[];objective:string;summary:string; }>
Defined in: context-capsule.ts:89
EnabledToolNamespacesSchema
constEnabledToolNamespacesSchema:ZodEffects<ZodArray<ZodString,"many">>,string[],string[]>
Defined in: tool.ts:52
EscalationSchema
constEscalationSchema:ZodObject<{reason:ZodString;requestedAt:ZodString;requestedAuthority:ZodOptional<ZodObject<{capabilities:ZodArray<ZodObject<{actions:ZodArray<ZodString,"many">>;resource:ZodObject<{namespace:ZodString;owner:ZodOptional<...>;path:ZodArray<..., ...>; },"strict",ZodTypeAny, {namespace:string;owner?: ... | ... | ... | ... | ...;path: ...[]; }, {namespace:string;owner?: ... | ... | ... | ... | ...;path: ...[]; }>;scope:ZodEnum<["exact","descendants"]>; },"strict",ZodTypeAny, {actions:string[];resource: {namespace:string;owner?: {kind: ...;userId: ...; } | {agentId: ...;kind: ...; } | {conversationId: ...;kind: ...; } | {kind: ...;serviceId: ...; };path:string[]; };scope:"exact"|"descendants"; }, {actions:string[];resource: {namespace:string;owner?: {kind: ...;userId: ...; } | {agentId: ...;kind: ...; } | {conversationId: ...;kind: ...; } | {kind: ...;serviceId: ...; };path:string[]; };scope:"exact"|"descendants"; }>,"many">>;constraints:ZodOptional<ZodEffects<ZodObject<{delegationDepth:ZodOptional<ZodNumber>>;expiresAt:ZodOptional<ZodString>>;maxUses:ZodOptional<ZodNumber>>;notBefore:ZodOptional<ZodString>>;purposes:ZodOptional<ZodArray<..., ...>>; },"strict",ZodTypeAny, {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?: ...[]; }, {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?: ...[]; }>, {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; }, {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; }>>;id:ZodString;metadata:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;namespaceId:ZodString;owner:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;purpose:ZodString;requestedAt:ZodString;requester:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>; },"strict",ZodTypeAny, {capabilities:object[];constraints?: {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; };id:string;metadata?:JsonObject;namespaceId:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;requestedAt:string;requester: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; }; }, {capabilities:object[];constraints?: {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; };id:string;metadata?:JsonObject;namespaceId:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;requestedAt:string;requester: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; }; }>>;reviewer:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;status:ZodLiteral<"pending">>; },"strict",ZodTypeAny, {reason:string;requestedAt:string;requestedAuthority?: {capabilities:object[];constraints?: {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; };id:string;metadata?:JsonObject;namespaceId:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;requestedAt:string;requester: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; }; };reviewer: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };status:"pending"; }, {reason:string;requestedAt:string;requestedAuthority?: {capabilities:object[];constraints?: {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?:string[]; };id:string;metadata?:JsonObject;namespaceId:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;requestedAt:string;requester: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; }; };reviewer: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };status:"pending"; }>
Defined in: execution.ts:70
A stopped turn awaiting a human decision.
This is a stub by design. SharedOS records that authority was asked for, who would decide it, and when -- and nothing else. It does not model review queues, approval tokens, or resumption, because granting authority is host-owned control-plane work and an escalation that could be resolved from inside a turn would be an escalation an agent could grant itself.
reviewer is assumed rather than resolved: it is the owner the turn already
runs on behalf of. A host with a real review roster substitutes its own.
ExecutionEventSchema
constExecutionEventSchema:ZodObject<{data:ZodType<JsonValue,ZodTypeDef,JsonValue>>;eventId:ZodString;executionId:ZodString;occurredAt:ZodString;sequence:ZodNumber;traceId:ZodString;type:ZodString;version:ZodLiteral<"1">>; },"strict",ZodTypeAny, {data:JsonValue;eventId:string;executionId:string;occurredAt:string;sequence:number;traceId:string;type:string;version:"1"; }, {data:JsonValue;eventId:string;executionId:string;occurredAt:string;sequence:number;traceId:string;type:string;version:"1"; }>
Defined in: execution.ts:43
An append-only event emitted while executing a request.
ExecutionOptionsSchema
constExecutionOptionsSchema:ZodObject<{maxSteps:ZodOptional<ZodNumber>>;maxToolCalls:ZodOptional<ZodNumber>>;timeoutMs:ZodOptional<ZodNumber>>; },"strict",ZodTypeAny, {maxSteps?:number;maxToolCalls?:number;timeoutMs?:number; }, {maxSteps?:number;maxToolCalls?:number;timeoutMs?:number; }>
Defined in: execution.ts:15
ExecutionRequestSchema
constExecutionRequestSchema:ZodObject<{agent:ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>;context:ZodObject<{actor:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;authority:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;enabledToolNamespaces:ZodEffects<ZodArray<ZodString,"many">>,string[],string[]>;namespaceId:ZodString;now:ZodString;owner:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;purpose:ZodString;traceId:ZodString; },"strict",ZodTypeAny, {actor: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };authority: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };enabledToolNamespaces:string[];namespaceId:string;now:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;traceId:string; }, {actor: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };authority: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };enabledToolNamespaces:string[];namespaceId:string;now:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;traceId:string; }>;executionId:ZodString;message:ZodObject<{createdAt:ZodString;id:ZodString;payload:ZodType<JsonValue,ZodTypeDef,JsonValue>>;provenance:ZodOptional<ZodObject<{metadata:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;parentIds:ZodArray<ZodString,"many">>;source:ZodString; },"strict",ZodTypeAny, {metadata?:JsonObject;parentIds:string[];source:string; }, {metadata?:JsonObject;parentIds:string[];source:string; }>>;purpose:ZodString;receiver:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;replyTo:ZodOptional<ZodString>>;sender:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;traceId:ZodString;version:ZodLiteral<"1">>; },"strict",ZodTypeAny, {createdAt:string;id:string;payload:JsonValue;provenance?: {metadata?:JsonObject;parentIds:string[];source:string; };purpose:string;receiver: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };replyTo?:string;sender: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };traceId:string;version:"1"; }, {createdAt:string;id:string;payload:JsonValue;provenance?: {metadata?:JsonObject;parentIds:string[];source:string; };purpose:string;receiver: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };replyTo?:string;sender: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };traceId:string;version:"1"; }>;metadata:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;options:ZodOptional<ZodObject<{maxSteps:ZodOptional<ZodNumber>>;maxToolCalls:ZodOptional<ZodNumber>>;timeoutMs:ZodOptional<ZodNumber>>; },"strict",ZodTypeAny, {maxSteps?:number;maxToolCalls?:number;timeoutMs?:number; }, {maxSteps?:number;maxToolCalls?:number;timeoutMs?:number; }>>;state:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;tools:ZodArray<ZodEffects<ZodObject<{annotations:ZodOptional<ZodObject<{destructive:ZodOptional<ZodBoolean>>;idempotent:ZodOptional<ZodBoolean>>;readOnly:ZodOptional<ZodBoolean>>; },"strict",ZodTypeAny, {destructive?:boolean;idempotent?:boolean;readOnly?:boolean; }, {destructive?:boolean;idempotent?:boolean;readOnly?:boolean; }>>;description:ZodString;inputSchema:ZodType<JsonObject,ZodTypeDef,JsonObject>>;metadata:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;name:ZodString;namespace:ZodString;outputSchema:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;readWrite:ZodEnum<["read","write"]>;requiredCapability:ZodObject<{action:ZodString;resource:ZodObject<{namespace:ZodString;owner:ZodOptional<...>;path:ZodArray<..., ...>; },"strict",ZodTypeAny, {namespace:string;owner?: ... | ... | ... | ... | ...;path: ...[]; }, {namespace:string;owner?: ... | ... | ... | ... | ...;path: ...[]; }>; },"strict",ZodTypeAny, {action:string;resource: {namespace:string;owner?: {kind: ...;userId: ...; } | {agentId: ...;kind: ...; } | {conversationId: ...;kind: ...; } | {kind: ...;serviceId: ...; };path:string[]; }; }, {action:string;resource: {namespace:string;owner?: {kind: ...;userId: ...; } | {agentId: ...;kind: ...; } | {conversationId: ...;kind: ...; } | {kind: ...;serviceId: ...; };path:string[]; }; }>;source:ZodString; },"strict",ZodTypeAny, {annotations?: {destructive?:boolean;idempotent?:boolean;readOnly?:boolean; };description:string;inputSchema:JsonObject;metadata?:JsonObject;name:string;namespace:string;outputSchema?:JsonObject;readWrite:"read"|"write";requiredCapability: {action:string;resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }; };source:string; }, {annotations?: {destructive?:boolean;idempotent?:boolean;readOnly?:boolean; };description:string;inputSchema:JsonObject;metadata?:JsonObject;name:string;namespace:string;outputSchema?:JsonObject;readWrite:"read"|"write";requiredCapability: {action:string;resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }; };source:string; }>, {annotations?: {destructive?:boolean;idempotent?:boolean;readOnly?:boolean; };description:string;inputSchema:JsonObject;metadata?:JsonObject;name:string;namespace:string;outputSchema?:JsonObject;readWrite:"read"|"write";requiredCapability: {action:string;resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }; };source:string; }, {annotations?: {destructive?:boolean;idempotent?:boolean;readOnly?:boolean; };description:string;inputSchema:JsonObject;metadata?:JsonObject;name:string;namespace:string;outputSchema?:JsonObject;readWrite:"read"|"write";requiredCapability: {action:string;resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }; };source:string; }>,"many">>;version:ZodLiteral<"1">>; },"strict",ZodTypeAny, {agent: {agentId:string;kind:"agent"; };context: {actor: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };authority: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };enabledToolNamespaces:string[];namespaceId:string;now:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;traceId:string; };executionId:string;message: {createdAt:string;id:string;payload:JsonValue;provenance?: {metadata?:JsonObject;parentIds:string[];source:string; };purpose:string;receiver: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };replyTo?:string;sender: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };traceId:string;version:"1"; };metadata?:JsonObject;options?: {maxSteps?:number;maxToolCalls?:number;timeoutMs?:number; };state?:JsonObject;tools:object[];version:"1"; }, {agent: {agentId:string;kind:"agent"; };context: {actor: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };authority: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };enabledToolNamespaces:string[];namespaceId:string;now:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;traceId:string; };executionId:string;message: {createdAt:string;id:string;payload:JsonValue;provenance?: {metadata?:JsonObject;parentIds:string[];source:string; };purpose:string;receiver: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };replyTo?:string;sender: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };traceId:string;version:"1"; };metadata?:JsonObject;options?: {maxSteps?:number;maxToolCalls?:number;timeoutMs?:number; };state?:JsonObject;tools:object[];version:"1"; }>
Defined in: execution.ts:26
One permission-controlled agent turn. Tick scheduling stays with the host.
ExecutionResultSchema
constExecutionResultSchema:ZodDiscriminatedUnion<"status", [ZodObject<object&object,"strict",ZodTypeAny, {completedAt:string;events:object[];executionId:string;metadata?:JsonObject;output:JsonValue;startedAt:string;status:"succeeded";traceId:string;version:"1"; }, {completedAt:string;events:object[];executionId:string;metadata?:JsonObject;output:JsonValue;startedAt:string;status:"succeeded";traceId:string;version:"1"; }>,ZodObject<object&object,"strict",ZodTypeAny, {completedAt:string;error: {code:string;details?:JsonObject;message:string;retryable?:boolean; };events:object[];executionId:string;metadata?:JsonObject;startedAt:string;status:"denied";traceId:string;version:"1"; }, {completedAt:string;error: {code:string;details?:JsonObject;message:string;retryable?:boolean; };events:object[];executionId:string;metadata?:JsonObject;startedAt:string;status:"denied";traceId:string;version:"1"; }>,ZodObject<object&object,"strict",ZodTypeAny, {completedAt:string;error: {code:string;details?:JsonObject;message:string;retryable?:boolean; };events:object[];executionId:string;metadata?:JsonObject;startedAt:string;status:"failed";traceId:string;version:"1"; }, {completedAt:string;error: {code:string;details?:JsonObject;message:string;retryable?:boolean; };events:object[];executionId:string;metadata?:JsonObject;startedAt:string;status:"failed";traceId:string;version:"1"; }>,ZodObject<object&object,"strict",ZodTypeAny, {completedAt:string;error?: {code:string;details?:JsonObject;message:string;retryable?:boolean; };events:object[];executionId:string;metadata?:JsonObject;startedAt:string;status:"cancelled";traceId:string;version:"1"; }, {completedAt:string;error?: {code:string;details?:JsonObject;message:string;retryable?:boolean; };events:object[];executionId:string;metadata?:JsonObject;startedAt:string;status:"cancelled";traceId:string;version:"1"; }>,ZodObject<object&object,"strict",ZodTypeAny, {completedAt:string;escalation: {reason:string;requestedAt:string;requestedAuthority?: {capabilities:object[];constraints?: {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?: ...[]; };id:string;metadata?:JsonObject;namespaceId:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;requestedAt:string;requester: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; }; };reviewer: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };status:"pending"; };events:object[];executionId:string;metadata?:JsonObject;startedAt:string;status:"escalated";traceId:string;version:"1"; }, {completedAt:string;escalation: {reason:string;requestedAt:string;requestedAuthority?: {capabilities:object[];constraints?: {delegationDepth?:number;expiresAt?:string;maxUses?:number;notBefore?:string;purposes?: ...[]; };id:string;metadata?:JsonObject;namespaceId:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;requestedAt:string;requester: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; }; };reviewer: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };status:"pending"; };events:object[];executionId:string;metadata?:JsonObject;startedAt:string;status:"escalated";traceId:string;version:"1"; }>]>
Defined in: execution.ts:105
GroupAddressSchema
constGroupAddressSchema:ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>
Defined in: address.ts:15
HumanAddressSchema
constHumanAddressSchema:ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>
Defined in: address.ts:5
IdentifierSchema
constIdentifierSchema:ZodString
Defined in: common.ts:8
An opaque identifier. Callers choose its format; SharedOS only requires stability.
JsonArraySchema
constJsonArraySchema:z.ZodType<JsonArray>>
Defined in: json.ts:28
JsonObjectSchema
constJsonObjectSchema:z.ZodType<JsonObject>>
Defined in: json.ts:27
JsonValueSchema
constJsonValueSchema:z.ZodType<JsonValue>>
Defined in: json.ts:16
Any value that can round-trip through JSON without custom serialization. In particular, this rejects undefined, bigint, Date, NaN, and Infinity.
MAX_CONTEXT_CAPSULE_CONTENT_BYTES
constMAX_CONTEXT_CAPSULE_CONTENT_BYTES:number
Defined in: context-capsule.ts:51
Combined item content, bounded separately from envelope overhead.
MAX_CONTEXT_CAPSULE_ENCODED_BYTES
constMAX_CONTEXT_CAPSULE_ENCODED_BYTES:number
Defined in: context-capsule.ts:49
Total encoded size of the capsule, so one delegation cannot become a dump.
MAX_CONTEXT_CAPSULE_ITEMS
constMAX_CONTEXT_CAPSULE_ITEMS:12=12
Defined in: context-capsule.ts:52
MAX_CONTEXT_CAPSULE_LIMITATIONS
constMAX_CONTEXT_CAPSULE_LIMITATIONS:12=12
Defined in: context-capsule.ts:53
MAX_EXECUTION_TIMEOUT_MS
constMAX_EXECUTION_TIMEOUT_MS:600000=600_000
Defined in: execution.ts:12
MAX_EXECUTION_TOOL_CALLS
constMAX_EXECUTION_TOOL_CALLS:10000=10_000
Defined in: execution.ts:13
MessageDeliveryResultSchema
constMessageDeliveryResultSchema:ZodDiscriminatedUnion<"status", [ZodObject<object&object,"strict",ZodTypeAny, {messageId:string;metadata?:JsonObject;status:"accepted";timestamp:string; }, {messageId:string;metadata?:JsonObject;status:"accepted";timestamp:string; }>,ZodObject<object&object,"strict",ZodTypeAny, {messageId:string;metadata?:JsonObject;status:"delivered";timestamp:string; }, {messageId:string;metadata?:JsonObject;status:"delivered";timestamp:string; }>,ZodObject<object&object,"strict",ZodTypeAny, {error: {code:string;details?:JsonObject;message:string;retryable?:boolean; };messageId:string;metadata?:JsonObject;status:"denied";timestamp:string; }, {error: {code:string;details?:JsonObject;message:string;retryable?:boolean; };messageId:string;metadata?:JsonObject;status:"denied";timestamp:string; }>,ZodObject<object&object,"strict",ZodTypeAny, {error: {code:string;details?:JsonObject;message:string;retryable?:boolean; };messageId:string;metadata?:JsonObject;status:"failed";timestamp:string; }, {error: {code:string;details?:JsonObject;message:string;retryable?:boolean; };messageId:string;metadata?:JsonObject;status:"failed";timestamp:string; }>]>
Defined in: message.ts:81
The transport-neutral outcome of submitting a message for delivery.
MessageEnvelopeSchema
constMessageEnvelopeSchema:ZodObject<{createdAt:ZodString;id:ZodString;payload:ZodType<JsonValue,ZodTypeDef,JsonValue>>;provenance:ZodOptional<ZodObject<{metadata:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;parentIds:ZodArray<ZodString,"many">>;source:ZodString; },"strict",ZodTypeAny, {metadata?:JsonObject;parentIds:string[];source:string; }, {metadata?:JsonObject;parentIds:string[];source:string; }>>;purpose:ZodString;receiver:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;replyTo:ZodOptional<ZodString>>;sender:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;traceId:ZodString;version:ZodLiteral<"1">>; },"strict",ZodTypeAny, {createdAt:string;id:string;payload:JsonValue;provenance?: {metadata?:JsonObject;parentIds:string[];source:string; };purpose:string;receiver: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };replyTo?:string;sender: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };traceId:string;version:"1"; }, {createdAt:string;id:string;payload:JsonValue;provenance?: {metadata?:JsonObject;parentIds:string[];source:string; };purpose:string;receiver: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };replyTo?:string;sender: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };traceId:string;version:"1"; }>
Defined in: message.ts:26
A message carries data and one host-bound purpose, never authority. Authority is supplied separately through AccessContext and evaluated at the point of use.
MessageProvenanceSchema
constMessageProvenanceSchema:ZodObject<{metadata:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;parentIds:ZodArray<ZodString,"many">>;source:ZodString; },"strict",ZodTypeAny, {metadata?:JsonObject;parentIds:string[];source:string; }, {metadata?:JsonObject;parentIds:string[];source:string; }>
Defined in: message.ts:12
Hop provenance a host may attach to an envelope. The kernel neither sets nor
reads it; see docs/open-items.md.
MessageRequestArgumentsSchema
constMessageRequestArgumentsSchema:ZodObject<{payload:ZodType<JsonValue,ZodTypeDef,JsonValue>>;recipient:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodEffects<ZodEffects<ZodString,string,string>>,string,string>>; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodEffects<ZodEffects<ZodString,string,string>>,string,string>>;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodEffects<ZodEffects<ZodString,string,string>>,string,string>>;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodEffects<ZodEffects<ZodString,string,string>>,string,string>>; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>; },"strict",ZodTypeAny, {payload:JsonValue;recipient: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; }; }, {payload:JsonValue;recipient: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; }; }>
Defined in: message.ts:65
The complete and intentionally narrow message input a model may author.
PathSegmentSchema
constPathSegmentSchema:ZodString
Defined in: capability.ts:15
One opaque resource-path segment.
Separators, traversal markers, and control characters are rejected here so every host receives the same canonical path vocabulary. Filesystem-backed providers must still resolve beneath their configured root and reject symlink escapes.
ProtocolErrorSchema
constProtocolErrorSchema:ZodObject<{code:ZodString;details:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;message:ZodString;retryable:ZodOptional<ZodBoolean>>; },"strict",ZodTypeAny, {code:string;details?:JsonObject;message:string;retryable?:boolean; }, {code:string;details?:JsonObject;message:string;retryable?:boolean; }>
Defined in: protocol-error.ts:7
A machine-readable error that is safe to return over npm and HTTP APIs.
ProtocolVersionSchema
constProtocolVersionSchema:ZodLiteral<"1">>
Defined in: common.ts:4
The wire protocol version implemented by this package.
PublishedToolAnnotationsSchema
constPublishedToolAnnotationsSchema:ZodObject<{destructiveHint:ZodOptional<ZodBoolean>>;idempotentHint:ZodOptional<ZodBoolean>>;openWorldHint:ZodOptional<ZodBoolean>>;readOnlyHint:ZodOptional<ZodBoolean>>; },"strict",ZodTypeAny, {destructiveHint?:boolean;idempotentHint?:boolean;openWorldHint?:boolean;readOnlyHint?:boolean; }, {destructiveHint?:boolean;idempotentHint?:boolean;openWorldHint?:boolean;readOnlyHint?:boolean; }>
Defined in: tool.ts:156
MCP tool annotation hints, in the vocabulary a harness receives them in.
These are the same three facts ToolAnnotationsSchema carries, renamed to the MCP wire spelling. They stay a separate type rather than a rename at the edge because they are a hint surface: advisory metadata a model may use to decide how to call a tool, and never an authorization input on either side of the boundary.
openWorldHint has no SharedOS equivalent and is therefore never emitted.
Inventing a value for it would put an unfixed field into catalogHash.
PublishedToolDefinitionSchema
constPublishedToolDefinitionSchema:ZodObject<{annotations:ZodOptional<ZodObject<{destructiveHint:ZodOptional<ZodBoolean>>;idempotentHint:ZodOptional<ZodBoolean>>;openWorldHint:ZodOptional<ZodBoolean>>;readOnlyHint:ZodOptional<ZodBoolean>>; },"strict",ZodTypeAny, {destructiveHint?:boolean;idempotentHint?:boolean;openWorldHint?:boolean;readOnlyHint?:boolean; }, {destructiveHint?:boolean;idempotentHint?:boolean;openWorldHint?:boolean;readOnlyHint?:boolean; }>>;description:ZodString;inputSchema:ZodType<JsonObject,ZodTypeDef,JsonObject>>;metadata:ZodOptional<ZodObject<{namespace:ZodOptional<ZodString>>;source:ZodOptional<ZodString>>; },"strict",ZodTypeAny, {namespace?:string;source?:string; }, {namespace?:string;source?:string; }>>;name:ZodString;outputSchema:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>; },"strict",ZodTypeAny, {annotations?: {destructiveHint?:boolean;idempotentHint?:boolean;openWorldHint?:boolean;readOnlyHint?:boolean; };description:string;inputSchema:JsonObject;metadata?: {namespace?:string;source?:string; };name:string;outputSchema?:JsonObject; }, {annotations?: {destructiveHint?:boolean;idempotentHint?:boolean;openWorldHint?:boolean;readOnlyHint?:boolean; };description:string;inputSchema:JsonObject;metadata?: {namespace?:string;source?:string; };name:string;outputSchema?:JsonObject; }>
Defined in: tool.ts:190
Everything a model or harness is allowed to see about one tool.
This is the projection SharedOS publishes across the MCP boundary, and it is
defined by what it omits. requiredCapability, resolveRequirement, grants,
issuing authority, namespace settings, credentials, and handler references do
not appear here and never cross the boundary: a harness receives the operation
surface, and SharedOS keeps the authority.
name is the canonical SharedOS tool ID and is simultaneously the raw MCP
Tool.name. There is deliberately no second identity field. A published
catalogue with two names for one tool is a catalogue where authorization and
discovery can disagree, and ToolNameSchema exists precisely so the
canonical name is always carriable as-is.
PublishedToolMetadataSchema
constPublishedToolMetadataSchema:ZodObject<{namespace:ZodOptional<ZodString>>;source:ZodOptional<ZodString>>; },"strict",ZodTypeAny, {namespace?:string;source?:string; }, {namespace?:string;source?:string; }>
Defined in: tool.ts:167
Catalogue provenance a harness may see. Metadata, never proof of authority.
ReachListSchema
constReachListSchema:ZodArray<ZodObject<{actions:ZodArray<ZodString,"many">>;namespace:ZodString;path:ZodArray<ZodString,"many">>;scope:ZodEnum<["exact","descendants"]>; },"strict",ZodTypeAny, {actions:string[];namespace:string;path:string[];scope:"exact"|"descendants"; }, {actions:string[];namespace:string;path:string[];scope:"exact"|"descendants"; }>,"many">>
Defined in: capability.ts:180
As many entries as one reach may carry, on a card or on the wire.
ReachResultSchema
constReachResultSchema:ZodDiscriminatedUnion<"status", [ZodObject<{reach:ZodArray<ZodObject<{actions:ZodArray<ZodString,"many">>;namespace:ZodString;path:ZodArray<ZodString,"many">>;scope:ZodEnum<["exact","descendants"]>; },"strict",ZodTypeAny, {actions:string[];namespace:string;path:string[];scope:"exact"|"descendants"; }, {actions:string[];namespace:string;path:string[];scope:"exact"|"descendants"; }>,"many">>;status:ZodLiteral<"computed">>; },"strict",ZodTypeAny, {reach:object[];status:"computed"; }, {reach:object[];status:"computed"; }>,ZodObject<{reasonCode:ZodEnum<["authority_unavailable","usage_store_unavailable"]>;status:ZodLiteral<"unavailable">>; },"strict",ZodTypeAny, {reasonCode:"authority_unavailable"|"usage_store_unavailable";status:"unavailable"; }, {reasonCode:"authority_unavailable"|"usage_store_unavailable";status:"unavailable"; }>]>
Defined in: capability.ts:207
What asking for a reach answers.
computed carries the reachable surface, possibly empty: a context that can
authorize nothing reaches nothing, and that is a true answer. unavailable
means no answer could be established, and says why in the vocabulary a denial
uses. The shape crosses the HTTP boundary unchanged, so a remote caller reads
the same result an embedded host does.
ReachSummarySchema
constReachSummarySchema:ZodObject<{actions:ZodArray<ZodString,"many">>;entries:ZodNumber;namespace:ZodString; },"strict",ZodTypeAny, {actions:string[];entries:number;namespace:string; }, {actions:string[];entries:number;namespace:string; }>
Defined in: card.ts:41
One namespace the subject reaches, and how much of it, without paths.
entries counts the reach entries collapsed into this row, not resources: a
single descendants entry over a whole tree counts once, exactly as it
appears in reach. Counting resources would require asking a provider what
exists, which is the lookup a card must never become.
ReachUnavailableReasonSchema
constReachUnavailableReasonSchema:ZodEnum<["authority_unavailable","usage_store_unavailable"]>
Defined in: capability.ts:192
Why a reach could not be established.
Both are infrastructure codes the decide path already fails closed with: the authority behind the reach could not be loaded, or a bounded grant's budget could not be read. Neither narrows the answer. A reach that silently omitted a live grant because a dependency is down would look exactly like one that is true, so the whole answer is withheld under a code the reader can act on (ADR 0021).
RemoteExecutionRequestSchema
constRemoteExecutionRequestSchema:ZodObject<Omit<{agent:ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>;context:ZodObject<{actor:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;authority:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;enabledToolNamespaces:ZodEffects<ZodArray<ZodString,"many">>,string[],string[]>;namespaceId:ZodString;now:ZodString;owner:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;purpose:ZodString;traceId:ZodString; },"strict",ZodTypeAny, {actor: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };authority: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };enabledToolNamespaces:string[];namespaceId:string;now:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;traceId:string; }, {actor: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };authority: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };enabledToolNamespaces:string[];namespaceId:string;now:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;traceId:string; }>;executionId:ZodString;message:ZodObject<{createdAt:ZodString;id:ZodString;payload:ZodType<JsonValue,ZodTypeDef,JsonValue>>;provenance:ZodOptional<ZodObject<{metadata:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;parentIds:ZodArray<ZodString,"many">>;source:ZodString; },"strict",ZodTypeAny, {metadata?:JsonObject;parentIds:string[];source:string; }, {metadata?:JsonObject;parentIds:string[];source:string; }>>;purpose:ZodString;receiver:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;replyTo:ZodOptional<ZodString>>;sender:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;traceId:ZodString;version:ZodLiteral<"1">>; },"strict",ZodTypeAny, {createdAt:string;id:string;payload:JsonValue;provenance?: {metadata?:JsonObject;parentIds:string[];source:string; };purpose:string;receiver: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };replyTo?:string;sender: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };traceId:string;version:"1"; }, {createdAt:string;id:string;payload:JsonValue;provenance?: {metadata?:JsonObject;parentIds:string[];source:string; };purpose:string;receiver: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };replyTo?:string;sender: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };traceId:string;version:"1"; }>;metadata:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;options:ZodOptional<ZodObject<{maxSteps:ZodOptional<ZodNumber>>;maxToolCalls:ZodOptional<ZodNumber>>;timeoutMs:ZodOptional<ZodNumber>>; },"strict",ZodTypeAny, {maxSteps?:number;maxToolCalls?:number;timeoutMs?:number; }, {maxSteps?:number;maxToolCalls?:number;timeoutMs?:number; }>>;state:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;tools:ZodArray<ZodEffects<ZodObject<{annotations:ZodOptional<ZodObject<{destructive:ZodOptional<...>;idempotent:ZodOptional<...>;readOnly:ZodOptional<...>; },"strict",ZodTypeAny, {destructive?: ... | ... | ...;idempotent?: ... | ... | ...;readOnly?: ... | ... | ...; }, {destructive?: ... | ... | ...;idempotent?: ... | ... | ...;readOnly?: ... | ... | ...; }>>;description:ZodString;inputSchema:ZodType<JsonObject,ZodTypeDef,JsonObject>>;metadata:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;name:ZodString;namespace:ZodString;outputSchema:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;readWrite:ZodEnum<["read","write"]>;requiredCapability:ZodObject<{action:ZodString;resource:ZodObject<{namespace: ...;owner: ...;path: ...; },"strict",ZodTypeAny, {namespace: ...;owner?: ...;path: ...; }, {namespace: ...;owner?: ...;path: ...; }>; },"strict",ZodTypeAny, {action:string;resource: {namespace:string;owner?: ... | ... | ... | ... | ...;path: ...[]; }; }, {action:string;resource: {namespace:string;owner?: ... | ... | ... | ... | ...;path: ...[]; }; }>;source:ZodString; },"strict",ZodTypeAny, {annotations?: {destructive?:boolean;idempotent?:boolean;readOnly?:boolean; };description:string;inputSchema:JsonObject;metadata?:JsonObject;name:string;namespace:string;outputSchema?:JsonObject;readWrite:"read"|"write";requiredCapability: {action:string;resource: {namespace:string;owner?: {kind: ...;userId: ...; } | {agentId: ...;kind: ...; } | {conversationId: ...;kind: ...; } | {kind: ...;serviceId: ...; };path:string[]; }; };source:string; }, {annotations?: {destructive?:boolean;idempotent?:boolean;readOnly?:boolean; };description:string;inputSchema:JsonObject;metadata?:JsonObject;name:string;namespace:string;outputSchema?:JsonObject;readWrite:"read"|"write";requiredCapability: {action:string;resource: {namespace:string;owner?: {kind: ...;userId: ...; } | {agentId: ...;kind: ...; } | {conversationId: ...;kind: ...; } | {kind: ...;serviceId: ...; };path:string[]; }; };source:string; }>, {annotations?: {destructive?:boolean;idempotent?:boolean;readOnly?:boolean; };description:string;inputSchema:JsonObject;metadata?:JsonObject;name:string;namespace:string;outputSchema?:JsonObject;readWrite:"read"|"write";requiredCapability: {action:string;resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }; };source:string; }, {annotations?: {destructive?:boolean;idempotent?:boolean;readOnly?:boolean; };description:string;inputSchema:JsonObject;metadata?:JsonObject;name:string;namespace:string;outputSchema?:JsonObject;readWrite:"read"|"write";requiredCapability: {action:string;resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }; };source:string; }>,"many">>;version:ZodLiteral<"1">>; },"tools"|"context">>,"strict",ZodTypeAny, {agent: {agentId:string;kind:"agent"; };executionId:string;message: {createdAt:string;id:string;payload:JsonValue;provenance?: {metadata?:JsonObject;parentIds:string[];source:string; };purpose:string;receiver: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };replyTo?:string;sender: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };traceId:string;version:"1"; };metadata?:JsonObject;options?: {maxSteps?:number;maxToolCalls?:number;timeoutMs?:number; };state?:JsonObject;version:"1"; }, {agent: {agentId:string;kind:"agent"; };executionId:string;message: {createdAt:string;id:string;payload:JsonValue;provenance?: {metadata?:JsonObject;parentIds:string[];source:string; };purpose:string;receiver: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };replyTo?:string;sender: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };traceId:string;version:"1"; };metadata?:JsonObject;options?: {maxSteps?:number;maxToolCalls?:number;timeoutMs?:number; };state?:JsonObject;version:"1"; }>
Defined in: http.ts:14
Turn request accepted over HTTP; authority and visible tools are host-derived.
RemoteResourceOperationSchema
constRemoteResourceOperationSchema:ZodObject<Omit<{action:ZodString;context:ZodObject<{actor:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;authority:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;enabledToolNamespaces:ZodEffects<ZodArray<ZodString,"many">>,string[],string[]>;namespaceId:ZodString;now:ZodString;owner:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;purpose:ZodString;traceId:ZodString; },"strict",ZodTypeAny, {actor: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };authority: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };enabledToolNamespaces:string[];namespaceId:string;now:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;traceId:string; }, {actor: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };authority: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };enabledToolNamespaces:string[];namespaceId:string;now:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;traceId:string; }>;input:ZodOptional<ZodType<JsonValue,ZodTypeDef,JsonValue>>>>;metadata:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;operationId:ZodString;resource:ZodObject<{namespace:ZodString;owner:ZodOptional<ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<...>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<...>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<...>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<...>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>>;path:ZodArray<ZodString,"many">>; },"strict",ZodTypeAny, {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }, {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }>; },"context">>,"strict",ZodTypeAny, {action:string;input?:JsonValue;metadata?:JsonObject;operationId:string;resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }; }, {action:string;input?:JsonValue;metadata?:JsonObject;operationId:string;resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }; }>
Defined in: http.ts:8
Resource operation accepted over HTTP; authority is injected by the host.
ResourceOperationSchema
constResourceOperationSchema:ZodObject<{action:ZodString;context:ZodObject<{actor:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;authority:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;enabledToolNamespaces:ZodEffects<ZodArray<ZodString,"many">>,string[],string[]>;namespaceId:ZodString;now:ZodString;owner:ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>;purpose:ZodString;traceId:ZodString; },"strict",ZodTypeAny, {actor: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };authority: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };enabledToolNamespaces:string[];namespaceId:string;now:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;traceId:string; }, {actor: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };authority: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };enabledToolNamespaces:string[];namespaceId:string;now:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;traceId:string; }>;input:ZodOptional<ZodType<JsonValue,ZodTypeDef,JsonValue>>>>;metadata:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;operationId:ZodString;resource:ZodObject<{namespace:ZodString;owner:ZodOptional<ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>>;path:ZodArray<ZodString,"many">>; },"strict",ZodTypeAny, {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }, {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }>; },"strict",ZodTypeAny, {action:string;context: {actor: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };authority: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };enabledToolNamespaces:string[];namespaceId:string;now:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;traceId:string; };input?:JsonValue;metadata?:JsonObject;operationId:string;resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }; }, {action:string;context: {actor: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };authority: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };enabledToolNamespaces:string[];namespaceId:string;now:string;owner: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };purpose:string;traceId:string; };input?:JsonValue;metadata?:JsonObject;operationId:string;resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }; }>
Defined in: resource.ts:10
A self-contained request to perform one permission-controlled operation.
ResourceReachSchema
constResourceReachSchema:ZodObject<{actions:ZodArray<ZodString,"many">>;namespace:ZodString;path:ZodArray<ZodString,"many">>;scope:ZodEnum<["exact","descendants"]>; },"strict",ZodTypeAny, {actions:string[];namespace:string;path:string[];scope:"exact"|"descendants"; }, {actions:string[];namespace:string;path:string[];scope:"exact"|"descendants"; }>
Defined in: capability.ts:168
Where an actor may operate, with the authority stripped out.
A reader needs to know which paths are worth naming — otherwise it guesses
and collects denials — but it must not learn who granted the access, for how
long, or how many uses remain. This carries the shape of the reachable
surface and nothing else. It is descriptive: every call is still authorized
independently, so a stale or over-wide ResourceReach cannot permit
anything.
The owner is deliberately absent as well. Reach is always derived under one access context and describes that context's world; carrying an owner would invite a reader to treat an entry as portable to another.
ResourceRefSchema
constResourceRefSchema:ZodObject<{namespace:ZodString;owner:ZodOptional<ZodDiscriminatedUnion<"kind", [ZodObject<{kind:ZodLiteral<"human">>;userId:ZodString; },"strict",ZodTypeAny, {kind:"human";userId:string; }, {kind:"human";userId:string; }>,ZodObject<{agentId:ZodString;kind:ZodLiteral<"agent">>; },"strict",ZodTypeAny, {agentId:string;kind:"agent"; }, {agentId:string;kind:"agent"; }>,ZodObject<{conversationId:ZodString;kind:ZodLiteral<"group">>; },"strict",ZodTypeAny, {conversationId:string;kind:"group"; }, {conversationId:string;kind:"group"; }>,ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>]>>;path:ZodArray<ZodString,"many">>; },"strict",ZodTypeAny, {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }, {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }>
Defined in: capability.ts:27
A host-independent reference to a resource exposed through SharedOS.
ResourceResultSchema
constResourceResultSchema:ZodDiscriminatedUnion<"status", [ZodObject<object&object,"strict",ZodTypeAny, {completedAt:string;metadata?:JsonObject;operationId:string;output:JsonValue;status:"succeeded"; }, {completedAt:string;metadata?:JsonObject;operationId:string;output:JsonValue;status:"succeeded"; }>,ZodObject<object&object,"strict",ZodTypeAny, {completedAt:string;error: {code:string;details?:JsonObject;message:string;retryable?:boolean; };metadata?:JsonObject;operationId:string;status:"denied"; }, {completedAt:string;error: {code:string;details?:JsonObject;message:string;retryable?:boolean; };metadata?:JsonObject;operationId:string;status:"denied"; }>,ZodObject<object&object,"strict",ZodTypeAny, {completedAt:string;error: {code:string;details?:JsonObject;message:string;retryable?:boolean; };metadata?:JsonObject;operationId:string;status:"failed"; }, {completedAt:string;error: {code:string;details?:JsonObject;message:string;retryable?:boolean; };metadata?:JsonObject;operationId:string;status:"failed"; }>]>
Defined in: resource.ts:29
RuntimeEventSchema
constRuntimeEventSchema:ZodObject<{data:ZodType<JsonValue,ZodTypeDef,JsonValue>>;type:ZodString; },"strict",ZodTypeAny, {data:JsonValue;type:string; }, {data:JsonValue;type:string; }>
Defined in: runtime.ts:20
A runtime-originated observation. The SharedOS envelope assigns its audit identity.
RuntimeManifestSchema
constRuntimeManifestSchema:ZodObject<{id:ZodString;metadata:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;protocolVersion:ZodLiteral<"1">>;version:ZodString; },"strict",ZodTypeAny, {id:string;metadata?:JsonObject;protocolVersion:"1";version:string; }, {id:string;metadata?:JsonObject;protocolVersion:"1";version:string; }>
Defined in: runtime.ts:8
Stable, JSON-safe provenance for one installed runtime implementation.
RuntimeTurnOutcomeSchema
constRuntimeTurnOutcomeSchema:ZodDiscriminatedUnion<"type", [ZodObject<object&object,"strict",ZodTypeAny, {metadata?:JsonObject;output:JsonValue;type:"complete"; }, {metadata?:JsonObject;output:JsonValue;type:"complete"; }>,ZodObject<object&object,"strict",ZodTypeAny, {error: {code:string;details?:JsonObject;message:string;retryable?:boolean; };metadata?:JsonObject;type:"fail"; }, {error: {code:string;details?:JsonObject;message:string;retryable?:boolean; };metadata?:JsonObject;type:"fail"; }>,ZodObject<object&object,"strict",ZodTypeAny, {metadata?:JsonObject;reason:string;type:"escalate"; }, {metadata?:JsonObject;reason:string;type:"escalate"; }>]>
Defined in: runtime.ts:43
The only terminal outcomes a runtime plugin may return for one bounded turn.
escalate is a third terminal state rather than a flavour of fail. A turn
that stopped because it needed authority it does not hold is a different
event from one that was refused and from one that erred, and collapsing it
into either would make "the agent asked for help" unrecoverable from the
record. It grants nothing: SharedOS records the request, names the reviewer
the host would route it to, and stops.
ServiceAddressSchema
constServiceAddressSchema:ZodObject<{kind:ZodLiteral<"service">>;serviceId:ZodString; },"strict",ZodTypeAny, {kind:"service";serviceId:string; }, {kind:"service";serviceId:string; }>
Defined in: address.ts:20
SharedOSApiErrorResponseSchema
constSharedOSApiErrorResponseSchema:ZodObject<{error:ZodObject<{code:ZodString;message:ZodString;requestId:ZodOptional<ZodString>>; },"strict",ZodTypeAny, {code:string;message:string;requestId?:string; }, {code:string;message:string;requestId?:string; }>; },"strict",ZodTypeAny, {error: {code:string;message:string;requestId?:string; }; }, {error: {code:string;message:string;requestId?:string; }; }>
Defined in: http.ts:28
SharedOSHealthSchema
constSharedOSHealthSchema:ZodObject<{protocolVersion:ZodLiteral<"1">>;status:ZodLiteral<"ok">>; },"strict",ZodTypeAny, {protocolVersion:"1";status:"ok"; }, {protocolVersion:"1";status:"ok"; }>
Defined in: http.ts:20
SharedOSToolCatalogSchema
constSharedOSToolCatalogSchema:ZodEffects<ZodObject<{catalogHash:ZodString;executionId:ZodString;tools:ZodArray<ZodObject<{annotations:ZodOptional<ZodObject<{destructiveHint:ZodOptional<ZodBoolean>>;idempotentHint:ZodOptional<ZodBoolean>>;openWorldHint:ZodOptional<ZodBoolean>>;readOnlyHint:ZodOptional<ZodBoolean>>; },"strict",ZodTypeAny, {destructiveHint?:boolean;idempotentHint?:boolean;openWorldHint?:boolean;readOnlyHint?:boolean; }, {destructiveHint?:boolean;idempotentHint?:boolean;openWorldHint?:boolean;readOnlyHint?:boolean; }>>;description:ZodString;inputSchema:ZodType<JsonObject,ZodTypeDef,JsonObject>>;metadata:ZodOptional<ZodObject<{namespace:ZodOptional<ZodString>>;source:ZodOptional<ZodString>>; },"strict",ZodTypeAny, {namespace?:string;source?:string; }, {namespace?:string;source?:string; }>>;name:ZodString;outputSchema:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>; },"strict",ZodTypeAny, {annotations?: {destructiveHint?:boolean;idempotentHint?:boolean;openWorldHint?:boolean;readOnlyHint?:boolean; };description:string;inputSchema:JsonObject;metadata?: {namespace?:string;source?:string; };name:string;outputSchema?:JsonObject; }, {annotations?: {destructiveHint?:boolean;idempotentHint?:boolean;openWorldHint?:boolean;readOnlyHint?:boolean; };description:string;inputSchema:JsonObject;metadata?: {namespace?:string;source?:string; };name:string;outputSchema?:JsonObject; }>,"many">>;version:ZodLiteral<"1">>; },"strict",ZodTypeAny, {catalogHash:string;executionId:string;tools:object[];version:"1"; }, {catalogHash:string;executionId:string;tools:object[];version:"1"; }>, {catalogHash:string;executionId:string;tools:object[];version:"1"; }, {catalogHash:string;executionId:string;tools:object[];version:"1"; }>
Defined in: tool.ts:211
The effective, permission-filtered catalogue for exactly one turn.
catalogHash covers the tools and nothing else, so two harnesses that were
handed the same semantic tool set produce the same hash even though their
executionIds, transports, and harness-side aliases differ. That is the whole
point of carrying it: an experiment can then prove the harnesses were compared
on equal terms rather than assuming it.
TimestampSchema
constTimestampSchema:ZodString
Defined in: common.ts:12
An RFC 3339 timestamp, represented as a string to remain JSON-safe.
ToolAnnotationsSchema
constToolAnnotationsSchema:ZodObject<{destructive:ZodOptional<ZodBoolean>>;idempotent:ZodOptional<ZodBoolean>>;readOnly:ZodOptional<ZodBoolean>>; },"strict",ZodTypeAny, {destructive?:boolean;idempotent?:boolean;readOnly?:boolean; }, {destructive?:boolean;idempotent?:boolean;readOnly?:boolean; }>
Defined in: tool.ts:100
ToolCallSchema
constToolCallSchema:ZodObject<{arguments:ZodType<JsonObject,ZodTypeDef,JsonObject>>;id:ZodString;requestedAt:ZodString;tool:ZodString;traceId:ZodString; },"strict",ZodTypeAny, {arguments:JsonObject;id:string;requestedAt:string;tool:string;traceId:string; }, {arguments:JsonObject;id:string;requestedAt:string;tool:string;traceId:string; }>
Defined in: tool.ts:350
ToolClassSchema
constToolClassSchema:ZodEnum<["managed","harness_local","external_direct"]>
Defined in: tool.ts:252
How a tool reached the model, and therefore whether SharedOS authorized it.
managed: published by SharedOS and authorized on every call.harness_local: the harness's own tool -- a patch tool, a bounded shell. SharedOS never sees the call.external_direct: an MCP server the harness was configured with independently. SharedOS never sees the call.
Only the managed class is a SharedOS claim. The other two are declared so a result can be read for what it is: an unclassified run cannot distinguish "the kernel refused every violation" from "the harness had a shell".
ToolDefinitionSchema
constToolDefinitionSchema:ZodEffects<ZodObject<{annotations:ZodOptional<ZodObject<{destructive:ZodOptional<ZodBoolean>>;idempotent:ZodOptional<ZodBoolean>>;readOnly:ZodOptional<ZodBoolean>>; },"strict",ZodTypeAny, {destructive?:boolean;idempotent?:boolean;readOnly?:boolean; }, {destructive?:boolean;idempotent?:boolean;readOnly?:boolean; }>>;description:ZodString;inputSchema:ZodType<JsonObject,ZodTypeDef,JsonObject>>;metadata:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;name:ZodString;namespace:ZodString;outputSchema:ZodOptional<ZodType<JsonObject,ZodTypeDef,JsonObject>>>>;readWrite:ZodEnum<["read","write"]>;requiredCapability:ZodObject<{action:ZodString;resource:ZodObject<{namespace:ZodString;owner:ZodOptional<ZodDiscriminatedUnion<"kind", [ZodObject<..., ..., ..., ..., ...>,ZodObject<..., ..., ..., ..., ...>,ZodObject<..., ..., ..., ..., ...>,ZodObject<..., ..., ..., ..., ...>]>>;path:ZodArray<ZodString,"many">>; },"strict",ZodTypeAny, {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }, {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }>; },"strict",ZodTypeAny, {action:string;resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }; }, {action:string;resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }; }>;source:ZodString; },"strict",ZodTypeAny, {annotations?: {destructive?:boolean;idempotent?:boolean;readOnly?:boolean; };description:string;inputSchema:JsonObject;metadata?:JsonObject;name:string;namespace:string;outputSchema?:JsonObject;readWrite:"read"|"write";requiredCapability: {action:string;resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }; };source:string; }, {annotations?: {destructive?:boolean;idempotent?:boolean;readOnly?:boolean; };description:string;inputSchema:JsonObject;metadata?:JsonObject;name:string;namespace:string;outputSchema?:JsonObject;readWrite:"read"|"write";requiredCapability: {action:string;resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }; };source:string; }>, {annotations?: {destructive?:boolean;idempotent?:boolean;readOnly?:boolean; };description:string;inputSchema:JsonObject;metadata?:JsonObject;name:string;namespace:string;outputSchema?:JsonObject;readWrite:"read"|"write";requiredCapability: {action:string;resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }; };source:string; }, {annotations?: {destructive?:boolean;idempotent?:boolean;readOnly?:boolean; };description:string;inputSchema:JsonObject;metadata?:JsonObject;name:string;namespace:string;outputSchema?:JsonObject;readWrite:"read"|"write";requiredCapability: {action:string;resource: {namespace:string;owner?: {kind:"human";userId:string; } | {agentId:string;kind:"agent"; } | {conversationId:string;kind:"group"; } | {kind:"service";serviceId:string; };path:string[]; }; };source:string; }>
Defined in: tool.ts:111
A JSON-Schema-described tool bound to one permission requirement.
ToolNameSchema
constToolNameSchema:ZodString
Defined in: tool.ts:28
A canonical SharedOS tool identity.
Deliberately narrower than IdentifierSchema. A tool name is not an
opaque host identifier: it is published to external harnesses as the raw MCP
Tool.name, so the character set has to be one every harness and transport
carries unchanged. Keeping the two schemas distinct makes the invariant
ToolDefinition.name = SharedOS canonical tool ID = raw MCP Tool.name
enforceable at registration rather than merely documented.
Names are globally unique across namespaces, so a catalogue that brokers two
providers exposing the same underlying operation still publishes two distinct
names -- github.search and notion.search, never search twice.
A harness is free to rewrite this into an alias of its own
(mcp__sharedos__files_search). That alias is presentation, never identity,
and never participates in authorization.
ToolNamespaceCatalogSchema
constToolNamespaceCatalogSchema:ZodEffects<ZodObject<{namespaces:ZodArray<ZodEffects<ZodObject<{enabled:ZodBoolean;namespace:ZodString;sources:ZodArray<ZodString,"many">>;toolCount:ZodNumber; },"strict",ZodTypeAny, {enabled:boolean;namespace:string;sources:string[];toolCount:number; }, {enabled:boolean;namespace:string;sources:string[];toolCount:number; }>, {enabled:boolean;namespace:string;sources:string[];toolCount:number; }, {enabled:boolean;namespace:string;sources:string[];toolCount:number; }>,"many">>;summary:ZodObject<{disabled:ZodNumber;enabled:ZodNumber;total:ZodNumber; },"strict",ZodTypeAny, {disabled:number;enabled:number;total:number; }, {disabled:number;enabled:number;total:number; }>; },"strict",ZodTypeAny, {namespaces:object[];summary: {disabled:number;enabled:number;total:number; }; }, {namespaces:object[];summary: {disabled:number;enabled:number;total:number; }; }>, {namespaces:object[];summary: {disabled:number;enabled:number;total:number; }; }, {namespaces:object[];summary: {disabled:number;enabled:number;total:number; }; }>
Defined in: tool.ts:312
ToolNamespaceDescriptorSchema
constToolNamespaceDescriptorSchema:ZodEffects<ZodObject<{enabled:ZodBoolean;namespace:ZodString;sources:ZodArray<ZodString,"many">>;toolCount:ZodNumber; },"strict",ZodTypeAny, {enabled:boolean;namespace:string;sources:string[];toolCount:number; }, {enabled:boolean;namespace:string;sources:string[];toolCount:number; }>, {enabled:boolean;namespace:string;sources:string[];toolCount:number; }, {enabled:boolean;namespace:string;sources:string[];toolCount:number; }>
Defined in: tool.ts:293
ToolNamespaceSchema
constToolNamespaceSchema:ZodString=IdentifierSchema
Defined in: tool.ts:38
A logical group of tools that a trusted host may enable for one access context.
ToolNamespaceUpdateSchema
constToolNamespaceUpdateSchema:ZodEffects<ZodObject<{disable:ZodOptional<ZodEffects<ZodArray<ZodString,"many">>,string[],string[]>>;enable:ZodOptional<ZodEffects<ZodArray<ZodString,"many">>,string[],string[]>>; },"strict",ZodTypeAny, {disable?:string[];enable?:string[]; }, {disable?:string[];enable?:string[]; }>, {disable?:string[];enable?:string[]; }, {disable?:string[];enable?:string[]; }>
Defined in: tool.ts:71
An idempotent patch to a host-owned tool namespace selection.
The host applies this atomically and returns the authoritative effective selection after product policy ceilings have been enforced.
ToolPolicySchema
constToolPolicySchema:ZodEffects<ZodObject<{externalDirect:ZodArray<ZodString,"many">>;harnessLocal:ZodArray<ZodString,"many">>;managedMcp:ZodArray<ZodString,"many">>;mode:ZodEnum<["strict","hybrid"]>; },"strict",ZodTypeAny, {externalDirect:string[];harnessLocal:string[];managedMcp:string[];mode:"strict"|"hybrid"; }, {externalDirect:string[];harnessLocal:string[];managedMcp:string[];mode:"strict"|"hybrid"; }>, {externalDirect:string[];harnessLocal:string[];managedMcp:string[];mode:"strict"|"hybrid"; }, {externalDirect:string[];harnessLocal:string[];managedMcp:string[];mode:"strict"|"hybrid"; }>
Defined in: tool.ts:267
The declared tool surface of one experiment or runtime configuration.
strict asserts that every effect available to the harness went through
SharedOS. It is checked, not just declared: a strict policy that also lists
externalDirect entries is rejected here rather than producing a run whose
headline claim its own manifest contradicts.
harnessLocal is still permitted under strict, because a harness with no
local tools at all cannot always be produced -- but the entries have to be
named, so a reader can see exactly which effects were outside the kernel.
ToolReadWriteSchema
constToolReadWriteSchema:ZodEnum<["read","write"]>
Defined in: tool.ts:49
A conservative catalog classification. Capabilities remain the authorization source.
ToolResultSchema
constToolResultSchema:ZodDiscriminatedUnion<"status", [ZodObject<object&object,"strict",ZodTypeAny, {callId:string;completedAt:string;metadata?:JsonObject;output:JsonValue;status:"succeeded";tool:string; }, {callId:string;completedAt:string;metadata?:JsonObject;output:JsonValue;status:"succeeded";tool:string; }>,ZodObject<object&object,"strict",ZodTypeAny, {callId:string;completedAt:string;error: {code:string;details?:JsonObject;message:string;retryable?:boolean; };metadata?:JsonObject;status:"denied";tool:string; }, {callId:string;completedAt:string;error: {code:string;details?:JsonObject;message:string;retryable?:boolean; };metadata?:JsonObject;status:"denied";tool:string; }>,ZodObject<object&object,"strict",ZodTypeAny, {callId:string;completedAt:string;error: {code:string;details?:JsonObject;message:string;retryable?:boolean; };metadata?:JsonObject;status:"failed";tool:string; }, {callId:string;completedAt:string;error: {code:string;details?:JsonObject;message:string;retryable?:boolean; };metadata?:JsonObject;status:"failed";tool:string; }>]>
Defined in: tool.ts:369
ToolSourceSchema
constToolSourceSchema:ZodString=IdentifierSchema
Defined in: tool.ts:45
The host-defined origin of a tool, for example sharedos, native, mcp,
or composio. This is catalog metadata, never proof of authority.
Functions
contextCapsulePreview()
contextCapsulePreview(
value): {items:object[];limitations:string[];summary:string; } |undefined
Defined in: context-capsule.ts:261
Project a capsule down to what a reviewer may see before approving.
Deliberately tolerant of malformed input: a preview is rendered for a request that has not been accepted yet, so an unparseable capsule must degrade to a partial preview rather than throw inside an approval surface. It never copies item content — that is the one invariant this function has.
Parameters
| Parameter | Type |
|---|---|
value | unknown |
Returns
{ items: object[]; limitations: string[]; summary: string; } | undefined
validateContextCapsule()
validateContextCapsule(
value,objective):Promise<ContextCapsuleValidation>>
Defined in: context-capsule.ts:153
Validate an untrusted capsule against the objective it claims to serve.
Every rejection returns its own code rather than one generic parse failure: the caller reports these to the sender, and "your capsule is invalid" is not actionable while "context_hash_mismatch" is.
The objective is checked, not just carried. A capsule assembled for one task must not be replayed against another, because the receiving owner approved the disclosure for that task.
Async because content integrity is verified with Web Crypto: SharedOS depends on no Node built-in, and accepting an injected hash function would make the integrity property optional for the caller who most wants to skip it.
Parameters
| Parameter | Type |
|---|---|
value | unknown |
objective | string |
Returns
Promise<ContextCapsuleValidation>