omnara 1.0.4 → 1.0.6
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 +647 -467
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -8,11 +8,6 @@ var __export = (target, all) => {
|
|
|
8
8
|
// src/bin.ts
|
|
9
9
|
import { Command } from "commander";
|
|
10
10
|
|
|
11
|
-
// src/config.ts
|
|
12
|
-
import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
13
|
-
import { homedir } from "node:os";
|
|
14
|
-
import { dirname, join } from "node:path";
|
|
15
|
-
|
|
16
11
|
// ../sdk/src/generated/sdk.gen.ts
|
|
17
12
|
var sdk_gen_exports = {};
|
|
18
13
|
__export(sdk_gen_exports, {
|
|
@@ -157,6 +152,7 @@ __export(sdk_gen_exports, {
|
|
|
157
152
|
updateProjectMachinePoolGrant: () => updateProjectMachinePoolGrant,
|
|
158
153
|
updateProjectModelGrant: () => updateProjectModelGrant,
|
|
159
154
|
updateSecret: () => updateSecret,
|
|
155
|
+
updateSkill: () => updateSkill,
|
|
160
156
|
uploadDaemonArtifact: () => uploadDaemonArtifact
|
|
161
157
|
});
|
|
162
158
|
|
|
@@ -210,7 +206,7 @@ function createSseClient({
|
|
|
210
206
|
sseMaxRetryAttempts,
|
|
211
207
|
sseMaxRetryDelay,
|
|
212
208
|
sseSleepFn,
|
|
213
|
-
url:
|
|
209
|
+
url: url4,
|
|
214
210
|
...options
|
|
215
211
|
}) {
|
|
216
212
|
let lastEventId;
|
|
@@ -234,9 +230,9 @@ function createSseClient({
|
|
|
234
230
|
headers,
|
|
235
231
|
signal
|
|
236
232
|
};
|
|
237
|
-
let request = new Request(
|
|
233
|
+
let request = new Request(url4, requestInit);
|
|
238
234
|
if (onRequest) {
|
|
239
|
-
request = await onRequest(
|
|
235
|
+
request = await onRequest(url4, requestInit);
|
|
240
236
|
}
|
|
241
237
|
const _fetch = options.fetch ?? globalThis.fetch;
|
|
242
238
|
const response = await _fetch(request);
|
|
@@ -453,7 +449,7 @@ var serializeObjectParam = ({
|
|
|
453
449
|
// ../sdk/src/generated/core/utils.gen.ts
|
|
454
450
|
var PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
455
451
|
var defaultPathSerializer = ({ path, url: _url }) => {
|
|
456
|
-
let
|
|
452
|
+
let url4 = _url;
|
|
457
453
|
const matches = _url.match(PATH_PARAM_RE);
|
|
458
454
|
if (matches) {
|
|
459
455
|
for (const match of matches) {
|
|
@@ -476,11 +472,11 @@ var defaultPathSerializer = ({ path, url: _url }) => {
|
|
|
476
472
|
continue;
|
|
477
473
|
}
|
|
478
474
|
if (Array.isArray(value)) {
|
|
479
|
-
|
|
475
|
+
url4 = url4.replace(match, serializeArrayParam({ explode, name, style, value }));
|
|
480
476
|
continue;
|
|
481
477
|
}
|
|
482
478
|
if (typeof value === "object") {
|
|
483
|
-
|
|
479
|
+
url4 = url4.replace(
|
|
484
480
|
match,
|
|
485
481
|
serializeObjectParam({
|
|
486
482
|
explode,
|
|
@@ -493,7 +489,7 @@ var defaultPathSerializer = ({ path, url: _url }) => {
|
|
|
493
489
|
continue;
|
|
494
490
|
}
|
|
495
491
|
if (style === "matrix") {
|
|
496
|
-
|
|
492
|
+
url4 = url4.replace(
|
|
497
493
|
match,
|
|
498
494
|
`;${serializePrimitiveParam({
|
|
499
495
|
name,
|
|
@@ -505,10 +501,10 @@ var defaultPathSerializer = ({ path, url: _url }) => {
|
|
|
505
501
|
const replaceValue = encodeURIComponent(
|
|
506
502
|
style === "label" ? `.${value}` : value
|
|
507
503
|
);
|
|
508
|
-
|
|
504
|
+
url4 = url4.replace(match, replaceValue);
|
|
509
505
|
}
|
|
510
506
|
}
|
|
511
|
-
return
|
|
507
|
+
return url4;
|
|
512
508
|
};
|
|
513
509
|
var getUrl = ({
|
|
514
510
|
baseUrl,
|
|
@@ -518,18 +514,18 @@ var getUrl = ({
|
|
|
518
514
|
url: _url
|
|
519
515
|
}) => {
|
|
520
516
|
const pathUrl = _url.startsWith("/") ? _url : `/${_url}`;
|
|
521
|
-
let
|
|
517
|
+
let url4 = (baseUrl ?? "") + pathUrl;
|
|
522
518
|
if (path) {
|
|
523
|
-
|
|
519
|
+
url4 = defaultPathSerializer({ path, url: url4 });
|
|
524
520
|
}
|
|
525
521
|
let search = query ? querySerializer(query) : "";
|
|
526
522
|
if (search.startsWith("?")) {
|
|
527
523
|
search = search.substring(1);
|
|
528
524
|
}
|
|
529
525
|
if (search) {
|
|
530
|
-
|
|
526
|
+
url4 += `?${search}`;
|
|
531
527
|
}
|
|
532
|
-
return
|
|
528
|
+
return url4;
|
|
533
529
|
};
|
|
534
530
|
function getValidRequestBody(options) {
|
|
535
531
|
const hasBody = options.body !== void 0;
|
|
@@ -805,8 +801,8 @@ var createClient = (config2 = {}) => {
|
|
|
805
801
|
opts.headers.delete("Content-Type");
|
|
806
802
|
}
|
|
807
803
|
const resolvedOpts = opts;
|
|
808
|
-
const
|
|
809
|
-
return { opts: resolvedOpts, url:
|
|
804
|
+
const url4 = buildUrl(resolvedOpts);
|
|
805
|
+
return { opts: resolvedOpts, url: url4 };
|
|
810
806
|
};
|
|
811
807
|
const request = async (options) => {
|
|
812
808
|
const throwOnError = options.throwOnError ?? _config.throwOnError;
|
|
@@ -814,13 +810,13 @@ var createClient = (config2 = {}) => {
|
|
|
814
810
|
let request2;
|
|
815
811
|
let response;
|
|
816
812
|
try {
|
|
817
|
-
const { opts, url:
|
|
813
|
+
const { opts, url: url4 } = await beforeRequest(options);
|
|
818
814
|
const requestInit = {
|
|
819
815
|
redirect: "follow",
|
|
820
816
|
...opts,
|
|
821
817
|
body: getValidRequestBody(opts)
|
|
822
818
|
};
|
|
823
|
-
request2 = new Request(
|
|
819
|
+
request2 = new Request(url4, requestInit);
|
|
824
820
|
for (const fn of interceptors.request.fns) {
|
|
825
821
|
if (fn) {
|
|
826
822
|
request2 = await fn(request2, opts);
|
|
@@ -922,13 +918,13 @@ var createClient = (config2 = {}) => {
|
|
|
922
918
|
};
|
|
923
919
|
const makeMethodFn = (method) => (options) => request({ ...options, method });
|
|
924
920
|
const makeSseFn = (method) => async (options) => {
|
|
925
|
-
const { opts, url:
|
|
921
|
+
const { opts, url: url4 } = await beforeRequest(options);
|
|
926
922
|
return createSseClient({
|
|
927
923
|
...opts,
|
|
928
924
|
body: opts.body,
|
|
929
925
|
method,
|
|
930
|
-
onRequest: async (
|
|
931
|
-
let request2 = new Request(
|
|
926
|
+
onRequest: async (url5, init) => {
|
|
927
|
+
let request2 = new Request(url5, init);
|
|
932
928
|
for (const fn of interceptors.request.fns) {
|
|
933
929
|
if (fn) {
|
|
934
930
|
request2 = await fn(request2, opts);
|
|
@@ -937,7 +933,7 @@ var createClient = (config2 = {}) => {
|
|
|
937
933
|
return request2;
|
|
938
934
|
},
|
|
939
935
|
serializedBody: getValidRequestBody(opts),
|
|
940
|
-
url:
|
|
936
|
+
url: url4
|
|
941
937
|
});
|
|
942
938
|
};
|
|
943
939
|
const _buildUrl = (options) => buildUrl({ ..._config, ...options });
|
|
@@ -971,7 +967,7 @@ var createClient = (config2 = {}) => {
|
|
|
971
967
|
};
|
|
972
968
|
|
|
973
969
|
// ../sdk/src/generated/client.gen.ts
|
|
974
|
-
var client = createClient(createConfig({ throwOnError: true }));
|
|
970
|
+
var client = createClient(createConfig({ baseUrl: "https://api.omnara.com/v1", throwOnError: true }));
|
|
975
971
|
|
|
976
972
|
// ../sdk/src/generated/zod.gen.ts
|
|
977
973
|
import * as z from "zod";
|
|
@@ -1247,7 +1243,7 @@ var zConfiguredModel = z.object({
|
|
|
1247
1243
|
context_window_tokens: z.int(),
|
|
1248
1244
|
max_output_tokens: z.int(),
|
|
1249
1245
|
default_max_output_tokens: z.int().nullish(),
|
|
1250
|
-
default_cache_retention: zModelCacheRetention,
|
|
1246
|
+
default_cache_retention: zModelCacheRetention.optional(),
|
|
1251
1247
|
supports_tools: z.boolean(),
|
|
1252
1248
|
supports_reasoning: z.boolean(),
|
|
1253
1249
|
default_reasoning_effort: z.string(),
|
|
@@ -1336,6 +1332,21 @@ var zCreateSkillRequest = z.object({
|
|
|
1336
1332
|
owner: zSkillOwnerInput,
|
|
1337
1333
|
archive: z.string()
|
|
1338
1334
|
});
|
|
1335
|
+
var zUpdateSkillRequest = z.intersection(z.union([
|
|
1336
|
+
z.object({
|
|
1337
|
+
archive: z.string()
|
|
1338
|
+
}),
|
|
1339
|
+
z.object({
|
|
1340
|
+
skill_md: z.string()
|
|
1341
|
+
})
|
|
1342
|
+
]), z.object({
|
|
1343
|
+
archive: z.string().optional(),
|
|
1344
|
+
skill_md: z.string().optional()
|
|
1345
|
+
}));
|
|
1346
|
+
var zSkillFile = z.object({
|
|
1347
|
+
path: z.string(),
|
|
1348
|
+
size: z.coerce.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" })
|
|
1349
|
+
});
|
|
1339
1350
|
var zSkill = z.object({
|
|
1340
1351
|
id: zSkillId,
|
|
1341
1352
|
org_id: zOrganizationId,
|
|
@@ -1345,6 +1356,7 @@ var zSkill = z.object({
|
|
|
1345
1356
|
revision: z.int().gte(1).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1346
1357
|
description: z.string(),
|
|
1347
1358
|
skill_md: z.string().optional(),
|
|
1359
|
+
files: z.array(zSkillFile).optional(),
|
|
1348
1360
|
created_at: zTimestamp,
|
|
1349
1361
|
updated_at: zTimestamp
|
|
1350
1362
|
});
|
|
@@ -1831,6 +1843,15 @@ var zInlineMediaContentBlock = z.object({
|
|
|
1831
1843
|
"text/markdown",
|
|
1832
1844
|
"text/csv",
|
|
1833
1845
|
"text/tab-separated-values",
|
|
1846
|
+
"text/x-iif",
|
|
1847
|
+
"application/msword",
|
|
1848
|
+
"application/rtf",
|
|
1849
|
+
"application/vnd.oasis.opendocument.text",
|
|
1850
|
+
"application/vnd.apple.pages",
|
|
1851
|
+
"application/vnd.apple.keynote",
|
|
1852
|
+
"application/vnd.apple.iwork",
|
|
1853
|
+
"application/vnd.ms-powerpoint",
|
|
1854
|
+
"application/vnd.ms-excel",
|
|
1834
1855
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
1835
1856
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
1836
1857
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
@@ -3256,6 +3277,11 @@ var zGetSkillPath = z.object({
|
|
|
3256
3277
|
skillID: z.string().regex(/^skl_[a-z2-7]{26}$/)
|
|
3257
3278
|
});
|
|
3258
3279
|
var zGetSkillResponse = zSkill;
|
|
3280
|
+
var zUpdateSkillPath = z.object({
|
|
3281
|
+
orgID: z.string().regex(/^org_[a-z2-7]{26}$/),
|
|
3282
|
+
skillID: z.string().regex(/^skl_[a-z2-7]{26}$/)
|
|
3283
|
+
});
|
|
3284
|
+
var zUpdateSkillResponse = zSkill;
|
|
3259
3285
|
var zListSkillGrantsPath = z.object({
|
|
3260
3286
|
orgID: z.string().regex(/^org_[a-z2-7]{26}$/),
|
|
3261
3287
|
skillID: zSkillId
|
|
@@ -4099,7 +4125,7 @@ var listPersonalAccessTokens = (options) => (options?.client ?? client).get({
|
|
|
4099
4125
|
name: "__Host-omnara_session",
|
|
4100
4126
|
type: "apiKey"
|
|
4101
4127
|
}],
|
|
4102
|
-
url: "/
|
|
4128
|
+
url: "/personal-access-tokens",
|
|
4103
4129
|
...options
|
|
4104
4130
|
});
|
|
4105
4131
|
var createPersonalAccessToken = (options) => (options.client ?? client).post({
|
|
@@ -4109,7 +4135,7 @@ var createPersonalAccessToken = (options) => (options.client ?? client).post({
|
|
|
4109
4135
|
name: "__Host-omnara_session",
|
|
4110
4136
|
type: "apiKey"
|
|
4111
4137
|
}, { name: "X-Omnara-Csrf", type: "apiKey" }],
|
|
4112
|
-
url: "/
|
|
4138
|
+
url: "/personal-access-tokens",
|
|
4113
4139
|
...options,
|
|
4114
4140
|
headers: {
|
|
4115
4141
|
"Content-Type": "application/json",
|
|
@@ -4131,7 +4157,7 @@ var revokePersonalAccessToken = (options) => (options.client ?? client).post({
|
|
|
4131
4157
|
},
|
|
4132
4158
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4133
4159
|
],
|
|
4134
|
-
url: "/
|
|
4160
|
+
url: "/personal-access-tokens/{tokenID}/revoke",
|
|
4135
4161
|
...options
|
|
4136
4162
|
});
|
|
4137
4163
|
var bootstrapDaemon = (options) => (options?.client ?? client).post({
|
|
@@ -4141,7 +4167,7 @@ var bootstrapDaemon = (options) => (options?.client ?? client).post({
|
|
|
4141
4167
|
scheme: "bearer",
|
|
4142
4168
|
type: "http"
|
|
4143
4169
|
}],
|
|
4144
|
-
url: "/
|
|
4170
|
+
url: "/daemon/bootstrap",
|
|
4145
4171
|
...options
|
|
4146
4172
|
});
|
|
4147
4173
|
var recordMachineFailure = (options) => (options.client ?? client).post({
|
|
@@ -4152,7 +4178,7 @@ var recordMachineFailure = (options) => (options.client ?? client).post({
|
|
|
4152
4178
|
scheme: "bearer",
|
|
4153
4179
|
type: "http"
|
|
4154
4180
|
}],
|
|
4155
|
-
url: "/
|
|
4181
|
+
url: "/daemon/failures",
|
|
4156
4182
|
...options,
|
|
4157
4183
|
headers: {
|
|
4158
4184
|
"Content-Type": "text/plain",
|
|
@@ -4174,7 +4200,7 @@ var createOrganization = (options) => (options.client ?? client).post({
|
|
|
4174
4200
|
},
|
|
4175
4201
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4176
4202
|
],
|
|
4177
|
-
url: "/
|
|
4203
|
+
url: "/orgs",
|
|
4178
4204
|
...options,
|
|
4179
4205
|
headers: {
|
|
4180
4206
|
"Content-Type": "application/json",
|
|
@@ -4196,7 +4222,7 @@ var deleteOrganization = (options) => (options.client ?? client).delete({
|
|
|
4196
4222
|
},
|
|
4197
4223
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4198
4224
|
],
|
|
4199
|
-
url: "/
|
|
4225
|
+
url: "/orgs/{orgID}",
|
|
4200
4226
|
...options
|
|
4201
4227
|
});
|
|
4202
4228
|
var deleteCurrentUser = (options) => (options?.client ?? client).delete({
|
|
@@ -4214,7 +4240,7 @@ var deleteCurrentUser = (options) => (options?.client ?? client).delete({
|
|
|
4214
4240
|
},
|
|
4215
4241
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4216
4242
|
],
|
|
4217
|
-
url: "/
|
|
4243
|
+
url: "/me",
|
|
4218
4244
|
...options
|
|
4219
4245
|
});
|
|
4220
4246
|
var getCurrentUser = (options) => (options?.client ?? client).get({
|
|
@@ -4228,7 +4254,7 @@ var getCurrentUser = (options) => (options?.client ?? client).get({
|
|
|
4228
4254
|
name: "__Host-omnara_session",
|
|
4229
4255
|
type: "apiKey"
|
|
4230
4256
|
}],
|
|
4231
|
-
url: "/
|
|
4257
|
+
url: "/me",
|
|
4232
4258
|
...options
|
|
4233
4259
|
});
|
|
4234
4260
|
var listPendingInvitations = (options) => (options?.client ?? client).get({
|
|
@@ -4242,7 +4268,7 @@ var listPendingInvitations = (options) => (options?.client ?? client).get({
|
|
|
4242
4268
|
name: "__Host-omnara_session",
|
|
4243
4269
|
type: "apiKey"
|
|
4244
4270
|
}],
|
|
4245
|
-
url: "/
|
|
4271
|
+
url: "/invitations",
|
|
4246
4272
|
...options
|
|
4247
4273
|
});
|
|
4248
4274
|
var acceptInvitation = (options) => (options.client ?? client).post({
|
|
@@ -4260,7 +4286,7 @@ var acceptInvitation = (options) => (options.client ?? client).post({
|
|
|
4260
4286
|
},
|
|
4261
4287
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4262
4288
|
],
|
|
4263
|
-
url: "/
|
|
4289
|
+
url: "/invitations/{invitationID}/accept",
|
|
4264
4290
|
...options
|
|
4265
4291
|
});
|
|
4266
4292
|
var declineInvitation = (options) => (options.client ?? client).post({
|
|
@@ -4278,7 +4304,7 @@ var declineInvitation = (options) => (options.client ?? client).post({
|
|
|
4278
4304
|
},
|
|
4279
4305
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4280
4306
|
],
|
|
4281
|
-
url: "/
|
|
4307
|
+
url: "/invitations/{invitationID}/decline",
|
|
4282
4308
|
...options
|
|
4283
4309
|
});
|
|
4284
4310
|
var getOrgOverview = (options) => (options.client ?? client).get({
|
|
@@ -4292,7 +4318,7 @@ var getOrgOverview = (options) => (options.client ?? client).get({
|
|
|
4292
4318
|
name: "__Host-omnara_session",
|
|
4293
4319
|
type: "apiKey"
|
|
4294
4320
|
}],
|
|
4295
|
-
url: "/
|
|
4321
|
+
url: "/orgs/{orgID}/overview",
|
|
4296
4322
|
...options
|
|
4297
4323
|
});
|
|
4298
4324
|
var listVisibleProjects = (options) => (options.client ?? client).get({
|
|
@@ -4306,7 +4332,7 @@ var listVisibleProjects = (options) => (options.client ?? client).get({
|
|
|
4306
4332
|
name: "__Host-omnara_session",
|
|
4307
4333
|
type: "apiKey"
|
|
4308
4334
|
}],
|
|
4309
|
-
url: "/
|
|
4335
|
+
url: "/orgs/{orgID}/projects",
|
|
4310
4336
|
...options
|
|
4311
4337
|
});
|
|
4312
4338
|
var createProject = (options) => (options.client ?? client).post({
|
|
@@ -4324,7 +4350,7 @@ var createProject = (options) => (options.client ?? client).post({
|
|
|
4324
4350
|
},
|
|
4325
4351
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4326
4352
|
],
|
|
4327
|
-
url: "/
|
|
4353
|
+
url: "/orgs/{orgID}/projects",
|
|
4328
4354
|
...options,
|
|
4329
4355
|
headers: {
|
|
4330
4356
|
"Content-Type": "application/json",
|
|
@@ -4346,7 +4372,7 @@ var deleteProject = (options) => (options.client ?? client).delete({
|
|
|
4346
4372
|
},
|
|
4347
4373
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4348
4374
|
],
|
|
4349
|
-
url: "/
|
|
4375
|
+
url: "/orgs/{orgID}/projects/{projectID}",
|
|
4350
4376
|
...options
|
|
4351
4377
|
});
|
|
4352
4378
|
var listOrgMembers = (options) => (options.client ?? client).get({
|
|
@@ -4360,7 +4386,7 @@ var listOrgMembers = (options) => (options.client ?? client).get({
|
|
|
4360
4386
|
name: "__Host-omnara_session",
|
|
4361
4387
|
type: "apiKey"
|
|
4362
4388
|
}],
|
|
4363
|
-
url: "/
|
|
4389
|
+
url: "/orgs/{orgID}/members",
|
|
4364
4390
|
...options
|
|
4365
4391
|
});
|
|
4366
4392
|
var removeOrgMember = (options) => (options.client ?? client).delete({
|
|
@@ -4378,7 +4404,7 @@ var removeOrgMember = (options) => (options.client ?? client).delete({
|
|
|
4378
4404
|
},
|
|
4379
4405
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4380
4406
|
],
|
|
4381
|
-
url: "/
|
|
4407
|
+
url: "/orgs/{orgID}/members/{userID}",
|
|
4382
4408
|
...options
|
|
4383
4409
|
});
|
|
4384
4410
|
var updateOrgMember = (options) => (options.client ?? client).patch({
|
|
@@ -4396,7 +4422,7 @@ var updateOrgMember = (options) => (options.client ?? client).patch({
|
|
|
4396
4422
|
},
|
|
4397
4423
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4398
4424
|
],
|
|
4399
|
-
url: "/
|
|
4425
|
+
url: "/orgs/{orgID}/members/{userID}",
|
|
4400
4426
|
...options,
|
|
4401
4427
|
headers: {
|
|
4402
4428
|
"Content-Type": "application/json",
|
|
@@ -4414,7 +4440,7 @@ var listMemberProjectAccess = (options) => (options.client ?? client).get({
|
|
|
4414
4440
|
name: "__Host-omnara_session",
|
|
4415
4441
|
type: "apiKey"
|
|
4416
4442
|
}],
|
|
4417
|
-
url: "/
|
|
4443
|
+
url: "/orgs/{orgID}/members/{userID}/projects",
|
|
4418
4444
|
...options
|
|
4419
4445
|
});
|
|
4420
4446
|
var removeMemberProjectAccess = (options) => (options.client ?? client).delete({
|
|
@@ -4432,7 +4458,7 @@ var removeMemberProjectAccess = (options) => (options.client ?? client).delete({
|
|
|
4432
4458
|
},
|
|
4433
4459
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4434
4460
|
],
|
|
4435
|
-
url: "/
|
|
4461
|
+
url: "/orgs/{orgID}/members/{userID}/projects/{projectID}",
|
|
4436
4462
|
...options
|
|
4437
4463
|
});
|
|
4438
4464
|
var setMemberProjectAccess = (options) => (options.client ?? client).put({
|
|
@@ -4450,7 +4476,7 @@ var setMemberProjectAccess = (options) => (options.client ?? client).put({
|
|
|
4450
4476
|
},
|
|
4451
4477
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4452
4478
|
],
|
|
4453
|
-
url: "/
|
|
4479
|
+
url: "/orgs/{orgID}/members/{userID}/projects/{projectID}",
|
|
4454
4480
|
...options,
|
|
4455
4481
|
headers: {
|
|
4456
4482
|
"Content-Type": "application/json",
|
|
@@ -4468,7 +4494,7 @@ var listOrgApiKeys = (options) => (options.client ?? client).get({
|
|
|
4468
4494
|
name: "__Host-omnara_session",
|
|
4469
4495
|
type: "apiKey"
|
|
4470
4496
|
}],
|
|
4471
|
-
url: "/
|
|
4497
|
+
url: "/orgs/{orgID}/api-keys",
|
|
4472
4498
|
...options
|
|
4473
4499
|
});
|
|
4474
4500
|
var createOrgApiKey = (options) => (options.client ?? client).post({
|
|
@@ -4478,7 +4504,7 @@ var createOrgApiKey = (options) => (options.client ?? client).post({
|
|
|
4478
4504
|
name: "__Host-omnara_session",
|
|
4479
4505
|
type: "apiKey"
|
|
4480
4506
|
}, { name: "X-Omnara-Csrf", type: "apiKey" }],
|
|
4481
|
-
url: "/
|
|
4507
|
+
url: "/orgs/{orgID}/api-keys",
|
|
4482
4508
|
...options,
|
|
4483
4509
|
headers: {
|
|
4484
4510
|
"Content-Type": "application/json",
|
|
@@ -4496,7 +4522,7 @@ var getOrgApiKey = (options) => (options.client ?? client).get({
|
|
|
4496
4522
|
name: "__Host-omnara_session",
|
|
4497
4523
|
type: "apiKey"
|
|
4498
4524
|
}],
|
|
4499
|
-
url: "/
|
|
4525
|
+
url: "/orgs/{orgID}/api-keys/{keyID}",
|
|
4500
4526
|
...options
|
|
4501
4527
|
});
|
|
4502
4528
|
var updateOrgApiKey = (options) => (options.client ?? client).patch({
|
|
@@ -4506,7 +4532,7 @@ var updateOrgApiKey = (options) => (options.client ?? client).patch({
|
|
|
4506
4532
|
name: "__Host-omnara_session",
|
|
4507
4533
|
type: "apiKey"
|
|
4508
4534
|
}, { name: "X-Omnara-Csrf", type: "apiKey" }],
|
|
4509
|
-
url: "/
|
|
4535
|
+
url: "/orgs/{orgID}/api-keys/{keyID}",
|
|
4510
4536
|
...options,
|
|
4511
4537
|
headers: {
|
|
4512
4538
|
"Content-Type": "application/json",
|
|
@@ -4520,7 +4546,7 @@ var revokeOrgApiKey = (options) => (options.client ?? client).post({
|
|
|
4520
4546
|
name: "__Host-omnara_session",
|
|
4521
4547
|
type: "apiKey"
|
|
4522
4548
|
}, { name: "X-Omnara-Csrf", type: "apiKey" }],
|
|
4523
|
-
url: "/
|
|
4549
|
+
url: "/orgs/{orgID}/api-keys/{keyID}/revoke",
|
|
4524
4550
|
...options
|
|
4525
4551
|
});
|
|
4526
4552
|
var listOrgApiKeyProjectAccess = (options) => (options.client ?? client).get({
|
|
@@ -4534,7 +4560,7 @@ var listOrgApiKeyProjectAccess = (options) => (options.client ?? client).get({
|
|
|
4534
4560
|
name: "__Host-omnara_session",
|
|
4535
4561
|
type: "apiKey"
|
|
4536
4562
|
}],
|
|
4537
|
-
url: "/
|
|
4563
|
+
url: "/orgs/{orgID}/api-keys/{keyID}/projects",
|
|
4538
4564
|
...options
|
|
4539
4565
|
});
|
|
4540
4566
|
var removeOrgApiKeyProjectRole = (options) => (options.client ?? client).delete({
|
|
@@ -4544,7 +4570,7 @@ var removeOrgApiKeyProjectRole = (options) => (options.client ?? client).delete(
|
|
|
4544
4570
|
name: "__Host-omnara_session",
|
|
4545
4571
|
type: "apiKey"
|
|
4546
4572
|
}, { name: "X-Omnara-Csrf", type: "apiKey" }],
|
|
4547
|
-
url: "/
|
|
4573
|
+
url: "/orgs/{orgID}/api-keys/{keyID}/projects/{projectID}",
|
|
4548
4574
|
...options
|
|
4549
4575
|
});
|
|
4550
4576
|
var setOrgApiKeyProjectRole = (options) => (options.client ?? client).put({
|
|
@@ -4554,7 +4580,7 @@ var setOrgApiKeyProjectRole = (options) => (options.client ?? client).put({
|
|
|
4554
4580
|
name: "__Host-omnara_session",
|
|
4555
4581
|
type: "apiKey"
|
|
4556
4582
|
}, { name: "X-Omnara-Csrf", type: "apiKey" }],
|
|
4557
|
-
url: "/
|
|
4583
|
+
url: "/orgs/{orgID}/api-keys/{keyID}/projects/{projectID}",
|
|
4558
4584
|
...options,
|
|
4559
4585
|
headers: {
|
|
4560
4586
|
"Content-Type": "application/json",
|
|
@@ -4572,7 +4598,7 @@ var listOrgInvitations = (options) => (options.client ?? client).get({
|
|
|
4572
4598
|
name: "__Host-omnara_session",
|
|
4573
4599
|
type: "apiKey"
|
|
4574
4600
|
}],
|
|
4575
|
-
url: "/
|
|
4601
|
+
url: "/orgs/{orgID}/invitations",
|
|
4576
4602
|
...options
|
|
4577
4603
|
});
|
|
4578
4604
|
var createOrgInvitation = (options) => (options.client ?? client).post({
|
|
@@ -4590,7 +4616,7 @@ var createOrgInvitation = (options) => (options.client ?? client).post({
|
|
|
4590
4616
|
},
|
|
4591
4617
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4592
4618
|
],
|
|
4593
|
-
url: "/
|
|
4619
|
+
url: "/orgs/{orgID}/invitations",
|
|
4594
4620
|
...options,
|
|
4595
4621
|
headers: {
|
|
4596
4622
|
"Content-Type": "application/json",
|
|
@@ -4612,7 +4638,7 @@ var deleteOrgInvitation = (options) => (options.client ?? client).delete({
|
|
|
4612
4638
|
},
|
|
4613
4639
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4614
4640
|
],
|
|
4615
|
-
url: "/
|
|
4641
|
+
url: "/orgs/{orgID}/invitations/{invitationID}",
|
|
4616
4642
|
...options
|
|
4617
4643
|
});
|
|
4618
4644
|
var listSkills = (options) => (options.client ?? client).get({
|
|
@@ -4626,7 +4652,7 @@ var listSkills = (options) => (options.client ?? client).get({
|
|
|
4626
4652
|
name: "__Host-omnara_session",
|
|
4627
4653
|
type: "apiKey"
|
|
4628
4654
|
}],
|
|
4629
|
-
url: "/
|
|
4655
|
+
url: "/orgs/{orgID}/skills",
|
|
4630
4656
|
...options
|
|
4631
4657
|
});
|
|
4632
4658
|
var createSkill = (options) => (options.client ?? client).post({
|
|
@@ -4645,7 +4671,7 @@ var createSkill = (options) => (options.client ?? client).post({
|
|
|
4645
4671
|
},
|
|
4646
4672
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4647
4673
|
],
|
|
4648
|
-
url: "/
|
|
4674
|
+
url: "/orgs/{orgID}/skills",
|
|
4649
4675
|
...options,
|
|
4650
4676
|
headers: {
|
|
4651
4677
|
"Content-Type": null,
|
|
@@ -4667,7 +4693,7 @@ var deleteSkill = (options) => (options.client ?? client).delete({
|
|
|
4667
4693
|
},
|
|
4668
4694
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4669
4695
|
],
|
|
4670
|
-
url: "/
|
|
4696
|
+
url: "/orgs/{orgID}/skills/{skillID}",
|
|
4671
4697
|
...options
|
|
4672
4698
|
});
|
|
4673
4699
|
var getSkill = (options) => (options.client ?? client).get({
|
|
@@ -4681,9 +4707,32 @@ var getSkill = (options) => (options.client ?? client).get({
|
|
|
4681
4707
|
name: "__Host-omnara_session",
|
|
4682
4708
|
type: "apiKey"
|
|
4683
4709
|
}],
|
|
4684
|
-
url: "/
|
|
4710
|
+
url: "/orgs/{orgID}/skills/{skillID}",
|
|
4685
4711
|
...options
|
|
4686
4712
|
});
|
|
4713
|
+
var updateSkill = (options) => (options.client ?? client).post({
|
|
4714
|
+
...formDataBodySerializer,
|
|
4715
|
+
responseValidator: async (data) => await validateResponse(zUpdateSkillResponse, data),
|
|
4716
|
+
security: [
|
|
4717
|
+
{
|
|
4718
|
+
key: "bearerAuth",
|
|
4719
|
+
scheme: "bearer",
|
|
4720
|
+
type: "http"
|
|
4721
|
+
},
|
|
4722
|
+
{
|
|
4723
|
+
in: "cookie",
|
|
4724
|
+
name: "__Host-omnara_session",
|
|
4725
|
+
type: "apiKey"
|
|
4726
|
+
},
|
|
4727
|
+
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4728
|
+
],
|
|
4729
|
+
url: "/orgs/{orgID}/skills/{skillID}",
|
|
4730
|
+
...options,
|
|
4731
|
+
headers: {
|
|
4732
|
+
"Content-Type": null,
|
|
4733
|
+
...options.headers
|
|
4734
|
+
}
|
|
4735
|
+
});
|
|
4687
4736
|
var listSkillGrants = (options) => (options.client ?? client).get({
|
|
4688
4737
|
responseValidator: async (data) => await validateResponse(zListSkillGrantsResponse2, data),
|
|
4689
4738
|
security: [{
|
|
@@ -4695,7 +4744,7 @@ var listSkillGrants = (options) => (options.client ?? client).get({
|
|
|
4695
4744
|
name: "__Host-omnara_session",
|
|
4696
4745
|
type: "apiKey"
|
|
4697
4746
|
}],
|
|
4698
|
-
url: "/
|
|
4747
|
+
url: "/orgs/{orgID}/skills/{skillID}/grants",
|
|
4699
4748
|
...options
|
|
4700
4749
|
});
|
|
4701
4750
|
var createSkillGrant = (options) => (options.client ?? client).post({
|
|
@@ -4713,7 +4762,7 @@ var createSkillGrant = (options) => (options.client ?? client).post({
|
|
|
4713
4762
|
},
|
|
4714
4763
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4715
4764
|
],
|
|
4716
|
-
url: "/
|
|
4765
|
+
url: "/orgs/{orgID}/skills/{skillID}/grants",
|
|
4717
4766
|
...options,
|
|
4718
4767
|
headers: {
|
|
4719
4768
|
"Content-Type": "application/json",
|
|
@@ -4735,7 +4784,7 @@ var deleteSkillGrant = (options) => (options.client ?? client).delete({
|
|
|
4735
4784
|
},
|
|
4736
4785
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4737
4786
|
],
|
|
4738
|
-
url: "/
|
|
4787
|
+
url: "/orgs/{orgID}/skills/{skillID}/grants/{grantID}",
|
|
4739
4788
|
...options
|
|
4740
4789
|
});
|
|
4741
4790
|
var listProjectAvailableSkills = (options) => (options.client ?? client).get({
|
|
@@ -4749,7 +4798,7 @@ var listProjectAvailableSkills = (options) => (options.client ?? client).get({
|
|
|
4749
4798
|
name: "__Host-omnara_session",
|
|
4750
4799
|
type: "apiKey"
|
|
4751
4800
|
}],
|
|
4752
|
-
url: "/
|
|
4801
|
+
url: "/orgs/{orgID}/projects/{projectID}/skills",
|
|
4753
4802
|
...options
|
|
4754
4803
|
});
|
|
4755
4804
|
var listSecrets = (options) => (options.client ?? client).get({
|
|
@@ -4763,7 +4812,7 @@ var listSecrets = (options) => (options.client ?? client).get({
|
|
|
4763
4812
|
name: "__Host-omnara_session",
|
|
4764
4813
|
type: "apiKey"
|
|
4765
4814
|
}],
|
|
4766
|
-
url: "/
|
|
4815
|
+
url: "/orgs/{orgID}/secrets",
|
|
4767
4816
|
...options
|
|
4768
4817
|
});
|
|
4769
4818
|
var createSecret = (options) => (options.client ?? client).post({
|
|
@@ -4781,7 +4830,7 @@ var createSecret = (options) => (options.client ?? client).post({
|
|
|
4781
4830
|
},
|
|
4782
4831
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4783
4832
|
],
|
|
4784
|
-
url: "/
|
|
4833
|
+
url: "/orgs/{orgID}/secrets",
|
|
4785
4834
|
...options,
|
|
4786
4835
|
headers: {
|
|
4787
4836
|
"Content-Type": "application/json",
|
|
@@ -4803,7 +4852,7 @@ var startSecretMcpoAuth = (options) => (options.client ?? client).post({
|
|
|
4803
4852
|
},
|
|
4804
4853
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4805
4854
|
],
|
|
4806
|
-
url: "/
|
|
4855
|
+
url: "/orgs/{orgID}/secrets/mcp-oauth",
|
|
4807
4856
|
...options,
|
|
4808
4857
|
headers: {
|
|
4809
4858
|
"Content-Type": "application/json",
|
|
@@ -4825,7 +4874,7 @@ var deleteSecret = (options) => (options.client ?? client).delete({
|
|
|
4825
4874
|
},
|
|
4826
4875
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4827
4876
|
],
|
|
4828
|
-
url: "/
|
|
4877
|
+
url: "/orgs/{orgID}/secrets/{secretID}",
|
|
4829
4878
|
...options
|
|
4830
4879
|
});
|
|
4831
4880
|
var getSecret = (options) => (options.client ?? client).get({
|
|
@@ -4839,7 +4888,7 @@ var getSecret = (options) => (options.client ?? client).get({
|
|
|
4839
4888
|
name: "__Host-omnara_session",
|
|
4840
4889
|
type: "apiKey"
|
|
4841
4890
|
}],
|
|
4842
|
-
url: "/
|
|
4891
|
+
url: "/orgs/{orgID}/secrets/{secretID}",
|
|
4843
4892
|
...options
|
|
4844
4893
|
});
|
|
4845
4894
|
var updateSecret = (options) => (options.client ?? client).patch({
|
|
@@ -4857,7 +4906,7 @@ var updateSecret = (options) => (options.client ?? client).patch({
|
|
|
4857
4906
|
},
|
|
4858
4907
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4859
4908
|
],
|
|
4860
|
-
url: "/
|
|
4909
|
+
url: "/orgs/{orgID}/secrets/{secretID}",
|
|
4861
4910
|
...options,
|
|
4862
4911
|
headers: {
|
|
4863
4912
|
"Content-Type": "application/json",
|
|
@@ -4879,7 +4928,7 @@ var createSecretVersion = (options) => (options.client ?? client).post({
|
|
|
4879
4928
|
},
|
|
4880
4929
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4881
4930
|
],
|
|
4882
|
-
url: "/
|
|
4931
|
+
url: "/orgs/{orgID}/secrets/{secretID}/versions",
|
|
4883
4932
|
...options,
|
|
4884
4933
|
headers: {
|
|
4885
4934
|
"Content-Type": "application/json",
|
|
@@ -4897,7 +4946,7 @@ var listSecretGrants = (options) => (options.client ?? client).get({
|
|
|
4897
4946
|
name: "__Host-omnara_session",
|
|
4898
4947
|
type: "apiKey"
|
|
4899
4948
|
}],
|
|
4900
|
-
url: "/
|
|
4949
|
+
url: "/orgs/{orgID}/secrets/{secretID}/grants",
|
|
4901
4950
|
...options
|
|
4902
4951
|
});
|
|
4903
4952
|
var createSecretGrant = (options) => (options.client ?? client).post({
|
|
@@ -4915,7 +4964,7 @@ var createSecretGrant = (options) => (options.client ?? client).post({
|
|
|
4915
4964
|
},
|
|
4916
4965
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4917
4966
|
],
|
|
4918
|
-
url: "/
|
|
4967
|
+
url: "/orgs/{orgID}/secrets/{secretID}/grants",
|
|
4919
4968
|
...options,
|
|
4920
4969
|
headers: {
|
|
4921
4970
|
"Content-Type": "application/json",
|
|
@@ -4937,7 +4986,7 @@ var deleteSecretGrant = (options) => (options.client ?? client).delete({
|
|
|
4937
4986
|
},
|
|
4938
4987
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4939
4988
|
],
|
|
4940
|
-
url: "/
|
|
4989
|
+
url: "/orgs/{orgID}/secrets/{secretID}/grants/{grantID}",
|
|
4941
4990
|
...options
|
|
4942
4991
|
});
|
|
4943
4992
|
var listIntegrationInstalls = (options) => (options.client ?? client).get({
|
|
@@ -4951,7 +5000,7 @@ var listIntegrationInstalls = (options) => (options.client ?? client).get({
|
|
|
4951
5000
|
name: "__Host-omnara_session",
|
|
4952
5001
|
type: "apiKey"
|
|
4953
5002
|
}],
|
|
4954
|
-
url: "/
|
|
5003
|
+
url: "/orgs/{orgID}/projects/{projectID}/integration-installs",
|
|
4955
5004
|
...options
|
|
4956
5005
|
});
|
|
4957
5006
|
var deleteIntegrationInstall = (options) => (options.client ?? client).delete({
|
|
@@ -4969,7 +5018,7 @@ var deleteIntegrationInstall = (options) => (options.client ?? client).delete({
|
|
|
4969
5018
|
},
|
|
4970
5019
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4971
5020
|
],
|
|
4972
|
-
url: "/
|
|
5021
|
+
url: "/orgs/{orgID}/projects/{projectID}/integration-installs/{integrationInstallID}",
|
|
4973
5022
|
...options
|
|
4974
5023
|
});
|
|
4975
5024
|
var createAgentConfig = (options) => (options.client ?? client).post({
|
|
@@ -4987,7 +5036,7 @@ var createAgentConfig = (options) => (options.client ?? client).post({
|
|
|
4987
5036
|
},
|
|
4988
5037
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
4989
5038
|
],
|
|
4990
|
-
url: "/
|
|
5039
|
+
url: "/orgs/{orgID}/projects/{projectID}/agent-configs",
|
|
4991
5040
|
...options,
|
|
4992
5041
|
headers: {
|
|
4993
5042
|
"Content-Type": "application/json",
|
|
@@ -5005,7 +5054,7 @@ var getToolCatalog = (options) => (options?.client ?? client).get({
|
|
|
5005
5054
|
name: "__Host-omnara_session",
|
|
5006
5055
|
type: "apiKey"
|
|
5007
5056
|
}],
|
|
5008
|
-
url: "/
|
|
5057
|
+
url: "/tool-catalog",
|
|
5009
5058
|
...options
|
|
5010
5059
|
});
|
|
5011
5060
|
var listMcpServers = (options) => (options?.client ?? client).get({
|
|
@@ -5019,7 +5068,7 @@ var listMcpServers = (options) => (options?.client ?? client).get({
|
|
|
5019
5068
|
name: "__Host-omnara_session",
|
|
5020
5069
|
type: "apiKey"
|
|
5021
5070
|
}],
|
|
5022
|
-
url: "/
|
|
5071
|
+
url: "/mcp-servers",
|
|
5023
5072
|
...options
|
|
5024
5073
|
});
|
|
5025
5074
|
var listMcpServerTools = (options) => (options.client ?? client).post({
|
|
@@ -5037,7 +5086,7 @@ var listMcpServerTools = (options) => (options.client ?? client).post({
|
|
|
5037
5086
|
},
|
|
5038
5087
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5039
5088
|
],
|
|
5040
|
-
url: "/
|
|
5089
|
+
url: "/orgs/{orgID}/projects/{projectID}/mcp-servers/tools",
|
|
5041
5090
|
...options,
|
|
5042
5091
|
headers: {
|
|
5043
5092
|
"Content-Type": "application/json",
|
|
@@ -5055,7 +5104,7 @@ var getAgentConfig = (options) => (options.client ?? client).get({
|
|
|
5055
5104
|
name: "__Host-omnara_session",
|
|
5056
5105
|
type: "apiKey"
|
|
5057
5106
|
}],
|
|
5058
|
-
url: "/
|
|
5107
|
+
url: "/orgs/{orgID}/projects/{projectID}/agent-configs/{agentConfigID}",
|
|
5059
5108
|
...options
|
|
5060
5109
|
});
|
|
5061
5110
|
var listAgentProfiles = (options) => (options.client ?? client).get({
|
|
@@ -5069,7 +5118,7 @@ var listAgentProfiles = (options) => (options.client ?? client).get({
|
|
|
5069
5118
|
name: "__Host-omnara_session",
|
|
5070
5119
|
type: "apiKey"
|
|
5071
5120
|
}],
|
|
5072
|
-
url: "/
|
|
5121
|
+
url: "/orgs/{orgID}/projects/{projectID}/agent-profiles",
|
|
5073
5122
|
...options
|
|
5074
5123
|
});
|
|
5075
5124
|
var createAgentProfile = (options) => (options.client ?? client).post({
|
|
@@ -5087,7 +5136,7 @@ var createAgentProfile = (options) => (options.client ?? client).post({
|
|
|
5087
5136
|
},
|
|
5088
5137
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5089
5138
|
],
|
|
5090
|
-
url: "/
|
|
5139
|
+
url: "/orgs/{orgID}/projects/{projectID}/agent-profiles",
|
|
5091
5140
|
...options,
|
|
5092
5141
|
headers: {
|
|
5093
5142
|
"Content-Type": "application/json",
|
|
@@ -5109,7 +5158,7 @@ var deleteAgentProfile = (options) => (options.client ?? client).delete({
|
|
|
5109
5158
|
},
|
|
5110
5159
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5111
5160
|
],
|
|
5112
|
-
url: "/
|
|
5161
|
+
url: "/orgs/{orgID}/projects/{projectID}/agent-profiles/{agentProfileID}",
|
|
5113
5162
|
...options
|
|
5114
5163
|
});
|
|
5115
5164
|
var getAgentProfile = (options) => (options.client ?? client).get({
|
|
@@ -5123,7 +5172,7 @@ var getAgentProfile = (options) => (options.client ?? client).get({
|
|
|
5123
5172
|
name: "__Host-omnara_session",
|
|
5124
5173
|
type: "apiKey"
|
|
5125
5174
|
}],
|
|
5126
|
-
url: "/
|
|
5175
|
+
url: "/orgs/{orgID}/projects/{projectID}/agent-profiles/{agentProfileID}",
|
|
5127
5176
|
...options
|
|
5128
5177
|
});
|
|
5129
5178
|
var renameAgentProfile = (options) => (options.client ?? client).patch({
|
|
@@ -5141,7 +5190,7 @@ var renameAgentProfile = (options) => (options.client ?? client).patch({
|
|
|
5141
5190
|
},
|
|
5142
5191
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5143
5192
|
],
|
|
5144
|
-
url: "/
|
|
5193
|
+
url: "/orgs/{orgID}/projects/{projectID}/agent-profiles/{agentProfileID}",
|
|
5145
5194
|
...options,
|
|
5146
5195
|
headers: {
|
|
5147
5196
|
"Content-Type": "application/json",
|
|
@@ -5163,7 +5212,7 @@ var updateAgentProfile = (options) => (options.client ?? client).post({
|
|
|
5163
5212
|
},
|
|
5164
5213
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5165
5214
|
],
|
|
5166
|
-
url: "/
|
|
5215
|
+
url: "/orgs/{orgID}/projects/{projectID}/agent-profiles/{agentProfileID}/config",
|
|
5167
5216
|
...options,
|
|
5168
5217
|
headers: {
|
|
5169
5218
|
"Content-Type": "application/json",
|
|
@@ -5185,7 +5234,7 @@ var createIntegrationOAuthSetup = (options) => (options.client ?? client).post({
|
|
|
5185
5234
|
},
|
|
5186
5235
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5187
5236
|
],
|
|
5188
|
-
url: "/
|
|
5237
|
+
url: "/orgs/{orgID}/projects/{projectID}/agent-profiles/{agentProfileID}/integration-oauth/setup",
|
|
5189
5238
|
...options,
|
|
5190
5239
|
headers: {
|
|
5191
5240
|
"Content-Type": "application/json",
|
|
@@ -5207,7 +5256,7 @@ var createSlackSetup = (options) => (options.client ?? client).post({
|
|
|
5207
5256
|
},
|
|
5208
5257
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5209
5258
|
],
|
|
5210
|
-
url: "/
|
|
5259
|
+
url: "/orgs/{orgID}/projects/{projectID}/agent-profiles/{agentProfileID}/slack-setup",
|
|
5211
5260
|
...options,
|
|
5212
5261
|
headers: {
|
|
5213
5262
|
"Content-Type": "application/json",
|
|
@@ -5225,7 +5274,7 @@ var listCronTriggers = (options) => (options.client ?? client).get({
|
|
|
5225
5274
|
name: "__Host-omnara_session",
|
|
5226
5275
|
type: "apiKey"
|
|
5227
5276
|
}],
|
|
5228
|
-
url: "/
|
|
5277
|
+
url: "/orgs/{orgID}/projects/{projectID}/cron-triggers",
|
|
5229
5278
|
...options
|
|
5230
5279
|
});
|
|
5231
5280
|
var createCronTrigger = (options) => (options.client ?? client).post({
|
|
@@ -5243,7 +5292,7 @@ var createCronTrigger = (options) => (options.client ?? client).post({
|
|
|
5243
5292
|
},
|
|
5244
5293
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5245
5294
|
],
|
|
5246
|
-
url: "/
|
|
5295
|
+
url: "/orgs/{orgID}/projects/{projectID}/cron-triggers",
|
|
5247
5296
|
...options,
|
|
5248
5297
|
headers: {
|
|
5249
5298
|
"Content-Type": "application/json",
|
|
@@ -5265,7 +5314,7 @@ var deleteCronTrigger = (options) => (options.client ?? client).delete({
|
|
|
5265
5314
|
},
|
|
5266
5315
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5267
5316
|
],
|
|
5268
|
-
url: "/
|
|
5317
|
+
url: "/orgs/{orgID}/projects/{projectID}/cron-triggers/{cronTriggerID}",
|
|
5269
5318
|
...options
|
|
5270
5319
|
});
|
|
5271
5320
|
var getCronTrigger = (options) => (options.client ?? client).get({
|
|
@@ -5279,7 +5328,7 @@ var getCronTrigger = (options) => (options.client ?? client).get({
|
|
|
5279
5328
|
name: "__Host-omnara_session",
|
|
5280
5329
|
type: "apiKey"
|
|
5281
5330
|
}],
|
|
5282
|
-
url: "/
|
|
5331
|
+
url: "/orgs/{orgID}/projects/{projectID}/cron-triggers/{cronTriggerID}",
|
|
5283
5332
|
...options
|
|
5284
5333
|
});
|
|
5285
5334
|
var updateCronTrigger = (options) => (options.client ?? client).patch({
|
|
@@ -5297,7 +5346,7 @@ var updateCronTrigger = (options) => (options.client ?? client).patch({
|
|
|
5297
5346
|
},
|
|
5298
5347
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5299
5348
|
],
|
|
5300
|
-
url: "/
|
|
5349
|
+
url: "/orgs/{orgID}/projects/{projectID}/cron-triggers/{cronTriggerID}",
|
|
5301
5350
|
...options,
|
|
5302
5351
|
headers: {
|
|
5303
5352
|
"Content-Type": "application/json",
|
|
@@ -5315,7 +5364,7 @@ var listAgents = (options) => (options.client ?? client).get({
|
|
|
5315
5364
|
name: "__Host-omnara_session",
|
|
5316
5365
|
type: "apiKey"
|
|
5317
5366
|
}],
|
|
5318
|
-
url: "/
|
|
5367
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents",
|
|
5319
5368
|
...options
|
|
5320
5369
|
});
|
|
5321
5370
|
var createAgent = (options) => (options.client ?? client).post({
|
|
@@ -5333,7 +5382,7 @@ var createAgent = (options) => (options.client ?? client).post({
|
|
|
5333
5382
|
},
|
|
5334
5383
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5335
5384
|
],
|
|
5336
|
-
url: "/
|
|
5385
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents",
|
|
5337
5386
|
...options,
|
|
5338
5387
|
headers: {
|
|
5339
5388
|
"Content-Type": "application/json",
|
|
@@ -5351,7 +5400,7 @@ var getAgent = (options) => (options.client ?? client).get({
|
|
|
5351
5400
|
name: "__Host-omnara_session",
|
|
5352
5401
|
type: "apiKey"
|
|
5353
5402
|
}],
|
|
5354
|
-
url: "/
|
|
5403
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}",
|
|
5355
5404
|
...options
|
|
5356
5405
|
});
|
|
5357
5406
|
var archiveAgent = (options) => (options.client ?? client).post({
|
|
@@ -5369,7 +5418,7 @@ var archiveAgent = (options) => (options.client ?? client).post({
|
|
|
5369
5418
|
},
|
|
5370
5419
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5371
5420
|
],
|
|
5372
|
-
url: "/
|
|
5421
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}/archive",
|
|
5373
5422
|
...options
|
|
5374
5423
|
});
|
|
5375
5424
|
var updateAgentConfig = (options) => (options.client ?? client).post({
|
|
@@ -5387,7 +5436,7 @@ var updateAgentConfig = (options) => (options.client ?? client).post({
|
|
|
5387
5436
|
},
|
|
5388
5437
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5389
5438
|
],
|
|
5390
|
-
url: "/
|
|
5439
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}/config",
|
|
5391
5440
|
...options,
|
|
5392
5441
|
headers: {
|
|
5393
5442
|
"Content-Type": "application/json",
|
|
@@ -5409,7 +5458,7 @@ var createAgentInput = (options) => (options.client ?? client).post({
|
|
|
5409
5458
|
},
|
|
5410
5459
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5411
5460
|
],
|
|
5412
|
-
url: "/
|
|
5461
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}/inputs",
|
|
5413
5462
|
...options,
|
|
5414
5463
|
headers: {
|
|
5415
5464
|
"Content-Type": "application/json",
|
|
@@ -5427,7 +5476,7 @@ var listToolCalls = (options) => (options.client ?? client).get({
|
|
|
5427
5476
|
name: "__Host-omnara_session",
|
|
5428
5477
|
type: "apiKey"
|
|
5429
5478
|
}],
|
|
5430
|
-
url: "/
|
|
5479
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}/tool-calls",
|
|
5431
5480
|
...options
|
|
5432
5481
|
});
|
|
5433
5482
|
var submitToolCallResult = (options) => (options.client ?? client).post({
|
|
@@ -5445,7 +5494,7 @@ var submitToolCallResult = (options) => (options.client ?? client).post({
|
|
|
5445
5494
|
},
|
|
5446
5495
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5447
5496
|
],
|
|
5448
|
-
url: "/
|
|
5497
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}/tool-calls/{toolCallID}/result",
|
|
5449
5498
|
...options,
|
|
5450
5499
|
headers: {
|
|
5451
5500
|
"Content-Type": "application/json",
|
|
@@ -5463,7 +5512,7 @@ var listTurns = (options) => (options.client ?? client).get({
|
|
|
5463
5512
|
name: "__Host-omnara_session",
|
|
5464
5513
|
type: "apiKey"
|
|
5465
5514
|
}],
|
|
5466
|
-
url: "/
|
|
5515
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}/turns",
|
|
5467
5516
|
...options
|
|
5468
5517
|
});
|
|
5469
5518
|
var listTurnEvents = (options) => (options.client ?? client).get({
|
|
@@ -5477,7 +5526,7 @@ var listTurnEvents = (options) => (options.client ?? client).get({
|
|
|
5477
5526
|
name: "__Host-omnara_session",
|
|
5478
5527
|
type: "apiKey"
|
|
5479
5528
|
}],
|
|
5480
|
-
url: "/
|
|
5529
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}/turns/{turnID}/events",
|
|
5481
5530
|
...options
|
|
5482
5531
|
});
|
|
5483
5532
|
var listEvents = (options) => (options.client ?? client).get({
|
|
@@ -5491,7 +5540,7 @@ var listEvents = (options) => (options.client ?? client).get({
|
|
|
5491
5540
|
name: "__Host-omnara_session",
|
|
5492
5541
|
type: "apiKey"
|
|
5493
5542
|
}],
|
|
5494
|
-
url: "/
|
|
5543
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}/events",
|
|
5495
5544
|
...options
|
|
5496
5545
|
});
|
|
5497
5546
|
var streamEvents = (options) => (options.client ?? client).sse.get({
|
|
@@ -5505,7 +5554,7 @@ var streamEvents = (options) => (options.client ?? client).sse.get({
|
|
|
5505
5554
|
name: "__Host-omnara_session",
|
|
5506
5555
|
type: "apiKey"
|
|
5507
5556
|
}],
|
|
5508
|
-
url: "/
|
|
5557
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}/events/stream",
|
|
5509
5558
|
...options
|
|
5510
5559
|
});
|
|
5511
5560
|
var cancelAgent = (options) => (options.client ?? client).post({
|
|
@@ -5523,7 +5572,7 @@ var cancelAgent = (options) => (options.client ?? client).post({
|
|
|
5523
5572
|
},
|
|
5524
5573
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5525
5574
|
],
|
|
5526
|
-
url: "/
|
|
5575
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}/cancel",
|
|
5527
5576
|
...options,
|
|
5528
5577
|
headers: {
|
|
5529
5578
|
"Content-Type": "application/json",
|
|
@@ -5541,7 +5590,7 @@ var listAgentInteractions = (options) => (options.client ?? client).get({
|
|
|
5541
5590
|
name: "__Host-omnara_session",
|
|
5542
5591
|
type: "apiKey"
|
|
5543
5592
|
}],
|
|
5544
|
-
url: "/
|
|
5593
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}/interactions",
|
|
5545
5594
|
...options
|
|
5546
5595
|
});
|
|
5547
5596
|
var resolveAgentInteraction = (options) => (options.client ?? client).post({
|
|
@@ -5559,7 +5608,7 @@ var resolveAgentInteraction = (options) => (options.client ?? client).post({
|
|
|
5559
5608
|
},
|
|
5560
5609
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5561
5610
|
],
|
|
5562
|
-
url: "/
|
|
5611
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}/interactions/{interactionID}/resolve",
|
|
5563
5612
|
...options,
|
|
5564
5613
|
headers: {
|
|
5565
5614
|
"Content-Type": "application/json",
|
|
@@ -5577,7 +5626,7 @@ var listQueuedBacklogInputs = (options) => (options.client ?? client).get({
|
|
|
5577
5626
|
name: "__Host-omnara_session",
|
|
5578
5627
|
type: "apiKey"
|
|
5579
5628
|
}],
|
|
5580
|
-
url: "/
|
|
5629
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}/inputs/backlog",
|
|
5581
5630
|
...options
|
|
5582
5631
|
});
|
|
5583
5632
|
var cancelQueuedBacklogInput = (options) => (options.client ?? client).post({
|
|
@@ -5595,7 +5644,7 @@ var cancelQueuedBacklogInput = (options) => (options.client ?? client).post({
|
|
|
5595
5644
|
},
|
|
5596
5645
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5597
5646
|
],
|
|
5598
|
-
url: "/
|
|
5647
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}/inputs/{inputID}/cancel",
|
|
5599
5648
|
...options
|
|
5600
5649
|
});
|
|
5601
5650
|
var moveQueuedBacklogInput = (options) => (options.client ?? client).post({
|
|
@@ -5613,7 +5662,7 @@ var moveQueuedBacklogInput = (options) => (options.client ?? client).post({
|
|
|
5613
5662
|
},
|
|
5614
5663
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5615
5664
|
],
|
|
5616
|
-
url: "/
|
|
5665
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}/inputs/{inputID}/move",
|
|
5617
5666
|
...options,
|
|
5618
5667
|
headers: {
|
|
5619
5668
|
"Content-Type": "application/json",
|
|
@@ -5635,7 +5684,7 @@ var promoteQueuedInputToSteering = (options) => (options.client ?? client).post(
|
|
|
5635
5684
|
},
|
|
5636
5685
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5637
5686
|
],
|
|
5638
|
-
url: "/
|
|
5687
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}/inputs/{inputID}/promote_to_steering",
|
|
5639
5688
|
...options,
|
|
5640
5689
|
headers: {
|
|
5641
5690
|
"Content-Type": "application/json",
|
|
@@ -5657,7 +5706,7 @@ var demoteSteeringInputToQueued = (options) => (options.client ?? client).post({
|
|
|
5657
5706
|
},
|
|
5658
5707
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5659
5708
|
],
|
|
5660
|
-
url: "/
|
|
5709
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}/inputs/{inputID}/demote_to_queued",
|
|
5661
5710
|
...options
|
|
5662
5711
|
});
|
|
5663
5712
|
var getArtifact = (options) => (options.client ?? client).get({
|
|
@@ -5671,7 +5720,7 @@ var getArtifact = (options) => (options.client ?? client).get({
|
|
|
5671
5720
|
name: "__Host-omnara_session",
|
|
5672
5721
|
type: "apiKey"
|
|
5673
5722
|
}],
|
|
5674
|
-
url: "/
|
|
5723
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}/artifacts/{artifactID}",
|
|
5675
5724
|
...options
|
|
5676
5725
|
});
|
|
5677
5726
|
var getArtifactContent = (options) => (options.client ?? client).get({
|
|
@@ -5685,7 +5734,7 @@ var getArtifactContent = (options) => (options.client ?? client).get({
|
|
|
5685
5734
|
name: "__Host-omnara_session",
|
|
5686
5735
|
type: "apiKey"
|
|
5687
5736
|
}],
|
|
5688
|
-
url: "/
|
|
5737
|
+
url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}/artifacts/{artifactID}/content",
|
|
5689
5738
|
...options
|
|
5690
5739
|
});
|
|
5691
5740
|
var listVisibleProjectMachines = (options) => (options.client ?? client).get({
|
|
@@ -5699,7 +5748,7 @@ var listVisibleProjectMachines = (options) => (options.client ?? client).get({
|
|
|
5699
5748
|
name: "__Host-omnara_session",
|
|
5700
5749
|
type: "apiKey"
|
|
5701
5750
|
}],
|
|
5702
|
-
url: "/
|
|
5751
|
+
url: "/orgs/{orgID}/projects/{projectID}/machines",
|
|
5703
5752
|
...options
|
|
5704
5753
|
});
|
|
5705
5754
|
var listProjectMachineGrants = (options) => (options.client ?? client).get({
|
|
@@ -5713,7 +5762,7 @@ var listProjectMachineGrants = (options) => (options.client ?? client).get({
|
|
|
5713
5762
|
name: "__Host-omnara_session",
|
|
5714
5763
|
type: "apiKey"
|
|
5715
5764
|
}],
|
|
5716
|
-
url: "/
|
|
5765
|
+
url: "/orgs/{orgID}/projects/{projectID}/machine-grants",
|
|
5717
5766
|
...options
|
|
5718
5767
|
});
|
|
5719
5768
|
var createProjectMachineGrant = (options) => (options.client ?? client).post({
|
|
@@ -5731,7 +5780,7 @@ var createProjectMachineGrant = (options) => (options.client ?? client).post({
|
|
|
5731
5780
|
},
|
|
5732
5781
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5733
5782
|
],
|
|
5734
|
-
url: "/
|
|
5783
|
+
url: "/orgs/{orgID}/projects/{projectID}/machine-grants",
|
|
5735
5784
|
...options,
|
|
5736
5785
|
headers: {
|
|
5737
5786
|
"Content-Type": "application/json",
|
|
@@ -5753,7 +5802,7 @@ var deleteProjectMachineGrant = (options) => (options.client ?? client).delete({
|
|
|
5753
5802
|
},
|
|
5754
5803
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5755
5804
|
],
|
|
5756
|
-
url: "/
|
|
5805
|
+
url: "/orgs/{orgID}/projects/{projectID}/machine-grants/{grantID}",
|
|
5757
5806
|
...options
|
|
5758
5807
|
});
|
|
5759
5808
|
var listProjectAvailableSecrets = (options) => (options.client ?? client).get({
|
|
@@ -5767,7 +5816,7 @@ var listProjectAvailableSecrets = (options) => (options.client ?? client).get({
|
|
|
5767
5816
|
name: "__Host-omnara_session",
|
|
5768
5817
|
type: "apiKey"
|
|
5769
5818
|
}],
|
|
5770
|
-
url: "/
|
|
5819
|
+
url: "/orgs/{orgID}/projects/{projectID}/secrets",
|
|
5771
5820
|
...options
|
|
5772
5821
|
});
|
|
5773
5822
|
var getProjectAvailableSecret = (options) => (options.client ?? client).get({
|
|
@@ -5781,7 +5830,7 @@ var getProjectAvailableSecret = (options) => (options.client ?? client).get({
|
|
|
5781
5830
|
name: "__Host-omnara_session",
|
|
5782
5831
|
type: "apiKey"
|
|
5783
5832
|
}],
|
|
5784
|
-
url: "/
|
|
5833
|
+
url: "/orgs/{orgID}/projects/{projectID}/secrets/{secretID}",
|
|
5785
5834
|
...options
|
|
5786
5835
|
});
|
|
5787
5836
|
var listActors = (options) => (options.client ?? client).get({
|
|
@@ -5795,7 +5844,7 @@ var listActors = (options) => (options.client ?? client).get({
|
|
|
5795
5844
|
name: "__Host-omnara_session",
|
|
5796
5845
|
type: "apiKey"
|
|
5797
5846
|
}],
|
|
5798
|
-
url: "/
|
|
5847
|
+
url: "/orgs/{orgID}/projects/{projectID}/actors",
|
|
5799
5848
|
...options
|
|
5800
5849
|
});
|
|
5801
5850
|
var putActor = (options) => (options.client ?? client).put({
|
|
@@ -5813,7 +5862,7 @@ var putActor = (options) => (options.client ?? client).put({
|
|
|
5813
5862
|
},
|
|
5814
5863
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5815
5864
|
],
|
|
5816
|
-
url: "/
|
|
5865
|
+
url: "/orgs/{orgID}/projects/{projectID}/actors",
|
|
5817
5866
|
...options,
|
|
5818
5867
|
headers: {
|
|
5819
5868
|
"Content-Type": "application/json",
|
|
@@ -5831,7 +5880,7 @@ var getActor = (options) => (options.client ?? client).get({
|
|
|
5831
5880
|
name: "__Host-omnara_session",
|
|
5832
5881
|
type: "apiKey"
|
|
5833
5882
|
}],
|
|
5834
|
-
url: "/
|
|
5883
|
+
url: "/orgs/{orgID}/projects/{projectID}/actors/{actorID}",
|
|
5835
5884
|
...options
|
|
5836
5885
|
});
|
|
5837
5886
|
var listVisibleMachines = (options) => (options.client ?? client).get({
|
|
@@ -5845,7 +5894,7 @@ var listVisibleMachines = (options) => (options.client ?? client).get({
|
|
|
5845
5894
|
name: "__Host-omnara_session",
|
|
5846
5895
|
type: "apiKey"
|
|
5847
5896
|
}],
|
|
5848
|
-
url: "/
|
|
5897
|
+
url: "/orgs/{orgID}/machines",
|
|
5849
5898
|
...options
|
|
5850
5899
|
});
|
|
5851
5900
|
var createMachine = (options) => (options.client ?? client).post({
|
|
@@ -5863,7 +5912,7 @@ var createMachine = (options) => (options.client ?? client).post({
|
|
|
5863
5912
|
},
|
|
5864
5913
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5865
5914
|
],
|
|
5866
|
-
url: "/
|
|
5915
|
+
url: "/orgs/{orgID}/machines",
|
|
5867
5916
|
...options,
|
|
5868
5917
|
headers: {
|
|
5869
5918
|
"Content-Type": "application/json",
|
|
@@ -5885,7 +5934,7 @@ var connectByoMachine = (options) => (options.client ?? client).post({
|
|
|
5885
5934
|
},
|
|
5886
5935
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5887
5936
|
],
|
|
5888
|
-
url: "/
|
|
5937
|
+
url: "/orgs/{orgID}/machines/connect",
|
|
5889
5938
|
...options,
|
|
5890
5939
|
headers: {
|
|
5891
5940
|
"Content-Type": "application/json",
|
|
@@ -5907,7 +5956,7 @@ var deleteMachine = (options) => (options.client ?? client).delete({
|
|
|
5907
5956
|
},
|
|
5908
5957
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5909
5958
|
],
|
|
5910
|
-
url: "/
|
|
5959
|
+
url: "/orgs/{orgID}/machines/{machineID}",
|
|
5911
5960
|
...options
|
|
5912
5961
|
});
|
|
5913
5962
|
var getMachine = (options) => (options.client ?? client).get({
|
|
@@ -5921,7 +5970,7 @@ var getMachine = (options) => (options.client ?? client).get({
|
|
|
5921
5970
|
name: "__Host-omnara_session",
|
|
5922
5971
|
type: "apiKey"
|
|
5923
5972
|
}],
|
|
5924
|
-
url: "/
|
|
5973
|
+
url: "/orgs/{orgID}/machines/{machineID}",
|
|
5925
5974
|
...options
|
|
5926
5975
|
});
|
|
5927
5976
|
var updateMachine = (options) => (options.client ?? client).patch({
|
|
@@ -5939,7 +5988,7 @@ var updateMachine = (options) => (options.client ?? client).patch({
|
|
|
5939
5988
|
},
|
|
5940
5989
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5941
5990
|
],
|
|
5942
|
-
url: "/
|
|
5991
|
+
url: "/orgs/{orgID}/machines/{machineID}",
|
|
5943
5992
|
...options,
|
|
5944
5993
|
headers: {
|
|
5945
5994
|
"Content-Type": "application/json",
|
|
@@ -5957,7 +6006,7 @@ var listModelProviderConfigs = (options) => (options.client ?? client).get({
|
|
|
5957
6006
|
name: "__Host-omnara_session",
|
|
5958
6007
|
type: "apiKey"
|
|
5959
6008
|
}],
|
|
5960
|
-
url: "/
|
|
6009
|
+
url: "/orgs/{orgID}/model-provider-configs",
|
|
5961
6010
|
...options
|
|
5962
6011
|
});
|
|
5963
6012
|
var createModelProviderConfig = (options) => (options.client ?? client).post({
|
|
@@ -5975,7 +6024,7 @@ var createModelProviderConfig = (options) => (options.client ?? client).post({
|
|
|
5975
6024
|
},
|
|
5976
6025
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5977
6026
|
],
|
|
5978
|
-
url: "/
|
|
6027
|
+
url: "/orgs/{orgID}/model-provider-configs",
|
|
5979
6028
|
...options,
|
|
5980
6029
|
headers: {
|
|
5981
6030
|
"Content-Type": "application/json",
|
|
@@ -5997,7 +6046,7 @@ var deleteModelProviderConfig = (options) => (options.client ?? client).delete({
|
|
|
5997
6046
|
},
|
|
5998
6047
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5999
6048
|
],
|
|
6000
|
-
url: "/
|
|
6049
|
+
url: "/orgs/{orgID}/model-provider-configs/{modelProviderConfigID}",
|
|
6001
6050
|
...options
|
|
6002
6051
|
});
|
|
6003
6052
|
var getModelProviderConfig = (options) => (options.client ?? client).get({
|
|
@@ -6011,7 +6060,7 @@ var getModelProviderConfig = (options) => (options.client ?? client).get({
|
|
|
6011
6060
|
name: "__Host-omnara_session",
|
|
6012
6061
|
type: "apiKey"
|
|
6013
6062
|
}],
|
|
6014
|
-
url: "/
|
|
6063
|
+
url: "/orgs/{orgID}/model-provider-configs/{modelProviderConfigID}",
|
|
6015
6064
|
...options
|
|
6016
6065
|
});
|
|
6017
6066
|
var updateModelProviderConfig = (options) => (options.client ?? client).put({
|
|
@@ -6029,7 +6078,7 @@ var updateModelProviderConfig = (options) => (options.client ?? client).put({
|
|
|
6029
6078
|
},
|
|
6030
6079
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
6031
6080
|
],
|
|
6032
|
-
url: "/
|
|
6081
|
+
url: "/orgs/{orgID}/model-provider-configs/{modelProviderConfigID}",
|
|
6033
6082
|
...options,
|
|
6034
6083
|
headers: {
|
|
6035
6084
|
"Content-Type": "application/json",
|
|
@@ -6047,7 +6096,7 @@ var getModelCatalog = (options) => (options.client ?? client).get({
|
|
|
6047
6096
|
name: "__Host-omnara_session",
|
|
6048
6097
|
type: "apiKey"
|
|
6049
6098
|
}],
|
|
6050
|
-
url: "/
|
|
6099
|
+
url: "/orgs/{orgID}/model-provider-configs/{modelProviderConfigID}/model-catalog",
|
|
6051
6100
|
...options
|
|
6052
6101
|
});
|
|
6053
6102
|
var listConfiguredModels = (options) => (options.client ?? client).get({
|
|
@@ -6061,7 +6110,7 @@ var listConfiguredModels = (options) => (options.client ?? client).get({
|
|
|
6061
6110
|
name: "__Host-omnara_session",
|
|
6062
6111
|
type: "apiKey"
|
|
6063
6112
|
}],
|
|
6064
|
-
url: "/
|
|
6113
|
+
url: "/orgs/{orgID}/model-provider-configs/{modelProviderConfigID}/models",
|
|
6065
6114
|
...options
|
|
6066
6115
|
});
|
|
6067
6116
|
var createConfiguredModel = (options) => (options.client ?? client).post({
|
|
@@ -6079,7 +6128,7 @@ var createConfiguredModel = (options) => (options.client ?? client).post({
|
|
|
6079
6128
|
},
|
|
6080
6129
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
6081
6130
|
],
|
|
6082
|
-
url: "/
|
|
6131
|
+
url: "/orgs/{orgID}/model-provider-configs/{modelProviderConfigID}/models",
|
|
6083
6132
|
...options,
|
|
6084
6133
|
headers: {
|
|
6085
6134
|
"Content-Type": "application/json",
|
|
@@ -6101,7 +6150,7 @@ var deleteConfiguredModel = (options) => (options.client ?? client).delete({
|
|
|
6101
6150
|
},
|
|
6102
6151
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
6103
6152
|
],
|
|
6104
|
-
url: "/
|
|
6153
|
+
url: "/orgs/{orgID}/model-provider-configs/{modelProviderConfigID}/models/{configuredModelID}",
|
|
6105
6154
|
...options
|
|
6106
6155
|
});
|
|
6107
6156
|
var updateConfiguredModel = (options) => (options.client ?? client).put({
|
|
@@ -6119,7 +6168,7 @@ var updateConfiguredModel = (options) => (options.client ?? client).put({
|
|
|
6119
6168
|
},
|
|
6120
6169
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
6121
6170
|
],
|
|
6122
|
-
url: "/
|
|
6171
|
+
url: "/orgs/{orgID}/model-provider-configs/{modelProviderConfigID}/models/{configuredModelID}",
|
|
6123
6172
|
...options,
|
|
6124
6173
|
headers: {
|
|
6125
6174
|
"Content-Type": "application/json",
|
|
@@ -6137,7 +6186,7 @@ var listProjectModelGrants = (options) => (options.client ?? client).get({
|
|
|
6137
6186
|
name: "__Host-omnara_session",
|
|
6138
6187
|
type: "apiKey"
|
|
6139
6188
|
}],
|
|
6140
|
-
url: "/
|
|
6189
|
+
url: "/orgs/{orgID}/projects/{projectID}/model-grants",
|
|
6141
6190
|
...options
|
|
6142
6191
|
});
|
|
6143
6192
|
var createProjectModelGrant = (options) => (options.client ?? client).post({
|
|
@@ -6155,7 +6204,7 @@ var createProjectModelGrant = (options) => (options.client ?? client).post({
|
|
|
6155
6204
|
},
|
|
6156
6205
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
6157
6206
|
],
|
|
6158
|
-
url: "/
|
|
6207
|
+
url: "/orgs/{orgID}/projects/{projectID}/model-grants",
|
|
6159
6208
|
...options,
|
|
6160
6209
|
headers: {
|
|
6161
6210
|
"Content-Type": "application/json",
|
|
@@ -6177,7 +6226,7 @@ var deleteProjectModelGrant = (options) => (options.client ?? client).delete({
|
|
|
6177
6226
|
},
|
|
6178
6227
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
6179
6228
|
],
|
|
6180
|
-
url: "/
|
|
6229
|
+
url: "/orgs/{orgID}/projects/{projectID}/model-grants/{modelGrantID}",
|
|
6181
6230
|
...options
|
|
6182
6231
|
});
|
|
6183
6232
|
var updateProjectModelGrant = (options) => (options.client ?? client).patch({
|
|
@@ -6195,7 +6244,7 @@ var updateProjectModelGrant = (options) => (options.client ?? client).patch({
|
|
|
6195
6244
|
},
|
|
6196
6245
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
6197
6246
|
],
|
|
6198
|
-
url: "/
|
|
6247
|
+
url: "/orgs/{orgID}/projects/{projectID}/model-grants/{modelGrantID}",
|
|
6199
6248
|
...options,
|
|
6200
6249
|
headers: {
|
|
6201
6250
|
"Content-Type": "application/json",
|
|
@@ -6213,7 +6262,7 @@ var listMachinePools = (options) => (options.client ?? client).get({
|
|
|
6213
6262
|
name: "__Host-omnara_session",
|
|
6214
6263
|
type: "apiKey"
|
|
6215
6264
|
}],
|
|
6216
|
-
url: "/
|
|
6265
|
+
url: "/orgs/{orgID}/machine-pools",
|
|
6217
6266
|
...options
|
|
6218
6267
|
});
|
|
6219
6268
|
var createMachinePool = (options) => (options.client ?? client).post({
|
|
@@ -6231,7 +6280,7 @@ var createMachinePool = (options) => (options.client ?? client).post({
|
|
|
6231
6280
|
},
|
|
6232
6281
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
6233
6282
|
],
|
|
6234
|
-
url: "/
|
|
6283
|
+
url: "/orgs/{orgID}/machine-pools",
|
|
6235
6284
|
...options,
|
|
6236
6285
|
headers: {
|
|
6237
6286
|
"Content-Type": "application/json",
|
|
@@ -6253,7 +6302,7 @@ var deleteMachinePool = (options) => (options.client ?? client).delete({
|
|
|
6253
6302
|
},
|
|
6254
6303
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
6255
6304
|
],
|
|
6256
|
-
url: "/
|
|
6305
|
+
url: "/orgs/{orgID}/machine-pools/{poolID}",
|
|
6257
6306
|
...options
|
|
6258
6307
|
});
|
|
6259
6308
|
var getMachinePool = (options) => (options.client ?? client).get({
|
|
@@ -6267,7 +6316,7 @@ var getMachinePool = (options) => (options.client ?? client).get({
|
|
|
6267
6316
|
name: "__Host-omnara_session",
|
|
6268
6317
|
type: "apiKey"
|
|
6269
6318
|
}],
|
|
6270
|
-
url: "/
|
|
6319
|
+
url: "/orgs/{orgID}/machine-pools/{poolID}",
|
|
6271
6320
|
...options
|
|
6272
6321
|
});
|
|
6273
6322
|
var updateMachinePool = (options) => (options.client ?? client).put({
|
|
@@ -6285,7 +6334,7 @@ var updateMachinePool = (options) => (options.client ?? client).put({
|
|
|
6285
6334
|
},
|
|
6286
6335
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
6287
6336
|
],
|
|
6288
|
-
url: "/
|
|
6337
|
+
url: "/orgs/{orgID}/machine-pools/{poolID}",
|
|
6289
6338
|
...options,
|
|
6290
6339
|
headers: {
|
|
6291
6340
|
"Content-Type": "application/json",
|
|
@@ -6303,7 +6352,7 @@ var listProjectMachinePoolGrants = (options) => (options.client ?? client).get({
|
|
|
6303
6352
|
name: "__Host-omnara_session",
|
|
6304
6353
|
type: "apiKey"
|
|
6305
6354
|
}],
|
|
6306
|
-
url: "/
|
|
6355
|
+
url: "/orgs/{orgID}/projects/{projectID}/machine-pool-grants",
|
|
6307
6356
|
...options
|
|
6308
6357
|
});
|
|
6309
6358
|
var createProjectMachinePoolGrant = (options) => (options.client ?? client).post({
|
|
@@ -6321,7 +6370,7 @@ var createProjectMachinePoolGrant = (options) => (options.client ?? client).post
|
|
|
6321
6370
|
},
|
|
6322
6371
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
6323
6372
|
],
|
|
6324
|
-
url: "/
|
|
6373
|
+
url: "/orgs/{orgID}/projects/{projectID}/machine-pool-grants",
|
|
6325
6374
|
...options,
|
|
6326
6375
|
headers: {
|
|
6327
6376
|
"Content-Type": "application/json",
|
|
@@ -6343,7 +6392,7 @@ var deleteProjectMachinePoolGrant = (options) => (options.client ?? client).dele
|
|
|
6343
6392
|
},
|
|
6344
6393
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
6345
6394
|
],
|
|
6346
|
-
url: "/
|
|
6395
|
+
url: "/orgs/{orgID}/projects/{projectID}/machine-pool-grants/{poolGrantID}",
|
|
6347
6396
|
...options
|
|
6348
6397
|
});
|
|
6349
6398
|
var getProjectMachinePoolGrant = (options) => (options.client ?? client).get({
|
|
@@ -6357,7 +6406,7 @@ var getProjectMachinePoolGrant = (options) => (options.client ?? client).get({
|
|
|
6357
6406
|
name: "__Host-omnara_session",
|
|
6358
6407
|
type: "apiKey"
|
|
6359
6408
|
}],
|
|
6360
|
-
url: "/
|
|
6409
|
+
url: "/orgs/{orgID}/projects/{projectID}/machine-pool-grants/{poolGrantID}",
|
|
6361
6410
|
...options
|
|
6362
6411
|
});
|
|
6363
6412
|
var updateProjectMachinePoolGrant = (options) => (options.client ?? client).patch({
|
|
@@ -6375,7 +6424,7 @@ var updateProjectMachinePoolGrant = (options) => (options.client ?? client).patc
|
|
|
6375
6424
|
},
|
|
6376
6425
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
6377
6426
|
],
|
|
6378
|
-
url: "/
|
|
6427
|
+
url: "/orgs/{orgID}/projects/{projectID}/machine-pool-grants/{poolGrantID}",
|
|
6379
6428
|
...options,
|
|
6380
6429
|
headers: {
|
|
6381
6430
|
"Content-Type": "application/json",
|
|
@@ -6393,7 +6442,7 @@ var listByoMachineDaemonTokens = (options) => (options.client ?? client).get({
|
|
|
6393
6442
|
name: "__Host-omnara_session",
|
|
6394
6443
|
type: "apiKey"
|
|
6395
6444
|
}],
|
|
6396
|
-
url: "/
|
|
6445
|
+
url: "/orgs/{orgID}/machines/{machineID}/daemon-tokens",
|
|
6397
6446
|
...options
|
|
6398
6447
|
});
|
|
6399
6448
|
var createByoMachineDaemonToken = (options) => (options.client ?? client).post({
|
|
@@ -6411,7 +6460,7 @@ var createByoMachineDaemonToken = (options) => (options.client ?? client).post({
|
|
|
6411
6460
|
},
|
|
6412
6461
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
6413
6462
|
],
|
|
6414
|
-
url: "/
|
|
6463
|
+
url: "/orgs/{orgID}/machines/{machineID}/daemon-tokens",
|
|
6415
6464
|
...options,
|
|
6416
6465
|
headers: {
|
|
6417
6466
|
"Content-Type": "application/json",
|
|
@@ -6433,7 +6482,7 @@ var revokeMachineDaemonToken = (options) => (options.client ?? client).post({
|
|
|
6433
6482
|
},
|
|
6434
6483
|
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
6435
6484
|
],
|
|
6436
|
-
url: "/
|
|
6485
|
+
url: "/orgs/{orgID}/machines/{machineID}/daemon-tokens/{tokenID}/revoke",
|
|
6437
6486
|
...options
|
|
6438
6487
|
});
|
|
6439
6488
|
var registerMachineDaemonRuntime = (options) => (options.client ?? client).post({
|
|
@@ -6443,7 +6492,7 @@ var registerMachineDaemonRuntime = (options) => (options.client ?? client).post(
|
|
|
6443
6492
|
scheme: "bearer",
|
|
6444
6493
|
type: "http"
|
|
6445
6494
|
}],
|
|
6446
|
-
url: "/
|
|
6495
|
+
url: "/daemon/runtimes",
|
|
6447
6496
|
...options,
|
|
6448
6497
|
headers: {
|
|
6449
6498
|
"Content-Type": "application/json",
|
|
@@ -6456,7 +6505,7 @@ var socketMachineDaemonRuntime = (options) => (options.client ?? client).get({
|
|
|
6456
6505
|
scheme: "bearer",
|
|
6457
6506
|
type: "http"
|
|
6458
6507
|
}],
|
|
6459
|
-
url: "/
|
|
6508
|
+
url: "/daemon/runtimes/{runtimeID}/socket",
|
|
6460
6509
|
...options
|
|
6461
6510
|
});
|
|
6462
6511
|
var endMachineDaemonRuntime = (options) => (options.client ?? client).post({
|
|
@@ -6466,7 +6515,7 @@ var endMachineDaemonRuntime = (options) => (options.client ?? client).post({
|
|
|
6466
6515
|
scheme: "bearer",
|
|
6467
6516
|
type: "http"
|
|
6468
6517
|
}],
|
|
6469
|
-
url: "/
|
|
6518
|
+
url: "/daemon/runtimes/{runtimeID}/end",
|
|
6470
6519
|
...options
|
|
6471
6520
|
});
|
|
6472
6521
|
var sleepMachineDaemonRuntime = (options) => (options.client ?? client).post({
|
|
@@ -6476,7 +6525,7 @@ var sleepMachineDaemonRuntime = (options) => (options.client ?? client).post({
|
|
|
6476
6525
|
scheme: "bearer",
|
|
6477
6526
|
type: "http"
|
|
6478
6527
|
}],
|
|
6479
|
-
url: "/
|
|
6528
|
+
url: "/daemon/runtimes/{runtimeID}/sleep",
|
|
6480
6529
|
...options
|
|
6481
6530
|
});
|
|
6482
6531
|
var getDaemonSkillArchive = (options) => (options.client ?? client).get({
|
|
@@ -6486,7 +6535,7 @@ var getDaemonSkillArchive = (options) => (options.client ?? client).get({
|
|
|
6486
6535
|
scheme: "bearer",
|
|
6487
6536
|
type: "http"
|
|
6488
6537
|
}],
|
|
6489
|
-
url: "/
|
|
6538
|
+
url: "/daemon/skills/{skillID}/archive",
|
|
6490
6539
|
...options
|
|
6491
6540
|
});
|
|
6492
6541
|
var uploadDaemonArtifact = (options) => (options.client ?? client).post({
|
|
@@ -6497,7 +6546,7 @@ var uploadDaemonArtifact = (options) => (options.client ?? client).post({
|
|
|
6497
6546
|
scheme: "bearer",
|
|
6498
6547
|
type: "http"
|
|
6499
6548
|
}],
|
|
6500
|
-
url: "/
|
|
6549
|
+
url: "/daemon/tool-calls/{toolCallID}/artifact",
|
|
6501
6550
|
...options,
|
|
6502
6551
|
headers: {
|
|
6503
6552
|
"Content-Type": "application/octet-stream",
|
|
@@ -6511,7 +6560,7 @@ var downloadDaemonArtifact = (options) => (options.client ?? client).get({
|
|
|
6511
6560
|
scheme: "bearer",
|
|
6512
6561
|
type: "http"
|
|
6513
6562
|
}],
|
|
6514
|
-
url: "/
|
|
6563
|
+
url: "/daemon/tool-calls/{toolCallID}/artifacts/{artifactID}/content",
|
|
6515
6564
|
...options
|
|
6516
6565
|
});
|
|
6517
6566
|
|
|
@@ -6564,7 +6613,9 @@ var ApiError = class _ApiError extends Error {
|
|
|
6564
6613
|
data = void 0;
|
|
6565
6614
|
}
|
|
6566
6615
|
if (data && typeof data === "object") {
|
|
6567
|
-
if ("
|
|
6616
|
+
if ("error_description" in data && typeof data.error_description === "string") {
|
|
6617
|
+
message = data.error_description;
|
|
6618
|
+
} else if ("error" in data && typeof data.error === "string") {
|
|
6568
6619
|
message = data.error;
|
|
6569
6620
|
}
|
|
6570
6621
|
if ("code" in data && typeof data.code === "string") {
|
|
@@ -6609,7 +6660,7 @@ function createOmnaraClient(options = {}) {
|
|
|
6609
6660
|
})
|
|
6610
6661
|
);
|
|
6611
6662
|
client2.setConfig({
|
|
6612
|
-
baseUrl: options.baseUrl ??
|
|
6663
|
+
baseUrl: options.baseUrl ?? client.getConfig().baseUrl,
|
|
6613
6664
|
credentials: options.credentials,
|
|
6614
6665
|
headers: options.headers
|
|
6615
6666
|
});
|
|
@@ -6630,6 +6681,15 @@ function createOmnaraClient(options = {}) {
|
|
|
6630
6681
|
|
|
6631
6682
|
// ../sdk/src/device.ts
|
|
6632
6683
|
import * as z3 from "zod";
|
|
6684
|
+
var OMNARA_CLI_OAUTH_CLIENT_ID = "omnara-cli";
|
|
6685
|
+
var OAUTH_DEVICE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
|
|
6686
|
+
var zAuthorizationServerMetadata = z3.object({
|
|
6687
|
+
issuer: z3.url(),
|
|
6688
|
+
device_authorization_endpoint: z3.url(),
|
|
6689
|
+
token_endpoint: z3.url(),
|
|
6690
|
+
grant_types_supported: z3.array(z3.string()),
|
|
6691
|
+
token_endpoint_auth_methods_supported: z3.array(z3.string())
|
|
6692
|
+
});
|
|
6633
6693
|
var zDeviceAuthStartResponse = z3.object({
|
|
6634
6694
|
device_code: z3.string().min(1),
|
|
6635
6695
|
user_code: z3.string().min(1),
|
|
@@ -6638,11 +6698,9 @@ var zDeviceAuthStartResponse = z3.object({
|
|
|
6638
6698
|
expires_in: z3.number().int().positive(),
|
|
6639
6699
|
interval: z3.number().int().positive()
|
|
6640
6700
|
});
|
|
6641
|
-
var
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
var zDeviceAuthFailureResponse = z3.object({
|
|
6645
|
-
error: z3.enum(["access_denied", "expired_token"])
|
|
6701
|
+
var zDeviceAuthErrorResponse = z3.object({
|
|
6702
|
+
error: z3.string().min(1),
|
|
6703
|
+
error_description: z3.string().optional()
|
|
6646
6704
|
});
|
|
6647
6705
|
var zDeviceAuthApprovedResponse = z3.object({
|
|
6648
6706
|
access_token: z3.string().min(1),
|
|
@@ -6660,29 +6718,55 @@ var DeviceAuthError = class extends Error {
|
|
|
6660
6718
|
this.code = code;
|
|
6661
6719
|
}
|
|
6662
6720
|
};
|
|
6663
|
-
async function
|
|
6664
|
-
return fetchImpl(
|
|
6721
|
+
async function postOAuthForm(fetchImpl, endpoint, body) {
|
|
6722
|
+
return fetchImpl(endpoint, {
|
|
6665
6723
|
method: "POST",
|
|
6666
|
-
headers: {
|
|
6667
|
-
|
|
6724
|
+
headers: {
|
|
6725
|
+
Accept: "application/json",
|
|
6726
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
6727
|
+
},
|
|
6728
|
+
body: new URLSearchParams(body).toString()
|
|
6668
6729
|
});
|
|
6669
6730
|
}
|
|
6731
|
+
function normalizeIssuer(raw) {
|
|
6732
|
+
const issuer = new URL(raw);
|
|
6733
|
+
if (issuer.username !== "" || issuer.password !== "" || issuer.pathname !== "/" || issuer.search !== "" || issuer.hash !== "") {
|
|
6734
|
+
throw new Error("authorization server issuer must be an origin");
|
|
6735
|
+
}
|
|
6736
|
+
return issuer.origin;
|
|
6737
|
+
}
|
|
6670
6738
|
async function startDeviceAuth(options) {
|
|
6671
|
-
const
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
);
|
|
6739
|
+
const fetchImpl = options.fetch ?? fetch;
|
|
6740
|
+
const expectedIssuer = normalizeIssuer(options.issuerUrl);
|
|
6741
|
+
const metadataUrl = new URL("/.well-known/oauth-authorization-server", `${expectedIssuer}/`);
|
|
6742
|
+
const metadataResponse = await fetchImpl(metadataUrl, { headers: { Accept: "application/json" } });
|
|
6743
|
+
if (!metadataResponse.ok) throw await ApiError.fromResponse(metadataResponse);
|
|
6744
|
+
const metadata = zAuthorizationServerMetadata.parse(await metadataResponse.json());
|
|
6745
|
+
if (normalizeIssuer(metadata.issuer) !== expectedIssuer) {
|
|
6746
|
+
throw new Error(
|
|
6747
|
+
`authorization server issuer mismatch: expected ${expectedIssuer}, received ${metadata.issuer}`
|
|
6748
|
+
);
|
|
6749
|
+
}
|
|
6750
|
+
if (!metadata.grant_types_supported.includes(OAUTH_DEVICE_GRANT_TYPE)) {
|
|
6751
|
+
throw new Error("authorization server does not support the OAuth device grant");
|
|
6752
|
+
}
|
|
6753
|
+
if (!metadata.token_endpoint_auth_methods_supported.includes("none")) {
|
|
6754
|
+
throw new Error("authorization server does not support public OAuth clients");
|
|
6755
|
+
}
|
|
6756
|
+
const body = { client_id: options.clientId };
|
|
6757
|
+
if (options.tokenName !== void 0) body.token_name = options.tokenName;
|
|
6758
|
+
const response = await postOAuthForm(fetchImpl, metadata.device_authorization_endpoint, body);
|
|
6677
6759
|
if (!response.ok) throw await ApiError.fromResponse(response);
|
|
6678
6760
|
const data = zDeviceAuthStartResponse.parse(await response.json());
|
|
6679
6761
|
return {
|
|
6680
6762
|
deviceCode: data.device_code,
|
|
6681
6763
|
userCode: data.user_code,
|
|
6682
|
-
verificationUri: new URL(data.verification_uri,
|
|
6683
|
-
verificationUriComplete: new URL(data.verification_uri_complete,
|
|
6764
|
+
verificationUri: new URL(data.verification_uri, metadata.issuer).toString(),
|
|
6765
|
+
verificationUriComplete: new URL(data.verification_uri_complete, metadata.issuer).toString(),
|
|
6684
6766
|
expiresInSeconds: data.expires_in,
|
|
6685
|
-
intervalSeconds: data.interval
|
|
6767
|
+
intervalSeconds: data.interval,
|
|
6768
|
+
tokenEndpoint: metadata.token_endpoint,
|
|
6769
|
+
clientId: options.clientId
|
|
6686
6770
|
};
|
|
6687
6771
|
}
|
|
6688
6772
|
function defaultSleep(seconds) {
|
|
@@ -6694,37 +6778,39 @@ async function pollDeviceAuthToken(options) {
|
|
|
6694
6778
|
let interval = options.intervalSeconds;
|
|
6695
6779
|
while (true) {
|
|
6696
6780
|
await sleep2(interval);
|
|
6697
|
-
const response = await
|
|
6698
|
-
|
|
6699
|
-
options.
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
device_code: options.deviceCode
|
|
6703
|
-
}
|
|
6704
|
-
);
|
|
6781
|
+
const response = await postOAuthForm(fetchImpl, options.tokenEndpoint, {
|
|
6782
|
+
grant_type: OAUTH_DEVICE_GRANT_TYPE,
|
|
6783
|
+
device_code: options.deviceCode,
|
|
6784
|
+
client_id: options.clientId
|
|
6785
|
+
});
|
|
6705
6786
|
if (response.status === 200) {
|
|
6706
6787
|
return zDeviceAuthApprovedResponse.parse(await response.json()).access_token;
|
|
6707
6788
|
}
|
|
6708
|
-
if (response.status === 202) {
|
|
6709
|
-
interval = zDeviceAuthWaitingResponse.parse(await response.json()).interval;
|
|
6710
|
-
continue;
|
|
6711
|
-
}
|
|
6712
6789
|
if (response.status === 400) {
|
|
6713
|
-
const failure =
|
|
6790
|
+
const failure = zDeviceAuthErrorResponse.safeParse(
|
|
6714
6791
|
await response.clone().json().catch(() => void 0)
|
|
6715
6792
|
);
|
|
6716
|
-
if (failure.success)
|
|
6793
|
+
if (failure.success) {
|
|
6794
|
+
if (failure.data.error === "authorization_pending") continue;
|
|
6795
|
+
if (failure.data.error === "slow_down") {
|
|
6796
|
+
interval += 5;
|
|
6797
|
+
continue;
|
|
6798
|
+
}
|
|
6799
|
+
if (failure.data.error === "access_denied" || failure.data.error === "expired_token") {
|
|
6800
|
+
throw new DeviceAuthError(failure.data.error);
|
|
6801
|
+
}
|
|
6802
|
+
}
|
|
6717
6803
|
}
|
|
6718
6804
|
throw await ApiError.fromResponse(response);
|
|
6719
6805
|
}
|
|
6720
6806
|
}
|
|
6721
6807
|
|
|
6722
|
-
// src/config.ts
|
|
6808
|
+
// src/config-file.ts
|
|
6809
|
+
import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
6810
|
+
import { homedir } from "node:os";
|
|
6811
|
+
import { dirname, join } from "node:path";
|
|
6723
6812
|
import * as z5 from "zod";
|
|
6724
6813
|
|
|
6725
|
-
// src/interactive.ts
|
|
6726
|
-
import { isCancel, select } from "@clack/prompts";
|
|
6727
|
-
|
|
6728
6814
|
// src/output.ts
|
|
6729
6815
|
import * as z4 from "zod";
|
|
6730
6816
|
var zRenderValue = z4.json();
|
|
@@ -6912,54 +6998,10 @@ ${z4.prettifyError(error)}`);
|
|
|
6912
6998
|
}
|
|
6913
6999
|
}
|
|
6914
7000
|
|
|
6915
|
-
// src/
|
|
6916
|
-
function canPromptInteractively() {
|
|
6917
|
-
return process.stdin.isTTY && process.stdout.isTTY;
|
|
6918
|
-
}
|
|
6919
|
-
async function selectFrom(message, choices) {
|
|
6920
|
-
const [only] = choices;
|
|
6921
|
-
if (choices.length === 1 && only !== void 0) {
|
|
6922
|
-
console.log(`${message}: ${only.label} (only option)`);
|
|
6923
|
-
return only.id;
|
|
6924
|
-
}
|
|
6925
|
-
const picked = await select({
|
|
6926
|
-
message,
|
|
6927
|
-
options: choices.map((choice) => ({ value: choice.id, label: choice.label, hint: choice.id }))
|
|
6928
|
-
});
|
|
6929
|
-
if (isCancel(picked)) throw new CliInputError("selection cancelled");
|
|
6930
|
-
return picked;
|
|
6931
|
-
}
|
|
6932
|
-
async function promptOrgSelection(client2) {
|
|
6933
|
-
const { data } = await sdk_gen_exports.getCurrentUser({ client: client2 });
|
|
6934
|
-
if (data.orgs.length === 0) {
|
|
6935
|
-
throw new CliInputError("this account has no organizations");
|
|
6936
|
-
}
|
|
6937
|
-
return selectFrom(
|
|
6938
|
-
"Select an organization",
|
|
6939
|
-
data.orgs.map((org) => ({ id: org.id, label: org.name }))
|
|
6940
|
-
);
|
|
6941
|
-
}
|
|
6942
|
-
async function promptProjectSelection(client2, orgId) {
|
|
6943
|
-
const projects = [];
|
|
6944
|
-
let cursor;
|
|
6945
|
-
do {
|
|
6946
|
-
const { data } = await sdk_gen_exports.listVisibleProjects({
|
|
6947
|
-
client: client2,
|
|
6948
|
-
path: { orgID: orgId },
|
|
6949
|
-
query: cursor === void 0 ? {} : { cursor }
|
|
6950
|
-
});
|
|
6951
|
-
projects.push(...data.data.map((project) => ({ id: project.id, label: project.name })));
|
|
6952
|
-
cursor = data.next_cursor ?? void 0;
|
|
6953
|
-
} while (cursor !== void 0);
|
|
6954
|
-
if (projects.length === 0) {
|
|
6955
|
-
throw new CliInputError(`no projects visible in organization ${orgId}`);
|
|
6956
|
-
}
|
|
6957
|
-
return selectFrom("Select a project", projects);
|
|
6958
|
-
}
|
|
6959
|
-
|
|
6960
|
-
// src/config.ts
|
|
6961
|
-
var DEFAULT_BASE_URL = "https://app.omnara.com";
|
|
7001
|
+
// src/config-file.ts
|
|
6962
7002
|
var zConfigFile = z5.looseObject({
|
|
7003
|
+
api_url: z5.url().optional(),
|
|
7004
|
+
issuer_url: z5.url().optional(),
|
|
6963
7005
|
base_url: z5.url().optional(),
|
|
6964
7006
|
token: z5.string().min(1).optional(),
|
|
6965
7007
|
org_id: zOrganizationId.optional(),
|
|
@@ -7019,20 +7061,297 @@ ${z5.prettifyError(result.error)}`);
|
|
|
7019
7061
|
chmodSync(configFilePath(), 384);
|
|
7020
7062
|
return result.data;
|
|
7021
7063
|
}
|
|
7064
|
+
|
|
7065
|
+
// src/device-login.ts
|
|
7066
|
+
import { hostname } from "node:os";
|
|
7067
|
+
import { intro, log, note, outro, spinner } from "@clack/prompts";
|
|
7068
|
+
import * as z6 from "zod";
|
|
7069
|
+
|
|
7070
|
+
// src/browser.ts
|
|
7071
|
+
import { spawn } from "node:child_process";
|
|
7072
|
+
function browserCommand(url4) {
|
|
7073
|
+
if (process.platform === "darwin") {
|
|
7074
|
+
return { command: "open", args: [url4], windowsVerbatimArguments: false };
|
|
7075
|
+
}
|
|
7076
|
+
if (process.platform === "win32") {
|
|
7077
|
+
return {
|
|
7078
|
+
command: "cmd",
|
|
7079
|
+
args: ["/c", "start", '""', `"${url4}"`],
|
|
7080
|
+
windowsVerbatimArguments: true
|
|
7081
|
+
};
|
|
7082
|
+
}
|
|
7083
|
+
return { command: "xdg-open", args: [url4], windowsVerbatimArguments: false };
|
|
7084
|
+
}
|
|
7085
|
+
function openInBrowser(url4, onError) {
|
|
7086
|
+
const { command, args, windowsVerbatimArguments } = browserCommand(url4);
|
|
7087
|
+
const child = spawn(command, args, { stdio: "ignore", detached: true, windowsVerbatimArguments });
|
|
7088
|
+
child.once("error", () => {
|
|
7089
|
+
onError("could not open a browser; use the URL above");
|
|
7090
|
+
});
|
|
7091
|
+
child.unref();
|
|
7092
|
+
}
|
|
7093
|
+
|
|
7094
|
+
// src/interactive.ts
|
|
7095
|
+
import { isCancel, select } from "@clack/prompts";
|
|
7096
|
+
function canPromptInteractively() {
|
|
7097
|
+
return process.stdin.isTTY && process.stdout.isTTY;
|
|
7098
|
+
}
|
|
7099
|
+
async function selectFrom(message, choices) {
|
|
7100
|
+
const [only] = choices;
|
|
7101
|
+
if (choices.length === 1 && only !== void 0) {
|
|
7102
|
+
console.log(`${message}: ${only.label} (only option)`);
|
|
7103
|
+
return only.id;
|
|
7104
|
+
}
|
|
7105
|
+
const picked = await select({
|
|
7106
|
+
message,
|
|
7107
|
+
options: choices.map((choice) => ({ value: choice.id, label: choice.label, hint: choice.id }))
|
|
7108
|
+
});
|
|
7109
|
+
if (isCancel(picked)) throw new CliInputError("selection cancelled");
|
|
7110
|
+
return picked;
|
|
7111
|
+
}
|
|
7112
|
+
async function promptOrgSelection(client2) {
|
|
7113
|
+
const { data } = await sdk_gen_exports.getCurrentUser({ client: client2 });
|
|
7114
|
+
if (data.orgs.length === 0) {
|
|
7115
|
+
throw new CliInputError("this account has no organizations");
|
|
7116
|
+
}
|
|
7117
|
+
return selectFrom(
|
|
7118
|
+
"Select an organization",
|
|
7119
|
+
data.orgs.map((org) => ({ id: org.id, label: org.name }))
|
|
7120
|
+
);
|
|
7121
|
+
}
|
|
7122
|
+
async function promptProjectSelection(client2, orgId) {
|
|
7123
|
+
const projects = [];
|
|
7124
|
+
let cursor;
|
|
7125
|
+
do {
|
|
7126
|
+
const { data } = await sdk_gen_exports.listVisibleProjects({
|
|
7127
|
+
client: client2,
|
|
7128
|
+
path: { orgID: orgId },
|
|
7129
|
+
query: cursor === void 0 ? {} : { cursor }
|
|
7130
|
+
});
|
|
7131
|
+
projects.push(...data.data.map((project) => ({ id: project.id, label: project.name })));
|
|
7132
|
+
cursor = data.next_cursor ?? void 0;
|
|
7133
|
+
} while (cursor !== void 0);
|
|
7134
|
+
if (projects.length === 0) {
|
|
7135
|
+
throw new CliInputError(`no projects visible in organization ${orgId}`);
|
|
7136
|
+
}
|
|
7137
|
+
return selectFrom("Select a project", projects);
|
|
7138
|
+
}
|
|
7139
|
+
|
|
7140
|
+
// src/device-login.ts
|
|
7141
|
+
async function isProjectVisible(client2, orgId, projectId) {
|
|
7142
|
+
let cursor;
|
|
7143
|
+
do {
|
|
7144
|
+
const { data } = await sdk_gen_exports.listVisibleProjects({
|
|
7145
|
+
client: client2,
|
|
7146
|
+
path: { orgID: orgId },
|
|
7147
|
+
query: cursor === void 0 ? {} : { cursor }
|
|
7148
|
+
});
|
|
7149
|
+
if (data.data.some((project) => project.id === projectId)) return true;
|
|
7150
|
+
cursor = data.next_cursor ?? void 0;
|
|
7151
|
+
} while (cursor !== void 0);
|
|
7152
|
+
return false;
|
|
7153
|
+
}
|
|
7154
|
+
function interactiveReporter(title) {
|
|
7155
|
+
intro(title);
|
|
7156
|
+
const spin = spinner();
|
|
7157
|
+
return {
|
|
7158
|
+
showCode(userCode, approvalUrl) {
|
|
7159
|
+
note(`Code: ${userCode}
|
|
7160
|
+
${approvalUrl}`, "Confirm this code in your browser");
|
|
7161
|
+
},
|
|
7162
|
+
startWaiting() {
|
|
7163
|
+
spin.start("Waiting for approval in your browser");
|
|
7164
|
+
},
|
|
7165
|
+
stopWaiting(approved) {
|
|
7166
|
+
if (approved) {
|
|
7167
|
+
spin.stop("Approved");
|
|
7168
|
+
} else {
|
|
7169
|
+
spin.error("Approval failed");
|
|
7170
|
+
}
|
|
7171
|
+
},
|
|
7172
|
+
success(message) {
|
|
7173
|
+
log.success(message);
|
|
7174
|
+
},
|
|
7175
|
+
info(message) {
|
|
7176
|
+
log.info(message);
|
|
7177
|
+
},
|
|
7178
|
+
warn(message) {
|
|
7179
|
+
log.warn(message);
|
|
7180
|
+
},
|
|
7181
|
+
finish(message) {
|
|
7182
|
+
outro(message ?? "Done");
|
|
7183
|
+
}
|
|
7184
|
+
};
|
|
7185
|
+
}
|
|
7186
|
+
function plainReporter(title) {
|
|
7187
|
+
console.log(title);
|
|
7188
|
+
return {
|
|
7189
|
+
showCode(userCode, approvalUrl) {
|
|
7190
|
+
console.log(`Confirm this code in your browser: ${userCode}`);
|
|
7191
|
+
console.log(`Approval page: ${approvalUrl}`);
|
|
7192
|
+
},
|
|
7193
|
+
startWaiting() {
|
|
7194
|
+
console.log("Waiting for approval...");
|
|
7195
|
+
},
|
|
7196
|
+
stopWaiting(approved) {
|
|
7197
|
+
if (approved) console.log("Approved.");
|
|
7198
|
+
},
|
|
7199
|
+
success(message) {
|
|
7200
|
+
console.log(message);
|
|
7201
|
+
},
|
|
7202
|
+
info(message) {
|
|
7203
|
+
console.log(message);
|
|
7204
|
+
},
|
|
7205
|
+
warn(message) {
|
|
7206
|
+
console.error(`warning: ${message}`);
|
|
7207
|
+
},
|
|
7208
|
+
finish(message) {
|
|
7209
|
+
if (message !== void 0) console.log(message);
|
|
7210
|
+
}
|
|
7211
|
+
};
|
|
7212
|
+
}
|
|
7213
|
+
function createLoginReporter(title) {
|
|
7214
|
+
return canPromptInteractively() ? interactiveReporter(title) : plainReporter(title);
|
|
7215
|
+
}
|
|
7216
|
+
function loginTokenName(explicit, hostName) {
|
|
7217
|
+
const candidate = explicit ?? cliLoginTokenName(hostName);
|
|
7218
|
+
const result = zResourceName.safeParse(candidate);
|
|
7219
|
+
if (result.success) return result.data;
|
|
7220
|
+
if (explicit === void 0) return cliLoginTokenName();
|
|
7221
|
+
throw new CliInputError(`invalid token name:
|
|
7222
|
+
${z6.prettifyError(result.error)}`);
|
|
7223
|
+
}
|
|
7224
|
+
async function loginWithDevice(options) {
|
|
7225
|
+
const { report } = options;
|
|
7226
|
+
updateConfigFile({});
|
|
7227
|
+
const start = await startDeviceAuth({
|
|
7228
|
+
issuerUrl: options.issuerUrl,
|
|
7229
|
+
clientId: OMNARA_CLI_OAUTH_CLIENT_ID,
|
|
7230
|
+
tokenName: loginTokenName(options.tokenName, hostname())
|
|
7231
|
+
});
|
|
7232
|
+
report.showCode(start.userCode, start.verificationUriComplete);
|
|
7233
|
+
if (options.browser) {
|
|
7234
|
+
openInBrowser(start.verificationUriComplete, (message) => {
|
|
7235
|
+
report.warn(message);
|
|
7236
|
+
});
|
|
7237
|
+
}
|
|
7238
|
+
report.startWaiting();
|
|
7239
|
+
let token;
|
|
7240
|
+
try {
|
|
7241
|
+
token = await pollDeviceAuthToken({
|
|
7242
|
+
tokenEndpoint: start.tokenEndpoint,
|
|
7243
|
+
clientId: start.clientId,
|
|
7244
|
+
deviceCode: start.deviceCode,
|
|
7245
|
+
intervalSeconds: start.intervalSeconds
|
|
7246
|
+
});
|
|
7247
|
+
} catch (error) {
|
|
7248
|
+
report.stopWaiting(false);
|
|
7249
|
+
throw error;
|
|
7250
|
+
}
|
|
7251
|
+
report.stopWaiting(true);
|
|
7252
|
+
const saved = updateConfigFile({
|
|
7253
|
+
token,
|
|
7254
|
+
api_url: options.apiUrl,
|
|
7255
|
+
issuer_url: options.issuerUrl
|
|
7256
|
+
});
|
|
7257
|
+
const client2 = createOmnaraClient({ baseUrl: options.apiUrl, auth: bearerToken(token) });
|
|
7258
|
+
let orgId = saved.org_id;
|
|
7259
|
+
let projectId = saved.project_id;
|
|
7260
|
+
let loginMessage = "Logged in";
|
|
7261
|
+
let validationWarning;
|
|
7262
|
+
try {
|
|
7263
|
+
const { data: me } = await sdk_gen_exports.getCurrentUser({ client: client2 });
|
|
7264
|
+
loginMessage = `Logged in as ${me.user.email || me.user.display_name}`;
|
|
7265
|
+
if (orgId !== void 0 && !me.orgs.some((org) => org.id === orgId)) {
|
|
7266
|
+
updateConfigFile({ org_id: void 0, project_id: void 0 });
|
|
7267
|
+
orgId = void 0;
|
|
7268
|
+
projectId = void 0;
|
|
7269
|
+
report.warn(
|
|
7270
|
+
"Cleared the saved default organization and project: this account cannot access them."
|
|
7271
|
+
);
|
|
7272
|
+
} else if (orgId !== void 0 && projectId !== void 0 && !await isProjectVisible(client2, orgId, projectId)) {
|
|
7273
|
+
updateConfigFile({ project_id: void 0 });
|
|
7274
|
+
projectId = void 0;
|
|
7275
|
+
report.warn("Cleared the saved default project: this account cannot access it.");
|
|
7276
|
+
}
|
|
7277
|
+
} catch (error) {
|
|
7278
|
+
validationWarning = `could not verify the account or saved organization and project defaults: ${error instanceof Error ? error.message : String(error)}`;
|
|
7279
|
+
}
|
|
7280
|
+
report.success(loginMessage);
|
|
7281
|
+
report.info(`Token saved to ${configFilePath()}`);
|
|
7282
|
+
if (validationWarning !== void 0) report.warn(validationWarning);
|
|
7283
|
+
if (process.env.OMNARA_API_KEY !== void 0) {
|
|
7284
|
+
report.warn("OMNARA_API_KEY is set and takes precedence over the saved token");
|
|
7285
|
+
}
|
|
7286
|
+
return { token, orgId, projectId };
|
|
7287
|
+
}
|
|
7288
|
+
|
|
7289
|
+
// src/config.ts
|
|
7290
|
+
var DEFAULT_API_URL = "https://api.omnara.com/v1";
|
|
7291
|
+
var DEFAULT_ISSUER_URL = "https://app.omnara.com";
|
|
7292
|
+
function resolveUrls(file, env) {
|
|
7293
|
+
return {
|
|
7294
|
+
apiUrl: env.OMNARA_API_URL ?? file.api_url ?? DEFAULT_API_URL,
|
|
7295
|
+
issuerUrl: env.OMNARA_ISSUER_URL ?? file.issuer_url ?? DEFAULT_ISSUER_URL
|
|
7296
|
+
};
|
|
7297
|
+
}
|
|
7298
|
+
function migrateLegacyBaseUrl(file) {
|
|
7299
|
+
const { base_url: baseUrl, ...rest } = file;
|
|
7300
|
+
if (baseUrl === void 0) return void 0;
|
|
7301
|
+
return rest;
|
|
7302
|
+
}
|
|
7303
|
+
function createTokenResolver(options) {
|
|
7304
|
+
let token = options.savedToken;
|
|
7305
|
+
let pending;
|
|
7306
|
+
return () => {
|
|
7307
|
+
if (token !== void 0) return Promise.resolve(token);
|
|
7308
|
+
if (!options.canPrompt()) {
|
|
7309
|
+
return Promise.reject(
|
|
7310
|
+
new CliInputError("not logged in: run 'omnara login' or set OMNARA_API_KEY")
|
|
7311
|
+
);
|
|
7312
|
+
}
|
|
7313
|
+
pending ??= options.login().then((result) => {
|
|
7314
|
+
token = result;
|
|
7315
|
+
return result;
|
|
7316
|
+
});
|
|
7317
|
+
return pending;
|
|
7318
|
+
};
|
|
7319
|
+
}
|
|
7022
7320
|
function loadConfig() {
|
|
7023
|
-
const
|
|
7024
|
-
const
|
|
7025
|
-
const
|
|
7321
|
+
const loaded = readConfigFile();
|
|
7322
|
+
const migrated = migrateLegacyBaseUrl(loaded);
|
|
7323
|
+
const file = migrated === void 0 ? loaded : updateConfigFile({ ...migrated, base_url: void 0 });
|
|
7324
|
+
const { apiUrl, issuerUrl } = resolveUrls(file, process.env);
|
|
7325
|
+
let saved = { orgId: file.org_id, projectId: file.project_id };
|
|
7326
|
+
const resolveToken = createTokenResolver({
|
|
7327
|
+
savedToken: process.env.OMNARA_API_KEY ?? file.token,
|
|
7328
|
+
canPrompt: canPromptInteractively,
|
|
7329
|
+
login: async () => {
|
|
7330
|
+
const report = createLoginReporter(`Not logged in yet. Log in to ${issuerUrl}`);
|
|
7331
|
+
const login = await loginWithDevice({ apiUrl, issuerUrl, browser: true, report });
|
|
7332
|
+
saved = { orgId: login.orgId, projectId: login.projectId };
|
|
7333
|
+
report.finish("Continuing");
|
|
7334
|
+
return login.token;
|
|
7335
|
+
}
|
|
7336
|
+
});
|
|
7026
7337
|
const client2 = createOmnaraClient({
|
|
7027
|
-
baseUrl,
|
|
7028
|
-
auth:
|
|
7338
|
+
baseUrl: apiUrl,
|
|
7339
|
+
auth: bearerToken(resolveToken),
|
|
7029
7340
|
headers: { "User-Agent": "omnara-cli" }
|
|
7030
7341
|
});
|
|
7031
7342
|
return {
|
|
7032
7343
|
client: client2,
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7344
|
+
apiUrl,
|
|
7345
|
+
issuerUrl,
|
|
7346
|
+
get defaultOrgId() {
|
|
7347
|
+
return process.env.OMNARA_ORG_ID ?? saved.orgId;
|
|
7348
|
+
},
|
|
7349
|
+
get defaultProjectId() {
|
|
7350
|
+
return process.env.OMNARA_PROJECT_ID ?? saved.projectId;
|
|
7351
|
+
},
|
|
7352
|
+
ensureLoggedIn: async () => {
|
|
7353
|
+
await resolveToken();
|
|
7354
|
+
}
|
|
7036
7355
|
};
|
|
7037
7356
|
}
|
|
7038
7357
|
function describeValue(envName, fileValue, defaultValue) {
|
|
@@ -7050,17 +7369,23 @@ function printConfig() {
|
|
|
7050
7369
|
console.log(`config file ${configFilePath()}`);
|
|
7051
7370
|
console.log(`org_id ${describeValue("OMNARA_ORG_ID", file.org_id)}`);
|
|
7052
7371
|
console.log(`project_id ${describeValue("OMNARA_PROJECT_ID", file.project_id)}`);
|
|
7053
|
-
|
|
7372
|
+
const { apiUrl, issuerUrl } = resolveUrls(file, {});
|
|
7373
|
+
console.log(`api_url ${describeValue("OMNARA_API_URL", file.api_url, apiUrl)}`);
|
|
7374
|
+
console.log(`issuer_url ${describeValue("OMNARA_ISSUER_URL", file.issuer_url, issuerUrl)}`);
|
|
7054
7375
|
}
|
|
7055
7376
|
function registerConfigCommand(program2, cli) {
|
|
7056
|
-
const config2 = program2.command("config").description("Show or set the default organization and project").option("--org <org-id>", "save this organization ID as the default").option("--project <project-id>", "save this project ID as the default").option("--
|
|
7377
|
+
const config2 = program2.command("config").description("Show or set the default organization and project").option("--org <org-id>", "save this organization ID as the default").option("--project <project-id>", "save this project ID as the default").option("--api-url <url>", "save this API root URL (used for requests) as the default").option(
|
|
7378
|
+
"--issuer-url <url>",
|
|
7379
|
+
"save this web app origin (used for login and browser links) as the default"
|
|
7380
|
+
).action(async (options) => {
|
|
7057
7381
|
await runCliAction(() => {
|
|
7058
|
-
if (options.org !== void 0 || options.project !== void 0 || options.
|
|
7382
|
+
if (options.org !== void 0 || options.project !== void 0 || options.apiUrl !== void 0 || options.issuerUrl !== void 0) {
|
|
7059
7383
|
const clearStaleProject = options.org !== void 0 && options.project === void 0;
|
|
7060
7384
|
updateConfigFile({
|
|
7061
7385
|
...options.org !== void 0 ? { org_id: options.org } : {},
|
|
7062
7386
|
...clearStaleProject ? { project_id: void 0 } : options.project !== void 0 ? { project_id: options.project } : {},
|
|
7063
|
-
...options.
|
|
7387
|
+
...options.apiUrl !== void 0 ? { api_url: options.apiUrl } : {},
|
|
7388
|
+
...options.issuerUrl !== void 0 ? { issuer_url: options.issuerUrl } : {}
|
|
7064
7389
|
});
|
|
7065
7390
|
}
|
|
7066
7391
|
printConfig();
|
|
@@ -7071,6 +7396,7 @@ function registerConfigCommand(program2, cli) {
|
|
|
7071
7396
|
if (!canPromptInteractively()) {
|
|
7072
7397
|
throw new CliInputError("interactive selection needs a terminal");
|
|
7073
7398
|
}
|
|
7399
|
+
await cli.ensureLoggedIn();
|
|
7074
7400
|
const orgId = await promptOrgSelection(cli.client);
|
|
7075
7401
|
const projectId = await promptProjectSelection(cli.client, orgId);
|
|
7076
7402
|
updateConfigFile({ org_id: orgId, project_id: projectId });
|
|
@@ -7081,10 +7407,10 @@ function registerConfigCommand(program2, cli) {
|
|
|
7081
7407
|
|
|
7082
7408
|
// src/factory.ts
|
|
7083
7409
|
import { InvalidArgumentError } from "commander";
|
|
7084
|
-
import * as
|
|
7410
|
+
import * as z8 from "zod";
|
|
7085
7411
|
|
|
7086
7412
|
// src/flags.ts
|
|
7087
|
-
import * as
|
|
7413
|
+
import * as z7 from "zod";
|
|
7088
7414
|
function kebabCase(name) {
|
|
7089
7415
|
return name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replaceAll("_", "-").toLowerCase();
|
|
7090
7416
|
}
|
|
@@ -7201,21 +7527,21 @@ function finalizeFlag(draft) {
|
|
|
7201
7527
|
};
|
|
7202
7528
|
}
|
|
7203
7529
|
function deriveFlags(schema) {
|
|
7204
|
-
const jsonSchema =
|
|
7530
|
+
const jsonSchema = z7.toJSONSchema(schema, { io: "input" });
|
|
7205
7531
|
const drafts = /* @__PURE__ */ new Map();
|
|
7206
7532
|
collectDrafts(drafts, jsonSchema, [], false);
|
|
7207
7533
|
return [...drafts.values()].map(finalizeFlag);
|
|
7208
7534
|
}
|
|
7209
7535
|
|
|
7210
7536
|
// src/reporter.ts
|
|
7211
|
-
import { intro, log, note, outro, spinner } from "@clack/prompts";
|
|
7212
|
-
function
|
|
7213
|
-
|
|
7214
|
-
const spin =
|
|
7537
|
+
import { intro as intro2, log as log2, note as note2, outro as outro2, spinner as spinner2 } from "@clack/prompts";
|
|
7538
|
+
function interactiveReporter2(title) {
|
|
7539
|
+
intro2(title);
|
|
7540
|
+
const spin = spinner2();
|
|
7215
7541
|
let spinning = false;
|
|
7216
7542
|
return {
|
|
7217
7543
|
url(label, href) {
|
|
7218
|
-
|
|
7544
|
+
note2(href, label);
|
|
7219
7545
|
},
|
|
7220
7546
|
start(message) {
|
|
7221
7547
|
spin.start(message);
|
|
@@ -7232,17 +7558,17 @@ function interactiveReporter(title) {
|
|
|
7232
7558
|
spinning = false;
|
|
7233
7559
|
},
|
|
7234
7560
|
warn(message) {
|
|
7235
|
-
|
|
7561
|
+
log2.warn(message);
|
|
7236
7562
|
},
|
|
7237
7563
|
info(message) {
|
|
7238
|
-
|
|
7564
|
+
log2.info(message);
|
|
7239
7565
|
},
|
|
7240
7566
|
done() {
|
|
7241
|
-
|
|
7567
|
+
outro2("Done");
|
|
7242
7568
|
}
|
|
7243
7569
|
};
|
|
7244
7570
|
}
|
|
7245
|
-
function
|
|
7571
|
+
function plainReporter2() {
|
|
7246
7572
|
return {
|
|
7247
7573
|
url(label, href) {
|
|
7248
7574
|
console.log(`${label}: ${href}`);
|
|
@@ -7268,7 +7594,7 @@ function plainReporter() {
|
|
|
7268
7594
|
};
|
|
7269
7595
|
}
|
|
7270
7596
|
function createFlowReporter(title) {
|
|
7271
|
-
return canPromptInteractively() ?
|
|
7597
|
+
return canPromptInteractively() ? interactiveReporter2(title) : plainReporter2();
|
|
7272
7598
|
}
|
|
7273
7599
|
|
|
7274
7600
|
// src/factory.ts
|
|
@@ -7282,7 +7608,7 @@ function flowOp(spec) {
|
|
|
7282
7608
|
type: "flow",
|
|
7283
7609
|
execute: (input) => run({
|
|
7284
7610
|
client: input.client,
|
|
7285
|
-
|
|
7611
|
+
apiUrl: input.apiUrl,
|
|
7286
7612
|
path: parseWithSchema(spec.path, input.path, "arguments"),
|
|
7287
7613
|
body: parseWithSchema(spec.body, input.body, "flags"),
|
|
7288
7614
|
report: createFlowReporter(spec.summary)
|
|
@@ -7382,7 +7708,7 @@ function parseWithSchema(schema, value, label) {
|
|
|
7382
7708
|
const result = schema.safeParse(value);
|
|
7383
7709
|
if (!result.success) {
|
|
7384
7710
|
throw new CliInputError(`invalid ${label}:
|
|
7385
|
-
${
|
|
7711
|
+
${z8.prettifyError(result.error)}`);
|
|
7386
7712
|
}
|
|
7387
7713
|
return result.data;
|
|
7388
7714
|
}
|
|
@@ -7390,7 +7716,7 @@ async function callOperation(spec, input) {
|
|
|
7390
7716
|
const result = await spec.fn(input);
|
|
7391
7717
|
return result.data;
|
|
7392
7718
|
}
|
|
7393
|
-
var zBodyObject =
|
|
7719
|
+
var zBodyObject = z8.looseObject({});
|
|
7394
7720
|
function deepMerge(base, patch) {
|
|
7395
7721
|
const merged = { ...base };
|
|
7396
7722
|
for (const [key, value] of Object.entries(patch)) {
|
|
@@ -7468,6 +7794,7 @@ function registerOperation(parent, config2, spec) {
|
|
|
7468
7794
|
command.option("--json", "print the raw JSON response");
|
|
7469
7795
|
command.action(async (...args) => {
|
|
7470
7796
|
await runCliAction(async () => {
|
|
7797
|
+
await config2.ensureLoggedIn();
|
|
7471
7798
|
const options = command.opts();
|
|
7472
7799
|
const input = { client: config2.client };
|
|
7473
7800
|
if (spec.path) {
|
|
@@ -7492,7 +7819,9 @@ function registerOperation(parent, config2, spec) {
|
|
|
7492
7819
|
renderResult(data, true);
|
|
7493
7820
|
return;
|
|
7494
7821
|
}
|
|
7495
|
-
const formatted = spec.format(data, {
|
|
7822
|
+
const formatted = spec.format(data, {
|
|
7823
|
+
apiUrl: config2.apiUrl
|
|
7824
|
+
});
|
|
7496
7825
|
renderResult(formatted.value, false, { columns: formatted.columns });
|
|
7497
7826
|
});
|
|
7498
7827
|
});
|
|
@@ -7505,10 +7834,11 @@ function registerFlow(parent, config2, spec) {
|
|
|
7505
7834
|
for (const flag of bodyFlags) registerFlag(command, flag);
|
|
7506
7835
|
command.action(async (...args) => {
|
|
7507
7836
|
await runCliAction(async () => {
|
|
7837
|
+
await config2.ensureLoggedIn();
|
|
7508
7838
|
const options = command.opts();
|
|
7509
7839
|
await spec.execute({
|
|
7510
7840
|
client: config2.client,
|
|
7511
|
-
|
|
7841
|
+
apiUrl: config2.apiUrl,
|
|
7512
7842
|
path: await resolvePathValues(plan, args, options, config2),
|
|
7513
7843
|
body: collectFlagValues(bodyFlags, options)
|
|
7514
7844
|
});
|
|
@@ -7525,170 +7855,17 @@ function registerGroup(program2, config2, group) {
|
|
|
7525
7855
|
}
|
|
7526
7856
|
|
|
7527
7857
|
// src/login.ts
|
|
7528
|
-
import { hostname } from "node:os";
|
|
7529
|
-
import { intro as intro2, log as log2, note as note2, outro as outro2, spinner as spinner2 } from "@clack/prompts";
|
|
7530
|
-
import * as z8 from "zod";
|
|
7531
|
-
|
|
7532
|
-
// src/browser.ts
|
|
7533
|
-
import { spawn } from "node:child_process";
|
|
7534
|
-
function browserCommand(url3) {
|
|
7535
|
-
if (process.platform === "darwin") {
|
|
7536
|
-
return { command: "open", args: [url3], windowsVerbatimArguments: false };
|
|
7537
|
-
}
|
|
7538
|
-
if (process.platform === "win32") {
|
|
7539
|
-
return {
|
|
7540
|
-
command: "cmd",
|
|
7541
|
-
args: ["/c", "start", '""', `"${url3}"`],
|
|
7542
|
-
windowsVerbatimArguments: true
|
|
7543
|
-
};
|
|
7544
|
-
}
|
|
7545
|
-
return { command: "xdg-open", args: [url3], windowsVerbatimArguments: false };
|
|
7546
|
-
}
|
|
7547
|
-
function openInBrowser(url3, onError) {
|
|
7548
|
-
const { command, args, windowsVerbatimArguments } = browserCommand(url3);
|
|
7549
|
-
const child = spawn(command, args, { stdio: "ignore", detached: true, windowsVerbatimArguments });
|
|
7550
|
-
child.once("error", () => {
|
|
7551
|
-
onError("could not open a browser; use the URL above");
|
|
7552
|
-
});
|
|
7553
|
-
child.unref();
|
|
7554
|
-
}
|
|
7555
|
-
|
|
7556
|
-
// src/login.ts
|
|
7557
|
-
async function isProjectVisible(client2, orgId, projectId) {
|
|
7558
|
-
let cursor;
|
|
7559
|
-
do {
|
|
7560
|
-
const { data } = await sdk_gen_exports.listVisibleProjects({
|
|
7561
|
-
client: client2,
|
|
7562
|
-
path: { orgID: orgId },
|
|
7563
|
-
query: cursor === void 0 ? {} : { cursor }
|
|
7564
|
-
});
|
|
7565
|
-
if (data.data.some((project) => project.id === projectId)) return true;
|
|
7566
|
-
cursor = data.next_cursor ?? void 0;
|
|
7567
|
-
} while (cursor !== void 0);
|
|
7568
|
-
return false;
|
|
7569
|
-
}
|
|
7570
|
-
function interactiveReporter2(baseUrl) {
|
|
7571
|
-
intro2(`Log in to ${baseUrl}`);
|
|
7572
|
-
const spin = spinner2();
|
|
7573
|
-
return {
|
|
7574
|
-
showCode(userCode, approvalUrl) {
|
|
7575
|
-
note2(`Code: ${userCode}
|
|
7576
|
-
${approvalUrl}`, "Confirm this code in your browser");
|
|
7577
|
-
},
|
|
7578
|
-
startWaiting() {
|
|
7579
|
-
spin.start("Waiting for approval in your browser");
|
|
7580
|
-
},
|
|
7581
|
-
stopWaiting(approved) {
|
|
7582
|
-
if (approved) {
|
|
7583
|
-
spin.stop("Approved");
|
|
7584
|
-
} else {
|
|
7585
|
-
spin.error("Approval failed");
|
|
7586
|
-
}
|
|
7587
|
-
},
|
|
7588
|
-
success(message) {
|
|
7589
|
-
log2.success(message);
|
|
7590
|
-
},
|
|
7591
|
-
info(message) {
|
|
7592
|
-
log2.info(message);
|
|
7593
|
-
},
|
|
7594
|
-
warn(message) {
|
|
7595
|
-
log2.warn(message);
|
|
7596
|
-
},
|
|
7597
|
-
finish(message) {
|
|
7598
|
-
outro2(message ?? "Done");
|
|
7599
|
-
}
|
|
7600
|
-
};
|
|
7601
|
-
}
|
|
7602
|
-
function plainReporter2() {
|
|
7603
|
-
return {
|
|
7604
|
-
showCode(userCode, approvalUrl) {
|
|
7605
|
-
console.log(`Confirm this code in your browser: ${userCode}`);
|
|
7606
|
-
console.log(`Approval page: ${approvalUrl}`);
|
|
7607
|
-
},
|
|
7608
|
-
startWaiting() {
|
|
7609
|
-
console.log("Waiting for approval...");
|
|
7610
|
-
},
|
|
7611
|
-
stopWaiting(approved) {
|
|
7612
|
-
if (approved) console.log("Approved.");
|
|
7613
|
-
},
|
|
7614
|
-
success(message) {
|
|
7615
|
-
console.log(message);
|
|
7616
|
-
},
|
|
7617
|
-
info(message) {
|
|
7618
|
-
console.log(message);
|
|
7619
|
-
},
|
|
7620
|
-
warn(message) {
|
|
7621
|
-
console.error(`warning: ${message}`);
|
|
7622
|
-
},
|
|
7623
|
-
finish(message) {
|
|
7624
|
-
if (message !== void 0) console.log(message);
|
|
7625
|
-
}
|
|
7626
|
-
};
|
|
7627
|
-
}
|
|
7628
|
-
function loginTokenName(explicit, hostName) {
|
|
7629
|
-
const candidate = explicit ?? cliLoginTokenName(hostName);
|
|
7630
|
-
const result = zResourceName.safeParse(candidate);
|
|
7631
|
-
if (result.success) return result.data;
|
|
7632
|
-
if (explicit === void 0) return cliLoginTokenName();
|
|
7633
|
-
throw new CliInputError(`invalid token name:
|
|
7634
|
-
${z8.prettifyError(result.error)}`);
|
|
7635
|
-
}
|
|
7636
7858
|
function registerLoginCommand(program2, cli) {
|
|
7637
7859
|
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) => {
|
|
7638
7860
|
await runCliAction(async () => {
|
|
7639
|
-
|
|
7640
|
-
const
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
tokenName:
|
|
7861
|
+
const report = createLoginReporter(`Log in to ${cli.issuerUrl}`);
|
|
7862
|
+
const { orgId } = await loginWithDevice({
|
|
7863
|
+
apiUrl: cli.apiUrl,
|
|
7864
|
+
issuerUrl: cli.issuerUrl,
|
|
7865
|
+
browser: options.browser,
|
|
7866
|
+
tokenName: options.tokenName,
|
|
7867
|
+
report
|
|
7645
7868
|
});
|
|
7646
|
-
report.showCode(start.userCode, start.verificationUriComplete);
|
|
7647
|
-
if (options.browser) {
|
|
7648
|
-
openInBrowser(start.verificationUriComplete, (message) => {
|
|
7649
|
-
report.warn(message);
|
|
7650
|
-
});
|
|
7651
|
-
}
|
|
7652
|
-
report.startWaiting();
|
|
7653
|
-
let token;
|
|
7654
|
-
try {
|
|
7655
|
-
token = await pollDeviceAuthToken({
|
|
7656
|
-
baseUrl: cli.baseUrl,
|
|
7657
|
-
deviceCode: start.deviceCode,
|
|
7658
|
-
intervalSeconds: start.intervalSeconds
|
|
7659
|
-
});
|
|
7660
|
-
} catch (error) {
|
|
7661
|
-
report.stopWaiting(false);
|
|
7662
|
-
throw error;
|
|
7663
|
-
}
|
|
7664
|
-
report.stopWaiting(true);
|
|
7665
|
-
const saved = updateConfigFile({ token, base_url: cli.baseUrl });
|
|
7666
|
-
const client2 = createOmnaraClient({ baseUrl: cli.baseUrl, auth: bearerToken(token) });
|
|
7667
|
-
let orgId = saved.org_id;
|
|
7668
|
-
let loginMessage = "Logged in";
|
|
7669
|
-
let validationWarning;
|
|
7670
|
-
try {
|
|
7671
|
-
const { data: me } = await sdk_gen_exports.getCurrentUser({ client: client2 });
|
|
7672
|
-
loginMessage = `Logged in as ${me.user.email || me.user.display_name}`;
|
|
7673
|
-
if (orgId !== void 0 && !me.orgs.some((org) => org.id === orgId)) {
|
|
7674
|
-
updateConfigFile({ org_id: void 0, project_id: void 0 });
|
|
7675
|
-
orgId = void 0;
|
|
7676
|
-
report.warn(
|
|
7677
|
-
"Cleared the saved default organization and project: this account cannot access them."
|
|
7678
|
-
);
|
|
7679
|
-
} else if (orgId !== void 0 && saved.project_id !== void 0 && !await isProjectVisible(client2, orgId, saved.project_id)) {
|
|
7680
|
-
updateConfigFile({ project_id: void 0 });
|
|
7681
|
-
report.warn("Cleared the saved default project: this account cannot access it.");
|
|
7682
|
-
}
|
|
7683
|
-
} catch (error) {
|
|
7684
|
-
validationWarning = `could not verify the account or saved organization and project defaults: ${error instanceof Error ? error.message : String(error)}`;
|
|
7685
|
-
}
|
|
7686
|
-
report.success(loginMessage);
|
|
7687
|
-
report.info(`Token saved to ${configFilePath()}`);
|
|
7688
|
-
if (validationWarning !== void 0) report.warn(validationWarning);
|
|
7689
|
-
if (process.env.OMNARA_API_KEY !== void 0) {
|
|
7690
|
-
report.warn("OMNARA_API_KEY is set and takes precedence over the saved token");
|
|
7691
|
-
}
|
|
7692
7869
|
if ((process.env.OMNARA_ORG_ID ?? orgId) === void 0) {
|
|
7693
7870
|
report.finish("Run 'omnara config select' to choose a default organization and project.");
|
|
7694
7871
|
} else {
|
|
@@ -7831,13 +8008,16 @@ async function connectMachine(context) {
|
|
|
7831
8008
|
function shellQuote(value) {
|
|
7832
8009
|
return `'${value.replaceAll("'", `'\\''`)}'`;
|
|
7833
8010
|
}
|
|
7834
|
-
function
|
|
7835
|
-
return
|
|
8011
|
+
function installScriptUrl(apiUrl) {
|
|
8012
|
+
return new URL("/install/omnarad.sh", apiUrl).toString();
|
|
8013
|
+
}
|
|
8014
|
+
function installCommand(apiUrl) {
|
|
8015
|
+
return `curl -fsSL ${shellQuote(installScriptUrl(apiUrl))} | sh`;
|
|
7836
8016
|
}
|
|
7837
|
-
var formatMachineSetup = (response, {
|
|
8017
|
+
var formatMachineSetup = (response, { apiUrl }) => ({
|
|
7838
8018
|
value: {
|
|
7839
8019
|
...response,
|
|
7840
|
-
install_command: installCommand(
|
|
8020
|
+
install_command: installCommand(apiUrl),
|
|
7841
8021
|
install_note: "Run install_command on the target machine and paste the token when prompted."
|
|
7842
8022
|
}
|
|
7843
8023
|
});
|
|
@@ -7941,9 +8121,9 @@ function ensureDaemonHomeWritable(home) {
|
|
|
7941
8121
|
var DaemonExitError = class extends Error {
|
|
7942
8122
|
};
|
|
7943
8123
|
async function runMachineCreateLocal(context) {
|
|
7944
|
-
const { report,
|
|
8124
|
+
const { report, apiUrl } = context;
|
|
7945
8125
|
ensureSupportedPlatform(process.platform, process.arch);
|
|
7946
|
-
ensureDaemonApiUrl(
|
|
8126
|
+
ensureDaemonApiUrl(apiUrl);
|
|
7947
8127
|
const home = daemonHome();
|
|
7948
8128
|
const existing = describeExistingInstallation(home);
|
|
7949
8129
|
if (existing !== void 0) {
|
|
@@ -7961,7 +8141,7 @@ async function runMachineCreateLocal(context) {
|
|
|
7961
8141
|
report.info(`Machine ID: ${machine.id}`);
|
|
7962
8142
|
report.start("Installing omnarad on this machine");
|
|
7963
8143
|
try {
|
|
7964
|
-
await runInstaller(report,
|
|
8144
|
+
await runInstaller(report, apiUrl, token, machine.id, home);
|
|
7965
8145
|
} catch (error) {
|
|
7966
8146
|
if (error instanceof DaemonExitError) {
|
|
7967
8147
|
report.fail("omnarad exited after it was installed");
|
|
@@ -7978,7 +8158,7 @@ async function runMachineCreateLocal(context) {
|
|
|
7978
8158
|
${token}`);
|
|
7979
8159
|
report.url(
|
|
7980
8160
|
"Finish setup by running this, then paste the machine token when prompted",
|
|
7981
|
-
installCommand(
|
|
8161
|
+
installCommand(apiUrl)
|
|
7982
8162
|
);
|
|
7983
8163
|
throw error;
|
|
7984
8164
|
}
|
|
@@ -8035,11 +8215,11 @@ function readDaemonLockPid(home) {
|
|
|
8035
8215
|
return void 0;
|
|
8036
8216
|
}
|
|
8037
8217
|
}
|
|
8038
|
-
function installerScript(
|
|
8218
|
+
function installerScript(apiUrl) {
|
|
8039
8219
|
return [
|
|
8040
8220
|
"installer=$(mktemp)",
|
|
8041
8221
|
`trap 'rm -f "$installer"' EXIT`,
|
|
8042
|
-
`curl -qfsSL --connect-timeout 10 -m 60 --max-redirs 5 --max-filesize 1048576 --proto '=http,https' --proto-redir '=https' -o "$installer" ${shellQuote(
|
|
8222
|
+
`curl -qfsSL --connect-timeout 10 -m 60 --max-redirs 5 --max-filesize 1048576 --proto '=http,https' --proto-redir '=https' -o "$installer" ${shellQuote(installScriptUrl(apiUrl))}`,
|
|
8043
8223
|
'sh "$installer"'
|
|
8044
8224
|
].join(" && ");
|
|
8045
8225
|
}
|
|
@@ -8048,11 +8228,11 @@ function installerFailure(code, signal, log3) {
|
|
|
8048
8228
|
return new Error(`omnarad installer failed (${reason})${log3 === "" ? "" : `
|
|
8049
8229
|
${log3}`}`);
|
|
8050
8230
|
}
|
|
8051
|
-
function runInstaller(report,
|
|
8231
|
+
function runInstaller(report, apiUrl, token, machineId, home) {
|
|
8052
8232
|
return new Promise((resolve3, reject) => {
|
|
8053
|
-
const child = spawn2("/bin/sh", ["-c", installerScript(
|
|
8233
|
+
const child = spawn2("/bin/sh", ["-c", installerScript(apiUrl)], {
|
|
8054
8234
|
stdio: ["ignore", "pipe", "pipe"],
|
|
8055
|
-
env: { ...process.env, OMNARA_API_URL:
|
|
8235
|
+
env: { ...process.env, OMNARA_API_URL: apiUrl, OMNARA_MACHINE_TOKEN: token }
|
|
8056
8236
|
});
|
|
8057
8237
|
const relay = (signal) => {
|
|
8058
8238
|
child.kill(signal);
|
|
@@ -8174,10 +8354,10 @@ async function authorizeMcpOAuthSecret(options) {
|
|
|
8174
8354
|
});
|
|
8175
8355
|
}
|
|
8176
8356
|
var zBrowserFlag = z11.boolean().default(true).describe("open the authorization URL in a browser");
|
|
8177
|
-
function openAuthorizationUrl(report, title,
|
|
8178
|
-
report.url(title,
|
|
8357
|
+
function openAuthorizationUrl(report, title, url4, browser) {
|
|
8358
|
+
report.url(title, url4);
|
|
8179
8359
|
if (browser) {
|
|
8180
|
-
openInBrowser(
|
|
8360
|
+
openInBrowser(url4, (message) => {
|
|
8181
8361
|
report.warn(message);
|
|
8182
8362
|
});
|
|
8183
8363
|
}
|
|
@@ -8192,8 +8372,8 @@ async function runMcpOAuth(context) {
|
|
|
8192
8372
|
client: client2,
|
|
8193
8373
|
orgId: path.orgID,
|
|
8194
8374
|
request,
|
|
8195
|
-
onAuthorization(
|
|
8196
|
-
openAuthorizationUrl(report, "Authorize this MCP server in your browser",
|
|
8375
|
+
onAuthorization(url4) {
|
|
8376
|
+
openAuthorizationUrl(report, "Authorize this MCP server in your browser", url4, browser);
|
|
8197
8377
|
report.start("Waiting for the secret to be created");
|
|
8198
8378
|
}
|
|
8199
8379
|
});
|
|
@@ -8219,8 +8399,8 @@ var zMcpAddBody = zMcpoAuthStartRequest.omit({ owner: true, name: true }).extend
|
|
|
8219
8399
|
function targetLabel(target) {
|
|
8220
8400
|
return target === "agent" ? "agent" : "agent profile";
|
|
8221
8401
|
}
|
|
8222
|
-
function serverEntry(
|
|
8223
|
-
return { url:
|
|
8402
|
+
function serverEntry(url4, secretId) {
|
|
8403
|
+
return { url: url4, auth: { type: "oauth", secret_id: secretId } };
|
|
8224
8404
|
}
|
|
8225
8405
|
var zJsonRecord = z12.record(z12.string(), z12.json());
|
|
8226
8406
|
function prepareJsonConfig(config2, serverName, mcpUrl) {
|
|
@@ -8352,8 +8532,8 @@ async function runMcpAdd(context, target, targetId) {
|
|
|
8352
8532
|
client: client2,
|
|
8353
8533
|
orgId: scope.orgId,
|
|
8354
8534
|
request,
|
|
8355
|
-
onAuthorization(
|
|
8356
|
-
openAuthorizationUrl(report, "Authorize this MCP server in your browser",
|
|
8535
|
+
onAuthorization(url4) {
|
|
8536
|
+
openAuthorizationUrl(report, "Authorize this MCP server in your browser", url4, browser);
|
|
8357
8537
|
report.start("Waiting for the MCP OAuth secret to be created");
|
|
8358
8538
|
}
|
|
8359
8539
|
});
|