@autohq/cli 0.1.302 → 0.1.304
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 +487 -410
- package/dist/index.js +973 -895
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18417,979 +18417,980 @@ var init_environments = __esm({
|
|
|
18417
18417
|
}
|
|
18418
18418
|
});
|
|
18419
18419
|
|
|
18420
|
-
// ../../packages/schemas/src/
|
|
18421
|
-
var
|
|
18422
|
-
var
|
|
18423
|
-
"../../packages/schemas/src/
|
|
18424
|
-
"use strict";
|
|
18425
|
-
init_zod();
|
|
18426
|
-
init_primitives();
|
|
18427
|
-
LiveEntityEventEnvelopeSchema = external_exports.object({
|
|
18428
|
-
// Replay cursor for this frame; the SSE `id:` mirrors it so reconnects resume
|
|
18429
|
-
// from `sequence > cursor`.
|
|
18430
|
-
sequence: external_exports.number().int().nonnegative(),
|
|
18431
|
-
eventKey: external_exports.string().min(1),
|
|
18432
|
-
// The event's `subjectKind`, surfaced as `entity` for client-side dispatch.
|
|
18433
|
-
entity: external_exports.string().min(1),
|
|
18434
|
-
subjectId: external_exports.string().min(1),
|
|
18435
|
-
payload: JsonValueSchema,
|
|
18436
|
-
occurredAt: external_exports.string().min(1)
|
|
18437
|
-
});
|
|
18438
|
-
}
|
|
18439
|
-
});
|
|
18440
|
-
|
|
18441
|
-
// ../../packages/schemas/src/mcp.ts
|
|
18442
|
-
var McpToolCallMessageSchema, McpJsonRpcMessageSchema, McpPostBodySchema;
|
|
18443
|
-
var init_mcp = __esm({
|
|
18444
|
-
"../../packages/schemas/src/mcp.ts"() {
|
|
18420
|
+
// ../../packages/schemas/src/singleton-refresh.ts
|
|
18421
|
+
var SINGLETON_RESPAWN_REASONS, SingletonRespawnReasonSchema, SingletonRespawnSchema, SingletonRefreshEventPayloadSchema;
|
|
18422
|
+
var init_singleton_refresh = __esm({
|
|
18423
|
+
"../../packages/schemas/src/singleton-refresh.ts"() {
|
|
18445
18424
|
"use strict";
|
|
18446
18425
|
init_zod();
|
|
18447
|
-
|
|
18448
|
-
|
|
18449
|
-
|
|
18450
|
-
|
|
18426
|
+
SINGLETON_RESPAWN_REASONS = ["refresh", "failure"];
|
|
18427
|
+
SingletonRespawnReasonSchema = external_exports.enum(SINGLETON_RESPAWN_REASONS);
|
|
18428
|
+
SingletonRespawnSchema = external_exports.object({
|
|
18429
|
+
reason: SingletonRespawnReasonSchema.default("refresh")
|
|
18430
|
+
}).strict();
|
|
18431
|
+
SingletonRefreshEventPayloadSchema = external_exports.object({
|
|
18432
|
+
trigger: external_exports.literal("agent.refresh"),
|
|
18433
|
+
refresh: external_exports.object({
|
|
18434
|
+
reason: SingletonRespawnReasonSchema,
|
|
18435
|
+
agentResourceId: external_exports.string().trim().min(1),
|
|
18436
|
+
previousSessionId: external_exports.string().trim().min(1)
|
|
18451
18437
|
})
|
|
18452
18438
|
});
|
|
18453
|
-
McpJsonRpcMessageSchema = external_exports.object({
|
|
18454
|
-
method: external_exports.string().optional()
|
|
18455
|
-
}).passthrough();
|
|
18456
|
-
McpPostBodySchema = external_exports.union([McpJsonRpcMessageSchema, external_exports.array(McpJsonRpcMessageSchema)]).transform((body) => Array.isArray(body) ? body : [body]);
|
|
18457
|
-
}
|
|
18458
|
-
});
|
|
18459
|
-
|
|
18460
|
-
// ../../packages/schemas/src/pricing.ts
|
|
18461
|
-
function tier(inputUsdPerMtok, outputUsdPerMtok) {
|
|
18462
|
-
return {
|
|
18463
|
-
inputUsdPerMtok,
|
|
18464
|
-
outputUsdPerMtok,
|
|
18465
|
-
cacheWrite5mUsdPerMtok: inputUsdPerMtok * 1.25,
|
|
18466
|
-
cacheReadUsdPerMtok: inputUsdPerMtok * 0.1
|
|
18467
|
-
};
|
|
18468
|
-
}
|
|
18469
|
-
function opusTier() {
|
|
18470
|
-
return tier(5, 25);
|
|
18471
|
-
}
|
|
18472
|
-
function openAiTier(rates) {
|
|
18473
|
-
return {
|
|
18474
|
-
inputUsdPerMtok: rates.input,
|
|
18475
|
-
outputUsdPerMtok: rates.output,
|
|
18476
|
-
cacheWrite5mUsdPerMtok: rates.input,
|
|
18477
|
-
cacheReadUsdPerMtok: rates.cachedInput
|
|
18478
|
-
};
|
|
18479
|
-
}
|
|
18480
|
-
var RATE_CARD_2026_06_23, PRICING_RATE_CARDS, CURRENT_PRICING_VERSION;
|
|
18481
|
-
var init_pricing = __esm({
|
|
18482
|
-
"../../packages/schemas/src/pricing.ts"() {
|
|
18483
|
-
"use strict";
|
|
18484
|
-
RATE_CARD_2026_06_23 = {
|
|
18485
|
-
version: "2026-06-23",
|
|
18486
|
-
effectiveAt: "2026-06-23T00:00:00.000Z",
|
|
18487
|
-
models: {
|
|
18488
|
-
"claude-opus-4-8": opusTier(),
|
|
18489
|
-
"claude-opus-4-7": opusTier(),
|
|
18490
|
-
"claude-opus-4-6": opusTier(),
|
|
18491
|
-
"claude-sonnet-4-6": tier(3, 15),
|
|
18492
|
-
"claude-haiku-4-5": tier(1, 5),
|
|
18493
|
-
"claude-haiku-4-5-20251001": tier(1, 5),
|
|
18494
|
-
"claude-fable-5": tier(10, 50),
|
|
18495
|
-
// OpenAI gpt-5.3-codex, standard tier: input $1.75/Mtok, cached input
|
|
18496
|
-
// $0.175/Mtok, output $14.00/Mtok. Source (verified 2026-06-23):
|
|
18497
|
-
// https://developers.openai.com/api/docs/models/gpt-5.3-codex and
|
|
18498
|
-
// https://developers.openai.com/api/docs/pricing (priority tier is 2x; we
|
|
18499
|
-
// bill standard).
|
|
18500
|
-
"gpt-5.3-codex": openAiTier({
|
|
18501
|
-
input: 1.75,
|
|
18502
|
-
cachedInput: 0.175,
|
|
18503
|
-
output: 14
|
|
18504
|
-
})
|
|
18505
|
-
}
|
|
18506
|
-
};
|
|
18507
|
-
PRICING_RATE_CARDS = {
|
|
18508
|
-
[RATE_CARD_2026_06_23.version]: RATE_CARD_2026_06_23
|
|
18509
|
-
};
|
|
18510
|
-
CURRENT_PRICING_VERSION = RATE_CARD_2026_06_23.version;
|
|
18511
|
-
}
|
|
18512
|
-
});
|
|
18513
|
-
|
|
18514
|
-
// ../../packages/schemas/src/project-service-accounts.ts
|
|
18515
|
-
var ProjectServiceAccountSchema, ProjectServiceAccountCreateRequestSchema, ProjectServiceAccountUpdateRequestSchema, ProjectServiceAccountTokenResponseSchema, ProjectServiceAccountUpdateResponseSchema, ProjectServiceAccountRemoveResponseSchema, ProjectServiceAccountListResponseSchema;
|
|
18516
|
-
var init_project_service_accounts = __esm({
|
|
18517
|
-
"../../packages/schemas/src/project-service-accounts.ts"() {
|
|
18518
|
-
"use strict";
|
|
18519
|
-
init_zod();
|
|
18520
|
-
init_auth();
|
|
18521
|
-
init_ids();
|
|
18522
|
-
init_resources();
|
|
18523
|
-
ProjectServiceAccountSchema = external_exports.object({
|
|
18524
|
-
id: ServiceAccountIdSchema,
|
|
18525
|
-
organizationId: OrganizationIdSchema,
|
|
18526
|
-
projectId: ProjectIdSchema,
|
|
18527
|
-
name: ResourceNameSchema,
|
|
18528
|
-
scopes: external_exports.array(AuthScopeSchema),
|
|
18529
|
-
createdAt: external_exports.string().datetime()
|
|
18530
|
-
});
|
|
18531
|
-
ProjectServiceAccountCreateRequestSchema = external_exports.object({
|
|
18532
|
-
name: ResourceNameSchema,
|
|
18533
|
-
scopes: external_exports.array(AuthScopeSchema).min(1)
|
|
18534
|
-
});
|
|
18535
|
-
ProjectServiceAccountUpdateRequestSchema = external_exports.object({
|
|
18536
|
-
scopes: external_exports.array(AuthScopeSchema).min(1)
|
|
18537
|
-
});
|
|
18538
|
-
ProjectServiceAccountTokenResponseSchema = external_exports.object({
|
|
18539
|
-
serviceAccount: ProjectServiceAccountSchema,
|
|
18540
|
-
token: external_exports.string().min(1)
|
|
18541
|
-
});
|
|
18542
|
-
ProjectServiceAccountUpdateResponseSchema = external_exports.object({
|
|
18543
|
-
serviceAccount: ProjectServiceAccountSchema
|
|
18544
|
-
});
|
|
18545
|
-
ProjectServiceAccountRemoveResponseSchema = external_exports.object({
|
|
18546
|
-
serviceAccount: ProjectServiceAccountSchema,
|
|
18547
|
-
removed: external_exports.literal(true)
|
|
18548
|
-
});
|
|
18549
|
-
ProjectServiceAccountListResponseSchema = external_exports.object({
|
|
18550
|
-
serviceAccounts: external_exports.array(ProjectServiceAccountSchema)
|
|
18551
|
-
});
|
|
18552
18439
|
}
|
|
18553
18440
|
});
|
|
18554
18441
|
|
|
18555
|
-
// ../../packages/schemas/src/
|
|
18556
|
-
|
|
18557
|
-
|
|
18558
|
-
|
|
18559
|
-
var EnvironmentApplyDocumentSchema, IdentityApplyDocumentSchema, AgentApplyDocumentSchema, ProjectApplyResourceSchema, PROJECT_RESOURCE_APPLY_ORDER, PROJECT_RESOURCE_KINDS, PROJECT_APPLY_RESOURCE_KINDS, PROJECT_APPLY_BUNDLE_VERSION, MAX_PROJECT_APPLY_BUNDLE_BYTES, PROJECT_APPLY_BUNDLE_CONTENT_TYPE, ProjectDeleteResourceBaseSchema, ProjectDeleteResourceSchema, AVATAR_ASSET_CONTENT_TYPES, MAX_AVATAR_ASSET_BASE64_LENGTH, ProjectApplyAssetSchema, ProjectApplyAssetsSchema, AvatarAssetUploadResponseSchema, ApplyBundlePathSchema, ProjectApplyBundleFileSchema, ProjectApplyBundleSchema, ProjectApplyBundleRefSchema, ProjectApplyBundleUploadRequestSchema, ProjectApplyBundleUploadResponseSchema, ProjectApplyBundleDirectoryEntrypointSchema, ProjectApplyBundleFileEntrypointSchema, ProjectApplyBundleEntrypointSchema, ProjectApplySourceSchema, ProjectApplySourceRequestSchema, ProjectApplyRequestSchema, ProjectApplySystemConfigSchema, ProjectAppliedResourceSchema, ProjectApplyDiagnosticSchema, ProjectApplyResponsePrunedSchema, ProjectApplyPlanDiffSchema, ProjectApplyResponseSchema, ProjectResourceApplyResultSchema, ProjectResourceApplyAuditActionSchema, ProjectResourceApplyOperationIdSchema, ProjectResourceApplyTriggerArtifactSchema, ProjectResourceApplyWorkflowErrorSchema, ProjectResourceApplyWorkflowInputSchema, ProjectResourceApplyWorkflowResultSchema;
|
|
18560
|
-
var init_project_resources = __esm({
|
|
18561
|
-
"../../packages/schemas/src/project-resources.ts"() {
|
|
18442
|
+
// ../../packages/schemas/src/session-commands.ts
|
|
18443
|
+
var SESSION_COMMAND_KINDS, SESSION_DISPATCH_COMMAND_KINDS, SESSION_PERSISTED_COMMAND_KINDS, SESSION_LIFECYCLE_COMMAND_KINDS, SESSION_COMMAND_STATUSES, SESSION_DISPATCH_COMMAND_STATUSES, SessionCommandKindSchema, SessionPersistedCommandKindSchema, SessionDispatchCommandKindSchema, RunLifecycleCommandKindSchema, SessionCommandStatusSchema, SessionDispatchCommandStatusSchema, SessionCommandSenderSchema, MESSAGE_DELIVERY_MODES, MessageDeliveryModeSchema, TRIGGER_INJECTION_MODALITIES, TriggerInjectionModalitySchema, RunMessageCommandPayloadSchema, RunAnswerCommandPayloadSchema, RunLifecycleCommandPayloadSchema, RunStopCommandPayloadSchema, SessionCommandPayloadSchema, CreateRunMessageCommandRequestSchema, CreateRunAnswerCommandRequestSchema, CreateRunLifecycleCommandRequestSchema, CreateRunStopCommandRequestSchema, CreateSessionCommandRequestSchema, RunResolutionPolicySchema, AgentAddressedCommandTargetSchema, SessionCommandRecordBaseSchema, RunStartCommandPayloadSchema, RunStartWithMessageCommandPayloadSchema, SessionPersistedCommandPayloadSchema, SessionCommandRecordSchema, SessionDispatchMessageCommandPayloadSchema, SessionDispatchAnswerCommandPayloadSchema, SessionDispatchStopCommandPayloadSchema, SessionDispatchCommandPayloadSchema, SessionDispatchCommandRecordBaseSchema, SessionDispatchCommandRecordSchema;
|
|
18444
|
+
var init_session_commands = __esm({
|
|
18445
|
+
"../../packages/schemas/src/session-commands.ts"() {
|
|
18562
18446
|
"use strict";
|
|
18563
18447
|
init_zod();
|
|
18564
|
-
init_agents();
|
|
18565
18448
|
init_auth();
|
|
18566
|
-
init_connections();
|
|
18567
|
-
init_environments();
|
|
18568
|
-
init_identities();
|
|
18569
18449
|
init_ids();
|
|
18570
18450
|
init_primitives();
|
|
18571
|
-
|
|
18572
|
-
|
|
18573
|
-
|
|
18574
|
-
|
|
18575
|
-
|
|
18451
|
+
init_singleton_refresh();
|
|
18452
|
+
SESSION_COMMAND_KINDS = [
|
|
18453
|
+
"message",
|
|
18454
|
+
"answer",
|
|
18455
|
+
"pause",
|
|
18456
|
+
"resume",
|
|
18457
|
+
"interrupt",
|
|
18458
|
+
"cancel",
|
|
18459
|
+
"stop"
|
|
18460
|
+
];
|
|
18461
|
+
SESSION_DISPATCH_COMMAND_KINDS = [
|
|
18462
|
+
"start",
|
|
18463
|
+
"startWithMessage",
|
|
18464
|
+
"message",
|
|
18465
|
+
"answer",
|
|
18466
|
+
"stop"
|
|
18467
|
+
];
|
|
18468
|
+
SESSION_PERSISTED_COMMAND_KINDS = [
|
|
18469
|
+
"message",
|
|
18470
|
+
"pause",
|
|
18471
|
+
"resume",
|
|
18472
|
+
"interrupt",
|
|
18473
|
+
"cancel",
|
|
18474
|
+
"stop",
|
|
18475
|
+
"start",
|
|
18476
|
+
"startWithMessage",
|
|
18477
|
+
"answer"
|
|
18478
|
+
];
|
|
18479
|
+
SESSION_LIFECYCLE_COMMAND_KINDS = [
|
|
18480
|
+
"pause",
|
|
18481
|
+
"resume",
|
|
18482
|
+
"interrupt",
|
|
18483
|
+
"cancel",
|
|
18484
|
+
"stop"
|
|
18485
|
+
];
|
|
18486
|
+
SESSION_COMMAND_STATUSES = [
|
|
18487
|
+
"pending",
|
|
18488
|
+
"dispatching",
|
|
18489
|
+
"accepted",
|
|
18490
|
+
"failed"
|
|
18491
|
+
];
|
|
18492
|
+
SESSION_DISPATCH_COMMAND_STATUSES = [
|
|
18493
|
+
"pending",
|
|
18494
|
+
"dispatching",
|
|
18495
|
+
"accepted",
|
|
18496
|
+
"failed"
|
|
18497
|
+
];
|
|
18498
|
+
SessionCommandKindSchema = external_exports.enum(SESSION_COMMAND_KINDS);
|
|
18499
|
+
SessionPersistedCommandKindSchema = external_exports.enum(
|
|
18500
|
+
SESSION_PERSISTED_COMMAND_KINDS
|
|
18576
18501
|
);
|
|
18577
|
-
|
|
18578
|
-
|
|
18579
|
-
IdentityApplyRequestSchema.shape.spec
|
|
18502
|
+
SessionDispatchCommandKindSchema = external_exports.enum(
|
|
18503
|
+
SESSION_DISPATCH_COMMAND_KINDS
|
|
18580
18504
|
);
|
|
18581
|
-
|
|
18582
|
-
|
|
18583
|
-
AgentApplyRequestSchema.shape.spec
|
|
18505
|
+
RunLifecycleCommandKindSchema = external_exports.enum(
|
|
18506
|
+
SESSION_LIFECYCLE_COMMAND_KINDS
|
|
18584
18507
|
);
|
|
18585
|
-
|
|
18586
|
-
|
|
18587
|
-
|
|
18588
|
-
|
|
18508
|
+
SessionCommandStatusSchema = external_exports.enum(SESSION_COMMAND_STATUSES);
|
|
18509
|
+
SessionDispatchCommandStatusSchema = external_exports.enum(
|
|
18510
|
+
SESSION_DISPATCH_COMMAND_STATUSES
|
|
18511
|
+
);
|
|
18512
|
+
SessionCommandSenderSchema = external_exports.discriminatedUnion("type", [
|
|
18513
|
+
external_exports.object({
|
|
18514
|
+
type: external_exports.literal("operator"),
|
|
18515
|
+
id: external_exports.string().trim().min(1).nullable().default(null),
|
|
18516
|
+
actor: AuthActorSchema.nullable().optional()
|
|
18517
|
+
}),
|
|
18518
|
+
external_exports.object({
|
|
18519
|
+
type: external_exports.literal("agent"),
|
|
18520
|
+
sessionId: SessionIdSchema
|
|
18521
|
+
}),
|
|
18522
|
+
external_exports.object({
|
|
18523
|
+
type: external_exports.literal("system")
|
|
18524
|
+
})
|
|
18589
18525
|
]);
|
|
18590
|
-
|
|
18591
|
-
|
|
18592
|
-
|
|
18593
|
-
|
|
18594
|
-
|
|
18595
|
-
|
|
18596
|
-
|
|
18597
|
-
|
|
18598
|
-
|
|
18599
|
-
|
|
18600
|
-
|
|
18601
|
-
];
|
|
18602
|
-
PROJECT_APPLY_BUNDLE_VERSION = 1;
|
|
18603
|
-
MAX_PROJECT_APPLY_BUNDLE_BYTES = 64 * 1024 * 1024;
|
|
18604
|
-
PROJECT_APPLY_BUNDLE_CONTENT_TYPE = "application/vnd.auto.project-apply-bundle+json";
|
|
18605
|
-
ProjectDeleteResourceBaseSchema = external_exports.object({
|
|
18606
|
-
name: external_exports.string().trim().min(1)
|
|
18607
|
-
});
|
|
18608
|
-
ProjectDeleteResourceSchema = ProjectDeleteResourceBaseSchema.extend({
|
|
18609
|
-
kind: external_exports.enum(PROJECT_APPLY_RESOURCE_KINDS)
|
|
18610
|
-
});
|
|
18611
|
-
AVATAR_ASSET_CONTENT_TYPES = ["image/png", "image/jpeg"];
|
|
18612
|
-
MAX_AVATAR_ASSET_BASE64_LENGTH = Math.ceil(MAX_AVATAR_ASSET_BYTES / 3) * 4 + 4;
|
|
18613
|
-
ProjectApplyAssetSchema = external_exports.object({
|
|
18614
|
-
sha256: external_exports.string().regex(/^[a-f0-9]{64}$/),
|
|
18615
|
-
contentType: external_exports.enum(AVATAR_ASSET_CONTENT_TYPES),
|
|
18616
|
-
dataBase64: external_exports.string().min(1).max(MAX_AVATAR_ASSET_BASE64_LENGTH).regex(/^[A-Za-z0-9+/]+={0,2}$/)
|
|
18617
|
-
});
|
|
18618
|
-
ProjectApplyAssetsSchema = external_exports.record(
|
|
18619
|
-
external_exports.string().refine(isAvatarAssetPathShapeValid, {
|
|
18620
|
-
message: "asset keys must be relative paths under .auto/assets"
|
|
18621
|
-
}),
|
|
18622
|
-
ProjectApplyAssetSchema
|
|
18526
|
+
MESSAGE_DELIVERY_MODES = ["interrupt", "deferred"];
|
|
18527
|
+
MessageDeliveryModeSchema = external_exports.enum(MESSAGE_DELIVERY_MODES);
|
|
18528
|
+
TRIGGER_INJECTION_MODALITIES = [
|
|
18529
|
+
"chat",
|
|
18530
|
+
"githubCheck",
|
|
18531
|
+
"githubCheckAction",
|
|
18532
|
+
"githubPullRequest",
|
|
18533
|
+
"other"
|
|
18534
|
+
];
|
|
18535
|
+
TriggerInjectionModalitySchema = external_exports.enum(
|
|
18536
|
+
TRIGGER_INJECTION_MODALITIES
|
|
18623
18537
|
);
|
|
18624
|
-
|
|
18625
|
-
|
|
18626
|
-
|
|
18627
|
-
|
|
18628
|
-
|
|
18629
|
-
|
|
18630
|
-
|
|
18631
|
-
|
|
18632
|
-
|
|
18633
|
-
|
|
18634
|
-
|
|
18635
|
-
|
|
18636
|
-
|
|
18637
|
-
|
|
18638
|
-
|
|
18639
|
-
})
|
|
18640
|
-
|
|
18641
|
-
kind: external_exports.literal("vercel_blob"),
|
|
18642
|
-
storageKey: external_exports.string().trim().min(1).max(1024),
|
|
18643
|
-
sha256: external_exports.string().regex(SHA256_HEX_PATTERN),
|
|
18644
|
-
sizeBytes: external_exports.number().int().positive().max(MAX_PROJECT_APPLY_BUNDLE_BYTES)
|
|
18645
|
-
}).superRefine((ref, context) => {
|
|
18646
|
-
const expectedStorageKey = projectApplyBundleStorageKey(ref.sha256);
|
|
18647
|
-
if (ref.storageKey === expectedStorageKey) {
|
|
18648
|
-
return;
|
|
18649
|
-
}
|
|
18650
|
-
context.addIssue({
|
|
18651
|
-
code: "custom",
|
|
18652
|
-
path: ["storageKey"],
|
|
18653
|
-
message: "apply bundle storage key must match its sha256"
|
|
18654
|
-
});
|
|
18655
|
-
});
|
|
18656
|
-
ProjectApplyBundleUploadRequestSchema = external_exports.object({
|
|
18657
|
-
sha256: external_exports.string().regex(SHA256_HEX_PATTERN),
|
|
18658
|
-
sizeBytes: external_exports.number().int().positive().max(MAX_PROJECT_APPLY_BUNDLE_BYTES)
|
|
18659
|
-
});
|
|
18660
|
-
ProjectApplyBundleUploadResponseSchema = external_exports.object({
|
|
18661
|
-
method: external_exports.literal("PUT"),
|
|
18662
|
-
uploadUrl: external_exports.string().url(),
|
|
18663
|
-
contentType: external_exports.literal(PROJECT_APPLY_BUNDLE_CONTENT_TYPE),
|
|
18664
|
-
source: ProjectApplyBundleRefSchema
|
|
18665
|
-
});
|
|
18666
|
-
ProjectApplyBundleDirectoryEntrypointSchema = external_exports.object({
|
|
18667
|
-
kind: external_exports.literal("directory"),
|
|
18668
|
-
resourceRoot: ApplyBundlePathSchema.default(".auto"),
|
|
18669
|
-
displayResourceRoot: external_exports.string().trim().min(1).max(4096).optional()
|
|
18670
|
-
});
|
|
18671
|
-
ProjectApplyBundleFileEntrypointSchema = external_exports.object({
|
|
18672
|
-
kind: external_exports.literal("file"),
|
|
18673
|
-
filePath: ApplyBundlePathSchema
|
|
18538
|
+
RunMessageCommandPayloadSchema = external_exports.object({
|
|
18539
|
+
message: external_exports.string().trim().min(1),
|
|
18540
|
+
// Optional so existing payloads and direct operator/agent messages stay
|
|
18541
|
+
// valid without it; trigger routing sets "deferred" for GitHub check
|
|
18542
|
+
// events. An absent mode is treated as "interrupt" at the delivery
|
|
18543
|
+
// boundary (commandDeliveryPayload / the runtime handler), so the default
|
|
18544
|
+
// lives where the value is consumed rather than as a required field every
|
|
18545
|
+
// call site must construct.
|
|
18546
|
+
deliveryMode: MessageDeliveryModeSchema.optional(),
|
|
18547
|
+
metadata: JsonValueSchema.optional()
|
|
18548
|
+
}).strict();
|
|
18549
|
+
RunAnswerCommandPayloadSchema = external_exports.object({
|
|
18550
|
+
toolCallId: external_exports.string().trim().min(1),
|
|
18551
|
+
answers: external_exports.record(external_exports.string(), external_exports.string()),
|
|
18552
|
+
response: external_exports.string().trim().min(1).optional()
|
|
18553
|
+
}).strict().refine((value) => Object.keys(value.answers).length > 0 || value.response, {
|
|
18554
|
+
message: "Provide at least one answer or a freeform response"
|
|
18674
18555
|
});
|
|
18675
|
-
|
|
18676
|
-
|
|
18677
|
-
|
|
18556
|
+
RunLifecycleCommandPayloadSchema = external_exports.object({
|
|
18557
|
+
reason: external_exports.string().trim().min(1).optional()
|
|
18558
|
+
}).strict();
|
|
18559
|
+
RunStopCommandPayloadSchema = external_exports.object({
|
|
18560
|
+
reason: external_exports.string().trim().min(1).optional(),
|
|
18561
|
+
respawn: SingletonRespawnSchema.optional()
|
|
18562
|
+
}).strict();
|
|
18563
|
+
SessionCommandPayloadSchema = external_exports.union([
|
|
18564
|
+
RunMessageCommandPayloadSchema,
|
|
18565
|
+
RunAnswerCommandPayloadSchema,
|
|
18566
|
+
RunLifecycleCommandPayloadSchema,
|
|
18567
|
+
RunStopCommandPayloadSchema
|
|
18678
18568
|
]);
|
|
18679
|
-
|
|
18680
|
-
|
|
18681
|
-
|
|
18682
|
-
entrypoint: ProjectApplyBundleEntrypointSchema
|
|
18683
|
-
});
|
|
18684
|
-
ProjectApplySourceRequestSchema = external_exports.object({
|
|
18685
|
-
source: ProjectApplySourceSchema,
|
|
18686
|
-
delete: external_exports.array(ProjectDeleteResourceSchema).default([]),
|
|
18687
|
-
dryRun: external_exports.boolean().default(false),
|
|
18688
|
-
prune: external_exports.boolean().default(true)
|
|
18569
|
+
CreateRunMessageCommandRequestSchema = external_exports.object({
|
|
18570
|
+
message: external_exports.string().trim().min(1),
|
|
18571
|
+
metadata: JsonValueSchema.optional()
|
|
18689
18572
|
});
|
|
18690
|
-
|
|
18691
|
-
|
|
18692
|
-
|
|
18693
|
-
prune: external_exports.boolean().default(false),
|
|
18694
|
-
resources: external_exports.array(ProjectApplyResourceSchema).default([]),
|
|
18695
|
-
assets: ProjectApplyAssetsSchema.default({})
|
|
18573
|
+
CreateRunAnswerCommandRequestSchema = RunAnswerCommandPayloadSchema;
|
|
18574
|
+
CreateRunLifecycleCommandRequestSchema = external_exports.object({
|
|
18575
|
+
reason: external_exports.string().trim().min(1).optional()
|
|
18696
18576
|
});
|
|
18697
|
-
|
|
18698
|
-
|
|
18699
|
-
|
|
18700
|
-
name: external_exports.string().trim().min(1).optional()
|
|
18701
|
-
}).optional(),
|
|
18702
|
-
spec: ProjectApplyRequestSchema
|
|
18577
|
+
CreateRunStopCommandRequestSchema = external_exports.object({
|
|
18578
|
+
reason: external_exports.string().trim().min(1).optional(),
|
|
18579
|
+
respawn: SingletonRespawnSchema.optional()
|
|
18703
18580
|
});
|
|
18704
|
-
|
|
18705
|
-
|
|
18706
|
-
|
|
18707
|
-
|
|
18708
|
-
|
|
18581
|
+
CreateSessionCommandRequestSchema = external_exports.discriminatedUnion("kind", [
|
|
18582
|
+
external_exports.object({
|
|
18583
|
+
kind: external_exports.literal("message"),
|
|
18584
|
+
payload: CreateRunMessageCommandRequestSchema
|
|
18585
|
+
}).strict(),
|
|
18586
|
+
external_exports.object({
|
|
18587
|
+
kind: external_exports.literal("answer"),
|
|
18588
|
+
payload: CreateRunAnswerCommandRequestSchema
|
|
18589
|
+
}).strict(),
|
|
18590
|
+
external_exports.object({
|
|
18591
|
+
kind: external_exports.literal("pause"),
|
|
18592
|
+
payload: CreateRunLifecycleCommandRequestSchema
|
|
18593
|
+
}).strict(),
|
|
18594
|
+
external_exports.object({
|
|
18595
|
+
kind: external_exports.literal("resume"),
|
|
18596
|
+
payload: CreateRunLifecycleCommandRequestSchema
|
|
18597
|
+
}).strict(),
|
|
18598
|
+
external_exports.object({
|
|
18599
|
+
kind: external_exports.literal("interrupt"),
|
|
18600
|
+
payload: CreateRunLifecycleCommandRequestSchema
|
|
18601
|
+
}).strict(),
|
|
18602
|
+
external_exports.object({
|
|
18603
|
+
kind: external_exports.literal("cancel"),
|
|
18604
|
+
payload: CreateRunLifecycleCommandRequestSchema
|
|
18605
|
+
}).strict(),
|
|
18606
|
+
external_exports.object({
|
|
18607
|
+
kind: external_exports.literal("stop"),
|
|
18608
|
+
payload: CreateRunStopCommandRequestSchema
|
|
18609
|
+
}).strict()
|
|
18709
18610
|
]);
|
|
18710
|
-
|
|
18711
|
-
|
|
18712
|
-
|
|
18713
|
-
|
|
18714
|
-
severity: external_exports.enum(["error", "info"]),
|
|
18715
|
-
blocking: external_exports.boolean(),
|
|
18716
|
-
code: external_exports.string().min(1),
|
|
18717
|
-
message: external_exports.string().min(1),
|
|
18718
|
-
action: external_exports.enum(["create", "update", "unchanged"]),
|
|
18719
|
-
kind: external_exports.enum([
|
|
18720
|
-
RESOURCE_KIND_CONNECTION,
|
|
18721
|
-
RESOURCE_KIND_ENVIRONMENT,
|
|
18722
|
-
RESOURCE_KIND_IDENTITY,
|
|
18723
|
-
RESOURCE_KIND_AGENT
|
|
18724
|
-
]),
|
|
18725
|
-
name: external_exports.string().min(1)
|
|
18726
|
-
});
|
|
18727
|
-
ProjectApplyResponsePrunedSchema = external_exports.object({
|
|
18728
|
-
kind: external_exports.enum(PROJECT_RESOURCE_KINDS),
|
|
18729
|
-
name: external_exports.string().min(1),
|
|
18730
|
-
uid: external_exports.string().min(1),
|
|
18731
|
-
heartbeatScheduleIds: external_exports.array(external_exports.string().min(1)).optional()
|
|
18732
|
-
});
|
|
18733
|
-
ProjectApplyPlanDiffSchema = external_exports.object({
|
|
18734
|
-
action: external_exports.enum(["add", "remove", "change"]),
|
|
18735
|
-
path: external_exports.string().min(1)
|
|
18736
|
-
});
|
|
18737
|
-
ProjectApplyResponseSchema = external_exports.object({
|
|
18738
|
-
dryRun: external_exports.boolean().default(false),
|
|
18739
|
-
resources: external_exports.array(ProjectAppliedResourceSchema),
|
|
18740
|
-
triggers: external_exports.array(ApplyTriggerReceiptSchema).default([]),
|
|
18741
|
-
diagnostics: external_exports.array(ProjectApplyDiagnosticSchema).default([]),
|
|
18742
|
-
plan: external_exports.array(
|
|
18743
|
-
external_exports.object({
|
|
18744
|
-
action: external_exports.enum(["create", "update", "unchanged", "archive"]),
|
|
18745
|
-
kind: external_exports.enum(PROJECT_RESOURCE_KINDS),
|
|
18746
|
-
name: external_exports.string().min(1),
|
|
18747
|
-
uid: external_exports.string().min(1).optional(),
|
|
18748
|
-
diff: external_exports.array(ProjectApplyPlanDiffSchema).optional(),
|
|
18749
|
-
diffOmitted: external_exports.number().int().positive().optional()
|
|
18750
|
-
})
|
|
18751
|
-
).default([]),
|
|
18752
|
-
pruned: external_exports.array(ProjectApplyResponsePrunedSchema).default([])
|
|
18753
|
-
});
|
|
18754
|
-
ProjectResourceApplyResultSchema = ProjectApplyResponseSchema.extend({
|
|
18755
|
-
heartbeatSchedules: external_exports.array(
|
|
18756
|
-
external_exports.object({
|
|
18757
|
-
scheduleId: external_exports.string().trim().min(1),
|
|
18758
|
-
cron: external_exports.string().trim().min(1),
|
|
18759
|
-
timezone: external_exports.string().trim().min(1),
|
|
18760
|
-
input: HeartbeatTickWorkflowInputSchema
|
|
18761
|
-
})
|
|
18762
|
-
).default([]),
|
|
18763
|
-
deletedHeartbeatScheduleIds: external_exports.array(external_exports.string().trim().min(1)).default([])
|
|
18764
|
-
});
|
|
18765
|
-
ProjectResourceApplyAuditActionSchema = external_exports.enum([
|
|
18766
|
-
"project_resources.apply",
|
|
18767
|
-
"github_sync.apply"
|
|
18611
|
+
RunResolutionPolicySchema = external_exports.enum([
|
|
18612
|
+
"singletonLiveRun",
|
|
18613
|
+
"latestLiveRun",
|
|
18614
|
+
"latestRun"
|
|
18768
18615
|
]);
|
|
18769
|
-
|
|
18770
|
-
|
|
18771
|
-
|
|
18772
|
-
|
|
18773
|
-
|
|
18774
|
-
|
|
18775
|
-
ProjectResourceApplyWorkflowErrorSchema = external_exports.object({
|
|
18776
|
-
name: external_exports.string().trim().min(1),
|
|
18777
|
-
message: external_exports.string().trim().min(1)
|
|
18616
|
+
AgentAddressedCommandTargetSchema = external_exports.object({
|
|
18617
|
+
agentId: AgentIdSchema.optional(),
|
|
18618
|
+
agentName: external_exports.string().trim().min(1).optional(),
|
|
18619
|
+
resolutionPolicy: RunResolutionPolicySchema
|
|
18620
|
+
}).refine((value) => Boolean(value.agentId) !== Boolean(value.agentName), {
|
|
18621
|
+
message: "Provide exactly one of agentId or agentName"
|
|
18778
18622
|
});
|
|
18779
|
-
|
|
18780
|
-
|
|
18781
|
-
|
|
18782
|
-
|
|
18783
|
-
|
|
18784
|
-
|
|
18785
|
-
|
|
18786
|
-
|
|
18787
|
-
|
|
18788
|
-
|
|
18789
|
-
|
|
18790
|
-
|
|
18791
|
-
|
|
18792
|
-
|
|
18793
|
-
message: "exactly one of request or sourceRequest is required"
|
|
18794
|
-
});
|
|
18795
|
-
}
|
|
18623
|
+
SessionCommandRecordBaseSchema = external_exports.object({
|
|
18624
|
+
id: SessionCommandIdSchema,
|
|
18625
|
+
sessionId: SessionIdSchema,
|
|
18626
|
+
sender: SessionCommandSenderSchema,
|
|
18627
|
+
idempotencyKey: external_exports.string().min(1).nullable(),
|
|
18628
|
+
status: SessionCommandStatusSchema,
|
|
18629
|
+
attemptCount: external_exports.number().int().nonnegative(),
|
|
18630
|
+
nextAttemptAt: external_exports.string().datetime().nullable(),
|
|
18631
|
+
lastAttemptAt: external_exports.string().datetime().nullable(),
|
|
18632
|
+
acceptedAt: external_exports.string().datetime().nullable(),
|
|
18633
|
+
failedAt: external_exports.string().datetime().nullable(),
|
|
18634
|
+
error: JsonValueSchema.nullable(),
|
|
18635
|
+
createdAt: external_exports.string().datetime(),
|
|
18636
|
+
updatedAt: external_exports.string().datetime()
|
|
18796
18637
|
});
|
|
18797
|
-
|
|
18798
|
-
"
|
|
18638
|
+
RunStartCommandPayloadSchema = external_exports.object({
|
|
18639
|
+
kind: external_exports.literal("start")
|
|
18640
|
+
}).strict();
|
|
18641
|
+
RunStartWithMessageCommandPayloadSchema = external_exports.object({
|
|
18642
|
+
kind: external_exports.literal("startWithMessage"),
|
|
18643
|
+
message: external_exports.string().trim().min(1)
|
|
18644
|
+
}).strict();
|
|
18645
|
+
SessionPersistedCommandPayloadSchema = external_exports.union([
|
|
18646
|
+
RunMessageCommandPayloadSchema,
|
|
18647
|
+
RunAnswerCommandPayloadSchema,
|
|
18648
|
+
RunLifecycleCommandPayloadSchema,
|
|
18649
|
+
RunStopCommandPayloadSchema,
|
|
18650
|
+
RunStartCommandPayloadSchema,
|
|
18651
|
+
RunStartWithMessageCommandPayloadSchema
|
|
18652
|
+
]);
|
|
18653
|
+
SessionCommandRecordSchema = external_exports.discriminatedUnion("kind", [
|
|
18654
|
+
SessionCommandRecordBaseSchema.extend({
|
|
18655
|
+
kind: external_exports.literal("message"),
|
|
18656
|
+
payload: RunMessageCommandPayloadSchema
|
|
18657
|
+
}),
|
|
18658
|
+
SessionCommandRecordBaseSchema.extend({
|
|
18659
|
+
kind: external_exports.literal("answer"),
|
|
18660
|
+
payload: RunAnswerCommandPayloadSchema
|
|
18661
|
+
}),
|
|
18662
|
+
SessionCommandRecordBaseSchema.extend({
|
|
18663
|
+
kind: external_exports.literal("pause"),
|
|
18664
|
+
payload: RunLifecycleCommandPayloadSchema
|
|
18665
|
+
}),
|
|
18666
|
+
SessionCommandRecordBaseSchema.extend({
|
|
18667
|
+
kind: external_exports.literal("resume"),
|
|
18668
|
+
payload: RunLifecycleCommandPayloadSchema
|
|
18669
|
+
}),
|
|
18670
|
+
SessionCommandRecordBaseSchema.extend({
|
|
18671
|
+
kind: external_exports.literal("interrupt"),
|
|
18672
|
+
payload: RunLifecycleCommandPayloadSchema
|
|
18673
|
+
}),
|
|
18674
|
+
SessionCommandRecordBaseSchema.extend({
|
|
18675
|
+
kind: external_exports.literal("cancel"),
|
|
18676
|
+
payload: RunLifecycleCommandPayloadSchema
|
|
18677
|
+
}),
|
|
18678
|
+
SessionCommandRecordBaseSchema.extend({
|
|
18679
|
+
kind: external_exports.literal("stop"),
|
|
18680
|
+
payload: RunStopCommandPayloadSchema
|
|
18681
|
+
}),
|
|
18682
|
+
SessionCommandRecordBaseSchema.extend({
|
|
18683
|
+
kind: external_exports.literal("start"),
|
|
18684
|
+
payload: RunStartCommandPayloadSchema
|
|
18685
|
+
}),
|
|
18686
|
+
SessionCommandRecordBaseSchema.extend({
|
|
18687
|
+
kind: external_exports.literal("startWithMessage"),
|
|
18688
|
+
payload: RunStartWithMessageCommandPayloadSchema
|
|
18689
|
+
})
|
|
18690
|
+
]);
|
|
18691
|
+
SessionDispatchMessageCommandPayloadSchema = external_exports.object({
|
|
18692
|
+
kind: external_exports.literal("message"),
|
|
18693
|
+
message: external_exports.string().trim().min(1)
|
|
18694
|
+
}).strict();
|
|
18695
|
+
SessionDispatchAnswerCommandPayloadSchema = external_exports.object({
|
|
18696
|
+
kind: external_exports.literal("answer"),
|
|
18697
|
+
toolCallId: external_exports.string().trim().min(1),
|
|
18698
|
+
answers: external_exports.record(external_exports.string(), external_exports.string()),
|
|
18699
|
+
response: external_exports.string().trim().min(1).optional()
|
|
18700
|
+
}).strict();
|
|
18701
|
+
SessionDispatchStopCommandPayloadSchema = external_exports.object({
|
|
18702
|
+
kind: external_exports.literal("stop"),
|
|
18703
|
+
reason: external_exports.string().trim().min(1).optional()
|
|
18704
|
+
}).strict();
|
|
18705
|
+
SessionDispatchCommandPayloadSchema = external_exports.discriminatedUnion(
|
|
18706
|
+
"kind",
|
|
18799
18707
|
[
|
|
18800
|
-
|
|
18801
|
-
|
|
18802
|
-
|
|
18803
|
-
|
|
18804
|
-
|
|
18805
|
-
status: external_exports.literal("failed"),
|
|
18806
|
-
error: ProjectResourceApplyWorkflowErrorSchema
|
|
18807
|
-
})
|
|
18708
|
+
RunStartCommandPayloadSchema,
|
|
18709
|
+
RunStartWithMessageCommandPayloadSchema,
|
|
18710
|
+
SessionDispatchMessageCommandPayloadSchema,
|
|
18711
|
+
SessionDispatchAnswerCommandPayloadSchema,
|
|
18712
|
+
SessionDispatchStopCommandPayloadSchema
|
|
18808
18713
|
]
|
|
18809
18714
|
);
|
|
18715
|
+
SessionDispatchCommandRecordBaseSchema = external_exports.object({
|
|
18716
|
+
id: SessionCommandIdSchema,
|
|
18717
|
+
sessionId: SessionIdSchema,
|
|
18718
|
+
sender: SessionCommandSenderSchema,
|
|
18719
|
+
idempotencyKey: external_exports.string().min(1).nullable(),
|
|
18720
|
+
status: SessionDispatchCommandStatusSchema,
|
|
18721
|
+
attemptCount: external_exports.number().int().nonnegative(),
|
|
18722
|
+
nextAttemptAt: external_exports.string().datetime().nullable(),
|
|
18723
|
+
lastAttemptAt: external_exports.string().datetime().nullable(),
|
|
18724
|
+
acceptedAt: external_exports.string().datetime().nullable(),
|
|
18725
|
+
failedAt: external_exports.string().datetime().nullable(),
|
|
18726
|
+
error: JsonValueSchema.nullable(),
|
|
18727
|
+
createdAt: external_exports.string().datetime(),
|
|
18728
|
+
updatedAt: external_exports.string().datetime()
|
|
18729
|
+
});
|
|
18730
|
+
SessionDispatchCommandRecordSchema = external_exports.discriminatedUnion("kind", [
|
|
18731
|
+
SessionDispatchCommandRecordBaseSchema.extend({
|
|
18732
|
+
kind: external_exports.literal("start"),
|
|
18733
|
+
payload: RunStartCommandPayloadSchema
|
|
18734
|
+
}),
|
|
18735
|
+
SessionDispatchCommandRecordBaseSchema.extend({
|
|
18736
|
+
kind: external_exports.literal("startWithMessage"),
|
|
18737
|
+
payload: RunStartWithMessageCommandPayloadSchema
|
|
18738
|
+
}),
|
|
18739
|
+
SessionDispatchCommandRecordBaseSchema.extend({
|
|
18740
|
+
kind: external_exports.literal("message"),
|
|
18741
|
+
payload: SessionDispatchMessageCommandPayloadSchema
|
|
18742
|
+
}),
|
|
18743
|
+
SessionDispatchCommandRecordBaseSchema.extend({
|
|
18744
|
+
kind: external_exports.literal("answer"),
|
|
18745
|
+
payload: SessionDispatchAnswerCommandPayloadSchema
|
|
18746
|
+
}),
|
|
18747
|
+
SessionDispatchCommandRecordBaseSchema.extend({
|
|
18748
|
+
kind: external_exports.literal("stop"),
|
|
18749
|
+
payload: SessionDispatchStopCommandPayloadSchema
|
|
18750
|
+
})
|
|
18751
|
+
]);
|
|
18810
18752
|
}
|
|
18811
18753
|
});
|
|
18812
18754
|
|
|
18813
|
-
// ../../packages/schemas/src/
|
|
18814
|
-
|
|
18815
|
-
|
|
18816
|
-
|
|
18817
|
-
|
|
18818
|
-
|
|
18819
|
-
|
|
18820
|
-
|
|
18821
|
-
|
|
18822
|
-
|
|
18823
|
-
// ../../packages/schemas/src/session-diagnostics.ts
|
|
18824
|
-
var SESSION_DIAGNOSTIC_REALTIME_EVENT, SESSION_DIAGNOSTIC_LEVELS, SESSION_DIAGNOSTIC_SOURCES, SESSION_DIAGNOSTIC_PHASES, SESSION_DIAGNOSTIC_STATUSES, SessionDiagnosticLevelSchema, SessionDiagnosticSourceSchema, SessionDiagnosticPhaseSchema, SessionDiagnosticStatusSchema, SessionDiagnosticEventSchema;
|
|
18825
|
-
var init_session_diagnostics = __esm({
|
|
18826
|
-
"../../packages/schemas/src/session-diagnostics.ts"() {
|
|
18755
|
+
// ../../packages/schemas/src/sessions.ts
|
|
18756
|
+
function isSessionTerminalStatus(status) {
|
|
18757
|
+
return SESSION_TERMINAL_STATUSES.some(
|
|
18758
|
+
(terminalStatus) => terminalStatus === status
|
|
18759
|
+
);
|
|
18760
|
+
}
|
|
18761
|
+
var SESSION_STATUSES, SESSION_RUNTIME_PHASES, SESSION_TERMINAL_STATUSES, SESSION_DISPLAY_TITLE_MAX_LENGTH, SESSION_MESSAGE_ROLES, SESSION_MESSAGE_STATUSES, SessionStatusSchema, SessionRuntimePhaseSchema, SessionMessageRoleSchema, SessionMessageStatusSchema, RunDisplayTitleSchema, AmbientStatusSchema, SESSION_CHECK_STATUSES, SESSION_CHECK_CONCLUSIONS, SESSION_CHECK_TIMEOUT_PHASES, SessionCheckStatusSchema, SessionCheckConclusionSchema, SessionCheckTimeoutPhaseSchema, ManualSessionRequestSchema, SessionArchiveRequestSchema, SessionsArchiveRequestSchema, SessionRecordSchema, SessionMessageOriginSchema, SessionUiMessageRecordSchema, SessionListItemAgentSchema, SessionListItemSchema, SessionListResponseSchema, SessionsArchiveResponseSchema;
|
|
18762
|
+
var init_sessions = __esm({
|
|
18763
|
+
"../../packages/schemas/src/sessions.ts"() {
|
|
18827
18764
|
"use strict";
|
|
18828
18765
|
init_zod();
|
|
18766
|
+
init_agents();
|
|
18767
|
+
init_auth();
|
|
18768
|
+
init_environments();
|
|
18829
18769
|
init_ids();
|
|
18830
18770
|
init_primitives();
|
|
18831
|
-
|
|
18832
|
-
|
|
18833
|
-
|
|
18834
|
-
"
|
|
18835
|
-
"
|
|
18836
|
-
"
|
|
18771
|
+
init_session_commands();
|
|
18772
|
+
init_tools();
|
|
18773
|
+
SESSION_STATUSES = [
|
|
18774
|
+
"queued",
|
|
18775
|
+
"running",
|
|
18776
|
+
"awaiting",
|
|
18777
|
+
"failed",
|
|
18778
|
+
"stopped"
|
|
18837
18779
|
];
|
|
18838
|
-
|
|
18839
|
-
"
|
|
18840
|
-
"
|
|
18841
|
-
"
|
|
18842
|
-
"
|
|
18843
|
-
"
|
|
18780
|
+
SESSION_RUNTIME_PHASES = [
|
|
18781
|
+
"building_image",
|
|
18782
|
+
"booting_container",
|
|
18783
|
+
"preparing_environment",
|
|
18784
|
+
"starting_runtime",
|
|
18785
|
+
"running"
|
|
18844
18786
|
];
|
|
18845
|
-
|
|
18846
|
-
|
|
18847
|
-
|
|
18848
|
-
|
|
18849
|
-
"
|
|
18850
|
-
"
|
|
18851
|
-
"
|
|
18787
|
+
SESSION_TERMINAL_STATUSES = ["failed", "stopped"];
|
|
18788
|
+
SESSION_DISPLAY_TITLE_MAX_LENGTH = 64;
|
|
18789
|
+
SESSION_MESSAGE_ROLES = ["system", "user", "assistant"];
|
|
18790
|
+
SESSION_MESSAGE_STATUSES = [
|
|
18791
|
+
"in_progress",
|
|
18792
|
+
"completed",
|
|
18793
|
+
"failed"
|
|
18852
18794
|
];
|
|
18853
|
-
|
|
18854
|
-
|
|
18855
|
-
|
|
18856
|
-
|
|
18857
|
-
|
|
18858
|
-
|
|
18795
|
+
SessionStatusSchema = external_exports.enum(SESSION_STATUSES);
|
|
18796
|
+
SessionRuntimePhaseSchema = external_exports.enum(SESSION_RUNTIME_PHASES);
|
|
18797
|
+
SessionMessageRoleSchema = external_exports.enum(SESSION_MESSAGE_ROLES);
|
|
18798
|
+
SessionMessageStatusSchema = external_exports.enum(SESSION_MESSAGE_STATUSES);
|
|
18799
|
+
RunDisplayTitleSchema = external_exports.string().trim().max(SESSION_DISPLAY_TITLE_MAX_LENGTH);
|
|
18800
|
+
AmbientStatusSchema = external_exports.string().trim().min(1);
|
|
18801
|
+
SESSION_CHECK_STATUSES = [
|
|
18802
|
+
"queued",
|
|
18803
|
+
"in_progress",
|
|
18804
|
+
"completed"
|
|
18859
18805
|
];
|
|
18860
|
-
|
|
18861
|
-
|
|
18862
|
-
|
|
18863
|
-
|
|
18864
|
-
|
|
18806
|
+
SESSION_CHECK_CONCLUSIONS = ["success", "failure"];
|
|
18807
|
+
SESSION_CHECK_TIMEOUT_PHASES = ["begin", "complete"];
|
|
18808
|
+
SessionCheckStatusSchema = external_exports.enum(SESSION_CHECK_STATUSES);
|
|
18809
|
+
SessionCheckConclusionSchema = external_exports.enum(SESSION_CHECK_CONCLUSIONS);
|
|
18810
|
+
SessionCheckTimeoutPhaseSchema = external_exports.enum(
|
|
18811
|
+
SESSION_CHECK_TIMEOUT_PHASES
|
|
18865
18812
|
);
|
|
18866
|
-
|
|
18867
|
-
|
|
18868
|
-
|
|
18869
|
-
|
|
18870
|
-
|
|
18871
|
-
|
|
18872
|
-
|
|
18873
|
-
|
|
18874
|
-
|
|
18875
|
-
|
|
18876
|
-
|
|
18877
|
-
|
|
18878
|
-
|
|
18879
|
-
|
|
18880
|
-
|
|
18881
|
-
|
|
18882
|
-
|
|
18813
|
+
ManualSessionRequestSchema = external_exports.object({
|
|
18814
|
+
message: external_exports.string().trim().min(1).max(2e4).optional(),
|
|
18815
|
+
interactive: external_exports.boolean().optional(),
|
|
18816
|
+
/**
|
|
18817
|
+
* Deliver the agent's configured `initialPrompt` as the session's kickoff
|
|
18818
|
+
* message so the agent opens the conversation. Agents without an
|
|
18819
|
+
* `initialPrompt` fall back to the default manual say-hello message, so a
|
|
18820
|
+
* kickoff always pings the agent. The kickoff is delivered through the
|
|
18821
|
+
* session's one idempotent start command and never renders as a user chat
|
|
18822
|
+
* bubble; the agent's greeting is the first visible content.
|
|
18823
|
+
*/
|
|
18824
|
+
kickoff: external_exports.boolean().optional()
|
|
18825
|
+
});
|
|
18826
|
+
SessionArchiveRequestSchema = external_exports.object({
|
|
18827
|
+
archived: external_exports.boolean()
|
|
18828
|
+
});
|
|
18829
|
+
SessionsArchiveRequestSchema = external_exports.object({
|
|
18830
|
+
session_ids: external_exports.array(SessionIdSchema).min(1).max(100),
|
|
18831
|
+
archived: external_exports.boolean()
|
|
18832
|
+
});
|
|
18833
|
+
SessionRecordSchema = external_exports.object({
|
|
18834
|
+
id: SessionIdSchema,
|
|
18835
|
+
organizationId: external_exports.string().trim().min(1),
|
|
18836
|
+
projectId: external_exports.string().trim().min(1).nullable(),
|
|
18837
|
+
agentId: AgentIdSchema,
|
|
18838
|
+
runtimeId: RuntimeIdSchema.nullable(),
|
|
18839
|
+
status: SessionStatusSchema,
|
|
18840
|
+
runtimePhase: SessionRuntimePhaseSchema.nullable(),
|
|
18841
|
+
idempotencyKey: external_exports.string().min(1).nullable(),
|
|
18842
|
+
correlationKey: external_exports.string().nullable(),
|
|
18843
|
+
workflowId: external_exports.string().min(1),
|
|
18844
|
+
displayTitle: RunDisplayTitleSchema,
|
|
18845
|
+
ambientStatus: AmbientStatusSchema.nullable(),
|
|
18846
|
+
ambientStatusUpdatedAt: external_exports.string().datetime().nullable(),
|
|
18847
|
+
starterActor: AuthActorSchema.nullable(),
|
|
18848
|
+
snapshot: AgentResourceSchema,
|
|
18849
|
+
environmentSnapshot: EnvironmentResourceSchema,
|
|
18850
|
+
toolSnapshots: external_exports.array(
|
|
18851
|
+
external_exports.object({
|
|
18852
|
+
source: external_exports.literal("inline"),
|
|
18853
|
+
alias: ToolAliasSchema,
|
|
18854
|
+
spec: RemoteMcpToolSchema.or(ConnectionBackedToolSchema).or(LocalToolSchema).or(GithubToolSchema)
|
|
18855
|
+
})
|
|
18856
|
+
),
|
|
18857
|
+
input: JsonValueSchema,
|
|
18858
|
+
createdAt: external_exports.string().datetime(),
|
|
18859
|
+
updatedAt: external_exports.string().datetime(),
|
|
18860
|
+
lastActivityAt: external_exports.string().datetime(),
|
|
18861
|
+
startedAt: external_exports.string().datetime().nullable(),
|
|
18862
|
+
finishedAt: external_exports.string().datetime().nullable(),
|
|
18863
|
+
archivedAt: external_exports.string().datetime().nullable(),
|
|
18864
|
+
error: JsonValueSchema.nullable()
|
|
18865
|
+
});
|
|
18866
|
+
SessionMessageOriginSchema = external_exports.object({
|
|
18867
|
+
eventKey: external_exports.string().trim().min(1),
|
|
18868
|
+
provider: external_exports.string().trim().min(1).nullable().default(null)
|
|
18869
|
+
});
|
|
18870
|
+
SessionUiMessageRecordSchema = external_exports.object({
|
|
18871
|
+
id: external_exports.string().trim().min(1),
|
|
18872
|
+
sessionId: SessionIdSchema,
|
|
18873
|
+
sequence: external_exports.number().int().nonnegative(),
|
|
18874
|
+
messageId: external_exports.string().trim().min(1),
|
|
18875
|
+
commandId: external_exports.string().trim().min(1).nullable(),
|
|
18876
|
+
turnId: external_exports.string().trim().min(1).nullable(),
|
|
18877
|
+
role: SessionMessageRoleSchema,
|
|
18878
|
+
status: SessionMessageStatusSchema,
|
|
18879
|
+
message: JsonValueSchema,
|
|
18880
|
+
// The sender of the command that carried this message into the session
|
|
18881
|
+
// (operator chat send, trigger delivery, or another agent's session), joined
|
|
18882
|
+
// from session_commands at read time. Null for messages that did not arrive
|
|
18883
|
+
// through a command, such as assistant output.
|
|
18884
|
+
sender: SessionCommandSenderSchema.nullable().default(null),
|
|
18885
|
+
// For trigger deliveries, the routed event behind the carrying command:
|
|
18886
|
+
// its event key plus the originating provider connection when known
|
|
18887
|
+
// (e.g. "slack" for a subscribed-thread reply, "github" for a check event).
|
|
18888
|
+
origin: SessionMessageOriginSchema.nullable().default(null),
|
|
18889
|
+
streamCursor: external_exports.number().int().positive().nullable().default(null),
|
|
18890
|
+
createdAt: external_exports.string().datetime(),
|
|
18891
|
+
updatedAt: external_exports.string().datetime(),
|
|
18892
|
+
completedAt: external_exports.string().datetime().nullable()
|
|
18893
|
+
});
|
|
18894
|
+
SessionListItemAgentSchema = external_exports.object({
|
|
18895
|
+
name: external_exports.string(),
|
|
18896
|
+
displayName: external_exports.string().nullable(),
|
|
18897
|
+
username: external_exports.string().nullable(),
|
|
18898
|
+
avatarSha256: external_exports.string().nullable()
|
|
18899
|
+
});
|
|
18900
|
+
SessionListItemSchema = external_exports.object({
|
|
18901
|
+
id: SessionIdSchema,
|
|
18902
|
+
agentId: AgentIdSchema,
|
|
18903
|
+
status: SessionStatusSchema,
|
|
18904
|
+
runtimePhase: SessionRuntimePhaseSchema.nullable(),
|
|
18905
|
+
displayTitle: RunDisplayTitleSchema,
|
|
18906
|
+
summary: external_exports.string(),
|
|
18907
|
+
agent: SessionListItemAgentSchema,
|
|
18908
|
+
createdAt: external_exports.string().datetime(),
|
|
18909
|
+
updatedAt: external_exports.string().datetime(),
|
|
18910
|
+
archivedAt: external_exports.string().datetime().nullable(),
|
|
18911
|
+
lastActivityAt: external_exports.string().datetime()
|
|
18912
|
+
});
|
|
18913
|
+
SessionListResponseSchema = external_exports.object({
|
|
18914
|
+
sessions: external_exports.array(SessionListItemSchema),
|
|
18915
|
+
/**
|
|
18916
|
+
* Opaque keyset cursor for the next page, or `null` when the list is
|
|
18917
|
+
* exhausted. Replay it on the next request to append the following page; it is
|
|
18918
|
+
* minted for a specific sort and rejected against a different one.
|
|
18919
|
+
*/
|
|
18920
|
+
nextCursor: external_exports.string().nullable(),
|
|
18921
|
+
hasMore: external_exports.boolean()
|
|
18922
|
+
});
|
|
18923
|
+
SessionsArchiveResponseSchema = external_exports.object({
|
|
18924
|
+
archived: external_exports.boolean(),
|
|
18925
|
+
sessions: external_exports.array(SessionRecordSchema)
|
|
18883
18926
|
});
|
|
18884
18927
|
}
|
|
18885
18928
|
});
|
|
18886
18929
|
|
|
18887
|
-
// ../../packages/schemas/src/
|
|
18888
|
-
var
|
|
18889
|
-
var
|
|
18890
|
-
"../../packages/schemas/src/
|
|
18930
|
+
// ../../packages/schemas/src/live-events.ts
|
|
18931
|
+
var LiveEntityEventEnvelopeSchema;
|
|
18932
|
+
var init_live_events = __esm({
|
|
18933
|
+
"../../packages/schemas/src/live-events.ts"() {
|
|
18891
18934
|
"use strict";
|
|
18892
18935
|
init_zod();
|
|
18893
|
-
|
|
18894
|
-
|
|
18895
|
-
|
|
18896
|
-
|
|
18897
|
-
|
|
18898
|
-
|
|
18899
|
-
|
|
18900
|
-
|
|
18901
|
-
|
|
18902
|
-
|
|
18903
|
-
|
|
18936
|
+
init_primitives();
|
|
18937
|
+
init_sessions();
|
|
18938
|
+
LiveEntityEventEnvelopeSchema = external_exports.object({
|
|
18939
|
+
// Replay cursor for this frame; the SSE `id:` mirrors it so reconnects resume
|
|
18940
|
+
// from `sequence > cursor`.
|
|
18941
|
+
sequence: external_exports.number().int().nonnegative(),
|
|
18942
|
+
eventKey: external_exports.string().min(1),
|
|
18943
|
+
// The event's `subjectKind`, surfaced as `entity` for client-side dispatch.
|
|
18944
|
+
entity: external_exports.string().min(1),
|
|
18945
|
+
subjectId: external_exports.string().min(1),
|
|
18946
|
+
payload: JsonValueSchema,
|
|
18947
|
+
occurredAt: external_exports.string().min(1)
|
|
18948
|
+
});
|
|
18949
|
+
}
|
|
18950
|
+
});
|
|
18951
|
+
|
|
18952
|
+
// ../../packages/schemas/src/mcp.ts
|
|
18953
|
+
var McpToolCallMessageSchema, McpJsonRpcMessageSchema, McpPostBodySchema;
|
|
18954
|
+
var init_mcp = __esm({
|
|
18955
|
+
"../../packages/schemas/src/mcp.ts"() {
|
|
18956
|
+
"use strict";
|
|
18957
|
+
init_zod();
|
|
18958
|
+
McpToolCallMessageSchema = external_exports.object({
|
|
18959
|
+
method: external_exports.literal("tools/call"),
|
|
18960
|
+
params: external_exports.object({
|
|
18961
|
+
name: external_exports.string().trim().min(1)
|
|
18904
18962
|
})
|
|
18905
18963
|
});
|
|
18964
|
+
McpJsonRpcMessageSchema = external_exports.object({
|
|
18965
|
+
method: external_exports.string().optional()
|
|
18966
|
+
}).passthrough();
|
|
18967
|
+
McpPostBodySchema = external_exports.union([McpJsonRpcMessageSchema, external_exports.array(McpJsonRpcMessageSchema)]).transform((body) => Array.isArray(body) ? body : [body]);
|
|
18906
18968
|
}
|
|
18907
18969
|
});
|
|
18908
18970
|
|
|
18909
|
-
// ../../packages/schemas/src/
|
|
18910
|
-
|
|
18911
|
-
|
|
18912
|
-
|
|
18971
|
+
// ../../packages/schemas/src/pricing.ts
|
|
18972
|
+
function tier(inputUsdPerMtok, outputUsdPerMtok) {
|
|
18973
|
+
return {
|
|
18974
|
+
inputUsdPerMtok,
|
|
18975
|
+
outputUsdPerMtok,
|
|
18976
|
+
cacheWrite5mUsdPerMtok: inputUsdPerMtok * 1.25,
|
|
18977
|
+
cacheReadUsdPerMtok: inputUsdPerMtok * 0.1
|
|
18978
|
+
};
|
|
18979
|
+
}
|
|
18980
|
+
function opusTier() {
|
|
18981
|
+
return tier(5, 25);
|
|
18982
|
+
}
|
|
18983
|
+
function openAiTier(rates) {
|
|
18984
|
+
return {
|
|
18985
|
+
inputUsdPerMtok: rates.input,
|
|
18986
|
+
outputUsdPerMtok: rates.output,
|
|
18987
|
+
cacheWrite5mUsdPerMtok: rates.input,
|
|
18988
|
+
cacheReadUsdPerMtok: rates.cachedInput
|
|
18989
|
+
};
|
|
18990
|
+
}
|
|
18991
|
+
var RATE_CARD_2026_06_23, PRICING_RATE_CARDS, CURRENT_PRICING_VERSION;
|
|
18992
|
+
var init_pricing = __esm({
|
|
18993
|
+
"../../packages/schemas/src/pricing.ts"() {
|
|
18994
|
+
"use strict";
|
|
18995
|
+
RATE_CARD_2026_06_23 = {
|
|
18996
|
+
version: "2026-06-23",
|
|
18997
|
+
effectiveAt: "2026-06-23T00:00:00.000Z",
|
|
18998
|
+
models: {
|
|
18999
|
+
"claude-opus-4-8": opusTier(),
|
|
19000
|
+
"claude-opus-4-7": opusTier(),
|
|
19001
|
+
"claude-opus-4-6": opusTier(),
|
|
19002
|
+
"claude-sonnet-4-6": tier(3, 15),
|
|
19003
|
+
"claude-haiku-4-5": tier(1, 5),
|
|
19004
|
+
"claude-haiku-4-5-20251001": tier(1, 5),
|
|
19005
|
+
"claude-fable-5": tier(10, 50),
|
|
19006
|
+
// OpenAI gpt-5.3-codex, standard tier: input $1.75/Mtok, cached input
|
|
19007
|
+
// $0.175/Mtok, output $14.00/Mtok. Source (verified 2026-06-23):
|
|
19008
|
+
// https://developers.openai.com/api/docs/models/gpt-5.3-codex and
|
|
19009
|
+
// https://developers.openai.com/api/docs/pricing (priority tier is 2x; we
|
|
19010
|
+
// bill standard).
|
|
19011
|
+
"gpt-5.3-codex": openAiTier({
|
|
19012
|
+
input: 1.75,
|
|
19013
|
+
cachedInput: 0.175,
|
|
19014
|
+
output: 14
|
|
19015
|
+
})
|
|
19016
|
+
}
|
|
19017
|
+
};
|
|
19018
|
+
PRICING_RATE_CARDS = {
|
|
19019
|
+
[RATE_CARD_2026_06_23.version]: RATE_CARD_2026_06_23
|
|
19020
|
+
};
|
|
19021
|
+
CURRENT_PRICING_VERSION = RATE_CARD_2026_06_23.version;
|
|
19022
|
+
}
|
|
19023
|
+
});
|
|
19024
|
+
|
|
19025
|
+
// ../../packages/schemas/src/project-service-accounts.ts
|
|
19026
|
+
var ProjectServiceAccountSchema, ProjectServiceAccountCreateRequestSchema, ProjectServiceAccountUpdateRequestSchema, ProjectServiceAccountTokenResponseSchema, ProjectServiceAccountUpdateResponseSchema, ProjectServiceAccountRemoveResponseSchema, ProjectServiceAccountListResponseSchema;
|
|
19027
|
+
var init_project_service_accounts = __esm({
|
|
19028
|
+
"../../packages/schemas/src/project-service-accounts.ts"() {
|
|
18913
19029
|
"use strict";
|
|
18914
19030
|
init_zod();
|
|
18915
19031
|
init_auth();
|
|
18916
19032
|
init_ids();
|
|
18917
|
-
|
|
18918
|
-
|
|
18919
|
-
|
|
18920
|
-
|
|
18921
|
-
|
|
18922
|
-
|
|
18923
|
-
|
|
18924
|
-
|
|
18925
|
-
|
|
18926
|
-
|
|
18927
|
-
|
|
18928
|
-
|
|
18929
|
-
|
|
18930
|
-
|
|
18931
|
-
|
|
18932
|
-
|
|
18933
|
-
|
|
18934
|
-
|
|
18935
|
-
|
|
18936
|
-
|
|
18937
|
-
|
|
18938
|
-
|
|
18939
|
-
|
|
18940
|
-
|
|
18941
|
-
|
|
18942
|
-
|
|
18943
|
-
|
|
18944
|
-
|
|
18945
|
-
|
|
18946
|
-
|
|
18947
|
-
|
|
18948
|
-
|
|
18949
|
-
|
|
18950
|
-
|
|
18951
|
-
|
|
18952
|
-
|
|
18953
|
-
|
|
18954
|
-
|
|
18955
|
-
|
|
18956
|
-
|
|
18957
|
-
|
|
18958
|
-
|
|
18959
|
-
|
|
18960
|
-
|
|
18961
|
-
|
|
18962
|
-
|
|
18963
|
-
|
|
18964
|
-
|
|
18965
|
-
|
|
18966
|
-
|
|
18967
|
-
|
|
18968
|
-
|
|
18969
|
-
|
|
18970
|
-
|
|
19033
|
+
init_resources();
|
|
19034
|
+
ProjectServiceAccountSchema = external_exports.object({
|
|
19035
|
+
id: ServiceAccountIdSchema,
|
|
19036
|
+
organizationId: OrganizationIdSchema,
|
|
19037
|
+
projectId: ProjectIdSchema,
|
|
19038
|
+
name: ResourceNameSchema,
|
|
19039
|
+
scopes: external_exports.array(AuthScopeSchema),
|
|
19040
|
+
createdAt: external_exports.string().datetime()
|
|
19041
|
+
});
|
|
19042
|
+
ProjectServiceAccountCreateRequestSchema = external_exports.object({
|
|
19043
|
+
name: ResourceNameSchema,
|
|
19044
|
+
scopes: external_exports.array(AuthScopeSchema).min(1)
|
|
19045
|
+
});
|
|
19046
|
+
ProjectServiceAccountUpdateRequestSchema = external_exports.object({
|
|
19047
|
+
scopes: external_exports.array(AuthScopeSchema).min(1)
|
|
19048
|
+
});
|
|
19049
|
+
ProjectServiceAccountTokenResponseSchema = external_exports.object({
|
|
19050
|
+
serviceAccount: ProjectServiceAccountSchema,
|
|
19051
|
+
token: external_exports.string().min(1)
|
|
19052
|
+
});
|
|
19053
|
+
ProjectServiceAccountUpdateResponseSchema = external_exports.object({
|
|
19054
|
+
serviceAccount: ProjectServiceAccountSchema
|
|
19055
|
+
});
|
|
19056
|
+
ProjectServiceAccountRemoveResponseSchema = external_exports.object({
|
|
19057
|
+
serviceAccount: ProjectServiceAccountSchema,
|
|
19058
|
+
removed: external_exports.literal(true)
|
|
19059
|
+
});
|
|
19060
|
+
ProjectServiceAccountListResponseSchema = external_exports.object({
|
|
19061
|
+
serviceAccounts: external_exports.array(ProjectServiceAccountSchema)
|
|
19062
|
+
});
|
|
19063
|
+
}
|
|
19064
|
+
});
|
|
19065
|
+
|
|
19066
|
+
// ../../packages/schemas/src/project-resources.ts
|
|
19067
|
+
function projectApplyBundleStorageKey(sha256) {
|
|
19068
|
+
return `project-apply-bundles/${sha256}.json`;
|
|
19069
|
+
}
|
|
19070
|
+
var EnvironmentApplyDocumentSchema, IdentityApplyDocumentSchema, AgentApplyDocumentSchema, ProjectApplyResourceSchema, PROJECT_RESOURCE_APPLY_ORDER, PROJECT_RESOURCE_KINDS, PROJECT_APPLY_RESOURCE_KINDS, PROJECT_APPLY_BUNDLE_VERSION, MAX_PROJECT_APPLY_BUNDLE_BYTES, PROJECT_APPLY_BUNDLE_CONTENT_TYPE, ProjectDeleteResourceBaseSchema, ProjectDeleteResourceSchema, AVATAR_ASSET_CONTENT_TYPES, MAX_AVATAR_ASSET_BASE64_LENGTH, ProjectApplyAssetSchema, ProjectApplyAssetsSchema, AvatarAssetUploadResponseSchema, ApplyBundlePathSchema, ProjectApplyBundleFileSchema, ProjectApplyBundleSchema, ProjectApplyBundleRefSchema, ProjectApplyBundleUploadRequestSchema, ProjectApplyBundleUploadResponseSchema, ProjectApplyBundleDirectoryEntrypointSchema, ProjectApplyBundleFileEntrypointSchema, ProjectApplyBundleEntrypointSchema, ProjectApplySourceSchema, ProjectApplySourceRequestSchema, ProjectApplyRequestSchema, ProjectApplySystemConfigSchema, ProjectAppliedResourceSchema, ProjectApplyDiagnosticSchema, ProjectApplyResponsePrunedSchema, ProjectApplyPlanDiffSchema, ProjectApplyResponseSchema, ProjectResourceApplyResultSchema, ProjectResourceApplyAuditActionSchema, ProjectResourceApplyOperationIdSchema, ProjectResourceApplyTriggerArtifactSchema, ProjectResourceApplyWorkflowErrorSchema, ProjectResourceApplyWorkflowInputSchema, ProjectResourceApplyWorkflowResultSchema;
|
|
19071
|
+
var init_project_resources = __esm({
|
|
19072
|
+
"../../packages/schemas/src/project-resources.ts"() {
|
|
19073
|
+
"use strict";
|
|
19074
|
+
init_zod();
|
|
19075
|
+
init_agents();
|
|
19076
|
+
init_auth();
|
|
19077
|
+
init_connections();
|
|
19078
|
+
init_environments();
|
|
19079
|
+
init_identities();
|
|
19080
|
+
init_ids();
|
|
19081
|
+
init_primitives();
|
|
19082
|
+
init_resources();
|
|
19083
|
+
init_trigger_router();
|
|
19084
|
+
EnvironmentApplyDocumentSchema = resourceApplyDocumentSchema(
|
|
19085
|
+
RESOURCE_KIND_ENVIRONMENT,
|
|
19086
|
+
EnvironmentApplyRequestSchema.shape.spec
|
|
18971
19087
|
);
|
|
18972
|
-
|
|
18973
|
-
|
|
19088
|
+
IdentityApplyDocumentSchema = resourceApplyDocumentSchema(
|
|
19089
|
+
RESOURCE_KIND_IDENTITY,
|
|
19090
|
+
IdentityApplyRequestSchema.shape.spec
|
|
18974
19091
|
);
|
|
18975
|
-
|
|
18976
|
-
|
|
18977
|
-
|
|
19092
|
+
AgentApplyDocumentSchema = resourceApplyDocumentSchema(
|
|
19093
|
+
RESOURCE_KIND_AGENT,
|
|
19094
|
+
AgentApplyRequestSchema.shape.spec
|
|
18978
19095
|
);
|
|
18979
|
-
|
|
18980
|
-
|
|
18981
|
-
|
|
18982
|
-
|
|
18983
|
-
actor: AuthActorSchema.nullable().optional()
|
|
18984
|
-
}),
|
|
18985
|
-
external_exports.object({
|
|
18986
|
-
type: external_exports.literal("agent"),
|
|
18987
|
-
sessionId: SessionIdSchema
|
|
18988
|
-
}),
|
|
18989
|
-
external_exports.object({
|
|
18990
|
-
type: external_exports.literal("system")
|
|
18991
|
-
})
|
|
19096
|
+
ProjectApplyResourceSchema = external_exports.discriminatedUnion("kind", [
|
|
19097
|
+
EnvironmentApplyDocumentSchema,
|
|
19098
|
+
IdentityApplyDocumentSchema,
|
|
19099
|
+
AgentApplyDocumentSchema
|
|
18992
19100
|
]);
|
|
18993
|
-
|
|
18994
|
-
|
|
18995
|
-
|
|
18996
|
-
|
|
18997
|
-
|
|
18998
|
-
"githubCheckAction",
|
|
18999
|
-
"githubPullRequest",
|
|
19000
|
-
"other"
|
|
19101
|
+
PROJECT_RESOURCE_APPLY_ORDER = [
|
|
19102
|
+
RESOURCE_KIND_CONNECTION,
|
|
19103
|
+
RESOURCE_KIND_IDENTITY,
|
|
19104
|
+
RESOURCE_KIND_ENVIRONMENT,
|
|
19105
|
+
RESOURCE_KIND_AGENT
|
|
19001
19106
|
];
|
|
19002
|
-
|
|
19003
|
-
|
|
19107
|
+
PROJECT_RESOURCE_KINDS = PROJECT_RESOURCE_APPLY_ORDER;
|
|
19108
|
+
PROJECT_APPLY_RESOURCE_KINDS = [
|
|
19109
|
+
RESOURCE_KIND_IDENTITY,
|
|
19110
|
+
RESOURCE_KIND_ENVIRONMENT,
|
|
19111
|
+
RESOURCE_KIND_AGENT
|
|
19112
|
+
];
|
|
19113
|
+
PROJECT_APPLY_BUNDLE_VERSION = 1;
|
|
19114
|
+
MAX_PROJECT_APPLY_BUNDLE_BYTES = 64 * 1024 * 1024;
|
|
19115
|
+
PROJECT_APPLY_BUNDLE_CONTENT_TYPE = "application/vnd.auto.project-apply-bundle+json";
|
|
19116
|
+
ProjectDeleteResourceBaseSchema = external_exports.object({
|
|
19117
|
+
name: external_exports.string().trim().min(1)
|
|
19118
|
+
});
|
|
19119
|
+
ProjectDeleteResourceSchema = ProjectDeleteResourceBaseSchema.extend({
|
|
19120
|
+
kind: external_exports.enum(PROJECT_APPLY_RESOURCE_KINDS)
|
|
19121
|
+
});
|
|
19122
|
+
AVATAR_ASSET_CONTENT_TYPES = ["image/png", "image/jpeg"];
|
|
19123
|
+
MAX_AVATAR_ASSET_BASE64_LENGTH = Math.ceil(MAX_AVATAR_ASSET_BYTES / 3) * 4 + 4;
|
|
19124
|
+
ProjectApplyAssetSchema = external_exports.object({
|
|
19125
|
+
sha256: external_exports.string().regex(/^[a-f0-9]{64}$/),
|
|
19126
|
+
contentType: external_exports.enum(AVATAR_ASSET_CONTENT_TYPES),
|
|
19127
|
+
dataBase64: external_exports.string().min(1).max(MAX_AVATAR_ASSET_BASE64_LENGTH).regex(/^[A-Za-z0-9+/]+={0,2}$/)
|
|
19128
|
+
});
|
|
19129
|
+
ProjectApplyAssetsSchema = external_exports.record(
|
|
19130
|
+
external_exports.string().refine(isAvatarAssetPathShapeValid, {
|
|
19131
|
+
message: "asset keys must be relative paths under .auto/assets"
|
|
19132
|
+
}),
|
|
19133
|
+
ProjectApplyAssetSchema
|
|
19004
19134
|
);
|
|
19005
|
-
|
|
19006
|
-
|
|
19007
|
-
|
|
19008
|
-
|
|
19009
|
-
// events. An absent mode is treated as "interrupt" at the delivery
|
|
19010
|
-
// boundary (commandDeliveryPayload / the runtime handler), so the default
|
|
19011
|
-
// lives where the value is consumed rather than as a required field every
|
|
19012
|
-
// call site must construct.
|
|
19013
|
-
deliveryMode: MessageDeliveryModeSchema.optional(),
|
|
19014
|
-
metadata: JsonValueSchema.optional()
|
|
19015
|
-
}).strict();
|
|
19016
|
-
RunAnswerCommandPayloadSchema = external_exports.object({
|
|
19017
|
-
toolCallId: external_exports.string().trim().min(1),
|
|
19018
|
-
answers: external_exports.record(external_exports.string(), external_exports.string()),
|
|
19019
|
-
response: external_exports.string().trim().min(1).optional()
|
|
19020
|
-
}).strict().refine((value) => Object.keys(value.answers).length > 0 || value.response, {
|
|
19021
|
-
message: "Provide at least one answer or a freeform response"
|
|
19135
|
+
AvatarAssetUploadResponseSchema = external_exports.object({
|
|
19136
|
+
sha256: external_exports.string().regex(/^[a-f0-9]{64}$/),
|
|
19137
|
+
contentType: external_exports.enum(AVATAR_ASSET_CONTENT_TYPES),
|
|
19138
|
+
sizeBytes: external_exports.number().int().positive()
|
|
19022
19139
|
});
|
|
19023
|
-
|
|
19024
|
-
|
|
19025
|
-
})
|
|
19026
|
-
|
|
19027
|
-
|
|
19028
|
-
|
|
19029
|
-
})
|
|
19030
|
-
|
|
19031
|
-
|
|
19032
|
-
|
|
19033
|
-
|
|
19034
|
-
|
|
19140
|
+
ApplyBundlePathSchema = external_exports.string().trim().min(1).max(4096).refine((path2) => !path2.startsWith("/") && !path2.includes("\0"), {
|
|
19141
|
+
message: "apply bundle paths must be relative paths"
|
|
19142
|
+
});
|
|
19143
|
+
ProjectApplyBundleFileSchema = external_exports.object({
|
|
19144
|
+
path: ApplyBundlePathSchema,
|
|
19145
|
+
contentBase64: external_exports.string().regex(/^[A-Za-z0-9+/]*={0,2}$/)
|
|
19146
|
+
});
|
|
19147
|
+
ProjectApplyBundleSchema = external_exports.object({
|
|
19148
|
+
version: external_exports.literal(PROJECT_APPLY_BUNDLE_VERSION),
|
|
19149
|
+
files: external_exports.array(ProjectApplyBundleFileSchema).max(2e4)
|
|
19150
|
+
});
|
|
19151
|
+
ProjectApplyBundleRefSchema = external_exports.object({
|
|
19152
|
+
kind: external_exports.literal("vercel_blob"),
|
|
19153
|
+
storageKey: external_exports.string().trim().min(1).max(1024),
|
|
19154
|
+
sha256: external_exports.string().regex(SHA256_HEX_PATTERN),
|
|
19155
|
+
sizeBytes: external_exports.number().int().positive().max(MAX_PROJECT_APPLY_BUNDLE_BYTES)
|
|
19156
|
+
}).superRefine((ref, context) => {
|
|
19157
|
+
const expectedStorageKey = projectApplyBundleStorageKey(ref.sha256);
|
|
19158
|
+
if (ref.storageKey === expectedStorageKey) {
|
|
19159
|
+
return;
|
|
19160
|
+
}
|
|
19161
|
+
context.addIssue({
|
|
19162
|
+
code: "custom",
|
|
19163
|
+
path: ["storageKey"],
|
|
19164
|
+
message: "apply bundle storage key must match its sha256"
|
|
19165
|
+
});
|
|
19166
|
+
});
|
|
19167
|
+
ProjectApplyBundleUploadRequestSchema = external_exports.object({
|
|
19168
|
+
sha256: external_exports.string().regex(SHA256_HEX_PATTERN),
|
|
19169
|
+
sizeBytes: external_exports.number().int().positive().max(MAX_PROJECT_APPLY_BUNDLE_BYTES)
|
|
19170
|
+
});
|
|
19171
|
+
ProjectApplyBundleUploadResponseSchema = external_exports.object({
|
|
19172
|
+
method: external_exports.literal("PUT"),
|
|
19173
|
+
uploadUrl: external_exports.string().url(),
|
|
19174
|
+
contentType: external_exports.literal(PROJECT_APPLY_BUNDLE_CONTENT_TYPE),
|
|
19175
|
+
source: ProjectApplyBundleRefSchema
|
|
19176
|
+
});
|
|
19177
|
+
ProjectApplyBundleDirectoryEntrypointSchema = external_exports.object({
|
|
19178
|
+
kind: external_exports.literal("directory"),
|
|
19179
|
+
resourceRoot: ApplyBundlePathSchema.default(".auto"),
|
|
19180
|
+
displayResourceRoot: external_exports.string().trim().min(1).max(4096).optional()
|
|
19181
|
+
});
|
|
19182
|
+
ProjectApplyBundleFileEntrypointSchema = external_exports.object({
|
|
19183
|
+
kind: external_exports.literal("file"),
|
|
19184
|
+
filePath: ApplyBundlePathSchema
|
|
19185
|
+
});
|
|
19186
|
+
ProjectApplyBundleEntrypointSchema = external_exports.discriminatedUnion("kind", [
|
|
19187
|
+
ProjectApplyBundleDirectoryEntrypointSchema,
|
|
19188
|
+
ProjectApplyBundleFileEntrypointSchema
|
|
19035
19189
|
]);
|
|
19036
|
-
|
|
19037
|
-
|
|
19038
|
-
|
|
19190
|
+
ProjectApplySourceSchema = external_exports.object({
|
|
19191
|
+
kind: external_exports.literal("bundle"),
|
|
19192
|
+
bundle: ProjectApplyBundleRefSchema,
|
|
19193
|
+
entrypoint: ProjectApplyBundleEntrypointSchema
|
|
19194
|
+
});
|
|
19195
|
+
ProjectApplySourceRequestSchema = external_exports.object({
|
|
19196
|
+
source: ProjectApplySourceSchema,
|
|
19197
|
+
delete: external_exports.array(ProjectDeleteResourceSchema).default([]),
|
|
19198
|
+
dryRun: external_exports.boolean().default(false),
|
|
19199
|
+
prune: external_exports.boolean().default(true)
|
|
19200
|
+
});
|
|
19201
|
+
ProjectApplyRequestSchema = external_exports.object({
|
|
19202
|
+
delete: external_exports.array(ProjectDeleteResourceSchema).default([]),
|
|
19203
|
+
dryRun: external_exports.boolean().default(false),
|
|
19204
|
+
prune: external_exports.boolean().default(false),
|
|
19205
|
+
resources: external_exports.array(ProjectApplyResourceSchema).default([]),
|
|
19206
|
+
assets: ProjectApplyAssetsSchema.default({})
|
|
19207
|
+
});
|
|
19208
|
+
ProjectApplySystemConfigSchema = external_exports.object({
|
|
19209
|
+
kind: external_exports.literal("system"),
|
|
19210
|
+
metadata: external_exports.object({
|
|
19211
|
+
name: external_exports.string().trim().min(1).optional()
|
|
19212
|
+
}).optional(),
|
|
19213
|
+
spec: ProjectApplyRequestSchema
|
|
19214
|
+
});
|
|
19215
|
+
ProjectAppliedResourceSchema = external_exports.union([
|
|
19216
|
+
ProjectConnectionAllocationResourceSchema,
|
|
19217
|
+
EnvironmentResourceSchema,
|
|
19218
|
+
IdentityResourceSchema,
|
|
19219
|
+
AgentResourceSchema
|
|
19220
|
+
]);
|
|
19221
|
+
ProjectApplyDiagnosticSchema = external_exports.object({
|
|
19222
|
+
// "info" is a non-blocking advisory (e.g. template-push capability/override
|
|
19223
|
+
// notices); "error" remains the validation-failure severity. Coordinated
|
|
19224
|
+
// shape with the optional-connection-gating work; whoever lands second rebases.
|
|
19225
|
+
severity: external_exports.enum(["error", "info"]),
|
|
19226
|
+
blocking: external_exports.boolean(),
|
|
19227
|
+
code: external_exports.string().min(1),
|
|
19228
|
+
message: external_exports.string().min(1),
|
|
19229
|
+
action: external_exports.enum(["create", "update", "unchanged"]),
|
|
19230
|
+
kind: external_exports.enum([
|
|
19231
|
+
RESOURCE_KIND_CONNECTION,
|
|
19232
|
+
RESOURCE_KIND_ENVIRONMENT,
|
|
19233
|
+
RESOURCE_KIND_IDENTITY,
|
|
19234
|
+
RESOURCE_KIND_AGENT
|
|
19235
|
+
]),
|
|
19236
|
+
name: external_exports.string().min(1)
|
|
19039
19237
|
});
|
|
19040
|
-
|
|
19041
|
-
|
|
19042
|
-
|
|
19238
|
+
ProjectApplyResponsePrunedSchema = external_exports.object({
|
|
19239
|
+
kind: external_exports.enum(PROJECT_RESOURCE_KINDS),
|
|
19240
|
+
name: external_exports.string().min(1),
|
|
19241
|
+
uid: external_exports.string().min(1),
|
|
19242
|
+
heartbeatScheduleIds: external_exports.array(external_exports.string().min(1)).optional()
|
|
19043
19243
|
});
|
|
19044
|
-
|
|
19045
|
-
|
|
19046
|
-
|
|
19244
|
+
ProjectApplyPlanDiffSchema = external_exports.object({
|
|
19245
|
+
action: external_exports.enum(["add", "remove", "change"]),
|
|
19246
|
+
path: external_exports.string().min(1)
|
|
19047
19247
|
});
|
|
19048
|
-
|
|
19049
|
-
external_exports.
|
|
19050
|
-
|
|
19051
|
-
|
|
19052
|
-
|
|
19053
|
-
external_exports.
|
|
19054
|
-
|
|
19055
|
-
|
|
19056
|
-
|
|
19057
|
-
|
|
19058
|
-
|
|
19059
|
-
|
|
19060
|
-
|
|
19061
|
-
|
|
19062
|
-
|
|
19063
|
-
|
|
19064
|
-
}).strict(),
|
|
19065
|
-
external_exports.object({
|
|
19066
|
-
kind: external_exports.literal("interrupt"),
|
|
19067
|
-
payload: CreateRunLifecycleCommandRequestSchema
|
|
19068
|
-
}).strict(),
|
|
19069
|
-
external_exports.object({
|
|
19070
|
-
kind: external_exports.literal("cancel"),
|
|
19071
|
-
payload: CreateRunLifecycleCommandRequestSchema
|
|
19072
|
-
}).strict(),
|
|
19073
|
-
external_exports.object({
|
|
19074
|
-
kind: external_exports.literal("stop"),
|
|
19075
|
-
payload: CreateRunStopCommandRequestSchema
|
|
19076
|
-
}).strict()
|
|
19077
|
-
]);
|
|
19078
|
-
RunResolutionPolicySchema = external_exports.enum([
|
|
19079
|
-
"singletonLiveRun",
|
|
19080
|
-
"latestLiveRun",
|
|
19081
|
-
"latestRun"
|
|
19082
|
-
]);
|
|
19083
|
-
AgentAddressedCommandTargetSchema = external_exports.object({
|
|
19084
|
-
agentId: AgentIdSchema.optional(),
|
|
19085
|
-
agentName: external_exports.string().trim().min(1).optional(),
|
|
19086
|
-
resolutionPolicy: RunResolutionPolicySchema
|
|
19087
|
-
}).refine((value) => Boolean(value.agentId) !== Boolean(value.agentName), {
|
|
19088
|
-
message: "Provide exactly one of agentId or agentName"
|
|
19248
|
+
ProjectApplyResponseSchema = external_exports.object({
|
|
19249
|
+
dryRun: external_exports.boolean().default(false),
|
|
19250
|
+
resources: external_exports.array(ProjectAppliedResourceSchema),
|
|
19251
|
+
triggers: external_exports.array(ApplyTriggerReceiptSchema).default([]),
|
|
19252
|
+
diagnostics: external_exports.array(ProjectApplyDiagnosticSchema).default([]),
|
|
19253
|
+
plan: external_exports.array(
|
|
19254
|
+
external_exports.object({
|
|
19255
|
+
action: external_exports.enum(["create", "update", "unchanged", "archive"]),
|
|
19256
|
+
kind: external_exports.enum(PROJECT_RESOURCE_KINDS),
|
|
19257
|
+
name: external_exports.string().min(1),
|
|
19258
|
+
uid: external_exports.string().min(1).optional(),
|
|
19259
|
+
diff: external_exports.array(ProjectApplyPlanDiffSchema).optional(),
|
|
19260
|
+
diffOmitted: external_exports.number().int().positive().optional()
|
|
19261
|
+
})
|
|
19262
|
+
).default([]),
|
|
19263
|
+
pruned: external_exports.array(ProjectApplyResponsePrunedSchema).default([])
|
|
19089
19264
|
});
|
|
19090
|
-
|
|
19091
|
-
|
|
19092
|
-
|
|
19093
|
-
|
|
19094
|
-
|
|
19095
|
-
|
|
19096
|
-
|
|
19097
|
-
|
|
19098
|
-
|
|
19099
|
-
|
|
19100
|
-
failedAt: external_exports.string().datetime().nullable(),
|
|
19101
|
-
error: JsonValueSchema.nullable(),
|
|
19102
|
-
createdAt: external_exports.string().datetime(),
|
|
19103
|
-
updatedAt: external_exports.string().datetime()
|
|
19265
|
+
ProjectResourceApplyResultSchema = ProjectApplyResponseSchema.extend({
|
|
19266
|
+
heartbeatSchedules: external_exports.array(
|
|
19267
|
+
external_exports.object({
|
|
19268
|
+
scheduleId: external_exports.string().trim().min(1),
|
|
19269
|
+
cron: external_exports.string().trim().min(1),
|
|
19270
|
+
timezone: external_exports.string().trim().min(1),
|
|
19271
|
+
input: HeartbeatTickWorkflowInputSchema
|
|
19272
|
+
})
|
|
19273
|
+
).default([]),
|
|
19274
|
+
deletedHeartbeatScheduleIds: external_exports.array(external_exports.string().trim().min(1)).default([])
|
|
19104
19275
|
});
|
|
19105
|
-
|
|
19106
|
-
|
|
19107
|
-
|
|
19108
|
-
RunStartWithMessageCommandPayloadSchema = external_exports.object({
|
|
19109
|
-
kind: external_exports.literal("startWithMessage"),
|
|
19110
|
-
message: external_exports.string().trim().min(1)
|
|
19111
|
-
}).strict();
|
|
19112
|
-
SessionPersistedCommandPayloadSchema = external_exports.union([
|
|
19113
|
-
RunMessageCommandPayloadSchema,
|
|
19114
|
-
RunAnswerCommandPayloadSchema,
|
|
19115
|
-
RunLifecycleCommandPayloadSchema,
|
|
19116
|
-
RunStopCommandPayloadSchema,
|
|
19117
|
-
RunStartCommandPayloadSchema,
|
|
19118
|
-
RunStartWithMessageCommandPayloadSchema
|
|
19119
|
-
]);
|
|
19120
|
-
SessionCommandRecordSchema = external_exports.discriminatedUnion("kind", [
|
|
19121
|
-
SessionCommandRecordBaseSchema.extend({
|
|
19122
|
-
kind: external_exports.literal("message"),
|
|
19123
|
-
payload: RunMessageCommandPayloadSchema
|
|
19124
|
-
}),
|
|
19125
|
-
SessionCommandRecordBaseSchema.extend({
|
|
19126
|
-
kind: external_exports.literal("answer"),
|
|
19127
|
-
payload: RunAnswerCommandPayloadSchema
|
|
19128
|
-
}),
|
|
19129
|
-
SessionCommandRecordBaseSchema.extend({
|
|
19130
|
-
kind: external_exports.literal("pause"),
|
|
19131
|
-
payload: RunLifecycleCommandPayloadSchema
|
|
19132
|
-
}),
|
|
19133
|
-
SessionCommandRecordBaseSchema.extend({
|
|
19134
|
-
kind: external_exports.literal("resume"),
|
|
19135
|
-
payload: RunLifecycleCommandPayloadSchema
|
|
19136
|
-
}),
|
|
19137
|
-
SessionCommandRecordBaseSchema.extend({
|
|
19138
|
-
kind: external_exports.literal("interrupt"),
|
|
19139
|
-
payload: RunLifecycleCommandPayloadSchema
|
|
19140
|
-
}),
|
|
19141
|
-
SessionCommandRecordBaseSchema.extend({
|
|
19142
|
-
kind: external_exports.literal("cancel"),
|
|
19143
|
-
payload: RunLifecycleCommandPayloadSchema
|
|
19144
|
-
}),
|
|
19145
|
-
SessionCommandRecordBaseSchema.extend({
|
|
19146
|
-
kind: external_exports.literal("stop"),
|
|
19147
|
-
payload: RunStopCommandPayloadSchema
|
|
19148
|
-
}),
|
|
19149
|
-
SessionCommandRecordBaseSchema.extend({
|
|
19150
|
-
kind: external_exports.literal("start"),
|
|
19151
|
-
payload: RunStartCommandPayloadSchema
|
|
19152
|
-
}),
|
|
19153
|
-
SessionCommandRecordBaseSchema.extend({
|
|
19154
|
-
kind: external_exports.literal("startWithMessage"),
|
|
19155
|
-
payload: RunStartWithMessageCommandPayloadSchema
|
|
19156
|
-
})
|
|
19276
|
+
ProjectResourceApplyAuditActionSchema = external_exports.enum([
|
|
19277
|
+
"project_resources.apply",
|
|
19278
|
+
"github_sync.apply"
|
|
19157
19279
|
]);
|
|
19158
|
-
|
|
19159
|
-
|
|
19160
|
-
|
|
19161
|
-
|
|
19162
|
-
|
|
19163
|
-
kind: external_exports.literal("answer"),
|
|
19164
|
-
toolCallId: external_exports.string().trim().min(1),
|
|
19165
|
-
answers: external_exports.record(external_exports.string(), external_exports.string()),
|
|
19166
|
-
response: external_exports.string().trim().min(1).optional()
|
|
19167
|
-
}).strict();
|
|
19168
|
-
SessionDispatchStopCommandPayloadSchema = external_exports.object({
|
|
19169
|
-
kind: external_exports.literal("stop"),
|
|
19170
|
-
reason: external_exports.string().trim().min(1).optional()
|
|
19280
|
+
ProjectResourceApplyOperationIdSchema = external_exports.string().trim().min(1).max(512);
|
|
19281
|
+
ProjectResourceApplyTriggerArtifactSchema = external_exports.object({
|
|
19282
|
+
type: external_exports.string().trim().min(1),
|
|
19283
|
+
externalId: external_exports.string().trim().min(1),
|
|
19284
|
+
payload: JsonValueSchema.optional()
|
|
19171
19285
|
}).strict();
|
|
19172
|
-
|
|
19173
|
-
|
|
19286
|
+
ProjectResourceApplyWorkflowErrorSchema = external_exports.object({
|
|
19287
|
+
name: external_exports.string().trim().min(1),
|
|
19288
|
+
message: external_exports.string().trim().min(1)
|
|
19289
|
+
});
|
|
19290
|
+
ProjectResourceApplyWorkflowInputSchema = external_exports.object({
|
|
19291
|
+
operationId: ProjectResourceApplyOperationIdSchema,
|
|
19292
|
+
request: ProjectApplyRequestSchema.optional(),
|
|
19293
|
+
sourceRequest: ProjectApplySourceRequestSchema.optional(),
|
|
19294
|
+
organizationId: OrganizationIdSchema,
|
|
19295
|
+
projectId: ProjectIdSchema.nullable().optional(),
|
|
19296
|
+
actor: AuthActorSchema,
|
|
19297
|
+
auditAction: ProjectResourceApplyAuditActionSchema,
|
|
19298
|
+
triggerArtifact: ProjectResourceApplyTriggerArtifactSchema.optional()
|
|
19299
|
+
}).superRefine((input, context) => {
|
|
19300
|
+
if ((input.request ? 1 : 0) + (input.sourceRequest ? 1 : 0) !== 1) {
|
|
19301
|
+
context.addIssue({
|
|
19302
|
+
code: "custom",
|
|
19303
|
+
path: ["request"],
|
|
19304
|
+
message: "exactly one of request or sourceRequest is required"
|
|
19305
|
+
});
|
|
19306
|
+
}
|
|
19307
|
+
});
|
|
19308
|
+
ProjectResourceApplyWorkflowResultSchema = external_exports.discriminatedUnion(
|
|
19309
|
+
"status",
|
|
19174
19310
|
[
|
|
19175
|
-
|
|
19176
|
-
|
|
19177
|
-
|
|
19178
|
-
|
|
19179
|
-
|
|
19311
|
+
external_exports.object({
|
|
19312
|
+
status: external_exports.literal("applied"),
|
|
19313
|
+
result: ProjectResourceApplyResultSchema
|
|
19314
|
+
}),
|
|
19315
|
+
external_exports.object({
|
|
19316
|
+
status: external_exports.literal("failed"),
|
|
19317
|
+
error: ProjectResourceApplyWorkflowErrorSchema
|
|
19318
|
+
})
|
|
19180
19319
|
]
|
|
19181
19320
|
);
|
|
19182
|
-
SessionDispatchCommandRecordBaseSchema = external_exports.object({
|
|
19183
|
-
id: SessionCommandIdSchema,
|
|
19184
|
-
sessionId: SessionIdSchema,
|
|
19185
|
-
sender: SessionCommandSenderSchema,
|
|
19186
|
-
idempotencyKey: external_exports.string().min(1).nullable(),
|
|
19187
|
-
status: SessionDispatchCommandStatusSchema,
|
|
19188
|
-
attemptCount: external_exports.number().int().nonnegative(),
|
|
19189
|
-
nextAttemptAt: external_exports.string().datetime().nullable(),
|
|
19190
|
-
lastAttemptAt: external_exports.string().datetime().nullable(),
|
|
19191
|
-
acceptedAt: external_exports.string().datetime().nullable(),
|
|
19192
|
-
failedAt: external_exports.string().datetime().nullable(),
|
|
19193
|
-
error: JsonValueSchema.nullable(),
|
|
19194
|
-
createdAt: external_exports.string().datetime(),
|
|
19195
|
-
updatedAt: external_exports.string().datetime()
|
|
19196
|
-
});
|
|
19197
|
-
SessionDispatchCommandRecordSchema = external_exports.discriminatedUnion("kind", [
|
|
19198
|
-
SessionDispatchCommandRecordBaseSchema.extend({
|
|
19199
|
-
kind: external_exports.literal("start"),
|
|
19200
|
-
payload: RunStartCommandPayloadSchema
|
|
19201
|
-
}),
|
|
19202
|
-
SessionDispatchCommandRecordBaseSchema.extend({
|
|
19203
|
-
kind: external_exports.literal("startWithMessage"),
|
|
19204
|
-
payload: RunStartWithMessageCommandPayloadSchema
|
|
19205
|
-
}),
|
|
19206
|
-
SessionDispatchCommandRecordBaseSchema.extend({
|
|
19207
|
-
kind: external_exports.literal("message"),
|
|
19208
|
-
payload: SessionDispatchMessageCommandPayloadSchema
|
|
19209
|
-
}),
|
|
19210
|
-
SessionDispatchCommandRecordBaseSchema.extend({
|
|
19211
|
-
kind: external_exports.literal("answer"),
|
|
19212
|
-
payload: SessionDispatchAnswerCommandPayloadSchema
|
|
19213
|
-
}),
|
|
19214
|
-
SessionDispatchCommandRecordBaseSchema.extend({
|
|
19215
|
-
kind: external_exports.literal("stop"),
|
|
19216
|
-
payload: SessionDispatchStopCommandPayloadSchema
|
|
19217
|
-
})
|
|
19218
|
-
]);
|
|
19219
19321
|
}
|
|
19220
19322
|
});
|
|
19221
19323
|
|
|
19222
|
-
// ../../packages/schemas/src/
|
|
19223
|
-
|
|
19224
|
-
|
|
19225
|
-
|
|
19226
|
-
|
|
19227
|
-
|
|
19228
|
-
|
|
19229
|
-
|
|
19230
|
-
|
|
19324
|
+
// ../../packages/schemas/src/realtime.ts
|
|
19325
|
+
var RunRealtimeEventSchema;
|
|
19326
|
+
var init_realtime = __esm({
|
|
19327
|
+
"../../packages/schemas/src/realtime.ts"() {
|
|
19328
|
+
"use strict";
|
|
19329
|
+
init_conversation();
|
|
19330
|
+
RunRealtimeEventSchema = ConversationRealtimeEventSchema;
|
|
19331
|
+
}
|
|
19332
|
+
});
|
|
19333
|
+
|
|
19334
|
+
// ../../packages/schemas/src/session-diagnostics.ts
|
|
19335
|
+
var SESSION_DIAGNOSTIC_REALTIME_EVENT, SESSION_DIAGNOSTIC_LEVELS, SESSION_DIAGNOSTIC_SOURCES, SESSION_DIAGNOSTIC_PHASES, SESSION_DIAGNOSTIC_STATUSES, SessionDiagnosticLevelSchema, SessionDiagnosticSourceSchema, SessionDiagnosticPhaseSchema, SessionDiagnosticStatusSchema, SessionDiagnosticEventSchema;
|
|
19336
|
+
var init_session_diagnostics = __esm({
|
|
19337
|
+
"../../packages/schemas/src/session-diagnostics.ts"() {
|
|
19231
19338
|
"use strict";
|
|
19232
19339
|
init_zod();
|
|
19233
|
-
init_agents();
|
|
19234
|
-
init_auth();
|
|
19235
|
-
init_environments();
|
|
19236
19340
|
init_ids();
|
|
19237
19341
|
init_primitives();
|
|
19238
|
-
|
|
19239
|
-
|
|
19240
|
-
|
|
19241
|
-
"
|
|
19242
|
-
"
|
|
19243
|
-
"
|
|
19244
|
-
"failed",
|
|
19245
|
-
"stopped"
|
|
19342
|
+
SESSION_DIAGNOSTIC_REALTIME_EVENT = "session.diagnostic";
|
|
19343
|
+
SESSION_DIAGNOSTIC_LEVELS = [
|
|
19344
|
+
"debug",
|
|
19345
|
+
"info",
|
|
19346
|
+
"warn",
|
|
19347
|
+
"error"
|
|
19246
19348
|
];
|
|
19247
|
-
|
|
19248
|
-
"
|
|
19249
|
-
"
|
|
19250
|
-
"
|
|
19251
|
-
"
|
|
19252
|
-
"
|
|
19349
|
+
SESSION_DIAGNOSTIC_SOURCES = [
|
|
19350
|
+
"web",
|
|
19351
|
+
"worker",
|
|
19352
|
+
"activity",
|
|
19353
|
+
"bridge",
|
|
19354
|
+
"runtime"
|
|
19253
19355
|
];
|
|
19254
|
-
|
|
19255
|
-
|
|
19256
|
-
|
|
19257
|
-
|
|
19258
|
-
"
|
|
19259
|
-
"
|
|
19260
|
-
"
|
|
19356
|
+
SESSION_DIAGNOSTIC_PHASES = [
|
|
19357
|
+
"dispatch",
|
|
19358
|
+
"environment",
|
|
19359
|
+
"bridge",
|
|
19360
|
+
"delivery",
|
|
19361
|
+
"command",
|
|
19362
|
+
"runtime"
|
|
19261
19363
|
];
|
|
19262
|
-
|
|
19263
|
-
|
|
19264
|
-
|
|
19265
|
-
|
|
19266
|
-
|
|
19267
|
-
|
|
19268
|
-
SESSION_CHECK_STATUSES = [
|
|
19269
|
-
"queued",
|
|
19270
|
-
"in_progress",
|
|
19271
|
-
"completed"
|
|
19364
|
+
SESSION_DIAGNOSTIC_STATUSES = [
|
|
19365
|
+
"started",
|
|
19366
|
+
"succeeded",
|
|
19367
|
+
"retrying",
|
|
19368
|
+
"failed",
|
|
19369
|
+
"skipped"
|
|
19272
19370
|
];
|
|
19273
|
-
|
|
19274
|
-
|
|
19275
|
-
|
|
19276
|
-
|
|
19277
|
-
|
|
19278
|
-
SESSION_CHECK_TIMEOUT_PHASES
|
|
19371
|
+
SessionDiagnosticLevelSchema = external_exports.enum(SESSION_DIAGNOSTIC_LEVELS);
|
|
19372
|
+
SessionDiagnosticSourceSchema = external_exports.enum(SESSION_DIAGNOSTIC_SOURCES);
|
|
19373
|
+
SessionDiagnosticPhaseSchema = external_exports.enum(SESSION_DIAGNOSTIC_PHASES);
|
|
19374
|
+
SessionDiagnosticStatusSchema = external_exports.enum(
|
|
19375
|
+
SESSION_DIAGNOSTIC_STATUSES
|
|
19279
19376
|
);
|
|
19280
|
-
|
|
19281
|
-
|
|
19282
|
-
|
|
19283
|
-
/**
|
|
19284
|
-
* Deliver the agent's configured `initialPrompt` as the session's kickoff
|
|
19285
|
-
* message so the agent opens the conversation. Agents without an
|
|
19286
|
-
* `initialPrompt` fall back to the default manual say-hello message, so a
|
|
19287
|
-
* kickoff always pings the agent. The kickoff is delivered through the
|
|
19288
|
-
* session's one idempotent start command and never renders as a user chat
|
|
19289
|
-
* bubble; the agent's greeting is the first visible content.
|
|
19290
|
-
*/
|
|
19291
|
-
kickoff: external_exports.boolean().optional()
|
|
19292
|
-
});
|
|
19293
|
-
SessionArchiveRequestSchema = external_exports.object({
|
|
19294
|
-
archived: external_exports.boolean()
|
|
19295
|
-
});
|
|
19296
|
-
SessionsArchiveRequestSchema = external_exports.object({
|
|
19297
|
-
session_ids: external_exports.array(SessionIdSchema).min(1).max(100),
|
|
19298
|
-
archived: external_exports.boolean()
|
|
19299
|
-
});
|
|
19300
|
-
SessionRecordSchema = external_exports.object({
|
|
19301
|
-
id: SessionIdSchema,
|
|
19302
|
-
organizationId: external_exports.string().trim().min(1),
|
|
19303
|
-
projectId: external_exports.string().trim().min(1).nullable(),
|
|
19304
|
-
agentId: AgentIdSchema,
|
|
19305
|
-
runtimeId: RuntimeIdSchema.nullable(),
|
|
19306
|
-
status: SessionStatusSchema,
|
|
19307
|
-
runtimePhase: SessionRuntimePhaseSchema.nullable(),
|
|
19308
|
-
idempotencyKey: external_exports.string().min(1).nullable(),
|
|
19309
|
-
correlationKey: external_exports.string().nullable(),
|
|
19310
|
-
workflowId: external_exports.string().min(1),
|
|
19311
|
-
displayTitle: RunDisplayTitleSchema,
|
|
19312
|
-
ambientStatus: AmbientStatusSchema.nullable(),
|
|
19313
|
-
ambientStatusUpdatedAt: external_exports.string().datetime().nullable(),
|
|
19314
|
-
starterActor: AuthActorSchema.nullable(),
|
|
19315
|
-
snapshot: AgentResourceSchema,
|
|
19316
|
-
environmentSnapshot: EnvironmentResourceSchema,
|
|
19317
|
-
toolSnapshots: external_exports.array(
|
|
19318
|
-
external_exports.object({
|
|
19319
|
-
source: external_exports.literal("inline"),
|
|
19320
|
-
alias: ToolAliasSchema,
|
|
19321
|
-
spec: RemoteMcpToolSchema.or(ConnectionBackedToolSchema).or(LocalToolSchema).or(GithubToolSchema)
|
|
19322
|
-
})
|
|
19323
|
-
),
|
|
19324
|
-
input: JsonValueSchema,
|
|
19325
|
-
createdAt: external_exports.string().datetime(),
|
|
19326
|
-
updatedAt: external_exports.string().datetime(),
|
|
19327
|
-
lastActivityAt: external_exports.string().datetime(),
|
|
19328
|
-
startedAt: external_exports.string().datetime().nullable(),
|
|
19329
|
-
finishedAt: external_exports.string().datetime().nullable(),
|
|
19330
|
-
archivedAt: external_exports.string().datetime().nullable(),
|
|
19331
|
-
error: JsonValueSchema.nullable()
|
|
19332
|
-
});
|
|
19333
|
-
SessionMessageOriginSchema = external_exports.object({
|
|
19334
|
-
eventKey: external_exports.string().trim().min(1),
|
|
19335
|
-
provider: external_exports.string().trim().min(1).nullable().default(null)
|
|
19336
|
-
});
|
|
19337
|
-
SessionUiMessageRecordSchema = external_exports.object({
|
|
19338
|
-
id: external_exports.string().trim().min(1),
|
|
19377
|
+
SessionDiagnosticEventSchema = external_exports.object({
|
|
19378
|
+
type: external_exports.literal(SESSION_DIAGNOSTIC_REALTIME_EVENT),
|
|
19379
|
+
id: external_exports.string().min(1),
|
|
19339
19380
|
sessionId: SessionIdSchema,
|
|
19340
|
-
|
|
19341
|
-
|
|
19342
|
-
|
|
19343
|
-
|
|
19344
|
-
|
|
19345
|
-
|
|
19346
|
-
|
|
19347
|
-
|
|
19348
|
-
|
|
19349
|
-
|
|
19350
|
-
|
|
19351
|
-
|
|
19352
|
-
|
|
19353
|
-
// its event key plus the originating provider connection when known
|
|
19354
|
-
// (e.g. "slack" for a subscribed-thread reply, "github" for a check event).
|
|
19355
|
-
origin: SessionMessageOriginSchema.nullable().default(null),
|
|
19356
|
-
streamCursor: external_exports.number().int().positive().nullable().default(null),
|
|
19357
|
-
createdAt: external_exports.string().datetime(),
|
|
19358
|
-
updatedAt: external_exports.string().datetime(),
|
|
19359
|
-
completedAt: external_exports.string().datetime().nullable()
|
|
19360
|
-
});
|
|
19361
|
-
SessionListItemAgentSchema = external_exports.object({
|
|
19362
|
-
name: external_exports.string(),
|
|
19363
|
-
displayName: external_exports.string().nullable(),
|
|
19364
|
-
username: external_exports.string().nullable(),
|
|
19365
|
-
avatarSha256: external_exports.string().nullable()
|
|
19366
|
-
});
|
|
19367
|
-
SessionListItemSchema = external_exports.object({
|
|
19368
|
-
id: SessionIdSchema,
|
|
19369
|
-
agentId: AgentIdSchema,
|
|
19370
|
-
status: SessionStatusSchema,
|
|
19371
|
-
runtimePhase: SessionRuntimePhaseSchema.nullable(),
|
|
19372
|
-
displayTitle: RunDisplayTitleSchema,
|
|
19373
|
-
summary: external_exports.string(),
|
|
19374
|
-
agent: SessionListItemAgentSchema,
|
|
19375
|
-
createdAt: external_exports.string().datetime(),
|
|
19376
|
-
updatedAt: external_exports.string().datetime(),
|
|
19377
|
-
archivedAt: external_exports.string().datetime().nullable(),
|
|
19378
|
-
lastActivityAt: external_exports.string().datetime()
|
|
19379
|
-
});
|
|
19380
|
-
SessionListResponseSchema = external_exports.object({
|
|
19381
|
-
sessions: external_exports.array(SessionListItemSchema),
|
|
19382
|
-
/**
|
|
19383
|
-
* Opaque keyset cursor for the next page, or `null` when the list is
|
|
19384
|
-
* exhausted. Replay it on the next request to append the following page; it is
|
|
19385
|
-
* minted for a specific sort and rejected against a different one.
|
|
19386
|
-
*/
|
|
19387
|
-
nextCursor: external_exports.string().nullable(),
|
|
19388
|
-
hasMore: external_exports.boolean()
|
|
19389
|
-
});
|
|
19390
|
-
SessionsArchiveResponseSchema = external_exports.object({
|
|
19391
|
-
archived: external_exports.boolean(),
|
|
19392
|
-
sessions: external_exports.array(SessionRecordSchema)
|
|
19381
|
+
level: SessionDiagnosticLevelSchema,
|
|
19382
|
+
source: SessionDiagnosticSourceSchema,
|
|
19383
|
+
phase: SessionDiagnosticPhaseSchema,
|
|
19384
|
+
step: external_exports.string().trim().min(1),
|
|
19385
|
+
status: SessionDiagnosticStatusSchema,
|
|
19386
|
+
message: external_exports.string().trim().min(1),
|
|
19387
|
+
commandId: SessionCommandIdSchema.optional(),
|
|
19388
|
+
runtimeId: RuntimeIdSchema.optional(),
|
|
19389
|
+
bridgeLeaseId: RuntimeBridgeLeaseIdSchema.optional(),
|
|
19390
|
+
attempt: external_exports.number().int().nonnegative().optional(),
|
|
19391
|
+
durationMs: external_exports.number().nonnegative().optional(),
|
|
19392
|
+
details: external_exports.record(external_exports.string(), JsonValueSchema).optional(),
|
|
19393
|
+
createdAt: external_exports.string().datetime()
|
|
19393
19394
|
});
|
|
19394
19395
|
}
|
|
19395
19396
|
});
|
|
@@ -24703,7 +24704,7 @@ var init_package = __esm({
|
|
|
24703
24704
|
"package.json"() {
|
|
24704
24705
|
package_default = {
|
|
24705
24706
|
name: "@autohq/cli",
|
|
24706
|
-
version: "0.1.
|
|
24707
|
+
version: "0.1.304",
|
|
24707
24708
|
license: "SEE LICENSE IN README.md",
|
|
24708
24709
|
publishConfig: {
|
|
24709
24710
|
access: "public"
|
|
@@ -35273,6 +35274,7 @@ var UiMessagePartTracker = class {
|
|
|
35273
35274
|
textPartIndexById = /* @__PURE__ */ new Map();
|
|
35274
35275
|
reasoningPartIndexById = /* @__PURE__ */ new Map();
|
|
35275
35276
|
toolPartIndexByCallId = /* @__PURE__ */ new Map();
|
|
35277
|
+
approvalByCallId = /* @__PURE__ */ new Map();
|
|
35276
35278
|
dataPartIndexById = /* @__PURE__ */ new Map();
|
|
35277
35279
|
append(chunk) {
|
|
35278
35280
|
switch (chunk.type) {
|
|
@@ -35365,14 +35367,16 @@ var UiMessagePartTracker = class {
|
|
|
35365
35367
|
return [];
|
|
35366
35368
|
}
|
|
35367
35369
|
case "tool-input-available": {
|
|
35370
|
+
const pendingApproval = this.approvalByCallId.get(chunk.toolCallId);
|
|
35368
35371
|
const index = this.upsertToolPart(chunk.toolCallId, {
|
|
35369
35372
|
...toolPartShape({
|
|
35370
35373
|
toolCallId: chunk.toolCallId,
|
|
35371
35374
|
toolName: chunk.toolName,
|
|
35372
35375
|
dynamic: chunk.dynamic,
|
|
35373
|
-
state: "input-available"
|
|
35376
|
+
state: pendingApproval ? "approval-requested" : "input-available"
|
|
35374
35377
|
}),
|
|
35375
35378
|
input: chunk.input,
|
|
35379
|
+
...pendingApproval ? { approval: pendingApproval } : {},
|
|
35376
35380
|
...chunk.providerExecuted !== void 0 ? { providerExecuted: chunk.providerExecuted } : {},
|
|
35377
35381
|
...chunk.providerMetadata !== void 0 ? { callProviderMetadata: chunk.providerMetadata } : {}
|
|
35378
35382
|
});
|
|
@@ -35391,6 +35395,24 @@ var UiMessagePartTracker = class {
|
|
|
35391
35395
|
});
|
|
35392
35396
|
return this.persistable(index);
|
|
35393
35397
|
}
|
|
35398
|
+
case "tool-approval-request": {
|
|
35399
|
+
const approval = {
|
|
35400
|
+
id: chunk.approvalId,
|
|
35401
|
+
...chunk.signature != null ? { signature: chunk.signature } : {}
|
|
35402
|
+
};
|
|
35403
|
+
this.approvalByCallId.set(chunk.toolCallId, approval);
|
|
35404
|
+
const part = this.partById(
|
|
35405
|
+
this.toolPartIndexByCallId,
|
|
35406
|
+
chunk.toolCallId
|
|
35407
|
+
);
|
|
35408
|
+
const index = this.toolPartIndexByCallId.get(chunk.toolCallId);
|
|
35409
|
+
if (!part || index === void 0) {
|
|
35410
|
+
return [];
|
|
35411
|
+
}
|
|
35412
|
+
part.state = "approval-requested";
|
|
35413
|
+
part.approval = approval;
|
|
35414
|
+
return this.persistable(index);
|
|
35415
|
+
}
|
|
35394
35416
|
case "tool-output-available": {
|
|
35395
35417
|
const part = this.partById(
|
|
35396
35418
|
this.toolPartIndexByCallId,
|
|
@@ -35403,6 +35425,20 @@ var UiMessagePartTracker = class {
|
|
|
35403
35425
|
part.state = "output-available";
|
|
35404
35426
|
part.output = chunk.output;
|
|
35405
35427
|
part.preliminary = chunk.preliminary;
|
|
35428
|
+
this.settleApproval(part, chunk.toolCallId, { approved: true });
|
|
35429
|
+
return this.persistable(index);
|
|
35430
|
+
}
|
|
35431
|
+
case "tool-output-denied": {
|
|
35432
|
+
const part = this.partById(
|
|
35433
|
+
this.toolPartIndexByCallId,
|
|
35434
|
+
chunk.toolCallId
|
|
35435
|
+
);
|
|
35436
|
+
const index = this.toolPartIndexByCallId.get(chunk.toolCallId);
|
|
35437
|
+
if (!part || index === void 0) {
|
|
35438
|
+
return [];
|
|
35439
|
+
}
|
|
35440
|
+
part.state = "output-denied";
|
|
35441
|
+
this.settleApproval(part, chunk.toolCallId, { approved: false });
|
|
35406
35442
|
return this.persistable(index);
|
|
35407
35443
|
}
|
|
35408
35444
|
case "tool-output-error": {
|
|
@@ -35416,6 +35452,7 @@ var UiMessagePartTracker = class {
|
|
|
35416
35452
|
}
|
|
35417
35453
|
part.state = "output-error";
|
|
35418
35454
|
part.errorText = chunk.errorText;
|
|
35455
|
+
this.settleApproval(part, chunk.toolCallId, { approved: true });
|
|
35419
35456
|
return this.persistable(index);
|
|
35420
35457
|
}
|
|
35421
35458
|
case "start-step": {
|
|
@@ -35523,6 +35560,16 @@ var UiMessagePartTracker = class {
|
|
|
35523
35560
|
}
|
|
35524
35561
|
return this.parts[index] ?? null;
|
|
35525
35562
|
}
|
|
35563
|
+
// The UIToolInvocation contract requires `approval.approved` on settled
|
|
35564
|
+
// states (`output-available`/`output-denied`), but the settling chunks don't
|
|
35565
|
+
// carry it — the outcome is implied by which chunk arrives. Stamp it onto a
|
|
35566
|
+
// previously requested approval; parts that never parked stay approval-free.
|
|
35567
|
+
settleApproval(part, toolCallId, outcome) {
|
|
35568
|
+
const approval = this.approvalByCallId.get(toolCallId);
|
|
35569
|
+
if (approval) {
|
|
35570
|
+
part.approval = { ...approval, approved: outcome.approved };
|
|
35571
|
+
}
|
|
35572
|
+
}
|
|
35526
35573
|
reset() {
|
|
35527
35574
|
this.messageId = null;
|
|
35528
35575
|
this.messageMetadata = void 0;
|
|
@@ -35531,6 +35578,7 @@ var UiMessagePartTracker = class {
|
|
|
35531
35578
|
this.textPartIndexById = /* @__PURE__ */ new Map();
|
|
35532
35579
|
this.reasoningPartIndexById = /* @__PURE__ */ new Map();
|
|
35533
35580
|
this.toolPartIndexByCallId = /* @__PURE__ */ new Map();
|
|
35581
|
+
this.approvalByCallId = /* @__PURE__ */ new Map();
|
|
35534
35582
|
this.dataPartIndexById = /* @__PURE__ */ new Map();
|
|
35535
35583
|
}
|
|
35536
35584
|
};
|
|
@@ -35967,6 +36015,21 @@ function legacyToolEntry(chunk) {
|
|
|
35967
36015
|
]
|
|
35968
36016
|
}
|
|
35969
36017
|
};
|
|
36018
|
+
case "tool-output-denied":
|
|
36019
|
+
return {
|
|
36020
|
+
role: "tool",
|
|
36021
|
+
kind: "tool_result",
|
|
36022
|
+
content: {
|
|
36023
|
+
parts: [
|
|
36024
|
+
{
|
|
36025
|
+
type: "tool_result",
|
|
36026
|
+
toolUseId: legacyToolCallId(chunk.toolCallId),
|
|
36027
|
+
output: { denied: true },
|
|
36028
|
+
isError: true
|
|
36029
|
+
}
|
|
36030
|
+
]
|
|
36031
|
+
}
|
|
36032
|
+
};
|
|
35970
36033
|
default:
|
|
35971
36034
|
return null;
|
|
35972
36035
|
}
|
|
@@ -38109,15 +38172,19 @@ var CodexProjector = class {
|
|
|
38109
38172
|
return [];
|
|
38110
38173
|
}
|
|
38111
38174
|
}
|
|
38112
|
-
// An approval parks the turn on operator input, so
|
|
38113
|
-
//
|
|
38175
|
+
// An approval parks the turn on operator input, so both chunks mark the
|
|
38176
|
+
// delivered turn as waiting for input.
|
|
38114
38177
|
projectApproval(request) {
|
|
38115
38178
|
return [
|
|
38116
|
-
|
|
38117
|
-
type: "
|
|
38118
|
-
|
|
38119
|
-
|
|
38120
|
-
|
|
38179
|
+
{
|
|
38180
|
+
type: "ui_message_chunk",
|
|
38181
|
+
chunk: {
|
|
38182
|
+
type: "tool-approval-request",
|
|
38183
|
+
approvalId: String(request.requestId),
|
|
38184
|
+
toolCallId: request.itemId
|
|
38185
|
+
},
|
|
38186
|
+
turnStatus: "waiting_for_input"
|
|
38187
|
+
},
|
|
38121
38188
|
{
|
|
38122
38189
|
type: "ui_message_chunk",
|
|
38123
38190
|
chunk: {
|
|
@@ -38172,6 +38239,7 @@ var CodexProjector = class {
|
|
|
38172
38239
|
...item.cwd ? { cwd: item.cwd } : {}
|
|
38173
38240
|
},
|
|
38174
38241
|
output: item.aggregatedOutput ?? "",
|
|
38242
|
+
isDenied: isDeclinedStatus(item.status),
|
|
38175
38243
|
isError: isFailedStatus(item.status) || (item.exitCode ?? 0) !== 0,
|
|
38176
38244
|
title: item.command,
|
|
38177
38245
|
toolMetadata: statusMetadata(item.status, {
|
|
@@ -38185,6 +38253,7 @@ var CodexProjector = class {
|
|
|
38185
38253
|
name: "apply_patch",
|
|
38186
38254
|
input: { changes: toJsonValue(item.changes) },
|
|
38187
38255
|
output: { status: item.status ?? "unknown" },
|
|
38256
|
+
isDenied: isDeclinedStatus(item.status),
|
|
38188
38257
|
isError: isFailedStatus(item.status),
|
|
38189
38258
|
title: "apply_patch",
|
|
38190
38259
|
toolMetadata: statusMetadata(item.status)
|
|
@@ -38282,6 +38351,12 @@ function toolInputChunk(input) {
|
|
|
38282
38351
|
});
|
|
38283
38352
|
}
|
|
38284
38353
|
function toolOutputChunk(input) {
|
|
38354
|
+
if (input.isDenied) {
|
|
38355
|
+
return uiChunk2({
|
|
38356
|
+
type: "tool-output-denied",
|
|
38357
|
+
toolCallId: input.itemId
|
|
38358
|
+
});
|
|
38359
|
+
}
|
|
38285
38360
|
return uiChunk2(
|
|
38286
38361
|
input.isError ? {
|
|
38287
38362
|
type: "tool-output-error",
|
|
@@ -38352,6 +38427,9 @@ function reasoningPartId(itemId) {
|
|
|
38352
38427
|
function isFailedStatus(status) {
|
|
38353
38428
|
return status === "failed" || status === "declined";
|
|
38354
38429
|
}
|
|
38430
|
+
function isDeclinedStatus(status) {
|
|
38431
|
+
return status === "declined";
|
|
38432
|
+
}
|
|
38355
38433
|
function statusMetadata(status, fields = {}) {
|
|
38356
38434
|
return {
|
|
38357
38435
|
status: status ?? "unknown",
|