aegis-platform-sdk 0.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
- type QueryParams = Record<string, string | number | boolean | undefined | null>;
1
+ type QueryParams = Record<string, string | number | boolean | ReadonlyArray<string | number> | undefined | null>;
2
2
  interface RequestOptions {
3
3
  params?: QueryParams;
4
4
  json?: unknown;
5
+ /** Multipart body (e.g. logo upload) — mutually exclusive with `json`. */
6
+ form?: FormData;
5
7
  signal?: AbortSignal;
6
8
  }
7
9
  /** The verb-agnostic transport contract every resource is built on. */
@@ -9,6 +11,30 @@ interface Transport {
9
11
  request<T = unknown>(method: string, path: string, opts?: RequestOptions): Promise<T>;
10
12
  }
11
13
 
14
+ /**
15
+ * Minimal SSE (text/event-stream) support — zero dependencies.
16
+ *
17
+ * AEGIS exposes server-sent-event endpoints for long-running work
18
+ * (operator task progress, AIP chat streaming). `AegisClient.stream()`
19
+ * yields parsed events as an async iterator:
20
+ *
21
+ * ```ts
22
+ * for await (const ev of client.stream("/operator/tasks/t1/events")) {
23
+ * if (ev.event === "progress") console.log(JSON.parse(ev.data));
24
+ * }
25
+ * ```
26
+ */
27
+ interface SseEvent {
28
+ /** Event name — defaults to "message" per the SSE spec. */
29
+ event: string;
30
+ /** Raw data payload (multi-line `data:` fields joined with `\n`). */
31
+ data: string;
32
+ id?: string;
33
+ retry?: number;
34
+ }
35
+ /** Parse a `text/event-stream` byte stream into events (spec-compliant subset). */
36
+ declare function parseSseStream(stream: ReadableStream<Uint8Array>): AsyncGenerator<SseEvent, void, undefined>;
37
+
12
38
  /**
13
39
  * Core wire types — mirrors `aegis/types.py` in the Python SDK.
14
40
  *
@@ -97,12 +123,18 @@ interface LoginOptions {
97
123
  /** Attach the issued JWT to the client for subsequent calls (default true). */
98
124
  attach?: boolean;
99
125
  }
