@ref0/sdk 0.12.0 → 0.13.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/dist/{browse-SaxCrclF.d.mts → browse-Dios11m0.d.mts} +2 -2
- package/dist/browser.d.mts +1 -1
- package/dist/client.d.mts +60 -6
- package/dist/client.mjs +725 -417
- package/dist/{index-BSPC_jQm.d.mts → index-DRFaIKvW.d.mts} +1343 -1104
- package/dist/index.d.mts +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as ConnectionCall, An as
|
|
1
|
+
import { A as ConnectionCall, An as WorkflowOwn, At as SandboxExec, Cn as WorkflowCheckStates, Dn as WorkflowConnections, En as WorkflowComment, Fn as WorkflowPasskeyState, Ft as SandboxPushAnswer, Gn as WorkflowTrigger, Gt as StartActor$1, Hn as WorkflowStartState, In as WorkflowPermissions, K as GetIssueInput, Kt as StartRun$1, Mn as WorkflowPasskeyAsked, Mt as SandboxOpen, Nn as WorkflowPasskeyEnded, Nt as SandboxOpenAnswer, On as WorkflowEvent, Pn as WorkflowPasskeyRead, Pt as SandboxPush, Rn as WorkflowPullRequestAnswer, Sn as WorkflowCheckStartAnswer, Tn as WorkflowCheckWhere, Tt as Ref0Owned, U as ForkAnswer$1, Un as WorkflowText, V as EventRunInput, Vn as WorkflowStartEnded, W as ForkCreate, Wn as WorkflowThreadStart, Yt as ThreadStage, _ as CheckOn, _n as WorkflowCheckResults, b as CheckRunParams, bn as WorkflowCheckRunEnded, cn as WorkflowCallAnswer, dn as WorkflowCallRefusal, fn as WorkflowCallRefused, gn as WorkflowCheckRefused, hn as WorkflowCheckRefusal, j as ConnectionCallAnswer, jn as WorkflowPasskeyAsk, jt as SandboxExecAnswer, kn as WorkflowFilters, ln as WorkflowCallEnded, mn as WorkflowCalledStateAnswer, nn as WorkflowAction, on as WorkflowAskClosed, pn as WorkflowCalledState, rn as WorkflowActionAnswer, sn as WorkflowCall, un as WorkflowCallInput, v as CheckOwn, vn as WorkflowCheckResultsAnswer, wn as WorkflowCheckStatesAnswer, x as CheckTreeEntry, xn as WorkflowCheckStart, y as CheckRunError, yn as WorkflowCheckRun, zn as WorkflowPullRequestOpen } from "./index-DRFaIKvW.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/needs.d.ts
|
|
4
4
|
/**
|
|
@@ -671,4 +671,4 @@ interface Browser {
|
|
|
671
671
|
}
|
|
672
672
|
//#endregion
|
|
673
673
|
export { StartActor as $, ForkOptions as A, WorkflowContext as B, Comment as C, EventWorkflow as D, EventOf as E, StepConfig as F, CalledWorkflow as G, text as H, StepContext as I, TreeEntry as J, JsonValue as K, ThreadStart as L, PullRequestAnswer as M, PullRequestOptions as N, EventWorkflowSpec as O, Ref0Actions as P, Refusal as Q, WaitType as R, CheckRunEnded as S, Duration as T, workflow as U, WorkflowStep as V, CalledRunFailed as W, Allow as X, TreeRead as Y, CalledRun as Z, ActionAnswer as _, CheckRunOptions as a, allow as at, CalledContext as b, CheckRunResult as c, Need as ct, OneOfValues as d, StartContext as et, OutputResult as f, oneOf as g, check as h, CheckResult as i, StartRun as it, NeedAddOptions as j, ForkAnswer as k, CheckSpec as l, Step as m, Check as n, StartOutput as nt, CheckRunReference as o, refuse as ot, OutputSchema as p, Tree as q, CheckContext as r, StartRule as rt, CheckRunRefused as s, CheckNeed as st, Browser as t, StartItem as tt, DurationText as u, CallAnswer as v, ConnectionsOf as w, CalledWorkflowSpec as x, CallEnded as y, WaitedEvent as z };
|
|
674
|
-
//# sourceMappingURL=browse-
|
|
674
|
+
//# sourceMappingURL=browse-Dios11m0.d.mts.map
|
package/dist/browser.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as Browser } from "./browse-
|
|
1
|
+
import { t as Browser } from "./browse-Dios11m0.mjs";
|
|
2
2
|
import { BrowserContext, BrowserContext as BrowserContext$1, BrowserContextOptions, Locator, Page, Page as Page$1, Request, Response } from "@cloudflare/playwright";
|
|
3
3
|
import { expect as expect$1 } from "@cloudflare/playwright/test";
|
|
4
4
|
//#region src/browser-stub.d.ts
|
package/dist/client.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { Effect, Layer, Option, Redacted, Schema, Stream } from "effect";
|
|
1
|
+
import { $ as LiveTicketRequest, $n as liveSocketUrl, $t as TypedApprovalCode, B as EndpointName, Bt as SentryRegion, C as ClientGranted, Ct as RanOf, D as ConnectFolderOption, Dt as RepoUrl, E as ConnectFolderChoices, Et as RepoName, F as ConnectionView, H as FoldersConnected, Ht as SignInDestination, I as ConsentAsked, J as ImportFailure, Jn as connectEndpoint, Jt as ThreadId, Kn as WrittenProject, L as ConsentClient, Ln as WorkflowPreview, Lt as ScopeAction, M as ConnectionChanged, N as ConnectionKind, O as ConnectOptions, Ot as RepoView, P as ConnectionName, Q as LiveTicket, Qn as isRef0Path, Qt as TrackThread, R as ConsentProject, Rt as SecretHash, S as ClientAccess, St as PublicJwk, T as ConnectChosen, Ut as SignedIn, Vt as SentryToken, Wt as SocketUrl, X as KeyProof, Xn as hookTokenPrefix, Xt as TrackClosed, Y as InvalidDpopProof, Yn as encodeSecret, Yt as ThreadStage, Z as KeyStoreUnavailable, Zn as hookUrl, Zt as TrackSession, _t as PreviewEcho, a as AnswerKey, at as NamedDecision, bt as ProjectTrackMessage, c as ApprovalAnswer, ct as OwnerThreadPage, d as ApprovalState, dt as PasskeyAsserted, er as projectParts, et as LiveTrackName, f as ApprovalView, ft as PasskeyCreated, gt as PasskeyRequestOptions, h as Authorization, i as AgentView, it as MirrorView, k as ConnectableAgent, kt as RequestFolder, l as ApprovalId, lt as OwnerThreadView, m as AttachmentRequestView, n as AgentPermissionChoice, nr as surfaceOf, nt as MirrorChoice, o as Api, ot as OwnerId, p as AttachmentFailed, pt as PasskeyCreationOptions, q as Harness, qn as commandLine, qt as StatementView, r as AgentPermissionSetting, rr as threadParts, rt as MirrorEntry, s as ApiOrigin, st as OwnerName, t as AgentHandle, tn as Welcome, tr as repoNameKey, tt as MachineConnected, u as ApprovalPreview, ut as OwnerTrackMessage, vt as PreviewUnavailable, w as ConnectAgent, wt as ReadEvent, xt as ProofOrigin, yt as ProjectName, z as CredentialView, zt as SentryOrg } from "./index-DRFaIKvW.mjs";
|
|
2
|
+
import { Context, Effect, Layer, Option, Redacted, Ref, Schema, Stream } from "effect";
|
|
3
3
|
import { HttpApi, HttpApiClient, HttpApiGroup, HttpApiMiddleware } from "effect/http-api";
|
|
4
4
|
import { HttpBody, HttpClient } from "effect/http";
|
|
5
5
|
//#region src/client/client.d.ts
|
|
@@ -13,11 +13,11 @@ type Ref0Client = HttpApiClient.ForApi<typeof Api>;
|
|
|
13
13
|
*/
|
|
14
14
|
export declare const ref0Client: (origin?: ApiOrigin) => Effect.Effect<Ref0Client, never, HttpClient.HttpClient | HttpApiGroup.MiddlewareClient<ApiGroups>>;
|
|
15
15
|
/** A bearer token: an agent's credential, sent with every request. */
|
|
16
|
-
export declare const bearerCredential: (token: Redacted.Redacted<string>) => Layer.Layer<HttpApiMiddleware.ForClient<Authorization> | HttpApiMiddleware.ForClient<SignedIn>, never, never>;
|
|
16
|
+
export declare const bearerCredential: (token: Redacted.Redacted<string>) => Layer.Layer<HttpApiMiddleware.ForClient<Authorization> | HttpApiMiddleware.ForClient<KeyProof> | HttpApiMiddleware.ForClient<SignedIn>, never, never>;
|
|
17
17
|
/** A browser session: the browser sends its cookie on ref0's own origin, so nothing is added. */
|
|
18
|
-
export declare const browserCredential: Layer.Layer<HttpApiMiddleware.ForClient<Authorization> | HttpApiMiddleware.ForClient<SignedIn>, never, never>;
|
|
18
|
+
export declare const browserCredential: Layer.Layer<HttpApiMiddleware.ForClient<Authorization> | HttpApiMiddleware.ForClient<KeyProof> | HttpApiMiddleware.ForClient<SignedIn>, never, never>;
|
|
19
19
|
/** No credential: a terminal asking its person, which sends nothing of theirs. */
|
|
20
|
-
export declare const anonymousCredential: Layer.Layer<HttpApiMiddleware.ForClient<Authorization> | HttpApiMiddleware.ForClient<SignedIn>, never, never>;
|
|
20
|
+
export declare const anonymousCredential: Layer.Layer<HttpApiMiddleware.ForClient<Authorization> | HttpApiMiddleware.ForClient<KeyProof> | HttpApiMiddleware.ForClient<SignedIn>, never, never>;
|
|
21
21
|
/** The platform's `fetch`, for a client in a browser or a Worker. */
|
|
22
22
|
export declare const fetchTransport: Layer.Layer<HttpClient.HttpClient, never, never>;
|
|
23
23
|
//#endregion
|
|
@@ -65,6 +65,60 @@ export declare const followApproval: <Name extends EndpointName>(client: Ref0Cli
|
|
|
65
65
|
/** What a socket opened at `url` hears, as `message` decodes it, ending when it closes. */
|
|
66
66
|
export declare const liveMessages: <M>(url: SocketUrl, message: Schema.Codec<M, unknown>) => Stream.Stream<M>;
|
|
67
67
|
//#endregion
|
|
68
|
+
//#region src/client/proofs.d.ts
|
|
69
|
+
/**
|
|
70
|
+
* A credential bound to a key, sent with a proof of possession on each attempt: RFC 9449's DPoP.
|
|
71
|
+
* The adapter builds each proof and knows nothing of where the key is kept; a key store signs.
|
|
72
|
+
*/
|
|
73
|
+
/**
|
|
74
|
+
* Where a key that signs proofs is kept, such as a machine's keychain, a file only its user can
|
|
75
|
+
* read, or hardware: the public half it signs for, and its signing, which answers ES256's
|
|
76
|
+
* signature as JOSE has it, `r` then `s`, 64 bytes. The signer never sees the key itself, and a
|
|
77
|
+
* store that takes its time, or asks a person, fits the same.
|
|
78
|
+
*/
|
|
79
|
+
interface KeyStore {
|
|
80
|
+
readonly publicKey: PublicJwk;
|
|
81
|
+
readonly sign: (bytes: Uint8Array) => Effect.Effect<Uint8Array, KeyStoreUnavailable>;
|
|
82
|
+
}
|
|
83
|
+
declare const ProofClock_base: Context.ServiceClass<ProofClock, "ref0/sdk/ProofClock", {
|
|
84
|
+
readonly offset: Ref.Ref<number>;
|
|
85
|
+
}>;
|
|
86
|
+
/**
|
|
87
|
+
* How far ref0's clock is ahead of this machine's, in milliseconds, as the `Date` of a refused
|
|
88
|
+
* proof's answer said: provided once for a process, so every proof it signs after is dated by it.
|
|
89
|
+
*/
|
|
90
|
+
export declare class ProofClock extends ProofClock_base {
|
|
91
|
+
static readonly layer: Layer.Layer<ProofClock, never, never>;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* RFC 7638's thumbprint of a P-256 public key: the SHA-256 of its required members, in order, as
|
|
95
|
+
* JSON, in base64url. What a credential bound to the key names it by, as `cnf.jkt`.
|
|
96
|
+
*/
|
|
97
|
+
export declare const keyThumbprint: (jwk: PublicJwk) => Effect.Effect<string & import("effect/Brand").Brand<"KeyThumbprint">, never, never>;
|
|
98
|
+
/** A key that signs proofs: ref0's origin, where its client sends requests, and its key's store. */
|
|
99
|
+
interface ProofSigner {
|
|
100
|
+
readonly origin: ProofOrigin;
|
|
101
|
+
readonly store: KeyStore;
|
|
102
|
+
}
|
|
103
|
+
/** A credential bound to a key: its token, and the key that signs a proof for it. */
|
|
104
|
+
interface BoundCredential extends ProofSigner {
|
|
105
|
+
readonly token: Redacted.Redacted<string>;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* ref0's `/v1` as a typed client at a bound credential's origin, sending its token with a proof
|
|
109
|
+
* its key store signs for each attempt. The client is made at the origin its proofs name, so
|
|
110
|
+
* neither the token nor a proof is sent anywhere else. It needs the process's `ProofClock`. A
|
|
111
|
+
* request's trace redacts its proof, but an error it fails with still holds the request: a
|
|
112
|
+
* program that logs errors adds `dpop` to `Headers.CurrentRedactedNames` at its root.
|
|
113
|
+
*/
|
|
114
|
+
export declare const boundClient: (credential: BoundCredential) => Effect.Effect<Ref0Client, never, HttpClient.HttpClient | ProofClock>;
|
|
115
|
+
/**
|
|
116
|
+
* ref0's `/v1` as a typed client at a key's origin, with no credential, signing each request that
|
|
117
|
+
* asks for a proof, such as a machine's ask to connect, with the key its store holds. It needs the
|
|
118
|
+
* process's `ProofClock`, and its errors still hold their requests, as `boundClient`'s do.
|
|
119
|
+
*/
|
|
120
|
+
export declare const provingClient: (signer: ProofSigner) => Effect.Effect<Ref0Client, never, HttpClient.HttpClient | ProofClock>;
|
|
121
|
+
//#endregion
|
|
68
122
|
//#region src/client/request-id.d.ts
|
|
69
123
|
/**
|
|
70
124
|
* A new delivery ID, for a request that changes something's `Idempotency-Key`: a UUIDv7 from the
|
|
@@ -90,5 +144,5 @@ export declare const startGitHubSignIn: (landing: {
|
|
|
90
144
|
*/
|
|
91
145
|
export declare const signOut: (origin?: ApiOrigin) => Effect.Effect<void, import("effect/http/HttpClientError").HttpClientError, HttpClient.HttpClient>;
|
|
92
146
|
//#endregion
|
|
93
|
-
export { AgentHandle, type AgentPermissionChoice, type AgentPermissionSetting, type AgentView, AnswerKey, ApiOrigin, type ApprovalAnswer, type ApprovalId, type ApprovalPreview, type ApprovalState, type ApprovalView, AttachmentFailed, AttachmentRequestView, ClientAccess, ClientGranted, type ConnectAgent, type ConnectChosen, type ConnectFolderChoices, type ConnectFolderOption, type ConnectOptions, type ConnectableAgent, ConnectionChanged, ConnectionKind, ConnectionName, type ConnectionView, type ConsentAsked, type ConsentClient, ConsentProject, type CredentialView, FoldersConnected, type Harness, type ImportFailure, type LiveTicket, type LiveTicketRequest, LiveTrackName, MachineConnected, type MirrorChoice, type MirrorEntry, type MirrorView, type NamedDecision, type OwnerId, OwnerName, type OwnerThreadPage, type OwnerThreadView, OwnerTrackMessage, PasskeyAsserted, PasskeyCreated, type PasskeyCreationOptions, type PasskeyRequestOptions, type PreviewEcho, PreviewUnavailable, ProjectName, ProjectTrackMessage, type ReadEvent, type Ref0Client, RepoName, RepoUrl, type RepoView, type RequestFolder, type ScopeAction, SecretHash, SentryOrg, SentryRegion, SentryToken, type SettledApproval, SignInDestination, type StatementView, ThreadId, ThreadStage, type TrackClosed, type TrackSession, type TrackThread, TypedApprovalCode, type Welcome, WorkflowPreview, WrittenProject, commandLine, connectEndpoint, encodeSecret, hookTokenPrefix, hookUrl, isRef0Path, liveSocketUrl, projectParts, repoNameKey, surfaceOf, threadParts };
|
|
147
|
+
export { AgentHandle, type AgentPermissionChoice, type AgentPermissionSetting, type AgentView, AnswerKey, ApiOrigin, type ApprovalAnswer, type ApprovalId, type ApprovalPreview, type ApprovalState, type ApprovalView, AttachmentFailed, AttachmentRequestView, type BoundCredential, ClientAccess, ClientGranted, type ConnectAgent, type ConnectChosen, type ConnectFolderChoices, type ConnectFolderOption, type ConnectOptions, type ConnectableAgent, ConnectionChanged, ConnectionKind, ConnectionName, type ConnectionView, type ConsentAsked, type ConsentClient, ConsentProject, type CredentialView, FoldersConnected, type Harness, type ImportFailure, InvalidDpopProof, type KeyStore, KeyStoreUnavailable, type LiveTicket, type LiveTicketRequest, LiveTrackName, MachineConnected, type MirrorChoice, type MirrorEntry, type MirrorView, type NamedDecision, type OwnerId, OwnerName, type OwnerThreadPage, type OwnerThreadView, OwnerTrackMessage, PasskeyAsserted, PasskeyCreated, type PasskeyCreationOptions, type PasskeyRequestOptions, type PreviewEcho, PreviewUnavailable, ProjectName, ProjectTrackMessage, ProofOrigin, type ProofSigner, PublicJwk, type ReadEvent, type Ref0Client, RepoName, RepoUrl, type RepoView, type RequestFolder, type ScopeAction, SecretHash, SentryOrg, SentryRegion, SentryToken, type SettledApproval, SignInDestination, type StatementView, ThreadId, ThreadStage, type TrackClosed, type TrackSession, type TrackThread, TypedApprovalCode, type Welcome, WorkflowPreview, WrittenProject, commandLine, connectEndpoint, encodeSecret, hookTokenPrefix, hookUrl, isRef0Path, liveSocketUrl, projectParts, repoNameKey, surfaceOf, threadParts };
|
|
94
148
|
//# sourceMappingURL=client.d.mts.map
|