@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.mjs
CHANGED
|
@@ -3786,6 +3786,37 @@ var WorkspaceClient = class {
|
|
|
3786
3786
|
var TasksClient = class {
|
|
3787
3787
|
constructor(_r) {
|
|
3788
3788
|
this._r = _r;
|
|
3789
|
+
// ── release201/10 rev 2 — SPEC.md ─────────────────────────────────────
|
|
3790
|
+
this.spec = {
|
|
3791
|
+
/** Read SPEC.md latest revision. */
|
|
3792
|
+
get: (taskId) => this._r("GET", `/api/im/tasks/${taskId}/spec`),
|
|
3793
|
+
/** Owner sets/updates SPEC.md (writes a new revision). */
|
|
3794
|
+
set: (taskId, input) => this._r("PUT", `/api/im/tasks/${taskId}/spec`, input)
|
|
3795
|
+
};
|
|
3796
|
+
// ── release201/10 rev 2 — TODO.md ─────────────────────────────────────
|
|
3797
|
+
this.todo = {
|
|
3798
|
+
list: (taskId) => this._r("GET", `/api/im/tasks/${taskId}/todo`),
|
|
3799
|
+
add: (taskId, input) => this._r("POST", `/api/im/tasks/${taskId}/todo/items`, input),
|
|
3800
|
+
toggle: (taskId, index, done) => this._r("PATCH", `/api/im/tasks/${taskId}/todo/items/${index}`, { done }),
|
|
3801
|
+
setText: (taskId, index, text) => this._r("PATCH", `/api/im/tasks/${taskId}/todo/items/${index}`, { text }),
|
|
3802
|
+
remove: (taskId, index) => this._r("DELETE", `/api/im/tasks/${taskId}/todo/items/${index}`)
|
|
3803
|
+
};
|
|
3804
|
+
this.criteria = {
|
|
3805
|
+
/** List current criteria via the acceptance view. */
|
|
3806
|
+
list: (taskId) => this._r("GET", `/api/im/tasks/${taskId}/acceptance`),
|
|
3807
|
+
/** Add a criterion (rev 2 — verifyMode + expectation + verifierAgentId). */
|
|
3808
|
+
add: (taskId, input) => this._r("POST", `/api/im/tasks/${taskId}/criteria`, input),
|
|
3809
|
+
/** Update a criterion in place. */
|
|
3810
|
+
update: (taskId, cid, patch) => this._r("PATCH", `/api/im/tasks/${taskId}/criteria/${cid}`, patch),
|
|
3811
|
+
/** Remove a criterion. */
|
|
3812
|
+
remove: (taskId, cid) => this._r("DELETE", `/api/im/tasks/${taskId}/criteria/${cid}`),
|
|
3813
|
+
/**
|
|
3814
|
+
* Unified verify entry (rev 2). Manual reviewer, agent-self-check
|
|
3815
|
+
* report, AND verifier-agent report all use this — cloud routes by
|
|
3816
|
+
* actor identity.
|
|
3817
|
+
*/
|
|
3818
|
+
verify: (taskId, cid, input) => this._r("POST", `/api/im/tasks/${taskId}/criteria/${cid}/verify`, input)
|
|
3819
|
+
};
|
|
3789
3820
|
}
|
|
3790
3821
|
/** Create a new task */
|
|
3791
3822
|
async create(options) {
|
|
@@ -3805,6 +3836,7 @@ var TasksClient = class {
|
|
|
3805
3836
|
if (options?.limit != null) query.limit = String(options.limit);
|
|
3806
3837
|
if (options?.cursor) query.cursor = options.cursor;
|
|
3807
3838
|
if (options?.workspaceId) query.workspaceId = options.workspaceId;
|
|
3839
|
+
if (options?.projectId) query.projectId = options.projectId;
|
|
3808
3840
|
if (options?.conversationId) query.conversationId = options.conversationId;
|
|
3809
3841
|
return this._r("GET", "/api/im/tasks", void 0, query);
|
|
3810
3842
|
}
|
|
@@ -3840,6 +3872,10 @@ var TasksClient = class {
|
|
|
3840
3872
|
async update(taskId, options) {
|
|
3841
3873
|
return this._r("PATCH", `/api/im/tasks/${taskId}`, options);
|
|
3842
3874
|
}
|
|
3875
|
+
/** Move a task into a project, or pass null to return it to workspace-level. */
|
|
3876
|
+
async moveProject(taskId, targetProjectId) {
|
|
3877
|
+
return this._r("POST", `/api/im/tasks/${taskId}/move-project`, { targetProjectId });
|
|
3878
|
+
}
|
|
3843
3879
|
/** Claim a pending task */
|
|
3844
3880
|
async claim(taskId) {
|
|
3845
3881
|
return this._r("POST", `/api/im/tasks/${taskId}/claim`);
|
|
@@ -3894,6 +3930,39 @@ var TasksClient = class {
|
|
|
3894
3930
|
async forceTransition(taskId, options) {
|
|
3895
3931
|
return this._r("POST", `/api/im/tasks/${taskId}/force-transition`, options);
|
|
3896
3932
|
}
|
|
3933
|
+
// ── release201/10 — acceptance criteria ──────────────────────────────
|
|
3934
|
+
/** Get rolled-up acceptance + criteria list for a task. */
|
|
3935
|
+
async getAcceptance(taskId) {
|
|
3936
|
+
return this._r("GET", `/api/im/tasks/${taskId}/acceptance`);
|
|
3937
|
+
}
|
|
3938
|
+
/** Copy a template's criteria onto the task. */
|
|
3939
|
+
async applyTemplate(taskId, templateId) {
|
|
3940
|
+
return this._r("POST", `/api/im/tasks/${taskId}/apply-template`, { templateId });
|
|
3941
|
+
}
|
|
3942
|
+
};
|
|
3943
|
+
var CriteriaTemplatesClient = class {
|
|
3944
|
+
constructor(_r) {
|
|
3945
|
+
this._r = _r;
|
|
3946
|
+
}
|
|
3947
|
+
list(query) {
|
|
3948
|
+
const q = {};
|
|
3949
|
+
if (query?.capability) q.capability = query.capability;
|
|
3950
|
+
if (query?.workspaceId === null) q.workspaceId = "__global";
|
|
3951
|
+
else if (query?.workspaceId) q.workspaceId = query.workspaceId;
|
|
3952
|
+
return this._r("GET", "/api/im/criteria-templates", void 0, q);
|
|
3953
|
+
}
|
|
3954
|
+
get(id) {
|
|
3955
|
+
return this._r("GET", `/api/im/criteria-templates/${id}`);
|
|
3956
|
+
}
|
|
3957
|
+
create(input) {
|
|
3958
|
+
return this._r("POST", "/api/im/criteria-templates", input);
|
|
3959
|
+
}
|
|
3960
|
+
update(id, patch) {
|
|
3961
|
+
return this._r("PATCH", `/api/im/criteria-templates/${id}`, patch);
|
|
3962
|
+
}
|
|
3963
|
+
delete(id) {
|
|
3964
|
+
return this._r("DELETE", `/api/im/criteria-templates/${id}`);
|
|
3965
|
+
}
|
|
3897
3966
|
};
|
|
3898
3967
|
var MemoryClient = class {
|
|
3899
3968
|
constructor(_r) {
|
|
@@ -3966,6 +4035,32 @@ var KnowledgeLinkClient = class {
|
|
|
3966
4035
|
return this._r("GET", "/api/im/knowledge/links", void 0, { entityType, entityId });
|
|
3967
4036
|
}
|
|
3968
4037
|
};
|
|
4038
|
+
var MetricsClient = class {
|
|
4039
|
+
constructor(_r) {
|
|
4040
|
+
this._r = _r;
|
|
4041
|
+
}
|
|
4042
|
+
async emit(input) {
|
|
4043
|
+
return this._r("POST", "/api/im/metrics/emit", input);
|
|
4044
|
+
}
|
|
4045
|
+
async batch(events) {
|
|
4046
|
+
return this._r("POST", "/api/im/metrics/batch", { events });
|
|
4047
|
+
}
|
|
4048
|
+
async aggregate(opts) {
|
|
4049
|
+
const query = {
|
|
4050
|
+
namespace: opts.namespace,
|
|
4051
|
+
name: opts.name,
|
|
4052
|
+
agg: opts.agg
|
|
4053
|
+
};
|
|
4054
|
+
if (opts.range) query.range = opts.range;
|
|
4055
|
+
if (opts.from) query.from = opts.from;
|
|
4056
|
+
if (opts.to) query.to = opts.to;
|
|
4057
|
+
if (opts.groupBy && opts.groupBy.length) query.groupBy = opts.groupBy.join(",");
|
|
4058
|
+
if (opts.bucket) query.bucket = opts.bucket;
|
|
4059
|
+
const filterPairs = Object.entries(opts.filter).map(([k, v]) => `${k}:${v}`);
|
|
4060
|
+
if (filterPairs.length) query.filter = filterPairs.join(",");
|
|
4061
|
+
return this._r("GET", "/api/im/metrics/aggregate", void 0, query);
|
|
4062
|
+
}
|
|
4063
|
+
};
|
|
3969
4064
|
var IdentityClient = class {
|
|
3970
4065
|
constructor(_r) {
|
|
3971
4066
|
this._r = _r;
|
|
@@ -4130,9 +4225,51 @@ var EvolutionSkillsClient = class {
|
|
|
4130
4225
|
return this._r("POST", `/api/im/skills/${encodeURIComponent(skillId)}/star`);
|
|
4131
4226
|
}
|
|
4132
4227
|
};
|
|
4228
|
+
var AgentSkillsClient = class {
|
|
4229
|
+
constructor(_r) {
|
|
4230
|
+
this._r = _r;
|
|
4231
|
+
}
|
|
4232
|
+
/** List skills installed on the agent. */
|
|
4233
|
+
async list(agentId, options) {
|
|
4234
|
+
const query = {};
|
|
4235
|
+
if (options?.workspaceId) query.workspaceId = options.workspaceId;
|
|
4236
|
+
if (options?.includeInactive) query.includeInactive = "true";
|
|
4237
|
+
return this._r("GET", `/api/im/agents/${encodeURIComponent(agentId)}/skills`, void 0, query);
|
|
4238
|
+
}
|
|
4239
|
+
/** Install a published skill onto the agent. */
|
|
4240
|
+
async install(agentId, input) {
|
|
4241
|
+
return this._r("POST", `/api/im/agents/${encodeURIComponent(agentId)}/skills`, input);
|
|
4242
|
+
}
|
|
4243
|
+
/** Uninstall (or disable, for built-ins) a skill from the agent. */
|
|
4244
|
+
async uninstall(agentId, skillIdOrSlug, options) {
|
|
4245
|
+
const query = {};
|
|
4246
|
+
if (options?.workspaceId) query.workspaceId = options.workspaceId;
|
|
4247
|
+
return this._r(
|
|
4248
|
+
"DELETE",
|
|
4249
|
+
`/api/im/agents/${encodeURIComponent(agentId)}/skills/${encodeURIComponent(skillIdOrSlug)}`,
|
|
4250
|
+
void 0,
|
|
4251
|
+
query
|
|
4252
|
+
);
|
|
4253
|
+
}
|
|
4254
|
+
/**
|
|
4255
|
+
* PATCH /api/im/agents/:agentId/skills/:skillId — Update per-skill config.
|
|
4256
|
+
*
|
|
4257
|
+
* Validates against the skill's `executableJson.configSchema` server-side
|
|
4258
|
+
* (release201/13 §3.4 / 07 §2.6). Returns the updated agentSkill row;
|
|
4259
|
+
* `installedRevision` will be null until the next daemon sync poll.
|
|
4260
|
+
*/
|
|
4261
|
+
async updateConfig(agentId, skillId, config, options) {
|
|
4262
|
+
return this._r(
|
|
4263
|
+
"PATCH",
|
|
4264
|
+
`/api/im/agents/${encodeURIComponent(agentId)}/skills/${encodeURIComponent(skillId)}`,
|
|
4265
|
+
{ config, workspaceId: options?.workspaceId }
|
|
4266
|
+
);
|
|
4267
|
+
}
|
|
4268
|
+
};
|
|
4133
4269
|
var AgentsClient = class {
|
|
4134
4270
|
constructor(_r) {
|
|
4135
4271
|
this._r = _r;
|
|
4272
|
+
this.skills = new AgentSkillsClient(_r);
|
|
4136
4273
|
}
|
|
4137
4274
|
async spec(agentId, workspaceId) {
|
|
4138
4275
|
const query = workspaceId ? { workspaceId } : void 0;
|
|
@@ -4169,6 +4306,63 @@ var AgentsClient = class {
|
|
|
4169
4306
|
async deletePack(packIdOrSlug) {
|
|
4170
4307
|
return this._r("DELETE", `/api/im/agent-packs/${encodeURIComponent(packIdOrSlug)}`);
|
|
4171
4308
|
}
|
|
4309
|
+
// release201/09 §9.7.2 Phase 3 — agent quiesce + transfer endpoints.
|
|
4310
|
+
//
|
|
4311
|
+
// pause/resume: workspace owner / orchestrator / admin only. Used by
|
|
4312
|
+
// `prismer agent export` to halt cloud dispatch on the source device
|
|
4313
|
+
// before tarballing the agent dir, and by `prismer agent import` to
|
|
4314
|
+
// resume dispatch on the target device after rebind.
|
|
4315
|
+
async pause(agentId) {
|
|
4316
|
+
return this._r("POST", `/api/im/agents/${encodeURIComponent(agentId)}/pause`, {});
|
|
4317
|
+
}
|
|
4318
|
+
async resume(agentId) {
|
|
4319
|
+
return this._r("POST", `/api/im/agents/${encodeURIComponent(agentId)}/resume`, {});
|
|
4320
|
+
}
|
|
4321
|
+
async transfer(input) {
|
|
4322
|
+
return this._r("POST", "/api/im/agent-bindings/transfer", input);
|
|
4323
|
+
}
|
|
4324
|
+
};
|
|
4325
|
+
var StudioEvolutionClient = class {
|
|
4326
|
+
constructor(_r) {
|
|
4327
|
+
this._r = _r;
|
|
4328
|
+
}
|
|
4329
|
+
/** List capsules emitted by the target agent (workspace-owner-scoped). */
|
|
4330
|
+
async capsules(agentId, options) {
|
|
4331
|
+
const query = { agentId };
|
|
4332
|
+
if (options?.page != null) query.page = String(options.page);
|
|
4333
|
+
if (options?.limit != null) query.limit = String(options.limit);
|
|
4334
|
+
if (options?.scope) query.scope = options.scope;
|
|
4335
|
+
return this._r("GET", "/api/im/studio/evolution/capsules", void 0, query);
|
|
4336
|
+
}
|
|
4337
|
+
/** List genes owned by the target agent (workspace-owner-scoped). */
|
|
4338
|
+
async genes(agentId, options) {
|
|
4339
|
+
const query = { agentId };
|
|
4340
|
+
if (options?.signals) query.signals = options.signals;
|
|
4341
|
+
return this._r("GET", "/api/im/studio/evolution/genes", void 0, query);
|
|
4342
|
+
}
|
|
4343
|
+
};
|
|
4344
|
+
var StudioClient = class {
|
|
4345
|
+
constructor(_r) {
|
|
4346
|
+
this._r = _r;
|
|
4347
|
+
this.evolution = new StudioEvolutionClient(_r);
|
|
4348
|
+
}
|
|
4349
|
+
/** Studio overview — counts + recent activity for a workspace. */
|
|
4350
|
+
async getOverview(workspaceId) {
|
|
4351
|
+
const query = workspaceId ? { workspaceId } : void 0;
|
|
4352
|
+
return this._r("GET", "/api/im/studio/overview", void 0, query);
|
|
4353
|
+
}
|
|
4354
|
+
/** Studio Profile domain — agent identity / personality / credits. */
|
|
4355
|
+
async getProfile(agentId) {
|
|
4356
|
+
const query = agentId ? { agentId } : void 0;
|
|
4357
|
+
return this._r("GET", "/api/im/studio/profile", void 0, query);
|
|
4358
|
+
}
|
|
4359
|
+
/** Studio Installed domain — workspace agents + active agent's skills. */
|
|
4360
|
+
async getInstalled(options) {
|
|
4361
|
+
const query = {};
|
|
4362
|
+
if (options?.workspaceId) query.workspaceId = options.workspaceId;
|
|
4363
|
+
if (options?.agentId) query.agentId = options.agentId;
|
|
4364
|
+
return this._r("GET", "/api/im/studio/installed", void 0, query);
|
|
4365
|
+
}
|
|
4172
4366
|
};
|
|
4173
4367
|
var EvolutionClient = class {
|
|
4174
4368
|
constructor(_r) {
|
|
@@ -4671,6 +4865,8 @@ function safeSlug(input) {
|
|
|
4671
4865
|
var WorkspacesClient = class {
|
|
4672
4866
|
constructor(_r) {
|
|
4673
4867
|
this._r = _r;
|
|
4868
|
+
this.members = new WorkspaceMembersClient(_r);
|
|
4869
|
+
this.invites = new WorkspaceInvitesClient(_r);
|
|
4674
4870
|
}
|
|
4675
4871
|
/** List active workspaces owned by the caller. */
|
|
4676
4872
|
async list() {
|
|
@@ -4726,6 +4922,101 @@ var WorkspacesClient = class {
|
|
|
4726
4922
|
async revokeOrchestrator(workspaceId) {
|
|
4727
4923
|
return this._r("DELETE", `/api/im/workspaces/${workspaceId}/orchestrator`);
|
|
4728
4924
|
}
|
|
4925
|
+
// Sub-clients `members` / `invites` are declared at the top of the class and
|
|
4926
|
+
// wired up inside the constructor body — see `AgentsClient` for the same
|
|
4927
|
+
// pattern. Declaring them as field initializers that reference `this._r`
|
|
4928
|
+
// hits TS2729 because parameter-property assignment happens after class
|
|
4929
|
+
// field initializers under `useDefineForClassFields`.
|
|
4930
|
+
};
|
|
4931
|
+
var WorkspaceMembersClient = class {
|
|
4932
|
+
constructor(_r) {
|
|
4933
|
+
this._r = _r;
|
|
4934
|
+
}
|
|
4935
|
+
async list(workspaceId) {
|
|
4936
|
+
return this._r("GET", `/api/im/workspaces/${workspaceId}/members`);
|
|
4937
|
+
}
|
|
4938
|
+
async add(workspaceId, options) {
|
|
4939
|
+
return this._r("POST", `/api/im/workspaces/${workspaceId}/members`, options);
|
|
4940
|
+
}
|
|
4941
|
+
async update(workspaceId, memberId, options) {
|
|
4942
|
+
return this._r("PATCH", `/api/im/workspaces/${workspaceId}/members/${memberId}`, options);
|
|
4943
|
+
}
|
|
4944
|
+
async remove(workspaceId, memberId) {
|
|
4945
|
+
return this._r("DELETE", `/api/im/workspaces/${workspaceId}/members/${memberId}`);
|
|
4946
|
+
}
|
|
4947
|
+
};
|
|
4948
|
+
var WorkspaceInvitesClient = class {
|
|
4949
|
+
constructor(_r) {
|
|
4950
|
+
this._r = _r;
|
|
4951
|
+
}
|
|
4952
|
+
async create(workspaceId, options) {
|
|
4953
|
+
return this._r("POST", `/api/im/workspaces/${workspaceId}/invites`, options);
|
|
4954
|
+
}
|
|
4955
|
+
async list(workspaceId) {
|
|
4956
|
+
return this._r("GET", `/api/im/workspaces/${workspaceId}/invites`);
|
|
4957
|
+
}
|
|
4958
|
+
async revoke(workspaceId, inviteId) {
|
|
4959
|
+
return this._r("DELETE", `/api/im/workspaces/${workspaceId}/invites/${inviteId}`);
|
|
4960
|
+
}
|
|
4961
|
+
};
|
|
4962
|
+
var InvitesClient = class {
|
|
4963
|
+
constructor(_r) {
|
|
4964
|
+
this._r = _r;
|
|
4965
|
+
}
|
|
4966
|
+
async preview(token) {
|
|
4967
|
+
return this._r("GET", `/api/im/invites/${encodeURIComponent(token)}`);
|
|
4968
|
+
}
|
|
4969
|
+
async accept(token) {
|
|
4970
|
+
return this._r("POST", `/api/im/invites/${encodeURIComponent(token)}/accept`);
|
|
4971
|
+
}
|
|
4972
|
+
async reject(token) {
|
|
4973
|
+
return this._r("POST", `/api/im/invites/${encodeURIComponent(token)}/reject`);
|
|
4974
|
+
}
|
|
4975
|
+
};
|
|
4976
|
+
var ProjectMembersClient = class {
|
|
4977
|
+
constructor(_r) {
|
|
4978
|
+
this._r = _r;
|
|
4979
|
+
}
|
|
4980
|
+
async list(projectId) {
|
|
4981
|
+
return this._r("GET", `/api/im/projects/${projectId}/members`);
|
|
4982
|
+
}
|
|
4983
|
+
async add(projectId, options) {
|
|
4984
|
+
return this._r("POST", `/api/im/projects/${projectId}/members`, options);
|
|
4985
|
+
}
|
|
4986
|
+
async update(projectId, membershipId, options) {
|
|
4987
|
+
return this._r("PATCH", `/api/im/projects/${projectId}/members/${membershipId}`, options);
|
|
4988
|
+
}
|
|
4989
|
+
async remove(projectId, membershipId) {
|
|
4990
|
+
return this._r("DELETE", `/api/im/projects/${projectId}/members/${membershipId}`);
|
|
4991
|
+
}
|
|
4992
|
+
};
|
|
4993
|
+
var ProjectsClient = class {
|
|
4994
|
+
constructor(_r) {
|
|
4995
|
+
this._r = _r;
|
|
4996
|
+
this.members = new ProjectMembersClient(_r);
|
|
4997
|
+
}
|
|
4998
|
+
async list(options) {
|
|
4999
|
+
const query = { workspaceId: options.workspaceId };
|
|
5000
|
+
if (options.status) query.status = options.status;
|
|
5001
|
+
if (options.search) query.search = options.search;
|
|
5002
|
+
if (options.limit !== void 0) query.limit = String(options.limit);
|
|
5003
|
+
if (options.offset !== void 0) query.offset = String(options.offset);
|
|
5004
|
+
return this._r("GET", "/api/im/projects", void 0, query);
|
|
5005
|
+
}
|
|
5006
|
+
async create(options) {
|
|
5007
|
+
return this._r("POST", "/api/im/projects", options);
|
|
5008
|
+
}
|
|
5009
|
+
async get(projectId) {
|
|
5010
|
+
return this._r("GET", `/api/im/projects/${projectId}`);
|
|
5011
|
+
}
|
|
5012
|
+
async update(projectId, options) {
|
|
5013
|
+
return this._r("PATCH", `/api/im/projects/${projectId}`, options);
|
|
5014
|
+
}
|
|
5015
|
+
async delete(projectId, options) {
|
|
5016
|
+
const query = {};
|
|
5017
|
+
if (options?.cascade) query.cascade = options.cascade;
|
|
5018
|
+
return this._r("DELETE", `/api/im/projects/${projectId}`, void 0, query);
|
|
5019
|
+
}
|
|
4729
5020
|
};
|
|
4730
5021
|
var WorkspaceFilesClient = class {
|
|
4731
5022
|
constructor(_r) {
|
|
@@ -5033,10 +5324,18 @@ var RuntimeInstallationsClient = class {
|
|
|
5033
5324
|
constructor(_r) {
|
|
5034
5325
|
this._r = _r;
|
|
5035
5326
|
}
|
|
5036
|
-
/**
|
|
5327
|
+
/**
|
|
5328
|
+
* List runtime installations in a workspace.
|
|
5329
|
+
*
|
|
5330
|
+
* v2.0.8 M448 (release201/20 §1) — `projectId` narrows scope:
|
|
5331
|
+
* - omitted | `'all'` → no project filter (legacy behaviour)
|
|
5332
|
+
* - `'__unscoped'` → only workspace-level rows (projectId IS NULL)
|
|
5333
|
+
* - any other string → exact projectId match
|
|
5334
|
+
*/
|
|
5037
5335
|
async list(workspaceId, options) {
|
|
5038
5336
|
const query = { workspaceId };
|
|
5039
5337
|
if (options?.limit != null) query.limit = String(options.limit);
|
|
5338
|
+
if (options?.projectId) query.projectId = options.projectId;
|
|
5040
5339
|
return this._r("GET", "/api/workspace/runtime-installations", void 0, query);
|
|
5041
5340
|
}
|
|
5042
5341
|
/**
|
|
@@ -5045,10 +5344,27 @@ var RuntimeInstallationsClient = class {
|
|
|
5045
5344
|
* The daemon receives `PRISMER_API_KEY`, `PRISMER_DAEMON_ID`,
|
|
5046
5345
|
* `PRISMER_BASE_URL`, `PRISMER_WORKSPACE_ID`, and
|
|
5047
5346
|
* `PRISMER_RUNTIME_KIND=workspace-daemon` env vars.
|
|
5347
|
+
*
|
|
5348
|
+
* v2.0.8 M448 — `options.projectId` (optional) opts into project scope.
|
|
5349
|
+
* Server validates it belongs to the same workspace and is `active`,
|
|
5350
|
+
* otherwise rejects 422 `PROJECT_WORKSPACE_MISMATCH` / `PROJECT_NOT_ACTIVE`.
|
|
5048
5351
|
*/
|
|
5049
5352
|
async create(options) {
|
|
5050
5353
|
return this._r("POST", "/api/workspace/runtime-installations", options);
|
|
5051
5354
|
}
|
|
5355
|
+
/**
|
|
5356
|
+
* v2.0.8 M448 (release201/20 §1) — update the project binding on an
|
|
5357
|
+
* existing runtime installation. Pass `projectId: null` to detach.
|
|
5358
|
+
* No-op when body omits `projectId`. Same workspace/active invariant as
|
|
5359
|
+
* create — returns 422 on mismatch.
|
|
5360
|
+
*/
|
|
5361
|
+
async patch(runtimeInstallationId, options) {
|
|
5362
|
+
return this._r(
|
|
5363
|
+
"PATCH",
|
|
5364
|
+
`/api/workspace/runtime-installations/${runtimeInstallationId}`,
|
|
5365
|
+
options
|
|
5366
|
+
);
|
|
5367
|
+
}
|
|
5052
5368
|
/**
|
|
5053
5369
|
* Install an agent onto a runtime daemon. Resolves or creates the agent
|
|
5054
5370
|
* profile, calls the controller's `installAgent` RPC, and stamps
|
|
@@ -5181,6 +5497,19 @@ var FilesClient = class {
|
|
|
5181
5497
|
*/
|
|
5182
5498
|
async sendFile(conversationId, input, opts) {
|
|
5183
5499
|
const uploaded = await this.upload(input, opts);
|
|
5500
|
+
const outboxDir = process.env.PRISMER_OUTBOX_DIR;
|
|
5501
|
+
if (outboxDir) {
|
|
5502
|
+
try {
|
|
5503
|
+
const fsMod = await import("fs");
|
|
5504
|
+
const pathMod = await import("path");
|
|
5505
|
+
const srcPath = typeof input === "string" ? input : input.path;
|
|
5506
|
+
if (srcPath && typeof srcPath === "string") {
|
|
5507
|
+
await fsMod.promises.mkdir(outboxDir, { recursive: true });
|
|
5508
|
+
fsMod.cpSync(srcPath, pathMod.join(outboxDir, pathMod.basename(srcPath)));
|
|
5509
|
+
}
|
|
5510
|
+
} catch {
|
|
5511
|
+
}
|
|
5512
|
+
}
|
|
5184
5513
|
const msgRes = await this._r("POST", `/api/im/messages/${conversationId}`, {
|
|
5185
5514
|
content: opts?.content || uploaded.fileName,
|
|
5186
5515
|
type: "file",
|
|
@@ -5389,6 +5718,36 @@ var IMRealtimeClient = class {
|
|
|
5389
5718
|
};
|
|
5390
5719
|
}
|
|
5391
5720
|
};
|
|
5721
|
+
var SkillsDraftClient = class {
|
|
5722
|
+
constructor(_r) {
|
|
5723
|
+
this._r = _r;
|
|
5724
|
+
}
|
|
5725
|
+
/** Create a draft skill from a manifest v1 payload. */
|
|
5726
|
+
async create(input) {
|
|
5727
|
+
return this._r("POST", "/api/im/skills/draft", input);
|
|
5728
|
+
}
|
|
5729
|
+
/** Apply incremental file ops to a draft. */
|
|
5730
|
+
async patch(id, input) {
|
|
5731
|
+
return this._r("PATCH", `/api/im/skills/${id}/draft`, input);
|
|
5732
|
+
}
|
|
5733
|
+
/** Request a regenerate session for a draft. */
|
|
5734
|
+
async regenerate(id, input) {
|
|
5735
|
+
return this._r("POST", `/api/im/skills/${id}/draft/regenerate`, input);
|
|
5736
|
+
}
|
|
5737
|
+
/** Fetch a single draft's manifest + revision history. */
|
|
5738
|
+
async show(id) {
|
|
5739
|
+
return this._r("GET", `/api/im/skills/draft/${id}`);
|
|
5740
|
+
}
|
|
5741
|
+
/** List drafts for a workspace (most-recently-updated first). */
|
|
5742
|
+
async list(workspaceId) {
|
|
5743
|
+
return this._r("GET", "/api/im/skills/drafts", void 0, { workspaceId });
|
|
5744
|
+
}
|
|
5745
|
+
};
|
|
5746
|
+
var SkillsClient = class {
|
|
5747
|
+
constructor(_r) {
|
|
5748
|
+
this.draft = new SkillsDraftClient(_r);
|
|
5749
|
+
}
|
|
5750
|
+
};
|
|
5392
5751
|
var IMClient = class {
|
|
5393
5752
|
constructor(request, wsBase, fetchFn, getAuthHeaders, offlineManager, communityHubConfig) {
|
|
5394
5753
|
this._request = request;
|
|
@@ -5402,16 +5761,22 @@ var IMClient = class {
|
|
|
5402
5761
|
this.credits = new CreditsClient(request);
|
|
5403
5762
|
this.workspace = new WorkspaceClient(request);
|
|
5404
5763
|
this.workspaces = new WorkspacesClient(request);
|
|
5764
|
+
this.invites = new InvitesClient(request);
|
|
5765
|
+
this.projects = new ProjectsClient(request);
|
|
5405
5766
|
this.workspaceFiles = new WorkspaceFilesClient(request);
|
|
5406
5767
|
this.assets = new AssetsClient(request, wsBase, fetchFn, getAuthHeaders);
|
|
5407
5768
|
this.runtimeInstallations = new RuntimeInstallationsClient(request);
|
|
5408
5769
|
this.tasks = new TasksClient(request);
|
|
5770
|
+
this.criteriaTemplates = new CriteriaTemplatesClient(request);
|
|
5409
5771
|
this.memory = new MemoryClient(request);
|
|
5410
5772
|
this.knowledge = new KnowledgeLinkClient(request);
|
|
5773
|
+
this.metrics = new MetricsClient(request);
|
|
5411
5774
|
this.identity = new IdentityClient(request);
|
|
5412
5775
|
this.security = new SecurityClient(request);
|
|
5413
5776
|
this.agents = new AgentsClient(request);
|
|
5414
5777
|
this.evolution = new EvolutionClient(request);
|
|
5778
|
+
this.skills = new SkillsClient(request);
|
|
5779
|
+
this.studio = new StudioClient(request);
|
|
5415
5780
|
this.community = new CommunityHub(request, communityHubConfig ?? void 0);
|
|
5416
5781
|
this.files = new FilesClient(request, wsBase, fetchFn, getAuthHeaders);
|
|
5417
5782
|
this.realtime = new IMRealtimeClient(wsBase, fetchFn);
|
|
@@ -5461,6 +5826,7 @@ var PrismerClient = class {
|
|
|
5461
5826
|
this.timeout = config.timeout || 3e4;
|
|
5462
5827
|
this.fetchFn = config.fetch || fetch;
|
|
5463
5828
|
this.imAgent = config.imAgent;
|
|
5829
|
+
this.imWorkspace = config.imWorkspace;
|
|
5464
5830
|
if (config.identity) {
|
|
5465
5831
|
if (config.identity === "auto" && this.apiKey) {
|
|
5466
5832
|
this._identityReady = AIPIdentity.fromApiKey(this.apiKey).then((id) => {
|
|
@@ -5519,6 +5885,8 @@ var PrismerClient = class {
|
|
|
5519
5885
|
config.community ?? null
|
|
5520
5886
|
);
|
|
5521
5887
|
this.workspaces = this.im.workspaces;
|
|
5888
|
+
this.invites = this.im.invites;
|
|
5889
|
+
this.projects = this.im.projects;
|
|
5522
5890
|
this.workspaceFiles = this.im.workspaceFiles;
|
|
5523
5891
|
this.assets = this.im.assets;
|
|
5524
5892
|
this.evolution = this.im.evolution;
|
|
@@ -5555,6 +5923,7 @@ var PrismerClient = class {
|
|
|
5555
5923
|
const headers = {};
|
|
5556
5924
|
if (this.apiKey) headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
5557
5925
|
if (this.imAgent) headers["X-IM-Agent"] = this.imAgent;
|
|
5926
|
+
if (this.imWorkspace) headers["X-IM-Workspace"] = this.imWorkspace;
|
|
5558
5927
|
return headers;
|
|
5559
5928
|
}
|
|
5560
5929
|
/**
|
|
@@ -5621,6 +5990,9 @@ var PrismerClient = class {
|
|
|
5621
5990
|
if (this.imAgent) {
|
|
5622
5991
|
headers["X-IM-Agent"] = this.imAgent;
|
|
5623
5992
|
}
|
|
5993
|
+
if (this.imWorkspace) {
|
|
5994
|
+
headers["X-IM-Workspace"] = this.imWorkspace;
|
|
5995
|
+
}
|
|
5624
5996
|
if (opts?.headers) {
|
|
5625
5997
|
for (const [k, v] of Object.entries(opts.headers)) headers[k] = v;
|
|
5626
5998
|
}
|
|
@@ -5729,6 +6101,7 @@ function createClient(config) {
|
|
|
5729
6101
|
export {
|
|
5730
6102
|
AIPIdentity,
|
|
5731
6103
|
AccountClient,
|
|
6104
|
+
AgentSkillsClient,
|
|
5732
6105
|
AgentsClient,
|
|
5733
6106
|
AssetsClient,
|
|
5734
6107
|
AttachmentQueue,
|
|
@@ -5737,6 +6110,7 @@ export {
|
|
|
5737
6110
|
ContactsClient,
|
|
5738
6111
|
ConversationsClient,
|
|
5739
6112
|
CreditsClient,
|
|
6113
|
+
CriteriaTemplatesClient,
|
|
5740
6114
|
DirectClient,
|
|
5741
6115
|
E2EEncryption,
|
|
5742
6116
|
ENVIRONMENTS,
|
|
@@ -5750,22 +6124,32 @@ export {
|
|
|
5750
6124
|
IMRealtimeClient,
|
|
5751
6125
|
IdentityClient,
|
|
5752
6126
|
IndexedDBStorage,
|
|
6127
|
+
InvitesClient,
|
|
5753
6128
|
KnowledgeLinkClient,
|
|
5754
6129
|
MemoryClient,
|
|
5755
6130
|
MemoryStorage,
|
|
5756
6131
|
MessagesClient,
|
|
6132
|
+
MetricsClient,
|
|
5757
6133
|
OfflineManager,
|
|
5758
6134
|
PrismerClient,
|
|
6135
|
+
ProjectMembersClient,
|
|
6136
|
+
ProjectsClient,
|
|
5759
6137
|
RealtimeSSEClient,
|
|
5760
6138
|
RealtimeWSClient,
|
|
5761
6139
|
RuntimeInstallationsClient,
|
|
5762
6140
|
SQLiteStorage,
|
|
5763
6141
|
SecurityClient,
|
|
6142
|
+
SkillsClient,
|
|
6143
|
+
SkillsDraftClient,
|
|
6144
|
+
StudioClient,
|
|
6145
|
+
StudioEvolutionClient,
|
|
5764
6146
|
TabCoordinator,
|
|
5765
6147
|
TasksClient,
|
|
5766
6148
|
WORKSPACE_ASSETS_ROUTE,
|
|
5767
6149
|
WorkspaceClient,
|
|
5768
6150
|
WorkspaceFilesClient,
|
|
6151
|
+
WorkspaceInvitesClient,
|
|
6152
|
+
WorkspaceMembersClient,
|
|
5769
6153
|
WorkspacesClient,
|
|
5770
6154
|
createClient,
|
|
5771
6155
|
createEnrichedExtractor,
|