100
- /** `client.auth.*` — login, whoami, dev-mode. */
126
+ /** `client.auth.*` — login, refresh, whoami, dev-mode. */
101
127
  declare class AuthResource {
102
128
  private readonly t;
103
- private readonly setToken;
104
- constructor(t: Transport, setToken: (token: string | null) => void);
129
+ private readonly attach;
130
+ constructor(t: Transport, attach: (pair: TokenPair) => void);
105
131
  login(username: string, password: string, opts?: LoginOptions): Promise<TokenPair>;
132
+ /** Rotate a refresh token explicitly (`POST /auth/refresh`). The client
133
+ * already does this transparently on 401 — call this only for manual
134
+ * flows. Attaches the new pair unless `attach: false`. */
135
+ refresh(refreshToken: string, opts?: {
136
+ attach?: boolean;
137
+ }): Promise<TokenPair>;
106
138
  me(): Promise<WhoAmI>;
107
139
  /** Activate a vendor dev-mode session; requires the `vendor` role. */
108
140
  enableDevMode(password: string): Promise<DevMode>;
@@ -123,21 +155,21 @@ declare class RolesResource {
123
155
  declare class GroupsResource {
124
156
  private readonly t;
125
157
  constructor(t: Transport);
126
- list(opts?: {
158
+ list<T = Json>(opts?: {
127
159
  limit?: number;
128
160
  offset?: number;
129
- }): Promise<Json[]>;
130
- get(groupId: string): Promise<Json>;
131
- create(name: string, description?: string): Promise<Json>;
132
- update(groupId: string, patch: {
161
+ }): Promise<T[]>;
162
+ get<T = Json>(groupId: string): Promise<T>;
163
+ create<T = Json>(name: string, description?: string): Promise<T>;
164
+ update<T = Json>(groupId: string, patch: {
133
165
  name?: string;
134
166
  description?: string;
135
- }): Promise<Json>;
167
+ }): Promise<T>;
136
168
  delete(groupId: string): Promise<void>;
137
- listMembers(groupId: string): Promise<Json[]>;
138
- addMember(groupId: string, userId: string): Promise<Json>;
169
+ listMembers<T = Json>(groupId: string): Promise<T[]>;
170
+ addMember<T = Json>(groupId: string, userId: string): Promise<T>;
139
171
  removeMember(groupId: string, userId: string): Promise<void>;
140
- listForUser(userId: string): Promise<Json[]>;
172
+ listForUser<T = Json>(userId: string): Promise<T[]>;
141
173
  }
142
174
  declare class PermissionsResource {
143
175
  private readonly t;
@@ -147,7 +179,7 @@ declare class PermissionsResource {
147
179
  declare class NavResource {
148
180
  private readonly t;
149
181
  constructor(t: Transport);
150
- tree(asRoleId?: string): Promise<Json>;
182
+ tree<T = Json>(asRoleId?: string): Promise<T>;
151
183
  }
152
184
  /** `client.iam.*` — users, roles, groups, permissions, nav tree. */
153
185
  declare class IamResource {
@@ -189,12 +221,12 @@ interface OperatorTaskCreate {
189
221
  declare class OperatorTasksResource {
190
222
  private readonly t;
191
223
  constructor(t: Transport);
192
- list(opts?: OperatorTaskListOptions): Promise<Json[]>;
193
- get(taskId: string): Promise<Json>;
194
- create(input: OperatorTaskCreate): Promise<Json>;
195
- cancel(taskId: string): Promise<Json>;
196
- retry(taskId: string): Promise<Json>;
197
- reprioritize(taskId: string, priority: string): Promise<Json>;
224
+ list<T = Json>(opts?: OperatorTaskListOptions): Promise<T[]>;
225
+ get<T = Json>(taskId: string): Promise<T>;
226
+ create<T = Json>(input: OperatorTaskCreate): Promise<T>;
227
+ cancel<T = Json>(taskId: string): Promise<T>;
228
+ retry<T = Json>(taskId: string): Promise<T>;
229
+ reprioritize<T = Json>(taskId: string, priority: string): Promise<T>;
198
230
  }
199
231
  /** `client.operator.*` — operator task queue (NL kanban). */
200
232
  declare class OperatorResource {
@@ -205,44 +237,44 @@ declare class OperatorResource {
205
237
  declare class ObjectsResource {
206
238
  private readonly t;
207
239
  constructor(t: Transport);
208
- get(objectId: string): Promise<Json>;
209
- list(kind: string, opts?: {
240
+ get<T = Json>(objectId: string): Promise<T>;
241
+ list<T = Json>(kind: string, opts?: {
210
242
  limit?: number;
211
243
  offset?: number;
212
244
  q?: string;
213
- }): Promise<Json[]>;
214
- create(kind: string, properties: Json, name?: string): Promise<Json>;
215
- createMany(kind: string, items: Json[], markings?: string[]): Promise<Json>;
216
- delete(objectId: string): Promise<Json>;
217
- bulkDelete(opts: {
245
+ }): Promise<T[]>;
246
+ create<T = Json>(kind: string, properties: Json, name?: string): Promise<T>;
247
+ createMany<T = Json>(kind: string, items: Json[], markings?: string[]): Promise<T>;
248
+ delete<T = Json>(objectId: string): Promise<T>;
249
+ bulkDelete<T = Json>(opts: {
218
250
  object_ids?: string[];
219
251
  kind?: string;
220
252
  dry_run?: boolean;
221
253
  confirm?: boolean;
222
254
  expected_count?: number;
223
- }): Promise<Json>;
224
- links(objectId: string): Promise<Json[]>;
225
- history(objectId: string): Promise<Json[]>;
226
- queryTimeseries(objectId: string, propertyName: string, opts?: {
255
+ }): Promise<T>;
256
+ links<T = Json>(objectId: string): Promise<T[]>;
257
+ history<T = Json>(objectId: string): Promise<T[]>;
258
+ queryTimeseries<T = Json>(objectId: string, propertyName: string, opts?: {
227
259
  from_time?: string;
228
260
  to_time?: string;
229
261
  max_points?: number;
230
- }): Promise<Json>;
231
- appendTimeseries(objectId: string, propertyName: string, points: Json[]): Promise<Json>;
262
+ }): Promise<T>;
263
+ appendTimeseries<T = Json>(objectId: string, propertyName: string, points: Json[]): Promise<T>;
232
264
  }
233
265
  declare class GraphResource {
234
266
  private readonly t;
235
267
  constructor(t: Transport);
236
- expand(seedId: string, opts?: {
268
+ expand<T = Json>(seedId: string, opts?: {
237
269
  depth?: number;
238
270
  limit?: number;
239
- }): Promise<Json>;
271
+ }): Promise<T>;
240
272
  }
241
273
  declare class ExplorerResource {
242
274
  private readonly t;
243
275
  constructor(t: Transport);
244
- histogram(property: string, filters?: Json): Promise<Json[]>;
245
- timeline(filters?: Json, bin?: string): Promise<Json[]>;
276
+ histogram<T = Json>(property: string, filters?: Json): Promise<T[]>;
277
+ timeline<T = Json>(filters?: Json, bin?: string): Promise<T[]>;
246
278
  }
247
279
  interface ObjectTypeWrite {
248
280
  title_property: string;
@@ -254,22 +286,22 @@ interface ObjectTypeWrite {
254
286
  declare class ObjectTypesResource {
255
287
  private readonly t;
256
288
  constructor(t: Transport);
257
- get(kind: string): Promise<Json>;
258
- create(kind: string, input: ObjectTypeWrite): Promise<Json>;
259
- update(kind: string, input: ObjectTypeWrite): Promise<Json>;
260
- delete(kind: string): Promise<Json>;
289
+ get<T = Json>(kind: string): Promise<T>;
290
+ create<T = Json>(kind: string, input: ObjectTypeWrite): Promise<T>;
291
+ update<T = Json>(kind: string, input: ObjectTypeWrite): Promise<T>;
292
+ delete<T = Json>(kind: string): Promise<T>;
261
293
  }
262
294
  declare class LinkTypesResource {
263
295
  private readonly t;
264
296
  constructor(t: Transport);
265
- declare(input: {
297
+ declare<T = Json>(input: {
266
298
  source_kind: string;
267
299
  target_kind: string;
268
300
  relation: string;
269
301
  cardinality: string;
270
302
  inverse_label?: string;
271
- }): Promise<Json>;
272
- delete(edgeId: string): Promise<Json>;
303
+ }): Promise<T>;
304
+ delete<T = Json>(edgeId: string): Promise<T>;
273
305
  }
274
306
  /** `client.ontology.*` — objects, graph, explorer, object/link types, OSDK manifest. */
275
307
  declare class OntologyResource {
@@ -282,46 +314,46 @@ declare class OntologyResource {
282
314
  constructor(t: Transport);
283
315
  /** Shortcut — same as `objectTypes.get(kind)`. */
284
316
  objectType(kind: string): Promise<Json>;
285
- osdkManifest(): Promise<Json[]>;
286
- osdkFunctions(): Promise<Json[]>;
287
- osdkGenerate(lang?: string): Promise<Json>;
317
+ osdkManifest<T = Json>(): Promise<T[]>;
318
+ osdkFunctions<T = Json>(): Promise<T[]>;
319
+ osdkGenerate<T = Json>(lang?: string): Promise<T>;
288
320
  }
289
321
 
290
322
  declare class FlowsResource {
291
323
  private readonly t;
292
324
  constructor(t: Transport);
293
- list(): Promise<Json[]>;
294
- get(flowId: string): Promise<Json>;
295
- runs(flowId: string): Promise<Json[]>;
296
- patch(flowId: string, payload: Json): Promise<Json>;
297
- run(flowId: string, dryRun?: boolean): Promise<Json>;
325
+ list<T = Json>(): Promise<T[]>;
326
+ get<T = Json>(flowId: string): Promise<T>;
327
+ runs<T = Json>(flowId: string): Promise<T[]>;
328
+ patch<T = Json>(flowId: string, payload: Json): Promise<T>;
329
+ run<T = Json>(flowId: string, dryRun?: boolean): Promise<T>;
298
330
  }
299
331
  declare class AgentsResource {
300
332
  private readonly t;
301
333
  constructor(t: Transport);
302
- list(): Promise<Json[]>;
303
- get(agentId: string): Promise<Json>;
304
- patch(agentId: string, config: Json): Promise<Json>;
305
- manualRun(agentId: string): Promise<Json>;
306
- runs(agentId: string): Promise<Json[]>;
334
+ list<T = Json>(): Promise<T[]>;
335
+ get<T = Json>(agentId: string): Promise<T>;
336
+ patch<T = Json>(agentId: string, config: Json): Promise<T>;
337
+ manualRun<T = Json>(agentId: string): Promise<T>;
338
+ runs<T = Json>(agentId: string): Promise<T[]>;
307
339
  }
308
340
  declare class ModelsResource {
309
341
  private readonly t;
310
342
  constructor(t: Transport);
311
- catalog(provider?: string): Promise<Json[]>;
312
- defaults(): Promise<Json[]>;
313
- setDefault(input: {
343
+ catalog<T = Json>(provider?: string): Promise<T[]>;
344
+ defaults<T = Json>(): Promise<T[]>;
345
+ setDefault<T = Json>(input: {
314
346
  provider: string;
315
347
  model: string;
316
348
  purpose?: string;
317
349
  provider_id?: string;
318
- }): Promise<Json>;
350
+ }): Promise<T>;
319
351
  }
320
352
  declare class BudgetResource {
321
353
  private readonly t;
322
354
  constructor(t: Transport);
323
- get(): Promise<Json>;
324
- set(tokensPerMonth: number): Promise<Json>;
355
+ get<T = Json>(): Promise<T>;
356
+ set<T = Json>(tokensPerMonth: number): Promise<T>;
325
357
  }
326
358
  /** `client.aip.*` — flows, agents, model catalog/defaults, LLM budget. */
327
359
  declare class AipResource {
@@ -358,43 +390,43 @@ interface PullRequestCreate {
358
390
  declare class FunctionsResource {
359
391
  private readonly t;
360
392
  constructor(t: Transport);
361
- list(): Promise<Json[]>;
362
- get(slug: string): Promise<Json>;
363
- create(input: FunctionCreate): Promise<Json>;
364
- invoke(slug: string, inputs?: Json, opts?: {
393
+ list<T = Json>(): Promise<T[]>;
394
+ get<T = Json>(slug: string): Promise<T>;
395
+ create<T = Json>(input: FunctionCreate): Promise<T>;
396
+ invoke<T = Json>(slug: string, inputs?: Json, opts?: {
365
397
  branch?: string;
366
398
  draft?: boolean;
367
- }): Promise<Json>;
368
- tests(slug: string): Promise<Json[]>;
369
- addTest(slug: string, name: string, inputs?: Json, expectedContains?: string): Promise<Json>;
370
- runTest(slug: string, testId: string): Promise<Json>;
371
- runTests(slug: string): Promise<Json>;
372
- publish(slug: string, branch?: string): Promise<Json>;
373
- versions(slug: string): Promise<Json[]>;
374
- pullRequests(slug: string, status?: string): Promise<Json[]>;
375
- openPullRequest(slug: string, input: PullRequestCreate): Promise<Json>;
376
- updatePullRequest(slug: string, prId: string, patch: Json): Promise<Json>;
377
- runPrCi(slug: string, prId: string): Promise<Json>;
378
- reviewPullRequest(slug: string, prId: string, decision: string, comment?: string): Promise<Json>;
379
- mergePullRequest(slug: string, prId: string): Promise<Json>;
399
+ }): Promise<T>;
400
+ tests<T = Json>(slug: string): Promise<T[]>;
401
+ addTest<T = Json>(slug: string, name: string, inputs?: Json, expectedContains?: string): Promise<T>;
402
+ runTest<T = Json>(slug: string, testId: string): Promise<T>;
403
+ runTests<T = Json>(slug: string): Promise<T>;
404
+ publish<T = Json>(slug: string, branch?: string): Promise<T>;
405
+ versions<T = Json>(slug: string): Promise<T[]>;
406
+ pullRequests<T = Json>(slug: string, status?: string): Promise<T[]>;
407
+ openPullRequest<T = Json>(slug: string, input: PullRequestCreate): Promise<T>;
408
+ updatePullRequest<T = Json>(slug: string, prId: string, patch: Json): Promise<T>;
409
+ runPrCi<T = Json>(slug: string, prId: string): Promise<T>;
410
+ reviewPullRequest<T = Json>(slug: string, prId: string, decision: string, comment?: string): Promise<T>;
411
+ mergePullRequest<T = Json>(slug: string, prId: string): Promise<T>;
380
412
  }
381
413
  /** `client.codeRepositories.*` — repos/branches around Code Functions. */
382
414
  declare class CodeRepositoriesResource {
383
415
  private readonly t;
384
416
  constructor(t: Transport);
385
- list(): Promise<Json[]>;
386
- create(input: {
417
+ list<T = Json>(): Promise<T[]>;
418
+ create<T = Json>(input: {
387
419
  slug: string;
388
420
  display_name: string;
389
421
  description?: string;
390
422
  default_branch?: string;
391
- }): Promise<Json>;
392
- branches(repoId: string): Promise<Json[]>;
393
- createBranch(repoId: string, name: string, description?: string): Promise<Json>;
394
- functions(repoId: string): Promise<Json[]>;
395
- assignFunction(repoId: string, slug: string): Promise<Json>;
396
- runCi(repoId: string): Promise<Json>;
397
- mergeBranch(repoId: string, sourceBranch: string, into?: string): Promise<Json>;
423
+ }): Promise<T>;
424
+ branches<T = Json>(repoId: string): Promise<T[]>;
425
+ createBranch<T = Json>(repoId: string, name: string, description?: string): Promise<T>;
426
+ functions<T = Json>(repoId: string): Promise<T[]>;
427
+ assignFunction<T = Json>(repoId: string, slug: string): Promise<T>;
428
+ runCi<T = Json>(repoId: string): Promise<T>;
429
+ mergeBranch<T = Json>(repoId: string, sourceBranch: string, into?: string): Promise<T>;
398
430
  }
399
431
 
400
432
  type TransactionKind = "SNAPSHOT" | "APPEND" | "UPDATE" | "DELETE";
@@ -402,34 +434,2001 @@ type TransactionKind = "SNAPSHOT" | "APPEND" | "UPDATE" | "DELETE";
402
434
  declare class DatasetsResource {
403
435
  private readonly t;
404
436
  constructor(t: Transport);
405
- list(): Promise<Json[]>;
406
- get(name: string): Promise<Json>;
407
- sample(name: string, limit?: number): Promise<Json>;
408
- listBranches(name: string): Promise<Json[]>;
409
- createBranch(name: string, branchName: string, opts?: {
437
+ list<T = Json>(): Promise<T[]>;
438
+ get<T = Json>(name: string): Promise<T>;
439
+ sample<T = Json>(name: string, limit?: number): Promise<T>;
440
+ listBranches<T = Json>(name: string): Promise<T[]>;
441
+ createBranch<T = Json>(name: string, branchName: string, opts?: {
410
442
  from_branch?: string;
411
443
  from_asset_id?: string;
412
444
  description?: string;
413
445
  project_id?: string;
414
- }): Promise<Json>;
415
- deactivateBranch(name: string, branchName: string): Promise<Json>;
416
- listTransactions(name: string, branch?: string): Promise<Json[]>;
417
- beginTransaction(name: string, kind: TransactionKind, branch?: string): Promise<Json>;
418
- commitTransaction(name: string, txId: string, inputPayload: Json): Promise<Json>;
419
- abortTransaction(name: string, txId: string, reason?: string): Promise<Json>;
420
- mergeFastForward(name: string, source: string, into: string): Promise<Json>;
446
+ }): Promise<T>;
447
+ deactivateBranch<T = Json>(name: string, branchName: string): Promise<T>;
448
+ listTransactions<T = Json>(name: string, branch?: string): Promise<T[]>;
449
+ beginTransaction<T = Json>(name: string, kind: TransactionKind, branch?: string): Promise<T>;
450
+ commitTransaction<T = Json>(name: string, txId: string, inputPayload: Json): Promise<T>;
451
+ abortTransaction<T = Json>(name: string, txId: string, reason?: string): Promise<T>;
452
+ mergeFastForward<T = Json>(name: string, source: string, into: string): Promise<T>;
421
453
  /** 409 responses carry the conflict body in `AegisAPIError.payload`. */
422
- mergeThreeWay(name: string, source: string, into: string, resolutions?: Json): Promise<Json>;
423
- getClassification(name: string): Promise<Json>;
424
- setClassification(name: string, patch: {
454
+ mergeThreeWay<T = Json>(name: string, source: string, into: string, resolutions?: Json): Promise<T>;
455
+ getClassification<T = Json>(name: string): Promise<T>;
456
+ setClassification<T = Json>(name: string, patch: {
425
457
  data_classification?: string;
426
458
  file_classification?: string;
427
- }): Promise<Json>;
428
- listMarkings(name: string): Promise<Json[]>;
429
- applyMarking(name: string, markingId: string): Promise<Json>;
459
+ }): Promise<T>;
460
+ listMarkings<T = Json>(name: string): Promise<T[]>;
461
+ applyMarking<T = Json>(name: string, markingId: string): Promise<T>;
430
462
  removeMarking(name: string, markingId: string): Promise<void>;
431
463
  }
432
464
 
465
+ /** `client.geo.*` — geospatial read layer over the ontology (/api/v1/geo). */
466
+ declare class GeoResource {
467
+ private readonly t;
468
+ constructor(t: Transport);
469
+ nodes<T = Json>(opts?: {
470
+ node_type?: string;
471
+ since_minutes?: number;
472
+ limit?: number;
473
+ bbox?: string;
474
+ }): Promise<T>;
475
+ nodeTypes<T = Json>(): Promise<T>;
476
+ sources<T = Json>(): Promise<T>;
477
+ edges<T = Json>(nodeIds: string[], relationTypes?: string[]): Promise<T>;
478
+ /** Catalog of keyless reference layers (IBGE limits, CNES health, …). */
479
+ referenceLayers<T = Json>(): Promise<T>;
480
+ /** GeoJSON of one reference layer (resilient keyless proxy). */
481
+ referenceLayer<T = Json>(layerId: string, opts?: {
482
+ uf?: string;
483
+ municipio?: string;
484
+ }): Promise<T>;
485
+ zones<T = Json>(): Promise<T>;
486
+ importZones<T = Json>(features: Json[], opts?: {
487
+ default_zone_type?: string;
488
+ extruded_height?: number;
489
+ source_name?: string;
490
+ }): Promise<T>;
491
+ deleteZone(zoneId: string): Promise<void>;
492
+ /** Builder layers of the tenant, grouped by "map" (the project). */
493
+ layers<T = Json>(): Promise<T>;
494
+ /** Creates a layer (empty inline dataset + published board). The
495
+ * `node_type` derives from the name and is IMMUTABLE. */
496
+ createLayer<T = Json>(input: {
497
+ nome: string;
498
+ mapa?: string;
499
+ descricao?: string;
500
+ }): Promise<T>;
501
+ layerFeatures<T = Json>(boardId: string): Promise<T>;
502
+ /** Saves the drawing as a versioned SNAPSHOT. `geometry` is GeoJSON
503
+ * `[lng,lat]`; `geo_style` travels PER FEATURE (colour/alpha/extrusion). */
504
+ saveLayerFeatures<T = Json>(boardId: string, rows: Json[]): Promise<T>;
505
+ /** Runs the board and RECONCILES — a feature deleted in the builder leaves
506
+ * the map (the engine is upsert-only). */
507
+ publishLayer<T = Json>(boardId: string): Promise<T>;
508
+ /** Renames / regroups. Never changes the `node_type`; `mapa: ""` ungroups. */
509
+ patchLayer<T = Json>(boardId: string, changes: {
510
+ nome?: string;
511
+ mapa?: string;
512
+ descricao?: string;
513
+ }): Promise<T>;
514
+ /** Deletes the whole layer: materialized nodes + dataset + board. */
515
+ deleteLayer<T = Json>(boardId: string): Promise<T>;
516
+ }
517
+ /** `client.mapTemplates.*` — reusable map specs (v22).
518
+ * (The Python SDK's stdout `Map` builder is sandbox-IDE-only and is not ported.) */
519
+ declare class MapTemplatesResource {
520
+ private readonly t;
521
+ constructor(t: Transport);
522
+ list(): Promise<Json[]>;
523
+ get<T = Json>(templateId: string): Promise<T>;
524
+ create<T = Json>(name: string, spec: Json, description?: string): Promise<T>;
525
+ instantiate<T = Json>(templateId: string, variables?: Json): Promise<T>;
526
+ /** Returns the raw SVG markup (non-JSON body). */
527
+ exportSvg(templateId: string): Promise<string>;
528
+ }
529
+ /** `client.media.*` — media sets + item metadata (bytes live in MinIO via `uri`). */
530
+ declare class MediaResource {
531
+ private readonly t;
532
+ constructor(t: Transport);
533
+ listSets<T = Json>(): Promise<T[]>;
534
+ createSet<T = Json>(input: {
535
+ slug: string;
536
+ display_name: string;
537
+ /** image | video | audio | document | mixed */
538
+ media_type: string;
539
+ bucket?: string;
540
+ markings?: string[];
541
+ project_id?: string;
542
+ }): Promise<T>;
543
+ deleteSet<T = Json>(setId: string): Promise<T>;
544
+ listItems<T = Json>(setId: string): Promise<T[]>;
545
+ /** Metadata only — no file bytes are uploaded (pass a pre-supplied `uri`). */
546
+ addItem<T = Json>(setId: string, input: {
547
+ filename: string;
548
+ content_type?: string;
549
+ size_bytes?: number;
550
+ uri?: string;
551
+ meta?: Json;
552
+ }): Promise<T>;
553
+ }
554
+ /** `client.docs.*` — platform documentation tree. */
555
+ declare class DocsResource {
556
+ private readonly t;
557
+ constructor(t: Transport);
558
+ tree<T = Json>(): Promise<T>;
559
+ read<T = Json>(path: string): Promise<T>;
560
+ }
561
+ /** `client.pages.*` — registered pages (v23 page registry). */
562
+ declare class PagesResource {
563
+ private readonly t;
564
+ constructor(t: Transport);
565
+ list<T = Json>(opts?: {
566
+ status?: string;
567
+ scope?: string;
568
+ perm?: string;
569
+ }): Promise<T[]>;
570
+ get<T = Json>(slug: string): Promise<T>;
571
+ getConfig<T = Json>(slug: string): Promise<T>;
572
+ create<T = Json>(input: {
573
+ slug: string;
574
+ title: string;
575
+ route: string;
576
+ status?: string;
577
+ workspace_bindings?: Json[];
578
+ marking_requirements?: string[];
579
+ iam_perm_required?: string;
580
+ config?: Json;
581
+ }): Promise<T>;
582
+ update<T = Json>(slug: string, patch: Json): Promise<T>;
583
+ /** Soft delete — page moves to status=archived. */
584
+ delete<T = Json>(slug: string): Promise<T>;
585
+ duplicate<T = Json>(slug: string): Promise<T>;
586
+ putConfig<T = Json>(slug: string, config: Json): Promise<T>;
587
+ publish<T = Json>(slug: string): Promise<T>;
588
+ }
589
+ /** `client.dossier.*` — async dossier generation (start → poll `get`). */
590
+ declare class DossierResource {
591
+ private readonly t;
592
+ constructor(t: Transport);
593
+ startGeneric<T = Json>(nodeId: string, purpose?: string): Promise<T>;
594
+ /** Requires `anchor_node_id` or `node_ids`. */
595
+ startComposite<T = Json>(input: {
596
+ anchor_node_id?: string;
597
+ node_ids?: string[];
598
+ purpose?: string;
599
+ correlate?: boolean;
600
+ scene?: boolean;
601
+ max_depth?: number;
602
+ budget_nodes?: number;
603
+ }): Promise<T>;
604
+ /** Poll until `status === "done"`; `result` is then populated. */
605
+ get<T = Json>(taskId: string): Promise<T>;
606
+ }
607
+ /** `client.timeseries.*` — chart definitions + render (v23). */
608
+ declare class TimeSeriesResource {
609
+ private readonly t;
610
+ constructor(t: Transport);
611
+ list<T = Json>(): Promise<T[]>;
612
+ create<T = Json>(input: {
613
+ slug: string;
614
+ display_name: string;
615
+ node_type: string;
616
+ /** e.g. `{ bucket: "day" | "hour" }` */
617
+ config?: Json;
618
+ markings?: string[];
619
+ }): Promise<T>;
620
+ delete<T = Json>(chartId: string): Promise<T>;
621
+ render<T = Json>(chartId: string): Promise<T>;
622
+ }
623
+
624
+ /**
625
+ * Body do `POST /public/v1/guest/{token}/fix` — uma leitura de GPS do visitante.
626
+ * O backend avalia cerca/rota/destino (evaluate_fix) e devolve
627
+ * inside_fence/arrived/deviated. Sem throttle e sem geofence-gate nesta rota.
628
+ */
629
+ interface GuestFix {
630
+ lat: number;
631
+ lng: number;
632
+ accuracy?: number;
633
+ /** ISO-8601; o backend usa "agora" se ausente. */
634
+ ts?: string;
635
+ /** Veredito de desvio do PRÓPRIO cliente (ex.: livetracker checando contra a
636
+ * rota desenhada por ruas). O backend RELAIA à portaria (paridade legado);
637
+ * ausente ⇒ o backend calcula pelo desvio da reta do token. */
638
+ off_route?: boolean;
639
+ }
640
+ /** Body do `POST /{token}/document/object-sets/query`. */
641
+ interface GuestObjectSetQuery {
642
+ object_type: string;
643
+ filter?: Json;
644
+ order_by?: Json;
645
+ /** 1..10000, default 200 no backend. */
646
+ limit?: number;
647
+ }
648
+ /**
649
+ * O transporte + a base URL. `mediaUrl()` precisa da base para montar um
650
+ * `<img src>`; o AegisClient satisfaz isto (implementa Transport e expõe
651
+ * `readonly baseUrl`).
652
+ */
653
+ interface PublicGuestTransport extends Transport {
654
+ readonly baseUrl: string;
655
+ }
656
+ /**
657
+ * `client.publicGuest.*` — o lado CONSUMIDOR do guest token público
658
+ * (`/public/v1/guest/{token}/*`). Sem cookie e sem Authorization: o token
659
+ * viaja no path; construa um client anônimo (`new AegisClient({ baseUrl })`).
660
+ *
661
+ * Erros mapeados pelo transporte: 404 (token inválido/expirado/revogado —
662
+ * "never leaks why"), 403 (geofence-gate/ação não permitida — invoke),
663
+ * 429 (throttle — invoke). Visita finalizada (chegou ao destino) → 410, que
664
+ * cai em `AegisAPIError` com `statusCode === 410`.
665
+ */
666
+ declare class PublicGuestResource {
667
+ private readonly t;
668
+ constructor(t: PublicGuestTransport);
669
+ private base;
670
+ /** Menu/resumo do token: label, subject, status, geo, ações permitidas. */
671
+ menu<T = Json>(token: string): Promise<T>;
672
+ /** Reporta uma posição GPS; o backend avalia cerca/rota/destino. */
673
+ fix<T = Json>(token: string, body: GuestFix): Promise<T>;
674
+ /** Invoca uma ação permitida do token (ex.: abrir portão). */
675
+ invoke<T = Json>(token: string, actionId: string, input?: Json): Promise<T>;
676
+ /**
677
+ * Onda 2 — última posição do VISITANTE amarrado a um token de MORADOR
678
+ * (`geo.live_ref`). Sem push: a SPA do morador faz polling desta rota. O
679
+ * morador só vê ESSA visita (least-privilege). Retorna `{available, lat,
680
+ * lng, ts, inside_fence, arrived, deviated, distance_to_target_m,
681
+ * visit_status}`; `available:false` enquanto o visitante não mandou fix.
682
+ */
683
+ position<T = Json>(token: string): Promise<T>;
684
+ /** Documento vinculado ao token (se `geo.document_id`). */
685
+ document<T = Json>(token: string): Promise<T>;
686
+ /** Consulta um object-set embutido no documento do token. */
687
+ queryObjectSet<T = Json>(token: string, body: GuestObjectSetQuery): Promise<T>;
688
+ /** Um nó da ontologia referenciado pelo documento (mascarado por ABAC). */
689
+ documentNode<T = Json>(token: string, nodeId: string): Promise<T>;
690
+ /** Descritor da Page vinculada ao token (`geo.page_slug`). */
691
+ page<T = Json>(token: string, slug: string): Promise<T>;
692
+ /** Avalia as variáveis da Page (com overrides só de variáveis estáticas). */
693
+ evaluatePage<T = Json>(token: string, slug: string, overrides?: Json): Promise<T>;
694
+ /**
695
+ * URL absoluta de um objeto de mídia do documento (bytes servidos com
696
+ * `Cache-Control: private`). Retorna string p/ `<img src>`/`<a href>` —
697
+ * NÃO faz request (o transporte é JSON-cêntrico). A `key` deve começar
698
+ * com `notepad/{doc_id}/` (validado no backend).
699
+ */
700
+ mediaUrl(token: string, key: string): string;
701
+ }
702
+
703
+ declare class AlertFeedsResource {
704
+ private readonly t;
705
+ constructor(t: Transport);
706
+ list<T = Json>(): Promise<T[]>;
707
+ create<T = Json>(name: string, filters: Json, cadenceSeconds?: number): Promise<T>;
708
+ delete(feedId: string): Promise<void>;
709
+ alerts<T = Json>(): Promise<T[]>;
710
+ acknowledge(alertId: string): Promise<void>;
711
+ }
712
+ declare class AlertWatchesResource {
713
+ private readonly t;
714
+ constructor(t: Transport);
715
+ list<T = Json>(): Promise<T[]>;
716
+ create<T = Json>(objectId: string): Promise<T>;
717
+ delete(watchId: string): Promise<void>;
718
+ alerts<T = Json>(): Promise<T[]>;
719
+ acknowledge(alertId: string): Promise<void>;
720
+ }
721
+ declare class AlertGeofencesResource {
722
+ private readonly t;
723
+ constructor(t: Transport);
724
+ list<T = Json>(): Promise<T[]>;
725
+ /** `coordinates` is shape-dependent: polygon `[[lon,lat],…]`, circle
726
+ * `{center, radius_meters}`, corridor/route `{waypoints, width_meters}`. */
727
+ create<T = Json>(input: {
728
+ name: string;
729
+ shape: string;
730
+ coordinates: unknown;
731
+ severity?: string;
732
+ baseline_silent?: boolean;
733
+ }): Promise<T>;
734
+ update<T = Json>(geofenceId: string, patch: Json): Promise<T>;
735
+ delete(geofenceId: string): Promise<void>;
736
+ alerts<T = Json>(): Promise<T[]>;
737
+ acknowledge(alertId: string): Promise<void>;
738
+ }
739
+ declare class AlertSharesResource {
740
+ private readonly t;
741
+ constructor(t: Transport);
742
+ list<T = Json>(): Promise<T[]>;
743
+ acknowledge(alertId: string): Promise<void>;
744
+ }
745
+ declare class AlertRoutesResource {
746
+ private readonly t;
747
+ constructor(t: Transport);
748
+ list<T = Json>(): Promise<T[]>;
749
+ create<T = Json>(input: {
750
+ name: string;
751
+ channel: string;
752
+ match?: Json;
753
+ channel_config_ref?: string;
754
+ escalation?: Json;
755
+ active?: boolean;
756
+ }): Promise<T>;
757
+ update<T = Json>(routeId: string, patch: Json): Promise<T>;
758
+ delete(routeId: string): Promise<void>;
759
+ silence<T = Json>(routeId: string, minutes: number): Promise<T>;
760
+ unsilence(routeId: string): Promise<Json>;
761
+ silenceState<T = Json>(routeId: string): Promise<T>;
762
+ kinds(): Promise<string[]>;
763
+ }
764
+ declare class AlertInboxResource {
765
+ private readonly t;
766
+ constructor(t: Transport);
767
+ list<T = Json>(opts?: {
768
+ kinds?: string[];
769
+ severities?: string[];
770
+ status?: string;
771
+ limit?: number;
772
+ offset?: number;
773
+ }): Promise<T[]>;
774
+ countPending(): Promise<number>;
775
+ acknowledge<T = Json>(alertId: string): Promise<T>;
776
+ }
777
+ /** `client.alerts.*` — feeds, watches, geofences, shares, routes, inbox. */
778
+ declare class AlertsResource {
779
+ private readonly t;
780
+ readonly feeds: AlertFeedsResource;
781
+ readonly watches: AlertWatchesResource;
782
+ readonly geofences: AlertGeofencesResource;
783
+ readonly shares: AlertSharesResource;
784
+ readonly routes: AlertRoutesResource;
785
+ readonly inbox: AlertInboxResource;
786
+ constructor(t: Transport);
787
+ escalate(alertId: string): Promise<void>;
788
+ channels<T = Json>(): Promise<T[]>;
789
+ /**
790
+ * `PUT /alerts/channels/{ref}` — point a delivery channel at its
791
+ * destination.
792
+ *
793
+ * Exists so this is a GESTURE: before it, sending alerts to the team's
794
+ * Discord (or any webhook) meant editing the tenant's JSONB in the
795
+ * database. Audited as `alert_channel.configured`.
796
+ *
797
+ * `ref` is the channel name (`"discord"`) or a named ref
798
+ * (`"discord-plantao"`, then pass `channel: "discord"`). Fields are open
799
+ * because the vocabulary belongs to the CHANNEL, not the core.
800
+ *
801
+ * The response returns the config MASKED — a webhook URL is the
802
+ * credential, and reads never hand it back whole.
803
+ * Perm: `alerts.routes.manage`.
804
+ */
805
+ setChannel<T = Json>(ref: string, config: AlertChannelConfigInput): Promise<T>;
806
+ /** `DELETE /alerts/channels/{ref}` — audited as `alert_channel.removed`. */
807
+ deleteChannel(ref: string): Promise<void>;
808
+ }
809
+ /** What `setChannel` accepts. Open-ended on purpose: the vocabulary is the
810
+ * channel's, not the core's. */
811
+ interface AlertChannelConfigInput {
812
+ /** Which channel a named ref belongs to (omit when ref === channel). */
813
+ channel?: string;
814
+ /** Webhook address. This IS the credential — reads return it masked. */
815
+ url?: string;
816
+ to?: string;
817
+ token?: string;
818
+ username?: string;
819
+ allowlist?: string[];
820
+ timeout?: number;
821
+ }
822
+ /** `client.alarms.*` — threshold alarm rules on node properties (v26). */
823
+ declare class AlarmsResource {
824
+ private readonly t;
825
+ constructor(t: Transport);
826
+ list<T = Json>(): Promise<T[]>;
827
+ /** `node_id` XOR `node_type`; operator ∈ gt|gte|lt|lte|eq|ne. */
828
+ create<T = Json>(input: {
829
+ name: string;
830
+ property_name: string;
831
+ operator: string;
832
+ threshold: number;
833
+ node_id?: string;
834
+ node_type?: string;
835
+ action_type_name?: string;
836
+ action_payload?: Json;
837
+ cooldown_seconds?: number;
838
+ active?: boolean;
839
+ }): Promise<T>;
840
+ update<T = Json>(ruleId: string, patch: Json): Promise<T>;
841
+ delete(ruleId: string): Promise<void>;
842
+ events<T = Json>(opts?: {
843
+ rule_id?: string;
844
+ limit?: number;
845
+ }): Promise<T[]>;
846
+ }
847
+ /** `client.events.*` — detections pipeline status + dead-letter queue. */
848
+ declare class EventsResource {
849
+ private readonly t;
850
+ constructor(t: Transport);
851
+ pipelineStatus<T = Json>(): Promise<T>;
852
+ dlqList<T = Json>(limit?: number): Promise<T>;
853
+ /** Exactly one of `ids` / `all` is required. */
854
+ dlqRetry<T = Json>(opts: {
855
+ ids?: string[];
856
+ all?: boolean;
857
+ }): Promise<T>;
858
+ /** Exactly one of `ids` / `all` is required. */
859
+ dlqPurge<T = Json>(opts: {
860
+ ids?: string[];
861
+ all?: boolean;
862
+ }): Promise<T>;
863
+ }
864
+ /**
865
+ * Pairing state for a skill that declares the `pairing` capability (e.g. a
866
+ * WhatsApp station). `qr_data_url` is a ready-to-render `data:image/png;base64`.
867
+ */
868
+ interface PairingInfo {
869
+ state: "connected" | "awaiting_scan" | "disconnected" | "error";
870
+ qr_data_url: string | null;
871
+ code: string | null;
872
+ expires_at: string | null;
873
+ detail: string;
874
+ /** Additive (pool station): WHICH number is pairing — single-instance skills never set it. */
875
+ pairing_number?: string | null;
876
+ }
877
+ /**
878
+ * Result of an inventory gesture on a skill that declares the `inventory`
879
+ * capability. `detail` carries the driver's own sentence ("já existe número
880
+ * com este identificador") — it is the operator's diagnosis, so surface it
881
+ * instead of a generic failure.
882
+ */
883
+ interface InventoryResult {
884
+ ok: boolean;
885
+ detail: string;
886
+ item?: Record<string, unknown> | null;
887
+ }
888
+ /** A row of the connector skill catalog (`GET /governance/agents/skills`). */
889
+ interface SkillCatalogRow {
890
+ skill_key: string;
891
+ label: string;
892
+ description: string;
893
+ category: string;
894
+ source: string;
895
+ platforms: string[];
896
+ requires_secrets: string[];
897
+ param_schema: Json[];
898
+ /** Additive — declared capabilities of the skill, e.g. `["pairing"]`. */
899
+ capabilities?: string[];
900
+ }
901
+ /** `client.connectors.*` — HTTP connector agents under governance. */
902
+ declare class ConnectorsResource {
903
+ private readonly t;
904
+ constructor(t: Transport);
905
+ list<T = Json>(): Promise<T[]>;
906
+ patch<T = Json>(agentId: string, patch: Json): Promise<T>;
907
+ /** status ∈ inactive|active|running|degraded|failed */
908
+ setStatus(agentId: string, status: string): Promise<Json>;
909
+ bindings<T = Json>(agentId: string): Promise<T[]>;
910
+ /** Two calls: creates the worker agent, then binds the `connector.http` skill. */
911
+ register(input: {
912
+ slug: string;
913
+ display_name: string;
914
+ base_url: string;
915
+ node_type: string;
916
+ id_field: string;
917
+ path?: string;
918
+ name_field?: string;
919
+ records_path?: string;
920
+ auth?: Json;
921
+ pagination?: Json;
922
+ cron_preset?: string;
923
+ }): Promise<Json>;
924
+ test<T = Json>(agentId: string): Promise<T>;
925
+ run<T = Json>(agentId: string): Promise<T>;
926
+ /**
927
+ * Start/renew QR pairing for a skill with the `pairing` capability (WhatsApp
928
+ * station). Pass `{ refresh: true }` to force a fresh code.
929
+ */
930
+ pairingStart<T = PairingInfo>(agentId: string, skillKey: string, opts?: {
931
+ refresh?: boolean;
932
+ target?: string;
933
+ }): Promise<T>;
934
+ /** Read-only poll of the pairing state (no side effects). `target` aims a pool number. */
935
+ pairingPoll<T = PairingInfo>(agentId: string, skillKey: string, opts?: {
936
+ target?: string;
937
+ }): Promise<T>;
938
+ /**
939
+ * Add / correct / remove a sub-unit administered by a connector that
940
+ * declares the `inventory` capability — e.g. one number of a WhatsApp
941
+ * number-station.
942
+ *
943
+ * Reading is NOT here: the inventory already reaches callers through the
944
+ * snapshot the tick publishes on the device mirror (`GET /api/v1/edge/nodes`
945
+ * → `nodes[].pool`). A second read path would drift between ticks.
946
+ */
947
+ applyInventory<T = InventoryResult>(agentId: string, skillKey: string, op: "add" | "update" | "remove", item: Record<string, unknown>): Promise<T>;
948
+ schedulerTick<T = Json>(): Promise<T>;
949
+ /** source ∈ native|clawhub. Rows carry an additive `capabilities` field. */
950
+ skillCatalog<T = SkillCatalogRow>(source?: string): Promise<T[]>;
951
+ installOpenclaw<T = Json>(slug: string): Promise<T>;
952
+ refreshOpenclaw<T = Json>(): Promise<T>;
953
+ }
954
+ /** `client.pipelines.*` — data pipelines (v22 CRUD + v23 preview/dry-run). */
955
+ declare class PipelinesResource {
956
+ private readonly t;
957
+ constructor(t: Transport);
958
+ list<T = Json>(): Promise<T[]>;
959
+ transformPreview<T = Json>(sampleRows: Json[], steps: Json[]): Promise<T>;
960
+ dryRun<T = Json>(boardId: string): Promise<T>;
961
+ syncPreview<T = Json>(format: string, opts?: {
962
+ sample?: string;
963
+ source_url?: string;
964
+ options?: Json;
965
+ headers?: Json;
966
+ }): Promise<T>;
967
+ create<T = Json>(input: {
968
+ slug: string;
969
+ display_name: string;
970
+ description?: string;
971
+ /** `{ source, steps[], output?: { target_node_type, id_field } }` */
972
+ spec?: Json;
973
+ }): Promise<T>;
974
+ update<T = Json>(pipelineId: string, patch: Json): Promise<T>;
975
+ setSchedule(pipelineId: string, preset: string): Promise<Json>;
976
+ build<T = Json>(pipelineId: string, opts?: {
977
+ incremental?: boolean;
978
+ branch?: string;
979
+ }): Promise<T>;
980
+ runs<T = Json>(pipelineId: string, limit?: number): Promise<T[]>;
981
+ }
982
+ declare class ChatChannelsResource {
983
+ private readonly t;
984
+ constructor(t: Transport);
985
+ list<T = Json>(): Promise<T[]>;
986
+ get<T = Json>(channelId: string): Promise<T>;
987
+ create<T = Json>(input: {
988
+ name: string;
989
+ visibility?: string;
990
+ min_classification?: string;
991
+ project_id?: string;
992
+ description?: string;
993
+ }): Promise<T>;
994
+ patch<T = Json>(channelId: string, payload: Json): Promise<T>;
995
+ delete(channelId: string): Promise<void>;
996
+ }
997
+ declare class ChatMessagesResource {
998
+ private readonly t;
999
+ constructor(t: Transport);
1000
+ list<T = Json>(channelId: string, opts?: {
1001
+ limit?: number;
1002
+ before?: string;
1003
+ }): Promise<T[]>;
1004
+ send<T = Json>(channelId: string, body: string, opts?: {
1005
+ classification?: string;
1006
+ embeds?: Json[];
1007
+ }): Promise<T>;
1008
+ }
1009
+ /** `client.chat.*` — operator chat channels + messages. */
1010
+ declare class ChatResource {
1011
+ readonly channels: ChatChannelsResource;
1012
+ readonly messages: ChatMessagesResource;
1013
+ constructor(t: Transport);
1014
+ }
1015
+ /** `client.notepad.*` — markdown docs (v23). */
1016
+ declare class NotepadResource {
1017
+ private readonly t;
1018
+ constructor(t: Transport);
1019
+ list<T = Json>(): Promise<T[]>;
1020
+ get<T = Json>(docId: string): Promise<T>;
1021
+ create<T = Json>(input: {
1022
+ slug: string;
1023
+ title: string;
1024
+ body_md?: string;
1025
+ markings?: string[];
1026
+ pinned?: boolean;
1027
+ project_id?: string;
1028
+ }): Promise<T>;
1029
+ /** Mirrors Python: all keys are sent (null = unchanged server-side). */
1030
+ update<T = Json>(docId: string, patch: {
1031
+ title?: string;
1032
+ body_md?: string;
1033
+ markings?: string[];
1034
+ pinned?: boolean;
1035
+ }): Promise<T>;
1036
+ delete<T = Json>(docId: string): Promise<T>;
1037
+ }
1038
+
1039
+ /** `client.lineage.*` — workflow lineage graph + event log. */
1040
+ declare class LineageResource {
1041
+ private readonly t;
1042
+ constructor(t: Transport);
1043
+ graph<T = Json>(opts?: {
1044
+ marking?: string;
1045
+ since?: string;
1046
+ kind?: string;
1047
+ limit_events?: number;
1048
+ }): Promise<T>;
1049
+ events<T = Json>(opts?: {
1050
+ limit?: number;
1051
+ offset?: number;
1052
+ event_type?: string;
1053
+ status?: string;
1054
+ }): Promise<T[]>;
1055
+ }
1056
+ /** `client.accessAudit.*` — governance access-audit trail. */
1057
+ declare class AccessAuditResource {
1058
+ private readonly t;
1059
+ constructor(t: Transport);
1060
+ list<T = Json>(opts?: {
1061
+ resource_type?: string;
1062
+ resource_id?: string;
1063
+ user_id?: string;
1064
+ since?: string;
1065
+ until?: string;
1066
+ limit?: number;
1067
+ }): Promise<T[]>;
1068
+ }
1069
+ declare class MarkingCategoriesResource {
1070
+ private readonly t;
1071
+ constructor(t: Transport);
1072
+ list<T = Json>(opts?: {
1073
+ limit?: number;
1074
+ offset?: number;
1075
+ }): Promise<T[]>;
1076
+ create<T = Json>(input: {
1077
+ slug: string;
1078
+ display_name: string;
1079
+ mode?: string;
1080
+ description?: string;
1081
+ }): Promise<T>;
1082
+ }
1083
+ /** `client.markings.*` — marking catalog + per-user eligibility. */
1084
+ declare class MarkingsResource {
1085
+ private readonly t;
1086
+ readonly categories: MarkingCategoriesResource;
1087
+ constructor(t: Transport);
1088
+ list<T = Json>(opts?: {
1089
+ limit?: number;
1090
+ offset?: number;
1091
+ category_id?: string;
1092
+ }): Promise<T[]>;
1093
+ get<T = Json>(markingId: string): Promise<T>;
1094
+ create<T = Json>(input: {
1095
+ slug: string;
1096
+ display_name: string;
1097
+ description?: string;
1098
+ category_id?: string;
1099
+ }): Promise<T>;
1100
+ update<T = Json>(markingId: string, patch: {
1101
+ display_name?: string;
1102
+ description?: string;
1103
+ category_id?: string;
1104
+ active?: boolean;
1105
+ }): Promise<T>;
1106
+ listEligibility<T = Json>(markingId: string): Promise<T[]>;
1107
+ grantEligibility<T = Json>(markingId: string, userId: string, canApply?: boolean): Promise<T>;
1108
+ revokeEligibility(markingId: string, userId: string): Promise<void>;
1109
+ }
1110
+ /** `client.resourceMarkings.*` — markings applied to arbitrary resources. */
1111
+ declare class ResourceMarkingsResource {
1112
+ private readonly t;
1113
+ constructor(t: Transport);
1114
+ list<T = Json>(resourceKind: string, resourceId: string): Promise<T[]>;
1115
+ apply<T = Json>(resourceKind: string, resourceId: string, markingId: string): Promise<T>;
1116
+ remove(resourceKind: string, resourceId: string, markingId: string): Promise<void>;
1117
+ }
1118
+ /** `client.propertyMarkings.*` — markings on individual node properties. */
1119
+ declare class PropertyMarkingsResource {
1120
+ private readonly t;
1121
+ constructor(t: Transport);
1122
+ listForNode<T = Json>(nodeId: string): Promise<T>;
1123
+ listOne<T = Json>(nodeId: string, propertyKey: string): Promise<T[]>;
1124
+ apply<T = Json>(nodeId: string, propertyKey: string, markingId: string): Promise<T>;
1125
+ remove(nodeId: string, propertyKey: string, markingId: string): Promise<void>;
1126
+ }
1127
+ /** `client.rowPolicies.*` — row-level security policy templates (v26). */
1128
+ declare class RowPoliciesResource {
1129
+ private readonly t;
1130
+ constructor(t: Transport);
1131
+ list<T = Json>(): Promise<T[]>;
1132
+ create<T = Json>(input: {
1133
+ object_type: string;
1134
+ role: string;
1135
+ predicate_template: string;
1136
+ description?: string;
1137
+ active?: boolean;
1138
+ }): Promise<T>;
1139
+ delete(policyId: string): Promise<void>;
1140
+ }
1141
+ interface ErasureSelector {
1142
+ node_ids?: string[];
1143
+ property?: string;
1144
+ value?: string;
1145
+ node_type?: string;
1146
+ }
1147
+ /** `client.erasure.*` — right-to-be-forgotten (preview first, then forget). */
1148
+ declare class ErasureResource {
1149
+ private readonly t;
1150
+ constructor(t: Transport);
1151
+ /** Dry-run: shows the match radius without mutating anything. */
1152
+ preview<T = Json>(selector: ErasureSelector): Promise<T>;
1153
+ /** Requires `confirm: true`; pass `expected_count` to guard the radius (422 on mismatch). */
1154
+ forget<T = Json>(selector: ErasureSelector, opts?: {
1155
+ mode?: string;
1156
+ reason?: string;
1157
+ confirm?: boolean;
1158
+ expected_count?: number;
1159
+ }): Promise<T>;
1160
+ }
1161
+ /** `client.retention.*` — retention windows per target + manual prune. */
1162
+ declare class RetentionResource {
1163
+ private readonly t;
1164
+ constructor(t: Transport);
1165
+ list<T = Json>(): Promise<T[]>;
1166
+ set<T = Json>(target: string, retentionDays: number, active?: boolean): Promise<T>;
1167
+ delete(target: string): Promise<void>;
1168
+ run<T = Json>(target: string): Promise<T>;
1169
+ }
1170
+ interface GuestTokenIssue {
1171
+ allowed_action_ids: string[];
1172
+ label?: string;
1173
+ subject?: string;
1174
+ ttl_hours?: number;
1175
+ max_uses?: number;
1176
+ min_interval_seconds?: number;
1177
+ /** `{ fence, target, arrival_radius_m }` */
1178
+ geo?: Json;
1179
+ /**
1180
+ * Free-form denormalized contact (e.g. `{ phone, document, notes }`),
1181
+ * surfaced by real-time gate screens without extra reads. Multi-domain: the
1182
+ * site decides what goes here.
1183
+ */
1184
+ contact?: Json;
1185
+ /** `{ channel, to, text? }` */
1186
+ share?: Json;
1187
+ link_base?: string;
1188
+ }
1189
+ /** `client.guestTokens.*` — public /m/{token} guest links. */
1190
+ declare class GuestTokensResource {
1191
+ private readonly t;
1192
+ constructor(t: Transport);
1193
+ list<T = Json>(): Promise<T[]>;
1194
+ /** Plaintext token appears once in the response — treat as a secret. */
1195
+ issue<T = Json>(input: GuestTokenIssue): Promise<T>;
1196
+ revoke<T = Json>(tokenId: string): Promise<T>;
1197
+ }
1198
+
1199
+ declare class WorkshopBriefingsResource {
1200
+ private readonly t;
1201
+ constructor(t: Transport);
1202
+ list<T = Json>(): Promise<T[]>;
1203
+ get<T = Json>(briefingId: string): Promise<T>;
1204
+ create<T = Json>(name: string): Promise<T>;
1205
+ patch<T = Json>(briefingId: string, payload: Json): Promise<T>;
1206
+ broadcast<T = Json>(briefingId: string): Promise<T>;
1207
+ }
1208
+ declare class WorkshopDossiersResource {
1209
+ private readonly t;
1210
+ constructor(t: Transport);
1211
+ list<T = Json>(): Promise<T[]>;
1212
+ get<T = Json>(dossierId: string): Promise<T>;
1213
+ create<T = Json>(title: string): Promise<T>;
1214
+ patch<T = Json>(dossierId: string, body: Json): Promise<T>;
1215
+ delete(dossierId: string): Promise<void>;
1216
+ addEmbed<T = Json>(dossierId: string, kind: string, sourceRef: string, nodeId: string): Promise<T>;
1217
+ embeds<T = Json>(dossierId: string): Promise<T[]>;
1218
+ }
1219
+ declare class WorkshopCovsResource {
1220
+ private readonly t;
1221
+ constructor(t: Transport);
1222
+ list<T = Json>(objectType?: string): Promise<T[]>;
1223
+ get<T = Json>(covId: string): Promise<T>;
1224
+ /** Full-object upsert. */
1225
+ save<T = Json>(cov: Json): Promise<T>;
1226
+ delete(covId: string): Promise<void>;
1227
+ setTeamDefault(covId: string): Promise<void>;
1228
+ }
1229
+ /** `client.workshop.*` — briefings, dossiers, custom object views, widget catalog. */
1230
+ declare class WorkshopResource {
1231
+ private readonly t;
1232
+ readonly briefings: WorkshopBriefingsResource;
1233
+ readonly dossiers: WorkshopDossiersResource;
1234
+ readonly covs: WorkshopCovsResource;
1235
+ constructor(t: Transport);
1236
+ widgetCatalog<T = Json>(proposableOnly?: boolean): Promise<T[]>;
1237
+ }
1238
+ declare class ComputeProvidersResource {
1239
+ private readonly t;
1240
+ constructor(t: Transport);
1241
+ catalog<T = Json>(): Promise<T>;
1242
+ list<T = Json>(): Promise<T[]>;
1243
+ /** `api_key` is write-only — never returned by the API. */
1244
+ create<T = Json>(input: {
1245
+ display_name: string;
1246
+ vendor: string;
1247
+ api_key?: string;
1248
+ base_url?: string;
1249
+ country?: string;
1250
+ jurisdictions?: string[];
1251
+ capabilities?: string[];
1252
+ cert_metadata?: Json;
1253
+ pricing_hint?: Json;
1254
+ provider_kind?: string;
1255
+ enabled?: boolean;
1256
+ }): Promise<T>;
1257
+ update<T = Json>(providerId: string, patch: Json): Promise<T>;
1258
+ delete<T = Json>(providerId: string): Promise<T>;
1259
+ test<T = Json>(providerId: string): Promise<T>;
1260
+ }
1261
+ declare class ComputeReleasesResource {
1262
+ private readonly t;
1263
+ constructor(t: Transport);
1264
+ list<T = Json>(name?: string): Promise<T>;
1265
+ publish<T = Json>(input: {
1266
+ name: string;
1267
+ image: string;
1268
+ eval_score?: number;
1269
+ metrics_sha256?: string;
1270
+ eval_notes?: string;
1271
+ notes?: string;
1272
+ spec?: Json;
1273
+ }): Promise<T>;
1274
+ /** 409 if `eval_score` is below the gate. */
1275
+ promote<T = Json>(name: string, version: string, minEvalScore?: number): Promise<T>;
1276
+ deploy<T = Json>(providerId: string, name: string, channel?: string, extra?: Json): Promise<T>;
1277
+ }
1278
+ /** Scoped control-plane for one provider — `client.compute.control(providerId)`. */
1279
+ declare class ComputeControlResource {
1280
+ private readonly t;
1281
+ private readonly base;
1282
+ constructor(t: Transport, providerId: string);
1283
+ listTemplates<T = Json>(): Promise<T>;
1284
+ saveTemplate<T = Json>(name: string, imageName: string, extra?: Json): Promise<T>;
1285
+ deleteTemplate<T = Json>(templateId: string): Promise<T>;
1286
+ listEndpoints<T = Json>(): Promise<T>;
1287
+ createEndpoint<T = Json>(templateId: string, name: string, extra?: Json): Promise<T>;
1288
+ updateEndpoint<T = Json>(endpointId: string, patch: Json): Promise<T>;
1289
+ deleteEndpoint<T = Json>(endpointId: string): Promise<T>;
1290
+ endpointHealth<T = Json>(endpointId: string): Promise<T>;
1291
+ /** `sync: true` long-polls server-side up to `timeout_s` — pass a matching
1292
+ * `signal` (or raise the client `timeoutMs`) for long jobs. */
1293
+ submitJob<T = Json>(endpointId: string, input: Json, opts?: {
1294
+ sync?: boolean;
1295
+ webhook?: string;
1296
+ timeout_s?: number;
1297
+ }): Promise<T>;
1298
+ jobStatus<T = Json>(endpointId: string, jobId: string): Promise<T>;
1299
+ cancelJob<T = Json>(endpointId: string, jobId: string): Promise<T>;
1300
+ listPods<T = Json>(): Promise<T>;
1301
+ createPod<T = Json>(name: string, imageName: string, extra?: Json): Promise<T>;
1302
+ stopPod<T = Json>(podId: string): Promise<T>;
1303
+ terminatePod<T = Json>(podId: string): Promise<T>;
1304
+ }
1305
+ /** `client.compute.*` — vision compute, providers, releases, per-provider control plane. */
1306
+ declare class ComputeResource {
1307
+ private readonly t;
1308
+ readonly providers: ComputeProvidersResource;
1309
+ readonly releases: ComputeReleasesResource;
1310
+ constructor(t: Transport);
1311
+ selectModel<T = Json>(objective: string, opts?: {
1312
+ intention?: string;
1313
+ jurisdiction?: string;
1314
+ }): Promise<T>;
1315
+ generateSpec<T = Json>(objective: string, opts?: {
1316
+ base_image?: string;
1317
+ contract?: Json;
1318
+ pip?: string[];
1319
+ env?: Json;
1320
+ }): Promise<T>;
1321
+ visionCount<T = Json>(imageUrl: string, instruction: string, opts?: {
1322
+ provider?: string;
1323
+ jurisdiction?: string;
1324
+ /** `{ nw: {lat,lng}, se: {lat,lng} }` */
1325
+ geo_bounds?: Json;
1326
+ /** detect | segment */
1327
+ capability?: string;
1328
+ /** geoshape | point */
1329
+ output_as?: string;
1330
+ }): Promise<T>;
1331
+ /** Factory (no HTTP) — control plane scoped to one provider. */
1332
+ control(providerId: string): ComputeControlResource;
1333
+ }
1334
+ /** `client.inference.*` — audited LLM inference (server-side InferenceLog). */
1335
+ declare class InferenceResource {
1336
+ private readonly t;
1337
+ constructor(t: Transport);
1338
+ complete<T = Json>(prompt: string, opts?: {
1339
+ provider?: string;
1340
+ model?: string;
1341
+ system_prompt?: string;
1342
+ temperature?: number;
1343
+ max_tokens?: number;
1344
+ }): Promise<T>;
1345
+ chat<T = Json>(messages: Json[], opts?: {
1346
+ rag_sources?: string[];
1347
+ rag_limit?: number;
1348
+ provider?: string;
1349
+ model?: string;
1350
+ temperature?: number;
1351
+ max_tokens?: number;
1352
+ }): Promise<T>;
1353
+ models<T = Json>(): Promise<T[]>;
1354
+ collections<T = Json>(): Promise<T[]>;
1355
+ chatWithRag(query: string, opts?: {
1356
+ sources?: string[];
1357
+ limit?: number;
1358
+ provider?: string;
1359
+ model?: string;
1360
+ temperature?: number;
1361
+ max_tokens?: number;
1362
+ system?: string;
1363
+ }): Promise<Json>;
1364
+ auditTrail<T = Json>(opts?: {
1365
+ limit?: number;
1366
+ provider?: string;
1367
+ }): Promise<T[]>;
1368
+ }
1369
+ /** `client.codegen.*` — LLM code generation (server AST-validates; invalid → 400). */
1370
+ declare class CodegenResource {
1371
+ private readonly t;
1372
+ constructor(t: Transport);
1373
+ /** kind ∈ transform|script */
1374
+ generate<T = Json>(objective: string, kind?: string, context?: Json): Promise<T>;
1375
+ }
1376
+ /** `client.correlation.*` — chain correlation (quick 1-hop sync + multi-hop async). */
1377
+ declare class CorrelationResource {
1378
+ private readonly t;
1379
+ constructor(t: Transport);
1380
+ quickLinks<T = Json>(value: string, kind?: string): Promise<T>;
1381
+ startChain<T = Json>(value: string, opts?: {
1382
+ kind?: string;
1383
+ max_depth?: number;
1384
+ budget_nodes?: number;
1385
+ deep_osint_depth?: number;
1386
+ }): Promise<T>;
1387
+ /** Poll until `status === "done"`. */
1388
+ getChain<T = Json>(taskId: string): Promise<T>;
1389
+ /** Opt-in: materializes the chain graph into the ontology. */
1390
+ saveChain<T = Json>(taskId: string, nodeIds?: string[]): Promise<T>;
1391
+ }
1392
+ /** `client.situational.*` — spatio-temporal correlation over positioned nodes. */
1393
+ declare class SituationalResource {
1394
+ private readonly t;
1395
+ constructor(t: Transport);
1396
+ nearby<T = Json>(nodeId: string, opts?: {
1397
+ radius_m?: number;
1398
+ window_s?: number;
1399
+ kinds?: string[];
1400
+ limit?: number;
1401
+ }): Promise<T>;
1402
+ correlations<T = Json>(nodeId: string): Promise<T>;
1403
+ correlate<T = Json>(anchorNodeId: string, opts?: {
1404
+ radius_m?: number;
1405
+ window_s?: number;
1406
+ kinds?: string[];
1407
+ limit?: number;
1408
+ }): Promise<T>;
1409
+ /** Reversible — removes the correlation edge. */
1410
+ cut(edgeId: string): Promise<void>;
1411
+ }
1412
+ /** Merge target selector: `{object_id}` | `{node_type, canonical}` | `{create: node_type}`. */
1413
+ type MergeTarget = Json;
1414
+ /** `client.merge.*` — evidence-preserving merge into canonical objects (perm `ontology.merge`). */
1415
+ declare class MergeResource {
1416
+ private readonly t;
1417
+ constructor(t: Transport);
1418
+ suggestTarget<T = Json>(nodeType: string, canonical: string): Promise<T>;
1419
+ /** Pass `result_payload` (raw) OR `properties` (ready). */
1420
+ preview<T = Json>(target: MergeTarget, opts?: {
1421
+ result_payload?: Json;
1422
+ properties?: Json;
1423
+ }): Promise<T>;
1424
+ /** `field_resolutions`: `{field: "keep"|"replace"|"append"}`;
1425
+ * `link`: `{target_object_id, relation_type, metadata?}`. */
1426
+ apply<T = Json>(target: MergeTarget, opts?: {
1427
+ result_payload?: Json;
1428
+ properties?: Json;
1429
+ field_resolutions?: Json;
1430
+ link?: Json;
1431
+ }): Promise<T>;
1432
+ }
1433
+
1434
+ declare class AtlasLayersResource {
1435
+ private readonly t;
1436
+ constructor(t: Transport);
1437
+ list<T = Json>(): Promise<T[]>;
1438
+ create<T = Json>(name: string, kind: string, extra?: Json): Promise<T>;
1439
+ delete(layerId: string): Promise<void>;
1440
+ /** KML content travels inside the JSON body (not multipart) — same as Python. */
1441
+ importKml<T = Json>(layerId: string, kmlText: string): Promise<T>;
1442
+ }
1443
+ declare class AtlasEvaluationResource {
1444
+ private readonly t;
1445
+ constructor(t: Transport);
1446
+ status<T = Json>(): Promise<T>;
1447
+ runOnce<T = Json>(): Promise<T>;
1448
+ }
1449
+ /** `client.atlas.*` — atlas layers + rule evaluator. */
1450
+ declare class AtlasResource {
1451
+ readonly layers: AtlasLayersResource;
1452
+ readonly evaluation: AtlasEvaluationResource;
1453
+ constructor(t: Transport);
1454
+ }
1455
+ /** `client.briefing.*` — per-slug home briefing. */
1456
+ declare class BriefingResource {
1457
+ private readonly t;
1458
+ constructor(t: Transport);
1459
+ get<T = Json>(slug: string): Promise<T>;
1460
+ refresh<T = Json>(slug: string): Promise<T>;
1461
+ crisisPlan<T = Json>(slug: string): Promise<T>;
1462
+ }
1463
+ declare class CctvBookmarksResource {
1464
+ private readonly t;
1465
+ constructor(t: Transport);
1466
+ create<T = Json>(streamId: string, input: {
1467
+ t_ms: number;
1468
+ label: string;
1469
+ t_end_ms?: number;
1470
+ severity?: string;
1471
+ }): Promise<T>;
1472
+ list<T = Json>(streamId: string, opts?: {
1473
+ from_ms?: number;
1474
+ to_ms?: number;
1475
+ }): Promise<T[]>;
1476
+ delete(bookmarkId: string): Promise<void>;
1477
+ }
1478
+ declare class CctvGcpsResource {
1479
+ private readonly t;
1480
+ constructor(t: Transport);
1481
+ put<T = Json>(streamId: string, gcps: Json[]): Promise<T>;
1482
+ get<T = Json>(streamId: string): Promise<T>;
1483
+ delete(streamId: string): Promise<void>;
1484
+ }
1485
+ declare class CctvHotlistResource {
1486
+ private readonly t;
1487
+ constructor(t: Transport);
1488
+ list<T = Json>(activeOnly?: boolean): Promise<T[]>;
1489
+ add<T = Json>(plate: string, opts?: {
1490
+ reason?: string;
1491
+ severity?: string;
1492
+ }): Promise<T>;
1493
+ remove(watchedId: string): Promise<void>;
1494
+ }
1495
+ /** `client.cctv.*` — CCTV streams, detections, recordings, exports, LPR hotlist. */
1496
+ declare class CctvResource {
1497
+ private readonly t;
1498
+ readonly bookmarks: CctvBookmarksResource;
1499
+ readonly gcps: CctvGcpsResource;
1500
+ readonly hotlist: CctvHotlistResource;
1501
+ constructor(t: Transport);
1502
+ streamsPage<T = Json>(opts?: {
1503
+ offset?: number;
1504
+ limit?: number;
1505
+ q?: string;
1506
+ status?: string;
1507
+ city?: string;
1508
+ detection_enabled?: boolean;
1509
+ }): Promise<T>;
1510
+ detections<T = Json>(streamId: string, opts?: {
1511
+ limit?: number;
1512
+ from_ms?: number;
1513
+ to_ms?: number;
1514
+ }): Promise<T[]>;
1515
+ detectorClasses<T = Json>(): Promise<T>;
1516
+ presets<T = Json>(): Promise<T[]>;
1517
+ bridgeBackfill<T = Json>(): Promise<T>;
1518
+ /** 202 — returns a provider job to poll. */
1519
+ detectNow<T = Json>(streamId: string, opts?: {
1520
+ frames?: number;
1521
+ frame_stride?: number;
1522
+ push?: boolean;
1523
+ }): Promise<T>;
1524
+ /** 202 — export job; poll with `exportStatus`. */
1525
+ exportClip<T = Json>(streamId: string, opts?: {
1526
+ duration_s?: number;
1527
+ from_ms?: number;
1528
+ to_ms?: number;
1529
+ }): Promise<T>;
1530
+ exportStatus<T = Json>(jobId: string): Promise<T>;
1531
+ recordings<T = Json>(streamId: string, opts?: {
1532
+ from_ms?: number;
1533
+ to_ms?: number;
1534
+ }): Promise<T>;
1535
+ recordingStatus<T = Json>(streamId: string): Promise<T>;
1536
+ /** action ∈ start|stop */
1537
+ recordingControl<T = Json>(streamId: string, action: "start" | "stop", cadence?: number): Promise<T>;
1538
+ /** Returns the raw HLS VOD playlist text (m3u8), not JSON. */
1539
+ recordingsPlaylist(streamId: string, opts?: {
1540
+ from_ms?: number;
1541
+ to_ms?: number;
1542
+ }): Promise<string>;
1543
+ }
1544
+ /**
1545
+ * A number of a pool station's inventory (`GET /api/v1/edge/nodes` →
1546
+ * `nodes[].pool.numbers[]`). Published by the `connector.whatsapp_pool` tick.
1547
+ */
1548
+ interface EdgePoolNumber {
1549
+ id: string;
1550
+ msisdn?: string;
1551
+ role?: string;
1552
+ owner?: string;
1553
+ state?: string;
1554
+ sendable?: boolean;
1555
+ needs_gesture?: boolean;
1556
+ banned_until?: string | null;
1557
+ sent?: number;
1558
+ /** Present only when a device is declared for this number (opt-in). */
1559
+ automation?: EdgePoolAutomation | null;
1560
+ }
1561
+ /**
1562
+ * Android relink automation for one number. The phone is an edge: when a
1563
+ * session dies, a runner types the 8-character pairing code on the declared
1564
+ * device. Absent when no device is declared — the number stays on the manual
1565
+ * gesture and the row is unchanged.
1566
+ */
1567
+ interface EdgePoolAutomation {
1568
+ /** `"idle"` | `"pending"` | `"attempting"` | `"confirming"` | `"needs_human"` */
1569
+ state?: string;
1570
+ attempts?: number;
1571
+ max_attempts?: number;
1572
+ /** Why the automation gave up. Truncated to 160 chars by the backend. */
1573
+ last_error?: string;
1574
+ last_attempt_at?: string;
1575
+ last_success_at?: string;
1576
+ device?: {
1577
+ serial?: string;
1578
+ /** 0 = not reported. */
1579
+ battery?: number;
1580
+ screen_on?: boolean;
1581
+ wa_foreground?: boolean;
1582
+ at?: string;
1583
+ };
1584
+ }
1585
+ /** Pool snapshot of a number-station device (additive `pool` on {@link EdgeNode}). */
1586
+ interface EdgePoolSummary {
1587
+ station?: string | null;
1588
+ state?: string | null;
1589
+ health?: {
1590
+ total?: number;
1591
+ sendable?: number;
1592
+ standby?: number;
1593
+ needs_gesture?: number;
1594
+ temp_banned?: number;
1595
+ connected?: boolean;
1596
+ };
1597
+ numbers?: EdgePoolNumber[];
1598
+ }
1599
+ /**
1600
+ * An edge device row from `GET /api/v1/edge/nodes`. `kind` is additive —
1601
+ * `"camera_gateway"` | `"whatsapp_station"` | `"whatsapp_pool"` |
1602
+ * `"autosync_bridge"` (absent = legacy camera gateway). `pool` is additive —
1603
+ * present only on number-station devices whose connector published inventory.
1604
+ */
1605
+ interface EdgeNode {
1606
+ edge_id: string;
1607
+ name: string;
1608
+ kind?: string;
1609
+ status: string;
1610
+ version: string;
1611
+ last_seen_at: string | null;
1612
+ update_available: boolean;
1613
+ cameras_ok: number | null;
1614
+ pool?: EdgePoolSummary | null;
1615
+ /**
1616
+ * Connector behind a station-like device. `capabilities` are the ones the
1617
+ * skill DECLARES (`"pairing"`, `"inventory"`, …) — gate each gesture by
1618
+ * them, never by a hardcoded skill key.
1619
+ */
1620
+ pairing?: {
1621
+ agent_id: string;
1622
+ slug: string;
1623
+ skill_key: string;
1624
+ capabilities?: string[];
1625
+ } | null;
1626
+ }
1627
+ /** `client.edge.*` — edge node pairing + fleet version pinning. */
1628
+ declare class EdgeResource {
1629
+ private readonly t;
1630
+ constructor(t: Transport);
1631
+ /**
1632
+ * Issue a single-use pairing code (short TTL). The plaintext `code` appears
1633
+ * ONLY in this response (hash at rest).
1634
+ *
1635
+ * `grants` GRANTS gestures to whichever device redeems the code (allowlist;
1636
+ * today `["retry"]`, so a desk app can ask the station to reconnect a
1637
+ * number). Empty — the default — is **read only**: least privilege, and
1638
+ * granting has to be a choice. The grant travels from the code to the node
1639
+ * and dies with it on `revoke`.
1640
+ *
1641
+ * Even when granted, the device never receives the gesture's ADDRESS
1642
+ * (`agent_id`/`skill_key`): it sends the verb and the server routes it.
1643
+ * Perm: `connectors.manage`.
1644
+ */
1645
+ createPairingCode<T = Json>(opts?: {
1646
+ label?: string;
1647
+ ttl_seconds?: number;
1648
+ grants?: string[];
1649
+ }): Promise<T>;
1650
+ /** Nodes carry an additive `kind` field — see {@link EdgeNode}. */
1651
+ listNodes<T = Json>(): Promise<T>;
1652
+ listDiscovered<T = Json>(): Promise<T[]>;
1653
+ revoke<T = Json>(edgeId: string): Promise<T>;
1654
+ setExpectedVersion<T = Json>(version: string): Promise<T>;
1655
+ getExpectedVersion<T = Json>(): Promise<T>;
1656
+ }
1657
+ declare class VideoStreamsResource {
1658
+ private readonly t;
1659
+ constructor(t: Transport);
1660
+ list<T = Json>(): Promise<T[]>;
1661
+ create<T = Json>(input: {
1662
+ name: string;
1663
+ source_url: string;
1664
+ source_kind: string;
1665
+ classification?: string;
1666
+ camera_pose?: Json;
1667
+ }): Promise<T>;
1668
+ delete(streamId: string): Promise<void>;
1669
+ }
1670
+ /** `client.video.*` — video streams, detections, tags, soak heatmap, exports. */
1671
+ declare class VideoResource {
1672
+ private readonly t;
1673
+ readonly streams: VideoStreamsResource;
1674
+ constructor(t: Transport);
1675
+ listDetections<T = Json>(streamId: string, opts?: {
1676
+ from?: string;
1677
+ to?: string;
1678
+ }): Promise<T[]>;
1679
+ submitDetection<T = Json>(detection: Json): Promise<T>;
1680
+ listTags<T = Json>(streamId: string): Promise<T[]>;
1681
+ submitTag<T = Json>(tag: Json): Promise<T>;
1682
+ soakHeatmap<T = Json>(streamId: string, from: string, to: string, precision?: number): Promise<T[]>;
1683
+ createExport<T = Json>(streamId: string, frameRange: Json, redactions?: Json[]): Promise<T>;
1684
+ getExport<T = Json>(exportId: string): Promise<T>;
1685
+ }
1686
+ /** `client.comunicados.*` — tenant-wide announcements (v23). */
1687
+ declare class ComunicadosResource {
1688
+ private readonly t;
1689
+ constructor(t: Transport);
1690
+ list<T = Json>(opts?: {
1691
+ kind?: string;
1692
+ status_temporal?: string;
1693
+ include_deleted?: boolean;
1694
+ }): Promise<T[]>;
1695
+ listActive<T = Json>(): Promise<T[]>;
1696
+ create<T = Json>(input: {
1697
+ kind: string;
1698
+ title: string;
1699
+ body?: string;
1700
+ icon?: string;
1701
+ closable?: boolean;
1702
+ duration_s?: number;
1703
+ audience_roles?: string[];
1704
+ audience_iam_perms?: string[];
1705
+ audience_groups?: string[];
1706
+ schedule_start?: string;
1707
+ schedule_end?: string;
1708
+ schedule_days_of_week?: number[];
1709
+ cta_label?: string;
1710
+ cta_href?: string;
1711
+ }): Promise<T>;
1712
+ /** Sparse patch — only provided keys are sent. */
1713
+ patch<T = Json>(comunicadoId: string, patch: Json): Promise<T>;
1714
+ /** Soft delete. */
1715
+ delete(comunicadoId: string): Promise<void>;
1716
+ /** Idempotent per-user dismissal. */
1717
+ dismissMe(comunicadoId: string): Promise<void>;
1718
+ }
1719
+ declare class CampaignBriefingResource {
1720
+ private readonly t;
1721
+ constructor(t: Transport);
1722
+ refresh<T = Json>(opts?: {
1723
+ candidato_nome?: string;
1724
+ candidato_slug?: string;
1725
+ perfil_payload?: Json;
1726
+ clipping_items?: Json[];
1727
+ default_modo_inicial?: string;
1728
+ }): Promise<T>;
1729
+ get<T = Json>(candidatoSlug: string, includeHeadline?: boolean): Promise<T>;
1730
+ /** 409 when the briefing is in crisis mode. */
1731
+ regenerateHeadline<T = Json>(candidatoSlug: string): Promise<T>;
1732
+ /** duration_hours ∈ 1..168 (default 24). */
1733
+ overrideModo<T = Json>(candidatoSlug: string, novoModo: string, durationHours?: number): Promise<T>;
1734
+ }
1735
+ /** `client.campaign.*` — campaign home-briefing engine. */
1736
+ declare class CampaignResource {
1737
+ readonly briefing: CampaignBriefingResource;
1738
+ constructor(t: Transport);
1739
+ }
1740
+
1741
+ /** `client.forms.*` — governed form submissions (v23). */
1742
+ declare class FormsResource {
1743
+ private readonly t;
1744
+ constructor(t: Transport);
1745
+ submit<T = Json>(formKey: string, payload: Json, opts?: {
1746
+ fields?: Json[];
1747
+ visibility_policy?: string;
1748
+ required_perm?: string;
1749
+ action_id?: string;
1750
+ target_node_type?: string;
1751
+ note?: string;
1752
+ }): Promise<T>;
1753
+ listSubmissions<T = Json>(opts?: {
1754
+ form_key?: string;
1755
+ limit?: number;
1756
+ offset?: number;
1757
+ }): Promise<T[]>;
1758
+ }
1759
+ declare class AppShellSection {
1760
+ private readonly t;
1761
+ private readonly path;
1762
+ constructor(t: Transport, path: string);
1763
+ get<T = Json>(): Promise<T>;
1764
+ put<T = Json>(value: Json): Promise<T>;
1765
+ }
1766
+ /** `client.appShell.*` — chrome configuration (banner/footer/user-menu/sidenav/homepage). */
1767
+ declare class AppShellResource {
1768
+ private readonly t;
1769
+ readonly banner: AppShellSection;
1770
+ readonly footer: AppShellSection;
1771
+ readonly userMenu: AppShellSection;
1772
+ readonly sidenav: AppShellSection;
1773
+ readonly homepage: AppShellSection;
1774
+ constructor(t: Transport);
1775
+ getMe<T = Json>(): Promise<T>;
1776
+ putMe<T = Json>(config: Json): Promise<T>;
1777
+ getTenant<T = Json>(): Promise<T>;
1778
+ putTenant<T = Json>(config: Json): Promise<T>;
1779
+ }
1780
+ declare class ProjectConstraintsResource {
1781
+ private readonly t;
1782
+ constructor(t: Transport);
1783
+ get<T = Json>(projectId: string): Promise<T>;
1784
+ put<T = Json>(projectId: string, opts?: {
1785
+ mode?: string;
1786
+ markings?: string[];
1787
+ classification_ceiling?: string;
1788
+ }): Promise<T>;
1789
+ clear(projectId: string): Promise<void>;
1790
+ /** Report-only — deletes nothing. */
1791
+ revalidate<T = Json>(projectId: string): Promise<T>;
1792
+ }
1793
+ /** `client.projects.*` — project placement + governance constraints. */
1794
+ declare class ProjectsResource {
1795
+ private readonly t;
1796
+ readonly constraints: ProjectConstraintsResource;
1797
+ constructor(t: Transport);
1798
+ /** `spaceId: null` removes the project from its Space. */
1799
+ move<T = Json>(projectId: string, spaceId: string | null): Promise<T>;
1800
+ }
1801
+ /** `client.organizations.*` — org listing + cross-org guests. */
1802
+ declare class OrganizationsResource {
1803
+ private readonly t;
1804
+ constructor(t: Transport);
1805
+ list<T = Json>(opts?: {
1806
+ limit?: number;
1807
+ offset?: number;
1808
+ }): Promise<T[]>;
1809
+ get<T = Json>(organizationId: string): Promise<T>;
1810
+ listGuests<T = Json>(organizationId: string, includeRevoked?: boolean): Promise<T[]>;
1811
+ inviteGuest<T = Json>(organizationId: string, userId: string, expiresAt?: string): Promise<T>;
1812
+ revokeGuest(organizationId: string, userId: string): Promise<void>;
1813
+ }
1814
+ /** `client.spaces.*` — spaces (project grouping) + org membership. */
1815
+ declare class SpacesResource {
1816
+ private readonly t;
1817
+ constructor(t: Transport);
1818
+ list<T = Json>(opts?: {
1819
+ limit?: number;
1820
+ offset?: number;
1821
+ }): Promise<T[]>;
1822
+ get<T = Json>(spaceId: string): Promise<T>;
1823
+ create<T = Json>(slug: string, displayName: string, description?: string): Promise<T>;
1824
+ update<T = Json>(spaceId: string, patch: {
1825
+ display_name?: string;
1826
+ description?: string;
1827
+ active?: boolean;
1828
+ }): Promise<T>;
1829
+ addOrganization<T = Json>(spaceId: string, tenantId: string): Promise<T>;
1830
+ removeOrganization(spaceId: string, tenantId: string): Promise<void>;
1831
+ }
1832
+ /** Valid project roles (mirror of `aegis.taxonomy.VALID_ROLES`). */
1833
+ declare const VALID_PROJECT_ROLES: readonly ["owner", "editor", "reviewer", "viewer", "discoverer"];
1834
+ /** `client.solutions.*` — AIP solution designer (blueprints, diagrams, materialize, teardown, marketplace). */
1835
+ declare class SolutionsResource {
1836
+ private readonly t;
1837
+ constructor(t: Transport);
1838
+ design<T = Json>(problem: string, opts?: {
1839
+ domain?: string;
1840
+ wizard?: Json;
1841
+ }): Promise<T>;
1842
+ /** Accept-flags travel nested under `accept`; blueprint/diagram_id/app_id/linked_sources stay top-level. */
1843
+ materialize<T = Json>(blueprint: Json, accept?: {
1844
+ ontology_types?: boolean;
1845
+ logic_functions?: boolean;
1846
+ action_types?: boolean;
1847
+ workspace_layout?: boolean;
1848
+ project?: boolean;
1849
+ project_id?: string;
1850
+ agents?: boolean;
1851
+ flows?: boolean;
1852
+ }, opts?: {
1853
+ diagram_id?: string;
1854
+ app_id?: string;
1855
+ linked_sources?: Json[];
1856
+ }): Promise<T>;
1857
+ /** depth ∈ lean|full */
1858
+ designGraph<T = Json>(problem: string, opts?: {
1859
+ wizard?: Json;
1860
+ depth?: string;
1861
+ }): Promise<T>;
1862
+ mergeGraph<T = Json>(currentGraph: Json, baseBlueprint: Json, incomingBlueprint: Json): Promise<T>;
1863
+ listPatterns<T = Json>(): Promise<T[]>;
1864
+ listDiagrams<T = Json>(opts?: {
1865
+ limit?: number;
1866
+ offset?: number;
1867
+ }): Promise<T[]>;
1868
+ get<T = Json>(diagramId: string): Promise<T>;
1869
+ create<T = Json>(input: {
1870
+ slug: string;
1871
+ title: string;
1872
+ nodes: Json[];
1873
+ edges: Json[];
1874
+ wizard?: Json;
1875
+ description?: string;
1876
+ project_id?: string;
1877
+ }): Promise<T>;
1878
+ /** Save == publish. */
1879
+ save<T = Json>(diagramId: string, input: {
1880
+ nodes: Json[];
1881
+ edges: Json[];
1882
+ wizard?: Json;
1883
+ message?: string;
1884
+ }): Promise<T>;
1885
+ delete(diagramId: string): Promise<void>;
1886
+ versions<T = Json>(diagramId: string): Promise<T[]>;
1887
+ walkthrough<T = Json>(diagramId: string): Promise<T>;
1888
+ implementations<T = Json>(graph: Json, nodeId: string, opts?: {
1889
+ problem?: string;
1890
+ wizard?: Json;
1891
+ }): Promise<T[]>;
1892
+ expandNode<T = Json>(graph: Json, nodeId: string, planId: string, wizard?: Json): Promise<T>;
1893
+ ontologyModel<T = Json>(prompt: string): Promise<T>;
1894
+ fromLineage<T = Json>(events?: Json[]): Promise<T>;
1895
+ teardownPlan<T = Json>(appId: string): Promise<T>;
1896
+ teardown<T = Json>(appId: string): Promise<T>;
1897
+ marketplaceListings<T = Json>(opts?: {
1898
+ status?: string;
1899
+ q?: string;
1900
+ tag?: string;
1901
+ category?: string;
1902
+ }): Promise<T[]>;
1903
+ marketplaceDetail<T = Json>(listingId: string): Promise<T>;
1904
+ marketplacePublish<T = Json>(diagramId: string, opts?: {
1905
+ title?: string;
1906
+ description?: string;
1907
+ category?: string;
1908
+ tags?: string[];
1909
+ }): Promise<T>;
1910
+ /** Re-materializes the listing in the caller's tenant. */
1911
+ marketplaceInstall<T = Json>(listingId: string): Promise<T>;
1912
+ marketplacePatch<T = Json>(listingId: string, fields: Json): Promise<T>;
1913
+ }
1914
+
1915
+ declare class WorkspaceVersionsResource {
1916
+ private readonly t;
1917
+ constructor(t: Transport);
1918
+ list<T = Json>(workspaceId: string): Promise<T[]>;
1919
+ get<T = Json>(workspaceId: string, versionNumber: number): Promise<T>;
1920
+ republish<T = Json>(workspaceId: string, versionNumber: number, message?: string): Promise<T>;
1921
+ }
1922
+ /** `client.workspaces.*` — Workshop workspaces: publish, navigation, promotions, kiosk. */
1923
+ declare class WorkspacesResource {
1924
+ private readonly t;
1925
+ readonly versions: WorkspaceVersionsResource;
1926
+ constructor(t: Transport);
1927
+ list<T = Json>(opts?: {
1928
+ limit?: number;
1929
+ offset?: number;
1930
+ include_inactive?: boolean;
1931
+ }): Promise<T[]>;
1932
+ get<T = Json>(workspaceId: string): Promise<T>;
1933
+ create<T = Json>(input: {
1934
+ slug: string;
1935
+ display_name: string;
1936
+ description?: string;
1937
+ project_id?: string;
1938
+ config?: Json;
1939
+ }): Promise<T>;
1940
+ /** Save == immediate publish — bumps version + snapshot. */
1941
+ publish<T = Json>(workspaceId: string, config: Json, message?: string): Promise<T>;
1942
+ /** Soft delete (`active=false`). */
1943
+ delete(workspaceId: string): Promise<void>;
1944
+ getNavigation<T = Json>(workspaceId: string): Promise<T>;
1945
+ setNavigation<T = Json>(workspaceId: string, opts?: {
1946
+ navigate_out_allowed?: boolean;
1947
+ allowed_applications?: string[];
1948
+ message?: string;
1949
+ }): Promise<T>;
1950
+ listPromotions<T = Json>(workspaceId: string): Promise<T[]>;
1951
+ /** Idempotent. */
1952
+ promote<T = Json>(workspaceId: string, organizationId: string, ordering?: number): Promise<T>;
1953
+ unpromote(workspaceId: string, organizationId: string): Promise<void>;
1954
+ listPromotedForOrganization<T = Json>(organizationId: string): Promise<T[]>;
1955
+ getKiosk<T = Json>(workspaceId: string): Promise<T>;
1956
+ setKiosk<T = Json>(workspaceId: string, opts?: {
1957
+ hide_chrome?: boolean;
1958
+ allow_exit?: boolean;
1959
+ auto_fullscreen?: boolean;
1960
+ message?: string;
1961
+ }): Promise<T>;
1962
+ startKioskSession<T = Json>(workspaceId: string, clientInfo?: Json): Promise<T>;
1963
+ endKioskSession<T = Json>(workspaceId: string, sessionId: string): Promise<T>;
1964
+ listKioskSessions<T = Json>(workspaceId: string, opts?: {
1965
+ active_only?: boolean;
1966
+ limit?: number;
1967
+ offset?: number;
1968
+ }): Promise<T[]>;
1969
+ }
1970
+ /** `client.workspaceUpdates.*` — workspace release-notes tours. */
1971
+ declare class WorkspaceUpdatesResource {
1972
+ private readonly t;
1973
+ constructor(t: Transport);
1974
+ list<T = Json>(workspaceId: string, includeArchived?: boolean): Promise<T[]>;
1975
+ /** Active updates not yet seen by the caller. */
1976
+ listUnseen<T = Json>(workspaceId: string): Promise<T[]>;
1977
+ get<T = Json>(workspaceId: string, updateId: string): Promise<T>;
1978
+ create<T = Json>(workspaceId: string, input: {
1979
+ title: string;
1980
+ pages: Json[];
1981
+ summary?: string;
1982
+ }): Promise<T>;
1983
+ patch<T = Json>(workspaceId: string, updateId: string, patch: {
1984
+ title?: string;
1985
+ summary?: string;
1986
+ pages?: Json[];
1987
+ }): Promise<T>;
1988
+ archive<T = Json>(workspaceId: string, updateId: string): Promise<T>;
1989
+ /** Hard delete — cascades pages + views. */
1990
+ delete(workspaceId: string, updateId: string): Promise<void>;
1991
+ markSeen(workspaceId: string, updateId: string, dismissed?: boolean): Promise<void>;
1992
+ }
1993
+
1994
+ /**
1995
+ * Versioned platform surfaces (`/platform/v22..v26`) — mirrors the Python
1996
+ * `platform_v22..platform_v26` modules, unified over the single client
1997
+ * transport (Python uses four different transports; TS uses one).
1998
+ *
1999
+ * Surfaces already mirrored on first-class resources are NOT duplicated
2000
+ * here (pipelines v22, notepad/media/timeseries/pages/guest-tokens/
2001
+ * lineage-graph/llm-budget v23, aip models v25, functions/code-repos/
2002
+ * row-policies/alarms v26).
2003
+ */
2004
+
2005
+ declare class V22ActionLogResource {
2006
+ private readonly t;
2007
+ constructor(t: Transport);
2008
+ record<T = Json>(input: {
2009
+ subject_type: string;
2010
+ subject_id: string;
2011
+ action: string;
2012
+ summary?: string;
2013
+ before?: Json;
2014
+ after?: Json;
2015
+ markings?: string[];
2016
+ }): Promise<T>;
2017
+ list<T = Json>(opts?: {
2018
+ subject_type?: string;
2019
+ subject_id?: string;
2020
+ }): Promise<T[]>;
2021
+ }
2022
+ declare class V22NotepadResource {
2023
+ private readonly t;
2024
+ constructor(t: Transport);
2025
+ create<T = Json>(title: string, opts?: {
2026
+ body?: string;
2027
+ is_template?: boolean;
2028
+ markings?: string[];
2029
+ }): Promise<T>;
2030
+ freeze<T = Json>(docId: string): Promise<T>;
2031
+ instantiate<T = Json>(templateId: string, title: string, variables?: Json): Promise<T>;
2032
+ }
2033
+ declare class V22QuiverResource {
2034
+ private readonly t;
2035
+ constructor(t: Transport);
2036
+ create<T = Json>(input: {
2037
+ slug: string;
2038
+ display_name: string;
2039
+ cells?: Json[];
2040
+ input_vars?: Json;
2041
+ output_vars?: Json;
2042
+ }): Promise<T>;
2043
+ render<T = Json>(dashId: string, opts?: {
2044
+ variables?: Json;
2045
+ range?: Json;
2046
+ }): Promise<T>;
2047
+ }
2048
+ /** `client.platformV22.*` — action log, notepad templates, quiver dashboards, usage metering. */
2049
+ declare class PlatformV22Resource {
2050
+ private readonly t;
2051
+ readonly actionLog: V22ActionLogResource;
2052
+ readonly notepad: V22NotepadResource;
2053
+ readonly quiver: V22QuiverResource;
2054
+ constructor(t: Transport);
2055
+ /** Returns the transformed value (unwraps the response's `value` field). */
2056
+ applyVariableTransform(kind: string, inputs: Json): Promise<unknown>;
2057
+ recordUsage<T = Json>(input: {
2058
+ object_type: string;
2059
+ op: string;
2060
+ app_type: string;
2061
+ user_count_delta?: number;
2062
+ event_count_delta?: number;
2063
+ }): Promise<T>;
2064
+ queryUsage<T = Json>(opts?: {
2065
+ object_type?: string;
2066
+ op?: string;
2067
+ app_type?: string;
2068
+ days?: number;
2069
+ }): Promise<T[]>;
2070
+ }
2071
+ declare class V23LogicResource {
2072
+ private readonly t;
2073
+ constructor(t: Transport);
2074
+ list<T = Json>(): Promise<T[]>;
2075
+ get<T = Json>(fid: string): Promise<T>;
2076
+ create<T = Json>(input: Json): Promise<T>;
2077
+ update<T = Json>(fid: string, patch: Json): Promise<T>;
2078
+ delete(fid: string): Promise<void>;
2079
+ invoke<T = Json>(fid: string, inputs?: Json): Promise<T>;
2080
+ addTest<T = Json>(fid: string, input: Json): Promise<T>;
2081
+ runTest<T = Json>(fid: string, testId: string): Promise<T>;
2082
+ }
2083
+ declare class V23ActionsResource {
2084
+ private readonly t;
2085
+ constructor(t: Transport);
2086
+ list<T = Json>(): Promise<T[]>;
2087
+ get<T = Json>(aid: string): Promise<T>;
2088
+ create<T = Json>(input: Json): Promise<T>;
2089
+ update<T = Json>(aid: string, patch: Json): Promise<T>;
2090
+ delete(aid: string): Promise<void>;
2091
+ execute<T = Json>(aid: string, inputs?: Json, note?: string): Promise<T>;
2092
+ plan<T = Json>(steps: Json[]): Promise<T>;
2093
+ executions<T = Json>(aid: string): Promise<T[]>;
2094
+ }
2095
+ declare class V23AssistResource {
2096
+ private readonly t;
2097
+ constructor(t: Transport);
2098
+ list<T = Json>(opts?: {
2099
+ scope?: string;
2100
+ resource_id?: string;
2101
+ }): Promise<T[]>;
2102
+ create<T = Json>(input: Json): Promise<T>;
2103
+ delete(cid: string): Promise<void>;
2104
+ suggest<T = Json>(input: Json): Promise<T>;
2105
+ }
2106
+ declare class V23PipelineResource {
2107
+ private readonly t;
2108
+ constructor(t: Transport);
2109
+ list<T = Json>(): Promise<T[]>;
2110
+ create<T = Json>(input: Json): Promise<T>;
2111
+ update<T = Json>(pid: string, patch: Json): Promise<T>;
2112
+ delete(pid: string): Promise<void>;
2113
+ run<T = Json>(pid: string, opts?: Json): Promise<T>;
2114
+ runs<T = Json>(pid: string, limit?: number): Promise<T[]>;
2115
+ }
2116
+ declare class V23StylesBrandResource {
2117
+ private readonly t;
2118
+ constructor(t: Transport);
2119
+ get<T = Json>(): Promise<T>;
2120
+ update<T = Json>(patch: Json): Promise<T>;
2121
+ /** Unauthenticated-safe read. */
2122
+ getPublic<T = Json>(tenant?: string): Promise<T>;
2123
+ }
2124
+ declare class V23StylesResource {
2125
+ private readonly t;
2126
+ readonly brand: V23StylesBrandResource;
2127
+ constructor(t: Transport);
2128
+ get<T = Json>(): Promise<T>;
2129
+ update<T = Json>(tokens: Json, message?: string): Promise<T>;
2130
+ getRegionColors<T = Json>(): Promise<T>;
2131
+ updateRegionColors<T = Json>(patch: Json): Promise<T>;
2132
+ /** Multipart upload (the only non-JSON write in the v2x surfaces). */
2133
+ uploadLogo<T = Json>(file: Blob, filename?: string): Promise<T>;
2134
+ }
2135
+ /** `client.platformV23.*` — logic, action-types, assist, pipeline, quiver,
2136
+ * connectors, automate, health, contour, vertex, repos, object-sets, carbon, styles. */
2137
+ declare class PlatformV23Resource {
2138
+ private readonly t;
2139
+ readonly logic: V23LogicResource;
2140
+ readonly actions: V23ActionsResource;
2141
+ readonly assist: V23AssistResource;
2142
+ readonly pipeline: V23PipelineResource;
2143
+ readonly styles: V23StylesResource;
2144
+ readonly quiver: {
2145
+ list(): Promise<Json[]>;
2146
+ create(input: Json): Promise<Json>;
2147
+ delete(id: string): Promise<void>;
2148
+ update(id: string, patch: Json): Promise<Json>;
2149
+ run(id: string): Promise<Json>;
2150
+ };
2151
+ readonly connectors: {
2152
+ list(): Promise<Json[]>;
2153
+ register(input: Json): Promise<Json>;
2154
+ delete(id: string): Promise<void>;
2155
+ heartbeat(id: string, status?: string, error?: string): Promise<Json>;
2156
+ };
2157
+ readonly automate: {
2158
+ list(): Promise<Json[]>;
2159
+ create(input: Json): Promise<Json>;
2160
+ delete(id: string): Promise<void>;
2161
+ fire(id: string): Promise<Json>;
2162
+ runs(id: string): Promise<Json[]>;
2163
+ };
2164
+ readonly health: {
2165
+ list(): Promise<Json[]>;
2166
+ create(input: Json): Promise<Json>;
2167
+ delete(id: string): Promise<void>;
2168
+ run(id: string): Promise<Json>;
2169
+ };
2170
+ readonly contour: {
2171
+ list(): Promise<Json[]>;
2172
+ create(input: Json): Promise<Json>;
2173
+ delete(id: string): Promise<void>;
2174
+ evaluate(id: string, limit?: number): Promise<Json>;
2175
+ };
2176
+ readonly vertex: {
2177
+ list(): Promise<Json[]>;
2178
+ create(input: Json): Promise<Json>;
2179
+ delete(id: string): Promise<void>;
2180
+ };
2181
+ readonly repos: {
2182
+ list(): Promise<Json[]>;
2183
+ create(input: Json): Promise<Json>;
2184
+ delete(id: string): Promise<void>;
2185
+ commit(id: string, input: Json): Promise<Json>;
2186
+ commits(id: string, branch?: string): Promise<Json[]>;
2187
+ show(id: string, commitId: string): Promise<Json>;
2188
+ };
2189
+ readonly objectSets: {
2190
+ list(): Promise<Json[]>;
2191
+ create(input: Json): Promise<Json>;
2192
+ delete(id: string): Promise<void>;
2193
+ materialize(id: string, limit?: number): Promise<Json>;
2194
+ };
2195
+ constructor(t: Transport);
2196
+ carbonValidate<T = Json>(config: Json): Promise<T>;
2197
+ catalog<T = Json>(): Promise<T>;
2198
+ }
2199
+ /** `client.marketplace.*` — product storefront + install wizard (v23). */
2200
+ declare class MarketplaceResource {
2201
+ private readonly t;
2202
+ constructor(t: Transport);
2203
+ storefront<T = Json>(opts?: {
2204
+ category?: string;
2205
+ sort?: string;
2206
+ search?: string;
2207
+ tags?: string[];
2208
+ }): Promise<T[]>;
2209
+ products<T = Json>(publishedOnly?: boolean): Promise<T[]>;
2210
+ create<T = Json>(input: Json): Promise<T>;
2211
+ publish<T = Json>(pid: string): Promise<T>;
2212
+ details<T = Json>(pid: string): Promise<T>;
2213
+ ontologyImpact<T = Json>(pid: string): Promise<T>;
2214
+ installPrecheck<T = Json>(pid: string): Promise<T>;
2215
+ /** 422 with `{ok:false, gaps}` in the error payload when modules are missing. */
2216
+ install<T = Json>(pid: string, opts?: {
2217
+ confirm_text?: string;
2218
+ config?: Json;
2219
+ notes?: string;
2220
+ }): Promise<T>;
2221
+ installed<T = Json>(): Promise<T[]>;
2222
+ uninstall<T = Json>(installId: string): Promise<T>;
2223
+ /** Admin, idempotent. */
2224
+ seed<T = Json>(): Promise<T>;
2225
+ }
2226
+ /** `client.platformV24.*` — flat surface (logic functions, assist sessions,
2227
+ * views, rules, checkpoints, expectations, change requests, scenarios,
2228
+ * aggregations, object-set traversal, automations, metrics). */
2229
+ declare class PlatformV24Resource {
2230
+ private readonly t;
2231
+ constructor(t: Transport);
2232
+ createLogicFunction<T = Json>(input: Json): Promise<T>;
2233
+ listLogicFunctions<T = Json>(): Promise<T[]>;
2234
+ invokeLogicFunction<T = Json>(fnId: string, inputs: Json): Promise<T>;
2235
+ openAssistSession<T = Json>(surface: string, context?: Json): Promise<T>;
2236
+ assistTurn<T = Json>(sessionId: string, content: string): Promise<T>;
2237
+ createView<T = Json>(input: Json): Promise<T>;
2238
+ materializeView<T = Json>(viewId: string): Promise<T>;
2239
+ listTemplates<T = Json>(): Promise<T[]>;
2240
+ installTemplate<T = Json>(templateId: string, config?: Json): Promise<T>;
2241
+ createRule<T = Json>(input: Json): Promise<T>;
2242
+ evaluateRules<T = Json>(trigger: string, subject: Json): Promise<T>;
2243
+ recordCheckpoint<T = Json>(pipeline: string, step: string, opts?: {
2244
+ status?: string;
2245
+ state?: Json;
2246
+ }): Promise<T>;
2247
+ resumePipeline<T = Json>(pipeline: string): Promise<T>;
2248
+ createExpectation<T = Json>(input: Json): Promise<T>;
2249
+ runExpectation<T = Json>(expId: string): Promise<T>;
2250
+ submitChangeRequest<T = Json>(input: Json): Promise<T>;
2251
+ reviewChangeRequest<T = Json>(crId: string, status: string, note?: string): Promise<T>;
2252
+ createScenario<T = Json>(input: Json): Promise<T>;
2253
+ simulateScenario<T = Json>(scenarioId: string): Promise<T>;
2254
+ createNotebook<T = Json>(input: Json): Promise<T>;
2255
+ createAgent<T = Json>(input: Json): Promise<T>;
2256
+ createEvalDashboard<T = Json>(input: Json): Promise<T>;
2257
+ renderEvalDashboard<T = Json>(dashId: string): Promise<T>;
2258
+ addVerticalTab<T = Json>(input: Json): Promise<T>;
2259
+ createAggregation<T = Json>(input: Json): Promise<T>;
2260
+ runAggregation<T = Json>(aggId: string): Promise<T>;
2261
+ /** Multi-hop object-set traversal (gate `workshop.apps.read`). */
2262
+ searchAround<T = Json>(input: Json): Promise<T>;
2263
+ /** On-the-fly aggregation: count/sum/avg/min/max/distinct_count/cardinality. */
2264
+ aggregateObjectSet<T = Json>(input: Json): Promise<T>;
2265
+ createOsdkToken<T = Json>(name: string, scopes?: string[]): Promise<T>;
2266
+ verifyOsdkToken<T = Json>(token: string): Promise<T>;
2267
+ createAutomation<T = Json>(input: Json): Promise<T>;
2268
+ runAutomation<T = Json>(autoId: string): Promise<T>;
2269
+ computeOntologyMetrics<T = Json>(): Promise<T>;
2270
+ forkThread<T = Json>(parentSessionId: string, branchName: string, forkAtMessage?: number): Promise<T>;
2271
+ }
2272
+ /** `client.platformV25.*` — machinery processes, branch protection, kiosk
2273
+ * tokens, analyst threads, dataset rollback/snapshots/limits, freshness,
2274
+ * code scan, evals generation. */
2275
+ declare class PlatformV25Resource {
2276
+ private readonly t;
2277
+ constructor(t: Transport);
2278
+ listProcesses<T = Json>(): Promise<T[]>;
2279
+ createProcess<T = Json>(input: {
2280
+ slug: string;
2281
+ display_name: string;
2282
+ graph: Json;
2283
+ description?: string;
2284
+ markings?: string[];
2285
+ project_id?: string;
2286
+ }): Promise<T>;
2287
+ startProcessInstance<T = Json>(processId: string, opts?: {
2288
+ subject_ref?: string;
2289
+ context?: Json;
2290
+ initial_state?: string;
2291
+ }): Promise<T>;
2292
+ transitionProcessInstance<T = Json>(instanceId: string, to: string, reason?: string): Promise<T>;
2293
+ setBranchProtection<T = Json>(dataset: string, branch: string, opts?: {
2294
+ require_approvals?: number;
2295
+ required_clearances?: string[];
2296
+ required_reviewers?: string[];
2297
+ block_direct_commit?: boolean;
2298
+ }): Promise<T>;
2299
+ evaluateBranchProtection<T = Json>(dataset: string, branch: string, opts?: {
2300
+ approvals?: number;
2301
+ committer?: string;
2302
+ }): Promise<T>;
2303
+ mintKioskSession<T = Json>(appId: string, opts?: {
2304
+ display_name?: string;
2305
+ allowed_markings?: string[];
2306
+ ttl_hours?: number;
2307
+ }): Promise<T>;
2308
+ verifyKioskToken<T = Json>(token: string): Promise<T>;
2309
+ newAnalystThread<T = Json>(title?: string): Promise<T>;
2310
+ postAnalystMessage<T = Json>(threadId: string, input: {
2311
+ role: string;
2312
+ content: string;
2313
+ citations?: Json[];
2314
+ depends_on?: string[];
2315
+ kind?: string;
2316
+ }): Promise<T>;
2317
+ rollbackDataset<T = Json>(dataset: string, toAssetId: string, opts?: {
2318
+ branch?: string;
2319
+ reason?: string;
2320
+ }): Promise<T>;
2321
+ queueSnapshot<T = Json>(dataset: string, branch?: string): Promise<T>;
2322
+ peekSnapshotQueue<T = Json>(dataset: string, branch?: string): Promise<T>;
2323
+ setTransactionLimits<T = Json>(dataset: string, opts?: {
2324
+ branch?: string;
2325
+ max_rows?: number;
2326
+ max_bytes?: number;
2327
+ max_open?: number;
2328
+ }): Promise<T>;
2329
+ /** Repeated `dataset` query params. */
2330
+ checkFreshness<T = Json>(datasets: string[]): Promise<T>;
2331
+ raiseCodeScanFinding<T = Json>(input: {
2332
+ repo_ref: string;
2333
+ path: string;
2334
+ rule_id: string;
2335
+ severity: string;
2336
+ message: string;
2337
+ line?: number;
2338
+ commit_sha?: string;
2339
+ }): Promise<T>;
2340
+ codeScanSummary<T = Json>(repoRef: string): Promise<T>;
2341
+ generateEvals<T = Json>(subjectFunction: string, opts?: {
2342
+ description?: string;
2343
+ count?: number;
2344
+ }): Promise<T>;
2345
+ analyzeEvals<T = Json>(evalRunId: string, failures: Json[]): Promise<T>;
2346
+ }
2347
+ /** `client.platformV26.*` — promotions, object/core views, capacity,
2348
+ * listeners, sensitive-data scanner, monitoring, health checks, media
2349
+ * versions, insight, peers, run history. */
2350
+ declare class PlatformV26Resource {
2351
+ private readonly t;
2352
+ constructor(t: Transport);
2353
+ listPromotions<T = Json>(): Promise<T[]>;
2354
+ promoteObjectType<T = Json>(objectType: string, opts?: {
2355
+ status?: string;
2356
+ justification?: string;
2357
+ }): Promise<T>;
2358
+ listObjectViews<T = Json>(objectType?: string): Promise<T[]>;
2359
+ createObjectView<T = Json>(objectType: string, branch: string, opts?: {
2360
+ parent_branch?: string;
2361
+ view_spec?: Json;
2362
+ }): Promise<T>;
2363
+ publishObjectView<T = Json>(branchId: string): Promise<T>;
2364
+ generateCoreView<T = Json>(objectType: string, topN?: number): Promise<T>;
2365
+ getCoreView<T = Json>(objectType: string): Promise<T>;
2366
+ reserveCapacity<T = Json>(provider: string, model: string, opts?: {
2367
+ reserved_tpm?: number;
2368
+ reserved_rpm?: number;
2369
+ reason?: string;
2370
+ }): Promise<T>;
2371
+ consumeCapacity<T = Json>(provider: string, model: string, opts?: {
2372
+ tokens?: number;
2373
+ requests?: number;
2374
+ }): Promise<T>;
2375
+ /** Webhook listener — the secret is returned once. */
2376
+ createListener<T = Json>(slug: string, opts?: {
2377
+ integration?: string;
2378
+ target_ontology_type?: string;
2379
+ markings?: string[];
2380
+ }): Promise<T>;
2381
+ listenerEvents<T = Json>(listenerId: string): Promise<T[]>;
2382
+ /** mode ∈ report_only|hash|redact */
2383
+ scanSensitive<T = Json>(payload: Json, opts?: {
2384
+ mode?: string;
2385
+ scope?: string;
2386
+ scope_ref?: string;
2387
+ }): Promise<T>;
2388
+ scanHistory<T = Json>(limit?: number): Promise<T[]>;
2389
+ createMonitoringView<T = Json>(slug: string, displayName: string, opts?: {
2390
+ project_scope?: string;
2391
+ resource_kinds?: string[];
2392
+ }): Promise<T>;
2393
+ monitoringRollup<T = Json>(slug: string): Promise<T>;
2394
+ createHealthCheck<T = Json>(datasetName: string, name: string, checkType: string, spec?: Json): Promise<T>;
2395
+ runHealthCheck<T = Json>(checkId: string, branch?: string): Promise<T>;
2396
+ healthRuns<T = Json>(checkId: string, limit?: number): Promise<T[]>;
2397
+ /** Hash-referenced version metadata — no binary body. */
2398
+ uploadMediaVersion<T = Json>(mediaSet: string, path: string, input: {
2399
+ content_hash: string;
2400
+ mime_type?: string;
2401
+ size_bytes?: number;
2402
+ metadata?: Json;
2403
+ }): Promise<T>;
2404
+ mediaHistory<T = Json>(mediaSet: string, path: string): Promise<T[]>;
2405
+ createInsight<T = Json>(slug: string, input: {
2406
+ display_name: string;
2407
+ base_object_type: string;
2408
+ path: Json[];
2409
+ markings?: string[];
2410
+ project_id?: string;
2411
+ }): Promise<T>;
2412
+ executeInsight<T = Json>(analysisId: string): Promise<T>;
2413
+ createPeer<T = Json>(slug: string, displayName: string, remoteUrl: string, authToken?: string): Promise<T>;
2414
+ syncPeer<T = Json>(peerId: string, input: {
2415
+ resource_kind: string;
2416
+ remote_path: string;
2417
+ local_ref?: string;
2418
+ }): Promise<T>;
2419
+ listPeerMirrors<T = Json>(peerId: string): Promise<T[]>;
2420
+ runHistory<T = Json>(opts?: {
2421
+ status?: string;
2422
+ since?: string;
2423
+ until?: string;
2424
+ user?: string;
2425
+ action?: string;
2426
+ min_duration_ms?: number;
2427
+ failed_only?: boolean;
2428
+ limit?: number;
2429
+ }): Promise<T[]>;
2430
+ }
2431
+
433
2432
  interface AegisClientOptions {
434
2433
  /** Root URL of the AEGIS deployment, e.g. `https://aegis.example.com`.
435
2434
  * Falls back to `process.env.AEGIS_API_URL`, then `http://localhost:8002`. */
@@ -441,12 +2440,38 @@ interface AegisClientOptions {
441
2440
  timeoutMs?: number;
442
2441
  /** Custom fetch implementation (tests, proxies, polyfills). */
443
2442
  fetch?: typeof globalThis.fetch;
2443
+ /** Extra fetch init merged into every request — e.g. cookie-proxy setups
2444
+ * use `{ credentials: "include", cache: "no-store" }` with a relative
2445
+ * `baseUrl` like `/api` (the browser cookie carries the auth). */
2446
+ fetchInit?: Omit<RequestInit, "method" | "body" | "signal">;
2447
+ /** Refresh token to seed automatic JWT refresh (normally captured from
2448
+ * `auth.login`). On a 401 the client rotates it via `POST /auth/refresh`
2449
+ * and retries the request once. */
2450
+ refreshToken?: string;
2451
+ /** Retry/backoff for transient failures (network errors, timeouts, 429/
2452
+ * 502/503/504). GET/HEAD only unless `retryPost`. Exponential backoff
2453
+ * with full jitter. Pass `{ retries: 0 }` to disable. */
2454
+ retry?: RetryOptions;
2455
+ }
2456
+ interface RetryOptions {
2457
+ /** Extra attempts after the first (default 2). */
2458
+ retries?: number;
2459
+ /** First backoff delay in ms (default 250; doubles per attempt). */
2460
+ baseDelayMs?: number;
2461
+ /** Backoff ceiling in ms (default 4000). */
2462
+ maxDelayMs?: number;
2463
+ /** Also retry non-idempotent verbs (default false). */
2464
+ retryPost?: boolean;
444
2465
  }
445
2466
  declare class AegisClient implements Transport {
446
2467
  readonly baseUrl: string;
447
2468
  private _token;
448
2469
  private readonly timeoutMs;
449
- private readonly _fetch;
2470
+ private readonly _fetchOverride?;
2471
+ private readonly _fetchInit;
2472
+ private _refreshToken;
2473
+ private readonly _retry;
2474
+ private _refreshInFlight;
450
2475
  readonly auth: AuthResource;
451
2476
  readonly iam: IamResource;
452
2477
  readonly osdk: OsdkResource;
@@ -456,12 +2481,88 @@ declare class AegisClient implements Transport {
456
2481
  readonly functions: FunctionsResource;
457
2482
  readonly codeRepositories: CodeRepositoriesResource;
458
2483
  readonly datasets: DatasetsResource;
2484
+ readonly geo: GeoResource;
2485
+ readonly mapTemplates: MapTemplatesResource;
2486
+ readonly media: MediaResource;
2487
+ readonly docs: DocsResource;
2488
+ readonly pages: PagesResource;
2489
+ readonly dossier: DossierResource;
2490
+ readonly timeseries: TimeSeriesResource;
2491
+ /** Public guest-token consumer surface (`/public/v1/guest/{token}/*`). */
2492
+ readonly publicGuest: PublicGuestResource;
2493
+ readonly alerts: AlertsResource;
2494
+ readonly alarms: AlarmsResource;
2495
+ readonly events: EventsResource;
2496
+ readonly connectors: ConnectorsResource;
2497
+ readonly pipelines: PipelinesResource;
2498
+ readonly chat: ChatResource;
2499
+ readonly notepad: NotepadResource;
2500
+ readonly lineage: LineageResource;
2501
+ readonly accessAudit: AccessAuditResource;
2502
+ readonly markings: MarkingsResource;
2503
+ readonly resourceMarkings: ResourceMarkingsResource;
2504
+ readonly propertyMarkings: PropertyMarkingsResource;
2505
+ readonly rowPolicies: RowPoliciesResource;
2506
+ readonly erasure: ErasureResource;
2507
+ readonly retention: RetentionResource;
2508
+ readonly guestTokens: GuestTokensResource;
2509
+ readonly atlas: AtlasResource;
2510
+ readonly briefing: BriefingResource;
2511
+ readonly campaign: CampaignResource;
2512
+ readonly cctv: CctvResource;
2513
+ readonly comunicados: ComunicadosResource;
2514
+ readonly edge: EdgeResource;
2515
+ readonly video: VideoResource;
2516
+ readonly appShell: AppShellResource;
2517
+ readonly forms: FormsResource;
2518
+ /** Alias of `iam.groups` (mirrors Python's standalone `client.groups`). */
2519
+ readonly groups: GroupsResource;
2520
+ readonly organizations: OrganizationsResource;
2521
+ readonly projects: ProjectsResource;
2522
+ readonly solutions: SolutionsResource;
2523
+ readonly spaces: SpacesResource;
2524
+ readonly workspaces: WorkspacesResource;
2525
+ readonly workspaceUpdates: WorkspaceUpdatesResource;
2526
+ readonly marketplace: MarketplaceResource;
2527
+ readonly platformV22: PlatformV22Resource;
2528
+ readonly platformV23: PlatformV23Resource;
2529
+ readonly platformV24: PlatformV24Resource;
2530
+ readonly platformV25: PlatformV25Resource;
2531
+ readonly platformV26: PlatformV26Resource;
2532
+ readonly workshop: WorkshopResource;
2533
+ readonly compute: ComputeResource;
2534
+ readonly inference: InferenceResource;
2535
+ readonly codegen: CodegenResource;
2536
+ readonly correlation: CorrelationResource;
2537
+ readonly situational: SituationalResource;
2538
+ readonly merge: MergeResource;
459
2539
  constructor(options?: AegisClientOptions);
460
2540
  /** Replace the active bearer token (or clear with `null`). */
461
2541
  setToken(token: string | null): void;
2542
+ /** Replace the refresh token used for automatic 401 recovery. */
2543
+ setRefreshToken(token: string | null): void;
462
2544
  get token(): string | null;
463
- /** Generic escape hatch — call any AEGIS endpoint not yet wrapped. */
2545
+ private get _fetch();
2546
+ /** Generic escape hatch — call any AEGIS endpoint not yet wrapped.
2547
+ * Transient failures are retried with backoff (see `RetryOptions`);
2548
+ * a 401 triggers one transparent `POST /auth/refresh` + retry when a
2549
+ * refresh token is held. */
464
2550
  request<T = unknown>(method: string, path: string, opts?: RequestOptions): Promise<T>;
2551
+ /** Rotate the refresh token (single-flight) and attach the new pair. */
2552
+ private _refreshOnce;
2553
+ private _requestWithRetry;
2554
+ private _doRequest;
2555
+ /**
2556
+ * Open a server-sent-events endpoint and iterate its events. Long-lived:
2557
+ * no default timeout is applied — pass `signal` to cancel.
2558
+ *
2559
+ * ```ts
2560
+ * for await (const ev of client.stream("/operator/tasks/t1/events")) { … }
2561
+ * ```
2562
+ */
2563
+ stream(path: string, opts?: RequestOptions & {
2564
+ method?: string;
2565
+ }): AsyncGenerator<SseEvent, void, undefined>;
465
2566
  }
466
2567
 
467
2568
  /**
@@ -494,4 +2595,79 @@ declare class PermissionDeniedError extends AegisAPIError {
494
2595
  declare class NotFoundError extends AegisAPIError {
495
2596
  }
496
2597
 
497
- export { AegisAPIError, AegisClient, type AegisClientOptions, AuthError, type DevMode, type FunctionCreate, type Json, type LoginOptions, NotFoundError, type ObjectTypeWrite, type OperatorTaskCreate, type OperatorTaskListOptions, type OsdkToken, type OsdkTokenWithSecret, type Permission, PermissionDeniedError, type PullRequestCreate, type QueryParams, type RequestOptions, type Role, type Tenant, type TokenPair, type TransactionKind, type Transport, type User, type WhoAmI };
2598
+ /**
2599
+ * Pure client-side CBAC helpers — mirrors `aegis/classification.py`.
2600
+ * No HTTP: these validate the classification invariant before writes.
2601
+ */
2602
+ type ClassificationLevel = "PUBLICO" | "INTERNO" | "RESTRITO" | "SECRETO";
2603
+ declare const VALID_LEVELS: readonly ClassificationLevel[];
2604
+ declare const CLASSIFICATION_RANK: Readonly<Record<ClassificationLevel, number>>;
2605
+ declare const CLASSIFICATION_LABEL: Readonly<Record<ClassificationLevel, string>>;
2606
+ declare class ClassificationInvariantViolation extends Error {
2607
+ constructor(message: string);
2608
+ }
2609
+ /** Highest classification level among the given ones. */
2610
+ declare function maxLevel(levels: Iterable<string>): ClassificationLevel;
2611
+ /**
2612
+ * The file classification must dominate the data classification, and the
2613
+ * data classification must dominate every upstream input. Throws
2614
+ * `ClassificationInvariantViolation` on breach.
2615
+ */
2616
+ declare function validateInvariant(fileCls: string, dataCls: string, upstreamData?: Iterable<string>): void;
2617
+
2618
+ /**
2619
+ * IAM permission catalog — mirrors `aegis/iam/permissions.py` verbatim.
2620
+ * Pure client-side (no HTTP): lets SDK consumers reference permission keys
2621
+ * statically instead of hardcoding strings.
2622
+ */
2623
+ declare const NAV_PERMISSIONS: readonly ["nav.section.discover", "nav.item.discover.home", "nav.section.operations", "nav.item.operations.tasks", "nav.section.core_loop", "nav.item.core_loop.alerts", "nav.item.core_loop.proposals", "nav.item.core_loop.actions", "nav.section.ontology", "nav.item.ontology.manager", "nav.item.ontology.explorer", "nav.item.ontology.types", "nav.item.ontology.actions", "nav.item.ontology.interfaces", "nav.item.ontology.links", "nav.item.ontology.views", "nav.item.ontology.aggregations", "nav.item.ontology.object_sets", "nav.section.data", "nav.item.data.datasets", "nav.item.data.pipelines", "nav.item.data.connectors", "nav.item.data.media", "nav.item.data.schedules", "nav.item.data.notepad", "nav.item.data.lineage", "nav.item.data.health", "nav.section.aip", "nav.item.aip.threads", "nav.item.aip.agents", "nav.item.aip.tools", "nav.item.aip.logic", "nav.item.aip.models", "nav.item.aip.capacity", "nav.item.aip.scenarios", "nav.item.aip.evals", "nav.item.aip.memory", "nav.item.aip.mcp_adapters", "nav.section.workshop", "nav.item.workshop.apps", "nav.section.governance", "nav.item.governance.projects", "nav.item.governance.audit", "nav.item.governance.lgpd", "nav.item.governance.trace", "nav.item.governance.rules", "nav.item.governance.change_requests", "nav.item.governance.automations", "nav.item.governance.tokens", "nav.item.governance.peers", "nav.item.governance.code_scan", "nav.item.governance.kiosk", "nav.item.governance.access", "nav.item.governance.osdk", "nav.section.resources", "nav.item.resources.docs", "nav.item.resources.template_gallery", "nav.item.resources.aegis_sdk", "nav.section.other", "nav.item.other.intel_map", "nav.item.other.cognitive", "nav.item.other.map_view", "nav.section.campanha", "nav.item.campaign.hub", "nav.item.campaign.chat", "nav.item.campaign.visibility", "nav.item.campaign.agents", "nav.item.campaign.scenarios", "nav.item.campaign.brief", "nav.section.painel-de-controle", "nav.item.painel.home", "nav.item.painel.aprovacoes", "nav.item.painel.comunicacoes", "nav.item.painel.atividade"];
2624
+ declare const CAPABILITY_PERMISSIONS: readonly ["ontology.types.read", "ontology.types.write", "ontology.actions.read", "ontology.actions.write", "ontology.actions.execute", "ontology.actions.execute_external", "ontology.objects.read", "ontology.objects.write", "ontology.objects.bulk_delete", "ontology.links.read", "ontology.links.write", "solution.diagram.read", "solution.diagram.write", "solution.diagram.publish", "solution.diagram.delete", "solution.diagram.history.read", "solution.materialize.delete", "solution.refactor", "data.datasets.read", "data.datasets.write", "data.pipelines.read", "data.pipelines.write", "data.lineage.read", "data.connectors.read", "data.connectors.write", "aip.threads.read", "aip.threads.write", "aip.agents.read", "aip.agents.write", "aip.models.read", "aip.models.write", "aip.evals.read", "aip.evals.run", "aip.memory.read", "aip.memory.write", "workshop.apps.read", "workshop.apps.write", "workshop.apps.purge", "operator.tasks.read", "operator.tasks.write", "governance.audit.read", "governance.rules.read", "governance.rules.write", "governance.change_requests.read", "governance.change_requests.write", "governance.change_requests.approve", "governance.tokens.read", "governance.tokens.write", "governance.lgpd.read", "governance.lgpd.write", "governance.peers.read", "governance.peers.write", "governance.kiosk.read", "governance.kiosk.write", "admin.acessos", "admin.classificacao", "admin.auditoria", "admin.federacao", "admin.unidades", "admin.templates", "admin.automacoes", "admin.tokens", "campaign.chat.read", "campaign.chat.write", "campaign.brief.read", "campaign.brief.generate", "campaign.brief.sign", "campaign.scenario.read", "campaign.scenario.run", "campaign.scenario.write", "campaign.visibility.read", "campaign.visibility.pin", "campaign.visibility.escalate", "campaign.agents.read", "campaign.agents.write", "campaign.agents.run", "campaign.flows.read", "campaign.flows.write", "campaign.flows.run", "campaign.briefing.read", "campaign.briefing.refresh", "campaign.briefing.headline", "campaign.briefing.crisis_override", "vault.cookies.manage", "iam.users.read", "iam.users.write", "iam.roles.read", "iam.roles.write", "iam.permissions.read", "iam.permissions.write", "iam.nav.read", "iam.nav.write", "iam.audit.read", "iam.groups.read", "iam.groups.write", "iam.groups.manage_members", "docs.tree.read", "docs.content.read", "aip.flows.read", "aip.flows.write", "aip.flows.execute", "aip.agents.execute", "briefing.read", "briefing.refresh", "ontology.objects.view", "ontology.graph.read", "ontology.graph.export", "ontology.explorer.aggregate", "workshop.briefings.read", "workshop.briefings.write", "workshop.briefings.broadcast", "workshop.dossiers.read", "workshop.dossiers.write", "workshop.dossiers.share", "workshop.covs.read", "workshop.covs.write", "workshop.covs.share", "chat.channels.read", "chat.channels.write", "chat.channels.manage", "chat.messages.send", "chat.messages.read", "alerts.feeds.read", "alerts.feeds.subscribe", "alerts.watches.read", "alerts.watches.subscribe", "alerts.geofences.read", "alerts.geofences.manage", "alerts.shares.read", "alerts.read", "alerts.escalate", "alerts.routes.view", "alerts.routes.manage", "atlas.layers.read", "atlas.layers.manage", "atlas.geofences.draw", "atlas.evaluation.read", "atlas.evaluation.manage", "video.exports.create", "connectors.manage", "events.pipeline.view", "events.pipeline.manage", "situational.correlate.view", "situational.correlate.manage", "security.painel.view", "security.buscar.view", "security.geo.view", "security.geo.cerca.create", "security.cameras.view", "security.cameras.tag", "security.cameras.export", "security.cameras.manage", "security.cameras.bookmark", "security.cameras.hotlist", "security.cameras.cloud_inference", "security.explorador.view", "security.rede.view", "security.rede.edit", "security.ficha.view", "security.ficha.edit", "security.alertas.view", "security.alertas.resolve", "security.relatorios.view", "security.relatorios.edit", "security.relatorios.close", "security.briefings.view", "security.briefings.edit", "security.briefings.broadcast", "security.workshop.view", "security.workshop.edit", "security.workshop.publish_global", "security.fluxos.view", "security.fluxos.edit", "security.fluxos.run", "security.agentes.view", "security.agentes.edit", "security.agentes.run", "security.ontologia.view", "security.ontologia.edit", "security.workshop.kiosk", "security.configuracoes.view", "security.browser.manage", "painel.home.view", "painel.aprovacoes.view", "painel.aprovacoes.act", "painel.comunicacoes.view", "painel.comunicacoes.edit", "painel.atividade.view", "painel.atividade.export", "painel.favoritos.edit", "organization.read", "organization.write", "organization.invite_guest", "space.read", "space.write", "space.add_organization", "project.read", "project.write", "project.move", "project.link", "markings.read", "markings.write", "markings.apply", "markings.remove", "markings.expand_access", "markings.manage_eligibility", "classification.read", "classification.set", "classification.upgrade", "project.constraints.read", "project.constraints.configure", "project.constraints.revalidate", "workspace.read", "workspace.write", "workspace.delete", "workspace.publish", "workspace.history.read", "workspace.republish", "workspace.update.read", "workspace.update.write", "workspace.update.archive", "workspace.update.delete", "workspace.update.view", "workspace.navigation.read", "workspace.navigation.configure", "workspace.promote.read", "workspace.promote.set", "workspace.promote.unset", "workspace.kiosk.read", "workspace.kiosk.configure", "workspace.kiosk.session.start", "workspace.kiosk.session.end", "app_shell.manage", "comunicado.read", "comunicado.write", "comunicado.delete", "forms.submit", "forms.submissions.read", "vendor.dev_mode", "public.token.read", "public.token.issue", "public.token.revoke", "messaging.send", "automation.alarms.read", "automation.alarms.write", "data.media.read", "data.media.write", "function.read", "function.write", "function.invoke", "function.review", "sandbox.install", "sandbox.terminal", "llm.budget.read", "llm.budget.write", "governance.retention.read", "governance.retention.write", "rowpolicy.read", "rowpolicy.write", "compute.providers.read", "compute.providers.write", "compute.pipelines.deploy", "vision.count.execute", "ontology.objects.bulk_write"];
2625
+ type NavPermissionKey = (typeof NAV_PERMISSIONS)[number];
2626
+ type CapabilityPermissionKey = (typeof CAPABILITY_PERMISSIONS)[number];
2627
+ type PermissionKey = NavPermissionKey | CapabilityPermissionKey;
2628
+ declare const ALL_PERMISSIONS: readonly PermissionKey[];
2629
+ interface IamPermissionDef {
2630
+ key: PermissionKey;
2631
+ kind: "nav" | "capability";
2632
+ /** Key minus its last segment. */
2633
+ resource: string;
2634
+ /** Last segment of the key. */
2635
+ action: string;
2636
+ }
2637
+ declare function listPermissions(kind?: "nav" | "capability"): IamPermissionDef[];
2638
+ declare function isSystemPermission(key: string): boolean;
2639
+
2640
+ interface OsdkApplication {
2641
+ slug: string;
2642
+ display_name: string;
2643
+ description: string;
2644
+ permissions: readonly string[];
2645
+ }
2646
+ declare const APPLICATIONS: readonly OsdkApplication[];
2647
+ declare function listApplications(): readonly OsdkApplication[];
2648
+ declare function applicationBySlug(slug: string): OsdkApplication | undefined;
2649
+ declare function applicationHas(app: OsdkApplication, key: string): boolean;
2650
+ /** Throws if the application references a permission key unknown to the catalog. */
2651
+ declare function validateApplication(app: OsdkApplication): void;
2652
+
2653
+ /**
2654
+ * Adapter between `AegisClient` and the `OSDKClient` contract expected by
2655
+ * code generated from the live ontology (`aegis-osdk generate` /
2656
+ * `GET /ontology/osdk/generate?lang=typescript`):
2657
+ *
2658
+ * ```ts
2659
+ * import { AegisClient, asOsdkClient } from "aegis-platform-sdk";
2660
+ * import { CameraApi } from "./aegis_osdk"; // generated
2661
+ *
2662
+ * const osdk = asOsdkClient(new AegisClient({ ... }));
2663
+ * ```
2664
+ */
2665
+
2666
+ /** The client contract emitted at the top of every generated OSDK module. */
2667
+ interface OSDKClient {
2668
+ get(path: string, params?: Record<string, unknown>): Promise<any>;
2669
+ post(path: string, body?: unknown): Promise<any>;
2670
+ }
2671
+ declare function asOsdkClient(client: AegisClient): OSDKClient;
2672
+
2673
+ export { ALL_PERMISSIONS, APPLICATIONS, AccessAuditResource, AegisAPIError, AegisClient, type AegisClientOptions, AipResource, AlarmsResource, type AlertChannelConfigInput, AlertsResource, AppShellResource, AtlasResource, AuthError, AuthResource, BriefingResource, CAPABILITY_PERMISSIONS, CLASSIFICATION_LABEL, CLASSIFICATION_RANK, CampaignResource, type CapabilityPermissionKey, CctvResource, ChatResource, ClassificationInvariantViolation, type ClassificationLevel, CodeRepositoriesResource, CodegenResource, ComputeControlResource, ComputeResource, ComunicadosResource, ConnectorsResource, CorrelationResource, DatasetsResource, type DevMode, DocsResource, DossierResource, type EdgeNode, type EdgePoolAutomation, type EdgePoolNumber, type EdgePoolSummary, EdgeResource, ErasureResource, type ErasureSelector, EventsResource, FormsResource, type FunctionCreate, FunctionsResource, GeoResource, GroupsResource, type GuestFix, type GuestObjectSetQuery, type GuestTokenIssue, GuestTokensResource, type IamPermissionDef, IamResource, InferenceResource, type InventoryResult, type Json, LineageResource, type LoginOptions, MapTemplatesResource, MarketplaceResource, MarkingsResource, MediaResource, MergeResource, type MergeTarget, NAV_PERMISSIONS, type NavPermissionKey, NotFoundError, NotepadResource, type OSDKClient, type ObjectTypeWrite, OntologyResource, OperatorResource, type OperatorTaskCreate, type OperatorTaskListOptions, OrganizationsResource, type OsdkApplication, OsdkResource, type OsdkToken, type OsdkTokenWithSecret, PagesResource, type PairingInfo, type Permission, PermissionDeniedError, type PermissionKey, PipelinesResource, PlatformV22Resource, PlatformV23Resource, PlatformV24Resource, PlatformV25Resource, PlatformV26Resource, ProjectsResource, PropertyMarkingsResource, PublicGuestResource, type PublicGuestTransport, type PullRequestCreate, type QueryParams, type RequestOptions, ResourceMarkingsResource, RetentionResource, type RetryOptions, type Role, RowPoliciesResource, SituationalResource, type SkillCatalogRow, SolutionsResource, SpacesResource, type SseEvent, type Tenant, TimeSeriesResource, type TokenPair, type TransactionKind, type Transport, type User, VALID_LEVELS, VALID_PROJECT_ROLES, VideoResource, type WhoAmI, WorkshopResource, WorkspaceUpdatesResource, WorkspacesResource, applicationBySlug, applicationHas, asOsdkClient, isSystemPermission, listApplications, listPermissions, maxLevel, parseSseStream, validateApplication, validateInvariant };