agentuity-vscode 0.1.22 → 0.1.24
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/extension.js +1839 -578
- package/package.json +347 -2
- package/src/core/cliClient.ts +401 -4
- package/src/core/urls.ts +54 -0
- package/src/extension.ts +85 -0
- package/src/features/agentExplorer/index.ts +3 -4
- package/src/features/chat/agentTools.ts +387 -1
- package/src/features/codeLens/index.ts +2 -3
- package/src/features/customAgents/index.ts +28 -29
- package/src/features/dataExplorer/dataTreeData.ts +386 -18
- package/src/features/dataExplorer/index.ts +463 -0
- package/src/features/devServer/devServerManager.ts +3 -3
- package/src/features/sandboxExplorer/sandboxTreeData.ts +16 -3
- package/src/features/workbench/index.ts +3 -4
package/dist/extension.js
CHANGED
|
@@ -6104,7 +6104,7 @@ __export(extension_exports, {
|
|
|
6104
6104
|
deactivate: () => deactivate
|
|
6105
6105
|
});
|
|
6106
6106
|
module.exports = __toCommonJS(extension_exports);
|
|
6107
|
-
var
|
|
6107
|
+
var vscode28 = __toESM(require("vscode"));
|
|
6108
6108
|
|
|
6109
6109
|
// src/core/cliClient.ts
|
|
6110
6110
|
var vscode = __toESM(require("vscode"));
|
|
@@ -7181,6 +7181,48 @@ var CliClient = class {
|
|
|
7181
7181
|
async whoami() {
|
|
7182
7182
|
return this.exec(["auth", "whoami"], { format: "json" });
|
|
7183
7183
|
}
|
|
7184
|
+
// ==================== Org/Region Methods ====================
|
|
7185
|
+
async orgList() {
|
|
7186
|
+
const result = await this.exec(["auth", "whoami"], {
|
|
7187
|
+
format: "json"
|
|
7188
|
+
});
|
|
7189
|
+
if (result.success && result.data) {
|
|
7190
|
+
const whoamiData = result.data;
|
|
7191
|
+
return {
|
|
7192
|
+
success: true,
|
|
7193
|
+
data: whoamiData.organizations || [],
|
|
7194
|
+
exitCode: result.exitCode
|
|
7195
|
+
};
|
|
7196
|
+
}
|
|
7197
|
+
return { success: result.success, error: result.error, data: [], exitCode: result.exitCode };
|
|
7198
|
+
}
|
|
7199
|
+
async orgCurrent() {
|
|
7200
|
+
return this.exec(["auth", "org", "current"], { format: "json" });
|
|
7201
|
+
}
|
|
7202
|
+
async orgSelect(orgId) {
|
|
7203
|
+
return this.exec(["auth", "org", "select", orgId], { format: "json" });
|
|
7204
|
+
}
|
|
7205
|
+
async orgUnselect() {
|
|
7206
|
+
return this.exec(["auth", "org", "unselect"], { format: "json" });
|
|
7207
|
+
}
|
|
7208
|
+
async regionList() {
|
|
7209
|
+
const regions = [
|
|
7210
|
+
{ region: "usc", description: "US Central" },
|
|
7211
|
+
{ region: "use", description: "US East" }
|
|
7212
|
+
];
|
|
7213
|
+
return { success: true, data: regions, exitCode: 0 };
|
|
7214
|
+
}
|
|
7215
|
+
async regionCurrent() {
|
|
7216
|
+
return this.exec(["cloud", "region", "current"], { format: "json" });
|
|
7217
|
+
}
|
|
7218
|
+
async regionSelect(region) {
|
|
7219
|
+
return this.exec(["cloud", "region", "select", region], {
|
|
7220
|
+
format: "json"
|
|
7221
|
+
});
|
|
7222
|
+
}
|
|
7223
|
+
async regionUnselect() {
|
|
7224
|
+
return this.exec(["cloud", "region", "unselect"], { format: "json" });
|
|
7225
|
+
}
|
|
7184
7226
|
async listAgents() {
|
|
7185
7227
|
return this.exec(["cloud", "agent", "list"], { format: "json" });
|
|
7186
7228
|
}
|
|
@@ -7273,11 +7315,150 @@ var CliClient = class {
|
|
|
7273
7315
|
async deleteStream(id) {
|
|
7274
7316
|
return this.exec(["cloud", "stream", "delete", id], { format: "json" });
|
|
7275
7317
|
}
|
|
7318
|
+
// Queue methods
|
|
7319
|
+
async listQueues(opts) {
|
|
7320
|
+
const args = ["cloud", "queue", "list"];
|
|
7321
|
+
if (opts?.limit) {
|
|
7322
|
+
args.push("--limit", String(opts.limit));
|
|
7323
|
+
}
|
|
7324
|
+
if (opts?.offset) {
|
|
7325
|
+
args.push("--offset", String(opts.offset));
|
|
7326
|
+
}
|
|
7327
|
+
return this.exec(args, { format: "json" });
|
|
7328
|
+
}
|
|
7329
|
+
async getQueue(name2) {
|
|
7330
|
+
return this.exec(["cloud", "queue", "get", name2], { format: "json" });
|
|
7331
|
+
}
|
|
7332
|
+
async getQueueStats() {
|
|
7333
|
+
return this.exec(["cloud", "queue", "stats"], { format: "json" });
|
|
7334
|
+
}
|
|
7335
|
+
async listQueueMessages(queueName, opts) {
|
|
7336
|
+
const args = ["cloud", "queue", "messages", queueName];
|
|
7337
|
+
if (opts?.limit) {
|
|
7338
|
+
args.push("--limit", String(opts.limit));
|
|
7339
|
+
}
|
|
7340
|
+
if (opts?.offset) {
|
|
7341
|
+
args.push("--offset", String(opts.offset));
|
|
7342
|
+
}
|
|
7343
|
+
return this.exec(args, { format: "json" });
|
|
7344
|
+
}
|
|
7345
|
+
async getQueueMessage(queueName, messageId) {
|
|
7346
|
+
return this.exec(["cloud", "queue", "messages", queueName, messageId], {
|
|
7347
|
+
format: "json"
|
|
7348
|
+
});
|
|
7349
|
+
}
|
|
7350
|
+
async publishQueueMessage(queueName, payload, opts) {
|
|
7351
|
+
const quotedPayload = `'${payload.replace(/'/g, "'\\''")}'`;
|
|
7352
|
+
const args = ["cloud", "queue", "publish", queueName, quotedPayload];
|
|
7353
|
+
if (opts?.metadata) {
|
|
7354
|
+
const quotedMetadata = `'${opts.metadata.replace(/'/g, "'\\''")}'`;
|
|
7355
|
+
args.push("--metadata", quotedMetadata);
|
|
7356
|
+
}
|
|
7357
|
+
if (opts?.ttl) {
|
|
7358
|
+
args.push("--ttl", String(opts.ttl));
|
|
7359
|
+
}
|
|
7360
|
+
if (opts?.partitionKey) {
|
|
7361
|
+
args.push("--partitionKey", opts.partitionKey);
|
|
7362
|
+
}
|
|
7363
|
+
if (opts?.idempotencyKey) {
|
|
7364
|
+
args.push("--idempotencyKey", opts.idempotencyKey);
|
|
7365
|
+
}
|
|
7366
|
+
return this.exec(args, { format: "json" });
|
|
7367
|
+
}
|
|
7368
|
+
async pauseQueue(name2) {
|
|
7369
|
+
return this.exec(["cloud", "queue", "pause", name2], { format: "json" });
|
|
7370
|
+
}
|
|
7371
|
+
async resumeQueue(name2) {
|
|
7372
|
+
return this.exec(["cloud", "queue", "resume", name2], { format: "json" });
|
|
7373
|
+
}
|
|
7374
|
+
async deleteQueue(name2) {
|
|
7375
|
+
return this.exec(["cloud", "queue", "delete", name2, "--confirm"], {
|
|
7376
|
+
format: "json"
|
|
7377
|
+
});
|
|
7378
|
+
}
|
|
7379
|
+
async createQueue(queueType, name2, opts) {
|
|
7380
|
+
const args = ["cloud", "queue", "create", queueType, "--name", name2];
|
|
7381
|
+
if (opts?.ttl) {
|
|
7382
|
+
args.push("--ttl", String(opts.ttl));
|
|
7383
|
+
}
|
|
7384
|
+
if (opts?.description) {
|
|
7385
|
+
args.push("--description", opts.description);
|
|
7386
|
+
}
|
|
7387
|
+
return this.exec(args, { format: "json" });
|
|
7388
|
+
}
|
|
7389
|
+
async listDlqMessages(queueName, opts) {
|
|
7390
|
+
const args = ["cloud", "queue", "dlq", "list", queueName];
|
|
7391
|
+
if (opts?.limit) {
|
|
7392
|
+
args.push("--limit", String(opts.limit));
|
|
7393
|
+
}
|
|
7394
|
+
if (opts?.offset) {
|
|
7395
|
+
args.push("--offset", String(opts.offset));
|
|
7396
|
+
}
|
|
7397
|
+
return this.exec(args, { format: "json" });
|
|
7398
|
+
}
|
|
7399
|
+
async replayDlqMessage(queueName, messageId) {
|
|
7400
|
+
return this.exec(
|
|
7401
|
+
["cloud", "queue", "dlq", "replay", queueName, messageId],
|
|
7402
|
+
{ format: "json" }
|
|
7403
|
+
);
|
|
7404
|
+
}
|
|
7405
|
+
async purgeDlq(queueName) {
|
|
7406
|
+
return this.exec(
|
|
7407
|
+
["cloud", "queue", "dlq", "purge", queueName, "--confirm"],
|
|
7408
|
+
{ format: "json" }
|
|
7409
|
+
);
|
|
7410
|
+
}
|
|
7411
|
+
async listQueueDestinations(queueName) {
|
|
7412
|
+
return this.exec(
|
|
7413
|
+
["cloud", "queue", "destinations", "list", queueName],
|
|
7414
|
+
{ format: "json" }
|
|
7415
|
+
);
|
|
7416
|
+
}
|
|
7417
|
+
async createQueueDestination(queueName, url, opts) {
|
|
7418
|
+
const args = ["cloud", "queue", "destinations", "create", queueName, "--url", url];
|
|
7419
|
+
if (opts?.method) {
|
|
7420
|
+
args.push("--method", opts.method);
|
|
7421
|
+
}
|
|
7422
|
+
if (opts?.timeout) {
|
|
7423
|
+
args.push("--timeout", String(opts.timeout));
|
|
7424
|
+
}
|
|
7425
|
+
return this.exec(args, { format: "json" });
|
|
7426
|
+
}
|
|
7427
|
+
async updateQueueDestination(queueName, destinationId, opts) {
|
|
7428
|
+
const args = ["cloud", "queue", "destinations", "update", queueName, destinationId];
|
|
7429
|
+
if (opts.url) {
|
|
7430
|
+
args.push("--url", opts.url);
|
|
7431
|
+
}
|
|
7432
|
+
if (opts.method) {
|
|
7433
|
+
args.push("--method", opts.method);
|
|
7434
|
+
}
|
|
7435
|
+
if (opts.timeout) {
|
|
7436
|
+
args.push("--timeout", String(opts.timeout));
|
|
7437
|
+
}
|
|
7438
|
+
if (opts.enabled) {
|
|
7439
|
+
args.push("--enabled");
|
|
7440
|
+
}
|
|
7441
|
+
if (opts.disabled) {
|
|
7442
|
+
args.push("--disabled");
|
|
7443
|
+
}
|
|
7444
|
+
return this.exec(args, { format: "json" });
|
|
7445
|
+
}
|
|
7446
|
+
async deleteQueueDestination(queueName, destinationId) {
|
|
7447
|
+
return this.exec(
|
|
7448
|
+
["cloud", "queue", "destinations", "delete", queueName, destinationId],
|
|
7449
|
+
{ format: "json" }
|
|
7450
|
+
);
|
|
7451
|
+
}
|
|
7276
7452
|
// Profile methods
|
|
7277
7453
|
async getCurrentProfile() {
|
|
7278
7454
|
return this.exec(["profile", "current"], { format: "json" });
|
|
7279
7455
|
}
|
|
7280
7456
|
// Vector methods
|
|
7457
|
+
async listVectorNamespaces() {
|
|
7458
|
+
return this.exec(["cloud", "vector", "list-namespaces"], {
|
|
7459
|
+
format: "json"
|
|
7460
|
+
});
|
|
7461
|
+
}
|
|
7281
7462
|
async vectorSearch(namespace, query, opts) {
|
|
7282
7463
|
const args = ["cloud", "vector", "search", namespace, query];
|
|
7283
7464
|
if (opts?.limit) {
|
|
@@ -7374,6 +7555,9 @@ var CliClient = class {
|
|
|
7374
7555
|
if (options.description) {
|
|
7375
7556
|
args.push("--description", options.description);
|
|
7376
7557
|
}
|
|
7558
|
+
if (options.projectId) {
|
|
7559
|
+
args.push("--project-id", options.projectId);
|
|
7560
|
+
}
|
|
7377
7561
|
if (options.memory) {
|
|
7378
7562
|
args.push("--memory", options.memory);
|
|
7379
7563
|
}
|
|
@@ -7413,6 +7597,11 @@ var CliClient = class {
|
|
|
7413
7597
|
args.push("--metadata", `${key}=${value}`);
|
|
7414
7598
|
}
|
|
7415
7599
|
}
|
|
7600
|
+
if (options.files && options.files.length > 0) {
|
|
7601
|
+
for (const file of options.files) {
|
|
7602
|
+
args.push("--file", `${file.path}:${file.content}`);
|
|
7603
|
+
}
|
|
7604
|
+
}
|
|
7416
7605
|
return this.exec(args, { format: "json", timeout: 12e4 });
|
|
7417
7606
|
}
|
|
7418
7607
|
/**
|
|
@@ -7944,8 +8133,8 @@ var DevServerManager = class {
|
|
|
7944
8133
|
this.hasReceivedOutput = false;
|
|
7945
8134
|
const cli = getCliClient();
|
|
7946
8135
|
const env9 = cli.getCliEnv();
|
|
7947
|
-
const cliPath =
|
|
7948
|
-
const args = ["
|
|
8136
|
+
const cliPath = cli.getCliPath();
|
|
8137
|
+
const args = ["dev"];
|
|
7949
8138
|
const spawnOpts = {
|
|
7950
8139
|
cwd: project.rootPath,
|
|
7951
8140
|
shell: true,
|
|
@@ -8644,7 +8833,7 @@ function getExtension(language) {
|
|
|
8644
8833
|
}
|
|
8645
8834
|
|
|
8646
8835
|
// src/features/agentExplorer/index.ts
|
|
8647
|
-
var
|
|
8836
|
+
var vscode12 = __toESM(require("vscode"));
|
|
8648
8837
|
var path5 = __toESM(require("path"));
|
|
8649
8838
|
|
|
8650
8839
|
// src/features/agentExplorer/agentTreeData.ts
|
|
@@ -8768,8 +8957,27 @@ var AgentTreeDataProvider = class extends BaseTreeDataProvider {
|
|
|
8768
8957
|
}
|
|
8769
8958
|
};
|
|
8770
8959
|
|
|
8960
|
+
// src/core/urls.ts
|
|
8961
|
+
var vscode11 = __toESM(require("vscode"));
|
|
8962
|
+
var DEFAULT_APP_URL = "https://app.agentuity.com";
|
|
8963
|
+
function getAppUrl() {
|
|
8964
|
+
const config = vscode11.workspace.getConfiguration("agentuity");
|
|
8965
|
+
return config.get("appUrl") || DEFAULT_APP_URL;
|
|
8966
|
+
}
|
|
8967
|
+
function getSessionsUrl(projectId, agentIdentifier) {
|
|
8968
|
+
const base = getAppUrl();
|
|
8969
|
+
let url = `${base}/projects/${projectId}/sessions`;
|
|
8970
|
+
if (agentIdentifier) {
|
|
8971
|
+
url += `?agent=${encodeURIComponent(agentIdentifier)}`;
|
|
8972
|
+
}
|
|
8973
|
+
return url;
|
|
8974
|
+
}
|
|
8975
|
+
function getWorkbenchUrl(projectId) {
|
|
8976
|
+
const base = getAppUrl();
|
|
8977
|
+
return `${base}/projects/${projectId}`;
|
|
8978
|
+
}
|
|
8979
|
+
|
|
8771
8980
|
// src/features/agentExplorer/index.ts
|
|
8772
|
-
var SESSIONS_BASE_URL = "https://app-v1.agentuity.com";
|
|
8773
8981
|
var agentProvider;
|
|
8774
8982
|
function getAgentProvider() {
|
|
8775
8983
|
return agentProvider;
|
|
@@ -8777,7 +8985,7 @@ function getAgentProvider() {
|
|
|
8777
8985
|
function registerAgentExplorer(context) {
|
|
8778
8986
|
const provider = new AgentTreeDataProvider();
|
|
8779
8987
|
agentProvider = provider;
|
|
8780
|
-
const treeView =
|
|
8988
|
+
const treeView = vscode12.window.createTreeView("agentuity.agents", {
|
|
8781
8989
|
treeDataProvider: provider,
|
|
8782
8990
|
showCollapseAll: true
|
|
8783
8991
|
});
|
|
@@ -8788,61 +8996,61 @@ function registerAgentExplorer(context) {
|
|
|
8788
8996
|
void provider.forceRefresh();
|
|
8789
8997
|
});
|
|
8790
8998
|
context.subscriptions.push(
|
|
8791
|
-
|
|
8999
|
+
vscode12.commands.registerCommand("agentuity.agent.goToFile", async (item) => {
|
|
8792
9000
|
const filename = item?.agentData?.metadata?.filename;
|
|
8793
9001
|
if (typeof filename !== "string") {
|
|
8794
|
-
|
|
9002
|
+
vscode12.window.showWarningMessage("No source file associated with this agent");
|
|
8795
9003
|
return;
|
|
8796
9004
|
}
|
|
8797
9005
|
const project = getCurrentProject();
|
|
8798
9006
|
if (!project) {
|
|
8799
|
-
|
|
9007
|
+
vscode12.window.showWarningMessage("No project detected");
|
|
8800
9008
|
return;
|
|
8801
9009
|
}
|
|
8802
9010
|
const filePath = path5.join(project.rootPath, filename);
|
|
8803
|
-
const uri =
|
|
9011
|
+
const uri = vscode12.Uri.file(filePath);
|
|
8804
9012
|
try {
|
|
8805
|
-
await
|
|
9013
|
+
await vscode12.window.showTextDocument(uri);
|
|
8806
9014
|
} catch {
|
|
8807
|
-
|
|
9015
|
+
vscode12.window.showErrorMessage(`Could not open file: ${filePath}`);
|
|
8808
9016
|
}
|
|
8809
9017
|
})
|
|
8810
9018
|
);
|
|
8811
9019
|
context.subscriptions.push(
|
|
8812
|
-
|
|
9020
|
+
vscode12.commands.registerCommand(
|
|
8813
9021
|
"agentuity.agent.viewSessions",
|
|
8814
9022
|
async (item) => {
|
|
8815
9023
|
const project = getCurrentProject();
|
|
8816
9024
|
if (!project) {
|
|
8817
|
-
|
|
9025
|
+
vscode12.window.showErrorMessage("No Agentuity project found");
|
|
8818
9026
|
return;
|
|
8819
9027
|
}
|
|
8820
9028
|
const agent = item?.agentData;
|
|
8821
9029
|
if (!agent) {
|
|
8822
|
-
|
|
9030
|
+
vscode12.window.showWarningMessage("No agent selected");
|
|
8823
9031
|
return;
|
|
8824
9032
|
}
|
|
8825
|
-
const url =
|
|
8826
|
-
await
|
|
9033
|
+
const url = getSessionsUrl(project.projectId, agent.id);
|
|
9034
|
+
await vscode12.env.openExternal(vscode12.Uri.parse(url));
|
|
8827
9035
|
}
|
|
8828
9036
|
)
|
|
8829
9037
|
);
|
|
8830
9038
|
context.subscriptions.push(
|
|
8831
|
-
|
|
9039
|
+
vscode12.commands.registerCommand(
|
|
8832
9040
|
"agentuity.agent.viewSessionLogs",
|
|
8833
9041
|
async (item) => {
|
|
8834
9042
|
const project = getCurrentProject();
|
|
8835
9043
|
if (!project) {
|
|
8836
|
-
|
|
9044
|
+
vscode12.window.showErrorMessage("No Agentuity project found");
|
|
8837
9045
|
return;
|
|
8838
9046
|
}
|
|
8839
9047
|
const agent = item?.agentData;
|
|
8840
9048
|
if (!agent) {
|
|
8841
|
-
|
|
9049
|
+
vscode12.window.showWarningMessage("No agent selected");
|
|
8842
9050
|
return;
|
|
8843
9051
|
}
|
|
8844
|
-
const url =
|
|
8845
|
-
await
|
|
9052
|
+
const url = getSessionsUrl(project.projectId, agent.id);
|
|
9053
|
+
await vscode12.env.openExternal(vscode12.Uri.parse(url));
|
|
8846
9054
|
}
|
|
8847
9055
|
)
|
|
8848
9056
|
);
|
|
@@ -8851,12 +9059,12 @@ function registerAgentExplorer(context) {
|
|
|
8851
9059
|
}
|
|
8852
9060
|
|
|
8853
9061
|
// src/features/dataExplorer/index.ts
|
|
8854
|
-
var
|
|
9062
|
+
var vscode14 = __toESM(require("vscode"));
|
|
8855
9063
|
|
|
8856
9064
|
// src/features/dataExplorer/dataTreeData.ts
|
|
8857
|
-
var
|
|
8858
|
-
var DataTreeItem = class extends
|
|
8859
|
-
constructor(label, collapsibleState, itemType, category, parentName, vectorResult, streamInfo) {
|
|
9065
|
+
var vscode13 = __toESM(require("vscode"));
|
|
9066
|
+
var DataTreeItem = class extends vscode13.TreeItem {
|
|
9067
|
+
constructor(label, collapsibleState, itemType, category, parentName, vectorResult, streamInfo, queueInfo) {
|
|
8860
9068
|
super(label, collapsibleState);
|
|
8861
9069
|
this.label = label;
|
|
8862
9070
|
this.collapsibleState = collapsibleState;
|
|
@@ -8865,6 +9073,7 @@ var DataTreeItem = class extends vscode12.TreeItem {
|
|
|
8865
9073
|
this.parentName = parentName;
|
|
8866
9074
|
this.vectorResult = vectorResult;
|
|
8867
9075
|
this.streamInfo = streamInfo;
|
|
9076
|
+
this.queueInfo = queueInfo;
|
|
8868
9077
|
this.setIcon();
|
|
8869
9078
|
if (itemType === "category" && category === "vector") {
|
|
8870
9079
|
this.contextValue = "category-vector";
|
|
@@ -8872,58 +9081,101 @@ var DataTreeItem = class extends vscode12.TreeItem {
|
|
|
8872
9081
|
this.contextValue = itemType;
|
|
8873
9082
|
}
|
|
8874
9083
|
}
|
|
9084
|
+
messageId;
|
|
9085
|
+
destinationId;
|
|
8875
9086
|
setIcon() {
|
|
8876
9087
|
switch (this.itemType) {
|
|
8877
9088
|
case "category":
|
|
8878
9089
|
if (this.label === "Key-Value") {
|
|
8879
|
-
this.iconPath = new
|
|
9090
|
+
this.iconPath = new vscode13.ThemeIcon("database");
|
|
8880
9091
|
} else if (this.label === "Databases") {
|
|
8881
|
-
this.iconPath = new
|
|
9092
|
+
this.iconPath = new vscode13.ThemeIcon("server");
|
|
8882
9093
|
} else if (this.label === "Vectors") {
|
|
8883
|
-
this.iconPath = new
|
|
9094
|
+
this.iconPath = new vscode13.ThemeIcon("symbol-numeric");
|
|
8884
9095
|
} else if (this.label === "Storage") {
|
|
8885
|
-
this.iconPath = new
|
|
9096
|
+
this.iconPath = new vscode13.ThemeIcon("cloud");
|
|
8886
9097
|
} else if (this.label === "Streams") {
|
|
8887
|
-
this.iconPath = new
|
|
9098
|
+
this.iconPath = new vscode13.ThemeIcon("pulse");
|
|
9099
|
+
} else if (this.label === "Queues") {
|
|
9100
|
+
this.iconPath = new vscode13.ThemeIcon("mail");
|
|
8888
9101
|
}
|
|
8889
9102
|
break;
|
|
8890
9103
|
case "namespace":
|
|
8891
|
-
this.iconPath = new
|
|
9104
|
+
this.iconPath = new vscode13.ThemeIcon("folder");
|
|
8892
9105
|
break;
|
|
8893
9106
|
case "key":
|
|
8894
|
-
this.iconPath = new
|
|
9107
|
+
this.iconPath = new vscode13.ThemeIcon("symbol-key");
|
|
8895
9108
|
break;
|
|
8896
9109
|
case "database":
|
|
8897
|
-
this.iconPath = new
|
|
9110
|
+
this.iconPath = new vscode13.ThemeIcon("database");
|
|
8898
9111
|
break;
|
|
8899
9112
|
case "vectorSearchGroup":
|
|
8900
|
-
this.iconPath = new
|
|
9113
|
+
this.iconPath = new vscode13.ThemeIcon("search");
|
|
8901
9114
|
break;
|
|
8902
9115
|
case "vectorResult":
|
|
8903
|
-
this.iconPath = new
|
|
9116
|
+
this.iconPath = new vscode13.ThemeIcon("file-text");
|
|
8904
9117
|
break;
|
|
8905
9118
|
case "storageBucket":
|
|
8906
|
-
this.iconPath = new
|
|
9119
|
+
this.iconPath = new vscode13.ThemeIcon("package");
|
|
8907
9120
|
break;
|
|
8908
9121
|
case "storageFile":
|
|
8909
|
-
this.iconPath = new
|
|
9122
|
+
this.iconPath = new vscode13.ThemeIcon("file");
|
|
8910
9123
|
break;
|
|
8911
9124
|
case "streamItem":
|
|
8912
|
-
this.iconPath = new
|
|
9125
|
+
this.iconPath = new vscode13.ThemeIcon("broadcast");
|
|
9126
|
+
break;
|
|
9127
|
+
case "queueItem":
|
|
9128
|
+
this.iconPath = new vscode13.ThemeIcon("mail");
|
|
9129
|
+
break;
|
|
9130
|
+
case "queueSection":
|
|
9131
|
+
if (this.label === "Messages") {
|
|
9132
|
+
this.iconPath = new vscode13.ThemeIcon("inbox");
|
|
9133
|
+
} else if (this.label === "Dead Letter Queue") {
|
|
9134
|
+
this.iconPath = new vscode13.ThemeIcon("warning");
|
|
9135
|
+
} else if (this.label === "Destinations") {
|
|
9136
|
+
this.iconPath = new vscode13.ThemeIcon("link-external");
|
|
9137
|
+
}
|
|
9138
|
+
break;
|
|
9139
|
+
case "queueMessage":
|
|
9140
|
+
this.iconPath = new vscode13.ThemeIcon("mail");
|
|
9141
|
+
break;
|
|
9142
|
+
case "dlqMessage":
|
|
9143
|
+
this.iconPath = new vscode13.ThemeIcon("warning");
|
|
9144
|
+
break;
|
|
9145
|
+
case "queueDestination":
|
|
9146
|
+
this.iconPath = new vscode13.ThemeIcon("link-external");
|
|
8913
9147
|
break;
|
|
8914
9148
|
case "message":
|
|
8915
|
-
this.iconPath = new
|
|
9149
|
+
this.iconPath = new vscode13.ThemeIcon("info");
|
|
8916
9150
|
break;
|
|
8917
9151
|
}
|
|
8918
9152
|
}
|
|
8919
9153
|
};
|
|
8920
9154
|
var DataTreeDataProvider = class {
|
|
8921
|
-
_onDidChangeTreeData = new
|
|
9155
|
+
_onDidChangeTreeData = new vscode13.EventEmitter();
|
|
8922
9156
|
onDidChangeTreeData = this._onDidChangeTreeData.event;
|
|
8923
9157
|
vectorSearchGroups = [];
|
|
9158
|
+
messageLimits = /* @__PURE__ */ new Map();
|
|
9159
|
+
dlqLimits = /* @__PURE__ */ new Map();
|
|
9160
|
+
MESSAGE_PAGE_SIZE = 25;
|
|
8924
9161
|
refresh() {
|
|
8925
9162
|
this._onDidChangeTreeData.fire();
|
|
8926
9163
|
}
|
|
9164
|
+
refreshQueueMessages(queueName) {
|
|
9165
|
+
this.messageLimits.delete(queueName);
|
|
9166
|
+
this.dlqLimits.delete(queueName);
|
|
9167
|
+
this._onDidChangeTreeData.fire();
|
|
9168
|
+
}
|
|
9169
|
+
loadMoreMessages(queueName) {
|
|
9170
|
+
const currentLimit = this.messageLimits.get(queueName) || this.MESSAGE_PAGE_SIZE;
|
|
9171
|
+
this.messageLimits.set(queueName, currentLimit + this.MESSAGE_PAGE_SIZE);
|
|
9172
|
+
this._onDidChangeTreeData.fire();
|
|
9173
|
+
}
|
|
9174
|
+
loadMoreDlqMessages(queueName) {
|
|
9175
|
+
const currentLimit = this.dlqLimits.get(queueName) || this.MESSAGE_PAGE_SIZE;
|
|
9176
|
+
this.dlqLimits.set(queueName, currentLimit + this.MESSAGE_PAGE_SIZE);
|
|
9177
|
+
this._onDidChangeTreeData.fire();
|
|
9178
|
+
}
|
|
8927
9179
|
addVectorSearchGroup(group) {
|
|
8928
9180
|
this.vectorSearchGroups.unshift(group);
|
|
8929
9181
|
this.refresh();
|
|
@@ -8939,24 +9191,24 @@ var DataTreeDataProvider = class {
|
|
|
8939
9191
|
const authStatus = getAuthStatus();
|
|
8940
9192
|
if (authStatus.state === "unknown") {
|
|
8941
9193
|
return [
|
|
8942
|
-
new DataTreeItem("Checking auth...",
|
|
9194
|
+
new DataTreeItem("Checking auth...", vscode13.TreeItemCollapsibleState.None, "message")
|
|
8943
9195
|
];
|
|
8944
9196
|
}
|
|
8945
9197
|
if (authStatus.state === "cli-missing") {
|
|
8946
9198
|
return [
|
|
8947
|
-
new DataTreeItem("CLI not installed",
|
|
9199
|
+
new DataTreeItem("CLI not installed", vscode13.TreeItemCollapsibleState.None, "message")
|
|
8948
9200
|
];
|
|
8949
9201
|
}
|
|
8950
9202
|
if (authStatus.state === "unauthenticated") {
|
|
8951
9203
|
return [
|
|
8952
|
-
new DataTreeItem("Not logged in",
|
|
9204
|
+
new DataTreeItem("Not logged in", vscode13.TreeItemCollapsibleState.None, "message")
|
|
8953
9205
|
];
|
|
8954
9206
|
}
|
|
8955
9207
|
if (!hasProject()) {
|
|
8956
9208
|
return [
|
|
8957
9209
|
new DataTreeItem(
|
|
8958
9210
|
"No project detected",
|
|
8959
|
-
|
|
9211
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
8960
9212
|
"message"
|
|
8961
9213
|
)
|
|
8962
9214
|
];
|
|
@@ -8965,33 +9217,39 @@ var DataTreeDataProvider = class {
|
|
|
8965
9217
|
return [
|
|
8966
9218
|
new DataTreeItem(
|
|
8967
9219
|
"Key-Value",
|
|
8968
|
-
|
|
9220
|
+
vscode13.TreeItemCollapsibleState.Collapsed,
|
|
8969
9221
|
"category",
|
|
8970
9222
|
"kv"
|
|
8971
9223
|
),
|
|
8972
9224
|
new DataTreeItem(
|
|
8973
9225
|
"Databases",
|
|
8974
|
-
|
|
9226
|
+
vscode13.TreeItemCollapsibleState.Collapsed,
|
|
8975
9227
|
"category",
|
|
8976
9228
|
"db"
|
|
8977
9229
|
),
|
|
8978
9230
|
new DataTreeItem(
|
|
8979
9231
|
"Vectors",
|
|
8980
|
-
|
|
9232
|
+
vscode13.TreeItemCollapsibleState.Collapsed,
|
|
8981
9233
|
"category",
|
|
8982
9234
|
"vector"
|
|
8983
9235
|
),
|
|
8984
9236
|
new DataTreeItem(
|
|
8985
9237
|
"Storage",
|
|
8986
|
-
|
|
9238
|
+
vscode13.TreeItemCollapsibleState.Collapsed,
|
|
8987
9239
|
"category",
|
|
8988
9240
|
"storage"
|
|
8989
9241
|
),
|
|
8990
9242
|
new DataTreeItem(
|
|
8991
9243
|
"Streams",
|
|
8992
|
-
|
|
9244
|
+
vscode13.TreeItemCollapsibleState.Collapsed,
|
|
8993
9245
|
"category",
|
|
8994
9246
|
"stream"
|
|
9247
|
+
),
|
|
9248
|
+
new DataTreeItem(
|
|
9249
|
+
"Queues",
|
|
9250
|
+
vscode13.TreeItemCollapsibleState.Collapsed,
|
|
9251
|
+
"category",
|
|
9252
|
+
"queue"
|
|
8995
9253
|
)
|
|
8996
9254
|
];
|
|
8997
9255
|
}
|
|
@@ -9007,6 +9265,19 @@ var DataTreeDataProvider = class {
|
|
|
9007
9265
|
if (element.itemType === "storageBucket" && element.category === "storage") {
|
|
9008
9266
|
return this.loadStorageFiles(element.label);
|
|
9009
9267
|
}
|
|
9268
|
+
if (element.itemType === "queueItem" && element.queueInfo) {
|
|
9269
|
+
return this.loadQueueSections(element.queueInfo.name);
|
|
9270
|
+
}
|
|
9271
|
+
if (element.itemType === "queueSection" && element.parentName) {
|
|
9272
|
+
const sectionLabel = element.label;
|
|
9273
|
+
if (sectionLabel === "Messages") {
|
|
9274
|
+
return this.loadQueueMessages(element.parentName);
|
|
9275
|
+
} else if (sectionLabel === "Dead Letter Queue") {
|
|
9276
|
+
return this.loadDlqMessages(element.parentName);
|
|
9277
|
+
} else if (sectionLabel === "Destinations") {
|
|
9278
|
+
return this.loadQueueDestinations(element.parentName);
|
|
9279
|
+
}
|
|
9280
|
+
}
|
|
9010
9281
|
return [];
|
|
9011
9282
|
}
|
|
9012
9283
|
getErrorMessage(error, category) {
|
|
@@ -9026,7 +9297,7 @@ var DataTreeDataProvider = class {
|
|
|
9026
9297
|
return [
|
|
9027
9298
|
new DataTreeItem(
|
|
9028
9299
|
"No namespaces",
|
|
9029
|
-
|
|
9300
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9030
9301
|
"message"
|
|
9031
9302
|
)
|
|
9032
9303
|
];
|
|
@@ -9034,7 +9305,7 @@ var DataTreeDataProvider = class {
|
|
|
9034
9305
|
return result.data.map((ns) => {
|
|
9035
9306
|
return new DataTreeItem(
|
|
9036
9307
|
ns,
|
|
9037
|
-
|
|
9308
|
+
vscode13.TreeItemCollapsibleState.Collapsed,
|
|
9038
9309
|
"namespace",
|
|
9039
9310
|
"kv"
|
|
9040
9311
|
);
|
|
@@ -9043,7 +9314,7 @@ var DataTreeDataProvider = class {
|
|
|
9043
9314
|
return [
|
|
9044
9315
|
new DataTreeItem(
|
|
9045
9316
|
this.getErrorMessage(result.error, "namespaces"),
|
|
9046
|
-
|
|
9317
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9047
9318
|
"message"
|
|
9048
9319
|
)
|
|
9049
9320
|
];
|
|
@@ -9054,7 +9325,7 @@ var DataTreeDataProvider = class {
|
|
|
9054
9325
|
return [
|
|
9055
9326
|
new DataTreeItem(
|
|
9056
9327
|
"No databases",
|
|
9057
|
-
|
|
9328
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9058
9329
|
"message"
|
|
9059
9330
|
)
|
|
9060
9331
|
];
|
|
@@ -9062,7 +9333,7 @@ var DataTreeDataProvider = class {
|
|
|
9062
9333
|
return result.data.databases.map((db) => {
|
|
9063
9334
|
const item = new DataTreeItem(
|
|
9064
9335
|
db.name,
|
|
9065
|
-
|
|
9336
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9066
9337
|
"database",
|
|
9067
9338
|
"db"
|
|
9068
9339
|
);
|
|
@@ -9073,31 +9344,57 @@ var DataTreeDataProvider = class {
|
|
|
9073
9344
|
return [
|
|
9074
9345
|
new DataTreeItem(
|
|
9075
9346
|
this.getErrorMessage(result.error, "databases"),
|
|
9076
|
-
|
|
9347
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9077
9348
|
"message"
|
|
9078
9349
|
)
|
|
9079
9350
|
];
|
|
9080
9351
|
} else if (element.category === "vector") {
|
|
9081
|
-
|
|
9352
|
+
const items = [];
|
|
9353
|
+
if (this.vectorSearchGroups.length > 0) {
|
|
9354
|
+
for (const group of this.vectorSearchGroups) {
|
|
9355
|
+
const item = new DataTreeItem(
|
|
9356
|
+
group.label,
|
|
9357
|
+
vscode13.TreeItemCollapsibleState.Collapsed,
|
|
9358
|
+
"vectorSearchGroup",
|
|
9359
|
+
"vector",
|
|
9360
|
+
group.id
|
|
9361
|
+
);
|
|
9362
|
+
item.description = `${group.results.length} results`;
|
|
9363
|
+
items.push(item);
|
|
9364
|
+
}
|
|
9365
|
+
}
|
|
9366
|
+
const result = await cli.listVectorNamespaces();
|
|
9367
|
+
if (result.success && Array.isArray(result.data) && result.data.length > 0) {
|
|
9368
|
+
if (items.length > 0) {
|
|
9369
|
+
const separator = new DataTreeItem(
|
|
9370
|
+
"\u2500\u2500\u2500 Namespaces \u2500\u2500\u2500",
|
|
9371
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9372
|
+
"message"
|
|
9373
|
+
);
|
|
9374
|
+
items.push(separator);
|
|
9375
|
+
}
|
|
9376
|
+
for (const ns of result.data) {
|
|
9377
|
+
const item = new DataTreeItem(
|
|
9378
|
+
ns,
|
|
9379
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9380
|
+
"namespace",
|
|
9381
|
+
"vector"
|
|
9382
|
+
);
|
|
9383
|
+
item.tooltip = `Vector namespace: ${ns}
|
|
9384
|
+
Right-click to search`;
|
|
9385
|
+
items.push(item);
|
|
9386
|
+
}
|
|
9387
|
+
}
|
|
9388
|
+
if (items.length === 0) {
|
|
9082
9389
|
const item = new DataTreeItem(
|
|
9083
|
-
|
|
9084
|
-
|
|
9390
|
+
"No namespaces found",
|
|
9391
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9085
9392
|
"message"
|
|
9086
9393
|
);
|
|
9087
|
-
item.tooltip = "
|
|
9394
|
+
item.tooltip = "Deploy your project to create vector namespaces";
|
|
9088
9395
|
return [item];
|
|
9089
9396
|
}
|
|
9090
|
-
return
|
|
9091
|
-
const item = new DataTreeItem(
|
|
9092
|
-
group.label,
|
|
9093
|
-
vscode12.TreeItemCollapsibleState.Collapsed,
|
|
9094
|
-
"vectorSearchGroup",
|
|
9095
|
-
"vector",
|
|
9096
|
-
group.id
|
|
9097
|
-
);
|
|
9098
|
-
item.description = `${group.results.length} results`;
|
|
9099
|
-
return item;
|
|
9100
|
-
});
|
|
9397
|
+
return items;
|
|
9101
9398
|
} else if (element.category === "storage") {
|
|
9102
9399
|
const result = await cli.listStorageBuckets();
|
|
9103
9400
|
if (result.success && result.data?.buckets) {
|
|
@@ -9105,7 +9402,7 @@ var DataTreeDataProvider = class {
|
|
|
9105
9402
|
return [
|
|
9106
9403
|
new DataTreeItem(
|
|
9107
9404
|
"No buckets",
|
|
9108
|
-
|
|
9405
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9109
9406
|
"message"
|
|
9110
9407
|
)
|
|
9111
9408
|
];
|
|
@@ -9113,7 +9410,7 @@ var DataTreeDataProvider = class {
|
|
|
9113
9410
|
return result.data.buckets.map((bucket) => {
|
|
9114
9411
|
const item = new DataTreeItem(
|
|
9115
9412
|
bucket.bucket_name,
|
|
9116
|
-
|
|
9413
|
+
vscode13.TreeItemCollapsibleState.Collapsed,
|
|
9117
9414
|
"storageBucket",
|
|
9118
9415
|
"storage"
|
|
9119
9416
|
);
|
|
@@ -9126,7 +9423,7 @@ var DataTreeDataProvider = class {
|
|
|
9126
9423
|
return [
|
|
9127
9424
|
new DataTreeItem(
|
|
9128
9425
|
this.getErrorMessage(result.error, "storage"),
|
|
9129
|
-
|
|
9426
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9130
9427
|
"message"
|
|
9131
9428
|
)
|
|
9132
9429
|
];
|
|
@@ -9137,7 +9434,7 @@ var DataTreeDataProvider = class {
|
|
|
9137
9434
|
return [
|
|
9138
9435
|
new DataTreeItem(
|
|
9139
9436
|
"No streams",
|
|
9140
|
-
|
|
9437
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9141
9438
|
"message"
|
|
9142
9439
|
)
|
|
9143
9440
|
];
|
|
@@ -9145,7 +9442,7 @@ var DataTreeDataProvider = class {
|
|
|
9145
9442
|
return result.data.streams.map((stream) => {
|
|
9146
9443
|
const item = new DataTreeItem(
|
|
9147
9444
|
stream.name || stream.id,
|
|
9148
|
-
|
|
9445
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9149
9446
|
"streamItem",
|
|
9150
9447
|
"stream",
|
|
9151
9448
|
void 0,
|
|
@@ -9161,16 +9458,53 @@ URL: ${stream.url}`;
|
|
|
9161
9458
|
return [
|
|
9162
9459
|
new DataTreeItem(
|
|
9163
9460
|
this.getErrorMessage(result.error, "streams"),
|
|
9164
|
-
|
|
9461
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9462
|
+
"message"
|
|
9463
|
+
)
|
|
9464
|
+
];
|
|
9465
|
+
} else if (element.category === "queue") {
|
|
9466
|
+
const result = await cli.listQueues();
|
|
9467
|
+
if (result.success && result.data?.queues) {
|
|
9468
|
+
if (result.data.queues.length === 0) {
|
|
9469
|
+
return [
|
|
9470
|
+
new DataTreeItem("No queues", vscode13.TreeItemCollapsibleState.None, "message")
|
|
9471
|
+
];
|
|
9472
|
+
}
|
|
9473
|
+
return result.data.queues.map((queue) => {
|
|
9474
|
+
const item = new DataTreeItem(
|
|
9475
|
+
queue.name,
|
|
9476
|
+
vscode13.TreeItemCollapsibleState.Collapsed,
|
|
9477
|
+
"queueItem",
|
|
9478
|
+
"queue",
|
|
9479
|
+
void 0,
|
|
9480
|
+
void 0,
|
|
9481
|
+
void 0,
|
|
9482
|
+
queue
|
|
9483
|
+
);
|
|
9484
|
+
item.description = `${queue.queue_type} \u2022 ${queue.message_count} msgs`;
|
|
9485
|
+
item.tooltip = [
|
|
9486
|
+
`Name: ${queue.name}`,
|
|
9487
|
+
`Type: ${queue.queue_type}`,
|
|
9488
|
+
`Messages: ${queue.message_count}`,
|
|
9489
|
+
`DLQ: ${queue.dlq_count}`,
|
|
9490
|
+
`Created: ${new Date(queue.created_at).toLocaleString()}`
|
|
9491
|
+
].join("\n");
|
|
9492
|
+
return item;
|
|
9493
|
+
});
|
|
9494
|
+
}
|
|
9495
|
+
return [
|
|
9496
|
+
new DataTreeItem(
|
|
9497
|
+
this.getErrorMessage(result.error, "queues"),
|
|
9498
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9165
9499
|
"message"
|
|
9166
9500
|
)
|
|
9167
9501
|
];
|
|
9168
9502
|
}
|
|
9169
9503
|
} catch (err) {
|
|
9170
9504
|
const message = err instanceof Error ? err.message : "Failed to load";
|
|
9171
|
-
return [new DataTreeItem(message,
|
|
9505
|
+
return [new DataTreeItem(message, vscode13.TreeItemCollapsibleState.None, "message")];
|
|
9172
9506
|
}
|
|
9173
|
-
return [new DataTreeItem("Failed to load",
|
|
9507
|
+
return [new DataTreeItem("Failed to load", vscode13.TreeItemCollapsibleState.None, "message")];
|
|
9174
9508
|
}
|
|
9175
9509
|
loadVectorSearchResults(groupId) {
|
|
9176
9510
|
const group = this.vectorSearchGroups.find((g) => g.id === groupId);
|
|
@@ -9178,12 +9512,12 @@ URL: ${stream.url}`;
|
|
|
9178
9512
|
return [];
|
|
9179
9513
|
}
|
|
9180
9514
|
if (group.results.length === 0) {
|
|
9181
|
-
return [new DataTreeItem("No results",
|
|
9515
|
+
return [new DataTreeItem("No results", vscode13.TreeItemCollapsibleState.None, "message")];
|
|
9182
9516
|
}
|
|
9183
9517
|
return group.results.map((result) => {
|
|
9184
9518
|
const item = new DataTreeItem(
|
|
9185
9519
|
result.key ?? "(unknown)",
|
|
9186
|
-
|
|
9520
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9187
9521
|
"vectorResult",
|
|
9188
9522
|
"vector",
|
|
9189
9523
|
group.namespace,
|
|
@@ -9202,13 +9536,13 @@ ID: ${result.id ?? "(unknown)"}`;
|
|
|
9202
9536
|
if (result.success && result.data?.keys) {
|
|
9203
9537
|
if (result.data.keys.length === 0) {
|
|
9204
9538
|
return [
|
|
9205
|
-
new DataTreeItem("No keys",
|
|
9539
|
+
new DataTreeItem("No keys", vscode13.TreeItemCollapsibleState.None, "message")
|
|
9206
9540
|
];
|
|
9207
9541
|
}
|
|
9208
9542
|
return result.data.keys.map(
|
|
9209
9543
|
(key) => new DataTreeItem(
|
|
9210
9544
|
key,
|
|
9211
|
-
|
|
9545
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9212
9546
|
"key",
|
|
9213
9547
|
"kv",
|
|
9214
9548
|
namespace
|
|
@@ -9217,10 +9551,10 @@ ID: ${result.id ?? "(unknown)"}`;
|
|
|
9217
9551
|
}
|
|
9218
9552
|
} catch (err) {
|
|
9219
9553
|
const message = err instanceof Error ? err.message : "Failed to load keys";
|
|
9220
|
-
return [new DataTreeItem(message,
|
|
9554
|
+
return [new DataTreeItem(message, vscode13.TreeItemCollapsibleState.None, "message")];
|
|
9221
9555
|
}
|
|
9222
9556
|
return [
|
|
9223
|
-
new DataTreeItem("Failed to load keys",
|
|
9557
|
+
new DataTreeItem("Failed to load keys", vscode13.TreeItemCollapsibleState.None, "message")
|
|
9224
9558
|
];
|
|
9225
9559
|
}
|
|
9226
9560
|
async loadStorageFiles(bucket) {
|
|
@@ -9230,13 +9564,13 @@ ID: ${result.id ?? "(unknown)"}`;
|
|
|
9230
9564
|
if (result.success && result.data?.files) {
|
|
9231
9565
|
if (result.data.files.length === 0) {
|
|
9232
9566
|
return [
|
|
9233
|
-
new DataTreeItem("No files",
|
|
9567
|
+
new DataTreeItem("No files", vscode13.TreeItemCollapsibleState.None, "message")
|
|
9234
9568
|
];
|
|
9235
9569
|
}
|
|
9236
9570
|
return result.data.files.map((file) => {
|
|
9237
9571
|
const item = new DataTreeItem(
|
|
9238
9572
|
file.key,
|
|
9239
|
-
|
|
9573
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9240
9574
|
"storageFile",
|
|
9241
9575
|
"storage",
|
|
9242
9576
|
bucket
|
|
@@ -9247,10 +9581,10 @@ ID: ${result.id ?? "(unknown)"}`;
|
|
|
9247
9581
|
}
|
|
9248
9582
|
} catch (err) {
|
|
9249
9583
|
const message = err instanceof Error ? err.message : "Failed to load files";
|
|
9250
|
-
return [new DataTreeItem(message,
|
|
9584
|
+
return [new DataTreeItem(message, vscode13.TreeItemCollapsibleState.None, "message")];
|
|
9251
9585
|
}
|
|
9252
9586
|
return [
|
|
9253
|
-
new DataTreeItem("Failed to load files",
|
|
9587
|
+
new DataTreeItem("Failed to load files", vscode13.TreeItemCollapsibleState.None, "message")
|
|
9254
9588
|
];
|
|
9255
9589
|
}
|
|
9256
9590
|
formatFileSize(bytes) {
|
|
@@ -9259,6 +9593,203 @@ ID: ${result.id ?? "(unknown)"}`;
|
|
|
9259
9593
|
if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
9260
9594
|
return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;
|
|
9261
9595
|
}
|
|
9596
|
+
loadQueueSections(queueName) {
|
|
9597
|
+
const messagesItem = new DataTreeItem(
|
|
9598
|
+
"Messages",
|
|
9599
|
+
vscode13.TreeItemCollapsibleState.Collapsed,
|
|
9600
|
+
"queueSection",
|
|
9601
|
+
"queue",
|
|
9602
|
+
queueName
|
|
9603
|
+
);
|
|
9604
|
+
messagesItem.contextValue = "queueSection-messages";
|
|
9605
|
+
messagesItem.description = `${this.MESSAGE_PAGE_SIZE} latest`;
|
|
9606
|
+
const dlqItem = new DataTreeItem(
|
|
9607
|
+
"Dead Letter Queue",
|
|
9608
|
+
vscode13.TreeItemCollapsibleState.Collapsed,
|
|
9609
|
+
"queueSection",
|
|
9610
|
+
"queue",
|
|
9611
|
+
queueName
|
|
9612
|
+
);
|
|
9613
|
+
dlqItem.contextValue = "queueSection-dlq";
|
|
9614
|
+
dlqItem.description = `${this.MESSAGE_PAGE_SIZE} latest`;
|
|
9615
|
+
const destItem = new DataTreeItem(
|
|
9616
|
+
"Destinations",
|
|
9617
|
+
vscode13.TreeItemCollapsibleState.Collapsed,
|
|
9618
|
+
"queueSection",
|
|
9619
|
+
"queue",
|
|
9620
|
+
queueName
|
|
9621
|
+
);
|
|
9622
|
+
destItem.contextValue = "queueSection-destinations";
|
|
9623
|
+
return [messagesItem, dlqItem, destItem];
|
|
9624
|
+
}
|
|
9625
|
+
async loadQueueMessages(queueName) {
|
|
9626
|
+
const cli = getCliClient();
|
|
9627
|
+
const currentLimit = this.messageLimits.get(queueName) || this.MESSAGE_PAGE_SIZE;
|
|
9628
|
+
try {
|
|
9629
|
+
const result = await cli.listQueueMessages(queueName, { limit: currentLimit });
|
|
9630
|
+
if (result.success && result.data?.data?.messages) {
|
|
9631
|
+
const messages = result.data.data.messages;
|
|
9632
|
+
const total = result.data.data.total || messages.length;
|
|
9633
|
+
if (messages.length === 0) {
|
|
9634
|
+
return [
|
|
9635
|
+
new DataTreeItem("No messages", vscode13.TreeItemCollapsibleState.None, "message")
|
|
9636
|
+
];
|
|
9637
|
+
}
|
|
9638
|
+
const items = messages.map((msg) => {
|
|
9639
|
+
const item = new DataTreeItem(
|
|
9640
|
+
msg.id.substring(0, 16) + "...",
|
|
9641
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9642
|
+
"queueMessage",
|
|
9643
|
+
"queue",
|
|
9644
|
+
queueName
|
|
9645
|
+
);
|
|
9646
|
+
item.contextValue = "queueMessage";
|
|
9647
|
+
item.description = msg.state || "";
|
|
9648
|
+
item.tooltip = [
|
|
9649
|
+
`ID: ${msg.id}`,
|
|
9650
|
+
`Offset: ${msg.offset}`,
|
|
9651
|
+
`State: ${msg.state || "unknown"}`,
|
|
9652
|
+
msg.created_at ? `Created: ${new Date(msg.created_at).toLocaleString()}` : ""
|
|
9653
|
+
].filter(Boolean).join("\n");
|
|
9654
|
+
item.messageId = msg.id;
|
|
9655
|
+
return item;
|
|
9656
|
+
});
|
|
9657
|
+
if (messages.length < total) {
|
|
9658
|
+
const remaining = total - messages.length;
|
|
9659
|
+
const loadMoreItem = new DataTreeItem(
|
|
9660
|
+
`Load ${Math.min(remaining, this.MESSAGE_PAGE_SIZE)} More... (${remaining} remaining)`,
|
|
9661
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9662
|
+
"message",
|
|
9663
|
+
"queue",
|
|
9664
|
+
queueName
|
|
9665
|
+
);
|
|
9666
|
+
loadMoreItem.contextValue = "loadMoreMessages";
|
|
9667
|
+
items.push(loadMoreItem);
|
|
9668
|
+
}
|
|
9669
|
+
return items;
|
|
9670
|
+
}
|
|
9671
|
+
return [
|
|
9672
|
+
new DataTreeItem(
|
|
9673
|
+
this.getErrorMessage(result.error, "messages"),
|
|
9674
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9675
|
+
"message"
|
|
9676
|
+
)
|
|
9677
|
+
];
|
|
9678
|
+
} catch (err) {
|
|
9679
|
+
const message = err instanceof Error ? err.message : "Failed to load messages";
|
|
9680
|
+
return [new DataTreeItem(message, vscode13.TreeItemCollapsibleState.None, "message")];
|
|
9681
|
+
}
|
|
9682
|
+
}
|
|
9683
|
+
async loadDlqMessages(queueName) {
|
|
9684
|
+
const cli = getCliClient();
|
|
9685
|
+
const currentLimit = this.dlqLimits.get(queueName) || this.MESSAGE_PAGE_SIZE;
|
|
9686
|
+
try {
|
|
9687
|
+
const result = await cli.listDlqMessages(queueName, { limit: currentLimit });
|
|
9688
|
+
if (result.success && result.data?.messages) {
|
|
9689
|
+
const messages = result.data.messages;
|
|
9690
|
+
const total = result.data.total || messages.length;
|
|
9691
|
+
if (messages.length === 0) {
|
|
9692
|
+
return [
|
|
9693
|
+
new DataTreeItem(
|
|
9694
|
+
"No DLQ messages",
|
|
9695
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9696
|
+
"message"
|
|
9697
|
+
)
|
|
9698
|
+
];
|
|
9699
|
+
}
|
|
9700
|
+
const items = messages.map((msg) => {
|
|
9701
|
+
const item = new DataTreeItem(
|
|
9702
|
+
msg.id.substring(0, 16) + "...",
|
|
9703
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9704
|
+
"dlqMessage",
|
|
9705
|
+
"queue",
|
|
9706
|
+
queueName
|
|
9707
|
+
);
|
|
9708
|
+
item.contextValue = "dlqMessage";
|
|
9709
|
+
item.description = `${msg.delivery_attempts} attempts`;
|
|
9710
|
+
item.tooltip = [
|
|
9711
|
+
`ID: ${msg.id}`,
|
|
9712
|
+
`Offset: ${msg.offset}`,
|
|
9713
|
+
`Attempts: ${msg.delivery_attempts}`,
|
|
9714
|
+
`Reason: ${msg.failure_reason || "Unknown"}`,
|
|
9715
|
+
`Moved: ${new Date(msg.moved_at).toLocaleString()}`
|
|
9716
|
+
].join("\n");
|
|
9717
|
+
item.messageId = msg.id;
|
|
9718
|
+
return item;
|
|
9719
|
+
});
|
|
9720
|
+
if (messages.length < total) {
|
|
9721
|
+
const remaining = total - messages.length;
|
|
9722
|
+
const loadMoreItem = new DataTreeItem(
|
|
9723
|
+
`Load ${Math.min(remaining, this.MESSAGE_PAGE_SIZE)} More... (${remaining} remaining)`,
|
|
9724
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9725
|
+
"message",
|
|
9726
|
+
"queue",
|
|
9727
|
+
queueName
|
|
9728
|
+
);
|
|
9729
|
+
loadMoreItem.contextValue = "loadMoreDlqMessages";
|
|
9730
|
+
items.push(loadMoreItem);
|
|
9731
|
+
}
|
|
9732
|
+
return items;
|
|
9733
|
+
}
|
|
9734
|
+
return [
|
|
9735
|
+
new DataTreeItem(
|
|
9736
|
+
this.getErrorMessage(result.error, "DLQ"),
|
|
9737
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9738
|
+
"message"
|
|
9739
|
+
)
|
|
9740
|
+
];
|
|
9741
|
+
} catch (err) {
|
|
9742
|
+
const message = err instanceof Error ? err.message : "Failed to load DLQ";
|
|
9743
|
+
return [new DataTreeItem(message, vscode13.TreeItemCollapsibleState.None, "message")];
|
|
9744
|
+
}
|
|
9745
|
+
}
|
|
9746
|
+
async loadQueueDestinations(queueName) {
|
|
9747
|
+
const cli = getCliClient();
|
|
9748
|
+
try {
|
|
9749
|
+
const result = await cli.listQueueDestinations(queueName);
|
|
9750
|
+
if (result.success && result.data?.destinations) {
|
|
9751
|
+
if (result.data.destinations.length === 0) {
|
|
9752
|
+
return [
|
|
9753
|
+
new DataTreeItem(
|
|
9754
|
+
"No destinations",
|
|
9755
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9756
|
+
"message"
|
|
9757
|
+
)
|
|
9758
|
+
];
|
|
9759
|
+
}
|
|
9760
|
+
return result.data.destinations.map((dest) => {
|
|
9761
|
+
const item = new DataTreeItem(
|
|
9762
|
+
dest.url,
|
|
9763
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9764
|
+
"queueDestination",
|
|
9765
|
+
"queue",
|
|
9766
|
+
queueName
|
|
9767
|
+
);
|
|
9768
|
+
item.contextValue = "queueDestination";
|
|
9769
|
+
item.description = dest.enabled ? "enabled" : "disabled";
|
|
9770
|
+
item.tooltip = [
|
|
9771
|
+
`ID: ${dest.id}`,
|
|
9772
|
+
`Type: ${dest.destination_type}`,
|
|
9773
|
+
`URL: ${dest.url}`,
|
|
9774
|
+
`Enabled: ${dest.enabled ? "Yes" : "No"}`,
|
|
9775
|
+
`Created: ${new Date(dest.created_at).toLocaleString()}`
|
|
9776
|
+
].join("\n");
|
|
9777
|
+
item.destinationId = dest.id;
|
|
9778
|
+
return item;
|
|
9779
|
+
});
|
|
9780
|
+
}
|
|
9781
|
+
return [
|
|
9782
|
+
new DataTreeItem(
|
|
9783
|
+
this.getErrorMessage(result.error, "destinations"),
|
|
9784
|
+
vscode13.TreeItemCollapsibleState.None,
|
|
9785
|
+
"message"
|
|
9786
|
+
)
|
|
9787
|
+
];
|
|
9788
|
+
} catch (err) {
|
|
9789
|
+
const message = err instanceof Error ? err.message : "Failed to load destinations";
|
|
9790
|
+
return [new DataTreeItem(message, vscode13.TreeItemCollapsibleState.None, "message")];
|
|
9791
|
+
}
|
|
9792
|
+
}
|
|
9262
9793
|
dispose() {
|
|
9263
9794
|
this._onDidChangeTreeData.dispose();
|
|
9264
9795
|
}
|
|
@@ -9267,7 +9798,7 @@ ID: ${result.id ?? "(unknown)"}`;
|
|
|
9267
9798
|
// src/features/dataExplorer/index.ts
|
|
9268
9799
|
function registerDataExplorer(context) {
|
|
9269
9800
|
const provider = new DataTreeDataProvider();
|
|
9270
|
-
const treeView =
|
|
9801
|
+
const treeView = vscode14.window.createTreeView("agentuity.data", {
|
|
9271
9802
|
treeDataProvider: provider,
|
|
9272
9803
|
showCollapseAll: true
|
|
9273
9804
|
});
|
|
@@ -9284,6 +9815,14 @@ function registerDataExplorer(context) {
|
|
|
9284
9815
|
await openStorageFile(item);
|
|
9285
9816
|
} else if (item.itemType === "streamItem" && item.streamInfo) {
|
|
9286
9817
|
await openStreamDetails(item);
|
|
9818
|
+
} else if (item.itemType === "queueMessage" && item.parentName) {
|
|
9819
|
+
await vscode14.commands.executeCommand("agentuity.queue.viewMessage", item);
|
|
9820
|
+
} else if (item.itemType === "queueItem" && item.queueInfo) {
|
|
9821
|
+
await openQueueDetails(item);
|
|
9822
|
+
} else if (item.itemType === "message" && item.contextValue === "loadMoreMessages" && item.parentName) {
|
|
9823
|
+
provider.loadMoreMessages(item.parentName);
|
|
9824
|
+
} else if (item.itemType === "message" && item.contextValue === "loadMoreDlqMessages" && item.parentName) {
|
|
9825
|
+
provider.loadMoreDlqMessages(item.parentName);
|
|
9287
9826
|
}
|
|
9288
9827
|
});
|
|
9289
9828
|
const authSub = onAuthStatusChanged(() => {
|
|
@@ -9293,7 +9832,7 @@ function registerDataExplorer(context) {
|
|
|
9293
9832
|
provider.refresh();
|
|
9294
9833
|
});
|
|
9295
9834
|
context.subscriptions.push(
|
|
9296
|
-
|
|
9835
|
+
vscode14.commands.registerCommand(
|
|
9297
9836
|
"agentuity.db.copyConnectionString",
|
|
9298
9837
|
async (item) => {
|
|
9299
9838
|
if (item?.itemType === "database") {
|
|
@@ -9303,7 +9842,7 @@ function registerDataExplorer(context) {
|
|
|
9303
9842
|
)
|
|
9304
9843
|
);
|
|
9305
9844
|
context.subscriptions.push(
|
|
9306
|
-
|
|
9845
|
+
vscode14.commands.registerCommand(
|
|
9307
9846
|
"agentuity.db.openConnectionUri",
|
|
9308
9847
|
async (item) => {
|
|
9309
9848
|
if (item?.itemType !== "database") return;
|
|
@@ -9311,40 +9850,40 @@ function registerDataExplorer(context) {
|
|
|
9311
9850
|
const name2 = String(item.label);
|
|
9312
9851
|
const result = await cli.getDatabase(name2);
|
|
9313
9852
|
if (!result.success || !result.data) {
|
|
9314
|
-
|
|
9853
|
+
vscode14.window.showErrorMessage(
|
|
9315
9854
|
`Failed to get database "${name2}": ${result.error ?? "Unknown error"}`
|
|
9316
9855
|
);
|
|
9317
9856
|
return;
|
|
9318
9857
|
}
|
|
9319
9858
|
try {
|
|
9320
|
-
await
|
|
9859
|
+
await vscode14.env.openExternal(vscode14.Uri.parse(result.data.url));
|
|
9321
9860
|
} catch {
|
|
9322
|
-
|
|
9861
|
+
vscode14.window.showErrorMessage(`Could not open URI: ${result.data.url}`);
|
|
9323
9862
|
}
|
|
9324
9863
|
}
|
|
9325
9864
|
)
|
|
9326
9865
|
);
|
|
9327
9866
|
context.subscriptions.push(
|
|
9328
|
-
|
|
9867
|
+
vscode14.commands.registerCommand("agentuity.db.viewLogs", async (item) => {
|
|
9329
9868
|
if (item?.itemType !== "database") return;
|
|
9330
9869
|
const cli = getCliClient();
|
|
9331
9870
|
const name2 = String(item.label);
|
|
9332
|
-
await
|
|
9871
|
+
await vscode14.window.withProgress(
|
|
9333
9872
|
{
|
|
9334
|
-
location:
|
|
9873
|
+
location: vscode14.ProgressLocation.Notification,
|
|
9335
9874
|
title: `Fetching database logs for "${name2}"...`,
|
|
9336
9875
|
cancellable: false
|
|
9337
9876
|
},
|
|
9338
9877
|
async () => {
|
|
9339
9878
|
const result = await cli.getDbLogs(name2, { limit: 100 });
|
|
9340
9879
|
if (!result.success || !result.data) {
|
|
9341
|
-
|
|
9880
|
+
vscode14.window.showErrorMessage(
|
|
9342
9881
|
`Failed to fetch database logs: ${result.error ?? "Unknown error"}`
|
|
9343
9882
|
);
|
|
9344
9883
|
return;
|
|
9345
9884
|
}
|
|
9346
9885
|
if (result.data.length === 0) {
|
|
9347
|
-
|
|
9886
|
+
vscode14.window.showInformationMessage("No logs found for this database");
|
|
9348
9887
|
return;
|
|
9349
9888
|
}
|
|
9350
9889
|
const logContent = result.data.map((log2) => {
|
|
@@ -9358,48 +9897,412 @@ function registerDataExplorer(context) {
|
|
|
9358
9897
|
}).join("\n\n");
|
|
9359
9898
|
await openReadonlyDocument(logContent, "log", `db-logs-${name2}`);
|
|
9360
9899
|
}
|
|
9361
|
-
);
|
|
9362
|
-
})
|
|
9900
|
+
);
|
|
9901
|
+
})
|
|
9902
|
+
);
|
|
9903
|
+
context.subscriptions.push(
|
|
9904
|
+
vscode14.commands.registerCommand("agentuity.vector.search", async () => {
|
|
9905
|
+
const cli = getCliClient();
|
|
9906
|
+
const namespace = await vscode14.window.showInputBox({
|
|
9907
|
+
prompt: "Vector namespace",
|
|
9908
|
+
placeHolder: "e.g., default, products, knowledge-base",
|
|
9909
|
+
ignoreFocusOut: true
|
|
9910
|
+
});
|
|
9911
|
+
if (!namespace) return;
|
|
9912
|
+
const query = await vscode14.window.showInputBox({
|
|
9913
|
+
prompt: "Search query (text to find similar vectors)",
|
|
9914
|
+
placeHolder: "Enter search text...",
|
|
9915
|
+
ignoreFocusOut: true
|
|
9916
|
+
});
|
|
9917
|
+
if (!query) return;
|
|
9918
|
+
const result = await cli.vectorSearch(namespace, query);
|
|
9919
|
+
if (!result.success || !result.data) {
|
|
9920
|
+
vscode14.window.showErrorMessage(
|
|
9921
|
+
`Vector search failed: ${result.error ?? "Unknown error"}`
|
|
9922
|
+
);
|
|
9923
|
+
return;
|
|
9924
|
+
}
|
|
9925
|
+
provider.addVectorSearchGroup({
|
|
9926
|
+
id: `${namespace}:${Date.now()}`,
|
|
9927
|
+
label: `"${query}" in ${namespace}`,
|
|
9928
|
+
namespace,
|
|
9929
|
+
query,
|
|
9930
|
+
results: result.data.results ?? []
|
|
9931
|
+
});
|
|
9932
|
+
vscode14.window.showInformationMessage(
|
|
9933
|
+
`Found ${result.data.count} result${result.data.count !== 1 ? "s" : ""}`
|
|
9934
|
+
);
|
|
9935
|
+
})
|
|
9936
|
+
);
|
|
9937
|
+
context.subscriptions.push(
|
|
9938
|
+
vscode14.commands.registerCommand("agentuity.vector.clearSearches", () => {
|
|
9939
|
+
provider.clearVectorSearchGroups();
|
|
9940
|
+
vscode14.window.showInformationMessage("Cleared vector search results");
|
|
9941
|
+
})
|
|
9942
|
+
);
|
|
9943
|
+
context.subscriptions.push(
|
|
9944
|
+
vscode14.commands.registerCommand("agentuity.queue.create", async () => {
|
|
9945
|
+
const cli = getCliClient();
|
|
9946
|
+
const queueType = await vscode14.window.showQuickPick(
|
|
9947
|
+
[
|
|
9948
|
+
{
|
|
9949
|
+
label: "Worker",
|
|
9950
|
+
description: "Point-to-point queue with acknowledgment",
|
|
9951
|
+
value: "worker"
|
|
9952
|
+
},
|
|
9953
|
+
{
|
|
9954
|
+
label: "Pub/Sub",
|
|
9955
|
+
description: "Publish-subscribe with multiple consumers",
|
|
9956
|
+
value: "pubsub"
|
|
9957
|
+
}
|
|
9958
|
+
],
|
|
9959
|
+
{ placeHolder: "Select queue type" }
|
|
9960
|
+
);
|
|
9961
|
+
if (!queueType) return;
|
|
9962
|
+
const name2 = await vscode14.window.showInputBox({
|
|
9963
|
+
prompt: "Queue name",
|
|
9964
|
+
placeHolder: "my-queue",
|
|
9965
|
+
validateInput: (value) => {
|
|
9966
|
+
if (!value || value.trim() === "") return "Queue name is required";
|
|
9967
|
+
if (!/^[a-zA-Z0-9_-]+$/.test(value))
|
|
9968
|
+
return "Only letters, numbers, dashes, and underscores allowed";
|
|
9969
|
+
return null;
|
|
9970
|
+
}
|
|
9971
|
+
});
|
|
9972
|
+
if (!name2) return;
|
|
9973
|
+
const ttlStr = await vscode14.window.showInputBox({
|
|
9974
|
+
prompt: "Message TTL in seconds (optional)",
|
|
9975
|
+
placeHolder: "86400 (24 hours)"
|
|
9976
|
+
});
|
|
9977
|
+
const ttl = ttlStr ? parseInt(ttlStr, 10) : void 0;
|
|
9978
|
+
const result = await cli.createQueue(queueType.value, name2, {
|
|
9979
|
+
ttl
|
|
9980
|
+
});
|
|
9981
|
+
if (result.success) {
|
|
9982
|
+
vscode14.window.showInformationMessage(`Created ${queueType.value} queue: ${name2}`);
|
|
9983
|
+
provider.refresh();
|
|
9984
|
+
} else {
|
|
9985
|
+
vscode14.window.showErrorMessage(`Failed to create queue: ${result.error}`);
|
|
9986
|
+
}
|
|
9987
|
+
})
|
|
9988
|
+
);
|
|
9989
|
+
context.subscriptions.push(
|
|
9990
|
+
vscode14.commands.registerCommand("agentuity.queue.delete", async (item) => {
|
|
9991
|
+
if (item?.itemType !== "queueItem" || !item.queueInfo) return;
|
|
9992
|
+
const queueName = item.queueInfo.name;
|
|
9993
|
+
const confirm = await vscode14.window.showInputBox({
|
|
9994
|
+
prompt: `Type "${queueName}" to confirm deletion`,
|
|
9995
|
+
placeHolder: queueName
|
|
9996
|
+
});
|
|
9997
|
+
if (confirm !== queueName) {
|
|
9998
|
+
vscode14.window.showWarningMessage("Queue deletion cancelled");
|
|
9999
|
+
return;
|
|
10000
|
+
}
|
|
10001
|
+
const cli = getCliClient();
|
|
10002
|
+
const result = await cli.deleteQueue(queueName);
|
|
10003
|
+
if (result.success) {
|
|
10004
|
+
vscode14.window.showInformationMessage(`Deleted queue: ${queueName}`);
|
|
10005
|
+
provider.refresh();
|
|
10006
|
+
} else {
|
|
10007
|
+
vscode14.window.showErrorMessage(`Failed to delete queue: ${result.error}`);
|
|
10008
|
+
}
|
|
10009
|
+
})
|
|
10010
|
+
);
|
|
10011
|
+
context.subscriptions.push(
|
|
10012
|
+
vscode14.commands.registerCommand("agentuity.queue.pause", async (item) => {
|
|
10013
|
+
if (item?.itemType !== "queueItem" || !item.queueInfo) return;
|
|
10014
|
+
const cli = getCliClient();
|
|
10015
|
+
const result = await cli.pauseQueue(item.queueInfo.name);
|
|
10016
|
+
if (result.success) {
|
|
10017
|
+
vscode14.window.showInformationMessage(`Paused queue: ${item.queueInfo.name}`);
|
|
10018
|
+
provider.refresh();
|
|
10019
|
+
} else {
|
|
10020
|
+
vscode14.window.showErrorMessage(`Failed to pause queue: ${result.error}`);
|
|
10021
|
+
}
|
|
10022
|
+
})
|
|
10023
|
+
);
|
|
10024
|
+
context.subscriptions.push(
|
|
10025
|
+
vscode14.commands.registerCommand("agentuity.queue.resume", async (item) => {
|
|
10026
|
+
if (item?.itemType !== "queueItem" || !item.queueInfo) return;
|
|
10027
|
+
const cli = getCliClient();
|
|
10028
|
+
const result = await cli.resumeQueue(item.queueInfo.name);
|
|
10029
|
+
if (result.success) {
|
|
10030
|
+
vscode14.window.showInformationMessage(`Resumed queue: ${item.queueInfo.name}`);
|
|
10031
|
+
provider.refresh();
|
|
10032
|
+
} else {
|
|
10033
|
+
vscode14.window.showErrorMessage(`Failed to resume queue: ${result.error}`);
|
|
10034
|
+
}
|
|
10035
|
+
})
|
|
10036
|
+
);
|
|
10037
|
+
context.subscriptions.push(
|
|
10038
|
+
vscode14.commands.registerCommand("agentuity.queue.publish", async (item) => {
|
|
10039
|
+
let queueName;
|
|
10040
|
+
if (item?.itemType === "queueItem" && item.queueInfo) {
|
|
10041
|
+
queueName = item.queueInfo.name;
|
|
10042
|
+
} else {
|
|
10043
|
+
const cli2 = getCliClient();
|
|
10044
|
+
const queuesResult = await cli2.listQueues();
|
|
10045
|
+
if (!queuesResult.success || !queuesResult.data?.queues?.length) {
|
|
10046
|
+
vscode14.window.showErrorMessage("No queues available");
|
|
10047
|
+
return;
|
|
10048
|
+
}
|
|
10049
|
+
const queuePick = await vscode14.window.showQuickPick(
|
|
10050
|
+
queuesResult.data.queues.map((q) => ({ label: q.name, description: q.queue_type })),
|
|
10051
|
+
{ placeHolder: "Select queue" }
|
|
10052
|
+
);
|
|
10053
|
+
if (!queuePick) return;
|
|
10054
|
+
queueName = queuePick.label;
|
|
10055
|
+
}
|
|
10056
|
+
const payloadStr = await vscode14.window.showInputBox({
|
|
10057
|
+
prompt: "Message payload (JSON)",
|
|
10058
|
+
placeHolder: '{"key": "value"}',
|
|
10059
|
+
validateInput: (value) => {
|
|
10060
|
+
if (!value) return "Payload is required";
|
|
10061
|
+
try {
|
|
10062
|
+
JSON.parse(value);
|
|
10063
|
+
return null;
|
|
10064
|
+
} catch {
|
|
10065
|
+
return "Invalid JSON";
|
|
10066
|
+
}
|
|
10067
|
+
}
|
|
10068
|
+
});
|
|
10069
|
+
if (!payloadStr) return;
|
|
10070
|
+
const metadataStr = await vscode14.window.showInputBox({
|
|
10071
|
+
prompt: "Message metadata (JSON, optional)",
|
|
10072
|
+
placeHolder: '{"priority": "high"}',
|
|
10073
|
+
validateInput: (value) => {
|
|
10074
|
+
if (!value) return null;
|
|
10075
|
+
try {
|
|
10076
|
+
JSON.parse(value);
|
|
10077
|
+
return null;
|
|
10078
|
+
} catch {
|
|
10079
|
+
return "Invalid JSON";
|
|
10080
|
+
}
|
|
10081
|
+
}
|
|
10082
|
+
});
|
|
10083
|
+
const cli = getCliClient();
|
|
10084
|
+
const result = await cli.publishQueueMessage(queueName, payloadStr, {
|
|
10085
|
+
metadata: metadataStr || void 0
|
|
10086
|
+
});
|
|
10087
|
+
if (result.success && result.data) {
|
|
10088
|
+
vscode14.window.showInformationMessage(`Published message: ${result.data.id}`);
|
|
10089
|
+
provider.refresh();
|
|
10090
|
+
} else {
|
|
10091
|
+
vscode14.window.showErrorMessage(`Failed to publish message: ${result.error}`);
|
|
10092
|
+
}
|
|
10093
|
+
})
|
|
10094
|
+
);
|
|
10095
|
+
context.subscriptions.push(
|
|
10096
|
+
vscode14.commands.registerCommand("agentuity.queue.viewMessage", async (item) => {
|
|
10097
|
+
if (item?.itemType !== "queueMessage" || !item.parentName) return;
|
|
10098
|
+
const messageId = item.messageId;
|
|
10099
|
+
if (!messageId) return;
|
|
10100
|
+
const cli = getCliClient();
|
|
10101
|
+
const result = await cli.getQueueMessage(item.parentName, messageId);
|
|
10102
|
+
if (result.success && result.data?.message) {
|
|
10103
|
+
const msg = result.data.message;
|
|
10104
|
+
const content = JSON.stringify(
|
|
10105
|
+
{
|
|
10106
|
+
id: msg.id,
|
|
10107
|
+
queue_id: msg.queue_id,
|
|
10108
|
+
offset: msg.offset,
|
|
10109
|
+
state: msg.state,
|
|
10110
|
+
delivery_attempts: msg.delivery_attempts,
|
|
10111
|
+
partition_key: msg.partition_key,
|
|
10112
|
+
idempotency_key: msg.idempotency_key,
|
|
10113
|
+
published_at: msg.published_at,
|
|
10114
|
+
created_at: msg.created_at,
|
|
10115
|
+
delivered_at: msg.delivered_at,
|
|
10116
|
+
acknowledged_at: msg.acknowledged_at,
|
|
10117
|
+
expires_at: msg.expires_at,
|
|
10118
|
+
payload: msg.payload,
|
|
10119
|
+
metadata: msg.metadata
|
|
10120
|
+
},
|
|
10121
|
+
null,
|
|
10122
|
+
2
|
|
10123
|
+
);
|
|
10124
|
+
await openReadonlyDocument(
|
|
10125
|
+
content,
|
|
10126
|
+
"json",
|
|
10127
|
+
`queue-message-${messageId.substring(0, 8)}`
|
|
10128
|
+
);
|
|
10129
|
+
} else {
|
|
10130
|
+
vscode14.window.showErrorMessage(`Failed to get message: ${result.error}`);
|
|
10131
|
+
}
|
|
10132
|
+
})
|
|
10133
|
+
);
|
|
10134
|
+
context.subscriptions.push(
|
|
10135
|
+
vscode14.commands.registerCommand(
|
|
10136
|
+
"agentuity.queue.copyMessageId",
|
|
10137
|
+
async (item) => {
|
|
10138
|
+
if (item?.itemType !== "queueMessage" && item?.itemType !== "dlqMessage") return;
|
|
10139
|
+
const messageId = item.messageId;
|
|
10140
|
+
if (!messageId) return;
|
|
10141
|
+
await vscode14.env.clipboard.writeText(messageId);
|
|
10142
|
+
vscode14.window.showInformationMessage("Message ID copied to clipboard");
|
|
10143
|
+
}
|
|
10144
|
+
)
|
|
10145
|
+
);
|
|
10146
|
+
context.subscriptions.push(
|
|
10147
|
+
vscode14.commands.registerCommand(
|
|
10148
|
+
"agentuity.queue.refreshMessages",
|
|
10149
|
+
async (item) => {
|
|
10150
|
+
let queueName;
|
|
10151
|
+
if (item?.itemType === "queueItem" && item.queueInfo) {
|
|
10152
|
+
queueName = item.queueInfo.name;
|
|
10153
|
+
} else if (item?.itemType === "queueSection" && item.parentName) {
|
|
10154
|
+
queueName = item.parentName;
|
|
10155
|
+
}
|
|
10156
|
+
if (queueName) {
|
|
10157
|
+
provider.refreshQueueMessages(queueName);
|
|
10158
|
+
vscode14.window.showInformationMessage(`Refreshed messages for queue: ${queueName}`);
|
|
10159
|
+
}
|
|
10160
|
+
}
|
|
10161
|
+
)
|
|
10162
|
+
);
|
|
10163
|
+
context.subscriptions.push(
|
|
10164
|
+
vscode14.commands.registerCommand("agentuity.queue.dlq.replay", async (item) => {
|
|
10165
|
+
if (item?.itemType !== "dlqMessage" || !item.parentName) return;
|
|
10166
|
+
const messageId = item.messageId;
|
|
10167
|
+
if (!messageId) return;
|
|
10168
|
+
const cli = getCliClient();
|
|
10169
|
+
const result = await cli.replayDlqMessage(item.parentName, messageId);
|
|
10170
|
+
if (result.success) {
|
|
10171
|
+
vscode14.window.showInformationMessage(`Replayed message: ${messageId}`);
|
|
10172
|
+
provider.refreshQueueMessages(item.parentName);
|
|
10173
|
+
} else {
|
|
10174
|
+
vscode14.window.showErrorMessage(`Failed to replay message: ${result.error}`);
|
|
10175
|
+
}
|
|
10176
|
+
})
|
|
10177
|
+
);
|
|
10178
|
+
context.subscriptions.push(
|
|
10179
|
+
vscode14.commands.registerCommand("agentuity.queue.dlq.purge", async (item) => {
|
|
10180
|
+
let queueName;
|
|
10181
|
+
if (item?.itemType === "queueSection" && item.parentName && item.label === "Dead Letter Queue") {
|
|
10182
|
+
queueName = item.parentName;
|
|
10183
|
+
} else if (item?.itemType === "queueItem" && item.queueInfo) {
|
|
10184
|
+
queueName = item.queueInfo.name;
|
|
10185
|
+
} else {
|
|
10186
|
+
return;
|
|
10187
|
+
}
|
|
10188
|
+
const confirm = await vscode14.window.showInputBox({
|
|
10189
|
+
prompt: `Type "purge ${queueName}" to confirm DLQ purge`,
|
|
10190
|
+
placeHolder: `purge ${queueName}`
|
|
10191
|
+
});
|
|
10192
|
+
if (confirm !== `purge ${queueName}`) {
|
|
10193
|
+
vscode14.window.showWarningMessage("DLQ purge cancelled");
|
|
10194
|
+
return;
|
|
10195
|
+
}
|
|
10196
|
+
const cli = getCliClient();
|
|
10197
|
+
const result = await cli.purgeDlq(queueName);
|
|
10198
|
+
if (result.success) {
|
|
10199
|
+
vscode14.window.showInformationMessage(`Purged DLQ for: ${queueName}`);
|
|
10200
|
+
provider.refreshQueueMessages(queueName);
|
|
10201
|
+
} else {
|
|
10202
|
+
vscode14.window.showErrorMessage(`Failed to purge DLQ: ${result.error}`);
|
|
10203
|
+
}
|
|
10204
|
+
})
|
|
10205
|
+
);
|
|
10206
|
+
context.subscriptions.push(
|
|
10207
|
+
vscode14.commands.registerCommand(
|
|
10208
|
+
"agentuity.queue.destination.create",
|
|
10209
|
+
async (item) => {
|
|
10210
|
+
let queueName;
|
|
10211
|
+
if (item?.itemType === "queueSection" && item.parentName && item.label === "Destinations") {
|
|
10212
|
+
queueName = item.parentName;
|
|
10213
|
+
} else if (item?.itemType === "queueItem" && item.queueInfo) {
|
|
10214
|
+
queueName = item.queueInfo.name;
|
|
10215
|
+
} else {
|
|
10216
|
+
return;
|
|
10217
|
+
}
|
|
10218
|
+
const url = await vscode14.window.showInputBox({
|
|
10219
|
+
prompt: "Webhook URL",
|
|
10220
|
+
placeHolder: "https://example.com/webhook",
|
|
10221
|
+
validateInput: (value) => {
|
|
10222
|
+
if (!value) return "URL is required";
|
|
10223
|
+
try {
|
|
10224
|
+
new URL(value);
|
|
10225
|
+
return null;
|
|
10226
|
+
} catch {
|
|
10227
|
+
return "Invalid URL";
|
|
10228
|
+
}
|
|
10229
|
+
}
|
|
10230
|
+
});
|
|
10231
|
+
if (!url) return;
|
|
10232
|
+
const method = await vscode14.window.showQuickPick(["POST", "PUT", "PATCH"], {
|
|
10233
|
+
placeHolder: "HTTP method (default: POST)"
|
|
10234
|
+
});
|
|
10235
|
+
const cli = getCliClient();
|
|
10236
|
+
const result = await cli.createQueueDestination(queueName, url, {
|
|
10237
|
+
method: method || "POST"
|
|
10238
|
+
});
|
|
10239
|
+
if (result.success) {
|
|
10240
|
+
vscode14.window.showInformationMessage(
|
|
10241
|
+
`Created destination: ${url} - refresh to see updated state`
|
|
10242
|
+
);
|
|
10243
|
+
} else {
|
|
10244
|
+
vscode14.window.showErrorMessage(`Failed to create destination: ${result.error}`);
|
|
10245
|
+
}
|
|
10246
|
+
}
|
|
10247
|
+
)
|
|
10248
|
+
);
|
|
10249
|
+
context.subscriptions.push(
|
|
10250
|
+
vscode14.commands.registerCommand(
|
|
10251
|
+
"agentuity.queue.destination.delete",
|
|
10252
|
+
async (item) => {
|
|
10253
|
+
if (item?.itemType !== "queueDestination" || !item.parentName) return;
|
|
10254
|
+
const destinationId = item.destinationId;
|
|
10255
|
+
if (!destinationId) return;
|
|
10256
|
+
const confirm = await vscode14.window.showWarningMessage(
|
|
10257
|
+
`Delete destination: ${item.label}?`,
|
|
10258
|
+
{ modal: true },
|
|
10259
|
+
"Delete"
|
|
10260
|
+
);
|
|
10261
|
+
if (confirm !== "Delete") return;
|
|
10262
|
+
const cli = getCliClient();
|
|
10263
|
+
const result = await cli.deleteQueueDestination(item.parentName, destinationId);
|
|
10264
|
+
if (result.success) {
|
|
10265
|
+
vscode14.window.showInformationMessage(
|
|
10266
|
+
"Destination deleted - refresh to see updated state"
|
|
10267
|
+
);
|
|
10268
|
+
} else {
|
|
10269
|
+
vscode14.window.showErrorMessage(`Failed to delete destination: ${result.error}`);
|
|
10270
|
+
}
|
|
10271
|
+
}
|
|
10272
|
+
)
|
|
9363
10273
|
);
|
|
9364
10274
|
context.subscriptions.push(
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9369
|
-
|
|
9370
|
-
|
|
9371
|
-
|
|
9372
|
-
|
|
9373
|
-
|
|
9374
|
-
|
|
9375
|
-
|
|
9376
|
-
|
|
9377
|
-
|
|
9378
|
-
|
|
9379
|
-
|
|
9380
|
-
|
|
9381
|
-
|
|
9382
|
-
`
|
|
9383
|
-
|
|
9384
|
-
return;
|
|
10275
|
+
vscode14.commands.registerCommand(
|
|
10276
|
+
"agentuity.queue.destination.toggle",
|
|
10277
|
+
async (item) => {
|
|
10278
|
+
if (item?.itemType !== "queueDestination" || !item.parentName) return;
|
|
10279
|
+
const destinationId = item.destinationId;
|
|
10280
|
+
if (!destinationId) return;
|
|
10281
|
+
const isEnabled = item.description === "enabled";
|
|
10282
|
+
const cli = getCliClient();
|
|
10283
|
+
const result = await cli.updateQueueDestination(item.parentName, destinationId, {
|
|
10284
|
+
enabled: !isEnabled,
|
|
10285
|
+
disabled: isEnabled
|
|
10286
|
+
});
|
|
10287
|
+
if (result.success) {
|
|
10288
|
+
vscode14.window.showInformationMessage(
|
|
10289
|
+
`Destination ${isEnabled ? "disabled" : "enabled"} - refresh to see updated state`
|
|
10290
|
+
);
|
|
10291
|
+
} else {
|
|
10292
|
+
vscode14.window.showErrorMessage(`Failed to update destination: ${result.error}`);
|
|
10293
|
+
}
|
|
9385
10294
|
}
|
|
9386
|
-
|
|
9387
|
-
id: `${namespace}:${Date.now()}`,
|
|
9388
|
-
label: `"${query}" in ${namespace}`,
|
|
9389
|
-
namespace,
|
|
9390
|
-
query,
|
|
9391
|
-
results: result.data.results ?? []
|
|
9392
|
-
});
|
|
9393
|
-
vscode13.window.showInformationMessage(
|
|
9394
|
-
`Found ${result.data.count} result${result.data.count !== 1 ? "s" : ""}`
|
|
9395
|
-
);
|
|
9396
|
-
})
|
|
10295
|
+
)
|
|
9397
10296
|
);
|
|
9398
10297
|
context.subscriptions.push(
|
|
9399
|
-
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
10298
|
+
vscode14.commands.registerCommand(
|
|
10299
|
+
"agentuity.queue.destination.copyUrl",
|
|
10300
|
+
async (item) => {
|
|
10301
|
+
if (item?.itemType !== "queueDestination") return;
|
|
10302
|
+
await vscode14.env.clipboard.writeText(item.label);
|
|
10303
|
+
vscode14.window.showInformationMessage("URL copied to clipboard");
|
|
10304
|
+
}
|
|
10305
|
+
)
|
|
9403
10306
|
);
|
|
9404
10307
|
context.subscriptions.push(treeView, authSub, projectSub, { dispose: () => provider.dispose() });
|
|
9405
10308
|
return provider;
|
|
@@ -9409,13 +10312,13 @@ async function copyDatabaseConnectionString(item) {
|
|
|
9409
10312
|
const name2 = String(item.label);
|
|
9410
10313
|
const result = await cli.getDatabase(name2);
|
|
9411
10314
|
if (!result.success || !result.data) {
|
|
9412
|
-
|
|
10315
|
+
vscode14.window.showErrorMessage(
|
|
9413
10316
|
`Failed to get database "${name2}": ${result.error ?? "Unknown error"}`
|
|
9414
10317
|
);
|
|
9415
10318
|
return;
|
|
9416
10319
|
}
|
|
9417
|
-
await
|
|
9418
|
-
|
|
10320
|
+
await vscode14.env.clipboard.writeText(result.data.url);
|
|
10321
|
+
vscode14.window.showInformationMessage(`Copied connection string for "${name2}" to clipboard`);
|
|
9419
10322
|
}
|
|
9420
10323
|
async function openVectorDocument(item) {
|
|
9421
10324
|
const cli = getCliClient();
|
|
@@ -9423,11 +10326,11 @@ async function openVectorDocument(item) {
|
|
|
9423
10326
|
const namespace = item.parentName;
|
|
9424
10327
|
const result = await cli.getVector(namespace, key);
|
|
9425
10328
|
if (!result.success || !result.data) {
|
|
9426
|
-
|
|
10329
|
+
vscode14.window.showErrorMessage(`Failed to get vector: ${result.error}`);
|
|
9427
10330
|
return;
|
|
9428
10331
|
}
|
|
9429
10332
|
if (!result.data.exists) {
|
|
9430
|
-
|
|
10333
|
+
vscode14.window.showWarningMessage(`Vector "${key}" does not exist`);
|
|
9431
10334
|
return;
|
|
9432
10335
|
}
|
|
9433
10336
|
const lines = [];
|
|
@@ -9450,12 +10353,12 @@ async function openDataValue(item) {
|
|
|
9450
10353
|
const result = await cli.getKvValue(namespace, key);
|
|
9451
10354
|
if (result.success && result.data) {
|
|
9452
10355
|
if (!result.data.exists) {
|
|
9453
|
-
|
|
10356
|
+
vscode14.window.showWarningMessage(`Key "${key}" does not exist`);
|
|
9454
10357
|
return;
|
|
9455
10358
|
}
|
|
9456
10359
|
await openContent(result.data.data, result.data.contentType);
|
|
9457
10360
|
} else {
|
|
9458
|
-
|
|
10361
|
+
vscode14.window.showErrorMessage(`Failed to get value: ${result.error}`);
|
|
9459
10362
|
}
|
|
9460
10363
|
}
|
|
9461
10364
|
async function openStorageFile(item) {
|
|
@@ -9464,7 +10367,7 @@ async function openStorageFile(item) {
|
|
|
9464
10367
|
const bucket = item.parentName;
|
|
9465
10368
|
const result = await cli.getStorageFileMetadata(bucket, filename);
|
|
9466
10369
|
if (!result.success || !result.data) {
|
|
9467
|
-
|
|
10370
|
+
vscode14.window.showErrorMessage(`Failed to get file metadata: ${result.error}`);
|
|
9468
10371
|
return;
|
|
9469
10372
|
}
|
|
9470
10373
|
const lines = [];
|
|
@@ -9497,6 +10400,33 @@ async function openStreamDetails(item) {
|
|
|
9497
10400
|
);
|
|
9498
10401
|
await openReadonlyDocument(content, "json", `stream-${stream.name}`);
|
|
9499
10402
|
}
|
|
10403
|
+
async function openQueueDetails(item) {
|
|
10404
|
+
const cli = getCliClient();
|
|
10405
|
+
const queueName = item.queueInfo.name;
|
|
10406
|
+
const result = await cli.getQueue(queueName);
|
|
10407
|
+
if (result.success && result.data?.queue) {
|
|
10408
|
+
const queue = result.data.queue;
|
|
10409
|
+
const content = JSON.stringify(
|
|
10410
|
+
{
|
|
10411
|
+
name: queue.name,
|
|
10412
|
+
id: queue.id,
|
|
10413
|
+
queue_type: queue.queue_type,
|
|
10414
|
+
description: queue.description,
|
|
10415
|
+
message_count: queue.message_count,
|
|
10416
|
+
dlq_count: queue.dlq_count,
|
|
10417
|
+
next_offset: queue.next_offset,
|
|
10418
|
+
paused_at: queue.paused_at,
|
|
10419
|
+
created_at: queue.created_at,
|
|
10420
|
+
updated_at: queue.updated_at
|
|
10421
|
+
},
|
|
10422
|
+
null,
|
|
10423
|
+
2
|
|
10424
|
+
);
|
|
10425
|
+
await openReadonlyDocument(content, "json", `queue-${queueName}`);
|
|
10426
|
+
} else {
|
|
10427
|
+
vscode14.window.showErrorMessage(`Failed to get queue details: ${result.error}`);
|
|
10428
|
+
}
|
|
10429
|
+
}
|
|
9500
10430
|
function formatFileSize(bytes) {
|
|
9501
10431
|
if (bytes < 1024) return `${bytes} B`;
|
|
9502
10432
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
@@ -9556,11 +10486,11 @@ function bytesToString(data) {
|
|
|
9556
10486
|
}
|
|
9557
10487
|
|
|
9558
10488
|
// src/features/deploymentExplorer/index.ts
|
|
9559
|
-
var
|
|
10489
|
+
var vscode16 = __toESM(require("vscode"));
|
|
9560
10490
|
|
|
9561
10491
|
// src/features/deploymentExplorer/deploymentTreeData.ts
|
|
9562
|
-
var
|
|
9563
|
-
var DeploymentTreeItem = class extends
|
|
10492
|
+
var vscode15 = __toESM(require("vscode"));
|
|
10493
|
+
var DeploymentTreeItem = class extends vscode15.TreeItem {
|
|
9564
10494
|
constructor(label, collapsibleState, itemType, deploymentData) {
|
|
9565
10495
|
super(label, collapsibleState);
|
|
9566
10496
|
this.label = label;
|
|
@@ -9574,23 +10504,23 @@ var DeploymentTreeItem = class extends vscode14.TreeItem {
|
|
|
9574
10504
|
switch (this.itemType) {
|
|
9575
10505
|
case "deployment":
|
|
9576
10506
|
if (this.deploymentData?.active) {
|
|
9577
|
-
this.iconPath = new
|
|
10507
|
+
this.iconPath = new vscode15.ThemeIcon(
|
|
9578
10508
|
"rocket",
|
|
9579
|
-
new
|
|
10509
|
+
new vscode15.ThemeColor("charts.green")
|
|
9580
10510
|
);
|
|
9581
10511
|
} else {
|
|
9582
|
-
this.iconPath = new
|
|
10512
|
+
this.iconPath = new vscode15.ThemeIcon("history");
|
|
9583
10513
|
}
|
|
9584
10514
|
break;
|
|
9585
10515
|
case "info":
|
|
9586
10516
|
case "message":
|
|
9587
|
-
this.iconPath = new
|
|
10517
|
+
this.iconPath = new vscode15.ThemeIcon("info");
|
|
9588
10518
|
break;
|
|
9589
10519
|
}
|
|
9590
10520
|
}
|
|
9591
10521
|
};
|
|
9592
10522
|
var DeploymentTreeDataProvider = class {
|
|
9593
|
-
_onDidChangeTreeData = new
|
|
10523
|
+
_onDidChangeTreeData = new vscode15.EventEmitter();
|
|
9594
10524
|
onDidChangeTreeData = this._onDidChangeTreeData.event;
|
|
9595
10525
|
deployments = [];
|
|
9596
10526
|
loading = false;
|
|
@@ -9613,7 +10543,7 @@ var DeploymentTreeDataProvider = class {
|
|
|
9613
10543
|
return [
|
|
9614
10544
|
new DeploymentTreeItem(
|
|
9615
10545
|
"Checking auth...",
|
|
9616
|
-
|
|
10546
|
+
vscode15.TreeItemCollapsibleState.None,
|
|
9617
10547
|
"message"
|
|
9618
10548
|
)
|
|
9619
10549
|
];
|
|
@@ -9622,7 +10552,7 @@ var DeploymentTreeDataProvider = class {
|
|
|
9622
10552
|
return [
|
|
9623
10553
|
new DeploymentTreeItem(
|
|
9624
10554
|
"CLI not installed",
|
|
9625
|
-
|
|
10555
|
+
vscode15.TreeItemCollapsibleState.None,
|
|
9626
10556
|
"message"
|
|
9627
10557
|
)
|
|
9628
10558
|
];
|
|
@@ -9631,7 +10561,7 @@ var DeploymentTreeDataProvider = class {
|
|
|
9631
10561
|
return [
|
|
9632
10562
|
new DeploymentTreeItem(
|
|
9633
10563
|
"Not logged in",
|
|
9634
|
-
|
|
10564
|
+
vscode15.TreeItemCollapsibleState.None,
|
|
9635
10565
|
"message"
|
|
9636
10566
|
)
|
|
9637
10567
|
];
|
|
@@ -9640,21 +10570,21 @@ var DeploymentTreeDataProvider = class {
|
|
|
9640
10570
|
return [
|
|
9641
10571
|
new DeploymentTreeItem(
|
|
9642
10572
|
"No project detected",
|
|
9643
|
-
|
|
10573
|
+
vscode15.TreeItemCollapsibleState.None,
|
|
9644
10574
|
"message"
|
|
9645
10575
|
)
|
|
9646
10576
|
];
|
|
9647
10577
|
}
|
|
9648
10578
|
if (this.loading) {
|
|
9649
10579
|
return [
|
|
9650
|
-
new DeploymentTreeItem("Loading...",
|
|
10580
|
+
new DeploymentTreeItem("Loading...", vscode15.TreeItemCollapsibleState.None, "message")
|
|
9651
10581
|
];
|
|
9652
10582
|
}
|
|
9653
10583
|
if (this.error) {
|
|
9654
10584
|
return [
|
|
9655
10585
|
new DeploymentTreeItem(
|
|
9656
10586
|
`Error: ${this.error}`,
|
|
9657
|
-
|
|
10587
|
+
vscode15.TreeItemCollapsibleState.None,
|
|
9658
10588
|
"message"
|
|
9659
10589
|
)
|
|
9660
10590
|
];
|
|
@@ -9666,7 +10596,7 @@ var DeploymentTreeDataProvider = class {
|
|
|
9666
10596
|
return [
|
|
9667
10597
|
new DeploymentTreeItem(
|
|
9668
10598
|
"No deployments found",
|
|
9669
|
-
|
|
10599
|
+
vscode15.TreeItemCollapsibleState.None,
|
|
9670
10600
|
"message"
|
|
9671
10601
|
)
|
|
9672
10602
|
];
|
|
@@ -9675,7 +10605,7 @@ var DeploymentTreeDataProvider = class {
|
|
|
9675
10605
|
const label = dep.active ? `${dep.id} (active)` : dep.id;
|
|
9676
10606
|
const item = new DeploymentTreeItem(
|
|
9677
10607
|
label,
|
|
9678
|
-
|
|
10608
|
+
vscode15.TreeItemCollapsibleState.Collapsed,
|
|
9679
10609
|
"deployment",
|
|
9680
10610
|
dep
|
|
9681
10611
|
);
|
|
@@ -9689,14 +10619,14 @@ var DeploymentTreeDataProvider = class {
|
|
|
9689
10619
|
items.push(
|
|
9690
10620
|
new DeploymentTreeItem(
|
|
9691
10621
|
`State: ${dep.state || "unknown"}`,
|
|
9692
|
-
|
|
10622
|
+
vscode15.TreeItemCollapsibleState.None,
|
|
9693
10623
|
"info"
|
|
9694
10624
|
)
|
|
9695
10625
|
);
|
|
9696
10626
|
items.push(
|
|
9697
10627
|
new DeploymentTreeItem(
|
|
9698
10628
|
`Created: ${new Date(dep.createdAt).toLocaleString()}`,
|
|
9699
|
-
|
|
10629
|
+
vscode15.TreeItemCollapsibleState.None,
|
|
9700
10630
|
"info"
|
|
9701
10631
|
)
|
|
9702
10632
|
);
|
|
@@ -9704,7 +10634,7 @@ var DeploymentTreeDataProvider = class {
|
|
|
9704
10634
|
items.push(
|
|
9705
10635
|
new DeploymentTreeItem(
|
|
9706
10636
|
`Message: ${dep.message}`,
|
|
9707
|
-
|
|
10637
|
+
vscode15.TreeItemCollapsibleState.None,
|
|
9708
10638
|
"info"
|
|
9709
10639
|
)
|
|
9710
10640
|
);
|
|
@@ -9713,7 +10643,7 @@ var DeploymentTreeDataProvider = class {
|
|
|
9713
10643
|
items.push(
|
|
9714
10644
|
new DeploymentTreeItem(
|
|
9715
10645
|
`Tags: ${dep.tags.join(", ")}`,
|
|
9716
|
-
|
|
10646
|
+
vscode15.TreeItemCollapsibleState.None,
|
|
9717
10647
|
"info"
|
|
9718
10648
|
)
|
|
9719
10649
|
);
|
|
@@ -9768,7 +10698,7 @@ var DeploymentTreeDataProvider = class {
|
|
|
9768
10698
|
// src/features/deploymentExplorer/index.ts
|
|
9769
10699
|
function registerDeploymentExplorer(context) {
|
|
9770
10700
|
const provider = new DeploymentTreeDataProvider();
|
|
9771
|
-
const treeView =
|
|
10701
|
+
const treeView = vscode16.window.createTreeView("agentuity.deployments", {
|
|
9772
10702
|
treeDataProvider: provider,
|
|
9773
10703
|
showCollapseAll: true
|
|
9774
10704
|
});
|
|
@@ -9786,7 +10716,7 @@ function registerDeploymentExplorer(context) {
|
|
|
9786
10716
|
void provider.forceRefresh();
|
|
9787
10717
|
});
|
|
9788
10718
|
context.subscriptions.push(
|
|
9789
|
-
|
|
10719
|
+
vscode16.commands.registerCommand(
|
|
9790
10720
|
"agentuity.deployment.viewLogs",
|
|
9791
10721
|
async (item) => {
|
|
9792
10722
|
if (item?.deploymentData) {
|
|
@@ -9796,7 +10726,7 @@ function registerDeploymentExplorer(context) {
|
|
|
9796
10726
|
)
|
|
9797
10727
|
);
|
|
9798
10728
|
context.subscriptions.push(
|
|
9799
|
-
|
|
10729
|
+
vscode16.commands.registerCommand(
|
|
9800
10730
|
"agentuity.deployment.showDetails",
|
|
9801
10731
|
async (item) => {
|
|
9802
10732
|
if (item?.deploymentData) {
|
|
@@ -9815,14 +10745,14 @@ async function showDeploymentDetails(deploymentId) {
|
|
|
9815
10745
|
const content = JSON.stringify(result.data, null, 2);
|
|
9816
10746
|
await openReadonlyDocument(content, "json", `deployment-${deploymentId.substring(0, 8)}`);
|
|
9817
10747
|
} else {
|
|
9818
|
-
|
|
10748
|
+
vscode16.window.showErrorMessage(`Failed to get deployment details: ${result.error}`);
|
|
9819
10749
|
}
|
|
9820
10750
|
}
|
|
9821
10751
|
async function viewDeploymentLogs(deploymentId) {
|
|
9822
10752
|
const cli = getCliClient();
|
|
9823
|
-
await
|
|
10753
|
+
await vscode16.window.withProgress(
|
|
9824
10754
|
{
|
|
9825
|
-
location:
|
|
10755
|
+
location: vscode16.ProgressLocation.Notification,
|
|
9826
10756
|
title: "Fetching deployment logs...",
|
|
9827
10757
|
cancellable: false
|
|
9828
10758
|
},
|
|
@@ -9830,7 +10760,7 @@ async function viewDeploymentLogs(deploymentId) {
|
|
|
9830
10760
|
const result = await cli.getDeploymentLogs(deploymentId, 100);
|
|
9831
10761
|
if (result.success && result.data) {
|
|
9832
10762
|
if (result.data.length === 0) {
|
|
9833
|
-
|
|
10763
|
+
vscode16.window.showInformationMessage("No logs found for this deployment");
|
|
9834
10764
|
return;
|
|
9835
10765
|
}
|
|
9836
10766
|
const logContent = result.data.map((log2) => {
|
|
@@ -9843,21 +10773,21 @@ async function viewDeploymentLogs(deploymentId) {
|
|
|
9843
10773
|
`deployment-logs-${deploymentId.substring(0, 8)}`
|
|
9844
10774
|
);
|
|
9845
10775
|
} else {
|
|
9846
|
-
|
|
10776
|
+
vscode16.window.showErrorMessage(`Failed to fetch logs: ${result.error}`);
|
|
9847
10777
|
}
|
|
9848
10778
|
}
|
|
9849
10779
|
);
|
|
9850
10780
|
}
|
|
9851
10781
|
|
|
9852
10782
|
// src/features/sandboxExplorer/index.ts
|
|
9853
|
-
var
|
|
10783
|
+
var vscode19 = __toESM(require("vscode"));
|
|
9854
10784
|
var path13 = __toESM(require("path"));
|
|
9855
10785
|
var os3 = __toESM(require("os"));
|
|
9856
10786
|
var fs14 = __toESM(require("fs"));
|
|
9857
10787
|
|
|
9858
10788
|
// src/features/sandboxExplorer/sandboxTreeData.ts
|
|
9859
|
-
var
|
|
9860
|
-
var SandboxTreeItem = class extends
|
|
10789
|
+
var vscode17 = __toESM(require("vscode"));
|
|
10790
|
+
var SandboxTreeItem = class extends vscode17.TreeItem {
|
|
9861
10791
|
constructor(label, collapsibleState, itemType, sandboxData, fileData, snapshotData, executionData, parentSandboxId, categoryType, linkedData, filePath, region) {
|
|
9862
10792
|
super(label, collapsibleState);
|
|
9863
10793
|
this.label = label;
|
|
@@ -9899,7 +10829,7 @@ var SandboxTreeItem = class extends vscode16.TreeItem {
|
|
|
9899
10829
|
this.setupCreateItem();
|
|
9900
10830
|
break;
|
|
9901
10831
|
case "message":
|
|
9902
|
-
this.iconPath = new
|
|
10832
|
+
this.iconPath = new vscode17.ThemeIcon("info");
|
|
9903
10833
|
this.contextValue = "message";
|
|
9904
10834
|
break;
|
|
9905
10835
|
}
|
|
@@ -9908,7 +10838,7 @@ var SandboxTreeItem = class extends vscode16.TreeItem {
|
|
|
9908
10838
|
if (!this.sandboxData) return;
|
|
9909
10839
|
const status = this.sandboxData.status;
|
|
9910
10840
|
const isLinked = this.linkedData !== void 0;
|
|
9911
|
-
this.iconPath = new
|
|
10841
|
+
this.iconPath = new vscode17.ThemeIcon(this.getStatusIcon(status), this.getStatusColor(status));
|
|
9912
10842
|
let contextValue = `sandbox.${status}`;
|
|
9913
10843
|
if (isLinked) {
|
|
9914
10844
|
contextValue += ".linked";
|
|
@@ -9945,13 +10875,13 @@ var SandboxTreeItem = class extends vscode16.TreeItem {
|
|
|
9945
10875
|
getStatusColor(status) {
|
|
9946
10876
|
switch (status) {
|
|
9947
10877
|
case "idle":
|
|
9948
|
-
return new
|
|
10878
|
+
return new vscode17.ThemeColor("charts.blue");
|
|
9949
10879
|
case "running":
|
|
9950
|
-
return new
|
|
10880
|
+
return new vscode17.ThemeColor("charts.green");
|
|
9951
10881
|
case "failed":
|
|
9952
|
-
return new
|
|
10882
|
+
return new vscode17.ThemeColor("charts.red");
|
|
9953
10883
|
case "terminated":
|
|
9954
|
-
return new
|
|
10884
|
+
return new vscode17.ThemeColor("disabledForeground");
|
|
9955
10885
|
default:
|
|
9956
10886
|
return void 0;
|
|
9957
10887
|
}
|
|
@@ -9997,25 +10927,25 @@ var SandboxTreeItem = class extends vscode16.TreeItem {
|
|
|
9997
10927
|
setupCategoryItem() {
|
|
9998
10928
|
switch (this.categoryType) {
|
|
9999
10929
|
case "files":
|
|
10000
|
-
this.iconPath = new
|
|
10930
|
+
this.iconPath = new vscode17.ThemeIcon("folder");
|
|
10001
10931
|
this.contextValue = "sandboxCategory.files";
|
|
10002
10932
|
break;
|
|
10003
10933
|
case "snapshots":
|
|
10004
|
-
this.iconPath = new
|
|
10934
|
+
this.iconPath = new vscode17.ThemeIcon("device-camera");
|
|
10005
10935
|
this.contextValue = "sandboxCategory.snapshots";
|
|
10006
10936
|
break;
|
|
10007
10937
|
case "executions":
|
|
10008
|
-
this.iconPath = new
|
|
10938
|
+
this.iconPath = new vscode17.ThemeIcon("terminal");
|
|
10009
10939
|
this.contextValue = "sandboxCategory.executions";
|
|
10010
10940
|
break;
|
|
10011
10941
|
}
|
|
10012
10942
|
}
|
|
10013
10943
|
setupFileItem() {
|
|
10014
10944
|
if (this.itemType === "directory") {
|
|
10015
|
-
this.iconPath = new
|
|
10945
|
+
this.iconPath = new vscode17.ThemeIcon("folder");
|
|
10016
10946
|
this.contextValue = "sandboxFile.directory";
|
|
10017
10947
|
} else {
|
|
10018
|
-
this.iconPath = new
|
|
10948
|
+
this.iconPath = new vscode17.ThemeIcon("file");
|
|
10019
10949
|
this.contextValue = "sandboxFile";
|
|
10020
10950
|
this.command = {
|
|
10021
10951
|
command: "agentuity.sandbox.viewFile",
|
|
@@ -10038,7 +10968,7 @@ Modified: ${this.fileData.modTime}`;
|
|
|
10038
10968
|
}
|
|
10039
10969
|
setupSnapshotItem() {
|
|
10040
10970
|
if (!this.snapshotData) return;
|
|
10041
|
-
this.iconPath = new
|
|
10971
|
+
this.iconPath = this.snapshotData.public ? new vscode17.ThemeIcon("globe") : new vscode17.ThemeIcon("device-camera");
|
|
10042
10972
|
if (this.snapshotData.tag) {
|
|
10043
10973
|
this.contextValue = "snapshot.tagged";
|
|
10044
10974
|
this.description = `[${this.snapshotData.tag}] ${this.snapshotData.fileCount} files`;
|
|
@@ -10046,12 +10976,18 @@ Modified: ${this.fileData.modTime}`;
|
|
|
10046
10976
|
this.contextValue = "snapshot";
|
|
10047
10977
|
this.description = `${this.snapshotData.fileCount} files`;
|
|
10048
10978
|
}
|
|
10979
|
+
if (this.snapshotData.public) {
|
|
10980
|
+
this.description = `\u{1F310} ${this.description}`;
|
|
10981
|
+
}
|
|
10049
10982
|
this.tooltip = [
|
|
10983
|
+
this.snapshotData.fullName ? `Name: ${this.snapshotData.fullName}` : "",
|
|
10050
10984
|
`ID: ${this.snapshotData.snapshotId}`,
|
|
10051
10985
|
`Size: ${this.formatFileSize(this.snapshotData.sizeBytes)}`,
|
|
10052
10986
|
`Files: ${this.snapshotData.fileCount}`,
|
|
10053
10987
|
`Created: ${new Date(this.snapshotData.createdAt).toLocaleString()}`,
|
|
10054
10988
|
this.snapshotData.tag ? `Tag: ${this.snapshotData.tag}` : "",
|
|
10989
|
+
this.snapshotData.public ? "\u{1F310} Public snapshot" : "",
|
|
10990
|
+
this.snapshotData.orgSlug ? `Org: @${this.snapshotData.orgSlug}` : "",
|
|
10055
10991
|
"",
|
|
10056
10992
|
"Click to view snapshot details"
|
|
10057
10993
|
].filter(Boolean).join("\n");
|
|
@@ -10062,7 +10998,7 @@ Modified: ${this.fileData.modTime}`;
|
|
|
10062
10998
|
};
|
|
10063
10999
|
}
|
|
10064
11000
|
setupSnapshotFileItem() {
|
|
10065
|
-
this.iconPath = new
|
|
11001
|
+
this.iconPath = new vscode17.ThemeIcon("file");
|
|
10066
11002
|
this.contextValue = "snapshotFile";
|
|
10067
11003
|
if (this.fileData) {
|
|
10068
11004
|
this.description = this.formatFileSize(this.fileData.size);
|
|
@@ -10082,7 +11018,7 @@ Click to view file (readonly)`;
|
|
|
10082
11018
|
const status = this.executionData.status;
|
|
10083
11019
|
const icon = this.getExecutionIcon(status);
|
|
10084
11020
|
const color = this.getExecutionColor(status);
|
|
10085
|
-
this.iconPath = new
|
|
11021
|
+
this.iconPath = new vscode17.ThemeIcon(icon, color);
|
|
10086
11022
|
this.contextValue = status === "running" ? "execution.running" : "execution";
|
|
10087
11023
|
const parts = [];
|
|
10088
11024
|
if (this.executionData.exitCode !== void 0) {
|
|
@@ -10127,18 +11063,18 @@ Click to view file (readonly)`;
|
|
|
10127
11063
|
getExecutionColor(status) {
|
|
10128
11064
|
switch (status) {
|
|
10129
11065
|
case "completed":
|
|
10130
|
-
return new
|
|
11066
|
+
return new vscode17.ThemeColor("charts.green");
|
|
10131
11067
|
case "failed":
|
|
10132
11068
|
case "timeout":
|
|
10133
|
-
return new
|
|
11069
|
+
return new vscode17.ThemeColor("charts.red");
|
|
10134
11070
|
case "cancelled":
|
|
10135
|
-
return new
|
|
11071
|
+
return new vscode17.ThemeColor("charts.orange");
|
|
10136
11072
|
default:
|
|
10137
11073
|
return void 0;
|
|
10138
11074
|
}
|
|
10139
11075
|
}
|
|
10140
11076
|
setupCreateItem() {
|
|
10141
|
-
this.iconPath = new
|
|
11077
|
+
this.iconPath = new vscode17.ThemeIcon("add");
|
|
10142
11078
|
this.contextValue = "createSandbox";
|
|
10143
11079
|
this.command = {
|
|
10144
11080
|
command: "agentuity.sandbox.create",
|
|
@@ -10147,7 +11083,7 @@ Click to view file (readonly)`;
|
|
|
10147
11083
|
}
|
|
10148
11084
|
};
|
|
10149
11085
|
var SandboxTreeDataProvider = class {
|
|
10150
|
-
_onDidChangeTreeData = new
|
|
11086
|
+
_onDidChangeTreeData = new vscode17.EventEmitter();
|
|
10151
11087
|
onDidChangeTreeData = this._onDidChangeTreeData.event;
|
|
10152
11088
|
sandboxes = [];
|
|
10153
11089
|
loading = false;
|
|
@@ -10195,7 +11131,7 @@ var SandboxTreeDataProvider = class {
|
|
|
10195
11131
|
return [
|
|
10196
11132
|
new SandboxTreeItem(
|
|
10197
11133
|
"Checking auth...",
|
|
10198
|
-
|
|
11134
|
+
vscode17.TreeItemCollapsibleState.None,
|
|
10199
11135
|
"message"
|
|
10200
11136
|
)
|
|
10201
11137
|
];
|
|
@@ -10204,26 +11140,26 @@ var SandboxTreeDataProvider = class {
|
|
|
10204
11140
|
return [
|
|
10205
11141
|
new SandboxTreeItem(
|
|
10206
11142
|
"CLI not installed",
|
|
10207
|
-
|
|
11143
|
+
vscode17.TreeItemCollapsibleState.None,
|
|
10208
11144
|
"message"
|
|
10209
11145
|
)
|
|
10210
11146
|
];
|
|
10211
11147
|
}
|
|
10212
11148
|
if (authStatus.state === "unauthenticated") {
|
|
10213
11149
|
return [
|
|
10214
|
-
new SandboxTreeItem("Not logged in",
|
|
11150
|
+
new SandboxTreeItem("Not logged in", vscode17.TreeItemCollapsibleState.None, "message")
|
|
10215
11151
|
];
|
|
10216
11152
|
}
|
|
10217
11153
|
if (this.loading) {
|
|
10218
11154
|
return [
|
|
10219
|
-
new SandboxTreeItem("Loading...",
|
|
11155
|
+
new SandboxTreeItem("Loading...", vscode17.TreeItemCollapsibleState.None, "message")
|
|
10220
11156
|
];
|
|
10221
11157
|
}
|
|
10222
11158
|
if (this.error) {
|
|
10223
11159
|
return [
|
|
10224
11160
|
new SandboxTreeItem(
|
|
10225
11161
|
`Error: ${this.error}`,
|
|
10226
|
-
|
|
11162
|
+
vscode17.TreeItemCollapsibleState.None,
|
|
10227
11163
|
"message"
|
|
10228
11164
|
)
|
|
10229
11165
|
];
|
|
@@ -10243,7 +11179,7 @@ var SandboxTreeDataProvider = class {
|
|
|
10243
11179
|
items.push(
|
|
10244
11180
|
new SandboxTreeItem(
|
|
10245
11181
|
displayName,
|
|
10246
|
-
|
|
11182
|
+
vscode17.TreeItemCollapsibleState.Collapsed,
|
|
10247
11183
|
"sandbox",
|
|
10248
11184
|
sandbox,
|
|
10249
11185
|
void 0,
|
|
@@ -10258,7 +11194,7 @@ var SandboxTreeDataProvider = class {
|
|
|
10258
11194
|
items.push(
|
|
10259
11195
|
new SandboxTreeItem(
|
|
10260
11196
|
"Create Sandbox",
|
|
10261
|
-
|
|
11197
|
+
vscode17.TreeItemCollapsibleState.None,
|
|
10262
11198
|
"createSandbox"
|
|
10263
11199
|
)
|
|
10264
11200
|
);
|
|
@@ -10266,7 +11202,7 @@ var SandboxTreeDataProvider = class {
|
|
|
10266
11202
|
return [
|
|
10267
11203
|
new SandboxTreeItem(
|
|
10268
11204
|
"No sandboxes found",
|
|
10269
|
-
|
|
11205
|
+
vscode17.TreeItemCollapsibleState.None,
|
|
10270
11206
|
"message"
|
|
10271
11207
|
),
|
|
10272
11208
|
items[0]
|
|
@@ -10278,7 +11214,7 @@ var SandboxTreeDataProvider = class {
|
|
|
10278
11214
|
return [
|
|
10279
11215
|
new SandboxTreeItem(
|
|
10280
11216
|
"Files",
|
|
10281
|
-
|
|
11217
|
+
vscode17.TreeItemCollapsibleState.Collapsed,
|
|
10282
11218
|
"category",
|
|
10283
11219
|
sandbox,
|
|
10284
11220
|
void 0,
|
|
@@ -10290,7 +11226,7 @@ var SandboxTreeDataProvider = class {
|
|
|
10290
11226
|
),
|
|
10291
11227
|
new SandboxTreeItem(
|
|
10292
11228
|
"Snapshots",
|
|
10293
|
-
|
|
11229
|
+
vscode17.TreeItemCollapsibleState.Collapsed,
|
|
10294
11230
|
"category",
|
|
10295
11231
|
sandbox,
|
|
10296
11232
|
void 0,
|
|
@@ -10302,7 +11238,7 @@ var SandboxTreeDataProvider = class {
|
|
|
10302
11238
|
),
|
|
10303
11239
|
new SandboxTreeItem(
|
|
10304
11240
|
"Executions",
|
|
10305
|
-
|
|
11241
|
+
vscode17.TreeItemCollapsibleState.Collapsed,
|
|
10306
11242
|
"category",
|
|
10307
11243
|
sandbox,
|
|
10308
11244
|
void 0,
|
|
@@ -10325,7 +11261,7 @@ var SandboxTreeDataProvider = class {
|
|
|
10325
11261
|
return [
|
|
10326
11262
|
new SandboxTreeItem(
|
|
10327
11263
|
`Error: ${result.error || "Failed to list files"}`,
|
|
10328
|
-
|
|
11264
|
+
vscode17.TreeItemCollapsibleState.None,
|
|
10329
11265
|
"message"
|
|
10330
11266
|
)
|
|
10331
11267
|
];
|
|
@@ -10345,7 +11281,7 @@ var SandboxTreeDataProvider = class {
|
|
|
10345
11281
|
}
|
|
10346
11282
|
});
|
|
10347
11283
|
if (directChildren.length === 0) {
|
|
10348
|
-
return [new SandboxTreeItem("(empty)",
|
|
11284
|
+
return [new SandboxTreeItem("(empty)", vscode17.TreeItemCollapsibleState.None, "message")];
|
|
10349
11285
|
}
|
|
10350
11286
|
const sorted = [...directChildren].sort((a, b) => {
|
|
10351
11287
|
if (a.isDir && !b.isDir) return -1;
|
|
@@ -10355,7 +11291,7 @@ var SandboxTreeDataProvider = class {
|
|
|
10355
11291
|
return sorted.map((file) => {
|
|
10356
11292
|
return new SandboxTreeItem(
|
|
10357
11293
|
file.name,
|
|
10358
|
-
file.isDir ?
|
|
11294
|
+
file.isDir ? vscode17.TreeItemCollapsibleState.Collapsed : vscode17.TreeItemCollapsibleState.None,
|
|
10359
11295
|
file.isDir ? "directory" : "file",
|
|
10360
11296
|
void 0,
|
|
10361
11297
|
file,
|
|
@@ -10381,7 +11317,7 @@ var SandboxTreeDataProvider = class {
|
|
|
10381
11317
|
return [
|
|
10382
11318
|
new SandboxTreeItem(
|
|
10383
11319
|
`Error: ${result.error || "Failed to list snapshots"}`,
|
|
10384
|
-
|
|
11320
|
+
vscode17.TreeItemCollapsibleState.None,
|
|
10385
11321
|
"message"
|
|
10386
11322
|
)
|
|
10387
11323
|
];
|
|
@@ -10390,14 +11326,14 @@ var SandboxTreeDataProvider = class {
|
|
|
10390
11326
|
const snapshots = this.snapshotsCache.get(sandboxId) || [];
|
|
10391
11327
|
if (snapshots.length === 0) {
|
|
10392
11328
|
return [
|
|
10393
|
-
new SandboxTreeItem("No snapshots",
|
|
11329
|
+
new SandboxTreeItem("No snapshots", vscode17.TreeItemCollapsibleState.None, "message")
|
|
10394
11330
|
];
|
|
10395
11331
|
}
|
|
10396
11332
|
return snapshots.map(
|
|
10397
11333
|
(snap) => new SandboxTreeItem(
|
|
10398
11334
|
snap.tag || snap.snapshotId.slice(0, 12),
|
|
10399
11335
|
// Make expandable to show files
|
|
10400
|
-
|
|
11336
|
+
vscode17.TreeItemCollapsibleState.Collapsed,
|
|
10401
11337
|
"snapshot",
|
|
10402
11338
|
void 0,
|
|
10403
11339
|
void 0,
|
|
@@ -10418,7 +11354,7 @@ var SandboxTreeDataProvider = class {
|
|
|
10418
11354
|
return [
|
|
10419
11355
|
new SandboxTreeItem(
|
|
10420
11356
|
`Error: ${result.error || "Failed to get snapshot"}`,
|
|
10421
|
-
|
|
11357
|
+
vscode17.TreeItemCollapsibleState.None,
|
|
10422
11358
|
"message"
|
|
10423
11359
|
)
|
|
10424
11360
|
];
|
|
@@ -10427,7 +11363,7 @@ var SandboxTreeDataProvider = class {
|
|
|
10427
11363
|
const files = snapshotData.files || [];
|
|
10428
11364
|
if (files.length === 0) {
|
|
10429
11365
|
return [
|
|
10430
|
-
new SandboxTreeItem("(no files)",
|
|
11366
|
+
new SandboxTreeItem("(no files)", vscode17.TreeItemCollapsibleState.None, "message")
|
|
10431
11367
|
];
|
|
10432
11368
|
}
|
|
10433
11369
|
const sorted = [...files].sort((a, b) => a.path.localeCompare(b.path));
|
|
@@ -10435,7 +11371,7 @@ var SandboxTreeDataProvider = class {
|
|
|
10435
11371
|
const fileName = file.path.split("/").pop() || file.path;
|
|
10436
11372
|
return new SandboxTreeItem(
|
|
10437
11373
|
fileName,
|
|
10438
|
-
|
|
11374
|
+
vscode17.TreeItemCollapsibleState.None,
|
|
10439
11375
|
"snapshotFile",
|
|
10440
11376
|
void 0,
|
|
10441
11377
|
{
|
|
@@ -10466,7 +11402,7 @@ var SandboxTreeDataProvider = class {
|
|
|
10466
11402
|
return [
|
|
10467
11403
|
new SandboxTreeItem(
|
|
10468
11404
|
`Error: ${result.error || "Failed to list executions"}`,
|
|
10469
|
-
|
|
11405
|
+
vscode17.TreeItemCollapsibleState.None,
|
|
10470
11406
|
"message"
|
|
10471
11407
|
)
|
|
10472
11408
|
];
|
|
@@ -10475,13 +11411,13 @@ var SandboxTreeDataProvider = class {
|
|
|
10475
11411
|
const executions = this.executionsCache.get(sandboxId) || [];
|
|
10476
11412
|
if (executions.length === 0) {
|
|
10477
11413
|
return [
|
|
10478
|
-
new SandboxTreeItem("No executions",
|
|
11414
|
+
new SandboxTreeItem("No executions", vscode17.TreeItemCollapsibleState.None, "message")
|
|
10479
11415
|
];
|
|
10480
11416
|
}
|
|
10481
11417
|
return executions.map(
|
|
10482
11418
|
(exec2) => new SandboxTreeItem(
|
|
10483
11419
|
exec2.executionId.slice(0, 12),
|
|
10484
|
-
|
|
11420
|
+
vscode17.TreeItemCollapsibleState.None,
|
|
10485
11421
|
"execution",
|
|
10486
11422
|
void 0,
|
|
10487
11423
|
void 0,
|
|
@@ -10542,19 +11478,19 @@ var SandboxTreeDataProvider = class {
|
|
|
10542
11478
|
};
|
|
10543
11479
|
|
|
10544
11480
|
// src/features/sandboxExplorer/statusBar.ts
|
|
10545
|
-
var
|
|
11481
|
+
var vscode18 = __toESM(require("vscode"));
|
|
10546
11482
|
var statusBarItem;
|
|
10547
11483
|
var syncStatusItem;
|
|
10548
11484
|
var hideTimeoutId;
|
|
10549
11485
|
function createSandboxStatusBar(context) {
|
|
10550
|
-
statusBarItem =
|
|
11486
|
+
statusBarItem = vscode18.window.createStatusBarItem(vscode18.StatusBarAlignment.Left, 50);
|
|
10551
11487
|
statusBarItem.command = "agentuity.sandbox.showQuickPick";
|
|
10552
11488
|
context.subscriptions.push(statusBarItem);
|
|
10553
|
-
syncStatusItem =
|
|
11489
|
+
syncStatusItem = vscode18.window.createStatusBarItem(vscode18.StatusBarAlignment.Left, 49);
|
|
10554
11490
|
syncStatusItem.hide();
|
|
10555
11491
|
context.subscriptions.push(syncStatusItem);
|
|
10556
11492
|
context.subscriptions.push(
|
|
10557
|
-
|
|
11493
|
+
vscode18.commands.registerCommand("agentuity.sandbox.showQuickPick", showSandboxQuickPick)
|
|
10558
11494
|
);
|
|
10559
11495
|
updateStatusBar();
|
|
10560
11496
|
}
|
|
@@ -10600,7 +11536,7 @@ function showSyncProgress(message) {
|
|
|
10600
11536
|
}
|
|
10601
11537
|
syncStatusItem.text = `$(sync~spin) ${message}`;
|
|
10602
11538
|
syncStatusItem.tooltip = message;
|
|
10603
|
-
syncStatusItem.backgroundColor = new
|
|
11539
|
+
syncStatusItem.backgroundColor = new vscode18.ThemeColor("statusBarItem.warningBackground");
|
|
10604
11540
|
syncStatusItem.show();
|
|
10605
11541
|
}
|
|
10606
11542
|
function hideSyncProgress() {
|
|
@@ -10628,7 +11564,7 @@ function showSyncError(error) {
|
|
|
10628
11564
|
}
|
|
10629
11565
|
syncStatusItem.text = "$(error) Sync failed";
|
|
10630
11566
|
syncStatusItem.tooltip = `Sync failed: ${error}`;
|
|
10631
|
-
syncStatusItem.backgroundColor = new
|
|
11567
|
+
syncStatusItem.backgroundColor = new vscode18.ThemeColor("statusBarItem.errorBackground");
|
|
10632
11568
|
syncStatusItem.show();
|
|
10633
11569
|
clearHideTimeout();
|
|
10634
11570
|
hideTimeoutId = setTimeout(() => {
|
|
@@ -10642,7 +11578,7 @@ async function showSandboxQuickPick() {
|
|
|
10642
11578
|
if (linked.length > 0) {
|
|
10643
11579
|
items.push({
|
|
10644
11580
|
label: "Linked Sandboxes",
|
|
10645
|
-
kind:
|
|
11581
|
+
kind: vscode18.QuickPickItemKind.Separator,
|
|
10646
11582
|
action: ""
|
|
10647
11583
|
});
|
|
10648
11584
|
for (const sandbox of linked) {
|
|
@@ -10658,7 +11594,7 @@ async function showSandboxQuickPick() {
|
|
|
10658
11594
|
}
|
|
10659
11595
|
items.push({
|
|
10660
11596
|
label: "Actions",
|
|
10661
|
-
kind:
|
|
11597
|
+
kind: vscode18.QuickPickItemKind.Separator,
|
|
10662
11598
|
action: ""
|
|
10663
11599
|
});
|
|
10664
11600
|
}
|
|
@@ -10689,7 +11625,7 @@ async function showSandboxQuickPick() {
|
|
|
10689
11625
|
action: "explorer"
|
|
10690
11626
|
});
|
|
10691
11627
|
}
|
|
10692
|
-
const selected = await
|
|
11628
|
+
const selected = await vscode18.window.showQuickPick(items, {
|
|
10693
11629
|
placeHolder: "Select a sandbox or action",
|
|
10694
11630
|
title: "Agentuity Sandboxes"
|
|
10695
11631
|
});
|
|
@@ -10703,10 +11639,10 @@ async function showSandboxQuickPick() {
|
|
|
10703
11639
|
}
|
|
10704
11640
|
break;
|
|
10705
11641
|
case "create":
|
|
10706
|
-
await
|
|
11642
|
+
await vscode18.commands.executeCommand("agentuity.sandbox.create");
|
|
10707
11643
|
break;
|
|
10708
11644
|
case "link":
|
|
10709
|
-
await
|
|
11645
|
+
await vscode18.commands.executeCommand("agentuity.sandbox.link");
|
|
10710
11646
|
break;
|
|
10711
11647
|
case "sync":
|
|
10712
11648
|
await promptAndSync();
|
|
@@ -10715,7 +11651,7 @@ async function showSandboxQuickPick() {
|
|
|
10715
11651
|
await promptAndExec();
|
|
10716
11652
|
break;
|
|
10717
11653
|
case "explorer":
|
|
10718
|
-
await
|
|
11654
|
+
await vscode18.commands.executeCommand("agentuity.sandboxes.focus");
|
|
10719
11655
|
break;
|
|
10720
11656
|
}
|
|
10721
11657
|
}
|
|
@@ -10754,7 +11690,7 @@ async function showSandboxActions(sandboxId) {
|
|
|
10754
11690
|
action: "unlink"
|
|
10755
11691
|
}
|
|
10756
11692
|
];
|
|
10757
|
-
const selected = await
|
|
11693
|
+
const selected = await vscode18.window.showQuickPick(items, {
|
|
10758
11694
|
placeHolder: `Actions for ${name2}`,
|
|
10759
11695
|
title: `Sandbox: ${name2}`
|
|
10760
11696
|
});
|
|
@@ -10763,19 +11699,19 @@ async function showSandboxActions(sandboxId) {
|
|
|
10763
11699
|
}
|
|
10764
11700
|
switch (selected.action) {
|
|
10765
11701
|
case "sync":
|
|
10766
|
-
await
|
|
11702
|
+
await vscode18.commands.executeCommand("agentuity.sandbox.sync", { sandboxId });
|
|
10767
11703
|
break;
|
|
10768
11704
|
case "exec":
|
|
10769
11705
|
await promptAndExecForSandbox(sandboxId);
|
|
10770
11706
|
break;
|
|
10771
11707
|
case "snapshot":
|
|
10772
|
-
await
|
|
11708
|
+
await vscode18.commands.executeCommand("agentuity.sandbox.snapshot.create", { sandboxId });
|
|
10773
11709
|
break;
|
|
10774
11710
|
case "browse":
|
|
10775
|
-
await
|
|
11711
|
+
await vscode18.commands.executeCommand("agentuity.sandboxes.focus");
|
|
10776
11712
|
break;
|
|
10777
11713
|
case "unlink":
|
|
10778
|
-
await
|
|
11714
|
+
await vscode18.commands.executeCommand("agentuity.sandbox.unlink", { sandboxId });
|
|
10779
11715
|
break;
|
|
10780
11716
|
}
|
|
10781
11717
|
}
|
|
@@ -10783,7 +11719,7 @@ async function promptAndSync() {
|
|
|
10783
11719
|
const manager = getSandboxManager();
|
|
10784
11720
|
const linked = manager.getLinkedSandboxes();
|
|
10785
11721
|
if (linked.length === 0) {
|
|
10786
|
-
|
|
11722
|
+
vscode18.window.showWarningMessage("No sandboxes linked. Link a sandbox first.");
|
|
10787
11723
|
return;
|
|
10788
11724
|
}
|
|
10789
11725
|
let sandboxId;
|
|
@@ -10795,7 +11731,7 @@ async function promptAndSync() {
|
|
|
10795
11731
|
description: s.sandboxId,
|
|
10796
11732
|
sandboxId: s.sandboxId
|
|
10797
11733
|
}));
|
|
10798
|
-
const selected = await
|
|
11734
|
+
const selected = await vscode18.window.showQuickPick(items, {
|
|
10799
11735
|
placeHolder: "Select sandbox to sync to"
|
|
10800
11736
|
});
|
|
10801
11737
|
if (!selected) {
|
|
@@ -10803,13 +11739,13 @@ async function promptAndSync() {
|
|
|
10803
11739
|
}
|
|
10804
11740
|
sandboxId = selected.sandboxId;
|
|
10805
11741
|
}
|
|
10806
|
-
await
|
|
11742
|
+
await vscode18.commands.executeCommand("agentuity.sandbox.sync", { sandboxId });
|
|
10807
11743
|
}
|
|
10808
11744
|
async function promptAndExec() {
|
|
10809
11745
|
const manager = getSandboxManager();
|
|
10810
11746
|
const linked = manager.getLinkedSandboxes();
|
|
10811
11747
|
if (linked.length === 0) {
|
|
10812
|
-
|
|
11748
|
+
vscode18.window.showWarningMessage("No sandboxes linked. Link a sandbox first.");
|
|
10813
11749
|
return;
|
|
10814
11750
|
}
|
|
10815
11751
|
let sandboxId;
|
|
@@ -10821,7 +11757,7 @@ async function promptAndExec() {
|
|
|
10821
11757
|
description: s.sandboxId,
|
|
10822
11758
|
sandboxId: s.sandboxId
|
|
10823
11759
|
}));
|
|
10824
|
-
const selected = await
|
|
11760
|
+
const selected = await vscode18.window.showQuickPick(items, {
|
|
10825
11761
|
placeHolder: "Select sandbox to execute in"
|
|
10826
11762
|
});
|
|
10827
11763
|
if (!selected) {
|
|
@@ -10832,14 +11768,14 @@ async function promptAndExec() {
|
|
|
10832
11768
|
await promptAndExecForSandbox(sandboxId);
|
|
10833
11769
|
}
|
|
10834
11770
|
async function promptAndExecForSandbox(sandboxId) {
|
|
10835
|
-
const command = await
|
|
11771
|
+
const command = await vscode18.window.showInputBox({
|
|
10836
11772
|
prompt: "Enter command to execute",
|
|
10837
11773
|
placeHolder: "npm test"
|
|
10838
11774
|
});
|
|
10839
11775
|
if (!command) {
|
|
10840
11776
|
return;
|
|
10841
11777
|
}
|
|
10842
|
-
await
|
|
11778
|
+
await vscode18.commands.executeCommand("agentuity.sandbox.exec", { sandboxId, command });
|
|
10843
11779
|
}
|
|
10844
11780
|
function clearHideTimeout() {
|
|
10845
11781
|
if (hideTimeoutId) {
|
|
@@ -10868,7 +11804,7 @@ var UPLOAD_DEBOUNCE_MS = 1e3;
|
|
|
10868
11804
|
function registerSandboxExplorer(context) {
|
|
10869
11805
|
initSandboxManager(context);
|
|
10870
11806
|
const provider = new SandboxTreeDataProvider();
|
|
10871
|
-
const treeView =
|
|
11807
|
+
const treeView = vscode19.window.createTreeView("agentuity.sandboxes", {
|
|
10872
11808
|
treeDataProvider: provider,
|
|
10873
11809
|
showCollapseAll: true
|
|
10874
11810
|
});
|
|
@@ -10882,7 +11818,7 @@ function registerSandboxExplorer(context) {
|
|
|
10882
11818
|
updateStatusBar();
|
|
10883
11819
|
});
|
|
10884
11820
|
registerCommands(context, provider);
|
|
10885
|
-
saveListener =
|
|
11821
|
+
saveListener = vscode19.workspace.onDidSaveTextDocument((doc) => {
|
|
10886
11822
|
const mapping = sandboxFileMap.get(doc.uri.fsPath);
|
|
10887
11823
|
if (mapping) {
|
|
10888
11824
|
const existingTimer = uploadDebounceTimers.get(doc.uri.fsPath);
|
|
@@ -10896,7 +11832,7 @@ function registerSandboxExplorer(context) {
|
|
|
10896
11832
|
uploadDebounceTimers.set(doc.uri.fsPath, timer);
|
|
10897
11833
|
}
|
|
10898
11834
|
});
|
|
10899
|
-
const closeListener =
|
|
11835
|
+
const closeListener = vscode19.workspace.onDidCloseTextDocument((doc) => {
|
|
10900
11836
|
sandboxFileMap.delete(doc.uri.fsPath);
|
|
10901
11837
|
const timer = uploadDebounceTimers.get(doc.uri.fsPath);
|
|
10902
11838
|
if (timer) {
|
|
@@ -10927,18 +11863,18 @@ function registerSandboxExplorer(context) {
|
|
|
10927
11863
|
}
|
|
10928
11864
|
function registerCommands(context, provider) {
|
|
10929
11865
|
context.subscriptions.push(
|
|
10930
|
-
|
|
11866
|
+
vscode19.commands.registerCommand("agentuity.sandbox.create", async () => {
|
|
10931
11867
|
await createSandbox(provider);
|
|
10932
11868
|
})
|
|
10933
11869
|
);
|
|
10934
11870
|
context.subscriptions.push(
|
|
10935
|
-
|
|
11871
|
+
vscode19.commands.registerCommand(
|
|
10936
11872
|
"agentuity.sandbox.createFromSnapshot",
|
|
10937
11873
|
async (item) => {
|
|
10938
11874
|
if (item?.snapshotData) {
|
|
10939
11875
|
await createSandboxFromSnapshot(item.snapshotData.snapshotId, provider);
|
|
10940
11876
|
} else {
|
|
10941
|
-
const snapshotId = await
|
|
11877
|
+
const snapshotId = await vscode19.window.showInputBox({
|
|
10942
11878
|
prompt: "Enter snapshot ID or tag",
|
|
10943
11879
|
placeHolder: "snp_xxx or tag-name"
|
|
10944
11880
|
});
|
|
@@ -10950,7 +11886,7 @@ function registerCommands(context, provider) {
|
|
|
10950
11886
|
)
|
|
10951
11887
|
);
|
|
10952
11888
|
context.subscriptions.push(
|
|
10953
|
-
|
|
11889
|
+
vscode19.commands.registerCommand(
|
|
10954
11890
|
"agentuity.sandbox.delete",
|
|
10955
11891
|
async (item) => {
|
|
10956
11892
|
if (!item?.sandboxData) return;
|
|
@@ -10959,13 +11895,13 @@ function registerCommands(context, provider) {
|
|
|
10959
11895
|
)
|
|
10960
11896
|
);
|
|
10961
11897
|
context.subscriptions.push(
|
|
10962
|
-
|
|
11898
|
+
vscode19.commands.registerCommand("agentuity.sandbox.link", async (item) => {
|
|
10963
11899
|
if (!item?.sandboxData) return;
|
|
10964
11900
|
await linkSandbox(item.sandboxData.sandboxId, provider);
|
|
10965
11901
|
})
|
|
10966
11902
|
);
|
|
10967
11903
|
context.subscriptions.push(
|
|
10968
|
-
|
|
11904
|
+
vscode19.commands.registerCommand(
|
|
10969
11905
|
"agentuity.sandbox.unlink",
|
|
10970
11906
|
async (item) => {
|
|
10971
11907
|
if (!item?.sandboxData) return;
|
|
@@ -10974,14 +11910,14 @@ function registerCommands(context, provider) {
|
|
|
10974
11910
|
)
|
|
10975
11911
|
);
|
|
10976
11912
|
context.subscriptions.push(
|
|
10977
|
-
|
|
11913
|
+
vscode19.commands.registerCommand("agentuity.sandbox.sync", async (item) => {
|
|
10978
11914
|
let sandboxId;
|
|
10979
11915
|
if (item?.sandboxData) {
|
|
10980
11916
|
sandboxId = item.sandboxData.sandboxId;
|
|
10981
11917
|
} else {
|
|
10982
11918
|
const linked = getSandboxManager().getLinkedSandboxes();
|
|
10983
11919
|
if (linked.length === 0) {
|
|
10984
|
-
|
|
11920
|
+
vscode19.window.showWarningMessage(
|
|
10985
11921
|
"No sandbox linked to this workspace. Link a sandbox first."
|
|
10986
11922
|
);
|
|
10987
11923
|
return;
|
|
@@ -10989,7 +11925,7 @@ function registerCommands(context, provider) {
|
|
|
10989
11925
|
if (linked.length === 1) {
|
|
10990
11926
|
sandboxId = linked[0].sandboxId;
|
|
10991
11927
|
} else {
|
|
10992
|
-
const picked = await
|
|
11928
|
+
const picked = await vscode19.window.showQuickPick(
|
|
10993
11929
|
linked.map((l) => ({
|
|
10994
11930
|
label: l.name || l.sandboxId,
|
|
10995
11931
|
description: l.sandboxId,
|
|
@@ -11008,7 +11944,7 @@ function registerCommands(context, provider) {
|
|
|
11008
11944
|
})
|
|
11009
11945
|
);
|
|
11010
11946
|
context.subscriptions.push(
|
|
11011
|
-
|
|
11947
|
+
vscode19.commands.registerCommand(
|
|
11012
11948
|
"agentuity.sandbox.exec",
|
|
11013
11949
|
async (itemOrOptions) => {
|
|
11014
11950
|
let sandboxId;
|
|
@@ -11025,7 +11961,7 @@ function registerCommands(context, provider) {
|
|
|
11025
11961
|
)
|
|
11026
11962
|
);
|
|
11027
11963
|
context.subscriptions.push(
|
|
11028
|
-
|
|
11964
|
+
vscode19.commands.registerCommand(
|
|
11029
11965
|
"agentuity.sandbox.viewFile",
|
|
11030
11966
|
async (item) => {
|
|
11031
11967
|
if (!item?.parentSandboxId || !item?.filePath) return;
|
|
@@ -11034,7 +11970,7 @@ function registerCommands(context, provider) {
|
|
|
11034
11970
|
)
|
|
11035
11971
|
);
|
|
11036
11972
|
context.subscriptions.push(
|
|
11037
|
-
|
|
11973
|
+
vscode19.commands.registerCommand(
|
|
11038
11974
|
"agentuity.sandbox.download",
|
|
11039
11975
|
async (item) => {
|
|
11040
11976
|
if (!item?.parentSandboxId || !item?.filePath) return;
|
|
@@ -11047,7 +11983,7 @@ function registerCommands(context, provider) {
|
|
|
11047
11983
|
)
|
|
11048
11984
|
);
|
|
11049
11985
|
context.subscriptions.push(
|
|
11050
|
-
|
|
11986
|
+
vscode19.commands.registerCommand(
|
|
11051
11987
|
"agentuity.sandbox.deleteFile",
|
|
11052
11988
|
async (item) => {
|
|
11053
11989
|
if (!item?.parentSandboxId || !item?.filePath) return;
|
|
@@ -11061,7 +11997,7 @@ function registerCommands(context, provider) {
|
|
|
11061
11997
|
)
|
|
11062
11998
|
);
|
|
11063
11999
|
context.subscriptions.push(
|
|
11064
|
-
|
|
12000
|
+
vscode19.commands.registerCommand(
|
|
11065
12001
|
"agentuity.sandbox.createFile",
|
|
11066
12002
|
async (item) => {
|
|
11067
12003
|
const sandboxId = item?.parentSandboxId || item?.sandboxData?.sandboxId;
|
|
@@ -11077,7 +12013,7 @@ function registerCommands(context, provider) {
|
|
|
11077
12013
|
)
|
|
11078
12014
|
);
|
|
11079
12015
|
context.subscriptions.push(
|
|
11080
|
-
|
|
12016
|
+
vscode19.commands.registerCommand(
|
|
11081
12017
|
"agentuity.sandbox.createFolder",
|
|
11082
12018
|
async (item) => {
|
|
11083
12019
|
const sandboxId = item?.parentSandboxId || item?.sandboxData?.sandboxId;
|
|
@@ -11093,17 +12029,17 @@ function registerCommands(context, provider) {
|
|
|
11093
12029
|
)
|
|
11094
12030
|
);
|
|
11095
12031
|
context.subscriptions.push(
|
|
11096
|
-
|
|
12032
|
+
vscode19.commands.registerCommand(
|
|
11097
12033
|
"agentuity.sandbox.copyPath",
|
|
11098
12034
|
async (item) => {
|
|
11099
12035
|
if (!item?.filePath) return;
|
|
11100
|
-
await
|
|
11101
|
-
|
|
12036
|
+
await vscode19.env.clipboard.writeText(item.filePath);
|
|
12037
|
+
vscode19.window.showInformationMessage(`Copied: ${item.filePath}`);
|
|
11102
12038
|
}
|
|
11103
12039
|
)
|
|
11104
12040
|
);
|
|
11105
12041
|
context.subscriptions.push(
|
|
11106
|
-
|
|
12042
|
+
vscode19.commands.registerCommand(
|
|
11107
12043
|
"agentuity.sandbox.viewExecution",
|
|
11108
12044
|
async (item) => {
|
|
11109
12045
|
if (!item?.executionData) return;
|
|
@@ -11112,7 +12048,7 @@ function registerCommands(context, provider) {
|
|
|
11112
12048
|
)
|
|
11113
12049
|
);
|
|
11114
12050
|
context.subscriptions.push(
|
|
11115
|
-
|
|
12051
|
+
vscode19.commands.registerCommand(
|
|
11116
12052
|
"agentuity.sandbox.setEnv",
|
|
11117
12053
|
async (item) => {
|
|
11118
12054
|
if (!item?.sandboxData) return;
|
|
@@ -11121,7 +12057,7 @@ function registerCommands(context, provider) {
|
|
|
11121
12057
|
)
|
|
11122
12058
|
);
|
|
11123
12059
|
context.subscriptions.push(
|
|
11124
|
-
|
|
12060
|
+
vscode19.commands.registerCommand(
|
|
11125
12061
|
"agentuity.sandbox.viewEnv",
|
|
11126
12062
|
async (item) => {
|
|
11127
12063
|
if (!item?.sandboxData) return;
|
|
@@ -11130,7 +12066,7 @@ function registerCommands(context, provider) {
|
|
|
11130
12066
|
)
|
|
11131
12067
|
);
|
|
11132
12068
|
context.subscriptions.push(
|
|
11133
|
-
|
|
12069
|
+
vscode19.commands.registerCommand(
|
|
11134
12070
|
"agentuity.sandbox.syncEnvFile",
|
|
11135
12071
|
async (item) => {
|
|
11136
12072
|
if (!item?.sandboxData) return;
|
|
@@ -11139,7 +12075,7 @@ function registerCommands(context, provider) {
|
|
|
11139
12075
|
)
|
|
11140
12076
|
);
|
|
11141
12077
|
context.subscriptions.push(
|
|
11142
|
-
|
|
12078
|
+
vscode19.commands.registerCommand(
|
|
11143
12079
|
"agentuity.sandbox.snapshot.create",
|
|
11144
12080
|
async (item) => {
|
|
11145
12081
|
if (!item?.sandboxData) return;
|
|
@@ -11148,7 +12084,7 @@ function registerCommands(context, provider) {
|
|
|
11148
12084
|
)
|
|
11149
12085
|
);
|
|
11150
12086
|
context.subscriptions.push(
|
|
11151
|
-
|
|
12087
|
+
vscode19.commands.registerCommand(
|
|
11152
12088
|
"agentuity.sandbox.snapshot.delete",
|
|
11153
12089
|
async (item) => {
|
|
11154
12090
|
if (!item?.snapshotData) return;
|
|
@@ -11157,7 +12093,7 @@ function registerCommands(context, provider) {
|
|
|
11157
12093
|
)
|
|
11158
12094
|
);
|
|
11159
12095
|
context.subscriptions.push(
|
|
11160
|
-
|
|
12096
|
+
vscode19.commands.registerCommand(
|
|
11161
12097
|
"agentuity.sandbox.snapshot.tag",
|
|
11162
12098
|
async (item) => {
|
|
11163
12099
|
if (!item?.snapshotData) return;
|
|
@@ -11166,7 +12102,7 @@ function registerCommands(context, provider) {
|
|
|
11166
12102
|
)
|
|
11167
12103
|
);
|
|
11168
12104
|
context.subscriptions.push(
|
|
11169
|
-
|
|
12105
|
+
vscode19.commands.registerCommand(
|
|
11170
12106
|
"agentuity.sandbox.snapshot.viewDetails",
|
|
11171
12107
|
async (item) => {
|
|
11172
12108
|
if (!item?.snapshotData) return;
|
|
@@ -11175,7 +12111,7 @@ function registerCommands(context, provider) {
|
|
|
11175
12111
|
)
|
|
11176
12112
|
);
|
|
11177
12113
|
context.subscriptions.push(
|
|
11178
|
-
|
|
12114
|
+
vscode19.commands.registerCommand(
|
|
11179
12115
|
"agentuity.sandbox.snapshot.viewFile",
|
|
11180
12116
|
async (item) => {
|
|
11181
12117
|
if (!item?.snapshotData || !item?.filePath) return;
|
|
@@ -11184,7 +12120,7 @@ function registerCommands(context, provider) {
|
|
|
11184
12120
|
)
|
|
11185
12121
|
);
|
|
11186
12122
|
context.subscriptions.push(
|
|
11187
|
-
|
|
12123
|
+
vscode19.commands.registerCommand("agentuity.sandbox.upload", async (uri) => {
|
|
11188
12124
|
if (!uri) return;
|
|
11189
12125
|
await uploadToSandbox(uri);
|
|
11190
12126
|
})
|
|
@@ -11192,16 +12128,16 @@ function registerCommands(context, provider) {
|
|
|
11192
12128
|
}
|
|
11193
12129
|
async function pickSandboxRuntime() {
|
|
11194
12130
|
const cli = getCliClient();
|
|
11195
|
-
const result = await
|
|
12131
|
+
const result = await vscode19.window.withProgress(
|
|
11196
12132
|
{
|
|
11197
|
-
location:
|
|
12133
|
+
location: vscode19.ProgressLocation.Notification,
|
|
11198
12134
|
title: "Loading runtimes...",
|
|
11199
12135
|
cancellable: false
|
|
11200
12136
|
},
|
|
11201
12137
|
async () => cli.sandboxRuntimeList({ limit: 50 })
|
|
11202
12138
|
);
|
|
11203
12139
|
if (!result.success || !result.data || !result.data.runtimes.length) {
|
|
11204
|
-
const choice = await
|
|
12140
|
+
const choice = await vscode19.window.showQuickPick(
|
|
11205
12141
|
[
|
|
11206
12142
|
{ label: "Use default runtime (base:latest)", runtime: void 0 },
|
|
11207
12143
|
{ label: "Cancel", runtime: "__cancel__" }
|
|
@@ -11220,18 +12156,18 @@ async function pickSandboxRuntime() {
|
|
|
11220
12156
|
runtime: rt.name,
|
|
11221
12157
|
runtimeId: rt.id
|
|
11222
12158
|
}));
|
|
11223
|
-
const picked = await
|
|
12159
|
+
const picked = await vscode19.window.showQuickPick(items, {
|
|
11224
12160
|
placeHolder: "Select a sandbox runtime"
|
|
11225
12161
|
});
|
|
11226
12162
|
if (!picked) return void 0;
|
|
11227
12163
|
return { runtime: picked.runtime, runtimeId: picked.runtimeId };
|
|
11228
12164
|
}
|
|
11229
12165
|
async function createSandbox(provider) {
|
|
11230
|
-
const config =
|
|
12166
|
+
const config = vscode19.workspace.getConfiguration("agentuity");
|
|
11231
12167
|
const defaultMemory = config.get("sandbox.defaultMemory", "512Mi");
|
|
11232
12168
|
const defaultCpu = config.get("sandbox.defaultCpu", "500m");
|
|
11233
12169
|
const defaultNetwork = config.get("sandbox.defaultNetwork", false);
|
|
11234
|
-
const mode = await
|
|
12170
|
+
const mode = await vscode19.window.showQuickPick(
|
|
11235
12171
|
[
|
|
11236
12172
|
{ label: "Quick Create", description: "bun:1 runtime with default settings" },
|
|
11237
12173
|
{ label: "Custom", description: "Configure runtime, resources and options" }
|
|
@@ -11241,13 +12177,13 @@ async function createSandbox(provider) {
|
|
|
11241
12177
|
if (!mode) return;
|
|
11242
12178
|
let options = {};
|
|
11243
12179
|
if (mode.label === "Custom") {
|
|
11244
|
-
const name2 = await
|
|
12180
|
+
const name2 = await vscode19.window.showInputBox({
|
|
11245
12181
|
prompt: "Sandbox name (optional)",
|
|
11246
12182
|
placeHolder: "e.g., my-feature-env"
|
|
11247
12183
|
});
|
|
11248
12184
|
if (name2 === void 0) return;
|
|
11249
12185
|
options.name = name2 || void 0;
|
|
11250
|
-
const description = await
|
|
12186
|
+
const description = await vscode19.window.showInputBox({
|
|
11251
12187
|
prompt: "Sandbox description (optional)",
|
|
11252
12188
|
placeHolder: "e.g., Sandbox for feature-xyz integration tests"
|
|
11253
12189
|
});
|
|
@@ -11257,21 +12193,21 @@ async function createSandbox(provider) {
|
|
|
11257
12193
|
if (runtimeSelection === void 0) return;
|
|
11258
12194
|
options.runtime = runtimeSelection.runtime;
|
|
11259
12195
|
options.runtimeId = runtimeSelection.runtimeId;
|
|
11260
|
-
const memory = await
|
|
12196
|
+
const memory = await vscode19.window.showInputBox({
|
|
11261
12197
|
prompt: "Memory limit",
|
|
11262
12198
|
value: defaultMemory,
|
|
11263
12199
|
placeHolder: "e.g., 512Mi, 1Gi, 2Gi"
|
|
11264
12200
|
});
|
|
11265
12201
|
if (memory === void 0) return;
|
|
11266
12202
|
options.memory = memory || void 0;
|
|
11267
|
-
const cpu = await
|
|
12203
|
+
const cpu = await vscode19.window.showInputBox({
|
|
11268
12204
|
prompt: "CPU limit (millicores)",
|
|
11269
12205
|
value: defaultCpu,
|
|
11270
12206
|
placeHolder: "e.g., 500m, 1000m"
|
|
11271
12207
|
});
|
|
11272
12208
|
if (cpu === void 0) return;
|
|
11273
12209
|
options.cpu = cpu || void 0;
|
|
11274
|
-
const network = await
|
|
12210
|
+
const network = await vscode19.window.showQuickPick(
|
|
11275
12211
|
[
|
|
11276
12212
|
{ label: "Disabled", description: "No outbound network access", value: false },
|
|
11277
12213
|
{ label: "Enabled", description: "Allow outbound network access", value: true }
|
|
@@ -11280,7 +12216,7 @@ async function createSandbox(provider) {
|
|
|
11280
12216
|
);
|
|
11281
12217
|
if (!network) return;
|
|
11282
12218
|
options.network = network.value;
|
|
11283
|
-
const deps = await
|
|
12219
|
+
const deps = await vscode19.window.showInputBox({
|
|
11284
12220
|
prompt: "APT packages to install (optional)",
|
|
11285
12221
|
placeHolder: "e.g., python3 nodejs git"
|
|
11286
12222
|
});
|
|
@@ -11295,9 +12231,9 @@ async function createSandbox(provider) {
|
|
|
11295
12231
|
network: defaultNetwork
|
|
11296
12232
|
};
|
|
11297
12233
|
}
|
|
11298
|
-
await
|
|
12234
|
+
await vscode19.window.withProgress(
|
|
11299
12235
|
{
|
|
11300
|
-
location:
|
|
12236
|
+
location: vscode19.ProgressLocation.Notification,
|
|
11301
12237
|
title: "Creating sandbox...",
|
|
11302
12238
|
cancellable: false
|
|
11303
12239
|
},
|
|
@@ -11308,32 +12244,32 @@ async function createSandbox(provider) {
|
|
|
11308
12244
|
const info = result.data;
|
|
11309
12245
|
const displayName = info.name || info.sandboxId.slice(0, 12);
|
|
11310
12246
|
const runtimeDisplay = info.runtime?.name ?? info.runtime?.id ?? "bun:1";
|
|
11311
|
-
|
|
12247
|
+
vscode19.window.showInformationMessage(
|
|
11312
12248
|
`Sandbox "${displayName}" created with runtime ${runtimeDisplay}`
|
|
11313
12249
|
);
|
|
11314
12250
|
await provider.forceRefresh();
|
|
11315
12251
|
} else {
|
|
11316
|
-
|
|
12252
|
+
vscode19.window.showErrorMessage(`Failed to create sandbox: ${result.error}`);
|
|
11317
12253
|
}
|
|
11318
12254
|
}
|
|
11319
12255
|
);
|
|
11320
12256
|
}
|
|
11321
12257
|
async function createSandboxFromSnapshot(snapshotId, provider) {
|
|
11322
|
-
const name2 = await
|
|
12258
|
+
const name2 = await vscode19.window.showInputBox({
|
|
11323
12259
|
prompt: "Sandbox name (optional)",
|
|
11324
12260
|
placeHolder: "e.g., my-feature-env"
|
|
11325
12261
|
});
|
|
11326
12262
|
if (name2 === void 0) return;
|
|
11327
|
-
const description = await
|
|
12263
|
+
const description = await vscode19.window.showInputBox({
|
|
11328
12264
|
prompt: "Sandbox description (optional)",
|
|
11329
12265
|
placeHolder: "e.g., Restored from snapshot for testing"
|
|
11330
12266
|
});
|
|
11331
12267
|
if (description === void 0) return;
|
|
11332
12268
|
const runtimeSelection = await pickSandboxRuntime();
|
|
11333
12269
|
if (runtimeSelection === void 0) return;
|
|
11334
|
-
await
|
|
12270
|
+
await vscode19.window.withProgress(
|
|
11335
12271
|
{
|
|
11336
|
-
location:
|
|
12272
|
+
location: vscode19.ProgressLocation.Notification,
|
|
11337
12273
|
title: "Creating sandbox from snapshot...",
|
|
11338
12274
|
cancellable: false
|
|
11339
12275
|
},
|
|
@@ -11350,26 +12286,26 @@ async function createSandboxFromSnapshot(snapshotId, provider) {
|
|
|
11350
12286
|
const info = result.data;
|
|
11351
12287
|
const displayName = info.name || info.sandboxId.slice(0, 12);
|
|
11352
12288
|
const runtimeDisplay = info.runtime?.name ?? info.runtime?.id ?? "bun:1";
|
|
11353
|
-
|
|
12289
|
+
vscode19.window.showInformationMessage(
|
|
11354
12290
|
`Sandbox "${displayName}" created from snapshot with runtime ${runtimeDisplay}`
|
|
11355
12291
|
);
|
|
11356
12292
|
await provider.forceRefresh();
|
|
11357
12293
|
} else {
|
|
11358
|
-
|
|
12294
|
+
vscode19.window.showErrorMessage(`Failed to create sandbox: ${result.error}`);
|
|
11359
12295
|
}
|
|
11360
12296
|
}
|
|
11361
12297
|
);
|
|
11362
12298
|
}
|
|
11363
12299
|
async function deleteSandbox(sandboxId, provider) {
|
|
11364
|
-
const confirm = await
|
|
12300
|
+
const confirm = await vscode19.window.showWarningMessage(
|
|
11365
12301
|
`Are you sure you want to delete sandbox ${sandboxId}?`,
|
|
11366
12302
|
{ modal: true },
|
|
11367
12303
|
"Delete"
|
|
11368
12304
|
);
|
|
11369
12305
|
if (confirm !== "Delete") return;
|
|
11370
|
-
await
|
|
12306
|
+
await vscode19.window.withProgress(
|
|
11371
12307
|
{
|
|
11372
|
-
location:
|
|
12308
|
+
location: vscode19.ProgressLocation.Notification,
|
|
11373
12309
|
title: "Deleting sandbox...",
|
|
11374
12310
|
cancellable: false
|
|
11375
12311
|
},
|
|
@@ -11381,20 +12317,20 @@ async function deleteSandbox(sandboxId, provider) {
|
|
|
11381
12317
|
await getSandboxManager().unlinkSandbox(sandboxId);
|
|
11382
12318
|
} catch {
|
|
11383
12319
|
}
|
|
11384
|
-
|
|
12320
|
+
vscode19.window.showInformationMessage("Sandbox deleted");
|
|
11385
12321
|
await provider.forceRefresh();
|
|
11386
12322
|
} else {
|
|
11387
|
-
|
|
12323
|
+
vscode19.window.showErrorMessage(`Failed to delete sandbox: ${result.error}`);
|
|
11388
12324
|
}
|
|
11389
12325
|
}
|
|
11390
12326
|
);
|
|
11391
12327
|
}
|
|
11392
12328
|
async function linkSandbox(sandboxId, provider) {
|
|
11393
|
-
const name2 = await
|
|
12329
|
+
const name2 = await vscode19.window.showInputBox({
|
|
11394
12330
|
prompt: "Enter a friendly name for this sandbox (optional)",
|
|
11395
12331
|
placeHolder: "my-dev-sandbox"
|
|
11396
12332
|
});
|
|
11397
|
-
const remotePath = await
|
|
12333
|
+
const remotePath = await vscode19.window.showInputBox({
|
|
11398
12334
|
prompt: "Remote path for synced files",
|
|
11399
12335
|
value: DEFAULT_SANDBOX_PATH,
|
|
11400
12336
|
placeHolder: DEFAULT_SANDBOX_PATH
|
|
@@ -11405,10 +12341,10 @@ async function linkSandbox(sandboxId, provider) {
|
|
|
11405
12341
|
name: name2 || void 0,
|
|
11406
12342
|
remotePath: remotePath || DEFAULT_SANDBOX_PATH
|
|
11407
12343
|
});
|
|
11408
|
-
|
|
12344
|
+
vscode19.window.showInformationMessage(`Sandbox linked to workspace`);
|
|
11409
12345
|
provider.refresh();
|
|
11410
12346
|
} catch (err) {
|
|
11411
|
-
|
|
12347
|
+
vscode19.window.showErrorMessage(
|
|
11412
12348
|
`Failed to link sandbox: ${err instanceof Error ? err.message : "Unknown error"}`
|
|
11413
12349
|
);
|
|
11414
12350
|
}
|
|
@@ -11416,19 +12352,19 @@ async function linkSandbox(sandboxId, provider) {
|
|
|
11416
12352
|
async function unlinkSandbox(sandboxId, provider) {
|
|
11417
12353
|
try {
|
|
11418
12354
|
await getSandboxManager().unlinkSandbox(sandboxId);
|
|
11419
|
-
|
|
12355
|
+
vscode19.window.showInformationMessage("Sandbox unlinked from workspace");
|
|
11420
12356
|
provider.refresh();
|
|
11421
12357
|
} catch (err) {
|
|
11422
|
-
|
|
12358
|
+
vscode19.window.showErrorMessage(
|
|
11423
12359
|
`Failed to unlink sandbox: ${err instanceof Error ? err.message : "Unknown error"}`
|
|
11424
12360
|
);
|
|
11425
12361
|
}
|
|
11426
12362
|
}
|
|
11427
12363
|
async function syncToSandbox(sandboxId, provider) {
|
|
11428
12364
|
showSyncProgress("Syncing to sandbox...");
|
|
11429
|
-
await
|
|
12365
|
+
await vscode19.window.withProgress(
|
|
11430
12366
|
{
|
|
11431
|
-
location:
|
|
12367
|
+
location: vscode19.ProgressLocation.Notification,
|
|
11432
12368
|
title: "Syncing files to sandbox...",
|
|
11433
12369
|
cancellable: false
|
|
11434
12370
|
},
|
|
@@ -11436,7 +12372,7 @@ async function syncToSandbox(sandboxId, provider) {
|
|
|
11436
12372
|
try {
|
|
11437
12373
|
const manager = getSandboxManager();
|
|
11438
12374
|
const result = await manager.syncToSandbox(sandboxId);
|
|
11439
|
-
|
|
12375
|
+
vscode19.window.showInformationMessage(
|
|
11440
12376
|
`Synced ${result.filesUploaded} files (${formatBytes(result.bytesTransferred)}) in ${(result.duration / 1e3).toFixed(1)}s`
|
|
11441
12377
|
);
|
|
11442
12378
|
showSyncSuccess(result.filesUploaded, result.bytesTransferred);
|
|
@@ -11445,14 +12381,14 @@ async function syncToSandbox(sandboxId, provider) {
|
|
|
11445
12381
|
updateStatusBar();
|
|
11446
12382
|
} catch (err) {
|
|
11447
12383
|
const errorMessage = err instanceof Error ? err.message : "Unknown error";
|
|
11448
|
-
|
|
12384
|
+
vscode19.window.showErrorMessage(`Failed to sync: ${errorMessage}`);
|
|
11449
12385
|
showSyncError(errorMessage);
|
|
11450
12386
|
}
|
|
11451
12387
|
}
|
|
11452
12388
|
);
|
|
11453
12389
|
}
|
|
11454
12390
|
async function execInSandbox(sandboxId, prefilledCommand) {
|
|
11455
|
-
const command = prefilledCommand ?? await
|
|
12391
|
+
const command = prefilledCommand ?? await vscode19.window.showInputBox({
|
|
11456
12392
|
prompt: "Enter command to execute",
|
|
11457
12393
|
placeHolder: "npm test"
|
|
11458
12394
|
});
|
|
@@ -11464,9 +12400,9 @@ function executeInTerminal(sandboxId, command) {
|
|
|
11464
12400
|
const cliPath = cli.getCliPath();
|
|
11465
12401
|
let terminal = sandboxTerminals.get(sandboxId);
|
|
11466
12402
|
if (!terminal || terminal.exitStatus !== void 0) {
|
|
11467
|
-
terminal =
|
|
12403
|
+
terminal = vscode19.window.createTerminal({
|
|
11468
12404
|
name: `Sandbox: ${sandboxId.slice(0, 8)}`,
|
|
11469
|
-
iconPath: new
|
|
12405
|
+
iconPath: new vscode19.ThemeIcon("vm")
|
|
11470
12406
|
});
|
|
11471
12407
|
sandboxTerminals.set(sandboxId, terminal);
|
|
11472
12408
|
}
|
|
@@ -11480,9 +12416,9 @@ function disposeTerminals() {
|
|
|
11480
12416
|
sandboxTerminals.clear();
|
|
11481
12417
|
}
|
|
11482
12418
|
async function viewSandboxFile(sandboxId, filePath) {
|
|
11483
|
-
await
|
|
12419
|
+
await vscode19.window.withProgress(
|
|
11484
12420
|
{
|
|
11485
|
-
location:
|
|
12421
|
+
location: vscode19.ProgressLocation.Notification,
|
|
11486
12422
|
title: "Fetching file...",
|
|
11487
12423
|
cancellable: false
|
|
11488
12424
|
},
|
|
@@ -11499,10 +12435,10 @@ async function viewSandboxFile(sandboxId, filePath) {
|
|
|
11499
12435
|
sandboxId,
|
|
11500
12436
|
remotePath: fullRemotePath
|
|
11501
12437
|
});
|
|
11502
|
-
const doc = await
|
|
11503
|
-
await
|
|
12438
|
+
const doc = await vscode19.workspace.openTextDocument(localPath);
|
|
12439
|
+
await vscode19.window.showTextDocument(doc, { preview: false });
|
|
11504
12440
|
} else {
|
|
11505
|
-
|
|
12441
|
+
vscode19.window.showErrorMessage(`Failed to fetch file: ${result.error}`);
|
|
11506
12442
|
}
|
|
11507
12443
|
}
|
|
11508
12444
|
);
|
|
@@ -11511,15 +12447,15 @@ async function uploadSavedFile(sandboxId, localPath, remotePath, provider) {
|
|
|
11511
12447
|
const cli = getCliClient();
|
|
11512
12448
|
const result = await cli.sandboxCpToSandbox(sandboxId, localPath, remotePath, false);
|
|
11513
12449
|
if (result.success) {
|
|
11514
|
-
|
|
12450
|
+
vscode19.window.showInformationMessage(`Saved to sandbox: ${path13.basename(remotePath)}`);
|
|
11515
12451
|
provider.clearSandboxCache(sandboxId);
|
|
11516
12452
|
provider.refresh();
|
|
11517
12453
|
} else {
|
|
11518
|
-
|
|
12454
|
+
vscode19.window.showErrorMessage(`Failed to save to sandbox: ${result.error}`);
|
|
11519
12455
|
}
|
|
11520
12456
|
}
|
|
11521
12457
|
async function createSandboxFile(sandboxId, parentDir, _provider) {
|
|
11522
|
-
const fileName = await
|
|
12458
|
+
const fileName = await vscode19.window.showInputBox({
|
|
11523
12459
|
prompt: "Enter new file name",
|
|
11524
12460
|
placeHolder: "newfile.ts",
|
|
11525
12461
|
validateInput: (value) => {
|
|
@@ -11542,12 +12478,12 @@ async function createSandboxFile(sandboxId, parentDir, _provider) {
|
|
|
11542
12478
|
sandboxId,
|
|
11543
12479
|
remotePath
|
|
11544
12480
|
});
|
|
11545
|
-
const doc = await
|
|
11546
|
-
await
|
|
11547
|
-
|
|
12481
|
+
const doc = await vscode19.workspace.openTextDocument(localPath);
|
|
12482
|
+
await vscode19.window.showTextDocument(doc, { preview: false });
|
|
12483
|
+
vscode19.window.showInformationMessage(`New file will be created at ${remotePath} when you save`);
|
|
11548
12484
|
}
|
|
11549
12485
|
async function createSandboxFolder(sandboxId, parentDir, provider) {
|
|
11550
|
-
const folderName = await
|
|
12486
|
+
const folderName = await vscode19.window.showInputBox({
|
|
11551
12487
|
prompt: "Enter new folder name",
|
|
11552
12488
|
placeHolder: "newfolder",
|
|
11553
12489
|
validateInput: (value) => {
|
|
@@ -11565,24 +12501,24 @@ async function createSandboxFolder(sandboxId, parentDir, provider) {
|
|
|
11565
12501
|
const cli = getCliClient();
|
|
11566
12502
|
const result = await cli.sandboxMkdir(sandboxId, remotePath, true);
|
|
11567
12503
|
if (result.success) {
|
|
11568
|
-
|
|
12504
|
+
vscode19.window.showInformationMessage(`Created folder: ${folderName}`);
|
|
11569
12505
|
provider.clearSandboxCache(sandboxId);
|
|
11570
12506
|
provider.refresh();
|
|
11571
12507
|
} else {
|
|
11572
|
-
|
|
12508
|
+
vscode19.window.showErrorMessage(`Failed to create folder: ${result.error}`);
|
|
11573
12509
|
}
|
|
11574
12510
|
}
|
|
11575
12511
|
async function downloadFromSandbox(sandboxId, remotePath, isDirectory) {
|
|
11576
|
-
const defaultUri =
|
|
11577
|
-
const saveUri = await
|
|
11578
|
-
defaultUri: defaultUri ?
|
|
12512
|
+
const defaultUri = vscode19.workspace.workspaceFolders?.[0]?.uri;
|
|
12513
|
+
const saveUri = await vscode19.window.showSaveDialog({
|
|
12514
|
+
defaultUri: defaultUri ? vscode19.Uri.joinPath(defaultUri, path13.basename(remotePath)) : void 0,
|
|
11579
12515
|
saveLabel: "Download",
|
|
11580
12516
|
filters: isDirectory ? { Archives: ["tar.gz", "zip"] } : {}
|
|
11581
12517
|
});
|
|
11582
12518
|
if (!saveUri) return;
|
|
11583
|
-
await
|
|
12519
|
+
await vscode19.window.withProgress(
|
|
11584
12520
|
{
|
|
11585
|
-
location:
|
|
12521
|
+
location: vscode19.ProgressLocation.Notification,
|
|
11586
12522
|
title: "Downloading...",
|
|
11587
12523
|
cancellable: false
|
|
11588
12524
|
},
|
|
@@ -11595,15 +12531,15 @@ async function downloadFromSandbox(sandboxId, remotePath, isDirectory) {
|
|
|
11595
12531
|
isDirectory
|
|
11596
12532
|
);
|
|
11597
12533
|
if (result.success) {
|
|
11598
|
-
|
|
12534
|
+
vscode19.window.showInformationMessage(`Downloaded to ${saveUri.fsPath}`);
|
|
11599
12535
|
} else {
|
|
11600
|
-
|
|
12536
|
+
vscode19.window.showErrorMessage(`Failed to download: ${result.error}`);
|
|
11601
12537
|
}
|
|
11602
12538
|
}
|
|
11603
12539
|
);
|
|
11604
12540
|
}
|
|
11605
12541
|
async function deleteFile(sandboxId, filePath, isDirectory, provider) {
|
|
11606
|
-
const confirm = await
|
|
12542
|
+
const confirm = await vscode19.window.showWarningMessage(
|
|
11607
12543
|
`Delete ${isDirectory ? "directory" : "file"} ${filePath}?`,
|
|
11608
12544
|
{ modal: true },
|
|
11609
12545
|
"Delete"
|
|
@@ -11612,17 +12548,17 @@ async function deleteFile(sandboxId, filePath, isDirectory, provider) {
|
|
|
11612
12548
|
const cli = getCliClient();
|
|
11613
12549
|
const result = isDirectory ? await cli.sandboxRmdir(sandboxId, filePath, true) : await cli.sandboxRm(sandboxId, filePath);
|
|
11614
12550
|
if (result.success) {
|
|
11615
|
-
|
|
12551
|
+
vscode19.window.showInformationMessage(`Deleted ${filePath}`);
|
|
11616
12552
|
provider.clearSandboxCache(sandboxId);
|
|
11617
12553
|
provider.refresh();
|
|
11618
12554
|
} else {
|
|
11619
|
-
|
|
12555
|
+
vscode19.window.showErrorMessage(`Failed to delete: ${result.error}`);
|
|
11620
12556
|
}
|
|
11621
12557
|
}
|
|
11622
12558
|
async function viewExecution(executionId) {
|
|
11623
|
-
await
|
|
12559
|
+
await vscode19.window.withProgress(
|
|
11624
12560
|
{
|
|
11625
|
-
location:
|
|
12561
|
+
location: vscode19.ProgressLocation.Notification,
|
|
11626
12562
|
title: "Fetching execution details...",
|
|
11627
12563
|
cancellable: false
|
|
11628
12564
|
},
|
|
@@ -11672,7 +12608,7 @@ async function viewExecution(executionId) {
|
|
|
11672
12608
|
`execution-${executionId.slice(0, 8)}`
|
|
11673
12609
|
);
|
|
11674
12610
|
} else {
|
|
11675
|
-
|
|
12611
|
+
vscode19.window.showErrorMessage(`Failed to get execution: ${result.error}`);
|
|
11676
12612
|
}
|
|
11677
12613
|
}
|
|
11678
12614
|
);
|
|
@@ -11704,7 +12640,7 @@ async function fetchStreamContent(url) {
|
|
|
11704
12640
|
});
|
|
11705
12641
|
}
|
|
11706
12642
|
async function setEnvVar(sandboxId) {
|
|
11707
|
-
const input = await
|
|
12643
|
+
const input = await vscode19.window.showInputBox({
|
|
11708
12644
|
prompt: "Enter environment variable (KEY=value)",
|
|
11709
12645
|
placeHolder: "MY_VAR=my_value"
|
|
11710
12646
|
});
|
|
@@ -11712,21 +12648,21 @@ async function setEnvVar(sandboxId) {
|
|
|
11712
12648
|
const [key, ...valueParts] = input.split("=");
|
|
11713
12649
|
const value = valueParts.join("=");
|
|
11714
12650
|
if (!key || value === void 0) {
|
|
11715
|
-
|
|
12651
|
+
vscode19.window.showErrorMessage("Invalid format. Use KEY=value");
|
|
11716
12652
|
return;
|
|
11717
12653
|
}
|
|
11718
12654
|
const cli = getCliClient();
|
|
11719
12655
|
const result = await cli.sandboxEnvSet(sandboxId, { [key]: value });
|
|
11720
12656
|
if (result.success) {
|
|
11721
|
-
|
|
12657
|
+
vscode19.window.showInformationMessage(`Set ${key}=${value}`);
|
|
11722
12658
|
} else {
|
|
11723
|
-
|
|
12659
|
+
vscode19.window.showErrorMessage(`Failed to set env var: ${result.error}`);
|
|
11724
12660
|
}
|
|
11725
12661
|
}
|
|
11726
12662
|
async function viewEnv(sandboxId) {
|
|
11727
|
-
await
|
|
12663
|
+
await vscode19.window.withProgress(
|
|
11728
12664
|
{
|
|
11729
|
-
location:
|
|
12665
|
+
location: vscode19.ProgressLocation.Notification,
|
|
11730
12666
|
title: "Fetching environment variables...",
|
|
11731
12667
|
cancellable: false
|
|
11732
12668
|
},
|
|
@@ -11741,20 +12677,20 @@ async function viewEnv(sandboxId) {
|
|
|
11741
12677
|
`sandbox-env-${sandboxId.slice(0, 8)}`
|
|
11742
12678
|
);
|
|
11743
12679
|
} else {
|
|
11744
|
-
|
|
12680
|
+
vscode19.window.showErrorMessage(`Failed to get env: ${result.error}`);
|
|
11745
12681
|
}
|
|
11746
12682
|
}
|
|
11747
12683
|
);
|
|
11748
12684
|
}
|
|
11749
12685
|
async function syncEnvFile(sandboxId) {
|
|
11750
|
-
const workspaceFolder =
|
|
12686
|
+
const workspaceFolder = vscode19.workspace.workspaceFolders?.[0];
|
|
11751
12687
|
if (!workspaceFolder) {
|
|
11752
|
-
|
|
12688
|
+
vscode19.window.showWarningMessage("No workspace folder open");
|
|
11753
12689
|
return;
|
|
11754
12690
|
}
|
|
11755
12691
|
const envPath = path13.join(workspaceFolder.uri.fsPath, ".env");
|
|
11756
12692
|
try {
|
|
11757
|
-
const content = await
|
|
12693
|
+
const content = await vscode19.workspace.fs.readFile(vscode19.Uri.file(envPath));
|
|
11758
12694
|
const text = new TextDecoder().decode(content);
|
|
11759
12695
|
const vars = {};
|
|
11760
12696
|
for (const line of text.split("\n")) {
|
|
@@ -11766,30 +12702,30 @@ async function syncEnvFile(sandboxId) {
|
|
|
11766
12702
|
}
|
|
11767
12703
|
}
|
|
11768
12704
|
if (Object.keys(vars).length === 0) {
|
|
11769
|
-
|
|
12705
|
+
vscode19.window.showWarningMessage("No variables found in .env file");
|
|
11770
12706
|
return;
|
|
11771
12707
|
}
|
|
11772
12708
|
const cli = getCliClient();
|
|
11773
12709
|
const result = await cli.sandboxEnvSet(sandboxId, vars);
|
|
11774
12710
|
if (result.success) {
|
|
11775
|
-
|
|
12711
|
+
vscode19.window.showInformationMessage(
|
|
11776
12712
|
`Synced ${Object.keys(vars).length} environment variables`
|
|
11777
12713
|
);
|
|
11778
12714
|
} else {
|
|
11779
|
-
|
|
12715
|
+
vscode19.window.showErrorMessage(`Failed to sync env: ${result.error}`);
|
|
11780
12716
|
}
|
|
11781
12717
|
} catch {
|
|
11782
|
-
|
|
12718
|
+
vscode19.window.showWarningMessage("No .env file found in workspace root");
|
|
11783
12719
|
}
|
|
11784
12720
|
}
|
|
11785
12721
|
async function createSnapshot(sandboxId, provider) {
|
|
11786
|
-
const tag = await
|
|
12722
|
+
const tag = await vscode19.window.showInputBox({
|
|
11787
12723
|
prompt: "Enter a tag for this snapshot (optional)",
|
|
11788
12724
|
placeHolder: "v1.0 or latest"
|
|
11789
12725
|
});
|
|
11790
|
-
await
|
|
12726
|
+
await vscode19.window.withProgress(
|
|
11791
12727
|
{
|
|
11792
|
-
location:
|
|
12728
|
+
location: vscode19.ProgressLocation.Notification,
|
|
11793
12729
|
title: "Creating snapshot...",
|
|
11794
12730
|
cancellable: false
|
|
11795
12731
|
},
|
|
@@ -11797,19 +12733,19 @@ async function createSnapshot(sandboxId, provider) {
|
|
|
11797
12733
|
const cli = getCliClient();
|
|
11798
12734
|
const result = await cli.snapshotCreate(sandboxId, tag || void 0);
|
|
11799
12735
|
if (result.success && result.data) {
|
|
11800
|
-
|
|
12736
|
+
vscode19.window.showInformationMessage(
|
|
11801
12737
|
`Snapshot created: ${result.data.snapshotId}${tag ? ` [${tag}]` : ""}`
|
|
11802
12738
|
);
|
|
11803
12739
|
provider.clearSandboxCache(sandboxId);
|
|
11804
12740
|
provider.refresh();
|
|
11805
12741
|
} else {
|
|
11806
|
-
|
|
12742
|
+
vscode19.window.showErrorMessage(`Failed to create snapshot: ${result.error}`);
|
|
11807
12743
|
}
|
|
11808
12744
|
}
|
|
11809
12745
|
);
|
|
11810
12746
|
}
|
|
11811
12747
|
async function deleteSnapshot(snapshotId, provider) {
|
|
11812
|
-
const confirm = await
|
|
12748
|
+
const confirm = await vscode19.window.showWarningMessage(
|
|
11813
12749
|
`Are you sure you want to delete snapshot ${snapshotId}?`,
|
|
11814
12750
|
{ modal: true },
|
|
11815
12751
|
"Delete"
|
|
@@ -11818,14 +12754,14 @@ async function deleteSnapshot(snapshotId, provider) {
|
|
|
11818
12754
|
const cli = getCliClient();
|
|
11819
12755
|
const result = await cli.snapshotDelete(snapshotId);
|
|
11820
12756
|
if (result.success) {
|
|
11821
|
-
|
|
12757
|
+
vscode19.window.showInformationMessage("Snapshot deleted");
|
|
11822
12758
|
await provider.forceRefresh();
|
|
11823
12759
|
} else {
|
|
11824
|
-
|
|
12760
|
+
vscode19.window.showErrorMessage(`Failed to delete snapshot: ${result.error}`);
|
|
11825
12761
|
}
|
|
11826
12762
|
}
|
|
11827
12763
|
async function tagSnapshot(snapshotId, provider) {
|
|
11828
|
-
const tag = await
|
|
12764
|
+
const tag = await vscode19.window.showInputBox({
|
|
11829
12765
|
prompt: "Enter new tag (leave empty to remove tag)",
|
|
11830
12766
|
placeHolder: "v1.0 or latest"
|
|
11831
12767
|
});
|
|
@@ -11833,16 +12769,16 @@ async function tagSnapshot(snapshotId, provider) {
|
|
|
11833
12769
|
const cli = getCliClient();
|
|
11834
12770
|
const result = await cli.snapshotTag(snapshotId, tag || null);
|
|
11835
12771
|
if (result.success) {
|
|
11836
|
-
|
|
12772
|
+
vscode19.window.showInformationMessage(tag ? `Tagged as: ${tag}` : "Tag removed");
|
|
11837
12773
|
await provider.forceRefresh();
|
|
11838
12774
|
} else {
|
|
11839
|
-
|
|
12775
|
+
vscode19.window.showErrorMessage(`Failed to update tag: ${result.error}`);
|
|
11840
12776
|
}
|
|
11841
12777
|
}
|
|
11842
12778
|
async function viewSnapshotDetails(snapshotId) {
|
|
11843
|
-
await
|
|
12779
|
+
await vscode19.window.withProgress(
|
|
11844
12780
|
{
|
|
11845
|
-
location:
|
|
12781
|
+
location: vscode19.ProgressLocation.Notification,
|
|
11846
12782
|
title: "Fetching snapshot details...",
|
|
11847
12783
|
cancellable: false
|
|
11848
12784
|
},
|
|
@@ -11853,19 +12789,19 @@ async function viewSnapshotDetails(snapshotId) {
|
|
|
11853
12789
|
const content = JSON.stringify(result.data, null, 2);
|
|
11854
12790
|
await openReadonlyDocument(content, "json", `snapshot-${snapshotId.slice(0, 8)}`);
|
|
11855
12791
|
} else {
|
|
11856
|
-
|
|
12792
|
+
vscode19.window.showErrorMessage(`Failed to get snapshot: ${result.error}`);
|
|
11857
12793
|
}
|
|
11858
12794
|
}
|
|
11859
12795
|
);
|
|
11860
12796
|
}
|
|
11861
12797
|
async function viewSnapshotFile(snapshot, filePath) {
|
|
11862
12798
|
if (!snapshot.downloadUrl) {
|
|
11863
|
-
|
|
12799
|
+
vscode19.window.showErrorMessage("Snapshot does not have a download URL");
|
|
11864
12800
|
return;
|
|
11865
12801
|
}
|
|
11866
|
-
await
|
|
12802
|
+
await vscode19.window.withProgress(
|
|
11867
12803
|
{
|
|
11868
|
-
location:
|
|
12804
|
+
location: vscode19.ProgressLocation.Notification,
|
|
11869
12805
|
title: `Fetching ${path13.basename(filePath)}...`,
|
|
11870
12806
|
cancellable: false
|
|
11871
12807
|
},
|
|
@@ -11890,7 +12826,7 @@ async function viewSnapshotFile(snapshot, filePath) {
|
|
|
11890
12826
|
}
|
|
11891
12827
|
const targetFile = path13.join(extractDir, filePath);
|
|
11892
12828
|
if (!fs14.existsSync(targetFile)) {
|
|
11893
|
-
|
|
12829
|
+
vscode19.window.showErrorMessage(`File not found in snapshot: ${filePath}`);
|
|
11894
12830
|
return;
|
|
11895
12831
|
}
|
|
11896
12832
|
const content = fs14.readFileSync(targetFile, "utf-8");
|
|
@@ -11901,7 +12837,7 @@ async function viewSnapshotFile(snapshot, filePath) {
|
|
|
11901
12837
|
`snapshot-${snapshot.snapshotId.slice(0, 8)}-${path13.basename(filePath)}`
|
|
11902
12838
|
);
|
|
11903
12839
|
} catch (err) {
|
|
11904
|
-
|
|
12840
|
+
vscode19.window.showErrorMessage(
|
|
11905
12841
|
`Failed to view snapshot file: ${err instanceof Error ? err.message : "unknown error"}`
|
|
11906
12842
|
);
|
|
11907
12843
|
}
|
|
@@ -11961,20 +12897,20 @@ async function downloadFile(url, destPath) {
|
|
|
11961
12897
|
}
|
|
11962
12898
|
async function uploadToSandbox(uri) {
|
|
11963
12899
|
const cli = getCliClient();
|
|
11964
|
-
const listResult = await
|
|
12900
|
+
const listResult = await vscode19.window.withProgress(
|
|
11965
12901
|
{
|
|
11966
|
-
location:
|
|
12902
|
+
location: vscode19.ProgressLocation.Notification,
|
|
11967
12903
|
title: "Loading sandboxes...",
|
|
11968
12904
|
cancellable: false
|
|
11969
12905
|
},
|
|
11970
12906
|
async () => cli.sandboxList()
|
|
11971
12907
|
);
|
|
11972
12908
|
if (!listResult.success || !listResult.data || listResult.data.length === 0) {
|
|
11973
|
-
|
|
12909
|
+
vscode19.window.showWarningMessage("No sandboxes available. Create a sandbox first.");
|
|
11974
12910
|
return;
|
|
11975
12911
|
}
|
|
11976
12912
|
const sandboxes = listResult.data;
|
|
11977
|
-
const picked = await
|
|
12913
|
+
const picked = await vscode19.window.showQuickPick(
|
|
11978
12914
|
sandboxes.map((s) => ({
|
|
11979
12915
|
label: s.name || s.sandboxId.slice(0, 12),
|
|
11980
12916
|
description: `${s.status} \xB7 ${s.runtime?.name ?? s.runtime?.id ?? "base"}`,
|
|
@@ -11985,20 +12921,20 @@ async function uploadToSandbox(uri) {
|
|
|
11985
12921
|
);
|
|
11986
12922
|
if (!picked) return;
|
|
11987
12923
|
const selectedSandbox = picked.sandbox;
|
|
11988
|
-
const remotePath = await
|
|
12924
|
+
const remotePath = await vscode19.window.showInputBox({
|
|
11989
12925
|
prompt: "Remote path",
|
|
11990
12926
|
value: DEFAULT_SANDBOX_PATH
|
|
11991
12927
|
});
|
|
11992
12928
|
if (!remotePath) return;
|
|
11993
|
-
await
|
|
12929
|
+
await vscode19.window.withProgress(
|
|
11994
12930
|
{
|
|
11995
|
-
location:
|
|
12931
|
+
location: vscode19.ProgressLocation.Notification,
|
|
11996
12932
|
title: "Uploading...",
|
|
11997
12933
|
cancellable: false
|
|
11998
12934
|
},
|
|
11999
12935
|
async () => {
|
|
12000
|
-
const stats = await
|
|
12001
|
-
const isDir = stats.type ===
|
|
12936
|
+
const stats = await vscode19.workspace.fs.stat(uri);
|
|
12937
|
+
const isDir = stats.type === vscode19.FileType.Directory;
|
|
12002
12938
|
const fileName = path13.basename(uri.fsPath);
|
|
12003
12939
|
const fullRemotePath = remotePath.endsWith("/") ? `${remotePath}${fileName}` : `${remotePath}/${fileName}`;
|
|
12004
12940
|
const result = await cli.sandboxCpToSandbox(
|
|
@@ -12008,32 +12944,31 @@ async function uploadToSandbox(uri) {
|
|
|
12008
12944
|
isDir
|
|
12009
12945
|
);
|
|
12010
12946
|
if (result.success) {
|
|
12011
|
-
|
|
12947
|
+
vscode19.window.showInformationMessage(`Uploaded to ${remotePath}`);
|
|
12012
12948
|
} else {
|
|
12013
|
-
|
|
12949
|
+
vscode19.window.showErrorMessage(`Failed to upload: ${result.error}`);
|
|
12014
12950
|
}
|
|
12015
12951
|
}
|
|
12016
12952
|
);
|
|
12017
12953
|
}
|
|
12018
12954
|
|
|
12019
12955
|
// src/features/workbench/index.ts
|
|
12020
|
-
var
|
|
12021
|
-
var WORKBENCH_BASE_URL = "https://app-v1.agentuity.com";
|
|
12956
|
+
var vscode20 = __toESM(require("vscode"));
|
|
12022
12957
|
function registerWorkbenchCommands(context) {
|
|
12023
12958
|
context.subscriptions.push(
|
|
12024
|
-
|
|
12959
|
+
vscode20.commands.registerCommand("agentuity.workbench.open", async () => {
|
|
12025
12960
|
const project = getCurrentProject();
|
|
12026
|
-
let url =
|
|
12961
|
+
let url = getAppUrl();
|
|
12027
12962
|
if (project) {
|
|
12028
|
-
url =
|
|
12963
|
+
url = getWorkbenchUrl(project.projectId);
|
|
12029
12964
|
}
|
|
12030
|
-
await
|
|
12965
|
+
await vscode20.env.openExternal(vscode20.Uri.parse(url));
|
|
12031
12966
|
})
|
|
12032
12967
|
);
|
|
12033
12968
|
}
|
|
12034
12969
|
|
|
12035
12970
|
// src/features/chat/agentuityParticipant.ts
|
|
12036
|
-
var
|
|
12971
|
+
var vscode21 = __toESM(require("vscode"));
|
|
12037
12972
|
var CLI_REFERENCE_FALLBACK = `
|
|
12038
12973
|
# Agentuity CLI Quick Reference
|
|
12039
12974
|
|
|
@@ -12063,15 +12998,15 @@ var SLASH_COMMANDS = [
|
|
|
12063
12998
|
{ name: "logs", description: "View logs for a session" }
|
|
12064
12999
|
];
|
|
12065
13000
|
function registerChatParticipant(context) {
|
|
12066
|
-
if (!
|
|
13001
|
+
if (!vscode21.chat?.createChatParticipant) {
|
|
12067
13002
|
return;
|
|
12068
13003
|
}
|
|
12069
13004
|
try {
|
|
12070
|
-
const participant =
|
|
13005
|
+
const participant = vscode21.chat.createChatParticipant(
|
|
12071
13006
|
"agentuity.assistant",
|
|
12072
13007
|
handleChatRequest
|
|
12073
13008
|
);
|
|
12074
|
-
participant.iconPath =
|
|
13009
|
+
participant.iconPath = vscode21.Uri.joinPath(context.extensionUri, "resources", "icon.svg");
|
|
12075
13010
|
context.subscriptions.push(participant);
|
|
12076
13011
|
} catch {
|
|
12077
13012
|
}
|
|
@@ -12179,7 +13114,7 @@ async function handleNaturalLanguage(request, _context, stream, token) {
|
|
|
12179
13114
|
if (prompt.includes("log") && (prompt.includes("session") || prompt.includes("view") || prompt.includes("show"))) {
|
|
12180
13115
|
return handleLogs("", stream);
|
|
12181
13116
|
}
|
|
12182
|
-
const models = await
|
|
13117
|
+
const models = await vscode21.lm.selectChatModels({
|
|
12183
13118
|
vendor: "copilot",
|
|
12184
13119
|
family: "gpt-4o"
|
|
12185
13120
|
});
|
|
@@ -12220,8 +13155,8 @@ ${projectContext}
|
|
|
12220
13155
|
- For destructive operations (delete, deploy), always confirm with the user first
|
|
12221
13156
|
- Link to https://agentuity.dev for documentation`;
|
|
12222
13157
|
const messages = [
|
|
12223
|
-
|
|
12224
|
-
|
|
13158
|
+
vscode21.LanguageModelChatMessage.User(systemPrompt),
|
|
13159
|
+
vscode21.LanguageModelChatMessage.User(request.prompt)
|
|
12225
13160
|
];
|
|
12226
13161
|
try {
|
|
12227
13162
|
const response = await model.sendRequest(messages, {}, token);
|
|
@@ -12235,7 +13170,7 @@ ${projectContext}
|
|
|
12235
13170
|
if (token.isCancellationRequested) {
|
|
12236
13171
|
return { metadata: { command: "cancelled" } };
|
|
12237
13172
|
}
|
|
12238
|
-
if (err instanceof
|
|
13173
|
+
if (err instanceof vscode21.LanguageModelError) {
|
|
12239
13174
|
stream.markdown(`Error: ${err.message}
|
|
12240
13175
|
|
|
12241
13176
|
`);
|
|
@@ -12743,7 +13678,7 @@ async function handleFallback(_prompt, stream) {
|
|
|
12743
13678
|
}
|
|
12744
13679
|
|
|
12745
13680
|
// src/features/chat/cliTool.ts
|
|
12746
|
-
var
|
|
13681
|
+
var vscode22 = __toESM(require("vscode"));
|
|
12747
13682
|
var DESTRUCTIVE_PATTERNS = [
|
|
12748
13683
|
/^auth\s+logout/i,
|
|
12749
13684
|
/\bdelete\b/i,
|
|
@@ -12772,7 +13707,7 @@ var AgentuityCliTool = class {
|
|
|
12772
13707
|
throw new Error(`CLI command failed: ${result.error}`);
|
|
12773
13708
|
}
|
|
12774
13709
|
const output = typeof result.data === "string" ? result.data : JSON.stringify(result.data, null, 2);
|
|
12775
|
-
return new
|
|
13710
|
+
return new vscode22.LanguageModelToolResult([new vscode22.LanguageModelTextPart(output)]);
|
|
12776
13711
|
}
|
|
12777
13712
|
async prepareInvocation(options, _token) {
|
|
12778
13713
|
const { command } = options.input;
|
|
@@ -12782,7 +13717,7 @@ var AgentuityCliTool = class {
|
|
|
12782
13717
|
invocationMessage: `Run deployment command: \`agentuity ${command}\``,
|
|
12783
13718
|
confirmationMessages: {
|
|
12784
13719
|
title: "Deploy to Agentuity Cloud",
|
|
12785
|
-
message: new
|
|
13720
|
+
message: new vscode22.MarkdownString(
|
|
12786
13721
|
`This will deploy your project to Agentuity Cloud.
|
|
12787
13722
|
|
|
12788
13723
|
\`\`\`bash
|
|
@@ -12801,27 +13736,27 @@ Do you want to continue?`
|
|
|
12801
13736
|
}
|
|
12802
13737
|
};
|
|
12803
13738
|
function registerCliTool(context) {
|
|
12804
|
-
if (!
|
|
13739
|
+
if (!vscode22.lm?.registerTool) {
|
|
12805
13740
|
return;
|
|
12806
13741
|
}
|
|
12807
13742
|
try {
|
|
12808
13743
|
const tool = new AgentuityCliTool();
|
|
12809
|
-
const disposable =
|
|
13744
|
+
const disposable = vscode22.lm.registerTool("agentuity_run_cli", tool);
|
|
12810
13745
|
context.subscriptions.push(disposable);
|
|
12811
13746
|
} catch {
|
|
12812
13747
|
}
|
|
12813
13748
|
}
|
|
12814
13749
|
|
|
12815
13750
|
// src/features/chat/contextProvider.ts
|
|
12816
|
-
var
|
|
13751
|
+
var vscode23 = __toESM(require("vscode"));
|
|
12817
13752
|
var CONTEXT_PROVIDER_ID = "agentuity.context";
|
|
12818
13753
|
function registerChatContextProvider(context) {
|
|
12819
|
-
if (!
|
|
13754
|
+
if (!vscode23.chat?.registerChatContextProvider) {
|
|
12820
13755
|
return;
|
|
12821
13756
|
}
|
|
12822
13757
|
try {
|
|
12823
13758
|
const provider = new AgentuityContextProvider();
|
|
12824
|
-
const disposable =
|
|
13759
|
+
const disposable = vscode23.chat.registerChatContextProvider(
|
|
12825
13760
|
[
|
|
12826
13761
|
{ language: "typescript" },
|
|
12827
13762
|
{ language: "javascript" },
|
|
@@ -12836,7 +13771,7 @@ function registerChatContextProvider(context) {
|
|
|
12836
13771
|
}
|
|
12837
13772
|
}
|
|
12838
13773
|
var AgentuityContextProvider = class {
|
|
12839
|
-
_onDidChangeWorkspaceChatContext = new
|
|
13774
|
+
_onDidChangeWorkspaceChatContext = new vscode23.EventEmitter();
|
|
12840
13775
|
onDidChangeWorkspaceChatContext = this._onDidChangeWorkspaceChatContext.event;
|
|
12841
13776
|
_disposables = [];
|
|
12842
13777
|
constructor() {
|
|
@@ -12859,7 +13794,7 @@ var AgentuityContextProvider = class {
|
|
|
12859
13794
|
}
|
|
12860
13795
|
const items = [];
|
|
12861
13796
|
items.push({
|
|
12862
|
-
icon: new
|
|
13797
|
+
icon: new vscode23.ThemeIcon("rocket"),
|
|
12863
13798
|
label: "Agentuity Project",
|
|
12864
13799
|
modelDescription: "Summary of the Agentuity AI agent project including authentication, agents, deployments, and dev server status",
|
|
12865
13800
|
contextType: "workspace"
|
|
@@ -12872,25 +13807,25 @@ var AgentuityContextProvider = class {
|
|
|
12872
13807
|
}
|
|
12873
13808
|
const items = [];
|
|
12874
13809
|
items.push({
|
|
12875
|
-
icon: new
|
|
13810
|
+
icon: new vscode23.ThemeIcon("rocket"),
|
|
12876
13811
|
label: "Agentuity: Full Project Context",
|
|
12877
13812
|
modelDescription: "Complete Agentuity project context including all agents, deployments, data stores, and dev server status",
|
|
12878
13813
|
contextType: "workspace"
|
|
12879
13814
|
});
|
|
12880
13815
|
items.push({
|
|
12881
|
-
icon: new
|
|
13816
|
+
icon: new vscode23.ThemeIcon("hubot"),
|
|
12882
13817
|
label: "Agentuity: Agents",
|
|
12883
13818
|
modelDescription: "List of all agents in this Agentuity project with their configuration",
|
|
12884
13819
|
contextType: "agents"
|
|
12885
13820
|
});
|
|
12886
13821
|
items.push({
|
|
12887
|
-
icon: new
|
|
13822
|
+
icon: new vscode23.ThemeIcon("cloud-upload"),
|
|
12888
13823
|
label: "Agentuity: Deployments",
|
|
12889
13824
|
modelDescription: "Recent deployments and their status for this Agentuity project",
|
|
12890
13825
|
contextType: "deployments"
|
|
12891
13826
|
});
|
|
12892
13827
|
items.push({
|
|
12893
|
-
icon: new
|
|
13828
|
+
icon: new vscode23.ThemeIcon("server-process"),
|
|
12894
13829
|
label: "Agentuity: Dev Server",
|
|
12895
13830
|
modelDescription: "Current dev server status and configuration",
|
|
12896
13831
|
contextType: "devServer"
|
|
@@ -12901,7 +13836,7 @@ var AgentuityContextProvider = class {
|
|
|
12901
13836
|
if (agentsResult.success && agentsResult.data) {
|
|
12902
13837
|
for (const agent of agentsResult.data) {
|
|
12903
13838
|
items.push({
|
|
12904
|
-
icon: new
|
|
13839
|
+
icon: new vscode23.ThemeIcon("hubot"),
|
|
12905
13840
|
label: `Agentuity Agent: ${agent.name}`,
|
|
12906
13841
|
modelDescription: `Details for the "${agent.name}" agent including configuration, tools, and recent sessions`,
|
|
12907
13842
|
contextType: "agent-detail",
|
|
@@ -13110,7 +14045,7 @@ var AgentuityContextProvider = class {
|
|
|
13110
14045
|
};
|
|
13111
14046
|
|
|
13112
14047
|
// src/features/chat/agentTools.ts
|
|
13113
|
-
var
|
|
14048
|
+
var vscode24 = __toESM(require("vscode"));
|
|
13114
14049
|
var GetAgentsTool = class {
|
|
13115
14050
|
async invoke(_options, _token) {
|
|
13116
14051
|
if (!hasProject()) {
|
|
@@ -13123,8 +14058,8 @@ var GetAgentsTool = class {
|
|
|
13123
14058
|
}
|
|
13124
14059
|
const agents = result.data;
|
|
13125
14060
|
if (agents.length === 0) {
|
|
13126
|
-
return new
|
|
13127
|
-
new
|
|
14061
|
+
return new vscode24.LanguageModelToolResult([
|
|
14062
|
+
new vscode24.LanguageModelTextPart("No agents found in this project.")
|
|
13128
14063
|
]);
|
|
13129
14064
|
}
|
|
13130
14065
|
const output = agents.map((agent) => ({
|
|
@@ -13134,8 +14069,8 @@ var GetAgentsTool = class {
|
|
|
13134
14069
|
description: agent.description,
|
|
13135
14070
|
sourceFile: agent.metadata?.filename
|
|
13136
14071
|
}));
|
|
13137
|
-
return new
|
|
13138
|
-
new
|
|
14072
|
+
return new vscode24.LanguageModelToolResult([
|
|
14073
|
+
new vscode24.LanguageModelTextPart(JSON.stringify(output, null, 2))
|
|
13139
14074
|
]);
|
|
13140
14075
|
}
|
|
13141
14076
|
async prepareInvocation(_options, _token) {
|
|
@@ -13178,8 +14113,8 @@ var GetProjectStatusTool = class {
|
|
|
13178
14113
|
status.totalDeployments = deploymentsResult.data.length;
|
|
13179
14114
|
}
|
|
13180
14115
|
}
|
|
13181
|
-
return new
|
|
13182
|
-
new
|
|
14116
|
+
return new vscode24.LanguageModelToolResult([
|
|
14117
|
+
new vscode24.LanguageModelTextPart(JSON.stringify(status, null, 2))
|
|
13183
14118
|
]);
|
|
13184
14119
|
}
|
|
13185
14120
|
async prepareInvocation(_options, _token) {
|
|
@@ -13195,7 +14130,10 @@ var GetSessionsTool = class {
|
|
|
13195
14130
|
}
|
|
13196
14131
|
const cli = getCliClient();
|
|
13197
14132
|
const count = options.input.count || 10;
|
|
13198
|
-
const result = await cli.listSessions({
|
|
14133
|
+
const result = await cli.listSessions({
|
|
14134
|
+
count,
|
|
14135
|
+
agentIdentifier: options.input.agentName
|
|
14136
|
+
});
|
|
13199
14137
|
if (!result.success || !result.data) {
|
|
13200
14138
|
throw new Error(`Failed to list sessions: ${result.error || "Unknown error"}`);
|
|
13201
14139
|
}
|
|
@@ -13207,8 +14145,8 @@ var GetSessionsTool = class {
|
|
|
13207
14145
|
trigger: session.trigger,
|
|
13208
14146
|
env: session.env
|
|
13209
14147
|
}));
|
|
13210
|
-
return new
|
|
13211
|
-
new
|
|
14148
|
+
return new vscode24.LanguageModelToolResult([
|
|
14149
|
+
new vscode24.LanguageModelTextPart(JSON.stringify(sessions, null, 2))
|
|
13212
14150
|
]);
|
|
13213
14151
|
}
|
|
13214
14152
|
async prepareInvocation(options, _token) {
|
|
@@ -13237,8 +14175,8 @@ var GetSessionLogsTool = class {
|
|
|
13237
14175
|
severity: log2.severity,
|
|
13238
14176
|
message: log2.body
|
|
13239
14177
|
}));
|
|
13240
|
-
return new
|
|
13241
|
-
new
|
|
14178
|
+
return new vscode24.LanguageModelToolResult([
|
|
14179
|
+
new vscode24.LanguageModelTextPart(JSON.stringify(logs, null, 2))
|
|
13242
14180
|
]);
|
|
13243
14181
|
}
|
|
13244
14182
|
async prepareInvocation(options, _token) {
|
|
@@ -13257,32 +14195,32 @@ var ControlDevServerTool = class {
|
|
|
13257
14195
|
switch (action) {
|
|
13258
14196
|
case "start":
|
|
13259
14197
|
if (devServer.getState() === "running") {
|
|
13260
|
-
return new
|
|
13261
|
-
new
|
|
14198
|
+
return new vscode24.LanguageModelToolResult([
|
|
14199
|
+
new vscode24.LanguageModelTextPart("Dev server is already running.")
|
|
13262
14200
|
]);
|
|
13263
14201
|
}
|
|
13264
14202
|
await devServer.start();
|
|
13265
|
-
return new
|
|
13266
|
-
new
|
|
14203
|
+
return new vscode24.LanguageModelToolResult([
|
|
14204
|
+
new vscode24.LanguageModelTextPart("Dev server started successfully.")
|
|
13267
14205
|
]);
|
|
13268
14206
|
case "stop":
|
|
13269
14207
|
if (devServer.getState() === "stopped") {
|
|
13270
|
-
return new
|
|
13271
|
-
new
|
|
14208
|
+
return new vscode24.LanguageModelToolResult([
|
|
14209
|
+
new vscode24.LanguageModelTextPart("Dev server is not running.")
|
|
13272
14210
|
]);
|
|
13273
14211
|
}
|
|
13274
14212
|
await devServer.stop();
|
|
13275
|
-
return new
|
|
13276
|
-
new
|
|
14213
|
+
return new vscode24.LanguageModelToolResult([
|
|
14214
|
+
new vscode24.LanguageModelTextPart("Dev server stopped.")
|
|
13277
14215
|
]);
|
|
13278
14216
|
case "restart":
|
|
13279
14217
|
await devServer.restart();
|
|
13280
|
-
return new
|
|
13281
|
-
new
|
|
14218
|
+
return new vscode24.LanguageModelToolResult([
|
|
14219
|
+
new vscode24.LanguageModelTextPart("Dev server restarted.")
|
|
13282
14220
|
]);
|
|
13283
14221
|
case "status":
|
|
13284
|
-
return new
|
|
13285
|
-
new
|
|
14222
|
+
return new vscode24.LanguageModelToolResult([
|
|
14223
|
+
new vscode24.LanguageModelTextPart(
|
|
13286
14224
|
JSON.stringify({ state: devServer.getState() }, null, 2)
|
|
13287
14225
|
)
|
|
13288
14226
|
]);
|
|
@@ -13299,7 +14237,7 @@ var ControlDevServerTool = class {
|
|
|
13299
14237
|
invocationMessage: `${action === "start" ? "Starting" : "Restarting"} dev server...`,
|
|
13300
14238
|
confirmationMessages: {
|
|
13301
14239
|
title: `${action === "start" ? "Start" : "Restart"} Dev Server`,
|
|
13302
|
-
message: new
|
|
14240
|
+
message: new vscode24.MarkdownString(
|
|
13303
14241
|
`This will ${action} the Agentuity dev server for local testing.
|
|
13304
14242
|
|
|
13305
14243
|
Do you want to continue?`
|
|
@@ -13330,8 +14268,8 @@ var GetDeploymentsTool = class {
|
|
|
13330
14268
|
createdAt: dep.createdAt,
|
|
13331
14269
|
tags: dep.tags
|
|
13332
14270
|
}));
|
|
13333
|
-
return new
|
|
13334
|
-
new
|
|
14271
|
+
return new vscode24.LanguageModelToolResult([
|
|
14272
|
+
new vscode24.LanguageModelTextPart(JSON.stringify(deployments, null, 2))
|
|
13335
14273
|
]);
|
|
13336
14274
|
}
|
|
13337
14275
|
async prepareInvocation(_options, _token) {
|
|
@@ -13349,11 +14287,11 @@ var DeployProjectTool = class {
|
|
|
13349
14287
|
if (authStatus.state !== "authenticated") {
|
|
13350
14288
|
throw new Error('You must be logged in to deploy. Run "agentuity auth login" first.');
|
|
13351
14289
|
}
|
|
13352
|
-
const terminal =
|
|
14290
|
+
const terminal = vscode24.window.createTerminal("Agentuity Deploy");
|
|
13353
14291
|
terminal.sendText("agentuity cloud deploy");
|
|
13354
14292
|
terminal.show();
|
|
13355
|
-
return new
|
|
13356
|
-
new
|
|
14293
|
+
return new vscode24.LanguageModelToolResult([
|
|
14294
|
+
new vscode24.LanguageModelTextPart(
|
|
13357
14295
|
"Deployment started in terminal. Check the terminal output for progress."
|
|
13358
14296
|
)
|
|
13359
14297
|
]);
|
|
@@ -13363,7 +14301,7 @@ var DeployProjectTool = class {
|
|
|
13363
14301
|
invocationMessage: "Preparing deployment...",
|
|
13364
14302
|
confirmationMessages: {
|
|
13365
14303
|
title: "Deploy to Agentuity Cloud",
|
|
13366
|
-
message: new
|
|
14304
|
+
message: new vscode24.MarkdownString(
|
|
13367
14305
|
"This will deploy your Agentuity project to the cloud.\n\n**Warning**: This will make your agents publicly accessible.\n\nDo you want to continue?"
|
|
13368
14306
|
)
|
|
13369
14307
|
}
|
|
@@ -13428,8 +14366,8 @@ var GetHealthSummaryTool = class {
|
|
|
13428
14366
|
health.devServer = {
|
|
13429
14367
|
state: devServer.getState()
|
|
13430
14368
|
};
|
|
13431
|
-
return new
|
|
13432
|
-
new
|
|
14369
|
+
return new vscode24.LanguageModelToolResult([
|
|
14370
|
+
new vscode24.LanguageModelTextPart(JSON.stringify(health, null, 2))
|
|
13433
14371
|
]);
|
|
13434
14372
|
}
|
|
13435
14373
|
async prepareInvocation(_options, _token) {
|
|
@@ -13457,8 +14395,8 @@ var ListSandboxesTool = class {
|
|
|
13457
14395
|
resources: s.resources,
|
|
13458
14396
|
executions: s.executions
|
|
13459
14397
|
}));
|
|
13460
|
-
return new
|
|
13461
|
-
new
|
|
14398
|
+
return new vscode24.LanguageModelToolResult([
|
|
14399
|
+
new vscode24.LanguageModelTextPart(JSON.stringify(sandboxes, null, 2))
|
|
13462
14400
|
]);
|
|
13463
14401
|
}
|
|
13464
14402
|
async prepareInvocation(_options, _token) {
|
|
@@ -13482,8 +14420,8 @@ var ListSandboxRuntimesTool = class {
|
|
|
13482
14420
|
tags: rt.tags,
|
|
13483
14421
|
url: rt.url
|
|
13484
14422
|
}));
|
|
13485
|
-
return new
|
|
13486
|
-
new
|
|
14423
|
+
return new vscode24.LanguageModelToolResult([
|
|
14424
|
+
new vscode24.LanguageModelTextPart(JSON.stringify(output, null, 2))
|
|
13487
14425
|
]);
|
|
13488
14426
|
}
|
|
13489
14427
|
async prepareInvocation(_options, _token) {
|
|
@@ -13521,8 +14459,8 @@ var CreateSandboxTool = class {
|
|
|
13521
14459
|
`Status: ${info.status}`,
|
|
13522
14460
|
`Region: ${info.region}`
|
|
13523
14461
|
].filter(Boolean);
|
|
13524
|
-
return new
|
|
13525
|
-
new
|
|
14462
|
+
return new vscode24.LanguageModelToolResult([
|
|
14463
|
+
new vscode24.LanguageModelTextPart(lines.join("\n"))
|
|
13526
14464
|
]);
|
|
13527
14465
|
}
|
|
13528
14466
|
async prepareInvocation(_options, _token) {
|
|
@@ -13530,7 +14468,7 @@ var CreateSandboxTool = class {
|
|
|
13530
14468
|
invocationMessage: "Creating sandbox...",
|
|
13531
14469
|
confirmationMessages: {
|
|
13532
14470
|
title: "Create Sandbox",
|
|
13533
|
-
message: new
|
|
14471
|
+
message: new vscode24.MarkdownString(
|
|
13534
14472
|
"This will create a new sandbox environment in the cloud.\n\nDo you want to continue?"
|
|
13535
14473
|
)
|
|
13536
14474
|
}
|
|
@@ -13543,14 +14481,14 @@ var SyncToSandboxTool = class {
|
|
|
13543
14481
|
if (!sandboxId) {
|
|
13544
14482
|
throw new Error("Sandbox ID is required.");
|
|
13545
14483
|
}
|
|
13546
|
-
if (!
|
|
14484
|
+
if (!vscode24.workspace.workspaceFolders?.length) {
|
|
13547
14485
|
throw new Error("No workspace folder open to sync.");
|
|
13548
14486
|
}
|
|
13549
14487
|
try {
|
|
13550
14488
|
const manager = getSandboxManager();
|
|
13551
14489
|
const result = await manager.syncToSandbox(sandboxId);
|
|
13552
|
-
return new
|
|
13553
|
-
new
|
|
14490
|
+
return new vscode24.LanguageModelToolResult([
|
|
14491
|
+
new vscode24.LanguageModelTextPart(
|
|
13554
14492
|
`Synced ${result.filesUploaded} files (${formatBytes(result.bytesTransferred)}) in ${(result.duration / 1e3).toFixed(1)}s`
|
|
13555
14493
|
)
|
|
13556
14494
|
]);
|
|
@@ -13563,7 +14501,7 @@ var SyncToSandboxTool = class {
|
|
|
13563
14501
|
invocationMessage: `Syncing workspace to sandbox ${options.input.sandboxId?.substring(0, 8)}...`,
|
|
13564
14502
|
confirmationMessages: {
|
|
13565
14503
|
title: "Sync to Sandbox",
|
|
13566
|
-
message: new
|
|
14504
|
+
message: new vscode24.MarkdownString(
|
|
13567
14505
|
"This will upload your workspace files to the sandbox.\n\nDo you want to continue?"
|
|
13568
14506
|
)
|
|
13569
14507
|
}
|
|
@@ -13578,14 +14516,14 @@ var ExecuteInSandboxTool = class {
|
|
|
13578
14516
|
}
|
|
13579
14517
|
const cli = getCliClient();
|
|
13580
14518
|
const cliPath = cli.getCliPath();
|
|
13581
|
-
const terminal =
|
|
14519
|
+
const terminal = vscode24.window.createTerminal({
|
|
13582
14520
|
name: `Sandbox: ${sandboxId.slice(0, 8)}`,
|
|
13583
|
-
iconPath: new
|
|
14521
|
+
iconPath: new vscode24.ThemeIcon("vm")
|
|
13584
14522
|
});
|
|
13585
14523
|
terminal.show();
|
|
13586
14524
|
terminal.sendText(`${cliPath} cloud sandbox exec ${sandboxId} -- ${command}`);
|
|
13587
|
-
return new
|
|
13588
|
-
new
|
|
14525
|
+
return new vscode24.LanguageModelToolResult([
|
|
14526
|
+
new vscode24.LanguageModelTextPart(
|
|
13589
14527
|
`Executing "${command}" in sandbox ${sandboxId}. Check the terminal for output.`
|
|
13590
14528
|
)
|
|
13591
14529
|
]);
|
|
@@ -13595,7 +14533,7 @@ var ExecuteInSandboxTool = class {
|
|
|
13595
14533
|
invocationMessage: `Executing command in sandbox ${options.input.sandboxId?.substring(0, 8)}...`,
|
|
13596
14534
|
confirmationMessages: {
|
|
13597
14535
|
title: "Execute in Sandbox",
|
|
13598
|
-
message: new
|
|
14536
|
+
message: new vscode24.MarkdownString(
|
|
13599
14537
|
`This will execute the following command in the sandbox:
|
|
13600
14538
|
|
|
13601
14539
|
\`\`\`
|
|
@@ -13619,8 +14557,8 @@ var CreateSnapshotTool = class {
|
|
|
13619
14557
|
if (!result.success || !result.data) {
|
|
13620
14558
|
throw new Error(`Failed to create snapshot: ${result.error || "Unknown error"}`);
|
|
13621
14559
|
}
|
|
13622
|
-
return new
|
|
13623
|
-
new
|
|
14560
|
+
return new vscode24.LanguageModelToolResult([
|
|
14561
|
+
new vscode24.LanguageModelTextPart(
|
|
13624
14562
|
`Snapshot created!
|
|
13625
14563
|
|
|
13626
14564
|
ID: ${result.data.snapshotId}
|
|
@@ -13636,66 +14574,324 @@ Tag: ${tag}` : ""}`
|
|
|
13636
14574
|
};
|
|
13637
14575
|
}
|
|
13638
14576
|
};
|
|
14577
|
+
var DeleteSandboxTool = class {
|
|
14578
|
+
async invoke(options, _token) {
|
|
14579
|
+
const { sandboxId } = options.input;
|
|
14580
|
+
if (!sandboxId) {
|
|
14581
|
+
throw new Error("Sandbox ID is required.");
|
|
14582
|
+
}
|
|
14583
|
+
const cli = getCliClient();
|
|
14584
|
+
const result = await cli.sandboxDelete(sandboxId);
|
|
14585
|
+
if (!result.success) {
|
|
14586
|
+
throw new Error(`Failed to delete sandbox: ${result.error || "Unknown error"}`);
|
|
14587
|
+
}
|
|
14588
|
+
return new vscode24.LanguageModelToolResult([
|
|
14589
|
+
new vscode24.LanguageModelTextPart(`Sandbox ${sandboxId} deleted successfully.`)
|
|
14590
|
+
]);
|
|
14591
|
+
}
|
|
14592
|
+
async prepareInvocation(options, _token) {
|
|
14593
|
+
return {
|
|
14594
|
+
invocationMessage: `Deleting sandbox ${options.input.sandboxId?.substring(0, 8)}...`,
|
|
14595
|
+
confirmationMessages: {
|
|
14596
|
+
title: "Delete Sandbox",
|
|
14597
|
+
message: new vscode24.MarkdownString(
|
|
14598
|
+
`Are you sure you want to delete sandbox **${options.input.sandboxId}**?
|
|
14599
|
+
|
|
14600
|
+
This action cannot be undone.`
|
|
14601
|
+
)
|
|
14602
|
+
}
|
|
14603
|
+
};
|
|
14604
|
+
}
|
|
14605
|
+
};
|
|
14606
|
+
var ListQueuesTool = class {
|
|
14607
|
+
async invoke(options, _token) {
|
|
14608
|
+
if (!hasProject()) {
|
|
14609
|
+
throw new Error("No Agentuity project found in the current workspace.");
|
|
14610
|
+
}
|
|
14611
|
+
const cli = getCliClient();
|
|
14612
|
+
const result = await cli.listQueues({ limit: options.input.limit });
|
|
14613
|
+
if (!result.success || !result.data) {
|
|
14614
|
+
throw new Error(`Failed to list queues: ${result.error || "Unknown error"}`);
|
|
14615
|
+
}
|
|
14616
|
+
const queues = result.data.queues;
|
|
14617
|
+
if (queues.length === 0) {
|
|
14618
|
+
return new vscode24.LanguageModelToolResult([
|
|
14619
|
+
new vscode24.LanguageModelTextPart("No queues found.")
|
|
14620
|
+
]);
|
|
14621
|
+
}
|
|
14622
|
+
const output = queues.map((q) => ({
|
|
14623
|
+
name: q.name,
|
|
14624
|
+
type: q.queue_type,
|
|
14625
|
+
messageCount: q.message_count,
|
|
14626
|
+
dlqCount: q.dlq_count,
|
|
14627
|
+
createdAt: q.created_at
|
|
14628
|
+
}));
|
|
14629
|
+
return new vscode24.LanguageModelToolResult([
|
|
14630
|
+
new vscode24.LanguageModelTextPart(JSON.stringify(output, null, 2))
|
|
14631
|
+
]);
|
|
14632
|
+
}
|
|
14633
|
+
async prepareInvocation(_options, _token) {
|
|
14634
|
+
return {
|
|
14635
|
+
invocationMessage: "Fetching queues..."
|
|
14636
|
+
};
|
|
14637
|
+
}
|
|
14638
|
+
};
|
|
14639
|
+
var PublishQueueMessageTool = class {
|
|
14640
|
+
async invoke(options, _token) {
|
|
14641
|
+
if (!hasProject()) {
|
|
14642
|
+
throw new Error("No Agentuity project found in the current workspace.");
|
|
14643
|
+
}
|
|
14644
|
+
const { queueName, payload, metadata, ttl } = options.input;
|
|
14645
|
+
if (!queueName || !payload) {
|
|
14646
|
+
throw new Error("Queue name and payload are required.");
|
|
14647
|
+
}
|
|
14648
|
+
try {
|
|
14649
|
+
JSON.parse(payload);
|
|
14650
|
+
} catch {
|
|
14651
|
+
throw new Error("Payload must be valid JSON.");
|
|
14652
|
+
}
|
|
14653
|
+
if (metadata) {
|
|
14654
|
+
try {
|
|
14655
|
+
JSON.parse(metadata);
|
|
14656
|
+
} catch {
|
|
14657
|
+
throw new Error("Metadata must be valid JSON.");
|
|
14658
|
+
}
|
|
14659
|
+
}
|
|
14660
|
+
const cli = getCliClient();
|
|
14661
|
+
const result = await cli.publishQueueMessage(queueName, payload, { metadata, ttl });
|
|
14662
|
+
if (!result.success || !result.data) {
|
|
14663
|
+
throw new Error(`Failed to publish message: ${result.error || "Unknown error"}`);
|
|
14664
|
+
}
|
|
14665
|
+
return new vscode24.LanguageModelToolResult([
|
|
14666
|
+
new vscode24.LanguageModelTextPart(
|
|
14667
|
+
`Published message to queue "${queueName}":
|
|
14668
|
+
|
|
14669
|
+
ID: ${result.data.id}
|
|
14670
|
+
Offset: ${result.data.offset}
|
|
14671
|
+
State: ${result.data.state}`
|
|
14672
|
+
)
|
|
14673
|
+
]);
|
|
14674
|
+
}
|
|
14675
|
+
async prepareInvocation(options, _token) {
|
|
14676
|
+
return {
|
|
14677
|
+
invocationMessage: `Publishing message to queue "${options.input.queueName}"...`,
|
|
14678
|
+
confirmationMessages: {
|
|
14679
|
+
title: "Publish Message",
|
|
14680
|
+
message: new vscode24.MarkdownString(
|
|
14681
|
+
`Publish message to queue **${options.input.queueName}**?
|
|
14682
|
+
|
|
14683
|
+
\`\`\`json
|
|
14684
|
+
${options.input.payload}
|
|
14685
|
+
\`\`\``
|
|
14686
|
+
)
|
|
14687
|
+
}
|
|
14688
|
+
};
|
|
14689
|
+
}
|
|
14690
|
+
};
|
|
14691
|
+
var ListQueueMessagesTool = class {
|
|
14692
|
+
async invoke(options, _token) {
|
|
14693
|
+
if (!hasProject()) {
|
|
14694
|
+
throw new Error("No Agentuity project found in the current workspace.");
|
|
14695
|
+
}
|
|
14696
|
+
const { queueName, limit } = options.input;
|
|
14697
|
+
if (!queueName) {
|
|
14698
|
+
throw new Error("Queue name is required.");
|
|
14699
|
+
}
|
|
14700
|
+
const cli = getCliClient();
|
|
14701
|
+
const result = await cli.listQueueMessages(queueName, { limit: limit || 20 });
|
|
14702
|
+
if (!result.success || !result.data) {
|
|
14703
|
+
throw new Error(`Failed to list messages: ${result.error || "Unknown error"}`);
|
|
14704
|
+
}
|
|
14705
|
+
const messages = result.data.data?.messages || [];
|
|
14706
|
+
if (messages.length === 0) {
|
|
14707
|
+
return new vscode24.LanguageModelToolResult([
|
|
14708
|
+
new vscode24.LanguageModelTextPart(`No messages in queue "${queueName}".`)
|
|
14709
|
+
]);
|
|
14710
|
+
}
|
|
14711
|
+
return new vscode24.LanguageModelToolResult([
|
|
14712
|
+
new vscode24.LanguageModelTextPart(JSON.stringify(messages, null, 2))
|
|
14713
|
+
]);
|
|
14714
|
+
}
|
|
14715
|
+
async prepareInvocation(options, _token) {
|
|
14716
|
+
return {
|
|
14717
|
+
invocationMessage: `Fetching messages from queue "${options.input.queueName}"...`
|
|
14718
|
+
};
|
|
14719
|
+
}
|
|
14720
|
+
};
|
|
14721
|
+
var PauseResumeQueueTool = class {
|
|
14722
|
+
async invoke(options, _token) {
|
|
14723
|
+
if (!hasProject()) {
|
|
14724
|
+
throw new Error("No Agentuity project found in the current workspace.");
|
|
14725
|
+
}
|
|
14726
|
+
const { queueName, action } = options.input;
|
|
14727
|
+
if (!queueName || !action) {
|
|
14728
|
+
throw new Error("Queue name and action are required.");
|
|
14729
|
+
}
|
|
14730
|
+
const cli = getCliClient();
|
|
14731
|
+
const result = action === "pause" ? await cli.pauseQueue(queueName) : await cli.resumeQueue(queueName);
|
|
14732
|
+
if (!result.success) {
|
|
14733
|
+
throw new Error(`Failed to ${action} queue: ${result.error || "Unknown error"}`);
|
|
14734
|
+
}
|
|
14735
|
+
return new vscode24.LanguageModelToolResult([
|
|
14736
|
+
new vscode24.LanguageModelTextPart(`Queue "${queueName}" ${action}d successfully.`)
|
|
14737
|
+
]);
|
|
14738
|
+
}
|
|
14739
|
+
async prepareInvocation(options, _token) {
|
|
14740
|
+
return {
|
|
14741
|
+
invocationMessage: `${options.input.action === "pause" ? "Pausing" : "Resuming"} queue "${options.input.queueName}"...`
|
|
14742
|
+
};
|
|
14743
|
+
}
|
|
14744
|
+
};
|
|
14745
|
+
var ListDlqMessagesTool = class {
|
|
14746
|
+
async invoke(options, _token) {
|
|
14747
|
+
if (!hasProject()) {
|
|
14748
|
+
throw new Error("No Agentuity project found in the current workspace.");
|
|
14749
|
+
}
|
|
14750
|
+
const { queueName, limit } = options.input;
|
|
14751
|
+
if (!queueName) {
|
|
14752
|
+
throw new Error("Queue name is required.");
|
|
14753
|
+
}
|
|
14754
|
+
const cli = getCliClient();
|
|
14755
|
+
const result = await cli.listDlqMessages(queueName, { limit: limit || 20 });
|
|
14756
|
+
if (!result.success || !result.data) {
|
|
14757
|
+
throw new Error(`Failed to list DLQ messages: ${result.error || "Unknown error"}`);
|
|
14758
|
+
}
|
|
14759
|
+
const messages = result.data.messages || [];
|
|
14760
|
+
if (messages.length === 0) {
|
|
14761
|
+
return new vscode24.LanguageModelToolResult([
|
|
14762
|
+
new vscode24.LanguageModelTextPart(`No messages in DLQ for queue "${queueName}".`)
|
|
14763
|
+
]);
|
|
14764
|
+
}
|
|
14765
|
+
const output = messages.map((m) => ({
|
|
14766
|
+
id: m.id,
|
|
14767
|
+
offset: m.offset,
|
|
14768
|
+
failureReason: m.failure_reason,
|
|
14769
|
+
deliveryAttempts: m.delivery_attempts,
|
|
14770
|
+
movedAt: m.moved_at
|
|
14771
|
+
}));
|
|
14772
|
+
return new vscode24.LanguageModelToolResult([
|
|
14773
|
+
new vscode24.LanguageModelTextPart(JSON.stringify(output, null, 2))
|
|
14774
|
+
]);
|
|
14775
|
+
}
|
|
14776
|
+
async prepareInvocation(options, _token) {
|
|
14777
|
+
return {
|
|
14778
|
+
invocationMessage: `Fetching DLQ messages from queue "${options.input.queueName}"...`
|
|
14779
|
+
};
|
|
14780
|
+
}
|
|
14781
|
+
};
|
|
14782
|
+
var ReplayDlqMessageTool = class {
|
|
14783
|
+
async invoke(options, _token) {
|
|
14784
|
+
if (!hasProject()) {
|
|
14785
|
+
throw new Error("No Agentuity project found in the current workspace.");
|
|
14786
|
+
}
|
|
14787
|
+
const { queueName, messageId } = options.input;
|
|
14788
|
+
if (!queueName || !messageId) {
|
|
14789
|
+
throw new Error("Queue name and message ID are required.");
|
|
14790
|
+
}
|
|
14791
|
+
const cli = getCliClient();
|
|
14792
|
+
const result = await cli.replayDlqMessage(queueName, messageId);
|
|
14793
|
+
if (!result.success || !result.data) {
|
|
14794
|
+
throw new Error(`Failed to replay message: ${result.error || "Unknown error"}`);
|
|
14795
|
+
}
|
|
14796
|
+
return new vscode24.LanguageModelToolResult([
|
|
14797
|
+
new vscode24.LanguageModelTextPart(
|
|
14798
|
+
`Replayed DLQ message ${messageId}. New offset: ${result.data.message.offset}`
|
|
14799
|
+
)
|
|
14800
|
+
]);
|
|
14801
|
+
}
|
|
14802
|
+
async prepareInvocation(options, _token) {
|
|
14803
|
+
return {
|
|
14804
|
+
invocationMessage: `Replaying DLQ message ${options.input.messageId?.substring(0, 8)}...`,
|
|
14805
|
+
confirmationMessages: {
|
|
14806
|
+
title: "Replay DLQ Message",
|
|
14807
|
+
message: new vscode24.MarkdownString(
|
|
14808
|
+
`Replay message **${options.input.messageId}** from the dead letter queue back to queue **${options.input.queueName}**?`
|
|
14809
|
+
)
|
|
14810
|
+
}
|
|
14811
|
+
};
|
|
14812
|
+
}
|
|
14813
|
+
};
|
|
13639
14814
|
function registerAgentTools(context) {
|
|
13640
|
-
if (!
|
|
14815
|
+
if (!vscode24.lm?.registerTool) {
|
|
13641
14816
|
return;
|
|
13642
14817
|
}
|
|
13643
14818
|
try {
|
|
13644
14819
|
context.subscriptions.push(
|
|
13645
|
-
|
|
14820
|
+
vscode24.lm.registerTool("agentuity_get_agents", new GetAgentsTool())
|
|
14821
|
+
);
|
|
14822
|
+
context.subscriptions.push(
|
|
14823
|
+
vscode24.lm.registerTool("agentuity_get_project_status", new GetProjectStatusTool())
|
|
14824
|
+
);
|
|
14825
|
+
context.subscriptions.push(
|
|
14826
|
+
vscode24.lm.registerTool("agentuity_get_sessions", new GetSessionsTool())
|
|
14827
|
+
);
|
|
14828
|
+
context.subscriptions.push(
|
|
14829
|
+
vscode24.lm.registerTool("agentuity_get_session_logs", new GetSessionLogsTool())
|
|
14830
|
+
);
|
|
14831
|
+
context.subscriptions.push(
|
|
14832
|
+
vscode24.lm.registerTool("agentuity_control_dev_server", new ControlDevServerTool())
|
|
14833
|
+
);
|
|
14834
|
+
context.subscriptions.push(
|
|
14835
|
+
vscode24.lm.registerTool("agentuity_get_deployments", new GetDeploymentsTool())
|
|
14836
|
+
);
|
|
14837
|
+
context.subscriptions.push(
|
|
14838
|
+
vscode24.lm.registerTool("agentuity_deploy_project", new DeployProjectTool())
|
|
14839
|
+
);
|
|
14840
|
+
context.subscriptions.push(
|
|
14841
|
+
vscode24.lm.registerTool("agentuity_get_health_summary", new GetHealthSummaryTool())
|
|
13646
14842
|
);
|
|
13647
14843
|
context.subscriptions.push(
|
|
13648
|
-
|
|
14844
|
+
vscode24.lm.registerTool("agentuity_list_sandboxes", new ListSandboxesTool())
|
|
13649
14845
|
);
|
|
13650
14846
|
context.subscriptions.push(
|
|
13651
|
-
|
|
14847
|
+
vscode24.lm.registerTool("agentuity_list_sandbox_runtimes", new ListSandboxRuntimesTool())
|
|
13652
14848
|
);
|
|
13653
14849
|
context.subscriptions.push(
|
|
13654
|
-
|
|
14850
|
+
vscode24.lm.registerTool("agentuity_create_sandbox", new CreateSandboxTool())
|
|
13655
14851
|
);
|
|
13656
14852
|
context.subscriptions.push(
|
|
13657
|
-
|
|
14853
|
+
vscode24.lm.registerTool("agentuity_sync_to_sandbox", new SyncToSandboxTool())
|
|
13658
14854
|
);
|
|
13659
14855
|
context.subscriptions.push(
|
|
13660
|
-
|
|
14856
|
+
vscode24.lm.registerTool("agentuity_execute_in_sandbox", new ExecuteInSandboxTool())
|
|
13661
14857
|
);
|
|
13662
14858
|
context.subscriptions.push(
|
|
13663
|
-
|
|
14859
|
+
vscode24.lm.registerTool("agentuity_create_snapshot", new CreateSnapshotTool())
|
|
13664
14860
|
);
|
|
13665
14861
|
context.subscriptions.push(
|
|
13666
|
-
|
|
14862
|
+
vscode24.lm.registerTool("agentuity_delete_sandbox", new DeleteSandboxTool())
|
|
13667
14863
|
);
|
|
13668
14864
|
context.subscriptions.push(
|
|
13669
|
-
|
|
14865
|
+
vscode24.lm.registerTool("agentuity_list_queues", new ListQueuesTool())
|
|
13670
14866
|
);
|
|
13671
14867
|
context.subscriptions.push(
|
|
13672
|
-
|
|
14868
|
+
vscode24.lm.registerTool("agentuity_publish_queue_message", new PublishQueueMessageTool())
|
|
13673
14869
|
);
|
|
13674
14870
|
context.subscriptions.push(
|
|
13675
|
-
|
|
14871
|
+
vscode24.lm.registerTool("agentuity_list_queue_messages", new ListQueueMessagesTool())
|
|
13676
14872
|
);
|
|
13677
14873
|
context.subscriptions.push(
|
|
13678
|
-
|
|
14874
|
+
vscode24.lm.registerTool("agentuity_pause_resume_queue", new PauseResumeQueueTool())
|
|
13679
14875
|
);
|
|
13680
14876
|
context.subscriptions.push(
|
|
13681
|
-
|
|
14877
|
+
vscode24.lm.registerTool("agentuity_list_dlq_messages", new ListDlqMessagesTool())
|
|
13682
14878
|
);
|
|
13683
14879
|
context.subscriptions.push(
|
|
13684
|
-
|
|
14880
|
+
vscode24.lm.registerTool("agentuity_replay_dlq_message", new ReplayDlqMessageTool())
|
|
13685
14881
|
);
|
|
13686
14882
|
} catch {
|
|
13687
14883
|
}
|
|
13688
14884
|
}
|
|
13689
14885
|
|
|
13690
14886
|
// src/features/codeLens/index.ts
|
|
13691
|
-
var
|
|
14887
|
+
var vscode26 = __toESM(require("vscode"));
|
|
13692
14888
|
var fs15 = __toESM(require("fs"));
|
|
13693
14889
|
var path14 = __toESM(require("path"));
|
|
13694
14890
|
|
|
13695
14891
|
// src/features/codeLens/agentCodeLensProvider.ts
|
|
13696
|
-
var
|
|
14892
|
+
var vscode25 = __toESM(require("vscode"));
|
|
13697
14893
|
var AgentCodeLensProvider = class {
|
|
13698
|
-
_onDidChangeCodeLenses = new
|
|
14894
|
+
_onDidChangeCodeLenses = new vscode25.EventEmitter();
|
|
13699
14895
|
onDidChangeCodeLenses = this._onDidChangeCodeLenses.event;
|
|
13700
14896
|
// Match both: createAgent('name', { and createAgent({
|
|
13701
14897
|
createAgentRegex = /createAgent\s*\(/g;
|
|
@@ -13709,10 +14905,10 @@ var AgentCodeLensProvider = class {
|
|
|
13709
14905
|
this.createAgentRegex.lastIndex = 0;
|
|
13710
14906
|
while ((match = this.createAgentRegex.exec(text)) !== null) {
|
|
13711
14907
|
const position = document.positionAt(match.index);
|
|
13712
|
-
const range = new
|
|
14908
|
+
const range = new vscode25.Range(position, position);
|
|
13713
14909
|
const agentInfo = this.extractAgentInfo(document, match.index);
|
|
13714
14910
|
codeLenses.push(
|
|
13715
|
-
new
|
|
14911
|
+
new vscode25.CodeLens(range, {
|
|
13716
14912
|
title: "$(play) Open in Workbench",
|
|
13717
14913
|
command: "agentuity.codeLens.openInWorkbench",
|
|
13718
14914
|
arguments: [agentInfo],
|
|
@@ -13720,7 +14916,7 @@ var AgentCodeLensProvider = class {
|
|
|
13720
14916
|
})
|
|
13721
14917
|
);
|
|
13722
14918
|
codeLenses.push(
|
|
13723
|
-
new
|
|
14919
|
+
new vscode25.CodeLens(range, {
|
|
13724
14920
|
title: "$(pulse) View Sessions",
|
|
13725
14921
|
command: "agentuity.codeLens.viewSessions",
|
|
13726
14922
|
arguments: [agentInfo],
|
|
@@ -13749,7 +14945,7 @@ var AgentCodeLensProvider = class {
|
|
|
13749
14945
|
identifier = identifierMatch[1];
|
|
13750
14946
|
}
|
|
13751
14947
|
if (!identifier) {
|
|
13752
|
-
const relativePath =
|
|
14948
|
+
const relativePath = vscode25.workspace.asRelativePath(document.uri);
|
|
13753
14949
|
const pathParts = relativePath.split("/");
|
|
13754
14950
|
const agentsIndex = pathParts.indexOf("agents");
|
|
13755
14951
|
if (agentsIndex !== -1 && agentsIndex < pathParts.length - 1) {
|
|
@@ -13777,7 +14973,6 @@ var AgentCodeLensProvider = class {
|
|
|
13777
14973
|
};
|
|
13778
14974
|
|
|
13779
14975
|
// src/features/codeLens/index.ts
|
|
13780
|
-
var SESSIONS_BASE_URL2 = "https://app-v1.agentuity.com";
|
|
13781
14976
|
function findAgentIdFromMetadata(project, info) {
|
|
13782
14977
|
try {
|
|
13783
14978
|
const metadataPath = path14.join(project.rootPath, ".agentuity", "agentuity.metadata.json");
|
|
@@ -13815,30 +15010,30 @@ function registerCodeLens(context) {
|
|
|
13815
15010
|
{ language: "typescript", scheme: "file" },
|
|
13816
15011
|
{ language: "javascript", scheme: "file" }
|
|
13817
15012
|
];
|
|
13818
|
-
context.subscriptions.push(
|
|
15013
|
+
context.subscriptions.push(vscode26.languages.registerCodeLensProvider(selector, provider));
|
|
13819
15014
|
context.subscriptions.push(
|
|
13820
|
-
|
|
15015
|
+
vscode26.commands.registerCommand(
|
|
13821
15016
|
"agentuity.codeLens.openInWorkbench",
|
|
13822
15017
|
async (info) => {
|
|
13823
15018
|
const devServer2 = getDevServerManager();
|
|
13824
15019
|
if (devServer2.getState() !== "running") {
|
|
13825
|
-
const action = await
|
|
15020
|
+
const action = await vscode26.window.showWarningMessage(
|
|
13826
15021
|
"Dev server is not running. Start it to open the Workbench.",
|
|
13827
15022
|
"Start Dev Server",
|
|
13828
15023
|
"Cancel"
|
|
13829
15024
|
);
|
|
13830
15025
|
if (action === "Start Dev Server") {
|
|
13831
|
-
await
|
|
15026
|
+
await vscode26.commands.executeCommand("agentuity.dev.start");
|
|
13832
15027
|
await waitForDevServer(5e3);
|
|
13833
15028
|
if (devServer2.getState() !== "running") {
|
|
13834
|
-
|
|
15029
|
+
vscode26.window.showErrorMessage("Failed to start dev server");
|
|
13835
15030
|
return;
|
|
13836
15031
|
}
|
|
13837
15032
|
} else {
|
|
13838
15033
|
return;
|
|
13839
15034
|
}
|
|
13840
15035
|
}
|
|
13841
|
-
const port =
|
|
15036
|
+
const port = vscode26.workspace.getConfiguration("agentuity").get("devServer.port", 3500);
|
|
13842
15037
|
let url = `http://localhost:${port}/workbench`;
|
|
13843
15038
|
const project = getCurrentProject();
|
|
13844
15039
|
if (project) {
|
|
@@ -13847,37 +15042,37 @@ function registerCodeLens(context) {
|
|
|
13847
15042
|
url += `?agent=${encodeURIComponent(agentId)}`;
|
|
13848
15043
|
}
|
|
13849
15044
|
}
|
|
13850
|
-
await
|
|
15045
|
+
await vscode26.env.openExternal(vscode26.Uri.parse(url));
|
|
13851
15046
|
}
|
|
13852
15047
|
)
|
|
13853
15048
|
);
|
|
13854
15049
|
context.subscriptions.push(
|
|
13855
|
-
|
|
15050
|
+
vscode26.commands.registerCommand(
|
|
13856
15051
|
"agentuity.codeLens.viewSessions",
|
|
13857
15052
|
async (info) => {
|
|
13858
15053
|
const project = getCurrentProject();
|
|
13859
15054
|
if (!project) {
|
|
13860
|
-
|
|
15055
|
+
vscode26.window.showErrorMessage("No Agentuity project found");
|
|
13861
15056
|
return;
|
|
13862
15057
|
}
|
|
13863
15058
|
if (!info.identifier) {
|
|
13864
|
-
|
|
15059
|
+
vscode26.window.showErrorMessage("Could not determine agent identifier");
|
|
13865
15060
|
return;
|
|
13866
15061
|
}
|
|
13867
15062
|
const agentProvider2 = getAgentProvider();
|
|
13868
15063
|
if (!agentProvider2) {
|
|
13869
|
-
|
|
15064
|
+
vscode26.window.showErrorMessage("Agent explorer not initialized");
|
|
13870
15065
|
return;
|
|
13871
15066
|
}
|
|
13872
15067
|
const agent = agentProvider2.findAgentByIdentifier(info.identifier);
|
|
13873
15068
|
if (!agent) {
|
|
13874
|
-
|
|
15069
|
+
vscode26.window.showWarningMessage(
|
|
13875
15070
|
`Agent "${info.identifier}" not found. Deploy your project first to view sessions.`
|
|
13876
15071
|
);
|
|
13877
15072
|
return;
|
|
13878
15073
|
}
|
|
13879
|
-
const url =
|
|
13880
|
-
await
|
|
15074
|
+
const url = getSessionsUrl(project.projectId, agent.id);
|
|
15075
|
+
await vscode26.env.openExternal(vscode26.Uri.parse(url));
|
|
13881
15076
|
}
|
|
13882
15077
|
)
|
|
13883
15078
|
);
|
|
@@ -13914,18 +15109,18 @@ async function waitForDevServer(timeoutMs) {
|
|
|
13914
15109
|
}
|
|
13915
15110
|
|
|
13916
15111
|
// src/features/customAgents/index.ts
|
|
13917
|
-
var
|
|
15112
|
+
var vscode27 = __toESM(require("vscode"));
|
|
13918
15113
|
var path15 = __toESM(require("path"));
|
|
13919
15114
|
var AGENTUITY_DEVELOPER_AGENT = `---
|
|
13920
15115
|
name: Agentuity Developer
|
|
13921
15116
|
description: Expert at building and debugging Agentuity AI agents
|
|
13922
15117
|
tools:
|
|
13923
|
-
-
|
|
13924
|
-
-
|
|
13925
|
-
-
|
|
13926
|
-
-
|
|
13927
|
-
-
|
|
13928
|
-
-
|
|
15118
|
+
- agentuity_get_agents
|
|
15119
|
+
- agentuity_get_project_status
|
|
15120
|
+
- agentuity_get_sessions
|
|
15121
|
+
- agentuity_get_session_logs
|
|
15122
|
+
- agentuity_control_dev_server
|
|
15123
|
+
- agentuity_get_deployments
|
|
13929
15124
|
---
|
|
13930
15125
|
|
|
13931
15126
|
You are an expert Agentuity developer assistant. You help build, debug, and deploy AI agents using the Agentuity platform.
|
|
@@ -13933,29 +15128,28 @@ You are an expert Agentuity developer assistant. You help build, debug, and depl
|
|
|
13933
15128
|
## Your Capabilities
|
|
13934
15129
|
|
|
13935
15130
|
You have access to specialized Agentuity tools:
|
|
13936
|
-
-
|
|
13937
|
-
-
|
|
13938
|
-
-
|
|
13939
|
-
-
|
|
13940
|
-
-
|
|
13941
|
-
-
|
|
15131
|
+
- **agentuity_get_agents**: List all agents in the project
|
|
15132
|
+
- **agentuity_get_project_status**: Get project status (auth, config, dev server, deployments)
|
|
15133
|
+
- **agentuity_get_sessions**: View recent agent execution sessions
|
|
15134
|
+
- **agentuity_get_session_logs**: Get detailed logs for a specific session
|
|
15135
|
+
- **agentuity_control_dev_server**: Control the dev server (start/stop/restart/status)
|
|
15136
|
+
- **agentuity_get_deployments**: List deployment history
|
|
13942
15137
|
|
|
13943
15138
|
## Guidelines
|
|
13944
15139
|
|
|
13945
|
-
1. **Before making changes**, always check the current project status with
|
|
15140
|
+
1. **Before making changes**, always check the current project status with agentuity_get_project_status
|
|
13946
15141
|
2. **For debugging**, fetch recent sessions and their logs to understand what went wrong
|
|
13947
15142
|
3. **For testing**, ensure the dev server is running before suggesting tests
|
|
13948
15143
|
4. **For deployment**, verify authentication status first
|
|
13949
15144
|
|
|
13950
15145
|
## Agentuity Agent Structure
|
|
13951
15146
|
|
|
13952
|
-
Agentuity agents are TypeScript/JavaScript files that export a
|
|
15147
|
+
Agentuity agents are TypeScript/JavaScript files that export a default agent:
|
|
13953
15148
|
|
|
13954
15149
|
\`\`\`typescript
|
|
13955
|
-
import {
|
|
15150
|
+
import { createAgent } from '@agentuity/sdk';
|
|
13956
15151
|
|
|
13957
|
-
export default
|
|
13958
|
-
name: 'my-agent',
|
|
15152
|
+
export default createAgent('my-agent', {
|
|
13959
15153
|
description: 'What this agent does',
|
|
13960
15154
|
async handler(request, context) {
|
|
13961
15155
|
// Agent logic here
|
|
@@ -13975,8 +15169,8 @@ var AGENTUITY_REVIEWER_AGENT = `---
|
|
|
13975
15169
|
name: Agentuity Reviewer
|
|
13976
15170
|
description: Reviews Agentuity agent code for best practices and issues
|
|
13977
15171
|
tools:
|
|
13978
|
-
-
|
|
13979
|
-
-
|
|
15172
|
+
- agentuity_get_agents
|
|
15173
|
+
- agentuity_get_project_status
|
|
13980
15174
|
---
|
|
13981
15175
|
|
|
13982
15176
|
You are an Agentuity code reviewer. You review agent implementations for:
|
|
@@ -14016,11 +15210,11 @@ var AGENTUITY_DEBUGGER_AGENT = `---
|
|
|
14016
15210
|
name: Agentuity Debugger
|
|
14017
15211
|
description: Diagnoses and fixes issues with Agentuity agents
|
|
14018
15212
|
tools:
|
|
14019
|
-
-
|
|
14020
|
-
-
|
|
14021
|
-
-
|
|
14022
|
-
-
|
|
14023
|
-
-
|
|
15213
|
+
- agentuity_get_agents
|
|
15214
|
+
- agentuity_get_project_status
|
|
15215
|
+
- agentuity_get_sessions
|
|
15216
|
+
- agentuity_get_session_logs
|
|
15217
|
+
- agentuity_control_dev_server
|
|
14024
15218
|
---
|
|
14025
15219
|
|
|
14026
15220
|
You are an Agentuity debugging specialist. Your job is to diagnose and fix issues with AI agents.
|
|
@@ -14028,9 +15222,9 @@ You are an Agentuity debugging specialist. Your job is to diagnose and fix issue
|
|
|
14028
15222
|
## Debugging Workflow
|
|
14029
15223
|
|
|
14030
15224
|
1. **Gather Context**
|
|
14031
|
-
- Use
|
|
14032
|
-
- Use
|
|
14033
|
-
- Use
|
|
15225
|
+
- Use agentuity_get_project_status to check project state
|
|
15226
|
+
- Use agentuity_get_sessions to find recent failures
|
|
15227
|
+
- Use agentuity_get_session_logs to get detailed error information
|
|
14034
15228
|
|
|
14035
15229
|
2. **Analyze**
|
|
14036
15230
|
- Identify error patterns
|
|
@@ -14045,12 +15239,12 @@ You are an Agentuity debugging specialist. Your job is to diagnose and fix issue
|
|
|
14045
15239
|
## Common Issues
|
|
14046
15240
|
|
|
14047
15241
|
### Agent Not Responding
|
|
14048
|
-
- Check if dev server is running (
|
|
15242
|
+
- Check if dev server is running (agentuity_control_dev_server with action: status)
|
|
14049
15243
|
- Verify agent is properly exported
|
|
14050
15244
|
- Check for infinite loops or blocking calls
|
|
14051
15245
|
|
|
14052
15246
|
### Authentication Errors
|
|
14053
|
-
- Verify
|
|
15247
|
+
- Verify agentuity_get_project_status shows authenticated
|
|
14054
15248
|
- Check API key configuration
|
|
14055
15249
|
- Ensure correct environment variables
|
|
14056
15250
|
|
|
@@ -14065,9 +15259,9 @@ You are an Agentuity debugging specialist. Your job is to diagnose and fix issue
|
|
|
14065
15259
|
- Validate JSON serialization
|
|
14066
15260
|
`;
|
|
14067
15261
|
async function scaffoldCustomAgents() {
|
|
14068
|
-
const workspaceFolders =
|
|
15262
|
+
const workspaceFolders = vscode27.workspace.workspaceFolders;
|
|
14069
15263
|
if (!workspaceFolders || workspaceFolders.length === 0) {
|
|
14070
|
-
|
|
15264
|
+
vscode27.window.showErrorMessage("No workspace folder open. Open a folder first.");
|
|
14071
15265
|
return;
|
|
14072
15266
|
}
|
|
14073
15267
|
const rootPath = workspaceFolders[0].uri.fsPath;
|
|
@@ -14077,7 +15271,7 @@ async function scaffoldCustomAgents() {
|
|
|
14077
15271
|
{ name: "agentuity-reviewer.agent.md", content: AGENTUITY_REVIEWER_AGENT },
|
|
14078
15272
|
{ name: "agentuity-debugger.agent.md", content: AGENTUITY_DEBUGGER_AGENT }
|
|
14079
15273
|
];
|
|
14080
|
-
const selected = await
|
|
15274
|
+
const selected = await vscode27.window.showQuickPick(
|
|
14081
15275
|
[
|
|
14082
15276
|
{ label: "All Agents", description: "Create all Agentuity custom agents", value: "all" },
|
|
14083
15277
|
{
|
|
@@ -14104,18 +15298,18 @@ async function scaffoldCustomAgents() {
|
|
|
14104
15298
|
if (!selected) {
|
|
14105
15299
|
return;
|
|
14106
15300
|
}
|
|
14107
|
-
const agentsDirUri =
|
|
15301
|
+
const agentsDirUri = vscode27.Uri.file(agentsDir);
|
|
14108
15302
|
try {
|
|
14109
|
-
await
|
|
15303
|
+
await vscode27.workspace.fs.createDirectory(agentsDirUri);
|
|
14110
15304
|
} catch {
|
|
14111
15305
|
}
|
|
14112
15306
|
const toCreate = selected.value === "all" ? agents : agents.filter((a) => a.name.includes(selected.value));
|
|
14113
15307
|
const writtenFiles = [];
|
|
14114
15308
|
for (const agent of toCreate) {
|
|
14115
|
-
const filePath =
|
|
15309
|
+
const filePath = vscode27.Uri.file(path15.join(agentsDir, agent.name));
|
|
14116
15310
|
try {
|
|
14117
|
-
await
|
|
14118
|
-
const overwrite = await
|
|
15311
|
+
await vscode27.workspace.fs.stat(filePath);
|
|
15312
|
+
const overwrite = await vscode27.window.showWarningMessage(
|
|
14119
15313
|
`${agent.name} already exists. Overwrite?`,
|
|
14120
15314
|
"Yes",
|
|
14121
15315
|
"No"
|
|
@@ -14125,21 +15319,21 @@ async function scaffoldCustomAgents() {
|
|
|
14125
15319
|
}
|
|
14126
15320
|
} catch {
|
|
14127
15321
|
}
|
|
14128
|
-
await
|
|
15322
|
+
await vscode27.workspace.fs.writeFile(filePath, Buffer.from(agent.content, "utf-8"));
|
|
14129
15323
|
writtenFiles.push(filePath);
|
|
14130
15324
|
}
|
|
14131
15325
|
if (writtenFiles.length === 0) {
|
|
14132
|
-
|
|
15326
|
+
vscode27.window.showInformationMessage("No custom agents were created.");
|
|
14133
15327
|
return;
|
|
14134
15328
|
}
|
|
14135
|
-
|
|
15329
|
+
vscode27.window.showInformationMessage(
|
|
14136
15330
|
`Created ${writtenFiles.length} custom agent${writtenFiles.length > 1 ? "s" : ""} in .github/agents/`
|
|
14137
15331
|
);
|
|
14138
|
-
await
|
|
15332
|
+
await vscode27.window.showTextDocument(writtenFiles[0]);
|
|
14139
15333
|
}
|
|
14140
15334
|
function registerCustomAgentCommands(context) {
|
|
14141
15335
|
context.subscriptions.push(
|
|
14142
|
-
|
|
15336
|
+
vscode27.commands.registerCommand("agentuity.createCustomAgents", () => scaffoldCustomAgents())
|
|
14143
15337
|
);
|
|
14144
15338
|
}
|
|
14145
15339
|
|
|
@@ -14161,10 +15355,11 @@ async function activate(context) {
|
|
|
14161
15355
|
registerAiCommands(context);
|
|
14162
15356
|
registerSetupCommands(context);
|
|
14163
15357
|
registerDeployCommand(context);
|
|
15358
|
+
registerOrgRegionCommands(context);
|
|
14164
15359
|
const walkthroughShown = context.globalState.get("agentuity.walkthroughShown", false);
|
|
14165
15360
|
if (!walkthroughShown) {
|
|
14166
15361
|
await context.globalState.update("agentuity.walkthroughShown", true);
|
|
14167
|
-
void
|
|
15362
|
+
void vscode28.commands.executeCommand(
|
|
14168
15363
|
"workbench.action.openWalkthrough",
|
|
14169
15364
|
"agentuity.agentuity#gettingStarted",
|
|
14170
15365
|
false
|
|
@@ -14200,11 +15395,11 @@ async function activate(context) {
|
|
|
14200
15395
|
}
|
|
14201
15396
|
function registerAuthCommands(context) {
|
|
14202
15397
|
context.subscriptions.push(
|
|
14203
|
-
|
|
14204
|
-
const terminal =
|
|
15398
|
+
vscode28.commands.registerCommand("agentuity.login", () => {
|
|
15399
|
+
const terminal = vscode28.window.createTerminal("Agentuity Login");
|
|
14205
15400
|
terminal.sendText("agentuity auth login");
|
|
14206
15401
|
terminal.show();
|
|
14207
|
-
|
|
15402
|
+
vscode28.window.showInformationMessage(
|
|
14208
15403
|
"Complete login in the terminal, then refresh the extension.",
|
|
14209
15404
|
"Refresh"
|
|
14210
15405
|
).then((action) => {
|
|
@@ -14215,35 +15410,35 @@ function registerAuthCommands(context) {
|
|
|
14215
15410
|
})
|
|
14216
15411
|
);
|
|
14217
15412
|
context.subscriptions.push(
|
|
14218
|
-
|
|
15413
|
+
vscode28.commands.registerCommand("agentuity.logout", async () => {
|
|
14219
15414
|
const cli = getCliClient();
|
|
14220
15415
|
const result = await cli.exec(["auth", "logout"]);
|
|
14221
15416
|
if (result.success) {
|
|
14222
|
-
|
|
15417
|
+
vscode28.window.showInformationMessage("Logged out of Agentuity");
|
|
14223
15418
|
await checkAuth();
|
|
14224
15419
|
} else {
|
|
14225
|
-
|
|
15420
|
+
vscode28.window.showErrorMessage(`Logout failed: ${result.error}`);
|
|
14226
15421
|
}
|
|
14227
15422
|
})
|
|
14228
15423
|
);
|
|
14229
15424
|
context.subscriptions.push(
|
|
14230
|
-
|
|
15425
|
+
vscode28.commands.registerCommand("agentuity.whoami", async () => {
|
|
14231
15426
|
const cli = getCliClient();
|
|
14232
15427
|
const result = await cli.whoami();
|
|
14233
15428
|
if (result.success && result.data) {
|
|
14234
15429
|
const user = result.data;
|
|
14235
|
-
|
|
15430
|
+
vscode28.window.showInformationMessage(
|
|
14236
15431
|
`Logged in as: ${user.firstName} ${user.lastName}`
|
|
14237
15432
|
);
|
|
14238
15433
|
} else {
|
|
14239
|
-
|
|
15434
|
+
vscode28.window.showWarningMessage("Not logged in to Agentuity");
|
|
14240
15435
|
}
|
|
14241
15436
|
})
|
|
14242
15437
|
);
|
|
14243
15438
|
}
|
|
14244
15439
|
function registerAiCommands(context) {
|
|
14245
15440
|
context.subscriptions.push(
|
|
14246
|
-
|
|
15441
|
+
vscode28.commands.registerCommand("agentuity.getAiCapabilities", async () => {
|
|
14247
15442
|
if (!await requireAuth()) {
|
|
14248
15443
|
return void 0;
|
|
14249
15444
|
}
|
|
@@ -14252,13 +15447,13 @@ function registerAiCommands(context) {
|
|
|
14252
15447
|
if (result.success) {
|
|
14253
15448
|
return result.data;
|
|
14254
15449
|
} else {
|
|
14255
|
-
|
|
15450
|
+
vscode28.window.showErrorMessage(`Failed to get capabilities: ${result.error}`);
|
|
14256
15451
|
return void 0;
|
|
14257
15452
|
}
|
|
14258
15453
|
})
|
|
14259
15454
|
);
|
|
14260
15455
|
context.subscriptions.push(
|
|
14261
|
-
|
|
15456
|
+
vscode28.commands.registerCommand("agentuity.getAiSchema", async () => {
|
|
14262
15457
|
if (!await requireAuth()) {
|
|
14263
15458
|
return void 0;
|
|
14264
15459
|
}
|
|
@@ -14267,7 +15462,7 @@ function registerAiCommands(context) {
|
|
|
14267
15462
|
if (result.success) {
|
|
14268
15463
|
return result.data;
|
|
14269
15464
|
} else {
|
|
14270
|
-
|
|
15465
|
+
vscode28.window.showErrorMessage(`Failed to get schema: ${result.error}`);
|
|
14271
15466
|
return void 0;
|
|
14272
15467
|
}
|
|
14273
15468
|
})
|
|
@@ -14275,27 +15470,27 @@ function registerAiCommands(context) {
|
|
|
14275
15470
|
}
|
|
14276
15471
|
function registerSetupCommands(context) {
|
|
14277
15472
|
context.subscriptions.push(
|
|
14278
|
-
|
|
14279
|
-
void
|
|
14280
|
-
|
|
15473
|
+
vscode28.commands.registerCommand("agentuity.installCli", () => {
|
|
15474
|
+
void vscode28.env.openExternal(
|
|
15475
|
+
vscode28.Uri.parse("https://agentuity.dev/Introduction/getting-started")
|
|
14281
15476
|
);
|
|
14282
15477
|
})
|
|
14283
15478
|
);
|
|
14284
15479
|
context.subscriptions.push(
|
|
14285
|
-
|
|
14286
|
-
const terminal =
|
|
15480
|
+
vscode28.commands.registerCommand("agentuity.createProject", () => {
|
|
15481
|
+
const terminal = vscode28.window.createTerminal("Agentuity");
|
|
14287
15482
|
terminal.sendText("agentuity project new");
|
|
14288
15483
|
terminal.show();
|
|
14289
15484
|
})
|
|
14290
15485
|
);
|
|
14291
15486
|
context.subscriptions.push(
|
|
14292
|
-
|
|
14293
|
-
const workspaceFolder =
|
|
15487
|
+
vscode28.commands.registerCommand("agentuity.generateSkills", async () => {
|
|
15488
|
+
const workspaceFolder = vscode28.workspace.workspaceFolders?.[0];
|
|
14294
15489
|
if (!workspaceFolder) {
|
|
14295
|
-
|
|
15490
|
+
vscode28.window.showErrorMessage("No workspace folder open");
|
|
14296
15491
|
return;
|
|
14297
15492
|
}
|
|
14298
|
-
const outputPath = await
|
|
15493
|
+
const outputPath = await vscode28.window.showInputBox({
|
|
14299
15494
|
prompt: "Output directory for generated skills",
|
|
14300
15495
|
value: workspaceFolder.uri.fsPath,
|
|
14301
15496
|
placeHolder: "/path/to/output"
|
|
@@ -14303,20 +15498,20 @@ function registerSetupCommands(context) {
|
|
|
14303
15498
|
if (!outputPath) {
|
|
14304
15499
|
return;
|
|
14305
15500
|
}
|
|
14306
|
-
const terminal =
|
|
15501
|
+
const terminal = vscode28.window.createTerminal("Agentuity Skills");
|
|
14307
15502
|
terminal.sendText(`agentuity ai skills generate --output "${outputPath}"`);
|
|
14308
15503
|
terminal.show();
|
|
14309
|
-
|
|
15504
|
+
vscode28.window.showInformationMessage("Generating AI skills...");
|
|
14310
15505
|
})
|
|
14311
15506
|
);
|
|
14312
15507
|
}
|
|
14313
15508
|
function registerDeployCommand(context) {
|
|
14314
15509
|
context.subscriptions.push(
|
|
14315
|
-
|
|
15510
|
+
vscode28.commands.registerCommand("agentuity.deploy", async () => {
|
|
14316
15511
|
if (!await requireAuth()) {
|
|
14317
15512
|
return;
|
|
14318
15513
|
}
|
|
14319
|
-
const answer = await
|
|
15514
|
+
const answer = await vscode28.window.showWarningMessage(
|
|
14320
15515
|
"Deploy to Agentuity Cloud?",
|
|
14321
15516
|
{ modal: true },
|
|
14322
15517
|
"Deploy"
|
|
@@ -14324,41 +15519,107 @@ function registerDeployCommand(context) {
|
|
|
14324
15519
|
if (answer !== "Deploy") {
|
|
14325
15520
|
return;
|
|
14326
15521
|
}
|
|
14327
|
-
const terminal =
|
|
15522
|
+
const terminal = vscode28.window.createTerminal("Agentuity Deploy");
|
|
14328
15523
|
terminal.sendText("agentuity cloud deploy");
|
|
14329
15524
|
terminal.show();
|
|
14330
15525
|
})
|
|
14331
15526
|
);
|
|
14332
15527
|
}
|
|
15528
|
+
function registerOrgRegionCommands(context) {
|
|
15529
|
+
context.subscriptions.push(
|
|
15530
|
+
vscode28.commands.registerCommand("agentuity.org.select", async () => {
|
|
15531
|
+
if (!await requireAuth()) {
|
|
15532
|
+
return;
|
|
15533
|
+
}
|
|
15534
|
+
const cli = getCliClient();
|
|
15535
|
+
const result = await cli.orgList();
|
|
15536
|
+
if (!result.success || !result.data || result.data.length === 0) {
|
|
15537
|
+
vscode28.window.showWarningMessage("No organizations found");
|
|
15538
|
+
return;
|
|
15539
|
+
}
|
|
15540
|
+
const items = result.data.map((org) => ({
|
|
15541
|
+
label: org.name,
|
|
15542
|
+
description: org.id,
|
|
15543
|
+
orgId: org.id
|
|
15544
|
+
}));
|
|
15545
|
+
const selected = await vscode28.window.showQuickPick(items, {
|
|
15546
|
+
placeHolder: "Select an organization",
|
|
15547
|
+
title: "Switch Organization"
|
|
15548
|
+
});
|
|
15549
|
+
if (!selected) {
|
|
15550
|
+
return;
|
|
15551
|
+
}
|
|
15552
|
+
const selectResult = await cli.orgSelect(selected.orgId);
|
|
15553
|
+
if (selectResult.success) {
|
|
15554
|
+
vscode28.window.showInformationMessage(`Switched to organization: ${selected.label}`);
|
|
15555
|
+
void vscode28.commands.executeCommand("agentuity.refresh");
|
|
15556
|
+
} else {
|
|
15557
|
+
vscode28.window.showErrorMessage(`Failed to switch organization: ${selectResult.error}`);
|
|
15558
|
+
}
|
|
15559
|
+
})
|
|
15560
|
+
);
|
|
15561
|
+
context.subscriptions.push(
|
|
15562
|
+
vscode28.commands.registerCommand("agentuity.region.select", async () => {
|
|
15563
|
+
if (!await requireAuth()) {
|
|
15564
|
+
return;
|
|
15565
|
+
}
|
|
15566
|
+
const cli = getCliClient();
|
|
15567
|
+
const result = await cli.regionList();
|
|
15568
|
+
if (!result.success || !result.data || result.data.length === 0) {
|
|
15569
|
+
vscode28.window.showWarningMessage("No regions available");
|
|
15570
|
+
return;
|
|
15571
|
+
}
|
|
15572
|
+
const items = result.data.map((region) => ({
|
|
15573
|
+
label: region.description,
|
|
15574
|
+
description: region.region,
|
|
15575
|
+
region: region.region
|
|
15576
|
+
}));
|
|
15577
|
+
const selected = await vscode28.window.showQuickPick(items, {
|
|
15578
|
+
placeHolder: "Select a region",
|
|
15579
|
+
title: "Switch Region"
|
|
15580
|
+
});
|
|
15581
|
+
if (!selected) {
|
|
15582
|
+
return;
|
|
15583
|
+
}
|
|
15584
|
+
const selectResult = await cli.regionSelect(selected.region);
|
|
15585
|
+
if (selectResult.success) {
|
|
15586
|
+
vscode28.window.showInformationMessage(`Switched to region: ${selected.label}`);
|
|
15587
|
+
void vscode28.commands.executeCommand("agentuity.sandbox.refresh");
|
|
15588
|
+
} else {
|
|
15589
|
+
vscode28.window.showErrorMessage(`Failed to switch region: ${selectResult.error}`);
|
|
15590
|
+
}
|
|
15591
|
+
})
|
|
15592
|
+
);
|
|
15593
|
+
}
|
|
14333
15594
|
function registerRefreshCommands(context, providers) {
|
|
14334
15595
|
context.subscriptions.push(
|
|
14335
|
-
|
|
15596
|
+
vscode28.commands.registerCommand("agentuity.refresh", async () => {
|
|
14336
15597
|
await checkAuth();
|
|
14337
15598
|
await detectProject();
|
|
14338
15599
|
providers.agents.forceRefresh();
|
|
14339
15600
|
providers.data.refresh();
|
|
14340
15601
|
providers.deployments.forceRefresh();
|
|
14341
15602
|
providers.sandboxes.forceRefresh();
|
|
14342
|
-
|
|
15603
|
+
vscode28.window.showInformationMessage("Agentuity refreshed");
|
|
14343
15604
|
})
|
|
14344
15605
|
);
|
|
14345
15606
|
context.subscriptions.push(
|
|
14346
|
-
|
|
15607
|
+
vscode28.commands.registerCommand("agentuity.agents.refresh", () => {
|
|
14347
15608
|
void providers.agents.forceRefresh();
|
|
14348
15609
|
})
|
|
14349
15610
|
);
|
|
14350
15611
|
context.subscriptions.push(
|
|
14351
|
-
|
|
15612
|
+
vscode28.commands.registerCommand("agentuity.deployments.refresh", () => {
|
|
14352
15613
|
void providers.deployments.forceRefresh();
|
|
14353
15614
|
})
|
|
14354
15615
|
);
|
|
14355
15616
|
context.subscriptions.push(
|
|
14356
|
-
|
|
15617
|
+
vscode28.commands.registerCommand("agentuity.data.refresh", () => {
|
|
14357
15618
|
providers.data.refresh();
|
|
14358
15619
|
})
|
|
14359
15620
|
);
|
|
14360
15621
|
context.subscriptions.push(
|
|
14361
|
-
|
|
15622
|
+
vscode28.commands.registerCommand("agentuity.sandbox.refresh", () => {
|
|
14362
15623
|
void providers.sandboxes.forceRefresh();
|
|
14363
15624
|
})
|
|
14364
15625
|
);
|