@autohq/cli 0.1.436 → 0.1.438

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/index.js CHANGED
@@ -17584,6 +17584,347 @@ var init_connections = __esm({
17584
17584
  }
17585
17585
  });
17586
17586
 
17587
+ // ../../packages/schemas/src/default-agent.ts
17588
+ var BUILT_IN_DEFAULT_AGENT_NAME, BUILT_IN_DEFAULT_AGENT_TEMPLATE_NAME, BUILT_IN_DEFAULT_AGENT_TEMPLATE_SUBPATH, BUILT_IN_DEFAULT_AGENT_TEMPLATE_IMPORT;
17589
+ var init_default_agent = __esm({
17590
+ "../../packages/schemas/src/default-agent.ts"() {
17591
+ "use strict";
17592
+ BUILT_IN_DEFAULT_AGENT_NAME = "default";
17593
+ BUILT_IN_DEFAULT_AGENT_TEMPLATE_NAME = "@auto/default";
17594
+ BUILT_IN_DEFAULT_AGENT_TEMPLATE_SUBPATH = "fragments/default.yaml";
17595
+ BUILT_IN_DEFAULT_AGENT_TEMPLATE_IMPORT = `${BUILT_IN_DEFAULT_AGENT_TEMPLATE_NAME}@latest/${BUILT_IN_DEFAULT_AGENT_TEMPLATE_SUBPATH}`;
17596
+ }
17597
+ });
17598
+
17599
+ // ../../packages/schemas/src/dormant-capabilities.ts
17600
+ var DormantCapabilityConnectionSchema, DormantCapabilitySchema, DormantCapabilitiesSchema;
17601
+ var init_dormant_capabilities = __esm({
17602
+ "../../packages/schemas/src/dormant-capabilities.ts"() {
17603
+ "use strict";
17604
+ init_zod();
17605
+ DormantCapabilityConnectionSchema = external_exports.object({
17606
+ provider: external_exports.string().trim().min(1),
17607
+ connection: external_exports.string().trim().min(1)
17608
+ });
17609
+ DormantCapabilitySchema = external_exports.object({
17610
+ kind: external_exports.enum(["tool", "trigger"]),
17611
+ name: external_exports.string().trim().min(1),
17612
+ connections: external_exports.array(DormantCapabilityConnectionSchema).min(1)
17613
+ });
17614
+ DormantCapabilitiesSchema = external_exports.array(DormantCapabilitySchema);
17615
+ }
17616
+ });
17617
+
17618
+ // ../../packages/schemas/src/github-sync.ts
17619
+ var GITHUB_SYNC_AUTO_PATH, GITHUB_SYNC_CI_WATCHDOG_DEFAULT_DELAY_MS, GithubSyncRepositoryFullNameSchema, GithubSyncProductionBranchSchema, GithubSyncCiWatchdogWorkflowSchema, GithubSyncCiWatchdogSchema, GithubSyncBindingSchema, GithubSyncBindingCreateRequestSchema, GithubSyncInitialSyncSchema, GithubSyncBindingCreateResponseSchema, GithubSyncBindingListResponseSchema, GithubSyncTriggerArtifactSchema, GithubSyncWorkflowInputSchema, GithubSyncWorkflowResultSchema;
17620
+ var init_github_sync = __esm({
17621
+ "../../packages/schemas/src/github-sync.ts"() {
17622
+ "use strict";
17623
+ init_zod();
17624
+ init_ids();
17625
+ init_primitives();
17626
+ GITHUB_SYNC_AUTO_PATH = ".auto";
17627
+ GITHUB_SYNC_CI_WATCHDOG_DEFAULT_DELAY_MS = 15e3;
17628
+ GithubSyncRepositoryFullNameSchema = external_exports.string().trim().min(1).regex(/^[^/\s]+\/[^/\s]+$/, {
17629
+ message: "repository must be in owner/name form"
17630
+ });
17631
+ GithubSyncProductionBranchSchema = external_exports.string().trim().min(1).max(255).refine((branch) => !branch.startsWith("/") && !branch.endsWith("/"), {
17632
+ message: "branch must not start or end with /"
17633
+ });
17634
+ GithubSyncCiWatchdogWorkflowSchema = external_exports.object({
17635
+ workflowId: external_exports.string().trim().min(1).max(255)
17636
+ }).strict();
17637
+ GithubSyncCiWatchdogSchema = external_exports.object({
17638
+ workflows: external_exports.array(GithubSyncCiWatchdogWorkflowSchema).max(10).default([]),
17639
+ checkDelayMs: external_exports.number().int().nonnegative().default(GITHUB_SYNC_CI_WATCHDOG_DEFAULT_DELAY_MS)
17640
+ }).strict();
17641
+ GithubSyncBindingSchema = external_exports.object({
17642
+ id: external_exports.string().trim().min(1),
17643
+ organizationId: OrganizationIdSchema,
17644
+ projectId: ProjectIdSchema,
17645
+ providerGrantId: ProviderGrantIdSchema,
17646
+ installationId: external_exports.string().trim().min(1),
17647
+ repoFullName: GithubSyncRepositoryFullNameSchema,
17648
+ repoId: external_exports.string().trim().min(1).nullable(),
17649
+ productionBranch: GithubSyncProductionBranchSchema,
17650
+ autoPath: external_exports.literal(GITHUB_SYNC_AUTO_PATH),
17651
+ ciWatchdog: GithubSyncCiWatchdogSchema,
17652
+ enabled: external_exports.boolean(),
17653
+ lastPlannedSha: external_exports.string().trim().min(1).nullable(),
17654
+ lastAppliedSha: external_exports.string().trim().min(1).nullable(),
17655
+ createdAt: external_exports.string().datetime(),
17656
+ updatedAt: external_exports.string().datetime()
17657
+ });
17658
+ GithubSyncBindingCreateRequestSchema = external_exports.object({
17659
+ connection: external_exports.string().trim().min(1).optional(),
17660
+ repo: GithubSyncRepositoryFullNameSchema,
17661
+ repoId: external_exports.string().trim().min(1).optional(),
17662
+ branch: GithubSyncProductionBranchSchema.optional(),
17663
+ ciWatchdog: GithubSyncCiWatchdogSchema.optional()
17664
+ });
17665
+ GithubSyncInitialSyncSchema = external_exports.object({
17666
+ started: external_exports.boolean(),
17667
+ headSha: external_exports.string().trim().min(1).optional(),
17668
+ workflowId: external_exports.string().trim().min(1).optional(),
17669
+ reason: external_exports.enum([
17670
+ "no_auto_directory",
17671
+ "already_applied",
17672
+ "probe_failed",
17673
+ "start_failed"
17674
+ ]).optional()
17675
+ });
17676
+ GithubSyncBindingCreateResponseSchema = external_exports.object({
17677
+ binding: GithubSyncBindingSchema,
17678
+ created: external_exports.boolean(),
17679
+ initialSync: GithubSyncInitialSyncSchema.optional()
17680
+ });
17681
+ GithubSyncBindingListResponseSchema = external_exports.object({
17682
+ bindings: external_exports.array(GithubSyncBindingSchema)
17683
+ });
17684
+ GithubSyncTriggerArtifactSchema = external_exports.object({
17685
+ type: external_exports.string().trim().min(1),
17686
+ externalId: external_exports.string().trim().min(1),
17687
+ payload: JsonValueSchema.optional()
17688
+ }).strict();
17689
+ GithubSyncWorkflowInputSchema = external_exports.discriminatedUnion("kind", [
17690
+ external_exports.object({
17691
+ kind: external_exports.literal("pull_request"),
17692
+ bindingId: external_exports.string().trim().min(1),
17693
+ organizationId: OrganizationIdSchema,
17694
+ projectId: ProjectIdSchema,
17695
+ providerGrantId: ProviderGrantIdSchema,
17696
+ installationId: external_exports.string().trim().min(1),
17697
+ repoFullName: GithubSyncRepositoryFullNameSchema,
17698
+ repoId: external_exports.string().trim().min(1).optional(),
17699
+ productionBranch: GithubSyncProductionBranchSchema,
17700
+ autoPath: external_exports.literal(GITHUB_SYNC_AUTO_PATH),
17701
+ pullRequestNumber: external_exports.number().int().positive(),
17702
+ headSha: external_exports.string().trim().min(1),
17703
+ baseSha: external_exports.string().trim().min(1).optional(),
17704
+ baseRef: GithubSyncProductionBranchSchema,
17705
+ triggerArtifact: GithubSyncTriggerArtifactSchema.optional()
17706
+ }),
17707
+ external_exports.object({
17708
+ kind: external_exports.literal("push"),
17709
+ bindingId: external_exports.string().trim().min(1),
17710
+ organizationId: OrganizationIdSchema,
17711
+ projectId: ProjectIdSchema,
17712
+ providerGrantId: ProviderGrantIdSchema,
17713
+ installationId: external_exports.string().trim().min(1),
17714
+ repoFullName: GithubSyncRepositoryFullNameSchema,
17715
+ repoId: external_exports.string().trim().min(1).optional(),
17716
+ productionBranch: GithubSyncProductionBranchSchema,
17717
+ autoPath: external_exports.literal(GITHUB_SYNC_AUTO_PATH),
17718
+ ref: external_exports.string().trim().min(1),
17719
+ branch: GithubSyncProductionBranchSchema,
17720
+ before: external_exports.string().trim().min(1).optional(),
17721
+ after: external_exports.string().trim().min(1),
17722
+ triggerArtifact: GithubSyncTriggerArtifactSchema.optional()
17723
+ }),
17724
+ // Synthetic re-apply triggered by a managed-template version bump (not a
17725
+ // webhook). The tenant's `.auto` is unchanged — only our registry changed —
17726
+ // so this arm skips the `no_auto_changes` early-out and applies the production
17727
+ // branch HEAD (`after`, which the sweep resolves before starting the run).
17728
+ // It is otherwise push-shaped. `templateName`/`version` identify the drift
17729
+ // that triggered it (for the commit check + idempotent workflow id).
17730
+ external_exports.object({
17731
+ kind: external_exports.literal("template_push"),
17732
+ bindingId: external_exports.string().trim().min(1),
17733
+ organizationId: OrganizationIdSchema,
17734
+ projectId: ProjectIdSchema,
17735
+ providerGrantId: ProviderGrantIdSchema,
17736
+ installationId: external_exports.string().trim().min(1),
17737
+ repoFullName: GithubSyncRepositoryFullNameSchema,
17738
+ repoId: external_exports.string().trim().min(1).optional(),
17739
+ productionBranch: GithubSyncProductionBranchSchema,
17740
+ autoPath: external_exports.literal(GITHUB_SYNC_AUTO_PATH),
17741
+ before: external_exports.string().trim().min(1).optional(),
17742
+ after: external_exports.string().trim().min(1),
17743
+ templateName: external_exports.string().trim().min(1),
17744
+ version: external_exports.string().trim().min(1),
17745
+ triggerArtifact: GithubSyncTriggerArtifactSchema.optional()
17746
+ }),
17747
+ // Synthetic authoritative re-apply triggered by one durable connection
17748
+ // lifecycle occurrence. The event id makes retries reuse the same workflow,
17749
+ // while a later remove/re-allow occurrence can re-run at the same git SHA.
17750
+ external_exports.object({
17751
+ kind: external_exports.literal("connection_push"),
17752
+ bindingId: external_exports.string().trim().min(1),
17753
+ organizationId: OrganizationIdSchema,
17754
+ projectId: ProjectIdSchema,
17755
+ providerGrantId: ProviderGrantIdSchema,
17756
+ installationId: external_exports.string().trim().min(1),
17757
+ repoFullName: GithubSyncRepositoryFullNameSchema,
17758
+ repoId: external_exports.string().trim().min(1).optional(),
17759
+ productionBranch: GithubSyncProductionBranchSchema,
17760
+ autoPath: external_exports.literal(GITHUB_SYNC_AUTO_PATH),
17761
+ before: external_exports.string().trim().min(1).optional(),
17762
+ after: external_exports.string().trim().min(1),
17763
+ connectionEventId: external_exports.string().trim().min(1),
17764
+ triggerArtifact: GithubSyncTriggerArtifactSchema.optional()
17765
+ })
17766
+ ]);
17767
+ GithubSyncWorkflowResultSchema = external_exports.discriminatedUnion("status", [
17768
+ external_exports.object({
17769
+ status: external_exports.literal("skipped"),
17770
+ reason: external_exports.string().trim().min(1)
17771
+ }),
17772
+ external_exports.object({
17773
+ status: external_exports.literal("planned"),
17774
+ changed: external_exports.boolean(),
17775
+ checkRunId: external_exports.number().int().positive().optional()
17776
+ }),
17777
+ external_exports.object({
17778
+ status: external_exports.literal("applied"),
17779
+ changed: external_exports.boolean(),
17780
+ checkRunId: external_exports.number().int().positive().optional()
17781
+ }),
17782
+ external_exports.object({
17783
+ status: external_exports.literal("failed"),
17784
+ message: external_exports.string().trim().min(1),
17785
+ checkRunId: external_exports.number().int().positive().optional()
17786
+ })
17787
+ ]);
17788
+ }
17789
+ });
17790
+
17791
+ // ../../packages/schemas/src/github-credentials.ts
17792
+ var CreateRunGithubCredentialRequestSchema, RunGithubCredentialResponseSchema;
17793
+ var init_github_credentials = __esm({
17794
+ "../../packages/schemas/src/github-credentials.ts"() {
17795
+ "use strict";
17796
+ init_zod();
17797
+ CreateRunGithubCredentialRequestSchema = external_exports.object({
17798
+ host: external_exports.literal("github.com"),
17799
+ path: external_exports.string().trim().min(1).optional()
17800
+ });
17801
+ RunGithubCredentialResponseSchema = external_exports.object({
17802
+ username: external_exports.literal("x-access-token"),
17803
+ password: external_exports.string().min(1),
17804
+ expiresAt: external_exports.string().datetime()
17805
+ });
17806
+ }
17807
+ });
17808
+
17809
+ // ../../packages/schemas/src/github-mcp-catalog.ts
17810
+ var GITHUB_MCP_TOOL_NAMES, GITHUB_MCP_PROXY_TOOL_NAMES, GITHUB_MCP_SELECTABLE_TOOL_NAMES, GITHUB_MCP_MERGE_TOOLS, GITHUB_MCP_SECRETS_TOOLS, GITHUB_MCP_SECRETS_WRITE_TOOLS, GITHUB_MCP_WRITE_TOOLS, githubMcpToolNameSet, GITHUB_MCP_ATTRIBUTION_EXEMPT_PROXY_TOOLS, githubMcpWriteToolSet, githubMcpProxyToolSet, githubMcpMergeToolSet, githubMcpSecretsToolSet, githubMcpSecretsWriteToolSet;
17811
+ var init_github_mcp_catalog = __esm({
17812
+ "../../packages/schemas/src/github-mcp-catalog.ts"() {
17813
+ "use strict";
17814
+ GITHUB_MCP_TOOL_NAMES = [
17815
+ "actions_get",
17816
+ "actions_list",
17817
+ "actions_run_trigger",
17818
+ "add_comment_to_pending_review",
17819
+ "add_issue_comment",
17820
+ "add_reply_to_pull_request_comment",
17821
+ "create_branch",
17822
+ "create_or_update_file",
17823
+ "create_pull_request",
17824
+ "create_repository",
17825
+ "delete_file",
17826
+ "fork_repository",
17827
+ "get_commit",
17828
+ "get_file_contents",
17829
+ "get_job_logs",
17830
+ "get_label",
17831
+ "get_latest_release",
17832
+ "get_release_by_tag",
17833
+ "get_tag",
17834
+ "issue_read",
17835
+ "issue_write",
17836
+ "list_branches",
17837
+ "list_commits",
17838
+ "list_issue_types",
17839
+ "list_issues",
17840
+ "list_pull_requests",
17841
+ "list_releases",
17842
+ "list_repository_collaborators",
17843
+ "list_tags",
17844
+ "merge_pull_request",
17845
+ "pull_request_read",
17846
+ "pull_request_review_write",
17847
+ "push_files",
17848
+ "search_code",
17849
+ "search_commits",
17850
+ "search_issues",
17851
+ "search_pull_requests",
17852
+ "search_repositories",
17853
+ "sub_issue_write",
17854
+ "update_pull_request",
17855
+ "update_pull_request_branch"
17856
+ ];
17857
+ GITHUB_MCP_PROXY_TOOL_NAMES = [
17858
+ "actions_secret_list",
17859
+ "actions_secret_write",
17860
+ "delete_issue_comment",
17861
+ "download_comment_attachment",
17862
+ "enable_pull_request_auto_merge",
17863
+ "upsert_issue_comment"
17864
+ ];
17865
+ GITHUB_MCP_SELECTABLE_TOOL_NAMES = [
17866
+ ...GITHUB_MCP_TOOL_NAMES,
17867
+ ...GITHUB_MCP_PROXY_TOOL_NAMES
17868
+ ];
17869
+ GITHUB_MCP_MERGE_TOOLS = [
17870
+ "merge_pull_request",
17871
+ "enable_pull_request_auto_merge"
17872
+ ];
17873
+ GITHUB_MCP_SECRETS_TOOLS = [
17874
+ "actions_secret_list",
17875
+ "actions_secret_write"
17876
+ ];
17877
+ GITHUB_MCP_SECRETS_WRITE_TOOLS = [
17878
+ "actions_secret_write"
17879
+ ];
17880
+ GITHUB_MCP_WRITE_TOOLS = [
17881
+ "actions_run_trigger",
17882
+ "add_comment_to_pending_review",
17883
+ "add_issue_comment",
17884
+ "add_reply_to_pull_request_comment",
17885
+ "create_branch",
17886
+ "create_or_update_file",
17887
+ "create_pull_request",
17888
+ "create_repository",
17889
+ "delete_file",
17890
+ "fork_repository",
17891
+ "issue_write",
17892
+ "merge_pull_request",
17893
+ "pull_request_review_write",
17894
+ "push_files",
17895
+ "sub_issue_write",
17896
+ "update_pull_request",
17897
+ "update_pull_request_branch"
17898
+ ];
17899
+ githubMcpToolNameSet = new Set(
17900
+ GITHUB_MCP_TOOL_NAMES
17901
+ );
17902
+ GITHUB_MCP_ATTRIBUTION_EXEMPT_PROXY_TOOLS = /* @__PURE__ */ new Set([
17903
+ "actions_secret_list",
17904
+ "download_comment_attachment",
17905
+ "delete_issue_comment"
17906
+ ]);
17907
+ githubMcpWriteToolSet = /* @__PURE__ */ new Set([
17908
+ ...GITHUB_MCP_WRITE_TOOLS,
17909
+ ...GITHUB_MCP_PROXY_TOOL_NAMES.filter(
17910
+ (name) => !GITHUB_MCP_ATTRIBUTION_EXEMPT_PROXY_TOOLS.has(name)
17911
+ )
17912
+ ]);
17913
+ githubMcpProxyToolSet = new Set(
17914
+ GITHUB_MCP_PROXY_TOOL_NAMES
17915
+ );
17916
+ githubMcpMergeToolSet = new Set(
17917
+ GITHUB_MCP_MERGE_TOOLS
17918
+ );
17919
+ githubMcpSecretsToolSet = new Set(
17920
+ GITHUB_MCP_SECRETS_TOOLS
17921
+ );
17922
+ githubMcpSecretsWriteToolSet = new Set(
17923
+ GITHUB_MCP_SECRETS_WRITE_TOOLS
17924
+ );
17925
+ }
17926
+ });
17927
+
17587
17928
  // ../../packages/schemas/src/mounts.ts
