@tangle-network/hub-sdk 0.31.0-develop.20260821231838.b8bef46 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +194 -8
- package/dist/index.d.ts +1676 -537
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1007 -464
- package/dist/index.js.map +1 -1
- package/package.json +13 -5
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
|
|
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 {
|
|
35
620
|
id: string;
|
|
36
621
|
providerId: string;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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;
|
|
42
662
|
createdAt: string;
|
|
43
663
|
updatedAt: string;
|
|
44
|
-
lastUsedAt: string | null;
|
|
45
664
|
}
|
|
46
|
-
interface
|
|
47
|
-
|
|
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;
|
|
48
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;
|
|
706
|
+
}
|
|
707
|
+
interface HubApprovalListResponse {
|
|
708
|
+
approvals: HubApproval[];
|
|
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,223 +967,49 @@ 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 {
|
|
289
985
|
connection: HubConnection;
|
|
290
|
-
reconnected: boolean;
|
|
291
|
-
}
|
|
292
|
-
interface HubConnectionDeleteRequest {
|
|
293
|
-
connectionId: string;
|
|
294
|
-
}
|
|
295
|
-
interface HubConnectionDeleteResponse {
|
|
296
|
-
connection: HubConnection;
|
|
297
|
-
}
|
|
298
|
-
interface HubConnectionHealthRequest {
|
|
299
|
-
connectionId: string;
|
|
300
|
-
}
|
|
301
|
-
type HubConnectionHealthStatus = "healthy" | "reconnect_required" | "unhealthy" | "rate_limited" | "unsupported";
|
|
302
|
-
interface HubConnectionHealthError {
|
|
303
|
-
code: string;
|
|
304
|
-
message: string;
|
|
305
|
-
}
|
|
306
|
-
interface HubConnectionHealthInfo {
|
|
307
|
-
status: HubConnectionHealthStatus;
|
|
308
|
-
checkedAt: string;
|
|
309
|
-
error?: HubConnectionHealthError;
|
|
310
|
-
}
|
|
311
|
-
interface HubConnectionHealthResponse {
|
|
312
|
-
connection: HubConnection;
|
|
313
|
-
health: HubConnectionHealthInfo;
|
|
314
|
-
}
|
|
315
|
-
interface HubToolSource {
|
|
316
|
-
sourceId: string;
|
|
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;
|
|
986
|
+
reconnected: boolean;
|
|
468
987
|
}
|
|
469
|
-
interface
|
|
470
|
-
|
|
471
|
-
capabilityToken?: HubApprovalCapabilityToken;
|
|
988
|
+
interface HubConnectionDeleteRequest {
|
|
989
|
+
connectionId: string;
|
|
472
990
|
}
|
|
473
|
-
interface
|
|
474
|
-
|
|
991
|
+
interface HubConnectionDeleteResponse {
|
|
992
|
+
connection: HubConnection;
|
|
475
993
|
}
|
|
476
|
-
interface
|
|
477
|
-
|
|
478
|
-
action: string;
|
|
479
|
-
targetUserId: string | null;
|
|
480
|
-
targetKeyId: string | null;
|
|
481
|
-
metadata: unknown;
|
|
482
|
-
createdAt: string;
|
|
994
|
+
interface HubConnectionHealthRequest {
|
|
995
|
+
connectionId: string;
|
|
483
996
|
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
since?: string;
|
|
489
|
-
until?: string;
|
|
490
|
-
cursor?: string;
|
|
491
|
-
limit?: number;
|
|
997
|
+
type HubConnectionHealthStatus = "healthy" | "reconnect_required" | "unhealthy" | "rate_limited" | "unsupported";
|
|
998
|
+
interface HubConnectionHealthError {
|
|
999
|
+
code: string;
|
|
1000
|
+
message: string;
|
|
492
1001
|
}
|
|
493
|
-
interface
|
|
494
|
-
|
|
495
|
-
|
|
1002
|
+
interface HubConnectionHealthInfo {
|
|
1003
|
+
status: HubConnectionHealthStatus;
|
|
1004
|
+
checkedAt: string;
|
|
1005
|
+
error?: HubConnectionHealthError;
|
|
496
1006
|
}
|
|
497
|
-
interface
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
};
|
|
1007
|
+
interface HubConnectionHealthResponse {
|
|
1008
|
+
connection: HubConnection;
|
|
1009
|
+
health: HubConnectionHealthInfo;
|
|
501
1010
|
}
|
|
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,8 +1091,10 @@ 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
1099
|
interface HubGithubAppIsRepoInstalledRequest {
|
|
587
1100
|
owner: string;
|
|
@@ -591,32 +1104,46 @@ interface HubGithubAppIsRepoInstalledResponse {
|
|
|
591
1104
|
installed: boolean;
|
|
592
1105
|
installationId: number | null;
|
|
593
1106
|
}
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
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 = {
|
|
1117
|
+
path: string;
|
|
1118
|
+
op: HubWorkflowConditionOp;
|
|
1119
|
+
value?: HubWorkflowConditionScalar | HubWorkflowConditionScalar[];
|
|
1120
|
+
} | {
|
|
1121
|
+
all: HubWorkflowCondition[];
|
|
1122
|
+
} | {
|
|
1123
|
+
any: HubWorkflowCondition[];
|
|
1124
|
+
} | {
|
|
1125
|
+
not: HubWorkflowCondition;
|
|
1126
|
+
};
|
|
1127
|
+
interface HubWorkflowGraphNode {
|
|
605
1128
|
id: string;
|
|
606
|
-
|
|
607
|
-
|
|
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;
|
|
1129
|
+
index: number;
|
|
1130
|
+
join?: HubWorkflowGraphJoinRule;
|
|
615
1131
|
}
|
|
616
|
-
interface
|
|
617
|
-
|
|
618
|
-
|
|
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 {
|
|
@@ -849,21 +1378,175 @@ interface HubWorkflowFleetEntry {
|
|
|
849
1378
|
id: string;
|
|
850
1379
|
name: string;
|
|
851
1380
|
enabled: boolean;
|
|
852
|
-
runsInWindow: number;
|
|
853
|
-
succeeded: number;
|
|
854
|
-
failed: number;
|
|
855
|
-
/** Runs parked on a human `decision` step (status `waiting`). */
|
|
856
|
-
waiting: number;
|
|
857
|
-
successRate: number | null;
|
|
858
|
-
lastRunStatus: HubWorkflowRunStatus | null;
|
|
859
|
-
lastRunAt: string | null;
|
|
1381
|
+
runsInWindow: number;
|
|
1382
|
+
succeeded: number;
|
|
1383
|
+
failed: number;
|
|
1384
|
+
/** Runs parked on a human `decision` step (status `waiting`). */
|
|
1385
|
+
waiting: number;
|
|
1386
|
+
successRate: number | null;
|
|
1387
|
+
lastRunStatus: HubWorkflowRunStatus | null;
|
|
1388
|
+
lastRunAt: string | null;
|
|
1389
|
+
}
|
|
1390
|
+
/** `GET /v1/workflows/insights/fleet` — the whole fleet, sorted failing-first. */
|
|
1391
|
+
interface HubWorkflowFleetInsights {
|
|
1392
|
+
window: HubWorkflowFleetWindow;
|
|
1393
|
+
/** ISO instant the window starts at (now minus the window length). */
|
|
1394
|
+
windowStart: string;
|
|
1395
|
+
workflows: HubWorkflowFleetEntry[];
|
|
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;
|
|
860
1544
|
}
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
/**
|
|
865
|
-
|
|
866
|
-
workflows: HubWorkflowFleetEntry[];
|
|
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;
|
|
867
1550
|
}
|
|
868
1551
|
interface HubWorkflow {
|
|
869
1552
|
id: string;
|
|
@@ -914,62 +1597,6 @@ type HubWorkflowValidateResponse = {
|
|
|
914
1597
|
};
|
|
915
1598
|
/** JSON Schema for the YAML workflow definition. */
|
|
916
1599
|
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>;
|
|
959
|
-
}
|
|
960
|
-
/** How an action's `onError` policy handled a failure so the run continued
|
|
961
|
-
* (the action itself still reads `failed`). */
|
|
962
|
-
interface HubWorkflowOnErrorOutcome {
|
|
963
|
-
policy: "continue" | "fallback";
|
|
964
|
-
/** The recovery leaf's result when the policy ran a `{ do }` fallback. */
|
|
965
|
-
fallback?: {
|
|
966
|
-
kind: string;
|
|
967
|
-
status: "succeeded" | "failed";
|
|
968
|
-
output?: unknown;
|
|
969
|
-
error?: string;
|
|
970
|
-
costUsd?: number;
|
|
971
|
-
};
|
|
972
|
-
}
|
|
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
|
-
|
|
1182
|
-
|
|
1750
|
+
interface HubWorkflowArtifactsResponse {
|
|
1751
|
+
artifacts: HubWorkflowArtifact[];
|
|
1752
|
+
}
|
|
1753
|
+
/** Raw artifact bytes from the download route, with their stored content type. */
|
|
1754
|
+
interface HubWorkflowArtifactDownload {
|
|
1755
|
+
bytes: Uint8Array;
|
|
1756
|
+
contentType: string;
|
|
1183
1757
|
}
|
|
1184
|
-
|
|
1185
|
-
|
|
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";
|
|
1186
1766
|
}
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
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
|
+
};
|
|
1194
1794
|
}
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1795
|
+
interface HubLineSendInput {
|
|
1796
|
+
toMember: string;
|
|
1797
|
+
text: string;
|
|
1798
|
+
notBefore?: string;
|
|
1799
|
+
onBehalfOf?: string;
|
|
1800
|
+
idempotencyKey?: string;
|
|
1200
1801
|
}
|
|
1201
|
-
|
|
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 {
|
|
1202
1806
|
url: string;
|
|
1203
|
-
token: string;
|
|
1204
1807
|
}
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
type HubWorkflowAgentStep = {
|
|
1208
|
-
kind: "reasoning";
|
|
1808
|
+
interface HubLineOwnerSendInput {
|
|
1809
|
+
memberId: string;
|
|
1209
1810
|
text: string;
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
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>;
|
|
1223
1974
|
}
|
|
1224
1975
|
//#endregion
|
|
1225
|
-
//#region src/
|
|
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. */
|
|
1995
|
+
token: string;
|
|
1996
|
+
}
|
|
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;
|
|
2096
|
+
}
|
|
2097
|
+
//#endregion
|
|
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>;
|
|
1403
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>;
|
|
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,20 @@ 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
|
}
|
|
2353
|
+
//#endregion
|
|
2354
|
+
//#region src/workflows.d.ts
|
|
1433
2355
|
declare class HubWorkflowsClient {
|
|
1434
2356
|
private readonly request;
|
|
1435
2357
|
private readonly stream?;
|
|
1436
2358
|
private readonly download?;
|
|
1437
|
-
constructor(request:
|
|
2359
|
+
constructor(request: HubRequest, stream?: HubStreamRequest | undefined, download?: HubArtifactRequest | undefined);
|
|
1438
2360
|
list(): Promise<HubWorkflow[]>;
|
|
1439
2361
|
/**
|
|
1440
2362
|
* Owner-wide fleet overview: one row per workflow with its run tallies over
|
|
@@ -1482,8 +2404,9 @@ declare class HubWorkflowsClient {
|
|
|
1482
2404
|
* `{ "pull_request.number": "123" }`. Omit it for a one-click run of a
|
|
1483
2405
|
* workflow that reads no trigger fields. Throws `HubSdkError`:
|
|
1484
2406
|
* `MISSING_RUN_INPUTS` when a required field is absent (`details.missing`
|
|
1485
|
-
* names them), `
|
|
1486
|
-
*
|
|
2407
|
+
* names them), `NOT_FOUND` for an unknown/foreign id. A paused workflow
|
|
2408
|
+
* still runs once; pausing only stops its triggers. Pass `opts.signal` to
|
|
2409
|
+
* abort a slow request.
|
|
1487
2410
|
*/
|
|
1488
2411
|
run(id: string, inputs?: HubWorkflowRunInputs, opts?: {
|
|
1489
2412
|
signal?: AbortSignal;
|
|
@@ -1518,8 +2441,8 @@ declare class HubWorkflowsClient {
|
|
|
1518
2441
|
* follow it with {@link getRun}/{@link watchRun}/{@link waitForRun} like any
|
|
1519
2442
|
* other run. Throws `HubSdkError`: `RUN_NOT_RETRYABLE` when the run is not
|
|
1520
2443
|
* terminal-failed/cancelled (queued/running/waiting, or succeeded),
|
|
1521
|
-
* `
|
|
1522
|
-
*
|
|
2444
|
+
* `NOT_FOUND` for an unknown/foreign run id; a workflow paused since the
|
|
2445
|
+
* failure still retries. Pass `opts.signal` to abort a slow request.
|
|
1523
2446
|
*/
|
|
1524
2447
|
retryRun(id: string, runId: string, opts?: {
|
|
1525
2448
|
signal?: AbortSignal;
|
|
@@ -1537,10 +2460,18 @@ declare class HubWorkflowsClient {
|
|
|
1537
2460
|
* poll) arrive — the persisted record, read via {@link getRun}, stays the
|
|
1538
2461
|
* source of truth. Pass `signal` to cancel; iterating to `run.done` (or
|
|
1539
2462
|
* breaking early) releases the connection.
|
|
2463
|
+
*
|
|
2464
|
+
* A stream that ends before `run.done` or `run.waiting` (the Platform is
|
|
2465
|
+
* restarting or handing over) is reopened after a second, as is one refused
|
|
2466
|
+
* with `SERVICE_DRAINING`; the reopened stream starts with a fresh
|
|
2467
|
+
* `snapshot`. After 30 reopens in a row that deliver nothing it throws
|
|
2468
|
+
* `HubSdkError(WORKFLOW_STREAM_INTERRUPTED)`.
|
|
1540
2469
|
*/
|
|
1541
2470
|
watchRun(id: string, runId: string, opts?: {
|
|
1542
2471
|
signal?: AbortSignal;
|
|
1543
2472
|
}): AsyncGenerator<HubWorkflowRunStreamEvent>;
|
|
2473
|
+
/** One connection's events, then how it ended. */
|
|
2474
|
+
private watchRunOnce;
|
|
1544
2475
|
/**
|
|
1545
2476
|
* Poll {@link getRun} until the run reaches a terminal state (`succeeded` or
|
|
1546
2477
|
* `failed`) and return its detail. The scripting primitive behind "run and
|
|
@@ -1739,6 +2670,48 @@ declare class HubWorkflowsClient {
|
|
|
1739
2670
|
schema(): Promise<HubWorkflowSchemaResponse>;
|
|
1740
2671
|
}
|
|
1741
2672
|
//#endregion
|
|
2673
|
+
//#region src/client.d.ts
|
|
2674
|
+
declare class HubClient extends HubTransport {
|
|
2675
|
+
readonly knowledge: HubKnowledgeClient;
|
|
2676
|
+
readonly allowances: HubAllowancesClient;
|
|
2677
|
+
readonly apps: HubAppsClient;
|
|
2678
|
+
readonly connections: HubConnectionsClient;
|
|
2679
|
+
readonly channels: HubChannelsClient;
|
|
2680
|
+
readonly numbers: HubManagedNumbersClient;
|
|
2681
|
+
readonly eventSubscriptions: HubEventSubscriptionsClient;
|
|
2682
|
+
readonly permissions: HubPermissionsClient;
|
|
2683
|
+
readonly tokens: HubTokensClient;
|
|
2684
|
+
readonly tools: HubToolsClient;
|
|
2685
|
+
readonly approvals: HubApprovalsClient;
|
|
2686
|
+
readonly audit: HubAuditClient;
|
|
2687
|
+
readonly githubApp: HubGithubAppClient;
|
|
2688
|
+
readonly workflows: HubWorkflowsClient;
|
|
2689
|
+
readonly lines: HubLinesClient;
|
|
2690
|
+
constructor(options: HubClientOptions);
|
|
2691
|
+
static fromEnv(options?: HubClientFromEnvOptions): HubClient;
|
|
2692
|
+
status(): Promise<HubStatusResponse>;
|
|
2693
|
+
/**
|
|
2694
|
+
* Open a streaming (Server-Sent Events) response and return its raw body.
|
|
2695
|
+
* Shares auth-header building + `fetch` with {@link request}, but does NOT
|
|
2696
|
+
* buffer or JSON-parse the body — the caller consumes the stream.
|
|
2697
|
+
*
|
|
2698
|
+
* A successful stream comes back as `text/event-stream`. Anything else is an
|
|
2699
|
+
* error envelope (404/429/401 JSON) or a transport failure (gateway/HTML
|
|
2700
|
+
* page); it is surfaced the same way {@link request} surfaces errors — a
|
|
2701
|
+
* typed `HubSdkError` from a `{success:false}` envelope, otherwise an
|
|
2702
|
+
* `HUB_HTTP_<status>` transport error — rather than handed back as bogus SSE.
|
|
2703
|
+
*/
|
|
2704
|
+
private stream;
|
|
2705
|
+
/**
|
|
2706
|
+
* Fetch raw (non-envelope) bytes — the artifact download route, whose 200 is
|
|
2707
|
+
* the artifact's own content type, not JSON. Error responses on such routes
|
|
2708
|
+
* are still the standard envelope, so a failure surfaces exactly like
|
|
2709
|
+
* {@link request}: a typed `HubSdkError` from a `{success:false}` body,
|
|
2710
|
+
* otherwise an `HUB_HTTP_<status>` transport error.
|
|
2711
|
+
*/
|
|
2712
|
+
private requestBytes;
|
|
2713
|
+
}
|
|
2714
|
+
//#endregion
|
|
1742
2715
|
//#region src/event-delivery.d.ts
|
|
1743
2716
|
type HubEventSignatureFailure = "missing" | "malformed" | "stale" | "mismatch";
|
|
1744
2717
|
type HubEventSignatureResult = {
|
|
@@ -1809,8 +2782,174 @@ declare function authenticateHubEventRequest(input: AuthenticateHubEventRequestI
|
|
|
1809
2782
|
declare function verifyHubEventSignature(input: VerifyHubEventSignatureInput): Promise<HubEventSignatureResult>;
|
|
1810
2783
|
declare function parseHubEventDelivery(input: string | unknown): HubEventDelivery;
|
|
1811
2784
|
//#endregion
|
|
2785
|
+
//#region src/knowledge-approval.d.ts
|
|
2786
|
+
/** Called only after the owner reviews this exact pending effect and clicks
|
|
2787
|
+
* Approve. Re-read first: a stale tab cannot approve a substituted operation. */
|
|
2788
|
+
declare function approveKnowledgeSource(input: {
|
|
2789
|
+
port: Pick<HubKnowledgeManagementClient, "get" | "refresh">;
|
|
2790
|
+
approvals: Pick<HubApprovalsClient, "approve">;
|
|
2791
|
+
source: KnowledgeSourceSummary;
|
|
2792
|
+
}): Promise<KnowledgeSourceSummary>;
|
|
2793
|
+
//#endregion
|
|
2794
|
+
//#region src/line-grants.d.ts
|
|
2795
|
+
type HubOwnerAskSendInput = Pick<HubLineOwnerSendInput, "text" | "image" | "reply" | "idempotencyKey">;
|
|
2796
|
+
interface HubLineGrantBinding {
|
|
2797
|
+
workspaceId: string;
|
|
2798
|
+
workspaceAgentId: string;
|
|
2799
|
+
}
|
|
2800
|
+
interface HubLineGrant {
|
|
2801
|
+
id: string;
|
|
2802
|
+
/** Canonical Hub identity that consented this grant; distinct from the app-local owner. */
|
|
2803
|
+
ownerUserId?: string;
|
|
2804
|
+
purpose?: "agent" | "owner_asks";
|
|
2805
|
+
lineId: string;
|
|
2806
|
+
connectionId: string;
|
|
2807
|
+
workspaceId: string;
|
|
2808
|
+
workspaceAgentId: string;
|
|
2809
|
+
agentProfileVersion: string;
|
|
2810
|
+
backendSha256: string;
|
|
2811
|
+
attachmentId: string | null;
|
|
2812
|
+
intakeMode: "guests" | "owner_only";
|
|
2813
|
+
/** "application" grants select the app's callback for the owner member instead of attaching. */
|
|
2814
|
+
execution: "backend" | "application" | "none";
|
|
2815
|
+
applicationOrigin: string | null;
|
|
2816
|
+
priorAttachmentId: string | null;
|
|
2817
|
+
priorAttachmentActive: boolean;
|
|
2818
|
+
monthlyBudgetUsd: number;
|
|
2819
|
+
monthlySpentUsd: number;
|
|
2820
|
+
}
|
|
2821
|
+
interface HubLineGrantLine {
|
|
2822
|
+
id: string;
|
|
2823
|
+
connectionId: string;
|
|
2824
|
+
transport: "sms" | "imessage" | "whatsapp";
|
|
2825
|
+
status: string;
|
|
2826
|
+
address: string | null;
|
|
2827
|
+
attachment: {
|
|
2828
|
+
id: string;
|
|
2829
|
+
sandboxId: string;
|
|
2830
|
+
status: string;
|
|
2831
|
+
} | null;
|
|
2832
|
+
}
|
|
2833
|
+
interface HubLineGrantAttachInput {
|
|
2834
|
+
workspaceAgentId: string;
|
|
2835
|
+
agentProfileVersion: string;
|
|
2836
|
+
renewalCode?: string;
|
|
2837
|
+
respond: {
|
|
2838
|
+
kind: "agent";
|
|
2839
|
+
backend: Record<string, unknown>;
|
|
2840
|
+
};
|
|
2841
|
+
}
|
|
2842
|
+
interface HubLineGrantAttachment {
|
|
2843
|
+
id: string;
|
|
2844
|
+
sandboxId: string;
|
|
2845
|
+
status: string;
|
|
2846
|
+
members?: Array<{
|
|
2847
|
+
id: string;
|
|
2848
|
+
role: string;
|
|
2849
|
+
}>;
|
|
2850
|
+
}
|
|
2851
|
+
interface HubLineGrantThread {
|
|
2852
|
+
id: string;
|
|
2853
|
+
lineId: string;
|
|
2854
|
+
attachmentId: string;
|
|
2855
|
+
}
|
|
2856
|
+
interface HubLineGrantMessage {
|
|
2857
|
+
id: string;
|
|
2858
|
+
threadId: string;
|
|
2859
|
+
direction: string;
|
|
2860
|
+
text: string | null;
|
|
2861
|
+
}
|
|
2862
|
+
/** The consented owner member on the owner's current attachment. */
|
|
2863
|
+
interface HubLineGrantMemberApplication {
|
|
2864
|
+
lineId: string;
|
|
2865
|
+
attachmentId: string;
|
|
2866
|
+
memberId: string;
|
|
2867
|
+
subjectId: string;
|
|
2868
|
+
/** Pass back unchanged as `expectedMemberRevision`. */
|
|
2869
|
+
memberRevision: string;
|
|
2870
|
+
/** False until the owner has texted the line and Hub recorded consent. */
|
|
2871
|
+
eligible: boolean;
|
|
2872
|
+
/** Hub-derived; every callback for this grant carries it. */
|
|
2873
|
+
binding: string;
|
|
2874
|
+
selection: {
|
|
2875
|
+
id: string; /** True when this grant's callback is the selected application. */
|
|
2876
|
+
own: boolean;
|
|
2877
|
+
/**
|
|
2878
|
+
* Hub's name for the app that answers the owner's texts, shown to the
|
|
2879
|
+
* owner in every app they consented on this line: a registered app's
|
|
2880
|
+
* name, or "Another app" when Hub has none. Absent before Platform named
|
|
2881
|
+
* selection holders.
|
|
2882
|
+
*/
|
|
2883
|
+
app?: {
|
|
2884
|
+
name: string;
|
|
2885
|
+
}; /** When the current app started answering. */
|
|
2886
|
+
selectedAt?: string; /** This app's own callback; never returned for another app. */
|
|
2887
|
+
url?: string;
|
|
2888
|
+
createdAt?: string;
|
|
2889
|
+
} | null;
|
|
2890
|
+
}
|
|
2891
|
+
interface HubLineGrantSelectApplicationInput {
|
|
2892
|
+
/** The current selection exactly as read. */
|
|
2893
|
+
expectedSelectionId: string | null;
|
|
2894
|
+
/**
|
|
2895
|
+
* Set only when the owner chose to move their texts here from the app shown
|
|
2896
|
+
* in `selection.app`: that selection's id, also passed as
|
|
2897
|
+
* `expectedSelectionId`. Without it Hub never replaces another app.
|
|
2898
|
+
*/
|
|
2899
|
+
replaceSelectionId?: string;
|
|
2900
|
+
expectedMemberRevision: string;
|
|
2901
|
+
/** HTTPS callback on the owner-approved application origin. */
|
|
2902
|
+
url: string;
|
|
2903
|
+
/** Bearer Hub sends to the callback; 32-512 printable ASCII characters. */
|
|
2904
|
+
secret: string;
|
|
2905
|
+
}
|
|
2906
|
+
interface HubLineGrantApplicationSelection {
|
|
2907
|
+
id: string;
|
|
2908
|
+
lineId: string;
|
|
2909
|
+
attachmentId: string;
|
|
2910
|
+
memberId: string;
|
|
2911
|
+
subjectId: string;
|
|
2912
|
+
status: string;
|
|
2913
|
+
application: {
|
|
2914
|
+
url: string;
|
|
2915
|
+
binding: string;
|
|
2916
|
+
};
|
|
2917
|
+
createdAt: string;
|
|
2918
|
+
revokedAt: string | null;
|
|
2919
|
+
}
|
|
2920
|
+
/** Every call uses HubTransport's authHeaders, so one-use app broker tokens can be minted per request. */
|
|
2921
|
+
declare class HubLineGrantsClient extends HubTransport {
|
|
2922
|
+
current(binding: HubLineGrantBinding): Promise<HubLineGrant>;
|
|
2923
|
+
line(binding: HubLineGrantBinding): Promise<HubLineGrantLine>;
|
|
2924
|
+
attach(binding: HubLineGrantBinding, input: HubLineGrantAttachInput): Promise<HubLineGrantAttachment>;
|
|
2925
|
+
detach(binding: HubLineGrantBinding): Promise<{
|
|
2926
|
+
detached: boolean;
|
|
2927
|
+
}>;
|
|
2928
|
+
threads(binding: HubLineGrantBinding): Promise<HubLineGrantThread[]>;
|
|
2929
|
+
messages(binding: HubLineGrantBinding, threadId: string): Promise<HubLineGrantMessage[]>;
|
|
2930
|
+
memberApplication(binding: HubLineGrantBinding): Promise<HubLineGrantMemberApplication>;
|
|
2931
|
+
/**
|
|
2932
|
+
* Route the owner's texts to this app's callback; the incumbent attachment
|
|
2933
|
+
* stays. `replaceSelectionId` moves them from another app on the owner's
|
|
2934
|
+
* explicit choice.
|
|
2935
|
+
*/
|
|
2936
|
+
selectApplication(binding: HubLineGrantBinding, input: HubLineGrantSelectApplicationInput): Promise<HubLineGrantApplicationSelection>;
|
|
2937
|
+
/** Return the owner's texts to the incumbent attachment. */
|
|
2938
|
+
clearApplication(binding: HubLineGrantBinding, input: {
|
|
2939
|
+
expectedSelectionId: string;
|
|
2940
|
+
expectedMemberRevision: string;
|
|
2941
|
+
}): Promise<void>;
|
|
2942
|
+
/** Ask only the verified owner member named by this owner_asks grant. */
|
|
2943
|
+
send(binding: HubLineGrantBinding, input: HubOwnerAskSendInput): Promise<HubLineSendReceipt>;
|
|
2944
|
+
/** Only a send created by this same grant is visible. */
|
|
2945
|
+
outbox(binding: HubLineGrantBinding, messageId: string): Promise<HubLineSendReceipt>;
|
|
2946
|
+
revoke(binding: HubLineGrantBinding, expectedGrantId?: string): Promise<{
|
|
2947
|
+
revoked: boolean;
|
|
2948
|
+
}>;
|
|
2949
|
+
}
|
|
2950
|
+
//#endregion
|
|
1812
2951
|
//#region src/redaction.d.ts
|
|
1813
2952
|
declare function redactHubValue(value: unknown): unknown;
|
|
1814
2953
|
//#endregion
|
|
1815
|
-
export { type AuthenticateHubEventRequestInput, type DeriveHubEventCallbackSecretInput, HUB_API_KEY_ENV_VAR, HUB_CAPABILITY_TOKEN_ENV_VAR, HUB_URL_ENV_VAR, type HubAgentIterationSpan, type HubAgentRunDetail, type HubApiKeyConnectRequest, type HubApiKeyConnectResponse, type HubApproval, type HubApprovalCapabilityToken, type HubApprovalDecisionResponse, type HubApprovalStatus, HubApprovalsClient, HubAuditClient, type HubAuditEvent, type HubAuditListRequest, type HubAuditResponse, type HubAuthHeaders, type HubCapabilityToken, type HubChannel, type HubChannelCreateResponse, type HubChannelDeleteResponse, HubChannelsClient, type HubChannelsResponse, HubClient, type HubClientFromEnvOptions, type HubClientOptions, type HubConnection, type HubConnectionDeleteRequest, type HubConnectionDeleteResponse, type HubConnectionHealthError, type HubConnectionHealthInfo, type HubConnectionHealthRequest, type HubConnectionHealthResponse, type HubConnectionHealthStatus, type HubConnectionStartOptions, HubConnectionsClient, type HubConnectionsResponse, type HubEmailChannel, type HubEmailChannelCreateRequest, type HubEnv, type HubEnvelope, type HubErrorBody, type HubErrorCode, type HubErrorEnvelope, type HubEventCondition, type HubEventConditionScalar, type HubEventDelivery, HubEventDeliveryError, type HubEventRequestFailureCode, type HubEventRequestResult, type HubEventSignatureFailure, type HubEventSignatureResult, type HubEventSubscription, type HubEventSubscriptionCallback, type HubEventSubscriptionCreateRequest, type HubEventSubscriptionCreateResponse, type HubEventSubscriptionDeleteResponse, type HubEventSubscriptionFilter, type HubEventSubscriptionSource, HubEventSubscriptionsClient, type HubEventSubscriptionsResponse, type HubExecRequest, type HubExecResponse, HubGithubAppClient, type HubGithubAppDisconnectResponse, type HubGithubAppInstallation, type HubGithubAppInstallationResponse, type HubGithubAppIsRepoInstalledRequest, type HubGithubAppIsRepoInstalledResponse, type HubGithubAppListInstallationsResponse, type HubGithubAppListReposResponse, type HubGithubAppManagedInstallation, type HubGithubAppMintInstallationTokenRequest, type HubGithubAppMintInstallationTokenResponse, type HubGithubAppSyncResponse, type HubGithubAppSyncedInstallation, type HubManualRunInput, type HubOAuthCallbackErrorQuery, type HubOAuthCallbackQuery, type HubOAuthCallbackResponse, type HubOAuthCallbackSuccessQuery, type HubOAuthConnectionParameter, type HubOAuthStartRequest, type HubOAuthStartResponse, HubPermissionsClient, type HubPolicy, type HubPolicyDecision, type HubPolicyDeleteRequest, type HubPolicyDeleteResponse, type HubPolicyListRequest, type HubPolicyListResponse, type HubPolicyResponse, type HubPolicyUpdateRequest, type HubPrincipal, type HubPrincipalKind, type HubProvider, type HubProviderAuthKind, type HubProviderEvent, type HubProvidersResponse, HubSdkError, type HubStatusConnections, type HubStatusResponse, type HubSuccessEnvelope, type HubTokenListOptions, type HubTokenMintRequest, type HubTokenMintResponse, type HubTokenRevokeResponse, HubTokensClient, type HubTokensListResponse, type HubTool, type HubToolInvokeOptions, type HubToolRisk, type HubToolSearchOptions, type HubToolSource, type HubToolSourcesResponse, HubToolsClient, type HubToolsDescribeRequest, type HubToolsDescribeResponse, type HubToolsSearchRequest, type HubToolsSearchResponse, type HubUnimplementedErrorEnvelope, type HubWhatsappEmbeddedSignupCompleteRequest, type HubWhatsappEmbeddedSignupCompleteResponse, type HubWhatsappEmbeddedSignupStartRequest, type HubWhatsappEmbeddedSignupStartResponse, type HubWorkflow, type HubWorkflowAction, type HubWorkflowActionResult, type HubWorkflowAgentStep, type HubWorkflowArtifact, type HubWorkflowArtifactDownload, type HubWorkflowArtifactRef, type HubWorkflowArtifactsResponse, type HubWorkflowCondition, type HubWorkflowConditionOp, type HubWorkflowConditionScalar, type HubWorkflowConnectionRequirement, type HubWorkflowDecision, type HubWorkflowDecisionOnTimeout, type HubWorkflowDecisionResolveResult, type HubWorkflowDecisionResolvedVia, type HubWorkflowDecisionStatus, type HubWorkflowDistillationCandidate, type HubWorkflowEdgeVerdicts, type HubWorkflowEventFilter, type HubWorkflowFailureCluster, type HubWorkflowFleetEntry, type HubWorkflowFleetInsights, type HubWorkflowFleetWindow, type HubWorkflowGraphEdge, type HubWorkflowGraphJoinRule, type HubWorkflowGraphNode, type HubWorkflowGraphSpec, type HubWorkflowHealth, type HubWorkflowHookEndpoint, type HubWorkflowHookToken, type HubWorkflowKvDeleteResponse, type HubWorkflowKvEntry, type HubWorkflowKvEntryMeta, type HubWorkflowKvListResponse, type HubWorkflowNodeHealth, type HubWorkflowOnErrorOutcome, type HubWorkflowPendingDecision, type HubWorkflowPendingDecisionsResponse, type HubWorkflowProposal, type HubWorkflowProposalInput, type HubWorkflowRevision, type HubWorkflowRevisionMeta, type HubWorkflowRevisionSource, type HubWorkflowRevisionStatus, type HubWorkflowRun, type HubWorkflowRunCancelResult, type HubWorkflowRunDetail, type HubWorkflowRunEnqueued, type HubWorkflowRunInputs, type HubWorkflowRunRetried, type HubWorkflowRunStatus, type HubWorkflowRunStepsPage, type HubWorkflowRunStreamEvent, type HubWorkflowRunSummary, type HubWorkflowRunsPage, type HubWorkflowSchemaResponse, type HubWorkflowTemplate, type HubWorkflowTemplateCategory, type HubWorkflowTemplateInstantiateResult, type HubWorkflowTemplateParameter, type HubWorkflowTrigger, type HubWorkflowValidateResponse, type HubWorkflowValidationError, HubWorkflowsClient, type VerifyHubEventSignatureInput, authenticateHubEventRequest, deriveHubEventCallbackSecret, parseHubEventDelivery, redactHubValue, resolveHubAuth, resolveHubBaseUrl, verifyHubEventSignature };
|
|
2954
|
+
export { type AuthenticateHubEventRequestInput, type DeriveHubEventCallbackSecretInput, HUB_API_KEY_ENV_VAR, HUB_CAPABILITY_TOKEN_ENV_VAR, HUB_URL_ENV_VAR, type HubAgentIterationSpan, type HubAgentRunDetail, type HubAllowanceDecision, type HubAllowanceGrant, type HubAllowancePlan, type HubAllowancePlanInput, type HubAllowanceRole, type HubAllowanceSubject, type HubAllowanceSyncInput, type HubAllowanceSyncReceipt, type HubAllowanceTier, type HubAllowanceUsage, HubAllowancesClient, type HubApiKeyConnectRequest, type HubApiKeyConnectResponse, type HubApiKeyConnectionMetadata, type HubApp, HubAppBrokerClient, type HubAppBrokerExchange, type HubAppBrokerOptions, type HubAppBrokerToken, type HubAppComplianceClaim, type HubAppComplianceState, type HubAppCreateInput, type HubAppGrant, type HubAppGrantRevoked, type HubApproval, type HubApprovalCapabilityToken, type HubApprovalDecisionResponse, type HubApprovalStatus, HubApprovalsClient, HubAppsClient, HubAuditClient, type HubAuditEvent, type HubAuditListRequest, type HubAuditResponse, type HubAuthHeaders, type HubCapabilityToken, type HubChannel, type HubChannelCreateResponse, type HubChannelDeleteResponse, HubChannelsClient, type HubChannelsResponse, HubClient, type HubClientFromEnvOptions, type HubClientOptions, type HubConnection, type HubConnectionDeleteRequest, type HubConnectionDeleteResponse, type HubConnectionHealthError, type HubConnectionHealthInfo, type HubConnectionHealthRequest, type HubConnectionHealthResponse, type HubConnectionHealthStatus, type HubConnectionStartOptions, HubConnectionsClient, type HubConnectionsResponse, type HubEmailChannel, type HubEmailChannelCreateRequest, type HubEnv, type HubEnvelope, type HubErrorBody, type HubErrorCode, type HubErrorEnvelope, type HubEventCondition, type HubEventConditionScalar, type HubEventDelivery, HubEventDeliveryError, type HubEventRequestFailureCode, type HubEventRequestResult, type HubEventSignatureFailure, type HubEventSignatureResult, type HubEventSubscription, type HubEventSubscriptionCallback, type HubEventSubscriptionCreateRequest, type HubEventSubscriptionCreateResponse, type HubEventSubscriptionDeleteResponse, type HubEventSubscriptionFilter, type HubEventSubscriptionSource, HubEventSubscriptionsClient, type HubEventSubscriptionsResponse, type HubExecRequest, type HubExecResponse, HubGithubAppClient, type HubGithubAppDisconnectResponse, type HubGithubAppInstallation, type HubGithubAppInstallationResponse, type HubGithubAppIsRepoInstalledRequest, type HubGithubAppIsRepoInstalledResponse, type HubGithubAppListInstallationsResponse, type HubGithubAppListReposResponse, type HubGithubAppManagedInstallation, type HubGithubAppMintInstallationTokenRequest, type HubGithubAppMintInstallationTokenResponse, type HubGithubAppSyncResponse, type 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, type HubManualRunInput, type HubNumberListQuery, type HubNumberOrder, type HubNumberOrderPage, type HubNumberQuote, type HubNumberReadiness, type HubNumberResolution, type HubOAuthCallbackErrorQuery, type HubOAuthCallbackQuery, type HubOAuthCallbackResponse, type HubOAuthCallbackSuccessQuery, type HubOAuthConnectionParameter, type HubOAuthStartRequest, type HubOAuthStartResponse, type HubOwnerAskSendInput, HubPermissionsClient, type HubPolicy, type HubPolicyDecision, type HubPolicyDeleteRequest, type HubPolicyDeleteResponse, type HubPolicyListRequest, type HubPolicyListResponse, type HubPolicyResponse, type HubPolicyUpdateRequest, type HubPrincipal, type HubPrincipalKind, type HubProvider, type HubProviderAuthKind, type HubProviderEvent, type HubProvidersResponse, HubSdkError, type HubStatusConnections, type HubStatusResponse, type HubSuccessEnvelope, type HubTokenListOptions, type HubTokenMintRequest, type HubTokenMintResponse, type HubTokenRevokeResponse, HubTokensClient, type HubTokensListResponse, type HubTool, type HubToolInvokeOptions, type HubToolRisk, type HubToolSearchOptions, type HubToolSource, type HubToolSourcesResponse, HubToolsClient, type HubToolsDescribeRequest, type HubToolsDescribeResponse, type HubToolsSearchRequest, type HubToolsSearchResponse, type HubUnimplementedErrorEnvelope, type HubWhatsappEmbeddedSignupCompleteRequest, type HubWhatsappEmbeddedSignupCompleteResponse, type HubWhatsappEmbeddedSignupStartRequest, type HubWhatsappEmbeddedSignupStartResponse, type HubWorkflow, type HubWorkflowAction, type HubWorkflowActionResult, type HubWorkflowAgentStep, type HubWorkflowArtifact, type HubWorkflowArtifactDownload, type HubWorkflowArtifactRef, type HubWorkflowArtifactsResponse, type HubWorkflowCondition, type HubWorkflowConditionOp, type HubWorkflowConditionScalar, type HubWorkflowConnectionRequirement, type HubWorkflowDecision, type HubWorkflowDecisionOnTimeout, type HubWorkflowDecisionResolveResult, type HubWorkflowDecisionResolvedVia, type HubWorkflowDecisionStatus, type HubWorkflowDistillationCandidate, type HubWorkflowEdgeVerdicts, type HubWorkflowEventFilter, type HubWorkflowFailureCluster, type HubWorkflowFleetEntry, type HubWorkflowFleetInsights, type HubWorkflowFleetWindow, type HubWorkflowGraphEdge, type HubWorkflowGraphJoinRule, type HubWorkflowGraphNode, type HubWorkflowGraphSpec, type HubWorkflowHealth, type HubWorkflowHookEndpoint, type HubWorkflowHookToken, type HubWorkflowKvDeleteResponse, type HubWorkflowKvEntry, type HubWorkflowKvEntryMeta, type HubWorkflowKvListResponse, type HubWorkflowNodeHealth, type HubWorkflowOnErrorOutcome, type HubWorkflowPendingDecision, type HubWorkflowPendingDecisionsResponse, type HubWorkflowProposal, type HubWorkflowProposalInput, type HubWorkflowRevision, type HubWorkflowRevisionMeta, type HubWorkflowRevisionSource, type HubWorkflowRevisionStatus, type HubWorkflowRun, type HubWorkflowRunCancelResult, type HubWorkflowRunDetail, type HubWorkflowRunEnqueued, type HubWorkflowRunInputs, type HubWorkflowRunRetried, type HubWorkflowRunStatus, type HubWorkflowRunStepsPage, type HubWorkflowRunStreamEvent, type HubWorkflowRunSummary, type HubWorkflowRunsPage, type HubWorkflowSchemaResponse, type HubWorkflowTemplate, type HubWorkflowTemplateCategory, type HubWorkflowTemplateInstantiateResult, type HubWorkflowTemplateParameter, type HubWorkflowTrigger, type HubWorkflowValidateResponse, type HubWorkflowValidationError, HubWorkflowsClient, KnowledgeAttachment, KnowledgeAttachmentAuthorization, KnowledgeAuthorization, KnowledgeCapabilities, KnowledgeCapability, KnowledgeEmbeddingSpace, KnowledgeReference, KnowledgeSourceCreate, KnowledgeSourceInput, KnowledgeSourceSummary, type VerifyHubEventSignatureInput, approveKnowledgeSource, authenticateHubEventRequest, deriveHubEventCallbackSecret, parseHubEventDelivery, redactHubValue, resolveHubAuth, resolveHubBaseUrl, verifyHubEventSignature, workflowConnectionRequirementKey };
|
|
1816
2955
|
//# sourceMappingURL=index.d.ts.map
|