@autohq/cli 0.1.137 → 0.1.138
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 +11 -33
- package/dist/index.js +72 -94
- package/package.json +1 -1
package/dist/agent-bridge.js
CHANGED
|
@@ -21253,7 +21253,6 @@ var EventRoutingTriggerResultSchema = external_exports.object({
|
|
|
21253
21253
|
|
|
21254
21254
|
// ../../packages/schemas/src/sessions.ts
|
|
21255
21255
|
var RESOURCE_KIND_AGENT = "agent";
|
|
21256
|
-
var LEGACY_RESOURCE_KIND_SESSION = "session";
|
|
21257
21256
|
var RESOURCE_KIND_SESSION = RESOURCE_KIND_AGENT;
|
|
21258
21257
|
var SESSION_HARNESSES = ["claude-code"];
|
|
21259
21258
|
var TriggerFilterScalarSchema = external_exports.union([
|
|
@@ -21909,14 +21908,11 @@ var SessionApplyDocumentSchema = resourceApplyDocumentSchema(
|
|
|
21909
21908
|
RESOURCE_KIND_SESSION,
|
|
21910
21909
|
SessionApplyRequestSchema.shape.spec
|
|
21911
21910
|
);
|
|
21912
|
-
var ProjectApplyResourceSchema = external_exports.
|
|
21913
|
-
|
|
21914
|
-
|
|
21915
|
-
|
|
21916
|
-
|
|
21917
|
-
SessionApplyDocumentSchema
|
|
21918
|
-
])
|
|
21919
|
-
);
|
|
21911
|
+
var ProjectApplyResourceSchema = external_exports.discriminatedUnion("kind", [
|
|
21912
|
+
EnvironmentApplyDocumentSchema,
|
|
21913
|
+
IdentityApplyDocumentSchema,
|
|
21914
|
+
SessionApplyDocumentSchema
|
|
21915
|
+
]);
|
|
21920
21916
|
var PROJECT_RESOURCE_APPLY_ORDER = [
|
|
21921
21917
|
RESOURCE_KIND_CONNECTION,
|
|
21922
21918
|
RESOURCE_KIND_IDENTITY,
|
|
@@ -21932,12 +21928,9 @@ var PROJECT_APPLY_RESOURCE_KINDS = [
|
|
|
21932
21928
|
var ProjectDeleteResourceBaseSchema = external_exports.object({
|
|
21933
21929
|
name: external_exports.string().trim().min(1)
|
|
21934
21930
|
});
|
|
21935
|
-
var ProjectDeleteResourceSchema =
|
|
21936
|
-
|
|
21937
|
-
|
|
21938
|
-
kind: external_exports.enum(PROJECT_APPLY_RESOURCE_KINDS)
|
|
21939
|
-
})
|
|
21940
|
-
);
|
|
21931
|
+
var ProjectDeleteResourceSchema = ProjectDeleteResourceBaseSchema.extend({
|
|
21932
|
+
kind: external_exports.enum(PROJECT_APPLY_RESOURCE_KINDS)
|
|
21933
|
+
});
|
|
21941
21934
|
var AVATAR_ASSET_CONTENT_TYPES = ["image/png", "image/jpeg"];
|
|
21942
21935
|
var MAX_AVATAR_ASSET_BASE64_LENGTH = Math.ceil(MAX_AVATAR_ASSET_BYTES / 3) * 4 + 4;
|
|
21943
21936
|
var ProjectApplyAssetSchema = external_exports.object({
|
|
@@ -21993,12 +21986,6 @@ var ProjectApplyDiagnosticSchema = external_exports.object({
|
|
|
21993
21986
|
]),
|
|
21994
21987
|
name: external_exports.string().min(1)
|
|
21995
21988
|
});
|
|
21996
|
-
var ProjectApplyResponseResourceKindSchema = external_exports.union([
|
|
21997
|
-
external_exports.enum(PROJECT_RESOURCE_KINDS),
|
|
21998
|
-
external_exports.literal(LEGACY_RESOURCE_KIND_SESSION)
|
|
21999
|
-
]).transform(
|
|
22000
|
-
(kind) => kind === LEGACY_RESOURCE_KIND_SESSION ? RESOURCE_KIND_SESSION : kind
|
|
22001
|
-
);
|
|
22002
21989
|
var ProjectApplyResponseSchema = external_exports.object({
|
|
22003
21990
|
dryRun: external_exports.boolean().default(false),
|
|
22004
21991
|
resources: external_exports.array(ProjectAppliedResourceSchema),
|
|
@@ -22007,28 +21994,19 @@ var ProjectApplyResponseSchema = external_exports.object({
|
|
|
22007
21994
|
plan: external_exports.array(
|
|
22008
21995
|
external_exports.object({
|
|
22009
21996
|
action: external_exports.enum(["create", "update", "unchanged", "archive"]),
|
|
22010
|
-
kind:
|
|
21997
|
+
kind: external_exports.enum(PROJECT_RESOURCE_KINDS),
|
|
22011
21998
|
name: external_exports.string().min(1),
|
|
22012
21999
|
uid: external_exports.string().min(1).optional()
|
|
22013
22000
|
})
|
|
22014
22001
|
).default([]),
|
|
22015
22002
|
pruned: external_exports.array(
|
|
22016
22003
|
external_exports.object({
|
|
22017
|
-
kind:
|
|
22004
|
+
kind: external_exports.enum(PROJECT_RESOURCE_KINDS),
|
|
22018
22005
|
name: external_exports.string().min(1),
|
|
22019
22006
|
uid: external_exports.string().min(1)
|
|
22020
22007
|
})
|
|
22021
22008
|
).default([])
|
|
22022
22009
|
});
|
|
22023
|
-
function normalizeLegacySessionKind(value2) {
|
|
22024
|
-
if (isRecord(value2) && value2.kind === LEGACY_RESOURCE_KIND_SESSION) {
|
|
22025
|
-
return { ...value2, kind: RESOURCE_KIND_SESSION };
|
|
22026
|
-
}
|
|
22027
|
-
return value2;
|
|
22028
|
-
}
|
|
22029
|
-
function isRecord(value2) {
|
|
22030
|
-
return typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
|
|
22031
|
-
}
|
|
22032
22010
|
|
|
22033
22011
|
// ../../packages/schemas/src/run-diagnostics.ts
|
|
22034
22012
|
var RUN_DIAGNOSTIC_REALTIME_EVENT = "run.diagnostic";
|
|
@@ -26290,7 +26268,7 @@ Object.assign(lookup, {
|
|
|
26290
26268
|
// package.json
|
|
26291
26269
|
var package_default = {
|
|
26292
26270
|
name: "@autohq/cli",
|
|
26293
|
-
version: "0.1.
|
|
26271
|
+
version: "0.1.138",
|
|
26294
26272
|
license: "SEE LICENSE IN README.md",
|
|
26295
26273
|
publishConfig: {
|
|
26296
26274
|
access: "public"
|
package/dist/index.js
CHANGED
|
@@ -18062,7 +18062,7 @@ function isChatMessageEvent(trigger) {
|
|
|
18062
18062
|
function hasFilterValue(trigger, path2, expected) {
|
|
18063
18063
|
return trigger.where?.[path2] === expected;
|
|
18064
18064
|
}
|
|
18065
|
-
var RESOURCE_KIND_AGENT,
|
|
18065
|
+
var RESOURCE_KIND_AGENT, RESOURCE_KIND_SESSION, SESSION_HARNESSES, TriggerFilterScalarSchema, TriggerFilterPathSchema, TriggerFilterClauseSchema, TriggerFilterSchema, SessionTriggerCheckTimeoutSchema, TriggerEventSchema, TriggerEventsSchema, SessionTriggerSharedFields, SessionTriggerEventSourceFields, SessionTriggerBaseSchema, SessionTriggerDefinitionBaseSchema, SessionTriggerSchema, SessionApplyTriggerSchema, SessionHeartbeatTriggerBaseSchema, SessionHeartbeatTriggerSchema, SessionApplyHeartbeatTriggerSchema, SessionTriggerDefinitionSchema, SessionApplyTriggerDefinitionSchema, SessionTriggersSchema, SessionApplyTriggersSchema, AVATAR_ASSET_EXTENSIONS, MAX_AVATAR_ASSET_BYTES, MIN_AVATAR_ASSET_DIMENSION_PX, MAX_AVATAR_ASSET_DIMENSION_PX, PNG_SIGNATURE, SESSION_IDENTITY_DESCRIPTION_MAX_LENGTH, SHA256_HEX_PATTERN, SessionIdentitySchema, SessionSpecFieldsSchema, SessionSpecSchema, SessionApplySpecSchema, SessionStatusSchema, SessionResourceSchema, SessionApplyRequestSchema, SessionApplyTriggerReceiptSchema, SessionApplyResponseSchema, SESSION_TELEGRAM_IDENTITY_STATUSES, SessionTelegramIdentityStatusSchema, SessionPresenceIdentitySchema, SessionPresenceResponseSchema, SessionPresenceConnectRequestSchema, SessionPresenceConnectPendingSchema, SessionPresenceConnectResponseSchema, SessionPresenceIconRequestSchema, SessionPresenceIconResponseSchema, SessionPresenceCompleteResponseSchema;
|
|
18066
18066
|
var init_sessions = __esm({
|
|
18067
18067
|
"../../packages/schemas/src/sessions.ts"() {
|
|
18068
18068
|
"use strict";
|
|
@@ -18075,7 +18075,6 @@ var init_sessions = __esm({
|
|
|
18075
18075
|
init_tools();
|
|
18076
18076
|
init_trigger_router();
|
|
18077
18077
|
RESOURCE_KIND_AGENT = "agent";
|
|
18078
|
-
LEGACY_RESOURCE_KIND_SESSION = "session";
|
|
18079
18078
|
RESOURCE_KIND_SESSION = RESOURCE_KIND_AGENT;
|
|
18080
18079
|
SESSION_HARNESSES = ["claude-code"];
|
|
18081
18080
|
TriggerFilterScalarSchema = external_exports.union([
|
|
@@ -18595,16 +18594,7 @@ var init_project_service_accounts = __esm({
|
|
|
18595
18594
|
});
|
|
18596
18595
|
|
|
18597
18596
|
// ../../packages/schemas/src/project-resources.ts
|
|
18598
|
-
|
|
18599
|
-
if (isRecord(value) && value.kind === LEGACY_RESOURCE_KIND_SESSION) {
|
|
18600
|
-
return { ...value, kind: RESOURCE_KIND_SESSION };
|
|
18601
|
-
}
|
|
18602
|
-
return value;
|
|
18603
|
-
}
|
|
18604
|
-
function isRecord(value) {
|
|
18605
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
18606
|
-
}
|
|
18607
|
-
var EnvironmentApplyDocumentSchema, IdentityApplyDocumentSchema, SessionApplyDocumentSchema, ProjectApplyResourceSchema, PROJECT_RESOURCE_APPLY_ORDER, PROJECT_RESOURCE_KINDS, PROJECT_APPLY_RESOURCE_KINDS, ProjectDeleteResourceBaseSchema, ProjectDeleteResourceSchema, AVATAR_ASSET_CONTENT_TYPES, MAX_AVATAR_ASSET_BASE64_LENGTH, ProjectApplyAssetSchema, ProjectApplyAssetsSchema, AvatarAssetUploadRequestSchema, AvatarAssetUploadResponseSchema, ProjectApplyRequestSchema, ProjectApplySystemConfigSchema, ProjectAppliedResourceSchema, ProjectApplyDiagnosticSchema, ProjectApplyResponseResourceKindSchema, ProjectApplyResponseSchema;
|
|
18597
|
+
var EnvironmentApplyDocumentSchema, IdentityApplyDocumentSchema, SessionApplyDocumentSchema, ProjectApplyResourceSchema, PROJECT_RESOURCE_APPLY_ORDER, PROJECT_RESOURCE_KINDS, PROJECT_APPLY_RESOURCE_KINDS, ProjectDeleteResourceBaseSchema, ProjectDeleteResourceSchema, AVATAR_ASSET_CONTENT_TYPES, MAX_AVATAR_ASSET_BASE64_LENGTH, ProjectApplyAssetSchema, ProjectApplyAssetsSchema, AvatarAssetUploadRequestSchema, AvatarAssetUploadResponseSchema, ProjectApplyRequestSchema, ProjectApplySystemConfigSchema, ProjectAppliedResourceSchema, ProjectApplyDiagnosticSchema, ProjectApplyResponseSchema;
|
|
18608
18598
|
var init_project_resources = __esm({
|
|
18609
18599
|
"../../packages/schemas/src/project-resources.ts"() {
|
|
18610
18600
|
"use strict";
|
|
@@ -18626,14 +18616,11 @@ var init_project_resources = __esm({
|
|
|
18626
18616
|
RESOURCE_KIND_SESSION,
|
|
18627
18617
|
SessionApplyRequestSchema.shape.spec
|
|
18628
18618
|
);
|
|
18629
|
-
ProjectApplyResourceSchema = external_exports.
|
|
18630
|
-
|
|
18631
|
-
|
|
18632
|
-
|
|
18633
|
-
|
|
18634
|
-
SessionApplyDocumentSchema
|
|
18635
|
-
])
|
|
18636
|
-
);
|
|
18619
|
+
ProjectApplyResourceSchema = external_exports.discriminatedUnion("kind", [
|
|
18620
|
+
EnvironmentApplyDocumentSchema,
|
|
18621
|
+
IdentityApplyDocumentSchema,
|
|
18622
|
+
SessionApplyDocumentSchema
|
|
18623
|
+
]);
|
|
18637
18624
|
PROJECT_RESOURCE_APPLY_ORDER = [
|
|
18638
18625
|
RESOURCE_KIND_CONNECTION,
|
|
18639
18626
|
RESOURCE_KIND_IDENTITY,
|
|
@@ -18649,12 +18636,9 @@ var init_project_resources = __esm({
|
|
|
18649
18636
|
ProjectDeleteResourceBaseSchema = external_exports.object({
|
|
18650
18637
|
name: external_exports.string().trim().min(1)
|
|
18651
18638
|
});
|
|
18652
|
-
ProjectDeleteResourceSchema =
|
|
18653
|
-
|
|
18654
|
-
|
|
18655
|
-
kind: external_exports.enum(PROJECT_APPLY_RESOURCE_KINDS)
|
|
18656
|
-
})
|
|
18657
|
-
);
|
|
18639
|
+
ProjectDeleteResourceSchema = ProjectDeleteResourceBaseSchema.extend({
|
|
18640
|
+
kind: external_exports.enum(PROJECT_APPLY_RESOURCE_KINDS)
|
|
18641
|
+
});
|
|
18658
18642
|
AVATAR_ASSET_CONTENT_TYPES = ["image/png", "image/jpeg"];
|
|
18659
18643
|
MAX_AVATAR_ASSET_BASE64_LENGTH = Math.ceil(MAX_AVATAR_ASSET_BYTES / 3) * 4 + 4;
|
|
18660
18644
|
ProjectApplyAssetSchema = external_exports.object({
|
|
@@ -18710,12 +18694,6 @@ var init_project_resources = __esm({
|
|
|
18710
18694
|
]),
|
|
18711
18695
|
name: external_exports.string().min(1)
|
|
18712
18696
|
});
|
|
18713
|
-
ProjectApplyResponseResourceKindSchema = external_exports.union([
|
|
18714
|
-
external_exports.enum(PROJECT_RESOURCE_KINDS),
|
|
18715
|
-
external_exports.literal(LEGACY_RESOURCE_KIND_SESSION)
|
|
18716
|
-
]).transform(
|
|
18717
|
-
(kind) => kind === LEGACY_RESOURCE_KIND_SESSION ? RESOURCE_KIND_SESSION : kind
|
|
18718
|
-
);
|
|
18719
18697
|
ProjectApplyResponseSchema = external_exports.object({
|
|
18720
18698
|
dryRun: external_exports.boolean().default(false),
|
|
18721
18699
|
resources: external_exports.array(ProjectAppliedResourceSchema),
|
|
@@ -18724,14 +18702,14 @@ var init_project_resources = __esm({
|
|
|
18724
18702
|
plan: external_exports.array(
|
|
18725
18703
|
external_exports.object({
|
|
18726
18704
|
action: external_exports.enum(["create", "update", "unchanged", "archive"]),
|
|
18727
|
-
kind:
|
|
18705
|
+
kind: external_exports.enum(PROJECT_RESOURCE_KINDS),
|
|
18728
18706
|
name: external_exports.string().min(1),
|
|
18729
18707
|
uid: external_exports.string().min(1).optional()
|
|
18730
18708
|
})
|
|
18731
18709
|
).default([]),
|
|
18732
18710
|
pruned: external_exports.array(
|
|
18733
18711
|
external_exports.object({
|
|
18734
|
-
kind:
|
|
18712
|
+
kind: external_exports.enum(PROJECT_RESOURCE_KINDS),
|
|
18735
18713
|
name: external_exports.string().min(1),
|
|
18736
18714
|
uid: external_exports.string().min(1)
|
|
18737
18715
|
})
|
|
@@ -21226,7 +21204,7 @@ var init_package = __esm({
|
|
|
21226
21204
|
"package.json"() {
|
|
21227
21205
|
package_default = {
|
|
21228
21206
|
name: "@autohq/cli",
|
|
21229
|
-
version: "0.1.
|
|
21207
|
+
version: "0.1.138",
|
|
21230
21208
|
license: "SEE LICENSE IN README.md",
|
|
21231
21209
|
publishConfig: {
|
|
21232
21210
|
access: "public"
|
|
@@ -21548,7 +21526,7 @@ function discoverImports(document, path2, stack, imported) {
|
|
|
21548
21526
|
`Agent import cycle detected: ${[...stack, resolvedPath].join(" -> ")}`
|
|
21549
21527
|
);
|
|
21550
21528
|
}
|
|
21551
|
-
if (!
|
|
21529
|
+
if (!isRecord(document)) {
|
|
21552
21530
|
return;
|
|
21553
21531
|
}
|
|
21554
21532
|
for (const importPath of importPaths(document)) {
|
|
@@ -21569,7 +21547,7 @@ function compileAgentDocument(document, path2, stack, context) {
|
|
|
21569
21547
|
`Agent import cycle detected: ${[...stack, resolvedPath].join(" -> ")}`
|
|
21570
21548
|
);
|
|
21571
21549
|
}
|
|
21572
|
-
if (!
|
|
21550
|
+
if (!isRecord(document)) {
|
|
21573
21551
|
throw new Error(`Invalid agent authoring file ${path2}: expected object`);
|
|
21574
21552
|
}
|
|
21575
21553
|
const imports = importPaths(document).map(
|
|
@@ -21644,18 +21622,20 @@ function sanitizedAgentDocument(document) {
|
|
|
21644
21622
|
delete next.import;
|
|
21645
21623
|
delete next.imports;
|
|
21646
21624
|
delete next.remove;
|
|
21647
|
-
if (isRecord2(next.spec) && "remove" in next.spec) {
|
|
21648
|
-
const spec = { ...next.spec };
|
|
21649
|
-
delete spec.remove;
|
|
21650
|
-
next.spec = spec;
|
|
21651
|
-
}
|
|
21652
21625
|
return next;
|
|
21653
21626
|
}
|
|
21654
21627
|
function authoringDocumentApplyShape(document, path2) {
|
|
21655
21628
|
const sanitized = sanitizedAgentDocument(document);
|
|
21656
|
-
const
|
|
21657
|
-
|
|
21658
|
-
|
|
21629
|
+
const legacyEnvelopeFields = ["kind", "metadata", "spec"].filter(
|
|
21630
|
+
(field) => field in sanitized
|
|
21631
|
+
);
|
|
21632
|
+
if (legacyEnvelopeFields.length > 0) {
|
|
21633
|
+
throw new Error(
|
|
21634
|
+
`Invalid agent authoring file ${path2}: legacy resource envelope fields are no longer supported (${legacyEnvelopeFields.join(", ")}). Use root-level Agent facade fields instead.`
|
|
21635
|
+
);
|
|
21636
|
+
}
|
|
21637
|
+
const metadata = {};
|
|
21638
|
+
const spec = {};
|
|
21659
21639
|
for (const [key, value] of Object.entries(sanitized)) {
|
|
21660
21640
|
if (key === "kind" || key === "metadata" || key === "spec" || value === void 0) {
|
|
21661
21641
|
continue;
|
|
@@ -21682,20 +21662,20 @@ function authoringDocumentApplyShape(document, path2) {
|
|
|
21682
21662
|
}
|
|
21683
21663
|
}
|
|
21684
21664
|
return {
|
|
21685
|
-
kind,
|
|
21665
|
+
kind: RESOURCE_KIND_SESSION,
|
|
21686
21666
|
metadata,
|
|
21687
21667
|
spec: resolveFileBackedFields(spec, path2)
|
|
21688
21668
|
};
|
|
21689
21669
|
}
|
|
21690
21670
|
function finalizeAgentApplyShape(document) {
|
|
21691
|
-
if (!
|
|
21671
|
+
if (!isRecord(document) || !isRecord(document.spec)) {
|
|
21692
21672
|
return document;
|
|
21693
21673
|
}
|
|
21694
21674
|
const next = structuredClone(document);
|
|
21695
21675
|
const spec = next.spec;
|
|
21696
21676
|
if (Array.isArray(spec.triggers)) {
|
|
21697
21677
|
spec.triggers = spec.triggers.map((trigger) => {
|
|
21698
|
-
if (!
|
|
21678
|
+
if (!isRecord(trigger) || !("name" in trigger)) {
|
|
21699
21679
|
return trigger;
|
|
21700
21680
|
}
|
|
21701
21681
|
const compiledTrigger = { ...trigger };
|
|
@@ -21726,7 +21706,7 @@ function resolveFileBackedFields(spec, path2) {
|
|
|
21726
21706
|
};
|
|
21727
21707
|
}
|
|
21728
21708
|
function resolveFileBackedString(value, input) {
|
|
21729
|
-
if (!
|
|
21709
|
+
if (!isRecord(value) || !("file" in value)) {
|
|
21730
21710
|
return value;
|
|
21731
21711
|
}
|
|
21732
21712
|
const file2 = value.file;
|
|
@@ -21744,12 +21724,8 @@ function resolveFileBackedString(value, input) {
|
|
|
21744
21724
|
return readFileSync3(resolve(dirname4(input.path), filePath), "utf8");
|
|
21745
21725
|
}
|
|
21746
21726
|
function removalDirectives(document, path2) {
|
|
21747
|
-
const raw =
|
|
21748
|
-
|
|
21749
|
-
isRecord2(document.spec) && isRecord2(document.spec.remove) ? document.spec.remove : {},
|
|
21750
|
-
[]
|
|
21751
|
-
);
|
|
21752
|
-
if (!isRecord2(raw)) {
|
|
21727
|
+
const raw = isRecord(document.remove) ? document.remove : {};
|
|
21728
|
+
if (!isRecord(raw)) {
|
|
21753
21729
|
return [];
|
|
21754
21730
|
}
|
|
21755
21731
|
const directives = [];
|
|
@@ -21771,18 +21747,18 @@ function stringList(value, label) {
|
|
|
21771
21747
|
});
|
|
21772
21748
|
}
|
|
21773
21749
|
function applyRemoval(value, removal) {
|
|
21774
|
-
if (!
|
|
21750
|
+
if (!isRecord(value)) {
|
|
21775
21751
|
return value;
|
|
21776
21752
|
}
|
|
21777
21753
|
const next = structuredClone(value);
|
|
21778
|
-
if (!
|
|
21754
|
+
if (!isRecord(next.spec)) {
|
|
21779
21755
|
return next;
|
|
21780
21756
|
}
|
|
21781
21757
|
const spec = { ...next.spec };
|
|
21782
21758
|
next.spec = spec;
|
|
21783
21759
|
switch (removal.target) {
|
|
21784
21760
|
case "tools": {
|
|
21785
|
-
if (!
|
|
21761
|
+
if (!isRecord(spec[removal.target])) {
|
|
21786
21762
|
return next;
|
|
21787
21763
|
}
|
|
21788
21764
|
const collection = {
|
|
@@ -21820,7 +21796,7 @@ function mergeValues2(base, override, path2) {
|
|
|
21820
21796
|
if (Array.isArray(base) && Array.isArray(override)) {
|
|
21821
21797
|
return mergeArrays(base, override, path2);
|
|
21822
21798
|
}
|
|
21823
|
-
if (
|
|
21799
|
+
if (isRecord(base) && isRecord(override)) {
|
|
21824
21800
|
const merged = { ...base };
|
|
21825
21801
|
for (const [key, value] of Object.entries(override)) {
|
|
21826
21802
|
merged[key] = mergeValues2(merged[key], value, [...path2, key]);
|
|
@@ -21863,7 +21839,7 @@ function isNamedArrayMergePath(path2) {
|
|
|
21863
21839
|
return path2 === "spec.mounts" || path2 === "spec.triggers";
|
|
21864
21840
|
}
|
|
21865
21841
|
function collectionItemKey(collection, item) {
|
|
21866
|
-
if (!
|
|
21842
|
+
if (!isRecord(item)) {
|
|
21867
21843
|
return void 0;
|
|
21868
21844
|
}
|
|
21869
21845
|
if (typeof item.name === "string") {
|
|
@@ -21895,7 +21871,7 @@ function isAgentFile(path2) {
|
|
|
21895
21871
|
return false;
|
|
21896
21872
|
}
|
|
21897
21873
|
}
|
|
21898
|
-
function
|
|
21874
|
+
function isRecord(value) {
|
|
21899
21875
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
21900
21876
|
}
|
|
21901
21877
|
var AGENT_FILE_EXTENSIONS, AGENT_SPEC_FIELDS, AGENT_METADATA_FIELDS;
|
|
@@ -21950,6 +21926,7 @@ function readProjectApplyRequest(options) {
|
|
|
21950
21926
|
return { ...request, assets: assets2 };
|
|
21951
21927
|
}
|
|
21952
21928
|
const directory = options.directory ?? join4(process.cwd(), ".auto");
|
|
21929
|
+
assertNoLegacySessionFiles(directory);
|
|
21953
21930
|
const files = applyFiles(directory);
|
|
21954
21931
|
if (files.length === 0) {
|
|
21955
21932
|
throw new Error(`No resource files found in ${directory}`);
|
|
@@ -22002,21 +21979,19 @@ function applyFiles(root) {
|
|
|
22002
21979
|
const files = [];
|
|
22003
21980
|
for (const kind of PROJECT_APPLY_RESOURCE_KINDS) {
|
|
22004
21981
|
const kindFiles = [];
|
|
22005
|
-
|
|
22006
|
-
|
|
22007
|
-
|
|
22008
|
-
|
|
22009
|
-
|
|
22010
|
-
|
|
22011
|
-
continue;
|
|
22012
|
-
}
|
|
22013
|
-
kindFiles.push(...resourceApplyFiles(path2, entries));
|
|
21982
|
+
const path2 = join4(root, primaryApplyDirectory(kind));
|
|
21983
|
+
let entries;
|
|
21984
|
+
try {
|
|
21985
|
+
entries = readdirSync3(path2, { withFileTypes: true });
|
|
21986
|
+
} catch {
|
|
21987
|
+
continue;
|
|
22014
21988
|
}
|
|
21989
|
+
kindFiles.push(...resourceApplyFiles(path2, entries));
|
|
22015
21990
|
const importedFiles = kind === RESOURCE_KIND_SESSION ? importedAgentAuthoringPaths(kindFiles) : /* @__PURE__ */ new Set();
|
|
22016
21991
|
const appliedFiles = kind === RESOURCE_KIND_SESSION ? kindFiles.filter(
|
|
22017
|
-
(
|
|
21992
|
+
(path3) => !importedFiles.has(resolve2(path3)) && !isSharedAgentAuthoringFile(root, path3)
|
|
22018
21993
|
) : kindFiles;
|
|
22019
|
-
files.push(...appliedFiles.map((
|
|
21994
|
+
files.push(...appliedFiles.map((path3) => ({ kind, path: path3 })));
|
|
22020
21995
|
}
|
|
22021
21996
|
return files;
|
|
22022
21997
|
}
|
|
@@ -22025,6 +22000,22 @@ function isSharedAgentAuthoringFile(root, path2) {
|
|
|
22025
22000
|
const resolvedPath = resolve2(path2);
|
|
22026
22001
|
return resolvedPath.startsWith(`${agentsSharedRoot}/`);
|
|
22027
22002
|
}
|
|
22003
|
+
function assertNoLegacySessionFiles(root) {
|
|
22004
|
+
const path2 = join4(root, "sessions");
|
|
22005
|
+
let entries;
|
|
22006
|
+
try {
|
|
22007
|
+
entries = readdirSync3(path2, { withFileTypes: true });
|
|
22008
|
+
} catch {
|
|
22009
|
+
return;
|
|
22010
|
+
}
|
|
22011
|
+
const files = resourceApplyFiles(path2, entries);
|
|
22012
|
+
if (files.length === 0) {
|
|
22013
|
+
return;
|
|
22014
|
+
}
|
|
22015
|
+
throw new Error(
|
|
22016
|
+
`Legacy .auto/sessions files are no longer supported. Move ${files.length === 1 ? "this file" : "these files"} to .auto/agents and use the root-level Agent facade format: ${files.join(", ")}`
|
|
22017
|
+
);
|
|
22018
|
+
}
|
|
22028
22019
|
function mcpOAuthSessionToolConnectionsFromSessionTools(input) {
|
|
22029
22020
|
return Object.entries(input.tools).flatMap(([alias, tool]) => {
|
|
22030
22021
|
if (tool.kind !== "mcp_remote" || tool.disabled || tool.auth.kind !== "mcp_oauth") {
|
|
@@ -22197,23 +22188,19 @@ function isInside(path2, parent) {
|
|
|
22197
22188
|
return path2.startsWith(`${parent}/`);
|
|
22198
22189
|
}
|
|
22199
22190
|
function applyCandidate(document) {
|
|
22200
|
-
if (!
|
|
22191
|
+
if (!isRecord2(document) || !("kind" in document)) {
|
|
22201
22192
|
return { kind: RESOURCE_KIND_SESSION, value: document };
|
|
22202
22193
|
}
|
|
22203
|
-
if (document.kind ===
|
|
22204
|
-
|
|
22205
|
-
kind
|
|
22206
|
-
|
|
22207
|
-
metadata: document.metadata,
|
|
22208
|
-
spec: document.spec
|
|
22209
|
-
}
|
|
22210
|
-
};
|
|
22194
|
+
if (document.kind === "session") {
|
|
22195
|
+
throw new Error(
|
|
22196
|
+
'Legacy resource kind "session" is no longer supported. Use .auto/agents with the root-level Agent facade format.'
|
|
22197
|
+
);
|
|
22211
22198
|
}
|
|
22212
22199
|
if (!PROJECT_APPLY_RESOURCE_KINDS.includes(
|
|
22213
22200
|
document.kind
|
|
22214
22201
|
)) {
|
|
22215
22202
|
throw new Error(
|
|
22216
|
-
`Unsupported apply resource kind "${String(document.kind)}"; supported kinds are ${PROJECT_APPLY_RESOURCE_KINDS.map((kind2) => `"${kind2}"`).join(", ")}
|
|
22203
|
+
`Unsupported apply resource kind "${String(document.kind)}"; supported kinds are ${PROJECT_APPLY_RESOURCE_KINDS.map((kind2) => `"${kind2}"`).join(", ")}`
|
|
22217
22204
|
);
|
|
22218
22205
|
}
|
|
22219
22206
|
const kind = document.kind;
|
|
@@ -22225,13 +22212,10 @@ function applyCandidate(document) {
|
|
|
22225
22212
|
}
|
|
22226
22213
|
};
|
|
22227
22214
|
}
|
|
22228
|
-
function applyDirectories(kind) {
|
|
22229
|
-
return [...LEGACY_APPLY_DIRECTORIES[kind] ?? [], APPLY_DIRECTORIES[kind]];
|
|
22230
|
-
}
|
|
22231
22215
|
function primaryApplyDirectory(kind) {
|
|
22232
22216
|
return APPLY_DIRECTORIES[kind];
|
|
22233
22217
|
}
|
|
22234
|
-
function
|
|
22218
|
+
function isRecord2(value) {
|
|
22235
22219
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
22236
22220
|
}
|
|
22237
22221
|
function resourceApplyFiles(directory, entries) {
|
|
@@ -22250,7 +22234,7 @@ function resourceApplyFiles(directory, entries) {
|
|
|
22250
22234
|
}
|
|
22251
22235
|
return files.sort((left, right) => left.localeCompare(right));
|
|
22252
22236
|
}
|
|
22253
|
-
var APPLY_DIRECTORIES,
|
|
22237
|
+
var APPLY_DIRECTORIES, APPLY_SCHEMAS, ALLOWED_AVATAR_EXTENSIONS;
|
|
22254
22238
|
var init_files = __esm({
|
|
22255
22239
|
"src/commands/apply/files.ts"() {
|
|
22256
22240
|
"use strict";
|
|
@@ -22261,9 +22245,6 @@ var init_files = __esm({
|
|
|
22261
22245
|
identity: "identities",
|
|
22262
22246
|
agent: "agents"
|
|
22263
22247
|
};
|
|
22264
|
-
LEGACY_APPLY_DIRECTORIES = {
|
|
22265
|
-
[RESOURCE_KIND_SESSION]: ["sessions"]
|
|
22266
|
-
};
|
|
22267
22248
|
APPLY_SCHEMAS = {
|
|
22268
22249
|
environment: EnvironmentApplyRequestSchema,
|
|
22269
22250
|
identity: IdentityApplyRequestSchema,
|
|
@@ -22563,11 +22544,8 @@ function parseProjectResourceReference(resource) {
|
|
|
22563
22544
|
if (!PROJECT_APPLY_RESOURCE_KINDS.includes(
|
|
22564
22545
|
kind
|
|
22565
22546
|
)) {
|
|
22566
|
-
if (kind === LEGACY_RESOURCE_KIND_SESSION) {
|
|
22567
|
-
return { kind: RESOURCE_KIND_SESSION, name };
|
|
22568
|
-
}
|
|
22569
22547
|
throw new Error(
|
|
22570
|
-
`Unsupported resource kind "${kind}"; supported kinds are ${PROJECT_APPLY_RESOURCE_KINDS.map((value) => `"${value}"`).join(", ")}
|
|
22548
|
+
`Unsupported resource kind "${kind}"; supported kinds are ${PROJECT_APPLY_RESOURCE_KINDS.map((value) => `"${value}"`).join(", ")}`
|
|
22571
22549
|
);
|
|
22572
22550
|
}
|
|
22573
22551
|
return {
|