@loomcycle/client 1.124.0 → 1.126.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +158 -0
- package/dist/cjs/client-tools.js +28 -5
- package/dist/cjs/client.js +310 -10
- package/dist/cjs/device-login.js +146 -0
- package/dist/cjs/errors.js +40 -1
- package/dist/cjs/fetch-helpers.js +31 -0
- package/dist/cjs/index.js +35 -1
- package/dist/cjs/oauth.js +400 -0
- package/dist/client-tools.d.ts +6 -2
- package/dist/client-tools.js +28 -5
- package/dist/client.d.ts +226 -4
- package/dist/client.js +311 -11
- package/dist/device-login.d.ts +12 -0
- package/dist/device-login.js +143 -0
- package/dist/errors.d.ts +36 -0
- package/dist/errors.js +37 -0
- package/dist/fetch-helpers.d.ts +8 -0
- package/dist/fetch-helpers.js +30 -0
- package/dist/index.d.ts +31 -2
- package/dist/index.js +29 -1
- package/dist/oauth.d.ts +131 -0
- package/dist/oauth.js +393 -0
- package/dist/types.d.ts +593 -12
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -24,11 +24,18 @@
|
|
|
24
24
|
* full mapping table.
|
|
25
25
|
*/
|
|
26
26
|
import { InteractiveSession } from "./interactive.js";
|
|
27
|
+
import { LoomcycleOAuth } from "./oauth.js";
|
|
27
28
|
import { ClientToolHost, type ConnectClientToolsOptions } from "./client-tools.js";
|
|
28
|
-
import type { ChangeFeedFrame, StreamChangesOptions, CredentialListResponse, CredentialMeta, CryptoKeyEncoding, CryptoKeyExport, CryptoKeyExternal, CryptoKeyType, CryptoRequest, CryptoResultByOp, DecideRequest, DecideResponse, DecisionModelsResponse, CredentialScope, DirectoryInspection, DirectoryTenant, DirectoryUser, ErasureReport, ErasureResult, Agent, AgentEvent, AgentList, CancelAgentResult, ClientOptions, ContinueOptions, RunOverrideOptions, EffectiveConfigResponse, AgentOverridableResponse, RetuneRunResponse, RunConfigResponse, RunPromptResponse, CreateSnapshotOptions, EnsureCodeAgentOptions, EnsureCodeAgentResult, EnsureHookDefOptions, EnsureHookDefResult, HookDefInput, HookDefOverlay, HookDefRowResponse, CreateDefOptions, ForkDefOptions, HookDefForkOverlay, ScheduleDefInput, ScheduleDefOverlay, ScheduleDefRowResponse, WebhookDefInput, WebhookDefOverlay, WebhookDefRowResponse, EnsureMcpServerOptions, EnsureMcpServerResult, HealthResponse, InterruptListResponse, InterruptStatus, ListUserAgentsOptions, WalkRunsPage, AckChannelOptions, AwaitChannelsOptions, BroadcastChannelsOptions, ChannelAckResult, ChannelAwaitResult, ChannelBroadcastResult, ChannelDescriptor, ChannelPeekResult, ListTeamChannelsOptions, PeekTeamChannelOptions, ReleaseTeamChannelOptions, TeamChannelPeekResult, TeamChannelReleaseResult, TeamChannelsResult, ChannelPublishResult, ChannelPurgeResult, ChannelReleaseResult, ChannelSubscribeResult, CreateChannelOptions, ListChannelsResponse, PeekChannelOptions, PublishChannelOptions, ReleaseChannelOptions, SetMemoryEntryOptions, SetMemoryEntryResponse, SubscribeChannelOptions, UpdateChannelOptions, LibraryAgentDefinition, LibraryListResponse, LibraryMcpServerDefinition, LibrarySkillDefinition, ListUsersResponse, UserRecord, CreateUserBody, UpdateUserBody, MintedUserToken, ListUserTokensResponse, RunnableAgentsResponse, LLMChatOptions, LLMChatResponse, LLMChatStreamItem, LLMEmbeddingsOptions, LLMEmbeddingsResponse, MCPServerDefVerifyResult, MemoryEmbedStatsResponse, MemoryEntriesResponse, MemoryEntryResponse, MemoryBackfillResponse, MemoryPurgeResponse, MemoryReembedResponse, MemoryScopeIDsResponse, MemoryScopesResponse, MemorySearchInput, MemorySearchResponse, PauseResult, RetentionOverride, PersistentVolumesResponse, EphemeralVolumesResponse, ResolveInterruptOptions, ResumeResult, ResolverMatrix, CompactRunResult, RunTreeDeletion, ReplaySessionResult, CancelTurnResult, ReviewRunResult, RunBatchOptions, RunBatchResult, RunOptions, ConfiguredRun, ConfiguredRunPatch, RunStateStreamItem, RuntimeStateResponse, SnapshotCreateResponse, SnapshotDescriptor, SnapshotEnvelope, SnapshotRestoreResponse, StreamUserRunStatesOptions, SubstrateToolInput, SubstrateToolResponse, CreatedTeam, CreateTeamOptions, DefNamesResponse, ForkTeamOptions, ModelAliasesResponse, OperatorTokenDefNamesResponse, ProviderModelsResponse, RoutingResponse, ScheduleListResponse, SchedulePauseResult, ScheduleRunNowResult, ScheduleStateView, ListTeamsResponse, PromotedTeam, RetiredTeam, TeamBreakpoints, TeamDefDetail, TeamRunDetached, TeamRunTarget, TeamVerification, TeamDraft, TeamDraftVerification, TeamVersionList, TeamDiagram, TeamRunResult, PathToolInput, PathToolResponse, DocumentToolInput, DocumentToolResponse, HistoryToolInput, HistoryToolResponse, EvaluationSubmitInput, EvaluationGetInput, EvaluationListForRunInput, EvaluationListForDefInput, EvaluationAggregateInput, EvaluationInput, EvaluationSubmitResult, EvaluationRecord, EvaluationListForRunResult, EvaluationListForDefResult, EvaluationAggregate, TranscriptResponse, WhoamiResponse, UsageDimension, UsageReportResponse, TokenLimit, TokenLimitsResponse, ConfigResponse, SetTokenLimitRequest, AclBinding, AclBindingListResponse, AclCatalog, AclDefInput, AclDefListResponse, AclDefNamesResponse, AclDefRow, AclRule, AclValidateResult, AuthzDecision, AuthzEvaluationRequest, AuthzEvaluationsRequest, AuthzEvaluationsResponse, AuthzExplainResponse, AuthzSimulateRequest, AuthzSimulateResponse, CreateAclBindingBody, CreateGroupBody, GroupDetail, GroupEffective, GroupListResponse, GroupMemberChange, GroupMemberKind, GroupRow } from "./types.js";
|
|
29
|
+
import type { ChangeFeedFrame, StreamChangesOptions, CredentialListResponse, CredentialMeta, CryptoKeyEncoding, CryptoKeyExport, CryptoKeyExternal, CryptoKeyType, CryptoRequest, CryptoResultByOp, DecideRequest, DecideResponse, DecisionModelsResponse, CredentialScope, DirectoryInspection, DirectoryTenant, DirectoryUser, ErasureReport, ErasureResult, Agent, AgentEvent, AgentList, CancelAgentResult, ClientOptions, ContinueOptions, RunOverrideOptions, EffectiveConfigResponse, RunFileInput, RunInboxDownload, AgentOverridableResponse, RetuneRunResponse, RunConfigResponse, RunPromptResponse, CreateSnapshotOptions, EnsureCodeAgentOptions, EnsureCodeAgentResult, EnsureHookDefOptions, EnsureHookDefResult, HookDefInput, HookDefOverlay, HookDefRowResponse, CreateDefOptions, ForkDefOptions, HookDefForkOverlay, ScheduleDefInput, ScheduleDefOverlay, ScheduleDefRowResponse, WebhookDefInput, WebhookDefOverlay, WebhookDefRowResponse, EnsureMcpServerOptions, EnsureMcpServerResult, HealthResponse, InterruptListResponse, InterruptStatus, ListUserAgentsOptions, WalkRunsPage, AckChannelOptions, AwaitChannelsOptions, BroadcastChannelsOptions, ChannelAckResult, ChannelAwaitResult, ChannelBroadcastResult, ChannelDescriptor, ChannelPeekResult, ListTeamChannelsOptions, PeekTeamChannelOptions, ReleaseTeamChannelOptions, TeamChannelPeekResult, TeamChannelReleaseResult, TeamChannelsResult, ChannelPublishResult, ChannelPurgeResult, ChannelReleaseResult, ChannelSubscribeResult, CreateChannelOptions, ListChannelsResponse, PeekChannelOptions, PublishChannelOptions, ReleaseChannelOptions, SetMemoryEntryOptions, SetMemoryEntryResponse, SubscribeChannelOptions, UpdateChannelOptions, LibraryAgentDefinition, LibraryListResponse, LibraryMcpServerDefinition, LibrarySkillDefinition, ListUsersResponse, UserRecord, CreateUserBody, UpdateUserBody, MintedUserToken, ListUserTokensResponse, UserIdentitiesResponse, AuthGateListResponse, CreateInviteBody, CreatedInvite, AuthInviteListResponse, CreatedPasswordReset, GateIdentitiesResponse, GateTenantStatus, RunnableAgentsResponse, LLMChatOptions, LLMChatResponse, LLMChatStreamItem, LLMEmbeddingsOptions, LLMEmbeddingsResponse, MCPServerDefVerifyResult, MemoryEmbedStatsResponse, MemoryEntriesResponse, MemoryEntryResponse, MemoryBackfillResponse, MemoryPurgeResponse, MemoryReembedResponse, MemoryScopeIDsResponse, MemoryScopesResponse, MemorySearchInput, MemorySearchResponse, PauseResult, RetentionOverride, PersistentVolumesResponse, EphemeralVolumesResponse, ResolveInterruptOptions, ResumeResult, ResolverMatrix, CompactRunResult, RunTreeDeletion, ReplaySessionResult, CancelTurnResult, ReviewRunResult, RunBatchOptions, RunBatchResult, RunOptions, ConfiguredRun, ConfiguredRunPatch, RunStateStreamItem, RuntimeStateResponse, SnapshotCreateResponse, SnapshotDescriptor, SnapshotEnvelope, SnapshotRestoreResponse, StreamUserRunStatesOptions, SubstrateToolInput, SubstrateToolResponse, CreatedTeam, CreateTeamOptions, DefNamesResponse, ForkTeamOptions, ModelAliasesResponse, OperatorTokenDefNamesResponse, ProviderModelsResponse, RoutingResponse, ScheduleListResponse, SchedulePauseResult, ScheduleRunNowResult, ScheduleStateView, ListTeamsResponse, PromotedTeam, RetiredTeam, TeamBreakpoints, TeamDefDetail, TeamRunDetached, TeamRunTarget, TeamVerification, TeamDraft, TeamDraftVerification, TeamVersionList, TeamDiagram, TeamRunResult, PathToolInput, PathToolResponse, DocumentToolInput, DocumentToolResponse, HistoryToolInput, HistoryToolResponse, EvaluationSubmitInput, EvaluationGetInput, EvaluationListForRunInput, EvaluationListForDefInput, EvaluationAggregateInput, EvaluationInput, EvaluationSubmitResult, EvaluationRecord, EvaluationListForRunResult, EvaluationListForDefResult, EvaluationAggregate, TranscriptResponse, WhoamiResponse, UsageDimension, UsageBucket, UsageReportResponse, TokenLimit, TokenLimitsResponse, ConfigResponse, SetTokenLimitRequest, AclBinding, AclBindingListResponse, AclCatalog, AclDefInput, AclDefListResponse, AclDefNamesResponse, AclDefRow, AclRule, AclValidateResult, AuthzDecision, AuthzEvaluationRequest, AuthzEvaluationsRequest, AuthzEvaluationsResponse, AuthzExplainResponse, AuthzSimulateRequest, AuthzSimulateResponse, CreateAclBindingBody, CreateGroupBody, GroupDetail, GroupEffective, GroupListResponse, GroupMemberChange, GroupMemberKind, GroupRow, AppClientConfig, AppClientEntry, ClientDefInput, ClientDefListResponse, ClientDefNamesResponse, ClientDefRecord, ClientDefRetireResult, ClientDefVerifyResult, DeviceLoginOptions, DeviceLoginResult } from "./types.js";
|
|
29
30
|
export declare class LoomcycleClient {
|
|
30
31
|
private ctx;
|
|
32
|
+
private readonly tokenProvider?;
|
|
33
|
+
private oauthHelper?;
|
|
34
|
+
private readonly rawFetch?;
|
|
31
35
|
constructor(opts?: ClientOptions);
|
|
36
|
+
/** The app sign-in helper (RFC FL) for this server: same base URL and
|
|
37
|
+
* fetch, never this client's bearer. See {@link LoomcycleOAuth}. */
|
|
38
|
+
get oauth(): LoomcycleOAuth;
|
|
32
39
|
/**
|
|
33
40
|
* Run an agent and stream events. Returns AsyncIterable<AgentEvent>;
|
|
34
41
|
* the iterator completes when the server closes the SSE stream.
|
|
@@ -183,6 +190,33 @@ export declare class LoomcycleClient {
|
|
|
183
190
|
getEffectiveConfig(runId: string, opts?: {
|
|
184
191
|
signal?: AbortSignal;
|
|
185
192
|
}): Promise<EffectiveConfigResponse>;
|
|
193
|
+
/** Run one File-tool op on a run's inbox from outside the run — the files the
|
|
194
|
+
* run's tools returned. Mirrors `POST /v1/runs/{run_id}/file`, the HTTP twin
|
|
195
|
+
* of the MCP `file` tool. Ops: stat, ls, extract, import, keep, rm, clear.
|
|
196
|
+
* The response is the op's own JSON (narrow as needed).
|
|
197
|
+
*
|
|
198
|
+
* Needs `runs:read`, and works on any run you can read; another tenant's run
|
|
199
|
+
* is an opaque {@link NotFoundError}. extract, keep, rm and clear write, so
|
|
200
|
+
* they need the run's owner or an admin — a tenant operator counts as one
|
|
201
|
+
* for its own tenant's runs; anyone else gets a
|
|
202
|
+
* {@link SubstrateToolRefusedError}, as does a refused op. */
|
|
203
|
+
runFile<T = unknown>(runId: string, input: RunFileInput, opts?: {
|
|
204
|
+
signal?: AbortSignal;
|
|
205
|
+
}): Promise<T>;
|
|
206
|
+
/** Download one file of a run's inbox. Mirrors
|
|
207
|
+
* `GET /v1/runs/{run_id}/inbox/{path}` (HEAD with `head: true`). `path` is
|
|
208
|
+
* relative to the inbox root (`documents/a.pdf`) or a reference
|
|
209
|
+
* (`volume:inbox:documents/a.pdf`).
|
|
210
|
+
*
|
|
211
|
+
* Any reader of the run may download (`runs:read`). `range` is sent as the
|
|
212
|
+
* Range header (`bytes=0-1023`). The inbox is deleted when its run ends, so
|
|
213
|
+
* a finished run's file — like a missing file, run, or another tenant's run —
|
|
214
|
+
* is a {@link NotFoundError}. */
|
|
215
|
+
downloadRunInboxFile(runId: string, path: string, opts?: {
|
|
216
|
+
range?: string;
|
|
217
|
+
head?: boolean;
|
|
218
|
+
signal?: AbortSignal;
|
|
219
|
+
}): Promise<RunInboxDownload>;
|
|
186
220
|
/** Which per-run overrides a run of `name` may set, for this caller — what a
|
|
187
221
|
* run form needs before it sends anything. Mirrors
|
|
188
222
|
* `GET /v1/_agentdef/{name}/overridable`.
|
|
@@ -474,8 +508,11 @@ export declare class LoomcycleClient {
|
|
|
474
508
|
signal?: AbortSignal;
|
|
475
509
|
}): Promise<WalkRunsPage>;
|
|
476
510
|
/** Aggregated token-usage + cost report (RFC AV). Group by any of
|
|
477
|
-
* tenant/user/provider/model/source over
|
|
478
|
-
*
|
|
511
|
+
* tenant/user/provider/model/source/purpose/tier/user_tier/agent/class over
|
|
512
|
+
* an optional time window, split into periods with `bucket`;
|
|
513
|
+
* group by `source` for the operator-vs-tenant split, by `purpose` to see
|
|
514
|
+
* what OCR and speech-to-text cost (a row's `audio_seconds` is the audio its
|
|
515
|
+
* speech-to-text calls transcribed). Tenant-scoped server-side: a
|
|
479
516
|
* tenant principal sees only its own tenant (the `tenant` focus is
|
|
480
517
|
* admin-only). Mirrors `GET /v1/_usage`. */
|
|
481
518
|
usageReport(opts?: {
|
|
@@ -486,6 +523,16 @@ export declare class LoomcycleClient {
|
|
|
486
523
|
to?: string;
|
|
487
524
|
/** Super-admin tenant focus (?tenant=); ignored for a tenant principal. */
|
|
488
525
|
tenant?: string;
|
|
526
|
+
/** Split the window into UTC periods; each row then carries `period`.
|
|
527
|
+
* `hour` reaches only `detail_since` onward. */
|
|
528
|
+
bucket?: UsageBucket;
|
|
529
|
+
/** Keep the `top` largest values of the first `groupBy` dimension (by
|
|
530
|
+
* `topBy`, default cost); the rest fold into rows marked `other`. */
|
|
531
|
+
top?: number;
|
|
532
|
+
topBy?: "cost" | "tokens" | "calls";
|
|
533
|
+
/** Keep rows whose dimension is one of the values. `tenant` is not a
|
|
534
|
+
* filter: it is the `tenant` focus above. */
|
|
535
|
+
filters?: Partial<Record<Exclude<UsageDimension, "tenant">, string[]>>;
|
|
489
536
|
signal?: AbortSignal;
|
|
490
537
|
}): Promise<UsageReportResponse>;
|
|
491
538
|
/** Instance configuration: build identity, the feature matrix, and the live
|
|
@@ -606,12 +653,16 @@ export declare class LoomcycleClient {
|
|
|
606
653
|
* "isolated" confines the member to its own user scope. 409 on a duplicate
|
|
607
654
|
* (tenant, subject). */
|
|
608
655
|
createUser(body: CreateUserBody, opts?: {
|
|
656
|
+
tenant?: string;
|
|
609
657
|
signal?: AbortSignal;
|
|
610
658
|
}): Promise<UserRecord>;
|
|
611
659
|
/** Patch mutable fields on a user in the caller's own tenant. An omitted key
|
|
612
660
|
* leaves the column unchanged. Disabling a user (status:"disabled") also
|
|
613
|
-
* revokes its delegated tokens server-side.
|
|
661
|
+
* revokes its delegated tokens server-side. A pending user is activated by
|
|
662
|
+
* {@link approveUser}, not here (409 `use_approve`). Cross-tenant target →
|
|
663
|
+
* 404. */
|
|
614
664
|
updateUser(subject: string, body: UpdateUserBody, opts?: {
|
|
665
|
+
tenant?: string;
|
|
615
666
|
signal?: AbortSignal;
|
|
616
667
|
}): Promise<UserRecord>;
|
|
617
668
|
/** Delete the user identity row in the caller's own tenant (204). Its
|
|
@@ -619,8 +670,126 @@ export declare class LoomcycleClient {
|
|
|
619
670
|
* Owned data (runs / sessions / memory) is left intact — this is not
|
|
620
671
|
* erasure ({@link erasureExecute}). Cross-tenant target → 404. */
|
|
621
672
|
deleteUser(subject: string, opts?: {
|
|
673
|
+
tenant?: string;
|
|
674
|
+
signal?: AbortSignal;
|
|
675
|
+
}): Promise<void>;
|
|
676
|
+
/** Approve a user awaiting approval: `pending` → `active`
|
|
677
|
+
* (`POST /v1/_users/{subject}/approve`). A sign-in gate configured with
|
|
678
|
+
* `new_user.status: pending` provisions people who can sign in but are
|
|
679
|
+
* refused everything until this call. Returns the updated record. 409
|
|
680
|
+
* `not_pending` for a user that is not pending; 404 for an unknown or
|
|
681
|
+
* cross-tenant subject. An `auth:manage` credential may approve only a user
|
|
682
|
+
* at its floor (403 `target_beyond_floor`). */
|
|
683
|
+
approveUser(subject: string, opts?: {
|
|
684
|
+
tenant?: string;
|
|
685
|
+
signal?: AbortSignal;
|
|
686
|
+
}): Promise<UserRecord>;
|
|
687
|
+
/** The identity-provider accounts a user signs in with
|
|
688
|
+
* (`GET /v1/_users/{subject}/identities`): one row per linked gate, never a
|
|
689
|
+
* secret. A user reads its own; a tenant operator or an admin reads any in
|
|
690
|
+
* the tenant. Password-gate logins, with whether a password and an
|
|
691
|
+
* authenticator are set, are {@link listGateIdentities}. */
|
|
692
|
+
listUserIdentities(subject: string, opts?: {
|
|
693
|
+
tenant?: string;
|
|
694
|
+
signal?: AbortSignal;
|
|
695
|
+
}): Promise<UserIdentitiesResponse>;
|
|
696
|
+
/** Unlink one identity-provider account from a user
|
|
697
|
+
* (`DELETE /v1/_users/{subject}/identities/{gate}`, 204). Sessions made
|
|
698
|
+
* through it end on their next request. For a tenant operator or an admin;
|
|
699
|
+
* a user unlinking its own account must do it from a recently
|
|
700
|
+
* signed-in Web UI session, so a bearer is refused (403
|
|
701
|
+
* `link_needs_own_session`). A password gate's login is removed with
|
|
702
|
+
* {@link removeGateCredentials} instead (409 `password_gate`). 404
|
|
703
|
+
* `identity_not_found` when no account of that gate is linked. */
|
|
704
|
+
unlinkUserIdentity(subject: string, gate: string, opts?: {
|
|
705
|
+
tenant?: string;
|
|
706
|
+
signal?: AbortSignal;
|
|
707
|
+
}): Promise<void>;
|
|
708
|
+
/** Sign in through the server's device gate (RFC 8628): shows the person a
|
|
709
|
+
* code through `onPrompt`, polls until they approve it in a signed-in Web
|
|
710
|
+
* UI session (`/ui/device`), and returns the token issued to them. The
|
|
711
|
+
* token is the approver's own member token, at most the device gate's
|
|
712
|
+
* `token_ttl` and never past the approving session or the credential it
|
|
713
|
+
* was made from. Sends no bearer: a client constructed without one can
|
|
714
|
+
* call it. Throws {@link DeviceLoginError} when the login is denied,
|
|
715
|
+
* expires, or the server refuses it; 404 `device_login_disabled` when no
|
|
716
|
+
* device gate is configured. */
|
|
717
|
+
deviceLogin(opts: DeviceLoginOptions): Promise<DeviceLoginResult>;
|
|
718
|
+
/** Every configured sign-in gate (`GET /v1/_authgate`): kind, label,
|
|
719
|
+
* whether a browser can sign in through it, its identity map and an
|
|
720
|
+
* external gate's key fingerprint and removal timing — never key
|
|
721
|
+
* material. **Admin token only.** `probe: true` also fetches each
|
|
722
|
+
* external gate's discovery document (bounded) and compares it with the
|
|
723
|
+
* registration. */
|
|
724
|
+
listAuthGates(opts?: {
|
|
725
|
+
probe?: boolean;
|
|
726
|
+
signal?: AbortSignal;
|
|
727
|
+
}): Promise<AuthGateListResponse>;
|
|
728
|
+
/** Invite a person to sign in through a password gate
|
|
729
|
+
* (`POST /v1/_authgate/{gate}/invites`). Without `subject` the invite
|
|
730
|
+
* makes a new user, at the gate's new-user floor unless the gate is
|
|
731
|
+
* trusted; with one it gives that existing user a login (409
|
|
732
|
+
* `credential_exists` if it has one — issue a reset instead). Returns the
|
|
733
|
+
* one-time link, shown once. */
|
|
734
|
+
createInvite(gate: string, body: CreateInviteBody, opts?: {
|
|
735
|
+
tenant?: string;
|
|
736
|
+
signal?: AbortSignal;
|
|
737
|
+
}): Promise<CreatedInvite>;
|
|
738
|
+
/** A password gate's invites in the tenant, live and past
|
|
739
|
+
* (`GET /v1/_authgate/{gate}/invites`), never their codes. An admin naming
|
|
740
|
+
* no tenant lists every tenant's. */
|
|
741
|
+
listInvites(gate: string, opts?: {
|
|
742
|
+
tenant?: string;
|
|
743
|
+
signal?: AbortSignal;
|
|
744
|
+
}): Promise<AuthInviteListResponse>;
|
|
745
|
+
/** Revoke a live invite (`DELETE /v1/_authgate/{gate}/invites/{id}`, 204).
|
|
746
|
+
* 409 `invite_not_live` when it was already redeemed, revoked or expired;
|
|
747
|
+
* another tenant's invite is a 404. */
|
|
748
|
+
revokeInvite(gate: string, inviteId: string, opts?: {
|
|
749
|
+
tenant?: string;
|
|
750
|
+
signal?: AbortSignal;
|
|
751
|
+
}): Promise<void>;
|
|
752
|
+
/** Issue a one-time link that sets a new password for a user with a login
|
|
753
|
+
* at the gate (`POST /v1/_authgate/{gate}/resets`). A user with an
|
|
754
|
+
* authenticator still needs a code from it. Completing the reset ends the
|
|
755
|
+
* user's sessions from the old password and retires its delegated tokens.
|
|
756
|
+
* 404 `login_not_found` when the user has no login at the gate. */
|
|
757
|
+
createPasswordReset(gate: string, subject: string, opts?: {
|
|
758
|
+
tenant?: string;
|
|
759
|
+
signal?: AbortSignal;
|
|
760
|
+
}): Promise<CreatedPasswordReset>;
|
|
761
|
+
/** Remove a user's password, authenticator and recovery codes at a gate
|
|
762
|
+
* (`DELETE /v1/_authgate/{gate}/credentials/{subject}`, 204). The login
|
|
763
|
+
* stays reserved, so a later {@link createPasswordReset} restores access. */
|
|
764
|
+
removeGateCredentials(gate: string, subject: string, opts?: {
|
|
765
|
+
tenant?: string;
|
|
622
766
|
signal?: AbortSignal;
|
|
623
767
|
}): Promise<void>;
|
|
768
|
+
/** Change the login a user signs in with at a gate
|
|
769
|
+
* (`PATCH /v1/_authgate/{gate}/logins/{subject}`). The subject does not
|
|
770
|
+
* change, so nothing the user owns moves. Returns the normalised login;
|
|
771
|
+
* 409 `login_taken` when another user has it. */
|
|
772
|
+
renameGateLogin(gate: string, subject: string, login: string, opts?: {
|
|
773
|
+
tenant?: string;
|
|
774
|
+
signal?: AbortSignal;
|
|
775
|
+
}): Promise<{
|
|
776
|
+
subject: string;
|
|
777
|
+
login: string;
|
|
778
|
+
}>;
|
|
779
|
+
/** A user's logins at every gate, and whether it has a password and a
|
|
780
|
+
* confirmed authenticator (`GET /v1/_authgate/{gate}/identities`) — never
|
|
781
|
+
* a secret. `gate` must name a password gate. */
|
|
782
|
+
listGateIdentities(gate: string, subject: string, opts?: {
|
|
783
|
+
tenant?: string;
|
|
784
|
+
signal?: AbortSignal;
|
|
785
|
+
}): Promise<GateIdentitiesResponse>;
|
|
786
|
+
/** Whether the tenant has, or ever had, a user and whether an owner invite
|
|
787
|
+
* is live (`GET /v1/_authgate/{gate}/tenant-status`) — what deciding on an
|
|
788
|
+
* owner invite needs, and nothing about who the users are. */
|
|
789
|
+
getGateTenantStatus(gate: string, opts?: {
|
|
790
|
+
tenant?: string;
|
|
791
|
+
signal?: AbortSignal;
|
|
792
|
+
}): Promise<GateTenantStatus>;
|
|
624
793
|
/** Mint a bearer token for one of the caller's own ACTIVE users. The granted
|
|
625
794
|
* scopes are DERIVED server-side from the member's access_mode (never sent),
|
|
626
795
|
* and the plaintext `token` is returned exactly ONCE — store it now, it is
|
|
@@ -1236,6 +1405,59 @@ export declare class LoomcycleClient {
|
|
|
1236
1405
|
volumeDef(input: SubstrateToolInput, opts?: {
|
|
1237
1406
|
signal?: AbortSignal;
|
|
1238
1407
|
}): Promise<SubstrateToolResponse>;
|
|
1408
|
+
/** The ClientDef op dispatch, as sent: `{op, name?, def_id?, client?,
|
|
1409
|
+
* description?, tenant?, content_sha256?}`. The typed methods below are
|
|
1410
|
+
* the usual way in. */
|
|
1411
|
+
clientDef(input: ClientDefInput, opts?: {
|
|
1412
|
+
signal?: AbortSignal;
|
|
1413
|
+
}): Promise<unknown>;
|
|
1414
|
+
/** Register an app (`op: "create"`). Its redirect URIs and origins are
|
|
1415
|
+
* checked as strictly as a config client's. `tenant` is for an admin: the
|
|
1416
|
+
* tenant whose people it signs in, "" (the default) for every tenant. */
|
|
1417
|
+
createClientDef(name: string, client: AppClientConfig, opts?: {
|
|
1418
|
+
description?: string;
|
|
1419
|
+
tenant?: string;
|
|
1420
|
+
signal?: AbortSignal;
|
|
1421
|
+
}): Promise<ClientDefRecord>;
|
|
1422
|
+
/** Change an app (`op: "update"`): a new version, whole. Codes issued
|
|
1423
|
+
* under the old version that were not exchanged yet stop working. */
|
|
1424
|
+
updateClientDef(name: string, client: AppClientConfig, opts?: {
|
|
1425
|
+
description?: string;
|
|
1426
|
+
signal?: AbortSignal;
|
|
1427
|
+
}): Promise<ClientDefRecord>;
|
|
1428
|
+
/** One app by name (a config client too) or one version by `def_id`
|
|
1429
|
+
* (`op: "get"`). */
|
|
1430
|
+
getClientDef(ref: {
|
|
1431
|
+
name?: string;
|
|
1432
|
+
def_id?: string;
|
|
1433
|
+
}, opts?: {
|
|
1434
|
+
signal?: AbortSignal;
|
|
1435
|
+
}): Promise<AppClientEntry>;
|
|
1436
|
+
/** The apps the caller may see, config ones included (`op: "list"`). An
|
|
1437
|
+
* admin may focus one tenant with `tenant` ("" = the every-tenant ones). */
|
|
1438
|
+
listClientDefs(opts?: {
|
|
1439
|
+
tenant?: string;
|
|
1440
|
+
signal?: AbortSignal;
|
|
1441
|
+
}): Promise<ClientDefListResponse>;
|
|
1442
|
+
/** Take an app out of service (`op: "retire"`): its unused codes are
|
|
1443
|
+
* voided, its sign-ins revoked and their access tokens retired. The name
|
|
1444
|
+
* is not reusable. */
|
|
1445
|
+
retireClientDef(name: string, opts?: {
|
|
1446
|
+
signal?: AbortSignal;
|
|
1447
|
+
}): Promise<ClientDefRetireResult>;
|
|
1448
|
+
/** Whether an app is deployed and, with `contentSha256`, whether it matches
|
|
1449
|
+
* (`op: "verify"`). An absent app answers `deployed: false`. */
|
|
1450
|
+
verifyClientDef(name: string, opts?: {
|
|
1451
|
+
contentSha256?: string;
|
|
1452
|
+
signal?: AbortSignal;
|
|
1453
|
+
}): Promise<ClientDefVerifyResult>;
|
|
1454
|
+
/** The apps the caller may see, by name (`GET /v1/_clientdef/names`). An
|
|
1455
|
+
* admin may focus one tenant with `tenant`; unlike the other families'
|
|
1456
|
+
* name lists, `""` is a focus too (the every-tenant apps). */
|
|
1457
|
+
listClientDefNames(opts?: {
|
|
1458
|
+
tenant?: string;
|
|
1459
|
+
signal?: AbortSignal;
|
|
1460
|
+
}): Promise<ClientDefNamesResponse>;
|
|
1239
1461
|
private listDefNames;
|
|
1240
1462
|
/** Every AgentDef name (`GET /v1/_agentdef/names`). */
|
|
1241
1463
|
listAgentDefNames(opts?: {
|