@joshski/dust 0.1.54 → 0.1.55
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/agents/detection.d.ts +30 -0
- package/dist/agents.js +16 -0
- package/dist/dust.js +1 -1
- package/dist/workflow-tasks.js +4 -2
- package/package.json +6 -2
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent detection module
|
|
3
|
+
*
|
|
4
|
+
* Provides type-safe detection of which agent environment is running
|
|
5
|
+
* based on environment variables.
|
|
6
|
+
*/
|
|
7
|
+
export type Agent = {
|
|
8
|
+
type: 'claude-code-web';
|
|
9
|
+
name: 'Claude Code Web';
|
|
10
|
+
} | {
|
|
11
|
+
type: 'claude-code';
|
|
12
|
+
name: 'Claude Code';
|
|
13
|
+
} | {
|
|
14
|
+
type: 'codex';
|
|
15
|
+
name: 'Codex';
|
|
16
|
+
} | {
|
|
17
|
+
type: 'unknown';
|
|
18
|
+
name: 'Agent';
|
|
19
|
+
};
|
|
20
|
+
export type AgentType = Agent['type'];
|
|
21
|
+
/**
|
|
22
|
+
* Detects which agent environment is running based on environment variables.
|
|
23
|
+
*
|
|
24
|
+
* Detection priority:
|
|
25
|
+
* 1. CLAUDECODE + CLAUDE_CODE_REMOTE → Claude Code Web
|
|
26
|
+
* 2. CLAUDECODE alone → Claude Code
|
|
27
|
+
* 3. CODEX_HOME or CODEX_CI → Codex
|
|
28
|
+
* 4. Fallback → unknown Agent
|
|
29
|
+
*/
|
|
30
|
+
export declare function detectAgent(env?: NodeJS.ProcessEnv): Agent;
|
package/dist/agents.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// lib/agents/detection.ts
|
|
2
|
+
function detectAgent(env = process.env) {
|
|
3
|
+
if (env.CLAUDECODE) {
|
|
4
|
+
if (env.CLAUDE_CODE_REMOTE) {
|
|
5
|
+
return { type: "claude-code-web", name: "Claude Code Web" };
|
|
6
|
+
}
|
|
7
|
+
return { type: "claude-code", name: "Claude Code" };
|
|
8
|
+
}
|
|
9
|
+
if (env.CODEX_HOME || env.CODEX_CI) {
|
|
10
|
+
return { type: "codex", name: "Codex" };
|
|
11
|
+
}
|
|
12
|
+
return { type: "unknown", name: "Agent" };
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
detectAgent
|
|
16
|
+
};
|
package/dist/dust.js
CHANGED
|
@@ -269,7 +269,7 @@ function detectAgent(env = process.env) {
|
|
|
269
269
|
}
|
|
270
270
|
return { type: "claude-code", name: "Claude Code" };
|
|
271
271
|
}
|
|
272
|
-
if (env.CODEX_HOME) {
|
|
272
|
+
if (env.CODEX_HOME || env.CODEX_CI) {
|
|
273
273
|
return { type: "codex", name: "Codex" };
|
|
274
274
|
}
|
|
275
275
|
return { type: "unknown", name: "Agent" };
|
package/dist/workflow-tasks.js
CHANGED
|
@@ -111,9 +111,10 @@ async function createIdeaTask(fileSystem, dustPath, prefix, ideaSlug, openingSen
|
|
|
111
111
|
return { filePath };
|
|
112
112
|
}
|
|
113
113
|
async function createRefineIdeaTask(fileSystem, dustPath, ideaSlug, description) {
|
|
114
|
-
return createIdeaTask(fileSystem, dustPath, "Refine Idea: ", ideaSlug, (ideaTitle) => `Thoroughly research this idea and refine it into a well-defined proposal. Read the idea file, explore the codebase for relevant context, and identify any ambiguity. Where aspects are unclear or could go multiple ways, add open questions to the idea file. Review \`.dust/goals/\` for alignment and \`.dust/facts/\` for relevant design decisions. See [${ideaTitle}](../ideas/${ideaSlug}.md).`, [
|
|
114
|
+
return createIdeaTask(fileSystem, dustPath, "Refine Idea: ", ideaSlug, (ideaTitle) => `Thoroughly research this idea and refine it into a well-defined proposal. Read the idea file, explore the codebase for relevant context, and identify any ambiguity. Where aspects are unclear or could go multiple ways, add open questions to the idea file. Review \`.dust/goals/\` for alignment and \`.dust/facts/\` for relevant design decisions. See [${ideaTitle}](../ideas/${ideaSlug}.md). If you add open questions, use \`## Open Questions\` with \`### Question?\` headings and \`#### Option\` headings, and only add questions that are meaningful decisions worth asking.`, [
|
|
115
115
|
"Idea is thoroughly researched with relevant codebase context",
|
|
116
116
|
"Open questions are added for any ambiguous or underspecified aspects",
|
|
117
|
+
"Open questions follow the required heading format and focus on high-value decisions",
|
|
117
118
|
"Idea file is updated with findings"
|
|
118
119
|
], { description });
|
|
119
120
|
}
|
|
@@ -174,7 +175,7 @@ ${description}
|
|
|
174
175
|
const ideaPath = `.dust/ideas/${ideaFilename}`;
|
|
175
176
|
const content = `# ${taskTitle}
|
|
176
177
|
|
|
177
|
-
Research this idea thoroughly, then create an idea file at \`${ideaPath}\`. Read the codebase for relevant context, flesh out the description, and identify any ambiguity. Where aspects are unclear or could go multiple ways, add open questions to the idea file. Review \`.dust/goals/\` and \`.dust/facts/\` for relevant context.
|
|
178
|
+
Research this idea thoroughly, then create an idea file at \`${ideaPath}\`. Read the codebase for relevant context, flesh out the description, and identify any ambiguity. Where aspects are unclear or could go multiple ways, add open questions to the idea file. If you add open questions, use \`## Open Questions\` with \`### Question?\` headings and \`#### Option\` headings, and only add questions that are meaningful decisions worth asking. Review \`.dust/goals/\` and \`.dust/facts/\` for relevant context.
|
|
178
179
|
|
|
179
180
|
## Idea Description
|
|
180
181
|
|
|
@@ -194,6 +195,7 @@ ${description}
|
|
|
194
195
|
- [ ] Idea file has an H1 title matching "${title}"
|
|
195
196
|
- [ ] Idea includes relevant context from codebase exploration
|
|
196
197
|
- [ ] Open questions are added for any ambiguous or underspecified aspects
|
|
198
|
+
- [ ] Open questions follow the required heading format and focus on high-value decisions
|
|
197
199
|
`;
|
|
198
200
|
await fileSystem.writeFile(filePath, content);
|
|
199
201
|
return { filePath };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@joshski/dust",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.55",
|
|
4
4
|
"description": "Flow state for AI coding agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"import": "./dist/logging.js",
|
|
19
19
|
"types": "./dist/logging/index.d.ts"
|
|
20
20
|
},
|
|
21
|
+
"./agents": {
|
|
22
|
+
"import": "./dist/agents.js",
|
|
23
|
+
"types": "./dist/agents/detection.d.ts"
|
|
24
|
+
},
|
|
21
25
|
"./istanbul/minimal-reporter": "./lib/istanbul/minimal-reporter.cjs"
|
|
22
26
|
},
|
|
23
27
|
"files": [
|
|
@@ -38,7 +42,7 @@
|
|
|
38
42
|
"author": "joshski",
|
|
39
43
|
"license": "MIT",
|
|
40
44
|
"scripts": {
|
|
41
|
-
"build": "bun build lib/cli/run.ts --target node --outfile dist/dust.js && printf '%s\\n%s' '#!/usr/bin/env node' \"$(cat dist/dust.js)\" > dist/dust.js && bun build lib/workflow-tasks.ts --target node --outfile dist/workflow-tasks.js && bun build lib/logging/index.ts --target node --outfile dist/logging.js && bunx tsc --project tsconfig.build.json",
|
|
45
|
+
"build": "bun build lib/cli/run.ts --target node --outfile dist/dust.js && printf '%s\\n%s' '#!/usr/bin/env node' \"$(cat dist/dust.js)\" > dist/dust.js && bun build lib/workflow-tasks.ts --target node --outfile dist/workflow-tasks.js && bun build lib/logging/index.ts --target node --outfile dist/logging.js && bun build lib/agents/detection.ts --target node --outfile dist/agents.js && bunx tsc --project tsconfig.build.json",
|
|
42
46
|
"test": "vitest run",
|
|
43
47
|
"test:coverage": "vitest run --coverage",
|
|
44
48
|
"eval": "bun run ./evals/run.ts"
|