@autohq/cli 0.1.305 → 0.1.306

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.
@@ -23399,7 +23399,7 @@ Object.assign(lookup, {
23399
23399
  // package.json
23400
23400
  var package_default = {
23401
23401
  name: "@autohq/cli",
23402
- version: "0.1.305",
23402
+ version: "0.1.306",
23403
23403
  license: "SEE LICENSE IN README.md",
23404
23404
  publishConfig: {
23405
23405
  access: "public"
@@ -27314,6 +27314,30 @@ function openAiTier(rates) {
27314
27314
  };
27315
27315
  }
27316
27316
 
27317
+ // ../../packages/schemas/src/project-config.ts
27318
+ var RESOURCE_KIND_CONFIG = "config";
27319
+ var ProjectConfigSpecSchema = external_exports.object({
27320
+ defaultAgent: ResourceNameSchema.optional()
27321
+ }).strict();
27322
+ var ProjectConfigResourceSchema = resourceEnvelopeSchema(
27323
+ ProjectConfigSpecSchema
27324
+ );
27325
+ var ProjectConfigApplyRequestSchema = resourceApplySchema(
27326
+ ProjectConfigSpecSchema
27327
+ );
27328
+ var PROJECT_DEFAULT_AGENT_SOURCES = [
27329
+ "config",
27330
+ "setting",
27331
+ "first_agent"
27332
+ ];
27333
+ var ProjectDefaultAgentSourceSchema = external_exports.enum(
27334
+ PROJECT_DEFAULT_AGENT_SOURCES
27335
+ );
27336
+ var ProjectDefaultAgentSchema = external_exports.object({
27337
+ agentName: ResourceNameSchema,
27338
+ source: ProjectDefaultAgentSourceSchema
27339
+ });
27340
+
27317
27341
  // ../../packages/schemas/src/project-service-accounts.ts
27318
27342
  var ProjectServiceAccountSchema = external_exports.object({
27319
27343
  id: ServiceAccountIdSchema,
@@ -27358,22 +27382,29 @@ var AgentApplyDocumentSchema = resourceApplyDocumentSchema(
27358
27382
  RESOURCE_KIND_AGENT,
27359
27383
  AgentApplyRequestSchema.shape.spec
27360
27384
  );
27385
+ var ConfigApplyDocumentSchema = resourceApplyDocumentSchema(
27386
+ RESOURCE_KIND_CONFIG,
27387
+ ProjectConfigApplyRequestSchema.shape.spec
27388
+ );
27361
27389
  var ProjectApplyResourceSchema = external_exports.discriminatedUnion("kind", [
27362
27390
  EnvironmentApplyDocumentSchema,
27363
27391
  IdentityApplyDocumentSchema,
27364
- AgentApplyDocumentSchema
27392
+ AgentApplyDocumentSchema,
27393
+ ConfigApplyDocumentSchema
27365
27394
  ]);
27366
27395
  var PROJECT_RESOURCE_APPLY_ORDER = [
27367
27396
  RESOURCE_KIND_CONNECTION,
27368
27397
  RESOURCE_KIND_IDENTITY,
27369
27398
  RESOURCE_KIND_ENVIRONMENT,
27370
- RESOURCE_KIND_AGENT
27399
+ RESOURCE_KIND_AGENT,
27400
+ RESOURCE_KIND_CONFIG
27371
27401
  ];
27372
27402
  var PROJECT_RESOURCE_KINDS = PROJECT_RESOURCE_APPLY_ORDER;
27373
27403
  var PROJECT_APPLY_RESOURCE_KINDS = [
27374
27404
  RESOURCE_KIND_IDENTITY,
27375
27405
  RESOURCE_KIND_ENVIRONMENT,
27376
- RESOURCE_KIND_AGENT
27406
+ RESOURCE_KIND_AGENT,
27407
+ RESOURCE_KIND_CONFIG
27377
27408
  ];
27378
27409
  var PROJECT_APPLY_BUNDLE_VERSION = 1;
27379
27410
  var MAX_PROJECT_APPLY_BUNDLE_BYTES = 64 * 1024 * 1024;
@@ -27484,7 +27515,8 @@ var ProjectAppliedResourceSchema = external_exports.union([
27484
27515
  ProjectConnectionAllocationResourceSchema,
27485
27516
  EnvironmentResourceSchema,
27486
27517
  IdentityResourceSchema,
27487
- AgentResourceSchema
27518
+ AgentResourceSchema,
27519
+ ProjectConfigResourceSchema
27488
27520
  ]);
27489
27521
  var ProjectApplyDiagnosticSchema = external_exports.object({
27490
27522
  // "info" is a non-blocking advisory (e.g. template-push capability/override
@@ -27499,7 +27531,8 @@ var ProjectApplyDiagnosticSchema = external_exports.object({
27499
27531
  RESOURCE_KIND_CONNECTION,
27500
27532
  RESOURCE_KIND_ENVIRONMENT,
27501
27533
  RESOURCE_KIND_IDENTITY,
27502
- RESOURCE_KIND_AGENT
27534
+ RESOURCE_KIND_AGENT,
27535
+ RESOURCE_KIND_CONFIG
27503
27536
  ]),
27504
27537
  name: external_exports.string().min(1)
27505
27538
  });
package/dist/index.js CHANGED
@@ -19022,6 +19022,40 @@ var init_pricing = __esm({
19022
19022
  }
19023
19023
  });
19024
19024
 
19025
+ // ../../packages/schemas/src/project-config.ts
19026
+ var RESOURCE_KIND_CONFIG, PROJECT_CONFIG_RESOURCE_NAME, PROJECT_CONFIG_FILE_NAME, ProjectConfigSpecSchema, ProjectConfigResourceSchema, ProjectConfigApplyRequestSchema, PROJECT_DEFAULT_AGENT_SOURCES, ProjectDefaultAgentSourceSchema, ProjectDefaultAgentSchema;
19027
+ var init_project_config = __esm({
19028
+ "../../packages/schemas/src/project-config.ts"() {
19029
+ "use strict";
19030
+ init_zod();
19031
+ init_resources();
19032
+ RESOURCE_KIND_CONFIG = "config";
19033
+ PROJECT_CONFIG_RESOURCE_NAME = "project";
19034
+ PROJECT_CONFIG_FILE_NAME = "config.yaml";
19035
+ ProjectConfigSpecSchema = external_exports.object({
19036
+ defaultAgent: ResourceNameSchema.optional()
19037
+ }).strict();
19038
+ ProjectConfigResourceSchema = resourceEnvelopeSchema(
19039
+ ProjectConfigSpecSchema
19040
+ );
19041
+ ProjectConfigApplyRequestSchema = resourceApplySchema(
19042
+ ProjectConfigSpecSchema
19043
+ );
19044
+ PROJECT_DEFAULT_AGENT_SOURCES = [
19045
+ "config",
19046
+ "setting",
19047
+ "first_agent"
19048
+ ];
19049
+ ProjectDefaultAgentSourceSchema = external_exports.enum(
19050
+ PROJECT_DEFAULT_AGENT_SOURCES
19051
+ );
19052
+ ProjectDefaultAgentSchema = external_exports.object({
19053
+ agentName: ResourceNameSchema,
19054
+ source: ProjectDefaultAgentSourceSchema
19055
+ });
19056
+ }
19057
+ });
19058
+
19025
19059
  // ../../packages/schemas/src/project-service-accounts.ts
19026
19060
  var ProjectServiceAccountSchema, ProjectServiceAccountCreateRequestSchema, ProjectServiceAccountUpdateRequestSchema, ProjectServiceAccountTokenResponseSchema, ProjectServiceAccountUpdateResponseSchema, ProjectServiceAccountRemoveResponseSchema, ProjectServiceAccountListResponseSchema;
19027
19061
  var init_project_service_accounts = __esm({
@@ -19067,7 +19101,7 @@ var init_project_service_accounts = __esm({
19067
19101
  function projectApplyBundleStorageKey(sha256) {
19068
19102
  return `project-apply-bundles/${sha256}.json`;
19069
19103
  }
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;
19104
+ var EnvironmentApplyDocumentSchema, IdentityApplyDocumentSchema, AgentApplyDocumentSchema, ConfigApplyDocumentSchema, 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
19105
  var init_project_resources = __esm({
19072
19106
  "../../packages/schemas/src/project-resources.ts"() {
19073
19107
  "use strict";
@@ -19079,6 +19113,7 @@ var init_project_resources = __esm({
19079
19113
  init_identities();
19080
19114
  init_ids();
19081
19115
  init_primitives();
19116
+ init_project_config();
19082
19117
  init_resources();
19083
19118
  init_trigger_router();
19084
19119
  EnvironmentApplyDocumentSchema = resourceApplyDocumentSchema(
@@ -19093,22 +19128,29 @@ var init_project_resources = __esm({
19093
19128
  RESOURCE_KIND_AGENT,
19094
19129
  AgentApplyRequestSchema.shape.spec
19095
19130
  );
19131
+ ConfigApplyDocumentSchema = resourceApplyDocumentSchema(
19132
+ RESOURCE_KIND_CONFIG,
19133
+ ProjectConfigApplyRequestSchema.shape.spec
19134
+ );
19096
19135
  ProjectApplyResourceSchema = external_exports.discriminatedUnion("kind", [
19097
19136
  EnvironmentApplyDocumentSchema,
19098
19137
  IdentityApplyDocumentSchema,
19099
- AgentApplyDocumentSchema
19138
+ AgentApplyDocumentSchema,
19139
+ ConfigApplyDocumentSchema
19100
19140
  ]);
19101
19141
  PROJECT_RESOURCE_APPLY_ORDER = [
19102
19142
  RESOURCE_KIND_CONNECTION,
19103
19143
  RESOURCE_KIND_IDENTITY,
19104
19144
  RESOURCE_KIND_ENVIRONMENT,
19105
- RESOURCE_KIND_AGENT
19145
+ RESOURCE_KIND_AGENT,
19146
+ RESOURCE_KIND_CONFIG
19106
19147
  ];
19107
19148
  PROJECT_RESOURCE_KINDS = PROJECT_RESOURCE_APPLY_ORDER;
19108
19149
  PROJECT_APPLY_RESOURCE_KINDS = [
19109
19150
  RESOURCE_KIND_IDENTITY,
19110
19151
  RESOURCE_KIND_ENVIRONMENT,
19111
- RESOURCE_KIND_AGENT
19152
+ RESOURCE_KIND_AGENT,
19153
+ RESOURCE_KIND_CONFIG
19112
19154
  ];
19113
19155
  PROJECT_APPLY_BUNDLE_VERSION = 1;
19114
19156
  MAX_PROJECT_APPLY_BUNDLE_BYTES = 64 * 1024 * 1024;
@@ -19216,7 +19258,8 @@ var init_project_resources = __esm({
19216
19258
  ProjectConnectionAllocationResourceSchema,
19217
19259
  EnvironmentResourceSchema,
19218
19260
  IdentityResourceSchema,
19219
- AgentResourceSchema
19261
+ AgentResourceSchema,
19262
+ ProjectConfigResourceSchema
19220
19263
  ]);
19221
19264
  ProjectApplyDiagnosticSchema = external_exports.object({
19222
19265
  // "info" is a non-blocking advisory (e.g. template-push capability/override
@@ -19231,7 +19274,8 @@ var init_project_resources = __esm({
19231
19274
  RESOURCE_KIND_CONNECTION,
19232
19275
  RESOURCE_KIND_ENVIRONMENT,
19233
19276
  RESOURCE_KIND_IDENTITY,
19234
- RESOURCE_KIND_AGENT
19277
+ RESOURCE_KIND_AGENT,
19278
+ RESOURCE_KIND_CONFIG
19235
19279
  ]),
19236
19280
  name: external_exports.string().min(1)
19237
19281
  });
@@ -22772,6 +22816,7 @@ var init_src = __esm({
22772
22816
  init_mounts();
22773
22817
  init_pricing();
22774
22818
  init_provider_grants();
22819
+ init_project_config();
22775
22820
  init_project_service_accounts();
22776
22821
  init_project_resources();
22777
22822
  init_primitives();
@@ -25527,7 +25572,7 @@ var init_package = __esm({
25527
25572
  "package.json"() {
25528
25573
  package_default = {
25529
25574
  name: "@autohq/cli",
25530
- version: "0.1.305",
25575
+ version: "0.1.306",
25531
25576
  license: "SEE LICENSE IN README.md",
25532
25577
  publishConfig: {
25533
25578
  access: "public"
@@ -27397,7 +27442,7 @@ function mcpOAuthAgentToolConnectionsFromAppliedResources(resources) {
27397
27442
  });
27398
27443
  }
27399
27444
  function isProjectApplyResourceKind(kind) {
27400
- return kind === RESOURCE_KIND_CONNECTION || kind === RESOURCE_KIND_IDENTITY || kind === RESOURCE_KIND_ENVIRONMENT || kind === RESOURCE_KIND_AGENT;
27445
+ return kind === RESOURCE_KIND_CONNECTION || kind === RESOURCE_KIND_IDENTITY || kind === RESOURCE_KIND_ENVIRONMENT || kind === RESOURCE_KIND_AGENT || kind === RESOURCE_KIND_CONFIG;
27401
27446
  }
27402
27447
  function applyResourceKindError(request, response, plannedResources, index) {
27403
27448
  const planLabels = plannedResources.map(
@@ -27445,6 +27490,7 @@ var init_apply_result = __esm({
27445
27490
  init_connections();
27446
27491
  init_environments();
27447
27492
  init_identities();
27493
+ init_project_config();
27448
27494
  }
27449
27495
  });
27450
27496
 
@@ -27663,8 +27709,12 @@ function readProjectApplyDirectorySource(input) {
27663
27709
  }))
27664
27710
  );
27665
27711
  }
27666
- const resources = dedupeGeneratedResources(resourceRecords);
27667
- if (agentFiles.length === 0 && !input.allowEmpty) {
27712
+ const configResource = readProjectConfigResource(input.files, resourceRoot);
27713
+ const resources = [
27714
+ ...dedupeGeneratedResources(resourceRecords),
27715
+ ...configResource ? [configResource] : []
27716
+ ];
27717
+ if (agentFiles.length === 0 && !configResource && !input.allowEmpty) {
27668
27718
  throw new Error(input.emptyMessage ?? "No resource files found");
27669
27719
  }
27670
27720
  return ProjectApplyRequestSchema.parse({
@@ -27707,6 +27757,42 @@ function readProjectApplyDocumentSourceFile(file2, options = {}) {
27707
27757
  assets: {}
27708
27758
  });
27709
27759
  }
27760
+ function readProjectConfigResource(files, resourceRoot) {
27761
+ const configPaths = new Set(
27762
+ ["config.yaml", "config.yml"].map(
27763
+ (name) => sourcePathJoin(resourceRoot, name)
27764
+ )
27765
+ );
27766
+ const configFiles = files.filter(
27767
+ (file3) => configPaths.has(normalizeSourcePath(file3.path))
27768
+ );
27769
+ if (configFiles.length === 0) {
27770
+ return void 0;
27771
+ }
27772
+ if (configFiles.length > 1) {
27773
+ throw new Error(
27774
+ `Multiple project config files found: ${configFiles.map((file3) => file3.path).join(", ")}. Keep exactly one ${PROJECT_CONFIG_FILE_NAME}.`
27775
+ );
27776
+ }
27777
+ const file2 = configFiles[0];
27778
+ const documents = readDocumentsFromSource(file2);
27779
+ if (documents.length > 1) {
27780
+ throw new Error(
27781
+ `Invalid project config ${file2.path}: expected a single document`
27782
+ );
27783
+ }
27784
+ const parsed = ProjectConfigSpecSchema.safeParse(documents[0] ?? {});
27785
+ if (!parsed.success) {
27786
+ throw new Error(
27787
+ `Invalid project config ${file2.path}: ${parsed.error.message}`
27788
+ );
27789
+ }
27790
+ return {
27791
+ kind: RESOURCE_KIND_CONFIG,
27792
+ metadata: { name: PROJECT_CONFIG_RESOURCE_NAME },
27793
+ spec: parsed.data
27794
+ };
27795
+ }
27710
27796
  function assertNoLegacySessionSourceFiles(files, resourceRoot, displayResourceRoot2) {
27711
27797
  const legacyFiles = files.filter(
27712
27798
  (file2) => isResourceFileUnderDirectory(
@@ -27781,6 +27867,7 @@ var init_project_apply_files = __esm({
27781
27867
  init_agents();
27782
27868
  init_environments();
27783
27869
  init_identities();
27870
+ init_project_config();
27784
27871
  init_project_resources();
27785
27872
  init_templates();
27786
27873
  init_agent_authoring();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autohq/cli",
3
- "version": "0.1.305",
3
+ "version": "0.1.306",
4
4
  "license": "SEE LICENSE IN README.md",
5
5
  "publishConfig": {
6
6
  "access": "public"