SharedOS API v0.1.0-alpha.5


SharedOS API / @aicoo/sharedos-testkit

@aicoo/sharedos-testkit

Deterministic in-memory fixtures and recording providers for SharedOS tests.

npm install --save-dev @aicoo/sharedos-testkit@next

This package is for tests, examples, and isolated experimental worlds. Its in-memory stores are not durable or multi-instance-safe production storage. InMemoryToolNamespaceSettingsStore can exercise the namespace control plane without becoming a production settings backend.

SharedOS is currently an 0.x prerelease.

Classes

InMemoryAuditSink

Defined in: testkit/src/index.ts:29

Implements

Constructors

Constructor

new InMemoryAuditSink(): InMemoryAuditSink

Returns

InMemoryAuditSink

Properties

PropertyModifierTypeDefault valueDefined in
<a id="property-events"></a> eventsreadonlyAuditEvent[][]testkit/src/index.ts:30

Methods

record()

record(event): Promise<void>>

Defined in: testkit/src/index.ts:32

Parameters
ParameterType
eventAuditEvent
Returns

Promise<void>

Implementation of

AuditSink.record


InMemoryDelegationChainResolver

Defined in: testkit/src/index.ts:136

Namespace-scoped ancestor lookup for delegated-grant fixtures.

Implements

Constructors

Constructor

new InMemoryDelegationChainResolver(grants?): InMemoryDelegationChainResolver

Defined in: testkit/src/index.ts:139

Parameters
ParameterTypeDefault value
grantsreadonly object[][]
Returns

InMemoryDelegationChainResolver

Methods

add()

add(grant): this

Defined in: testkit/src/index.ts:145

Parameters
ParameterType
grant{ 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; }; }
grant.capabilitiesobject[]
grant.constraints{ delegationDepth?: number; expiresAt?: string; maxUses?: number; notBefore?: string; purposes?: string[]; }
grant.constraints.delegationDepth?number
grant.constraints.expiresAt?string
grant.constraints.maxUses?number
grant.constraints.notBefore?string
grant.constraints.purposes?string[]
grant.idstring
grant.issuedAtstring
grant.issuer{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }
grant.metadata?JsonObject
grant.namespaceIdstring
grant.parentGrantId?string
grant.revokedAt?string
grant.subject{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }
Returns

this

resolve()

resolve(namespaceId, grantId): Promise<{ 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; }; } | undefined>>

Defined in: testkit/src/index.ts:165

Parameters
ParameterType
namespaceIdstring
grantIdstring
Returns

Promise<{ 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; }; } | undefined>

Implementation of

DelegationChainResolver.resolve

revoke()

revoke(namespaceId, grantId, revokedAt): this

Defined in: testkit/src/index.ts:156

Record a revocation the way a host grant store would, in place.

Parameters
ParameterType
namespaceIdstring
grantIdstring
revokedAtstring
Returns

this


InMemoryGrantSource

Defined in: testkit/src/index.ts:87

A host grant store fixture.

load answers only with grants issued to the context's actor by its authority inside its namespace, which is the contract every production GrantSource must satisfy.

Implements

Constructors

Constructor

new InMemoryGrantSource(grants?): InMemoryGrantSource

Defined in: testkit/src/index.ts:90

Parameters
ParameterTypeDefault value
grantsreadonly object[][]
Returns

InMemoryGrantSource

Methods

add()

add(...grants): this

Defined in: testkit/src/index.ts:96

Parameters
ParameterType
...grantsreadonly object[]
Returns

this

load()

load(context): Promise<readonly object[]>

Defined in: testkit/src/index.ts:114

Parameters
ParameterType
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; }
context.actor{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }
context.authority{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }
context.enabledToolNamespacesstring[]
context.namespaceIdstring
context.nowstring
context.owner{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }
context.purposestring
context.traceIdstring
Returns

Promise<readonly object[]>

Implementation of

GrantSource.load

revoke()

revoke(grantId, revokedAt): this

Defined in: testkit/src/index.ts:104

Record a revocation the way a host store would, without deleting history.

Parameters
ParameterType
grantIdstring
revokedAtstring
Returns

this


InMemoryMessageTransport

Defined in: testkit/src/index.ts:37

Implements

Constructors

Constructor

new InMemoryMessageTransport(): InMemoryMessageTransport

Returns

InMemoryMessageTransport

Properties

PropertyModifierTypeDefault valueDefined in
<a id="property-deliveries"></a> deliveriesreadonlyobject[][]testkit/src/index.ts:38

Methods

deliver()

deliver(context, envelope): Promise<{ messageId: string; metadata?: JsonObject; status: "accepted"; timestamp: string; } | { messageId: string; metadata?: JsonObject; status: "delivered"; timestamp: string; } | { 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: "failed"; timestamp: string; }>

Defined in: testkit/src/index.ts:40

