@autohq/cli 0.1.436 → 0.1.437

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({
@@ -27043,6 +26925,17 @@ triggers:
27043
26925
  ]
27044
26926
  }
27045
26927
  ],
26928
+ "@auto/default": [
26929
+ {
26930
+ version: "1.0.0",
26931
+ files: [
26932
+ {
26933
+ path: "fragments/default.yaml",
26934
+ 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"
26935
+ }
26936
+ ]
26937
+ }
26938
+ ],
27046
26939
  "@auto/engineering-tier": [
27047
26940
  {
27048
26941
  version: "1.0.0",
@@ -42821,6 +42714,7 @@ var init_hardcoded = __esm({
42821
42714
  "@auto/chat-assistant": "A conversational assistant for direct sessions, with optional Slack mentions, threaded replies, and retained context.",
42822
42715
  "@auto/code-review": "A pull-request reviewer that posts one severity-ranked review comment and reports a check, with optional Slack verdict reporting.",
42823
42716
  "@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.",
42717
+ "@auto/default": "Auto's minimum general-purpose runtime contract, implicitly imported by the permanent Default agent in every project.",
42824
42718
  "@auto/engineering-tier": "An engineering-tier fleet: senior and junior engineers with PR ownership, a live-iteration designer, and a session introspector.",
42825
42719
  "@auto/handoff": "A handoff coder that takes ownership of delegated PRs or coding tasks and reports back when ready.",
42826
42720
  "@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 +47203,7 @@ var init_package = __esm({
47309
47203
  "package.json"() {
47310
47204
  package_default = {
47311
47205
  name: "@autohq/cli",
47312
- version: "0.1.436",
47206
+ version: "0.1.437",
47313
47207
  license: "SEE LICENSE IN README.md",
47314
47208
  publishConfig: {
47315
47209
  access: "public"
@@ -47514,7 +47408,7 @@ function compileAgentDocument(document, path2, stack, context) {
47514
47408
  `Agent import cycle detected: ${[...stack, resolvedPath].join(" -> ")}`
47515
47409
  );
47516
47410
  }
47517
- if (!isRecord2(document)) {
47411
+ if (!isRecord(document)) {
47518
47412
  throw new Error(`Invalid agent authoring file ${path2}: expected object`);
47519
47413
  }
47520
47414
  const imports = importPaths(document).map(
@@ -47524,7 +47418,7 @@ function compileAgentDocument(document, path2, stack, context) {
47524
47418
  let merged = {};
47525
47419
  for (const imported of imports) {
47526
47420
  const importedDocument = readSingleDocument(imported);
47527
- merged = mergeValues3(
47421
+ merged = mergeValues2(
47528
47422
  merged,
47529
47423
  compileAgentDocument(
47530
47424
  importedDocument,
@@ -47540,7 +47434,7 @@ function compileAgentDocument(document, path2, stack, context) {
47540
47434
  merged = applyRemoval(merged, removal);
47541
47435
  context.removals.push(removal);
47542
47436
  }
47543
- return mergeValues3(
47437
+ return mergeValues2(
47544
47438
  merged,
47545
47439
  authoringDocumentApplyShape(document, resolvedPath),
47546
47440
  []
@@ -47639,25 +47533,25 @@ function authoringDocumentApplyShape(document, path2) {
47639
47533
  };
47640
47534
  }
47641
47535
  function finalizeAgentApplyShape(document, path2) {
47642
- if (!isRecord2(document) || !isRecord2(document.spec)) {
47536
+ if (!isRecord(document) || !isRecord(document.spec)) {
47643
47537
  return { resource: document, resources: [] };
47644
47538
  }
47645
47539
  const next = structuredClone(document);
47646
47540
  const spec = next.spec;
47647
47541
  const resources = [];
47648
- if (isRecord2(spec.environment)) {
47542
+ if (isRecord(spec.environment)) {
47649
47543
  const environment = inlineEnvironmentResource(spec.environment, path2);
47650
47544
  spec.environment = environment.metadata.name;
47651
47545
  resources.push(environment);
47652
47546
  }
47653
- if (isRecord2(spec.identity)) {
47547
+ if (isRecord(spec.identity)) {
47654
47548
  const identity2 = inlineIdentityResource(spec.identity, next, path2);
47655
47549
  spec.identity = identity2.metadata.name;
47656
47550
  resources.push(identity2);
47657
47551
  }
47658
47552
  if (Array.isArray(spec.triggers)) {
47659
47553
  spec.triggers = spec.triggers.map((trigger) => {
47660
- if (!isRecord2(trigger) || !("name" in trigger)) {
47554
+ if (!isRecord(trigger) || !("name" in trigger)) {
47661
47555
  return trigger;
47662
47556
  }
47663
47557
  const compiledTrigger = { ...trigger };
@@ -47705,7 +47599,7 @@ function inlineIdentityResource(document, agentDocument, path2) {
47705
47599
  }
47706
47600
  spec[key] = value;
47707
47601
  }
47708
- if (metadata.name === void 0 && isRecord2(agentDocument.metadata) && typeof agentDocument.metadata.name === "string") {
47602
+ if (metadata.name === void 0 && isRecord(agentDocument.metadata) && typeof agentDocument.metadata.name === "string") {
47709
47603
  metadata.name = agentDocument.metadata.name;
47710
47604
  }
47711
47605
  const parsed = IdentityApplyRequestSchema.safeParse({ metadata, spec });
@@ -47741,7 +47635,7 @@ function resolveFileBackedFields(spec, path2) {
47741
47635
  };
47742
47636
  }
47743
47637
  function resolveFileBackedString(value, input) {
47744
- if (!isRecord2(value) || !("file" in value)) {
47638
+ if (!isRecord(value) || !("file" in value)) {
47745
47639
  return value;
47746
47640
  }
47747
47641
  const file2 = value.file;
@@ -47759,8 +47653,8 @@ function resolveFileBackedString(value, input) {
47759
47653
  return readFileSync6(resolve(dirname7(input.path), filePath), "utf8");
47760
47654
  }
47761
47655
  function removalDirectives(document, path2) {
47762
- const raw = isRecord2(document.remove) ? document.remove : {};
47763
- if (!isRecord2(raw)) {
47656
+ const raw = isRecord(document.remove) ? document.remove : {};
47657
+ if (!isRecord(raw)) {
47764
47658
  return [];
47765
47659
  }
47766
47660
  const directives = [];
@@ -47782,18 +47676,18 @@ function stringList(value, label) {
47782
47676
  });
47783
47677
  }
47784
47678
  function applyRemoval(value, removal) {
47785
- if (!isRecord2(value)) {
47679
+ if (!isRecord(value)) {
47786
47680
  return value;
47787
47681
  }
47788
47682
  const next = structuredClone(value);
47789
- if (!isRecord2(next.spec)) {
47683
+ if (!isRecord(next.spec)) {
47790
47684
  return next;
47791
47685
  }
47792
47686
  const spec = { ...next.spec };
47793
47687
  next.spec = spec;
47794
47688
  switch (removal.target) {
47795
47689
  case "tools": {
47796
- if (!isRecord2(spec[removal.target])) {
47690
+ if (!isRecord(spec[removal.target])) {
47797
47691
  return next;
47798
47692
  }
47799
47693
  const collection = {
@@ -47830,17 +47724,17 @@ function assertSupportedRemovalTarget(target) {
47830
47724
  );
47831
47725
  }
47832
47726
  }
47833
- function mergeValues3(base, override, path2) {
47727
+ function mergeValues2(base, override, path2) {
47834
47728
  if (override === void 0) {
47835
47729
  return base;
47836
47730
  }
47837
47731
  if (Array.isArray(base) && Array.isArray(override)) {
47838
47732
  return mergeArrays(base, override, path2);
47839
47733
  }
47840
- if (isRecord2(base) && isRecord2(override)) {
47734
+ if (isRecord(base) && isRecord(override)) {
47841
47735
  const merged = { ...base };
47842
47736
  for (const [key, value] of Object.entries(override)) {
47843
- merged[key] = mergeValues3(merged[key], value, [...path2, key]);
47737
+ merged[key] = mergeValues2(merged[key], value, [...path2, key]);
47844
47738
  }
47845
47739
  return merged;
47846
47740
  }
@@ -47862,7 +47756,7 @@ function mergeArrays(base, override, path2) {
47862
47756
  for (const item of override) {
47863
47757
  const key = collectionItemKey(path2.at(-1) ?? "", item);
47864
47758
  if (key && indexByKey.has(key)) {
47865
- merged[indexByKey.get(key) ?? 0] = mergeValues3(
47759
+ merged[indexByKey.get(key) ?? 0] = mergeValues2(
47866
47760
  merged[indexByKey.get(key) ?? 0],
47867
47761
  item,
47868
47762
  path2
@@ -47880,7 +47774,7 @@ function isNamedArrayMergePath(path2) {
47880
47774
  return path2 === "spec.mounts" || path2 === "spec.triggers";
47881
47775
  }
47882
47776
  function collectionItemKey(collection, item) {
47883
- if (!isRecord2(item)) {
47777
+ if (!isRecord(item)) {
47884
47778
  return void 0;
47885
47779
  }
47886
47780
  if (typeof item.name === "string") {
@@ -47912,7 +47806,7 @@ function isAgentFile(path2) {
47912
47806
  return false;
47913
47807
  }
47914
47808
  }
47915
- function isRecord2(value) {
47809
+ function isRecord(value) {
47916
47810
  return typeof value === "object" && value !== null && !Array.isArray(value);
47917
47811
  }
47918
47812
  var AGENT_FILE_EXTENSIONS, AGENT_SPEC_FIELDS, AGENT_METADATA_FIELDS;
@@ -48314,7 +48208,7 @@ function sourceFileIndex(files) {
48314
48208
  function isAbsoluteSourcePath(path2) {
48315
48209
  return path2.startsWith("/");
48316
48210
  }
48317
- function isRecord3(value) {
48211
+ function isRecord2(value) {
48318
48212
  return typeof value === "object" && value !== null && !Array.isArray(value);
48319
48213
  }
48320
48214
  var APPLY_DIRECTORIES, PROJECT_APPLY_RESOURCE_DIRECTORIES;
@@ -48392,7 +48286,7 @@ function resolveTemplateImportPath(importPath, fileIndex) {
48392
48286
  return key;
48393
48287
  }
48394
48288
  function removalDirectives2(document, path2) {
48395
- const raw = isRecord3(document.remove) ? document.remove : {};
48289
+ const raw = isRecord2(document.remove) ? document.remove : {};
48396
48290
  const directives = [];
48397
48291
  for (const [target, value] of Object.entries(raw)) {
48398
48292
  const names = stringList2(value, `remove.${target}`);
@@ -48533,14 +48427,14 @@ function cloneAgentDraft(draft) {
48533
48427
  function isMetadataFieldKey(key) {
48534
48428
  return AGENT_METADATA_FIELD_KEYS.includes(key);
48535
48429
  }
48536
- function mergeValues4(base, override) {
48430
+ function mergeValues3(base, override) {
48537
48431
  if (override === void 0) {
48538
48432
  return base;
48539
48433
  }
48540
- if (isRecord3(base) && isRecord3(override)) {
48434
+ if (isRecord2(base) && isRecord2(override)) {
48541
48435
  const merged = { ...base };
48542
48436
  for (const [key, value] of Object.entries(override)) {
48543
- merged[key] = mergeValues4(merged[key], value);
48437
+ merged[key] = mergeValues3(merged[key], value);
48544
48438
  }
48545
48439
  return merged;
48546
48440
  }
@@ -48557,7 +48451,7 @@ function sortJson(value) {
48557
48451
  if (Array.isArray(value)) {
48558
48452
  return value.map(sortJson);
48559
48453
  }
48560
- if (isRecord3(value)) {
48454
+ if (isRecord2(value)) {
48561
48455
  return Object.fromEntries(
48562
48456
  Object.entries(value).sort(([left], [right]) => left.localeCompare(right)).map(([key, nested]) => [key, sortJson(nested)])
48563
48457
  );
@@ -48593,7 +48487,7 @@ function fileBackedStringField() {
48593
48487
  };
48594
48488
  }
48595
48489
  function rejectDirectiveObject(value, input) {
48596
- if (isRecord3(value) && "append" in value) {
48490
+ if (isRecord2(value) && "append" in value) {
48597
48491
  throw new Error(
48598
48492
  `Invalid agent authoring file ${input.path}: ${input.field} does not support directive objects; append is supported on ${APPEND_CAPABLE_FIELDS}`
48599
48493
  );
@@ -48601,7 +48495,7 @@ function rejectDirectiveObject(value, input) {
48601
48495
  return value;
48602
48496
  }
48603
48497
  function resolveFileBackedString2(value, input) {
48604
- if (!isRecord3(value)) {
48498
+ if (!isRecord2(value)) {
48605
48499
  return value;
48606
48500
  }
48607
48501
  if ("file" in value && !("append" in value)) {
@@ -48667,7 +48561,7 @@ function resolveAppendDirective(base, override) {
48667
48561
  `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
48562
  );
48669
48563
  }
48670
- return mergeValues4(base, override);
48564
+ return mergeValues3(base, override);
48671
48565
  }
48672
48566
  if (typeof base === "string") {
48673
48567
  return base + directive.text;
@@ -48699,11 +48593,11 @@ function rejectUnresolvedAppendDirective(value) {
48699
48593
  );
48700
48594
  }
48701
48595
  function appendDirectiveFromMarker(value) {
48702
- if (!isRecord3(value)) {
48596
+ if (!isRecord2(value)) {
48703
48597
  return void 0;
48704
48598
  }
48705
48599
  const marker = value[APPEND_DIRECTIVE_MARKER_KEY];
48706
- if (!isRecord3(marker)) {
48600
+ if (!isRecord2(marker)) {
48707
48601
  return void 0;
48708
48602
  }
48709
48603
  return marker;
@@ -48723,9 +48617,9 @@ var init_file_backed_string = __esm({
48723
48617
  function inlineEnvironmentField() {
48724
48618
  return {
48725
48619
  target: "spec",
48726
- merge: (base, override) => mergeValues4(base, override),
48620
+ merge: (base, override) => mergeValues3(base, override),
48727
48621
  compile: (value, context) => {
48728
- if (!isRecord3(value)) {
48622
+ if (!isRecord2(value)) {
48729
48623
  return { resources: [], value };
48730
48624
  }
48731
48625
  const resource = inlineEnvironmentResource2(value, context.path);
@@ -48736,9 +48630,9 @@ function inlineEnvironmentField() {
48736
48630
  function inlineIdentityField() {
48737
48631
  return {
48738
48632
  target: "spec",
48739
- merge: (base, override) => mergeValues4(base, override),
48633
+ merge: (base, override) => mergeValues3(base, override),
48740
48634
  compile: (value, context) => {
48741
- if (!isRecord3(value)) {
48635
+ if (!isRecord2(value)) {
48742
48636
  return { resources: [], value };
48743
48637
  }
48744
48638
  const resource = inlineIdentityResource2(
@@ -48751,7 +48645,7 @@ function inlineIdentityField() {
48751
48645
  };
48752
48646
  }
48753
48647
  function assertAgentAuthoringDocument(document, path2) {
48754
- if (!isRecord3(document) || !("kind" in document)) {
48648
+ if (!isRecord2(document) || !("kind" in document)) {
48755
48649
  return;
48756
48650
  }
48757
48651
  if (document.kind === "session") {
@@ -48777,10 +48671,7 @@ function assertAgentAuthoringDocument(document, path2) {
48777
48671
  );
48778
48672
  }
48779
48673
  }
48780
- function parseAgentResource(draft, path2, removals = []) {
48781
- if (draft.metadata.name === BUILT_IN_DEFAULT_AGENT_NAME) {
48782
- return parseBuiltInDefaultAgentResource(draft, path2, removals);
48783
- }
48674
+ function parseAgentResource(draft, path2, _removals = []) {
48784
48675
  const parsed = AgentApplyRequestSchema.safeParse({
48785
48676
  metadata: draft.metadata,
48786
48677
  spec: draft.spec
@@ -48794,44 +48685,6 @@ function parseAgentResource(draft, path2, removals = []) {
48794
48685
  spec: parsed.data.spec
48795
48686
  };
48796
48687
  }
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
48688
  function inlineEnvironmentResource2(document, path2) {
48836
48689
  const parsed = EnvironmentApplyRequestSchema.safeParse(
48837
48690
  splitMetadataAndSpec(document)
@@ -48893,7 +48746,6 @@ var init_inline_resource = __esm({
48893
48746
  "../../packages/schemas/src/project-apply-files/agent-fields/inline-resource.ts"() {
48894
48747
  "use strict";
48895
48748
  init_agents();
48896
- init_default_agent();
48897
48749
  init_environments();
48898
48750
  init_identities();
48899
48751
  init_source();
@@ -48906,12 +48758,12 @@ function compileRoutingInlineBindings(input) {
48906
48758
  const bindings = input.bindings ? cloneBindings(input.bindings) : {};
48907
48759
  const compiledTriggers = [];
48908
48760
  for (const trigger of input.triggers) {
48909
- if (!isRecord3(trigger) || trigger.kind === "heartbeat") {
48761
+ if (!isRecord2(trigger) || trigger.kind === "heartbeat") {
48910
48762
  compiledTriggers.push(trigger);
48911
48763
  continue;
48912
48764
  }
48913
48765
  const routing = trigger.routing;
48914
- if (!isRecord3(routing)) {
48766
+ if (!isRecord2(routing)) {
48915
48767
  compiledTriggers.push(trigger);
48916
48768
  continue;
48917
48769
  }
@@ -48942,7 +48794,7 @@ function extractDeliverContribution(routing, path2) {
48942
48794
  if (bindBlock === void 0) {
48943
48795
  return void 0;
48944
48796
  }
48945
- if (!isRecord3(bindBlock)) {
48797
+ if (!isRecord2(bindBlock)) {
48946
48798
  throw inlineShapeError(
48947
48799
  path2,
48948
48800
  "deliver",
@@ -48972,7 +48824,7 @@ function extractBindArmContribution(routing, path2) {
48972
48824
  }
48973
48825
  function extractSpawnArmContribution(routing, path2) {
48974
48826
  const bindBlock = routing.bind;
48975
- if (!isRecord3(bindBlock)) {
48827
+ if (!isRecord2(bindBlock)) {
48976
48828
  return void 0;
48977
48829
  }
48978
48830
  if (bindBlock.lifecycle === void 0 && bindBlock.continuity === void 0) {
@@ -49010,7 +48862,7 @@ function mergeContributionIntoBindings(bindings, contribution, path2) {
49010
48862
  }
49011
48863
  function ensureEntry(bindings, target) {
49012
48864
  const existing = bindings[target];
49013
- if (isRecord3(existing)) {
48865
+ if (isRecord2(existing)) {
49014
48866
  return existing;
49015
48867
  }
49016
48868
  const entry = {};
@@ -49032,7 +48884,7 @@ function stripInlineRoutingFields(trigger, routing) {
49032
48884
  return { ...trigger, routing: rest };
49033
48885
  }
49034
48886
  case "spawn": {
49035
- if (!isRecord3(routing.bind)) {
48887
+ if (!isRecord2(routing.bind)) {
49036
48888
  return trigger;
49037
48889
  }
49038
48890
  const {
@@ -49097,7 +48949,7 @@ function rejectSingletonTarget(target, path2, arm) {
49097
48949
  function cloneBindings(bindings) {
49098
48950
  const clone2 = {};
49099
48951
  for (const [key, value] of Object.entries(bindings)) {
49100
- clone2[key] = isRecord3(value) ? { ...value } : value;
48952
+ clone2[key] = isRecord2(value) ? { ...value } : value;
49101
48953
  }
49102
48954
  return clone2;
49103
48955
  }
@@ -49127,7 +48979,7 @@ function namedArrayField(options) {
49127
48979
  target: "spec",
49128
48980
  merge: (base, override) => {
49129
48981
  if (!Array.isArray(base) || !Array.isArray(override)) {
49130
- return mergeValues4(base, override);
48982
+ return mergeValues3(base, override);
49131
48983
  }
49132
48984
  return mergeNamedArray(base, override, options.itemKey);
49133
48985
  },
@@ -49147,7 +48999,7 @@ function triggersField() {
49147
48999
  const withNamesStripped = removeAuthoringTriggerNames(value);
49148
49000
  const { triggers, bindings } = compileRoutingInlineBindings({
49149
49001
  triggers: withNamesStripped,
49150
- bindings: isRecord3(context.draft.spec.bindings) ? context.draft.spec.bindings : void 0,
49002
+ bindings: isRecord2(context.draft.spec.bindings) ? context.draft.spec.bindings : void 0,
49151
49003
  path: context.path
49152
49004
  });
49153
49005
  context.draft.spec.bindings = bindings;
@@ -49156,7 +49008,7 @@ function triggersField() {
49156
49008
  };
49157
49009
  }
49158
49010
  function mountItemKey(item) {
49159
- if (!isRecord3(item)) {
49011
+ if (!isRecord2(item)) {
49160
49012
  return void 0;
49161
49013
  }
49162
49014
  if (typeof item.name === "string") {
@@ -49168,7 +49020,7 @@ function mountItemKey(item) {
49168
49020
  return void 0;
49169
49021
  }
49170
49022
  function triggerItemKey(item) {
49171
- if (!isRecord3(item)) {
49023
+ if (!isRecord2(item)) {
49172
49024
  return void 0;
49173
49025
  }
49174
49026
  if (typeof item.name === "string") {
@@ -49197,7 +49049,7 @@ function mergeNamedArray(base, override, itemKey) {
49197
49049
  for (const item of override) {
49198
49050
  const key = itemKey(item);
49199
49051
  if (key && indexByKey.has(key)) {
49200
- merged[indexByKey.get(key) ?? 0] = mergeValues4(
49052
+ merged[indexByKey.get(key) ?? 0] = mergeValues3(
49201
49053
  merged[indexByKey.get(key) ?? 0],
49202
49054
  item
49203
49055
  );
@@ -49221,7 +49073,7 @@ function removeAuthoringTriggerNames(value) {
49221
49073
  return value;
49222
49074
  }
49223
49075
  return value.map((trigger) => {
49224
- if (!isRecord3(trigger) || !("name" in trigger)) {
49076
+ if (!isRecord2(trigger) || !("name" in trigger)) {
49225
49077
  return trigger;
49226
49078
  }
49227
49079
  const next = { ...trigger };
@@ -49242,9 +49094,9 @@ var init_named_array = __esm({
49242
49094
  function namedMapField() {
49243
49095
  return {
49244
49096
  target: "spec",
49245
- merge: (base, override) => mergeValues4(base, override),
49097
+ merge: (base, override) => mergeValues3(base, override),
49246
49098
  remove: (value, names) => {
49247
- if (!isRecord3(value)) {
49099
+ if (!isRecord2(value)) {
49248
49100
  return value;
49249
49101
  }
49250
49102
  const next = { ...value };
@@ -49343,7 +49195,7 @@ function mergeSourceLocations(base, override) {
49343
49195
  continue;
49344
49196
  }
49345
49197
  const prefix = `${target}.${key}`;
49346
- if (!isRecord3(value)) {
49198
+ if (!isRecord2(value)) {
49347
49199
  merged = Object.fromEntries(
49348
49200
  Object.entries(merged).filter(
49349
49201
  ([path2]) => path2 !== prefix && !path2.startsWith(`${prefix}.`)
@@ -49403,7 +49255,7 @@ function mergeDraftTarget(target, base, override) {
49403
49255
  for (const [key, value] of Object.entries(override)) {
49404
49256
  const field = AGENT_FIELDS[key];
49405
49257
  const merge2 = field?.target === target ? field.merge : void 0;
49406
- merged[key] = merge2 ? merge2(merged[key], value, { field: key }) : mergeValues4(merged[key], value);
49258
+ merged[key] = merge2 ? merge2(merged[key], value, { field: key }) : mergeValues3(merged[key], value);
49407
49259
  }
49408
49260
  return merged;
49409
49261
  }
@@ -49469,7 +49321,7 @@ function readVariableScope(document, path2) {
49469
49321
  if (declared === void 0) {
49470
49322
  return /* @__PURE__ */ new Map();
49471
49323
  }
49472
- if (!isRecord3(declared)) {
49324
+ if (!isRecord2(declared)) {
49473
49325
  throw new Error(
49474
49326
  `Invalid variables in ${path2}: variables must be a map of name to value`
49475
49327
  );
@@ -49498,7 +49350,7 @@ function substituteValue(value, scope, site) {
49498
49350
  if (Array.isArray(value)) {
49499
49351
  return value.map((item) => substituteValue(item, scope, site));
49500
49352
  }
49501
- if (isRecord3(value)) {
49353
+ if (isRecord2(value)) {
49502
49354
  return Object.fromEntries(
49503
49355
  Object.entries(value).map(([key, nested]) => [
49504
49356
  key,
@@ -49616,7 +49468,7 @@ function projectCompiledTriggerSourceLocations(locations, authoredTriggers) {
49616
49468
  );
49617
49469
  let compiledIndex = 0;
49618
49470
  for (const [authoredIndex, trigger] of authoredTriggers.entries()) {
49619
- if (!isRecord3(trigger)) {
49471
+ if (!isRecord2(trigger)) {
49620
49472
  continue;
49621
49473
  }
49622
49474
  const events = authoredTriggerEvents(trigger);
@@ -49684,7 +49536,7 @@ function validateAgentFragmentDocument(document, path2, context) {
49684
49536
  `Agent import cycle detected: ${[...context.stack, normalizedPath].join(" -> ")}`
49685
49537
  );
49686
49538
  }
49687
- if (!isRecord3(document)) {
49539
+ if (!isRecord2(document)) {
49688
49540
  throw new Error(`Invalid agent fragment file ${path2}: expected object`);
49689
49541
  }
49690
49542
  for (const imported of importPaths2(document).map(
@@ -49741,7 +49593,7 @@ function compileAgentDocumentValue(document, path2, fileIndex, contextVariables)
49741
49593
  ...contextVariables && Object.keys(contextVariables).length > 0 ? { contextVariables: new Map(Object.entries(contextVariables)) } : {}
49742
49594
  });
49743
49595
  const authoredTriggers = structuredClone(draft.spec.triggers);
49744
- const removals = isRecord3(document) ? removalDirectives2(document, normalizeSourcePath(path2)) : [];
49596
+ const removals = isRecord2(document) ? removalDirectives2(document, normalizeSourcePath(path2)) : [];
49745
49597
  return {
49746
49598
  ...compileAgentDraftResources(draft, path2, removals),
49747
49599
  sourceLocations: draft.sourceLocations,
@@ -49755,7 +49607,7 @@ function compileAgentDocument2(document, path2, context) {
49755
49607
  `Agent import cycle detected: ${[...context.stack, normalizedPath].join(" -> ")}`
49756
49608
  );
49757
49609
  }
49758
- if (!isRecord3(document)) {
49610
+ if (!isRecord2(document)) {
49759
49611
  throw new Error(`Invalid agent authoring file ${path2}: expected object`);
49760
49612
  }
49761
49613
  const variables = context.stack.length === 0 ? new Map([
@@ -49763,7 +49615,11 @@ function compileAgentDocument2(document, path2, context) {
49763
49615
  ...readVariableScope(document, normalizedPath)
49764
49616
  ]) : context.variables;
49765
49617
  let merged = emptyAgentDraft();
49766
- for (const importPath of importPaths2(document)) {
49618
+ const imports = [
49619
+ ...context.stack.length === 0 && document.name === BUILT_IN_DEFAULT_AGENT_NAME ? [BUILT_IN_DEFAULT_AGENT_TEMPLATE_IMPORT] : [],
49620
+ ...importPaths2(document)
49621
+ ];
49622
+ for (const importPath of imports) {
49767
49623
  const imported = resolveImportPath2(
49768
49624
  importPath,
49769
49625
  normalizedPath,
@@ -49794,6 +49650,7 @@ function compileAgentDocument2(document, path2, context) {
49794
49650
  var init_agent_authoring = __esm({
49795
49651
  "../../packages/schemas/src/project-apply-files/agent-authoring.ts"() {
49796
49652
  "use strict";
49653
+ init_default_agent();
49797
49654
  init_agent_document_merge();
49798
49655
  init_agent_fields();
49799
49656
  init_source();
@@ -50024,13 +49881,33 @@ function collectInjectableTemplateReferences(files) {
50024
49881
  }
50025
49882
  }
50026
49883
  }
49884
+ if (hasBuiltInDefaultAgentDocument(files)) {
49885
+ const implicit = parseTemplateImportSpecifier(
49886
+ BUILT_IN_DEFAULT_AGENT_TEMPLATE_IMPORT
49887
+ );
49888
+ references.set(
49889
+ templateInjectionKey(implicit.name, implicit.track, ""),
49890
+ implicit
49891
+ );
49892
+ }
50027
49893
  return [...references.values()];
50028
49894
  }
49895
+ function hasBuiltInDefaultAgentDocument(files) {
49896
+ return files.some((file2) => {
49897
+ try {
49898
+ return readDocumentsFromSource(file2).some(
49899
+ (document) => isRecord2(document) && document.name === BUILT_IN_DEFAULT_AGENT_NAME
49900
+ );
49901
+ } catch {
49902
+ return false;
49903
+ }
49904
+ });
49905
+ }
50029
49906
  function templateImportsInFile(file2) {
50030
49907
  try {
50031
49908
  const specifiers = [];
50032
49909
  for (const document of readDocumentsFromSource(file2)) {
50033
- if (!isRecord3(document)) {
49910
+ if (!isRecord2(document)) {
50034
49911
  continue;
50035
49912
  }
50036
49913
  for (const importPath of importPaths2(document)) {
@@ -50047,6 +49924,7 @@ function templateImportsInFile(file2) {
50047
49924
  var init_template_injection = __esm({
50048
49925
  "../../packages/schemas/src/project-apply-files/template-injection.ts"() {
50049
49926
  "use strict";
49927
+ init_default_agent();
50050
49928
  init_templates();
50051
49929
  init_agent_document_merge();
50052
49930
  init_source();
@@ -50278,6 +50156,7 @@ var init_project_apply_files = __esm({
50278
50156
  "../../packages/schemas/src/project-apply-files/index.ts"() {
50279
50157
  "use strict";
50280
50158
  init_agents();
50159
+ init_default_agent();
50281
50160
  init_environments();
50282
50161
  init_identities();
50283
50162
  init_project_config();
@@ -68981,7 +68860,7 @@ async function selectRepository(context, github, explicitRepo) {
68981
68860
  const selection = github.grant.providerResourceSelection;
68982
68861
  if (selection.kind === "selected") {
68983
68862
  const repos = selection.resources.map(
68984
- (resource) => isRecord4(resource) && typeof resource.fullName === "string" ? resource.fullName : void 0
68863
+ (resource) => isRecord3(resource) && typeof resource.fullName === "string" ? resource.fullName : void 0
68985
68864
  ).filter(isDefined);
68986
68865
  if (repos.length === 1) {
68987
68866
  context.writeOutput(`Using GitHub repository ${repos[0]}.`);
@@ -69311,7 +69190,7 @@ function slackWorkspaceUrl(slack) {
69311
69190
  function organizationLabel(organization) {
69312
69191
  return `${organization.organizationName} (${organization.organizationSlug})`;
69313
69192
  }
69314
- function isRecord4(value) {
69193
+ function isRecord3(value) {
69315
69194
  return typeof value === "object" && value !== null && !Array.isArray(value);
69316
69195
  }
69317
69196
  function isDefined(value) {