@idea1/cli 1.9.1 → 1.10.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/README.md +117 -60
- package/dist/cli/named-lists.d.ts +1 -1
- package/dist/cli/named-lists.d.ts.map +1 -1
- package/dist/cli/named-lists.js +18 -2
- package/dist/cli/named-lists.js.map +1 -1
- package/dist/cli/parser.d.ts +3 -2
- package/dist/cli/parser.d.ts.map +1 -1
- package/dist/cli/parser.js +4 -3
- package/dist/cli/parser.js.map +1 -1
- package/dist/cli/resolver.d.ts +3 -0
- package/dist/cli/resolver.d.ts.map +1 -1
- package/dist/cli/resolver.js +41 -36
- package/dist/cli/resolver.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +15 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/approve-pr.d.ts.map +1 -1
- package/dist/commands/approve-pr.js +1 -0
- package/dist/commands/approve-pr.js.map +1 -1
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +11 -6
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/index.d.ts +2 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +5 -1
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/join-project-item.d.ts.map +1 -1
- package/dist/commands/join-project-item.js +31 -12
- package/dist/commands/join-project-item.js.map +1 -1
- package/dist/commands/next-workflow-step.d.ts.map +1 -1
- package/dist/commands/next-workflow-step.js +1 -0
- package/dist/commands/next-workflow-step.js.map +1 -1
- package/dist/commands/ready-for-approval.d.ts.map +1 -1
- package/dist/commands/ready-for-approval.js +24 -6
- package/dist/commands/ready-for-approval.js.map +1 -1
- package/dist/commands/release.d.ts.map +1 -1
- package/dist/commands/release.js +2 -1
- package/dist/commands/release.js.map +1 -1
- package/dist/commands/start-agent-implementation.d.ts.map +1 -1
- package/dist/commands/start-agent-implementation.js +4 -1
- package/dist/commands/start-agent-implementation.js.map +1 -1
- package/dist/commands/start-dev-implementation.d.ts.map +1 -1
- package/dist/commands/start-dev-implementation.js +1 -0
- package/dist/commands/start-dev-implementation.js.map +1 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +6 -3
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/url-handler.d.ts +5 -0
- package/dist/commands/url-handler.d.ts.map +1 -0
- package/dist/commands/url-handler.js +38 -0
- package/dist/commands/url-handler.js.map +1 -0
- package/dist/jobs/targets.d.ts +6 -1
- package/dist/jobs/targets.d.ts.map +1 -1
- package/dist/jobs/targets.js +12 -8
- package/dist/jobs/targets.js.map +1 -1
- package/dist/lib/claude-options.d.ts +47 -34
- package/dist/lib/claude-options.d.ts.map +1 -1
- package/dist/lib/claude-options.js +95 -82
- package/dist/lib/claude-options.js.map +1 -1
- package/dist/lib/claude-sessions.generated.d.ts +25 -0
- package/dist/lib/claude-sessions.generated.d.ts.map +1 -0
- package/dist/lib/claude-sessions.generated.js +16 -0
- package/dist/lib/claude-sessions.generated.js.map +1 -0
- package/dist/lib/settings.d.ts +10 -4
- package/dist/lib/settings.d.ts.map +1 -1
- package/dist/lib/settings.js +45 -15
- package/dist/lib/settings.js.map +1 -1
- package/dist/prompts/platform-prompts.d.ts +2 -0
- package/dist/prompts/platform-prompts.d.ts.map +1 -1
- package/dist/prompts/platform-prompts.js +9 -4
- package/dist/prompts/platform-prompts.js.map +1 -1
- package/dist/prompts/project-item-prompts.d.ts +3 -12
- package/dist/prompts/project-item-prompts.d.ts.map +1 -1
- package/dist/prompts/project-item-prompts.js +3 -18
- package/dist/prompts/project-item-prompts.js.map +1 -1
- package/dist/services/claude.d.ts +12 -7
- package/dist/services/claude.d.ts.map +1 -1
- package/dist/services/claude.js +7 -4
- package/dist/services/claude.js.map +1 -1
- package/dist/services/config.d.ts +5 -0
- package/dist/services/config.d.ts.map +1 -1
- package/dist/services/config.js +9 -0
- package/dist/services/config.js.map +1 -1
- package/dist/services/git.d.ts +5 -0
- package/dist/services/git.d.ts.map +1 -1
- package/dist/services/git.js +15 -3
- package/dist/services/git.js.map +1 -1
- package/dist/services/os-launcher.d.ts +29 -0
- package/dist/services/os-launcher.d.ts.map +1 -0
- package/dist/services/os-launcher.js +104 -0
- package/dist/services/os-launcher.js.map +1 -0
- package/dist/services/platform.d.ts +17 -3
- package/dist/services/platform.d.ts.map +1 -1
- package/dist/services/platform.js +79 -7
- package/dist/services/platform.js.map +1 -1
- package/dist/services/repository-registry.d.ts +11 -0
- package/dist/services/repository-registry.d.ts.map +1 -0
- package/dist/services/repository-registry.js +43 -0
- package/dist/services/repository-registry.js.map +1 -0
- package/dist/services/setup.d.ts.map +1 -1
- package/dist/services/setup.js +21 -1
- package/dist/services/setup.js.map +1 -1
- package/dist/services/url-handler.d.ts +23 -0
- package/dist/services/url-handler.d.ts.map +1 -0
- package/dist/services/url-handler.js +236 -0
- package/dist/services/url-handler.js.map +1 -0
- package/dist/services/worktree.d.ts +1 -19
- package/dist/services/worktree.d.ts.map +1 -1
- package/dist/services/worktree.js +0 -34
- package/dist/services/worktree.js.map +1 -1
- package/dist/types/index.d.ts +27 -25
- package/dist/types/index.d.ts.map +1 -1
- package/dist/workflow/data/project-item.d.ts +4 -0
- package/dist/workflow/data/project-item.d.ts.map +1 -1
- package/dist/workflow/data/team-member.d.ts +14 -0
- package/dist/workflow/data/team-member.d.ts.map +1 -0
- package/dist/workflow/data/team-member.js +2 -0
- package/dist/workflow/data/team-member.js.map +1 -0
- package/dist/workflow/data/workflow-context.d.ts +1 -1
- package/dist/workflow/data/workflow-states.d.ts +11 -2
- package/dist/workflow/data/workflow-states.d.ts.map +1 -1
- package/dist/workflow/data/workflow-states.generated.d.ts +17 -0
- package/dist/workflow/data/workflow-states.generated.d.ts.map +1 -1
- package/dist/workflow/data/workflow-states.generated.js +41 -0
- package/dist/workflow/data/workflow-states.generated.js.map +1 -1
- package/dist/workflow/data/workflow-states.js +21 -1
- package/dist/workflow/data/workflow-states.js.map +1 -1
- package/dist/workflow/engine/agent-session.d.ts +16 -0
- package/dist/workflow/engine/agent-session.d.ts.map +1 -0
- package/dist/workflow/engine/agent-session.js +109 -0
- package/dist/workflow/engine/agent-session.js.map +1 -0
- package/dist/workflow/engine/approval-flow.d.ts +21 -5
- package/dist/workflow/engine/approval-flow.d.ts.map +1 -1
- package/dist/workflow/engine/approval-flow.js +34 -0
- package/dist/workflow/engine/approval-flow.js.map +1 -1
- package/dist/workflow/engine/handlers/agent-implementation.d.ts +5 -4
- package/dist/workflow/engine/handlers/agent-implementation.d.ts.map +1 -1
- package/dist/workflow/engine/handlers/agent-implementation.js +13 -19
- package/dist/workflow/engine/handlers/agent-implementation.js.map +1 -1
- package/dist/workflow/engine/handlers/dev-implementation.js +1 -1
- package/dist/workflow/engine/handlers/dev-implementation.js.map +1 -1
- package/dist/workflow/engine/handlers/ready-for-approval.d.ts +7 -6
- package/dist/workflow/engine/handlers/ready-for-approval.d.ts.map +1 -1
- package/dist/workflow/engine/handlers/ready-for-approval.js +17 -19
- package/dist/workflow/engine/handlers/ready-for-approval.js.map +1 -1
- package/dist/workflow/engine/release-engine.js +1 -1
- package/dist/workflow/engine/release-engine.js.map +1 -1
- package/dist/workflow/engine/ship-flow.d.ts +5 -4
- package/dist/workflow/engine/ship-flow.d.ts.map +1 -1
- package/dist/workflow/engine/ship-flow.js +11 -9
- package/dist/workflow/engine/ship-flow.js.map +1 -1
- package/dist/workflow/engine/workflow-engine.d.ts +52 -16
- package/dist/workflow/engine/workflow-engine.d.ts.map +1 -1
- package/dist/workflow/engine/workflow-engine.js +146 -31
- package/dist/workflow/engine/workflow-engine.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,128 +1,141 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export const
|
|
4
|
-
|
|
5
|
-
export const
|
|
6
|
-
export const
|
|
7
|
-
export const DEFAULT_MODEL = 'opus';
|
|
8
|
-
export const DEFAULT_EFFORT = 'high';
|
|
9
|
-
// Labels match the /model picker in Claude Code; values are the aliases claude --model accepts.
|
|
10
|
-
export const MODEL_CHOICES = [
|
|
11
|
-
{ label: 'Fable 5', value: 'fable' },
|
|
12
|
-
{ label: 'Opus 5', value: 'opus' },
|
|
13
|
-
{ label: 'Sonnet 5', value: 'sonnet' },
|
|
14
|
-
{ label: 'Haiku 4.5', value: 'haiku' }
|
|
15
|
-
];
|
|
16
|
-
const USE_DEFAULT_PROMPT_CHOICES = [
|
|
17
|
-
{ label: 'Yes', value: 'yes' },
|
|
18
|
-
{ label: 'No — type the prompt to give Claude', value: 'no' }
|
|
19
|
-
];
|
|
1
|
+
import { CLAUDE_EFFORT_LEVELS, CLAUDE_MODEL_CHOICES, CLAUDE_PERMISSION_MODES, DEFAULT_CLAUDE_EFFORT, DEFAULT_CLAUDE_MODEL, DEFAULT_CLAUDE_PERMISSION_MODE } from './claude-sessions.generated.js';
|
|
2
|
+
/** The name of the option that says how Claude is invoked once the working environment is ready. */
|
|
3
|
+
export const CLAUDE_ENTRY_POINT_OPTION_NAME = 'claude-entry-point';
|
|
4
|
+
/** The `--entry-point` value that starts the session with no prompt. */
|
|
5
|
+
export const NO_ENTRY_POINT = 'none';
|
|
6
|
+
export const VALID_ENTRY_POINT_MODES = ['launch', 'desktop', 'inline', 'none'];
|
|
20
7
|
const ENTRY_POINT_MODE_CHOICES = [
|
|
21
|
-
{ label: 'Launch new Claude session', value: 'launch' },
|
|
8
|
+
{ label: 'Launch new Claude session in this terminal', value: 'launch' },
|
|
9
|
+
{ label: 'Start the session in Claude Desktop', value: 'desktop' },
|
|
22
10
|
{ label: 'Output prompt for current Claude session', value: 'inline' },
|
|
23
11
|
{ label: 'Do not invoke Claude', value: 'none' }
|
|
24
12
|
];
|
|
13
|
+
const MODEL_VALUES = CLAUDE_MODEL_CHOICES.map(choice => choice.value);
|
|
25
14
|
/**
|
|
26
15
|
* Whether the resolved options invoke Claude at all; with 'none' there is no session to configure.
|
|
27
16
|
* Reads `claude-entry-point`, so it must be declared before the options that depend on it.
|
|
28
17
|
*/
|
|
29
18
|
function invokesClaude(resolved) {
|
|
30
|
-
return resolved[
|
|
19
|
+
return resolved[CLAUDE_ENTRY_POINT_OPTION_NAME] !== 'none';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Whether the session starts in Claude Desktop, which has no per-session model or effort: those are
|
|
23
|
+
* not asked, and are left to Desktop unless given on the command line.
|
|
24
|
+
*/
|
|
25
|
+
function startsInDesktop(resolved) {
|
|
26
|
+
return resolved[CLAUDE_ENTRY_POINT_OPTION_NAME] === 'desktop';
|
|
31
27
|
}
|
|
32
28
|
function oneOf(valid) {
|
|
33
29
|
return (value) => (valid.includes(value) ? undefined : `Must be one of: ${valid.join(', ')}`);
|
|
34
30
|
}
|
|
31
|
+
/** One of `valid`, or empty for Claude Desktop's own default. */
|
|
32
|
+
function oneOfOrDesktopDefault(valid) {
|
|
33
|
+
return (value) => (value === '' ? undefined : oneOf(valid)(value));
|
|
34
|
+
}
|
|
35
35
|
/**
|
|
36
|
-
* The options that configure a Claude
|
|
37
|
-
*
|
|
38
|
-
*
|
|
36
|
+
* The options that configure a Claude session. Shared by every command that can start one, so they
|
|
37
|
+
* all ask the same questions the same way; the defaults are confirmed interactively. Not asked when
|
|
38
|
+
* Claude is not invoked. A session in Claude Desktop takes no permission mode, and its model and
|
|
39
|
+
* effort are Desktop's own unless given on the command line.
|
|
39
40
|
*/
|
|
40
41
|
export const claudeSessionOptions = [
|
|
41
42
|
{
|
|
42
43
|
longName: 'permission-mode',
|
|
43
44
|
shortName: 'pm',
|
|
44
45
|
description: 'Claude permission mode',
|
|
45
|
-
defaultValue:
|
|
46
|
+
defaultValue: DEFAULT_CLAUDE_PERMISSION_MODE,
|
|
46
47
|
promptWhenDefaultExists: true,
|
|
47
|
-
dependsOn: invokesClaude,
|
|
48
|
-
choices:
|
|
49
|
-
validate: oneOf(
|
|
48
|
+
dependsOn: resolved => invokesClaude(resolved) && !startsInDesktop(resolved),
|
|
49
|
+
choices: CLAUDE_PERMISSION_MODES.map(mode => ({ label: mode, value: mode })),
|
|
50
|
+
validate: oneOf(CLAUDE_PERMISSION_MODES)
|
|
50
51
|
},
|
|
51
52
|
{
|
|
52
53
|
longName: 'model',
|
|
53
54
|
shortName: 'm',
|
|
54
|
-
description: 'Claude model for the
|
|
55
|
-
defaultValue:
|
|
56
|
-
promptWhenDefaultExists:
|
|
55
|
+
description: 'Claude model for the session',
|
|
56
|
+
defaultValue: resolved => startsInDesktop(resolved) ? '' : DEFAULT_CLAUDE_MODEL,
|
|
57
|
+
promptWhenDefaultExists: resolved => !startsInDesktop(resolved),
|
|
57
58
|
dependsOn: invokesClaude,
|
|
58
|
-
choices:
|
|
59
|
-
validate:
|
|
59
|
+
choices: CLAUDE_MODEL_CHOICES.map(choice => ({ label: choice.label, value: choice.value })),
|
|
60
|
+
validate: oneOfOrDesktopDefault(MODEL_VALUES)
|
|
60
61
|
},
|
|
61
62
|
{
|
|
62
63
|
longName: 'effort',
|
|
63
64
|
shortName: 'e',
|
|
64
65
|
description: 'Claude effort level (reasoning depth)',
|
|
65
|
-
defaultValue:
|
|
66
|
-
promptWhenDefaultExists:
|
|
66
|
+
defaultValue: resolved => startsInDesktop(resolved) ? '' : DEFAULT_CLAUDE_EFFORT,
|
|
67
|
+
promptWhenDefaultExists: resolved => !startsInDesktop(resolved),
|
|
67
68
|
dependsOn: invokesClaude,
|
|
68
|
-
choices:
|
|
69
|
-
validate:
|
|
69
|
+
choices: CLAUDE_EFFORT_LEVELS.map(level => ({ label: level, value: level })),
|
|
70
|
+
validate: oneOfOrDesktopDefault(CLAUDE_EFFORT_LEVELS)
|
|
70
71
|
}
|
|
71
72
|
];
|
|
72
73
|
/**
|
|
73
|
-
* How Claude is invoked once the working environment is ready
|
|
74
|
-
* prompt options, which are only asked when Claude is invoked.
|
|
74
|
+
* How Claude is invoked once the working environment is ready, defaulting to `defaultMode` without
|
|
75
|
+
* asking. Declared before the session and prompt options, which are only asked when Claude is invoked.
|
|
75
76
|
*/
|
|
76
|
-
export
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
77
|
+
export function claudeEntryPointOption(defaultMode) {
|
|
78
|
+
return {
|
|
79
|
+
longName: CLAUDE_ENTRY_POINT_OPTION_NAME,
|
|
80
|
+
shortName: 'im',
|
|
81
|
+
description: 'How to invoke Claude after setup',
|
|
82
|
+
defaultValue: defaultMode,
|
|
83
|
+
promptWhenDefaultExists: false,
|
|
84
|
+
choices: ENTRY_POINT_MODE_CHOICES,
|
|
85
|
+
validate: oneOf(VALID_ENTRY_POINT_MODES)
|
|
86
|
+
};
|
|
87
|
+
}
|
|
85
88
|
/**
|
|
86
|
-
* The prompt Claude
|
|
87
|
-
*
|
|
88
|
-
* prompt
|
|
89
|
-
*
|
|
90
|
-
* Either way the prompt is a Handlebars
|
|
91
|
-
* branch context.
|
|
89
|
+
* The prompt a Claude session starts with: one of the entry point prompts of the session's workflow
|
|
90
|
+
* state, by name, or none (`--entry-point`), or a template given for this session alone
|
|
91
|
+
* (`--entry-point-prompt`). The two are alternatives; when neither is supplied the user picks which
|
|
92
|
+
* to answer. `entryPointChoiceList` is the named choice list (see cli/named-lists.ts) of the entry
|
|
93
|
+
* points of the state the command starts its session in. Either way the prompt is a Handlebars
|
|
94
|
+
* template rendered against the item's branch context.
|
|
92
95
|
*/
|
|
93
|
-
export
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
];
|
|
96
|
+
export function claudeEntryPointPromptOptions(entryPointChoiceList) {
|
|
97
|
+
return [
|
|
98
|
+
{
|
|
99
|
+
longName: 'entry-point',
|
|
100
|
+
shortName: 'ep',
|
|
101
|
+
description: 'Entry point prompt to start Claude with (a name, or none)',
|
|
102
|
+
exclusiveGroup: 'entry-point',
|
|
103
|
+
dependsOn: invokesClaude,
|
|
104
|
+
choices: entryPointChoiceList,
|
|
105
|
+
validate: (value) => (value.trim() ? undefined : `An entry point name, or ${NO_ENTRY_POINT}, is required`)
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
longName: 'entry-point-prompt',
|
|
109
|
+
shortName: 'epp',
|
|
110
|
+
description: 'Custom prompt template to start Claude with',
|
|
111
|
+
exclusiveGroup: 'entry-point',
|
|
112
|
+
dependsOn: invokesClaude,
|
|
113
|
+
validate: (value) => (value.trim() ? undefined : 'A prompt is required')
|
|
114
|
+
}
|
|
115
|
+
];
|
|
116
|
+
}
|
|
115
117
|
/**
|
|
116
118
|
* Read the Claude session settings out of resolved command options.
|
|
117
119
|
*/
|
|
118
120
|
export function resolveClaudeSessionOptions(resolved) {
|
|
119
|
-
const
|
|
121
|
+
const claudeEntryPointMode = (resolved[CLAUDE_ENTRY_POINT_OPTION_NAME] ?? 'launch');
|
|
120
122
|
return {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
claudeEntryPointMode,
|
|
124
|
+
entryPoint: claudeEntryPointMode === 'none' ? { kind: 'none' } : resolveEntryPointSelection(resolved),
|
|
125
|
+
permissionMode: (resolved['permission-mode'] ?? DEFAULT_CLAUDE_PERMISSION_MODE),
|
|
126
|
+
model: resolved['model'] ? resolved['model'] : null,
|
|
127
|
+
effort: resolved['effort'] ? resolved['effort'] : null
|
|
126
128
|
};
|
|
127
129
|
}
|
|
130
|
+
function resolveEntryPointSelection(resolved) {
|
|
131
|
+
const template = resolved['entry-point-prompt']?.trim();
|
|
132
|
+
if (template) {
|
|
133
|
+
return { kind: 'template', template };
|
|
134
|
+
}
|
|
135
|
+
const name = resolved['entry-point']?.trim();
|
|
136
|
+
if (!name) {
|
|
137
|
+
throw new Error(`Name the entry point prompt to start Claude with (--entry-point <name|${NO_ENTRY_POINT}>), or give one (--entry-point-prompt <template>).`);
|
|
138
|
+
}
|
|
139
|
+
return name === NO_ENTRY_POINT ? { kind: 'none' } : { kind: 'named', name };
|
|
140
|
+
}
|
|
128
141
|
//# sourceMappingURL=claude-options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-options.js","sourceRoot":"","sources":["../../src/lib/claude-options.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"claude-options.js","sourceRoot":"","sources":["../../src/lib/claude-options.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,8BAA8B,EAI/B,MAAM,gCAAgC,CAAC;AAExC,oGAAoG;AACpG,MAAM,CAAC,MAAM,8BAA8B,GAAG,oBAAoB,CAAC;AAEnE,wEAAwE;AACxE,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC;AAErC,MAAM,CAAC,MAAM,uBAAuB,GAAoC,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAEhH,MAAM,wBAAwB,GAAG;IAC/B,EAAE,KAAK,EAAE,4CAA4C,EAAE,KAAK,EAAE,QAAQ,EAAE;IACxE,EAAE,KAAK,EAAE,qCAAqC,EAAE,KAAK,EAAE,SAAS,EAAE;IAClE,EAAE,KAAK,EAAE,0CAA0C,EAAE,KAAK,EAAE,QAAQ,EAAE;IACtE,EAAE,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,EAAE;CACjD,CAAC;AAEF,MAAM,YAAY,GAAsB,oBAAoB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAEzF;;;GAGG;AACH,SAAS,aAAa,CAAC,QAAgC;IACrD,OAAO,QAAQ,CAAC,8BA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I;KAC5E,CAAC;AACJ,CAAC;AAED,SAAS,0BAA0B,CAAC,QAAgC;IAClE,MAAM,QAAQ,GAAG,QAAQ,CAAC,oBAAoB,CAAC,EAAE,IAAI,EAAE,CAAC;IACxD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;IACxC,CAAC;IAED,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,CAAC;IAC7C,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,yEAAyE,cAAc,oDAAoD,CAAC,CAAC;IAC/J,CAAC;IACD,OAAO,IAAI,KAAK,cAAc,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC9E,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** The models a Claude session can run with; values are the aliases `claude --model` accepts. */
|
|
2
|
+
export declare const CLAUDE_MODEL_CHOICES: readonly [{
|
|
3
|
+
readonly value: "fable";
|
|
4
|
+
readonly label: "Fable 5.1";
|
|
5
|
+
}, {
|
|
6
|
+
readonly value: "opus";
|
|
7
|
+
readonly label: "Opus 5.5";
|
|
8
|
+
}, {
|
|
9
|
+
readonly value: "sonnet";
|
|
10
|
+
readonly label: "Sonnet 5.5";
|
|
11
|
+
}, {
|
|
12
|
+
readonly value: "haiku";
|
|
13
|
+
readonly label: "Haiku 5.5";
|
|
14
|
+
}];
|
|
15
|
+
export type ClaudeModel = (typeof CLAUDE_MODEL_CHOICES)[number]['value'];
|
|
16
|
+
/** The effort levels a Claude session can run with, lowest first. */
|
|
17
|
+
export declare const CLAUDE_EFFORT_LEVELS: readonly ["low", "medium", "high", "xhigh", "max"];
|
|
18
|
+
export type ClaudeEffortLevel = (typeof CLAUDE_EFFORT_LEVELS)[number];
|
|
19
|
+
/** The permission modes a Claude session can start in. */
|
|
20
|
+
export declare const CLAUDE_PERMISSION_MODES: readonly ["acceptEdits", "bypassPermissions", "default", "delegate", "dontAsk", "plan"];
|
|
21
|
+
export type ClaudePermissionMode = (typeof CLAUDE_PERMISSION_MODES)[number];
|
|
22
|
+
export declare const DEFAULT_CLAUDE_MODEL: ClaudeModel;
|
|
23
|
+
export declare const DEFAULT_CLAUDE_EFFORT: ClaudeEffortLevel;
|
|
24
|
+
export declare const DEFAULT_CLAUDE_PERMISSION_MODE: ClaudePermissionMode;
|
|
25
|
+
//# sourceMappingURL=claude-sessions.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-sessions.generated.d.ts","sourceRoot":"","sources":["../../src/lib/claude-sessions.generated.ts"],"names":[],"mappings":"AAEA,iGAAiG;AACjG,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAKvB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;AAEzE,qEAAqE;AACrE,eAAO,MAAM,oBAAoB,oDAAqD,CAAC;AAEvF,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,0DAA0D;AAC1D,eAAO,MAAM,uBAAuB,yFAA0F,CAAC;AAE/H,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E,eAAO,MAAM,oBAAoB,EAAE,WAAoB,CAAC;AACxD,eAAO,MAAM,qBAAqB,EAAE,iBAA0B,CAAC;AAC/D,eAAO,MAAM,8BAA8B,EAAE,oBAA6B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// AUTO-GENERATED — Do not edit. Modify shared-config/claude-sessions.json instead.
|
|
2
|
+
/** The models a Claude session can run with; values are the aliases `claude --model` accepts. */
|
|
3
|
+
export const CLAUDE_MODEL_CHOICES = [
|
|
4
|
+
{ value: "fable", label: "Fable 5.1" },
|
|
5
|
+
{ value: "opus", label: "Opus 5.5" },
|
|
6
|
+
{ value: "sonnet", label: "Sonnet 5.5" },
|
|
7
|
+
{ value: "haiku", label: "Haiku 5.5" },
|
|
8
|
+
];
|
|
9
|
+
/** The effort levels a Claude session can run with, lowest first. */
|
|
10
|
+
export const CLAUDE_EFFORT_LEVELS = ['low', 'medium', 'high', 'xhigh', 'max'];
|
|
11
|
+
/** The permission modes a Claude session can start in. */
|
|
12
|
+
export const CLAUDE_PERMISSION_MODES = ['acceptEdits', 'bypassPermissions', 'default', 'delegate', 'dontAsk', 'plan'];
|
|
13
|
+
export const DEFAULT_CLAUDE_MODEL = 'opus';
|
|
14
|
+
export const DEFAULT_CLAUDE_EFFORT = 'high';
|
|
15
|
+
export const DEFAULT_CLAUDE_PERMISSION_MODE = 'plan';
|
|
16
|
+
//# sourceMappingURL=claude-sessions.generated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-sessions.generated.js","sourceRoot":"","sources":["../../src/lib/claude-sessions.generated.ts"],"names":[],"mappings":"AAAA,mFAAmF;AAEnF,iGAAiG;AACjG,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE;IACtC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE;IACpC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE;IACxC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE;CAC9B,CAAC;AAIX,qEAAqE;AACrE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAU,CAAC;AAIvF,0DAA0D;AAC1D,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,aAAa,EAAE,mBAAmB,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,CAAU,CAAC;AAI/H,MAAM,CAAC,MAAM,oBAAoB,GAAgB,MAAM,CAAC;AACxD,MAAM,CAAC,MAAM,qBAAqB,GAAsB,MAAM,CAAC;AAC/D,MAAM,CAAC,MAAM,8BAA8B,GAAyB,MAAM,CAAC"}
|
package/dist/lib/settings.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Idea1Settings, VersionedPackage } from '../types/index.js';
|
|
2
2
|
import { type WorkflowState } from '../workflow/data/workflow-states.js';
|
|
3
|
+
import { type EntryPointPrompt } from '../workflow/data/workflow-states.generated.js';
|
|
3
4
|
/**
|
|
4
5
|
* Settings files read from `.idea1/`, in increasing order of precedence.
|
|
5
6
|
* `settings.local.json` holds developer-specific overrides and is not committed.
|
|
@@ -36,14 +37,19 @@ export declare const DEFAULT_REMOVE_WORKTREE_AT_STATE: WorkflowState;
|
|
|
36
37
|
/**
|
|
37
38
|
* Read `.idea1/settings.json` from a repository, with `.idea1/settings.local.json`
|
|
38
39
|
* overlaid on top. Each section is merged individually, so a local file that
|
|
39
|
-
* overrides one hook or default leaves the rest of the committed settings intact
|
|
40
|
+
* overrides one hook or default leaves the rest of the committed settings intact;
|
|
41
|
+
* entry points are merged state by state.
|
|
40
42
|
*/
|
|
41
43
|
export declare function readSettings(repoRoot: string): Promise<Idea1Settings | null>;
|
|
42
44
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
+
* The entry point prompts an agent session can start with in a workflow state: the repository's
|
|
46
|
+
* entries for the state in `prompts.entryPoints` of its `.idea1` settings (with
|
|
47
|
+
* `settings.local.json` overlaid), else the built-in defaults for the state. Settings keys are
|
|
48
|
+
* workflow state names, matched as stored statuses are (case-insensitively, legacy names
|
|
49
|
+
* included); a key that names no state is an error. A `templateFile` entry is read from its file,
|
|
50
|
+
* relative to the repo root.
|
|
45
51
|
*/
|
|
46
|
-
export declare function
|
|
52
|
+
export declare function getEntryPointPrompts(repoRoot: string, state: WorkflowState): Promise<EntryPointPrompt[]>;
|
|
47
53
|
/**
|
|
48
54
|
* Get the setup-worktree hook command if defined
|
|
49
55
|
* Handles both string and object hook formats for backward compatibility
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/lib/settings.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/lib/settings.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAA2B,aAAa,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAClG,OAAO,EAA0C,KAAK,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACjH,OAAO,EAAwB,KAAK,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AAE5G;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAA6C,CAAC;AAE1F;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;CAQ1B,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,aAAa,EAI1D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gCAAgC,EAAE,aAAsD,CAAC;AAkBtG;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAkBlF;AAKD;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAkB9G;AA6BD;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAWnF;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAG7E;AAED;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,uBAAuB,EAAE,MAAM,CAAC;IAChC,yBAAyB,EAAE,MAAM,CAAC;IAClC,6BAA6B,EAAE,MAAM,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAW1F;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;CACvC;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAK5F;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAkBvF"}
|
package/dist/lib/settings.js
CHANGED
|
@@ -2,6 +2,7 @@ import { readFile } from 'fs/promises';
|
|
|
2
2
|
import { existsSync } from 'fs';
|
|
3
3
|
import { join, resolve } from 'path';
|
|
4
4
|
import { WorkflowStates, normalizeWorkflowState } from '../workflow/data/workflow-states.js';
|
|
5
|
+
import { DEFAULT_ENTRY_POINTS } from '../workflow/data/workflow-states.generated.js';
|
|
5
6
|
/**
|
|
6
7
|
* Settings files read from `.idea1/`, in increasing order of precedence.
|
|
7
8
|
* `settings.local.json` holds developer-specific overrides and is not committed.
|
|
@@ -57,7 +58,8 @@ async function readSettingsFile(path) {
|
|
|
57
58
|
/**
|
|
58
59
|
* Read `.idea1/settings.json` from a repository, with `.idea1/settings.local.json`
|
|
59
60
|
* overlaid on top. Each section is merged individually, so a local file that
|
|
60
|
-
* overrides one hook or default leaves the rest of the committed settings intact
|
|
61
|
+
* overrides one hook or default leaves the rest of the committed settings intact;
|
|
62
|
+
* entry points are merged state by state.
|
|
61
63
|
*/
|
|
62
64
|
export async function readSettings(repoRoot) {
|
|
63
65
|
const [shared, local] = await Promise.all(SETTINGS_FILES.map(file => readSettingsFile(join(repoRoot, '.idea1', file))));
|
|
@@ -69,29 +71,57 @@ export async function readSettings(repoRoot) {
|
|
|
69
71
|
}
|
|
70
72
|
return {
|
|
71
73
|
hooks: { ...shared.hooks, ...local.hooks },
|
|
72
|
-
prompts: { ...shared.prompts, ...local.prompts },
|
|
74
|
+
prompts: { entryPoints: { ...shared.prompts?.entryPoints, ...local.prompts?.entryPoints } },
|
|
73
75
|
defaults: { ...shared.defaults, ...local.defaults },
|
|
74
76
|
release: { ...shared.release, ...local.release }
|
|
75
77
|
};
|
|
76
78
|
}
|
|
79
|
+
/** The `--entry-point` value that means no prompt, so no entry point may be named it. */
|
|
80
|
+
const RESERVED_ENTRY_POINT_NAME = 'none';
|
|
77
81
|
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
82
|
+
* The entry point prompts an agent session can start with in a workflow state: the repository's
|
|
83
|
+
* entries for the state in `prompts.entryPoints` of its `.idea1` settings (with
|
|
84
|
+
* `settings.local.json` overlaid), else the built-in defaults for the state. Settings keys are
|
|
85
|
+
* workflow state names, matched as stored statuses are (case-insensitively, legacy names
|
|
86
|
+
* included); a key that names no state is an error. A `templateFile` entry is read from its file,
|
|
87
|
+
* relative to the repo root.
|
|
80
88
|
*/
|
|
81
|
-
export async function
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
89
|
+
export async function getEntryPointPrompts(repoRoot, state) {
|
|
90
|
+
const configured = (await readSettings(repoRoot))?.prompts?.entryPoints ?? {};
|
|
91
|
+
let entries = null;
|
|
92
|
+
for (const [key, value] of Object.entries(configured)) {
|
|
93
|
+
const keyState = normalizeWorkflowState(key);
|
|
94
|
+
if (!keyState) {
|
|
95
|
+
throw new Error(`"${key}" in prompts.entryPoints of the .idea1 settings is not a workflow state.`);
|
|
96
|
+
}
|
|
97
|
+
if (keyState === state) {
|
|
98
|
+
entries = value;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (!entries) {
|
|
102
|
+
return [...DEFAULT_ENTRY_POINTS[state]];
|
|
103
|
+
}
|
|
104
|
+
return Promise.all(entries.map(entry => readEntryPointPrompt(repoRoot, state, entry, entries)));
|
|
105
|
+
}
|
|
106
|
+
async function readEntryPointPrompt(repoRoot, state, entry, stateEntries) {
|
|
107
|
+
const name = typeof entry.name === 'string' ? entry.name.trim() : '';
|
|
108
|
+
if (!name || name.toLowerCase() === RESERVED_ENTRY_POINT_NAME) {
|
|
109
|
+
throw new Error(`Every entry point of "${state}" in the .idea1 settings needs a name other than "${RESERVED_ENTRY_POINT_NAME}".`);
|
|
110
|
+
}
|
|
111
|
+
if (stateEntries.filter(other => other.name?.trim() === name).length > 1) {
|
|
112
|
+
throw new Error(`"${state}" has more than one entry point named "${name}" in the .idea1 settings.`);
|
|
86
113
|
}
|
|
87
|
-
if (typeof
|
|
88
|
-
return
|
|
114
|
+
if ('template' in entry && typeof entry.template === 'string') {
|
|
115
|
+
return { name, template: entry.template };
|
|
89
116
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
117
|
+
if ('templateFile' in entry && typeof entry.templateFile === 'string') {
|
|
118
|
+
const templatePath = resolve(repoRoot, entry.templateFile);
|
|
119
|
+
if (!existsSync(templatePath)) {
|
|
120
|
+
throw new Error(`The template file "${entry.templateFile}" of the "${name}" entry point named in .idea1 settings does not exist (${templatePath}).`);
|
|
121
|
+
}
|
|
122
|
+
return { name, template: await readFile(templatePath, 'utf-8') };
|
|
93
123
|
}
|
|
94
|
-
|
|
124
|
+
throw new Error(`The "${name}" entry point of "${state}" in the .idea1 settings needs a template or a templateFile.`);
|
|
95
125
|
}
|
|
96
126
|
/**
|
|
97
127
|
* Get the setup-worktree hook command if defined
|
package/dist/lib/settings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/lib/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAsB,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/lib/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAsB,MAAM,qCAAqC,CAAC;AACjH,OAAO,EAAE,oBAAoB,EAAyB,MAAM,+CAA+C,CAAC;AAE5G;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAsB,CAAC,eAAe,EAAE,qBAAqB,CAAC,CAAC;AAE1F;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,YAAY,EAAE,eAAe;IAC7B,UAAU,EAAE,iBAAiB;IAC7B,mBAAmB,EAAE,MAAM;IAC3B,uBAAuB,EAAE,qBAAqB;IAC9C,yBAAyB,EAAE,sBAAsB;IACjD,6BAA6B,EAAE,oCAAoC;IACnE,WAAW,EAAE,cAAc;CACnB,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAA6B;IAC9D,cAAc,CAAC,iBAAiB;IAChC,cAAc,CAAC,uBAAuB;IACtC,cAAc,CAAC,iBAAiB;CACjC,C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;IACxD,MAAM,OAAO,GAAG,CAAC,MAAM,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC;IACxD,OAAO;QACL,iBAAiB,EAAE,OAAO,EAAE,iBAAiB,IAAI,EAAE;KACpD,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,QAAgB;IAC7D,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC9C,MAAM,kBAAkB,GAAG,QAAQ,EAAE,QAAQ,EAAE,qBAAqB,CAAC;IAErE,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACxB,OAAO,gCAAgC,CAAC;IAC1C,CAAC;IAED,MAAM,eAAe,GAAG,sBAAsB,CAAC,kBAAkB,CAAC,IAAI,kBAAkB,CAAC;IAEzF,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;QACtD,MAAM,WAAW,GAAG,sBAAsB,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjF,MAAM,IAAI,KAAK,CACb,0CAA0C,eAAe,uCAAuC,WAAW,GAAG,CAC/G,CAAC;IACJ,CAAC;IAED,OAAO,eAAe,CAAC;AACzB,CAAC"}
|
|
@@ -3,7 +3,9 @@ export declare const setWorkflowStatusPrompt: import("../services/template-rende
|
|
|
3
3
|
projectItemUrl: string;
|
|
4
4
|
workflowStatus: string;
|
|
5
5
|
pullRequestUrl: string | null;
|
|
6
|
+
assignedToEmail: string | null;
|
|
6
7
|
}>;
|
|
8
|
+
export declare const listTeamMembersPrompt: import("../services/template-renderer.js").RenderTemplate<Record<string, never>>;
|
|
7
9
|
export declare const getProjectItemSummaryForBranchPrompt: import("../services/template-renderer.js").RenderTemplate<{
|
|
8
10
|
repositoryFullName: string;
|
|
9
11
|
branchName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-prompts.d.ts","sourceRoot":"","sources":["../../src/prompts/platform-prompts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"platform-prompts.d.ts","sourceRoot":"","sources":["../../src/prompts/platform-prompts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAuB5E,eAAO,MAAM,uBAAuB;oBAClB,MAAM;oBACN,MAAM;oBACN,MAAM,GAAG,IAAI;qBACZ,MAAM,GAAG,IAAI;EAQ/B,CAAC;AAEF,eAAO,MAAM,qBAAqB,kFAIjC,CAAC;AAEF,eAAO,MAAM,oCAAoC;wBAAyC,MAAM;gBAAc,MAAM;EAGnH,CAAC;AAEF,eAAO,MAAM,2BAA2B;oBAAqC,MAAM;EAGlF,CAAC;AAEF,eAAO,MAAM,sCAAsC;oBACjC,MAAM;wBACF,MAAM;gBACd,MAAM;gBACN,MAAM;qBACD,eAAe;iBACnB,MAAM,GAAG,IAAI;uBACP,MAAM,GAAG,IAAI;EASjC,CAAC;AAEF,eAAO,MAAM,wBAAwB;oBAAqC,MAAM;EAI/E,CAAC;AAEF,eAAO,MAAM,kBAAkB,kFAG9B,CAAC;AAEF,eAAO,MAAM,uBAAuB;WAA4B,MAAM;iBAAe,MAAM;EAK1F,CAAC"}
|
|
@@ -9,7 +9,8 @@ import { compileTemplate } from '../services/template-renderer.js';
|
|
|
9
9
|
* Where a call that returns a project item summary puts the tool's result.
|
|
10
10
|
*/
|
|
11
11
|
const PROJECT_ITEM_SUMMARY_OUTPUT_INSTRUCTIONS = 'Copy the tool\'s result into the "projectItemSummary" field exactly as returned: url, externalId, title, epicId, ' +
|
|
12
|
-
'completionDate, legacyWorkflowStatus
|
|
12
|
+
'completionDate, legacyWorkflowStatus, projectId (null when the item is out of scope), assignedToUserId (null when ' +
|
|
13
|
+
'unassigned) and "workflowContext" with its workflowStatus, codingAgentUrl, ' +
|
|
13
14
|
'pullRequestUrl, repositoryFullName, branchName, baseBranch, devWorkflowType, stackBranch, integrationBranch and ' +
|
|
14
15
|
'branchState (the number the tool returned), or null when the result\'s workflowContext is null. Put null in ' +
|
|
15
16
|
'"error". If the tool returns an error, put its message verbatim in "error" and null in "projectItemSummary".';
|
|
@@ -17,10 +18,14 @@ const PROJECT_ITEM_SUMMARY_OUTPUT_INSTRUCTIONS = 'Copy the tool\'s result into t
|
|
|
17
18
|
// API call. The CLI will authenticate a user and call the API for direct integrations like this; MCP tools will then
|
|
18
19
|
// be only operations that agents should run.
|
|
19
20
|
export const setWorkflowStatusPrompt = compileTemplate('Record the workflow status of {{projectItemUrl}} as "{{workflowStatus}}" by calling the update_item MCP tool with ' +
|
|
20
|
-
'itemReference "{{projectItemUrl}}", workflowStatus "{{workflowStatus}}"
|
|
21
|
-
'{{#if pullRequestUrl}},
|
|
22
|
-
'
|
|
21
|
+
'itemReference "{{projectItemUrl}}", workflowStatus "{{workflowStatus}}"' +
|
|
22
|
+
'{{#if pullRequestUrl}}, pullRequestUrl "{{pullRequestUrl}}"{{/if}}' +
|
|
23
|
+
'{{#if assignedToEmail}}, assignedToEmail "{{assignedToEmail}}"{{/if}}' +
|
|
24
|
+
' and no other fields. ' +
|
|
23
25
|
'Put "done" in the "result" field on success, or an explanation in the "error" field on failure.');
|
|
26
|
+
export const listTeamMembersPrompt = compileTemplate('List the team\'s members using the list_team_members MCP tool. Copy the tool\'s result into the "members" field ' +
|
|
27
|
+
'exactly as returned: each member\'s userId, email, role and gitHubUsername (null when the member has no linked ' +
|
|
28
|
+
'GitHub account), in the order returned.');
|
|
24
29
|
export const getProjectItemSummaryForBranchPrompt = compileTemplate('Call the get_item_summary_for_branch MCP tool with repositoryFullName "{{repositoryFullName}}" and branchName "{{branchName}}". ' +
|
|
25
30
|
PROJECT_ITEM_SUMMARY_OUTPUT_INSTRUCTIONS);
|
|
26
31
|
export const getProjectItemSummaryPrompt = compileTemplate('Call the get_item_summary MCP tool with itemReference "{{projectItemUrl}}". ' +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-prompts.js","sourceRoot":"","sources":["../../src/prompts/platform-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,wCAAwC,GAC5C,mHAAmH;IACnH,
|
|
1
|
+
{"version":3,"file":"platform-prompts.js","sourceRoot":"","sources":["../../src/prompts/platform-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,wCAAwC,GAC5C,mHAAmH;IACnH,oHAAoH;IACpH,6EAA6E;IAC7E,kHAAkH;IAClH,8GAA8G;IAC9G,8GAA8G,CAAC;AAEjH,iHAAiH;AACjH,qHAAqH;AACrH,6CAA6C;AAC7C,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CAMpD,oHAAoH;IACpH,yEAAyE;IACzE,oEAAoE;IACpE,uEAAuE;IACvE,wBAAwB;IACxB,iGAAiG,CAClG,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,eAAe,CAClD,kHAAkH;IAClH,iHAAiH;IACjH,yCAAyC,CAC1C,CAAC;AAEF,MAAM,CAAC,MAAM,oCAAoC,GAAG,eAAe,CACjE,kIAAkI;IAClI,wCAAwC,CACzC,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,eAAe,CACxD,8EAA8E;IAC9E,wCAAwC,CACzC,CAAC;AAEF,MAAM,CAAC,MAAM,sCAAsC,GAAG,eAAe,CASnE,0FAA0F;IAC1F,yGAAyG;IACzG,uCAAuC;IACvC,2DAA2D;IAC3D,+EAA+E;IAC/E,8BAA8B;IAC9B,wCAAwC,CACzC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,eAAe,CACrD,4IAA4I;IAC5I,iIAAiI;IACjI,gFAAgF,CACjF,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAC/C,oEAAoE;IACpE,oGAAoG,CACrG,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CACpD,qHAAqH;IACrH,iHAAiH;IACjH,qHAAqH;IACrH,uFAAuF,CACxF,CAAC"}
|
|
@@ -28,17 +28,8 @@ export interface ProjectItemPromptModel {
|
|
|
28
28
|
*/
|
|
29
29
|
export declare function projectItemPromptModel(projectItemUrl: string, context: WorkflowContext, workingPath: string): ProjectItemPromptModel;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* Note: When launched via claude.runInteractive with permissionMode='plan', the Claude CLI enters
|
|
34
|
-
* plan mode automatically — the prompt itself should not instruct the model to plan.
|
|
31
|
+
* Render an entry point prompt - one of a workflow state's entry points, or a template given for the
|
|
32
|
+
* session - against the item's prompt model.
|
|
35
33
|
*/
|
|
36
|
-
export declare
|
|
37
|
-
/**
|
|
38
|
-
* The prompt an Agent Implementation session starts with, rendered from the first template that
|
|
39
|
-
* exists: the one given for this session (`--entry-point-prompt`), the repository's
|
|
40
|
-
* `prompts.agentImplementation` setting, the built-in default. Settings are read from the main
|
|
41
|
-
* repository, where `settings.local.json` lives, so a developer's override applies in worktrees too.
|
|
42
|
-
*/
|
|
43
|
-
export declare function renderAgentImplementationPrompt(model: ProjectItemPromptModel, sessionPromptTemplate: string | null): Promise<string>;
|
|
34
|
+
export declare function renderEntryPointPrompt(model: ProjectItemPromptModel, template: string): string;
|
|
44
35
|
//# sourceMappingURL=project-item-prompts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-item-prompts.d.ts","sourceRoot":"","sources":["../../src/prompts/project-item-prompts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"project-item-prompts.d.ts","sourceRoot":"","sources":["../../src/prompts/project-item-prompts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAE7F;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,cAAc,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,wFAAwF;IACxF,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,eAAe,CAAC;IACjC,8EAA8E;IAC9E,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,6EAA6E;IAC7E,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,2EAA2E;IAC3E,cAAc,EAAE,MAAM,CAAC;IACvB,kDAAkD;IAClD,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,GAAG,sBAAsB,CAapI;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE9F"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { getAgentImplementationPromptTemplate } from '../lib/settings.js';
|
|
2
|
-
import * as git from '../services/git.js';
|
|
3
1
|
import { compileTemplate } from '../services/template-renderer.js';
|
|
4
2
|
/**
|
|
5
3
|
* The prompt model of a project item whose live branch is checked out at `workingPath`.
|
|
@@ -19,23 +17,10 @@ export function projectItemPromptModel(projectItemUrl, context, workingPath) {
|
|
|
19
17
|
};
|
|
20
18
|
}
|
|
21
19
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* Note: When launched via claude.runInteractive with permissionMode='plan', the Claude CLI enters
|
|
25
|
-
* plan mode automatically — the prompt itself should not instruct the model to plan.
|
|
20
|
+
* Render an entry point prompt - one of a workflow state's entry points, or a template given for the
|
|
21
|
+
* session - against the item's prompt model.
|
|
26
22
|
*/
|
|
27
|
-
export
|
|
28
|
-
'Read the project item\'s context and description from Idea1 using get_item_context_for_agent_implementation.';
|
|
29
|
-
/**
|
|
30
|
-
* The prompt an Agent Implementation session starts with, rendered from the first template that
|
|
31
|
-
* exists: the one given for this session (`--entry-point-prompt`), the repository's
|
|
32
|
-
* `prompts.agentImplementation` setting, the built-in default. Settings are read from the main
|
|
33
|
-
* repository, where `settings.local.json` lives, so a developer's override applies in worktrees too.
|
|
34
|
-
*/
|
|
35
|
-
export async function renderAgentImplementationPrompt(model, sessionPromptTemplate) {
|
|
36
|
-
const template = sessionPromptTemplate
|
|
37
|
-
?? await getAgentImplementationPromptTemplate(await git.getMainRepoRoot())
|
|
38
|
-
?? DEFAULT_AGENT_IMPLEMENTATION_PROMPT_TEMPLATE;
|
|
23
|
+
export function renderEntryPointPrompt(model, template) {
|
|
39
24
|
return compileTemplate(template)(model).trim();
|
|
40
25
|
}
|
|
41
26
|
//# sourceMappingURL=project-item-prompts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-item-prompts.js","sourceRoot":"","sources":["../../src/prompts/project-item-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"project-item-prompts.js","sourceRoot":"","sources":["../../src/prompts/project-item-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AA4BnE;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,cAAsB,EAAE,OAAwB,EAAE,WAAmB;IAC1G,OAAO;QACL,cAAc;QACd,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;QAC9C,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;QAC5C,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,WAAW;KACZ,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAA6B,EAAE,QAAgB;IACpF,OAAO,eAAe,CAAyB,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AACzE,CAAC"}
|