Parameters
ParameterType
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; }
context.actor{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }
context.authority{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }
context.enabledToolNamespacesstring[]
context.namespaceIdstring
context.nowstring
context.owner{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }
context.purposestring
context.traceIdstring
envelope{ 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"; }
envelope.createdAtstring
envelope.idstring
envelope.payloadJsonValue
envelope.provenance?{ metadata?: JsonObject; parentIds: string[]; source: string; }
envelope.provenance.metadata?JsonObject
envelope.provenance.parentIdsstring[]
envelope.provenance.sourcestring
envelope.purposestring
envelope.receiver{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }
envelope.replyTo?string
envelope.sender{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }
envelope.traceIdstring
envelope.version"1"
Returns

Promise<{ messageId: string; metadata?: JsonObject; status: "accepted"; timestamp: string; } | { messageId: string; metadata?: JsonObject; status: "delivered"; timestamp: string; } | { 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: "failed"; timestamp: string; }>

Implementation of

MessageTransport.deliver


InMemoryResourceProvider

Defined in: testkit/src/index.ts:183

A host-neutral recording provider for examples, conformance tests, and isolated experiment worlds.

Implements

Constructors

Constructor

new InMemoryResourceProvider(namespace, handler?): InMemoryResourceProvider

Defined in: testkit/src/index.ts:188

Parameters
ParameterTypeDefault value
namespacestringundefined
handlerResourceHandlerechoResourceOperation
Returns

InMemoryResourceProvider

Properties

PropertyModifierTypeDefault valueDefined in
<a id="property-namespace"></a> namespacereadonlystringundefinedtestkit/src/index.ts:184
<a id="property-operations"></a> operationsreadonlyobject[][]testkit/src/index.ts:185

Methods

invoke()

invoke(operation): Promise<{ completedAt: string; metadata?: JsonObject; operationId: string; output: JsonValue; status: "succeeded"; } | { 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: "failed"; }>

Defined in: testkit/src/index.ts:193

Parameters
ParameterType
operation{ 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[]; }; }
operation.actionstring
operation.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; }
operation.context.actor{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }
operation.context.authority{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }
operation.context.enabledToolNamespacesstring[]
operation.context.namespaceIdstring
operation.context.nowstring
operation.context.owner{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }
operation.context.purposestring
operation.context.traceIdstring
operation.input?JsonValue
operation.metadata?JsonObject
operation.operationIdstring
operation.resource{ namespace: string; owner?: { kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }; path: string[]; }
operation.resource.namespacestring
operation.resource.owner?{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }
operation.resource.pathstring[]
Returns

Promise<{ completedAt: string; metadata?: JsonObject; operationId: string; output: JsonValue; status: "succeeded"; } | { 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: "failed"; }>

Implementation of

ResourceProvider.invoke


InMemoryToolNamespaceSettingsStore

Defined in: testkit/src/index.ts:54

Namespace settings fixture keyed by the access-context namespace/world.

Implements

Constructors

Constructor

new InMemoryToolNamespaceSettingsStore(initial?): InMemoryToolNamespaceSettingsStore

Defined in: testkit/src/index.ts:57

Parameters
ParameterType
initialReadonly<Record<string, readonly ToolNamespace[]>>
Returns

InMemoryToolNamespaceSettingsStore

Methods

applyUpdate()

applyUpdate(context, update): Promise<readonly string[]>

Defined in: testkit/src/index.ts:63

Parameters
ParameterType
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; }
context.actor{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }
context.authority{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }
context.enabledToolNamespacesstring[]
context.namespaceIdstring
context.nowstring
context.owner{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }
context.purposestring
context.traceIdstring
update{ disable?: string[]; enable?: string[]; }
update.disable?string[]
update.enable?string[]
Returns

Promise<readonly string[]>

Implementation of

ToolNamespaceSettingsStore.applyUpdate

get()

get(namespaceId): readonly string[]

Defined in: testkit/src/index.ts:75

Parameters
ParameterType
namespaceIdstring
Returns

readonly string[]


UnavailableDelegationChainResolver

Defined in: testkit/src/index.ts:173

A resolver whose authoritative source is down; every lookup must fail closed.

Implements

Constructors

Constructor

new UnavailableDelegationChainResolver(): UnavailableDelegationChainResolver

Returns

UnavailableDelegationChainResolver

Methods

resolve()

resolve(): Promise<{ 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; }; } | undefined>>

Defined in: testkit/src/index.ts:174

Returns

Promise<{ 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; }; } | undefined>

Implementation of

DelegationChainResolver.resolve


UnavailableGrantSource

Defined in: testkit/src/index.ts:128

A grant store that is down; every decision made against it must fail closed.

Implements

Constructors

Constructor

new UnavailableGrantSource(): UnavailableGrantSource

Returns

UnavailableGrantSource

Methods

load()

load(): Promise<readonly object[]>

Defined in: testkit/src/index.ts:129

Returns

Promise<readonly object[]>

Implementation of

GrantSource.load

Interfaces

TestContextOptions

Defined in: testkit/src/index.ts:238

Properties