17588
17929
  var AbsoluteMountPathSchema, GITHUB_MOUNT_CAPABILITY_LEVELS, GithubMountCapabilityLevelSchema, GITHUB_MOUNT_MERGE_CAPABILITY_LEVELS, GithubMountMergeCapabilityLevelSchema, DEFAULT_GITHUB_MOUNT_CAPABILITIES, GitMountAuthSchema, GitMountSchema, AgentMountSchema;
17589
17930
  var init_mounts = __esm({
@@ -17880,125 +18221,6 @@ var init_session_bindings = __esm({
17880
18221
  }
17881
18222
  });
17882
18223
 
17883
- // ../../packages/schemas/src/github-mcp-catalog.ts
17884
- var GITHUB_MCP_TOOL_NAMES, GITHUB_MCP_PROXY_TOOL_NAMES, GITHUB_MCP_SELECTABLE_TOOL_NAMES, GITHUB_MCP_MERGE_TOOLS, GITHUB_MCP_SECRETS_TOOLS, GITHUB_MCP_SECRETS_WRITE_TOOLS, GITHUB_MCP_WRITE_TOOLS, githubMcpToolNameSet, GITHUB_MCP_ATTRIBUTION_EXEMPT_PROXY_TOOLS, githubMcpWriteToolSet, githubMcpProxyToolSet, githubMcpMergeToolSet, githubMcpSecretsToolSet, githubMcpSecretsWriteToolSet;
17885
- var init_github_mcp_catalog = __esm({
17886
- "../../packages/schemas/src/github-mcp-catalog.ts"() {
17887
- "use strict";
17888
- GITHUB_MCP_TOOL_NAMES = [
17889
- "actions_get",
17890
- "actions_list",
17891
- "actions_run_trigger",
17892
- "add_comment_to_pending_review",
17893
- "add_issue_comment",
17894
- "add_reply_to_pull_request_comment",
17895
- "create_branch",
17896
- "create_or_update_file",
17897
- "create_pull_request",
17898
- "create_repository",
17899
- "delete_file",
17900
- "fork_repository",
17901
- "get_commit",
17902
- "get_file_contents",
17903
- "get_job_logs",
17904
- "get_label",
17905
- "get_latest_release",
17906
- "get_release_by_tag",
17907
- "get_tag",
17908
- "issue_read",
17909
- "issue_write",
17910
- "list_branches",
17911
- "list_commits",
17912
- "list_issue_types",
17913
- "list_issues",
17914
- "list_pull_requests",
17915
- "list_releases",
17916
- "list_repository_collaborators",
17917
- "list_tags",
17918
- "merge_pull_request",
17919
- "pull_request_read",
17920
- "pull_request_review_write",
17921
- "push_files",
17922
- "search_code",
17923
- "search_commits",
17924
- "search_issues",
17925
- "search_pull_requests",
17926
- "search_repositories",
17927
- "sub_issue_write",
17928
- "update_pull_request",
17929
- "update_pull_request_branch"
17930
- ];
17931
- GITHUB_MCP_PROXY_TOOL_NAMES = [
17932
- "actions_secret_list",
17933
- "actions_secret_write",
17934
- "delete_issue_comment",
17935
- "download_comment_attachment",
17936
- "enable_pull_request_auto_merge",
17937
- "upsert_issue_comment"
17938
- ];
17939
- GITHUB_MCP_SELECTABLE_TOOL_NAMES = [
17940
- ...GITHUB_MCP_TOOL_NAMES,
17941
- ...GITHUB_MCP_PROXY_TOOL_NAMES
17942
- ];
17943
- GITHUB_MCP_MERGE_TOOLS = [
17944
- "merge_pull_request",
17945
- "enable_pull_request_auto_merge"
17946
- ];
17947
- GITHUB_MCP_SECRETS_TOOLS = [
17948
- "actions_secret_list",
17949
- "actions_secret_write"
17950
- ];
17951
- GITHUB_MCP_SECRETS_WRITE_TOOLS = [
17952
- "actions_secret_write"
17953
- ];
17954
- GITHUB_MCP_WRITE_TOOLS = [
17955
- "actions_run_trigger",
17956
- "add_comment_to_pending_review",
17957
- "add_issue_comment",
17958
- "add_reply_to_pull_request_comment",
17959
- "create_branch",
17960
- "create_or_update_file",
17961
- "create_pull_request",
17962
- "create_repository",
17963
- "delete_file",
17964
- "fork_repository",
17965
- "issue_write",
17966
- "merge_pull_request",
17967
- "pull_request_review_write",
17968
- "push_files",
17969
- "sub_issue_write",
17970
- "update_pull_request",
17971
- "update_pull_request_branch"
17972
- ];
17973
- githubMcpToolNameSet = new Set(
17974
- GITHUB_MCP_TOOL_NAMES
17975
- );
17976
- GITHUB_MCP_ATTRIBUTION_EXEMPT_PROXY_TOOLS = /* @__PURE__ */ new Set([
17977
- "actions_secret_list",
17978
- "download_comment_attachment",
17979
- "delete_issue_comment"
17980
- ]);
17981
- githubMcpWriteToolSet = /* @__PURE__ */ new Set([
17982
- ...GITHUB_MCP_WRITE_TOOLS,
17983
- ...GITHUB_MCP_PROXY_TOOL_NAMES.filter(
17984
- (name) => !GITHUB_MCP_ATTRIBUTION_EXEMPT_PROXY_TOOLS.has(name)
17985
- )
17986
- ]);
17987
- githubMcpProxyToolSet = new Set(
17988
- GITHUB_MCP_PROXY_TOOL_NAMES
17989
- );
17990
- githubMcpMergeToolSet = new Set(
17991
- GITHUB_MCP_MERGE_TOOLS
17992
- );
17993
- githubMcpSecretsToolSet = new Set(
17994
- GITHUB_MCP_SECRETS_TOOLS
17995
- );
17996
- githubMcpSecretsWriteToolSet = new Set(
17997
- GITHUB_MCP_SECRETS_WRITE_TOOLS
17998
- );
17999
- }
18000
- });
18001
-
18002
18224
  // ../../packages/schemas/src/tools.ts
18003
18225
  function remoteMcpUrlSchema(input) {
18004
18226
  return external_exports.string().trim().url().refine(
@@ -18187,179 +18409,6 @@ var init_tools = __esm({
18187
18409
  }
18188
18410
  });
18189
18411
 
18190
- // ../../packages/schemas/src/github-sync.ts
18191
- var GITHUB_SYNC_AUTO_PATH, GITHUB_SYNC_CI_WATCHDOG_DEFAULT_DELAY_MS, GithubSyncRepositoryFullNameSchema, GithubSyncProductionBranchSchema, GithubSyncCiWatchdogWorkflowSchema, GithubSyncCiWatchdogSchema, GithubSyncBindingSchema, GithubSyncBindingCreateRequestSchema, GithubSyncInitialSyncSchema, GithubSyncBindingCreateResponseSchema, GithubSyncBindingListResponseSchema, GithubSyncTriggerArtifactSchema, GithubSyncWorkflowInputSchema, GithubSyncWorkflowResultSchema;
18192
- var init_github_sync = __esm({
18193
- "../../packages/schemas/src/github-sync.ts"() {
18194
- "use strict";
18195
- init_zod();
18196
- init_ids();
18197
- init_primitives();
18198
- GITHUB_SYNC_AUTO_PATH = ".auto";
18199
- GITHUB_SYNC_CI_WATCHDOG_DEFAULT_DELAY_MS = 15e3;
18200
- GithubSyncRepositoryFullNameSchema = external_exports.string().trim().min(1).regex(/^[^/\s]+\/[^/\s]+$/, {
18201
- message: "repository must be in owner/name form"
18202
- });
18203
- GithubSyncProductionBranchSchema = external_exports.string().trim().min(1).max(255).refine((branch) => !branch.startsWith("/") && !branch.endsWith("/"), {
18204
- message: "branch must not start or end with /"
18205
- });
18206
- GithubSyncCiWatchdogWorkflowSchema = external_exports.object({
18207
- workflowId: external_exports.string().trim().min(1).max(255)
18208
- }).strict();
18209
- GithubSyncCiWatchdogSchema = external_exports.object({
18210
- workflows: external_exports.array(GithubSyncCiWatchdogWorkflowSchema).max(10).default([]),
18211
- checkDelayMs: external_exports.number().int().nonnegative().default(GITHUB_SYNC_CI_WATCHDOG_DEFAULT_DELAY_MS)
18212
- }).strict();
18213
- GithubSyncBindingSchema = external_exports.object({
18214
- id: external_exports.string().trim().min(1),
18215
- organizationId: OrganizationIdSchema,
18216
- projectId: ProjectIdSchema,
18217
- providerGrantId: ProviderGrantIdSchema,
18218
- installationId: external_exports.string().trim().min(1),
18219
- repoFullName: GithubSyncRepositoryFullNameSchema,
18220
- repoId: external_exports.string().trim().min(1).nullable(),
18221
- productionBranch: GithubSyncProductionBranchSchema,
18222
- autoPath: external_exports.literal(GITHUB_SYNC_AUTO_PATH),
18223
- ciWatchdog: GithubSyncCiWatchdogSchema,
18224
- enabled: external_exports.boolean(),
18225
- lastPlannedSha: external_exports.string().trim().min(1).nullable(),
18226
- lastAppliedSha: external_exports.string().trim().min(1).nullable(),
18227
- createdAt: external_exports.string().datetime(),
18228
- updatedAt: external_exports.string().datetime()
18229
- });
18230
- GithubSyncBindingCreateRequestSchema = external_exports.object({
18231
- connection: external_exports.string().trim().min(1).optional(),
18232
- repo: GithubSyncRepositoryFullNameSchema,
18233
- repoId: external_exports.string().trim().min(1).optional(),
18234
- branch: GithubSyncProductionBranchSchema.optional(),
18235
- ciWatchdog: GithubSyncCiWatchdogSchema.optional()
18236
- });
18237
- GithubSyncInitialSyncSchema = external_exports.object({
18238
- started: external_exports.boolean(),
18239
- headSha: external_exports.string().trim().min(1).optional(),
18240
- workflowId: external_exports.string().trim().min(1).optional(),
18241
- reason: external_exports.enum([
18242
- "no_auto_directory",
18243
- "already_applied",
18244
- "probe_failed",
18245
- "start_failed"
18246
- ]).optional()
18247
- });
18248
- GithubSyncBindingCreateResponseSchema = external_exports.object({
18249
- binding: GithubSyncBindingSchema,
18250
- created: external_exports.boolean(),
18251
- initialSync: GithubSyncInitialSyncSchema.optional()
18252
- });
18253
- GithubSyncBindingListResponseSchema = external_exports.object({
18254
- bindings: external_exports.array(GithubSyncBindingSchema)
18255
- });
18256
- GithubSyncTriggerArtifactSchema = external_exports.object({
18257
- type: external_exports.string().trim().min(1),
18258
- externalId: external_exports.string().trim().min(1),
18259
- payload: JsonValueSchema.optional()
18260
- }).strict();
18261
- GithubSyncWorkflowInputSchema = external_exports.discriminatedUnion("kind", [
18262
- external_exports.object({
18263
- kind: external_exports.literal("pull_request"),
18264
- bindingId: external_exports.string().trim().min(1),
18265
- organizationId: OrganizationIdSchema,
18266
- projectId: ProjectIdSchema,
18267
- providerGrantId: ProviderGrantIdSchema,
18268
- installationId: external_exports.string().trim().min(1),
18269
- repoFullName: GithubSyncRepositoryFullNameSchema,
18270
- repoId: external_exports.string().trim().min(1).optional(),
18271
- productionBranch: GithubSyncProductionBranchSchema,
18272
- autoPath: external_exports.literal(GITHUB_SYNC_AUTO_PATH),
18273
- pullRequestNumber: external_exports.number().int().positive(),
18274
- headSha: external_exports.string().trim().min(1),
18275
- baseSha: external_exports.string().trim().min(1).optional(),
18276
- baseRef: GithubSyncProductionBranchSchema,
18277
- triggerArtifact: GithubSyncTriggerArtifactSchema.optional()
18278
- }),
18279
- external_exports.object({
18280
- kind: external_exports.literal("push"),
18281
- bindingId: external_exports.string().trim().min(1),
18282
- organizationId: OrganizationIdSchema,
18283
- projectId: ProjectIdSchema,
18284
- providerGrantId: ProviderGrantIdSchema,
18285
- installationId: external_exports.string().trim().min(1),
18286
- repoFullName: GithubSyncRepositoryFullNameSchema,
18287
- repoId: external_exports.string().trim().min(1).optional(),
18288
- productionBranch: GithubSyncProductionBranchSchema,
18289
- autoPath: external_exports.literal(GITHUB_SYNC_AUTO_PATH),
18290
- ref: external_exports.string().trim().min(1),
18291
- branch: GithubSyncProductionBranchSchema,
18292
- before: external_exports.string().trim().min(1).optional(),
18293
- after: external_exports.string().trim().min(1),
18294
- triggerArtifact: GithubSyncTriggerArtifactSchema.optional()
18295
- }),
18296
- // Synthetic re-apply triggered by a managed-template version bump (not a
18297
- // webhook). The tenant's `.auto` is unchanged — only our registry changed —
18298
- // so this arm skips the `no_auto_changes` early-out and applies the production
18299
- // branch HEAD (`after`, which the sweep resolves before starting the run).
18300
- // It is otherwise push-shaped. `templateName`/`version` identify the drift
18301
- // that triggered it (for the commit check + idempotent workflow id).
18302
- external_exports.object({
18303
- kind: external_exports.literal("template_push"),
18304
- bindingId: external_exports.string().trim().min(1),
18305
- organizationId: OrganizationIdSchema,
18306
- projectId: ProjectIdSchema,
18307
- providerGrantId: ProviderGrantIdSchema,
18308
- installationId: external_exports.string().trim().min(1),
18309
- repoFullName: GithubSyncRepositoryFullNameSchema,
18310
- repoId: external_exports.string().trim().min(1).optional(),
18311
- productionBranch: GithubSyncProductionBranchSchema,
18312
- autoPath: external_exports.literal(GITHUB_SYNC_AUTO_PATH),
18313
- before: external_exports.string().trim().min(1).optional(),
18314
- after: external_exports.string().trim().min(1),
18315
- templateName: external_exports.string().trim().min(1),
18316
- version: external_exports.string().trim().min(1),
18317
- triggerArtifact: GithubSyncTriggerArtifactSchema.optional()
18318
- }),
18319
- // Synthetic authoritative re-apply triggered by one durable connection
18320
- // lifecycle occurrence. The event id makes retries reuse the same workflow,
18321
- // while a later remove/re-allow occurrence can re-run at the same git SHA.
18322
- external_exports.object({
18323
- kind: external_exports.literal("connection_push"),
18324
- bindingId: external_exports.string().trim().min(1),
18325
- organizationId: OrganizationIdSchema,
18326
- projectId: ProjectIdSchema,
18327
- providerGrantId: ProviderGrantIdSchema,
18328
- installationId: external_exports.string().trim().min(1),
18329
- repoFullName: GithubSyncRepositoryFullNameSchema,
18330
- repoId: external_exports.string().trim().min(1).optional(),
18331
- productionBranch: GithubSyncProductionBranchSchema,
18332
- autoPath: external_exports.literal(GITHUB_SYNC_AUTO_PATH),
18333
- before: external_exports.string().trim().min(1).optional(),
18334
- after: external_exports.string().trim().min(1),
18335
- connectionEventId: external_exports.string().trim().min(1),
18336
- triggerArtifact: GithubSyncTriggerArtifactSchema.optional()
18337
- })
18338
- ]);
18339
- GithubSyncWorkflowResultSchema = external_exports.discriminatedUnion("status", [
18340
- external_exports.object({
18341
- status: external_exports.literal("skipped"),
18342
- reason: external_exports.string().trim().min(1)
18343
- }),
18344
- external_exports.object({
18345
- status: external_exports.literal("planned"),
18346
- changed: external_exports.boolean(),
18347
- checkRunId: external_exports.number().int().positive().optional()
18348
- }),
18349
- external_exports.object({
18350
- status: external_exports.literal("applied"),
18351
- changed: external_exports.boolean(),
18352
- checkRunId: external_exports.number().int().positive().optional()
18353
- }),
18354
- external_exports.object({
18355
- status: external_exports.literal("failed"),
18356
- message: external_exports.string().trim().min(1),
18357
- checkRunId: external_exports.number().int().positive().optional()
18358
- })
18359
- ]);
18360
- }
18361
- });
18362
-
18363
18412
  // ../../packages/schemas/src/trigger-router.ts
18364
18413
  function normalizeLegacyHeartbeatTickWorkflowInput(input) {
18365
18414
  if (!input || typeof input !== "object" || Array.isArray(input)) {
@@ -19041,7 +19090,7 @@ function isChatMessageEvent(trigger) {
19041
19090
  function hasFilterValue(trigger, path2, expected) {
19042
19091
  return trigger.where?.[path2] === expected;
19043
19092
  }
19044
- var RESOURCE_KIND_AGENT, AGENT_HARNESSES, AgentHarnessSchema, TriggerFilterScalarSchema, TriggerFilterPathSchema, TriggerFilterClauseSchema, TriggerFilterSchema, TriggerCheckTimeoutSchema, AgentArchiveAfterInactiveSchema, AgentSessionPolicySchema, AgentConcurrencySchema, AgentReplacePolicySchema, AgentManagesSchema, TriggerEventSchema, TriggerEventsSchema, PAYLOAD_PREFIXED_TEMPLATE_TOKEN, TriggerChecksField, TriggerEventSourceFields, TriggerSchema, ApplyTriggerSchema, HeartbeatTriggerSchema, ApplyHeartbeatTriggerSchema, TriggerDefinitionSchema, ApplyTriggerDefinitionSchema, TriggersSchema, ApplyTriggersSchema, AVATAR_ASSET_EXTENSIONS, MAX_AVATAR_ASSET_BYTES, MIN_AVATAR_ASSET_DIMENSION_PX, MAX_AVATAR_ASSET_DIMENSION_PX, PNG_SIGNATURE, AGENT_IDENTITY_DESCRIPTION_MAX_LENGTH, SHA256_HEX_PATTERN, AgentIdentitySchema, BINDING_LIFECYCLE_VALUES, BindingLifecycleSpecSchema, AgentBindingsSchema, AgentSpecFieldsSchema, AgentSpecSchema, AgentApplySpecFieldsSchema, AgentApplySpecSchema, AgentStatusSchema, AgentResourceOriginSchema, BuiltInAgentMetadataSchema, AgentResourceSchema, AgentApplyRequestSchema, ApplyTriggerReceiptSchema, AgentApplyResponseSchema, AGENT_TELEGRAM_IDENTITY_STATUSES, AgentTelegramIdentityStatusSchema, AgentPresenceIdentitySchema, AgentPresenceResponseSchema, AgentPresenceConnectRequestSchema, AgentPresenceConnectPendingSchema, AgentPresenceConnectResponseSchema, AgentPresenceIconRequestSchema, AgentPresenceIconResponseSchema, AgentPresenceCompleteResponseSchema;
19093
+ var RESOURCE_KIND_AGENT, AGENT_HARNESSES, AgentHarnessSchema, TriggerFilterScalarSchema, TriggerFilterPathSchema, TriggerFilterClauseSchema, TriggerFilterSchema, TriggerCheckTimeoutSchema, AgentArchiveAfterInactiveSchema, AgentSessionPolicySchema, AgentConcurrencySchema, AgentReplacePolicySchema, AgentManagesSchema, TriggerEventSchema, TriggerEventsSchema, PAYLOAD_PREFIXED_TEMPLATE_TOKEN, TriggerChecksField, TriggerEventSourceFields, TriggerSchema, ApplyTriggerSchema, HeartbeatTriggerSchema, ApplyHeartbeatTriggerSchema, TriggerDefinitionSchema, ApplyTriggerDefinitionSchema, TriggersSchema, ApplyTriggersSchema, AVATAR_ASSET_EXTENSIONS, MAX_AVATAR_ASSET_BYTES, MIN_AVATAR_ASSET_DIMENSION_PX, MAX_AVATAR_ASSET_DIMENSION_PX, PNG_SIGNATURE, AGENT_IDENTITY_DESCRIPTION_MAX_LENGTH, SHA256_HEX_PATTERN, AgentIdentitySchema, BINDING_LIFECYCLE_VALUES, BindingLifecycleSpecSchema, AgentBindingsSchema, AgentSpecFieldsSchema, AgentSpecSchema, AgentApplySpecFieldsSchema, AgentApplySpecSchema, AgentStatusSchema, AgentResourceOriginSchema, AgentResourceSchema, AgentApplyRequestSchema, ApplyTriggerReceiptSchema, AgentApplyResponseSchema, AGENT_TELEGRAM_IDENTITY_STATUSES, AgentTelegramIdentityStatusSchema, AgentPresenceIdentitySchema, AgentPresenceResponseSchema, AgentPresenceConnectRequestSchema, AgentPresenceConnectPendingSchema, AgentPresenceConnectResponseSchema, AgentPresenceIconRequestSchema, AgentPresenceIconResponseSchema, AgentPresenceCompleteResponseSchema;
19045
19094
  var init_agents = __esm({
19046
19095
  "../../packages/schemas/src/agents.ts"() {
19047
19096
  "use strict";
@@ -19297,18 +19346,11 @@ var init_agents = __esm({
19297
19346
  lastActivityAt: external_exports.string().datetime().nullable().default(null)
19298
19347
  }).default({ runCount: 0, lastActivityAt: null });
19299
19348
  AgentResourceOriginSchema = external_exports.enum(["authored", "built_in"]);
19300
- BuiltInAgentMetadataSchema = external_exports.object({
19301
- templateVersion: external_exports.string().trim().min(1),
19302
- harnessPinned: external_exports.boolean(),
19303
- authoredOverlay: JsonValueSchema.nullable(),
19304
- provenance: external_exports.record(external_exports.string().min(1), external_exports.enum(["built_in", "authored"]))
19305
- });
19306
19349
  AgentResourceSchema = resourceEnvelopeSchema(
19307
19350
  AgentSpecSchema
19308
19351
  ).extend({
19309
19352
  status: AgentStatusSchema,
19310
- origin: AgentResourceOriginSchema.optional(),
19311
- builtIn: BuiltInAgentMetadataSchema.optional()
19353
+ origin: AgentResourceOriginSchema.optional()
19312
19354
  });
19313
19355
  AgentApplyRequestSchema = resourceApplySchema(AgentApplySpecSchema);
19314
19356
  ApplyTriggerReceiptSchema = external_exports.object({
@@ -19422,166 +19464,6 @@ var init_agents = __esm({
19422
19464
  }
19423
19465
  });
19424
19466
 
19425
- // ../../packages/schemas/src/default-agent.ts
19426
- function builtInDefaultAgentSpec() {
19427
- return AgentApplySpecSchema.parse({
19428
- harness: BUILT_IN_DEFAULT_AGENT_RECOMMENDED_HARNESS,
19429
- environment: BUILT_IN_DEFAULT_AGENT_ENVIRONMENT_NAME,
19430
- identity: {
19431
- displayName: "Default",
19432
- username: BUILT_IN_DEFAULT_AGENT_NAME,
19433
- description: "Auto's built-in general-purpose agent."
19434
- },
19435
- tools: {
19436
- auto: {
19437
- kind: "local",
19438
- implementation: "auto"
19439
- }
19440
- }
19441
- });
19442
- }
19443
- function resolveBuiltInDefaultAgentSpec(input) {
19444
- const overlay = DefaultAgentOverlaySchema.parse(input);
19445
- const { remove, ...authoredSpec } = overlay;
19446
- const base = builtInDefaultAgentSpec();
19447
- const merged = mergeValues2(base, authoredSpec);
19448
- for (const name of remove?.env ?? []) {
19449
- removeKeyedEntry(merged, "env", name);
19450
- }
19451
- for (const name of remove?.tools ?? []) {
19452
- removeKeyedEntry(merged, "tools", name);
19453
- }
19454
- const harnessPinned = authoredSpec.harness !== void 0;
19455
- if ((authoredSpec.triggers?.length ?? 0) > 0 && !harnessPinned) {
19456
- throw new Error(
19457
- "Default agent triggers require an authored harness because unattended sessions cannot choose one"
19458
- );
19459
- }
19460
- const spec = AgentApplySpecSchema.parse(merged);
19461
- const provenance = {};
19462
- recordLeafProvenance(base, "", "built_in", provenance);
19463
- recordLeafProvenance(authoredSpec, "", "authored", provenance);
19464
- for (const name of remove?.env ?? []) {
19465
- delete provenance[`env.${name}`];
19466
- }
19467
- for (const name of remove?.tools ?? []) {
19468
- for (const key of Object.keys(provenance)) {
19469
- if (key === `tools.${name}` || key.startsWith(`tools.${name}.`)) {
19470
- delete provenance[key];
19471
- }
19472
- }
19473
- }
19474
- return { spec, harnessPinned, provenance };
19475
- }
19476
- function mergeValues2(base, overlay) {
19477
- if (overlay === void 0) {
19478
- return structuredClone(base);
19479
- }
19480
- if (isRecord(base) && isRecord(overlay)) {
19481
- const merged = structuredClone(base);
19482
- for (const [key, value] of Object.entries(overlay)) {
19483
- merged[key] = mergeValues2(merged[key], value);
19484
- }
19485
- return merged;
19486
- }
19487
- return structuredClone(overlay);
19488
- }
19489
- function removeKeyedEntry(spec, field, name) {
19490
- const entries = spec[field];
19491
- if (isRecord(entries)) {
19492
- delete entries[name];
19493
- }
19494
- }
19495
- function recordLeafProvenance(value, path2, source, output) {
19496
- if (isRecord(value)) {
19497
- if (path2) {
19498
- output[path2] = source;
19499
- }
19500
- const entries = Object.entries(value);
19501
- if (entries.length === 0 && path2) {
19502
- output[path2] = source;
19503
- return;
19504
- }
19505
- for (const [key, nested] of entries) {
19506
- recordLeafProvenance(
19507
- nested,
19508
- path2 ? `${path2}.${key}` : key,
19509
- source,
19510
- output
19511
- );
19512
- }
19513
- return;
19514
- }
19515
- output[path2] = source;
19516
- }
19517
- function isRecord(value) {
19518
- return Boolean(value) && typeof value === "object" && !Array.isArray(value);
19519
- }
19520
- var BUILT_IN_DEFAULT_AGENT_NAME, BUILT_IN_DEFAULT_AGENT_ENVIRONMENT_NAME, BUILT_IN_DEFAULT_AGENT_RECOMMENDED_HARNESS, BUILT_IN_DEFAULT_AGENT_OVERLAY_ANNOTATION, DefaultAgentRemovalSchema, DefaultAgentOverlaySchema;
19521
- var init_default_agent = __esm({
19522
- "../../packages/schemas/src/default-agent.ts"() {
19523
- "use strict";
19524
- init_zod();
19525
- init_agents();
19526
- init_resources();
19527
- BUILT_IN_DEFAULT_AGENT_NAME = "default";
19528
- BUILT_IN_DEFAULT_AGENT_ENVIRONMENT_NAME = "auto-default-runtime";
19529
- BUILT_IN_DEFAULT_AGENT_RECOMMENDED_HARNESS = "claude-code";
19530
- BUILT_IN_DEFAULT_AGENT_OVERLAY_ANNOTATION = "auto.dev/default-agent-overlay";
19531
- DefaultAgentRemovalSchema = external_exports.object({
19532
- env: external_exports.array(ResourceNameSchema).optional(),
19533
- tools: external_exports.array(ResourceNameSchema).optional(),
19534
- triggers: external_exports.array(ResourceNameSchema).optional()
19535
- }).strict();
19536
- DefaultAgentOverlaySchema = AgentApplySpecFieldsSchema.partial().extend({
19537
- env: AgentApplySpecFieldsSchema.shape.env.removeDefault().optional(),
19538
- mounts: AgentApplySpecFieldsSchema.shape.mounts.removeDefault().optional(),
19539
- triggers: AgentApplySpecFieldsSchema.shape.triggers.removeDefault().optional(),
19540
- session: AgentApplySpecFieldsSchema.shape.session.removeDefault().optional(),
19541
- bindings: AgentApplySpecFieldsSchema.shape.bindings.removeDefault().optional(),
19542
- tools: AgentApplySpecFieldsSchema.shape.tools.removeDefault().optional(),
19543
- remove: DefaultAgentRemovalSchema.optional()
19544
- }).strict();
19545
- }
19546
- });
19547
-
19548
- // ../../packages/schemas/src/dormant-capabilities.ts
19549
- var DormantCapabilityConnectionSchema, DormantCapabilitySchema, DormantCapabilitiesSchema;
19550
- var init_dormant_capabilities = __esm({
19551
- "../../packages/schemas/src/dormant-capabilities.ts"() {
19552
- "use strict";
19553
- init_zod();
19554
- DormantCapabilityConnectionSchema = external_exports.object({
19555
- provider: external_exports.string().trim().min(1),
19556
- connection: external_exports.string().trim().min(1)
19557
- });
19558
- DormantCapabilitySchema = external_exports.object({
19559
- kind: external_exports.enum(["tool", "trigger"]),
19560
- name: external_exports.string().trim().min(1),
19561
- connections: external_exports.array(DormantCapabilityConnectionSchema).min(1)
19562
- });
19563
- DormantCapabilitiesSchema = external_exports.array(DormantCapabilitySchema);
19564
- }
19565
- });
19566
-
19567
- // ../../packages/schemas/src/github-credentials.ts
19568
- var CreateRunGithubCredentialRequestSchema, RunGithubCredentialResponseSchema;
19569
- var init_github_credentials = __esm({
19570
- "../../packages/schemas/src/github-credentials.ts"() {
19571
- "use strict";
19572
- init_zod();
19573
- CreateRunGithubCredentialRequestSchema = external_exports.object({
19574
- host: external_exports.literal("github.com"),
19575
- path: external_exports.string().trim().min(1).optional()
19576
- });
19577
- RunGithubCredentialResponseSchema = external_exports.object({
19578
- username: external_exports.literal("x-access-token"),
19579
- password: external_exports.string().min(1),
19580
- expiresAt: external_exports.string().datetime()
19581
- });
19582
- }
19583
- });
19584
-
19585
19467
  // ../../packages/schemas/src/identities.ts
19586
19468
  var RESOURCE_KIND_IDENTITY, IdentitySpecSchema, IdentityResourceSchema, IdentityApplyRequestSchema;
19587
19469
  var init_identities = __esm({
@@ -20807,38 +20689,32 @@ var init_project_config = __esm({
20807
20689
  "../../packages/schemas/src/project-config.ts"() {
20808
20690
  "use strict";
20809
20691
  init_zod();
20692
+ init_agents();
20810
20693
  init_resources();
20811
20694
  RESOURCE_KIND_CONFIG = "config";
20812
20695
  PROJECT_CONFIG_RESOURCE_NAME = "project";
20813
20696
  PROJECT_CONFIG_FILE_NAME = "config.yaml";
20814
- ProjectConfigSpecSchema = external_exports.object({
20815
- defaultAgent: ResourceNameSchema.optional()
20816
- }).strict();
20697
+ ProjectConfigSpecSchema = external_exports.object({}).strict();
20817
20698
  ProjectConfigResourceSchema = resourceEnvelopeSchema(
20818
20699
  ProjectConfigSpecSchema
20819
20700
  );
20820
20701
  ProjectConfigApplyRequestSchema = resourceApplySchema(
20821
20702
  ProjectConfigSpecSchema
20822
20703
  );
20823
- PROJECT_DEFAULT_AGENT_SOURCES = [
20824
- "config",
20825
- "setting",
20826
- "first_agent"
20827
- ];
20704
+ PROJECT_DEFAULT_AGENT_SOURCES = ["built_in"];
20828
20705
  ProjectDefaultAgentSourceSchema = external_exports.enum(
20829
20706
  PROJECT_DEFAULT_AGENT_SOURCES
20830
20707
  );
20831
20708
  ProjectDefaultAgentSchema = external_exports.object({
20832
20709
  agentName: ResourceNameSchema,
20833
- source: ProjectDefaultAgentSourceSchema
20710
+ source: ProjectDefaultAgentSourceSchema,
20711
+ harness: AgentHarnessSchema.optional()
20834
20712
  });
20835
20713
  UpdateProjectSettingsRequestSchema = external_exports.object({
20836
- defaultAgentName: ResourceNameSchema.nullable().optional(),
20837
20714
  name: external_exports.string().trim().min(1).optional()
20838
- }).strict().refine(
20839
- (value) => value.defaultAgentName !== void 0 || value.name !== void 0,
20840
- { message: "At least one settings field is required" }
20841
- );
20715
+ }).strict().refine((value) => value.name !== void 0, {
20716
+ message: "At least one settings field is required"
20717
+ });
20842
20718
  }
20843
20719
  });
20844
20720
 
@@ -27043,6 +26919,17 @@ triggers:
27043
26919
  ]
27044
26920
  }
27045
26921
  ],
26922
+ "@auto/default": [
26923
+ {
26924
+ version: "1.0.0",
26925
+ files: [
26926
+ {
26927
+ path: "fragments/default.yaml",
26928
+ content: "harness: claude-code\nenvironment:\n name: auto-default-runtime\n image:\n kind: preset\n name: node24\nidentity:\n displayName: Default\n username: default\n description: Auto's built-in general-purpose agent.\ntools:\n auto:\n kind: local\n implementation: auto\n"
26929
+ }
26930
+ ]
26931
+ }
26932
+ ],
27046
26933
  "@auto/engineering-tier": [
27047
26934
  {
27048
26935
  version: "1.0.0",
@@ -42821,6 +42708,7 @@ var init_hardcoded = __esm({
42821
42708
  "@auto/chat-assistant": "A conversational assistant for direct sessions, with optional Slack mentions, threaded replies, and retained context.",
42822
42709
  "@auto/code-review": "A pull-request reviewer that posts one severity-ranked review comment and reports a check, with optional Slack verdict reporting.",
42823
42710
  "@auto/daily-digest": "A scheduled read-only analyst that delivers a daily shipped-code digest as its run report; a -slack entrypoint posts to Slack instead.",
42711
+ "@auto/default": "Auto's minimum general-purpose runtime contract, implicitly imported by the permanent Default agent in every project.",
42824
42712
  "@auto/engineering-tier": "An engineering-tier fleet: senior and junior engineers with PR ownership, a live-iteration designer, and a session introspector.",
42825
42713
  "@auto/handoff": "A handoff coder that takes ownership of delegated PRs or coding tasks and reports back when ready.",
42826
42714
  "@auto/incident-response": "A first responder for production alerts: investigates, delivers an evidence-based triage report, and opens a draft fix PR when the cause is clear; -slack entrypoint for channel triage.",
@@ -47309,7 +47197,7 @@ var init_package = __esm({
47309
47197
  "package.json"() {
47310
47198
  package_default = {
47311
47199
  name: "@autohq/cli",
47312
- version: "0.1.436",
47200
+ version: "0.1.438",
47313
47201
  license: "SEE LICENSE IN README.md",
47314
47202
  publishConfig: {
47315
47203
  access: "public"
@@ -47514,7 +47402,7 @@ function compileAgentDocument(document, path2, stack, context) {
47514
47402
  `Agent import cycle detected: ${[...stack, resolvedPath].join(" -> ")}`
47515
47403
  );
47516
47404
  }
47517
- if (!isRecord2(document)) {
47405
+ if (!isRecord(document)) {
47518
47406
  throw new Error(`Invalid agent authoring file ${path2}: expected object`);
47519
47407
  }
47520
47408
  const imports = importPaths(document).map(
@@ -47524,7 +47412,7 @@ function compileAgentDocument(document, path2, stack, context) {
47524
47412
  let merged = {};
47525
47413
  for (const imported of imports) {
47526
47414
  const importedDocument = readSingleDocument(imported);
47527
- merged = mergeValues3(
47415
+ merged = mergeValues2(
47528
47416
  merged,
47529
47417
  compileAgentDocument(
47530
47418
  importedDocument,
@@ -47540,7 +47428,7 @@ function compileAgentDocument(document, path2, stack, context) {
47540
47428
  merged = applyRemoval(merged, removal);
47541
47429
  context.removals.push(removal);
47542
47430
  }
47543
- return mergeValues3(
47431
+ return mergeValues2(
47544
47432
  merged,
47545
47433
  authoringDocumentApplyShape(document, resolvedPath),
47546
47434
  []
@@ -47639,25 +47527,25 @@ function authoringDocumentApplyShape(document, path2) {
47639
47527
  };
47640
47528
  }
47641
47529
  function finalizeAgentApplyShape(document, path2) {
47642
- if (!isRecord2(document) || !isRecord2(document.spec)) {
47530
+ if (!isRecord(document) || !isRecord(document.spec)) {
47643
47531
  return { resource: document, resources: [] };
47644
47532
  }
47645
47533
  const next = structuredClone(document);
47646
47534
  const spec = next.spec;
47647
47535
  const resources = [];
47648
- if (isRecord2(spec.environment)) {
47536
+ if (isRecord(spec.environment)) {
47649
47537
  const environment = inlineEnvironmentResource(spec.environment, path2);
47650
47538
  spec.environment = environment.metadata.name;
47651
47539
  resources.push(environment);
47652
47540
  }
47653
- if (isRecord2(spec.identity)) {
47541
+ if (isRecord(spec.identity)) {
47654
47542
  const identity2 = inlineIdentityResource(spec.identity, next, path2);
47655
47543
  spec.identity = identity2.metadata.name;
47656
47544
  resources.push(identity2);
47657
47545
  }
47658
47546
  if (Array.isArray(spec.triggers)) {
47659
47547
  spec.triggers = spec.triggers.map((trigger) => {
47660
- if (!isRecord2(trigger) || !("name" in trigger)) {
47548
+ if (!isRecord(trigger) || !("name" in trigger)) {
47661
47549
  return trigger;
47662
47550
  }
47663
47551
  const compiledTrigger = { ...trigger };
@@ -47705,7 +47593,7 @@ function inlineIdentityResource(document, agentDocument, path2) {
47705
47593
  }
47706
47594
  spec[key] = value;
47707
47595
  }
47708
- if (metadata.name === void 0 && isRecord2(agentDocument.metadata) && typeof agentDocument.metadata.name === "string") {
47596
+ if (metadata.name === void 0 && isRecord(agentDocument.metadata) && typeof agentDocument.metadata.name === "string") {
47709
47597
  metadata.name = agentDocument.metadata.name;
47710
47598
  }
47711
47599
  const parsed = IdentityApplyRequestSchema.safeParse({ metadata, spec });
@@ -47741,7 +47629,7 @@ function resolveFileBackedFields(spec, path2) {
47741
47629
  };
47742
47630
  }
47743
47631
  function resolveFileBackedString(value, input) {
47744
- if (!isRecord2(value) || !("file" in value)) {
47632
+ if (!isRecord(value) || !("file" in value)) {
47745
47633
  return value;
47746
47634
  }
47747
47635
  const file2 = value.file;
@@ -47759,8 +47647,8 @@ function resolveFileBackedString(value, input) {
47759
47647
  return readFileSync6(resolve(dirname7(input.path), filePath), "utf8");
47760
47648
  }
47761
47649
  function removalDirectives(document, path2) {
47762
- const raw = isRecord2(document.remove) ? document.remove : {};
47763
- if (!isRecord2(raw)) {
47650
+ const raw = isRecord(document.remove) ? document.remove : {};
47651
+ if (!isRecord(raw)) {
47764
47652
  return [];
47765
47653
  }
47766
47654
  const directives = [];
@@ -47782,18 +47670,18 @@ function stringList(value, label) {
47782
47670
  });
47783
47671
  }
47784
47672
  function applyRemoval(value, removal) {
47785
- if (!isRecord2(value)) {
47673
+ if (!isRecord(value)) {
47786
47674
  return value;
47787
47675
  }
47788
47676
  const next = structuredClone(value);
47789
- if (!isRecord2(next.spec)) {
47677
+ if (!isRecord(next.spec)) {
47790
47678
  return next;
47791
47679
  }
47792
47680
  const spec = { ...next.spec };
47793
47681
  next.spec = spec;
47794
47682
  switch (removal.target) {
47795
47683
  case "tools": {
47796
- if (!isRecord2(spec[removal.target])) {
47684
+ if (!isRecord(spec[removal.target])) {
47797
47685
  return next;
47798
47686
  }
47799
47687
  const collection = {
@@ -47830,17 +47718,17 @@ function assertSupportedRemovalTarget(target) {
47830
47718
  );
47831
47719
  }
47832
47720
  }
47833
- function mergeValues3(base, override, path2) {
47721
+ function mergeValues2(base, override, path2) {
47834
47722
  if (override === void 0) {
47835
47723
  return base;
47836
47724
  }
47837
47725
  if (Array.isArray(base) && Array.isArray(override)) {
47838
47726
  return mergeArrays(base, override, path2);
47839
47727
  }
47840
- if (isRecord2(base) && isRecord2(override)) {
47728
+ if (isRecord(base) && isRecord(override)) {
47841
47729
  const merged = { ...base };
47842
47730
  for (const [key, value] of Object.entries(override)) {
47843
- merged[key] = mergeValues3(merged[key], value, [...path2, key]);
47731
+ merged[key] = mergeValues2(merged[key], value, [...path2, key]);
47844
47732
  }
47845
47733
  return merged;
47846
47734
  }
@@ -47862,7 +47750,7 @@ function mergeArrays(base, override, path2) {
47862
47750
  for (const item of override) {
47863
47751
  const key = collectionItemKey(path2.at(-1) ?? "", item);
47864
47752
  if (key && indexByKey.has(key)) {
47865
- merged[indexByKey.get(key) ?? 0] = mergeValues3(
47753
+ merged[indexByKey.get(key) ?? 0] = mergeValues2(
47866
47754
  merged[indexByKey.get(key) ?? 0],
47867
47755
  item,
47868
47756
  path2
@@ -47880,7 +47768,7 @@ function isNamedArrayMergePath(path2) {
47880
47768
  return path2 === "spec.mounts" || path2 === "spec.triggers";
47881
47769
  }
47882
47770
  function collectionItemKey(collection, item) {
47883
- if (!isRecord2(item)) {
47771
+ if (!isRecord(item)) {
47884
47772
  return void 0;
47885
47773
  }
47886
47774
  if (typeof item.name === "string") {
@@ -47912,7 +47800,7 @@ function isAgentFile(path2) {
47912
47800
  return false;
47913
47801
  }
47914
47802
  }
47915
- function isRecord2(value) {
47803
+ function isRecord(value) {
47916
47804
  return typeof value === "object" && value !== null && !Array.isArray(value);
47917
47805
  }
47918
47806
  var AGENT_FILE_EXTENSIONS, AGENT_SPEC_FIELDS, AGENT_METADATA_FIELDS;
@@ -48314,7 +48202,7 @@ function sourceFileIndex(files) {
48314
48202
  function isAbsoluteSourcePath(path2) {
48315
48203
  return path2.startsWith("/");
48316
48204
  }
48317
- function isRecord3(value) {
48205
+ function isRecord2(value) {
48318
48206
  return typeof value === "object" && value !== null && !Array.isArray(value);
48319
48207
  }
48320
48208
  var APPLY_DIRECTORIES, PROJECT_APPLY_RESOURCE_DIRECTORIES;
@@ -48392,7 +48280,7 @@ function resolveTemplateImportPath(importPath, fileIndex) {
48392
48280
  return key;
48393
48281
  }
48394
48282
  function removalDirectives2(document, path2) {
48395
- const raw = isRecord3(document.remove) ? document.remove : {};
48283
+ const raw = isRecord2(document.remove) ? document.remove : {};
48396
48284
  const directives = [];
48397
48285
  for (const [target, value] of Object.entries(raw)) {
48398
48286
  const names = stringList2(value, `remove.${target}`);
@@ -48533,14 +48421,14 @@ function cloneAgentDraft(draft) {
48533
48421
  function isMetadataFieldKey(key) {
48534
48422
  return AGENT_METADATA_FIELD_KEYS.includes(key);
48535
48423
  }
48536
- function mergeValues4(base, override) {
48424
+ function mergeValues3(base, override) {
48537
48425
  if (override === void 0) {
48538
48426
  return base;
48539
48427
  }
48540
- if (isRecord3(base) && isRecord3(override)) {
48428
+ if (isRecord2(base) && isRecord2(override)) {
48541
48429
  const merged = { ...base };
48542
48430
  for (const [key, value] of Object.entries(override)) {
48543
- merged[key] = mergeValues4(merged[key], value);
48431
+ merged[key] = mergeValues3(merged[key], value);
48544
48432
  }
48545
48433
  return merged;
48546
48434
  }
@@ -48557,7 +48445,7 @@ function sortJson(value) {
48557
48445
  if (Array.isArray(value)) {
48558
48446
  return value.map(sortJson);
48559
48447
  }
48560
- if (isRecord3(value)) {
48448
+ if (isRecord2(value)) {
48561
48449
  return Object.fromEntries(
48562
48450
  Object.entries(value).sort(([left], [right]) => left.localeCompare(right)).map(([key, nested]) => [key, sortJson(nested)])
48563
48451
  );
@@ -48593,7 +48481,7 @@ function fileBackedStringField() {
48593
48481
  };
48594
48482
  }
48595
48483
  function rejectDirectiveObject(value, input) {
48596
- if (isRecord3(value) && "append" in value) {
48484
+ if (isRecord2(value) && "append" in value) {
48597
48485
  throw new Error(
48598
48486
  `Invalid agent authoring file ${input.path}: ${input.field} does not support directive objects; append is supported on ${APPEND_CAPABLE_FIELDS}`
48599
48487
  );
@@ -48601,7 +48489,7 @@ function rejectDirectiveObject(value, input) {
48601
48489
  return value;
48602
48490
  }
48603
48491
  function resolveFileBackedString2(value, input) {
48604
- if (!isRecord3(value)) {
48492
+ if (!isRecord2(value)) {
48605
48493
  return value;
48606
48494
  }
48607
48495
  if ("file" in value && !("append" in value)) {
@@ -48667,7 +48555,7 @@ function resolveAppendDirective(base, override) {
48667
48555
  `Invalid agent authoring file ${droppedPending.path}: ${droppedPending.field} append directive was merged before any base value; import the base document before its append overlay`
48668
48556
  );
48669
48557
  }
48670
- return mergeValues4(base, override);
48558
+ return mergeValues3(base, override);
48671
48559
  }
48672
48560
  if (typeof base === "string") {
48673
48561
  return base + directive.text;
@@ -48699,11 +48587,11 @@ function rejectUnresolvedAppendDirective(value) {
48699
48587
  );
48700
48588
  }
48701
48589
  function appendDirectiveFromMarker(value) {
48702
- if (!isRecord3(value)) {
48590
+ if (!isRecord2(value)) {
48703
48591
  return void 0;
48704
48592
  }
48705
48593
  const marker = value[APPEND_DIRECTIVE_MARKER_KEY];
48706
- if (!isRecord3(marker)) {
48594
+ if (!isRecord2(marker)) {
48707
48595
  return void 0;
48708
48596
  }
48709
48597
  return marker;
@@ -48723,9 +48611,9 @@ var init_file_backed_string = __esm({
48723
48611
  function inlineEnvironmentField() {
48724
48612
  return {
48725
48613
  target: "spec",
48726
- merge: (base, override) => mergeValues4(base, override),
48614
+ merge: (base, override) => mergeValues3(base, override),
48727
48615
  compile: (value, context) => {
48728
- if (!isRecord3(value)) {
48616
+ if (!isRecord2(value)) {
48729
48617
  return { resources: [], value };
48730
48618
  }
48731
48619
  const resource = inlineEnvironmentResource2(value, context.path);
@@ -48736,9 +48624,9 @@ function inlineEnvironmentField() {
48736
48624
  function inlineIdentityField() {
48737
48625
  return {
48738
48626
  target: "spec",
48739
- merge: (base, override) => mergeValues4(base, override),
48627
+ merge: (base, override) => mergeValues3(base, override),
48740
48628
  compile: (value, context) => {
48741
- if (!isRecord3(value)) {
48629
+ if (!isRecord2(value)) {
48742
48630
  return { resources: [], value };
48743
48631
  }
48744
48632
  const resource = inlineIdentityResource2(
@@ -48751,7 +48639,7 @@ function inlineIdentityField() {
48751
48639
  };
48752
48640
  }
48753
48641
  function assertAgentAuthoringDocument(document, path2) {
48754
- if (!isRecord3(document) || !("kind" in document)) {
48642
+ if (!isRecord2(document) || !("kind" in document)) {
48755
48643
  return;
48756
48644
  }
48757
48645
  if (document.kind === "session") {
@@ -48777,10 +48665,7 @@ function assertAgentAuthoringDocument(document, path2) {
48777
48665
  );
48778
48666
  }
48779
48667
  }
48780
- function parseAgentResource(draft, path2, removals = []) {
48781
- if (draft.metadata.name === BUILT_IN_DEFAULT_AGENT_NAME) {
48782
- return parseBuiltInDefaultAgentResource(draft, path2, removals);
48783
- }
48668
+ function parseAgentResource(draft, path2, _removals = []) {
48784
48669
  const parsed = AgentApplyRequestSchema.safeParse({
48785
48670
  metadata: draft.metadata,
48786
48671
  spec: draft.spec
@@ -48794,44 +48679,6 @@ function parseAgentResource(draft, path2, removals = []) {
48794
48679
  spec: parsed.data.spec
48795
48680
  };
48796
48681
  }
48797
- function parseBuiltInDefaultAgentResource(draft, path2, removals) {
48798
- const remove = Object.fromEntries(
48799
- removals.map(({ target, names }) => [target, names])
48800
- );
48801
- const overlay = DefaultAgentOverlaySchema.safeParse({
48802
- ...draft.spec,
48803
- ...Object.keys(remove).length > 0 ? { remove } : {}
48804
- });
48805
- if (!overlay.success) {
48806
- throw new Error(
48807
- `Invalid built-in Default agent overlay ${path2}: ${overlay.error.message}`
48808
- );
48809
- }
48810
- const resolved = resolveBuiltInDefaultAgentSpec(overlay.data);
48811
- const annotations = isRecord3(draft.metadata.annotations) ? draft.metadata.annotations : {};
48812
- const parsed = AgentApplyRequestSchema.safeParse({
48813
- metadata: {
48814
- ...draft.metadata,
48815
- annotations: {
48816
- ...annotations,
48817
- [BUILT_IN_DEFAULT_AGENT_OVERLAY_ANNOTATION]: JSON.stringify(
48818
- overlay.data
48819
- )
48820
- }
48821
- },
48822
- spec: resolved.spec
48823
- });
48824
- if (!parsed.success) {
48825
- throw new Error(
48826
- `Invalid compiled built-in Default agent ${path2}: ${parsed.error.message}`
48827
- );
48828
- }
48829
- return {
48830
- kind: RESOURCE_KIND_AGENT,
48831
- metadata: parsed.data.metadata,
48832
- spec: parsed.data.spec
48833
- };
48834
- }
48835
48682
  function inlineEnvironmentResource2(document, path2) {
48836
48683
  const parsed = EnvironmentApplyRequestSchema.safeParse(
48837
48684
  splitMetadataAndSpec(document)
@@ -48893,7 +48740,6 @@ var init_inline_resource = __esm({
48893
48740
  "../../packages/schemas/src/project-apply-files/agent-fields/inline-resource.ts"() {
48894
48741
  "use strict";
48895
48742
  init_agents();
48896
- init_default_agent();
48897
48743
  init_environments();
48898
48744
  init_identities();
48899
48745
  init_source();
@@ -48906,12 +48752,12 @@ function compileRoutingInlineBindings(input) {
48906
48752
  const bindings = input.bindings ? cloneBindings(input.bindings) : {};
48907
48753
  const compiledTriggers = [];
48908
48754
  for (const trigger of input.triggers) {
48909
- if (!isRecord3(trigger) || trigger.kind === "heartbeat") {
48755
+ if (!isRecord2(trigger) || trigger.kind === "heartbeat") {
48910
48756
  compiledTriggers.push(trigger);
48911
48757
  continue;
48912
48758
  }
48913
48759
  const routing = trigger.routing;
48914
- if (!isRecord3(routing)) {
48760
+ if (!isRecord2(routing)) {
48915
48761
  compiledTriggers.push(trigger);
48916
48762
  continue;
48917
48763
  }
@@ -48942,7 +48788,7 @@ function extractDeliverContribution(routing, path2) {
48942
48788
  if (bindBlock === void 0) {
48943
48789
  return void 0;
48944
48790
  }
48945
- if (!isRecord3(bindBlock)) {
48791
+ if (!isRecord2(bindBlock)) {
48946
48792
  throw inlineShapeError(
48947
48793
  path2,
48948
48794
  "deliver",
@@ -48972,7 +48818,7 @@ function extractBindArmContribution(routing, path2) {
48972
48818
  }
48973
48819
  function extractSpawnArmContribution(routing, path2) {
48974
48820
  const bindBlock = routing.bind;
48975
- if (!isRecord3(bindBlock)) {
48821
+ if (!isRecord2(bindBlock)) {
48976
48822
  return void 0;
48977
48823
  }
48978
48824
  if (bindBlock.lifecycle === void 0 && bindBlock.continuity === void 0) {
@@ -49010,7 +48856,7 @@ function mergeContributionIntoBindings(bindings, contribution, path2) {
49010
48856
  }
49011
48857
  function ensureEntry(bindings, target) {
49012
48858
  const existing = bindings[target];
49013
- if (isRecord3(existing)) {
48859
+ if (isRecord2(existing)) {
49014
48860
  return existing;
49015
48861
  }
49016
48862
  const entry = {};
@@ -49032,7 +48878,7 @@ function stripInlineRoutingFields(trigger, routing) {
49032
48878
  return { ...trigger, routing: rest };
49033
48879
  }
49034
48880
  case "spawn": {
49035
- if (!isRecord3(routing.bind)) {
48881
+ if (!isRecord2(routing.bind)) {
49036
48882
  return trigger;
49037
48883
  }
49038
48884
  const {
@@ -49097,7 +48943,7 @@ function rejectSingletonTarget(target, path2, arm) {
49097
48943
  function cloneBindings(bindings) {
49098
48944
  const clone2 = {};
49099
48945
  for (const [key, value] of Object.entries(bindings)) {
49100
- clone2[key] = isRecord3(value) ? { ...value } : value;
48946
+ clone2[key] = isRecord2(value) ? { ...value } : value;
49101
48947
  }
49102
48948
  return clone2;
49103
48949
  }
@@ -49127,7 +48973,7 @@ function namedArrayField(options) {
49127
48973
  target: "spec",
49128
48974
  merge: (base, override) => {
49129
48975
  if (!Array.isArray(base) || !Array.isArray(override)) {
49130
- return mergeValues4(base, override);
48976
+ return mergeValues3(base, override);
49131
48977
  }
49132
48978
  return mergeNamedArray(base, override, options.itemKey);
49133
48979
  },
@@ -49147,7 +48993,7 @@ function triggersField() {
49147
48993
  const withNamesStripped = removeAuthoringTriggerNames(value);
49148
48994
  const { triggers, bindings } = compileRoutingInlineBindings({
49149
48995
  triggers: withNamesStripped,
49150
- bindings: isRecord3(context.draft.spec.bindings) ? context.draft.spec.bindings : void 0,
48996
+ bindings: isRecord2(context.draft.spec.bindings) ? context.draft.spec.bindings : void 0,
49151
48997
  path: context.path
49152
48998
  });
49153
48999
  context.draft.spec.bindings = bindings;
@@ -49156,7 +49002,7 @@ function triggersField() {
49156
49002
  };
49157
49003
  }
49158
49004
  function mountItemKey(item) {
49159
- if (!isRecord3(item)) {
49005
+ if (!isRecord2(item)) {
49160
49006
  return void 0;
49161
49007
  }
49162
49008
  if (typeof item.name === "string") {
@@ -49168,7 +49014,7 @@ function mountItemKey(item) {
49168
49014
  return void 0;
49169
49015
  }
49170
49016
  function triggerItemKey(item) {
49171
- if (!isRecord3(item)) {
49017
+ if (!isRecord2(item)) {
49172
49018
  return void 0;
49173
49019
  }
49174
49020
  if (typeof item.name === "string") {
@@ -49197,7 +49043,7 @@ function mergeNamedArray(base, override, itemKey) {
49197
49043
  for (const item of override) {
49198
49044
  const key = itemKey(item);
49199
49045
  if (key && indexByKey.has(key)) {
49200
- merged[indexByKey.get(key) ?? 0] = mergeValues4(
49046
+ merged[indexByKey.get(key) ?? 0] = mergeValues3(
49201
49047
  merged[indexByKey.get(key) ?? 0],
49202
49048
  item
49203
49049
  );
@@ -49221,7 +49067,7 @@ function removeAuthoringTriggerNames(value) {
49221
49067
  return value;
49222
49068
  }
49223
49069
  return value.map((trigger) => {
49224
- if (!isRecord3(trigger) || !("name" in trigger)) {
49070
+ if (!isRecord2(trigger) || !("name" in trigger)) {
49225
49071
  return trigger;
49226
49072
  }
49227
49073
  const next = { ...trigger };
@@ -49242,9 +49088,9 @@ var init_named_array = __esm({
49242
49088
  function namedMapField() {
49243
49089
  return {
49244
49090
  target: "spec",
49245
- merge: (base, override) => mergeValues4(base, override),
49091
+ merge: (base, override) => mergeValues3(base, override),
49246
49092
  remove: (value, names) => {
49247
- if (!isRecord3(value)) {
49093
+ if (!isRecord2(value)) {
49248
49094
  return value;
49249
49095
  }
49250
49096
  const next = { ...value };
@@ -49343,7 +49189,7 @@ function mergeSourceLocations(base, override) {
49343
49189
  continue;
49344
49190
  }
49345
49191
  const prefix = `${target}.${key}`;
49346
- if (!isRecord3(value)) {
49192
+ if (!isRecord2(value)) {
49347
49193
  merged = Object.fromEntries(
49348
49194
  Object.entries(merged).filter(
49349
49195
  ([path2]) => path2 !== prefix && !path2.startsWith(`${prefix}.`)
@@ -49403,7 +49249,7 @@ function mergeDraftTarget(target, base, override) {
49403
49249
  for (const [key, value] of Object.entries(override)) {
49404
49250
  const field = AGENT_FIELDS[key];
49405
49251
  const merge2 = field?.target === target ? field.merge : void 0;
49406
- merged[key] = merge2 ? merge2(merged[key], value, { field: key }) : mergeValues4(merged[key], value);
49252
+ merged[key] = merge2 ? merge2(merged[key], value, { field: key }) : mergeValues3(merged[key], value);
49407
49253
  }
49408
49254
  return merged;
49409
49255
  }
@@ -49469,7 +49315,7 @@ function readVariableScope(document, path2) {
49469
49315
  if (declared === void 0) {
49470
49316
  return /* @__PURE__ */ new Map();
49471
49317
  }
49472
- if (!isRecord3(declared)) {
49318
+ if (!isRecord2(declared)) {
49473
49319
  throw new Error(
49474
49320
  `Invalid variables in ${path2}: variables must be a map of name to value`
49475
49321
  );
@@ -49498,7 +49344,7 @@ function substituteValue(value, scope, site) {
49498
49344
  if (Array.isArray(value)) {
49499
49345
  return value.map((item) => substituteValue(item, scope, site));
49500
49346
  }
49501
- if (isRecord3(value)) {
49347
+ if (isRecord2(value)) {
49502
49348
  return Object.fromEntries(
49503
49349
  Object.entries(value).map(([key, nested]) => [
49504
49350
  key,
@@ -49616,7 +49462,7 @@ function projectCompiledTriggerSourceLocations(locations, authoredTriggers) {
49616
49462
  );
49617
49463
  let compiledIndex = 0;
49618
49464
  for (const [authoredIndex, trigger] of authoredTriggers.entries()) {
49619
- if (!isRecord3(trigger)) {
49465
+ if (!isRecord2(trigger)) {
49620
49466
  continue;
49621
49467
  }
49622
49468
  const events = authoredTriggerEvents(trigger);
@@ -49684,7 +49530,7 @@ function validateAgentFragmentDocument(document, path2, context) {
49684
49530
  `Agent import cycle detected: ${[...context.stack, normalizedPath].join(" -> ")}`
49685
49531
  );
49686
49532
  }
49687
- if (!isRecord3(document)) {
49533
+ if (!isRecord2(document)) {
49688
49534
  throw new Error(`Invalid agent fragment file ${path2}: expected object`);
49689
49535
  }
49690
49536
  for (const imported of importPaths2(document).map(
@@ -49741,7 +49587,7 @@ function compileAgentDocumentValue(document, path2, fileIndex, contextVariables)
49741
49587
  ...contextVariables && Object.keys(contextVariables).length > 0 ? { contextVariables: new Map(Object.entries(contextVariables)) } : {}
49742
49588
  });
49743
49589
  const authoredTriggers = structuredClone(draft.spec.triggers);
49744
- const removals = isRecord3(document) ? removalDirectives2(document, normalizeSourcePath(path2)) : [];
49590
+ const removals = isRecord2(document) ? removalDirectives2(document, normalizeSourcePath(path2)) : [];
49745
49591
  return {
49746
49592
  ...compileAgentDraftResources(draft, path2, removals),
49747
49593
  sourceLocations: draft.sourceLocations,
@@ -49755,7 +49601,7 @@ function compileAgentDocument2(document, path2, context) {
49755
49601
  `Agent import cycle detected: ${[...context.stack, normalizedPath].join(" -> ")}`
49756
49602
  );
49757
49603
  }
49758
- if (!isRecord3(document)) {
49604
+ if (!isRecord2(document)) {
49759
49605
  throw new Error(`Invalid agent authoring file ${path2}: expected object`);
49760
49606
  }
49761
49607
  const variables = context.stack.length === 0 ? new Map([
@@ -49763,7 +49609,11 @@ function compileAgentDocument2(document, path2, context) {
49763
49609
  ...readVariableScope(document, normalizedPath)
49764
49610
  ]) : context.variables;
49765
49611
  let merged = emptyAgentDraft();
49766
- for (const importPath of importPaths2(document)) {
49612
+ const imports = [
49613
+ ...context.stack.length === 0 && document.name === BUILT_IN_DEFAULT_AGENT_NAME ? [BUILT_IN_DEFAULT_AGENT_TEMPLATE_IMPORT] : [],
49614
+ ...importPaths2(document)
49615
+ ];
49616
+ for (const importPath of imports) {
49767
49617
  const imported = resolveImportPath2(
49768
49618
  importPath,
49769
49619
  normalizedPath,
@@ -49794,6 +49644,7 @@ function compileAgentDocument2(document, path2, context) {
49794
49644
  var init_agent_authoring = __esm({
49795
49645
  "../../packages/schemas/src/project-apply-files/agent-authoring.ts"() {
49796
49646
  "use strict";
49647
+ init_default_agent();
49797
49648
  init_agent_document_merge();
49798
49649
  init_agent_fields();
49799
49650
  init_source();
@@ -50024,13 +49875,33 @@ function collectInjectableTemplateReferences(files) {
50024
49875
  }
50025
49876
  }
50026
49877
  }
49878
+ if (hasBuiltInDefaultAgentDocument(files)) {
49879
+ const implicit = parseTemplateImportSpecifier(
49880
+ BUILT_IN_DEFAULT_AGENT_TEMPLATE_IMPORT
49881
+ );
49882
+ references.set(
49883
+ templateInjectionKey(implicit.name, implicit.track, ""),
49884
+ implicit
49885
+ );
49886
+ }
50027
49887
  return [...references.values()];
50028
49888
  }
49889
+ function hasBuiltInDefaultAgentDocument(files) {
49890
+ return files.some((file2) => {
49891
+ try {
49892
+ return readDocumentsFromSource(file2).some(
49893
+ (document) => isRecord2(document) && document.name === BUILT_IN_DEFAULT_AGENT_NAME
49894
+ );
49895
+ } catch {
49896
+ return false;
49897
+ }
49898
+ });
49899
+ }
50029
49900
  function templateImportsInFile(file2) {
50030
49901
  try {
50031
49902
  const specifiers = [];
50032
49903
  for (const document of readDocumentsFromSource(file2)) {
50033
- if (!isRecord3(document)) {
49904
+ if (!isRecord2(document)) {
50034
49905
  continue;
50035
49906
  }
50036
49907
  for (const importPath of importPaths2(document)) {
@@ -50047,6 +49918,7 @@ function templateImportsInFile(file2) {
50047
49918
  var init_template_injection = __esm({
50048
49919
  "../../packages/schemas/src/project-apply-files/template-injection.ts"() {
50049
49920
  "use strict";
49921
+ init_default_agent();
50050
49922
  init_templates();
50051
49923
  init_agent_document_merge();
50052
49924
  init_source();
@@ -50278,6 +50150,7 @@ var init_project_apply_files = __esm({
50278
50150
  "../../packages/schemas/src/project-apply-files/index.ts"() {
50279
50151
  "use strict";
50280
50152
  init_agents();
50153
+ init_default_agent();
50281
50154
  init_environments();
50282
50155
  init_identities();
50283
50156
  init_project_config();
@@ -68981,7 +68854,7 @@ async function selectRepository(context, github, explicitRepo) {
68981
68854
  const selection = github.grant.providerResourceSelection;
68982
68855
  if (selection.kind === "selected") {
68983
68856
  const repos = selection.resources.map(
68984
- (resource) => isRecord4(resource) && typeof resource.fullName === "string" ? resource.fullName : void 0
68857
+ (resource) => isRecord3(resource) && typeof resource.fullName === "string" ? resource.fullName : void 0
68985
68858
  ).filter(isDefined);
68986
68859
  if (repos.length === 1) {
68987
68860
  context.writeOutput(`Using GitHub repository ${repos[0]}.`);
@@ -69311,7 +69184,7 @@ function slackWorkspaceUrl(slack) {
69311
69184
  function organizationLabel(organization) {
69312
69185
  return `${organization.organizationName} (${organization.organizationSlug})`;
69313
69186
  }
69314
- function isRecord4(value) {
69187
+ function isRecord3(value) {
69315
69188
  return typeof value === "object" && value !== null && !Array.isArray(value);
69316
69189
  }
69317
69190
  function isDefined(value) {