@topolo/sdk 0.15.0 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -48,6 +48,67 @@ interface TopoloActionValidationResult {
48
48
  }
49
49
  declare function validateTopoloActionInput(schema: Record<string, unknown>, input: unknown): TopoloActionValidationResult;
50
50
 
51
+ declare const ACTOR_ENVELOPE_VERSION: 1;
52
+ declare const TOPOLO_ACTOR_ENVELOPE_HEADER: "X-Topolo-Actor-Envelope";
53
+ type ActorPrincipalType = 'human' | 'managed_agent' | 'external_agent' | 'service' | 'browser_automation';
54
+ type AccountableSubjectType = 'human' | 'organization';
55
+ type ActorChannel = 'web' | 'mobile' | 'cli' | 'mcp' | 'api' | 'workflow' | 'browser_automation';
56
+ type ActorAssurance = 'authenticated' | 'workload_identity' | 'user_verified';
57
+ interface ActorIdentity {
58
+ principalType: ActorPrincipalType;
59
+ principalId: string;
60
+ displayName?: string;
61
+ installationId?: string;
62
+ agentInstanceId?: string;
63
+ browserSessionId?: string;
64
+ provider?: string;
65
+ model?: string;
66
+ }
67
+ interface AccountableSubject {
68
+ principalType: AccountableSubjectType;
69
+ principalId: string;
70
+ displayName?: string;
71
+ }
72
+ interface ActorDelegationHop {
73
+ principalType: ActorPrincipalType;
74
+ principalId: string;
75
+ }
76
+ interface ActorEnvelope {
77
+ schemaVersion: typeof ACTOR_ENVELOPE_VERSION;
78
+ organizationId: string;
79
+ accountableSubject: AccountableSubject;
80
+ performer: ActorIdentity;
81
+ delegation: {
82
+ taskId: string;
83
+ runId: string;
84
+ lineage: ActorDelegationHop[];
85
+ } | null;
86
+ channel: ActorChannel;
87
+ assurance: {
88
+ level: ActorAssurance;
89
+ methods: string[];
90
+ };
91
+ action: {
92
+ requestId: string;
93
+ actionId: string;
94
+ resourceType?: string;
95
+ resourceId?: string;
96
+ inputHash: string;
97
+ };
98
+ issuedAt: string;
99
+ expiresAt?: string;
100
+ }
101
+ declare class ActorEnvelopeValidationError extends Error {
102
+ readonly path: string;
103
+ constructor(path: string, message: string);
104
+ }
105
+ declare function parseActorEnvelope(value: unknown): ActorEnvelope;
106
+ declare function canonicalizeActorEnvelope(value: unknown): string;
107
+ declare function encodeActorEnvelopeHeader(value: unknown): string;
108
+ declare function decodeActorEnvelopeHeader(value: string): ActorEnvelope;
109
+ declare function canonicalJson(value: unknown): string;
110
+ declare function sha256CanonicalValue(value: unknown): Promise<string>;
111
+
51
112
  interface TopoloInlineBase64UploadContract {
52
113
  profile: 'inline-base64';
53
114
  contentField: string;
@@ -85,6 +146,12 @@ declare function encodeTopoloActionBase64(bytes: Uint8Array): string;
85
146
  interface TopoloClientOptions {
86
147
  credential: TopoloCredential;
87
148
  agent: AgentIdentity;
149
+ /** Host surface used to attribute actions performed with verified agent credentials. */
150
+ actorContext?: {
151
+ channel: ActorChannel;
152
+ taskId?: string;
153
+ runId?: string;
154
+ };
88
155
  /** Per-service URL overrides. Useful for staging/dev. */
89
156
  serviceUrls?: Record<string, string>;
90
157
  /** Explicit environment used to reject cross-environment service and action origins. */
@@ -164,6 +231,8 @@ interface RequestOptions {
164
231
  };
165
232
  /** Explicit write-acknowledgement for mutating calls. */
166
233
  confirm?: boolean;
234
+ /** Canonical accountable-subject and performer provenance for this request. */
235
+ actorEnvelope?: ActorEnvelope;
167
236
  /** Extra headers appended after auth/audit headers. */
168
237
  headers?: Record<string, string>;
169
238
  signal?: AbortSignal;
@@ -340,6 +409,7 @@ interface TopoloCatalogSearchOptions {
340
409
  declare class TopoloClient {
341
410
  private credential;
342
411
  private readonly agent;
412
+ private readonly actorContext?;
343
413
  private readonly serviceUrls?;
344
414
  private readonly environment?;
345
415
  private readonly appIds?;
@@ -426,6 +496,7 @@ declare class TopoloClient {
426
496
  resourceType: string;
427
497
  resourceId: string;
428
498
  };
499
+ actorEnvelope?: ActorEnvelope;
429
500
  }): Promise<T>;
430
501
  uploadAction<T = unknown>(action: string, content: Uint8Array | ArrayBuffer, input: Record<string, unknown>, options: TopoloActionUploadOptions & {
431
502
  confirm?: boolean;
@@ -467,8 +538,10 @@ declare class TopoloClient {
467
538
  resourceType: string;
468
539
  resourceId: string;
469
540
  };
541
+ actorEnvelope?: ActorEnvelope;
470
542
  }): Promise<T>;
471
543
  private executeResolvedAction;
544
+ private buildVerifiedAgentActorEnvelope;
472
545
  /**
473
546
  * Introspect the current credential. Returns the caller's resolved identity,
474
547
  * organization, and permission set. Used by CLI `whoami` and by MCP to gate
@@ -489,6 +562,15 @@ interface CredentialIntrospection {
489
562
  name: string | null;
490
563
  role: string;
491
564
  permissions: string[];
565
+ principalId?: string | null;
566
+ principalType?: 'agent_employee' | 'external_agent' | null;
567
+ accountableUserId?: string | null;
568
+ agentInstanceId?: string | null;
569
+ installationId?: string | null;
570
+ provider?: string | null;
571
+ model?: string | null;
572
+ serviceScopes?: string[];
573
+ policyRef?: string | null;
492
574
  };
493
575
  organization: {
494
576
  id: string;
@@ -902,64 +984,6 @@ declare class IdentityModule {
902
984
  whoami(): Promise<CredentialIntrospection>;
903
985
  }
904
986
 
905
- declare const ACTOR_ENVELOPE_VERSION: 1;
906
- type ActorPrincipalType = 'human' | 'managed_agent' | 'external_agent' | 'service' | 'browser_automation';
907
- type AccountableSubjectType = 'human' | 'organization';
908
- type ActorChannel = 'web' | 'mobile' | 'cli' | 'mcp' | 'api' | 'workflow' | 'browser_automation';
909
- type ActorAssurance = 'authenticated' | 'workload_identity' | 'user_verified';
910
- interface ActorIdentity {
911
- principalType: ActorPrincipalType;
912
- principalId: string;
913
- displayName?: string;
914
- installationId?: string;
915
- agentInstanceId?: string;
916
- browserSessionId?: string;
917
- provider?: string;
918
- model?: string;
919
- }
920
- interface AccountableSubject {
921
- principalType: AccountableSubjectType;
922
- principalId: string;
923
- displayName?: string;
924
- }
925
- interface ActorDelegationHop {
926
- principalType: ActorPrincipalType;
927
- principalId: string;
928
- }
929
- interface ActorEnvelope {
930
- schemaVersion: typeof ACTOR_ENVELOPE_VERSION;
931
- organizationId: string;
932
- accountableSubject: AccountableSubject;
933
- performer: ActorIdentity;
934
- delegation: {
935
- taskId: string;
936
- runId: string;
937
- lineage: ActorDelegationHop[];
938
- } | null;
939
- channel: ActorChannel;
940
- assurance: {
941
- level: ActorAssurance;
942
- methods: string[];
943
- };
944
- action: {
945
- requestId: string;
946
- actionId: string;
947
- resourceType?: string;
948
- resourceId?: string;
949
- inputHash: string;
950
- };
951
- issuedAt: string;
952
- expiresAt?: string;
953
- }
954
- declare class ActorEnvelopeValidationError extends Error {
955
- readonly path: string;
956
- constructor(path: string, message: string);
957
- }
958
- declare function parseActorEnvelope(value: unknown): ActorEnvelope;
959
- declare function canonicalizeActorEnvelope(value: unknown): string;
960
- declare function canonicalJson(value: unknown): string;
961
- declare function sha256CanonicalValue(value: unknown): Promise<string>;
962
-
963
987
  interface TopoloWorkspace {
964
988
  id: string;
965
989
  appId: string;
@@ -1652,4 +1676,4 @@ declare function createTopolo(options: TopoloClientOptions): {
1652
1676
  };
1653
1677
  type Topolo = ReturnType<typeof createTopolo>;
1654
1678
 
1655
- export { ACTION_CATALOG_DIGEST_ALGORITHM, ACTOR_ENVELOPE_VERSION, type AccountableSubject, type AccountableSubjectType, type ActionContractManifest, type ActionContractSource, type ActorAssurance, type ActorChannel, type ActorDelegationHop, type ActorEnvelope, ActorEnvelopeValidationError, type ActorIdentity, type ActorPrincipalType, type AgentIdentity, type AppApiId, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationDirectory, type ApplicationDirectoryApplication, type ApplicationDirectoryClient, type ApplicationDirectorySource, type ApplicationId, type CredentialIntrospection, type CrmContactSummary, CrmModule, DEFAULT_APP_URLS, type DeviceAuthorizationResponse, IdentityModule, type ListContactsOptions, type ListContactsResult, type OAuthHelperOptions, type P2PActionDetail, type P2PActionRequestInput, type P2PActionRequestResult, type P2PActionRow, type P2PActionRun, type P2PCapability, type P2PConnection, type P2PHold, type P2PLedgerEntry, P2PModule, type P2PPolicy, type P2PPricingModel, type P2PSettlementBatch, type P2PSettlementGroup, type PublishCapabilityInput, type RequestOptions, type ServiceCatalogUrlEntry, TOPOLO_ENVIRONMENT_SERVICE_URLS, TOPOLO_RUNTIME_ENVIRONMENTS, TOPOLO_WIDGET_CONTRACT_VERSION, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_OUTPUT_SCHEMA, TOPOLO_WIDGET_REFRESH_INTERVAL_MS, type TokenResponse, type Topolo, type TopoloActionAgentContract, type TopoloActionCatalogEntry, type TopoloActionCatalogSummary, type TopoloActionDigestInput, type TopoloActionPlan, type TopoloActionPreparation, type TopoloActionUploadOptions, type TopoloActionValidationIssue, type TopoloActionValidationResult, type TopoloActionsWidget, type TopoloActivityWidget, type TopoloAgentExecutionContext, type TopoloApiKeyResourceMetadata, TopoloAuthError, type TopoloBinaryResponse, type TopoloBindableResource, type TopoloBindableResourceCatalog, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, TopoloConfirmationRequiredError, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloInlineBase64UploadContract, type TopoloJsonSchema, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloRuntimeEnvironment, TopoloSdkError, type TopoloServiceCatalogEntry, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetAccessibility, type TopoloWidgetActionBinding, type TopoloWidgetActionRecovery, type TopoloWidgetActivityItem, type TopoloWidgetApiError, type TopoloWidgetApiErrorResponse, type TopoloWidgetApiResponse, type TopoloWidgetApiSuccessResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetConfiguration, type TopoloWidgetConfigurationField, type TopoloWidgetConfigurationOption, type TopoloWidgetContext, type TopoloWidgetContribution, type TopoloWidgetDatasetDefinition, type TopoloWidgetDimension, type TopoloWidgetDimensionDefinition, type TopoloWidgetDraft, type TopoloWidgetDrilldown, type TopoloWidgetErrorResponseOptions, type TopoloWidgetEventDefinition, type TopoloWidgetLifecycleStage, type TopoloWidgetLocalization, type TopoloWidgetMetric, type TopoloWidgetMetricAggregation, type TopoloWidgetMetricComparison, type TopoloWidgetMetricDefinition, type TopoloWidgetMetricSemantic, type TopoloWidgetNotificationItem, type TopoloWidgetPeriod, type TopoloWidgetPresentation, type TopoloWidgetRefreshPolicy, type TopoloWidgetResourceBinding, type TopoloWidgetResponseOptions, type TopoloWidgetSeries, type TopoloWidgetSeriesDefinition, type TopoloWidgetSeriesPoint, type TopoloWidgetSize, type TopoloWidgetState, type TopoloWidgetStatus, type TopoloWidgetType, type TopoloWidgetValidationResult, type TopoloWidgetVisualizationFamily, type TopoloWidgetWorkspaceSelector, type TopoloWorkspace, type TopoloWorkspaceListResult, type TopoloWorkspaceMutationResult, type TopoloWorkspacePolicy, WorkspacesModule, actionContractCompleteness, applicationEntryFromCatalog, assertTopoloServiceUrlEnvironment, canonicalJson, canonicalTopoloErrorCode, canonicalTopoloRequestId, canonicalTopoloRequired, canonicalTopoloRetryAfter, canonicalizeActorEnvelope, compactActionCatalogEntry, compactActionPlan, compactActionPreparation, compactActionResult, compactActionValidation, createTopolo, createTopoloAgentExecutionContext, createTopoloWidgetError, createTopoloWidgetResponse, defineTopoloActionsWidget, defineTopoloActivityWidget, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloStatsWidget, digestTopoloActionCatalog, encodeTopoloActionBase64, enrichActionContract, extractTopoloServiceErrorCode, extractTopoloServiceErrorDetails, formatDirectoryApplicationIds, friendlyAppId, isTopoloWidgetOutputSchema, listApplicationDirectory, parseActorEnvelope, parseTopoloActionUploadContract, preferExactActionMatches, prepareTopoloActionBase64UploadInput, prepareTopoloActionUploadInput, publicTopoloErrorMessage, resolveApplicationDirectoryEntry, resolveCatalogServiceUrl, resolveServiceUrl, sha256CanonicalValue, topoloErrorHint, topoloServiceOrigins, validateTopoloActionInput, validateTopoloWidgetResponse };
1679
+ export { ACTION_CATALOG_DIGEST_ALGORITHM, ACTOR_ENVELOPE_VERSION, type AccountableSubject, type AccountableSubjectType, type ActionContractManifest, type ActionContractSource, type ActorAssurance, type ActorChannel, type ActorDelegationHop, type ActorEnvelope, ActorEnvelopeValidationError, type ActorIdentity, type ActorPrincipalType, type AgentIdentity, type AppApiId, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationDirectory, type ApplicationDirectoryApplication, type ApplicationDirectoryClient, type ApplicationDirectorySource, type ApplicationId, type CredentialIntrospection, type CrmContactSummary, CrmModule, DEFAULT_APP_URLS, type DeviceAuthorizationResponse, IdentityModule, type ListContactsOptions, type ListContactsResult, type OAuthHelperOptions, type P2PActionDetail, type P2PActionRequestInput, type P2PActionRequestResult, type P2PActionRow, type P2PActionRun, type P2PCapability, type P2PConnection, type P2PHold, type P2PLedgerEntry, P2PModule, type P2PPolicy, type P2PPricingModel, type P2PSettlementBatch, type P2PSettlementGroup, type PublishCapabilityInput, type RequestOptions, type ServiceCatalogUrlEntry, TOPOLO_ACTOR_ENVELOPE_HEADER, TOPOLO_ENVIRONMENT_SERVICE_URLS, TOPOLO_RUNTIME_ENVIRONMENTS, TOPOLO_WIDGET_CONTRACT_VERSION, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_OUTPUT_SCHEMA, TOPOLO_WIDGET_REFRESH_INTERVAL_MS, type TokenResponse, type Topolo, type TopoloActionAgentContract, type TopoloActionCatalogEntry, type TopoloActionCatalogSummary, type TopoloActionDigestInput, type TopoloActionPlan, type TopoloActionPreparation, type TopoloActionUploadOptions, type TopoloActionValidationIssue, type TopoloActionValidationResult, type TopoloActionsWidget, type TopoloActivityWidget, type TopoloAgentExecutionContext, type TopoloApiKeyResourceMetadata, TopoloAuthError, type TopoloBinaryResponse, type TopoloBindableResource, type TopoloBindableResourceCatalog, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, TopoloConfirmationRequiredError, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloInlineBase64UploadContract, type TopoloJsonSchema, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloRuntimeEnvironment, TopoloSdkError, type TopoloServiceCatalogEntry, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetAccessibility, type TopoloWidgetActionBinding, type TopoloWidgetActionRecovery, type TopoloWidgetActivityItem, type TopoloWidgetApiError, type TopoloWidgetApiErrorResponse, type TopoloWidgetApiResponse, type TopoloWidgetApiSuccessResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetConfiguration, type TopoloWidgetConfigurationField, type TopoloWidgetConfigurationOption, type TopoloWidgetContext, type TopoloWidgetContribution, type TopoloWidgetDatasetDefinition, type TopoloWidgetDimension, type TopoloWidgetDimensionDefinition, type TopoloWidgetDraft, type TopoloWidgetDrilldown, type TopoloWidgetErrorResponseOptions, type TopoloWidgetEventDefinition, type TopoloWidgetLifecycleStage, type TopoloWidgetLocalization, type TopoloWidgetMetric, type TopoloWidgetMetricAggregation, type TopoloWidgetMetricComparison, type TopoloWidgetMetricDefinition, type TopoloWidgetMetricSemantic, type TopoloWidgetNotificationItem, type TopoloWidgetPeriod, type TopoloWidgetPresentation, type TopoloWidgetRefreshPolicy, type TopoloWidgetResourceBinding, type TopoloWidgetResponseOptions, type TopoloWidgetSeries, type TopoloWidgetSeriesDefinition, type TopoloWidgetSeriesPoint, type TopoloWidgetSize, type TopoloWidgetState, type TopoloWidgetStatus, type TopoloWidgetType, type TopoloWidgetValidationResult, type TopoloWidgetVisualizationFamily, type TopoloWidgetWorkspaceSelector, type TopoloWorkspace, type TopoloWorkspaceListResult, type TopoloWorkspaceMutationResult, type TopoloWorkspacePolicy, WorkspacesModule, actionContractCompleteness, applicationEntryFromCatalog, assertTopoloServiceUrlEnvironment, canonicalJson, canonicalTopoloErrorCode, canonicalTopoloRequestId, canonicalTopoloRequired, canonicalTopoloRetryAfter, canonicalizeActorEnvelope, compactActionCatalogEntry, compactActionPlan, compactActionPreparation, compactActionResult, compactActionValidation, createTopolo, createTopoloAgentExecutionContext, createTopoloWidgetError, createTopoloWidgetResponse, decodeActorEnvelopeHeader, defineTopoloActionsWidget, defineTopoloActivityWidget, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloStatsWidget, digestTopoloActionCatalog, encodeActorEnvelopeHeader, encodeTopoloActionBase64, enrichActionContract, extractTopoloServiceErrorCode, extractTopoloServiceErrorDetails, formatDirectoryApplicationIds, friendlyAppId, isTopoloWidgetOutputSchema, listApplicationDirectory, parseActorEnvelope, parseTopoloActionUploadContract, preferExactActionMatches, prepareTopoloActionBase64UploadInput, prepareTopoloActionUploadInput, publicTopoloErrorMessage, resolveApplicationDirectoryEntry, resolveCatalogServiceUrl, resolveServiceUrl, sha256CanonicalValue, topoloErrorHint, topoloServiceOrigins, validateTopoloActionInput, validateTopoloWidgetResponse };
package/dist/index.d.ts CHANGED
@@ -48,6 +48,67 @@ interface TopoloActionValidationResult {
48
48
  }
49
49
  declare function validateTopoloActionInput(schema: Record<string, unknown>, input: unknown): TopoloActionValidationResult;
50
50
 
51
+ declare const ACTOR_ENVELOPE_VERSION: 1;
52
+ declare const TOPOLO_ACTOR_ENVELOPE_HEADER: "X-Topolo-Actor-Envelope";
53
+ type ActorPrincipalType = 'human' | 'managed_agent' | 'external_agent' | 'service' | 'browser_automation';
54
+ type AccountableSubjectType = 'human' | 'organization';
55
+ type ActorChannel = 'web' | 'mobile' | 'cli' | 'mcp' | 'api' | 'workflow' | 'browser_automation';
56
+ type ActorAssurance = 'authenticated' | 'workload_identity' | 'user_verified';
57
+ interface ActorIdentity {
58
+ principalType: ActorPrincipalType;
59
+ principalId: string;
60
+ displayName?: string;
61
+ installationId?: string;
62
+ agentInstanceId?: string;
63
+ browserSessionId?: string;
64
+ provider?: string;
65
+ model?: string;
66
+ }
67
+ interface AccountableSubject {
68
+ principalType: AccountableSubjectType;
69
+ principalId: string;
70
+ displayName?: string;
71
+ }
72
+ interface ActorDelegationHop {
73
+ principalType: ActorPrincipalType;
74
+ principalId: string;
75
+ }
76
+ interface ActorEnvelope {
77
+ schemaVersion: typeof ACTOR_ENVELOPE_VERSION;
78
+ organizationId: string;
79
+ accountableSubject: AccountableSubject;
80
+ performer: ActorIdentity;
81
+ delegation: {
82
+ taskId: string;
83
+ runId: string;
84
+ lineage: ActorDelegationHop[];
85
+ } | null;
86
+ channel: ActorChannel;
87
+ assurance: {
88
+ level: ActorAssurance;
89
+ methods: string[];
90
+ };
91
+ action: {
92
+ requestId: string;
93
+ actionId: string;
94
+ resourceType?: string;
95
+ resourceId?: string;
96
+ inputHash: string;
97
+ };
98
+ issuedAt: string;
99
+ expiresAt?: string;
100
+ }
101
+ declare class ActorEnvelopeValidationError extends Error {
102
+ readonly path: string;
103
+ constructor(path: string, message: string);
104
+ }
105
+ declare function parseActorEnvelope(value: unknown): ActorEnvelope;
106
+ declare function canonicalizeActorEnvelope(value: unknown): string;
107
+ declare function encodeActorEnvelopeHeader(value: unknown): string;
108
+ declare function decodeActorEnvelopeHeader(value: string): ActorEnvelope;
109
+ declare function canonicalJson(value: unknown): string;
110
+ declare function sha256CanonicalValue(value: unknown): Promise<string>;
111
+
51
112
  interface TopoloInlineBase64UploadContract {
52
113
  profile: 'inline-base64';
53
114
  contentField: string;
@@ -85,6 +146,12 @@ declare function encodeTopoloActionBase64(bytes: Uint8Array): string;
85
146
  interface TopoloClientOptions {
86
147
  credential: TopoloCredential;
87
148
  agent: AgentIdentity;
149
+ /** Host surface used to attribute actions performed with verified agent credentials. */
150
+ actorContext?: {
151
+ channel: ActorChannel;
152
+ taskId?: string;
153
+ runId?: string;
154
+ };
88
155
  /** Per-service URL overrides. Useful for staging/dev. */
89
156
  serviceUrls?: Record<string, string>;
90
157
  /** Explicit environment used to reject cross-environment service and action origins. */
@@ -164,6 +231,8 @@ interface RequestOptions {
164
231
  };
165
232
  /** Explicit write-acknowledgement for mutating calls. */
166
233
  confirm?: boolean;
234
+ /** Canonical accountable-subject and performer provenance for this request. */
235
+ actorEnvelope?: ActorEnvelope;
167
236
  /** Extra headers appended after auth/audit headers. */
168
237
  headers?: Record<string, string>;
169
238
  signal?: AbortSignal;
@@ -340,6 +409,7 @@ interface TopoloCatalogSearchOptions {
340
409
  declare class TopoloClient {
341
410
  private credential;
342
411
  private readonly agent;
412
+ private readonly actorContext?;
343
413
  private readonly serviceUrls?;
344
414
  private readonly environment?;
345
415
  private readonly appIds?;
@@ -426,6 +496,7 @@ declare class TopoloClient {
426
496
  resourceType: string;
427
497
  resourceId: string;
428
498
  };
499
+ actorEnvelope?: ActorEnvelope;
429
500
  }): Promise<T>;
430
501
  uploadAction<T = unknown>(action: string, content: Uint8Array | ArrayBuffer, input: Record<string, unknown>, options: TopoloActionUploadOptions & {
431
502
  confirm?: boolean;
@@ -467,8 +538,10 @@ declare class TopoloClient {
467
538
  resourceType: string;
468
539
  resourceId: string;
469
540
  };
541
+ actorEnvelope?: ActorEnvelope;
470
542
  }): Promise<T>;
471
543
  private executeResolvedAction;
544
+ private buildVerifiedAgentActorEnvelope;
472
545
  /**
473
546
  * Introspect the current credential. Returns the caller's resolved identity,
474
547
  * organization, and permission set. Used by CLI `whoami` and by MCP to gate
@@ -489,6 +562,15 @@ interface CredentialIntrospection {
489
562
  name: string | null;
490
563
  role: string;
491
564
  permissions: string[];
565
+ principalId?: string | null;
566
+ principalType?: 'agent_employee' | 'external_agent' | null;
567
+ accountableUserId?: string | null;
568
+ agentInstanceId?: string | null;
569
+ installationId?: string | null;
570
+ provider?: string | null;
571
+ model?: string | null;
572
+ serviceScopes?: string[];
573
+ policyRef?: string | null;
492
574
  };
493
575
  organization: {
494
576
  id: string;
@@ -902,64 +984,6 @@ declare class IdentityModule {
902
984
  whoami(): Promise<CredentialIntrospection>;
903
985
  }
904
986
 
905
- declare const ACTOR_ENVELOPE_VERSION: 1;
906
- type ActorPrincipalType = 'human' | 'managed_agent' | 'external_agent' | 'service' | 'browser_automation';
907
- type AccountableSubjectType = 'human' | 'organization';
908
- type ActorChannel = 'web' | 'mobile' | 'cli' | 'mcp' | 'api' | 'workflow' | 'browser_automation';
909
- type ActorAssurance = 'authenticated' | 'workload_identity' | 'user_verified';
910
- interface ActorIdentity {
911
- principalType: ActorPrincipalType;
912
- principalId: string;
913
- displayName?: string;
914
- installationId?: string;
915
- agentInstanceId?: string;
916
- browserSessionId?: string;
917
- provider?: string;
918
- model?: string;
919
- }
920
- interface AccountableSubject {
921
- principalType: AccountableSubjectType;
922
- principalId: string;
923
- displayName?: string;
924
- }
925
- interface ActorDelegationHop {
926
- principalType: ActorPrincipalType;
927
- principalId: string;
928
- }
929
- interface ActorEnvelope {
930
- schemaVersion: typeof ACTOR_ENVELOPE_VERSION;
931
- organizationId: string;
932
- accountableSubject: AccountableSubject;
933
- performer: ActorIdentity;
934
- delegation: {
935
- taskId: string;
936
- runId: string;
937
- lineage: ActorDelegationHop[];
938
- } | null;
939
- channel: ActorChannel;
940
- assurance: {
941
- level: ActorAssurance;
942
- methods: string[];
943
- };
944
- action: {
945
- requestId: string;
946
- actionId: string;
947
- resourceType?: string;
948
- resourceId?: string;
949
- inputHash: string;
950
- };
951
- issuedAt: string;
952
- expiresAt?: string;
953
- }
954
- declare class ActorEnvelopeValidationError extends Error {
955
- readonly path: string;
956
- constructor(path: string, message: string);
957
- }
958
- declare function parseActorEnvelope(value: unknown): ActorEnvelope;
959
- declare function canonicalizeActorEnvelope(value: unknown): string;
960
- declare function canonicalJson(value: unknown): string;
961
- declare function sha256CanonicalValue(value: unknown): Promise<string>;
962
-
963
987
  interface TopoloWorkspace {
964
988
  id: string;
965
989
  appId: string;
@@ -1652,4 +1676,4 @@ declare function createTopolo(options: TopoloClientOptions): {
1652
1676
  };
1653
1677
  type Topolo = ReturnType<typeof createTopolo>;
1654
1678
 
1655
- export { ACTION_CATALOG_DIGEST_ALGORITHM, ACTOR_ENVELOPE_VERSION, type AccountableSubject, type AccountableSubjectType, type ActionContractManifest, type ActionContractSource, type ActorAssurance, type ActorChannel, type ActorDelegationHop, type ActorEnvelope, ActorEnvelopeValidationError, type ActorIdentity, type ActorPrincipalType, type AgentIdentity, type AppApiId, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationDirectory, type ApplicationDirectoryApplication, type ApplicationDirectoryClient, type ApplicationDirectorySource, type ApplicationId, type CredentialIntrospection, type CrmContactSummary, CrmModule, DEFAULT_APP_URLS, type DeviceAuthorizationResponse, IdentityModule, type ListContactsOptions, type ListContactsResult, type OAuthHelperOptions, type P2PActionDetail, type P2PActionRequestInput, type P2PActionRequestResult, type P2PActionRow, type P2PActionRun, type P2PCapability, type P2PConnection, type P2PHold, type P2PLedgerEntry, P2PModule, type P2PPolicy, type P2PPricingModel, type P2PSettlementBatch, type P2PSettlementGroup, type PublishCapabilityInput, type RequestOptions, type ServiceCatalogUrlEntry, TOPOLO_ENVIRONMENT_SERVICE_URLS, TOPOLO_RUNTIME_ENVIRONMENTS, TOPOLO_WIDGET_CONTRACT_VERSION, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_OUTPUT_SCHEMA, TOPOLO_WIDGET_REFRESH_INTERVAL_MS, type TokenResponse, type Topolo, type TopoloActionAgentContract, type TopoloActionCatalogEntry, type TopoloActionCatalogSummary, type TopoloActionDigestInput, type TopoloActionPlan, type TopoloActionPreparation, type TopoloActionUploadOptions, type TopoloActionValidationIssue, type TopoloActionValidationResult, type TopoloActionsWidget, type TopoloActivityWidget, type TopoloAgentExecutionContext, type TopoloApiKeyResourceMetadata, TopoloAuthError, type TopoloBinaryResponse, type TopoloBindableResource, type TopoloBindableResourceCatalog, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, TopoloConfirmationRequiredError, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloInlineBase64UploadContract, type TopoloJsonSchema, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloRuntimeEnvironment, TopoloSdkError, type TopoloServiceCatalogEntry, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetAccessibility, type TopoloWidgetActionBinding, type TopoloWidgetActionRecovery, type TopoloWidgetActivityItem, type TopoloWidgetApiError, type TopoloWidgetApiErrorResponse, type TopoloWidgetApiResponse, type TopoloWidgetApiSuccessResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetConfiguration, type TopoloWidgetConfigurationField, type TopoloWidgetConfigurationOption, type TopoloWidgetContext, type TopoloWidgetContribution, type TopoloWidgetDatasetDefinition, type TopoloWidgetDimension, type TopoloWidgetDimensionDefinition, type TopoloWidgetDraft, type TopoloWidgetDrilldown, type TopoloWidgetErrorResponseOptions, type TopoloWidgetEventDefinition, type TopoloWidgetLifecycleStage, type TopoloWidgetLocalization, type TopoloWidgetMetric, type TopoloWidgetMetricAggregation, type TopoloWidgetMetricComparison, type TopoloWidgetMetricDefinition, type TopoloWidgetMetricSemantic, type TopoloWidgetNotificationItem, type TopoloWidgetPeriod, type TopoloWidgetPresentation, type TopoloWidgetRefreshPolicy, type TopoloWidgetResourceBinding, type TopoloWidgetResponseOptions, type TopoloWidgetSeries, type TopoloWidgetSeriesDefinition, type TopoloWidgetSeriesPoint, type TopoloWidgetSize, type TopoloWidgetState, type TopoloWidgetStatus, type TopoloWidgetType, type TopoloWidgetValidationResult, type TopoloWidgetVisualizationFamily, type TopoloWidgetWorkspaceSelector, type TopoloWorkspace, type TopoloWorkspaceListResult, type TopoloWorkspaceMutationResult, type TopoloWorkspacePolicy, WorkspacesModule, actionContractCompleteness, applicationEntryFromCatalog, assertTopoloServiceUrlEnvironment, canonicalJson, canonicalTopoloErrorCode, canonicalTopoloRequestId, canonicalTopoloRequired, canonicalTopoloRetryAfter, canonicalizeActorEnvelope, compactActionCatalogEntry, compactActionPlan, compactActionPreparation, compactActionResult, compactActionValidation, createTopolo, createTopoloAgentExecutionContext, createTopoloWidgetError, createTopoloWidgetResponse, defineTopoloActionsWidget, defineTopoloActivityWidget, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloStatsWidget, digestTopoloActionCatalog, encodeTopoloActionBase64, enrichActionContract, extractTopoloServiceErrorCode, extractTopoloServiceErrorDetails, formatDirectoryApplicationIds, friendlyAppId, isTopoloWidgetOutputSchema, listApplicationDirectory, parseActorEnvelope, parseTopoloActionUploadContract, preferExactActionMatches, prepareTopoloActionBase64UploadInput, prepareTopoloActionUploadInput, publicTopoloErrorMessage, resolveApplicationDirectoryEntry, resolveCatalogServiceUrl, resolveServiceUrl, sha256CanonicalValue, topoloErrorHint, topoloServiceOrigins, validateTopoloActionInput, validateTopoloWidgetResponse };
1679
+ export { ACTION_CATALOG_DIGEST_ALGORITHM, ACTOR_ENVELOPE_VERSION, type AccountableSubject, type AccountableSubjectType, type ActionContractManifest, type ActionContractSource, type ActorAssurance, type ActorChannel, type ActorDelegationHop, type ActorEnvelope, ActorEnvelopeValidationError, type ActorIdentity, type ActorPrincipalType, type AgentIdentity, type AppApiId, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationDirectory, type ApplicationDirectoryApplication, type ApplicationDirectoryClient, type ApplicationDirectorySource, type ApplicationId, type CredentialIntrospection, type CrmContactSummary, CrmModule, DEFAULT_APP_URLS, type DeviceAuthorizationResponse, IdentityModule, type ListContactsOptions, type ListContactsResult, type OAuthHelperOptions, type P2PActionDetail, type P2PActionRequestInput, type P2PActionRequestResult, type P2PActionRow, type P2PActionRun, type P2PCapability, type P2PConnection, type P2PHold, type P2PLedgerEntry, P2PModule, type P2PPolicy, type P2PPricingModel, type P2PSettlementBatch, type P2PSettlementGroup, type PublishCapabilityInput, type RequestOptions, type ServiceCatalogUrlEntry, TOPOLO_ACTOR_ENVELOPE_HEADER, TOPOLO_ENVIRONMENT_SERVICE_URLS, TOPOLO_RUNTIME_ENVIRONMENTS, TOPOLO_WIDGET_CONTRACT_VERSION, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_OUTPUT_SCHEMA, TOPOLO_WIDGET_REFRESH_INTERVAL_MS, type TokenResponse, type Topolo, type TopoloActionAgentContract, type TopoloActionCatalogEntry, type TopoloActionCatalogSummary, type TopoloActionDigestInput, type TopoloActionPlan, type TopoloActionPreparation, type TopoloActionUploadOptions, type TopoloActionValidationIssue, type TopoloActionValidationResult, type TopoloActionsWidget, type TopoloActivityWidget, type TopoloAgentExecutionContext, type TopoloApiKeyResourceMetadata, TopoloAuthError, type TopoloBinaryResponse, type TopoloBindableResource, type TopoloBindableResourceCatalog, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, TopoloConfirmationRequiredError, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloInlineBase64UploadContract, type TopoloJsonSchema, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloRuntimeEnvironment, TopoloSdkError, type TopoloServiceCatalogEntry, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetAccessibility, type TopoloWidgetActionBinding, type TopoloWidgetActionRecovery, type TopoloWidgetActivityItem, type TopoloWidgetApiError, type TopoloWidgetApiErrorResponse, type TopoloWidgetApiResponse, type TopoloWidgetApiSuccessResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetConfiguration, type TopoloWidgetConfigurationField, type TopoloWidgetConfigurationOption, type TopoloWidgetContext, type TopoloWidgetContribution, type TopoloWidgetDatasetDefinition, type TopoloWidgetDimension, type TopoloWidgetDimensionDefinition, type TopoloWidgetDraft, type TopoloWidgetDrilldown, type TopoloWidgetErrorResponseOptions, type TopoloWidgetEventDefinition, type TopoloWidgetLifecycleStage, type TopoloWidgetLocalization, type TopoloWidgetMetric, type TopoloWidgetMetricAggregation, type TopoloWidgetMetricComparison, type TopoloWidgetMetricDefinition, type TopoloWidgetMetricSemantic, type TopoloWidgetNotificationItem, type TopoloWidgetPeriod, type TopoloWidgetPresentation, type TopoloWidgetRefreshPolicy, type TopoloWidgetResourceBinding, type TopoloWidgetResponseOptions, type TopoloWidgetSeries, type TopoloWidgetSeriesDefinition, type TopoloWidgetSeriesPoint, type TopoloWidgetSize, type TopoloWidgetState, type TopoloWidgetStatus, type TopoloWidgetType, type TopoloWidgetValidationResult, type TopoloWidgetVisualizationFamily, type TopoloWidgetWorkspaceSelector, type TopoloWorkspace, type TopoloWorkspaceListResult, type TopoloWorkspaceMutationResult, type TopoloWorkspacePolicy, WorkspacesModule, actionContractCompleteness, applicationEntryFromCatalog, assertTopoloServiceUrlEnvironment, canonicalJson, canonicalTopoloErrorCode, canonicalTopoloRequestId, canonicalTopoloRequired, canonicalTopoloRetryAfter, canonicalizeActorEnvelope, compactActionCatalogEntry, compactActionPlan, compactActionPreparation, compactActionResult, compactActionValidation, createTopolo, createTopoloAgentExecutionContext, createTopoloWidgetError, createTopoloWidgetResponse, decodeActorEnvelopeHeader, defineTopoloActionsWidget, defineTopoloActivityWidget, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloStatsWidget, digestTopoloActionCatalog, encodeActorEnvelopeHeader, encodeTopoloActionBase64, enrichActionContract, extractTopoloServiceErrorCode, extractTopoloServiceErrorDetails, formatDirectoryApplicationIds, friendlyAppId, isTopoloWidgetOutputSchema, listApplicationDirectory, parseActorEnvelope, parseTopoloActionUploadContract, preferExactActionMatches, prepareTopoloActionBase64UploadInput, prepareTopoloActionUploadInput, publicTopoloErrorMessage, resolveApplicationDirectoryEntry, resolveCatalogServiceUrl, resolveServiceUrl, sha256CanonicalValue, topoloErrorHint, topoloServiceOrigins, validateTopoloActionInput, validateTopoloWidgetResponse };