@prismer/sdk 2.0.6 → 2.0.8
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/cli.js +2595 -297
- package/dist/index.d.mts +724 -2
- package/dist/index.d.ts +724 -2
- package/dist/index.js +397 -1
- package/dist/index.mjs +385 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -32,6 +32,7 @@ var index_exports = {};
|
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
AIPIdentity: () => import_aip_sdk.AIPIdentity,
|
|
34
34
|
AccountClient: () => AccountClient,
|
|
35
|
+
AgentSkillsClient: () => AgentSkillsClient,
|
|
35
36
|
AgentsClient: () => AgentsClient,
|
|
36
37
|
AssetsClient: () => AssetsClient,
|
|
37
38
|
AttachmentQueue: () => AttachmentQueue,
|
|
@@ -40,6 +41,7 @@ __export(index_exports, {
|
|
|
40
41
|
ContactsClient: () => ContactsClient,
|
|
41
42
|
ConversationsClient: () => ConversationsClient,
|
|
42
43
|
CreditsClient: () => CreditsClient,
|
|
44
|
+
CriteriaTemplatesClient: () => CriteriaTemplatesClient,
|
|
43
45
|
DirectClient: () => DirectClient,
|
|
44
46
|
E2EEncryption: () => E2EEncryption,
|
|
45
47
|
ENVIRONMENTS: () => ENVIRONMENTS,
|
|
@@ -53,22 +55,32 @@ __export(index_exports, {
|
|
|
53
55
|
IMRealtimeClient: () => IMRealtimeClient,
|
|
54
56
|
IdentityClient: () => IdentityClient,
|
|
55
57
|
IndexedDBStorage: () => IndexedDBStorage,
|
|
58
|
+
InvitesClient: () => InvitesClient,
|
|
56
59
|
KnowledgeLinkClient: () => KnowledgeLinkClient,
|
|
57
60
|
MemoryClient: () => MemoryClient,
|
|
58
61
|
MemoryStorage: () => MemoryStorage,
|
|
59
62
|
MessagesClient: () => MessagesClient,
|
|
63
|
+
MetricsClient: () => MetricsClient,
|
|
60
64
|
OfflineManager: () => OfflineManager,
|
|
61
65
|
PrismerClient: () => PrismerClient,
|
|
66
|
+
ProjectMembersClient: () => ProjectMembersClient,
|
|
67
|
+
ProjectsClient: () => ProjectsClient,
|
|
62
68
|
RealtimeSSEClient: () => RealtimeSSEClient,
|
|
63
69
|
RealtimeWSClient: () => RealtimeWSClient,
|
|
64
70
|
RuntimeInstallationsClient: () => RuntimeInstallationsClient,
|
|
65
71
|
SQLiteStorage: () => SQLiteStorage,
|
|
66
72
|
SecurityClient: () => SecurityClient,
|
|
73
|
+
SkillsClient: () => SkillsClient,
|
|
74
|
+
SkillsDraftClient: () => SkillsDraftClient,
|
|
75
|
+
StudioClient: () => StudioClient,
|
|
76
|
+
StudioEvolutionClient: () => StudioEvolutionClient,
|
|
67
77
|
TabCoordinator: () => TabCoordinator,
|
|
68
78
|
TasksClient: () => TasksClient,
|
|
69
79
|
WORKSPACE_ASSETS_ROUTE: () => WORKSPACE_ASSETS_ROUTE,
|
|
70
80
|
WorkspaceClient: () => WorkspaceClient,
|
|
71
81
|
WorkspaceFilesClient: () => WorkspaceFilesClient,
|
|
82
|
+
WorkspaceInvitesClient: () => WorkspaceInvitesClient,
|
|
83
|
+
WorkspaceMembersClient: () => WorkspaceMembersClient,
|
|
72
84
|
WorkspacesClient: () => WorkspacesClient,
|
|
73
85
|
createClient: () => createClient,
|
|
74
86
|
createEnrichedExtractor: () => createEnrichedExtractor,
|
|
@@ -3856,6 +3868,37 @@ var WorkspaceClient = class {
|
|
|
3856
3868
|
var TasksClient = class {
|
|
3857
3869
|
constructor(_r) {
|
|
3858
3870
|
this._r = _r;
|
|
3871
|
+
// ── release201/10 rev 2 — SPEC.md ─────────────────────────────────────
|
|
3872
|
+
this.spec = {
|
|
3873
|
+
/** Read SPEC.md latest revision. */
|
|
3874
|
+
get: (taskId) => this._r("GET", `/api/im/tasks/${taskId}/spec`),
|
|
3875
|
+
/** Owner sets/updates SPEC.md (writes a new revision). */
|
|
3876
|
+
set: (taskId, input) => this._r("PUT", `/api/im/tasks/${taskId}/spec`, input)
|
|
3877
|
+
};
|
|
3878
|
+
// ── release201/10 rev 2 — TODO.md ─────────────────────────────────────
|
|
3879
|
+
this.todo = {
|
|
3880
|
+
list: (taskId) => this._r("GET", `/api/im/tasks/${taskId}/todo`),
|
|
3881
|
+
add: (taskId, input) => this._r("POST", `/api/im/tasks/${taskId}/todo/items`, input),
|
|
3882
|
+
toggle: (taskId, index, done) => this._r("PATCH", `/api/im/tasks/${taskId}/todo/items/${index}`, { done }),
|
|
3883
|
+
setText: (taskId, index, text) => this._r("PATCH", `/api/im/tasks/${taskId}/todo/items/${index}`, { text }),
|
|
3884
|
+
remove: (taskId, index) => this._r("DELETE", `/api/im/tasks/${taskId}/todo/items/${index}`)
|
|
3885
|
+
};
|
|
3886
|
+
this.criteria = {
|
|
3887
|
+
/** List current criteria via the acceptance view. */
|
|
3888
|
+
list: (taskId) => this._r("GET", `/api/im/tasks/${taskId}/acceptance`),
|
|
3889
|
+
/** Add a criterion (rev 2 — verifyMode + expectation + verifierAgentId). */
|
|
3890
|
+
add: (taskId, input) => this._r("POST", `/api/im/tasks/${taskId}/criteria`, input),
|
|
3891
|
+
/** Update a criterion in place. */
|
|
3892
|
+
update: (taskId, cid, patch) => this._r("PATCH", `/api/im/tasks/${taskId}/criteria/${cid}`, patch),
|
|
3893
|
+
/** Remove a criterion. */
|
|
3894
|
+
remove: (taskId, cid) => this._r("DELETE", `/api/im/tasks/${taskId}/criteria/${cid}`),
|
|
3895
|
+
/**
|
|
3896
|
+
* Unified verify entry (rev 2). Manual reviewer, agent-self-check
|
|
3897
|
+
* report, AND verifier-agent report all use this — cloud routes by
|
|
3898
|
+
* actor identity.
|
|
3899
|
+
*/
|
|
3900
|
+
verify: (taskId, cid, input) => this._r("POST", `/api/im/tasks/${taskId}/criteria/${cid}/verify`, input)
|
|
3901
|
+
};
|
|
3859
3902
|
}
|
|
3860
3903
|
/** Create a new task */
|
|
3861
3904
|
async create(options) {
|
|
@@ -3875,6 +3918,7 @@ var TasksClient = class {
|
|
|
3875
3918
|
if (options?.limit != null) query.limit = String(options.limit);
|
|
3876
3919
|
if (options?.cursor) query.cursor = options.cursor;
|
|
3877
3920
|
if (options?.workspaceId) query.workspaceId = options.workspaceId;
|
|
3921
|
+
if (options?.projectId) query.projectId = options.projectId;
|
|
3878
3922
|
if (options?.conversationId) query.conversationId = options.conversationId;
|
|
3879
3923
|
return this._r("GET", "/api/im/tasks", void 0, query);
|
|
3880
3924
|
}
|
|
@@ -3910,6 +3954,10 @@ var TasksClient = class {
|
|
|
3910
3954
|
async update(taskId, options) {
|
|
3911
3955
|
return this._r("PATCH", `/api/im/tasks/${taskId}`, options);
|
|
3912
3956
|
}
|
|
3957
|
+
/** Move a task into a project, or pass null to return it to workspace-level. */
|
|
3958
|
+
async moveProject(taskId, targetProjectId) {
|
|
3959
|
+
return this._r("POST", `/api/im/tasks/${taskId}/move-project`, { targetProjectId });
|
|
3960
|
+
}
|
|
3913
3961
|
/** Claim a pending task */
|
|
3914
3962
|
async claim(taskId) {
|
|
3915
3963
|
return this._r("POST", `/api/im/tasks/${taskId}/claim`);
|
|
@@ -3964,6 +4012,39 @@ var TasksClient = class {
|
|
|
3964
4012
|
async forceTransition(taskId, options) {
|
|
3965
4013
|
return this._r("POST", `/api/im/tasks/${taskId}/force-transition`, options);
|
|
3966
4014
|
}
|
|
4015
|
+
// ── release201/10 — acceptance criteria ──────────────────────────────
|
|
4016
|
+
/** Get rolled-up acceptance + criteria list for a task. */
|
|
4017
|
+
async getAcceptance(taskId) {
|
|
4018
|
+
return this._r("GET", `/api/im/tasks/${taskId}/acceptance`);
|
|
4019
|
+
}
|
|
4020
|
+
/** Copy a template's criteria onto the task. */
|
|
4021
|
+
async applyTemplate(taskId, templateId) {
|
|
4022
|
+
return this._r("POST", `/api/im/tasks/${taskId}/apply-template`, { templateId });
|
|
4023
|
+
}
|
|
4024
|
+
};
|
|
4025
|
+
var CriteriaTemplatesClient = class {
|
|
4026
|
+
constructor(_r) {
|
|
4027
|
+
this._r = _r;
|
|
4028
|
+
}
|
|
4029
|
+
list(query) {
|
|
4030
|
+
const q = {};
|
|
4031
|
+
if (query?.capability) q.capability = query.capability;
|
|
4032
|
+
if (query?.workspaceId === null) q.workspaceId = "__global";
|
|
4033
|
+
else if (query?.workspaceId) q.workspaceId = query.workspaceId;
|
|
4034
|
+
return this._r("GET", "/api/im/criteria-templates", void 0, q);
|
|
4035
|
+
}
|
|
4036
|
+
get(id) {
|
|
4037
|
+
return this._r("GET", `/api/im/criteria-templates/${id}`);
|
|
4038
|
+
}
|
|
4039
|
+
create(input) {
|
|
4040
|
+
return this._r("POST", "/api/im/criteria-templates", input);
|
|
4041
|
+
}
|
|
4042
|
+
update(id, patch) {
|
|
4043
|
+
return this._r("PATCH", `/api/im/criteria-templates/${id}`, patch);
|
|
4044
|
+
}
|
|
4045
|
+
delete(id) {
|
|
4046
|
+
return this._r("DELETE", `/api/im/criteria-templates/${id}`);
|
|
4047
|
+
}
|
|
3967
4048
|
};
|
|
3968
4049
|
var MemoryClient = class {
|
|
3969
4050
|
constructor(_r) {
|
|
@@ -4036,6 +4117,32 @@ var KnowledgeLinkClient = class {
|
|
|
4036
4117
|
return this._r("GET", "/api/im/knowledge/links", void 0, { entityType, entityId });
|
|
4037
4118
|
}
|
|
4038
4119
|
};
|
|
4120
|
+
var MetricsClient = class {
|
|
4121
|
+
constructor(_r) {
|
|
4122
|
+
this._r = _r;
|
|
4123
|
+
}
|
|
4124
|
+
async emit(input) {
|
|
4125
|
+
return this._r("POST", "/api/im/metrics/emit", input);
|
|
4126
|
+
}
|
|
4127
|
+
async batch(events) {
|
|
4128
|
+
return this._r("POST", "/api/im/metrics/batch", { events });
|
|
4129
|
+
}
|
|
4130
|
+
async aggregate(opts) {
|
|
4131
|
+
const query = {
|
|
4132
|
+
namespace: opts.namespace,
|
|
4133
|
+
name: opts.name,
|
|
4134
|
+
agg: opts.agg
|
|
4135
|
+
};
|
|
4136
|
+
if (opts.range) query.range = opts.range;
|
|
4137
|
+
if (opts.from) query.from = opts.from;
|
|
4138
|
+
if (opts.to) query.to = opts.to;
|
|
4139
|
+
if (opts.groupBy && opts.groupBy.length) query.groupBy = opts.groupBy.join(",");
|
|
4140
|
+
if (opts.bucket) query.bucket = opts.bucket;
|
|
4141
|
+
const filterPairs = Object.entries(opts.filter).map(([k, v]) => `${k}:${v}`);
|
|
4142
|
+
if (filterPairs.length) query.filter = filterPairs.join(",");
|
|
4143
|
+
return this._r("GET", "/api/im/metrics/aggregate", void 0, query);
|
|
4144
|
+
}
|
|
4145
|
+
};
|
|
4039
4146
|
var IdentityClient = class {
|
|
4040
4147
|
constructor(_r) {
|
|
4041
4148
|
this._r = _r;
|
|
@@ -4200,9 +4307,51 @@ var EvolutionSkillsClient = class {
|
|
|
4200
4307
|
return this._r("POST", `/api/im/skills/${encodeURIComponent(skillId)}/star`);
|
|
4201
4308
|
}
|
|
4202
4309
|
};
|
|
4310
|
+
var AgentSkillsClient = class {
|
|
4311
|
+
constructor(_r) {
|
|
4312
|
+
this._r = _r;
|
|
4313
|
+
}
|
|
4314
|
+
/** List skills installed on the agent. */
|
|
4315
|
+
async list(agentId, options) {
|
|
4316
|
+
const query = {};
|
|
4317
|
+
if (options?.workspaceId) query.workspaceId = options.workspaceId;
|
|
4318
|
+
if (options?.includeInactive) query.includeInactive = "true";
|
|
4319
|
+
return this._r("GET", `/api/im/agents/${encodeURIComponent(agentId)}/skills`, void 0, query);
|
|
4320
|
+
}
|
|
4321
|
+
/** Install a published skill onto the agent. */
|
|
4322
|
+
async install(agentId, input) {
|
|
4323
|
+
return this._r("POST", `/api/im/agents/${encodeURIComponent(agentId)}/skills`, input);
|
|
4324
|
+
}
|
|
4325
|
+
/** Uninstall (or disable, for built-ins) a skill from the agent. */
|
|
4326
|
+
async uninstall(agentId, skillIdOrSlug, options) {
|
|
4327
|
+
const query = {};
|
|
4328
|
+
if (options?.workspaceId) query.workspaceId = options.workspaceId;
|
|
4329
|
+
return this._r(
|
|
4330
|
+
"DELETE",
|
|
4331
|
+
`/api/im/agents/${encodeURIComponent(agentId)}/skills/${encodeURIComponent(skillIdOrSlug)}`,
|
|
4332
|
+
void 0,
|
|
4333
|
+
query
|
|
4334
|
+
);
|
|
4335
|
+
}
|
|
4336
|
+
/**
|
|
4337
|
+
* PATCH /api/im/agents/:agentId/skills/:skillId — Update per-skill config.
|
|
4338
|
+
*
|
|
4339
|
+
* Validates against the skill's `executableJson.configSchema` server-side
|
|
4340
|
+
* (release201/13 §3.4 / 07 §2.6). Returns the updated agentSkill row;
|
|
4341
|
+
* `installedRevision` will be null until the next daemon sync poll.
|
|
4342
|
+
*/
|
|
4343
|
+
async updateConfig(agentId, skillId, config, options) {
|
|
4344
|
+
return this._r(
|
|
4345
|
+
"PATCH",
|
|
4346
|
+
`/api/im/agents/${encodeURIComponent(agentId)}/skills/${encodeURIComponent(skillId)}`,
|
|
4347
|
+
{ config, workspaceId: options?.workspaceId }
|
|
4348
|
+
);
|
|
4349
|
+
}
|
|
4350
|
+
};
|
|
4203
4351
|
var AgentsClient = class {
|
|
4204
4352
|
constructor(_r) {
|
|
4205
4353
|
this._r = _r;
|
|
4354
|
+
this.skills = new AgentSkillsClient(_r);
|
|
4206
4355
|
}
|
|
4207
4356
|
async spec(agentId, workspaceId) {
|
|
4208
4357
|
const query = workspaceId ? { workspaceId } : void 0;
|
|
@@ -4239,6 +4388,63 @@ var AgentsClient = class {
|
|
|
4239
4388
|
async deletePack(packIdOrSlug) {
|
|
4240
4389
|
return this._r("DELETE", `/api/im/agent-packs/${encodeURIComponent(packIdOrSlug)}`);
|
|
4241
4390
|
}
|
|
4391
|
+
// release201/09 §9.7.2 Phase 3 — agent quiesce + transfer endpoints.
|
|
4392
|
+
//
|
|
4393
|
+
// pause/resume: workspace owner / orchestrator / admin only. Used by
|
|
4394
|
+
// `prismer agent export` to halt cloud dispatch on the source device
|
|
4395
|
+
// before tarballing the agent dir, and by `prismer agent import` to
|
|
4396
|
+
// resume dispatch on the target device after rebind.
|
|
4397
|
+
async pause(agentId) {
|
|
4398
|
+
return this._r("POST", `/api/im/agents/${encodeURIComponent(agentId)}/pause`, {});
|
|
4399
|
+
}
|
|
4400
|
+
async resume(agentId) {
|
|
4401
|
+
return this._r("POST", `/api/im/agents/${encodeURIComponent(agentId)}/resume`, {});
|
|
4402
|
+
}
|
|
4403
|
+
async transfer(input) {
|
|
4404
|
+
return this._r("POST", "/api/im/agent-bindings/transfer", input);
|
|
4405
|
+
}
|
|
4406
|
+
};
|
|
4407
|
+
var StudioEvolutionClient = class {
|
|
4408
|
+
constructor(_r) {
|
|
4409
|
+
this._r = _r;
|
|
4410
|
+
}
|
|
4411
|
+
/** List capsules emitted by the target agent (workspace-owner-scoped). */
|
|
4412
|
+
async capsules(agentId, options) {
|
|
4413
|
+
const query = { agentId };
|
|
4414
|
+
if (options?.page != null) query.page = String(options.page);
|
|
4415
|
+
if (options?.limit != null) query.limit = String(options.limit);
|
|
4416
|
+
if (options?.scope) query.scope = options.scope;
|
|
4417
|
+
return this._r("GET", "/api/im/studio/evolution/capsules", void 0, query);
|
|
4418
|
+
}
|
|
4419
|
+
/** List genes owned by the target agent (workspace-owner-scoped). */
|
|
4420
|
+
async genes(agentId, options) {
|
|
4421
|
+
const query = { agentId };
|
|
4422
|
+
if (options?.signals) query.signals = options.signals;
|
|
4423
|
+
return this._r("GET", "/api/im/studio/evolution/genes", void 0, query);
|
|
4424
|
+
}
|
|
4425
|
+
};
|
|
4426
|
+
var StudioClient = class {
|
|
4427
|
+
constructor(_r) {
|
|
4428
|
+
this._r = _r;
|
|
4429
|
+
this.evolution = new StudioEvolutionClient(_r);
|
|
4430
|
+
}
|
|
4431
|
+
/** Studio overview — counts + recent activity for a workspace. */
|
|
4432
|
+
async getOverview(workspaceId) {
|
|
4433
|
+
const query = workspaceId ? { workspaceId } : void 0;
|
|
4434
|
+
return this._r("GET", "/api/im/studio/overview", void 0, query);
|
|
4435
|
+
}
|
|
4436
|
+
/** Studio Profile domain — agent identity / personality / credits. */
|
|
4437
|
+
async getProfile(agentId) {
|
|
4438
|
+
const query = agentId ? { agentId } : void 0;
|
|
4439
|
+
return this._r("GET", "/api/im/studio/profile", void 0, query);
|
|
4440
|
+
}
|
|
4441
|
+
/** Studio Installed domain — workspace agents + active agent's skills. */
|
|
4442
|
+
async getInstalled(options) {
|
|
4443
|
+
const query = {};
|
|
4444
|
+
if (options?.workspaceId) query.workspaceId = options.workspaceId;
|
|
4445
|
+
if (options?.agentId) query.agentId = options.agentId;
|
|
4446
|
+
return this._r("GET", "/api/im/studio/installed", void 0, query);
|
|
4447
|
+
}
|
|
4242
4448
|
};
|
|
4243
4449
|
var EvolutionClient = class {
|
|
4244
4450
|
constructor(_r) {
|
|
@@ -4741,6 +4947,8 @@ function safeSlug(input) {
|
|
|
4741
4947
|
var WorkspacesClient = class {
|
|
4742
4948
|
constructor(_r) {
|
|
4743
4949
|
this._r = _r;
|
|
4950
|
+
this.members = new WorkspaceMembersClient(_r);
|
|
4951
|
+
this.invites = new WorkspaceInvitesClient(_r);
|
|
4744
4952
|
}
|
|
4745
4953
|
/** List active workspaces owned by the caller. */
|
|
4746
4954
|
async list() {
|
|
@@ -4796,6 +5004,101 @@ var WorkspacesClient = class {
|
|
|
4796
5004
|
async revokeOrchestrator(workspaceId) {
|
|
4797
5005
|
return this._r("DELETE", `/api/im/workspaces/${workspaceId}/orchestrator`);
|
|
4798
5006
|
}
|
|
5007
|
+
// Sub-clients `members` / `invites` are declared at the top of the class and
|
|
5008
|
+
// wired up inside the constructor body — see `AgentsClient` for the same
|
|
5009
|
+
// pattern. Declaring them as field initializers that reference `this._r`
|
|
5010
|
+
// hits TS2729 because parameter-property assignment happens after class
|
|
5011
|
+
// field initializers under `useDefineForClassFields`.
|
|
5012
|
+
};
|
|
5013
|
+
var WorkspaceMembersClient = class {
|
|
5014
|
+
constructor(_r) {
|
|
5015
|
+
this._r = _r;
|
|
5016
|
+
}
|
|
5017
|
+
async list(workspaceId) {
|
|
5018
|
+
return this._r("GET", `/api/im/workspaces/${workspaceId}/members`);
|
|
5019
|
+
}
|
|
5020
|
+
async add(workspaceId, options) {
|
|
5021
|
+
return this._r("POST", `/api/im/workspaces/${workspaceId}/members`, options);
|
|
5022
|
+
}
|
|
5023
|
+
async update(workspaceId, memberId, options) {
|
|
5024
|
+
return this._r("PATCH", `/api/im/workspaces/${workspaceId}/members/${memberId}`, options);
|
|
5025
|
+
}
|
|
5026
|
+
async remove(workspaceId, memberId) {
|
|
5027
|
+
return this._r("DELETE", `/api/im/workspaces/${workspaceId}/members/${memberId}`);
|
|
5028
|
+
}
|
|
5029
|
+
};
|
|
5030
|
+
var WorkspaceInvitesClient = class {
|
|
5031
|
+
constructor(_r) {
|
|
5032
|
+
this._r = _r;
|
|
5033
|
+
}
|
|
5034
|
+
async create(workspaceId, options) {
|
|
5035
|
+
return this._r("POST", `/api/im/workspaces/${workspaceId}/invites`, options);
|
|
5036
|
+
}
|
|
5037
|
+
async list(workspaceId) {
|
|
5038
|
+
return this._r("GET", `/api/im/workspaces/${workspaceId}/invites`);
|
|
5039
|
+
}
|
|
5040
|
+
async revoke(workspaceId, inviteId) {
|
|
5041
|
+
return this._r("DELETE", `/api/im/workspaces/${workspaceId}/invites/${inviteId}`);
|
|
5042
|
+
}
|
|
5043
|
+
};
|
|
5044
|
+
var InvitesClient = class {
|
|
5045
|
+
constructor(_r) {
|
|
5046
|
+
this._r = _r;
|
|
5047
|
+
}
|
|
5048
|
+
async preview(token) {
|
|
5049
|
+
return this._r("GET", `/api/im/invites/${encodeURIComponent(token)}`);
|
|
5050
|
+
}
|
|
5051
|
+
async accept(token) {
|
|
5052
|
+
return this._r("POST", `/api/im/invites/${encodeURIComponent(token)}/accept`);
|
|
5053
|
+
}
|
|
5054
|
+
async reject(token) {
|
|
5055
|
+
return this._r("POST", `/api/im/invites/${encodeURIComponent(token)}/reject`);
|
|
5056
|
+
}
|
|
5057
|
+
};
|
|
5058
|
+
var ProjectMembersClient = class {
|
|
5059
|
+
constructor(_r) {
|
|
5060
|
+
this._r = _r;
|
|
5061
|
+
}
|
|
5062
|
+
async list(projectId) {
|
|
5063
|
+
return this._r("GET", `/api/im/projects/${projectId}/members`);
|
|
5064
|
+
}
|
|
5065
|
+
async add(projectId, options) {
|
|
5066
|
+
return this._r("POST", `/api/im/projects/${projectId}/members`, options);
|
|
5067
|
+
}
|
|
5068
|
+
async update(projectId, membershipId, options) {
|
|
5069
|
+
return this._r("PATCH", `/api/im/projects/${projectId}/members/${membershipId}`, options);
|
|
5070
|
+
}
|
|
5071
|
+
async remove(projectId, membershipId) {
|
|
5072
|
+
return this._r("DELETE", `/api/im/projects/${projectId}/members/${membershipId}`);
|
|
5073
|
+
}
|
|
5074
|
+
};
|
|
5075
|
+
var ProjectsClient = class {
|
|
5076
|
+
constructor(_r) {
|
|
5077
|
+
this._r = _r;
|
|
5078
|
+
this.members = new ProjectMembersClient(_r);
|
|
5079
|
+
}
|
|
5080
|
+
async list(options) {
|
|
5081
|
+
const query = { workspaceId: options.workspaceId };
|
|
5082
|
+
if (options.status) query.status = options.status;
|
|
5083
|
+
if (options.search) query.search = options.search;
|
|
5084
|
+
if (options.limit !== void 0) query.limit = String(options.limit);
|
|
5085
|
+
if (options.offset !== void 0) query.offset = String(options.offset);
|
|
5086
|
+
return this._r("GET", "/api/im/projects", void 0, query);
|
|
5087
|
+
}
|
|
5088
|
+
async create(options) {
|
|
5089
|
+
return this._r("POST", "/api/im/projects", options);
|
|
5090
|
+
}
|
|
5091
|
+
async get(projectId) {
|
|
5092
|
+
return this._r("GET", `/api/im/projects/${projectId}`);
|
|
5093
|
+
}
|
|
5094
|
+
async update(projectId, options) {
|
|
5095
|
+
return this._r("PATCH", `/api/im/projects/${projectId}`, options);
|
|
5096
|
+
}
|
|
5097
|
+
async delete(projectId, options) {
|
|
5098
|
+
const query = {};
|
|
5099
|
+
if (options?.cascade) query.cascade = options.cascade;
|
|
5100
|
+
return this._r("DELETE", `/api/im/projects/${projectId}`, void 0, query);
|
|
5101
|
+
}
|
|
4799
5102
|
};
|
|
4800
5103
|
var WorkspaceFilesClient = class {
|
|
4801
5104
|
constructor(_r) {
|
|
@@ -5103,10 +5406,18 @@ var RuntimeInstallationsClient = class {
|
|
|
5103
5406
|
constructor(_r) {
|
|
5104
5407
|
this._r = _r;
|
|
5105
5408
|
}
|
|
5106
|
-
/**
|
|
5409
|
+
/**
|
|
5410
|
+
* List runtime installations in a workspace.
|
|
5411
|
+
*
|
|
5412
|
+
* v2.0.8 M448 (release201/20 §1) — `projectId` narrows scope:
|
|
5413
|
+
* - omitted | `'all'` → no project filter (legacy behaviour)
|
|
5414
|
+
* - `'__unscoped'` → only workspace-level rows (projectId IS NULL)
|
|
5415
|
+
* - any other string → exact projectId match
|
|
5416
|
+
*/
|
|
5107
5417
|
async list(workspaceId, options) {
|
|
5108
5418
|
const query = { workspaceId };
|
|
5109
5419
|
if (options?.limit != null) query.limit = String(options.limit);
|
|
5420
|
+
if (options?.projectId) query.projectId = options.projectId;
|
|
5110
5421
|
return this._r("GET", "/api/workspace/runtime-installations", void 0, query);
|
|
5111
5422
|
}
|
|
5112
5423
|
/**
|
|
@@ -5115,10 +5426,27 @@ var RuntimeInstallationsClient = class {
|
|
|
5115
5426
|
* The daemon receives `PRISMER_API_KEY`, `PRISMER_DAEMON_ID`,
|
|
5116
5427
|
* `PRISMER_BASE_URL`, `PRISMER_WORKSPACE_ID`, and
|
|
5117
5428
|
* `PRISMER_RUNTIME_KIND=workspace-daemon` env vars.
|
|
5429
|
+
*
|
|
5430
|
+
* v2.0.8 M448 — `options.projectId` (optional) opts into project scope.
|
|
5431
|
+
* Server validates it belongs to the same workspace and is `active`,
|
|
5432
|
+
* otherwise rejects 422 `PROJECT_WORKSPACE_MISMATCH` / `PROJECT_NOT_ACTIVE`.
|
|
5118
5433
|
*/
|
|
5119
5434
|
async create(options) {
|
|
5120
5435
|
return this._r("POST", "/api/workspace/runtime-installations", options);
|
|
5121
5436
|
}
|
|
5437
|
+
/**
|
|
5438
|
+
* v2.0.8 M448 (release201/20 §1) — update the project binding on an
|
|
5439
|
+
* existing runtime installation. Pass `projectId: null` to detach.
|
|
5440
|
+
* No-op when body omits `projectId`. Same workspace/active invariant as
|
|
5441
|
+
* create — returns 422 on mismatch.
|
|
5442
|
+
*/
|
|
5443
|
+
async patch(runtimeInstallationId, options) {
|
|
5444
|
+
return this._r(
|
|
5445
|
+
"PATCH",
|
|
5446
|
+
`/api/workspace/runtime-installations/${runtimeInstallationId}`,
|
|
5447
|
+
options
|
|
5448
|
+
);
|
|
5449
|
+
}
|
|
5122
5450
|
/**
|
|
5123
5451
|
* Install an agent onto a runtime daemon. Resolves or creates the agent
|
|
5124
5452
|
* profile, calls the controller's `installAgent` RPC, and stamps
|
|
@@ -5251,6 +5579,19 @@ var FilesClient = class {
|
|
|
5251
5579
|
*/
|
|
5252
5580
|
async sendFile(conversationId, input, opts) {
|
|
5253
5581
|
const uploaded = await this.upload(input, opts);
|
|
5582
|
+
const outboxDir = process.env.PRISMER_OUTBOX_DIR;
|
|
5583
|
+
if (outboxDir) {
|
|
5584
|
+
try {
|
|
5585
|
+
const fsMod = await import("fs");
|
|
5586
|
+
const pathMod = await import("path");
|
|
5587
|
+
const srcPath = typeof input === "string" ? input : input.path;
|
|
5588
|
+
if (srcPath && typeof srcPath === "string") {
|
|
5589
|
+
await fsMod.promises.mkdir(outboxDir, { recursive: true });
|
|
5590
|
+
fsMod.cpSync(srcPath, pathMod.join(outboxDir, pathMod.basename(srcPath)));
|
|
5591
|
+
}
|
|
5592
|
+
} catch {
|
|
5593
|
+
}
|
|
5594
|
+
}
|
|
5254
5595
|
const msgRes = await this._r("POST", `/api/im/messages/${conversationId}`, {
|
|
5255
5596
|
content: opts?.content || uploaded.fileName,
|
|
5256
5597
|
type: "file",
|
|
@@ -5459,6 +5800,36 @@ var IMRealtimeClient = class {
|
|
|
5459
5800
|
};
|
|
5460
5801
|
}
|
|
5461
5802
|
};
|
|
5803
|
+
var SkillsDraftClient = class {
|
|
5804
|
+
constructor(_r) {
|
|
5805
|
+
this._r = _r;
|
|
5806
|
+
}
|
|
5807
|
+
/** Create a draft skill from a manifest v1 payload. */
|
|
5808
|
+
async create(input) {
|
|
5809
|
+
return this._r("POST", "/api/im/skills/draft", input);
|
|
5810
|
+
}
|
|
5811
|
+
/** Apply incremental file ops to a draft. */
|
|
5812
|
+
async patch(id, input) {
|
|
5813
|
+
return this._r("PATCH", `/api/im/skills/${id}/draft`, input);
|
|
5814
|
+
}
|
|
5815
|
+
/** Request a regenerate session for a draft. */
|
|
5816
|
+
async regenerate(id, input) {
|
|
5817
|
+
return this._r("POST", `/api/im/skills/${id}/draft/regenerate`, input);
|
|
5818
|
+
}
|
|
5819
|
+
/** Fetch a single draft's manifest + revision history. */
|
|
5820
|
+
async show(id) {
|
|
5821
|
+
return this._r("GET", `/api/im/skills/draft/${id}`);
|
|
5822
|
+
}
|
|
5823
|
+
/** List drafts for a workspace (most-recently-updated first). */
|
|
5824
|
+
async list(workspaceId) {
|
|
5825
|
+
return this._r("GET", "/api/im/skills/drafts", void 0, { workspaceId });
|
|
5826
|
+
}
|
|
5827
|
+
};
|
|
5828
|
+
var SkillsClient = class {
|
|
5829
|
+
constructor(_r) {
|
|
5830
|
+
this.draft = new SkillsDraftClient(_r);
|
|
5831
|
+
}
|
|
5832
|
+
};
|
|
5462
5833
|
var IMClient = class {
|
|
5463
5834
|
constructor(request, wsBase, fetchFn, getAuthHeaders, offlineManager, communityHubConfig) {
|
|
5464
5835
|
this._request = request;
|
|
@@ -5472,16 +5843,22 @@ var IMClient = class {
|
|
|
5472
5843
|
this.credits = new CreditsClient(request);
|
|
5473
5844
|
this.workspace = new WorkspaceClient(request);
|
|
5474
5845
|
this.workspaces = new WorkspacesClient(request);
|
|
5846
|
+
this.invites = new InvitesClient(request);
|
|
5847
|
+
this.projects = new ProjectsClient(request);
|
|
5475
5848
|
this.workspaceFiles = new WorkspaceFilesClient(request);
|
|
5476
5849
|
this.assets = new AssetsClient(request, wsBase, fetchFn, getAuthHeaders);
|
|
5477
5850
|
this.runtimeInstallations = new RuntimeInstallationsClient(request);
|
|
5478
5851
|
this.tasks = new TasksClient(request);
|
|
5852
|
+
this.criteriaTemplates = new CriteriaTemplatesClient(request);
|
|
5479
5853
|
this.memory = new MemoryClient(request);
|
|
5480
5854
|
this.knowledge = new KnowledgeLinkClient(request);
|
|
5855
|
+
this.metrics = new MetricsClient(request);
|
|
5481
5856
|
this.identity = new IdentityClient(request);
|
|
5482
5857
|
this.security = new SecurityClient(request);
|
|
5483
5858
|
this.agents = new AgentsClient(request);
|
|
5484
5859
|
this.evolution = new EvolutionClient(request);
|
|
5860
|
+
this.skills = new SkillsClient(request);
|
|
5861
|
+
this.studio = new StudioClient(request);
|
|
5485
5862
|
this.community = new CommunityHub(request, communityHubConfig ?? void 0);
|
|
5486
5863
|
this.files = new FilesClient(request, wsBase, fetchFn, getAuthHeaders);
|
|
5487
5864
|
this.realtime = new IMRealtimeClient(wsBase, fetchFn);
|
|
@@ -5531,6 +5908,7 @@ var PrismerClient = class {
|
|
|
5531
5908
|
this.timeout = config.timeout || 3e4;
|
|
5532
5909
|
this.fetchFn = config.fetch || fetch;
|
|
5533
5910
|
this.imAgent = config.imAgent;
|
|
5911
|
+
this.imWorkspace = config.imWorkspace;
|
|
5534
5912
|
if (config.identity) {
|
|
5535
5913
|
if (config.identity === "auto" && this.apiKey) {
|
|
5536
5914
|
this._identityReady = import_aip_sdk.AIPIdentity.fromApiKey(this.apiKey).then((id) => {
|
|
@@ -5589,6 +5967,8 @@ var PrismerClient = class {
|
|
|
5589
5967
|
config.community ?? null
|
|
5590
5968
|
);
|
|
5591
5969
|
this.workspaces = this.im.workspaces;
|
|
5970
|
+
this.invites = this.im.invites;
|
|
5971
|
+
this.projects = this.im.projects;
|
|
5592
5972
|
this.workspaceFiles = this.im.workspaceFiles;
|
|
5593
5973
|
this.assets = this.im.assets;
|
|
5594
5974
|
this.evolution = this.im.evolution;
|
|
@@ -5625,6 +6005,7 @@ var PrismerClient = class {
|
|
|
5625
6005
|
const headers = {};
|
|
5626
6006
|
if (this.apiKey) headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
5627
6007
|
if (this.imAgent) headers["X-IM-Agent"] = this.imAgent;
|
|
6008
|
+
if (this.imWorkspace) headers["X-IM-Workspace"] = this.imWorkspace;
|
|
5628
6009
|
return headers;
|
|
5629
6010
|
}
|
|
5630
6011
|
/**
|
|
@@ -5691,6 +6072,9 @@ var PrismerClient = class {
|
|
|
5691
6072
|
if (this.imAgent) {
|
|
5692
6073
|
headers["X-IM-Agent"] = this.imAgent;
|
|
5693
6074
|
}
|
|
6075
|
+
if (this.imWorkspace) {
|
|
6076
|
+
headers["X-IM-Workspace"] = this.imWorkspace;
|
|
6077
|
+
}
|
|
5694
6078
|
if (opts?.headers) {
|
|
5695
6079
|
for (const [k, v] of Object.entries(opts.headers)) headers[k] = v;
|
|
5696
6080
|
}
|
|
@@ -5800,6 +6184,7 @@ function createClient(config) {
|
|
|
5800
6184
|
0 && (module.exports = {
|
|
5801
6185
|
AIPIdentity,
|
|
5802
6186
|
AccountClient,
|
|
6187
|
+
AgentSkillsClient,
|
|
5803
6188
|
AgentsClient,
|
|
5804
6189
|
AssetsClient,
|
|
5805
6190
|
AttachmentQueue,
|
|
@@ -5808,6 +6193,7 @@ function createClient(config) {
|
|
|
5808
6193
|
ContactsClient,
|
|
5809
6194
|
ConversationsClient,
|
|
5810
6195
|
CreditsClient,
|
|
6196
|
+
CriteriaTemplatesClient,
|
|
5811
6197
|
DirectClient,
|
|
5812
6198
|
E2EEncryption,
|
|
5813
6199
|
ENVIRONMENTS,
|
|
@@ -5821,22 +6207,32 @@ function createClient(config) {
|
|
|
5821
6207
|
IMRealtimeClient,
|
|
5822
6208
|
IdentityClient,
|
|
5823
6209
|
IndexedDBStorage,
|
|
6210
|
+
InvitesClient,
|
|
5824
6211
|
KnowledgeLinkClient,
|
|
5825
6212
|
MemoryClient,
|
|
5826
6213
|
MemoryStorage,
|
|
5827
6214
|
MessagesClient,
|
|
6215
|
+
MetricsClient,
|
|
5828
6216
|
OfflineManager,
|
|
5829
6217
|
PrismerClient,
|
|
6218
|
+
ProjectMembersClient,
|
|
6219
|
+
ProjectsClient,
|
|
5830
6220
|
RealtimeSSEClient,
|
|
5831
6221
|
RealtimeWSClient,
|
|
5832
6222
|
RuntimeInstallationsClient,
|
|
5833
6223
|
SQLiteStorage,
|
|
5834
6224
|
SecurityClient,
|
|
6225
|
+
SkillsClient,
|
|
6226
|
+
SkillsDraftClient,
|
|
6227
|
+
StudioClient,
|
|
6228
|
+
StudioEvolutionClient,
|
|
5835
6229
|
TabCoordinator,
|
|
5836
6230
|
TasksClient,
|
|
5837
6231
|
WORKSPACE_ASSETS_ROUTE,
|
|
5838
6232
|
WorkspaceClient,
|
|
5839
6233
|
WorkspaceFilesClient,
|
|
6234
|
+
WorkspaceInvitesClient,
|
|
6235
|
+
WorkspaceMembersClient,
|
|
5840
6236
|
WorkspacesClient,
|
|
5841
6237
|
createClient,
|
|
5842
6238
|
createEnrichedExtractor,
|