omnara 1.0.34 → 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 +81 -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)
|
|
@@ -1901,7 +1911,8 @@ var zCreateMachinePoolRequest = zCreateMachinePoolRequestBase.and(z.union([
|
|
|
1901
1911
|
"boxd",
|
|
1902
1912
|
"createos",
|
|
1903
1913
|
"daytona",
|
|
1904
|
-
"e2b"
|
|
1914
|
+
"e2b",
|
|
1915
|
+
"superserve"
|
|
1905
1916
|
]),
|
|
1906
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" }),
|
|
1907
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" }),
|
|
@@ -2593,6 +2604,25 @@ var zListCronTriggersResponse = z.object({
|
|
|
2593
2604
|
next_cursor: z.string().nullable()
|
|
2594
2605
|
});
|
|
2595
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
|
+
});
|
|
2596
2626
|
var zUpdateIntegrationRequest = z.object({
|
|
2597
2627
|
settings: zIntegrationSettings
|
|
2598
2628
|
});
|
|
@@ -2603,7 +2633,9 @@ var zIntegrationRuntimeFailure = z.object({
|
|
|
2603
2633
|
var zIntegrationName = z.string().regex(/^[a-zA-Z][a-zA-Z0-9-]{0,31}$/);
|
|
2604
2634
|
var zCompiledGitCredentials = z.object({
|
|
2605
2635
|
integration: zIntegrationName,
|
|
2606
|
-
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()
|
|
2607
2639
|
});
|
|
2608
2640
|
var zCompiledAgentConfig = z.object({
|
|
2609
2641
|
version: z.string().optional(),
|
|
@@ -4075,6 +4107,7 @@ var zListIntegrationsPath = z.object({
|
|
|
4075
4107
|
projectID: zProjectId
|
|
4076
4108
|
});
|
|
4077
4109
|
var zListIntegrationsQuery = z.object({
|
|
4110
|
+
name: z.string().min(1).max(200).optional(),
|
|
4078
4111
|
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
4079
4112
|
cursor: z.string().max(1024).optional()
|
|
4080
4113
|
});
|
|
@@ -4140,6 +4173,15 @@ var zDisconnectIntegrationPath = z.object({
|
|
|
4140
4173
|
integrationID: zIntegrationId
|
|
4141
4174
|
});
|
|
4142
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;
|
|
4143
4185
|
var zListIntegrationDefinitionsPath = z.object({
|
|
4144
4186
|
orgID: zOrganizationId,
|
|
4145
4187
|
projectID: zProjectId
|
|
@@ -4215,7 +4257,8 @@ var ApiError = class _ApiError extends Error {
|
|
|
4215
4257
|
body;
|
|
4216
4258
|
issues;
|
|
4217
4259
|
currentDigest;
|
|
4218
|
-
|
|
4260
|
+
retryAfterMs;
|
|
4261
|
+
constructor(status, message, code, body, retryAfterMs) {
|
|
4219
4262
|
super(message);
|
|
4220
4263
|
this.name = "ApiError";
|
|
4221
4264
|
this.status = status;
|
|
@@ -4224,17 +4267,30 @@ var ApiError = class _ApiError extends Error {
|
|
|
4224
4267
|
const parsed = zErrorResponse.safeParse(body);
|
|
4225
4268
|
this.issues = parsed.data?.issues ?? [];
|
|
4226
4269
|
this.currentDigest = parsed.data?.current_digest;
|
|
4270
|
+
this.retryAfterMs = retryAfterMs;
|
|
4227
4271
|
}
|
|
4228
4272
|
static async fromResponse(response) {
|
|
4229
4273
|
const body = zErrorBody.safeParse(await response.clone().text());
|
|
4230
|
-
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
|
+
);
|
|
4231
4279
|
}
|
|
4232
|
-
static fromBody(status, body) {
|
|
4280
|
+
static fromBody(status, body, retryAfterMs) {
|
|
4233
4281
|
const parsed = zErrorResponse.safeParse(body);
|
|
4234
4282
|
const message = parsed.data?.error_description ?? parsed.data?.error ?? `request failed with status ${status}`;
|
|
4235
|
-
return new _ApiError(status, message, parsed.data?.code, body);
|
|
4283
|
+
return new _ApiError(status, message, parsed.data?.code, body, retryAfterMs);
|
|
4236
4284
|
}
|
|
4237
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
|
+
}
|
|
4238
4294
|
|
|
4239
4295
|
// ../sdk/src/server-sent-events.ts
|
|
4240
4296
|
function createServerSentEventParser() {
|
|
@@ -4317,16 +4373,6 @@ function retryable(error) {
|
|
|
4317
4373
|
if (error.kind === "api") return error.code === "service_unavailable";
|
|
4318
4374
|
return error.kind === "http" && (error.status === 408 || error.status === 429 || error.status != null && error.status >= 500);
|
|
4319
4375
|
}
|
|
4320
|
-
function parseRetryAfter(value, now = Date.now()) {
|
|
4321
|
-
if (value == null) return void 0;
|
|
4322
|
-
const trimmed = value.trim();
|
|
4323
|
-
if (/^\d+$/.test(trimmed)) {
|
|
4324
|
-
return Math.min(Number.parseInt(trimmed, 10) * 1e3, retryAfterMaximumDelayMs);
|
|
4325
|
-
}
|
|
4326
|
-
const at = Date.parse(trimmed);
|
|
4327
|
-
if (Number.isNaN(at)) return void 0;
|
|
4328
|
-
return Math.min(Math.max(at - now, 0), retryAfterMaximumDelayMs);
|
|
4329
|
-
}
|
|
4330
4376
|
function reconnectDelay(attempt) {
|
|
4331
4377
|
const maximum = Math.min(retryBaseDelayMs * 2 ** Math.max(attempt - 1, 0), retryMaximumDelayMs);
|
|
4332
4378
|
return Math.floor(Math.random() * maximum);
|
|
@@ -4398,7 +4444,7 @@ async function* openConnection(client2, { path, query, headers }, callerSignal)
|
|
|
4398
4444
|
throw streamError("http", apiError.message, {
|
|
4399
4445
|
status: response.status,
|
|
4400
4446
|
code: apiError.code,
|
|
4401
|
-
retryAfterMs:
|
|
4447
|
+
retryAfterMs: apiError.retryAfterMs === void 0 ? void 0 : Math.min(apiError.retryAfterMs, retryAfterMaximumDelayMs),
|
|
4402
4448
|
cause: apiError
|
|
4403
4449
|
});
|
|
4404
4450
|
}
|
|
@@ -5656,6 +5702,7 @@ __export(sdk_gen_exports, {
|
|
|
5656
5702
|
listCronTriggers: () => listCronTriggers,
|
|
5657
5703
|
listEvents: () => listEvents,
|
|
5658
5704
|
listIntegrationDefinitions: () => listIntegrationDefinitions,
|
|
5705
|
+
listIntegrationGitHubRepositories: () => listIntegrationGitHubRepositories,
|
|
5659
5706
|
listIntegrationSubscriptions: () => listIntegrationSubscriptions,
|
|
5660
5707
|
listIntegrations: () => listIntegrations,
|
|
5661
5708
|
listMachinePools: () => listMachinePools,
|
|
@@ -8727,6 +8774,20 @@ var disconnectIntegration = (options) => (options.client ?? client).post({
|
|
|
8727
8774
|
url: "/orgs/{orgID}/projects/{projectID}/integrations/{integrationID}/disconnect",
|
|
8728
8775
|
...options
|
|
8729
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
|
+
});
|
|
8730
8791
|
var listIntegrationDefinitions = (options) => (options.client ?? client).get({
|
|
8731
8792
|
responseValidator: relaxedResponseValidator(zListIntegrationDefinitionsResponse2),
|
|
8732
8793
|
security: [{
|
|
@@ -8751,14 +8812,8 @@ import * as z8 from "zod";
|
|
|
8751
8812
|
var discordPublicKeyPattern = "[a-fA-F0-9]{64}";
|
|
8752
8813
|
var discordPublicKey = z8.string().regex(new RegExp(`^${discordPublicKeyPattern}$`));
|
|
8753
8814
|
var profilesSchema = z8.array(zAgentProfileId).max(16).refine((ids) => new Set(ids).size === ids.length, "Choose each profile only once.");
|
|
8754
|
-
var
|
|
8755
|
-
var
|
|
8756
|
-
var chatLauncherSchema = z8.object({ profiles: profilesSchema.min(1) }).strict();
|
|
8757
|
-
var githubLauncherSchema = z8.object({
|
|
8758
|
-
profile: zAgentProfileId,
|
|
8759
|
-
trigger: triggerSchema,
|
|
8760
|
-
repository_id: repositorySchema.optional()
|
|
8761
|
-
}).strict();
|
|
8815
|
+
var chatLauncherSchema = z8.strictObject(zChatIntegrationLauncher.shape);
|
|
8816
|
+
var githubLauncherSchema = z8.strictObject(zGitHubIntegrationLauncher.shape);
|
|
8762
8817
|
function profileIntegrationProfileUpdate(integration, profileIds) {
|
|
8763
8818
|
if (!["slack_thread", "discord_thread"].includes(integration.integration_kind))
|
|
8764
8819
|
throw new Error("Profile editing requires a Slack or Discord integration.");
|