omnara 1.0.33 → 1.0.35
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 +82 -26
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -28,7 +28,9 @@ var zAgentConfigDefinitionEventWebhook = z.object({
|
|
|
28
28
|
url: z.string().min(1)
|
|
29
29
|
});
|
|
30
30
|
var zAgentConfigDefinitionGitCredentials = z.object({
|
|
31
|
-
integration: z.string().regex(/^[a-zA-Z][a-zA-Z0-9-]{0,31}$/)
|
|
31
|
+
integration: z.string().regex(/^[a-zA-Z][a-zA-Z0-9-]{0,31}$/),
|
|
32
|
+
repository_ids: z.array(z.int().gte(1)).min(1).max(500).optional(),
|
|
33
|
+
read_only: z.boolean().optional()
|
|
32
34
|
});
|
|
33
35
|
var zAgentConfigDefinitionInteractionHandler = z.record(z.string(), z.never());
|
|
34
36
|
var zAgentConfigDefinitionInteractionHandlers = z.record(z.string(), zAgentConfigDefinitionInteractionHandler).nullable();
|
|
@@ -699,6 +701,14 @@ var zGitHubInstallations = z.object({
|
|
|
699
701
|
installations: z.array(zGitHubSetupInstallation),
|
|
700
702
|
next_page: z.int().gte(1).lte(1e3).optional()
|
|
701
703
|
});
|
|
704
|
+
var zGitHubRepository = z.object({
|
|
705
|
+
id: z.coerce.bigint().min(BigInt("-9223372036854775808"), { error: "Invalid value: Expected int64 to be >= -9223372036854775808" }).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
|
|
706
|
+
name: z.string()
|
|
707
|
+
});
|
|
708
|
+
var zListGitHubRepositoriesResponse = z.object({
|
|
709
|
+
data: z.array(zGitHubRepository),
|
|
710
|
+
next_cursor: z.string().nullable()
|
|
711
|
+
});
|
|
702
712
|
var zSlackSetupIcon = z.object({
|
|
703
713
|
filename: z.string().optional(),
|
|
704
714
|
data_base64: z.string().min(1)
|
|
@@ -1900,7 +1910,9 @@ var zCreateMachinePoolRequest = zCreateMachinePoolRequestBase.and(z.union([
|
|
|
1900
1910
|
provider: z.enum([
|
|
1901
1911
|
"boxd",
|
|
1902
1912
|
"createos",
|
|
1903
|
-
"daytona"
|
|
1913
|
+
"daytona",
|
|
1914
|
+
"e2b",
|
|
1915
|
+
"superserve"
|
|
1904
1916
|
]),
|
|
1905
1917
|
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" }),
|
|
1906
1918
|
max_total_memory_mb: z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
@@ -2592,6 +2604,25 @@ var zListCronTriggersResponse = z.object({
|
|
|
2592
2604
|
next_cursor: z.string().nullable()
|
|
2593
2605
|
});
|
|
2594
2606
|
var zIntegrationSettings = z.record(z.string(), z.unknown());
|
|
2607
|
+
var zGitHubIntegrationLauncher = z.object({
|
|
2608
|
+
profile: zAgentProfileId,
|
|
2609
|
+
trigger: z.enum([
|
|
2610
|
+
"mention",
|
|
2611
|
+
"pull_request_opened",
|
|
2612
|
+
"both"
|
|
2613
|
+
]),
|
|
2614
|
+
repository_id: z.string().regex(/^[1-9][0-9]*$/).optional()
|
|
2615
|
+
});
|
|
2616
|
+
var zGitHubIntegrationSettings = z.object({
|
|
2617
|
+
launcher: zGitHubIntegrationLauncher.optional(),
|
|
2618
|
+
code_write: z.boolean().optional()
|
|
2619
|
+
});
|
|
2620
|
+
var zChatIntegrationLauncher = z.object({
|
|
2621
|
+
profiles: z.array(zAgentProfileId).min(1).max(16)
|
|
2622
|
+
});
|
|
2623
|
+
var zChatIntegrationSettings = z.object({
|
|
2624
|
+
launcher: zChatIntegrationLauncher.optional()
|
|
2625
|
+
});
|
|
2595
2626
|
var zUpdateIntegrationRequest = z.object({
|
|
2596
2627
|
settings: zIntegrationSettings
|
|
2597
2628
|
});
|
|
@@ -2602,7 +2633,9 @@ var zIntegrationRuntimeFailure = z.object({
|
|
|
2602
2633
|
var zIntegrationName = z.string().regex(/^[a-zA-Z][a-zA-Z0-9-]{0,31}$/);
|
|
2603
2634
|
var zCompiledGitCredentials = z.object({
|
|
2604
2635
|
integration: zIntegrationName,
|
|
2605
|
-
integration_id: zIntegrationId
|
|
2636
|
+
integration_id: zIntegrationId,
|
|
2637
|
+
repository_ids: z.array(z.coerce.bigint().min(BigInt("-9223372036854775808"), { error: "Invalid value: Expected int64 to be >= -9223372036854775808" }).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" })).optional(),
|
|
2638
|
+
read_only: z.boolean().optional()
|
|
2606
2639
|
});
|
|
2607
2640
|
var zCompiledAgentConfig = z.object({
|
|
2608
2641
|
version: z.string().optional(),
|
|
@@ -4074,6 +4107,7 @@ var zListIntegrationsPath = z.object({
|
|
|
4074
4107
|
projectID: zProjectId
|
|
4075
4108
|
});
|
|
4076
4109
|
var zListIntegrationsQuery = z.object({
|
|
4110
|
+
name: z.string().min(1).max(200).optional(),
|
|
4077
4111
|
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
4078
4112
|
cursor: z.string().max(1024).optional()
|
|
4079
4113
|
});
|
|
@@ -4139,6 +4173,15 @@ var zDisconnectIntegrationPath = z.object({
|
|
|
4139
4173
|
integrationID: zIntegrationId
|
|
4140
4174
|
});
|
|
4141
4175
|
var zDisconnectIntegrationResponse = zIntegration;
|
|
4176
|
+
var zListIntegrationGitHubRepositoriesPath = z.object({
|
|
4177
|
+
orgID: zOrganizationId,
|
|
4178
|
+
projectID: zProjectId,
|
|
4179
|
+
integrationID: zIntegrationId
|
|
4180
|
+
});
|
|
4181
|
+
var zListIntegrationGitHubRepositoriesQuery = z.object({
|
|
4182
|
+
cursor: z.string().max(1024).optional()
|
|
4183
|
+
});
|
|
4184
|
+
var zListIntegrationGitHubRepositoriesResponse = zListGitHubRepositoriesResponse;
|
|
4142
4185
|
var zListIntegrationDefinitionsPath = z.object({
|
|
4143
4186
|
orgID: zOrganizationId,
|
|
4144
4187
|
projectID: zProjectId
|
|
@@ -4214,7 +4257,8 @@ var ApiError = class _ApiError extends Error {
|
|
|
4214
4257
|
body;
|
|
4215
4258
|
issues;
|
|
4216
4259
|
currentDigest;
|
|
4217
|
-
|
|
4260
|
+
retryAfterMs;
|
|
4261
|
+
constructor(status, message, code, body, retryAfterMs) {
|
|
4218
4262
|
super(message);
|
|
4219
4263
|
this.name = "ApiError";
|
|
4220
4264
|
this.status = status;
|
|
@@ -4223,17 +4267,30 @@ var ApiError = class _ApiError extends Error {
|
|
|
4223
4267
|
const parsed = zErrorResponse.safeParse(body);
|
|
4224
4268
|
this.issues = parsed.data?.issues ?? [];
|
|
4225
4269
|
this.currentDigest = parsed.data?.current_digest;
|
|
4270
|
+
this.retryAfterMs = retryAfterMs;
|
|
4226
4271
|
}
|
|
4227
4272
|
static async fromResponse(response) {
|
|
4228
4273
|
const body = zErrorBody.safeParse(await response.clone().text());
|
|
4229
|
-
return _ApiError.fromBody(
|
|
4274
|
+
return _ApiError.fromBody(
|
|
4275
|
+
response.status,
|
|
4276
|
+
body.success ? body.data : void 0,
|
|
4277
|
+
parseRetryAfter(response.headers.get("Retry-After"))
|
|
4278
|
+
);
|
|
4230
4279
|
}
|
|
4231
|
-
static fromBody(status, body) {
|
|
4280
|
+
static fromBody(status, body, retryAfterMs) {
|
|
4232
4281
|
const parsed = zErrorResponse.safeParse(body);
|
|
4233
4282
|
const message = parsed.data?.error_description ?? parsed.data?.error ?? `request failed with status ${status}`;
|
|
4234
|
-
return new _ApiError(status, message, parsed.data?.code, body);
|
|
4283
|
+
return new _ApiError(status, message, parsed.data?.code, body, retryAfterMs);
|
|
4235
4284
|
}
|
|
4236
4285
|
};
|
|
4286
|
+
function parseRetryAfter(value) {
|
|
4287
|
+
if (value == null) return void 0;
|
|
4288
|
+
const trimmed = value.trim();
|
|
4289
|
+
if (/^\d+$/.test(trimmed)) return Number.parseInt(trimmed, 10) * 1e3;
|
|
4290
|
+
const at = Date.parse(trimmed);
|
|
4291
|
+
if (Number.isNaN(at)) return void 0;
|
|
4292
|
+
return Math.max(at - Date.now(), 0);
|
|
4293
|
+
}
|
|
4237
4294
|
|
|
4238
4295
|
// ../sdk/src/server-sent-events.ts
|
|
4239
4296
|
function createServerSentEventParser() {
|
|
@@ -4316,16 +4373,6 @@ function retryable(error) {
|
|
|
4316
4373
|
if (error.kind === "api") return error.code === "service_unavailable";
|
|
4317
4374
|
return error.kind === "http" && (error.status === 408 || error.status === 429 || error.status != null && error.status >= 500);
|
|
4318
4375
|
}
|
|
4319
|
-
function parseRetryAfter(value, now = Date.now()) {
|
|
4320
|
-
if (value == null) return void 0;
|
|
4321
|
-
const trimmed = value.trim();
|
|
4322
|
-
if (/^\d+$/.test(trimmed)) {
|
|
4323
|
-
return Math.min(Number.parseInt(trimmed, 10) * 1e3, retryAfterMaximumDelayMs);
|
|
4324
|
-
}
|
|
4325
|
-
const at = Date.parse(trimmed);
|
|
4326
|
-
if (Number.isNaN(at)) return void 0;
|
|
4327
|
-
return Math.min(Math.max(at - now, 0), retryAfterMaximumDelayMs);
|
|
4328
|
-
}
|
|
4329
4376
|
function reconnectDelay(attempt) {
|
|
4330
4377
|
const maximum = Math.min(retryBaseDelayMs * 2 ** Math.max(attempt - 1, 0), retryMaximumDelayMs);
|
|
4331
4378
|
return Math.floor(Math.random() * maximum);
|
|
@@ -4397,7 +4444,7 @@ async function* openConnection(client2, { path, query, headers }, callerSignal)
|
|
|
4397
4444
|
throw streamError("http", apiError.message, {
|
|
4398
4445
|
status: response.status,
|
|
4399
4446
|
code: apiError.code,
|
|
4400
|
-
retryAfterMs:
|
|
4447
|
+
retryAfterMs: apiError.retryAfterMs === void 0 ? void 0 : Math.min(apiError.retryAfterMs, retryAfterMaximumDelayMs),
|
|
4401
4448
|
cause: apiError
|
|
4402
4449
|
});
|
|
4403
4450
|
}
|
|
@@ -5655,6 +5702,7 @@ __export(sdk_gen_exports, {
|
|
|
5655
5702
|
listCronTriggers: () => listCronTriggers,
|
|
5656
5703
|
listEvents: () => listEvents,
|
|
5657
5704
|
listIntegrationDefinitions: () => listIntegrationDefinitions,
|
|
5705
|
+
listIntegrationGitHubRepositories: () => listIntegrationGitHubRepositories,
|
|
5658
5706
|
listIntegrationSubscriptions: () => listIntegrationSubscriptions,
|
|
5659
5707
|
listIntegrations: () => listIntegrations,
|
|
5660
5708
|
listMachinePools: () => listMachinePools,
|
|
@@ -8726,6 +8774,20 @@ var disconnectIntegration = (options) => (options.client ?? client).post({
|
|
|
8726
8774
|
url: "/orgs/{orgID}/projects/{projectID}/integrations/{integrationID}/disconnect",
|
|
8727
8775
|
...options
|
|
8728
8776
|
});
|
|
8777
|
+
var listIntegrationGitHubRepositories = (options) => (options.client ?? client).get({
|
|
8778
|
+
responseValidator: relaxedResponseValidator(zListIntegrationGitHubRepositoriesResponse),
|
|
8779
|
+
security: [{
|
|
8780
|
+
key: "bearerAuth",
|
|
8781
|
+
scheme: "bearer",
|
|
8782
|
+
type: "http"
|
|
8783
|
+
}, {
|
|
8784
|
+
in: "cookie",
|
|
8785
|
+
name: "__Host-omnara_session",
|
|
8786
|
+
type: "apiKey"
|
|
8787
|
+
}],
|
|
8788
|
+
url: "/orgs/{orgID}/projects/{projectID}/integrations/{integrationID}/github-repositories",
|
|
8789
|
+
...options
|
|
8790
|
+
});
|
|
8729
8791
|
var listIntegrationDefinitions = (options) => (options.client ?? client).get({
|
|
8730
8792
|
responseValidator: relaxedResponseValidator(zListIntegrationDefinitionsResponse2),
|
|
8731
8793
|
security: [{
|
|
@@ -8750,14 +8812,8 @@ import * as z8 from "zod";
|
|
|
8750
8812
|
var discordPublicKeyPattern = "[a-fA-F0-9]{64}";
|
|
8751
8813
|
var discordPublicKey = z8.string().regex(new RegExp(`^${discordPublicKeyPattern}$`));
|
|
8752
8814
|
var profilesSchema = z8.array(zAgentProfileId).max(16).refine((ids) => new Set(ids).size === ids.length, "Choose each profile only once.");
|
|
8753
|
-
var
|
|
8754
|
-
var
|
|
8755
|
-
var chatLauncherSchema = z8.object({ profiles: profilesSchema.min(1) }).strict();
|
|
8756
|
-
var githubLauncherSchema = z8.object({
|
|
8757
|
-
profile: zAgentProfileId,
|
|
8758
|
-
trigger: triggerSchema,
|
|
8759
|
-
repository_id: repositorySchema.optional()
|
|
8760
|
-
}).strict();
|
|
8815
|
+
var chatLauncherSchema = z8.strictObject(zChatIntegrationLauncher.shape);
|
|
8816
|
+
var githubLauncherSchema = z8.strictObject(zGitHubIntegrationLauncher.shape);
|
|
8761
8817
|
function profileIntegrationProfileUpdate(integration, profileIds) {
|
|
8762
8818
|
if (!["slack_thread", "discord_thread"].includes(integration.integration_kind))
|
|
8763
8819
|
throw new Error("Profile editing requires a Slack or Discord integration.");
|