@compilr-dev/sdk 0.29.4 → 0.29.6
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/actions/index.d.ts +1 -2
- package/dist/actions/index.js +10 -2
- package/dist/actions/resolver.d.ts +0 -4
- package/dist/actions/resolver.js +0 -7
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/platform/project-patch.d.ts +52 -0
- package/dist/platform/project-patch.js +69 -0
- package/package.json +1 -1
- package/dist/actions/registry.d.ts +0 -17
- package/dist/actions/registry.js +0 -161
package/dist/actions/index.d.ts
CHANGED
|
@@ -25,5 +25,4 @@
|
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
27
|
export type { ActionContext, ActionDefinition } from './types.js';
|
|
28
|
-
export {
|
|
29
|
-
export { resolveActionPrompt, buildContextSummary, getSuggestedRole } from './resolver.js';
|
|
28
|
+
export { resolveActionPrompt, buildContextSummary } from './resolver.js';
|
package/dist/actions/index.js
CHANGED
|
@@ -25,6 +25,14 @@
|
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
27
|
// Registry
|
|
28
|
-
|
|
28
|
+
/*
|
|
29
|
+
⚠️ ACTION_REGISTRY IS GONE — superseded, not merely unused. `MACRO_META_REGISTRY` replaced it
|
|
30
|
+
during the macro rename and is a strict superset (55 entries against 14, every id present). The
|
|
31
|
+
old one kept an IPC handler and a preload binding alive that nothing called, which made it look
|
|
32
|
+
like the action source and cost a wrong assumption in the Projects plan.
|
|
33
|
+
|
|
34
|
+
`resolveActionPrompt` never read it: it resolves by skill NAME from the array it is given, so
|
|
35
|
+
the live path was never coupled to the dead one.
|
|
36
|
+
*/
|
|
29
37
|
// Resolver
|
|
30
|
-
export { resolveActionPrompt, buildContextSummary
|
|
38
|
+
export { resolveActionPrompt, buildContextSummary } from './resolver.js';
|
|
@@ -23,7 +23,3 @@ export declare function resolveActionPrompt(actionId: string, context: ActionCon
|
|
|
23
23
|
* Used by the ActionCard component to show a brief description.
|
|
24
24
|
*/
|
|
25
25
|
export declare function buildContextSummary(context: ActionContext): string;
|
|
26
|
-
/**
|
|
27
|
-
* Get the suggested agent role for an action.
|
|
28
|
-
*/
|
|
29
|
-
export declare function getSuggestedRole(actionId: string): string | undefined;
|
package/dist/actions/resolver.js
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Used by both CLI and desktop to turn user actions into agent prompts.
|
|
9
9
|
*/
|
|
10
|
-
import { getActionById } from './registry.js';
|
|
11
10
|
/**
|
|
12
11
|
* Resolve an action + context into a final prompt for the agent.
|
|
13
12
|
*
|
|
@@ -99,9 +98,3 @@ export function buildContextSummary(context) {
|
|
|
99
98
|
}
|
|
100
99
|
return '';
|
|
101
100
|
}
|
|
102
|
-
/**
|
|
103
|
-
* Get the suggested agent role for an action.
|
|
104
|
-
*/
|
|
105
|
-
export function getSuggestedRole(actionId) {
|
|
106
|
-
return getActionById(actionId)?.suggestedRole;
|
|
107
|
-
}
|
package/dist/index.d.ts
CHANGED
|
@@ -87,7 +87,7 @@ export type { MacroListEntry, BuildMacroListOptions } from './skills/index.js';
|
|
|
87
87
|
export { generateSkillCatalog, toCatalogEntry, createLoadSkillTool } from './skills/index.js';
|
|
88
88
|
export type { SkillCatalogEntry, SkillSource } from './skills/index.js';
|
|
89
89
|
export { platformMacros, designMacro, sketchMacro, prdMacro, refineMacro, refineItemMacro, architectureMacro, sessionNotesMacro, buildMacro, scaffoldMacro, outlineMacro, literatureReviewMacro, draftSectionMacro, peerReviewMacro, researchScaffoldMacro, businessVisionMacro, marketAnalysisMacro, competitorAnalysisMacro, financialModelMacro, pitchOutlineMacro, businessReviewMacro, brandSetupMacro, contentStrategyMacro, contentCalendarMacro, createContentMacro, contentReviewMacro, curriculumDesignMacro, lessonPlanMacro, assessmentDesignMacro, courseReviewMacro, bookOutlineMacro, characterDesignMacro, plotThreadsMacro, sceneBreakdownMacro, bookReviewMacro, } from './skills/index.js';
|
|
90
|
-
export {
|
|
90
|
+
export { resolveActionPrompt, buildContextSummary } from './actions/index.js';
|
|
91
91
|
export type { ActionContext, ActionDefinition } from './actions/index.js';
|
|
92
92
|
export { PROJECT_TYPES, getProjectTypeConfig, getEnrichedProjectTypeConfig, getProjectTypesByCategory, generalConfig, softwareConfig, researchConfig, businessPlanConfig, contentConfig, techDocsConfig, courseConfig, MACRO_META_REGISTRY, resolveActionMeta, getRelevantMacros, getMacroMeta, getAllMacroMeta, } from './project-types/index.js';
|
|
93
93
|
export type { ActionMeta, MacroMeta, MacroCategory, MacroCapabilities, } from './project-types/index.js';
|
|
@@ -110,6 +110,8 @@ export type { FileEpisodeStoreOptions, EpisodeRecorderConfig, WorkSummaryAnchorC
|
|
|
110
110
|
export { resolveNext, evaluateBranchCondition, walkPastBranches, lookupLabel, applyBacktrack, } from './flow-runner/index.js';
|
|
111
111
|
export type { BacktrackResult } from './flow-runner/index.js';
|
|
112
112
|
export { readMCPConfigFile, writeMCPConfigFile, resolveServerEntry, loadMCPServers, saveMCPServerEntry, deleteMCPServerEntry, getServerNames, readMCPConfig, assertWritable, canConnect, } from './mcp-config.js';
|
|
113
|
+
export { buildProjectUpdate } from './platform/project-patch.js';
|
|
114
|
+
export type { ProjectPatch, ProjectUpdateResult } from './platform/project-patch.js';
|
|
113
115
|
export type { MCPServerEntry, MCPConfigFile, ResolvedMCPServer, MCPConfigRead, ConfigValue, } from './mcp-config.js';
|
|
114
116
|
export { serverHealth, needsAttention, describeHealth, estimateToolTokens, estimateServerCost, formatTokens, disabledTools, isToolEnabled, setToolEnabled, filterMcpToolsByEnablement, isSecretRef, secretRefFor, parseSecretRef, looksLikeSecret, resolveValues, describeMissing, planSecretStorage, toStoredValues, secretRefsOf, } from './mcp/index.js';
|
|
115
117
|
export type { MCPServerHealth, MCPServerState, MCPConnectionStatus, HealthInput, MCPToolShape, ServerCost, SecretRef, ResolveResult, } from './mcp/index.js';
|
package/dist/index.js
CHANGED
|
@@ -166,7 +166,7 @@ export { platformMacros, designMacro, sketchMacro, prdMacro, refineMacro, refine
|
|
|
166
166
|
// =============================================================================
|
|
167
167
|
// Contextual Actions (skill invocations with context)
|
|
168
168
|
// =============================================================================
|
|
169
|
-
export {
|
|
169
|
+
export { resolveActionPrompt, buildContextSummary } from './actions/index.js';
|
|
170
170
|
// =============================================================================
|
|
171
171
|
// Project Types
|
|
172
172
|
// =============================================================================
|
|
@@ -233,6 +233,8 @@ export { resolveNext, evaluateBranchCondition, walkPastBranches, lookupLabel, ap
|
|
|
233
233
|
// Shared MCP Configuration
|
|
234
234
|
// =============================================================================
|
|
235
235
|
export { readMCPConfigFile, writeMCPConfigFile, resolveServerEntry, loadMCPServers, saveMCPServerEntry, deleteMCPServerEntry, getServerNames, readMCPConfig, assertWritable, canConnect, } from './mcp-config.js';
|
|
236
|
+
// Projects — the one allow-list both hosts write through (projects-restyling Phase 5)
|
|
237
|
+
export { buildProjectUpdate } from './platform/project-patch.js';
|
|
236
238
|
// MCP — health, per-tool enablement, secrets, cost (mcp-restyling Phase 1)
|
|
237
239
|
export { serverHealth, needsAttention, describeHealth, estimateToolTokens, estimateServerCost, formatTokens, disabledTools, isToolEnabled, setToolEnabled, filterMcpToolsByEnablement, isSecretRef, secretRefFor, parseSecretRef, looksLikeSecret, resolveValues, describeMissing, planSecretStorage, toStoredValues, secretRefsOf, } from './mcp/index.js';
|
|
238
240
|
// =============================================================================
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a person may change about a project, and how it maps to the repository.
|
|
3
|
+
*
|
|
4
|
+
* ⚠️ ONE ALLOW-LIST, IN THE SDK, BECAUSE BOTH HOSTS WRITE PROJECTS. Desktop and the CLI each had
|
|
5
|
+
* their own hand-written snake_case mapping, and they had already drifted: the CLI turned an empty
|
|
6
|
+
* string into `undefined`, so a git remote could be set there but never CLEARED, while Desktop
|
|
7
|
+
* treated `''` as a deliberate clear. Same screen, same field, two different meanings for erasing
|
|
8
|
+
* it.
|
|
9
|
+
*
|
|
10
|
+
* ⚠️ AN ALLOW-LIST, NOT A SPREAD. `UpdateProjectInput` reaches machine state — `current_item_id`,
|
|
11
|
+
* `last_context`, `metadata` — and the SLUG via `name`. `projects.name` is UNIQUE NOT NULL and a
|
|
12
|
+
* real key, so an editor that could set it by sending one extra field could collide it or break
|
|
13
|
+
* every reference to it. The slug is derived at creation and frozen.
|
|
14
|
+
*/
|
|
15
|
+
import type { UpdateProjectInput } from './types.js';
|
|
16
|
+
/** The camelCase fields an editor may write. Deliberately narrower than UpdateProjectInput. */
|
|
17
|
+
export interface ProjectPatch {
|
|
18
|
+
displayName?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Where the project lives.
|
|
22
|
+
*
|
|
23
|
+
* ⚠️ RE-POINTS THE PROJECT; IT DOES NOT MOVE ANYTHING. This is how a project whose folder was
|
|
24
|
+
* moved on disk is repaired — a host offering it should say so, because "Path" reads like a
|
|
25
|
+
* thing that relocates files.
|
|
26
|
+
*/
|
|
27
|
+
path?: string;
|
|
28
|
+
docsPath?: string;
|
|
29
|
+
language?: string;
|
|
30
|
+
framework?: string;
|
|
31
|
+
packageManager?: string;
|
|
32
|
+
runtimeVersion?: string;
|
|
33
|
+
gitRemote?: string;
|
|
34
|
+
gitBranch?: string;
|
|
35
|
+
workflowMode?: string;
|
|
36
|
+
status?: string;
|
|
37
|
+
}
|
|
38
|
+
export type ProjectUpdateResult = {
|
|
39
|
+
ok: true;
|
|
40
|
+
input: UpdateProjectInput;
|
|
41
|
+
} | {
|
|
42
|
+
ok: false;
|
|
43
|
+
error: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Map a patch onto the repository's input, or refuse it.
|
|
47
|
+
*
|
|
48
|
+
* ⚠️ AN EMPTY STRING IS A DELIBERATE CLEAR, NOT "LEAVE ALONE". Only `undefined` means untouched.
|
|
49
|
+
* Clearing a git remote has to be possible, and a host that cannot do it has no way to undo a
|
|
50
|
+
* typo in one.
|
|
51
|
+
*/
|
|
52
|
+
export declare function buildProjectUpdate(patch: ProjectPatch): ProjectUpdateResult;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a person may change about a project, and how it maps to the repository.
|
|
3
|
+
*
|
|
4
|
+
* ⚠️ ONE ALLOW-LIST, IN THE SDK, BECAUSE BOTH HOSTS WRITE PROJECTS. Desktop and the CLI each had
|
|
5
|
+
* their own hand-written snake_case mapping, and they had already drifted: the CLI turned an empty
|
|
6
|
+
* string into `undefined`, so a git remote could be set there but never CLEARED, while Desktop
|
|
7
|
+
* treated `''` as a deliberate clear. Same screen, same field, two different meanings for erasing
|
|
8
|
+
* it.
|
|
9
|
+
*
|
|
10
|
+
* ⚠️ AN ALLOW-LIST, NOT A SPREAD. `UpdateProjectInput` reaches machine state — `current_item_id`,
|
|
11
|
+
* `last_context`, `metadata` — and the SLUG via `name`. `projects.name` is UNIQUE NOT NULL and a
|
|
12
|
+
* real key, so an editor that could set it by sending one extra field could collide it or break
|
|
13
|
+
* every reference to it. The slug is derived at creation and frozen.
|
|
14
|
+
*/
|
|
15
|
+
/*
|
|
16
|
+
⚠️ `path` IS NOT IN HERE. `UpdateProjectInput` has no `path` key — it is written through the
|
|
17
|
+
repository's own column — so listing it beside the others would have needed a lie in the type.
|
|
18
|
+
It is handled explicitly in the loop, where the difference is visible.
|
|
19
|
+
*/
|
|
20
|
+
const FIELD_MAP = {
|
|
21
|
+
displayName: 'display_name',
|
|
22
|
+
description: 'description',
|
|
23
|
+
docsPath: 'docs_path',
|
|
24
|
+
language: 'language',
|
|
25
|
+
framework: 'framework',
|
|
26
|
+
packageManager: 'package_manager',
|
|
27
|
+
runtimeVersion: 'runtime_version',
|
|
28
|
+
gitRemote: 'git_remote',
|
|
29
|
+
gitBranch: 'git_branch',
|
|
30
|
+
workflowMode: 'workflow_mode',
|
|
31
|
+
status: 'status',
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Map a patch onto the repository's input, or refuse it.
|
|
35
|
+
*
|
|
36
|
+
* ⚠️ AN EMPTY STRING IS A DELIBERATE CLEAR, NOT "LEAVE ALONE". Only `undefined` means untouched.
|
|
37
|
+
* Clearing a git remote has to be possible, and a host that cannot do it has no way to undo a
|
|
38
|
+
* typo in one.
|
|
39
|
+
*/
|
|
40
|
+
export function buildProjectUpdate(patch) {
|
|
41
|
+
const displayName = patch.displayName?.trim();
|
|
42
|
+
if (displayName !== undefined && displayName === '') {
|
|
43
|
+
return { ok: false, error: 'A project needs a name.' };
|
|
44
|
+
}
|
|
45
|
+
const path = patch.path?.trim();
|
|
46
|
+
if (path !== undefined && path === '') {
|
|
47
|
+
return {
|
|
48
|
+
ok: false,
|
|
49
|
+
error: 'A project needs a path — clearing it would lose track of the folder.',
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const input = {};
|
|
53
|
+
if (path !== undefined)
|
|
54
|
+
input.path = path;
|
|
55
|
+
for (const key of Object.keys(FIELD_MAP)) {
|
|
56
|
+
const value = patch[key];
|
|
57
|
+
if (value === undefined)
|
|
58
|
+
continue;
|
|
59
|
+
if (key === 'displayName')
|
|
60
|
+
input.display_name = displayName;
|
|
61
|
+
else if (key === 'workflowMode')
|
|
62
|
+
input.workflow_mode = value;
|
|
63
|
+
else if (key === 'status')
|
|
64
|
+
input.status = value;
|
|
65
|
+
else
|
|
66
|
+
input[FIELD_MAP[key]] = value;
|
|
67
|
+
}
|
|
68
|
+
return { ok: true, input };
|
|
69
|
+
}
|
package/package.json
CHANGED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Action Registry — Defines which actions are available and where.
|
|
3
|
-
*
|
|
4
|
-
* Each action maps to a skill (from platformMacros/builtinSkills)
|
|
5
|
-
* but adds UI metadata: icon, label, category, applicable contexts,
|
|
6
|
-
* and suggested agent role.
|
|
7
|
-
*/
|
|
8
|
-
import type { ActionDefinition } from './types.js';
|
|
9
|
-
export declare const ACTION_REGISTRY: ActionDefinition[];
|
|
10
|
-
/**
|
|
11
|
-
* Get actions applicable to a given context type.
|
|
12
|
-
*/
|
|
13
|
-
export declare function getActionsForContext(contextType: 'project' | 'workitem' | 'document'): ActionDefinition[];
|
|
14
|
-
/**
|
|
15
|
-
* Get an action definition by ID.
|
|
16
|
-
*/
|
|
17
|
-
export declare function getActionById(id: string): ActionDefinition | undefined;
|
package/dist/actions/registry.js
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Action Registry — Defines which actions are available and where.
|
|
3
|
-
*
|
|
4
|
-
* Each action maps to a skill (from platformMacros/builtinSkills)
|
|
5
|
-
* but adds UI metadata: icon, label, category, applicable contexts,
|
|
6
|
-
* and suggested agent role.
|
|
7
|
-
*/
|
|
8
|
-
export const ACTION_REGISTRY = [
|
|
9
|
-
// ─── Project-level actions ─────────────────────────────────────────────
|
|
10
|
-
{
|
|
11
|
-
id: 'design',
|
|
12
|
-
label: 'Design App',
|
|
13
|
-
description: 'Describe an idea, get a full application design',
|
|
14
|
-
icon: 'Wand2',
|
|
15
|
-
applicableTo: ['project'],
|
|
16
|
-
category: 'design',
|
|
17
|
-
// BA owns requirements: the 'ba' role (analyst profile) has both
|
|
18
|
-
// backlog_write and documents, so it can complete the full /design action
|
|
19
|
-
// (create work items + write the PRD). The architect profile lacks
|
|
20
|
-
// backlog_write and cannot create the backlog.
|
|
21
|
-
suggestedRole: 'ba',
|
|
22
|
-
needsInput: true,
|
|
23
|
-
inputPrompt: 'What would you like to design?',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
id: 'sketch',
|
|
27
|
-
label: 'Quick Sketch',
|
|
28
|
-
description: 'Quickly sketch out an idea or concept',
|
|
29
|
-
icon: 'Pencil',
|
|
30
|
-
applicableTo: ['project'],
|
|
31
|
-
category: 'design',
|
|
32
|
-
needsInput: true,
|
|
33
|
-
inputPrompt: 'What would you like to sketch?',
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
id: 'prd',
|
|
37
|
-
label: 'Write PRD',
|
|
38
|
-
description: 'Create a product requirements document',
|
|
39
|
-
icon: 'FileText',
|
|
40
|
-
applicableTo: ['project'],
|
|
41
|
-
// PRD is artifact-authoring (requirements), grouped with design/architecture
|
|
42
|
-
// rather than backlog-breakdown 'planning' (refine/refine-item).
|
|
43
|
-
category: 'design',
|
|
44
|
-
// Requirements work → Business Analyst, not PM. The 'ba' role (analyst
|
|
45
|
-
// profile) is purpose-built for requirements gathering and has the
|
|
46
|
-
// documents tools needed to author the PRD.
|
|
47
|
-
suggestedRole: 'ba',
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
id: 'architecture',
|
|
51
|
-
label: 'Architecture',
|
|
52
|
-
description: 'Design the system architecture',
|
|
53
|
-
icon: 'Network',
|
|
54
|
-
applicableTo: ['project'],
|
|
55
|
-
category: 'design',
|
|
56
|
-
suggestedRole: 'architect',
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
id: 'scaffold',
|
|
60
|
-
label: 'Scaffold',
|
|
61
|
-
description: 'Generate project code from the app model',
|
|
62
|
-
icon: 'Layers',
|
|
63
|
-
applicableTo: ['project'],
|
|
64
|
-
category: 'development',
|
|
65
|
-
suggestedRole: 'developer',
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
id: 'session-notes',
|
|
69
|
-
label: 'Session Notes',
|
|
70
|
-
description: 'Summarize what was accomplished in this session',
|
|
71
|
-
icon: 'StickyNote',
|
|
72
|
-
applicableTo: ['project'],
|
|
73
|
-
category: 'documentation',
|
|
74
|
-
},
|
|
75
|
-
// ─── Work item actions ─────────────────────────────────────────────────
|
|
76
|
-
{
|
|
77
|
-
id: 'refine',
|
|
78
|
-
label: 'Refine',
|
|
79
|
-
description: 'Break down into smaller tasks',
|
|
80
|
-
icon: 'RefreshCw',
|
|
81
|
-
applicableTo: ['project', 'workitem'],
|
|
82
|
-
category: 'planning',
|
|
83
|
-
suggestedRole: 'pm',
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
id: 'refine-item',
|
|
87
|
-
label: 'Refine Item',
|
|
88
|
-
description: 'Add detail and acceptance criteria to this item',
|
|
89
|
-
icon: 'RefreshCw',
|
|
90
|
-
applicableTo: ['workitem'],
|
|
91
|
-
category: 'planning',
|
|
92
|
-
suggestedRole: 'pm',
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
id: 'build',
|
|
96
|
-
label: 'Build',
|
|
97
|
-
description: 'Implement this work item',
|
|
98
|
-
icon: 'Hammer',
|
|
99
|
-
applicableTo: ['workitem'],
|
|
100
|
-
category: 'development',
|
|
101
|
-
suggestedRole: 'developer',
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
id: 'code-review',
|
|
105
|
-
label: 'Code Review',
|
|
106
|
-
description: 'Review code for quality and correctness',
|
|
107
|
-
icon: 'Search',
|
|
108
|
-
applicableTo: ['project', 'workitem'],
|
|
109
|
-
category: 'development',
|
|
110
|
-
suggestedRole: 'qa',
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
id: 'debug',
|
|
114
|
-
label: 'Debug',
|
|
115
|
-
description: 'Debug an issue or error',
|
|
116
|
-
icon: 'Bug',
|
|
117
|
-
applicableTo: ['project', 'workitem'],
|
|
118
|
-
category: 'development',
|
|
119
|
-
suggestedRole: 'developer',
|
|
120
|
-
},
|
|
121
|
-
// ─── Document actions ──────────────────────────────────────────────────
|
|
122
|
-
{
|
|
123
|
-
id: 'explain',
|
|
124
|
-
label: 'Explain',
|
|
125
|
-
description: 'Explain this code or document',
|
|
126
|
-
icon: 'BookOpen',
|
|
127
|
-
applicableTo: ['document', 'workitem'],
|
|
128
|
-
category: 'documentation',
|
|
129
|
-
},
|
|
130
|
-
// ─── Analysis actions ──────────────────────────────────────────────────
|
|
131
|
-
{
|
|
132
|
-
id: 'security-review',
|
|
133
|
-
label: 'Security Review',
|
|
134
|
-
description: 'Review for security vulnerabilities',
|
|
135
|
-
icon: 'Shield',
|
|
136
|
-
applicableTo: ['project'],
|
|
137
|
-
category: 'analysis',
|
|
138
|
-
suggestedRole: 'security',
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
id: 'refactor',
|
|
142
|
-
label: 'Refactor',
|
|
143
|
-
description: 'Improve code quality without changing behavior',
|
|
144
|
-
icon: 'Scissors',
|
|
145
|
-
applicableTo: ['project', 'workitem'],
|
|
146
|
-
category: 'development',
|
|
147
|
-
suggestedRole: 'developer',
|
|
148
|
-
},
|
|
149
|
-
];
|
|
150
|
-
/**
|
|
151
|
-
* Get actions applicable to a given context type.
|
|
152
|
-
*/
|
|
153
|
-
export function getActionsForContext(contextType) {
|
|
154
|
-
return ACTION_REGISTRY.filter((a) => a.applicableTo.includes(contextType));
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Get an action definition by ID.
|
|
158
|
-
*/
|
|
159
|
-
export function getActionById(id) {
|
|
160
|
-
return ACTION_REGISTRY.find((a) => a.id === id);
|
|
161
|
-
}
|