-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(paths,workflows): unify ~/.archon/{workflows,commands,scripts} + drop globalSearchPath (closes #1136) #1315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,7 @@ import { | |
| } from '@archon/core'; | ||
| import { WORKFLOW_EVENT_TYPES, type WorkflowEventType } from '@archon/workflows/store'; | ||
| import { configureIsolation, getIsolationProvider } from '@archon/isolation'; | ||
| import { createLogger, getArchonHome } from '@archon/paths'; | ||
| import { createLogger } from '@archon/paths'; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Include the home workflow directory in the failure hint.
💬 Proposed clearer hint-import { createLogger } from '@archon/paths';
+import { createLogger, getHomeWorkflowsPath } from '@archon/paths';
@@
throw new Error(
- `Error loading workflows: ${err.message}\nHint: Check permissions on .archon/workflows/ directory.`
+ `Error loading workflows: ${err.message}\nHint: Check permissions on .archon/workflows/ and ${getHomeWorkflowsPath()} directories.`
);Also applies to: 122-129 🤖 Prompt for AI Agents |
||
| import { createWorkflowDeps } from '@archon/core/workflows/store-adapter'; | ||
| import { discoverWorkflowsWithConfig } from '@archon/workflows/workflow-discovery'; | ||
| import { resolveWorkflowName } from '@archon/workflows/router'; | ||
|
|
@@ -119,9 +119,9 @@ function renderWorkflowEvent(event: WorkflowEmitterEvent, verbose: boolean): voi | |
| */ | ||
| async function loadWorkflows(cwd: string): Promise<WorkflowLoadResult> { | ||
| try { | ||
| return await discoverWorkflowsWithConfig(cwd, loadConfig, { | ||
| globalSearchPath: getArchonHome(), | ||
| }); | ||
| // Home-scoped workflows at ~/.archon/workflows/ are discovered automatically — | ||
| // no option needed since the discovery helper reads them unconditionally. | ||
| return await discoverWorkflowsWithConfig(cwd, loadConfig); | ||
| } catch (error) { | ||
| const err = error as Error; | ||
| throw new Error( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,7 @@ import { formatToolCall } from '@archon/workflows/utils/tool-formatter'; | |
| import { classifyAndFormatError } from '../utils/error-formatter'; | ||
| import { toError } from '../utils/error'; | ||
| import { getAgentProvider, getProviderCapabilities } from '@archon/providers'; | ||
| import { getArchonHome, getArchonWorkspacesPath } from '@archon/paths'; | ||
| import { getArchonWorkspacesPath } from '@archon/paths'; | ||
| import { syncArchonToWorktree } from '../utils/worktree-sync'; | ||
| import { syncWorkspace, toRepoPath } from '@archon/git'; | ||
| import type { WorkspaceSyncResult } from '@archon/git'; | ||
|
|
@@ -388,9 +388,9 @@ async function discoverAllWorkflows(conversation: Conversation): Promise<Discove | |
| let config: MergedConfig | undefined; | ||
|
|
||
| try { | ||
| const result = await discoverWorkflowsWithConfig(getArchonWorkspacesPath(), loadConfig, { | ||
| globalSearchPath: getArchonHome(), | ||
| }); | ||
| // Home-scoped workflows at ~/.archon/workflows/ are discovered automatically | ||
| // by discoverWorkflowsWithConfig — no option needed. | ||
| const result = await discoverWorkflowsWithConfig(getArchonWorkspacesPath(), loadConfig); | ||
|
Comment on lines
+391
to
+393
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid discovering home workflows twice for project-scoped conversations. This call now includes home-scoped workflows internally, and the later repo discovery in this function does too. A broken home workflow can therefore be reported twice in 🤖 Prompt for AI Agents |
||
| workflows = [...result.workflows]; | ||
| allErrors.push(...result.errors); | ||
| } catch (error) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the API docs to include
source: 'global'.This section now documents the new global source label, but the workflow endpoint docs later still describe
GET /api/workflows/:nameas returning onlysource: 'project' | 'bundled'. Please update that API line too so Web/API consumers see the new enum value.🤖 Prompt for AI Agents