omnara 1.0.3 → 1.0.4
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/bin.js +115 -76
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -67,6 +67,7 @@ __export(sdk_gen_exports, {
|
|
|
67
67
|
deleteSkill: () => deleteSkill,
|
|
68
68
|
deleteSkillGrant: () => deleteSkillGrant,
|
|
69
69
|
demoteSteeringInputToQueued: () => demoteSteeringInputToQueued,
|
|
70
|
+
downloadDaemonArtifact: () => downloadDaemonArtifact,
|
|
70
71
|
endMachineDaemonRuntime: () => endMachineDaemonRuntime,
|
|
71
72
|
getActor: () => getActor,
|
|
72
73
|
getAgent: () => getAgent,
|
|
@@ -991,8 +992,15 @@ var zCreatedResourceListSort = z.enum([
|
|
|
991
992
|
"-created_at",
|
|
992
993
|
"created_at"
|
|
993
994
|
]).default("-created_at");
|
|
995
|
+
var zAgentConfigErrorIssue = z.object({
|
|
996
|
+
path: z.string(),
|
|
997
|
+
message: z.string(),
|
|
998
|
+
line: z.int().gte(1).optional(),
|
|
999
|
+
column: z.int().gte(1).optional()
|
|
1000
|
+
});
|
|
994
1001
|
var zError = z.object({
|
|
995
1002
|
error: z.string(),
|
|
1003
|
+
issues: z.array(zAgentConfigErrorIssue).optional(),
|
|
996
1004
|
code: z.enum([
|
|
997
1005
|
"invalid_request",
|
|
998
1006
|
"unauthorized",
|
|
@@ -4035,6 +4043,11 @@ var zUploadDaemonArtifactQuery = z.object({
|
|
|
4035
4043
|
filename: z.string().min(1).max(255)
|
|
4036
4044
|
});
|
|
4037
4045
|
var zUploadDaemonArtifactResponse = zUploadArtifactResponse;
|
|
4046
|
+
var zDownloadDaemonArtifactPath = z.object({
|
|
4047
|
+
toolCallID: zToolCallId,
|
|
4048
|
+
artifactID: zArtifactId
|
|
4049
|
+
});
|
|
4050
|
+
var zDownloadDaemonArtifactResponse = z.string();
|
|
4038
4051
|
|
|
4039
4052
|
// ../sdk/src/validate-response.ts
|
|
4040
4053
|
function valueAt(data, path) {
|
|
@@ -6491,6 +6504,16 @@ var uploadDaemonArtifact = (options) => (options.client ?? client).post({
|
|
|
6491
6504
|
...options.headers
|
|
6492
6505
|
}
|
|
6493
6506
|
});
|
|
6507
|
+
var downloadDaemonArtifact = (options) => (options.client ?? client).get({
|
|
6508
|
+
responseValidator: async (data) => await validateResponse(zDownloadDaemonArtifactResponse, data),
|
|
6509
|
+
security: [{
|
|
6510
|
+
key: "machineDaemonAuth",
|
|
6511
|
+
scheme: "bearer",
|
|
6512
|
+
type: "http"
|
|
6513
|
+
}],
|
|
6514
|
+
url: "/api/v1/daemon/tool-calls/{toolCallID}/artifacts/{artifactID}/content",
|
|
6515
|
+
...options
|
|
6516
|
+
});
|
|
6494
6517
|
|
|
6495
6518
|
// ../sdk/src/auth.ts
|
|
6496
6519
|
function bearerToken(token) {
|
|
@@ -6503,17 +6526,33 @@ function bearerToken(token) {
|
|
|
6503
6526
|
};
|
|
6504
6527
|
}
|
|
6505
6528
|
|
|
6529
|
+
// ../sdk/src/cli-login-token.ts
|
|
6530
|
+
var cliLoginTokenPrefix = "Omnara CLI";
|
|
6531
|
+
var cliLoginTokenHostSeparator = " on ";
|
|
6532
|
+
function cliLoginTokenName(hostName) {
|
|
6533
|
+
if (hostName === void 0) return cliLoginTokenPrefix;
|
|
6534
|
+
return `${cliLoginTokenPrefix}${cliLoginTokenHostSeparator}${hostName}`;
|
|
6535
|
+
}
|
|
6536
|
+
|
|
6506
6537
|
// ../sdk/src/errors.ts
|
|
6538
|
+
import * as z2 from "zod";
|
|
6539
|
+
var errorIssuesSchema = z2.object({ issues: z2.array(zAgentConfigErrorIssue).optional() });
|
|
6540
|
+
function issuesFromBody(body) {
|
|
6541
|
+
const parsed = errorIssuesSchema.safeParse(body);
|
|
6542
|
+
return parsed.success ? parsed.data.issues ?? [] : [];
|
|
6543
|
+
}
|
|
6507
6544
|
var ApiError = class _ApiError extends Error {
|
|
6508
6545
|
status;
|
|
6509
6546
|
code;
|
|
6510
6547
|
body;
|
|
6548
|
+
issues;
|
|
6511
6549
|
constructor(status, message, code, body) {
|
|
6512
6550
|
super(message);
|
|
6513
6551
|
this.name = "ApiError";
|
|
6514
6552
|
this.status = status;
|
|
6515
6553
|
this.code = code;
|
|
6516
6554
|
this.body = body;
|
|
6555
|
+
this.issues = issuesFromBody(body);
|
|
6517
6556
|
}
|
|
6518
6557
|
static async fromResponse(response) {
|
|
6519
6558
|
let message = `request failed with status ${response.status}`;
|
|
@@ -6590,24 +6629,24 @@ function createOmnaraClient(options = {}) {
|
|
|
6590
6629
|
}
|
|
6591
6630
|
|
|
6592
6631
|
// ../sdk/src/device.ts
|
|
6593
|
-
import * as
|
|
6594
|
-
var zDeviceAuthStartResponse =
|
|
6595
|
-
device_code:
|
|
6596
|
-
user_code:
|
|
6597
|
-
verification_uri:
|
|
6598
|
-
verification_uri_complete:
|
|
6599
|
-
expires_in:
|
|
6600
|
-
interval:
|
|
6632
|
+
import * as z3 from "zod";
|
|
6633
|
+
var zDeviceAuthStartResponse = z3.object({
|
|
6634
|
+
device_code: z3.string().min(1),
|
|
6635
|
+
user_code: z3.string().min(1),
|
|
6636
|
+
verification_uri: z3.string().min(1),
|
|
6637
|
+
verification_uri_complete: z3.string().min(1),
|
|
6638
|
+
expires_in: z3.number().int().positive(),
|
|
6639
|
+
interval: z3.number().int().positive()
|
|
6601
6640
|
});
|
|
6602
|
-
var zDeviceAuthWaitingResponse =
|
|
6603
|
-
interval:
|
|
6641
|
+
var zDeviceAuthWaitingResponse = z3.object({
|
|
6642
|
+
interval: z3.number().int().positive()
|
|
6604
6643
|
});
|
|
6605
|
-
var zDeviceAuthFailureResponse =
|
|
6606
|
-
error:
|
|
6644
|
+
var zDeviceAuthFailureResponse = z3.object({
|
|
6645
|
+
error: z3.enum(["access_denied", "expired_token"])
|
|
6607
6646
|
});
|
|
6608
|
-
var zDeviceAuthApprovedResponse =
|
|
6609
|
-
access_token:
|
|
6610
|
-
token_type:
|
|
6647
|
+
var zDeviceAuthApprovedResponse = z3.object({
|
|
6648
|
+
access_token: z3.string().min(1),
|
|
6649
|
+
token_type: z3.string()
|
|
6611
6650
|
});
|
|
6612
6651
|
var DEVICE_AUTH_FAILURE_MESSAGES = {
|
|
6613
6652
|
access_denied: "the login request was denied",
|
|
@@ -6681,14 +6720,14 @@ async function pollDeviceAuthToken(options) {
|
|
|
6681
6720
|
}
|
|
6682
6721
|
|
|
6683
6722
|
// src/config.ts
|
|
6684
|
-
import * as
|
|
6723
|
+
import * as z5 from "zod";
|
|
6685
6724
|
|
|
6686
6725
|
// src/interactive.ts
|
|
6687
6726
|
import { isCancel, select } from "@clack/prompts";
|
|
6688
6727
|
|
|
6689
6728
|
// src/output.ts
|
|
6690
|
-
import * as
|
|
6691
|
-
var zRenderValue =
|
|
6729
|
+
import * as z4 from "zod";
|
|
6730
|
+
var zRenderValue = z4.json();
|
|
6692
6731
|
var PREFERRED_LEADING_COLUMNS = ["id", "name"];
|
|
6693
6732
|
var HIDDEN_TABLE_COLUMNS = /* @__PURE__ */ new Set(["org_id", "project_id"]);
|
|
6694
6733
|
var useColor = process.stdout.isTTY && process.env.NO_COLOR === void 0;
|
|
@@ -6860,9 +6899,9 @@ async function runCliAction(action) {
|
|
|
6860
6899
|
} catch (error) {
|
|
6861
6900
|
if (error instanceof CliInputError) {
|
|
6862
6901
|
console.error(`error: ${error.message}`);
|
|
6863
|
-
} else if (error instanceof
|
|
6902
|
+
} else if (error instanceof z4.ZodError) {
|
|
6864
6903
|
console.error(`error: unexpected response shape:
|
|
6865
|
-
${
|
|
6904
|
+
${z4.prettifyError(error)}`);
|
|
6866
6905
|
} else if (error instanceof ApiError) {
|
|
6867
6906
|
const code = error.code ? ` [${error.code}]` : "";
|
|
6868
6907
|
console.error(`error: API ${error.status}${code}: ${error.message}`);
|
|
@@ -6920,9 +6959,9 @@ async function promptProjectSelection(client2, orgId) {
|
|
|
6920
6959
|
|
|
6921
6960
|
// src/config.ts
|
|
6922
6961
|
var DEFAULT_BASE_URL = "https://app.omnara.com";
|
|
6923
|
-
var zConfigFile =
|
|
6924
|
-
base_url:
|
|
6925
|
-
token:
|
|
6962
|
+
var zConfigFile = z5.looseObject({
|
|
6963
|
+
base_url: z5.url().optional(),
|
|
6964
|
+
token: z5.string().min(1).optional(),
|
|
6926
6965
|
org_id: zOrganizationId.optional(),
|
|
6927
6966
|
project_id: zProjectId.optional()
|
|
6928
6967
|
});
|
|
@@ -6935,12 +6974,12 @@ function warnConfigIgnored(message) {
|
|
|
6935
6974
|
warnedAboutConfig = true;
|
|
6936
6975
|
console.error(message);
|
|
6937
6976
|
}
|
|
6938
|
-
var zConfigContents =
|
|
6977
|
+
var zConfigContents = z5.string().transform((raw, ctx) => {
|
|
6939
6978
|
try {
|
|
6940
6979
|
return JSON.parse(raw);
|
|
6941
6980
|
} catch (error) {
|
|
6942
6981
|
ctx.addIssue(error instanceof Error ? error.message : String(error));
|
|
6943
|
-
return
|
|
6982
|
+
return z5.NEVER;
|
|
6944
6983
|
}
|
|
6945
6984
|
}).pipe(zConfigFile);
|
|
6946
6985
|
function loadConfigFile() {
|
|
@@ -6952,7 +6991,7 @@ function readConfigFile() {
|
|
|
6952
6991
|
const result = loadConfigFile();
|
|
6953
6992
|
if (result.success) return result.data;
|
|
6954
6993
|
warnConfigIgnored(
|
|
6955
|
-
`warning: ignoring unreadable config at ${configFilePath()}: ${
|
|
6994
|
+
`warning: ignoring unreadable config at ${configFilePath()}: ${z5.prettifyError(result.error)}`
|
|
6956
6995
|
);
|
|
6957
6996
|
return {};
|
|
6958
6997
|
}
|
|
@@ -6960,7 +6999,7 @@ function readConfigFileForUpdate() {
|
|
|
6960
6999
|
const result = loadConfigFile();
|
|
6961
7000
|
if (result.success) return result.data;
|
|
6962
7001
|
throw new CliInputError(
|
|
6963
|
-
`refusing to modify unreadable config at ${configFilePath()} (fix or delete it first): ${
|
|
7002
|
+
`refusing to modify unreadable config at ${configFilePath()} (fix or delete it first): ${z5.prettifyError(result.error)}`
|
|
6964
7003
|
);
|
|
6965
7004
|
}
|
|
6966
7005
|
function updateConfigFile(patch) {
|
|
@@ -6972,7 +7011,7 @@ function updateConfigFile(patch) {
|
|
|
6972
7011
|
const result = zConfigFile.safeParse(merged);
|
|
6973
7012
|
if (!result.success) {
|
|
6974
7013
|
throw new CliInputError(`refusing to save invalid config:
|
|
6975
|
-
${
|
|
7014
|
+
${z5.prettifyError(result.error)}`);
|
|
6976
7015
|
}
|
|
6977
7016
|
mkdirSync(dirname(configFilePath()), { recursive: true, mode: 448 });
|
|
6978
7017
|
writeFileSync(configFilePath(), `${JSON.stringify(result.data, null, 2)}
|
|
@@ -7042,10 +7081,10 @@ function registerConfigCommand(program2, cli) {
|
|
|
7042
7081
|
|
|
7043
7082
|
// src/factory.ts
|
|
7044
7083
|
import { InvalidArgumentError } from "commander";
|
|
7045
|
-
import * as
|
|
7084
|
+
import * as z7 from "zod";
|
|
7046
7085
|
|
|
7047
7086
|
// src/flags.ts
|
|
7048
|
-
import * as
|
|
7087
|
+
import * as z6 from "zod";
|
|
7049
7088
|
function kebabCase(name) {
|
|
7050
7089
|
return name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replaceAll("_", "-").toLowerCase();
|
|
7051
7090
|
}
|
|
@@ -7162,7 +7201,7 @@ function finalizeFlag(draft) {
|
|
|
7162
7201
|
};
|
|
7163
7202
|
}
|
|
7164
7203
|
function deriveFlags(schema) {
|
|
7165
|
-
const jsonSchema =
|
|
7204
|
+
const jsonSchema = z6.toJSONSchema(schema, { io: "input" });
|
|
7166
7205
|
const drafts = /* @__PURE__ */ new Map();
|
|
7167
7206
|
collectDrafts(drafts, jsonSchema, [], false);
|
|
7168
7207
|
return [...drafts.values()].map(finalizeFlag);
|
|
@@ -7343,7 +7382,7 @@ function parseWithSchema(schema, value, label) {
|
|
|
7343
7382
|
const result = schema.safeParse(value);
|
|
7344
7383
|
if (!result.success) {
|
|
7345
7384
|
throw new CliInputError(`invalid ${label}:
|
|
7346
|
-
${
|
|
7385
|
+
${z7.prettifyError(result.error)}`);
|
|
7347
7386
|
}
|
|
7348
7387
|
return result.data;
|
|
7349
7388
|
}
|
|
@@ -7351,7 +7390,7 @@ async function callOperation(spec, input) {
|
|
|
7351
7390
|
const result = await spec.fn(input);
|
|
7352
7391
|
return result.data;
|
|
7353
7392
|
}
|
|
7354
|
-
var zBodyObject =
|
|
7393
|
+
var zBodyObject = z7.looseObject({});
|
|
7355
7394
|
function deepMerge(base, patch) {
|
|
7356
7395
|
const merged = { ...base };
|
|
7357
7396
|
for (const [key, value] of Object.entries(patch)) {
|
|
@@ -7488,7 +7527,7 @@ function registerGroup(program2, config2, group) {
|
|
|
7488
7527
|
// src/login.ts
|
|
7489
7528
|
import { hostname } from "node:os";
|
|
7490
7529
|
import { intro as intro2, log as log2, note as note2, outro as outro2, spinner as spinner2 } from "@clack/prompts";
|
|
7491
|
-
import * as
|
|
7530
|
+
import * as z8 from "zod";
|
|
7492
7531
|
|
|
7493
7532
|
// src/browser.ts
|
|
7494
7533
|
import { spawn } from "node:child_process";
|
|
@@ -7587,12 +7626,12 @@ function plainReporter2() {
|
|
|
7587
7626
|
};
|
|
7588
7627
|
}
|
|
7589
7628
|
function loginTokenName(explicit, hostName) {
|
|
7590
|
-
const candidate = explicit ??
|
|
7629
|
+
const candidate = explicit ?? cliLoginTokenName(hostName);
|
|
7591
7630
|
const result = zResourceName.safeParse(candidate);
|
|
7592
7631
|
if (result.success) return result.data;
|
|
7593
|
-
if (explicit === void 0) return
|
|
7632
|
+
if (explicit === void 0) return cliLoginTokenName();
|
|
7594
7633
|
throw new CliInputError(`invalid token name:
|
|
7595
|
-
${
|
|
7634
|
+
${z8.prettifyError(result.error)}`);
|
|
7596
7635
|
}
|
|
7597
7636
|
function registerLoginCommand(program2, cli) {
|
|
7598
7637
|
program2.command("login").description("Log in via the browser and save an API token").option("--no-browser", "print the approval URL instead of opening a browser").option("--token-name <name>", "name for the created API token").action(async (options) => {
|
|
@@ -7672,16 +7711,16 @@ function registerLoginCommand(program2, cli) {
|
|
|
7672
7711
|
}
|
|
7673
7712
|
|
|
7674
7713
|
// src/manifest.ts
|
|
7675
|
-
import * as
|
|
7714
|
+
import * as z15 from "zod";
|
|
7676
7715
|
|
|
7677
7716
|
// src/config-attachment.ts
|
|
7678
7717
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
7679
|
-
import * as
|
|
7680
|
-
var zConfigSourceAttachment =
|
|
7681
|
-
file:
|
|
7682
|
-
source:
|
|
7718
|
+
import * as z9 from "zod";
|
|
7719
|
+
var zConfigSourceAttachment = z9.object({
|
|
7720
|
+
file: z9.string().min(1).optional().describe("path to an agent config file (.yaml, .yml, or .json)"),
|
|
7721
|
+
source: z9.string().min(1).optional().describe("inline agent config source (YAML or JSON)")
|
|
7683
7722
|
});
|
|
7684
|
-
var zConfigAttachment =
|
|
7723
|
+
var zConfigAttachment = z9.object({
|
|
7685
7724
|
config: zAgentConfigId.optional().describe("existing agent config ID"),
|
|
7686
7725
|
...zConfigSourceAttachment.shape
|
|
7687
7726
|
});
|
|
@@ -7722,9 +7761,9 @@ function renderConfigSource(attachment) {
|
|
|
7722
7761
|
}
|
|
7723
7762
|
throw new CliInputError(SOURCE_HINT);
|
|
7724
7763
|
}
|
|
7725
|
-
var zProjectScope =
|
|
7726
|
-
orgID:
|
|
7727
|
-
projectID:
|
|
7764
|
+
var zProjectScope = z9.object({
|
|
7765
|
+
orgID: z9.string().min(1),
|
|
7766
|
+
projectID: z9.string().min(1)
|
|
7728
7767
|
});
|
|
7729
7768
|
async function resolveConfigId(client2, path, attachment) {
|
|
7730
7769
|
requireExactlyOne([attachment.config, attachment.file, attachment.source], ATTACHMENT_HINT);
|
|
@@ -7736,7 +7775,7 @@ async function resolveConfigId(client2, path, attachment) {
|
|
|
7736
7775
|
});
|
|
7737
7776
|
return data.id;
|
|
7738
7777
|
}
|
|
7739
|
-
var zProfilePath = zProjectScope.extend({ agentProfileID:
|
|
7778
|
+
var zProfilePath = zProjectScope.extend({ agentProfileID: z9.string().min(1) });
|
|
7740
7779
|
async function currentProfileConfigId(client2, path) {
|
|
7741
7780
|
const { data } = await sdk_gen_exports.getAgentProfile({ client: client2, path: zProfilePath.parse(path) });
|
|
7742
7781
|
return data.current_config_id;
|
|
@@ -7772,7 +7811,7 @@ import { spawn as spawn2, spawnSync } from "node:child_process";
|
|
|
7772
7811
|
import { accessSync, constants, existsSync as existsSync2, readdirSync, readFileSync as readFileSync3 } from "node:fs";
|
|
7773
7812
|
import { homedir as homedir2 } from "node:os";
|
|
7774
7813
|
import { basename, dirname as dirname2, isAbsolute, join as join2, resolve } from "node:path";
|
|
7775
|
-
import * as
|
|
7814
|
+
import * as z10 from "zod";
|
|
7776
7815
|
var zMachineSetupBody = zConnectByoMachineRequest;
|
|
7777
7816
|
async function connectMachine(context) {
|
|
7778
7817
|
const { client: client2, path, body, report } = context;
|
|
@@ -7806,9 +7845,9 @@ var daemonConfigFileName = "daemon.json";
|
|
|
7806
7845
|
var installLockFileName = "install.lock";
|
|
7807
7846
|
var daemonLockFileName = "daemon.lock";
|
|
7808
7847
|
var daemonLockPollMs = 250;
|
|
7809
|
-
var zDaemonConfigFile =
|
|
7810
|
-
machine_id:
|
|
7811
|
-
api_url:
|
|
7848
|
+
var zDaemonConfigFile = z10.looseObject({
|
|
7849
|
+
machine_id: z10.string().optional(),
|
|
7850
|
+
api_url: z10.string().optional()
|
|
7812
7851
|
});
|
|
7813
7852
|
function daemonHome() {
|
|
7814
7853
|
const override = process.env.OMNARA_HOME;
|
|
@@ -8083,10 +8122,10 @@ function runInstaller(report, baseUrl, token, machineId, home) {
|
|
|
8083
8122
|
|
|
8084
8123
|
// src/mcp-add.ts
|
|
8085
8124
|
import { isMap, isScalar as isScalar2, parseDocument } from "yaml";
|
|
8086
|
-
import * as
|
|
8125
|
+
import * as z12 from "zod";
|
|
8087
8126
|
|
|
8088
8127
|
// src/mcp-oauth.ts
|
|
8089
|
-
import * as
|
|
8128
|
+
import * as z11 from "zod";
|
|
8090
8129
|
|
|
8091
8130
|
// src/poll.ts
|
|
8092
8131
|
var POLL_INTERVAL_SECONDS = 2;
|
|
@@ -8134,7 +8173,7 @@ async function authorizeMcpOAuthSecret(options) {
|
|
|
8134
8173
|
}
|
|
8135
8174
|
});
|
|
8136
8175
|
}
|
|
8137
|
-
var zBrowserFlag =
|
|
8176
|
+
var zBrowserFlag = z11.boolean().default(true).describe("open the authorization URL in a browser");
|
|
8138
8177
|
function openAuthorizationUrl(report, title, url3, browser) {
|
|
8139
8178
|
report.url(title, url3);
|
|
8140
8179
|
if (browser) {
|
|
@@ -8170,7 +8209,7 @@ async function runMcpOAuth(context) {
|
|
|
8170
8209
|
// src/mcp-add.ts
|
|
8171
8210
|
var SERVER_KEY_PATTERN = /^[a-zA-Z][a-zA-Z0-9-]{0,31}$/;
|
|
8172
8211
|
var zMcpAddBody = zMcpoAuthStartRequest.omit({ owner: true, name: true }).extend({
|
|
8173
|
-
server_name:
|
|
8212
|
+
server_name: z12.string().regex(
|
|
8174
8213
|
SERVER_KEY_PATTERN,
|
|
8175
8214
|
"must start with a letter and contain at most 32 letters, digits, or hyphens"
|
|
8176
8215
|
).describe("MCP server key used in the agent config"),
|
|
@@ -8183,7 +8222,7 @@ function targetLabel(target) {
|
|
|
8183
8222
|
function serverEntry(url3, secretId) {
|
|
8184
8223
|
return { url: url3, auth: { type: "oauth", secret_id: secretId } };
|
|
8185
8224
|
}
|
|
8186
|
-
var zJsonRecord =
|
|
8225
|
+
var zJsonRecord = z12.record(z12.string(), z12.json());
|
|
8187
8226
|
function prepareJsonConfig(config2, serverName, mcpUrl) {
|
|
8188
8227
|
let parsedJson;
|
|
8189
8228
|
try {
|
|
@@ -8350,10 +8389,10 @@ function runProfileMcpAdd(context) {
|
|
|
8350
8389
|
import { readdirSync as readdirSync2, readFileSync as readFileSync4, statSync } from "node:fs";
|
|
8351
8390
|
import { basename as basename2, dirname as dirname3, join as join3, resolve as resolve2 } from "node:path";
|
|
8352
8391
|
import * as tar from "tar";
|
|
8353
|
-
import * as
|
|
8354
|
-
var zCreateSkillCliBody =
|
|
8392
|
+
import * as z13 from "zod";
|
|
8393
|
+
var zCreateSkillCliBody = z13.object({
|
|
8355
8394
|
owner: zSkillOwnerInput,
|
|
8356
|
-
archive:
|
|
8395
|
+
archive: z13.string().min(1).describe("path to a skill directory (packed automatically) or a .zip/.tar.gz archive")
|
|
8357
8396
|
});
|
|
8358
8397
|
var ARCHIVE_SUFFIXES = [".zip", ".tar.gz", ".tgz"];
|
|
8359
8398
|
function assertPackable(dir) {
|
|
@@ -8395,16 +8434,16 @@ async function loadSkillArchive(archivePath) {
|
|
|
8395
8434
|
}
|
|
8396
8435
|
|
|
8397
8436
|
// src/slack-integration.ts
|
|
8398
|
-
import * as
|
|
8399
|
-
var zSlackBody =
|
|
8400
|
-
app_name:
|
|
8401
|
-
app_configuration_token:
|
|
8402
|
-
icon_filename:
|
|
8403
|
-
icon_data_base64:
|
|
8404
|
-
client_id:
|
|
8405
|
-
client_secret:
|
|
8406
|
-
signing_secret:
|
|
8407
|
-
return_to:
|
|
8437
|
+
import * as z14 from "zod";
|
|
8438
|
+
var zSlackBody = z14.object({
|
|
8439
|
+
app_name: z14.string().optional().describe("name for a new Slack app"),
|
|
8440
|
+
app_configuration_token: z14.string().optional().describe("Slack app configuration token for a new app"),
|
|
8441
|
+
icon_filename: z14.string().optional().describe("filename for the new Slack app icon"),
|
|
8442
|
+
icon_data_base64: z14.string().optional().describe("base64-encoded Slack app icon"),
|
|
8443
|
+
client_id: z14.string().optional().describe("existing Slack app client ID"),
|
|
8444
|
+
client_secret: z14.string().optional().describe("existing Slack app client secret"),
|
|
8445
|
+
signing_secret: z14.string().optional().describe("existing Slack app signing secret"),
|
|
8446
|
+
return_to: z14.string().optional().describe("console-relative path opened after authorization"),
|
|
8408
8447
|
browser: zBrowserFlag
|
|
8409
8448
|
});
|
|
8410
8449
|
function parseRequest(body) {
|
|
@@ -8433,7 +8472,7 @@ function parseRequest(body) {
|
|
|
8433
8472
|
if (!result2.success) {
|
|
8434
8473
|
throw new CliInputError(
|
|
8435
8474
|
`invalid existing Slack app parameters:
|
|
8436
|
-
${
|
|
8475
|
+
${z14.prettifyError(result2.error)}`
|
|
8437
8476
|
);
|
|
8438
8477
|
}
|
|
8439
8478
|
return { kind: "existing-app", body: result2.data };
|
|
@@ -8455,7 +8494,7 @@ ${z13.prettifyError(result2.error)}`
|
|
|
8455
8494
|
if (!result.success) {
|
|
8456
8495
|
throw new CliInputError(
|
|
8457
8496
|
`invalid Slack app parameters:
|
|
8458
|
-
${
|
|
8497
|
+
${z14.prettifyError(result.error)}
|
|
8459
8498
|
Pass --app-name and --app-configuration-token, or existing app credentials.`
|
|
8460
8499
|
);
|
|
8461
8500
|
}
|
|
@@ -8550,7 +8589,7 @@ var commandGroups = [
|
|
|
8550
8589
|
body: zConfigAttachment.extend({
|
|
8551
8590
|
profile: zAgentProfileId.optional(),
|
|
8552
8591
|
name: zAgentName.optional(),
|
|
8553
|
-
message:
|
|
8592
|
+
message: z15.string().optional()
|
|
8554
8593
|
}),
|
|
8555
8594
|
transformBody: async ({ profile, name, message, ...attachment }, { client: client2, path }) => ({
|
|
8556
8595
|
profile,
|
|
@@ -8591,7 +8630,7 @@ var commandGroups = [
|
|
|
8591
8630
|
flowOp({
|
|
8592
8631
|
verb: "mcp-add",
|
|
8593
8632
|
summary: "Create an OAuth secret and add an MCP server to an agent",
|
|
8594
|
-
path:
|
|
8633
|
+
path: z15.object({
|
|
8595
8634
|
orgID: zOrganizationId,
|
|
8596
8635
|
projectID: zProjectId,
|
|
8597
8636
|
agentID: zAgentId
|
|
@@ -9060,7 +9099,7 @@ var commandGroups = [
|
|
|
9060
9099
|
flowOp({
|
|
9061
9100
|
verb: "mcp-oauth",
|
|
9062
9101
|
summary: "Create a secret through an MCP server OAuth flow",
|
|
9063
|
-
path:
|
|
9102
|
+
path: z15.object({ orgID: zOrganizationId }),
|
|
9064
9103
|
body: zMcpOAuthBody,
|
|
9065
9104
|
run: runMcpOAuth
|
|
9066
9105
|
})
|
|
@@ -9174,7 +9213,7 @@ var commandGroups = [
|
|
|
9174
9213
|
flowOp({
|
|
9175
9214
|
verb: "mcp-add",
|
|
9176
9215
|
summary: "Create an OAuth secret and add an MCP server to an agent profile",
|
|
9177
|
-
path:
|
|
9216
|
+
path: z15.object({
|
|
9178
9217
|
orgID: zOrganizationId,
|
|
9179
9218
|
projectID: zProjectId,
|
|
9180
9219
|
agentProfileID: zAgentProfileId
|
|
@@ -9186,7 +9225,7 @@ var commandGroups = [
|
|
|
9186
9225
|
verb: "slack",
|
|
9187
9226
|
aliases: ["slack-setup"],
|
|
9188
9227
|
summary: "Connect Slack to an agent profile through OAuth",
|
|
9189
|
-
path:
|
|
9228
|
+
path: z15.object({
|
|
9190
9229
|
orgID: zOrganizationId,
|
|
9191
9230
|
projectID: zProjectId,
|
|
9192
9231
|
agentProfileID: zAgentProfileId
|
package/package.json
CHANGED