@tangle-network/hub-sdk 0.32.0-develop.20260826070812.30b81be → 0.32.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/README.md +194 -8
- package/dist/index.d.ts +1706 -561
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1077 -526
- package/dist/index.js.map +1 -1
- package/package.json +14 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,571 @@
|
|
|
1
|
-
//#region src/
|
|
1
|
+
//#region src/allowances.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Allowances: a developer's per-member daily allowance on a meter, and the
|
|
4
|
+
* paywall decision past it. The platform counts every admitted turn and reads
|
|
5
|
+
* each payer's dollars from the ledger; the app keeps only its checkout and
|
|
6
|
+
* records a paying member with {@link HubAllowancesClient.grant}.
|
|
7
|
+
*
|
|
8
|
+
* Only the meter's owner may call these, signed in or with a root API key of
|
|
9
|
+
* their own. A delegated or resource-bound key, such as the key a hosted end
|
|
10
|
+
* user's sandbox runs on, is refused.
|
|
11
|
+
*/
|
|
12
|
+
type HubAllowanceTier = "free" | "paid" | "owner";
|
|
13
|
+
type HubAllowanceRole = "owner" | "member";
|
|
14
|
+
interface HubAllowancePlanInput {
|
|
15
|
+
free: {
|
|
16
|
+
turnsPerDay: number;
|
|
17
|
+
usdPerDay: number | null;
|
|
18
|
+
};
|
|
19
|
+
/** Null turns billing off: past the free allowance nothing lifts the limit. */
|
|
20
|
+
paid: {
|
|
21
|
+
turnsPerDay: number;
|
|
22
|
+
usdPerDay: number | null;
|
|
23
|
+
priceUsdMonthly: number;
|
|
24
|
+
} | null;
|
|
25
|
+
owner?: {
|
|
26
|
+
turnsPerDay: number;
|
|
27
|
+
};
|
|
28
|
+
/** Key resource type whose ledger spend counts against a payer's dollars. */
|
|
29
|
+
spendResourceType: string | null;
|
|
30
|
+
}
|
|
31
|
+
interface HubAllowancePlan extends HubAllowancePlanInput {
|
|
32
|
+
meter: string;
|
|
33
|
+
owner: {
|
|
34
|
+
turnsPerDay: number;
|
|
35
|
+
};
|
|
36
|
+
/** False while the meter runs on the default plan. */
|
|
37
|
+
configured: boolean;
|
|
38
|
+
updatedAt: string | null;
|
|
39
|
+
}
|
|
40
|
+
interface HubAllowanceSubject {
|
|
41
|
+
member: string;
|
|
42
|
+
role?: HubAllowanceRole;
|
|
43
|
+
/** The member whose keys pay for the turn, when that is someone else. */
|
|
44
|
+
payer?: string;
|
|
45
|
+
payerRole?: HubAllowanceRole;
|
|
46
|
+
}
|
|
47
|
+
interface HubAllowanceDecision {
|
|
48
|
+
/** `paywall`: paying lifts the limit. `allowance_reached`: nothing does today. */
|
|
49
|
+
decision: "admit" | "paywall" | "allowance_reached";
|
|
50
|
+
tier: HubAllowanceTier;
|
|
51
|
+
paywall: boolean;
|
|
52
|
+
turns: {
|
|
53
|
+
used: number;
|
|
54
|
+
limit: number;
|
|
55
|
+
};
|
|
56
|
+
usd: {
|
|
57
|
+
spent: number;
|
|
58
|
+
limit: number;
|
|
59
|
+
remaining: number;
|
|
60
|
+
} | null;
|
|
61
|
+
day: string;
|
|
62
|
+
resetsAt: string;
|
|
63
|
+
/**
|
|
64
|
+
* A paying payer's spend in the current paid period against what funds it:
|
|
65
|
+
* the plan price less Tangle's 10% fee, plus the free daily allowance for
|
|
66
|
+
* the period. A paid turn is refused once `remaining` is gone.
|
|
67
|
+
*/
|
|
68
|
+
period?: {
|
|
69
|
+
spent: number;
|
|
70
|
+
funded: number;
|
|
71
|
+
remaining: number;
|
|
72
|
+
startsAt: string;
|
|
73
|
+
endsAt: string;
|
|
74
|
+
};
|
|
75
|
+
replay?: boolean;
|
|
76
|
+
}
|
|
77
|
+
interface HubAllowanceUsage {
|
|
78
|
+
day: string;
|
|
79
|
+
turns: number;
|
|
80
|
+
members: Array<{
|
|
81
|
+
member: string;
|
|
82
|
+
turns: number;
|
|
83
|
+
tier: HubAllowanceTier;
|
|
84
|
+
usdSpent: number | null;
|
|
85
|
+
}>;
|
|
86
|
+
lines: Array<{
|
|
87
|
+
line: string;
|
|
88
|
+
turns: number;
|
|
89
|
+
}>;
|
|
90
|
+
}
|
|
91
|
+
interface HubAllowanceSyncInput {
|
|
92
|
+
source: string;
|
|
93
|
+
revision: number;
|
|
94
|
+
expiresAt: string | null;
|
|
95
|
+
reference: string | null;
|
|
96
|
+
}
|
|
97
|
+
interface HubAllowanceSyncReceipt extends HubAllowanceSyncInput {
|
|
98
|
+
member: string;
|
|
99
|
+
}
|
|
100
|
+
interface HubAllowanceGrant {
|
|
101
|
+
member: string;
|
|
102
|
+
tier: "paid";
|
|
103
|
+
expiresAt: string;
|
|
104
|
+
reference: string | null;
|
|
105
|
+
}
|
|
106
|
+
declare class HubAllowancesClient {
|
|
107
|
+
private readonly request;
|
|
108
|
+
constructor(request: <T>(path: string, init: RequestInit) => Promise<T>);
|
|
109
|
+
plan(meter: string): Promise<HubAllowancePlan>;
|
|
110
|
+
setPlan(meter: string, plan: HubAllowancePlanInput): Promise<HubAllowancePlan>;
|
|
111
|
+
/** Admit one turn or refuse it. Retrying the same `turnId` never counts twice. */
|
|
112
|
+
admit(meter: string, input: HubAllowanceSubject & {
|
|
113
|
+
turnId: string;
|
|
114
|
+
line?: string;
|
|
115
|
+
channel?: string;
|
|
116
|
+
}): Promise<HubAllowanceDecision>;
|
|
117
|
+
/** What the member's next turn would get, without counting anything. */
|
|
118
|
+
status(meter: string, subject: HubAllowanceSubject): Promise<HubAllowanceDecision>;
|
|
119
|
+
/** Move a member to the paid allowance until `expiresAt` (the paid period's end). */
|
|
120
|
+
grant(meter: string, member: string, input: {
|
|
121
|
+
expiresAt: string;
|
|
122
|
+
reference?: string | null;
|
|
123
|
+
}): Promise<HubAllowanceGrant>;
|
|
124
|
+
/** Synchronize a paid grant by durable product revision. Null expiry writes
|
|
125
|
+
* a retained revocation. A delayed older update is refused, never reactivated.
|
|
126
|
+
* There is no fallback to the unversioned grant endpoint on older servers. */
|
|
127
|
+
syncGrant(meter: string, member: string, input: HubAllowanceSyncInput): Promise<HubAllowanceSyncReceipt>;
|
|
128
|
+
revoke(meter: string, member: string): Promise<void>;
|
|
129
|
+
/** Turns per member and per line on one UTC day (default today). */
|
|
130
|
+
usage(meter: string, day?: string): Promise<HubAllowanceUsage>;
|
|
131
|
+
private path;
|
|
132
|
+
private memberPath;
|
|
133
|
+
private body;
|
|
134
|
+
}
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region src/apps.d.ts
|
|
137
|
+
/** The compliance claim an owner latches through a BAA acceptance. Positive
|
|
138
|
+
* claims only: `{ hipaa: true }` or absent — `hipaa: false` is unspellable. */
|
|
139
|
+
interface HubAppComplianceClaim {
|
|
140
|
+
hipaa: true;
|
|
141
|
+
}
|
|
142
|
+
/** Owner-facing compliance state: the latched claim and the acceptance behind it. */
|
|
143
|
+
interface HubAppComplianceState {
|
|
144
|
+
compliance: HubAppComplianceClaim | null;
|
|
145
|
+
agreement: {
|
|
146
|
+
version: string;
|
|
147
|
+
url: string;
|
|
148
|
+
} | null;
|
|
149
|
+
acceptance: {
|
|
150
|
+
agreementVersion: string;
|
|
151
|
+
agreementUrl: string;
|
|
152
|
+
acceptedByUserId: string;
|
|
153
|
+
acceptedAt: string;
|
|
154
|
+
} | null;
|
|
155
|
+
}
|
|
156
|
+
/** App identity and customer permissions over the existing Platform transport.
|
|
157
|
+
* These operations do not authorize spending or expose upstream credentials. */
|
|
158
|
+
interface HubApp {
|
|
159
|
+
id: string;
|
|
160
|
+
clientId: string;
|
|
161
|
+
oauthClientId: string | null;
|
|
162
|
+
name: string;
|
|
163
|
+
redirectUris: string[];
|
|
164
|
+
allowedScopes: string[];
|
|
165
|
+
homepageUrl: string | null;
|
|
166
|
+
accessPayer?: "user" | "app-owner";
|
|
167
|
+
/** Latched HIPAA declaration; absent or null means "no claim". */
|
|
168
|
+
compliance?: HubAppComplianceClaim | null;
|
|
169
|
+
status: "active" | "revoked";
|
|
170
|
+
createdAt: string;
|
|
171
|
+
updatedAt: string;
|
|
172
|
+
}
|
|
173
|
+
interface HubAppCreateInput {
|
|
174
|
+
name: string;
|
|
175
|
+
redirectUris: string[];
|
|
176
|
+
allowedScopes: string[];
|
|
177
|
+
homepageUrl?: string;
|
|
178
|
+
/** The registered app owner funds eligibility; customer permissions remain separate. */
|
|
179
|
+
accessPayer?: "user" | "app-owner";
|
|
180
|
+
/** Associate an existing owned login client in the same transaction as creation. */
|
|
181
|
+
oauthClientId?: string;
|
|
182
|
+
}
|
|
183
|
+
interface HubAppGrant {
|
|
184
|
+
id: string;
|
|
185
|
+
appId: string;
|
|
186
|
+
userId: string;
|
|
187
|
+
connectionId: string;
|
|
188
|
+
scopes: string[];
|
|
189
|
+
status: "active" | "revoked";
|
|
190
|
+
createdAt: string;
|
|
191
|
+
updatedAt: string;
|
|
192
|
+
revokedAt: string | null;
|
|
193
|
+
/** Display metadata is additive; older deployments may omit it. */
|
|
194
|
+
appName?: string | null;
|
|
195
|
+
oauthClientId?: string | null;
|
|
196
|
+
providerId?: string | null;
|
|
197
|
+
accountDisplay?: string | null;
|
|
198
|
+
connectionDisplayName?: string | null;
|
|
199
|
+
}
|
|
200
|
+
interface HubAppGrantRevoked {
|
|
201
|
+
grantId: string;
|
|
202
|
+
status: "revoked";
|
|
203
|
+
revokedAt: string | null;
|
|
204
|
+
tokensRevoked: number;
|
|
205
|
+
}
|
|
206
|
+
declare class HubAppsClient {
|
|
207
|
+
private readonly request;
|
|
208
|
+
readonly grants: {
|
|
209
|
+
list: () => Promise<HubAppGrant[]>;
|
|
210
|
+
revoke: (grantId: string) => Promise<HubAppGrantRevoked>;
|
|
211
|
+
};
|
|
212
|
+
constructor(request: <T>(path: string, init: RequestInit) => Promise<T>);
|
|
213
|
+
list(): Promise<HubApp[]>;
|
|
214
|
+
/** The secret is returned only by creation; keep it in your server vault. */
|
|
215
|
+
create(input: HubAppCreateInput): Promise<{
|
|
216
|
+
app: HubApp;
|
|
217
|
+
clientSecret: string;
|
|
218
|
+
}>;
|
|
219
|
+
/** Immutable association of two existing records with the same owner. */
|
|
220
|
+
linkOAuthClient(appId: string, clientId: string): Promise<{
|
|
221
|
+
appId: string;
|
|
222
|
+
oauthClientId: string;
|
|
223
|
+
}>;
|
|
224
|
+
revoke(appId: string): Promise<{
|
|
225
|
+
appId: string;
|
|
226
|
+
grantsRevoked: number;
|
|
227
|
+
tokensRevoked: number;
|
|
228
|
+
}>;
|
|
229
|
+
/** Current latched compliance state and the BAA acceptance behind it. */
|
|
230
|
+
getCompliance(appId: string): Promise<HubAppComplianceState>;
|
|
231
|
+
/**
|
|
232
|
+
* Latch HIPAA compliance for this app. The request MUST carry the exact
|
|
233
|
+
* `agreementVersion` the deployment currently offers — the acceptance is
|
|
234
|
+
* recorded before the claim exists, and the claim can never be cleared:
|
|
235
|
+
* `hipaa: false` on a latched app is a 409, on an unlatched app a no-op.
|
|
236
|
+
*/
|
|
237
|
+
setCompliance(appId: string, input: {
|
|
238
|
+
hipaa: boolean;
|
|
239
|
+
agreementVersion?: string;
|
|
240
|
+
}): Promise<HubAppComplianceState>;
|
|
241
|
+
}
|
|
242
|
+
//#endregion
|
|
243
|
+
//#region src/tool-types.d.ts
|
|
244
|
+
interface HubToolSource {
|
|
245
|
+
sourceId: string;
|
|
246
|
+
providerId: string;
|
|
247
|
+
displayName: string;
|
|
248
|
+
toolCount: number;
|
|
249
|
+
connectionStatus: "connected" | "missing" | "unknown";
|
|
250
|
+
health: "healthy" | "unhealthy" | "rate_limited" | "unknown";
|
|
251
|
+
configured: boolean;
|
|
252
|
+
}
|
|
253
|
+
/** Per-tool catalog risk class. The first three mirror the platform's
|
|
254
|
+
* `HubActionRisk`; `unknown` is surfaced honestly for tools the catalog can't
|
|
255
|
+
* classify (substrate connectors). */
|
|
256
|
+
type HubToolRisk = "read" | "write" | "destructive" | "unknown";
|
|
257
|
+
interface HubTool {
|
|
258
|
+
path: string;
|
|
259
|
+
providerId?: string;
|
|
260
|
+
title?: string;
|
|
261
|
+
description?: string;
|
|
262
|
+
inputSchema?: unknown;
|
|
263
|
+
outputSchema?: unknown;
|
|
264
|
+
connectionRequired?: boolean;
|
|
265
|
+
connectionStatus?: "connected" | "missing" | "unknown";
|
|
266
|
+
requiredConnectionProviderId?: string;
|
|
267
|
+
policyState?: "allow" | "ask" | "deny" | "unknown";
|
|
268
|
+
risk?: HubToolRisk;
|
|
269
|
+
}
|
|
270
|
+
interface HubToolSourcesResponse {
|
|
271
|
+
sources: HubToolSource[];
|
|
272
|
+
}
|
|
273
|
+
interface HubToolsSearchRequest {
|
|
274
|
+
query: string;
|
|
275
|
+
provider?: string;
|
|
276
|
+
}
|
|
277
|
+
interface HubToolsSearchResponse {
|
|
278
|
+
tools: HubTool[];
|
|
279
|
+
}
|
|
280
|
+
interface HubToolsDescribeRequest {
|
|
281
|
+
path: string;
|
|
282
|
+
}
|
|
283
|
+
interface HubToolsDescribeResponse {
|
|
284
|
+
tool: HubTool;
|
|
285
|
+
}
|
|
286
|
+
interface HubExecRequest {
|
|
287
|
+
path: string;
|
|
288
|
+
input?: unknown;
|
|
289
|
+
connectionId?: string;
|
|
290
|
+
/** Caller-minted key for this exec. The platform ledger replays the first
|
|
291
|
+
* call's result for a retry that carries the same key, and rejects a key
|
|
292
|
+
* reused for a different request. On the capability-token arm the key only
|
|
293
|
+
* reaches the connector for provider-native dedupe: that arm is at-most-once
|
|
294
|
+
* per token and replays no stored result. */
|
|
295
|
+
idempotencyKey?: string;
|
|
296
|
+
}
|
|
297
|
+
interface HubExecResponse<TResult = unknown> {
|
|
298
|
+
result: TResult;
|
|
299
|
+
/** True when the result was replayed from a previous call with the same
|
|
300
|
+
* idempotency key, so the action did not run again. */
|
|
301
|
+
replayed?: boolean;
|
|
302
|
+
}
|
|
303
|
+
//#endregion
|
|
304
|
+
//#region src/broker.d.ts
|
|
305
|
+
interface HubAppBrokerOptions {
|
|
306
|
+
baseUrl: string;
|
|
307
|
+
clientId: string;
|
|
308
|
+
clientSecret: string;
|
|
309
|
+
fetch?: typeof fetch;
|
|
310
|
+
}
|
|
311
|
+
interface HubAppBrokerToken {
|
|
312
|
+
accessToken: string;
|
|
313
|
+
expiresIn: number;
|
|
314
|
+
scopes: string[];
|
|
315
|
+
}
|
|
316
|
+
interface HubAppBrokerExchange extends HubAppBrokerToken {
|
|
317
|
+
grantId: string;
|
|
318
|
+
connectionId: string;
|
|
319
|
+
}
|
|
320
|
+
/** Server-only client. App secrets never become a user's general API key.
|
|
321
|
+
* Every invocation mints and consumes one short-lived, exact-grant token. */
|
|
322
|
+
declare class HubAppBrokerClient {
|
|
323
|
+
private readonly options;
|
|
324
|
+
private readonly baseUrl;
|
|
325
|
+
private readonly fetcher;
|
|
326
|
+
constructor(options: HubAppBrokerOptions);
|
|
327
|
+
private token;
|
|
328
|
+
private readToken;
|
|
329
|
+
exchange(input: {
|
|
330
|
+
code: string;
|
|
331
|
+
redirectUri: string;
|
|
332
|
+
connectionId?: string;
|
|
333
|
+
}): Promise<HubAppBrokerExchange>;
|
|
334
|
+
mint(grantId: string): Promise<HubAppBrokerToken>;
|
|
335
|
+
invoke<T = unknown>(grantId: string, connectionId: string, actionPath: string, input: Record<string, unknown>): Promise<HubExecResponse<T>>;
|
|
336
|
+
}
|
|
337
|
+
//#endregion
|
|
338
|
+
//#region src/knowledge-management.d.ts
|
|
339
|
+
interface KnowledgeReference {
|
|
340
|
+
sourceId: string;
|
|
341
|
+
generation: string;
|
|
342
|
+
}
|
|
343
|
+
/** Connection references only. Provider credentials never enter this contract. */
|
|
344
|
+
interface KnowledgeEmbeddingSpace {
|
|
345
|
+
connectionId: string;
|
|
346
|
+
model: string;
|
|
347
|
+
dimensions: number;
|
|
348
|
+
}
|
|
349
|
+
type KnowledgeSourceInput = {
|
|
350
|
+
kind: "file";
|
|
351
|
+
name: string;
|
|
352
|
+
base64: string;
|
|
353
|
+
mediaType: string;
|
|
354
|
+
} | {
|
|
355
|
+
kind: "git";
|
|
356
|
+
connectionId: string;
|
|
357
|
+
owner: string;
|
|
358
|
+
repo: string;
|
|
359
|
+
ref: string;
|
|
360
|
+
pathPrefix?: string;
|
|
361
|
+
} | {
|
|
362
|
+
kind: "url";
|
|
363
|
+
url: string;
|
|
364
|
+
} | {
|
|
365
|
+
kind: "s3";
|
|
366
|
+
connectionId: string;
|
|
367
|
+
bucket: string;
|
|
368
|
+
prefix: string;
|
|
369
|
+
} | {
|
|
370
|
+
kind: "vector";
|
|
371
|
+
connectionId: string;
|
|
372
|
+
provider: "pinecone" | "qdrant" | "weaviate";
|
|
373
|
+
indexName: string;
|
|
374
|
+
namespace?: string;
|
|
375
|
+
embedding: KnowledgeEmbeddingSpace;
|
|
376
|
+
textField: string;
|
|
377
|
+
sourceUriField: string;
|
|
378
|
+
};
|
|
379
|
+
interface KnowledgeCapability {
|
|
380
|
+
supported: boolean;
|
|
381
|
+
reason?: string;
|
|
382
|
+
}
|
|
383
|
+
interface KnowledgeCapabilities {
|
|
384
|
+
delegation?: KnowledgeCapability & {
|
|
385
|
+
resource?: string;
|
|
386
|
+
scopes?: string[];
|
|
387
|
+
};
|
|
388
|
+
sources: Record<KnowledgeSourceInput["kind"], KnowledgeCapability>;
|
|
389
|
+
vectorProviders: Record<"pinecone" | "qdrant" | "weaviate", KnowledgeCapability>;
|
|
390
|
+
managedVector: KnowledgeCapability;
|
|
391
|
+
file: {
|
|
392
|
+
mediaTypes: string[];
|
|
393
|
+
maxBytes: number;
|
|
394
|
+
maxObjects: number;
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
interface KnowledgeSourceSummary {
|
|
398
|
+
/** Required query authorization, not proof that an owner policy currently permits it. */
|
|
399
|
+
retrieval?: {
|
|
400
|
+
kind: "lexical";
|
|
401
|
+
} | {
|
|
402
|
+
kind: "vector";
|
|
403
|
+
embeddingPolicy: {
|
|
404
|
+
connectionId: string;
|
|
405
|
+
actionPath: "openai.embeddings.create";
|
|
406
|
+
scope: "owner-connection-action";
|
|
407
|
+
};
|
|
408
|
+
};
|
|
409
|
+
id: string;
|
|
410
|
+
name: string;
|
|
411
|
+
kind: KnowledgeSourceInput["kind"];
|
|
412
|
+
status: "ready" | "refreshing" | "failed" | "awaiting-approval";
|
|
413
|
+
approval?: {
|
|
414
|
+
id: string;
|
|
415
|
+
path: string;
|
|
416
|
+
preview: {
|
|
417
|
+
provider: string;
|
|
418
|
+
connectionId: string;
|
|
419
|
+
collection: string;
|
|
420
|
+
sourceId: string;
|
|
421
|
+
requestId: string;
|
|
422
|
+
embedding: KnowledgeEmbeddingSpace;
|
|
423
|
+
chunkCount: number;
|
|
424
|
+
sourceCount: number;
|
|
425
|
+
dataSharing: string;
|
|
426
|
+
};
|
|
427
|
+
};
|
|
428
|
+
refreshRequestId?: string;
|
|
429
|
+
generation: string | null;
|
|
430
|
+
lastError: {
|
|
431
|
+
code: string;
|
|
432
|
+
message: string;
|
|
433
|
+
} | null;
|
|
434
|
+
updatedAt: string;
|
|
435
|
+
}
|
|
436
|
+
type KnowledgeAttachmentAuthorization = {
|
|
437
|
+
status: "active";
|
|
438
|
+
} | {
|
|
439
|
+
status: "unavailable";
|
|
440
|
+
code: "APP_CONSENT_REVOKED" | "KEY_REVOKED" | "CONNECTION_UNAVAILABLE" | "ATTACHMENT_REVOKED" | "GENERATION_UNAVAILABLE" | "RUNTIME_AUTHORITY_REVOKED";
|
|
441
|
+
};
|
|
442
|
+
interface KnowledgeAttachment {
|
|
443
|
+
/** Snapshot of live grant/key/connection authority, separate from durable pin state. */
|
|
444
|
+
authorization?: KnowledgeAttachmentAuthorization;
|
|
445
|
+
id: string;
|
|
446
|
+
sourceId: string;
|
|
447
|
+
sandboxId: string;
|
|
448
|
+
generation: string;
|
|
449
|
+
status: "active" | "detached";
|
|
450
|
+
}
|
|
451
|
+
interface KnowledgeSourceCreate {
|
|
452
|
+
requestId: string;
|
|
453
|
+
name: string;
|
|
454
|
+
source: KnowledgeSourceInput;
|
|
455
|
+
target?: {
|
|
456
|
+
kind: "lexical";
|
|
457
|
+
} | {
|
|
458
|
+
kind: "managed-vector";
|
|
459
|
+
provider: "qdrant";
|
|
460
|
+
connectionId: string;
|
|
461
|
+
embedding: KnowledgeEmbeddingSpace;
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
/** Owner-only management. Runtime tools use HubKnowledgeClient.query instead. */
|
|
465
|
+
interface KnowledgeAuthorization {
|
|
466
|
+
userId: string;
|
|
467
|
+
clientId: string;
|
|
468
|
+
resource: string;
|
|
469
|
+
scopes: Array<"knowledge:read" | "knowledge:write">;
|
|
470
|
+
}
|
|
471
|
+
declare class HubKnowledgeManagementClient {
|
|
472
|
+
private readonly request;
|
|
473
|
+
constructor(request: <T>(path: string, init: RequestInit) => Promise<T>);
|
|
474
|
+
materialize(input: {
|
|
475
|
+
sandboxId: string;
|
|
476
|
+
references: KnowledgeReference[];
|
|
477
|
+
}): Promise<KnowledgeAttachment[]>;
|
|
478
|
+
authorization(): Promise<KnowledgeAuthorization>;
|
|
479
|
+
disconnectAuthorization(): Promise<{
|
|
480
|
+
revoked: true;
|
|
481
|
+
}>;
|
|
482
|
+
capabilities(): Promise<KnowledgeCapabilities>;
|
|
483
|
+
list(): Promise<KnowledgeSourceSummary[]>;
|
|
484
|
+
get(sourceId: string): Promise<KnowledgeSourceSummary>;
|
|
485
|
+
create(input: KnowledgeSourceCreate): Promise<KnowledgeSourceSummary>;
|
|
486
|
+
refresh(sourceId: string, input: {
|
|
487
|
+
requestId: string;
|
|
488
|
+
approvalToken?: string;
|
|
489
|
+
}): Promise<KnowledgeSourceSummary>;
|
|
490
|
+
attach(sourceId: string, input: {
|
|
491
|
+
sandboxId: string;
|
|
492
|
+
generation: string;
|
|
493
|
+
expectedGeneration?: string;
|
|
494
|
+
}): Promise<KnowledgeAttachment>;
|
|
495
|
+
attachments(sandboxId?: string): Promise<KnowledgeAttachment[]>;
|
|
496
|
+
detach(attachmentId: string): Promise<KnowledgeAttachment>;
|
|
497
|
+
}
|
|
498
|
+
//#endregion
|
|
499
|
+
//#region src/knowledge.d.ts
|
|
500
|
+
interface HubKnowledgeRetrievalResult {
|
|
501
|
+
attachmentId: string;
|
|
502
|
+
generation: string;
|
|
503
|
+
provenance: "ingested" | "record-supplied";
|
|
504
|
+
hits: Array<{
|
|
505
|
+
id: string;
|
|
506
|
+
title: string;
|
|
507
|
+
snippet: string;
|
|
508
|
+
score?: number;
|
|
509
|
+
citations?: Array<{
|
|
510
|
+
sourceId: string;
|
|
511
|
+
sourceUri: string;
|
|
512
|
+
revision?: string;
|
|
513
|
+
}>;
|
|
514
|
+
}>;
|
|
515
|
+
elapsedMs?: number;
|
|
516
|
+
}
|
|
517
|
+
interface HubKnowledgeQueryResult {
|
|
518
|
+
results: HubKnowledgeRetrievalResult[];
|
|
519
|
+
/** Individual unavailable sources do not hide evidence from healthy sources. */
|
|
520
|
+
failures: Array<{
|
|
521
|
+
attachmentId: string;
|
|
522
|
+
code: string;
|
|
523
|
+
message: string;
|
|
524
|
+
}>;
|
|
525
|
+
partial: boolean;
|
|
526
|
+
}
|
|
527
|
+
/** Runtime-only retrieval. The authenticated sandbox credential determines the
|
|
528
|
+
* scope on the server; neither a caller nor an agent can supply another scope. */
|
|
529
|
+
declare class HubKnowledgeClient {
|
|
530
|
+
private readonly request;
|
|
531
|
+
readonly management: HubKnowledgeManagementClient;
|
|
532
|
+
constructor(request: <T>(path: string, init: RequestInit) => Promise<T>);
|
|
533
|
+
bindings(): Promise<{
|
|
534
|
+
references: KnowledgeReference[];
|
|
535
|
+
}>;
|
|
536
|
+
query(input: {
|
|
537
|
+
query: string;
|
|
538
|
+
limit?: number;
|
|
539
|
+
expectedReferences?: KnowledgeReference[];
|
|
540
|
+
}, options?: {
|
|
541
|
+
signal?: AbortSignal;
|
|
542
|
+
}): Promise<HubKnowledgeQueryResult>;
|
|
543
|
+
}
|
|
544
|
+
//#endregion
|
|
545
|
+
//#region src/audit-types.d.ts
|
|
546
|
+
interface HubAuditEvent {
|
|
547
|
+
id: string;
|
|
548
|
+
action: string;
|
|
549
|
+
targetUserId: string | null;
|
|
550
|
+
targetKeyId: string | null;
|
|
551
|
+
metadata: unknown;
|
|
552
|
+
createdAt: string;
|
|
553
|
+
}
|
|
554
|
+
interface HubAuditListRequest {
|
|
555
|
+
provider?: string;
|
|
556
|
+
action?: string;
|
|
557
|
+
status?: string;
|
|
558
|
+
since?: string;
|
|
559
|
+
until?: string;
|
|
560
|
+
cursor?: string;
|
|
561
|
+
limit?: number;
|
|
562
|
+
}
|
|
563
|
+
interface HubAuditResponse {
|
|
564
|
+
events: HubAuditEvent[];
|
|
565
|
+
nextCursor: string | null;
|
|
566
|
+
}
|
|
567
|
+
//#endregion
|
|
568
|
+
//#region src/transport-types.d.ts
|
|
2
569
|
type HubPrincipalKind = "user_session" | "api_key" | "sandbox_runtime";
|
|
3
570
|
interface HubSuccessEnvelope<TData> {
|
|
4
571
|
success: true;
|
|
@@ -14,7 +581,7 @@ interface HubErrorBody {
|
|
|
14
581
|
message: string;
|
|
15
582
|
details?: unknown;
|
|
16
583
|
}
|
|
17
|
-
type HubErrorCode = "HUB_UNAUTHENTICATED" | "HUB_FORBIDDEN" | "HUB_INVALID_INPUT" | "HUB_INVALID_STATE" | "HUB_PROVIDER_MISSING" | "HUB_CONNECTION_MISSING" | "HUB_CONNECTION_REVOKED" | "HUB_TOKEN_EXPIRED" | "HUB_TOKEN_REPLAYED" | "HUB_TOKEN_REVOKED" | "HUB_TOKEN_ACTION_MISMATCH" | "HUB_POLICY_DENIED" | "HUB_APPROVAL_REQUIRED" | "HUB_EXECUTOR_FAILURE" | "HUB_PROVIDER_FAILURE" | "HUB_CONFIG_MISSING" | "HUB_CONFIG_INVALID" | "HUB_NOT_FOUND" | "HUB_NOT_IMPLEMENTED" | "HUB_CONFLICT" | "HUB_IDEMPOTENCY_CONFLICT" | "HUB_IDEMPOTENCY_IN_FLIGHT" | "VALIDATION_ERROR" | "WORKFLOW_INVALID" | "NOT_FOUND" | "UNAUTHORIZED" | "CONFLICT" | "MISSING_RUN_INPUTS" | "WORKFLOW_DISABLED" | "PAYLOAD_TOO_LARGE" | "WORKFLOW_RUN_TIMEOUT" | `HUB_HTTP_${number}`;
|
|
584
|
+
type HubErrorCode = "HUB_UNAUTHENTICATED" | "HUB_FORBIDDEN" | "HUB_INVALID_INPUT" | "HUB_INVALID_STATE" | "HUB_PROVIDER_MISSING" | "HUB_CONNECTION_MISSING" | "HUB_CONNECTION_REVOKED" | "HUB_TOKEN_EXPIRED" | "HUB_TOKEN_REPLAYED" | "HUB_TOKEN_REVOKED" | "HUB_TOKEN_ACTION_MISMATCH" | "HUB_POLICY_DENIED" | "HUB_APPROVAL_REQUIRED" | "HUB_EXECUTOR_FAILURE" | "HUB_PROVIDER_FAILURE" | "HUB_PROVIDER_REJECTED" | "HUB_CONFIG_MISSING" | "HUB_CONFIG_INVALID" | "HUB_NOT_FOUND" | "HUB_NOT_IMPLEMENTED" | "HUB_CONFLICT" | "HUB_IDEMPOTENCY_CONFLICT" | "HUB_IDEMPOTENCY_IN_FLIGHT" | "VALIDATION_ERROR" | "WORKFLOW_INVALID" | "NOT_FOUND" | "UNAUTHORIZED" | "CONFLICT" | "MISSING_RUN_INPUTS" | "WORKFLOW_DISABLED" | "PAYLOAD_TOO_LARGE" | "WORKFLOW_RUN_TIMEOUT" | "SERVICE_DRAINING" | "WORKFLOW_STREAM_INTERRUPTED" | `HUB_HTTP_${number}`;
|
|
18
585
|
interface HubStatusResponse {
|
|
19
586
|
contract: unknown;
|
|
20
587
|
principal: HubPrincipal;
|
|
@@ -31,21 +598,117 @@ interface HubStatusConnections {
|
|
|
31
598
|
connectedProviderCount: number;
|
|
32
599
|
unhealthyProviderCount: number;
|
|
33
600
|
}
|
|
34
|
-
interface
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
601
|
+
interface HubUnimplementedErrorEnvelope extends HubErrorEnvelope {
|
|
602
|
+
error: HubErrorEnvelope["error"] & {
|
|
603
|
+
code: "HUB_NOT_IMPLEMENTED";
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
//#endregion
|
|
607
|
+
//#region src/authorization-types.d.ts
|
|
608
|
+
interface HubTokenMintRequest {
|
|
609
|
+
connectionId?: string;
|
|
610
|
+
provider?: string;
|
|
611
|
+
actionPath: string;
|
|
612
|
+
ttlSeconds?: number;
|
|
613
|
+
}
|
|
614
|
+
interface HubTokenMintResponse {
|
|
615
|
+
token: string;
|
|
616
|
+
tokenId: string;
|
|
617
|
+
expiresAt: string;
|
|
618
|
+
}
|
|
619
|
+
interface HubCapabilityToken {
|
|
620
|
+
id: string;
|
|
621
|
+
providerId: string;
|
|
622
|
+
connectionId: string;
|
|
623
|
+
connectionDisplay: string | null;
|
|
624
|
+
actionPath: string;
|
|
625
|
+
expiresAt: string;
|
|
626
|
+
status: "active" | "consumed" | "expired" | "revoked";
|
|
627
|
+
principalKind: HubPrincipalKind;
|
|
628
|
+
createdAt: string;
|
|
629
|
+
}
|
|
630
|
+
interface HubTokensListResponse {
|
|
631
|
+
tokens: HubCapabilityToken[];
|
|
632
|
+
}
|
|
633
|
+
interface HubTokenRevokeResponse {
|
|
634
|
+
tokenId: string;
|
|
635
|
+
status: HubCapabilityToken["status"];
|
|
636
|
+
}
|
|
637
|
+
type HubPolicyDecision = "allow" | "ask" | "deny";
|
|
638
|
+
interface HubPolicyUpdateRequest {
|
|
639
|
+
connectionId: string;
|
|
640
|
+
actionPath: string;
|
|
641
|
+
decision: HubPolicyDecision;
|
|
642
|
+
}
|
|
643
|
+
interface HubPolicyListRequest {
|
|
644
|
+
connectionId: string;
|
|
645
|
+
}
|
|
646
|
+
interface HubPolicyDeleteRequest {
|
|
647
|
+
connectionId: string;
|
|
648
|
+
actionPath: string;
|
|
649
|
+
}
|
|
650
|
+
interface HubPolicyDeleteResponse {
|
|
651
|
+
connectionId: string;
|
|
652
|
+
actionPath: string;
|
|
653
|
+
/** Whether a stored override existed and was removed (false = already default). */
|
|
654
|
+
deleted: boolean;
|
|
655
|
+
}
|
|
656
|
+
interface HubPolicy {
|
|
657
|
+
id: string;
|
|
658
|
+
connectionId: string;
|
|
659
|
+
providerId: string;
|
|
660
|
+
actionPath: string;
|
|
661
|
+
decision: HubPolicyDecision;
|
|
662
|
+
createdAt: string;
|
|
663
|
+
updatedAt: string;
|
|
664
|
+
}
|
|
665
|
+
interface HubPolicyResponse {
|
|
666
|
+
policy: HubPolicy;
|
|
667
|
+
}
|
|
668
|
+
interface HubPolicyListResponse {
|
|
669
|
+
policies: HubPolicy[];
|
|
670
|
+
}
|
|
671
|
+
interface HubAllowWritesResponse {
|
|
672
|
+
connectionId: string;
|
|
673
|
+
providerId: string;
|
|
674
|
+
/** Write actions the connection's provider exposes. */
|
|
675
|
+
writeActions: number;
|
|
676
|
+
/** Rows newly created (excludes actions that already had a policy). */
|
|
677
|
+
granted: number;
|
|
678
|
+
actionPaths: string[];
|
|
679
|
+
}
|
|
680
|
+
interface HubRevertWritesResponse {
|
|
681
|
+
connectionId: string;
|
|
682
|
+
/** `allow_writes` rows deleted. */
|
|
683
|
+
reverted: number;
|
|
684
|
+
}
|
|
685
|
+
type HubApprovalStatus = "pending" | "approved" | "denied" | "expired" | "consumed";
|
|
686
|
+
interface HubApproval {
|
|
687
|
+
id: string;
|
|
688
|
+
connectionId: string;
|
|
689
|
+
providerId: string;
|
|
690
|
+
actionPath: string;
|
|
691
|
+
inputHash: string;
|
|
692
|
+
requesterPrincipal: Record<string, unknown>;
|
|
693
|
+
status: HubApprovalStatus;
|
|
694
|
+
requestedAt: string;
|
|
695
|
+
expiresAt: string;
|
|
696
|
+
resolvedAt: string | null;
|
|
697
|
+
}
|
|
698
|
+
interface HubApprovalCapabilityToken {
|
|
699
|
+
tokenId: string;
|
|
700
|
+
token: string;
|
|
701
|
+
expiresAt: string;
|
|
702
|
+
}
|
|
703
|
+
interface HubApprovalDecisionResponse {
|
|
704
|
+
approval: HubApproval;
|
|
705
|
+
capabilityToken?: HubApprovalCapabilityToken;
|
|
45
706
|
}
|
|
46
|
-
interface
|
|
47
|
-
|
|
707
|
+
interface HubApprovalListResponse {
|
|
708
|
+
approvals: HubApproval[];
|
|
48
709
|
}
|
|
710
|
+
//#endregion
|
|
711
|
+
//#region src/channel-types.d.ts
|
|
49
712
|
interface HubEmailChannel {
|
|
50
713
|
id: string;
|
|
51
714
|
kind: "email";
|
|
@@ -166,6 +829,24 @@ interface HubEventDelivery {
|
|
|
166
829
|
providerEvent: HubProviderEvent;
|
|
167
830
|
firedAt: string;
|
|
168
831
|
}
|
|
832
|
+
//#endregion
|
|
833
|
+
//#region src/connection-types.d.ts
|
|
834
|
+
interface HubConnection {
|
|
835
|
+
id: string;
|
|
836
|
+
providerId: string;
|
|
837
|
+
displayName: string;
|
|
838
|
+
accountDisplay: string | null;
|
|
839
|
+
providerAccountId: string | null;
|
|
840
|
+
scopes: string[];
|
|
841
|
+
status: "active" | "revoked" | "unhealthy" | "reconnect_required";
|
|
842
|
+
health: "unknown" | "healthy" | "unhealthy" | "rate_limited";
|
|
843
|
+
createdAt: string;
|
|
844
|
+
updatedAt: string;
|
|
845
|
+
lastUsedAt: string | null;
|
|
846
|
+
}
|
|
847
|
+
interface HubConnectionsResponse {
|
|
848
|
+
connections: HubConnection[];
|
|
849
|
+
}
|
|
169
850
|
/** A connector's auth model. */
|
|
170
851
|
type HubProviderAuthKind = "oauth2" | "api_key" | "none" | "custom";
|
|
171
852
|
/** One non-secret value needed before an OAuth redirect can be built. Tenant-
|
|
@@ -222,6 +903,7 @@ interface HubOAuthStartRequest {
|
|
|
222
903
|
returnUrl?: string;
|
|
223
904
|
cli?: boolean;
|
|
224
905
|
connectionParameters?: Record<string, string>;
|
|
906
|
+
requestedScopes?: readonly string[];
|
|
225
907
|
}
|
|
226
908
|
interface HubOAuthCallbackSuccessQuery {
|
|
227
909
|
provider: string;
|
|
@@ -252,6 +934,9 @@ interface HubWhatsappEmbeddedSignupStartResponse {
|
|
|
252
934
|
appId: string;
|
|
253
935
|
configId: string;
|
|
254
936
|
sdkVersion: string;
|
|
937
|
+
/** Embedded Signup flow the login configuration selects. "v4" takes empty
|
|
938
|
+
* extras; "v2" needs featureType and sessionInfoVersion. Absent means "v2". */
|
|
939
|
+
signupVersion?: "v2" | "v4";
|
|
255
940
|
state: string;
|
|
256
941
|
expiresAt: string;
|
|
257
942
|
scopes: string[];
|
|
@@ -282,7 +967,18 @@ interface HubOAuthCallbackResponse {
|
|
|
282
967
|
interface HubApiKeyConnectRequest {
|
|
283
968
|
provider: string;
|
|
284
969
|
apiKey: string;
|
|
970
|
+
/** Connector-owned setup values. Hub validates them before testing the key. */
|
|
971
|
+
metadata?: HubApiKeyConnectionMetadata;
|
|
285
972
|
}
|
|
973
|
+
type HubApiKeyConnectionMetadata = {
|
|
974
|
+
propertyId: string;
|
|
975
|
+
currency?: string;
|
|
976
|
+
} | {
|
|
977
|
+
listings: Array<{
|
|
978
|
+
id: string;
|
|
979
|
+
pms: string;
|
|
980
|
+
}>;
|
|
981
|
+
};
|
|
286
982
|
/** Result of an api-key connect: the created (or reconnected) connection.
|
|
287
983
|
* Synchronous — there is no redirect leg, unlike the OAuth flow. */
|
|
288
984
|
interface HubApiKeyConnectResponse {
|
|
@@ -312,193 +1008,8 @@ interface HubConnectionHealthResponse {
|
|
|
312
1008
|
connection: HubConnection;
|
|
313
1009
|
health: HubConnectionHealthInfo;
|
|
314
1010
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
providerId: string;
|
|
318
|
-
displayName: string;
|
|
319
|
-
toolCount: number;
|
|
320
|
-
connectionStatus: "connected" | "missing" | "unknown";
|
|
321
|
-
health: "healthy" | "unhealthy" | "rate_limited" | "unknown";
|
|
322
|
-
configured: boolean;
|
|
323
|
-
}
|
|
324
|
-
/** Per-tool catalog risk class. The first three mirror the platform's
|
|
325
|
-
* `HubActionRisk`; `unknown` is surfaced honestly for tools the catalog can't
|
|
326
|
-
* classify (substrate connectors). */
|
|
327
|
-
type HubToolRisk = "read" | "write" | "destructive" | "unknown";
|
|
328
|
-
interface HubTool {
|
|
329
|
-
path: string;
|
|
330
|
-
providerId?: string;
|
|
331
|
-
title?: string;
|
|
332
|
-
description?: string;
|
|
333
|
-
inputSchema?: unknown;
|
|
334
|
-
outputSchema?: unknown;
|
|
335
|
-
connectionRequired?: boolean;
|
|
336
|
-
connectionStatus?: "connected" | "missing" | "unknown";
|
|
337
|
-
requiredConnectionProviderId?: string;
|
|
338
|
-
policyState?: "allow" | "ask" | "deny" | "unknown";
|
|
339
|
-
risk?: HubToolRisk;
|
|
340
|
-
}
|
|
341
|
-
interface HubToolSourcesResponse {
|
|
342
|
-
sources: HubToolSource[];
|
|
343
|
-
}
|
|
344
|
-
interface HubToolsSearchRequest {
|
|
345
|
-
query: string;
|
|
346
|
-
provider?: string;
|
|
347
|
-
}
|
|
348
|
-
interface HubToolsSearchResponse {
|
|
349
|
-
tools: HubTool[];
|
|
350
|
-
}
|
|
351
|
-
interface HubToolsDescribeRequest {
|
|
352
|
-
path: string;
|
|
353
|
-
}
|
|
354
|
-
interface HubToolsDescribeResponse {
|
|
355
|
-
tool: HubTool;
|
|
356
|
-
}
|
|
357
|
-
interface HubExecRequest {
|
|
358
|
-
path: string;
|
|
359
|
-
input?: unknown;
|
|
360
|
-
connectionId?: string;
|
|
361
|
-
/** Caller-minted key for this exec. The platform ledger replays the first
|
|
362
|
-
* call's result for a retry that carries the same key, and rejects a key
|
|
363
|
-
* reused for a different request. On the capability-token arm the key only
|
|
364
|
-
* reaches the connector for provider-native dedupe: that arm is at-most-once
|
|
365
|
-
* per token and replays no stored result. */
|
|
366
|
-
idempotencyKey?: string;
|
|
367
|
-
}
|
|
368
|
-
interface HubExecResponse<TResult = unknown> {
|
|
369
|
-
result: TResult;
|
|
370
|
-
/** True when the result was replayed from a previous call with the same
|
|
371
|
-
* idempotency key, so the action did not run again. */
|
|
372
|
-
replayed?: boolean;
|
|
373
|
-
}
|
|
374
|
-
interface HubTokenMintRequest {
|
|
375
|
-
connectionId?: string;
|
|
376
|
-
provider?: string;
|
|
377
|
-
actionPath: string;
|
|
378
|
-
ttlSeconds?: number;
|
|
379
|
-
}
|
|
380
|
-
interface HubTokenMintResponse {
|
|
381
|
-
token: string;
|
|
382
|
-
tokenId: string;
|
|
383
|
-
expiresAt: string;
|
|
384
|
-
}
|
|
385
|
-
interface HubCapabilityToken {
|
|
386
|
-
id: string;
|
|
387
|
-
providerId: string;
|
|
388
|
-
connectionId: string;
|
|
389
|
-
connectionDisplay: string | null;
|
|
390
|
-
actionPath: string;
|
|
391
|
-
expiresAt: string;
|
|
392
|
-
status: "active" | "consumed" | "expired" | "revoked";
|
|
393
|
-
principalKind: HubPrincipalKind;
|
|
394
|
-
createdAt: string;
|
|
395
|
-
}
|
|
396
|
-
interface HubTokensListResponse {
|
|
397
|
-
tokens: HubCapabilityToken[];
|
|
398
|
-
}
|
|
399
|
-
interface HubTokenRevokeResponse {
|
|
400
|
-
tokenId: string;
|
|
401
|
-
status: HubCapabilityToken["status"];
|
|
402
|
-
}
|
|
403
|
-
type HubPolicyDecision = "allow" | "ask" | "deny";
|
|
404
|
-
interface HubPolicyUpdateRequest {
|
|
405
|
-
connectionId: string;
|
|
406
|
-
actionPath: string;
|
|
407
|
-
decision: HubPolicyDecision;
|
|
408
|
-
}
|
|
409
|
-
interface HubPolicyListRequest {
|
|
410
|
-
connectionId: string;
|
|
411
|
-
}
|
|
412
|
-
interface HubPolicyDeleteRequest {
|
|
413
|
-
connectionId: string;
|
|
414
|
-
actionPath: string;
|
|
415
|
-
}
|
|
416
|
-
interface HubPolicyDeleteResponse {
|
|
417
|
-
connectionId: string;
|
|
418
|
-
actionPath: string;
|
|
419
|
-
/** Whether a stored override existed and was removed (false = already default). */
|
|
420
|
-
deleted: boolean;
|
|
421
|
-
}
|
|
422
|
-
interface HubPolicy {
|
|
423
|
-
id: string;
|
|
424
|
-
connectionId: string;
|
|
425
|
-
providerId: string;
|
|
426
|
-
actionPath: string;
|
|
427
|
-
decision: HubPolicyDecision;
|
|
428
|
-
createdAt: string;
|
|
429
|
-
updatedAt: string;
|
|
430
|
-
}
|
|
431
|
-
interface HubPolicyResponse {
|
|
432
|
-
policy: HubPolicy;
|
|
433
|
-
}
|
|
434
|
-
interface HubPolicyListResponse {
|
|
435
|
-
policies: HubPolicy[];
|
|
436
|
-
}
|
|
437
|
-
interface HubAllowWritesResponse {
|
|
438
|
-
connectionId: string;
|
|
439
|
-
providerId: string;
|
|
440
|
-
/** Write actions the connection's provider exposes. */
|
|
441
|
-
writeActions: number;
|
|
442
|
-
/** Rows newly created (excludes actions that already had a policy). */
|
|
443
|
-
granted: number;
|
|
444
|
-
actionPaths: string[];
|
|
445
|
-
}
|
|
446
|
-
interface HubRevertWritesResponse {
|
|
447
|
-
connectionId: string;
|
|
448
|
-
/** `allow_writes` rows deleted. */
|
|
449
|
-
reverted: number;
|
|
450
|
-
}
|
|
451
|
-
type HubApprovalStatus = "pending" | "approved" | "denied" | "expired" | "consumed";
|
|
452
|
-
interface HubApproval {
|
|
453
|
-
id: string;
|
|
454
|
-
connectionId: string;
|
|
455
|
-
providerId: string;
|
|
456
|
-
actionPath: string;
|
|
457
|
-
inputHash: string;
|
|
458
|
-
requesterPrincipal: Record<string, unknown>;
|
|
459
|
-
status: HubApprovalStatus;
|
|
460
|
-
requestedAt: string;
|
|
461
|
-
expiresAt: string;
|
|
462
|
-
resolvedAt: string | null;
|
|
463
|
-
}
|
|
464
|
-
interface HubApprovalCapabilityToken {
|
|
465
|
-
tokenId: string;
|
|
466
|
-
token: string;
|
|
467
|
-
expiresAt: string;
|
|
468
|
-
}
|
|
469
|
-
interface HubApprovalDecisionResponse {
|
|
470
|
-
approval: HubApproval;
|
|
471
|
-
capabilityToken?: HubApprovalCapabilityToken;
|
|
472
|
-
}
|
|
473
|
-
interface HubApprovalListResponse {
|
|
474
|
-
approvals: HubApproval[];
|
|
475
|
-
}
|
|
476
|
-
interface HubAuditEvent {
|
|
477
|
-
id: string;
|
|
478
|
-
action: string;
|
|
479
|
-
targetUserId: string | null;
|
|
480
|
-
targetKeyId: string | null;
|
|
481
|
-
metadata: unknown;
|
|
482
|
-
createdAt: string;
|
|
483
|
-
}
|
|
484
|
-
interface HubAuditListRequest {
|
|
485
|
-
provider?: string;
|
|
486
|
-
action?: string;
|
|
487
|
-
status?: string;
|
|
488
|
-
since?: string;
|
|
489
|
-
until?: string;
|
|
490
|
-
cursor?: string;
|
|
491
|
-
limit?: number;
|
|
492
|
-
}
|
|
493
|
-
interface HubAuditResponse {
|
|
494
|
-
events: HubAuditEvent[];
|
|
495
|
-
nextCursor: string | null;
|
|
496
|
-
}
|
|
497
|
-
interface HubUnimplementedErrorEnvelope extends HubErrorEnvelope {
|
|
498
|
-
error: HubErrorEnvelope["error"] & {
|
|
499
|
-
code: "HUB_NOT_IMPLEMENTED";
|
|
500
|
-
};
|
|
501
|
-
}
|
|
1011
|
+
//#endregion
|
|
1012
|
+
//#region src/github-app-types.d.ts
|
|
502
1013
|
interface HubGithubAppMintInstallationTokenRequest {
|
|
503
1014
|
/** HTTPS or SSH GitHub URL — alternative to installationId. */
|
|
504
1015
|
repoUrl?: string;
|
|
@@ -527,7 +1038,7 @@ interface HubGithubAppInstallation {
|
|
|
527
1038
|
accountType: string | null;
|
|
528
1039
|
/** "all" ⇒ every repo under the account; "selected" ⇒ only repoFullNames. */
|
|
529
1040
|
repositorySelection: "all" | "selected";
|
|
530
|
-
/**
|
|
1041
|
+
/** Metadata omits names; use githubApp.listRepos(id) for a live caller-safe list. */
|
|
531
1042
|
repoFullNames: string[];
|
|
532
1043
|
suspended: boolean;
|
|
533
1044
|
}
|
|
@@ -580,43 +1091,59 @@ interface HubGithubAppSyncResponse {
|
|
|
580
1091
|
}
|
|
581
1092
|
interface HubGithubAppListReposResponse {
|
|
582
1093
|
installationId: number;
|
|
583
|
-
/**
|
|
1094
|
+
/** Complete live intersection of App coverage and the caller's GitHub access. */
|
|
584
1095
|
repoFullNames: string[];
|
|
1096
|
+
/** True only when both upstream listings completed; failures return an error. */
|
|
1097
|
+
complete: true;
|
|
585
1098
|
}
|
|
586
|
-
interface HubGithubAppIsRepoInstalledRequest {
|
|
587
|
-
owner: string;
|
|
588
|
-
repo: string;
|
|
589
|
-
}
|
|
590
|
-
interface HubGithubAppIsRepoInstalledResponse {
|
|
591
|
-
installed: boolean;
|
|
592
|
-
installationId: number | null;
|
|
593
|
-
}
|
|
594
|
-
interface HubWorkflowAction {
|
|
595
|
-
kind: string;
|
|
596
|
-
config: Record<string, unknown>;
|
|
597
|
-
}
|
|
598
|
-
/** Inbound-event matcher for a `provider_event` trigger. */
|
|
599
|
-
interface HubWorkflowEventFilter {
|
|
600
|
-
event: string;
|
|
601
|
-
action?: string;
|
|
602
|
-
repo?: string;
|
|
603
|
-
}
|
|
604
|
-
interface HubWorkflowTrigger {
|
|
605
|
-
id: string;
|
|
606
|
-
kind: "provider_event" | "schedule" | "webhook";
|
|
607
|
-
enabled: boolean;
|
|
608
|
-
provider: string | null;
|
|
609
|
-
connectionId: string | null;
|
|
610
|
-
eventFilter: HubWorkflowEventFilter | null;
|
|
611
|
-
cron: string | null;
|
|
612
|
-
timezone: string | null;
|
|
613
|
-
nextFireAt: string | null;
|
|
614
|
-
lastFiredAt: string | null;
|
|
1099
|
+
interface HubGithubAppIsRepoInstalledRequest {
|
|
1100
|
+
owner: string;
|
|
1101
|
+
repo: string;
|
|
615
1102
|
}
|
|
616
|
-
interface
|
|
1103
|
+
interface HubGithubAppIsRepoInstalledResponse {
|
|
1104
|
+
installed: boolean;
|
|
1105
|
+
installationId: number | null;
|
|
1106
|
+
}
|
|
1107
|
+
//#endregion
|
|
1108
|
+
//#region src/workflow-graph-types.d.ts
|
|
1109
|
+
/** How a node's incoming edges release it (default `"all"` — omitted on the
|
|
1110
|
+
* wire for it, so specs compiled before join rules existed round-trip). */
|
|
1111
|
+
type HubWorkflowGraphJoinRule = "all" | "any" | "any_failed" | "all_done";
|
|
1112
|
+
type HubWorkflowConditionOp = "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "in" | "contains" | "exists" | "truthy";
|
|
1113
|
+
type HubWorkflowConditionScalar = string | number | boolean | null;
|
|
1114
|
+
/** The predicate on a guarded edge (`needs: [{ id, when }]`), evaluated by the
|
|
1115
|
+
* runner against the steps context on the source node's completion. */
|
|
1116
|
+
type HubWorkflowCondition = {
|
|
617
1117
|
path: string;
|
|
618
|
-
|
|
1118
|
+
op: HubWorkflowConditionOp;
|
|
1119
|
+
value?: HubWorkflowConditionScalar | HubWorkflowConditionScalar[];
|
|
1120
|
+
} | {
|
|
1121
|
+
all: HubWorkflowCondition[];
|
|
1122
|
+
} | {
|
|
1123
|
+
any: HubWorkflowCondition[];
|
|
1124
|
+
} | {
|
|
1125
|
+
not: HubWorkflowCondition;
|
|
1126
|
+
};
|
|
1127
|
+
interface HubWorkflowGraphNode {
|
|
1128
|
+
id: string;
|
|
1129
|
+
index: number;
|
|
1130
|
+
join?: HubWorkflowGraphJoinRule;
|
|
1131
|
+
}
|
|
1132
|
+
interface HubWorkflowGraphEdge {
|
|
1133
|
+
from: string;
|
|
1134
|
+
to: string;
|
|
1135
|
+
/** Guard the runner evaluates on the source's completion; unguarded edges
|
|
1136
|
+
* carry no `when`. */
|
|
1137
|
+
when?: HubWorkflowCondition;
|
|
1138
|
+
}
|
|
1139
|
+
/** JSON-serializable form of a validated graph (as stored on run/workflow rows). */
|
|
1140
|
+
interface HubWorkflowGraphSpec {
|
|
1141
|
+
nodes: HubWorkflowGraphNode[];
|
|
1142
|
+
edges: HubWorkflowGraphEdge[];
|
|
1143
|
+
maxNodeVisits: number;
|
|
619
1144
|
}
|
|
1145
|
+
//#endregion
|
|
1146
|
+
//#region src/workflow-run-types.d.ts
|
|
620
1147
|
type HubWorkflowRunStatus = "queued" | "running" | "waiting" | "succeeded" | "failed" | "cancelled";
|
|
621
1148
|
/** One agent iteration of an `agent.run`, as the single-run detail carries it
|
|
622
1149
|
* (JSON-clean ISO timestamps) — including the round's own output `text`. */
|
|
@@ -830,6 +1357,8 @@ interface HubWorkflowRunSummary {
|
|
|
830
1357
|
error: string | null;
|
|
831
1358
|
createdAt: string;
|
|
832
1359
|
completedAt: string | null;
|
|
1360
|
+
/** Execution start; null while queued, absent from older responses. */
|
|
1361
|
+
startedAt?: string | null;
|
|
833
1362
|
}
|
|
834
1363
|
/** One page of run history; `nextCursor` is null on the last page. */
|
|
835
1364
|
interface HubWorkflowRunsPage {
|
|
@@ -865,6 +1394,160 @@ interface HubWorkflowFleetInsights {
|
|
|
865
1394
|
windowStart: string;
|
|
866
1395
|
workflows: HubWorkflowFleetEntry[];
|
|
867
1396
|
}
|
|
1397
|
+
/** One journal completion on the wire: the node that completed and the guard
|
|
1398
|
+
* verdict evaluated for each of its guarded outgoing edges, keyed by edgeKey
|
|
1399
|
+
* (`"from->to"`). Only GUARDED edges ever appear. */
|
|
1400
|
+
interface HubWorkflowEdgeVerdicts {
|
|
1401
|
+
nodeId: string;
|
|
1402
|
+
verdicts: Record<string, boolean>;
|
|
1403
|
+
}
|
|
1404
|
+
/** How an action's `onError` policy handled a failure so the run continued
|
|
1405
|
+
* (the action itself still reads `failed`). */
|
|
1406
|
+
interface HubWorkflowOnErrorOutcome {
|
|
1407
|
+
policy: "continue" | "fallback";
|
|
1408
|
+
/** The recovery leaf's result when the policy ran a `{ do }` fallback. */
|
|
1409
|
+
fallback?: {
|
|
1410
|
+
kind: string;
|
|
1411
|
+
status: "succeeded" | "failed";
|
|
1412
|
+
output?: unknown;
|
|
1413
|
+
error?: string;
|
|
1414
|
+
costUsd?: number;
|
|
1415
|
+
};
|
|
1416
|
+
}
|
|
1417
|
+
/** One node's aggregate across the analyzed runs. */
|
|
1418
|
+
interface HubWorkflowNodeHealth {
|
|
1419
|
+
/** The author's graph node id, or `step-N` for a linear run's nodes (and for
|
|
1420
|
+
* a node whose run cannot be mapped back to a definition). */
|
|
1421
|
+
nodeId: string;
|
|
1422
|
+
visits: number;
|
|
1423
|
+
failures: number;
|
|
1424
|
+
/** Null when no visit carried a cost row (never a fabricated 0). */
|
|
1425
|
+
totalCostUsd: number | null;
|
|
1426
|
+
/** Null when no visit recorded duration spans. */
|
|
1427
|
+
avgDurationMs: number | null;
|
|
1428
|
+
}
|
|
1429
|
+
/** Failures grouped by a normalized error signature (ids/numbers/whitespace
|
|
1430
|
+
* stripped), most frequent first (top 5). */
|
|
1431
|
+
interface HubWorkflowFailureCluster {
|
|
1432
|
+
signature: string;
|
|
1433
|
+
count: number;
|
|
1434
|
+
sampleRunIds: string[];
|
|
1435
|
+
}
|
|
1436
|
+
/** An agent.run node whose outputs are near-static across runs — a
|
|
1437
|
+
* CANDIDATE for distillation, reported with its measurements, never a
|
|
1438
|
+
* verdict. */
|
|
1439
|
+
interface HubWorkflowDistillationCandidate {
|
|
1440
|
+
nodeId: string;
|
|
1441
|
+
matchRatio: number;
|
|
1442
|
+
samples: number;
|
|
1443
|
+
avgCostUsd: number | null;
|
|
1444
|
+
}
|
|
1445
|
+
interface HubWorkflowHealth {
|
|
1446
|
+
/** The requested window (the `runs` parameter). */
|
|
1447
|
+
runsWindow: number;
|
|
1448
|
+
/** Terminal runs that actually went into the stats. */
|
|
1449
|
+
runsAnalyzed: number;
|
|
1450
|
+
nodes: HubWorkflowNodeHealth[];
|
|
1451
|
+
failureClusters: HubWorkflowFailureCluster[];
|
|
1452
|
+
distillationCandidates: HubWorkflowDistillationCandidate[];
|
|
1453
|
+
}
|
|
1454
|
+
type HubWorkflowDecisionStatus = "pending" | "resolved" | "expired" | "cancelled";
|
|
1455
|
+
type HubWorkflowDecisionOnTimeout = "wait" | "fail" | "default";
|
|
1456
|
+
/** How the answer arrived: a UI click, a provider-channel event (e.g. a Slack
|
|
1457
|
+
* reaction), or the timeout policy. */
|
|
1458
|
+
type HubWorkflowDecisionResolvedVia = "in_app" | "channel" | "system";
|
|
1459
|
+
interface HubWorkflowDecision {
|
|
1460
|
+
id: string;
|
|
1461
|
+
runId: string;
|
|
1462
|
+
workflowId: string;
|
|
1463
|
+
actionIndex: number;
|
|
1464
|
+
title: string;
|
|
1465
|
+
prompt: string | null;
|
|
1466
|
+
options: string[];
|
|
1467
|
+
status: HubWorkflowDecisionStatus;
|
|
1468
|
+
onTimeout: HubWorkflowDecisionOnTimeout;
|
|
1469
|
+
defaultChoice: string | null;
|
|
1470
|
+
choice: string | null;
|
|
1471
|
+
note: string | null;
|
|
1472
|
+
timedOut: boolean;
|
|
1473
|
+
requestedAt: string;
|
|
1474
|
+
expiresAt: string | null;
|
|
1475
|
+
resolvedAt: string | null;
|
|
1476
|
+
/** Null while pending, and on a row settled without an answer (expired /
|
|
1477
|
+
* cancelled). */
|
|
1478
|
+
resolvedVia: HubWorkflowDecisionResolvedVia | null;
|
|
1479
|
+
/** `channel` answers only: the provider whose event carried the answer and
|
|
1480
|
+
* the raw external actor id it came from. */
|
|
1481
|
+
resolvedViaProvider: string | null;
|
|
1482
|
+
resolvedByExternalActor: string | null;
|
|
1483
|
+
}
|
|
1484
|
+
/** A pending decision on the cross-workflow list, named by its workflow
|
|
1485
|
+
* (null when the workflow was deleted while the run was parked). */
|
|
1486
|
+
interface HubWorkflowPendingDecision extends HubWorkflowDecision {
|
|
1487
|
+
workflowName: string | null;
|
|
1488
|
+
}
|
|
1489
|
+
interface HubWorkflowPendingDecisionsResponse {
|
|
1490
|
+
decisions: HubWorkflowPendingDecision[];
|
|
1491
|
+
}
|
|
1492
|
+
/** Result of resolving a decision. `resumed` is false when the resolution
|
|
1493
|
+
* stuck but the run could not be resumed (already terminal/cancelled). */
|
|
1494
|
+
interface HubWorkflowDecisionResolveResult {
|
|
1495
|
+
runId: string;
|
|
1496
|
+
decisionId: string;
|
|
1497
|
+
choice: string;
|
|
1498
|
+
resumed: boolean;
|
|
1499
|
+
}
|
|
1500
|
+
/** One step of an agent round's execution timeline (reasoning, or a tool call
|
|
1501
|
+
* with args + result), as the step-page endpoint serves it. */
|
|
1502
|
+
type HubWorkflowAgentStep = {
|
|
1503
|
+
kind: "reasoning";
|
|
1504
|
+
text: string;
|
|
1505
|
+
} | {
|
|
1506
|
+
kind: "tool"; /** Tool name, e.g. "read", "bash". */
|
|
1507
|
+
tool: string;
|
|
1508
|
+
status: "pending" | "running" | "completed" | "error"; /** Arguments the tool was called with (pretty JSON). */
|
|
1509
|
+
input?: string; /** Result the tool returned on success (pretty JSON / text). */
|
|
1510
|
+
output?: string; /** Error message when the tool failed. */
|
|
1511
|
+
error?: string;
|
|
1512
|
+
};
|
|
1513
|
+
/** One page of a round's step archive. `nextCursor` is the last `stepIndex`
|
|
1514
|
+
* held — pass it as `after` for the next page; null on the last page. */
|
|
1515
|
+
interface HubWorkflowRunStepsPage {
|
|
1516
|
+
steps: HubWorkflowAgentStep[];
|
|
1517
|
+
nextCursor: number | null;
|
|
1518
|
+
}
|
|
1519
|
+
//#endregion
|
|
1520
|
+
//#region src/workflow-definition-types.d.ts
|
|
1521
|
+
interface HubWorkflowAction {
|
|
1522
|
+
kind: string;
|
|
1523
|
+
config: Record<string, unknown>;
|
|
1524
|
+
}
|
|
1525
|
+
/** Inbound-event matcher for a `provider_event` trigger. */
|
|
1526
|
+
interface HubWorkflowEventFilter {
|
|
1527
|
+
event: string;
|
|
1528
|
+
action?: string;
|
|
1529
|
+
repo?: string;
|
|
1530
|
+
}
|
|
1531
|
+
interface HubWorkflowTrigger {
|
|
1532
|
+
id: string;
|
|
1533
|
+
kind: "provider_event" | "schedule" | "webhook";
|
|
1534
|
+
enabled: boolean;
|
|
1535
|
+
provider: string | null;
|
|
1536
|
+
connectionId: string | null;
|
|
1537
|
+
eventFilter: HubWorkflowEventFilter | null;
|
|
1538
|
+
cron: string | null;
|
|
1539
|
+
timezone: string | null;
|
|
1540
|
+
nextFireAt: string | null;
|
|
1541
|
+
lastFiredAt: string | null;
|
|
1542
|
+
/** Schedule only: the ISO-8601 instant it stops firing; null when unbounded. */
|
|
1543
|
+
until: string | null;
|
|
1544
|
+
}
|
|
1545
|
+
interface HubWorkflowValidationError {
|
|
1546
|
+
path: string;
|
|
1547
|
+
message: string;
|
|
1548
|
+
/** Machine-readable reason where one is defined, e.g. `schedule_outlives_grant`. */
|
|
1549
|
+
code?: string;
|
|
1550
|
+
}
|
|
868
1551
|
interface HubWorkflow {
|
|
869
1552
|
id: string;
|
|
870
1553
|
name: string;
|
|
@@ -894,82 +1577,26 @@ interface HubWorkflow {
|
|
|
894
1577
|
/** Present on the list response (latest run, or null if never run); omitted on detail. */
|
|
895
1578
|
lastRun?: HubWorkflowRunSummary | null;
|
|
896
1579
|
createdAt: string;
|
|
897
|
-
updatedAt: string;
|
|
898
|
-
}
|
|
899
|
-
/** A trigger field a manual "Run now" must supply (derived from the
|
|
900
|
-
* definition's `${trigger.*}` references). `required` is false only when every
|
|
901
|
-
* read is wrapped in a `default(...)`. */
|
|
902
|
-
interface HubManualRunInput {
|
|
903
|
-
path: string;
|
|
904
|
-
required: boolean;
|
|
905
|
-
}
|
|
906
|
-
type HubWorkflowValidateResponse = {
|
|
907
|
-
valid: true;
|
|
908
|
-
name: string;
|
|
909
|
-
actionCount: number;
|
|
910
|
-
triggerCount: number;
|
|
911
|
-
} | {
|
|
912
|
-
valid: false;
|
|
913
|
-
errors: HubWorkflowValidationError[];
|
|
914
|
-
};
|
|
915
|
-
/** JSON Schema for the YAML workflow definition. */
|
|
916
|
-
type HubWorkflowSchemaResponse = Record<string, unknown>;
|
|
917
|
-
/** How a node's incoming edges release it (default `"all"` — omitted on the
|
|
918
|
-
* wire for it, so specs compiled before join rules existed round-trip). */
|
|
919
|
-
type HubWorkflowGraphJoinRule = "all" | "any" | "any_failed" | "all_done";
|
|
920
|
-
type HubWorkflowConditionOp = "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "in" | "contains" | "exists" | "truthy";
|
|
921
|
-
type HubWorkflowConditionScalar = string | number | boolean | null;
|
|
922
|
-
/** The predicate on a guarded edge (`needs: [{ id, when }]`), evaluated by the
|
|
923
|
-
* runner against the steps context on the source node's completion. */
|
|
924
|
-
type HubWorkflowCondition = {
|
|
925
|
-
path: string;
|
|
926
|
-
op: HubWorkflowConditionOp;
|
|
927
|
-
value?: HubWorkflowConditionScalar | HubWorkflowConditionScalar[];
|
|
928
|
-
} | {
|
|
929
|
-
all: HubWorkflowCondition[];
|
|
930
|
-
} | {
|
|
931
|
-
any: HubWorkflowCondition[];
|
|
932
|
-
} | {
|
|
933
|
-
not: HubWorkflowCondition;
|
|
934
|
-
};
|
|
935
|
-
interface HubWorkflowGraphNode {
|
|
936
|
-
id: string;
|
|
937
|
-
index: number;
|
|
938
|
-
join?: HubWorkflowGraphJoinRule;
|
|
939
|
-
}
|
|
940
|
-
interface HubWorkflowGraphEdge {
|
|
941
|
-
from: string;
|
|
942
|
-
to: string;
|
|
943
|
-
/** Guard the runner evaluates on the source's completion; unguarded edges
|
|
944
|
-
* carry no `when`. */
|
|
945
|
-
when?: HubWorkflowCondition;
|
|
946
|
-
}
|
|
947
|
-
/** JSON-serializable form of a validated graph (as stored on run/workflow rows). */
|
|
948
|
-
interface HubWorkflowGraphSpec {
|
|
949
|
-
nodes: HubWorkflowGraphNode[];
|
|
950
|
-
edges: HubWorkflowGraphEdge[];
|
|
951
|
-
maxNodeVisits: number;
|
|
952
|
-
}
|
|
953
|
-
/** One journal completion on the wire: the node that completed and the guard
|
|
954
|
-
* verdict evaluated for each of its guarded outgoing edges, keyed by edgeKey
|
|
955
|
-
* (`"from->to"`). Only GUARDED edges ever appear. */
|
|
956
|
-
interface HubWorkflowEdgeVerdicts {
|
|
957
|
-
nodeId: string;
|
|
958
|
-
verdicts: Record<string, boolean>;
|
|
1580
|
+
updatedAt: string;
|
|
959
1581
|
}
|
|
960
|
-
/**
|
|
961
|
-
*
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
kind: string;
|
|
967
|
-
status: "succeeded" | "failed";
|
|
968
|
-
output?: unknown;
|
|
969
|
-
error?: string;
|
|
970
|
-
costUsd?: number;
|
|
971
|
-
};
|
|
1582
|
+
/** A trigger field a manual "Run now" must supply (derived from the
|
|
1583
|
+
* definition's `${trigger.*}` references). `required` is false only when every
|
|
1584
|
+
* read is wrapped in a `default(...)`. */
|
|
1585
|
+
interface HubManualRunInput {
|
|
1586
|
+
path: string;
|
|
1587
|
+
required: boolean;
|
|
972
1588
|
}
|
|
1589
|
+
type HubWorkflowValidateResponse = {
|
|
1590
|
+
valid: true;
|
|
1591
|
+
name: string;
|
|
1592
|
+
actionCount: number;
|
|
1593
|
+
triggerCount: number;
|
|
1594
|
+
} | {
|
|
1595
|
+
valid: false;
|
|
1596
|
+
errors: HubWorkflowValidationError[];
|
|
1597
|
+
};
|
|
1598
|
+
/** JSON Schema for the YAML workflow definition. */
|
|
1599
|
+
type HubWorkflowSchemaResponse = Record<string, unknown>;
|
|
973
1600
|
type HubWorkflowRevisionSource = "user" | "copilot" | "intelligence";
|
|
974
1601
|
/** Lifecycle state of a revision. The head rev only ever points at an
|
|
975
1602
|
* `applied` revision; `proposed` is a service-token-authored suggestion
|
|
@@ -1004,94 +1631,6 @@ interface HubWorkflowProposalInput {
|
|
|
1004
1631
|
* the revision and shown on the approval surface. */
|
|
1005
1632
|
evidence?: unknown;
|
|
1006
1633
|
}
|
|
1007
|
-
/** One node's aggregate across the analyzed runs. */
|
|
1008
|
-
interface HubWorkflowNodeHealth {
|
|
1009
|
-
/** The author's graph node id, or `step-N` for a linear run's nodes (and for
|
|
1010
|
-
* a node whose run cannot be mapped back to a definition). */
|
|
1011
|
-
nodeId: string;
|
|
1012
|
-
visits: number;
|
|
1013
|
-
failures: number;
|
|
1014
|
-
/** Null when no visit carried a cost row (never a fabricated 0). */
|
|
1015
|
-
totalCostUsd: number | null;
|
|
1016
|
-
/** Null when no visit recorded duration spans. */
|
|
1017
|
-
avgDurationMs: number | null;
|
|
1018
|
-
}
|
|
1019
|
-
/** Failures grouped by a normalized error signature (ids/numbers/whitespace
|
|
1020
|
-
* stripped), most frequent first (top 5). */
|
|
1021
|
-
interface HubWorkflowFailureCluster {
|
|
1022
|
-
signature: string;
|
|
1023
|
-
count: number;
|
|
1024
|
-
sampleRunIds: string[];
|
|
1025
|
-
}
|
|
1026
|
-
/** An agent.run node whose outputs are near-static across runs — a
|
|
1027
|
-
* CANDIDATE for distillation, reported with its measurements, never a
|
|
1028
|
-
* verdict. */
|
|
1029
|
-
interface HubWorkflowDistillationCandidate {
|
|
1030
|
-
nodeId: string;
|
|
1031
|
-
matchRatio: number;
|
|
1032
|
-
samples: number;
|
|
1033
|
-
avgCostUsd: number | null;
|
|
1034
|
-
}
|
|
1035
|
-
interface HubWorkflowHealth {
|
|
1036
|
-
/** The requested window (the `runs` parameter). */
|
|
1037
|
-
runsWindow: number;
|
|
1038
|
-
/** Terminal runs that actually went into the stats. */
|
|
1039
|
-
runsAnalyzed: number;
|
|
1040
|
-
nodes: HubWorkflowNodeHealth[];
|
|
1041
|
-
failureClusters: HubWorkflowFailureCluster[];
|
|
1042
|
-
distillationCandidates: HubWorkflowDistillationCandidate[];
|
|
1043
|
-
}
|
|
1044
|
-
/** One KV entry with its metadata — the get/put/cas response shape. */
|
|
1045
|
-
interface HubWorkflowKvEntry {
|
|
1046
|
-
key: string;
|
|
1047
|
-
value: unknown;
|
|
1048
|
-
version: number;
|
|
1049
|
-
updatedAt: string;
|
|
1050
|
-
}
|
|
1051
|
-
/** Keyspace metadata row (never the value) — the list response's entry. */
|
|
1052
|
-
interface HubWorkflowKvEntryMeta {
|
|
1053
|
-
key: string;
|
|
1054
|
-
version: number;
|
|
1055
|
-
updatedAt: string;
|
|
1056
|
-
}
|
|
1057
|
-
interface HubWorkflowKvListResponse {
|
|
1058
|
-
entries: HubWorkflowKvEntryMeta[];
|
|
1059
|
-
}
|
|
1060
|
-
interface HubWorkflowKvDeleteResponse {
|
|
1061
|
-
deleted: boolean;
|
|
1062
|
-
}
|
|
1063
|
-
/** The opaque ref a stored artifact is referred to by — the value a
|
|
1064
|
-
* script.run node returns as its step output. */
|
|
1065
|
-
interface HubWorkflowArtifactRef {
|
|
1066
|
-
$artifact: string;
|
|
1067
|
-
name: string;
|
|
1068
|
-
contentType: string;
|
|
1069
|
-
byteSize: number;
|
|
1070
|
-
preview: string | null;
|
|
1071
|
-
}
|
|
1072
|
-
/** Artifact metadata (never the bytes), oldest first on the list response. */
|
|
1073
|
-
interface HubWorkflowArtifact {
|
|
1074
|
-
id: string;
|
|
1075
|
-
runId: string;
|
|
1076
|
-
workflowId: string;
|
|
1077
|
-
/** The graph node (or `step-N` positional id on linear runs) whose action
|
|
1078
|
-
* emitted the artifact. */
|
|
1079
|
-
nodeId: string;
|
|
1080
|
-
name: string;
|
|
1081
|
-
contentType: string;
|
|
1082
|
-
byteSize: number;
|
|
1083
|
-
/** First 2KiB of textual content; null for binary content types. */
|
|
1084
|
-
preview: string | null;
|
|
1085
|
-
createdAt: string;
|
|
1086
|
-
}
|
|
1087
|
-
interface HubWorkflowArtifactsResponse {
|
|
1088
|
-
artifacts: HubWorkflowArtifact[];
|
|
1089
|
-
}
|
|
1090
|
-
/** Raw artifact bytes from the download route, with their stored content type. */
|
|
1091
|
-
interface HubWorkflowArtifactDownload {
|
|
1092
|
-
bytes: Uint8Array;
|
|
1093
|
-
contentType: string;
|
|
1094
|
-
}
|
|
1095
1634
|
type HubWorkflowTemplateCategory = "Code Review" | "Triage" | "Reports" | "Multi-agent";
|
|
1096
1635
|
/** One author-time literal a gallery starter needs the user to supply. Every
|
|
1097
1636
|
* declared parameter is required; `example` is a valid value that seeds the
|
|
@@ -1102,6 +1641,10 @@ interface HubWorkflowTemplateParameter {
|
|
|
1102
1641
|
type: "string" | "integer";
|
|
1103
1642
|
help?: string;
|
|
1104
1643
|
example: string;
|
|
1644
|
+
default?: string;
|
|
1645
|
+
defaultFrom?: "native_evaluation";
|
|
1646
|
+
required?: boolean;
|
|
1647
|
+
advanced?: boolean;
|
|
1105
1648
|
}
|
|
1106
1649
|
interface HubWorkflowTemplate {
|
|
1107
1650
|
id: string;
|
|
@@ -1115,6 +1658,7 @@ interface HubWorkflowTemplate {
|
|
|
1115
1658
|
parameters: HubWorkflowTemplateParameter[];
|
|
1116
1659
|
/** The template with parameter tokens rendered to their example values. */
|
|
1117
1660
|
previewYaml: string;
|
|
1661
|
+
setupNotes?: string[];
|
|
1118
1662
|
}
|
|
1119
1663
|
/** A connection a definition needs, with where to connect it. */
|
|
1120
1664
|
interface HubWorkflowConnectionRequirement {
|
|
@@ -1133,6 +1677,8 @@ interface HubWorkflowConnectionRequirement {
|
|
|
1133
1677
|
kind: "integration" | "github_app";
|
|
1134
1678
|
} | null;
|
|
1135
1679
|
}
|
|
1680
|
+
/** Stable identity shared by workflow connection requirements and prerequisite references. */
|
|
1681
|
+
declare function workflowConnectionRequirementKey(ref: Readonly<Pick<HubWorkflowConnectionRequirement, "provider" | "kind">>): string;
|
|
1136
1682
|
/**
|
|
1137
1683
|
* Result of instantiating a template. `created: false` is NOT an error — an
|
|
1138
1684
|
* actionable continuation listing the connections to satisfy before retrying
|
|
@@ -1146,83 +1692,410 @@ type HubWorkflowTemplateInstantiateResult = {
|
|
|
1146
1692
|
created: false;
|
|
1147
1693
|
connectionRequirements: HubWorkflowConnectionRequirement[];
|
|
1148
1694
|
};
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1695
|
+
/** A workflow's webhook delivery endpoint. `token` is the plaintext bearer —
|
|
1696
|
+
* revealed only at mint/rotate time (only the hash is stored). */
|
|
1697
|
+
interface HubWorkflowHookEndpoint {
|
|
1698
|
+
url: string;
|
|
1699
|
+
token?: string;
|
|
1700
|
+
}
|
|
1701
|
+
interface HubWorkflowHookToken {
|
|
1702
|
+
url: string;
|
|
1703
|
+
token: string;
|
|
1704
|
+
}
|
|
1705
|
+
//#endregion
|
|
1706
|
+
//#region src/workflow-storage-types.d.ts
|
|
1707
|
+
/** One KV entry with its metadata — the get/put/cas response shape. */
|
|
1708
|
+
interface HubWorkflowKvEntry {
|
|
1709
|
+
key: string;
|
|
1710
|
+
value: unknown;
|
|
1711
|
+
version: number;
|
|
1712
|
+
updatedAt: string;
|
|
1713
|
+
}
|
|
1714
|
+
/** Keyspace metadata row (never the value) — the list response's entry. */
|
|
1715
|
+
interface HubWorkflowKvEntryMeta {
|
|
1716
|
+
key: string;
|
|
1717
|
+
version: number;
|
|
1718
|
+
updatedAt: string;
|
|
1719
|
+
}
|
|
1720
|
+
interface HubWorkflowKvListResponse {
|
|
1721
|
+
entries: HubWorkflowKvEntryMeta[];
|
|
1722
|
+
}
|
|
1723
|
+
interface HubWorkflowKvDeleteResponse {
|
|
1724
|
+
deleted: boolean;
|
|
1725
|
+
}
|
|
1726
|
+
/** The opaque ref a stored artifact is referred to by — the value a
|
|
1727
|
+
* script.run node returns as its step output. */
|
|
1728
|
+
interface HubWorkflowArtifactRef {
|
|
1729
|
+
$artifact: string;
|
|
1730
|
+
name: string;
|
|
1731
|
+
contentType: string;
|
|
1732
|
+
byteSize: number;
|
|
1733
|
+
preview: string | null;
|
|
1734
|
+
}
|
|
1735
|
+
/** Artifact metadata (never the bytes), oldest first on the list response. */
|
|
1736
|
+
interface HubWorkflowArtifact {
|
|
1155
1737
|
id: string;
|
|
1156
1738
|
runId: string;
|
|
1157
1739
|
workflowId: string;
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
timedOut: boolean;
|
|
1168
|
-
requestedAt: string;
|
|
1169
|
-
expiresAt: string | null;
|
|
1170
|
-
resolvedAt: string | null;
|
|
1171
|
-
/** Null while pending, and on a row settled without an answer (expired /
|
|
1172
|
-
* cancelled). */
|
|
1173
|
-
resolvedVia: HubWorkflowDecisionResolvedVia | null;
|
|
1174
|
-
/** `channel` answers only: the provider whose event carried the answer and
|
|
1175
|
-
* the raw external actor id it came from. */
|
|
1176
|
-
resolvedViaProvider: string | null;
|
|
1177
|
-
resolvedByExternalActor: string | null;
|
|
1740
|
+
/** The graph node (or `step-N` positional id on linear runs) whose action
|
|
1741
|
+
* emitted the artifact. */
|
|
1742
|
+
nodeId: string;
|
|
1743
|
+
name: string;
|
|
1744
|
+
contentType: string;
|
|
1745
|
+
byteSize: number;
|
|
1746
|
+
/** First 2KiB of textual content; null for binary content types. */
|
|
1747
|
+
preview: string | null;
|
|
1748
|
+
createdAt: string;
|
|
1178
1749
|
}
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
interface HubWorkflowPendingDecision extends HubWorkflowDecision {
|
|
1182
|
-
workflowName: string | null;
|
|
1750
|
+
interface HubWorkflowArtifactsResponse {
|
|
1751
|
+
artifacts: HubWorkflowArtifact[];
|
|
1183
1752
|
}
|
|
1184
|
-
|
|
1185
|
-
|
|
1753
|
+
/** Raw artifact bytes from the download route, with their stored content type. */
|
|
1754
|
+
interface HubWorkflowArtifactDownload {
|
|
1755
|
+
bytes: Uint8Array;
|
|
1756
|
+
contentType: string;
|
|
1186
1757
|
}
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
interface
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1758
|
+
//#endregion
|
|
1759
|
+
//#region src/lines.d.ts
|
|
1760
|
+
interface HubLineMember {
|
|
1761
|
+
id: string;
|
|
1762
|
+
label: string | null;
|
|
1763
|
+
role: string;
|
|
1764
|
+
self?: boolean;
|
|
1765
|
+
consent?: "enabled" | "required";
|
|
1194
1766
|
}
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1767
|
+
interface HubLineContext {
|
|
1768
|
+
self: {
|
|
1769
|
+
id: string;
|
|
1770
|
+
label: string | null;
|
|
1771
|
+
role: string;
|
|
1772
|
+
};
|
|
1773
|
+
line: {
|
|
1774
|
+
id: string;
|
|
1775
|
+
label: string | null;
|
|
1776
|
+
transport: string;
|
|
1777
|
+
};
|
|
1778
|
+
members: HubLineMember[];
|
|
1779
|
+
capabilities: Record<string, {
|
|
1780
|
+
allowed: boolean;
|
|
1781
|
+
reason?: string;
|
|
1782
|
+
}>;
|
|
1783
|
+
pendingReminders: Array<{
|
|
1784
|
+
messageId: string;
|
|
1785
|
+
wakeAt?: string;
|
|
1786
|
+
prompt: string | null;
|
|
1787
|
+
}>;
|
|
1788
|
+
quotas: {
|
|
1789
|
+
selfMessagesToday: number;
|
|
1790
|
+
selfMessagesPerDay: number;
|
|
1791
|
+
selfMessagesPending: number;
|
|
1792
|
+
selfMessagesPendingLimit: number;
|
|
1793
|
+
};
|
|
1794
|
+
}
|
|
1795
|
+
interface HubLineSendInput {
|
|
1796
|
+
toMember: string;
|
|
1797
|
+
text: string;
|
|
1798
|
+
notBefore?: string;
|
|
1799
|
+
onBehalfOf?: string;
|
|
1800
|
+
idempotencyKey?: string;
|
|
1801
|
+
}
|
|
1802
|
+
/** An asset URL safe to share with the recipient and provider. Hub never fetches it.
|
|
1803
|
+
* Meta WhatsApp API-key lines send it with `text` as the caption. Other transports refuse it.
|
|
1804
|
+
* Use public HTTPS without a query, fragment or credentials. */
|
|
1805
|
+
interface HubLineImage {
|
|
1198
1806
|
url: string;
|
|
1199
|
-
token?: string;
|
|
1200
1807
|
}
|
|
1201
|
-
interface
|
|
1202
|
-
|
|
1808
|
+
interface HubLineOwnerSendInput {
|
|
1809
|
+
memberId: string;
|
|
1810
|
+
text: string;
|
|
1811
|
+
image?: HubLineImage;
|
|
1812
|
+
notBefore?: string;
|
|
1813
|
+
idempotencyKey: string;
|
|
1814
|
+
/** Ask a coded question; the member's reply that starts with `code` returns here. */
|
|
1815
|
+
reply?: HubLineReplyCodeInput;
|
|
1816
|
+
}
|
|
1817
|
+
interface HubLineReplyCodeInput {
|
|
1818
|
+
/** A letter, then up to seven letters or digits, with at least one digit (`F7`). Hub compares it case-insensitively. */
|
|
1819
|
+
code: string;
|
|
1820
|
+
/** 60 to 604800; the window opens when the send first becomes eligible. */
|
|
1821
|
+
ttlSeconds: number;
|
|
1822
|
+
/**
|
|
1823
|
+
* 1 to 20 distinct texted choices, each 1-32 of `a-z 0-9 _ -` after lower-casing.
|
|
1824
|
+
* An answer must then be `<code> <option>[ <note>]`; any other coded text keeps the question open.
|
|
1825
|
+
*/
|
|
1826
|
+
options?: string[];
|
|
1827
|
+
}
|
|
1828
|
+
/** The coded question's state on an owner send receipt. */
|
|
1829
|
+
interface HubLineReplyCode {
|
|
1830
|
+
/** Upper case. */
|
|
1831
|
+
code: string;
|
|
1832
|
+
expiresAt: string;
|
|
1833
|
+
/** Authoritative closure fence; absent on older Hub, never infer it from local time. */
|
|
1834
|
+
closed?: boolean;
|
|
1835
|
+
/** The first coded answer; `text` is null after content retention ends. */
|
|
1836
|
+
answer: {
|
|
1837
|
+
messageId: string;
|
|
1838
|
+
text: string | null;
|
|
1839
|
+
receivedAt: string; /** The named option, lower case; null when the send listed no options. */
|
|
1840
|
+
option: string | null; /** Words after the option; null when there were none or retention ended. */
|
|
1841
|
+
note: string | null;
|
|
1842
|
+
} | null;
|
|
1843
|
+
}
|
|
1844
|
+
interface HubLineReminderInput {
|
|
1845
|
+
text: string;
|
|
1846
|
+
notBefore: string;
|
|
1847
|
+
idempotencyKey: string;
|
|
1848
|
+
}
|
|
1849
|
+
interface HubLineApplicationDispatchCurrentInput {
|
|
1850
|
+
attachmentId: string;
|
|
1851
|
+
memberId: string;
|
|
1852
|
+
memberRevision: string;
|
|
1853
|
+
senderAddress: string;
|
|
1854
|
+
textSha256: string;
|
|
1855
|
+
binding: string;
|
|
1856
|
+
dispatchFence: string;
|
|
1857
|
+
dispatchDeadline: string;
|
|
1858
|
+
}
|
|
1859
|
+
interface HubLineMemberApplication {
|
|
1860
|
+
id: string;
|
|
1861
|
+
lineId: string;
|
|
1862
|
+
attachmentId: string;
|
|
1863
|
+
memberId: string;
|
|
1864
|
+
subjectId: string;
|
|
1865
|
+
status: "active" | "revoked";
|
|
1866
|
+
application: {
|
|
1867
|
+
url: string;
|
|
1868
|
+
binding: string;
|
|
1869
|
+
};
|
|
1870
|
+
/** Hub's name for the app at this callback; present on reads. */
|
|
1871
|
+
app?: {
|
|
1872
|
+
name: string;
|
|
1873
|
+
};
|
|
1874
|
+
createdAt: string;
|
|
1875
|
+
revokedAt: string | null;
|
|
1876
|
+
}
|
|
1877
|
+
interface HubLineMemberApplicationInput {
|
|
1878
|
+
expectedSelectionId: string | null;
|
|
1879
|
+
expectedMemberRevision: string;
|
|
1880
|
+
subjectId: string;
|
|
1881
|
+
application: {
|
|
1882
|
+
url: string;
|
|
1883
|
+
binding: string;
|
|
1884
|
+
secret: string;
|
|
1885
|
+
};
|
|
1886
|
+
}
|
|
1887
|
+
interface HubLineProviderDelivery {
|
|
1888
|
+
provider: "meta_whatsapp";
|
|
1889
|
+
messageId: string;
|
|
1890
|
+
acceptedAt: string;
|
|
1891
|
+
sentAt: string | null;
|
|
1892
|
+
deliveredAt: string | null;
|
|
1893
|
+
readAt: string | null;
|
|
1894
|
+
failedAt: string | null;
|
|
1895
|
+
failureCode: number | null;
|
|
1896
|
+
}
|
|
1897
|
+
interface HubLineSendReceipt {
|
|
1898
|
+
/** Absent on older Hub. Replied/accepted never implies delivered. */
|
|
1899
|
+
delivery?: HubLineProviderDelivery | null;
|
|
1900
|
+
message: {
|
|
1901
|
+
id: string;
|
|
1902
|
+
status: string;
|
|
1903
|
+
text: string | null;
|
|
1904
|
+
image?: HubLineImage;
|
|
1905
|
+
};
|
|
1906
|
+
eligibleAt: string | null;
|
|
1907
|
+
expiresAt: string;
|
|
1908
|
+
/** Null when the send asked no coded question; absent from Hub before reply codes. */
|
|
1909
|
+
reply?: HubLineReplyCode | null;
|
|
1910
|
+
}
|
|
1911
|
+
interface HubLineReminderReceipt {
|
|
1912
|
+
state: "queued" | "skipped";
|
|
1913
|
+
lineId: string;
|
|
1914
|
+
messageId?: string;
|
|
1915
|
+
sessionId?: string;
|
|
1916
|
+
completion?: string;
|
|
1917
|
+
reason?: string;
|
|
1918
|
+
}
|
|
1919
|
+
interface HubLineScheduledSendOptions {
|
|
1920
|
+
lineId: string;
|
|
1921
|
+
memberId: string;
|
|
1922
|
+
text: string;
|
|
1923
|
+
timezone: string;
|
|
1924
|
+
name?: string;
|
|
1925
|
+
notBefore?: string;
|
|
1926
|
+
/**
|
|
1927
|
+
* RFC 3339 instant the schedule stops at. Required when the calling key
|
|
1928
|
+
* expires, and no later than that expiry: a schedule never outlives the
|
|
1929
|
+
* key that wrote it.
|
|
1930
|
+
*/
|
|
1931
|
+
until?: string;
|
|
1932
|
+
}
|
|
1933
|
+
interface HubLineCheckinOptions {
|
|
1934
|
+
lineId: string;
|
|
1935
|
+
member: string;
|
|
1936
|
+
timezone: string;
|
|
1937
|
+
prompt: string;
|
|
1938
|
+
name?: string;
|
|
1939
|
+
/** RFC 3339 instant the schedule stops at; see {@link HubLineScheduledSendOptions.until}. */
|
|
1940
|
+
until?: string;
|
|
1941
|
+
}
|
|
1942
|
+
/** Line calls share HubClient authentication and envelope handling. */
|
|
1943
|
+
declare class HubLinesClient {
|
|
1944
|
+
private readonly request;
|
|
1945
|
+
private readonly createWorkflow;
|
|
1946
|
+
private readonly requestApplicationDispatchCurrent?;
|
|
1947
|
+
readonly members: {
|
|
1948
|
+
list: (lineId: string) => Promise<HubLineMember[]>;
|
|
1949
|
+
};
|
|
1950
|
+
readonly memberApplications: {
|
|
1951
|
+
get: (lineId: string, memberId: string) => Promise<{
|
|
1952
|
+
memberRevision: string;
|
|
1953
|
+
selection: HubLineMemberApplication | null;
|
|
1954
|
+
}>;
|
|
1955
|
+
select: (lineId: string, memberId: string, input: HubLineMemberApplicationInput) => Promise<HubLineMemberApplication>;
|
|
1956
|
+
clear: (lineId: string, memberId: string, input: {
|
|
1957
|
+
expectedSelectionId: string;
|
|
1958
|
+
expectedMemberRevision: string;
|
|
1959
|
+
}) => Promise<void>;
|
|
1960
|
+
};
|
|
1961
|
+
readonly checkins: {
|
|
1962
|
+
schedule: (cron: string, options: HubLineCheckinOptions) => Promise<HubWorkflow>;
|
|
1963
|
+
};
|
|
1964
|
+
constructor(request: <T>(path: string, init: RequestInit) => Promise<T>, createWorkflow: (yaml: string) => Promise<HubWorkflow>, requestApplicationDispatchCurrent?: ((path: string, init: RequestInit, callbackBearer: string) => Promise<{
|
|
1965
|
+
current: boolean;
|
|
1966
|
+
}>) | undefined);
|
|
1967
|
+
scheduleSend(cron: string, options: HubLineScheduledSendOptions): Promise<HubWorkflow>;
|
|
1968
|
+
context(): Promise<HubLineContext>;
|
|
1969
|
+
send(lineId: string, input: HubLineSendInput | HubLineOwnerSendInput): Promise<HubLineSendReceipt>;
|
|
1970
|
+
/** Read an owner send's receipt, including its coded answer. Queued is not delivered. */
|
|
1971
|
+
sentMessage(lineId: string, messageId: string): Promise<HubLineSendReceipt>;
|
|
1972
|
+
remind(lineId: string, input: HubLineReminderInput): Promise<HubLineReminderReceipt>;
|
|
1973
|
+
applicationDispatchCurrent(lineId: string, messageId: string, input: HubLineApplicationDispatchCurrentInput, callbackBearer: string): Promise<boolean>;
|
|
1974
|
+
}
|
|
1975
|
+
//#endregion
|
|
1976
|
+
//#region src/managed-numbers.d.ts
|
|
1977
|
+
interface HubNumberReadiness {
|
|
1978
|
+
configured: boolean;
|
|
1979
|
+
provider: "inkbox";
|
|
1980
|
+
transports: Array<"sms" | "imessage">;
|
|
1981
|
+
billing: "prepaid_activation";
|
|
1982
|
+
automaticRentalBilling: false;
|
|
1983
|
+
deliveryVerified: false;
|
|
1984
|
+
}
|
|
1985
|
+
interface HubNumberQuote {
|
|
1986
|
+
transport: "sms" | "imessage";
|
|
1987
|
+
activationCents: number;
|
|
1988
|
+
currency: "usd";
|
|
1989
|
+
termsVersion: string;
|
|
1990
|
+
terms: string;
|
|
1991
|
+
expiresAt: number;
|
|
1992
|
+
/** The binding the quote was issued for. Absent from older servers. */
|
|
1993
|
+
clientReference?: string;
|
|
1994
|
+
/** Opaque. Pass it back to `create`; never decode it. */
|
|
1203
1995
|
token: string;
|
|
1204
1996
|
}
|
|
1205
|
-
/** One
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1997
|
+
/** One page of the owner's orders, newest first. */
|
|
1998
|
+
interface HubNumberOrderPage {
|
|
1999
|
+
orders: HubNumberOrder[];
|
|
2000
|
+
/** Present while more orders exist. Older servers omit it and return one
|
|
2001
|
+
* bounded page, so an absent cursor never proves an order does not exist. */
|
|
2002
|
+
nextCursor?: string | null;
|
|
2003
|
+
}
|
|
2004
|
+
interface HubNumberListQuery {
|
|
2005
|
+
/** Only orders requested for this binding, including closed ones. */
|
|
2006
|
+
clientReference?: string;
|
|
2007
|
+
cursor?: string;
|
|
2008
|
+
/** 1 to 100; the server default is 100. */
|
|
2009
|
+
limit?: number;
|
|
2010
|
+
}
|
|
2011
|
+
/** An operator's terminal decision on an order stuck in `needs_review`.
|
|
2012
|
+
* Read-only for a creator: the resolution is made through the platform's
|
|
2013
|
+
* admin surface, never through this client. */
|
|
2014
|
+
interface HubNumberResolution {
|
|
2015
|
+
action: "release" | "settle" | "abandon";
|
|
2016
|
+
operator: string;
|
|
2017
|
+
reason: string;
|
|
2018
|
+
at: number;
|
|
2019
|
+
/** Present while the operator's action is still running. The decision is
|
|
2020
|
+
* not final and the order can still return to review. */
|
|
2021
|
+
pending?: true;
|
|
2022
|
+
/** Present when a `settle` handed a live, unfinished order back to
|
|
2023
|
+
* provisioning, so the order is working again rather than closed. */
|
|
2024
|
+
requeued?: true;
|
|
2025
|
+
}
|
|
2026
|
+
interface HubNumberOrder {
|
|
2027
|
+
id: string;
|
|
2028
|
+
clientReference: string;
|
|
2029
|
+
transport: "sms" | "imessage";
|
|
2030
|
+
status: "pending" | "provider_pending" | "needs_review" | "ready_for_setup" | "cancelled";
|
|
2031
|
+
phase: "identity" | "number" | "credential" | "connection" | "complete";
|
|
2032
|
+
address: string | null;
|
|
2033
|
+
connectionId: string | null;
|
|
2034
|
+
identityId: string | null;
|
|
2035
|
+
providerNumberId: string | null;
|
|
2036
|
+
billingStatus: "unreserved" | "reserved" | "settled" | "released";
|
|
2037
|
+
cancellation: "none" | "requested" | "needs_review" | "released" | "abandoned";
|
|
2038
|
+
errorCode: string | null;
|
|
2039
|
+
nextAttemptAt: number | null;
|
|
2040
|
+
resolution: HubNumberResolution | null;
|
|
2041
|
+
deliveryVerified: false;
|
|
2042
|
+
activationCents: number;
|
|
2043
|
+
currency: "usd";
|
|
2044
|
+
terms: string;
|
|
2045
|
+
}
|
|
2046
|
+
/** Administrative number operations through Hub's authenticated transport.
|
|
2047
|
+
* A mutation is one attempt; an uncertain create reuses its quote and reference. */
|
|
2048
|
+
declare class HubManagedNumbersClient {
|
|
2049
|
+
private readonly request;
|
|
2050
|
+
constructor(request: <T>(path: string, init: RequestInit) => Promise<T>);
|
|
2051
|
+
readiness(): Promise<HubNumberReadiness>;
|
|
2052
|
+
/** One page of orders. Scope by `clientReference` to ask about one binding,
|
|
2053
|
+
* and follow `nextCursor` for the rest; a page is never ownership evidence. */
|
|
2054
|
+
list(query?: HubNumberListQuery): Promise<HubNumberOrderPage>;
|
|
2055
|
+
get(id: string): Promise<{
|
|
2056
|
+
order: HubNumberOrder;
|
|
2057
|
+
}>;
|
|
2058
|
+
quote(input: {
|
|
2059
|
+
transport: "sms" | "imessage";
|
|
2060
|
+
clientReference: string;
|
|
2061
|
+
}): Promise<{
|
|
2062
|
+
quote: HubNumberQuote;
|
|
2063
|
+
}>;
|
|
2064
|
+
/** `clientReference` and `transport`, when given, must match the signed
|
|
2065
|
+
* quote or Hub refuses the purchase with a conflict. */
|
|
2066
|
+
create(input: {
|
|
2067
|
+
quoteToken: string;
|
|
2068
|
+
consent: true;
|
|
2069
|
+
state?: string;
|
|
2070
|
+
clientReference?: string;
|
|
2071
|
+
transport?: "sms" | "imessage";
|
|
2072
|
+
}): Promise<{
|
|
2073
|
+
order: HubNumberOrder;
|
|
2074
|
+
}>;
|
|
2075
|
+
/** Fences references so no order can take them again. Call it as the last
|
|
2076
|
+
* step before retiring the resource they name: a purchase that races the
|
|
2077
|
+
* retirement is then refused (`409 number_reference_fenced`) instead of
|
|
2078
|
+
* binding a line to a resource that is gone. Refused with
|
|
2079
|
+
* `409 number_reference_held` while a live order holds one of them; cancel
|
|
2080
|
+
* it first. A cancelled order no longer holds its reference, so the fence
|
|
2081
|
+
* succeeds as soon as `cancel` returns, whether or not its release is still
|
|
2082
|
+
* pending. Repeating a fence is harmless. */
|
|
2083
|
+
fence(input: {
|
|
2084
|
+
clientReferences: string[];
|
|
2085
|
+
}): Promise<{
|
|
2086
|
+
clientReferences: string[];
|
|
2087
|
+
}>;
|
|
2088
|
+
advance(id: string): Promise<{
|
|
2089
|
+
order: HubNumberOrder;
|
|
2090
|
+
}>;
|
|
2091
|
+
cancel(id: string): Promise<{
|
|
2092
|
+
order: HubNumberOrder;
|
|
2093
|
+
}>;
|
|
2094
|
+
private path;
|
|
2095
|
+
private post;
|
|
1223
2096
|
}
|
|
1224
2097
|
//#endregion
|
|
1225
|
-
//#region src/
|
|
2098
|
+
//#region src/transport.d.ts
|
|
1226
2099
|
type HubAuthHeaders = () => HeadersInit | Promise<HeadersInit>;
|
|
1227
2100
|
interface HubClientOptions {
|
|
1228
2101
|
baseUrl: string;
|
|
@@ -1238,6 +2111,26 @@ declare class HubSdkError extends Error {
|
|
|
1238
2111
|
status?: number;
|
|
1239
2112
|
});
|
|
1240
2113
|
}
|
|
2114
|
+
declare class HubTransport {
|
|
2115
|
+
#private;
|
|
2116
|
+
readonly baseUrl: string;
|
|
2117
|
+
readonly fetch: typeof fetch;
|
|
2118
|
+
readonly authHeaders?: HubAuthHeaders;
|
|
2119
|
+
constructor(options: HubClientOptions);
|
|
2120
|
+
/** The API key this client authenticates with, when it has one. */
|
|
2121
|
+
get apiKey(): string | undefined;
|
|
2122
|
+
protected request<TData>(path: string, init: RequestInit, options?: {
|
|
2123
|
+
auth?: "client" | "caller";
|
|
2124
|
+
validateData?: (data: unknown) => data is TData;
|
|
2125
|
+
}): Promise<TData>;
|
|
2126
|
+
protected buildHeaders(headers: HeadersInit | undefined, callerAuth?: boolean): Promise<Headers>;
|
|
2127
|
+
}
|
|
2128
|
+
/** Domain clients receive the existing envelope transport as one request function. */
|
|
2129
|
+
type HubRequest = <TData>(path: string, init: RequestInit) => Promise<TData>;
|
|
2130
|
+
type HubStreamRequest = (path: string, init: RequestInit) => Promise<ReadableStream<Uint8Array>>;
|
|
2131
|
+
type HubArtifactRequest = (path: string, init: RequestInit) => Promise<HubWorkflowArtifactDownload>;
|
|
2132
|
+
//#endregion
|
|
2133
|
+
//#region src/environment.d.ts
|
|
1241
2134
|
declare const HUB_URL_ENV_VAR: "TANGLE_HUB_URL";
|
|
1242
2135
|
declare const HUB_API_KEY_ENV_VAR: "TANGLE_API_KEY";
|
|
1243
2136
|
declare const HUB_CAPABILITY_TOKEN_ENV_VAR: "TANGLE_HUB_CAPABILITY_TOKEN";
|
|
@@ -1250,53 +2143,14 @@ interface HubClientFromEnvOptions {
|
|
|
1250
2143
|
}
|
|
1251
2144
|
declare function resolveHubBaseUrl(env?: HubEnv): string;
|
|
1252
2145
|
declare function resolveHubAuth(env?: HubEnv): string;
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
readonly fetch: typeof fetch;
|
|
1256
|
-
readonly apiKey?: string;
|
|
1257
|
-
readonly authHeaders?: HubAuthHeaders;
|
|
1258
|
-
readonly connections: HubConnectionsClient;
|
|
1259
|
-
readonly channels: HubChannelsClient;
|
|
1260
|
-
readonly eventSubscriptions: HubEventSubscriptionsClient;
|
|
1261
|
-
readonly permissions: HubPermissionsClient;
|
|
1262
|
-
readonly tokens: HubTokensClient;
|
|
1263
|
-
readonly tools: HubToolsClient;
|
|
1264
|
-
readonly approvals: HubApprovalsClient;
|
|
1265
|
-
readonly audit: HubAuditClient;
|
|
1266
|
-
readonly githubApp: HubGithubAppClient;
|
|
1267
|
-
readonly workflows: HubWorkflowsClient;
|
|
1268
|
-
constructor(options: HubClientOptions);
|
|
1269
|
-
static fromEnv(options?: HubClientFromEnvOptions): HubClient;
|
|
1270
|
-
status(): Promise<HubStatusResponse>;
|
|
1271
|
-
private request;
|
|
1272
|
-
/**
|
|
1273
|
-
* Open a streaming (Server-Sent Events) response and return its raw body.
|
|
1274
|
-
* Shares auth-header building + `fetch` with {@link request}, but does NOT
|
|
1275
|
-
* buffer or JSON-parse the body — the caller consumes the stream.
|
|
1276
|
-
*
|
|
1277
|
-
* A successful stream comes back as `text/event-stream`. Anything else is an
|
|
1278
|
-
* error envelope (404/429/401 JSON) or a transport failure (gateway/HTML
|
|
1279
|
-
* page); it is surfaced the same way {@link request} surfaces errors — a
|
|
1280
|
-
* typed `HubSdkError` from a `{success:false}` envelope, otherwise an
|
|
1281
|
-
* `HUB_HTTP_<status>` transport error — rather than handed back as bogus SSE.
|
|
1282
|
-
*/
|
|
1283
|
-
private stream;
|
|
1284
|
-
/**
|
|
1285
|
-
* Fetch raw (non-envelope) bytes — the artifact download route, whose 200 is
|
|
1286
|
-
* the artifact's own content type, not JSON. Error responses on such routes
|
|
1287
|
-
* are still the standard envelope, so a failure surfaces exactly like
|
|
1288
|
-
* {@link request}: a typed `HubSdkError` from a `{success:false}` body,
|
|
1289
|
-
* otherwise an `HUB_HTTP_<status>` transport error.
|
|
1290
|
-
*/
|
|
1291
|
-
private requestBytes;
|
|
1292
|
-
private buildHeaders;
|
|
1293
|
-
}
|
|
2146
|
+
//#endregion
|
|
2147
|
+
//#region src/authorization.d.ts
|
|
1294
2148
|
interface HubTokenListOptions {
|
|
1295
2149
|
includeExpired?: boolean;
|
|
1296
2150
|
}
|
|
1297
2151
|
declare class HubTokensClient {
|
|
1298
2152
|
private readonly request;
|
|
1299
|
-
constructor(request:
|
|
2153
|
+
constructor(request: HubRequest);
|
|
1300
2154
|
mint(options: {
|
|
1301
2155
|
actionPath: string;
|
|
1302
2156
|
connectionId?: string;
|
|
@@ -1308,7 +2162,7 @@ declare class HubTokensClient {
|
|
|
1308
2162
|
}
|
|
1309
2163
|
declare class HubPermissionsClient {
|
|
1310
2164
|
private readonly request;
|
|
1311
|
-
constructor(request:
|
|
2165
|
+
constructor(request: HubRequest);
|
|
1312
2166
|
list(connectionId: string): Promise<HubPolicyListResponse>;
|
|
1313
2167
|
set(input: HubPolicyUpdateRequest): Promise<HubPolicyResponse>;
|
|
1314
2168
|
/** Reset an action to its default by deleting any stored override. */
|
|
@@ -1321,6 +2175,15 @@ declare class HubPermissionsClient {
|
|
|
1321
2175
|
* connection. Manual per-action decisions are left intact. */
|
|
1322
2176
|
revertWrites(connectionId: string): Promise<HubRevertWritesResponse>;
|
|
1323
2177
|
}
|
|
2178
|
+
declare class HubApprovalsClient {
|
|
2179
|
+
private readonly request;
|
|
2180
|
+
constructor(request: HubRequest);
|
|
2181
|
+
list(): Promise<HubApprovalListResponse>;
|
|
2182
|
+
approve(approvalId: string): Promise<HubApprovalDecisionResponse>;
|
|
2183
|
+
deny(approvalId: string): Promise<HubApprovalDecisionResponse>;
|
|
2184
|
+
}
|
|
2185
|
+
//#endregion
|
|
2186
|
+
//#region src/tools.d.ts
|
|
1324
2187
|
interface HubToolSearchOptions {
|
|
1325
2188
|
provider?: string;
|
|
1326
2189
|
/** Max tools to return. The server defaults to a relevance-ranked shortlist
|
|
@@ -1344,7 +2207,7 @@ interface HubToolInvokeOptions {
|
|
|
1344
2207
|
}
|
|
1345
2208
|
declare class HubToolsClient {
|
|
1346
2209
|
private readonly request;
|
|
1347
|
-
constructor(request:
|
|
2210
|
+
constructor(request: HubRequest);
|
|
1348
2211
|
search(query: string, options?: HubToolSearchOptions): Promise<HubToolsSearchResponse>;
|
|
1349
2212
|
sources(): Promise<HubToolSourcesResponse>;
|
|
1350
2213
|
describe(path: string): Promise<HubToolsDescribeResponse>;
|
|
@@ -1356,28 +2219,71 @@ declare class HubToolsClient {
|
|
|
1356
2219
|
invoke<TResult = unknown>(path: string, raw: unknown, options?: HubToolInvokeOptions): Promise<HubExecResponse<TResult>>;
|
|
1357
2220
|
private buildExecInit;
|
|
1358
2221
|
}
|
|
2222
|
+
//#endregion
|
|
2223
|
+
//#region src/inbound-webhooks.d.ts
|
|
2224
|
+
/** Provider setup uses the existing authenticated Hub transport and vault. */
|
|
2225
|
+
interface HubInboundWebhookCreateOptions {
|
|
2226
|
+
/** Inkbox identity that owns all selected channels. */
|
|
2227
|
+
identityId?: string;
|
|
2228
|
+
mailboxId?: string;
|
|
2229
|
+
phoneNumberId?: string;
|
|
2230
|
+
imessage?: boolean;
|
|
2231
|
+
/** Linq: explicit owned lines; omitted does not mean every account line. */
|
|
2232
|
+
phoneNumbers?: string[];
|
|
2233
|
+
/** Linq WhatsApp: explicit opaque IDs from numbers.list, not E.164 phone strings. */
|
|
2234
|
+
phoneNumberIds?: string[];
|
|
2235
|
+
/** Contiguity Console secret, or an existing Inkbox identity signing key. */
|
|
2236
|
+
signingSecret?: string;
|
|
2237
|
+
}
|
|
2238
|
+
interface HubInboundWebhookCreateResponse {
|
|
2239
|
+
url: string;
|
|
2240
|
+
/** True only when the provider subscription was created by the server. */
|
|
2241
|
+
provisioned?: boolean;
|
|
2242
|
+
/** Self-configured legacy providers can return a newly minted secret once. */
|
|
2243
|
+
secret?: string;
|
|
2244
|
+
inboundAddress?: string;
|
|
2245
|
+
requiresProviderSetup?: boolean;
|
|
2246
|
+
}
|
|
2247
|
+
interface HubInboundWebhookStatus {
|
|
2248
|
+
configured: boolean;
|
|
2249
|
+
url?: string;
|
|
2250
|
+
/** Configuration is not evidence of a real delivered message. */
|
|
2251
|
+
deliveryVerified: false;
|
|
2252
|
+
requiresProviderSetup?: boolean;
|
|
2253
|
+
}
|
|
2254
|
+
/** Live provider readback for one explicitly selected Linq WhatsApp number. */
|
|
2255
|
+
interface HubInboundPhoneNumberScope {
|
|
2256
|
+
configured: true;
|
|
2257
|
+
provisioned: true;
|
|
2258
|
+
subscribed: true;
|
|
2259
|
+
phoneNumberIds: string[];
|
|
2260
|
+
}
|
|
2261
|
+
declare class HubInboundWebhooksClient {
|
|
2262
|
+
private readonly request;
|
|
2263
|
+
constructor(request: <T>(path: string, init: RequestInit) => Promise<T>);
|
|
2264
|
+
create(connectionId: string, options?: HubInboundWebhookCreateOptions): Promise<HubInboundWebhookCreateResponse>;
|
|
2265
|
+
get(connectionId: string): Promise<HubInboundWebhookStatus>;
|
|
2266
|
+
/** Add one owned Linq WhatsApp number without rotating the webhook secret. */
|
|
2267
|
+
ensurePhoneNumber(connectionId: string, phoneNumberId: string): Promise<HubInboundPhoneNumberScope>;
|
|
2268
|
+
/** Remove event subscriptions first. This does not silently rotate a live URL. */
|
|
2269
|
+
delete(connectionId: string): Promise<{
|
|
2270
|
+
removed: boolean;
|
|
2271
|
+
}>;
|
|
2272
|
+
private path;
|
|
2273
|
+
}
|
|
2274
|
+
//#endregion
|
|
2275
|
+
//#region src/connections.d.ts
|
|
1359
2276
|
interface HubConnectionStartOptions {
|
|
1360
2277
|
returnUrl?: string;
|
|
1361
2278
|
cli?: boolean;
|
|
1362
2279
|
connectionParameters?: Record<string, string>;
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
private readonly request;
|
|
1366
|
-
constructor(request: <TData>(path: string, init: RequestInit) => Promise<TData>);
|
|
1367
|
-
list(): Promise<HubChannelsResponse>;
|
|
1368
|
-
createEmail(input?: HubEmailChannelCreateRequest): Promise<HubChannelCreateResponse>;
|
|
1369
|
-
delete(channelId: string): Promise<HubChannelDeleteResponse>;
|
|
1370
|
-
}
|
|
1371
|
-
declare class HubEventSubscriptionsClient {
|
|
1372
|
-
private readonly request;
|
|
1373
|
-
constructor(request: <TData>(path: string, init: RequestInit) => Promise<TData>);
|
|
1374
|
-
list(): Promise<HubEventSubscriptionsResponse>;
|
|
1375
|
-
create(input: HubEventSubscriptionCreateRequest): Promise<HubEventSubscriptionCreateResponse>;
|
|
1376
|
-
delete(subscriptionId: string): Promise<HubEventSubscriptionDeleteResponse>;
|
|
2280
|
+
/** GitHub accepts the exact read:user, repo, read:org set. */
|
|
2281
|
+
requestedScopes?: readonly string[];
|
|
1377
2282
|
}
|
|
1378
2283
|
declare class HubConnectionsClient {
|
|
1379
2284
|
private readonly request;
|
|
1380
|
-
|
|
2285
|
+
readonly inboundWebhook: HubInboundWebhooksClient;
|
|
2286
|
+
constructor(request: HubRequest);
|
|
1381
2287
|
list(): Promise<HubConnectionsResponse>;
|
|
1382
2288
|
/** Connector catalog: every provider the hub can expose, each flagged with
|
|
1383
2289
|
* `configured` (whether its OAuth app credentials are wired). Callers render
|
|
@@ -1389,21 +2295,33 @@ declare class HubConnectionsClient {
|
|
|
1389
2295
|
/** Connect a non-OAuth (api-key) connector by submitting the user's key.
|
|
1390
2296
|
* The server validates the key with a live probe before persisting and
|
|
1391
2297
|
* returns the created (or reconnected) connection — there is no redirect,
|
|
1392
|
-
* unlike `start`.
|
|
1393
|
-
|
|
2298
|
+
* unlike `start`. Cloudbeds requires propertyId metadata and PriceLabs
|
|
2299
|
+
* requires listing ID/PMS pairs; other providers have no metadata. */
|
|
2300
|
+
connectApiKey(provider: string, apiKey: string, metadata?: HubApiKeyConnectRequest["metadata"]): Promise<HubApiKeyConnectResponse>;
|
|
1394
2301
|
revoke(connectionId: string): Promise<HubConnectionDeleteResponse>;
|
|
1395
2302
|
health(connectionId: string): Promise<HubConnectionHealthResponse>;
|
|
1396
2303
|
}
|
|
1397
|
-
|
|
2304
|
+
//#endregion
|
|
2305
|
+
//#region src/channels.d.ts
|
|
2306
|
+
declare class HubChannelsClient {
|
|
1398
2307
|
private readonly request;
|
|
1399
|
-
constructor(request:
|
|
1400
|
-
list(): Promise<
|
|
1401
|
-
|
|
1402
|
-
|
|
2308
|
+
constructor(request: HubRequest);
|
|
2309
|
+
list(): Promise<HubChannelsResponse>;
|
|
2310
|
+
createEmail(input?: HubEmailChannelCreateRequest): Promise<HubChannelCreateResponse>;
|
|
2311
|
+
delete(channelId: string): Promise<HubChannelDeleteResponse>;
|
|
2312
|
+
}
|
|
2313
|
+
declare class HubEventSubscriptionsClient {
|
|
2314
|
+
private readonly request;
|
|
2315
|
+
constructor(request: HubRequest);
|
|
2316
|
+
list(): Promise<HubEventSubscriptionsResponse>;
|
|
2317
|
+
create(input: HubEventSubscriptionCreateRequest): Promise<HubEventSubscriptionCreateResponse>;
|
|
2318
|
+
delete(subscriptionId: string): Promise<HubEventSubscriptionDeleteResponse>;
|
|
1403
2319
|
}
|
|
2320
|
+
//#endregion
|
|
2321
|
+
//#region src/github-app.d.ts
|
|
1404
2322
|
declare class HubGithubAppClient {
|
|
1405
2323
|
private readonly request;
|
|
1406
|
-
constructor(request:
|
|
2324
|
+
constructor(request: HubRequest);
|
|
1407
2325
|
mintInstallationToken(input: HubGithubAppMintInstallationTokenRequest): Promise<HubGithubAppMintInstallationTokenResponse>;
|
|
1408
2326
|
/** Every installation the caller may act through — their own and any org's
|
|
1409
2327
|
* they were verified against. The management surface's read. */
|
|
@@ -1425,16 +2343,50 @@ declare class HubGithubAppClient {
|
|
|
1425
2343
|
repo: string;
|
|
1426
2344
|
}): Promise<HubGithubAppIsRepoInstalledResponse>;
|
|
1427
2345
|
}
|
|
2346
|
+
//#endregion
|
|
2347
|
+
//#region src/audit.d.ts
|
|
1428
2348
|
declare class HubAuditClient {
|
|
1429
2349
|
private readonly request;
|
|
1430
|
-
constructor(request:
|
|
2350
|
+
constructor(request: HubRequest);
|
|
1431
2351
|
list(options?: HubAuditListRequest): Promise<HubAuditResponse>;
|
|
1432
2352
|
}
|
|
1433
|
-
|
|
1434
|
-
|
|
2353
|
+
//#endregion
|
|
2354
|
+
//#region src/workflows-kv.d.ts
|
|
2355
|
+
/** The workflow's durable keyspace, shared by all its runs. */
|
|
2356
|
+
declare class WorkflowKvResource {
|
|
2357
|
+
protected readonly request: HubRequest;
|
|
2358
|
+
constructor(request: HubRequest);
|
|
2359
|
+
/**
|
|
2360
|
+
* The workflow's whole keyspace as metadata (key, version, updatedAt — never
|
|
2361
|
+
* values), key-ordered. Bounded by the server's per-workflow key cap.
|
|
2362
|
+
*/
|
|
2363
|
+
listKv(id: string): Promise<HubWorkflowKvListResponse>;
|
|
2364
|
+
/** One KV entry (value + version); `HubSdkError(NOT_FOUND)` when absent. */
|
|
2365
|
+
getKv(id: string, key: string): Promise<HubWorkflowKvEntry>;
|
|
2366
|
+
/**
|
|
2367
|
+
* Upsert a key; returns the entry with its NEW version (increments on every
|
|
2368
|
+
* write). Throws `HubSdkError(KV_VALUE_TOO_LARGE)` past the 64KiB value cap
|
|
2369
|
+
* or `KV_KEY_LIMIT` past the per-workflow key cap. `raw` is the caller's
|
|
2370
|
+
* value, stored and read back verbatim, so the client never gives it a shape.
|
|
2371
|
+
*/
|
|
2372
|
+
putKv(id: string, key: string, raw: unknown): Promise<HubWorkflowKvEntry>;
|
|
2373
|
+
/**
|
|
2374
|
+
* Compare-and-swap: the write lands only when the stored version still
|
|
2375
|
+
* equals `expectedVersion`; otherwise `HubSdkError(KV_VERSION_CONFLICT)`
|
|
2376
|
+
* (409) — re-read and retry. Creation is {@link putKv}'s job. `raw` is the
|
|
2377
|
+
* caller's value, stored and read back verbatim, so the client never gives it
|
|
2378
|
+
* a shape.
|
|
2379
|
+
*/
|
|
2380
|
+
casKv(id: string, key: string, expectedVersion: number, raw: unknown): Promise<HubWorkflowKvEntry>;
|
|
2381
|
+
/** Delete a key; idempotent — `deleted` reports whether a row was removed. */
|
|
2382
|
+
deleteKv(id: string, key: string): Promise<HubWorkflowKvDeleteResponse>;
|
|
2383
|
+
}
|
|
2384
|
+
//#endregion
|
|
2385
|
+
//#region src/workflows.d.ts
|
|
2386
|
+
declare class HubWorkflowsClient extends WorkflowKvResource {
|
|
1435
2387
|
private readonly stream?;
|
|
1436
2388
|
private readonly download?;
|
|
1437
|
-
constructor(request:
|
|
2389
|
+
constructor(request: HubRequest, stream?: HubStreamRequest | undefined, download?: HubArtifactRequest | undefined);
|
|
1438
2390
|
list(): Promise<HubWorkflow[]>;
|
|
1439
2391
|
/**
|
|
1440
2392
|
* Owner-wide fleet overview: one row per workflow with its run tallies over
|
|
@@ -1482,8 +2434,9 @@ declare class HubWorkflowsClient {
|
|
|
1482
2434
|
* `{ "pull_request.number": "123" }`. Omit it for a one-click run of a
|
|
1483
2435
|
* workflow that reads no trigger fields. Throws `HubSdkError`:
|
|
1484
2436
|
* `MISSING_RUN_INPUTS` when a required field is absent (`details.missing`
|
|
1485
|
-
* names them), `
|
|
1486
|
-
*
|
|
2437
|
+
* names them), `NOT_FOUND` for an unknown/foreign id. A paused workflow
|
|
2438
|
+
* still runs once; pausing only stops its triggers. Pass `opts.signal` to
|
|
2439
|
+
* abort a slow request.
|
|
1487
2440
|
*/
|
|
1488
2441
|
run(id: string, inputs?: HubWorkflowRunInputs, opts?: {
|
|
1489
2442
|
signal?: AbortSignal;
|
|
@@ -1518,8 +2471,8 @@ declare class HubWorkflowsClient {
|
|
|
1518
2471
|
* follow it with {@link getRun}/{@link watchRun}/{@link waitForRun} like any
|
|
1519
2472
|
* other run. Throws `HubSdkError`: `RUN_NOT_RETRYABLE` when the run is not
|
|
1520
2473
|
* terminal-failed/cancelled (queued/running/waiting, or succeeded),
|
|
1521
|
-
* `
|
|
1522
|
-
*
|
|
2474
|
+
* `NOT_FOUND` for an unknown/foreign run id; a workflow paused since the
|
|
2475
|
+
* failure still retries. Pass `opts.signal` to abort a slow request.
|
|
1523
2476
|
*/
|
|
1524
2477
|
retryRun(id: string, runId: string, opts?: {
|
|
1525
2478
|
signal?: AbortSignal;
|
|
@@ -1537,10 +2490,18 @@ declare class HubWorkflowsClient {
|
|
|
1537
2490
|
* poll) arrive — the persisted record, read via {@link getRun}, stays the
|
|
1538
2491
|
* source of truth. Pass `signal` to cancel; iterating to `run.done` (or
|
|
1539
2492
|
* breaking early) releases the connection.
|
|
2493
|
+
*
|
|
2494
|
+
* A stream that ends before `run.done` or `run.waiting` (the Platform is
|
|
2495
|
+
* restarting or handing over) is reopened after a second, as is one refused
|
|
2496
|
+
* with `SERVICE_DRAINING`; the reopened stream starts with a fresh
|
|
2497
|
+
* `snapshot`. After 30 reopens in a row that deliver nothing it throws
|
|
2498
|
+
* `HubSdkError(WORKFLOW_STREAM_INTERRUPTED)`.
|
|
1540
2499
|
*/
|
|
1541
2500
|
watchRun(id: string, runId: string, opts?: {
|
|
1542
2501
|
signal?: AbortSignal;
|
|
1543
2502
|
}): AsyncGenerator<HubWorkflowRunStreamEvent>;
|
|
2503
|
+
/** One connection's events, then how it ended. */
|
|
2504
|
+
private watchRunOnce;
|
|
1544
2505
|
/**
|
|
1545
2506
|
* Poll {@link getRun} until the run reaches a terminal state (`succeeded` or
|
|
1546
2507
|
* `failed`) and return its detail. The scripting primitive behind "run and
|
|
@@ -1662,30 +2623,6 @@ declare class HubWorkflowsClient {
|
|
|
1662
2623
|
* `downloadUrl` attached to an `$artifact` ref in a run detail points at.
|
|
1663
2624
|
*/
|
|
1664
2625
|
downloadArtifact(id: string, runId: string, artifactId: string): Promise<HubWorkflowArtifactDownload>;
|
|
1665
|
-
/**
|
|
1666
|
-
* The workflow's whole keyspace as metadata (key, version, updatedAt — never
|
|
1667
|
-
* values), key-ordered. Bounded by the server's per-workflow key cap.
|
|
1668
|
-
*/
|
|
1669
|
-
listKv(id: string): Promise<HubWorkflowKvListResponse>;
|
|
1670
|
-
/** One KV entry (value + version); `HubSdkError(NOT_FOUND)` when absent. */
|
|
1671
|
-
getKv(id: string, key: string): Promise<HubWorkflowKvEntry>;
|
|
1672
|
-
/**
|
|
1673
|
-
* Upsert a key; returns the entry with its NEW version (increments on every
|
|
1674
|
-
* write). Throws `HubSdkError(KV_VALUE_TOO_LARGE)` past the 64KiB value cap
|
|
1675
|
-
* or `KV_KEY_LIMIT` past the per-workflow key cap. `raw` is the caller's
|
|
1676
|
-
* value, stored and read back verbatim, so the client never gives it a shape.
|
|
1677
|
-
*/
|
|
1678
|
-
putKv(id: string, key: string, raw: unknown): Promise<HubWorkflowKvEntry>;
|
|
1679
|
-
/**
|
|
1680
|
-
* Compare-and-swap: the write lands only when the stored version still
|
|
1681
|
-
* equals `expectedVersion`; otherwise `HubSdkError(KV_VERSION_CONFLICT)`
|
|
1682
|
-
* (409) — re-read and retry. Creation is {@link putKv}'s job. `raw` is the
|
|
1683
|
-
* caller's value, stored and read back verbatim, so the client never gives it
|
|
1684
|
-
* a shape.
|
|
1685
|
-
*/
|
|
1686
|
-
casKv(id: string, key: string, expectedVersion: number, raw: unknown): Promise<HubWorkflowKvEntry>;
|
|
1687
|
-
/** Delete a key; idempotent — `deleted` reports whether a row was removed. */
|
|
1688
|
-
deleteKv(id: string, key: string): Promise<HubWorkflowKvDeleteResponse>;
|
|
1689
2626
|
/** The curated starter gallery runnable on THIS deployment: metadata,
|
|
1690
2627
|
* parameters, referenced providers, and a concrete `previewYaml` per card. */
|
|
1691
2628
|
listTemplates(): Promise<HubWorkflowTemplate[]>;
|
|
@@ -1739,6 +2676,48 @@ declare class HubWorkflowsClient {
|
|
|
1739
2676
|
schema(): Promise<HubWorkflowSchemaResponse>;
|
|
1740
2677
|
}
|
|
1741
2678
|
//#endregion
|
|
2679
|
+
//#region src/client.d.ts
|
|
2680
|
+
declare class HubClient extends HubTransport {
|
|
2681
|
+
readonly knowledge: HubKnowledgeClient;
|
|
2682
|
+
readonly allowances: HubAllowancesClient;
|
|
2683
|
+
readonly apps: HubAppsClient;
|
|
2684
|
+
readonly connections: HubConnectionsClient;
|
|
2685
|
+
readonly channels: HubChannelsClient;
|
|
2686
|
+
readonly numbers: HubManagedNumbersClient;
|
|
2687
|
+
readonly eventSubscriptions: HubEventSubscriptionsClient;
|
|
2688
|
+
readonly permissions: HubPermissionsClient;
|
|
2689
|
+
readonly tokens: HubTokensClient;
|
|
2690
|
+
readonly tools: HubToolsClient;
|
|
2691
|
+
readonly approvals: HubApprovalsClient;
|
|
2692
|
+
readonly audit: HubAuditClient;
|
|
2693
|
+
readonly githubApp: HubGithubAppClient;
|
|
2694
|
+
readonly workflows: HubWorkflowsClient;
|
|
2695
|
+
readonly lines: HubLinesClient;
|
|
2696
|
+
constructor(options: HubClientOptions);
|
|
2697
|
+
static fromEnv(options?: HubClientFromEnvOptions): HubClient;
|
|
2698
|
+
status(): Promise<HubStatusResponse>;
|
|
2699
|
+
/**
|
|
2700
|
+
* Open a streaming (Server-Sent Events) response and return its raw body.
|
|
2701
|
+
* Shares auth-header building + `fetch` with {@link request}, but does NOT
|
|
2702
|
+
* buffer or JSON-parse the body — the caller consumes the stream.
|
|
2703
|
+
*
|
|
2704
|
+
* A successful stream comes back as `text/event-stream`. Anything else is an
|
|
2705
|
+
* error envelope (404/429/401 JSON) or a transport failure (gateway/HTML
|
|
2706
|
+
* page); it is surfaced the same way {@link request} surfaces errors — a
|
|
2707
|
+
* typed `HubSdkError` from a `{success:false}` envelope, otherwise an
|
|
2708
|
+
* `HUB_HTTP_<status>` transport error — rather than handed back as bogus SSE.
|
|
2709
|
+
*/
|
|
2710
|
+
private stream;
|
|
2711
|
+
/**
|
|
2712
|
+
* Fetch raw (non-envelope) bytes — the artifact download route, whose 200 is
|
|
2713
|
+
* the artifact's own content type, not JSON. Error responses on such routes
|
|
2714
|
+
* are still the standard envelope, so a failure surfaces exactly like
|
|
2715
|
+
* {@link request}: a typed `HubSdkError` from a `{success:false}` body,
|
|
2716
|
+
* otherwise an `HUB_HTTP_<status>` transport error.
|
|
2717
|
+
*/
|
|
2718
|
+
private requestBytes;
|
|
2719
|
+
}
|
|
2720
|
+
//#endregion
|
|
1742
2721
|
//#region src/event-delivery.d.ts
|
|
1743
2722
|
type HubEventSignatureFailure = "missing" | "malformed" | "stale" | "mismatch";
|
|
1744
2723
|
type HubEventSignatureResult = {
|
|
@@ -1809,8 +2788,174 @@ declare function authenticateHubEventRequest(input: AuthenticateHubEventRequestI
|
|
|
1809
2788
|
declare function verifyHubEventSignature(input: VerifyHubEventSignatureInput): Promise<HubEventSignatureResult>;
|
|
1810
2789
|
declare function parseHubEventDelivery(input: string | unknown): HubEventDelivery;
|
|
1811
2790
|
//#endregion
|
|
2791
|
+
//#region src/knowledge-approval.d.ts
|
|
2792
|
+
/** Called only after the owner reviews this exact pending effect and clicks
|
|
2793
|
+
* Approve. Re-read first: a stale tab cannot approve a substituted operation. */
|
|
2794
|
+
declare function approveKnowledgeSource(input: {
|
|
2795
|
+
port: Pick<HubKnowledgeManagementClient, "get" | "refresh">;
|
|
2796
|
+
approvals: Pick<HubApprovalsClient, "approve">;
|
|
2797
|
+
source: KnowledgeSourceSummary;
|
|
2798
|
+
}): Promise<KnowledgeSourceSummary>;
|
|
2799
|
+
//#endregion
|
|
2800
|
+
//#region src/line-grants.d.ts
|
|
2801
|
+
type HubOwnerAskSendInput = Pick<HubLineOwnerSendInput, "text" | "image" | "reply" | "idempotencyKey">;
|
|
2802
|
+
interface HubLineGrantBinding {
|
|
2803
|
+
workspaceId: string;
|
|
2804
|
+
workspaceAgentId: string;
|
|
2805
|
+
}
|
|
2806
|
+
interface HubLineGrant {
|
|
2807
|
+
id: string;
|
|
2808
|
+
/** Canonical Hub identity that consented this grant; distinct from the app-local owner. */
|
|
2809
|
+
ownerUserId?: string;
|
|
2810
|
+
purpose?: "agent" | "owner_asks";
|
|
2811
|
+
lineId: string;
|
|
2812
|
+
connectionId: string;
|
|
2813
|
+
workspaceId: string;
|
|
2814
|
+
workspaceAgentId: string;
|
|
2815
|
+
agentProfileVersion: string;
|
|
2816
|
+
backendSha256: string;
|
|
2817
|
+
attachmentId: string | null;
|
|
2818
|
+
intakeMode: "guests" | "owner_only";
|
|
2819
|
+
/** "application" grants select the app's callback for the owner member instead of attaching. */
|
|
2820
|
+
execution: "backend" | "application" | "none";
|
|
2821
|
+
applicationOrigin: string | null;
|
|
2822
|
+
priorAttachmentId: string | null;
|
|
2823
|
+
priorAttachmentActive: boolean;
|
|
2824
|
+
monthlyBudgetUsd: number;
|
|
2825
|
+
monthlySpentUsd: number;
|
|
2826
|
+
}
|
|
2827
|
+
interface HubLineGrantLine {
|
|
2828
|
+
id: string;
|
|
2829
|
+
connectionId: string;
|
|
2830
|
+
transport: "sms" | "imessage" | "whatsapp";
|
|
2831
|
+
status: string;
|
|
2832
|
+
address: string | null;
|
|
2833
|
+
attachment: {
|
|
2834
|
+
id: string;
|
|
2835
|
+
sandboxId: string;
|
|
2836
|
+
status: string;
|
|
2837
|
+
} | null;
|
|
2838
|
+
}
|
|
2839
|
+
interface HubLineGrantAttachInput {
|
|
2840
|
+
workspaceAgentId: string;
|
|
2841
|
+
agentProfileVersion: string;
|
|
2842
|
+
renewalCode?: string;
|
|
2843
|
+
respond: {
|
|
2844
|
+
kind: "agent";
|
|
2845
|
+
backend: Record<string, unknown>;
|
|
2846
|
+
};
|
|
2847
|
+
}
|
|
2848
|
+
interface HubLineGrantAttachment {
|
|
2849
|
+
id: string;
|
|
2850
|
+
sandboxId: string;
|
|
2851
|
+
status: string;
|
|
2852
|
+
members?: Array<{
|
|
2853
|
+
id: string;
|
|
2854
|
+
role: string;
|
|
2855
|
+
}>;
|
|
2856
|
+
}
|
|
2857
|
+
interface HubLineGrantThread {
|
|
2858
|
+
id: string;
|
|
2859
|
+
lineId: string;
|
|
2860
|
+
attachmentId: string;
|
|
2861
|
+
}
|
|
2862
|
+
interface HubLineGrantMessage {
|
|
2863
|
+
id: string;
|
|
2864
|
+
threadId: string;
|
|
2865
|
+
direction: string;
|
|
2866
|
+
text: string | null;
|
|
2867
|
+
}
|
|
2868
|
+
/** The consented owner member on the owner's current attachment. */
|
|
2869
|
+
interface HubLineGrantMemberApplication {
|
|
2870
|
+
lineId: string;
|
|
2871
|
+
attachmentId: string;
|
|
2872
|
+
memberId: string;
|
|
2873
|
+
subjectId: string;
|
|
2874
|
+
/** Pass back unchanged as `expectedMemberRevision`. */
|
|
2875
|
+
memberRevision: string;
|
|
2876
|
+
/** False until the owner has texted the line and Hub recorded consent. */
|
|
2877
|
+
eligible: boolean;
|
|
2878
|
+
/** Hub-derived; every callback for this grant carries it. */
|
|
2879
|
+
binding: string;
|
|
2880
|
+
selection: {
|
|
2881
|
+
id: string; /** True when this grant's callback is the selected application. */
|
|
2882
|
+
own: boolean;
|
|
2883
|
+
/**
|
|
2884
|
+
* Hub's name for the app that answers the owner's texts, shown to the
|
|
2885
|
+
* owner in every app they consented on this line: a registered app's
|
|
2886
|
+
* name, or "Another app" when Hub has none. Absent before Platform named
|
|
2887
|
+
* selection holders.
|
|
2888
|
+
*/
|
|
2889
|
+
app?: {
|
|
2890
|
+
name: string;
|
|
2891
|
+
}; /** When the current app started answering. */
|
|
2892
|
+
selectedAt?: string; /** This app's own callback; never returned for another app. */
|
|
2893
|
+
url?: string;
|
|
2894
|
+
createdAt?: string;
|
|
2895
|
+
} | null;
|
|
2896
|
+
}
|
|
2897
|
+
interface HubLineGrantSelectApplicationInput {
|
|
2898
|
+
/** The current selection exactly as read. */
|
|
2899
|
+
expectedSelectionId: string | null;
|
|
2900
|
+
/**
|
|
2901
|
+
* Set only when the owner chose to move their texts here from the app shown
|
|
2902
|
+
* in `selection.app`: that selection's id, also passed as
|
|
2903
|
+
* `expectedSelectionId`. Without it Hub never replaces another app.
|
|
2904
|
+
*/
|
|
2905
|
+
replaceSelectionId?: string;
|
|
2906
|
+
expectedMemberRevision: string;
|
|
2907
|
+
/** HTTPS callback on the owner-approved application origin. */
|
|
2908
|
+
url: string;
|
|
2909
|
+
/** Bearer Hub sends to the callback; 32-512 printable ASCII characters. */
|
|
2910
|
+
secret: string;
|
|
2911
|
+
}
|
|
2912
|
+
interface HubLineGrantApplicationSelection {
|
|
2913
|
+
id: string;
|
|
2914
|
+
lineId: string;
|
|
2915
|
+
attachmentId: string;
|
|
2916
|
+
memberId: string;
|
|
2917
|
+
subjectId: string;
|
|
2918
|
+
status: string;
|
|
2919
|
+
application: {
|
|
2920
|
+
url: string;
|
|
2921
|
+
binding: string;
|
|
2922
|
+
};
|
|
2923
|
+
createdAt: string;
|
|
2924
|
+
revokedAt: string | null;
|
|
2925
|
+
}
|
|
2926
|
+
/** Every call uses HubTransport's authHeaders, so one-use app broker tokens can be minted per request. */
|
|
2927
|
+
declare class HubLineGrantsClient extends HubTransport {
|
|
2928
|
+
current(binding: HubLineGrantBinding): Promise<HubLineGrant>;
|
|
2929
|
+
line(binding: HubLineGrantBinding): Promise<HubLineGrantLine>;
|
|
2930
|
+
attach(binding: HubLineGrantBinding, input: HubLineGrantAttachInput): Promise<HubLineGrantAttachment>;
|
|
2931
|
+
detach(binding: HubLineGrantBinding): Promise<{
|
|
2932
|
+
detached: boolean;
|
|
2933
|
+
}>;
|
|
2934
|
+
threads(binding: HubLineGrantBinding): Promise<HubLineGrantThread[]>;
|
|
2935
|
+
messages(binding: HubLineGrantBinding, threadId: string): Promise<HubLineGrantMessage[]>;
|
|
2936
|
+
memberApplication(binding: HubLineGrantBinding): Promise<HubLineGrantMemberApplication>;
|
|
2937
|
+
/**
|
|
2938
|
+
* Route the owner's texts to this app's callback; the incumbent attachment
|
|
2939
|
+
* stays. `replaceSelectionId` moves them from another app on the owner's
|
|
2940
|
+
* explicit choice.
|
|
2941
|
+
*/
|
|
2942
|
+
selectApplication(binding: HubLineGrantBinding, input: HubLineGrantSelectApplicationInput): Promise<HubLineGrantApplicationSelection>;
|
|
2943
|
+
/** Return the owner's texts to the incumbent attachment. */
|
|
2944
|
+
clearApplication(binding: HubLineGrantBinding, input: {
|
|
2945
|
+
expectedSelectionId: string;
|
|
2946
|
+
expectedMemberRevision: string;
|
|
2947
|
+
}): Promise<void>;
|
|
2948
|
+
/** Ask only the verified owner member named by this owner_asks grant. */
|
|
2949
|
+
send(binding: HubLineGrantBinding, input: HubOwnerAskSendInput): Promise<HubLineSendReceipt>;
|
|
2950
|
+
/** Only a send created by this same grant is visible. */
|
|
2951
|
+
outbox(binding: HubLineGrantBinding, messageId: string): Promise<HubLineSendReceipt>;
|
|
2952
|
+
revoke(binding: HubLineGrantBinding, expectedGrantId?: string): Promise<{
|
|
2953
|
+
revoked: boolean;
|
|
2954
|
+
}>;
|
|
2955
|
+
}
|
|
2956
|
+
//#endregion
|
|
1812
2957
|
//#region src/redaction.d.ts
|
|
1813
2958
|
declare function redactHubValue(value: unknown): unknown;
|
|
1814
2959
|
//#endregion
|
|
1815
|
-
export { type AuthenticateHubEventRequestInput, type DeriveHubEventCallbackSecretInput, HUB_API_KEY_ENV_VAR, HUB_CAPABILITY_TOKEN_ENV_VAR, HUB_URL_ENV_VAR, type
|
|
2960
|
+
export { type AuthenticateHubEventRequestInput, type DeriveHubEventCallbackSecretInput, HUB_API_KEY_ENV_VAR, HUB_CAPABILITY_TOKEN_ENV_VAR, HUB_URL_ENV_VAR, HubAgentIterationSpan, HubAgentRunDetail, HubAllowWritesResponse, type HubAllowanceDecision, type HubAllowanceGrant, type HubAllowancePlan, type HubAllowancePlanInput, type HubAllowanceRole, type HubAllowanceSubject, type HubAllowanceSyncInput, type HubAllowanceSyncReceipt, type HubAllowanceTier, type HubAllowanceUsage, HubAllowancesClient, HubApiKeyConnectRequest, HubApiKeyConnectResponse, HubApiKeyConnectionMetadata, type HubApp, HubAppBrokerClient, type HubAppBrokerExchange, type HubAppBrokerOptions, type HubAppBrokerToken, type HubAppComplianceClaim, type HubAppComplianceState, type HubAppCreateInput, type HubAppGrant, type HubAppGrantRevoked, HubApproval, HubApprovalCapabilityToken, HubApprovalDecisionResponse, HubApprovalListResponse, HubApprovalStatus, HubApprovalsClient, HubAppsClient, HubAuditClient, HubAuditEvent, HubAuditListRequest, HubAuditResponse, type HubAuthHeaders, HubCapabilityToken, HubChannel, HubChannelCreateResponse, HubChannelDeleteResponse, HubChannelsClient, HubChannelsResponse, HubClient, type HubClientFromEnvOptions, type HubClientOptions, HubConnection, HubConnectionDeleteRequest, HubConnectionDeleteResponse, HubConnectionHealthError, HubConnectionHealthInfo, HubConnectionHealthRequest, HubConnectionHealthResponse, HubConnectionHealthStatus, type HubConnectionStartOptions, HubConnectionsClient, HubConnectionsResponse, HubEmailChannel, HubEmailChannelCreateRequest, type HubEnv, HubEnvelope, HubErrorBody, HubErrorCode, HubErrorEnvelope, HubEventCondition, HubEventConditionScalar, HubEventDelivery, HubEventDeliveryError, type HubEventRequestFailureCode, type HubEventRequestResult, type HubEventSignatureFailure, type HubEventSignatureResult, HubEventSubscription, HubEventSubscriptionCallback, HubEventSubscriptionCreateRequest, HubEventSubscriptionCreateResponse, HubEventSubscriptionDeleteResponse, HubEventSubscriptionFilter, HubEventSubscriptionSource, HubEventSubscriptionsClient, HubEventSubscriptionsResponse, HubExecRequest, HubExecResponse, HubGithubAppClient, HubGithubAppDisconnectResponse, HubGithubAppInstallation, HubGithubAppInstallationResponse, HubGithubAppIsRepoInstalledRequest, HubGithubAppIsRepoInstalledResponse, HubGithubAppListInstallationsResponse, HubGithubAppListReposResponse, HubGithubAppManagedInstallation, HubGithubAppMintInstallationTokenRequest, HubGithubAppMintInstallationTokenResponse, HubGithubAppSyncResponse, HubGithubAppSyncedInstallation, type HubInboundPhoneNumberScope, type HubInboundWebhookCreateOptions, type HubInboundWebhookCreateResponse, type HubInboundWebhookStatus, HubInboundWebhooksClient, HubKnowledgeClient, HubKnowledgeManagementClient, type HubKnowledgeQueryResult, type HubKnowledgeRetrievalResult, type HubLineApplicationDispatchCurrentInput, type HubLineCheckinOptions, type HubLineContext, type HubLineGrant, type HubLineGrantApplicationSelection, type HubLineGrantAttachInput, type HubLineGrantAttachment, type HubLineGrantBinding, type HubLineGrantLine, type HubLineGrantMemberApplication, type HubLineGrantMessage, type HubLineGrantSelectApplicationInput, type HubLineGrantThread, HubLineGrantsClient, type HubLineImage, type HubLineMember, type HubLineMemberApplication, type HubLineMemberApplicationInput, type HubLineOwnerSendInput, type HubLineProviderDelivery, type HubLineReminderInput, type HubLineReminderReceipt, type HubLineReplyCode, type HubLineReplyCodeInput, type HubLineScheduledSendOptions, type HubLineSendInput, type HubLineSendReceipt, HubLinesClient, HubManagedNumbersClient, HubManualRunInput, type HubNumberListQuery, type HubNumberOrder, type HubNumberOrderPage, type HubNumberQuote, type HubNumberReadiness, type HubNumberResolution, HubOAuthCallbackErrorQuery, HubOAuthCallbackQuery, HubOAuthCallbackResponse, HubOAuthCallbackSuccessQuery, HubOAuthConnectionParameter, HubOAuthStartRequest, HubOAuthStartResponse, type HubOwnerAskSendInput, HubPermissionsClient, HubPolicy, HubPolicyDecision, HubPolicyDeleteRequest, HubPolicyDeleteResponse, HubPolicyListRequest, HubPolicyListResponse, HubPolicyResponse, HubPolicyUpdateRequest, HubPrincipal, HubPrincipalKind, HubProvider, HubProviderAuthKind, HubProviderEvent, HubProvidersResponse, HubRevertWritesResponse, HubSdkError, HubStatusConnections, HubStatusResponse, HubSuccessEnvelope, type HubTokenListOptions, HubTokenMintRequest, HubTokenMintResponse, HubTokenRevokeResponse, HubTokensClient, HubTokensListResponse, HubTool, type HubToolInvokeOptions, HubToolRisk, type HubToolSearchOptions, HubToolSource, HubToolSourcesResponse, HubToolsClient, HubToolsDescribeRequest, HubToolsDescribeResponse, HubToolsSearchRequest, HubToolsSearchResponse, HubUnimplementedErrorEnvelope, HubWhatsappEmbeddedSignupCompleteRequest, HubWhatsappEmbeddedSignupCompleteResponse, HubWhatsappEmbeddedSignupStartRequest, HubWhatsappEmbeddedSignupStartResponse, HubWorkflow, HubWorkflowAction, HubWorkflowActionResult, HubWorkflowAgentStep, HubWorkflowArtifact, HubWorkflowArtifactDownload, HubWorkflowArtifactRef, HubWorkflowArtifactsResponse, type HubWorkflowCondition, type HubWorkflowConditionOp, type HubWorkflowConditionScalar, HubWorkflowConnectionRequirement, HubWorkflowDecision, HubWorkflowDecisionOnTimeout, HubWorkflowDecisionResolveResult, HubWorkflowDecisionResolvedVia, HubWorkflowDecisionStatus, HubWorkflowDistillationCandidate, HubWorkflowEdgeVerdicts, HubWorkflowEventFilter, HubWorkflowFailureCluster, HubWorkflowFleetEntry, HubWorkflowFleetInsights, HubWorkflowFleetWindow, type HubWorkflowGraphEdge, type HubWorkflowGraphJoinRule, type HubWorkflowGraphNode, type HubWorkflowGraphSpec, HubWorkflowHealth, HubWorkflowHookEndpoint, HubWorkflowHookToken, HubWorkflowKvDeleteResponse, HubWorkflowKvEntry, HubWorkflowKvEntryMeta, HubWorkflowKvListResponse, HubWorkflowNodeHealth, HubWorkflowOnErrorOutcome, HubWorkflowPendingDecision, HubWorkflowPendingDecisionsResponse, HubWorkflowProposal, HubWorkflowProposalInput, HubWorkflowRevision, HubWorkflowRevisionMeta, HubWorkflowRevisionSource, HubWorkflowRevisionStatus, HubWorkflowRun, HubWorkflowRunCancelResult, HubWorkflowRunDetail, HubWorkflowRunEnqueued, HubWorkflowRunInputs, HubWorkflowRunRetried, HubWorkflowRunStatus, HubWorkflowRunStepsPage, HubWorkflowRunStreamEvent, HubWorkflowRunSummary, HubWorkflowRunsPage, HubWorkflowSchemaResponse, HubWorkflowTemplate, HubWorkflowTemplateCategory, HubWorkflowTemplateInstantiateResult, HubWorkflowTemplateParameter, HubWorkflowTrigger, HubWorkflowValidateResponse, HubWorkflowValidationError, HubWorkflowsClient, KnowledgeAttachment, KnowledgeAttachmentAuthorization, KnowledgeAuthorization, KnowledgeCapabilities, KnowledgeCapability, KnowledgeEmbeddingSpace, KnowledgeReference, KnowledgeSourceCreate, KnowledgeSourceInput, KnowledgeSourceSummary, type VerifyHubEventSignatureInput, approveKnowledgeSource, authenticateHubEventRequest, deriveHubEventCallbackSecret, parseHubEventDelivery, redactHubValue, resolveHubAuth, resolveHubBaseUrl, verifyHubEventSignature, workflowConnectionRequirementKey };
|
|
1816
2961
|
//# sourceMappingURL=index.d.ts.map
|