omnara 1.0.18 → 1.0.20
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 +176 -142
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -52,9 +52,9 @@ var zError = z.object({
|
|
|
52
52
|
"request_too_large",
|
|
53
53
|
"unsupported_media_type",
|
|
54
54
|
"unprocessable",
|
|
55
|
+
"upstream_unavailable",
|
|
55
56
|
"rate_limited",
|
|
56
57
|
"internal_error",
|
|
57
|
-
"upstream_error",
|
|
58
58
|
"service_unavailable",
|
|
59
59
|
"idempotency_key_conflict",
|
|
60
60
|
"state_transition_conflict",
|
|
@@ -84,11 +84,11 @@ var zClientErrorCode = z.enum([
|
|
|
84
84
|
"request_too_large",
|
|
85
85
|
"unsupported_media_type",
|
|
86
86
|
"unprocessable",
|
|
87
|
+
"upstream_unavailable",
|
|
87
88
|
"rate_limited"
|
|
88
89
|
]);
|
|
89
90
|
var zServerErrorCode = z.enum([
|
|
90
91
|
"internal_error",
|
|
91
|
-
"upstream_error",
|
|
92
92
|
"service_unavailable",
|
|
93
93
|
"authentication_unavailable"
|
|
94
94
|
]);
|
|
@@ -215,6 +215,11 @@ var zUpdateProjectModelGrantRequest = z.object({
|
|
|
215
215
|
input_modalities: z.array(z.string()).optional(),
|
|
216
216
|
output_modalities: z.array(z.string()).optional()
|
|
217
217
|
});
|
|
218
|
+
var zProjectModelGrantEffectiveReasoning = z.object({
|
|
219
|
+
supports_reasoning: z.boolean(),
|
|
220
|
+
default_reasoning_effort: z.string(),
|
|
221
|
+
supported_reasoning_efforts: z.array(z.string())
|
|
222
|
+
});
|
|
218
223
|
var zMachinePoolId = z.string().regex(/^mpo_[a-z2-7]{26}$/);
|
|
219
224
|
var zMachineId = z.string().regex(/^mch_[a-z2-7]{26}$/);
|
|
220
225
|
var zProjectMachineGrantId = z.string().regex(/^pmg_[a-z2-7]{26}$/);
|
|
@@ -360,7 +365,8 @@ var zConfiguredModelSummary = z.object({
|
|
|
360
365
|
});
|
|
361
366
|
var zProjectModelGrantListItem = z.object({
|
|
362
367
|
grant: zProjectModelGrant,
|
|
363
|
-
model: zConfiguredModelSummary
|
|
368
|
+
model: zConfiguredModelSummary,
|
|
369
|
+
effective_reasoning: zProjectModelGrantEffectiveReasoning
|
|
364
370
|
});
|
|
365
371
|
var zListProjectModelGrantsResponse = z.object({
|
|
366
372
|
data: z.array(zProjectModelGrantListItem),
|
|
@@ -639,7 +645,7 @@ var zMcpServerAuthHint = z.object({
|
|
|
639
645
|
var zMcpServerAuthRequiredError = z.object({
|
|
640
646
|
error: z.string(),
|
|
641
647
|
code: z.enum(["unprocessable"]),
|
|
642
|
-
auth: zMcpServerAuthHint
|
|
648
|
+
auth: zMcpServerAuthHint.optional()
|
|
643
649
|
});
|
|
644
650
|
var zMcpServerInfo = z.object({
|
|
645
651
|
name: z.string(),
|
|
@@ -1815,7 +1821,11 @@ var zCreateMachinePoolRequestBase = z.object({
|
|
|
1815
1821
|
});
|
|
1816
1822
|
var zCreateMachinePoolRequest = zCreateMachinePoolRequestBase.and(z.union([
|
|
1817
1823
|
z.object({
|
|
1818
|
-
provider: z.enum([
|
|
1824
|
+
provider: z.enum([
|
|
1825
|
+
"unikraft",
|
|
1826
|
+
"modal",
|
|
1827
|
+
"freestyle"
|
|
1828
|
+
]),
|
|
1819
1829
|
default_machine_cpu: z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1820
1830
|
default_machine_memory_mb: z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
1821
1831
|
max_total_cpu: z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
@@ -3516,9 +3526,7 @@ function samePath(a, b) {
|
|
|
3516
3526
|
return a.length === b.length && a.every((segment, index) => segment === b[index]);
|
|
3517
3527
|
}
|
|
3518
3528
|
function isUnknownEnumIssue(issue) {
|
|
3519
|
-
if (issue.code === "invalid_value")
|
|
3520
|
-
return issue.values.length > 1 && isStringInput(issue);
|
|
3521
|
-
}
|
|
3529
|
+
if (issue.code === "invalid_value") return isStringInput(issue);
|
|
3522
3530
|
if (issue.code !== "invalid_union") return false;
|
|
3523
3531
|
if (issue.errors.length === 0) return hasStringDiscriminator(issue);
|
|
3524
3532
|
if (issue.errors.some((arm) => arm.every(isUnknownEnumIssue))) {
|
|
@@ -3874,6 +3882,9 @@ function cliLoginTokenName(hostName) {
|
|
|
3874
3882
|
return `${cliLoginTokenPrefix}${cliLoginTokenHostSeparator}${hostName}`;
|
|
3875
3883
|
}
|
|
3876
3884
|
|
|
3885
|
+
// ../sdk/src/client.ts
|
|
3886
|
+
import * as z6 from "zod";
|
|
3887
|
+
|
|
3877
3888
|
// ../sdk/src/generated/core/bodySerializer.gen.ts
|
|
3878
3889
|
var serializeFormDataPair = (data, key, value) => {
|
|
3879
3890
|
if (typeof value === "string" || value instanceof Blob) {
|
|
@@ -4699,21 +4710,44 @@ var httpMethods = [
|
|
|
4699
4710
|
"put",
|
|
4700
4711
|
"trace"
|
|
4701
4712
|
];
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4713
|
+
var zMultipartPart = z6.union([
|
|
4714
|
+
z6.string(),
|
|
4715
|
+
z6.instanceof(Blob),
|
|
4716
|
+
z6.date().transform((date2) => date2.toISOString()),
|
|
4717
|
+
z6.union([z6.number(), z6.boolean(), z6.bigint()]).transform(String),
|
|
4718
|
+
z6.json().transform((value) => new Blob([JSON.stringify(value)], { type: "application/json" }))
|
|
4719
|
+
]);
|
|
4720
|
+
var zMultipartBody = z6.record(
|
|
4721
|
+
z6.string(),
|
|
4722
|
+
z6.union([z6.array(zMultipartPart), zMultipartPart]).nullish()
|
|
4723
|
+
);
|
|
4724
|
+
var serializeMultipartBody = ((body) => {
|
|
4725
|
+
const form = new FormData();
|
|
4726
|
+
for (const [key, value] of Object.entries(zMultipartBody.parse(body))) {
|
|
4727
|
+
if (value === null || value === void 0) continue;
|
|
4728
|
+
for (const part of Array.isArray(value) ? value : [value]) form.append(key, part);
|
|
4729
|
+
}
|
|
4730
|
+
return form;
|
|
4731
|
+
});
|
|
4732
|
+
function normalizeRequestOptions(options) {
|
|
4733
|
+
const normalized = { ...options };
|
|
4734
|
+
Reflect.deleteProperty(normalized, "client");
|
|
4735
|
+
if (normalized.bodySerializer === formDataBodySerializer.bodySerializer) {
|
|
4736
|
+
normalized.bodySerializer = serializeMultipartBody;
|
|
4737
|
+
}
|
|
4738
|
+
return normalized;
|
|
4706
4739
|
}
|
|
4707
|
-
function
|
|
4740
|
+
function patchGeneratedRequests(client2) {
|
|
4708
4741
|
const { request } = client2;
|
|
4709
|
-
client2.request = (options) => request(
|
|
4742
|
+
client2.request = (options) => request(normalizeRequestOptions(options));
|
|
4710
4743
|
for (const method of httpMethods) {
|
|
4711
4744
|
const dispatch = client2[method];
|
|
4712
|
-
client2[method] = (options) => dispatch(
|
|
4745
|
+
client2[method] = (options) => dispatch(normalizeRequestOptions(options));
|
|
4713
4746
|
const sseDispatch = client2.sse[method];
|
|
4714
|
-
client2.sse[method] = (options) => sseDispatch(
|
|
4747
|
+
client2.sse[method] = (options) => sseDispatch(normalizeRequestOptions(options));
|
|
4715
4748
|
}
|
|
4716
4749
|
}
|
|
4750
|
+
patchGeneratedRequests(client);
|
|
4717
4751
|
function createOmnaraClient(options = {}) {
|
|
4718
4752
|
const client2 = createClient(
|
|
4719
4753
|
createConfig({
|
|
@@ -4737,37 +4771,37 @@ function createOmnaraClient(options = {}) {
|
|
|
4737
4771
|
if (!response.ok) throw await ApiError.fromResponse(response);
|
|
4738
4772
|
return response;
|
|
4739
4773
|
});
|
|
4740
|
-
|
|
4774
|
+
patchGeneratedRequests(client2);
|
|
4741
4775
|
return client2;
|
|
4742
4776
|
}
|
|
4743
4777
|
|
|
4744
4778
|
// ../sdk/src/device.ts
|
|
4745
|
-
import * as
|
|
4779
|
+
import * as z7 from "zod";
|
|
4746
4780
|
var OMNARA_CLI_OAUTH_CLIENT_ID = "omnara-cli";
|
|
4747
4781
|
var OAUTH_DEVICE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
|
|
4748
|
-
var zAuthorizationServerMetadata =
|
|
4749
|
-
issuer:
|
|
4750
|
-
device_authorization_endpoint:
|
|
4751
|
-
token_endpoint:
|
|
4752
|
-
grant_types_supported:
|
|
4753
|
-
token_endpoint_auth_methods_supported:
|
|
4754
|
-
});
|
|
4755
|
-
var zDeviceAuthStartResponse =
|
|
4756
|
-
device_code:
|
|
4757
|
-
user_code:
|
|
4758
|
-
verification_uri:
|
|
4759
|
-
verification_uri_complete:
|
|
4760
|
-
expires_in:
|
|
4761
|
-
interval:
|
|
4762
|
-
});
|
|
4763
|
-
var zDeviceAuthErrorResponse =
|
|
4764
|
-
error:
|
|
4765
|
-
error_description:
|
|
4782
|
+
var zAuthorizationServerMetadata = z7.object({
|
|
4783
|
+
issuer: z7.url(),
|
|
4784
|
+
device_authorization_endpoint: z7.url(),
|
|
4785
|
+
token_endpoint: z7.url(),
|
|
4786
|
+
grant_types_supported: z7.array(z7.string()),
|
|
4787
|
+
token_endpoint_auth_methods_supported: z7.array(z7.string())
|
|
4788
|
+
});
|
|
4789
|
+
var zDeviceAuthStartResponse = z7.object({
|
|
4790
|
+
device_code: z7.string().min(1),
|
|
4791
|
+
user_code: z7.string().min(1),
|
|
4792
|
+
verification_uri: z7.string().min(1),
|
|
4793
|
+
verification_uri_complete: z7.string().min(1),
|
|
4794
|
+
expires_in: z7.number().int().positive(),
|
|
4795
|
+
interval: z7.number().int().positive()
|
|
4796
|
+
});
|
|
4797
|
+
var zDeviceAuthErrorResponse = z7.object({
|
|
4798
|
+
error: z7.string().min(1),
|
|
4799
|
+
error_description: z7.string().optional()
|
|
4766
4800
|
});
|
|
4767
4801
|
var zDeviceAuthFailure = zJsonText.pipe(zDeviceAuthErrorResponse);
|
|
4768
|
-
var zDeviceAuthApprovedResponse =
|
|
4769
|
-
access_token:
|
|
4770
|
-
token_type:
|
|
4802
|
+
var zDeviceAuthApprovedResponse = z7.object({
|
|
4803
|
+
access_token: z7.string().min(1),
|
|
4804
|
+
token_type: z7.string()
|
|
4771
4805
|
});
|
|
4772
4806
|
var DEVICE_AUTH_FAILURE_MESSAGES = {
|
|
4773
4807
|
access_denied: "the login request was denied",
|
|
@@ -7569,15 +7603,15 @@ var downloadDaemonArtifact = (options) => (options.client ?? client).get({
|
|
|
7569
7603
|
import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
7570
7604
|
import { homedir } from "node:os";
|
|
7571
7605
|
import { dirname, join } from "node:path";
|
|
7572
|
-
import * as
|
|
7606
|
+
import * as z9 from "zod";
|
|
7573
7607
|
|
|
7574
7608
|
// src/output.ts
|
|
7575
|
-
import * as
|
|
7576
|
-
var zRenderValue =
|
|
7609
|
+
import * as z8 from "zod";
|
|
7610
|
+
var zRenderValue = z8.json();
|
|
7577
7611
|
var zOptionalRenderValue = zRenderValue.optional();
|
|
7578
|
-
var zListEnvelope =
|
|
7579
|
-
data:
|
|
7580
|
-
next_cursor:
|
|
7612
|
+
var zListEnvelope = z8.strictObject({
|
|
7613
|
+
data: z8.array(zRenderValue),
|
|
7614
|
+
next_cursor: z8.string().nullable()
|
|
7581
7615
|
});
|
|
7582
7616
|
var PREFERRED_LEADING_COLUMNS = ["id", "name"];
|
|
7583
7617
|
var HIDDEN_TABLE_COLUMNS = /* @__PURE__ */ new Set(["org_id", "project_id"]);
|
|
@@ -7749,9 +7783,9 @@ async function runCliAction(action) {
|
|
|
7749
7783
|
} catch (error) {
|
|
7750
7784
|
if (error instanceof CliInputError) {
|
|
7751
7785
|
console.error(`error: ${error.message}`);
|
|
7752
|
-
} else if (error instanceof
|
|
7786
|
+
} else if (error instanceof z8.ZodError) {
|
|
7753
7787
|
console.error(`error: unexpected response shape:
|
|
7754
|
-
${
|
|
7788
|
+
${z8.prettifyError(error)}`);
|
|
7755
7789
|
} else if (error instanceof ApiError) {
|
|
7756
7790
|
const code = error.code ? ` [${error.code}]` : "";
|
|
7757
7791
|
console.error(`error: API ${error.status}${code}: ${error.message}`);
|
|
@@ -7763,11 +7797,11 @@ ${z7.prettifyError(error)}`);
|
|
|
7763
7797
|
}
|
|
7764
7798
|
|
|
7765
7799
|
// src/config-file.ts
|
|
7766
|
-
var zConfigFile =
|
|
7767
|
-
api_url:
|
|
7768
|
-
issuer_url:
|
|
7769
|
-
base_url:
|
|
7770
|
-
token:
|
|
7800
|
+
var zConfigFile = z9.looseObject({
|
|
7801
|
+
api_url: z9.url().optional(),
|
|
7802
|
+
issuer_url: z9.url().optional(),
|
|
7803
|
+
base_url: z9.url().optional(),
|
|
7804
|
+
token: z9.string().min(1).optional(),
|
|
7771
7805
|
org_id: zOrganizationId.optional(),
|
|
7772
7806
|
project_id: zProjectId.optional()
|
|
7773
7807
|
});
|
|
@@ -7783,10 +7817,10 @@ function warnConfigIgnored(message) {
|
|
|
7783
7817
|
function loadConfigFile() {
|
|
7784
7818
|
const path = configFilePath();
|
|
7785
7819
|
if (!existsSync(path)) return { readable: true, file: {} };
|
|
7786
|
-
const
|
|
7787
|
-
if (!
|
|
7788
|
-
const file = zConfigFile.safeParse(
|
|
7789
|
-
return file.success ? { readable: true, file: file.data } : { readable: false, reason:
|
|
7820
|
+
const json8 = zJsonText.safeParse(readFileSync(path, "utf8"));
|
|
7821
|
+
if (!json8.success) return { readable: false, reason: z9.prettifyError(json8.error) };
|
|
7822
|
+
const file = zConfigFile.safeParse(json8.data);
|
|
7823
|
+
return file.success ? { readable: true, file: file.data } : { readable: false, reason: z9.prettifyError(file.error) };
|
|
7790
7824
|
}
|
|
7791
7825
|
function readConfigFile() {
|
|
7792
7826
|
const loaded = loadConfigFile();
|
|
@@ -7813,7 +7847,7 @@ function updateConfigFile(patch) {
|
|
|
7813
7847
|
const result = zConfigFile.safeParse(merged);
|
|
7814
7848
|
if (!result.success) {
|
|
7815
7849
|
throw new CliInputError(`refusing to save invalid config:
|
|
7816
|
-
${
|
|
7850
|
+
${z9.prettifyError(result.error)}`);
|
|
7817
7851
|
}
|
|
7818
7852
|
mkdirSync(dirname(configFilePath()), { recursive: true, mode: 448 });
|
|
7819
7853
|
writeFileSync(configFilePath(), `${JSON.stringify(result.data, null, 2)}
|
|
@@ -7825,7 +7859,7 @@ ${z8.prettifyError(result.error)}`);
|
|
|
7825
7859
|
// src/device-login.ts
|
|
7826
7860
|
import { hostname } from "node:os";
|
|
7827
7861
|
import { intro, log, note, outro, spinner } from "@clack/prompts";
|
|
7828
|
-
import * as
|
|
7862
|
+
import * as z10 from "zod";
|
|
7829
7863
|
|
|
7830
7864
|
// src/browser.ts
|
|
7831
7865
|
import { spawn } from "node:child_process";
|
|
@@ -7998,7 +8032,7 @@ function loginTokenName(explicit, hostName) {
|
|
|
7998
8032
|
if (result.success) return result.data;
|
|
7999
8033
|
if (explicit === void 0) return cliLoginTokenName();
|
|
8000
8034
|
throw new CliInputError(`invalid token name:
|
|
8001
|
-
${
|
|
8035
|
+
${z10.prettifyError(result.error)}`);
|
|
8002
8036
|
}
|
|
8003
8037
|
async function loginWithDevice(options) {
|
|
8004
8038
|
const { report, store } = options;
|
|
@@ -8234,14 +8268,14 @@ function registerConfigCommand(program2, cli) {
|
|
|
8234
8268
|
|
|
8235
8269
|
// src/factory.ts
|
|
8236
8270
|
import { InvalidArgumentError } from "commander";
|
|
8237
|
-
import * as
|
|
8271
|
+
import * as z12 from "zod";
|
|
8238
8272
|
|
|
8239
8273
|
// src/flags.ts
|
|
8240
|
-
import * as
|
|
8241
|
-
var zScalarKind =
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
|
|
8274
|
+
import * as z11 from "zod";
|
|
8275
|
+
var zScalarKind = z11.union([
|
|
8276
|
+
z11.string().transform(() => "string"),
|
|
8277
|
+
z11.number().transform(() => "number"),
|
|
8278
|
+
z11.boolean().transform(() => "boolean")
|
|
8245
8279
|
]);
|
|
8246
8280
|
function isChoice(value) {
|
|
8247
8281
|
return typeof value === "string" || typeof value === "number";
|
|
@@ -8358,7 +8392,7 @@ function finalizeFlag(draft) {
|
|
|
8358
8392
|
};
|
|
8359
8393
|
}
|
|
8360
8394
|
function deriveFlags(schema) {
|
|
8361
|
-
const jsonSchema =
|
|
8395
|
+
const jsonSchema = z11.toJSONSchema(schema, { io: "input" });
|
|
8362
8396
|
const drafts = /* @__PURE__ */ new Map();
|
|
8363
8397
|
collectDrafts(drafts, jsonSchema, [], false);
|
|
8364
8398
|
return [...drafts.values()].map(finalizeFlag);
|
|
@@ -8429,9 +8463,9 @@ function createFlowReporter(title) {
|
|
|
8429
8463
|
}
|
|
8430
8464
|
|
|
8431
8465
|
// src/factory.ts
|
|
8432
|
-
var zFlagValue =
|
|
8433
|
-
var zFlagObject =
|
|
8434
|
-
var zNoParams =
|
|
8466
|
+
var zFlagValue = z12.json();
|
|
8467
|
+
var zFlagObject = z12.record(z12.string(), zFlagValue);
|
|
8468
|
+
var zNoParams = z12.object({});
|
|
8435
8469
|
function op(spec) {
|
|
8436
8470
|
return {
|
|
8437
8471
|
type: "op",
|
|
@@ -8587,7 +8621,7 @@ function parseWithSchema(schema, value, label) {
|
|
|
8587
8621
|
const result = schema.safeParse(value);
|
|
8588
8622
|
if (!result.success) {
|
|
8589
8623
|
throw new CliInputError(`invalid ${label}:
|
|
8590
|
-
${
|
|
8624
|
+
${z12.prettifyError(result.error)}`);
|
|
8591
8625
|
}
|
|
8592
8626
|
return result.data;
|
|
8593
8627
|
}
|
|
@@ -8632,7 +8666,7 @@ function registerPathParams(command, plan) {
|
|
|
8632
8666
|
command.option(param.option, `defaults from config (${param.describe})`);
|
|
8633
8667
|
}
|
|
8634
8668
|
}
|
|
8635
|
-
var zExplicitOption =
|
|
8669
|
+
var zExplicitOption = z12.string().optional();
|
|
8636
8670
|
async function resolvePathValues(plan, args, options, config2) {
|
|
8637
8671
|
const path = {};
|
|
8638
8672
|
plan.positionalParams.forEach((param, index) => {
|
|
@@ -8775,10 +8809,10 @@ function registerLoginCommand(program2, cli) {
|
|
|
8775
8809
|
}
|
|
8776
8810
|
|
|
8777
8811
|
// src/manifest.ts
|
|
8778
|
-
import * as
|
|
8812
|
+
import * as z24 from "zod";
|
|
8779
8813
|
|
|
8780
8814
|
// src/agent-commands.ts
|
|
8781
|
-
import * as
|
|
8815
|
+
import * as z17 from "zod";
|
|
8782
8816
|
|
|
8783
8817
|
// ../sdk/src/generated/@tanstack/react-query.gen.ts
|
|
8784
8818
|
import { infiniteQueryOptions, queryOptions } from "@tanstack/react-query";
|
|
@@ -8880,10 +8914,10 @@ function useOmnaraClient() {
|
|
|
8880
8914
|
}
|
|
8881
8915
|
|
|
8882
8916
|
// ../react/src/domains/query-keys.ts
|
|
8883
|
-
import { z as
|
|
8884
|
-
var generatedQueryKeyEntry =
|
|
8885
|
-
_id:
|
|
8886
|
-
path:
|
|
8917
|
+
import { z as z13 } from "zod";
|
|
8918
|
+
var generatedQueryKeyEntry = z13.object({
|
|
8919
|
+
_id: z13.string(),
|
|
8920
|
+
path: z13.object({ orgID: z13.string().optional(), projectID: z13.string().optional() }).optional()
|
|
8887
8921
|
});
|
|
8888
8922
|
function generatedQueryKey(query) {
|
|
8889
8923
|
const parsed = generatedQueryKeyEntry.safeParse(query.queryKey[0]);
|
|
@@ -8906,7 +8940,7 @@ import { useCallback, useEffect, useMemo, useSyncExternalStore } from "react";
|
|
|
8906
8940
|
import { useInfiniteQuery } from "@tanstack/react-query";
|
|
8907
8941
|
|
|
8908
8942
|
// ../react/src/domains/agent-chat-messages.ts
|
|
8909
|
-
import { z as
|
|
8943
|
+
import { z as z14 } from "zod";
|
|
8910
8944
|
function parseStreamData(data) {
|
|
8911
8945
|
if ("event_kind" in data) return { kind: "event", event: data };
|
|
8912
8946
|
if ("tool_call_id" in data && "state" in data) return { kind: "tool_call_update" };
|
|
@@ -8943,7 +8977,7 @@ function mediaPart(block, id) {
|
|
|
8943
8977
|
function isHiddenContentBlock(block) {
|
|
8944
8978
|
return block.metadata?.omnara_hidden === "true";
|
|
8945
8979
|
}
|
|
8946
|
-
var structuredToolError =
|
|
8980
|
+
var structuredToolError = z14.object({ error_code: z14.string() });
|
|
8947
8981
|
function structuredToolErrorCode(blocks) {
|
|
8948
8982
|
for (const block of blocks) {
|
|
8949
8983
|
if (block.type !== "structured_data") continue;
|
|
@@ -10127,56 +10161,56 @@ import { useQuery as useQuery11 } from "@tanstack/react-query";
|
|
|
10127
10161
|
var mcpServerToolsStaleTime = 60 * 1e3;
|
|
10128
10162
|
|
|
10129
10163
|
// ../react/src/domains/me.ts
|
|
10130
|
-
import { useSuspenseQuery as useSuspenseQuery5 } from "@tanstack/react-query";
|
|
10164
|
+
import { useMutation as useMutation11, useQueryClient as useQueryClient13, useSuspenseQuery as useSuspenseQuery5 } from "@tanstack/react-query";
|
|
10131
10165
|
|
|
10132
10166
|
// ../react/src/domains/model-providers.ts
|
|
10133
10167
|
import {
|
|
10134
10168
|
useInfiniteQuery as useInfiniteQuery9,
|
|
10135
|
-
useMutation as
|
|
10169
|
+
useMutation as useMutation12,
|
|
10136
10170
|
useQueries,
|
|
10137
10171
|
useQuery as useQuery12,
|
|
10138
|
-
useQueryClient as
|
|
10172
|
+
useQueryClient as useQueryClient14
|
|
10139
10173
|
} from "@tanstack/react-query";
|
|
10140
10174
|
import { useEffect as useEffect2 } from "react";
|
|
10141
10175
|
var modelCatalogPricingStaleTime = 5 * 60 * 1e3;
|
|
10142
10176
|
|
|
10143
10177
|
// ../react/src/domains/org-api-keys.ts
|
|
10144
|
-
import { useInfiniteQuery as useInfiniteQuery10, useMutation as
|
|
10178
|
+
import { useInfiniteQuery as useInfiniteQuery10, useMutation as useMutation13, useQuery as useQuery13, useQueryClient as useQueryClient15 } from "@tanstack/react-query";
|
|
10145
10179
|
|
|
10146
10180
|
// ../react/src/domains/org-members.ts
|
|
10147
|
-
import { useMutation as
|
|
10181
|
+
import { useMutation as useMutation14, useQuery as useQuery14, useQueryClient as useQueryClient16 } from "@tanstack/react-query";
|
|
10148
10182
|
|
|
10149
10183
|
// ../react/src/domains/orgs.ts
|
|
10150
|
-
import { useInfiniteQuery as useInfiniteQuery11, useMutation as
|
|
10184
|
+
import { useInfiniteQuery as useInfiniteQuery11, useMutation as useMutation15, useQuery as useQuery15, useQueryClient as useQueryClient17 } from "@tanstack/react-query";
|
|
10151
10185
|
|
|
10152
10186
|
// ../react/src/domains/personal-access-tokens.ts
|
|
10153
|
-
import { useInfiniteQuery as useInfiniteQuery12, useMutation as
|
|
10187
|
+
import { useInfiniteQuery as useInfiniteQuery12, useMutation as useMutation16, useQueryClient as useQueryClient18 } from "@tanstack/react-query";
|
|
10154
10188
|
|
|
10155
10189
|
// ../react/src/domains/project-grants.ts
|
|
10156
|
-
import { useInfiniteQuery as useInfiniteQuery13, useMutation as
|
|
10190
|
+
import { useInfiniteQuery as useInfiniteQuery13, useMutation as useMutation17, useQueryClient as useQueryClient19 } from "@tanstack/react-query";
|
|
10157
10191
|
|
|
10158
10192
|
// ../react/src/domains/projects.ts
|
|
10159
10193
|
import {
|
|
10160
10194
|
skipToken,
|
|
10161
10195
|
useInfiniteQuery as useInfiniteQuery14,
|
|
10162
|
-
useQueryClient as
|
|
10196
|
+
useQueryClient as useQueryClient20,
|
|
10163
10197
|
useSuspenseInfiniteQuery
|
|
10164
10198
|
} from "@tanstack/react-query";
|
|
10165
10199
|
|
|
10166
10200
|
// ../react/src/domains/secrets.ts
|
|
10167
10201
|
import {
|
|
10168
10202
|
useInfiniteQuery as useInfiniteQuery15,
|
|
10169
|
-
useMutation as
|
|
10203
|
+
useMutation as useMutation18,
|
|
10170
10204
|
useQuery as useQuery16,
|
|
10171
|
-
useQueryClient as
|
|
10205
|
+
useQueryClient as useQueryClient21
|
|
10172
10206
|
} from "@tanstack/react-query";
|
|
10173
10207
|
|
|
10174
10208
|
// ../react/src/domains/skills.ts
|
|
10175
10209
|
import {
|
|
10176
10210
|
useInfiniteQuery as useInfiniteQuery16,
|
|
10177
|
-
useMutation as
|
|
10211
|
+
useMutation as useMutation19,
|
|
10178
10212
|
useQuery as useQuery17,
|
|
10179
|
-
useQueryClient as
|
|
10213
|
+
useQueryClient as useQueryClient22
|
|
10180
10214
|
} from "@tanstack/react-query";
|
|
10181
10215
|
|
|
10182
10216
|
// ../react/src/domains/tool-catalog.ts
|
|
@@ -10189,10 +10223,10 @@ import { render } from "ink";
|
|
|
10189
10223
|
// src/chat-ui.tsx
|
|
10190
10224
|
import { Box as Box2, Static, Text as Text2, useApp } from "ink";
|
|
10191
10225
|
import { useEffect as useEffect3, useMemo as useMemo2, useReducer, useState as useState2 } from "react";
|
|
10192
|
-
import * as
|
|
10226
|
+
import * as z16 from "zod";
|
|
10193
10227
|
|
|
10194
10228
|
// src/agent-rendering.ts
|
|
10195
|
-
import * as
|
|
10229
|
+
import * as z15 from "zod";
|
|
10196
10230
|
var formatAgentEventList = (response) => {
|
|
10197
10231
|
const page = {
|
|
10198
10232
|
data: response.data.map((event) => ({
|
|
@@ -10209,10 +10243,10 @@ var formatAgentEventList = (response) => {
|
|
|
10209
10243
|
return { value: next_before_sequence == null ? page : { ...page, next_before_sequence } };
|
|
10210
10244
|
};
|
|
10211
10245
|
var summaryWidth = 100;
|
|
10212
|
-
var zJsonValue =
|
|
10213
|
-
var zRunCommandInput =
|
|
10246
|
+
var zJsonValue = z15.json();
|
|
10247
|
+
var zRunCommandInput = z15.object({ command: z15.string() });
|
|
10214
10248
|
function summaryValue(value) {
|
|
10215
|
-
const text =
|
|
10249
|
+
const text = z15.string().safeParse(value);
|
|
10216
10250
|
return text.success ? text.data : JSON.stringify(value);
|
|
10217
10251
|
}
|
|
10218
10252
|
function toolCallSummary(name, input) {
|
|
@@ -10406,10 +10440,10 @@ import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
|
10406
10440
|
var spinnerFrames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
10407
10441
|
var streamingTailLines = 8;
|
|
10408
10442
|
var streamingTailChars = 1500;
|
|
10409
|
-
var zToolInput2 =
|
|
10410
|
-
var zToolOutput =
|
|
10443
|
+
var zToolInput2 = z16.record(z16.string(), z16.json());
|
|
10444
|
+
var zToolOutput = z16.object({
|
|
10411
10445
|
outcome: zToolCallOutcome,
|
|
10412
|
-
contentBlocks:
|
|
10446
|
+
contentBlocks: z16.array(zToolResultContentBlock)
|
|
10413
10447
|
});
|
|
10414
10448
|
function formatDuration(ms) {
|
|
10415
10449
|
const seconds = Math.max(1, Math.round(ms / 1e3));
|
|
@@ -10775,7 +10809,7 @@ var agentEventsStreamOp = customOp({
|
|
|
10775
10809
|
},
|
|
10776
10810
|
run: async ({ client: client2, path, args, options }) => {
|
|
10777
10811
|
const agentID = parseWithSchema(zAgentId, args[0], "agent id");
|
|
10778
|
-
const afterSequence = parseWithSchema(
|
|
10812
|
+
const afterSequence = parseWithSchema(z17.int().gte(0).optional(), options.afterSequence, "--after-sequence") ?? 0;
|
|
10779
10813
|
const abort = new AbortController();
|
|
10780
10814
|
process.once("SIGINT", () => {
|
|
10781
10815
|
abort.abort();
|
|
@@ -10792,12 +10826,12 @@ var agentEventsStreamOp = customOp({
|
|
|
10792
10826
|
|
|
10793
10827
|
// src/config-attachment.ts
|
|
10794
10828
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
10795
|
-
import * as
|
|
10796
|
-
var zConfigSourceAttachment =
|
|
10797
|
-
file:
|
|
10798
|
-
source:
|
|
10829
|
+
import * as z18 from "zod";
|
|
10830
|
+
var zConfigSourceAttachment = z18.object({
|
|
10831
|
+
file: z18.string().min(1).optional().describe("path to an agent config file (.yaml, .yml, or .json)"),
|
|
10832
|
+
source: z18.string().min(1).optional().describe("inline agent config source (YAML or JSON)")
|
|
10799
10833
|
});
|
|
10800
|
-
var zConfigAttachment =
|
|
10834
|
+
var zConfigAttachment = z18.object({
|
|
10801
10835
|
config: zAgentConfigId.optional().describe("existing agent config ID"),
|
|
10802
10836
|
...zConfigSourceAttachment.shape
|
|
10803
10837
|
});
|
|
@@ -10883,7 +10917,7 @@ import { spawn as spawn2, spawnSync } from "node:child_process";
|
|
|
10883
10917
|
import { accessSync, constants, existsSync as existsSync2, readdirSync, readFileSync as readFileSync3 } from "node:fs";
|
|
10884
10918
|
import { homedir as homedir2, release } from "node:os";
|
|
10885
10919
|
import { basename, dirname as dirname2, isAbsolute, join as join2, resolve } from "node:path";
|
|
10886
|
-
import * as
|
|
10920
|
+
import * as z19 from "zod";
|
|
10887
10921
|
var zMachineSetupBody = zConnectByoMachineRequest;
|
|
10888
10922
|
async function connectMachine(context) {
|
|
10889
10923
|
const { client: client2, path, body, report } = context;
|
|
@@ -10920,9 +10954,9 @@ var daemonConfigFileName = "daemon.json";
|
|
|
10920
10954
|
var installLockFileName = "install.lock";
|
|
10921
10955
|
var daemonLockFileName = "daemon.lock";
|
|
10922
10956
|
var daemonLockPollMs = 250;
|
|
10923
|
-
var zDaemonConfigFile =
|
|
10924
|
-
machine_id:
|
|
10925
|
-
api_url:
|
|
10957
|
+
var zDaemonConfigFile = z19.looseObject({
|
|
10958
|
+
machine_id: z19.string().optional(),
|
|
10959
|
+
api_url: z19.string().optional()
|
|
10926
10960
|
});
|
|
10927
10961
|
function daemonHome() {
|
|
10928
10962
|
const override = process.env.OMNARA_HOME;
|
|
@@ -11204,10 +11238,10 @@ function runInstaller(report, apiUrl, token, machineId, home) {
|
|
|
11204
11238
|
|
|
11205
11239
|
// src/mcp-add.ts
|
|
11206
11240
|
import { isMap, isScalar as isScalar2, parseDocument } from "yaml";
|
|
11207
|
-
import * as
|
|
11241
|
+
import * as z21 from "zod";
|
|
11208
11242
|
|
|
11209
11243
|
// src/mcp-oauth.ts
|
|
11210
|
-
import * as
|
|
11244
|
+
import * as z20 from "zod";
|
|
11211
11245
|
async function authorizeMcpOAuthSecret(options) {
|
|
11212
11246
|
const { data: start } = await sdk_gen_exports.startSecretMcpoAuth({
|
|
11213
11247
|
client: options.client,
|
|
@@ -11228,7 +11262,7 @@ async function authorizeMcpOAuthSecret(options) {
|
|
|
11228
11262
|
}
|
|
11229
11263
|
});
|
|
11230
11264
|
}
|
|
11231
|
-
var zBrowserFlag =
|
|
11265
|
+
var zBrowserFlag = z20.boolean().default(true).describe("open the authorization URL in a browser");
|
|
11232
11266
|
function openAuthorizationUrl(report, title, url4, browser) {
|
|
11233
11267
|
report.url(title, url4);
|
|
11234
11268
|
if (browser) {
|
|
@@ -11264,7 +11298,7 @@ async function runMcpOAuth(context) {
|
|
|
11264
11298
|
// src/mcp-add.ts
|
|
11265
11299
|
var SERVER_KEY_PATTERN = /^[a-zA-Z][a-zA-Z0-9-]{0,31}$/;
|
|
11266
11300
|
var zMcpAddBody = zMcpoAuthStartRequest.omit({ owner: true, name: true }).extend({
|
|
11267
|
-
server_name:
|
|
11301
|
+
server_name: z21.string().regex(
|
|
11268
11302
|
SERVER_KEY_PATTERN,
|
|
11269
11303
|
"must start with a letter and contain at most 32 letters, digits, or hyphens"
|
|
11270
11304
|
).describe("MCP server key used in the agent config"),
|
|
@@ -11277,11 +11311,11 @@ function targetLabel(target) {
|
|
|
11277
11311
|
function serverEntry(url4, secretId) {
|
|
11278
11312
|
return { url: url4, auth: { type: "oauth", secret_id: secretId } };
|
|
11279
11313
|
}
|
|
11280
|
-
var zJsonRecord =
|
|
11314
|
+
var zJsonRecord = z21.record(z21.string(), z21.json());
|
|
11281
11315
|
function prepareJsonConfig(config2, serverName, mcpUrl) {
|
|
11282
|
-
const
|
|
11283
|
-
if (!
|
|
11284
|
-
const parsed = zJsonRecord.safeParse(
|
|
11316
|
+
const json8 = zJsonText.safeParse(config2.source ?? "");
|
|
11317
|
+
if (!json8.success) throw new CliInputError("the current agent config contains invalid JSON");
|
|
11318
|
+
const parsed = zJsonRecord.safeParse(json8.data);
|
|
11285
11319
|
if (!parsed.success) throw new CliInputError("the current agent config must be an object");
|
|
11286
11320
|
const mcp = zJsonRecord.optional().safeParse(parsed.data.mcp);
|
|
11287
11321
|
if (!mcp.success) {
|
|
@@ -11440,10 +11474,10 @@ function runProfileMcpAdd(context) {
|
|
|
11440
11474
|
import { readdirSync as readdirSync2, readFileSync as readFileSync4, statSync } from "node:fs";
|
|
11441
11475
|
import { basename as basename2, dirname as dirname3, join as join3, resolve as resolve2 } from "node:path";
|
|
11442
11476
|
import * as tar from "tar";
|
|
11443
|
-
import * as
|
|
11444
|
-
var zCreateSkillCliBody =
|
|
11477
|
+
import * as z22 from "zod";
|
|
11478
|
+
var zCreateSkillCliBody = z22.object({
|
|
11445
11479
|
owner: zSkillOwnerInput,
|
|
11446
|
-
archive:
|
|
11480
|
+
archive: z22.string().min(1).describe("path to a skill directory (packed automatically) or a .zip/.tar.gz archive")
|
|
11447
11481
|
});
|
|
11448
11482
|
var ARCHIVE_SUFFIXES = [".zip", ".tar.gz", ".tgz"];
|
|
11449
11483
|
function assertPackable(dir) {
|
|
@@ -11485,16 +11519,16 @@ async function loadSkillArchive(archivePath) {
|
|
|
11485
11519
|
}
|
|
11486
11520
|
|
|
11487
11521
|
// src/slack-integration.ts
|
|
11488
|
-
import * as
|
|
11489
|
-
var zSlackBody =
|
|
11490
|
-
app_name:
|
|
11491
|
-
app_configuration_token:
|
|
11492
|
-
icon_filename:
|
|
11493
|
-
icon_data_base64:
|
|
11494
|
-
client_id:
|
|
11495
|
-
client_secret:
|
|
11496
|
-
signing_secret:
|
|
11497
|
-
return_to:
|
|
11522
|
+
import * as z23 from "zod";
|
|
11523
|
+
var zSlackBody = z23.object({
|
|
11524
|
+
app_name: z23.string().optional().describe("name for a new Slack app"),
|
|
11525
|
+
app_configuration_token: z23.string().optional().describe("Slack app configuration token for a new app"),
|
|
11526
|
+
icon_filename: z23.string().optional().describe("filename for the new Slack app icon"),
|
|
11527
|
+
icon_data_base64: z23.string().optional().describe("base64-encoded Slack app icon"),
|
|
11528
|
+
client_id: z23.string().optional().describe("existing Slack app client ID"),
|
|
11529
|
+
client_secret: z23.string().optional().describe("existing Slack app client secret"),
|
|
11530
|
+
signing_secret: z23.string().optional().describe("existing Slack app signing secret"),
|
|
11531
|
+
return_to: z23.string().optional().describe("console-relative path opened after authorization"),
|
|
11498
11532
|
browser: zBrowserFlag
|
|
11499
11533
|
});
|
|
11500
11534
|
function parseRequest(body) {
|
|
@@ -11524,7 +11558,7 @@ function parseRequest(body) {
|
|
|
11524
11558
|
if (!result2.success) {
|
|
11525
11559
|
throw new CliInputError(
|
|
11526
11560
|
`invalid existing Slack app parameters:
|
|
11527
|
-
${
|
|
11561
|
+
${z23.prettifyError(result2.error)}`
|
|
11528
11562
|
);
|
|
11529
11563
|
}
|
|
11530
11564
|
return { kind: "existing-app", body: result2.data };
|
|
@@ -11545,7 +11579,7 @@ ${z22.prettifyError(result2.error)}`
|
|
|
11545
11579
|
if (!result.success) {
|
|
11546
11580
|
throw new CliInputError(
|
|
11547
11581
|
`invalid Slack app parameters:
|
|
11548
|
-
${
|
|
11582
|
+
${z23.prettifyError(result.error)}
|
|
11549
11583
|
Pass --app-name and --app-configuration-token, or existing app credentials.`
|
|
11550
11584
|
);
|
|
11551
11585
|
}
|
|
@@ -11644,7 +11678,7 @@ var commandGroups = [
|
|
|
11644
11678
|
body: zConfigAttachment.extend({
|
|
11645
11679
|
profile: zAgentProfileId.optional(),
|
|
11646
11680
|
name: zAgentName.optional(),
|
|
11647
|
-
message:
|
|
11681
|
+
message: z24.string().optional()
|
|
11648
11682
|
}),
|
|
11649
11683
|
transformBody: async ({ profile, name, message, ...attachment }, { client: client2, path }) => ({
|
|
11650
11684
|
profile,
|
|
@@ -11685,7 +11719,7 @@ var commandGroups = [
|
|
|
11685
11719
|
flowOp({
|
|
11686
11720
|
verb: "mcp-add",
|
|
11687
11721
|
summary: "Create an OAuth secret and add an MCP server to an agent",
|
|
11688
|
-
path:
|
|
11722
|
+
path: z24.object({
|
|
11689
11723
|
orgID: zOrganizationId,
|
|
11690
11724
|
projectID: zProjectId,
|
|
11691
11725
|
agentID: zAgentId
|
|
@@ -11701,7 +11735,7 @@ var commandGroups = [
|
|
|
11701
11735
|
format: (response) => formatRecord()(response.agent_input),
|
|
11702
11736
|
path: zCreateAgentInputPath,
|
|
11703
11737
|
body: zCreateAgentInputBody.partial({ content_blocks: true }).extend({
|
|
11704
|
-
message:
|
|
11738
|
+
message: z24.string().optional().describe("plain text to send as a single text block")
|
|
11705
11739
|
}).transform(({ message, content_blocks, ...rest }, ctx) => {
|
|
11706
11740
|
if (content_blocks !== void 0 && message === void 0) {
|
|
11707
11741
|
return { ...rest, content_blocks };
|
|
@@ -11710,7 +11744,7 @@ var commandGroups = [
|
|
|
11710
11744
|
return { ...rest, content_blocks: [{ type: "text", text: message }] };
|
|
11711
11745
|
}
|
|
11712
11746
|
ctx.addIssue("pass exactly one of --message or --content-blocks");
|
|
11713
|
-
return
|
|
11747
|
+
return z24.NEVER;
|
|
11714
11748
|
})
|
|
11715
11749
|
})
|
|
11716
11750
|
],
|
|
@@ -11727,8 +11761,8 @@ var commandGroups = [
|
|
|
11727
11761
|
format: formatAgentEventList,
|
|
11728
11762
|
path: zListEventsPath,
|
|
11729
11763
|
query: zListEventsQuery.extend({
|
|
11730
|
-
before_sequence:
|
|
11731
|
-
after_sequence:
|
|
11764
|
+
before_sequence: z24.int().gte(0).optional(),
|
|
11765
|
+
after_sequence: z24.int().gte(0).optional()
|
|
11732
11766
|
})
|
|
11733
11767
|
}),
|
|
11734
11768
|
agentEventsStreamOp
|
|
@@ -12225,7 +12259,7 @@ var commandGroups = [
|
|
|
12225
12259
|
flowOp({
|
|
12226
12260
|
verb: "mcp-oauth",
|
|
12227
12261
|
summary: "Create a secret through an MCP server OAuth flow",
|
|
12228
|
-
path:
|
|
12262
|
+
path: z24.object({ orgID: zOrganizationId }),
|
|
12229
12263
|
body: zMcpOAuthBody,
|
|
12230
12264
|
run: runMcpOAuth
|
|
12231
12265
|
})
|
|
@@ -12339,7 +12373,7 @@ var commandGroups = [
|
|
|
12339
12373
|
flowOp({
|
|
12340
12374
|
verb: "mcp-add",
|
|
12341
12375
|
summary: "Create an OAuth secret and add an MCP server to an agent profile",
|
|
12342
|
-
path:
|
|
12376
|
+
path: z24.object({
|
|
12343
12377
|
orgID: zOrganizationId,
|
|
12344
12378
|
projectID: zProjectId,
|
|
12345
12379
|
agentProfileID: zAgentProfileId
|
|
@@ -12351,7 +12385,7 @@ var commandGroups = [
|
|
|
12351
12385
|
verb: "slack",
|
|
12352
12386
|
aliases: ["slack-setup"],
|
|
12353
12387
|
summary: "Connect Slack to an agent profile through OAuth",
|
|
12354
|
-
path:
|
|
12388
|
+
path: z24.object({
|
|
12355
12389
|
orgID: zOrganizationId,
|
|
12356
12390
|
projectID: zProjectId,
|
|
12357
12391
|
agentProfileID: zAgentProfileId
|
package/package.json
CHANGED