@bobannomi/client 0.7.0 → 0.8.1
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 +18 -2
- package/dist/index.d.ts +484 -123
- package/dist/index.js +213 -33
- package/dist/index.js.map +3 -3
- package/dist/service.js +221 -41
- package/dist/service.js.map +3 -3
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
// ../plugin-contracts/src/manifest/desktop.ts
|
|
2
|
+
var DESKTOP_COMPOSER_PLACEMENTS = [
|
|
3
|
+
"composer.above",
|
|
4
|
+
"composer.toolbar.left",
|
|
5
|
+
"composer.toolbar.right"
|
|
6
|
+
];
|
|
7
|
+
var DESKTOP_PLACEMENTS = [
|
|
8
|
+
"start.visual",
|
|
9
|
+
"shell.floating",
|
|
10
|
+
"appearance.theme",
|
|
11
|
+
"shell.brand",
|
|
12
|
+
"conversation.view",
|
|
13
|
+
"tools.panel",
|
|
14
|
+
"conversation.header.actions",
|
|
15
|
+
...DESKTOP_COMPOSER_PLACEMENTS,
|
|
16
|
+
"settings.extension",
|
|
17
|
+
"main.page"
|
|
18
|
+
];
|
|
19
|
+
|
|
1
20
|
// ../domain-contracts/src/sessions/records.ts
|
|
2
21
|
var SESSION_EVENT_SCHEMA_VERSION = 1;
|
|
3
22
|
var SESSION_EVENT_SCHEMA_VERSIONS = {
|
|
@@ -1528,7 +1547,7 @@ function parseAttachmentUploadRequest(value) {
|
|
|
1528
1547
|
}
|
|
1529
1548
|
|
|
1530
1549
|
// ../protocol/src/runtime/capabilities.ts
|
|
1531
|
-
var CURRENT_PROTOCOL_VERSION =
|
|
1550
|
+
var CURRENT_PROTOCOL_VERSION = 1;
|
|
1532
1551
|
var PROTOCOL_VERSION_HEADER = "x-bobannomi-protocol-version";
|
|
1533
1552
|
function parseServerCapabilities(value) {
|
|
1534
1553
|
if (!isRecord2(value))
|
|
@@ -2910,10 +2929,7 @@ async function create(transport, input, options = {}, prepareModel) {
|
|
|
2910
2929
|
{
|
|
2911
2930
|
method: "POST",
|
|
2912
2931
|
body,
|
|
2913
|
-
headers: {
|
|
2914
|
-
...body.workspaceId === void 0 ? {} : { "x-bobannomi-workspace-id": body.workspaceId },
|
|
2915
|
-
...modelConnection === void 0 ? {} : { "x-bobannomi-model-connection": modelConnection }
|
|
2916
|
-
},
|
|
2932
|
+
...modelConnection === void 0 ? {} : { headers: { "x-bobannomi-model-connection": modelConnection } },
|
|
2917
2933
|
signal: options.signal
|
|
2918
2934
|
}
|
|
2919
2935
|
);
|
|
@@ -3669,10 +3685,9 @@ async function waitForRun(client, options) {
|
|
|
3669
3685
|
const bucket = update.state.buckets[options.sessionId];
|
|
3670
3686
|
const run = bucket?.runs[options.runId];
|
|
3671
3687
|
if (!run || run.status === "pending" || run.status === "running") continue;
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
};
|
|
3688
|
+
const messages = getVisibleSessionMessages(bucket).filter((item) => item.message.runId === options.runId);
|
|
3689
|
+
const text3 = messages.filter(({ message }) => message.role === "assistant").flatMap(({ parts }) => parts.filter((part) => part.type === "text").map((part) => part.text ?? "")).join("");
|
|
3690
|
+
return { run, messages, text: text3 };
|
|
3676
3691
|
}
|
|
3677
3692
|
options.signal?.throwIfAborted();
|
|
3678
3693
|
throw new Error(`Run ${options.runId} observation ended before a terminal state was available`);
|
|
@@ -3933,8 +3948,8 @@ async function interrupt(transport, sessionId, options = {}) {
|
|
|
3933
3948
|
);
|
|
3934
3949
|
}
|
|
3935
3950
|
|
|
3936
|
-
// src/resources/session/session
|
|
3937
|
-
function
|
|
3951
|
+
// src/resources/session/session.ts
|
|
3952
|
+
function bindSession(transport, syncClient, management, sessionId, prepareModel) {
|
|
3938
3953
|
function cancelQueuedPrompt2(inputId, input, options) {
|
|
3939
3954
|
return cancelQueuedPrompt(transport, sessionId, inputId, input, options);
|
|
3940
3955
|
}
|
|
@@ -3983,7 +3998,12 @@ function createSessionHandle(transport, syncClient, management, sessionId, prepa
|
|
|
3983
3998
|
return decodeAgentSessionStateSnapshot(response);
|
|
3984
3999
|
},
|
|
3985
4000
|
/** `POST /sessions/:id/prompts` — 提交用户输入并触发/排队一次 run。 */
|
|
3986
|
-
prompt(input, options
|
|
4001
|
+
async prompt(input, options) {
|
|
4002
|
+
if (input.text !== void 0) {
|
|
4003
|
+
const { text: text3, ...fields3 } = input;
|
|
4004
|
+
if (fields3.items !== void 0) throw new TypeError("Pass either text or items to session.prompt()");
|
|
4005
|
+
return admitPrompt(transport, sessionId, { ...fields3, items: [{ type: "text", text: text3 }] }, options);
|
|
4006
|
+
}
|
|
3987
4007
|
return admitPrompt(transport, sessionId, input, options);
|
|
3988
4008
|
},
|
|
3989
4009
|
/** `POST /sessions/:id/interrupt` — 中断当前/排队中的 run。 */
|
|
@@ -4216,7 +4236,7 @@ var SessionResource = class {
|
|
|
4216
4236
|
/** Bind a session ID locally. Operations use this resource's daemon connection when called. */
|
|
4217
4237
|
byId(sessionId) {
|
|
4218
4238
|
if (typeof sessionId !== "string" || sessionId.length === 0) throw new TypeError("sessionId is required");
|
|
4219
|
-
return
|
|
4239
|
+
return bindSession(this.#transport, { sessions: this, events: this.#events }, this.#management, sessionId, this.prepareModel);
|
|
4220
4240
|
}
|
|
4221
4241
|
/** `GET /sessions/search` - search saved conversation text without opening it. */
|
|
4222
4242
|
async search(options) {
|
|
@@ -4245,9 +4265,10 @@ var SessionResource = class {
|
|
|
4245
4265
|
getDraftComposerOptions(input, options = {}) {
|
|
4246
4266
|
return getDraftComposerOptions(this.#transport, input, options);
|
|
4247
4267
|
}
|
|
4248
|
-
/**
|
|
4249
|
-
create(input, options = {}) {
|
|
4250
|
-
|
|
4268
|
+
/** Create a session and bind its operations to this connection. */
|
|
4269
|
+
async create(input, options = {}) {
|
|
4270
|
+
const record5 = await create(this.#transport, input, options, this.prepareModel);
|
|
4271
|
+
return { ...this.byId(record5.id), record: record5 };
|
|
4251
4272
|
}
|
|
4252
4273
|
getConfigurationOptions(input, options = {}) {
|
|
4253
4274
|
return getConfigurationOptions(this.#transport, input, options);
|
|
@@ -4263,7 +4284,7 @@ var AttachmentResource = class {
|
|
|
4263
4284
|
this.transport = transport;
|
|
4264
4285
|
}
|
|
4265
4286
|
transport;
|
|
4266
|
-
/**
|
|
4287
|
+
/** Inspect and maintain attachment storage for the current daemon. */
|
|
4267
4288
|
storage = {
|
|
4268
4289
|
scan: (options) => this.transport.request("/attachments/storage", options),
|
|
4269
4290
|
repair: (options) => this.transport.request("/attachments/storage/actions", { ...options, method: "POST", body: { action: "repair-safe" } }),
|
|
@@ -4278,19 +4299,24 @@ var AttachmentResource = class {
|
|
|
4278
4299
|
method: "POST",
|
|
4279
4300
|
headers: headers2,
|
|
4280
4301
|
body: input.body,
|
|
4302
|
+
query: { sessionId: input.sessionId },
|
|
4281
4303
|
signal: input.signal
|
|
4282
4304
|
});
|
|
4283
4305
|
return parseAttachmentAssetRecord(await response.json());
|
|
4284
4306
|
}
|
|
4285
4307
|
async getUpload(input) {
|
|
4286
|
-
const response = await this.transport.requestResponse("/attachments/uploads", {
|
|
4308
|
+
const response = await this.transport.requestResponse("/attachments/uploads", {
|
|
4309
|
+
headers: uploadIdentityHeaders(input),
|
|
4310
|
+
query: { sessionId: input.sessionId },
|
|
4311
|
+
signal: input.signal
|
|
4312
|
+
});
|
|
4287
4313
|
const value = await response.json();
|
|
4288
4314
|
return value === null ? null : parseAttachmentAssetRecord(value);
|
|
4289
4315
|
}
|
|
4290
4316
|
async get(id2, options = {}) {
|
|
4291
4317
|
const value = await this.transport.request(
|
|
4292
4318
|
`/attachments/${encodeURIComponent(id2)}`,
|
|
4293
|
-
{ signal: options.signal }
|
|
4319
|
+
{ query: { sessionId: options.sessionId }, signal: options.signal }
|
|
4294
4320
|
);
|
|
4295
4321
|
return parseAttachmentAssetRecord(value);
|
|
4296
4322
|
}
|
|
@@ -4301,13 +4327,13 @@ var AttachmentResource = class {
|
|
|
4301
4327
|
if (range) headers2.range = range;
|
|
4302
4328
|
return await this.transport.requestResponse(
|
|
4303
4329
|
`/attachments/${encodeURIComponent(id2)}/content`,
|
|
4304
|
-
{ method: "GET", headers: headers2, signal: options.signal }
|
|
4330
|
+
{ method: "GET", headers: headers2, query: { sessionId: options.sessionId }, signal: options.signal }
|
|
4305
4331
|
);
|
|
4306
4332
|
}
|
|
4307
|
-
async delete(id2, options
|
|
4333
|
+
async delete(id2, options) {
|
|
4308
4334
|
const value = await this.transport.request(
|
|
4309
4335
|
`/attachments/${encodeURIComponent(id2)}`,
|
|
4310
|
-
{ method: "DELETE", signal: options.signal }
|
|
4336
|
+
{ method: "DELETE", query: { sessionId: options.sessionId, draftId: options.draftId }, signal: options.signal }
|
|
4311
4337
|
);
|
|
4312
4338
|
return parseAttachmentAssetRecord(value);
|
|
4313
4339
|
}
|
|
@@ -4506,7 +4532,7 @@ var PluginMarketplaceResource = class {
|
|
|
4506
4532
|
this.transport = transport;
|
|
4507
4533
|
}
|
|
4508
4534
|
transport;
|
|
4509
|
-
catalog({ signal, ...query }) {
|
|
4535
|
+
catalog({ signal, ...query } = {}) {
|
|
4510
4536
|
return this.transport.request(`${market}/catalog`, { query, signal });
|
|
4511
4537
|
}
|
|
4512
4538
|
listSources(options) {
|
|
@@ -4547,6 +4573,7 @@ function matchingOperation(receipt2, operationId) {
|
|
|
4547
4573
|
}
|
|
4548
4574
|
|
|
4549
4575
|
// src/resources/plugins/plugin-resource.ts
|
|
4576
|
+
var archiveUploads = "/plugins/archive/uploads";
|
|
4550
4577
|
var PluginResource = class {
|
|
4551
4578
|
constructor(transport) {
|
|
4552
4579
|
this.transport = transport;
|
|
@@ -4555,9 +4582,13 @@ var PluginResource = class {
|
|
|
4555
4582
|
transport;
|
|
4556
4583
|
marketplace;
|
|
4557
4584
|
/** List native plugins for a directory in the daemon environment. */
|
|
4558
|
-
list({ signal, cwd }) {
|
|
4585
|
+
list({ signal, cwd } = {}) {
|
|
4559
4586
|
return this.transport.request("/plugins", { query: { cwd }, signal });
|
|
4560
4587
|
}
|
|
4588
|
+
/** Load an image from an installed plugin or a marketplace entry in the daemon. */
|
|
4589
|
+
getIcon(input, options) {
|
|
4590
|
+
return this.transport.request("/plugins/icon", { ...options, query: input });
|
|
4591
|
+
}
|
|
4561
4592
|
enable(id2, input, options) {
|
|
4562
4593
|
return this.transport.request(`/plugins/${encodeURIComponent(id2)}/enable`, { ...options, method: "POST", body: input });
|
|
4563
4594
|
}
|
|
@@ -4588,6 +4619,37 @@ var PluginResource = class {
|
|
|
4588
4619
|
installArchive(input, options) {
|
|
4589
4620
|
return this.transport.request("/plugins/archive/install", { ...options, method: "POST", body: input });
|
|
4590
4621
|
}
|
|
4622
|
+
/** Preview a client-selected archive by uploading its bytes to the daemon. */
|
|
4623
|
+
async uploadArchive(input, options) {
|
|
4624
|
+
const format = input.fileName.toLowerCase().match(/\.(zip|tar|tar\.gz|tgz)$/)?.[1];
|
|
4625
|
+
if (!format) throw new Error("Plugin archive must be ZIP, TAR, TAR.GZ or TGZ");
|
|
4626
|
+
const response = await this.transport.requestResponse(archiveUploads, {
|
|
4627
|
+
...options,
|
|
4628
|
+
method: "POST",
|
|
4629
|
+
body: input.archive,
|
|
4630
|
+
query: { cwd: input.cwd, format },
|
|
4631
|
+
headers: { "content-type": "application/octet-stream" }
|
|
4632
|
+
});
|
|
4633
|
+
const preview = await response.json();
|
|
4634
|
+
if (!preview?.candidateId || !/^[a-f0-9]{64}$/.test(preview.archiveDigest)) {
|
|
4635
|
+
throw new ProtocolDataError("Plugin archive preview is missing its candidate ID or SHA-256 digest");
|
|
4636
|
+
}
|
|
4637
|
+
return preview;
|
|
4638
|
+
}
|
|
4639
|
+
/** Release an uploaded archive preview. Unclaimed previews also expire. */
|
|
4640
|
+
cancelUploadedArchive(candidateId, options) {
|
|
4641
|
+
return this.transport.request(`${archiveUploads}/${encodeURIComponent(candidateId)}`, { ...options, method: "DELETE" });
|
|
4642
|
+
}
|
|
4643
|
+
/** Save the operation ID before submitting. Recover an uncertain result with getArchiveInstallOperation. */
|
|
4644
|
+
async installUploadedArchive(input, options) {
|
|
4645
|
+
const receipt2 = await this.transport.request(`${archiveUploads}/install`, { ...options, method: "POST", body: input });
|
|
4646
|
+
return matchingArchiveReceipt(receipt2, input.operationId);
|
|
4647
|
+
}
|
|
4648
|
+
/** Read the result of the original upload install without submitting it again. */
|
|
4649
|
+
async getArchiveInstallOperation(operationId, options) {
|
|
4650
|
+
const receipt2 = await this.transport.request(`${archiveUploads}/operations/${encodeURIComponent(operationId)}`, options);
|
|
4651
|
+
return matchingArchiveReceipt(receipt2, operationId);
|
|
4652
|
+
}
|
|
4591
4653
|
/** Read the digest and required permissions for a Git source. */
|
|
4592
4654
|
previewGit(input, options) {
|
|
4593
4655
|
return this.transport.request("/plugins/git/preview", { ...options, method: "POST", body: input });
|
|
@@ -4599,10 +4661,14 @@ var PluginResource = class {
|
|
|
4599
4661
|
uninstall(id2, input, options) {
|
|
4600
4662
|
return this.transport.request(`/plugins/${encodeURIComponent(id2)}`, { ...options, method: "DELETE", body: input });
|
|
4601
4663
|
}
|
|
4602
|
-
reload(input, options) {
|
|
4664
|
+
reload(input = {}, options) {
|
|
4603
4665
|
return this.transport.request("/plugins/reload", { ...options, method: "POST", body: input });
|
|
4604
4666
|
}
|
|
4605
4667
|
};
|
|
4668
|
+
function matchingArchiveReceipt(receipt2, operationId) {
|
|
4669
|
+
if (receipt2?.operationId !== operationId) throw new ProtocolDataError("Plugin archive receipt does not match original operation", "operationId");
|
|
4670
|
+
return receipt2;
|
|
4671
|
+
}
|
|
4606
4672
|
|
|
4607
4673
|
// src/resources/channels/channel-resource.ts
|
|
4608
4674
|
var ChannelResource = class {
|
|
@@ -4624,7 +4690,7 @@ var ChannelResource = class {
|
|
|
4624
4690
|
disconnect: (options) => this.transport.request("/channels/feishu", { ...options, method: "DELETE" }),
|
|
4625
4691
|
allowlist: {
|
|
4626
4692
|
add: (input, options) => this.transport.request("/channels/feishu/allow", { ...options, method: "POST", body: input }),
|
|
4627
|
-
remove: (key, options) => this.transport.request(
|
|
4693
|
+
remove: (key, options) => this.transport.request("/channels/feishu/allow", { ...options, method: "DELETE", query: { key } })
|
|
4628
4694
|
},
|
|
4629
4695
|
registration: {
|
|
4630
4696
|
start: (input = {}, options) => this.transport.request("/channels/feishu/registration", { ...options, method: "POST", body: input }),
|
|
@@ -4669,6 +4735,14 @@ var ProjectResource = class {
|
|
|
4669
4735
|
this.transport = transport;
|
|
4670
4736
|
}
|
|
4671
4737
|
transport;
|
|
4738
|
+
/** Read the daemon's registered project directories and their current directory identities. */
|
|
4739
|
+
listDirectories(options) {
|
|
4740
|
+
return this.transport.request("/projects/directories", options);
|
|
4741
|
+
}
|
|
4742
|
+
/** Apply the default shell only while the observed project and registered directory still match. */
|
|
4743
|
+
setDirectoryDefaultShell(input, options) {
|
|
4744
|
+
return this.transport.request("/projects/directories/default-shell", { ...options, method: "PATCH", body: input });
|
|
4745
|
+
}
|
|
4672
4746
|
/** `GET /projects` */
|
|
4673
4747
|
async list(options = {}) {
|
|
4674
4748
|
const { signal, ...query } = options;
|
|
@@ -4678,7 +4752,7 @@ var ProjectResource = class {
|
|
|
4678
4752
|
);
|
|
4679
4753
|
return response.projects;
|
|
4680
4754
|
}
|
|
4681
|
-
/** Register or reopen a
|
|
4755
|
+
/** Register or reopen a project on the daemon host, recording the directory identity and last-opened time. */
|
|
4682
4756
|
async register(path2, options) {
|
|
4683
4757
|
return (await this.transport.request("/projects/inspect", {
|
|
4684
4758
|
...options,
|
|
@@ -4711,7 +4785,7 @@ var ProjectResource = class {
|
|
|
4711
4785
|
{ ...options, method: "PATCH", body: { defaultShell } }
|
|
4712
4786
|
)).project;
|
|
4713
4787
|
}
|
|
4714
|
-
/**
|
|
4788
|
+
/** Rebind a project to the current directory at path. Pass the prior project path as expectedPath to reject a stale update. */
|
|
4715
4789
|
async rebind(projectId, path2, options) {
|
|
4716
4790
|
const { expectedPath, signal } = typeof options === "string" ? { expectedPath: options } : options ?? {};
|
|
4717
4791
|
return (await this.transport.request(
|
|
@@ -4760,11 +4834,58 @@ var WorktreeResource = class {
|
|
|
4760
4834
|
};
|
|
4761
4835
|
|
|
4762
4836
|
// src/resources/workspace/git-resource.ts
|
|
4837
|
+
var GitWorkspaceResource = class {
|
|
4838
|
+
constructor(transport, target) {
|
|
4839
|
+
this.transport = transport;
|
|
4840
|
+
this.target = target;
|
|
4841
|
+
}
|
|
4842
|
+
transport;
|
|
4843
|
+
target;
|
|
4844
|
+
status(options) {
|
|
4845
|
+
return this.read("git.status", {}, options);
|
|
4846
|
+
}
|
|
4847
|
+
listBranches(options) {
|
|
4848
|
+
return this.read("git.listBranches", {}, options);
|
|
4849
|
+
}
|
|
4850
|
+
changes(params = {}, options) {
|
|
4851
|
+
return this.read("git.changes", params, options);
|
|
4852
|
+
}
|
|
4853
|
+
diff(params = {}, options) {
|
|
4854
|
+
return this.read("git.diff", params, options);
|
|
4855
|
+
}
|
|
4856
|
+
/** Submit an original branch operation for a registered project. */
|
|
4857
|
+
changeBranch(requestId, original, options) {
|
|
4858
|
+
return this.transport.request("/git/workspace/branch", {
|
|
4859
|
+
...options,
|
|
4860
|
+
method: "POST",
|
|
4861
|
+
body: { target: this.target, requestId, original }
|
|
4862
|
+
});
|
|
4863
|
+
}
|
|
4864
|
+
/** Query the same original body and request ID after an interrupted branch operation. */
|
|
4865
|
+
getBranchOperation(requestId, original, options) {
|
|
4866
|
+
return this.transport.request("/git/workspace/branch-result", {
|
|
4867
|
+
...options,
|
|
4868
|
+
method: "POST",
|
|
4869
|
+
body: { target: this.target, requestId, original }
|
|
4870
|
+
});
|
|
4871
|
+
}
|
|
4872
|
+
read(method, params, options) {
|
|
4873
|
+
return this.transport.request("/git/workspace/read", {
|
|
4874
|
+
...options,
|
|
4875
|
+
method: "POST",
|
|
4876
|
+
body: { target: this.target, method, params }
|
|
4877
|
+
});
|
|
4878
|
+
}
|
|
4879
|
+
};
|
|
4763
4880
|
var GitResource = class {
|
|
4764
4881
|
constructor(transport) {
|
|
4765
4882
|
this.transport = transport;
|
|
4766
4883
|
}
|
|
4767
4884
|
transport;
|
|
4885
|
+
/** Open Git operations for a registered project or an existing session in the current daemon. */
|
|
4886
|
+
workspace(target) {
|
|
4887
|
+
return new GitWorkspaceResource(this.transport, structuredClone(target));
|
|
4888
|
+
}
|
|
4768
4889
|
/** `GET /git/diff?cwd=&full=` */
|
|
4769
4890
|
async getDiff(options) {
|
|
4770
4891
|
const { signal, cwd, full } = options;
|
|
@@ -4830,6 +4951,11 @@ var McpServersResource = class {
|
|
|
4830
4951
|
list(options) {
|
|
4831
4952
|
return this.request(this.basePath, options);
|
|
4832
4953
|
}
|
|
4954
|
+
/** List manually configured and application-registered connections without credentials. */
|
|
4955
|
+
async inventory(options) {
|
|
4956
|
+
await requireDaemonFeature(this.transport, "mcpServerInventory", options?.signal);
|
|
4957
|
+
return this.request(`${this.basePath}/config/inventory`, options);
|
|
4958
|
+
}
|
|
4833
4959
|
getConfig(name, options) {
|
|
4834
4960
|
return this.request(this.serverPath(name), options);
|
|
4835
4961
|
}
|
|
@@ -4843,13 +4969,13 @@ var McpServersResource = class {
|
|
|
4843
4969
|
return this.request(this.serverPath(name), { ...options, method: "PUT", body });
|
|
4844
4970
|
}
|
|
4845
4971
|
setEnabled({ name, enabled }, options) {
|
|
4846
|
-
return this.request(
|
|
4972
|
+
return this.request(this.serverPath(name, "/enabled"), { ...options, method: "PUT", body: { enabled } });
|
|
4847
4973
|
}
|
|
4848
4974
|
remove(name, options) {
|
|
4849
4975
|
return this.request(this.serverPath(name), { ...options, method: "DELETE" });
|
|
4850
4976
|
}
|
|
4851
|
-
serverPath(name) {
|
|
4852
|
-
return `${this.basePath}
|
|
4977
|
+
serverPath(name, suffix = "") {
|
|
4978
|
+
return this.transport.path(`${this.basePath}/config/entry${suffix}`, { name });
|
|
4853
4979
|
}
|
|
4854
4980
|
async request(path2, options) {
|
|
4855
4981
|
await requireDaemonFeature(this.transport, "mcpServerManagement", options?.signal);
|
|
@@ -4901,7 +5027,7 @@ var McpResource = class {
|
|
|
4901
5027
|
}
|
|
4902
5028
|
async startLogin(name, input, options = {}) {
|
|
4903
5029
|
return await this.transport.request(
|
|
4904
|
-
|
|
5030
|
+
this.transport.path("/mcp/oauth/login", { name }),
|
|
4905
5031
|
{ method: "POST", body: input, signal: options.signal }
|
|
4906
5032
|
);
|
|
4907
5033
|
}
|
|
@@ -4925,7 +5051,7 @@ var McpResource = class {
|
|
|
4925
5051
|
}
|
|
4926
5052
|
async logout(name, options = {}) {
|
|
4927
5053
|
return await this.transport.request(
|
|
4928
|
-
|
|
5054
|
+
this.transport.path("/mcp/oauth/logout", { name }),
|
|
4929
5055
|
{ method: "POST", body: {}, signal: options.signal }
|
|
4930
5056
|
);
|
|
4931
5057
|
}
|
|
@@ -5067,6 +5193,8 @@ var MaintenanceResource = class {
|
|
|
5067
5193
|
usage = {
|
|
5068
5194
|
get: (input = {}, options) => this.post("/usage", input, options),
|
|
5069
5195
|
getSettings: (options) => this.transport.request("/maintenance/usage/settings", options),
|
|
5196
|
+
/** Read whether known usage has reached the current monthly budget. */
|
|
5197
|
+
getBudgetStatus: (options) => this.transport.request("/maintenance/usage/budget", options),
|
|
5070
5198
|
updateBudget: (input, options) => this.post("/usage/budget", input, options),
|
|
5071
5199
|
addPrice: (input, options) => this.post("/usage/price", input, options)
|
|
5072
5200
|
};
|
|
@@ -5169,6 +5297,58 @@ var SettingsResource = class {
|
|
|
5169
5297
|
this.transport = transport;
|
|
5170
5298
|
}
|
|
5171
5299
|
transport;
|
|
5300
|
+
/** Runtime environment management from an existing full daemon connection. */
|
|
5301
|
+
runtimeEnvironment = {
|
|
5302
|
+
get: async ({ cwd } = {}, options) => {
|
|
5303
|
+
await requireDaemonFeature(this.transport, "runtimeEnvironmentSettings", options?.signal);
|
|
5304
|
+
return this.transport.request(this.transport.path("/settings/runtime-environment", { cwd }), options);
|
|
5305
|
+
},
|
|
5306
|
+
save: async (input, options) => {
|
|
5307
|
+
await requireDaemonFeature(this.transport, "runtimeEnvironmentSettings", options?.signal);
|
|
5308
|
+
return this.transport.request("/settings/runtime-environment", { ...options, method: "PATCH", body: input });
|
|
5309
|
+
},
|
|
5310
|
+
check: async (input, options) => {
|
|
5311
|
+
await requireDaemonFeature(this.transport, "runtimeEnvironmentSettings", options?.signal);
|
|
5312
|
+
return this.transport.request("/settings/runtime-environment/check", { ...options, method: "POST", body: input });
|
|
5313
|
+
}
|
|
5314
|
+
};
|
|
5315
|
+
/** Global or registered-project memory configuration from a full daemon connection. */
|
|
5316
|
+
personalization = {
|
|
5317
|
+
get: async ({ projectId } = {}, options) => {
|
|
5318
|
+
await requireDaemonFeature(this.transport, "personalizationSettings", options?.signal);
|
|
5319
|
+
return this.transport.request(this.transport.path("/settings/personalization", { projectId }), options);
|
|
5320
|
+
},
|
|
5321
|
+
save: async (input, options) => {
|
|
5322
|
+
await requireDaemonFeature(this.transport, "personalizationSettings", options?.signal);
|
|
5323
|
+
return this.transport.request("/settings/personalization", { ...options, method: "PATCH", body: input });
|
|
5324
|
+
}
|
|
5325
|
+
};
|
|
5326
|
+
/** Export selected non-secret settings and confirm an import preview from the same daemon. */
|
|
5327
|
+
portable = {
|
|
5328
|
+
export: async (categories, options) => {
|
|
5329
|
+
await requireDaemonFeature(this.transport, "portableConfigurationSettings", options?.signal);
|
|
5330
|
+
return this.transport.request("/settings/portable/export", { ...options, method: "POST", body: { categories } });
|
|
5331
|
+
},
|
|
5332
|
+
preview: async (value, options) => {
|
|
5333
|
+
await requireDaemonFeature(this.transport, "portableConfigurationSettings", options?.signal);
|
|
5334
|
+
return this.transport.request("/settings/portable/preview", { ...options, method: "POST", body: { value } });
|
|
5335
|
+
},
|
|
5336
|
+
apply: async ({ id: id2, categories }, options) => {
|
|
5337
|
+
await requireDaemonFeature(this.transport, "portableConfigurationSettings", options?.signal);
|
|
5338
|
+
await this.update({ importConfiguration: { previewId: id2, categories } }, options);
|
|
5339
|
+
}
|
|
5340
|
+
};
|
|
5341
|
+
/** Read the daemon's effective isolation availability or check a draft rule without running it. */
|
|
5342
|
+
permissionConfiguration = {
|
|
5343
|
+
get: async (options) => {
|
|
5344
|
+
await requireDaemonFeature(this.transport, "permissionConfigurationSettings", options?.signal);
|
|
5345
|
+
return this.transport.request("/settings/permissions", options);
|
|
5346
|
+
},
|
|
5347
|
+
check: async (input, options) => {
|
|
5348
|
+
await requireDaemonFeature(this.transport, "permissionConfigurationSettings", options?.signal);
|
|
5349
|
+
return this.transport.request("/settings/permissions/check", { ...options, method: "POST", body: input });
|
|
5350
|
+
}
|
|
5351
|
+
};
|
|
5172
5352
|
/** Read the daemon's current global settings. */
|
|
5173
5353
|
getGlobal({ signal } = {}) {
|
|
5174
5354
|
return this.get({ signal });
|