@supaku/agentfactory-linear 0.2.0 → 0.4.0
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/src/defaults/auto-trigger.d.ts +35 -0
- package/dist/src/defaults/auto-trigger.d.ts.map +1 -0
- package/dist/src/defaults/auto-trigger.js +36 -0
- package/dist/src/defaults/index.d.ts +12 -0
- package/dist/src/defaults/index.d.ts.map +1 -0
- package/dist/src/defaults/index.js +11 -0
- package/dist/src/defaults/priority.d.ts +20 -0
- package/dist/src/defaults/priority.d.ts.map +1 -0
- package/dist/src/defaults/priority.js +34 -0
- package/dist/src/defaults/prompts.d.ts +24 -0
- package/dist/src/defaults/prompts.d.ts.map +1 -0
- package/dist/src/defaults/prompts.js +115 -0
- package/dist/src/defaults/work-type-detection.d.ts +19 -0
- package/dist/src/defaults/work-type-detection.d.ts.map +1 -0
- package/dist/src/defaults/work-type-detection.js +87 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default auto-trigger configuration parser.
|
|
3
|
+
*
|
|
4
|
+
* Parses environment variables to determine which automated
|
|
5
|
+
* workflows (QA, acceptance) should be triggered on status transitions.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Auto-trigger configuration shape.
|
|
9
|
+
* Matches the AutoTriggerConfig interface from @supaku/agentfactory-nextjs.
|
|
10
|
+
*/
|
|
11
|
+
export interface DefaultAutoTriggerConfig {
|
|
12
|
+
enableAutoQA: boolean;
|
|
13
|
+
enableAutoAcceptance: boolean;
|
|
14
|
+
autoQARequireAgentWorked: boolean;
|
|
15
|
+
autoAcceptanceRequireAgentWorked: boolean;
|
|
16
|
+
autoQAProjects: string[];
|
|
17
|
+
autoAcceptanceProjects: string[];
|
|
18
|
+
autoQAExcludeLabels: string[];
|
|
19
|
+
autoAcceptanceExcludeLabels: string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Parse auto-trigger configuration from environment variables.
|
|
23
|
+
*
|
|
24
|
+
* Environment variables:
|
|
25
|
+
* ENABLE_AUTO_QA - Enable automatic QA on Finished transition
|
|
26
|
+
* ENABLE_AUTO_ACCEPTANCE - Enable automatic acceptance on Delivered transition
|
|
27
|
+
* AUTO_QA_REQUIRE_AGENT_WORKED - Only auto-QA agent-worked issues (default: true)
|
|
28
|
+
* AUTO_ACCEPTANCE_REQUIRE_AGENT_WORKED - Only auto-accept agent-worked issues (default: true)
|
|
29
|
+
* AUTO_QA_PROJECTS - Comma-separated project names to auto-QA
|
|
30
|
+
* AUTO_ACCEPTANCE_PROJECTS - Comma-separated project names to auto-accept
|
|
31
|
+
* AUTO_QA_EXCLUDE_LABELS - Labels that exclude issues from auto-QA
|
|
32
|
+
* AUTO_ACCEPTANCE_EXCLUDE_LABELS - Labels that exclude issues from auto-acceptance
|
|
33
|
+
*/
|
|
34
|
+
export declare function defaultParseAutoTriggerConfig(): DefaultAutoTriggerConfig;
|
|
35
|
+
//# sourceMappingURL=auto-trigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-trigger.d.ts","sourceRoot":"","sources":["../../../src/defaults/auto-trigger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,OAAO,CAAA;IACrB,oBAAoB,EAAE,OAAO,CAAA;IAC7B,wBAAwB,EAAE,OAAO,CAAA;IACjC,gCAAgC,EAAE,OAAO,CAAA;IACzC,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,sBAAsB,EAAE,MAAM,EAAE,CAAA;IAChC,mBAAmB,EAAE,MAAM,EAAE,CAAA;IAC7B,2BAA2B,EAAE,MAAM,EAAE,CAAA;CACtC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,6BAA6B,IAAI,wBAAwB,CAWxE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default auto-trigger configuration parser.
|
|
3
|
+
*
|
|
4
|
+
* Parses environment variables to determine which automated
|
|
5
|
+
* workflows (QA, acceptance) should be triggered on status transitions.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Parse auto-trigger configuration from environment variables.
|
|
9
|
+
*
|
|
10
|
+
* Environment variables:
|
|
11
|
+
* ENABLE_AUTO_QA - Enable automatic QA on Finished transition
|
|
12
|
+
* ENABLE_AUTO_ACCEPTANCE - Enable automatic acceptance on Delivered transition
|
|
13
|
+
* AUTO_QA_REQUIRE_AGENT_WORKED - Only auto-QA agent-worked issues (default: true)
|
|
14
|
+
* AUTO_ACCEPTANCE_REQUIRE_AGENT_WORKED - Only auto-accept agent-worked issues (default: true)
|
|
15
|
+
* AUTO_QA_PROJECTS - Comma-separated project names to auto-QA
|
|
16
|
+
* AUTO_ACCEPTANCE_PROJECTS - Comma-separated project names to auto-accept
|
|
17
|
+
* AUTO_QA_EXCLUDE_LABELS - Labels that exclude issues from auto-QA
|
|
18
|
+
* AUTO_ACCEPTANCE_EXCLUDE_LABELS - Labels that exclude issues from auto-acceptance
|
|
19
|
+
*/
|
|
20
|
+
export function defaultParseAutoTriggerConfig() {
|
|
21
|
+
return {
|
|
22
|
+
enableAutoQA: process.env.ENABLE_AUTO_QA === 'true',
|
|
23
|
+
enableAutoAcceptance: process.env.ENABLE_AUTO_ACCEPTANCE === 'true',
|
|
24
|
+
autoQARequireAgentWorked: process.env.AUTO_QA_REQUIRE_AGENT_WORKED !== 'false',
|
|
25
|
+
autoAcceptanceRequireAgentWorked: process.env.AUTO_ACCEPTANCE_REQUIRE_AGENT_WORKED !== 'false',
|
|
26
|
+
autoQAProjects: parseCommaSeparated(process.env.AUTO_QA_PROJECTS),
|
|
27
|
+
autoAcceptanceProjects: parseCommaSeparated(process.env.AUTO_ACCEPTANCE_PROJECTS),
|
|
28
|
+
autoQAExcludeLabels: parseCommaSeparated(process.env.AUTO_QA_EXCLUDE_LABELS),
|
|
29
|
+
autoAcceptanceExcludeLabels: parseCommaSeparated(process.env.AUTO_ACCEPTANCE_EXCLUDE_LABELS),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function parseCommaSeparated(value) {
|
|
33
|
+
if (!value)
|
|
34
|
+
return [];
|
|
35
|
+
return value.split(',').map(s => s.trim()).filter(Boolean);
|
|
36
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default implementations for prompt generation, work type detection,
|
|
3
|
+
* priority assignment, and auto-trigger configuration.
|
|
4
|
+
*
|
|
5
|
+
* New users start with these defaults and customize as needed.
|
|
6
|
+
* Supaku overrides these with its own prompts.ts.
|
|
7
|
+
*/
|
|
8
|
+
export { defaultGeneratePrompt, defaultBuildParentQAContext, defaultBuildParentAcceptanceContext, } from './prompts.js';
|
|
9
|
+
export { defaultDetectWorkTypeFromPrompt } from './work-type-detection.js';
|
|
10
|
+
export { defaultGetPriority } from './priority.js';
|
|
11
|
+
export { defaultParseAutoTriggerConfig, type DefaultAutoTriggerConfig, } from './auto-trigger.js';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/defaults/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,mCAAmC,GACpC,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAA;AAE1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAElD,OAAO,EACL,6BAA6B,EAC7B,KAAK,wBAAwB,GAC9B,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default implementations for prompt generation, work type detection,
|
|
3
|
+
* priority assignment, and auto-trigger configuration.
|
|
4
|
+
*
|
|
5
|
+
* New users start with these defaults and customize as needed.
|
|
6
|
+
* Supaku overrides these with its own prompts.ts.
|
|
7
|
+
*/
|
|
8
|
+
export { defaultGeneratePrompt, defaultBuildParentQAContext, defaultBuildParentAcceptanceContext, } from './prompts.js';
|
|
9
|
+
export { defaultDetectWorkTypeFromPrompt } from './work-type-detection.js';
|
|
10
|
+
export { defaultGetPriority } from './priority.js';
|
|
11
|
+
export { defaultParseAutoTriggerConfig, } from './auto-trigger.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default priority values for each work type.
|
|
3
|
+
*
|
|
4
|
+
* Lower values = higher priority in the work queue.
|
|
5
|
+
*/
|
|
6
|
+
import type { AgentWorkType } from '../types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Get the default priority for a work type.
|
|
9
|
+
*
|
|
10
|
+
* Priority scale:
|
|
11
|
+
* 1 = Urgent (reserved for future use)
|
|
12
|
+
* 2 = High (QA, acceptance, coordination, inflight, refinement)
|
|
13
|
+
* 3 = Normal (development, backlog-creation)
|
|
14
|
+
* 4 = Low (research)
|
|
15
|
+
*
|
|
16
|
+
* @param workType - The work type to get priority for
|
|
17
|
+
* @returns Priority value (lower = higher priority)
|
|
18
|
+
*/
|
|
19
|
+
export declare function defaultGetPriority(workType: AgentWorkType): number;
|
|
20
|
+
//# sourceMappingURL=priority.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"priority.d.ts","sourceRoot":"","sources":["../../../src/defaults/priority.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,CAgBlE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default priority values for each work type.
|
|
3
|
+
*
|
|
4
|
+
* Lower values = higher priority in the work queue.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Get the default priority for a work type.
|
|
8
|
+
*
|
|
9
|
+
* Priority scale:
|
|
10
|
+
* 1 = Urgent (reserved for future use)
|
|
11
|
+
* 2 = High (QA, acceptance, coordination, inflight, refinement)
|
|
12
|
+
* 3 = Normal (development, backlog-creation)
|
|
13
|
+
* 4 = Low (research)
|
|
14
|
+
*
|
|
15
|
+
* @param workType - The work type to get priority for
|
|
16
|
+
* @returns Priority value (lower = higher priority)
|
|
17
|
+
*/
|
|
18
|
+
export function defaultGetPriority(workType) {
|
|
19
|
+
switch (workType) {
|
|
20
|
+
case 'qa':
|
|
21
|
+
case 'acceptance':
|
|
22
|
+
case 'refinement':
|
|
23
|
+
case 'inflight':
|
|
24
|
+
case 'coordination':
|
|
25
|
+
case 'qa-coordination':
|
|
26
|
+
case 'acceptance-coordination':
|
|
27
|
+
return 2;
|
|
28
|
+
case 'backlog-creation':
|
|
29
|
+
case 'development':
|
|
30
|
+
return 3;
|
|
31
|
+
case 'research':
|
|
32
|
+
return 4;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default prompt templates for each work type.
|
|
3
|
+
*
|
|
4
|
+
* These provide sensible defaults that can be overridden by consumers.
|
|
5
|
+
* The Supaku project overrides these with its own prompts.ts.
|
|
6
|
+
*/
|
|
7
|
+
import type { AgentWorkType, SubIssueStatus } from '../types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Generate a default prompt for a given work type and issue identifier.
|
|
10
|
+
*
|
|
11
|
+
* @param identifier - The issue identifier (e.g., "PROJ-123")
|
|
12
|
+
* @param workType - The type of work to perform
|
|
13
|
+
* @param mentionContext - Optional additional context from a user mention
|
|
14
|
+
*/
|
|
15
|
+
export declare function defaultGeneratePrompt(identifier: string, workType: AgentWorkType, mentionContext?: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Build default QA context for parent issues with sub-issues.
|
|
18
|
+
*/
|
|
19
|
+
export declare function defaultBuildParentQAContext(issueIdentifier: string, subIssueStatuses: SubIssueStatus[]): string;
|
|
20
|
+
/**
|
|
21
|
+
* Build default acceptance context for parent issues with sub-issues.
|
|
22
|
+
*/
|
|
23
|
+
export declare function defaultBuildParentAcceptanceContext(issueIdentifier: string, subIssueStatuses: SubIssueStatus[]): string;
|
|
24
|
+
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/defaults/prompts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEhE;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,aAAa,EACvB,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM,CA0DR;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,eAAe,EAAE,MAAM,EACvB,gBAAgB,EAAE,cAAc,EAAE,GACjC,MAAM,CAoBR;AAED;;GAEG;AACH,wBAAgB,mCAAmC,CACjD,eAAe,EAAE,MAAM,EACvB,gBAAgB,EAAE,cAAc,EAAE,GACjC,MAAM,CAmBR"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default prompt templates for each work type.
|
|
3
|
+
*
|
|
4
|
+
* These provide sensible defaults that can be overridden by consumers.
|
|
5
|
+
* The Supaku project overrides these with its own prompts.ts.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Generate a default prompt for a given work type and issue identifier.
|
|
9
|
+
*
|
|
10
|
+
* @param identifier - The issue identifier (e.g., "PROJ-123")
|
|
11
|
+
* @param workType - The type of work to perform
|
|
12
|
+
* @param mentionContext - Optional additional context from a user mention
|
|
13
|
+
*/
|
|
14
|
+
export function defaultGeneratePrompt(identifier, workType, mentionContext) {
|
|
15
|
+
let basePrompt;
|
|
16
|
+
switch (workType) {
|
|
17
|
+
case 'research':
|
|
18
|
+
basePrompt = `Research and flesh out story ${identifier}. Analyze requirements, identify technical approach, estimate complexity, and update the story description with detailed acceptance criteria. Do NOT implement code.`;
|
|
19
|
+
break;
|
|
20
|
+
case 'backlog-creation':
|
|
21
|
+
basePrompt = `Create backlog issues from the researched story ${identifier}.
|
|
22
|
+
Read the issue description, identify distinct work items, classify each as bug/feature/chore,
|
|
23
|
+
and create appropriately scoped issues in Backlog status.
|
|
24
|
+
Choose the correct issue structure based on the work:
|
|
25
|
+
- Sub-issues (--parentId): When work is a single concern with sequential/parallel phases sharing context and dependencies.
|
|
26
|
+
- Independent issues (--type related): When items are unrelated work in different codebase areas with no shared context.
|
|
27
|
+
- Single issue rewrite: When scope is atomic (single concern, few files, no phases). Rewrite source in-place and move to Backlog.
|
|
28
|
+
When creating multiple issues, always add "related" links between them AND blocking relations where one step depends on another.
|
|
29
|
+
Do NOT wait for user approval - create issues automatically.`;
|
|
30
|
+
break;
|
|
31
|
+
case 'development':
|
|
32
|
+
basePrompt = `Start work on ${identifier}. Implement the feature/fix as specified.`;
|
|
33
|
+
break;
|
|
34
|
+
case 'inflight':
|
|
35
|
+
basePrompt = `Continue work on ${identifier}. Resume where you left off.`;
|
|
36
|
+
break;
|
|
37
|
+
case 'qa':
|
|
38
|
+
basePrompt = `QA ${identifier}. Validate the implementation against acceptance criteria.`;
|
|
39
|
+
break;
|
|
40
|
+
case 'acceptance':
|
|
41
|
+
basePrompt = `Process acceptance for ${identifier}. Validate development and QA work is complete, verify PR is ready to merge (CI passing, no conflicts), merge the PR, and clean up local resources.`;
|
|
42
|
+
break;
|
|
43
|
+
case 'refinement':
|
|
44
|
+
basePrompt = `Refine ${identifier} based on rejection feedback. Read comments, update requirements, then return to Backlog.`;
|
|
45
|
+
break;
|
|
46
|
+
case 'coordination':
|
|
47
|
+
basePrompt = `Coordinate sub-issue execution for parent issue ${identifier}. Fetch sub-issues with dependency graph, create tasks mapping to each sub-issue, spawn sub-agents for unblocked sub-issues in parallel, monitor completion, and create a single PR with all changes when done.
|
|
48
|
+
|
|
49
|
+
SUB-ISSUE STATUS MANAGEMENT:
|
|
50
|
+
Update sub-issue statuses in Linear as work progresses:
|
|
51
|
+
- When starting work on a sub-issue: update status to Started
|
|
52
|
+
- When a sub-agent completes a sub-issue: update status to Finished
|
|
53
|
+
- If a sub-agent fails: add a comment explaining the failure
|
|
54
|
+
|
|
55
|
+
COMPLETION VERIFICATION:
|
|
56
|
+
Before marking the parent issue as complete, verify ALL sub-issues are in Finished status.
|
|
57
|
+
If any sub-issue is not Finished, report the failure and do not mark the parent as complete.`;
|
|
58
|
+
break;
|
|
59
|
+
case 'qa-coordination':
|
|
60
|
+
basePrompt = `Coordinate QA across sub-issues for parent issue ${identifier}. Fetch sub-issues, spawn QA sub-agents in parallel for each sub-issue, collect pass/fail results, and roll up to parent. ALL sub-issues must pass QA for the parent to pass.`;
|
|
61
|
+
break;
|
|
62
|
+
case 'acceptance-coordination':
|
|
63
|
+
basePrompt = `Coordinate acceptance across sub-issues for parent issue ${identifier}. Verify all sub-issues are Delivered, validate the PR (CI passing, no conflicts), merge the PR, and bulk-update sub-issues to Accepted.`;
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
if (mentionContext) {
|
|
67
|
+
return `${basePrompt}\n\nAdditional context from the user's mention:\n${mentionContext}`;
|
|
68
|
+
}
|
|
69
|
+
return basePrompt;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Build default QA context for parent issues with sub-issues.
|
|
73
|
+
*/
|
|
74
|
+
export function defaultBuildParentQAContext(issueIdentifier, subIssueStatuses) {
|
|
75
|
+
const subIssueList = subIssueStatuses
|
|
76
|
+
.map(s => `- ${s.identifier}: ${s.title} (Status: ${s.status})`)
|
|
77
|
+
.join('\n');
|
|
78
|
+
return `QA ${issueIdentifier} (parent issue with ${subIssueStatuses.length} sub-issues).
|
|
79
|
+
|
|
80
|
+
## Sub-Issues
|
|
81
|
+
${subIssueList}
|
|
82
|
+
|
|
83
|
+
## Holistic QA Instructions
|
|
84
|
+
This is a parent issue whose work was coordinated across multiple sub-issues.
|
|
85
|
+
Perform holistic validation beyond individual sub-issue checks:
|
|
86
|
+
|
|
87
|
+
1. **Scope Coverage**: Read each sub-issue description and verify the PR includes implementation for ALL sub-issues.
|
|
88
|
+
2. **Integration Validation**: Check that shared types, API contracts, and data flow between sub-issue implementations are consistent and correct.
|
|
89
|
+
3. **Cross-Cutting Concerns**: Verify consistent error handling, auth patterns, naming conventions, and no orphaned/dead code across all sub-issue changes.
|
|
90
|
+
4. **Sub-Issue Status**: All sub-issues must be in Finished, Delivered, or Accepted status.
|
|
91
|
+
|
|
92
|
+
Validate the implementation against the parent issue's acceptance criteria as a whole, not just each sub-issue in isolation.`;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Build default acceptance context for parent issues with sub-issues.
|
|
96
|
+
*/
|
|
97
|
+
export function defaultBuildParentAcceptanceContext(issueIdentifier, subIssueStatuses) {
|
|
98
|
+
const subIssueList = subIssueStatuses
|
|
99
|
+
.map(s => `- ${s.identifier}: ${s.title} (Status: ${s.status})`)
|
|
100
|
+
.join('\n');
|
|
101
|
+
return `Process acceptance for ${issueIdentifier} (parent issue with ${subIssueStatuses.length} sub-issues).
|
|
102
|
+
|
|
103
|
+
## Sub-Issues
|
|
104
|
+
${subIssueList}
|
|
105
|
+
|
|
106
|
+
## Parent Issue Acceptance Requirements
|
|
107
|
+
This is a parent issue with coordinated sub-issues. Before merging:
|
|
108
|
+
|
|
109
|
+
1. **Sub-Issue Status**: ALL sub-issues must be in **Delivered** or **Accepted** status.
|
|
110
|
+
2. **PR Completeness**: The single PR should contain changes for all sub-issues.
|
|
111
|
+
3. **CI/Deployment**: Verify the combined PR passes CI and deploys successfully.
|
|
112
|
+
|
|
113
|
+
Validate development and QA work is complete, verify PR is ready to merge (CI passing, no conflicts), merge the PR.
|
|
114
|
+
After merge succeeds, delete the remote branch.`;
|
|
115
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default work type detection from prompt keywords.
|
|
3
|
+
*
|
|
4
|
+
* Scans prompt text for keywords that map to specific work types,
|
|
5
|
+
* constrained to the set of valid work types for the current issue status.
|
|
6
|
+
*/
|
|
7
|
+
import type { AgentWorkType } from '../types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Detect work type from prompt text, constrained to valid options.
|
|
10
|
+
*
|
|
11
|
+
* Scans the prompt for keywords and returns the first matching work type
|
|
12
|
+
* that is also in the set of valid work types for the current issue status.
|
|
13
|
+
*
|
|
14
|
+
* @param prompt - The prompt text to scan
|
|
15
|
+
* @param validWorkTypes - Work types valid for the current issue status
|
|
16
|
+
* @returns The detected work type, or undefined if no match
|
|
17
|
+
*/
|
|
18
|
+
export declare function defaultDetectWorkTypeFromPrompt(prompt: string, validWorkTypes: AgentWorkType[]): AgentWorkType | undefined;
|
|
19
|
+
//# sourceMappingURL=work-type-detection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-type-detection.d.ts","sourceRoot":"","sources":["../../../src/defaults/work-type-detection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AA6DhD;;;;;;;;;GASG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,aAAa,EAAE,GAC9B,aAAa,GAAG,SAAS,CAe3B"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default work type detection from prompt keywords.
|
|
3
|
+
*
|
|
4
|
+
* Scans prompt text for keywords that map to specific work types,
|
|
5
|
+
* constrained to the set of valid work types for the current issue status.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Default keywords that map to each work type.
|
|
9
|
+
* More specific phrases come before generic ones within each work type.
|
|
10
|
+
*/
|
|
11
|
+
const DEFAULT_WORK_TYPE_KEYWORDS = {
|
|
12
|
+
'backlog-creation': [
|
|
13
|
+
'create backlog', 'write stories', 'create stories', 'create issues',
|
|
14
|
+
'generate issues', 'make issues', 'turn into issues', 'break down',
|
|
15
|
+
'break this down', 'split into issues', 'backlog writer', 'backlog-writer',
|
|
16
|
+
'write backlog', 'populate backlog', 'write issues',
|
|
17
|
+
],
|
|
18
|
+
'research': [
|
|
19
|
+
'research', 'flesh out', 'write story', 'story details',
|
|
20
|
+
'analyze requirements', 'acceptance criteria',
|
|
21
|
+
],
|
|
22
|
+
'qa': [
|
|
23
|
+
'qa ', 'test this', 'verify', 'validate', 'review the pr', 'check the pr',
|
|
24
|
+
],
|
|
25
|
+
'inflight': [
|
|
26
|
+
'continue', 'resume', 'pick up where', 'keep going',
|
|
27
|
+
],
|
|
28
|
+
'acceptance': [
|
|
29
|
+
'acceptance', 'final test', 'preview deploy', 'merge pr', 'merge the pr',
|
|
30
|
+
'complete acceptance', 'finalize',
|
|
31
|
+
],
|
|
32
|
+
'refinement': [
|
|
33
|
+
'refine', 'rejection', 'feedback', 'rework',
|
|
34
|
+
],
|
|
35
|
+
'development': [
|
|
36
|
+
'implement', 'develop', 'build', 'code', 'work',
|
|
37
|
+
],
|
|
38
|
+
'coordination': [
|
|
39
|
+
'coordinate', 'orchestrate', 'run sub-issues', 'run children',
|
|
40
|
+
'run all sub-issues', 'execute sub-issues', 'work on this',
|
|
41
|
+
],
|
|
42
|
+
'qa-coordination': [
|
|
43
|
+
'qa coordination', 'qa sub-issues', 'qa all sub-issues', 'qa this', 'qa issue',
|
|
44
|
+
],
|
|
45
|
+
'acceptance-coordination': [
|
|
46
|
+
'acceptance coordination', 'accept sub-issues', 'accept all sub-issues',
|
|
47
|
+
'perform acceptance', 'complete acceptance',
|
|
48
|
+
],
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Priority order for work type detection.
|
|
52
|
+
* More specific work types come first to ensure correct matching.
|
|
53
|
+
*/
|
|
54
|
+
const WORK_TYPE_PRIORITY_ORDER = [
|
|
55
|
+
'coordination',
|
|
56
|
+
'backlog-creation',
|
|
57
|
+
'research',
|
|
58
|
+
'qa',
|
|
59
|
+
'inflight',
|
|
60
|
+
'acceptance',
|
|
61
|
+
'refinement',
|
|
62
|
+
'development',
|
|
63
|
+
];
|
|
64
|
+
/**
|
|
65
|
+
* Detect work type from prompt text, constrained to valid options.
|
|
66
|
+
*
|
|
67
|
+
* Scans the prompt for keywords and returns the first matching work type
|
|
68
|
+
* that is also in the set of valid work types for the current issue status.
|
|
69
|
+
*
|
|
70
|
+
* @param prompt - The prompt text to scan
|
|
71
|
+
* @param validWorkTypes - Work types valid for the current issue status
|
|
72
|
+
* @returns The detected work type, or undefined if no match
|
|
73
|
+
*/
|
|
74
|
+
export function defaultDetectWorkTypeFromPrompt(prompt, validWorkTypes) {
|
|
75
|
+
if (!prompt || validWorkTypes.length === 0)
|
|
76
|
+
return undefined;
|
|
77
|
+
const lowerPrompt = prompt.toLowerCase();
|
|
78
|
+
for (const workType of WORK_TYPE_PRIORITY_ORDER) {
|
|
79
|
+
if (!validWorkTypes.includes(workType))
|
|
80
|
+
continue;
|
|
81
|
+
const keywords = DEFAULT_WORK_TYPE_KEYWORDS[workType];
|
|
82
|
+
if (keywords?.some(keyword => lowerPrompt.includes(keyword))) {
|
|
83
|
+
return workType;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -13,4 +13,5 @@ export type { CheckboxItem, CheckboxUpdate } from './checkbox-utils';
|
|
|
13
13
|
export { LinearAgentClient, createLinearAgentClient } from './agent-client';
|
|
14
14
|
export { AgentSession, createAgentSession } from './agent-session';
|
|
15
15
|
export * from './webhook-types';
|
|
16
|
+
export { defaultGeneratePrompt, defaultBuildParentQAContext, defaultBuildParentAcceptanceContext, defaultDetectWorkTypeFromPrompt, defaultGetPriority, defaultParseAutoTriggerConfig, type DefaultAutoTriggerConfig, } from './defaults/index';
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACpB,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,YAAY,EACZ,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,8BAA8B,EAC9B,wBAAwB,EACxB,aAAa,EAEb,iBAAiB,EACjB,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,oBAAoB,EAEpB,iBAAiB,EACjB,aAAa,EACb,cAAc,GACf,MAAM,SAAS,CAAA;AAGhB,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,EACvB,iBAAiB,EACjB,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,SAAS,CAAA;AAEhB,YAAY,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAGvD,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,2BAA2B,EAC3B,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,UAAU,CAAA;AAGjB,OAAO,EACL,oBAAoB,EACpB,KAAK,EACL,cAAc,EACd,SAAS,EACT,kBAAkB,GACnB,MAAM,SAAS,CAAA;AAChB,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAG5E,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,aAAa,EACb,uBAAuB,GACxB,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAGvD,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,SAAS,CAAA;AAChB,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAG3C,OAAO,EACL,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,kBAAkB,GACnB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGpE,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAG3E,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAGlE,cAAc,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACpB,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,YAAY,EACZ,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,8BAA8B,EAC9B,wBAAwB,EACxB,aAAa,EAEb,iBAAiB,EACjB,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,oBAAoB,EAEpB,iBAAiB,EACjB,aAAa,EACb,cAAc,GACf,MAAM,SAAS,CAAA;AAGhB,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,EACvB,iBAAiB,EACjB,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,SAAS,CAAA;AAEhB,YAAY,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAGvD,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,2BAA2B,EAC3B,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,UAAU,CAAA;AAGjB,OAAO,EACL,oBAAoB,EACpB,KAAK,EACL,cAAc,EACd,SAAS,EACT,kBAAkB,GACnB,MAAM,SAAS,CAAA;AAChB,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAG5E,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,aAAa,EACb,uBAAuB,GACxB,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAGvD,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,SAAS,CAAA;AAChB,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAG3C,OAAO,EACL,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,kBAAkB,GACnB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGpE,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAG3E,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAGlE,cAAc,iBAAiB,CAAA;AAG/B,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,mCAAmC,EACnC,+BAA+B,EAC/B,kBAAkB,EAClB,6BAA6B,EAC7B,KAAK,wBAAwB,GAC9B,MAAM,kBAAkB,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -16,3 +16,5 @@ export { LinearAgentClient, createLinearAgentClient } from './agent-client';
|
|
|
16
16
|
export { AgentSession, createAgentSession } from './agent-session';
|
|
17
17
|
// Webhook types
|
|
18
18
|
export * from './webhook-types';
|
|
19
|
+
// Default implementations (prompt templates, work type detection, priority, auto-trigger)
|
|
20
|
+
export { defaultGeneratePrompt, defaultBuildParentQAContext, defaultBuildParentAcceptanceContext, defaultDetectWorkTypeFromPrompt, defaultGetPriority, defaultParseAutoTriggerConfig, } from './defaults/index';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supaku/agentfactory-linear",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Linear issue tracker integration for AgentFactory — status transitions, agent sessions, work routing",
|
|
6
6
|
"author": "Supaku (https://supaku.com)",
|