omnara 1.0.2 → 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 +295 -79
- 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,
|
|
@@ -98,6 +99,8 @@ __export(sdk_gen_exports, {
|
|
|
98
99
|
listEvents: () => listEvents,
|
|
99
100
|
listIntegrationInstalls: () => listIntegrationInstalls,
|
|
100
101
|
listMachinePools: () => listMachinePools,
|
|
102
|
+
listMcpServerTools: () => listMcpServerTools,
|
|
103
|
+
listMcpServers: () => listMcpServers,
|
|
101
104
|
listMemberProjectAccess: () => listMemberProjectAccess,
|
|
102
105
|
listModelProviderConfigs: () => listModelProviderConfigs,
|
|
103
106
|
listOrgApiKeyProjectAccess: () => listOrgApiKeyProjectAccess,
|
|
@@ -153,7 +156,8 @@ __export(sdk_gen_exports, {
|
|
|
153
156
|
updateOrgMember: () => updateOrgMember,
|
|
154
157
|
updateProjectMachinePoolGrant: () => updateProjectMachinePoolGrant,
|
|
155
158
|
updateProjectModelGrant: () => updateProjectModelGrant,
|
|
156
|
-
updateSecret: () => updateSecret
|
|
159
|
+
updateSecret: () => updateSecret,
|
|
160
|
+
uploadDaemonArtifact: () => uploadDaemonArtifact
|
|
157
161
|
});
|
|
158
162
|
|
|
159
163
|
// ../sdk/src/generated/core/bodySerializer.gen.ts
|
|
@@ -988,8 +992,15 @@ var zCreatedResourceListSort = z.enum([
|
|
|
988
992
|
"-created_at",
|
|
989
993
|
"created_at"
|
|
990
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
|
+
});
|
|
991
1001
|
var zError = z.object({
|
|
992
1002
|
error: z.string(),
|
|
1003
|
+
issues: z.array(zAgentConfigErrorIssue).optional(),
|
|
993
1004
|
code: z.enum([
|
|
994
1005
|
"invalid_request",
|
|
995
1006
|
"unauthorized",
|
|
@@ -1467,6 +1478,102 @@ var zToolCatalog = z.object({
|
|
|
1467
1478
|
custom_tool_permissions: zToolPermissionProfile,
|
|
1468
1479
|
mcp_tool_permissions: zToolPermissionProfile
|
|
1469
1480
|
});
|
|
1481
|
+
var zMcpRegistryHeader = z.object({
|
|
1482
|
+
name: z.string(),
|
|
1483
|
+
description: z.string().optional(),
|
|
1484
|
+
is_required: z.boolean(),
|
|
1485
|
+
is_secret: z.boolean()
|
|
1486
|
+
});
|
|
1487
|
+
var zMcpRegistryRemote = z.object({
|
|
1488
|
+
type: z.string(),
|
|
1489
|
+
url: z.string(),
|
|
1490
|
+
headers: z.array(zMcpRegistryHeader).optional()
|
|
1491
|
+
});
|
|
1492
|
+
var zMcpRegistryIcon = z.object({
|
|
1493
|
+
src: z.string(),
|
|
1494
|
+
mime_type: z.string().optional(),
|
|
1495
|
+
sizes: z.array(z.string()).optional(),
|
|
1496
|
+
theme: z.string().optional()
|
|
1497
|
+
});
|
|
1498
|
+
var zMcpRegistryServer = z.object({
|
|
1499
|
+
name: z.string(),
|
|
1500
|
+
title: z.string().optional(),
|
|
1501
|
+
description: z.string(),
|
|
1502
|
+
version: z.string(),
|
|
1503
|
+
website_url: z.string().optional(),
|
|
1504
|
+
status: z.string(),
|
|
1505
|
+
updated_at: z.iso.datetime({ offset: true }),
|
|
1506
|
+
remotes: z.array(zMcpRegistryRemote),
|
|
1507
|
+
icons: z.array(zMcpRegistryIcon)
|
|
1508
|
+
});
|
|
1509
|
+
var zListMcpServersResponse = z.object({
|
|
1510
|
+
data: z.array(zMcpRegistryServer),
|
|
1511
|
+
next_cursor: z.string().nullable()
|
|
1512
|
+
});
|
|
1513
|
+
var zMcpServerAuthNone = z.object({
|
|
1514
|
+
type: z.enum(["none"])
|
|
1515
|
+
});
|
|
1516
|
+
var zMcpServerAuthBearer = z.object({
|
|
1517
|
+
type: z.enum(["bearer"]),
|
|
1518
|
+
secret_id: zSecretId
|
|
1519
|
+
});
|
|
1520
|
+
var zMcpServerAuthOAuth = z.object({
|
|
1521
|
+
type: z.enum(["oauth"]),
|
|
1522
|
+
secret_id: zSecretId
|
|
1523
|
+
});
|
|
1524
|
+
var zMcpServerAuthSigV4 = z.object({
|
|
1525
|
+
type: z.enum(["sigv4"]),
|
|
1526
|
+
secret_id: zSecretId,
|
|
1527
|
+
service: z.string().min(1).max(64),
|
|
1528
|
+
region: z.string().min(1).max(64)
|
|
1529
|
+
});
|
|
1530
|
+
var zMcpServerAuth = z.discriminatedUnion("type", [
|
|
1531
|
+
zMcpServerAuthNone.extend({ type: z.literal("none") }),
|
|
1532
|
+
zMcpServerAuthBearer.extend({ type: z.literal("bearer") }),
|
|
1533
|
+
zMcpServerAuthOAuth.extend({ type: z.literal("oauth") }),
|
|
1534
|
+
zMcpServerAuthSigV4.extend({ type: z.literal("sigv4") })
|
|
1535
|
+
]);
|
|
1536
|
+
var zMcpServerToolsRequest = z.object({
|
|
1537
|
+
url: z.url().min(1).max(2048),
|
|
1538
|
+
auth: zMcpServerAuth
|
|
1539
|
+
});
|
|
1540
|
+
var zMcpServerAuthHint = z.object({
|
|
1541
|
+
type: z.enum(["oauth", "bearer"]),
|
|
1542
|
+
scopes: z.array(z.string()).optional(),
|
|
1543
|
+
authorization_server: z.string().optional()
|
|
1544
|
+
});
|
|
1545
|
+
var zMcpServerAuthRequiredError = z.object({
|
|
1546
|
+
error: z.string(),
|
|
1547
|
+
code: z.enum(["unprocessable"]),
|
|
1548
|
+
auth: zMcpServerAuthHint
|
|
1549
|
+
});
|
|
1550
|
+
var zMcpServerInfo = z.object({
|
|
1551
|
+
name: z.string(),
|
|
1552
|
+
version: z.string(),
|
|
1553
|
+
title: z.string().optional(),
|
|
1554
|
+
description: z.string().optional(),
|
|
1555
|
+
website_url: z.string().optional()
|
|
1556
|
+
});
|
|
1557
|
+
var zMcpServerToolAnnotations = z.object({
|
|
1558
|
+
title: z.string().optional(),
|
|
1559
|
+
read_only_hint: z.boolean().optional(),
|
|
1560
|
+
destructive_hint: z.boolean().optional(),
|
|
1561
|
+
idempotent_hint: z.boolean().optional(),
|
|
1562
|
+
open_world_hint: z.boolean().optional()
|
|
1563
|
+
});
|
|
1564
|
+
var zMcpServerTool = z.object({
|
|
1565
|
+
name: z.string(),
|
|
1566
|
+
title: z.string().optional(),
|
|
1567
|
+
description: z.string().optional(),
|
|
1568
|
+
input_schema: z.record(z.string(), z.unknown()),
|
|
1569
|
+
output_schema: z.record(z.string(), z.unknown()).optional(),
|
|
1570
|
+
annotations: zMcpServerToolAnnotations.optional()
|
|
1571
|
+
});
|
|
1572
|
+
var zMcpServerToolsResponse = z.object({
|
|
1573
|
+
protocol_version: z.string(),
|
|
1574
|
+
server_info: zMcpServerInfo,
|
|
1575
|
+
tools: z.array(zMcpServerTool)
|
|
1576
|
+
});
|
|
1470
1577
|
var zAgentConfigModel = z.object({
|
|
1471
1578
|
provider_config: zResourceName,
|
|
1472
1579
|
name: zResourceName,
|
|
@@ -1735,6 +1842,7 @@ var zInlineMediaContentBlock = z.object({
|
|
|
1735
1842
|
var zMediaRefContentBlock = z.object({
|
|
1736
1843
|
type: z.enum(["media_ref"]),
|
|
1737
1844
|
artifact_id: zArtifactId,
|
|
1845
|
+
exclude_from_model_context: z.boolean().optional(),
|
|
1738
1846
|
metadata: zContentBlockMetadata.optional()
|
|
1739
1847
|
});
|
|
1740
1848
|
var zReasoningContentBlock = z.object({
|
|
@@ -1777,6 +1885,7 @@ var zAgentInput = z.object({
|
|
|
1777
1885
|
delivery_mode: zAgentInputDeliveryMode,
|
|
1778
1886
|
input_kind: zAgentInputKind,
|
|
1779
1887
|
actor_id: zActorId.optional(),
|
|
1888
|
+
input_idempotency_key: z.string().optional(),
|
|
1780
1889
|
content_blocks: z.array(zAgentInputContentBlock).optional(),
|
|
1781
1890
|
queued_at: zTimestamp
|
|
1782
1891
|
});
|
|
@@ -2826,6 +2935,9 @@ var zBootstrapDaemonResponse = z.object({
|
|
|
2826
2935
|
installation_id: zInstallationId,
|
|
2827
2936
|
machine_id: zMachineId
|
|
2828
2937
|
});
|
|
2938
|
+
var zUploadArtifactResponse = z.object({
|
|
2939
|
+
artifact_id: zArtifactId
|
|
2940
|
+
});
|
|
2829
2941
|
var zCreateProjectRequest = z.object({
|
|
2830
2942
|
name: zResourceName
|
|
2831
2943
|
});
|
|
@@ -3281,6 +3393,18 @@ var zCreateAgentConfigPath = z.object({
|
|
|
3281
3393
|
});
|
|
3282
3394
|
var zCreateAgentConfigResponse = zAgentConfig;
|
|
3283
3395
|
var zGetToolCatalogResponse = zToolCatalog;
|
|
3396
|
+
var zListMcpServersQuery = z.object({
|
|
3397
|
+
q: z.string().max(200).optional(),
|
|
3398
|
+
remote_url: z.string().max(2048).optional(),
|
|
3399
|
+
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
3400
|
+
cursor: z.string().max(1024).optional()
|
|
3401
|
+
});
|
|
3402
|
+
var zListMcpServersResponse2 = zListMcpServersResponse;
|
|
3403
|
+
var zListMcpServerToolsPath = z.object({
|
|
3404
|
+
orgID: zOrganizationId,
|
|
3405
|
+
projectID: zProjectId
|
|
3406
|
+
});
|
|
3407
|
+
var zListMcpServerToolsResponse = zMcpServerToolsResponse;
|
|
3284
3408
|
var zGetAgentConfigPath = z.object({
|
|
3285
3409
|
orgID: z.string().regex(/^org_[a-z2-7]{26}$/),
|
|
3286
3410
|
projectID: z.string().regex(/^proj_[a-z2-7]{26}$/),
|
|
@@ -3911,6 +4035,19 @@ var zGetDaemonSkillArchiveQuery = z.object({
|
|
|
3911
4035
|
download_token: z.string().length(64)
|
|
3912
4036
|
});
|
|
3913
4037
|
var zGetDaemonSkillArchiveResponse = z.string();
|
|
4038
|
+
var zUploadDaemonArtifactBody = z.string();
|
|
4039
|
+
var zUploadDaemonArtifactPath = z.object({
|
|
4040
|
+
toolCallID: zToolCallId
|
|
4041
|
+
});
|
|
4042
|
+
var zUploadDaemonArtifactQuery = z.object({
|
|
4043
|
+
filename: z.string().min(1).max(255)
|
|
4044
|
+
});
|
|
4045
|
+
var zUploadDaemonArtifactResponse = zUploadArtifactResponse;
|
|
4046
|
+
var zDownloadDaemonArtifactPath = z.object({
|
|
4047
|
+
toolCallID: zToolCallId,
|
|
4048
|
+
artifactID: zArtifactId
|
|
4049
|
+
});
|
|
4050
|
+
var zDownloadDaemonArtifactResponse = z.string();
|
|
3914
4051
|
|
|
3915
4052
|
// ../sdk/src/validate-response.ts
|
|
3916
4053
|
function valueAt(data, path) {
|
|
@@ -4871,6 +5008,42 @@ var getToolCatalog = (options) => (options?.client ?? client).get({
|
|
|
4871
5008
|
url: "/api/v1/tool-catalog",
|
|
4872
5009
|
...options
|
|
4873
5010
|
});
|
|
5011
|
+
var listMcpServers = (options) => (options?.client ?? client).get({
|
|
5012
|
+
responseValidator: async (data) => await validateResponse(zListMcpServersResponse2, data),
|
|
5013
|
+
security: [{
|
|
5014
|
+
key: "bearerAuth",
|
|
5015
|
+
scheme: "bearer",
|
|
5016
|
+
type: "http"
|
|
5017
|
+
}, {
|
|
5018
|
+
in: "cookie",
|
|
5019
|
+
name: "__Host-omnara_session",
|
|
5020
|
+
type: "apiKey"
|
|
5021
|
+
}],
|
|
5022
|
+
url: "/api/v1/mcp-servers",
|
|
5023
|
+
...options
|
|
5024
|
+
});
|
|
5025
|
+
var listMcpServerTools = (options) => (options.client ?? client).post({
|
|
5026
|
+
responseValidator: async (data) => await validateResponse(zListMcpServerToolsResponse, data),
|
|
5027
|
+
security: [
|
|
5028
|
+
{
|
|
5029
|
+
key: "bearerAuth",
|
|
5030
|
+
scheme: "bearer",
|
|
5031
|
+
type: "http"
|
|
5032
|
+
},
|
|
5033
|
+
{
|
|
5034
|
+
in: "cookie",
|
|
5035
|
+
name: "__Host-omnara_session",
|
|
5036
|
+
type: "apiKey"
|
|
5037
|
+
},
|
|
5038
|
+
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5039
|
+
],
|
|
5040
|
+
url: "/api/v1/orgs/{orgID}/projects/{projectID}/mcp-servers/tools",
|
|
5041
|
+
...options,
|
|
5042
|
+
headers: {
|
|
5043
|
+
"Content-Type": "application/json",
|
|
5044
|
+
...options.headers
|
|
5045
|
+
}
|
|
5046
|
+
});
|
|
4874
5047
|
var getAgentConfig = (options) => (options.client ?? client).get({
|
|
4875
5048
|
responseValidator: async (data) => await validateResponse(zGetAgentConfigResponse, data),
|
|
4876
5049
|
security: [{
|
|
@@ -6316,6 +6489,31 @@ var getDaemonSkillArchive = (options) => (options.client ?? client).get({
|
|
|
6316
6489
|
url: "/api/v1/daemon/skills/{skillID}/archive",
|
|
6317
6490
|
...options
|
|
6318
6491
|
});
|
|
6492
|
+
var uploadDaemonArtifact = (options) => (options.client ?? client).post({
|
|
6493
|
+
bodySerializer: null,
|
|
6494
|
+
responseValidator: async (data) => await validateResponse(zUploadDaemonArtifactResponse, data),
|
|
6495
|
+
security: [{
|
|
6496
|
+
key: "machineDaemonAuth",
|
|
6497
|
+
scheme: "bearer",
|
|
6498
|
+
type: "http"
|
|
6499
|
+
}],
|
|
6500
|
+
url: "/api/v1/daemon/tool-calls/{toolCallID}/artifact",
|
|
6501
|
+
...options,
|
|
6502
|
+
headers: {
|
|
6503
|
+
"Content-Type": "application/octet-stream",
|
|
6504
|
+
...options.headers
|
|
6505
|
+
}
|
|
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
|
+
});
|
|
6319
6517
|
|
|
6320
6518
|
// ../sdk/src/auth.ts
|
|
6321
6519
|
function bearerToken(token) {
|
|
@@ -6328,15 +6526,33 @@ function bearerToken(token) {
|
|
|
6328
6526
|
};
|
|
6329
6527
|
}
|
|
6330
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
|
+
|
|
6331
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
|
+
}
|
|
6332
6544
|
var ApiError = class _ApiError extends Error {
|
|
6333
6545
|
status;
|
|
6334
6546
|
code;
|
|
6335
|
-
|
|
6547
|
+
body;
|
|
6548
|
+
issues;
|
|
6549
|
+
constructor(status, message, code, body) {
|
|
6336
6550
|
super(message);
|
|
6337
6551
|
this.name = "ApiError";
|
|
6338
6552
|
this.status = status;
|
|
6339
6553
|
this.code = code;
|
|
6554
|
+
this.body = body;
|
|
6555
|
+
this.issues = issuesFromBody(body);
|
|
6340
6556
|
}
|
|
6341
6557
|
static async fromResponse(response) {
|
|
6342
6558
|
let message = `request failed with status ${response.status}`;
|
|
@@ -6355,7 +6571,7 @@ var ApiError = class _ApiError extends Error {
|
|
|
6355
6571
|
code = data.code;
|
|
6356
6572
|
}
|
|
6357
6573
|
}
|
|
6358
|
-
return new _ApiError(response.status, message, code);
|
|
6574
|
+
return new _ApiError(response.status, message, code, data);
|
|
6359
6575
|
}
|
|
6360
6576
|
};
|
|
6361
6577
|
|
|
@@ -6413,24 +6629,24 @@ function createOmnaraClient(options = {}) {
|
|
|
6413
6629
|
}
|
|
6414
6630
|
|
|
6415
6631
|
// ../sdk/src/device.ts
|
|
6416
|
-
import * as
|
|
6417
|
-
var zDeviceAuthStartResponse =
|
|
6418
|
-
device_code:
|
|
6419
|
-
user_code:
|
|
6420
|
-
verification_uri:
|
|
6421
|
-
verification_uri_complete:
|
|
6422
|
-
expires_in:
|
|
6423
|
-
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()
|
|
6424
6640
|
});
|
|
6425
|
-
var zDeviceAuthWaitingResponse =
|
|
6426
|
-
interval:
|
|
6641
|
+
var zDeviceAuthWaitingResponse = z3.object({
|
|
6642
|
+
interval: z3.number().int().positive()
|
|
6427
6643
|
});
|
|
6428
|
-
var zDeviceAuthFailureResponse =
|
|
6429
|
-
error:
|
|
6644
|
+
var zDeviceAuthFailureResponse = z3.object({
|
|
6645
|
+
error: z3.enum(["access_denied", "expired_token"])
|
|
6430
6646
|
});
|
|
6431
|
-
var zDeviceAuthApprovedResponse =
|
|
6432
|
-
access_token:
|
|
6433
|
-
token_type:
|
|
6647
|
+
var zDeviceAuthApprovedResponse = z3.object({
|
|
6648
|
+
access_token: z3.string().min(1),
|
|
6649
|
+
token_type: z3.string()
|
|
6434
6650
|
});
|
|
6435
6651
|
var DEVICE_AUTH_FAILURE_MESSAGES = {
|
|
6436
6652
|
access_denied: "the login request was denied",
|
|
@@ -6504,14 +6720,14 @@ async function pollDeviceAuthToken(options) {
|
|
|
6504
6720
|
}
|
|
6505
6721
|
|
|
6506
6722
|
// src/config.ts
|
|
6507
|
-
import * as
|
|
6723
|
+
import * as z5 from "zod";
|
|
6508
6724
|
|
|
6509
6725
|
// src/interactive.ts
|
|
6510
6726
|
import { isCancel, select } from "@clack/prompts";
|
|
6511
6727
|
|
|
6512
6728
|
// src/output.ts
|
|
6513
|
-
import * as
|
|
6514
|
-
var zRenderValue =
|
|
6729
|
+
import * as z4 from "zod";
|
|
6730
|
+
var zRenderValue = z4.json();
|
|
6515
6731
|
var PREFERRED_LEADING_COLUMNS = ["id", "name"];
|
|
6516
6732
|
var HIDDEN_TABLE_COLUMNS = /* @__PURE__ */ new Set(["org_id", "project_id"]);
|
|
6517
6733
|
var useColor = process.stdout.isTTY && process.env.NO_COLOR === void 0;
|
|
@@ -6683,9 +6899,9 @@ async function runCliAction(action) {
|
|
|
6683
6899
|
} catch (error) {
|
|
6684
6900
|
if (error instanceof CliInputError) {
|
|
6685
6901
|
console.error(`error: ${error.message}`);
|
|
6686
|
-
} else if (error instanceof
|
|
6902
|
+
} else if (error instanceof z4.ZodError) {
|
|
6687
6903
|
console.error(`error: unexpected response shape:
|
|
6688
|
-
${
|
|
6904
|
+
${z4.prettifyError(error)}`);
|
|
6689
6905
|
} else if (error instanceof ApiError) {
|
|
6690
6906
|
const code = error.code ? ` [${error.code}]` : "";
|
|
6691
6907
|
console.error(`error: API ${error.status}${code}: ${error.message}`);
|
|
@@ -6743,9 +6959,9 @@ async function promptProjectSelection(client2, orgId) {
|
|
|
6743
6959
|
|
|
6744
6960
|
// src/config.ts
|
|
6745
6961
|
var DEFAULT_BASE_URL = "https://app.omnara.com";
|
|
6746
|
-
var zConfigFile =
|
|
6747
|
-
base_url:
|
|
6748
|
-
token:
|
|
6962
|
+
var zConfigFile = z5.looseObject({
|
|
6963
|
+
base_url: z5.url().optional(),
|
|
6964
|
+
token: z5.string().min(1).optional(),
|
|
6749
6965
|
org_id: zOrganizationId.optional(),
|
|
6750
6966
|
project_id: zProjectId.optional()
|
|
6751
6967
|
});
|
|
@@ -6758,12 +6974,12 @@ function warnConfigIgnored(message) {
|
|
|
6758
6974
|
warnedAboutConfig = true;
|
|
6759
6975
|
console.error(message);
|
|
6760
6976
|
}
|
|
6761
|
-
var zConfigContents =
|
|
6977
|
+
var zConfigContents = z5.string().transform((raw, ctx) => {
|
|
6762
6978
|
try {
|
|
6763
6979
|
return JSON.parse(raw);
|
|
6764
6980
|
} catch (error) {
|
|
6765
6981
|
ctx.addIssue(error instanceof Error ? error.message : String(error));
|
|
6766
|
-
return
|
|
6982
|
+
return z5.NEVER;
|
|
6767
6983
|
}
|
|
6768
6984
|
}).pipe(zConfigFile);
|
|
6769
6985
|
function loadConfigFile() {
|
|
@@ -6775,7 +6991,7 @@ function readConfigFile() {
|
|
|
6775
6991
|
const result = loadConfigFile();
|
|
6776
6992
|
if (result.success) return result.data;
|
|
6777
6993
|
warnConfigIgnored(
|
|
6778
|
-
`warning: ignoring unreadable config at ${configFilePath()}: ${
|
|
6994
|
+
`warning: ignoring unreadable config at ${configFilePath()}: ${z5.prettifyError(result.error)}`
|
|
6779
6995
|
);
|
|
6780
6996
|
return {};
|
|
6781
6997
|
}
|
|
@@ -6783,7 +6999,7 @@ function readConfigFileForUpdate() {
|
|
|
6783
6999
|
const result = loadConfigFile();
|
|
6784
7000
|
if (result.success) return result.data;
|
|
6785
7001
|
throw new CliInputError(
|
|
6786
|
-
`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)}`
|
|
6787
7003
|
);
|
|
6788
7004
|
}
|
|
6789
7005
|
function updateConfigFile(patch) {
|
|
@@ -6795,7 +7011,7 @@ function updateConfigFile(patch) {
|
|
|
6795
7011
|
const result = zConfigFile.safeParse(merged);
|
|
6796
7012
|
if (!result.success) {
|
|
6797
7013
|
throw new CliInputError(`refusing to save invalid config:
|
|
6798
|
-
${
|
|
7014
|
+
${z5.prettifyError(result.error)}`);
|
|
6799
7015
|
}
|
|
6800
7016
|
mkdirSync(dirname(configFilePath()), { recursive: true, mode: 448 });
|
|
6801
7017
|
writeFileSync(configFilePath(), `${JSON.stringify(result.data, null, 2)}
|
|
@@ -6865,10 +7081,10 @@ function registerConfigCommand(program2, cli) {
|
|
|
6865
7081
|
|
|
6866
7082
|
// src/factory.ts
|
|
6867
7083
|
import { InvalidArgumentError } from "commander";
|
|
6868
|
-
import * as
|
|
7084
|
+
import * as z7 from "zod";
|
|
6869
7085
|
|
|
6870
7086
|
// src/flags.ts
|
|
6871
|
-
import * as
|
|
7087
|
+
import * as z6 from "zod";
|
|
6872
7088
|
function kebabCase(name) {
|
|
6873
7089
|
return name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replaceAll("_", "-").toLowerCase();
|
|
6874
7090
|
}
|
|
@@ -6985,7 +7201,7 @@ function finalizeFlag(draft) {
|
|
|
6985
7201
|
};
|
|
6986
7202
|
}
|
|
6987
7203
|
function deriveFlags(schema) {
|
|
6988
|
-
const jsonSchema =
|
|
7204
|
+
const jsonSchema = z6.toJSONSchema(schema, { io: "input" });
|
|
6989
7205
|
const drafts = /* @__PURE__ */ new Map();
|
|
6990
7206
|
collectDrafts(drafts, jsonSchema, [], false);
|
|
6991
7207
|
return [...drafts.values()].map(finalizeFlag);
|
|
@@ -7166,7 +7382,7 @@ function parseWithSchema(schema, value, label) {
|
|
|
7166
7382
|
const result = schema.safeParse(value);
|
|
7167
7383
|
if (!result.success) {
|
|
7168
7384
|
throw new CliInputError(`invalid ${label}:
|
|
7169
|
-
${
|
|
7385
|
+
${z7.prettifyError(result.error)}`);
|
|
7170
7386
|
}
|
|
7171
7387
|
return result.data;
|
|
7172
7388
|
}
|
|
@@ -7174,7 +7390,7 @@ async function callOperation(spec, input) {
|
|
|
7174
7390
|
const result = await spec.fn(input);
|
|
7175
7391
|
return result.data;
|
|
7176
7392
|
}
|
|
7177
|
-
var zBodyObject =
|
|
7393
|
+
var zBodyObject = z7.looseObject({});
|
|
7178
7394
|
function deepMerge(base, patch) {
|
|
7179
7395
|
const merged = { ...base };
|
|
7180
7396
|
for (const [key, value] of Object.entries(patch)) {
|
|
@@ -7311,7 +7527,7 @@ function registerGroup(program2, config2, group) {
|
|
|
7311
7527
|
// src/login.ts
|
|
7312
7528
|
import { hostname } from "node:os";
|
|
7313
7529
|
import { intro as intro2, log as log2, note as note2, outro as outro2, spinner as spinner2 } from "@clack/prompts";
|
|
7314
|
-
import * as
|
|
7530
|
+
import * as z8 from "zod";
|
|
7315
7531
|
|
|
7316
7532
|
// src/browser.ts
|
|
7317
7533
|
import { spawn } from "node:child_process";
|
|
@@ -7410,12 +7626,12 @@ function plainReporter2() {
|
|
|
7410
7626
|
};
|
|
7411
7627
|
}
|
|
7412
7628
|
function loginTokenName(explicit, hostName) {
|
|
7413
|
-
const candidate = explicit ??
|
|
7629
|
+
const candidate = explicit ?? cliLoginTokenName(hostName);
|
|
7414
7630
|
const result = zResourceName.safeParse(candidate);
|
|
7415
7631
|
if (result.success) return result.data;
|
|
7416
|
-
if (explicit === void 0) return
|
|
7632
|
+
if (explicit === void 0) return cliLoginTokenName();
|
|
7417
7633
|
throw new CliInputError(`invalid token name:
|
|
7418
|
-
${
|
|
7634
|
+
${z8.prettifyError(result.error)}`);
|
|
7419
7635
|
}
|
|
7420
7636
|
function registerLoginCommand(program2, cli) {
|
|
7421
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) => {
|
|
@@ -7495,16 +7711,16 @@ function registerLoginCommand(program2, cli) {
|
|
|
7495
7711
|
}
|
|
7496
7712
|
|
|
7497
7713
|
// src/manifest.ts
|
|
7498
|
-
import * as
|
|
7714
|
+
import * as z15 from "zod";
|
|
7499
7715
|
|
|
7500
7716
|
// src/config-attachment.ts
|
|
7501
7717
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
7502
|
-
import * as
|
|
7503
|
-
var zConfigSourceAttachment =
|
|
7504
|
-
file:
|
|
7505
|
-
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)")
|
|
7506
7722
|
});
|
|
7507
|
-
var zConfigAttachment =
|
|
7723
|
+
var zConfigAttachment = z9.object({
|
|
7508
7724
|
config: zAgentConfigId.optional().describe("existing agent config ID"),
|
|
7509
7725
|
...zConfigSourceAttachment.shape
|
|
7510
7726
|
});
|
|
@@ -7545,9 +7761,9 @@ function renderConfigSource(attachment) {
|
|
|
7545
7761
|
}
|
|
7546
7762
|
throw new CliInputError(SOURCE_HINT);
|
|
7547
7763
|
}
|
|
7548
|
-
var zProjectScope =
|
|
7549
|
-
orgID:
|
|
7550
|
-
projectID:
|
|
7764
|
+
var zProjectScope = z9.object({
|
|
7765
|
+
orgID: z9.string().min(1),
|
|
7766
|
+
projectID: z9.string().min(1)
|
|
7551
7767
|
});
|
|
7552
7768
|
async function resolveConfigId(client2, path, attachment) {
|
|
7553
7769
|
requireExactlyOne([attachment.config, attachment.file, attachment.source], ATTACHMENT_HINT);
|
|
@@ -7559,7 +7775,7 @@ async function resolveConfigId(client2, path, attachment) {
|
|
|
7559
7775
|
});
|
|
7560
7776
|
return data.id;
|
|
7561
7777
|
}
|
|
7562
|
-
var zProfilePath = zProjectScope.extend({ agentProfileID:
|
|
7778
|
+
var zProfilePath = zProjectScope.extend({ agentProfileID: z9.string().min(1) });
|
|
7563
7779
|
async function currentProfileConfigId(client2, path) {
|
|
7564
7780
|
const { data } = await sdk_gen_exports.getAgentProfile({ client: client2, path: zProfilePath.parse(path) });
|
|
7565
7781
|
return data.current_config_id;
|
|
@@ -7595,7 +7811,7 @@ import { spawn as spawn2, spawnSync } from "node:child_process";
|
|
|
7595
7811
|
import { accessSync, constants, existsSync as existsSync2, readdirSync, readFileSync as readFileSync3 } from "node:fs";
|
|
7596
7812
|
import { homedir as homedir2 } from "node:os";
|
|
7597
7813
|
import { basename, dirname as dirname2, isAbsolute, join as join2, resolve } from "node:path";
|
|
7598
|
-
import * as
|
|
7814
|
+
import * as z10 from "zod";
|
|
7599
7815
|
var zMachineSetupBody = zConnectByoMachineRequest;
|
|
7600
7816
|
async function connectMachine(context) {
|
|
7601
7817
|
const { client: client2, path, body, report } = context;
|
|
@@ -7629,9 +7845,9 @@ var daemonConfigFileName = "daemon.json";
|
|
|
7629
7845
|
var installLockFileName = "install.lock";
|
|
7630
7846
|
var daemonLockFileName = "daemon.lock";
|
|
7631
7847
|
var daemonLockPollMs = 250;
|
|
7632
|
-
var zDaemonConfigFile =
|
|
7633
|
-
machine_id:
|
|
7634
|
-
api_url:
|
|
7848
|
+
var zDaemonConfigFile = z10.looseObject({
|
|
7849
|
+
machine_id: z10.string().optional(),
|
|
7850
|
+
api_url: z10.string().optional()
|
|
7635
7851
|
});
|
|
7636
7852
|
function daemonHome() {
|
|
7637
7853
|
const override = process.env.OMNARA_HOME;
|
|
@@ -7906,10 +8122,10 @@ function runInstaller(report, baseUrl, token, machineId, home) {
|
|
|
7906
8122
|
|
|
7907
8123
|
// src/mcp-add.ts
|
|
7908
8124
|
import { isMap, isScalar as isScalar2, parseDocument } from "yaml";
|
|
7909
|
-
import * as
|
|
8125
|
+
import * as z12 from "zod";
|
|
7910
8126
|
|
|
7911
8127
|
// src/mcp-oauth.ts
|
|
7912
|
-
import * as
|
|
8128
|
+
import * as z11 from "zod";
|
|
7913
8129
|
|
|
7914
8130
|
// src/poll.ts
|
|
7915
8131
|
var POLL_INTERVAL_SECONDS = 2;
|
|
@@ -7957,7 +8173,7 @@ async function authorizeMcpOAuthSecret(options) {
|
|
|
7957
8173
|
}
|
|
7958
8174
|
});
|
|
7959
8175
|
}
|
|
7960
|
-
var zBrowserFlag =
|
|
8176
|
+
var zBrowserFlag = z11.boolean().default(true).describe("open the authorization URL in a browser");
|
|
7961
8177
|
function openAuthorizationUrl(report, title, url3, browser) {
|
|
7962
8178
|
report.url(title, url3);
|
|
7963
8179
|
if (browser) {
|
|
@@ -7993,7 +8209,7 @@ async function runMcpOAuth(context) {
|
|
|
7993
8209
|
// src/mcp-add.ts
|
|
7994
8210
|
var SERVER_KEY_PATTERN = /^[a-zA-Z][a-zA-Z0-9-]{0,31}$/;
|
|
7995
8211
|
var zMcpAddBody = zMcpoAuthStartRequest.omit({ owner: true, name: true }).extend({
|
|
7996
|
-
server_name:
|
|
8212
|
+
server_name: z12.string().regex(
|
|
7997
8213
|
SERVER_KEY_PATTERN,
|
|
7998
8214
|
"must start with a letter and contain at most 32 letters, digits, or hyphens"
|
|
7999
8215
|
).describe("MCP server key used in the agent config"),
|
|
@@ -8006,7 +8222,7 @@ function targetLabel(target) {
|
|
|
8006
8222
|
function serverEntry(url3, secretId) {
|
|
8007
8223
|
return { url: url3, auth: { type: "oauth", secret_id: secretId } };
|
|
8008
8224
|
}
|
|
8009
|
-
var zJsonRecord =
|
|
8225
|
+
var zJsonRecord = z12.record(z12.string(), z12.json());
|
|
8010
8226
|
function prepareJsonConfig(config2, serverName, mcpUrl) {
|
|
8011
8227
|
let parsedJson;
|
|
8012
8228
|
try {
|
|
@@ -8173,10 +8389,10 @@ function runProfileMcpAdd(context) {
|
|
|
8173
8389
|
import { readdirSync as readdirSync2, readFileSync as readFileSync4, statSync } from "node:fs";
|
|
8174
8390
|
import { basename as basename2, dirname as dirname3, join as join3, resolve as resolve2 } from "node:path";
|
|
8175
8391
|
import * as tar from "tar";
|
|
8176
|
-
import * as
|
|
8177
|
-
var zCreateSkillCliBody =
|
|
8392
|
+
import * as z13 from "zod";
|
|
8393
|
+
var zCreateSkillCliBody = z13.object({
|
|
8178
8394
|
owner: zSkillOwnerInput,
|
|
8179
|
-
archive:
|
|
8395
|
+
archive: z13.string().min(1).describe("path to a skill directory (packed automatically) or a .zip/.tar.gz archive")
|
|
8180
8396
|
});
|
|
8181
8397
|
var ARCHIVE_SUFFIXES = [".zip", ".tar.gz", ".tgz"];
|
|
8182
8398
|
function assertPackable(dir) {
|
|
@@ -8218,16 +8434,16 @@ async function loadSkillArchive(archivePath) {
|
|
|
8218
8434
|
}
|
|
8219
8435
|
|
|
8220
8436
|
// src/slack-integration.ts
|
|
8221
|
-
import * as
|
|
8222
|
-
var zSlackBody =
|
|
8223
|
-
app_name:
|
|
8224
|
-
app_configuration_token:
|
|
8225
|
-
icon_filename:
|
|
8226
|
-
icon_data_base64:
|
|
8227
|
-
client_id:
|
|
8228
|
-
client_secret:
|
|
8229
|
-
signing_secret:
|
|
8230
|
-
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"),
|
|
8231
8447
|
browser: zBrowserFlag
|
|
8232
8448
|
});
|
|
8233
8449
|
function parseRequest(body) {
|
|
@@ -8256,7 +8472,7 @@ function parseRequest(body) {
|
|
|
8256
8472
|
if (!result2.success) {
|
|
8257
8473
|
throw new CliInputError(
|
|
8258
8474
|
`invalid existing Slack app parameters:
|
|
8259
|
-
${
|
|
8475
|
+
${z14.prettifyError(result2.error)}`
|
|
8260
8476
|
);
|
|
8261
8477
|
}
|
|
8262
8478
|
return { kind: "existing-app", body: result2.data };
|
|
@@ -8278,7 +8494,7 @@ ${z13.prettifyError(result2.error)}`
|
|
|
8278
8494
|
if (!result.success) {
|
|
8279
8495
|
throw new CliInputError(
|
|
8280
8496
|
`invalid Slack app parameters:
|
|
8281
|
-
${
|
|
8497
|
+
${z14.prettifyError(result.error)}
|
|
8282
8498
|
Pass --app-name and --app-configuration-token, or existing app credentials.`
|
|
8283
8499
|
);
|
|
8284
8500
|
}
|
|
@@ -8373,7 +8589,7 @@ var commandGroups = [
|
|
|
8373
8589
|
body: zConfigAttachment.extend({
|
|
8374
8590
|
profile: zAgentProfileId.optional(),
|
|
8375
8591
|
name: zAgentName.optional(),
|
|
8376
|
-
message:
|
|
8592
|
+
message: z15.string().optional()
|
|
8377
8593
|
}),
|
|
8378
8594
|
transformBody: async ({ profile, name, message, ...attachment }, { client: client2, path }) => ({
|
|
8379
8595
|
profile,
|
|
@@ -8414,7 +8630,7 @@ var commandGroups = [
|
|
|
8414
8630
|
flowOp({
|
|
8415
8631
|
verb: "mcp-add",
|
|
8416
8632
|
summary: "Create an OAuth secret and add an MCP server to an agent",
|
|
8417
|
-
path:
|
|
8633
|
+
path: z15.object({
|
|
8418
8634
|
orgID: zOrganizationId,
|
|
8419
8635
|
projectID: zProjectId,
|
|
8420
8636
|
agentID: zAgentId
|
|
@@ -8883,7 +9099,7 @@ var commandGroups = [
|
|
|
8883
9099
|
flowOp({
|
|
8884
9100
|
verb: "mcp-oauth",
|
|
8885
9101
|
summary: "Create a secret through an MCP server OAuth flow",
|
|
8886
|
-
path:
|
|
9102
|
+
path: z15.object({ orgID: zOrganizationId }),
|
|
8887
9103
|
body: zMcpOAuthBody,
|
|
8888
9104
|
run: runMcpOAuth
|
|
8889
9105
|
})
|
|
@@ -8997,7 +9213,7 @@ var commandGroups = [
|
|
|
8997
9213
|
flowOp({
|
|
8998
9214
|
verb: "mcp-add",
|
|
8999
9215
|
summary: "Create an OAuth secret and add an MCP server to an agent profile",
|
|
9000
|
-
path:
|
|
9216
|
+
path: z15.object({
|
|
9001
9217
|
orgID: zOrganizationId,
|
|
9002
9218
|
projectID: zProjectId,
|
|
9003
9219
|
agentProfileID: zAgentProfileId
|
|
@@ -9009,7 +9225,7 @@ var commandGroups = [
|
|
|
9009
9225
|
verb: "slack",
|
|
9010
9226
|
aliases: ["slack-setup"],
|
|
9011
9227
|
summary: "Connect Slack to an agent profile through OAuth",
|
|
9012
|
-
path:
|
|
9228
|
+
path: z15.object({
|
|
9013
9229
|
orgID: zOrganizationId,
|
|
9014
9230
|
projectID: zProjectId,
|
|
9015
9231
|
agentProfileID: zAgentProfileId
|
package/package.json
CHANGED