PropertyModifierTypeDefined in
<a id="property-actor"></a> actor?readonly{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }testkit/src/index.ts:239
<a id="property-authority"></a> authority?readonly{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }testkit/src/index.ts:240
<a id="property-enabledtoolnamespaces"></a> enabledToolNamespaces?readonlyreadonly string[]testkit/src/index.ts:243
<a id="property-namespaceid"></a> namespaceId?readonlystringtestkit/src/index.ts:242
<a id="property-now"></a> now?readonlystringtestkit/src/index.ts:246
<a id="property-owner"></a> owner?readonly{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }testkit/src/index.ts:241
<a id="property-purpose"></a> purpose?readonlystringtestkit/src/index.ts:244
<a id="property-traceid"></a> traceId?readonlystringtestkit/src/index.ts:245

TestGrantOptions

Defined in: testkit/src/index.ts:263

Properties

PropertyModifierTypeDefined in
<a id="property-capabilities"></a> capabilitiesreadonlyreadonly object[]testkit/src/index.ts:268
<a id="property-delegationdepth"></a> delegationDepth?readonlynumbertestkit/src/index.ts:275
<a id="property-expiresat"></a> expiresAt?readonlystringtestkit/src/index.ts:272
<a id="property-id"></a> id?readonlystringtestkit/src/index.ts:264
<a id="property-issuedat"></a> issuedAt?readonlystringtestkit/src/index.ts:270
<a id="property-issuer"></a> issuer?readonly{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }testkit/src/index.ts:267
<a id="property-maxuses"></a> maxUses?readonlynumbertestkit/src/index.ts:274
<a id="property-namespaceid-1"></a> namespaceId?readonlystringtestkit/src/index.ts:265
<a id="property-notbefore"></a> notBefore?readonlystringtestkit/src/index.ts:271
<a id="property-parentgrantid"></a> parentGrantId?readonlystringtestkit/src/index.ts:276
<a id="property-purposes"></a> purposes?readonlyreadonly string[]testkit/src/index.ts:269
<a id="property-revokedat"></a> revokedAt?readonlystringtestkit/src/index.ts:273
<a id="property-subject"></a> subject?readonly{ kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }testkit/src/index.ts:266

TestKernel

Defined in: testkit/src/index.ts:199

Properties

PropertyModifierTypeDescriptionDefined in
<a id="property-audit"></a> auditreadonlyInMemoryAuditSink-testkit/src/index.ts:201
<a id="property-grants"></a> grantsreadonlyInMemoryGrantSourceThe trusted store the kernel loads authority from; mutate it to grant or revoke.testkit/src/index.ts:204
<a id="property-kernel"></a> kernelreadonlySharedOSKernel-testkit/src/index.ts:200
<a id="property-messages"></a> messagesreadonlyInMemoryMessageTransport-testkit/src/index.ts:202

TestKernelOptions

Defined in: testkit/src/index.ts:207

Properties

PropertyModifierTypeDescriptionDefined in
<a id="property-delegationresolver"></a> delegationResolver?readonlyDelegationChainResolverInstalls ancestor validation so delegated grants can be exercised.testkit/src/index.ts:213
<a id="property-grants-1"></a> grants?readonlyreadonly object[]Seed authority for the kernel's trusted grant source.testkit/src/index.ts:209
<a id="property-grantsource"></a> grantSource?readonlyGrantSourceReplaces the trusted grant source, for example to exercise an outage.testkit/src/index.ts:211

Type Aliases

ResourceHandler

ResourceHandler = (operation) => Promise<ResourceResult>>

Defined in: testkit/src/index.ts:180

Parameters

ParameterType
operationResourceOperation

Returns

Promise<ResourceResult>

Functions

createTestContext()

createTestContext(options?): object

Defined in: testkit/src/index.ts:249

Parameters

ParameterType
optionsTestContextOptions

Returns

object

actor

actor: { kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }

authority

authority: { kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }

enabledToolNamespaces

enabledToolNamespaces: string[]

namespaceId

namespaceId: string

now

now: string

owner

owner: { kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }

purpose

purpose: string

traceId

traceId: string


createTestGrant()

createTestGrant(options): object

Defined in: testkit/src/index.ts:279

Parameters

ParameterType
optionsTestGrantOptions

Returns

object

capabilities

capabilities: object[]

constraints

constraints: object

constraints.delegationDepth?

optional delegationDepth?: number

constraints.expiresAt?

optional expiresAt?: string

constraints.maxUses?

optional maxUses?: number

constraints.notBefore?

optional notBefore?: string

constraints.purposes?

optional purposes?: string[]

id

id: string

issuedAt

issuedAt: string

issuer

issuer: { kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }

metadata?

optional metadata?: JsonObject

namespaceId

namespaceId: string

parentGrantId?

optional parentGrantId?: string

revokedAt?

optional revokedAt?: string

subject

subject: { kind: "human"; userId: string; } | { agentId: string; kind: "agent"; } | { conversationId: string; kind: "group"; } | { kind: "service"; serviceId: string; }


createTestKernel()

createTestKernel(options?): TestKernel

Defined in: testkit/src/index.ts:216

Parameters

ParameterType
optionsTestKernelOptions

Returns

TestKernel