@prismer/sdk 1.9.22 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +143 -94
- package/dist/cli.js +2006 -439
- package/dist/index.d.mts +579 -61
- package/dist/index.d.ts +579 -61
- package/dist/index.js +620 -83
- package/dist/index.mjs +615 -82
- package/package.json +4 -3
- package/smallicon +6 -0
package/dist/index.d.mts
CHANGED
|
@@ -517,6 +517,23 @@ interface IMTokenData {
|
|
|
517
517
|
token: string;
|
|
518
518
|
expiresIn: string;
|
|
519
519
|
}
|
|
520
|
+
interface IMMessageAttachment {
|
|
521
|
+
kind: 'file' | 'image' | 'audio' | 'video' | 'asset';
|
|
522
|
+
assetId: string;
|
|
523
|
+
title?: string;
|
|
524
|
+
filename?: string;
|
|
525
|
+
mime?: string | null;
|
|
526
|
+
sizeBytes?: number | null;
|
|
527
|
+
contentHash?: string | null;
|
|
528
|
+
thumbnailUrl?: string | null;
|
|
529
|
+
previewUrls?: {
|
|
530
|
+
small?: string;
|
|
531
|
+
medium?: string;
|
|
532
|
+
large?: string;
|
|
533
|
+
} | null;
|
|
534
|
+
revision?: number | null;
|
|
535
|
+
role?: 'attachment' | 'context' | 'output';
|
|
536
|
+
}
|
|
520
537
|
interface IMMessage {
|
|
521
538
|
id: string;
|
|
522
539
|
conversationId?: string;
|
|
@@ -528,6 +545,7 @@ interface IMMessage {
|
|
|
528
545
|
createdAt: string;
|
|
529
546
|
updatedAt?: string;
|
|
530
547
|
metadata?: Record<string, any> | string;
|
|
548
|
+
attachments?: IMMessageAttachment[] | null;
|
|
531
549
|
}
|
|
532
550
|
interface IMRouting {
|
|
533
551
|
mode: string;
|
|
@@ -715,6 +733,7 @@ interface IMCreateBindingOptions {
|
|
|
715
733
|
interface IMSendOptions {
|
|
716
734
|
type?: 'text' | 'markdown' | 'code' | 'image' | 'file' | 'voice' | 'location' | 'artifact' | 'tool_call' | 'tool_result' | 'system_event' | 'system' | 'thinking';
|
|
717
735
|
metadata?: Record<string, any>;
|
|
736
|
+
attachments?: IMMessageAttachment[] | null;
|
|
718
737
|
parentId?: string;
|
|
719
738
|
/** Quote-reply reference (v1.8.2). Distinct from parentId threading. */
|
|
720
739
|
quotedMessageId?: string;
|
|
@@ -732,6 +751,16 @@ interface IMConversationsOptions {
|
|
|
732
751
|
interface IMDiscoverOptions {
|
|
733
752
|
type?: string;
|
|
734
753
|
capability?: string;
|
|
754
|
+
/** Filter agents by presence status (`online`, `all`). Contacts router. */
|
|
755
|
+
status?: string;
|
|
756
|
+
/** Convenience flag for agents router compat (`onlineOnly=true`). */
|
|
757
|
+
onlineOnly?: string;
|
|
758
|
+
/** Search query (username/displayName/DID prefix). */
|
|
759
|
+
q?: string;
|
|
760
|
+
/** Pagination limit. */
|
|
761
|
+
limit?: string;
|
|
762
|
+
/** Pagination offset. */
|
|
763
|
+
offset?: string;
|
|
735
764
|
}
|
|
736
765
|
interface IMPresignOptions {
|
|
737
766
|
fileName: string;
|
|
@@ -989,6 +1018,10 @@ interface IMCreateMemoryFileOptions {
|
|
|
989
1018
|
content: string;
|
|
990
1019
|
scope?: string;
|
|
991
1020
|
ownerType?: 'user' | 'agent';
|
|
1021
|
+
/** v1.8.0 — semantic memory type (user | feedback | project | reference). */
|
|
1022
|
+
memoryType?: 'user' | 'feedback' | 'project' | 'reference';
|
|
1023
|
+
/** v1.8.0 — human-readable description shown in memory listings. */
|
|
1024
|
+
description?: string;
|
|
992
1025
|
}
|
|
993
1026
|
interface IMUpdateMemoryFileOptions {
|
|
994
1027
|
operation: 'append' | 'replace' | 'replace_section';
|
|
@@ -1066,6 +1099,8 @@ interface IMMemoryKnowledgeLinks {
|
|
|
1066
1099
|
type DerivationMode = 'generated' | 'derived' | 'imported';
|
|
1067
1100
|
interface IMRegisterKeyOptions {
|
|
1068
1101
|
publicKey: string;
|
|
1102
|
+
/** Legacy CLI compatibility. Identity keys are Ed25519; server currently ignores this field. */
|
|
1103
|
+
algorithm?: string;
|
|
1069
1104
|
derivationMode?: DerivationMode;
|
|
1070
1105
|
}
|
|
1071
1106
|
interface IMIdentityKey {
|
|
@@ -1238,6 +1273,36 @@ interface IMSkillInfo {
|
|
|
1238
1273
|
hasPackage: boolean;
|
|
1239
1274
|
fileCount: number;
|
|
1240
1275
|
}
|
|
1276
|
+
interface IMSkillSearchOptions {
|
|
1277
|
+
query?: string;
|
|
1278
|
+
category?: string;
|
|
1279
|
+
source?: string;
|
|
1280
|
+
compatibility?: string;
|
|
1281
|
+
sort?: 'newest' | 'most_installed' | 'most_starred' | 'name' | 'relevance' | 'recommended';
|
|
1282
|
+
page?: number;
|
|
1283
|
+
limit?: number;
|
|
1284
|
+
}
|
|
1285
|
+
interface IMSkillCreateInput {
|
|
1286
|
+
name: string;
|
|
1287
|
+
description: string;
|
|
1288
|
+
category: string;
|
|
1289
|
+
tags?: string[];
|
|
1290
|
+
content?: string;
|
|
1291
|
+
signals?: Array<{
|
|
1292
|
+
type: string;
|
|
1293
|
+
}>;
|
|
1294
|
+
author?: string;
|
|
1295
|
+
sourceUrl?: string;
|
|
1296
|
+
}
|
|
1297
|
+
interface IMSkillUpdateInput {
|
|
1298
|
+
name?: string;
|
|
1299
|
+
description?: string;
|
|
1300
|
+
category?: string;
|
|
1301
|
+
tags?: string[];
|
|
1302
|
+
content?: string;
|
|
1303
|
+
status?: string;
|
|
1304
|
+
geneId?: string;
|
|
1305
|
+
}
|
|
1241
1306
|
interface IMSkillInstallResult {
|
|
1242
1307
|
agentSkill: {
|
|
1243
1308
|
id: string;
|
|
@@ -1264,9 +1329,14 @@ interface IMAgentSkillRecord {
|
|
|
1264
1329
|
status: string;
|
|
1265
1330
|
version: string;
|
|
1266
1331
|
installedAt: string;
|
|
1332
|
+
installedRevision?: string | null;
|
|
1333
|
+
lastSyncedAt?: string | null;
|
|
1334
|
+
lastSyncError?: string | null;
|
|
1267
1335
|
};
|
|
1268
1336
|
skill: IMSkillInfo;
|
|
1269
1337
|
gene: IMGene | null;
|
|
1338
|
+
expectedRevision?: string | null;
|
|
1339
|
+
syncState?: 'pending' | 'synced' | 'error';
|
|
1270
1340
|
}
|
|
1271
1341
|
interface IMSkillContent {
|
|
1272
1342
|
content: string;
|
|
@@ -1277,6 +1347,25 @@ interface IMSkillContent {
|
|
|
1277
1347
|
}>;
|
|
1278
1348
|
checksum: string | null;
|
|
1279
1349
|
}
|
|
1350
|
+
interface IMAgentSkillListOptions {
|
|
1351
|
+
agentId?: string;
|
|
1352
|
+
workspaceId?: string;
|
|
1353
|
+
includeInactive?: boolean;
|
|
1354
|
+
}
|
|
1355
|
+
interface IMAgentSkillInstallOptions {
|
|
1356
|
+
workspaceId?: string;
|
|
1357
|
+
config?: Record<string, unknown>;
|
|
1358
|
+
version?: string;
|
|
1359
|
+
}
|
|
1360
|
+
interface IMAgentSkillAckInput {
|
|
1361
|
+
skillId?: string;
|
|
1362
|
+
slug?: string;
|
|
1363
|
+
revision?: string;
|
|
1364
|
+
installedRevision?: string;
|
|
1365
|
+
status?: string;
|
|
1366
|
+
error?: string | null;
|
|
1367
|
+
lastSyncError?: string | null;
|
|
1368
|
+
}
|
|
1280
1369
|
/** Internal request function type */
|
|
1281
1370
|
type RequestFn = <T>(method: string, path: string, body?: unknown, query?: Record<string, string>) => Promise<T>;
|
|
1282
1371
|
interface ExecutionContext {
|
|
@@ -1364,6 +1453,29 @@ interface IMWorkspaceSyncResult {
|
|
|
1364
1453
|
/** ISO timestamp cursor for next sync, or null when no rows returned. */
|
|
1365
1454
|
cursor: string | null;
|
|
1366
1455
|
}
|
|
1456
|
+
/**
|
|
1457
|
+
* Workspace orchestrator agent (release 200 §4 "Chief of Staff") — the single
|
|
1458
|
+
* agent per workspace authorized by the owner to perform high-trust task
|
|
1459
|
+
* actions (dispatch / approve / reject / cancel any task). Null on the GET
|
|
1460
|
+
* envelope when no active appointment exists.
|
|
1461
|
+
*/
|
|
1462
|
+
interface IMWorkspaceOrchestrator {
|
|
1463
|
+
agentImUserId: string;
|
|
1464
|
+
agentUsername: string;
|
|
1465
|
+
agentDisplayName: string;
|
|
1466
|
+
/** ISO-8601 timestamp of appointment. */
|
|
1467
|
+
authorizedAt: string;
|
|
1468
|
+
authorizedByImUserId: string;
|
|
1469
|
+
authorizedByDisplayName: string;
|
|
1470
|
+
}
|
|
1471
|
+
interface IMWorkspaceOrchestratorEnvelope {
|
|
1472
|
+
workspace: {
|
|
1473
|
+
id: string;
|
|
1474
|
+
name: string;
|
|
1475
|
+
ownerImUserId: string;
|
|
1476
|
+
};
|
|
1477
|
+
orchestrator: IMWorkspaceOrchestrator | null;
|
|
1478
|
+
}
|
|
1367
1479
|
/**
|
|
1368
1480
|
* Workspace file = path → assetId binding inside a workspace. Auto-versions
|
|
1369
1481
|
* on POST: previous binding at the same path is soft-deleted, version bumps,
|
|
@@ -1392,6 +1504,37 @@ interface IMWorkspaceFileSyncResult {
|
|
|
1392
1504
|
items: IMWorkspaceFile[];
|
|
1393
1505
|
cursor: string | null;
|
|
1394
1506
|
}
|
|
1507
|
+
type IMAssetPreviewKind = 'image' | 'pdf' | 'media' | 'text' | 'html' | 'table' | 'document' | 'code' | 'archive' | 'download-only';
|
|
1508
|
+
type IMAssetPreviewStatus = 'ready' | 'processing' | 'partial' | 'unsupported' | 'too_large' | 'failed';
|
|
1509
|
+
interface IMAssetPreviewContract {
|
|
1510
|
+
kind: IMAssetPreviewKind;
|
|
1511
|
+
status: IMAssetPreviewStatus;
|
|
1512
|
+
maxInlineBytes: number;
|
|
1513
|
+
contentLength?: number;
|
|
1514
|
+
byteRangeSupported?: boolean;
|
|
1515
|
+
preferredRenderer?: 'native' | 'monaco' | 'markdown' | 'iframe-safe-html' | 'table-sample' | 'page-viewer' | 'video-js';
|
|
1516
|
+
inlinePolicy?: 'allow' | 'sample-only' | 'metadata-only' | 'download-only';
|
|
1517
|
+
pageCount?: number;
|
|
1518
|
+
rowCountApprox?: number;
|
|
1519
|
+
sheetCount?: number;
|
|
1520
|
+
extractorVersion?: string;
|
|
1521
|
+
etag?: string;
|
|
1522
|
+
derivatives: Array<{
|
|
1523
|
+
type: 'thumbnail' | 'text' | 'html_safe' | 'table_sample' | 'schema' | 'page_text' | 'archive_listing' | 'pdf_linearized' | 'hls_manifest';
|
|
1524
|
+
assetId?: string;
|
|
1525
|
+
url?: string;
|
|
1526
|
+
endpoint?: string;
|
|
1527
|
+
metadata?: Record<string, unknown>;
|
|
1528
|
+
}>;
|
|
1529
|
+
warnings?: Array<{
|
|
1530
|
+
code: string;
|
|
1531
|
+
message: string;
|
|
1532
|
+
}>;
|
|
1533
|
+
securityWarnings?: Array<{
|
|
1534
|
+
code: string;
|
|
1535
|
+
message: string;
|
|
1536
|
+
}>;
|
|
1537
|
+
}
|
|
1395
1538
|
/**
|
|
1396
1539
|
* Asset = content-addressed immutable blob (sha256). Same hash + same workspace
|
|
1397
1540
|
* dedupes to a single row.
|
|
@@ -1410,8 +1553,41 @@ interface IMAsset {
|
|
|
1410
1553
|
sourceAgentImUserId: string | null;
|
|
1411
1554
|
sourceTaskId: string | null;
|
|
1412
1555
|
metadata: Record<string, unknown>;
|
|
1556
|
+
cdnUrl?: string | null;
|
|
1557
|
+
thumbnailUrl?: string | null;
|
|
1558
|
+
previewUrls?: {
|
|
1559
|
+
small?: string;
|
|
1560
|
+
medium?: string;
|
|
1561
|
+
large?: string;
|
|
1562
|
+
} | null;
|
|
1563
|
+
revision?: number;
|
|
1564
|
+
createdAt: string;
|
|
1565
|
+
}
|
|
1566
|
+
interface IMAssetRevision {
|
|
1567
|
+
id: string;
|
|
1568
|
+
assetId: string;
|
|
1569
|
+
workspaceId: string;
|
|
1570
|
+
revision: number;
|
|
1571
|
+
contentHash: string;
|
|
1572
|
+
sizeBytes: number | null;
|
|
1573
|
+
mime: string | null;
|
|
1574
|
+
kind: string;
|
|
1575
|
+
filename: string | null;
|
|
1576
|
+
folderPath: string | null;
|
|
1577
|
+
sourceRef: string | null;
|
|
1578
|
+
sourceKind: string | null;
|
|
1579
|
+
ingestStatus: string;
|
|
1580
|
+
ingestVersion: number;
|
|
1581
|
+
deletedAt: string | null;
|
|
1582
|
+
createdByImUserId: string | null;
|
|
1583
|
+
reason: string | null;
|
|
1413
1584
|
createdAt: string;
|
|
1414
1585
|
}
|
|
1586
|
+
interface IMAssetRevisionList {
|
|
1587
|
+
assetId: string;
|
|
1588
|
+
currentRevision: number;
|
|
1589
|
+
items: IMAssetRevision[];
|
|
1590
|
+
}
|
|
1415
1591
|
interface IMAssetListOptions {
|
|
1416
1592
|
workspaceId?: string;
|
|
1417
1593
|
taskId?: string;
|
|
@@ -1438,6 +1614,7 @@ interface IMAssetDetail extends IMAsset {
|
|
|
1438
1614
|
url?: string | null;
|
|
1439
1615
|
s3Url?: string | null;
|
|
1440
1616
|
expiresIn?: number;
|
|
1617
|
+
preview?: IMAssetPreviewContract | null;
|
|
1441
1618
|
/** Reverse-lookup of `photo-memory-segment` references when applicable. */
|
|
1442
1619
|
photoRefs?: Array<{
|
|
1443
1620
|
localId: string;
|
|
@@ -2213,32 +2390,88 @@ declare class CommunityHub {
|
|
|
2213
2390
|
}): Promise<IMResult<any>>;
|
|
2214
2391
|
}
|
|
2215
2392
|
|
|
2393
|
+
type Card = IMTask;
|
|
2394
|
+
type CardMetadata = Record<string, unknown>;
|
|
2395
|
+
type CardKanbanStatus = 'backlog' | 'todo' | 'in_progress' | 'review' | 'completed' | 'failed' | 'cancelled' | 'pending' | 'assigned' | 'running'
|
|
2396
|
+
/** Legacy v2.0 planning alias; new writers should emit `completed`. */
|
|
2397
|
+
| 'done';
|
|
2216
2398
|
/**
|
|
2217
|
-
*
|
|
2218
|
-
*
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2399
|
+
* Typed view over agreed Kanban fields stored in IMTask.metadata.
|
|
2400
|
+
* These are not separate cloud columns and do not imply a standalone Card model.
|
|
2401
|
+
*/
|
|
2402
|
+
interface CardKanbanMetadata {
|
|
2403
|
+
/** Current Kanban column. Moving a card writes this field. */
|
|
2404
|
+
columnId?: string;
|
|
2405
|
+
/** Sort weight inside a Kanban column. Fractional values support inserts. */
|
|
2406
|
+
cardOrder?: number;
|
|
2407
|
+
/** Legacy sort weight from early workspace UI builds. Accepted as input only; writers emit cardOrder. */
|
|
2408
|
+
order?: number;
|
|
2409
|
+
/** Board-level status view. New writers should prefer execution-aligned values (`completed`, not `done`). */
|
|
2410
|
+
cardStatus?: CardKanbanStatus;
|
|
2411
|
+
/** Board-level priority view, expected to mirror task priority when present. */
|
|
2412
|
+
cardPriority?: 'low' | 'medium' | 'high' | 'urgent';
|
|
2413
|
+
/** Visual labels used by Kanban clients. */
|
|
2414
|
+
cardLabels?: {
|
|
2415
|
+
color?: string;
|
|
2416
|
+
emoji?: string;
|
|
2417
|
+
tagIds?: string[];
|
|
2418
|
+
};
|
|
2419
|
+
}
|
|
2420
|
+
interface CardCreateInput {
|
|
2421
|
+
title: string;
|
|
2422
|
+
description?: string;
|
|
2423
|
+
assigneeId?: string;
|
|
2424
|
+
dueDate?: Date;
|
|
2425
|
+
tags?: string[];
|
|
2426
|
+
kanban: CardKanbanMetadata;
|
|
2427
|
+
}
|
|
2428
|
+
interface CardFilters {
|
|
2429
|
+
columnId?: string;
|
|
2430
|
+
cardStatus?: CardKanbanMetadata['cardStatus'];
|
|
2431
|
+
assigneeId?: string;
|
|
2432
|
+
tags?: string[];
|
|
2433
|
+
}
|
|
2434
|
+
interface CardMove {
|
|
2435
|
+
cardId: string;
|
|
2436
|
+
toColumnId: string;
|
|
2437
|
+
position?: number;
|
|
2438
|
+
}
|
|
2439
|
+
type CardKanbanMetadataSource = CardMetadata | {
|
|
2440
|
+
metadata?: CardMetadata | null;
|
|
2441
|
+
} | null | undefined;
|
|
2442
|
+
/**
|
|
2443
|
+
* Read the public Kanban view from card/task metadata.
|
|
2227
2444
|
*
|
|
2228
|
-
*
|
|
2229
|
-
*
|
|
2230
|
-
*
|
|
2445
|
+
* Accepts both flat `metadata.cardOrder` and legacy `metadata.order`, with
|
|
2446
|
+
* `cardOrder` winning when both are present. Legacy nested
|
|
2447
|
+
* `metadata.kanban` is also accepted and merged over the flat metadata.
|
|
2448
|
+
*/
|
|
2449
|
+
declare function readCardKanbanMetadata(source: CardKanbanMetadataSource): CardKanbanMetadata;
|
|
2450
|
+
/**
|
|
2451
|
+
* Return task metadata with a canonical public Kanban view.
|
|
2231
2452
|
*
|
|
2232
|
-
*
|
|
2233
|
-
*
|
|
2234
|
-
*
|
|
2235
|
-
* ✅ task.dispatch.request / .progress / .reply
|
|
2236
|
-
* ✅ task.cancel
|
|
2237
|
-
* ✅ agent.changed
|
|
2238
|
-
* ✅ workspace.changed
|
|
2239
|
-
* ✅ agent_profile.changed
|
|
2240
|
-
* ✅ workspace_file.changed
|
|
2453
|
+
* Existing non-Kanban metadata is preserved. Legacy `order` is removed from
|
|
2454
|
+
* both flat metadata and nested `metadata.kanban`; the canonical output uses
|
|
2455
|
+
* `cardOrder` only.
|
|
2241
2456
|
*/
|
|
2457
|
+
declare function writeCardKanbanMetadata(metadata: CardMetadata | null | undefined, kanban: CardKanbanMetadata): CardMetadata;
|
|
2458
|
+
|
|
2459
|
+
declare const WORKSPACE_ASSETS_ROUTE: "/api/im/assets";
|
|
2460
|
+
type WorkspaceAssetRoute = typeof WORKSPACE_ASSETS_ROUTE;
|
|
2461
|
+
type WorkspaceAssetFilters = IMAssetListOptions;
|
|
2462
|
+
interface WorkspaceAssetUploadInput extends Omit<IMAssetUploadOptions, 'workspaceId'> {
|
|
2463
|
+
workspaceId: string;
|
|
2464
|
+
file: FileInput;
|
|
2465
|
+
}
|
|
2466
|
+
interface WorkspaceAssetsApiContract {
|
|
2467
|
+
readonly route: WorkspaceAssetRoute;
|
|
2468
|
+
uploadAsset(input: WorkspaceAssetUploadInput): Promise<IMAsset>;
|
|
2469
|
+
getAsset(id: string): Promise<IMAsset | null>;
|
|
2470
|
+
listAssets(workspaceId: string, filters?: WorkspaceAssetFilters): Promise<IMAsset[]>;
|
|
2471
|
+
deleteAsset(id: string): Promise<void>;
|
|
2472
|
+
getAssetUrl(id: string): Promise<string>;
|
|
2473
|
+
}
|
|
2474
|
+
|
|
2242
2475
|
/** Subset of the cloud-side AgentStatus enum used by status-change events. */
|
|
2243
2476
|
type IMAgentStatus = 'online' | 'busy' | 'idle' | 'offline';
|
|
2244
2477
|
interface HostedAgentDeclaration {
|
|
@@ -2265,6 +2498,9 @@ interface HostAckedPayload {
|
|
|
2265
2498
|
[key: string]: number;
|
|
2266
2499
|
};
|
|
2267
2500
|
profilesToSync: string[];
|
|
2501
|
+
/** Profile IDs the daemon declared but that no longer exist on the cloud
|
|
2502
|
+
* (soft-deleted). The daemon should remove these from its local store. */
|
|
2503
|
+
profilesToDelete: string[];
|
|
2268
2504
|
}
|
|
2269
2505
|
interface AgentStatusChangedPayload {
|
|
2270
2506
|
agentImUserId: string;
|
|
@@ -2277,17 +2513,57 @@ interface TaskDispatchContextEntry {
|
|
|
2277
2513
|
senderRole: 'human' | 'agent' | 'admin' | 'system';
|
|
2278
2514
|
content: string;
|
|
2279
2515
|
createdAt: string;
|
|
2516
|
+
/** Wave-8 W1: assets the human attached to THIS chat message. */
|
|
2517
|
+
attachedAssetIds?: string[];
|
|
2518
|
+
}
|
|
2519
|
+
/** Wave-8 W1: hydrated asset reference attached to a dispatch. */
|
|
2520
|
+
interface AssetRef {
|
|
2521
|
+
assetId: string;
|
|
2522
|
+
contentHash: string;
|
|
2523
|
+
mime: string | null;
|
|
2524
|
+
sizeBytes: number | null;
|
|
2525
|
+
kind: string;
|
|
2526
|
+
workspaceId: string;
|
|
2527
|
+
role: 'attachment' | 'context';
|
|
2280
2528
|
}
|
|
2281
2529
|
interface TaskDispatchRequestPayload {
|
|
2282
2530
|
taskId: string;
|
|
2283
|
-
|
|
2531
|
+
/** Agent target for runtimeRoute='agent'. Shell dispatches do not use this. */
|
|
2532
|
+
agentImUserId?: string;
|
|
2533
|
+
/** Runtime/device target for runtimeRoute='shell'. */
|
|
2534
|
+
targetDaemonId?: string;
|
|
2284
2535
|
profileId: string;
|
|
2285
2536
|
capability: string;
|
|
2286
2537
|
prompt: string;
|
|
2538
|
+
/** Execution surface. `shell` is daemon-local command execution. */
|
|
2539
|
+
runtimeRoute?: 'agent' | 'sandbox' | 'shell';
|
|
2287
2540
|
metadata?: Record<string, unknown>;
|
|
2288
2541
|
timeoutMs?: number;
|
|
2289
2542
|
context?: TaskDispatchContextEntry[];
|
|
2290
2543
|
conversationId?: string;
|
|
2544
|
+
/**
|
|
2545
|
+
* Channel mode for the originating conversation. Optional and
|
|
2546
|
+
* forward-compatible: when missing, daemon renders 'unknown' in the
|
|
2547
|
+
* [Channel context] prompt block.
|
|
2548
|
+
* - `direct`: 1:1 DM (no @-mention needed in reply).
|
|
2549
|
+
* - `group`: multi-party room (end reply with `@<recipient>` to
|
|
2550
|
+
* continue the chain).
|
|
2551
|
+
*/
|
|
2552
|
+
conversationType?: 'direct' | 'group';
|
|
2553
|
+
/**
|
|
2554
|
+
* Active participants of the dispatch's conversation. Daemon injects this
|
|
2555
|
+
* into [Channel context] so the agent knows the authoritative recipient list
|
|
2556
|
+
* without hallucinating. Capped at 50 entries server-side.
|
|
2557
|
+
*/
|
|
2558
|
+
participants?: Array<{
|
|
2559
|
+
imUserId: string;
|
|
2560
|
+
username: string;
|
|
2561
|
+
displayName: string;
|
|
2562
|
+
role: string;
|
|
2563
|
+
agentType?: string | null;
|
|
2564
|
+
}>;
|
|
2565
|
+
/** Wave-8 W1: assets cloud wants daemon to fold into agent context. */
|
|
2566
|
+
assetRefs?: AssetRef[];
|
|
2291
2567
|
}
|
|
2292
2568
|
interface TaskDispatchProgressPayload {
|
|
2293
2569
|
taskId: string;
|
|
@@ -2295,6 +2571,17 @@ interface TaskDispatchProgressPayload {
|
|
|
2295
2571
|
message?: string;
|
|
2296
2572
|
detail?: Record<string, unknown>;
|
|
2297
2573
|
}
|
|
2574
|
+
/** Wave-8 W1: how the daemon handled a single AssetRef. */
|
|
2575
|
+
type AssetDispatchStrategy = 'inline-text' | 'inline-text-truncated' | 'uri-only' | 'error';
|
|
2576
|
+
interface AssetDispatchObservation {
|
|
2577
|
+
assetId: string;
|
|
2578
|
+
contentHash: string;
|
|
2579
|
+
mime: string | null;
|
|
2580
|
+
sizeBytes: number | null;
|
|
2581
|
+
strategy: AssetDispatchStrategy;
|
|
2582
|
+
inlinedBytes?: number;
|
|
2583
|
+
error?: string;
|
|
2584
|
+
}
|
|
2298
2585
|
interface TaskDispatchReplyPayload {
|
|
2299
2586
|
taskId: string;
|
|
2300
2587
|
ok: boolean;
|
|
@@ -2308,13 +2595,15 @@ interface TaskDispatchReplyPayload {
|
|
|
2308
2595
|
tokensUsed?: number;
|
|
2309
2596
|
durationMs?: number;
|
|
2310
2597
|
};
|
|
2598
|
+
/** Wave-8 W1: per-asset handling report. */
|
|
2599
|
+
assetObservability?: AssetDispatchObservation[];
|
|
2311
2600
|
}
|
|
2312
2601
|
interface TaskCancelPayload {
|
|
2313
2602
|
taskId: string;
|
|
2314
2603
|
reason?: string;
|
|
2315
2604
|
}
|
|
2316
2605
|
/**
|
|
2317
|
-
* Wire envelope for
|
|
2606
|
+
* Wire envelope for v2.0 WS events. `timestamp` is required (mirrors the
|
|
2318
2607
|
* cloud-side `WSMessage<T>` definition in src/im/types/index.ts).
|
|
2319
2608
|
*/
|
|
2320
2609
|
interface IMWSMessage<T = unknown> {
|
|
@@ -2347,6 +2636,14 @@ interface WorkspaceFileChangedPayload {
|
|
|
2347
2636
|
contentHash?: string;
|
|
2348
2637
|
version: number;
|
|
2349
2638
|
}
|
|
2639
|
+
interface AssetChangedPayload {
|
|
2640
|
+
workspaceId: string;
|
|
2641
|
+
assetId: string;
|
|
2642
|
+
operation: 'create' | 'update' | 'delete';
|
|
2643
|
+
contentHash?: string;
|
|
2644
|
+
assetIndexSeq?: number;
|
|
2645
|
+
revision?: number;
|
|
2646
|
+
}
|
|
2350
2647
|
|
|
2351
2648
|
/**
|
|
2352
2649
|
* Prismer SDK — Multi-Tab Coordination
|
|
@@ -2695,18 +2992,28 @@ declare function createEnrichedExtractor(config: SignalEnrichmentConfig): (ctx:
|
|
|
2695
2992
|
|
|
2696
2993
|
/** Minimal interface for the evolution client — avoids circular import */
|
|
2697
2994
|
interface EvolutionClientLike {
|
|
2698
|
-
getSyncSnapshot(since?: number): Promise<
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2995
|
+
getSyncSnapshot(since?: number): Promise<IMResult<EvolutionSyncSnapshot>>;
|
|
2996
|
+
analyze(options: IMAnalyzeOptions & {
|
|
2997
|
+
scope?: string;
|
|
2998
|
+
}): Promise<IMResult<IMAnalyzeResult>>;
|
|
2999
|
+
record(options: IMRecordOutcomeOptions & {
|
|
3000
|
+
scope?: string;
|
|
3001
|
+
}): Promise<IMResult<unknown>>;
|
|
3002
|
+
sync(options: {
|
|
3003
|
+
pushOutcomes?: IMRecordOutcomeOptions[];
|
|
3004
|
+
pullSince?: number;
|
|
3005
|
+
push?: {
|
|
3006
|
+
outcomes?: IMRecordOutcomeOptions[];
|
|
3007
|
+
scope?: string;
|
|
3008
|
+
};
|
|
3009
|
+
pull?: {
|
|
3010
|
+
since?: number;
|
|
3011
|
+
scope?: string;
|
|
3012
|
+
};
|
|
3013
|
+
scope?: string;
|
|
3014
|
+
}): Promise<IMResult<{
|
|
3015
|
+
pulled?: EvolutionSyncDelta['pulled'];
|
|
3016
|
+
}>>;
|
|
2710
3017
|
}
|
|
2711
3018
|
interface EvolutionRuntimeConfig {
|
|
2712
3019
|
/** Sync interval in ms (default: 60000 = 1 min) */
|
|
@@ -2719,6 +3026,19 @@ interface EvolutionRuntimeConfig {
|
|
|
2719
3026
|
outboxMaxSize?: number;
|
|
2720
3027
|
/** Outbox flush interval in ms (default: 5000) */
|
|
2721
3028
|
outboxFlushMs?: number;
|
|
3029
|
+
/**
|
|
3030
|
+
* Max attempts per outbox entry before it is moved to the dead-letter array
|
|
3031
|
+
* and a `console.warn` fires (default: 5). Use `Infinity` for unbounded
|
|
3032
|
+
* retries (legacy behaviour).
|
|
3033
|
+
*/
|
|
3034
|
+
outboxMaxAttempts?: number;
|
|
3035
|
+
}
|
|
3036
|
+
/** Entry shape exposed via `evolutionRuntime.deadLetter`. */
|
|
3037
|
+
interface DeadLetterEntry extends OutboxEntry {
|
|
3038
|
+
/** Last error message observed while trying to flush this entry. */
|
|
3039
|
+
lastError?: string;
|
|
3040
|
+
/** Timestamp at which the entry was moved to the dead-letter array. */
|
|
3041
|
+
droppedAt: number;
|
|
2722
3042
|
}
|
|
2723
3043
|
interface Suggestion {
|
|
2724
3044
|
action: 'apply_gene' | 'create_suggested' | 'none';
|
|
@@ -2735,6 +3055,18 @@ interface Suggestion {
|
|
|
2735
3055
|
title?: string;
|
|
2736
3056
|
}>;
|
|
2737
3057
|
}
|
|
3058
|
+
interface OutboxEntry {
|
|
3059
|
+
geneId: string;
|
|
3060
|
+
signals: SignalTag[];
|
|
3061
|
+
outcome: 'success' | 'failed';
|
|
3062
|
+
summary: string;
|
|
3063
|
+
score?: number;
|
|
3064
|
+
metadata?: Record<string, any>;
|
|
3065
|
+
timestamp: number;
|
|
3066
|
+
sessionId?: string;
|
|
3067
|
+
/** Number of times this entry has been pushed to the server and failed. */
|
|
3068
|
+
attempts?: number;
|
|
3069
|
+
}
|
|
2738
3070
|
/** Tracks a single suggest→learned cycle within a task. */
|
|
2739
3071
|
interface EvolutionSession {
|
|
2740
3072
|
/** Unique session ID */
|
|
@@ -2786,6 +3118,8 @@ declare class EvolutionRuntime {
|
|
|
2786
3118
|
private cache;
|
|
2787
3119
|
private enricher;
|
|
2788
3120
|
private outbox;
|
|
3121
|
+
/** Entries that exceeded `outboxMaxAttempts`. Public-readable for tests/ops. */
|
|
3122
|
+
readonly deadLetter: DeadLetterEntry[];
|
|
2789
3123
|
private syncTimer?;
|
|
2790
3124
|
private flushTimer?;
|
|
2791
3125
|
private lastSuggestedGeneId?;
|
|
@@ -2826,8 +3160,19 @@ declare class EvolutionRuntime {
|
|
|
2826
3160
|
resetMetrics(): void;
|
|
2827
3161
|
/** Sync cache with server */
|
|
2828
3162
|
private sync;
|
|
2829
|
-
/**
|
|
3163
|
+
/**
|
|
3164
|
+
* Flush outbox to server. Fire-and-forget contract: never blocks the caller's
|
|
3165
|
+
* critical path and never throws. Failed entries are retried until they hit
|
|
3166
|
+
* `outboxMaxAttempts`, then moved to `deadLetter` and reported via
|
|
3167
|
+
* `console.warn` so ops can detect a persistent failure.
|
|
3168
|
+
*/
|
|
2830
3169
|
private flush;
|
|
3170
|
+
/**
|
|
3171
|
+
* Bump the attempt counter and either re-queue (under ceiling) or move to
|
|
3172
|
+
* dead-letter. Always synchronous — caller's `flush()` already wraps in a
|
|
3173
|
+
* promise.allSettled.
|
|
3174
|
+
*/
|
|
3175
|
+
private _handleOutboxFailure;
|
|
2831
3176
|
}
|
|
2832
3177
|
|
|
2833
3178
|
/**
|
|
@@ -3188,6 +3533,37 @@ declare class TasksClient {
|
|
|
3188
3533
|
reject(taskId: string, reason: string): Promise<IMResult<IMTask>>;
|
|
3189
3534
|
/** Cancel a task */
|
|
3190
3535
|
cancel(taskId: string): Promise<IMResult<IMTask>>;
|
|
3536
|
+
/**
|
|
3537
|
+
* v2.0 release 200 §6.1 — unified state-machine transition.
|
|
3538
|
+
*
|
|
3539
|
+
* Drives every kanban / approve / reject / cancel / blocked / retry /
|
|
3540
|
+
* restore action through one endpoint. The 5 legacy endpoints
|
|
3541
|
+
* (start/complete/approve/reject/cancel) remain for backward
|
|
3542
|
+
* compatibility but new integrations should prefer this entrypoint.
|
|
3543
|
+
*
|
|
3544
|
+
* Server responds 409 (`code: 'invalid-transition'`) if the requested
|
|
3545
|
+
* `to` is not in the TRANSITIONS matrix from the current status, or
|
|
3546
|
+
* 403 (`code: 'forbidden'`) if the actor's tier is not in the rule's
|
|
3547
|
+
* `allowedActors`.
|
|
3548
|
+
*/
|
|
3549
|
+
transition(taskId: string, options: {
|
|
3550
|
+
to: 'pending' | 'assigned' | 'running' | 'review' | 'blocked' | 'failed' | 'completed' | 'cancelled';
|
|
3551
|
+
assigneeId?: string | null;
|
|
3552
|
+
position?: number;
|
|
3553
|
+
reason?: string;
|
|
3554
|
+
reviewComment?: string;
|
|
3555
|
+
}): Promise<IMResult<IMTask>>;
|
|
3556
|
+
/**
|
|
3557
|
+
* v2.0 release 200 §5.3 — admin escape-hatch.
|
|
3558
|
+
*
|
|
3559
|
+
* Bypasses the TRANSITIONS matrix. Restricted to workspace owner /
|
|
3560
|
+
* admin / trustTier>=4. Reason is required; the call is audit-logged
|
|
3561
|
+
* with `force_transition: true`. UI does NOT expose this — ops only.
|
|
3562
|
+
*/
|
|
3563
|
+
forceTransition(taskId: string, options: {
|
|
3564
|
+
to: 'pending' | 'assigned' | 'running' | 'review' | 'blocked' | 'failed' | 'completed' | 'cancelled';
|
|
3565
|
+
reason: string;
|
|
3566
|
+
}): Promise<IMResult<IMTask>>;
|
|
3191
3567
|
}
|
|
3192
3568
|
/** Memory management: files, compaction, session load */
|
|
3193
3569
|
declare class MemoryClient {
|
|
@@ -3269,9 +3645,76 @@ declare class SecurityClient {
|
|
|
3269
3645
|
/** Revoke a key for a specific user in a conversation */
|
|
3270
3646
|
revokeKey(conversationId: string, keyUserId: string): Promise<IMResult<any>>;
|
|
3271
3647
|
}
|
|
3648
|
+
/** Skill catalog and agent installation lifecycle. Kept under Evolution for v2.0 compatibility. */
|
|
3649
|
+
declare class EvolutionSkillsClient {
|
|
3650
|
+
private _r;
|
|
3651
|
+
constructor(_r: RequestFn);
|
|
3652
|
+
/** List the skill catalog. Alias of search() for the v2.0 public surface. */
|
|
3653
|
+
list(options?: IMSkillSearchOptions): Promise<IMResult<IMSkillInfo[]>>;
|
|
3654
|
+
/** Browse and search the skill catalog. */
|
|
3655
|
+
search(options?: IMSkillSearchOptions): Promise<IMResult<IMSkillInfo[]>>;
|
|
3656
|
+
/** Get skill catalog stats. */
|
|
3657
|
+
stats(): Promise<IMResult<any>>;
|
|
3658
|
+
/** List available skill categories. */
|
|
3659
|
+
categories(): Promise<IMResult<Array<{
|
|
3660
|
+
category: string;
|
|
3661
|
+
count: number;
|
|
3662
|
+
}>>>;
|
|
3663
|
+
/** List trending skills. */
|
|
3664
|
+
trending(limit?: number): Promise<IMResult<IMSkillInfo[]>>;
|
|
3665
|
+
/** List skills created by the authenticated agent. */
|
|
3666
|
+
created(): Promise<IMResult<IMSkillInfo[]>>;
|
|
3667
|
+
/** Get skill detail by slug or ID. */
|
|
3668
|
+
get(slugOrId: string): Promise<IMResult<IMSkillInfo & {
|
|
3669
|
+
content?: string;
|
|
3670
|
+
metadata?: Record<string, unknown>;
|
|
3671
|
+
}>>;
|
|
3672
|
+
/** Get full SKILL.md content and package metadata. */
|
|
3673
|
+
content(slugOrId: string): Promise<IMResult<IMSkillContent>>;
|
|
3674
|
+
/** Create/submit a workspace or community skill. */
|
|
3675
|
+
create(input: IMSkillCreateInput): Promise<IMResult<IMSkillInfo & {
|
|
3676
|
+
content?: string;
|
|
3677
|
+
}>>;
|
|
3678
|
+
/** Update a skill. */
|
|
3679
|
+
update(skillId: string, input: IMSkillUpdateInput): Promise<IMResult<IMSkillInfo & {
|
|
3680
|
+
content?: string;
|
|
3681
|
+
}>>;
|
|
3682
|
+
/** Soft-delete/deprecate a skill. */
|
|
3683
|
+
delete(skillId: string): Promise<IMResult<void>>;
|
|
3684
|
+
/** Install a skill for the authenticated agent. */
|
|
3685
|
+
install(slugOrId: string, scope?: string): Promise<IMResult<IMSkillInstallResult>>;
|
|
3686
|
+
/** Uninstall a skill for the authenticated agent. */
|
|
3687
|
+
uninstall(slugOrId: string, scope?: string): Promise<IMResult<{
|
|
3688
|
+
uninstalled: boolean;
|
|
3689
|
+
}>>;
|
|
3690
|
+
/**
|
|
3691
|
+
* List installed skills. When agentId is supplied, this uses the v2.0 Layer 5
|
|
3692
|
+
* route and includes daemon sync state; otherwise it keeps the legacy current-agent route.
|
|
3693
|
+
*/
|
|
3694
|
+
installed(options?: IMAgentSkillListOptions): Promise<IMResult<IMAgentSkillRecord[]>>;
|
|
3695
|
+
/** Install a skill to a specific agent. */
|
|
3696
|
+
installForAgent(agentId: string, skillIdOrSlug: string, options?: IMAgentSkillInstallOptions): Promise<IMResult<IMSkillInstallResult>>;
|
|
3697
|
+
/** Disable/uninstall a skill from a specific agent. Built-ins are disabled cloud-side. */
|
|
3698
|
+
uninstallFromAgent(agentId: string, skillIdOrSlug: string, options?: {
|
|
3699
|
+
workspaceId?: string;
|
|
3700
|
+
}): Promise<IMResult<{
|
|
3701
|
+
changed: boolean;
|
|
3702
|
+
status: string;
|
|
3703
|
+
builtIn?: boolean;
|
|
3704
|
+
}>>;
|
|
3705
|
+
/** List skills whose daemon sync state is not current. */
|
|
3706
|
+
pending(agentId: string, workspaceId?: string): Promise<IMResult<IMAgentSkillRecord[]>>;
|
|
3707
|
+
/** Acknowledge daemon sync for an installed skill. */
|
|
3708
|
+
ack(agentId: string, input: IMAgentSkillAckInput): Promise<IMResult<IMAgentSkillRecord>>;
|
|
3709
|
+
/** Star a skill. */
|
|
3710
|
+
star(skillId: string): Promise<IMResult<{
|
|
3711
|
+
stars?: number;
|
|
3712
|
+
}>>;
|
|
3713
|
+
}
|
|
3272
3714
|
/** Skill Evolution: gene management, analysis, recording, distillation */
|
|
3273
3715
|
declare class EvolutionClient {
|
|
3274
3716
|
private _r;
|
|
3717
|
+
readonly skills: EvolutionSkillsClient;
|
|
3275
3718
|
constructor(_r: RequestFn);
|
|
3276
3719
|
/** Get evolution stats */
|
|
3277
3720
|
getStats(): Promise<IMResult<IMEvolutionStats>>;
|
|
@@ -3420,38 +3863,26 @@ declare class EvolutionClient {
|
|
|
3420
3863
|
hypergraph: any;
|
|
3421
3864
|
}>>;
|
|
3422
3865
|
/** Search skills catalog */
|
|
3423
|
-
searchSkills(options?:
|
|
3424
|
-
query?: string;
|
|
3425
|
-
category?: string;
|
|
3426
|
-
limit?: number;
|
|
3427
|
-
}): Promise<IMResult<any[]>>;
|
|
3866
|
+
searchSkills(options?: IMSkillSearchOptions): Promise<IMResult<IMSkillInfo[]>>;
|
|
3428
3867
|
/** Get skill catalog stats */
|
|
3429
3868
|
getSkillStats(): Promise<IMResult<any>>;
|
|
3430
3869
|
/** Install a skill — creates Gene + returns content + install guide */
|
|
3431
3870
|
installSkill(slugOrId: string, scope?: string): Promise<IMResult<IMSkillInstallResult>>;
|
|
3432
3871
|
/** Uninstall a skill */
|
|
3433
|
-
uninstallSkill(slugOrId: string): Promise<IMResult<{
|
|
3872
|
+
uninstallSkill(slugOrId: string, scope?: string): Promise<IMResult<{
|
|
3434
3873
|
uninstalled: boolean;
|
|
3435
3874
|
}>>;
|
|
3436
3875
|
/** List installed skills for this agent */
|
|
3437
|
-
installedSkills(): Promise<IMResult<IMAgentSkillRecord[]>>;
|
|
3876
|
+
installedSkills(options?: IMAgentSkillListOptions): Promise<IMResult<IMAgentSkillRecord[]>>;
|
|
3438
3877
|
/** Get full skill content (SKILL.md + package info) */
|
|
3439
3878
|
getSkillContent(slugOrId: string): Promise<IMResult<IMSkillContent>>;
|
|
3440
3879
|
/** Create/submit a community skill */
|
|
3441
|
-
createSkill(input: {
|
|
3442
|
-
name: string;
|
|
3443
|
-
description: string;
|
|
3444
|
-
category: string;
|
|
3445
|
-
tags?: string[];
|
|
3880
|
+
createSkill(input: IMSkillCreateInput): Promise<IMResult<IMSkillInfo & {
|
|
3446
3881
|
content?: string;
|
|
3447
|
-
|
|
3448
|
-
type: string;
|
|
3449
|
-
}>;
|
|
3450
|
-
author?: string;
|
|
3451
|
-
}): Promise<IMResult<any>>;
|
|
3882
|
+
}>>;
|
|
3452
3883
|
/** Star a skill (increment community rating) */
|
|
3453
3884
|
starSkill(skillId: string): Promise<IMResult<{
|
|
3454
|
-
stars
|
|
3885
|
+
stars?: number;
|
|
3455
3886
|
}>>;
|
|
3456
3887
|
/**
|
|
3457
3888
|
* Install a skill and write SKILL.md to local filesystem.
|
|
@@ -3507,11 +3938,39 @@ declare class EvolutionClient {
|
|
|
3507
3938
|
getAchievements(): Promise<IMResult<any[]>>;
|
|
3508
3939
|
/** Get a sync snapshot (global gene/edge state since a sequence number) */
|
|
3509
3940
|
getSyncSnapshot(since?: number): Promise<IMResult<any>>;
|
|
3510
|
-
/**
|
|
3941
|
+
/**
|
|
3942
|
+
* Bidirectional sync: push local outcomes and pull remote updates.
|
|
3943
|
+
*
|
|
3944
|
+
* Accepts either the flat shape (`pushOutcomes` / `pullSince`) used by older
|
|
3945
|
+
* callers or the nested shape (`push` / `pull`) that mirrors the wire format
|
|
3946
|
+
* expected by `POST /api/im/evolution/sync`. The nested shape is preferred for
|
|
3947
|
+
* new code because it lets you pin a scope per-side.
|
|
3948
|
+
*/
|
|
3511
3949
|
sync(options?: {
|
|
3512
|
-
pushOutcomes?:
|
|
3950
|
+
pushOutcomes?: IMRecordOutcomeOptions[];
|
|
3513
3951
|
pullSince?: number;
|
|
3514
|
-
|
|
3952
|
+
push?: {
|
|
3953
|
+
outcomes?: IMRecordOutcomeOptions[];
|
|
3954
|
+
scope?: string;
|
|
3955
|
+
workspaceId?: string;
|
|
3956
|
+
};
|
|
3957
|
+
pull?: {
|
|
3958
|
+
since?: number;
|
|
3959
|
+
scope?: string;
|
|
3960
|
+
};
|
|
3961
|
+
scope?: string;
|
|
3962
|
+
}): Promise<IMResult<{
|
|
3963
|
+
accepted?: number;
|
|
3964
|
+
rejected?: string[];
|
|
3965
|
+
pulled?: {
|
|
3966
|
+
genes?: IMGene[];
|
|
3967
|
+
edges?: IMEvolutionEdge[];
|
|
3968
|
+
cursor?: number;
|
|
3969
|
+
};
|
|
3970
|
+
promotions?: string[];
|
|
3971
|
+
quarantines?: string[];
|
|
3972
|
+
priorAgg?: unknown;
|
|
3973
|
+
}>>;
|
|
3515
3974
|
}
|
|
3516
3975
|
|
|
3517
3976
|
/** Sanitize a slug/id to prevent path traversal (removes slashes, .., and null bytes) */
|
|
@@ -3548,6 +4007,22 @@ declare class WorkspacesClient {
|
|
|
3548
4007
|
* Provided for forward-compat; will become real in 1.10+.
|
|
3549
4008
|
*/
|
|
3550
4009
|
archive(workspaceId: string): Promise<IMResult<void>>;
|
|
4010
|
+
/**
|
|
4011
|
+
* Get the workspace's orchestrator agent (Chief of Staff) — readable by any
|
|
4012
|
+
* member. Returns `{ workspace, orchestrator: null }` when no active
|
|
4013
|
+
* appointment exists. See release 200 §4.
|
|
4014
|
+
*/
|
|
4015
|
+
getOrchestrator(workspaceId: string): Promise<IMResult<IMWorkspaceOrchestratorEnvelope>>;
|
|
4016
|
+
/**
|
|
4017
|
+
* Appoint an agent as the workspace's orchestrator. Owner-only. If an
|
|
4018
|
+
* orchestrator is already active, this auto-revokes the previous one in the
|
|
4019
|
+
* same UPDATE.
|
|
4020
|
+
*/
|
|
4021
|
+
appointOrchestrator(workspaceId: string, agentImUserId: string): Promise<IMResult<{
|
|
4022
|
+
orchestrator: IMWorkspaceOrchestrator | null;
|
|
4023
|
+
}>>;
|
|
4024
|
+
/** Revoke the workspace's current orchestrator. Owner-only. Idempotent. */
|
|
4025
|
+
revokeOrchestrator(workspaceId: string): Promise<IMResult<void>>;
|
|
3551
4026
|
}
|
|
3552
4027
|
/**
|
|
3553
4028
|
* Workspace files (v1.9.3). Each file is a `path → assetId` binding inside a
|
|
@@ -3618,10 +4093,16 @@ declare class AssetsClient {
|
|
|
3618
4093
|
sizeBytes: number | null;
|
|
3619
4094
|
}>;
|
|
3620
4095
|
/**
|
|
3621
|
-
* Upload bytes as an asset
|
|
3622
|
-
*
|
|
4096
|
+
* Upload bytes as an asset. Uses direct-to-S3 upload when the server exposes
|
|
4097
|
+
* `/assets/direct-upload/*`; falls back to legacy multipart POST for local
|
|
4098
|
+
* filesystem mode and older deployments. The client always sends SHA-256 for
|
|
4099
|
+
* server-side byte integrity checks. Hard cap: 1 GB.
|
|
3623
4100
|
*/
|
|
3624
4101
|
upload(input: FileInput, options: IMAssetUploadOptions): Promise<IMResult<IMAsset>>;
|
|
4102
|
+
private _tryDirectUpload;
|
|
4103
|
+
private _postAssetJson;
|
|
4104
|
+
private _putDirectUploadBytes;
|
|
4105
|
+
private _uploadMultipart;
|
|
3625
4106
|
}
|
|
3626
4107
|
/**
|
|
3627
4108
|
* Runtime installations (v1.9.3). Long-running daemon hosts inside a
|
|
@@ -3779,6 +4260,20 @@ declare class IMClient {
|
|
|
3779
4260
|
health(): Promise<IMResult<void>>;
|
|
3780
4261
|
/** Get workspace superset view with slot filtering */
|
|
3781
4262
|
getWorkspace(scope?: string, slots?: string[], includeContent?: boolean): Promise<any>;
|
|
4263
|
+
/**
|
|
4264
|
+
* Issue a typed IM API request via the shared `RequestFn` pipeline.
|
|
4265
|
+
*
|
|
4266
|
+
* Use this when you need to hit an IM endpoint that isn't (yet) exposed by a
|
|
4267
|
+
* sub-client (e.g. `/api/im/approvals`). Same auth + offline routing + retry
|
|
4268
|
+
* behaviour as the typed sub-clients.
|
|
4269
|
+
*
|
|
4270
|
+
* @example
|
|
4271
|
+
* const res = await client.im.request<ApprovalCreateResponse>(
|
|
4272
|
+
* 'POST', '/api/im/approvals', { category, title, context, options },
|
|
4273
|
+
* );
|
|
4274
|
+
*/
|
|
4275
|
+
request<T = unknown>(method: string, path: string, body?: unknown, query?: Record<string, string>): Promise<T>;
|
|
4276
|
+
private readonly _request;
|
|
3782
4277
|
}
|
|
3783
4278
|
declare class PrismerClient {
|
|
3784
4279
|
private apiKey;
|
|
@@ -3792,6 +4287,14 @@ declare class PrismerClient {
|
|
|
3792
4287
|
private _identityReady;
|
|
3793
4288
|
/** IM API sub-client */
|
|
3794
4289
|
readonly im: IMClient;
|
|
4290
|
+
/** v2.0 workspace public surface (`/api/im/workspaces`). */
|
|
4291
|
+
readonly workspaces: WorkspacesClient;
|
|
4292
|
+
/** v2.0 workspace file public surface (`/api/im/workspaces/:id/files`). */
|
|
4293
|
+
readonly workspaceFiles: WorkspaceFilesClient;
|
|
4294
|
+
/** v2.0 workspace asset public surface (`/api/im/assets`). */
|
|
4295
|
+
readonly assets: AssetsClient;
|
|
4296
|
+
/** Backward-compatible evolution namespace; same instance as `client.im.evolution`. */
|
|
4297
|
+
readonly evolution: EvolutionClient;
|
|
3795
4298
|
constructor(config?: PrismerConfig);
|
|
3796
4299
|
/** Wait for identity to be ready (useful for tests or explicit await) */
|
|
3797
4300
|
ensureIdentity(): Promise<AIPIdentity | null>;
|
|
@@ -3806,6 +4309,21 @@ declare class PrismerClient {
|
|
|
3806
4309
|
setToken(token: string): void;
|
|
3807
4310
|
/** Cleanup resources (offline manager, timers). Call when disposing the client. */
|
|
3808
4311
|
destroy(): Promise<void>;
|
|
4312
|
+
/**
|
|
4313
|
+
* Issue an authenticated raw HTTP request against the configured base URL,
|
|
4314
|
+
* returning the underlying `Response` so callers can inspect headers
|
|
4315
|
+
* (`Content-Range`, `Content-Length`, etc.) and stream the body.
|
|
4316
|
+
*
|
|
4317
|
+
* The path may be absolute (`/api/...`) or a full URL — full URLs are used
|
|
4318
|
+
* verbatim (useful for following 302 redirects), otherwise the path is
|
|
4319
|
+
* appended to the client's configured `baseUrl`. Authorization + `X-IM-Agent`
|
|
4320
|
+
* headers are added automatically; caller-supplied headers in `init.headers`
|
|
4321
|
+
* override them on collision.
|
|
4322
|
+
*
|
|
4323
|
+
* Use this for binary downloads / partial fetches; for normal JSON-envelope
|
|
4324
|
+
* IM requests use `client.im.request()` (typed) or the typed sub-clients.
|
|
4325
|
+
*/
|
|
4326
|
+
fetchAuthed(url: string, init?: RequestInit): Promise<Response>;
|
|
3809
4327
|
private _request;
|
|
3810
4328
|
/** Load content from URL(s) or search query */
|
|
3811
4329
|
load(input: string | string[], options?: LoadOptions): Promise<LoadResult>;
|
|
@@ -3834,4 +4352,4 @@ declare class PrismerClient {
|
|
|
3834
4352
|
|
|
3835
4353
|
declare function createClient(config: PrismerConfig): PrismerClient;
|
|
3836
4354
|
|
|
3837
|
-
export { AccountClient, type AgentChangedPayload, type AgentHostDeclarePayload, type AgentProfileChangedPayload, type AgentStatusChangedPayload, AssetsClient, AttachmentQueue, type AuthenticatedPayload, type BatchSummary, type BatchUrlCost, BindingsClient, type CacheManager, type CommandResult, CommunityHub, type CommunityHubConfig, ContactsClient, type ControlCommand, ConversationsClient, CreditsClient, type DaemonControlPlane, type DecryptResult, type DerivationMode, DirectClient, type DisconnectedPayload, E2EEncryption, ENVIRONMENTS, type EncryptedContextResult, type EncryptedFileResult, type EncryptedMessage, type Environment, type ErrorPayload, EvolutionCache, EvolutionClient, EvolutionRuntime, type EvolutionRuntimeConfig, type EvolutionSession, type EvolutionSyncDelta, type EvolutionSyncSnapshot, type ExecutionContext, type ExecutionPolicy, type FileInput, FilesClient, type GeneCategory, type GeneSelectionResult, type GeneVisibility, GroupsClient, type HostAckedPayload, type HostedAgentDeclaration, type IMAccountDeleteResult, type IMAgentCard, type IMAgentPersonality, type IMAgentSkillRecord, type IMAgentStatus, type IMAnalyzeOptions, type IMAnalyzeResult, type IMAsset, type IMAssetDetail, type IMAssetListOptions, type IMAssetUploadOptions, type IMAutocompleteResult, type IMBinding, type IMBindingData, type IMBlockedUser, type IMCapsule, IMClient, type IMCompactOptions, type IMCompactionSummary, type IMCompleteTaskOptions, type IMConfirmResult, type IMContact, type IMConversation, type IMConversationsOptions, type IMCreateBindingOptions, type IMCreateGeneOptions, type IMCreateGroupOptions, type IMCreateMemoryFileOptions, type IMCreateRuntimeInstallationOptions, type IMCreateTaskOptions, type IMCreateWorkspaceFileOptions, type IMCreateWorkspaceOptions, type IMCreditsData, type IMDiscoverAgent, type IMDiscoverOptions, type IMEvolutionEdge, type IMEvolutionStats, type IMFileQuota, type IMForkGeneOptions, type IMFriendRequest, type IMGene, type IMGeneListOptions, type IMGroupData, type IMGroupMember, type IMIdentityKey, type IMInstallAgentOnRuntimeOptions, type IMInstallAgentOnRuntimeResult, type IMKeyAuditEntry, type IMKeyVerifyResult, type IMKnowledgeLink, type IMMeData, type IMMemoryDigest, type IMMemoryDigestOptions, type IMMemoryFile, type IMMemoryFileDetail, type IMMemoryKnowledgeLinks, type IMMemoryLoadResult, type IMMessage, type IMMessageData, type IMMultipartInitResult, type IMOwnedAgent, type IMPaginationOptions, type IMPresignOptions, type IMPresignResult, IMRealtimeClient, type IMRecordOutcomeOptions, type IMRegisterData, type IMRegisterKeyOptions, type IMRegisterOptions, type IMResult, type IMRouting, type IMRuntimeInstallation, type IMSendOptions, type IMSkillContent, type IMSkillInfo, type IMSkillInstallResult, type IMTask, type IMTaskDetail, type IMTaskListOptions, type IMTaskLog, type IMTaskResult, type IMTokenData, type IMTransaction, type IMUpdateMemoryFileOptions, type IMUpdateTaskOptions, type IMUpdateWorkspaceOptions, type IMUser, type IMUserProfile, type IMWSMessage, type IMWorkspace, type IMWorkspaceData, type IMWorkspaceFile, type IMWorkspaceFileSyncResult, type IMWorkspaceInitGroupOptions, type IMWorkspaceInitOptions, type IMWorkspaceSyncResult, IdentityClient, IndexedDBStorage, type KeyManager, KnowledgeLinkClient, type KnowledgeLinkSource, type KnowledgeLinkType, type LLMBackend, type LLMDispatcher, type LLMResult, type LLMTask, type LoadOptions, type LoadResult, type LoadResultItem, MemoryClient, MemoryStorage, type MessageDeletedPayload, type MessageEditPayload, type MessageNewPayload, type MessageReactionPayload, MessagesClient, type ModelEntry, type NotificationSink, type OfflineConfig, type OfflineEventMap, type OfflineEventType, OfflineManager, type OutboxOperation, type ParseCost, type ParseCostBreakdown, type ParseDocument, type ParseDocumentImage, type ParseOptions, type ParseResult, type ParseUsage, type PongPayload, type PresenceChangedPayload, PrismerClient, type PrismerConfig, type PrismerEvent, type QueryCost, type QuerySummary, type QueuedAttachment, type QueuedTask, type RankingFactors, type RealtimeCommand, type RealtimeConfig, type RealtimeEventMap, type RealtimeEventType, RealtimeSSEClient, type RealtimeState, RealtimeWSClient, type ReconnectingPayload, type RequestFn, RuntimeInstallationsClient, type RuntimePhase, type RuntimeRoute, SQLiteStorage, type SaveBatchOptions, type SaveOptions, type SaveResult, type ScheduleType, SecurityClient, type SendFileOptions, type SendFileResult, type SessionMetrics, type SignalEnrichmentConfig, type SignalTag, type SingleUrlCost, type StorageAdapter, type StoredContact, type StoredConversation, type StoredMessage, type Suggestion, type SyncEvent, type SyncResult, TabCoordinator, type TaskCancelPayload, type TaskDispatchContextEntry, type TaskDispatchProgressPayload, type TaskDispatchReplyPayload, type TaskDispatchRequestPayload, type TaskEventEnvelope, type TaskEventType, type TaskExecutor, type TaskKind, type TaskStatus, TasksClient, type TypingIndicatorPayload, type UploadOptions, type UploadResult, type WorkspaceChangedPayload, WorkspaceClient, type WorkspaceFileChangedPayload, WorkspaceFilesClient, WorkspacesClient, createClient, createEnrichedExtractor, decryptContext, decryptFile, decryptMessages, decryptOnReceive, PrismerClient as default, encryptContext, encryptFile, encryptForSend, extractSignals, guessMimeType, safeSlug };
|
|
4355
|
+
export { AccountClient, type AgentChangedPayload, type AgentHostDeclarePayload, type AgentProfileChangedPayload, type AgentStatusChangedPayload, type AssetChangedPayload, type AssetDispatchObservation, type AssetDispatchStrategy, type AssetRef, AssetsClient, AttachmentQueue, type AuthenticatedPayload, type BatchSummary, type BatchUrlCost, BindingsClient, type CacheManager, type Card, type CardCreateInput, type CardFilters, type CardKanbanMetadata, type CardKanbanMetadataSource, type CardKanbanStatus, type CardMetadata, type CardMove, type CommandResult, CommunityHub, type CommunityHubConfig, ContactsClient, type ControlCommand, ConversationsClient, CreditsClient, type DaemonControlPlane, type DecryptResult, type DerivationMode, DirectClient, type DisconnectedPayload, E2EEncryption, ENVIRONMENTS, type EncryptedContextResult, type EncryptedFileResult, type EncryptedMessage, type Environment, type ErrorPayload, EvolutionCache, EvolutionClient, EvolutionRuntime, type EvolutionRuntimeConfig, type EvolutionSession, EvolutionSkillsClient, type EvolutionSyncDelta, type EvolutionSyncSnapshot, type ExecutionContext, type ExecutionPolicy, type FileInput, FilesClient, type GeneCategory, type GeneSelectionResult, type GeneVisibility, GroupsClient, type HostAckedPayload, type HostedAgentDeclaration, type IMAccountDeleteResult, type IMAgentCard, type IMAgentPersonality, type IMAgentSkillAckInput, type IMAgentSkillInstallOptions, type IMAgentSkillListOptions, type IMAgentSkillRecord, type IMAgentStatus, type IMAnalyzeOptions, type IMAnalyzeResult, type IMAsset, type IMAssetDetail, type IMAssetListOptions, type IMAssetPreviewContract, type IMAssetPreviewKind, type IMAssetPreviewStatus, type IMAssetRevision, type IMAssetRevisionList, type IMAssetUploadOptions, type IMAutocompleteResult, type IMBinding, type IMBindingData, type IMBlockedUser, type IMCapsule, IMClient, type IMCompactOptions, type IMCompactionSummary, type IMCompleteTaskOptions, type IMConfirmResult, type IMContact, type IMConversation, type IMConversationsOptions, type IMCreateBindingOptions, type IMCreateGeneOptions, type IMCreateGroupOptions, type IMCreateMemoryFileOptions, type IMCreateRuntimeInstallationOptions, type IMCreateTaskOptions, type IMCreateWorkspaceFileOptions, type IMCreateWorkspaceOptions, type IMCreditsData, type IMDiscoverAgent, type IMDiscoverOptions, type IMEvolutionEdge, type IMEvolutionStats, type IMFileQuota, type IMForkGeneOptions, type IMFriendRequest, type IMGene, type IMGeneListOptions, type IMGroupData, type IMGroupMember, type IMIdentityKey, type IMInstallAgentOnRuntimeOptions, type IMInstallAgentOnRuntimeResult, type IMKeyAuditEntry, type IMKeyVerifyResult, type IMKnowledgeLink, type IMMeData, type IMMemoryDigest, type IMMemoryDigestOptions, type IMMemoryFile, type IMMemoryFileDetail, type IMMemoryKnowledgeLinks, type IMMemoryLoadResult, type IMMessage, type IMMessageAttachment, type IMMessageData, type IMMultipartInitResult, type IMOwnedAgent, type IMPaginationOptions, type IMPresignOptions, type IMPresignResult, IMRealtimeClient, type IMRecordOutcomeOptions, type IMRegisterData, type IMRegisterKeyOptions, type IMRegisterOptions, type IMResult, type IMRouting, type IMRuntimeInstallation, type IMSendOptions, type IMSkillContent, type IMSkillCreateInput, type IMSkillInfo, type IMSkillInstallResult, type IMSkillSearchOptions, type IMSkillUpdateInput, type IMTask, type IMTaskDetail, type IMTaskListOptions, type IMTaskLog, type IMTaskResult, type IMTokenData, type IMTransaction, type IMUpdateMemoryFileOptions, type IMUpdateTaskOptions, type IMUpdateWorkspaceOptions, type IMUser, type IMUserProfile, type IMWSMessage, type IMWorkspace, type IMWorkspaceData, type IMWorkspaceFile, type IMWorkspaceFileSyncResult, type IMWorkspaceInitGroupOptions, type IMWorkspaceInitOptions, type IMWorkspaceOrchestrator, type IMWorkspaceOrchestratorEnvelope, type IMWorkspaceSyncResult, IdentityClient, IndexedDBStorage, type KeyManager, KnowledgeLinkClient, type KnowledgeLinkSource, type KnowledgeLinkType, type LLMBackend, type LLMDispatcher, type LLMResult, type LLMTask, type LoadOptions, type LoadResult, type LoadResultItem, MemoryClient, MemoryStorage, type MessageDeletedPayload, type MessageEditPayload, type MessageNewPayload, type MessageReactionPayload, MessagesClient, type ModelEntry, type NotificationSink, type OfflineConfig, type OfflineEventMap, type OfflineEventType, OfflineManager, type OutboxOperation, type ParseCost, type ParseCostBreakdown, type ParseDocument, type ParseDocumentImage, type ParseOptions, type ParseResult, type ParseUsage, type PongPayload, type PresenceChangedPayload, PrismerClient, type PrismerConfig, type PrismerEvent, type QueryCost, type QuerySummary, type QueuedAttachment, type QueuedTask, type RankingFactors, type RealtimeCommand, type RealtimeConfig, type RealtimeEventMap, type RealtimeEventType, RealtimeSSEClient, type RealtimeState, RealtimeWSClient, type ReconnectingPayload, type RequestFn, RuntimeInstallationsClient, type RuntimePhase, type RuntimeRoute, SQLiteStorage, type SaveBatchOptions, type SaveOptions, type SaveResult, type ScheduleType, SecurityClient, type SendFileOptions, type SendFileResult, type SessionMetrics, type SignalEnrichmentConfig, type SignalTag, type SingleUrlCost, type StorageAdapter, type StoredContact, type StoredConversation, type StoredMessage, type Suggestion, type SyncEvent, type SyncResult, TabCoordinator, type TaskCancelPayload, type TaskDispatchContextEntry, type TaskDispatchProgressPayload, type TaskDispatchReplyPayload, type TaskDispatchRequestPayload, type TaskEventEnvelope, type TaskEventType, type TaskExecutor, type TaskKind, type TaskStatus, TasksClient, type TypingIndicatorPayload, type UploadOptions, type UploadResult, WORKSPACE_ASSETS_ROUTE, type WorkspaceAssetFilters, type WorkspaceAssetRoute, type WorkspaceAssetUploadInput, type WorkspaceAssetsApiContract, type WorkspaceChangedPayload, WorkspaceClient, type WorkspaceFileChangedPayload, WorkspaceFilesClient, WorkspacesClient, createClient, createEnrichedExtractor, decryptContext, decryptFile, decryptMessages, decryptOnReceive, PrismerClient as default, encryptContext, encryptFile, encryptForSend, extractSignals, guessMimeType, readCardKanbanMetadata, safeSlug, writeCardKanbanMetadata };
|