@autohq/cli 0.1.128 → 0.1.130
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/agent-bridge.js +207 -203
- package/dist/index.js +531 -387
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16052,7 +16052,7 @@ var init_zod = __esm({
|
|
|
16052
16052
|
});
|
|
16053
16053
|
|
|
16054
16054
|
// ../../packages/schemas/src/ids.ts
|
|
16055
|
-
var OpaqueIdSchema, ProfileIdSchema, EnvironmentIdSchema, ConnectionIdSchema, ExternalAccountIdSchema, OrganizationIdSchema, ProjectIdSchema, ProviderGrantIdSchema, ServiceAccountIdSchema, SessionIdSchema, SessionRunIdSchema, SessionRunCommandIdSchema, RuntimeIdSchema, RuntimeBridgeLeaseIdSchema, EnvironmentSetupSnapshotIdSchema, ToolIdSchema, UserIdSchema;
|
|
16055
|
+
var OpaqueIdSchema, ProfileIdSchema, EnvironmentIdSchema, IdentityIdSchema, ConnectionIdSchema, ExternalAccountIdSchema, OrganizationIdSchema, ProjectIdSchema, ProviderGrantIdSchema, ServiceAccountIdSchema, SessionIdSchema, SessionRunIdSchema, SessionRunCommandIdSchema, RuntimeIdSchema, RuntimeBridgeLeaseIdSchema, EnvironmentSetupSnapshotIdSchema, ToolIdSchema, UserIdSchema;
|
|
16056
16056
|
var init_ids = __esm({
|
|
16057
16057
|
"../../packages/schemas/src/ids.ts"() {
|
|
16058
16058
|
"use strict";
|
|
@@ -16060,6 +16060,7 @@ var init_ids = __esm({
|
|
|
16060
16060
|
OpaqueIdSchema = external_exports.string().trim().min(1);
|
|
16061
16061
|
ProfileIdSchema = OpaqueIdSchema.brand();
|
|
16062
16062
|
EnvironmentIdSchema = OpaqueIdSchema.brand();
|
|
16063
|
+
IdentityIdSchema = OpaqueIdSchema.brand();
|
|
16063
16064
|
ConnectionIdSchema = OpaqueIdSchema.brand();
|
|
16064
16065
|
ExternalAccountIdSchema = OpaqueIdSchema.brand();
|
|
16065
16066
|
OrganizationIdSchema = OpaqueIdSchema.brand();
|
|
@@ -17431,193 +17432,6 @@ var init_github_mcp_catalog = __esm({
|
|
|
17431
17432
|
}
|
|
17432
17433
|
});
|
|
17433
17434
|
|
|
17434
|
-
// ../../packages/schemas/src/secrets.ts
|
|
17435
|
-
var SECRET_ENCRYPTION_ALGORITHM, SecretEnvNameSchema, SecretCiphertextFieldSchema, SecretAesGcmIvSchema, SecretAesGcmAuthTagSchema, SecretEnvValueSchema, SecretEnvSchema, EncryptedSecretValueSchema, SecretSetRequestSchema, SecretMetadataSchema, SecretSetResponseSchema, SecretListResponseSchema, SecretDeleteResponseSchema;
|
|
17436
|
-
var init_secrets = __esm({
|
|
17437
|
-
"../../packages/schemas/src/secrets.ts"() {
|
|
17438
|
-
"use strict";
|
|
17439
|
-
init_zod();
|
|
17440
|
-
init_resources();
|
|
17441
|
-
SECRET_ENCRYPTION_ALGORITHM = "AES-256-GCM";
|
|
17442
|
-
SecretEnvNameSchema = external_exports.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/);
|
|
17443
|
-
SecretCiphertextFieldSchema = external_exports.string().trim().min(1).regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/);
|
|
17444
|
-
SecretAesGcmIvSchema = external_exports.string().trim().regex(/^[A-Za-z0-9+/]{16}$/);
|
|
17445
|
-
SecretAesGcmAuthTagSchema = external_exports.string().trim().regex(/^[A-Za-z0-9+/]{22}==$/);
|
|
17446
|
-
SecretEnvValueSchema = external_exports.union([
|
|
17447
|
-
external_exports.string(),
|
|
17448
|
-
external_exports.object({
|
|
17449
|
-
$secret: ResourceNameSchema,
|
|
17450
|
-
optional: external_exports.boolean().optional()
|
|
17451
|
-
})
|
|
17452
|
-
]);
|
|
17453
|
-
SecretEnvSchema = external_exports.record(
|
|
17454
|
-
SecretEnvNameSchema,
|
|
17455
|
-
SecretEnvValueSchema
|
|
17456
|
-
);
|
|
17457
|
-
EncryptedSecretValueSchema = external_exports.object({
|
|
17458
|
-
keyVersion: external_exports.string().trim().min(1),
|
|
17459
|
-
algorithm: external_exports.literal(SECRET_ENCRYPTION_ALGORITHM),
|
|
17460
|
-
ciphertext: SecretCiphertextFieldSchema,
|
|
17461
|
-
valueIv: SecretAesGcmIvSchema,
|
|
17462
|
-
valueAuthTag: SecretAesGcmAuthTagSchema,
|
|
17463
|
-
encryptedDek: SecretCiphertextFieldSchema,
|
|
17464
|
-
dekIv: SecretAesGcmIvSchema,
|
|
17465
|
-
dekAuthTag: SecretAesGcmAuthTagSchema
|
|
17466
|
-
});
|
|
17467
|
-
SecretSetRequestSchema = external_exports.object({
|
|
17468
|
-
value: external_exports.string()
|
|
17469
|
-
});
|
|
17470
|
-
SecretMetadataSchema = external_exports.object({
|
|
17471
|
-
id: external_exports.string().trim().min(1),
|
|
17472
|
-
organizationId: external_exports.string().trim().min(1),
|
|
17473
|
-
projectId: external_exports.string().trim().min(1).nullable(),
|
|
17474
|
-
name: ResourceNameSchema,
|
|
17475
|
-
createdAt: external_exports.string().datetime(),
|
|
17476
|
-
updatedAt: external_exports.string().datetime()
|
|
17477
|
-
});
|
|
17478
|
-
SecretSetResponseSchema = external_exports.object({
|
|
17479
|
-
secret: SecretMetadataSchema
|
|
17480
|
-
});
|
|
17481
|
-
SecretListResponseSchema = external_exports.object({
|
|
17482
|
-
secrets: external_exports.array(SecretMetadataSchema)
|
|
17483
|
-
});
|
|
17484
|
-
SecretDeleteResponseSchema = external_exports.object({
|
|
17485
|
-
secret: SecretMetadataSchema
|
|
17486
|
-
});
|
|
17487
|
-
}
|
|
17488
|
-
});
|
|
17489
|
-
|
|
17490
|
-
// ../../packages/schemas/src/environments.ts
|
|
17491
|
-
function environmentSetupSchema(cachePathSchema) {
|
|
17492
|
-
return external_exports.object({
|
|
17493
|
-
name: ResourceNameSchema,
|
|
17494
|
-
commands: external_exports.array(external_exports.string().trim().min(1)).min(1),
|
|
17495
|
-
cache: external_exports.object({
|
|
17496
|
-
key: ResourceNameSchema.optional(),
|
|
17497
|
-
files: external_exports.array(
|
|
17498
|
-
external_exports.string().trim().refine(isSafeRelativePath, {
|
|
17499
|
-
message: "Expected a relative path without traversal"
|
|
17500
|
-
})
|
|
17501
|
-
).default([]),
|
|
17502
|
-
paths: external_exports.array(cachePathSchema).default([])
|
|
17503
|
-
}).strict().default({ files: [], paths: [] })
|
|
17504
|
-
}).strict();
|
|
17505
|
-
}
|
|
17506
|
-
function environmentSpecSchema(setupSchema) {
|
|
17507
|
-
return external_exports.object({
|
|
17508
|
-
image: EnvironmentImageSchema,
|
|
17509
|
-
env: SecretEnvSchema.default({}),
|
|
17510
|
-
resources: EnvironmentResourcesSchema.optional(),
|
|
17511
|
-
steps: external_exports.array(external_exports.string()).default([]),
|
|
17512
|
-
setup: external_exports.array(setupSchema).default([]),
|
|
17513
|
-
setupCache: EnvironmentSetupCacheSchema.optional()
|
|
17514
|
-
}).strict();
|
|
17515
|
-
}
|
|
17516
|
-
function isSafeSandboxUserHomePath(value, options = {}) {
|
|
17517
|
-
return (options.allowedHomes ?? [CURRENT_SANDBOX_USER_HOME]).some(
|
|
17518
|
-
(home) => isSafePathUnderHome(value, home)
|
|
17519
|
-
);
|
|
17520
|
-
}
|
|
17521
|
-
function isSafePathUnderHome(value, home) {
|
|
17522
|
-
const prefix = `${home}/`;
|
|
17523
|
-
if (!value.startsWith(prefix)) {
|
|
17524
|
-
return false;
|
|
17525
|
-
}
|
|
17526
|
-
const relative = value.slice(prefix.length);
|
|
17527
|
-
return relative.split("/").every((segment) => segment !== "" && segment !== "." && segment !== "..");
|
|
17528
|
-
}
|
|
17529
|
-
function isSafeRelativePath(value) {
|
|
17530
|
-
if (!value || value.startsWith("/")) {
|
|
17531
|
-
return false;
|
|
17532
|
-
}
|
|
17533
|
-
return value.split("/").every((segment) => segment !== "" && segment !== "." && segment !== "..");
|
|
17534
|
-
}
|
|
17535
|
-
function isSetupCacheTtl(value) {
|
|
17536
|
-
return /^[1-9][0-9]*(s|m|h|d)$/.test(value);
|
|
17537
|
-
}
|
|
17538
|
-
var RESOURCE_KIND_ENVIRONMENT, CURRENT_SANDBOX_USER_HOME, LEGACY_SANDBOX_USER_HOMES, STORED_SANDBOX_USER_HOMES, EnvironmentSetupCachePathSchema, StoredEnvironmentSetupCachePathSchema, EnvironmentImageSchema, EnvironmentSetupSchema, EnvironmentApplySetupSchema, EnvironmentSetupCacheSchema, EnvironmentResourcesSchema, EnvironmentSpecSchema, EnvironmentApplySpecSchema, EnvironmentResourceSchema, EnvironmentApplyRequestSchema;
|
|
17539
|
-
var init_environments = __esm({
|
|
17540
|
-
"../../packages/schemas/src/environments.ts"() {
|
|
17541
|
-
"use strict";
|
|
17542
|
-
init_zod();
|
|
17543
|
-
init_resources();
|
|
17544
|
-
init_secrets();
|
|
17545
|
-
RESOURCE_KIND_ENVIRONMENT = "environment";
|
|
17546
|
-
CURRENT_SANDBOX_USER_HOME = "/home/user";
|
|
17547
|
-
LEGACY_SANDBOX_USER_HOMES = ["/home/auto", "/home/node"];
|
|
17548
|
-
STORED_SANDBOX_USER_HOMES = [
|
|
17549
|
-
CURRENT_SANDBOX_USER_HOME,
|
|
17550
|
-
...LEGACY_SANDBOX_USER_HOMES
|
|
17551
|
-
];
|
|
17552
|
-
EnvironmentSetupCachePathSchema = external_exports.string().trim().refine((value) => isSafeSandboxUserHomePath(value), {
|
|
17553
|
-
message: `Expected an absolute path under ${CURRENT_SANDBOX_USER_HOME}`
|
|
17554
|
-
});
|
|
17555
|
-
StoredEnvironmentSetupCachePathSchema = external_exports.string().trim().refine(
|
|
17556
|
-
(value) => isSafeSandboxUserHomePath(value, {
|
|
17557
|
-
allowedHomes: STORED_SANDBOX_USER_HOMES
|
|
17558
|
-
}),
|
|
17559
|
-
{
|
|
17560
|
-
message: `Expected an absolute path under ${CURRENT_SANDBOX_USER_HOME}`
|
|
17561
|
-
}
|
|
17562
|
-
);
|
|
17563
|
-
EnvironmentImageSchema = external_exports.object({
|
|
17564
|
-
kind: external_exports.literal("preset"),
|
|
17565
|
-
name: ResourceNameSchema
|
|
17566
|
-
}).strict();
|
|
17567
|
-
EnvironmentSetupSchema = environmentSetupSchema(
|
|
17568
|
-
StoredEnvironmentSetupCachePathSchema
|
|
17569
|
-
);
|
|
17570
|
-
EnvironmentApplySetupSchema = environmentSetupSchema(
|
|
17571
|
-
EnvironmentSetupCachePathSchema
|
|
17572
|
-
);
|
|
17573
|
-
EnvironmentSetupCacheSchema = external_exports.object({
|
|
17574
|
-
ttl: external_exports.string().trim().refine(isSetupCacheTtl, {
|
|
17575
|
-
message: "Expected a positive setup cache TTL such as 30m, 24h, or 7d"
|
|
17576
|
-
})
|
|
17577
|
-
}).strict();
|
|
17578
|
-
EnvironmentResourcesSchema = external_exports.object({
|
|
17579
|
-
cpuCount: external_exports.number().int().min(1).optional(),
|
|
17580
|
-
memoryMB: external_exports.number().int().min(128).optional()
|
|
17581
|
-
}).strict().refine(
|
|
17582
|
-
(resources) => resources.cpuCount !== void 0 || resources.memoryMB !== void 0,
|
|
17583
|
-
{
|
|
17584
|
-
message: "Expected at least one runtime resource setting"
|
|
17585
|
-
}
|
|
17586
|
-
);
|
|
17587
|
-
EnvironmentSpecSchema = environmentSpecSchema(
|
|
17588
|
-
EnvironmentSetupSchema
|
|
17589
|
-
);
|
|
17590
|
-
EnvironmentApplySpecSchema = environmentSpecSchema(
|
|
17591
|
-
EnvironmentApplySetupSchema
|
|
17592
|
-
);
|
|
17593
|
-
EnvironmentResourceSchema = resourceEnvelopeSchema(
|
|
17594
|
-
EnvironmentSpecSchema
|
|
17595
|
-
);
|
|
17596
|
-
EnvironmentApplyRequestSchema = resourceApplySchema(
|
|
17597
|
-
EnvironmentApplySpecSchema
|
|
17598
|
-
);
|
|
17599
|
-
}
|
|
17600
|
-
});
|
|
17601
|
-
|
|
17602
|
-
// ../../packages/schemas/src/mcp.ts
|
|
17603
|
-
var McpToolCallMessageSchema, McpJsonRpcMessageSchema, McpPostBodySchema;
|
|
17604
|
-
var init_mcp = __esm({
|
|
17605
|
-
"../../packages/schemas/src/mcp.ts"() {
|
|
17606
|
-
"use strict";
|
|
17607
|
-
init_zod();
|
|
17608
|
-
McpToolCallMessageSchema = external_exports.object({
|
|
17609
|
-
method: external_exports.literal("tools/call"),
|
|
17610
|
-
params: external_exports.object({
|
|
17611
|
-
name: external_exports.string().trim().min(1)
|
|
17612
|
-
})
|
|
17613
|
-
});
|
|
17614
|
-
McpJsonRpcMessageSchema = external_exports.object({
|
|
17615
|
-
method: external_exports.string().optional()
|
|
17616
|
-
}).passthrough();
|
|
17617
|
-
McpPostBodySchema = external_exports.union([McpJsonRpcMessageSchema, external_exports.array(McpJsonRpcMessageSchema)]).transform((body) => Array.isArray(body) ? body : [body]);
|
|
17618
|
-
}
|
|
17619
|
-
});
|
|
17620
|
-
|
|
17621
17435
|
// ../../packages/schemas/src/mounts.ts
|
|
17622
17436
|
var AbsoluteMountPathSchema, GITHUB_MOUNT_CAPABILITY_LEVELS, GithubMountCapabilityLevelSchema, GITHUB_MOUNT_MERGE_CAPABILITY_LEVELS, GithubMountMergeCapabilityLevelSchema, DEFAULT_GITHUB_MOUNT_CAPABILITIES, GitMountAuthSchema, GitMountSchema, SessionMountSchema;
|
|
17623
17437
|
var init_mounts = __esm({
|
|
@@ -17696,43 +17510,58 @@ var init_mounts = __esm({
|
|
|
17696
17510
|
}
|
|
17697
17511
|
});
|
|
17698
17512
|
|
|
17699
|
-
// ../../packages/schemas/src/
|
|
17700
|
-
var
|
|
17701
|
-
var
|
|
17702
|
-
"../../packages/schemas/src/
|
|
17513
|
+
// ../../packages/schemas/src/secrets.ts
|
|
17514
|
+
var SECRET_ENCRYPTION_ALGORITHM, SecretEnvNameSchema, SecretCiphertextFieldSchema, SecretAesGcmIvSchema, SecretAesGcmAuthTagSchema, SecretEnvValueSchema, SecretEnvSchema, EncryptedSecretValueSchema, SecretSetRequestSchema, SecretMetadataSchema, SecretSetResponseSchema, SecretListResponseSchema, SecretDeleteResponseSchema;
|
|
17515
|
+
var init_secrets = __esm({
|
|
17516
|
+
"../../packages/schemas/src/secrets.ts"() {
|
|
17703
17517
|
"use strict";
|
|
17704
17518
|
init_zod();
|
|
17705
|
-
init_auth();
|
|
17706
|
-
init_ids();
|
|
17707
17519
|
init_resources();
|
|
17708
|
-
|
|
17709
|
-
|
|
17710
|
-
|
|
17711
|
-
|
|
17712
|
-
|
|
17713
|
-
|
|
17714
|
-
|
|
17715
|
-
|
|
17716
|
-
|
|
17717
|
-
|
|
17718
|
-
|
|
17520
|
+
SECRET_ENCRYPTION_ALGORITHM = "AES-256-GCM";
|
|
17521
|
+
SecretEnvNameSchema = external_exports.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/);
|
|
17522
|
+
SecretCiphertextFieldSchema = external_exports.string().trim().min(1).regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/);
|
|
17523
|
+
SecretAesGcmIvSchema = external_exports.string().trim().regex(/^[A-Za-z0-9+/]{16}$/);
|
|
17524
|
+
SecretAesGcmAuthTagSchema = external_exports.string().trim().regex(/^[A-Za-z0-9+/]{22}==$/);
|
|
17525
|
+
SecretEnvValueSchema = external_exports.union([
|
|
17526
|
+
external_exports.string(),
|
|
17527
|
+
external_exports.object({
|
|
17528
|
+
$secret: ResourceNameSchema,
|
|
17529
|
+
optional: external_exports.boolean().optional()
|
|
17530
|
+
})
|
|
17531
|
+
]);
|
|
17532
|
+
SecretEnvSchema = external_exports.record(
|
|
17533
|
+
SecretEnvNameSchema,
|
|
17534
|
+
SecretEnvValueSchema
|
|
17535
|
+
);
|
|
17536
|
+
EncryptedSecretValueSchema = external_exports.object({
|
|
17537
|
+
keyVersion: external_exports.string().trim().min(1),
|
|
17538
|
+
algorithm: external_exports.literal(SECRET_ENCRYPTION_ALGORITHM),
|
|
17539
|
+
ciphertext: SecretCiphertextFieldSchema,
|
|
17540
|
+
valueIv: SecretAesGcmIvSchema,
|
|
17541
|
+
valueAuthTag: SecretAesGcmAuthTagSchema,
|
|
17542
|
+
encryptedDek: SecretCiphertextFieldSchema,
|
|
17543
|
+
dekIv: SecretAesGcmIvSchema,
|
|
17544
|
+
dekAuthTag: SecretAesGcmAuthTagSchema
|
|
17719
17545
|
});
|
|
17720
|
-
|
|
17721
|
-
|
|
17546
|
+
SecretSetRequestSchema = external_exports.object({
|
|
17547
|
+
value: external_exports.string()
|
|
17722
17548
|
});
|
|
17723
|
-
|
|
17724
|
-
|
|
17725
|
-
|
|
17549
|
+
SecretMetadataSchema = external_exports.object({
|
|
17550
|
+
id: external_exports.string().trim().min(1),
|
|
17551
|
+
organizationId: external_exports.string().trim().min(1),
|
|
17552
|
+
projectId: external_exports.string().trim().min(1).nullable(),
|
|
17553
|
+
name: ResourceNameSchema,
|
|
17554
|
+
createdAt: external_exports.string().datetime(),
|
|
17555
|
+
updatedAt: external_exports.string().datetime()
|
|
17726
17556
|
});
|
|
17727
|
-
|
|
17728
|
-
|
|
17557
|
+
SecretSetResponseSchema = external_exports.object({
|
|
17558
|
+
secret: SecretMetadataSchema
|
|
17729
17559
|
});
|
|
17730
|
-
|
|
17731
|
-
|
|
17732
|
-
removed: external_exports.literal(true)
|
|
17560
|
+
SecretListResponseSchema = external_exports.object({
|
|
17561
|
+
secrets: external_exports.array(SecretMetadataSchema)
|
|
17733
17562
|
});
|
|
17734
|
-
|
|
17735
|
-
|
|
17563
|
+
SecretDeleteResponseSchema = external_exports.object({
|
|
17564
|
+
secret: SecretMetadataSchema
|
|
17736
17565
|
});
|
|
17737
17566
|
}
|
|
17738
17567
|
});
|
|
@@ -18436,13 +18265,13 @@ var init_sessions = __esm({
|
|
|
18436
18265
|
}
|
|
18437
18266
|
).optional()
|
|
18438
18267
|
}).strict().refine((identity2) => Object.keys(identity2).length > 0, {
|
|
18439
|
-
message: "
|
|
18268
|
+
message: "Identity requires at least one field"
|
|
18440
18269
|
});
|
|
18441
18270
|
SessionSpecFieldsSchema = external_exports.object({
|
|
18442
18271
|
harness: external_exports.enum(SESSION_HARNESSES).optional(),
|
|
18443
18272
|
systemPrompt: external_exports.string().trim().min(1).max(1e5).optional(),
|
|
18444
18273
|
environment: ResourceNameSchema.optional(),
|
|
18445
|
-
identity: SessionIdentitySchema.optional(),
|
|
18274
|
+
identity: external_exports.union([ResourceNameSchema, SessionIdentitySchema]).optional(),
|
|
18446
18275
|
initialPrompt: external_exports.string().trim().min(1).max(2e4).optional(),
|
|
18447
18276
|
env: SecretEnvSchema.default({}),
|
|
18448
18277
|
mounts: external_exports.array(SessionMountSchema).default([]),
|
|
@@ -18467,124 +18296,311 @@ var init_sessions = __esm({
|
|
|
18467
18296
|
SessionApplyRequestSchema = resourceApplySchema(
|
|
18468
18297
|
SessionApplySpecSchema
|
|
18469
18298
|
);
|
|
18470
|
-
SessionApplyTriggerReceiptSchema = external_exports.object({
|
|
18471
|
-
event: external_exports.string().trim().min(1),
|
|
18472
|
-
endpoint: external_exports.string().trim().min(1),
|
|
18473
|
-
ingestUrl: external_exports.string().trim().min(1),
|
|
18474
|
-
status: external_exports.literal("ready")
|
|
18475
|
-
});
|
|
18476
|
-
SessionApplyResponseSchema = external_exports.union([
|
|
18477
|
-
SessionResourceSchema,
|
|
18478
|
-
external_exports.object({
|
|
18479
|
-
resource: SessionResourceSchema,
|
|
18480
|
-
triggers: external_exports.array(SessionApplyTriggerReceiptSchema)
|
|
18299
|
+
SessionApplyTriggerReceiptSchema = external_exports.object({
|
|
18300
|
+
event: external_exports.string().trim().min(1),
|
|
18301
|
+
endpoint: external_exports.string().trim().min(1),
|
|
18302
|
+
ingestUrl: external_exports.string().trim().min(1),
|
|
18303
|
+
status: external_exports.literal("ready")
|
|
18304
|
+
});
|
|
18305
|
+
SessionApplyResponseSchema = external_exports.union([
|
|
18306
|
+
SessionResourceSchema,
|
|
18307
|
+
external_exports.object({
|
|
18308
|
+
resource: SessionResourceSchema,
|
|
18309
|
+
triggers: external_exports.array(SessionApplyTriggerReceiptSchema)
|
|
18310
|
+
})
|
|
18311
|
+
]);
|
|
18312
|
+
SESSION_TELEGRAM_IDENTITY_STATUSES = [
|
|
18313
|
+
"pending",
|
|
18314
|
+
"realized",
|
|
18315
|
+
"broken",
|
|
18316
|
+
"retired"
|
|
18317
|
+
];
|
|
18318
|
+
SessionTelegramIdentityStatusSchema = external_exports.enum(
|
|
18319
|
+
SESSION_TELEGRAM_IDENTITY_STATUSES
|
|
18320
|
+
);
|
|
18321
|
+
SessionPresenceIdentitySchema = external_exports.object({
|
|
18322
|
+
identityId: external_exports.string().trim().min(1),
|
|
18323
|
+
provider: external_exports.string().trim().min(1),
|
|
18324
|
+
connection: external_exports.string().trim().min(1),
|
|
18325
|
+
workspace: external_exports.string().trim().min(1),
|
|
18326
|
+
realized: external_exports.boolean(),
|
|
18327
|
+
appId: external_exports.string().trim().min(1).optional(),
|
|
18328
|
+
botUserId: external_exports.string().trim().min(1).optional(),
|
|
18329
|
+
teamId: external_exports.string().trim().min(1).optional(),
|
|
18330
|
+
// Telegram-realized identities: the persona bot's @username and lifecycle
|
|
18331
|
+
// state (creation is human-confirmed in Telegram, so identities can sit
|
|
18332
|
+
// `pending` between the connect step and the managed_bot webhook).
|
|
18333
|
+
botUsername: external_exports.string().trim().min(1).optional(),
|
|
18334
|
+
telegramStatus: SessionTelegramIdentityStatusSchema.optional(),
|
|
18335
|
+
/**
|
|
18336
|
+
* Telegram privacy-mode state verified during connect: true means privacy
|
|
18337
|
+
* mode is disabled and the persona sees all group messages. Not writable
|
|
18338
|
+
* via the Bot API — flipping it is a BotFather step (/setprivacy), or add
|
|
18339
|
+
* the persona as a group admin.
|
|
18340
|
+
*/
|
|
18341
|
+
canReadAllGroupMessages: external_exports.boolean().optional(),
|
|
18342
|
+
// Avatar drift surface: the session's desired avatar hash + public URL, and
|
|
18343
|
+
// the hash last confirmed applied to the provider app icon. Providers offer
|
|
18344
|
+
// no API for app icons, so application is a guided manual step recorded via
|
|
18345
|
+
// the presence icon endpoint.
|
|
18346
|
+
avatarSha256: external_exports.string().regex(SHA256_HEX_PATTERN).optional(),
|
|
18347
|
+
avatarUrl: external_exports.string().trim().min(1).optional(),
|
|
18348
|
+
appliedIconSha256: external_exports.string().regex(SHA256_HEX_PATTERN).optional(),
|
|
18349
|
+
/**
|
|
18350
|
+
* Scopes the current agent-app scope set requests that this realized
|
|
18351
|
+
* identity's install never granted. Computed at read time; non-empty means
|
|
18352
|
+
* the install predates a scope addition and `auto sessions connect
|
|
18353
|
+
* <session> --reconnect` refreshes it.
|
|
18354
|
+
*/
|
|
18355
|
+
missingScopes: external_exports.array(external_exports.string().trim().min(1)).optional()
|
|
18356
|
+
});
|
|
18357
|
+
SessionPresenceResponseSchema = external_exports.object({
|
|
18358
|
+
session: ResourceNameSchema,
|
|
18359
|
+
identities: external_exports.array(SessionPresenceIdentitySchema)
|
|
18360
|
+
});
|
|
18361
|
+
SessionPresenceConnectRequestSchema = external_exports.object({
|
|
18362
|
+
/**
|
|
18363
|
+
* Re-run the install OAuth for already-realized identities too. The repair
|
|
18364
|
+
* path for a stranded bot token (e.g. the single-use refresh token was
|
|
18365
|
+
* consumed but the rotated pair failed to persist): the stored app
|
|
18366
|
+
* credentials are reused, so this never creates a new Slack app.
|
|
18367
|
+
*/
|
|
18368
|
+
reconnect: external_exports.boolean().default(false)
|
|
18369
|
+
});
|
|
18370
|
+
SessionPresenceConnectPendingSchema = external_exports.object({
|
|
18371
|
+
identityId: external_exports.string().trim().min(1),
|
|
18372
|
+
connection: external_exports.string().trim().min(1),
|
|
18373
|
+
workspace: external_exports.string().trim().min(1),
|
|
18374
|
+
/**
|
|
18375
|
+
* The URL the operator opens to realize this identity: the Slack install
|
|
18376
|
+
* authorize URL, or the Telegram managed-bot creation deep link.
|
|
18377
|
+
*/
|
|
18378
|
+
authorizationUrl: external_exports.string().trim().url(),
|
|
18379
|
+
/**
|
|
18380
|
+
* Telegram only: the pre-filled bot username in the creation dialog. The
|
|
18381
|
+
* user can edit it there, so it is a suggestion, not the final identity.
|
|
18382
|
+
*/
|
|
18383
|
+
suggestedUsername: external_exports.string().trim().min(1).optional()
|
|
18384
|
+
});
|
|
18385
|
+
SessionPresenceConnectResponseSchema = external_exports.object({
|
|
18386
|
+
session: ResourceNameSchema,
|
|
18387
|
+
pending: external_exports.array(SessionPresenceConnectPendingSchema),
|
|
18388
|
+
realized: external_exports.array(SessionPresenceIdentitySchema),
|
|
18389
|
+
message: external_exports.string().trim().min(1)
|
|
18390
|
+
});
|
|
18391
|
+
SessionPresenceIconRequestSchema = external_exports.object({
|
|
18392
|
+
sha256: external_exports.string().regex(SHA256_HEX_PATTERN)
|
|
18393
|
+
});
|
|
18394
|
+
SessionPresenceIconResponseSchema = external_exports.object({
|
|
18395
|
+
session: ResourceNameSchema,
|
|
18396
|
+
identityId: external_exports.string().trim().min(1),
|
|
18397
|
+
appliedIconSha256: external_exports.string().regex(SHA256_HEX_PATTERN)
|
|
18398
|
+
});
|
|
18399
|
+
SessionPresenceCompleteResponseSchema = external_exports.object({
|
|
18400
|
+
status: external_exports.literal("connected"),
|
|
18401
|
+
session: ResourceNameSchema,
|
|
18402
|
+
connection: external_exports.string().trim().min(1),
|
|
18403
|
+
workspace: external_exports.string().trim().min(1),
|
|
18404
|
+
organizationId: external_exports.string().trim().min(1),
|
|
18405
|
+
botUserId: external_exports.string().trim().min(1)
|
|
18406
|
+
});
|
|
18407
|
+
}
|
|
18408
|
+
});
|
|
18409
|
+
|
|
18410
|
+
// ../../packages/schemas/src/identities.ts
|
|
18411
|
+
var RESOURCE_KIND_IDENTITY, IdentitySpecSchema, IdentityResourceSchema, IdentityApplyRequestSchema;
|
|
18412
|
+
var init_identities = __esm({
|
|
18413
|
+
"../../packages/schemas/src/identities.ts"() {
|
|
18414
|
+
"use strict";
|
|
18415
|
+
init_resources();
|
|
18416
|
+
init_sessions();
|
|
18417
|
+
RESOURCE_KIND_IDENTITY = "identity";
|
|
18418
|
+
IdentitySpecSchema = SessionIdentitySchema;
|
|
18419
|
+
IdentityResourceSchema = resourceEnvelopeSchema(IdentitySpecSchema);
|
|
18420
|
+
IdentityApplyRequestSchema = resourceApplySchema(IdentitySpecSchema);
|
|
18421
|
+
}
|
|
18422
|
+
});
|
|
18423
|
+
|
|
18424
|
+
// ../../packages/schemas/src/environments.ts
|
|
18425
|
+
function environmentSetupSchema(cachePathSchema) {
|
|
18426
|
+
return external_exports.object({
|
|
18427
|
+
name: ResourceNameSchema,
|
|
18428
|
+
commands: external_exports.array(external_exports.string().trim().min(1)).min(1),
|
|
18429
|
+
cache: external_exports.object({
|
|
18430
|
+
key: ResourceNameSchema.optional(),
|
|
18431
|
+
files: external_exports.array(
|
|
18432
|
+
external_exports.string().trim().refine(isSafeRelativePath, {
|
|
18433
|
+
message: "Expected a relative path without traversal"
|
|
18434
|
+
})
|
|
18435
|
+
).default([]),
|
|
18436
|
+
paths: external_exports.array(cachePathSchema).default([])
|
|
18437
|
+
}).strict().default({ files: [], paths: [] })
|
|
18438
|
+
}).strict();
|
|
18439
|
+
}
|
|
18440
|
+
function environmentSpecSchema(setupSchema) {
|
|
18441
|
+
return external_exports.object({
|
|
18442
|
+
image: EnvironmentImageSchema,
|
|
18443
|
+
env: SecretEnvSchema.default({}),
|
|
18444
|
+
resources: EnvironmentResourcesSchema.optional(),
|
|
18445
|
+
steps: external_exports.array(external_exports.string()).default([]),
|
|
18446
|
+
setup: external_exports.array(setupSchema).default([]),
|
|
18447
|
+
setupCache: EnvironmentSetupCacheSchema.optional()
|
|
18448
|
+
}).strict();
|
|
18449
|
+
}
|
|
18450
|
+
function isSafeSandboxUserHomePath(value, options = {}) {
|
|
18451
|
+
return (options.allowedHomes ?? [CURRENT_SANDBOX_USER_HOME]).some(
|
|
18452
|
+
(home) => isSafePathUnderHome(value, home)
|
|
18453
|
+
);
|
|
18454
|
+
}
|
|
18455
|
+
function isSafePathUnderHome(value, home) {
|
|
18456
|
+
const prefix = `${home}/`;
|
|
18457
|
+
if (!value.startsWith(prefix)) {
|
|
18458
|
+
return false;
|
|
18459
|
+
}
|
|
18460
|
+
const relative = value.slice(prefix.length);
|
|
18461
|
+
return relative.split("/").every((segment) => segment !== "" && segment !== "." && segment !== "..");
|
|
18462
|
+
}
|
|
18463
|
+
function isSafeRelativePath(value) {
|
|
18464
|
+
if (!value || value.startsWith("/")) {
|
|
18465
|
+
return false;
|
|
18466
|
+
}
|
|
18467
|
+
return value.split("/").every((segment) => segment !== "" && segment !== "." && segment !== "..");
|
|
18468
|
+
}
|
|
18469
|
+
function isSetupCacheTtl(value) {
|
|
18470
|
+
return /^[1-9][0-9]*(s|m|h|d)$/.test(value);
|
|
18471
|
+
}
|
|
18472
|
+
var RESOURCE_KIND_ENVIRONMENT, CURRENT_SANDBOX_USER_HOME, LEGACY_SANDBOX_USER_HOMES, STORED_SANDBOX_USER_HOMES, EnvironmentSetupCachePathSchema, StoredEnvironmentSetupCachePathSchema, EnvironmentImageSchema, EnvironmentSetupSchema, EnvironmentApplySetupSchema, EnvironmentSetupCacheSchema, EnvironmentResourcesSchema, EnvironmentSpecSchema, EnvironmentApplySpecSchema, EnvironmentResourceSchema, EnvironmentApplyRequestSchema;
|
|
18473
|
+
var init_environments = __esm({
|
|
18474
|
+
"../../packages/schemas/src/environments.ts"() {
|
|
18475
|
+
"use strict";
|
|
18476
|
+
init_zod();
|
|
18477
|
+
init_resources();
|
|
18478
|
+
init_secrets();
|
|
18479
|
+
RESOURCE_KIND_ENVIRONMENT = "environment";
|
|
18480
|
+
CURRENT_SANDBOX_USER_HOME = "/home/user";
|
|
18481
|
+
LEGACY_SANDBOX_USER_HOMES = ["/home/auto", "/home/node"];
|
|
18482
|
+
STORED_SANDBOX_USER_HOMES = [
|
|
18483
|
+
CURRENT_SANDBOX_USER_HOME,
|
|
18484
|
+
...LEGACY_SANDBOX_USER_HOMES
|
|
18485
|
+
];
|
|
18486
|
+
EnvironmentSetupCachePathSchema = external_exports.string().trim().refine((value) => isSafeSandboxUserHomePath(value), {
|
|
18487
|
+
message: `Expected an absolute path under ${CURRENT_SANDBOX_USER_HOME}`
|
|
18488
|
+
});
|
|
18489
|
+
StoredEnvironmentSetupCachePathSchema = external_exports.string().trim().refine(
|
|
18490
|
+
(value) => isSafeSandboxUserHomePath(value, {
|
|
18491
|
+
allowedHomes: STORED_SANDBOX_USER_HOMES
|
|
18492
|
+
}),
|
|
18493
|
+
{
|
|
18494
|
+
message: `Expected an absolute path under ${CURRENT_SANDBOX_USER_HOME}`
|
|
18495
|
+
}
|
|
18496
|
+
);
|
|
18497
|
+
EnvironmentImageSchema = external_exports.object({
|
|
18498
|
+
kind: external_exports.literal("preset"),
|
|
18499
|
+
name: ResourceNameSchema
|
|
18500
|
+
}).strict();
|
|
18501
|
+
EnvironmentSetupSchema = environmentSetupSchema(
|
|
18502
|
+
StoredEnvironmentSetupCachePathSchema
|
|
18503
|
+
);
|
|
18504
|
+
EnvironmentApplySetupSchema = environmentSetupSchema(
|
|
18505
|
+
EnvironmentSetupCachePathSchema
|
|
18506
|
+
);
|
|
18507
|
+
EnvironmentSetupCacheSchema = external_exports.object({
|
|
18508
|
+
ttl: external_exports.string().trim().refine(isSetupCacheTtl, {
|
|
18509
|
+
message: "Expected a positive setup cache TTL such as 30m, 24h, or 7d"
|
|
18481
18510
|
})
|
|
18482
|
-
|
|
18483
|
-
|
|
18484
|
-
|
|
18485
|
-
|
|
18486
|
-
|
|
18487
|
-
|
|
18488
|
-
|
|
18489
|
-
|
|
18490
|
-
|
|
18511
|
+
}).strict();
|
|
18512
|
+
EnvironmentResourcesSchema = external_exports.object({
|
|
18513
|
+
cpuCount: external_exports.number().int().min(1).optional(),
|
|
18514
|
+
memoryMB: external_exports.number().int().min(128).optional()
|
|
18515
|
+
}).strict().refine(
|
|
18516
|
+
(resources) => resources.cpuCount !== void 0 || resources.memoryMB !== void 0,
|
|
18517
|
+
{
|
|
18518
|
+
message: "Expected at least one runtime resource setting"
|
|
18519
|
+
}
|
|
18491
18520
|
);
|
|
18492
|
-
|
|
18493
|
-
|
|
18494
|
-
|
|
18495
|
-
|
|
18496
|
-
|
|
18497
|
-
|
|
18498
|
-
|
|
18499
|
-
|
|
18500
|
-
|
|
18501
|
-
|
|
18502
|
-
|
|
18503
|
-
|
|
18504
|
-
|
|
18505
|
-
|
|
18506
|
-
|
|
18507
|
-
|
|
18508
|
-
|
|
18509
|
-
|
|
18510
|
-
|
|
18511
|
-
|
|
18512
|
-
|
|
18513
|
-
|
|
18514
|
-
|
|
18515
|
-
|
|
18516
|
-
|
|
18517
|
-
|
|
18518
|
-
avatarUrl: external_exports.string().trim().min(1).optional(),
|
|
18519
|
-
appliedIconSha256: external_exports.string().regex(SHA256_HEX_PATTERN).optional(),
|
|
18520
|
-
/**
|
|
18521
|
-
* Scopes the current agent-app scope set requests that this realized
|
|
18522
|
-
* identity's install never granted. Computed at read time; non-empty means
|
|
18523
|
-
* the install predates a scope addition and `auto sessions connect
|
|
18524
|
-
* <session> --reconnect` refreshes it.
|
|
18525
|
-
*/
|
|
18526
|
-
missingScopes: external_exports.array(external_exports.string().trim().min(1)).optional()
|
|
18521
|
+
EnvironmentSpecSchema = environmentSpecSchema(
|
|
18522
|
+
EnvironmentSetupSchema
|
|
18523
|
+
);
|
|
18524
|
+
EnvironmentApplySpecSchema = environmentSpecSchema(
|
|
18525
|
+
EnvironmentApplySetupSchema
|
|
18526
|
+
);
|
|
18527
|
+
EnvironmentResourceSchema = resourceEnvelopeSchema(
|
|
18528
|
+
EnvironmentSpecSchema
|
|
18529
|
+
);
|
|
18530
|
+
EnvironmentApplyRequestSchema = resourceApplySchema(
|
|
18531
|
+
EnvironmentApplySpecSchema
|
|
18532
|
+
);
|
|
18533
|
+
}
|
|
18534
|
+
});
|
|
18535
|
+
|
|
18536
|
+
// ../../packages/schemas/src/mcp.ts
|
|
18537
|
+
var McpToolCallMessageSchema, McpJsonRpcMessageSchema, McpPostBodySchema;
|
|
18538
|
+
var init_mcp = __esm({
|
|
18539
|
+
"../../packages/schemas/src/mcp.ts"() {
|
|
18540
|
+
"use strict";
|
|
18541
|
+
init_zod();
|
|
18542
|
+
McpToolCallMessageSchema = external_exports.object({
|
|
18543
|
+
method: external_exports.literal("tools/call"),
|
|
18544
|
+
params: external_exports.object({
|
|
18545
|
+
name: external_exports.string().trim().min(1)
|
|
18546
|
+
})
|
|
18527
18547
|
});
|
|
18528
|
-
|
|
18529
|
-
|
|
18530
|
-
|
|
18548
|
+
McpJsonRpcMessageSchema = external_exports.object({
|
|
18549
|
+
method: external_exports.string().optional()
|
|
18550
|
+
}).passthrough();
|
|
18551
|
+
McpPostBodySchema = external_exports.union([McpJsonRpcMessageSchema, external_exports.array(McpJsonRpcMessageSchema)]).transform((body) => Array.isArray(body) ? body : [body]);
|
|
18552
|
+
}
|
|
18553
|
+
});
|
|
18554
|
+
|
|
18555
|
+
// ../../packages/schemas/src/project-service-accounts.ts
|
|
18556
|
+
var ProjectServiceAccountSchema, ProjectServiceAccountCreateRequestSchema, ProjectServiceAccountUpdateRequestSchema, ProjectServiceAccountTokenResponseSchema, ProjectServiceAccountUpdateResponseSchema, ProjectServiceAccountRemoveResponseSchema, ProjectServiceAccountListResponseSchema;
|
|
18557
|
+
var init_project_service_accounts = __esm({
|
|
18558
|
+
"../../packages/schemas/src/project-service-accounts.ts"() {
|
|
18559
|
+
"use strict";
|
|
18560
|
+
init_zod();
|
|
18561
|
+
init_auth();
|
|
18562
|
+
init_ids();
|
|
18563
|
+
init_resources();
|
|
18564
|
+
ProjectServiceAccountSchema = external_exports.object({
|
|
18565
|
+
id: ServiceAccountIdSchema,
|
|
18566
|
+
organizationId: OrganizationIdSchema,
|
|
18567
|
+
projectId: ProjectIdSchema,
|
|
18568
|
+
name: ResourceNameSchema,
|
|
18569
|
+
scopes: external_exports.array(AuthScopeSchema),
|
|
18570
|
+
createdAt: external_exports.string().datetime()
|
|
18531
18571
|
});
|
|
18532
|
-
|
|
18533
|
-
|
|
18534
|
-
|
|
18535
|
-
* path for a stranded bot token (e.g. the single-use refresh token was
|
|
18536
|
-
* consumed but the rotated pair failed to persist): the stored app
|
|
18537
|
-
* credentials are reused, so this never creates a new Slack app.
|
|
18538
|
-
*/
|
|
18539
|
-
reconnect: external_exports.boolean().default(false)
|
|
18572
|
+
ProjectServiceAccountCreateRequestSchema = external_exports.object({
|
|
18573
|
+
name: ResourceNameSchema,
|
|
18574
|
+
scopes: external_exports.array(AuthScopeSchema).min(1)
|
|
18540
18575
|
});
|
|
18541
|
-
|
|
18542
|
-
|
|
18543
|
-
connection: external_exports.string().trim().min(1),
|
|
18544
|
-
workspace: external_exports.string().trim().min(1),
|
|
18545
|
-
/**
|
|
18546
|
-
* The URL the operator opens to realize this identity: the Slack install
|
|
18547
|
-
* authorize URL, or the Telegram managed-bot creation deep link.
|
|
18548
|
-
*/
|
|
18549
|
-
authorizationUrl: external_exports.string().trim().url(),
|
|
18550
|
-
/**
|
|
18551
|
-
* Telegram only: the pre-filled bot username in the creation dialog. The
|
|
18552
|
-
* user can edit it there, so it is a suggestion, not the final identity.
|
|
18553
|
-
*/
|
|
18554
|
-
suggestedUsername: external_exports.string().trim().min(1).optional()
|
|
18576
|
+
ProjectServiceAccountUpdateRequestSchema = external_exports.object({
|
|
18577
|
+
scopes: external_exports.array(AuthScopeSchema).min(1)
|
|
18555
18578
|
});
|
|
18556
|
-
|
|
18557
|
-
|
|
18558
|
-
|
|
18559
|
-
realized: external_exports.array(SessionPresenceIdentitySchema),
|
|
18560
|
-
message: external_exports.string().trim().min(1)
|
|
18579
|
+
ProjectServiceAccountTokenResponseSchema = external_exports.object({
|
|
18580
|
+
serviceAccount: ProjectServiceAccountSchema,
|
|
18581
|
+
token: external_exports.string().min(1)
|
|
18561
18582
|
});
|
|
18562
|
-
|
|
18563
|
-
|
|
18583
|
+
ProjectServiceAccountUpdateResponseSchema = external_exports.object({
|
|
18584
|
+
serviceAccount: ProjectServiceAccountSchema
|
|
18564
18585
|
});
|
|
18565
|
-
|
|
18566
|
-
|
|
18567
|
-
|
|
18568
|
-
appliedIconSha256: external_exports.string().regex(SHA256_HEX_PATTERN)
|
|
18586
|
+
ProjectServiceAccountRemoveResponseSchema = external_exports.object({
|
|
18587
|
+
serviceAccount: ProjectServiceAccountSchema,
|
|
18588
|
+
removed: external_exports.literal(true)
|
|
18569
18589
|
});
|
|
18570
|
-
|
|
18571
|
-
|
|
18572
|
-
session: ResourceNameSchema,
|
|
18573
|
-
connection: external_exports.string().trim().min(1),
|
|
18574
|
-
workspace: external_exports.string().trim().min(1),
|
|
18575
|
-
organizationId: external_exports.string().trim().min(1),
|
|
18576
|
-
botUserId: external_exports.string().trim().min(1)
|
|
18590
|
+
ProjectServiceAccountListResponseSchema = external_exports.object({
|
|
18591
|
+
serviceAccounts: external_exports.array(ProjectServiceAccountSchema)
|
|
18577
18592
|
});
|
|
18578
18593
|
}
|
|
18579
18594
|
});
|
|
18580
18595
|
|
|
18581
18596
|
// ../../packages/schemas/src/project-resources.ts
|
|
18582
|
-
var EnvironmentApplyDocumentSchema, ToolApplyDocumentSchema, SessionApplyDocumentSchema, ProjectApplyResourceSchema, PROJECT_RESOURCE_APPLY_ORDER, PROJECT_RESOURCE_KINDS, ProjectDeleteResourceSchema, AVATAR_ASSET_CONTENT_TYPES, MAX_AVATAR_ASSET_BASE64_LENGTH, ProjectApplyAssetSchema, ProjectApplyAssetsSchema, AvatarAssetUploadRequestSchema, AvatarAssetUploadResponseSchema, ProjectApplyRequestSchema, ProjectApplySystemConfigSchema, ProjectAppliedResourceSchema, ProjectApplyDiagnosticSchema, ProjectApplyResponseSchema;
|
|
18597
|
+
var EnvironmentApplyDocumentSchema, IdentityApplyDocumentSchema, ToolApplyDocumentSchema, SessionApplyDocumentSchema, ProjectApplyResourceSchema, PROJECT_RESOURCE_APPLY_ORDER, PROJECT_RESOURCE_KINDS, ProjectDeleteResourceSchema, AVATAR_ASSET_CONTENT_TYPES, MAX_AVATAR_ASSET_BASE64_LENGTH, ProjectApplyAssetSchema, ProjectApplyAssetsSchema, AvatarAssetUploadRequestSchema, AvatarAssetUploadResponseSchema, ProjectApplyRequestSchema, ProjectApplySystemConfigSchema, ProjectAppliedResourceSchema, ProjectApplyDiagnosticSchema, ProjectApplyResponseSchema;
|
|
18583
18598
|
var init_project_resources = __esm({
|
|
18584
18599
|
"../../packages/schemas/src/project-resources.ts"() {
|
|
18585
18600
|
"use strict";
|
|
18586
18601
|
init_zod();
|
|
18587
18602
|
init_environments();
|
|
18603
|
+
init_identities();
|
|
18588
18604
|
init_resources();
|
|
18589
18605
|
init_sessions();
|
|
18590
18606
|
init_tools();
|
|
@@ -18592,6 +18608,10 @@ var init_project_resources = __esm({
|
|
|
18592
18608
|
RESOURCE_KIND_ENVIRONMENT,
|
|
18593
18609
|
EnvironmentApplyRequestSchema.shape.spec
|
|
18594
18610
|
);
|
|
18611
|
+
IdentityApplyDocumentSchema = resourceApplyDocumentSchema(
|
|
18612
|
+
RESOURCE_KIND_IDENTITY,
|
|
18613
|
+
IdentityApplyRequestSchema.shape.spec
|
|
18614
|
+
);
|
|
18595
18615
|
ToolApplyDocumentSchema = resourceApplyDocumentSchema(
|
|
18596
18616
|
RESOURCE_KIND_TOOL,
|
|
18597
18617
|
ToolApplyRequestSchema.shape.spec
|
|
@@ -18602,11 +18622,13 @@ var init_project_resources = __esm({
|
|
|
18602
18622
|
);
|
|
18603
18623
|
ProjectApplyResourceSchema = external_exports.discriminatedUnion("kind", [
|
|
18604
18624
|
EnvironmentApplyDocumentSchema,
|
|
18625
|
+
IdentityApplyDocumentSchema,
|
|
18605
18626
|
ToolApplyDocumentSchema,
|
|
18606
18627
|
SessionApplyDocumentSchema
|
|
18607
18628
|
]);
|
|
18608
18629
|
PROJECT_RESOURCE_APPLY_ORDER = [
|
|
18609
18630
|
RESOURCE_KIND_ENVIRONMENT,
|
|
18631
|
+
RESOURCE_KIND_IDENTITY,
|
|
18610
18632
|
RESOURCE_KIND_TOOL,
|
|
18611
18633
|
RESOURCE_KIND_SESSION
|
|
18612
18634
|
];
|
|
@@ -18652,6 +18674,7 @@ var init_project_resources = __esm({
|
|
|
18652
18674
|
});
|
|
18653
18675
|
ProjectAppliedResourceSchema = external_exports.union([
|
|
18654
18676
|
EnvironmentResourceSchema,
|
|
18677
|
+
IdentityResourceSchema,
|
|
18655
18678
|
ToolResourceSchema,
|
|
18656
18679
|
SessionResourceSchema
|
|
18657
18680
|
]);
|
|
@@ -18663,6 +18686,7 @@ var init_project_resources = __esm({
|
|
|
18663
18686
|
action: external_exports.enum(["create", "update", "unchanged"]),
|
|
18664
18687
|
kind: external_exports.enum([
|
|
18665
18688
|
RESOURCE_KIND_ENVIRONMENT,
|
|
18689
|
+
RESOURCE_KIND_IDENTITY,
|
|
18666
18690
|
RESOURCE_KIND_TOOL,
|
|
18667
18691
|
RESOURCE_KIND_SESSION
|
|
18668
18692
|
]),
|
|
@@ -18678,6 +18702,7 @@ var init_project_resources = __esm({
|
|
|
18678
18702
|
action: external_exports.enum(["create", "update", "unchanged", "archive"]),
|
|
18679
18703
|
kind: external_exports.enum([
|
|
18680
18704
|
RESOURCE_KIND_ENVIRONMENT,
|
|
18705
|
+
RESOURCE_KIND_IDENTITY,
|
|
18681
18706
|
RESOURCE_KIND_TOOL,
|
|
18682
18707
|
RESOURCE_KIND_SESSION
|
|
18683
18708
|
]),
|
|
@@ -18689,6 +18714,7 @@ var init_project_resources = __esm({
|
|
|
18689
18714
|
external_exports.object({
|
|
18690
18715
|
kind: external_exports.enum([
|
|
18691
18716
|
RESOURCE_KIND_ENVIRONMENT,
|
|
18717
|
+
RESOURCE_KIND_IDENTITY,
|
|
18692
18718
|
RESOURCE_KIND_TOOL,
|
|
18693
18719
|
RESOURCE_KIND_SESSION
|
|
18694
18720
|
]),
|
|
@@ -18700,25 +18726,6 @@ var init_project_resources = __esm({
|
|
|
18700
18726
|
}
|
|
18701
18727
|
});
|
|
18702
18728
|
|
|
18703
|
-
// ../../packages/schemas/src/profiles.ts
|
|
18704
|
-
var LEGACY_PROFILE_HARNESSES, LegacyProfileSpecSchema, LegacyProfileResourceSchema;
|
|
18705
|
-
var init_profiles2 = __esm({
|
|
18706
|
-
"../../packages/schemas/src/profiles.ts"() {
|
|
18707
|
-
"use strict";
|
|
18708
|
-
init_zod();
|
|
18709
|
-
init_resources();
|
|
18710
|
-
LEGACY_PROFILE_HARNESSES = ["claude-code"];
|
|
18711
|
-
LegacyProfileSpecSchema = external_exports.object({
|
|
18712
|
-
harness: external_exports.enum(LEGACY_PROFILE_HARNESSES),
|
|
18713
|
-
instructions: external_exports.string().trim().min(1).max(1e5).optional(),
|
|
18714
|
-
environment: ResourceNameSchema
|
|
18715
|
-
}).strict();
|
|
18716
|
-
LegacyProfileResourceSchema = resourceEnvelopeSchema(
|
|
18717
|
-
LegacyProfileSpecSchema
|
|
18718
|
-
);
|
|
18719
|
-
}
|
|
18720
|
-
});
|
|
18721
|
-
|
|
18722
18729
|
// ../../packages/schemas/src/realtime.ts
|
|
18723
18730
|
var RunRealtimeEventSchema;
|
|
18724
18731
|
var init_realtime = __esm({
|
|
@@ -18806,7 +18813,6 @@ var init_session_runs = __esm({
|
|
|
18806
18813
|
init_environments();
|
|
18807
18814
|
init_ids();
|
|
18808
18815
|
init_primitives();
|
|
18809
|
-
init_profiles2();
|
|
18810
18816
|
init_sessions();
|
|
18811
18817
|
init_tools();
|
|
18812
18818
|
SESSION_RUN_STATUSES = [
|
|
@@ -18858,7 +18864,6 @@ var init_session_runs = __esm({
|
|
|
18858
18864
|
displayTitle: SessionRunDisplayTitleSchema,
|
|
18859
18865
|
starterActor: AuthActorSchema.nullable(),
|
|
18860
18866
|
sessionSnapshot: SessionResourceSchema,
|
|
18861
|
-
profileSnapshot: LegacyProfileResourceSchema,
|
|
18862
18867
|
environmentSnapshot: EnvironmentResourceSchema,
|
|
18863
18868
|
toolSnapshots: external_exports.array(
|
|
18864
18869
|
external_exports.discriminatedUnion("source", [
|
|
@@ -19029,7 +19034,6 @@ var init_run_introspection = __esm({
|
|
|
19029
19034
|
run: external_exports.object({
|
|
19030
19035
|
id: SessionRunIdSchema,
|
|
19031
19036
|
sessionName: external_exports.string(),
|
|
19032
|
-
profileName: external_exports.string(),
|
|
19033
19037
|
displayTitle: external_exports.string(),
|
|
19034
19038
|
status: SessionRunStatusSchema,
|
|
19035
19039
|
error: JsonValueSchema.nullable(),
|
|
@@ -19438,6 +19442,7 @@ var init_src = __esm({
|
|
|
19438
19442
|
init_connections();
|
|
19439
19443
|
init_github_credentials();
|
|
19440
19444
|
init_github_mcp_catalog();
|
|
19445
|
+
init_identities();
|
|
19441
19446
|
init_ids();
|
|
19442
19447
|
init_environments();
|
|
19443
19448
|
init_mcp();
|
|
@@ -19445,7 +19450,6 @@ var init_src = __esm({
|
|
|
19445
19450
|
init_provider_grants();
|
|
19446
19451
|
init_project_service_accounts();
|
|
19447
19452
|
init_project_resources();
|
|
19448
|
-
init_profiles2();
|
|
19449
19453
|
init_primitives();
|
|
19450
19454
|
init_realtime();
|
|
19451
19455
|
init_resources();
|
|
@@ -19654,6 +19658,13 @@ function createResourceApi(context) {
|
|
|
19654
19658
|
path: "/tools",
|
|
19655
19659
|
applyResponseSchema: ToolResourceSchema
|
|
19656
19660
|
});
|
|
19661
|
+
const identities = projectResource(
|
|
19662
|
+
context,
|
|
19663
|
+
{
|
|
19664
|
+
path: "/identities",
|
|
19665
|
+
applyResponseSchema: IdentityResourceSchema
|
|
19666
|
+
}
|
|
19667
|
+
);
|
|
19657
19668
|
return {
|
|
19658
19669
|
applyEnvironmentResource: environments.apply,
|
|
19659
19670
|
hasAvatarAsset: (request, options) => hasAvatarAsset(context, request, options ?? {}),
|
|
@@ -19668,6 +19679,7 @@ function createResourceApi(context) {
|
|
|
19668
19679
|
createProjectServiceAccount: (request, options) => createProjectServiceAccount(context, request, options ?? {}),
|
|
19669
19680
|
deleteProjectResource: (request, options) => deleteProjectResource(context, request, options ?? {}),
|
|
19670
19681
|
listEnvironments: environments.list,
|
|
19682
|
+
listIdentities: identities.list,
|
|
19671
19683
|
listProjectServiceAccounts: (options) => listProjectServiceAccounts(context, options ?? {}),
|
|
19672
19684
|
listSessions: sessions.list,
|
|
19673
19685
|
listTools: tools.list,
|
|
@@ -21213,7 +21225,7 @@ var init_package = __esm({
|
|
|
21213
21225
|
"package.json"() {
|
|
21214
21226
|
package_default = {
|
|
21215
21227
|
name: "@autohq/cli",
|
|
21216
|
-
version: "0.1.
|
|
21228
|
+
version: "0.1.130",
|
|
21217
21229
|
license: "SEE LICENSE IN README.md",
|
|
21218
21230
|
publishConfig: {
|
|
21219
21231
|
access: "public"
|
|
@@ -21460,28 +21472,39 @@ async function uploadAvatarAsset2(client, asset, apiBaseUrl) {
|
|
|
21460
21472
|
}
|
|
21461
21473
|
}
|
|
21462
21474
|
function stampAvatarSha256(resource, assets) {
|
|
21463
|
-
if (resource.kind
|
|
21464
|
-
|
|
21465
|
-
|
|
21466
|
-
|
|
21467
|
-
|
|
21468
|
-
|
|
21469
|
-
return
|
|
21470
|
-
|
|
21471
|
-
|
|
21472
|
-
|
|
21473
|
-
return resource;
|
|
21474
|
-
}
|
|
21475
|
-
return {
|
|
21476
|
-
...resource,
|
|
21477
|
-
spec: {
|
|
21478
|
-
...resource.spec,
|
|
21479
|
-
identity: {
|
|
21480
|
-
...identity2,
|
|
21475
|
+
if (resource.kind === "identity") {
|
|
21476
|
+
const avatar = resource.spec.avatar;
|
|
21477
|
+
const asset = avatar ? assets[avatar.asset] : void 0;
|
|
21478
|
+
if (!avatar || !asset) {
|
|
21479
|
+
return resource;
|
|
21480
|
+
}
|
|
21481
|
+
return {
|
|
21482
|
+
...resource,
|
|
21483
|
+
spec: {
|
|
21484
|
+
...resource.spec,
|
|
21481
21485
|
avatar: { asset: avatar.asset, sha256: asset.sha256 }
|
|
21482
21486
|
}
|
|
21487
|
+
};
|
|
21488
|
+
}
|
|
21489
|
+
if (resource.kind === "session" && typeof resource.spec.identity === "object" && resource.spec.identity !== null && !Array.isArray(resource.spec.identity)) {
|
|
21490
|
+
const identity2 = resource.spec.identity;
|
|
21491
|
+
const avatar = identity2.avatar;
|
|
21492
|
+
const asset = avatar ? assets[avatar.asset] : void 0;
|
|
21493
|
+
if (!avatar || !asset) {
|
|
21494
|
+
return resource;
|
|
21483
21495
|
}
|
|
21484
|
-
|
|
21496
|
+
return {
|
|
21497
|
+
...resource,
|
|
21498
|
+
spec: {
|
|
21499
|
+
...resource.spec,
|
|
21500
|
+
identity: {
|
|
21501
|
+
...identity2,
|
|
21502
|
+
avatar: { asset: avatar.asset, sha256: asset.sha256 }
|
|
21503
|
+
}
|
|
21504
|
+
}
|
|
21505
|
+
};
|
|
21506
|
+
}
|
|
21507
|
+
return resource;
|
|
21485
21508
|
}
|
|
21486
21509
|
function formatMegabytes(bytes) {
|
|
21487
21510
|
return (bytes / (1024 * 1024)).toFixed(1);
|
|
@@ -21647,26 +21670,23 @@ function readApplyDocument(document) {
|
|
|
21647
21670
|
function readApplyAssets(resources, projectRoot) {
|
|
21648
21671
|
const assets = {};
|
|
21649
21672
|
for (const resource of resources) {
|
|
21650
|
-
|
|
21651
|
-
|
|
21652
|
-
}
|
|
21653
|
-
const avatarAsset = resource.spec.identity?.avatar?.asset;
|
|
21654
|
-
if (!avatarAsset || assets[avatarAsset]) {
|
|
21673
|
+
const target = avatarAssetTarget(resource);
|
|
21674
|
+
if (!target || assets[target.asset]) {
|
|
21655
21675
|
continue;
|
|
21656
21676
|
}
|
|
21657
21677
|
const resolvedPath = validateSessionAvatarAsset({
|
|
21658
|
-
asset:
|
|
21659
|
-
resourceName:
|
|
21678
|
+
asset: target.asset,
|
|
21679
|
+
resourceName: target.resourceName,
|
|
21660
21680
|
projectRoot
|
|
21661
21681
|
});
|
|
21662
21682
|
const bytes = readFileSync3(resolvedPath);
|
|
21663
21683
|
const dimensionsProblem = avatarAssetDimensionsProblem(bytes);
|
|
21664
21684
|
if (dimensionsProblem) {
|
|
21665
21685
|
throw new Error(
|
|
21666
|
-
`Invalid
|
|
21686
|
+
`Invalid identity avatar asset for "${target.resourceName}": ${dimensionsProblem}`
|
|
21667
21687
|
);
|
|
21668
21688
|
}
|
|
21669
|
-
assets[
|
|
21689
|
+
assets[target.asset] = {
|
|
21670
21690
|
sha256: createHash3("sha256").update(bytes).digest("hex"),
|
|
21671
21691
|
contentType: extname(resolvedPath).toLowerCase() === ".png" ? "image/png" : "image/jpeg",
|
|
21672
21692
|
dataBase64: bytes.toString("base64")
|
|
@@ -21674,16 +21694,27 @@ function readApplyAssets(resources, projectRoot) {
|
|
|
21674
21694
|
}
|
|
21675
21695
|
return assets;
|
|
21676
21696
|
}
|
|
21697
|
+
function avatarAssetTarget(resource) {
|
|
21698
|
+
if (resource.kind === RESOURCE_KIND_IDENTITY) {
|
|
21699
|
+
const asset = resource.spec.avatar?.asset;
|
|
21700
|
+
return asset ? { asset, resourceName: resource.metadata.name } : void 0;
|
|
21701
|
+
}
|
|
21702
|
+
if (resource.kind === RESOURCE_KIND_SESSION && typeof resource.spec.identity === "object" && resource.spec.identity !== null && !Array.isArray(resource.spec.identity)) {
|
|
21703
|
+
const asset = resource.spec.identity.avatar?.asset;
|
|
21704
|
+
return asset ? { asset, resourceName: resource.metadata.name } : void 0;
|
|
21705
|
+
}
|
|
21706
|
+
return void 0;
|
|
21707
|
+
}
|
|
21677
21708
|
function validateSessionAvatarAsset(input) {
|
|
21678
21709
|
if (isAbsolute(input.asset)) {
|
|
21679
21710
|
throw new Error(
|
|
21680
|
-
`Invalid
|
|
21711
|
+
`Invalid identity avatar asset for "${input.resourceName}": asset path must be relative`
|
|
21681
21712
|
);
|
|
21682
21713
|
}
|
|
21683
21714
|
const relativeAssetPath = input.asset.replaceAll("\\", "/");
|
|
21684
21715
|
if (!relativeAssetPath.startsWith(".auto/assets/") && relativeAssetPath !== ".auto/assets") {
|
|
21685
21716
|
throw new Error(
|
|
21686
|
-
`Invalid
|
|
21717
|
+
`Invalid identity avatar asset for "${input.resourceName}": asset path must be under .auto/assets`
|
|
21687
21718
|
);
|
|
21688
21719
|
}
|
|
21689
21720
|
const projectRoot = realpathSync(input.projectRoot);
|
|
@@ -21693,7 +21724,7 @@ function validateSessionAvatarAsset(input) {
|
|
|
21693
21724
|
assetsRoot = realpathSync(resolve(projectRoot, ".auto", "assets"));
|
|
21694
21725
|
} catch {
|
|
21695
21726
|
throw new Error(
|
|
21696
|
-
`Invalid
|
|
21727
|
+
`Invalid identity avatar asset for "${input.resourceName}": .auto/assets directory does not exist`
|
|
21697
21728
|
);
|
|
21698
21729
|
}
|
|
21699
21730
|
let resolvedAssetPath;
|
|
@@ -21703,28 +21734,28 @@ function validateSessionAvatarAsset(input) {
|
|
|
21703
21734
|
stat = statSync(resolvedAssetPath);
|
|
21704
21735
|
} catch {
|
|
21705
21736
|
throw new Error(
|
|
21706
|
-
`Invalid
|
|
21737
|
+
`Invalid identity avatar asset for "${input.resourceName}": ${input.asset} does not exist`
|
|
21707
21738
|
);
|
|
21708
21739
|
}
|
|
21709
21740
|
if (!(resolvedAssetPath === assetsRoot || isInside(resolvedAssetPath, assetsRoot))) {
|
|
21710
21741
|
throw new Error(
|
|
21711
|
-
`Invalid
|
|
21742
|
+
`Invalid identity avatar asset for "${input.resourceName}": asset path must stay inside .auto/assets`
|
|
21712
21743
|
);
|
|
21713
21744
|
}
|
|
21714
21745
|
if (!stat.isFile()) {
|
|
21715
21746
|
throw new Error(
|
|
21716
|
-
`Invalid
|
|
21747
|
+
`Invalid identity avatar asset for "${input.resourceName}": asset must be a file`
|
|
21717
21748
|
);
|
|
21718
21749
|
}
|
|
21719
21750
|
if (stat.size > MAX_AVATAR_ASSET_BYTES) {
|
|
21720
21751
|
throw new Error(
|
|
21721
|
-
`Invalid
|
|
21752
|
+
`Invalid identity avatar asset for "${input.resourceName}": asset must be ${MAX_AVATAR_ASSET_BYTES} bytes or smaller`
|
|
21722
21753
|
);
|
|
21723
21754
|
}
|
|
21724
21755
|
const extension = extname(resolvedAssetPath).toLowerCase();
|
|
21725
21756
|
if (!ALLOWED_AVATAR_EXTENSIONS.has(extension)) {
|
|
21726
21757
|
throw new Error(
|
|
21727
|
-
`Invalid
|
|
21758
|
+
`Invalid identity avatar asset for "${input.resourceName}": asset must be a PNG or JPEG image`
|
|
21728
21759
|
);
|
|
21729
21760
|
}
|
|
21730
21761
|
return resolvedAssetPath;
|
|
@@ -21793,11 +21824,13 @@ var init_files = __esm({
|
|
|
21793
21824
|
init_src();
|
|
21794
21825
|
APPLY_DIRECTORIES = {
|
|
21795
21826
|
environment: "environments",
|
|
21827
|
+
identity: "identities",
|
|
21796
21828
|
tool: "tools",
|
|
21797
21829
|
session: "sessions"
|
|
21798
21830
|
};
|
|
21799
21831
|
APPLY_SCHEMAS = {
|
|
21800
21832
|
environment: EnvironmentApplyRequestSchema,
|
|
21833
|
+
identity: IdentityApplyRequestSchema,
|
|
21801
21834
|
tool: ToolApplyRequestSchema,
|
|
21802
21835
|
session: SessionApplyRequestSchema
|
|
21803
21836
|
};
|
|
@@ -21969,6 +22002,8 @@ async function listProjectResources2(client, kind, options) {
|
|
|
21969
22002
|
switch (kind) {
|
|
21970
22003
|
case RESOURCE_KIND_ENVIRONMENT:
|
|
21971
22004
|
return (await client.listEnvironments(options)).environments;
|
|
22005
|
+
case RESOURCE_KIND_IDENTITY:
|
|
22006
|
+
return (await client.listIdentities(options)).identities;
|
|
21972
22007
|
case RESOURCE_KIND_TOOL:
|
|
21973
22008
|
return (await client.listTools(options)).tools;
|
|
21974
22009
|
case RESOURCE_KIND_SESSION:
|
|
@@ -22003,6 +22038,12 @@ var init_resources3 = __esm({
|
|
|
22003
22038
|
label: "Tool",
|
|
22004
22039
|
pluralLabel: "Tools"
|
|
22005
22040
|
},
|
|
22041
|
+
[RESOURCE_KIND_IDENTITY]: {
|
|
22042
|
+
kind: RESOURCE_KIND_IDENTITY,
|
|
22043
|
+
section: "identities",
|
|
22044
|
+
label: "Identity",
|
|
22045
|
+
pluralLabel: "Identities"
|
|
22046
|
+
},
|
|
22006
22047
|
[RESOURCE_KIND_SESSION]: {
|
|
22007
22048
|
kind: RESOURCE_KIND_SESSION,
|
|
22008
22049
|
section: "sessions",
|
|
@@ -22012,6 +22053,7 @@ var init_resources3 = __esm({
|
|
|
22012
22053
|
};
|
|
22013
22054
|
PROJECT_RESOURCE_TUI_ORDER = [
|
|
22014
22055
|
RESOURCE_KIND_SESSION,
|
|
22056
|
+
RESOURCE_KIND_IDENTITY,
|
|
22015
22057
|
RESOURCE_KIND_ENVIRONMENT,
|
|
22016
22058
|
RESOURCE_KIND_TOOL
|
|
22017
22059
|
];
|
|
@@ -24466,6 +24508,32 @@ function ToolsView({
|
|
|
24466
24508
|
}
|
|
24467
24509
|
);
|
|
24468
24510
|
}
|
|
24511
|
+
function IdentitiesView({
|
|
24512
|
+
resources,
|
|
24513
|
+
selectedIndex,
|
|
24514
|
+
error: error51
|
|
24515
|
+
}) {
|
|
24516
|
+
return /* @__PURE__ */ jsx9(
|
|
24517
|
+
ResourceTable,
|
|
24518
|
+
{
|
|
24519
|
+
rows: resources.map((identity2) => ({
|
|
24520
|
+
id: identity2.metadata.uid,
|
|
24521
|
+
name: identity2.metadata.name,
|
|
24522
|
+
kind: identity2.spec.displayName ?? "",
|
|
24523
|
+
target: identity2.spec.username ?? "",
|
|
24524
|
+
detail: identity2.spec.avatar?.asset ?? identity2.spec.description ?? "",
|
|
24525
|
+
updatedAt: identity2.metadata.updatedAt
|
|
24526
|
+
})),
|
|
24527
|
+
selectedIndex,
|
|
24528
|
+
error: error51,
|
|
24529
|
+
empty: "no identities found",
|
|
24530
|
+
kindHeader: "DISPLAY",
|
|
24531
|
+
targetHeader: "USERNAME",
|
|
24532
|
+
detailHeader: "AVATAR / DESCRIPTION",
|
|
24533
|
+
flexColumn: "detail"
|
|
24534
|
+
}
|
|
24535
|
+
);
|
|
24536
|
+
}
|
|
24469
24537
|
function ServiceAccountsView({
|
|
24470
24538
|
resources,
|
|
24471
24539
|
selectedIndex,
|
|
@@ -24650,6 +24718,10 @@ function useEnvironments(apiUrl) {
|
|
|
24650
24718
|
const client = useApiClient();
|
|
24651
24719
|
return useQuery(environmentsQueryOptions(client, apiUrl));
|
|
24652
24720
|
}
|
|
24721
|
+
function useIdentities(apiUrl) {
|
|
24722
|
+
const client = useApiClient();
|
|
24723
|
+
return useQuery(identitiesQueryOptions(client, apiUrl));
|
|
24724
|
+
}
|
|
24653
24725
|
function useTools(apiUrl) {
|
|
24654
24726
|
const client = useApiClient();
|
|
24655
24727
|
return useQuery(toolsQueryOptions(client, apiUrl));
|
|
@@ -24927,6 +24999,14 @@ function environmentsQueryOptions(client, apiUrl) {
|
|
|
24927
24999
|
staleTime: Number.POSITIVE_INFINITY
|
|
24928
25000
|
});
|
|
24929
25001
|
}
|
|
25002
|
+
function identitiesQueryOptions(client, apiUrl) {
|
|
25003
|
+
return queryOptions({
|
|
25004
|
+
queryKey: queryKeys.identities(apiUrl),
|
|
25005
|
+
queryFn: async () => (await client.listIdentities({ apiBaseUrl: apiUrl })).identities,
|
|
25006
|
+
select: sortByName,
|
|
25007
|
+
staleTime: Number.POSITIVE_INFINITY
|
|
25008
|
+
});
|
|
25009
|
+
}
|
|
24930
25010
|
function sessionsQueryOptions(client, apiUrl) {
|
|
24931
25011
|
return queryOptions({
|
|
24932
25012
|
queryKey: queryKeys.sessions(apiUrl),
|
|
@@ -25022,6 +25102,7 @@ var init_queries = __esm({
|
|
|
25022
25102
|
TUI_RUN_LIST_LIMIT = 200;
|
|
25023
25103
|
queryKeys = {
|
|
25024
25104
|
environments: (apiUrl) => ["environments", apiUrl],
|
|
25105
|
+
identities: (apiUrl) => ["identities", apiUrl],
|
|
25025
25106
|
sessions: (apiUrl) => ["sessions", apiUrl],
|
|
25026
25107
|
tools: (apiUrl) => ["tools", apiUrl],
|
|
25027
25108
|
projects: (apiUrl) => ["projects", apiUrl],
|
|
@@ -25486,6 +25567,8 @@ function selectedNamedResourceForSection(input) {
|
|
|
25486
25567
|
switch (input.activeSection) {
|
|
25487
25568
|
case "environments":
|
|
25488
25569
|
return input.selectedEnvironment ?? null;
|
|
25570
|
+
case "identities":
|
|
25571
|
+
return input.selectedIdentity ?? null;
|
|
25489
25572
|
case "sessions":
|
|
25490
25573
|
return input.selectedSession ?? null;
|
|
25491
25574
|
case "tools":
|
|
@@ -25528,6 +25611,7 @@ function HomeView({ apiUrl, notice, returnToSession }) {
|
|
|
25528
25611
|
);
|
|
25529
25612
|
const [sessionIndex, setSessionIndex] = useState3(0);
|
|
25530
25613
|
const [environmentIndex, setEnvironmentIndex] = useState3(0);
|
|
25614
|
+
const [identityIndex, setIdentityIndex] = useState3(0);
|
|
25531
25615
|
const [toolIndex, setToolIndex] = useState3(0);
|
|
25532
25616
|
const [projectIndex, setProjectIndex] = useState3(0);
|
|
25533
25617
|
const [serviceAccountIndex, setServiceAccountIndex] = useState3(0);
|
|
@@ -25563,6 +25647,11 @@ function HomeView({ apiUrl, notice, returnToSession }) {
|
|
|
25563
25647
|
isLoading: isEnvironmentsLoading,
|
|
25564
25648
|
error: environmentsError
|
|
25565
25649
|
} = useEnvironments(apiUrl);
|
|
25650
|
+
const {
|
|
25651
|
+
data: identities = [],
|
|
25652
|
+
isLoading: isIdentitiesLoading,
|
|
25653
|
+
error: identitiesError
|
|
25654
|
+
} = useIdentities(apiUrl);
|
|
25566
25655
|
const {
|
|
25567
25656
|
data: tools = [],
|
|
25568
25657
|
isLoading: isToolsLoading,
|
|
@@ -25655,11 +25744,13 @@ function HomeView({ apiUrl, notice, returnToSession }) {
|
|
|
25655
25744
|
const selectedServiceAccount = serviceAccounts[serviceAccountIndex];
|
|
25656
25745
|
const selectedSession = sessions[sessionIndex];
|
|
25657
25746
|
const selectedEnvironment = environments[environmentIndex];
|
|
25747
|
+
const selectedIdentity = identities[identityIndex];
|
|
25658
25748
|
const selectedTool = tools[toolIndex];
|
|
25659
25749
|
const selectedInspectableResource = useMemo3(() => {
|
|
25660
25750
|
const selectedEditable = editableResourceForSelection({
|
|
25661
25751
|
activeSection,
|
|
25662
25752
|
selectedEnvironment,
|
|
25753
|
+
selectedIdentity,
|
|
25663
25754
|
selectedSession,
|
|
25664
25755
|
selectedTool
|
|
25665
25756
|
});
|
|
@@ -25679,6 +25770,12 @@ function HomeView({ apiUrl, notice, returnToSession }) {
|
|
|
25679
25770
|
name: selectedEditable.name,
|
|
25680
25771
|
spec: selectedEnvironment.spec
|
|
25681
25772
|
} : null;
|
|
25773
|
+
case "identities":
|
|
25774
|
+
return selectedIdentity ? {
|
|
25775
|
+
kind: selectedEditable.kind,
|
|
25776
|
+
name: selectedEditable.name,
|
|
25777
|
+
spec: selectedIdentity.spec
|
|
25778
|
+
} : null;
|
|
25682
25779
|
case "tools":
|
|
25683
25780
|
return selectedTool ? {
|
|
25684
25781
|
kind: selectedEditable.kind,
|
|
@@ -25688,15 +25785,28 @@ function HomeView({ apiUrl, notice, returnToSession }) {
|
|
|
25688
25785
|
default:
|
|
25689
25786
|
return null;
|
|
25690
25787
|
}
|
|
25691
|
-
}, [
|
|
25788
|
+
}, [
|
|
25789
|
+
activeSection,
|
|
25790
|
+
selectedEnvironment,
|
|
25791
|
+
selectedIdentity,
|
|
25792
|
+
selectedSession,
|
|
25793
|
+
selectedTool
|
|
25794
|
+
]);
|
|
25692
25795
|
const selectedEditableResource = useMemo3(
|
|
25693
25796
|
() => editableResourceForSelection({
|
|
25694
25797
|
activeSection,
|
|
25695
25798
|
selectedEnvironment,
|
|
25799
|
+
selectedIdentity,
|
|
25696
25800
|
selectedSession,
|
|
25697
25801
|
selectedTool
|
|
25698
25802
|
}),
|
|
25699
|
-
[
|
|
25803
|
+
[
|
|
25804
|
+
activeSection,
|
|
25805
|
+
selectedEnvironment,
|
|
25806
|
+
selectedIdentity,
|
|
25807
|
+
selectedSession,
|
|
25808
|
+
selectedTool
|
|
25809
|
+
]
|
|
25700
25810
|
);
|
|
25701
25811
|
const inspectPanelHeight = Math.max(1, termHeight - 12);
|
|
25702
25812
|
const scopedSession = runScopeSessionName ? sessions.find((session) => session.metadata.name === runScopeSessionName) : void 0;
|
|
@@ -26290,6 +26400,16 @@ function HomeView({ apiUrl, notice, returnToSession }) {
|
|
|
26290
26400
|
return;
|
|
26291
26401
|
}
|
|
26292
26402
|
}
|
|
26403
|
+
if (activeSection === "identities") {
|
|
26404
|
+
if (key.upArrow) {
|
|
26405
|
+
setIdentityIndex((i) => Math.max(0, i - 1));
|
|
26406
|
+
return;
|
|
26407
|
+
}
|
|
26408
|
+
if (key.downArrow) {
|
|
26409
|
+
setIdentityIndex((i) => clampListIndex(i + 1, identities.length));
|
|
26410
|
+
return;
|
|
26411
|
+
}
|
|
26412
|
+
}
|
|
26293
26413
|
if (activeSection === "tools") {
|
|
26294
26414
|
if (key.upArrow) {
|
|
26295
26415
|
setToolIndex((i) => Math.max(0, i - 1));
|
|
@@ -26580,9 +26700,10 @@ function HomeView({ apiUrl, notice, returnToSession }) {
|
|
|
26580
26700
|
sectionTitle = `Service Accounts[${serviceAccounts.length}]`;
|
|
26581
26701
|
break;
|
|
26582
26702
|
case "environments":
|
|
26703
|
+
case "identities":
|
|
26583
26704
|
case "tools": {
|
|
26584
26705
|
const definition = PROJECT_RESOURCE_TUI_DEFINITIONS_BY_SECTION.get(activeSection);
|
|
26585
|
-
const count = activeSection === "environments" ? environments.length : tools.length;
|
|
26706
|
+
const count = activeSection === "environments" ? environments.length : activeSection === "identities" ? identities.length : tools.length;
|
|
26586
26707
|
sectionTitle = `${definition?.pluralLabel ?? activeSection}[${count}]`;
|
|
26587
26708
|
break;
|
|
26588
26709
|
}
|
|
@@ -26761,6 +26882,13 @@ function HomeView({ apiUrl, notice, returnToSession }) {
|
|
|
26761
26882
|
selectedSession,
|
|
26762
26883
|
error: toolsError instanceof Error ? toolsError.message : toolsError ? String(toolsError) : null
|
|
26763
26884
|
}
|
|
26885
|
+
) : activeSection === "identities" ? isIdentitiesLoading ? /* @__PURE__ */ jsx14(Box13, { padding: 2, children: /* @__PURE__ */ jsx14(Spinner, { label: "loading identities\u2026" }) }) : /* @__PURE__ */ jsx14(
|
|
26886
|
+
IdentitiesView,
|
|
26887
|
+
{
|
|
26888
|
+
resources: identities,
|
|
26889
|
+
selectedIndex: identityIndex,
|
|
26890
|
+
error: identitiesError instanceof Error ? identitiesError.message : identitiesError ? String(identitiesError) : null
|
|
26891
|
+
}
|
|
26764
26892
|
) : activeSection === "sessions" ? /* @__PURE__ */ jsx14(
|
|
26765
26893
|
SessionsView,
|
|
26766
26894
|
{
|
|
@@ -26865,7 +26993,7 @@ function HomeView({ apiUrl, notice, returnToSession }) {
|
|
|
26865
26993
|
/* @__PURE__ */ jsx14(Text14, { dimColor: true, children: ` ${inspectedResource.name} ` }),
|
|
26866
26994
|
/* @__PURE__ */ jsx14(Text14, { dimColor: true, children: "\u203A" }),
|
|
26867
26995
|
/* @__PURE__ */ jsx14(Text14, { backgroundColor: "cyan", color: "black", children: " inspect " })
|
|
26868
|
-
] }) : (activeSection === "projects" || activeSection === "environments" || activeSection === "tools" || activeSection === "serviceAccounts" || activeSection === "connections") && /* @__PURE__ */ jsx14(
|
|
26996
|
+
] }) : (activeSection === "projects" || activeSection === "environments" || activeSection === "identities" || activeSection === "tools" || activeSection === "serviceAccounts" || activeSection === "connections") && /* @__PURE__ */ jsx14(
|
|
26869
26997
|
Text14,
|
|
26870
26998
|
{
|
|
26871
26999
|
backgroundColor: "cyan",
|
|
@@ -27105,10 +27233,11 @@ var init_HomeView = __esm({
|
|
|
27105
27233
|
resourceNavItem({ k: "1", section: "sessions" }),
|
|
27106
27234
|
{ k: "2", label: "Runs", activeSection: "runs" },
|
|
27107
27235
|
resourceNavItem({ k: "3", section: "environments" }),
|
|
27108
|
-
resourceNavItem({ k: "4", section: "
|
|
27109
|
-
{ k: "5",
|
|
27110
|
-
{ k: "6", label: "
|
|
27111
|
-
{ k: "7", label: "
|
|
27236
|
+
resourceNavItem({ k: "4", section: "identities" }),
|
|
27237
|
+
resourceNavItem({ k: "5", section: "tools" }),
|
|
27238
|
+
{ k: "6", label: "Projects", activeSection: "projects" },
|
|
27239
|
+
{ k: "7", label: "Service Accounts", activeSection: "serviceAccounts" },
|
|
27240
|
+
{ k: "8", label: "Connections", activeSection: "connections" }
|
|
27112
27241
|
];
|
|
27113
27242
|
RESOURCES_PER_COLUMN = 4;
|
|
27114
27243
|
}
|
|
@@ -27217,6 +27346,7 @@ async function launch(opts) {
|
|
|
27217
27346
|
});
|
|
27218
27347
|
const prefetchP = Promise.allSettled([
|
|
27219
27348
|
apiClient.listSessions({ apiBaseUrl: apiUrl }),
|
|
27349
|
+
apiClient.listIdentities({ apiBaseUrl: apiUrl }),
|
|
27220
27350
|
apiClient.listProjects({ apiBaseUrl: apiUrl }),
|
|
27221
27351
|
apiClient.listProjectServiceAccounts({ apiBaseUrl: apiUrl }),
|
|
27222
27352
|
apiClient.listConnections({ apiBaseUrl: apiUrl }),
|
|
@@ -27229,6 +27359,7 @@ async function launch(opts) {
|
|
|
27229
27359
|
const [, prefetchResult] = await Promise.all([waitSplash(), prefetchP]);
|
|
27230
27360
|
const [
|
|
27231
27361
|
sessionsResult,
|
|
27362
|
+
identitiesResult,
|
|
27232
27363
|
projectsResult,
|
|
27233
27364
|
serviceAccountsResult,
|
|
27234
27365
|
connectionsResult,
|
|
@@ -27240,6 +27371,12 @@ async function launch(opts) {
|
|
|
27240
27371
|
sortSessions(sessionsResult.value.sessions)
|
|
27241
27372
|
);
|
|
27242
27373
|
}
|
|
27374
|
+
if (identitiesResult.status === "fulfilled") {
|
|
27375
|
+
queryClient.setQueryData(
|
|
27376
|
+
queryKeys.identities(apiUrl),
|
|
27377
|
+
sortByResourceName(identitiesResult.value.identities)
|
|
27378
|
+
);
|
|
27379
|
+
}
|
|
27243
27380
|
if (projectsResult.status === "fulfilled") {
|
|
27244
27381
|
queryClient.setQueryData(
|
|
27245
27382
|
queryKeys.projects(apiUrl),
|
|
@@ -27371,6 +27508,13 @@ var init_launcher = __esm({
|
|
|
27371
27508
|
queryKey: queryKeys.tools,
|
|
27372
27509
|
sort: sortByResourceName
|
|
27373
27510
|
},
|
|
27511
|
+
[RESOURCE_KIND_IDENTITY]: {
|
|
27512
|
+
async list({ apiClient, apiUrl }) {
|
|
27513
|
+
return (await apiClient.listIdentities({ apiBaseUrl: apiUrl })).identities;
|
|
27514
|
+
},
|
|
27515
|
+
queryKey: queryKeys.identities,
|
|
27516
|
+
sort: sortByResourceName
|
|
27517
|
+
},
|
|
27374
27518
|
[RESOURCE_KIND_SESSION]: {
|
|
27375
27519
|
async list({ apiClient, apiUrl }) {
|
|
27376
27520
|
return (await apiClient.listSessions({ apiBaseUrl: apiUrl })).sessions;
|
|
@@ -31948,7 +32092,7 @@ function formatRunShowText(result, writeLine, style) {
|
|
|
31948
32092
|
const { summary } = result;
|
|
31949
32093
|
writeLine(
|
|
31950
32094
|
`${style.id(summary.run.id)} ${styleRunStatus(style, summary.run.status)} ${style.dim(
|
|
31951
|
-
`session=${summary.run.sessionName}
|
|
32095
|
+
`session=${summary.run.sessionName}`
|
|
31952
32096
|
)}`
|
|
31953
32097
|
);
|
|
31954
32098
|
if (summary.run.displayTitle) {
|