@idea1/cli 1.9.0 → 1.9.1
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 +4 -4
- package/dist/commands/attach-project-item.d.ts.map +1 -1
- package/dist/commands/attach-project-item.js +1 -4
- package/dist/commands/attach-project-item.js.map +1 -1
- package/dist/commands/next-workflow-step.js +2 -2
- package/dist/commands/next-workflow-step.js.map +1 -1
- package/dist/commands/ship-local-changes.js +1 -1
- package/dist/commands/ship-local-changes.js.map +1 -1
- package/dist/index.js +0 -0
- package/dist/workflow/engine/branch-setup.d.ts +8 -2
- package/dist/workflow/engine/branch-setup.d.ts.map +1 -1
- package/dist/workflow/engine/branch-setup.js +16 -6
- package/dist/workflow/engine/branch-setup.js.map +1 -1
- package/dist/workflow/engine/ship-flow.d.ts +3 -2
- package/dist/workflow/engine/ship-flow.d.ts.map +1 -1
- package/dist/workflow/engine/ship-flow.js +5 -4
- package/dist/workflow/engine/ship-flow.js.map +1 -1
- package/package.json +1 -1
- package/dist/commands/integrate.d.ts +0 -13
- package/dist/commands/integrate.d.ts.map +0 -1
- package/dist/commands/integrate.js +0 -128
- package/dist/commands/integrate.js.map +0 -1
- package/dist/commands/start-project-item.d.ts +0 -27
- package/dist/commands/start-project-item.d.ts.map +0 -1
- package/dist/commands/start-project-item.js +0 -325
- package/dist/commands/start-project-item.js.map +0 -1
- package/dist/services/hooks.d.ts +0 -8
- package/dist/services/hooks.d.ts.map +0 -1
- package/dist/services/hooks.js +0 -72
- package/dist/services/hooks.js.map +0 -1
- package/dist/services/workflow.d.ts +0 -17
- package/dist/services/workflow.d.ts.map +0 -1
- package/dist/services/workflow.js +0 -39
- package/dist/services/workflow.js.map +0 -1
package/README.md
CHANGED
|
@@ -101,7 +101,7 @@ The state names and their order are defined once, in `shared-config/workflow-sta
|
|
|
101
101
|
|
|
102
102
|
### How the workflow engine works
|
|
103
103
|
|
|
104
|
-
An item **under workflow management** has a *workflow context* on idea1.ai: its workflow status together with the one branch on origin that carries its work — the repository and branch name, the PR target (base) branch, the dev workflow type and any stack or integration branch. An item with no context is outside workflow management and has no status. The CLI reads and records the context through the platform's MCP tools (`get_item_summary_for_branch`, `get_item_summary`, `upsert_item_workflow_context`) and, having run a transition's automation itself, records the state it reached directly with `update_item`'s `workflowStatus`; the web client works on the same context, so the two always agree, and any clone resolves a branch to its item from the platform. Locally, each clone remembers the item URL a branch was last resolved to in its git config, so ordinary branches are recognized as unmanaged instantly.
|
|
104
|
+
An item **under workflow management** has a *workflow context* on idea1.ai: its workflow status together with the one branch on origin that carries its work — the repository and branch name, the PR target (base) branch, the dev workflow type and any stack or integration branch. An item with no context is outside workflow management and has no status. The CLI reads and records the context through the platform's MCP tools (`get_item_summary_for_branch`, `get_item_summary`, `upsert_item_workflow_context`) and, having run a transition's automation itself, records the state it reached directly with `update_item`'s `workflowStatus`; the web client works on the same context, so the two always agree, and any clone resolves a branch to its item from the platform. The branching decisions the context records (dev workflow type, stack and integration branch, branch name) are made once, when the item's branch is created, and are never asked again for an item that has one. Locally, each clone remembers the item URL a branch was last resolved to in its git config, so ordinary branches are recognized as unmanaged instantly.
|
|
105
105
|
|
|
106
106
|
The branch itself carries the work. A branch's PR is therefore gated on a CI/CD run of exactly what merges, and `approve-pr` merges that run's head. When a branch is deleted on GitHub the context keeps its name and records whether the work merged; a context whose branch is gone without merging gets a new branch the next time the item enters a pre-merge state, while merged work stays merged. Branches put under workflow before the platform kept contexts carry a legacy `.idea1/<branch>.json` file, which the CLI removes from the branch before the approval gate.
|
|
107
107
|
|
|
@@ -145,9 +145,9 @@ idea1 s --target <url>
|
|
|
145
145
|
- `-t, --title <title>` - Title for the new project item (only when no target is given).
|
|
146
146
|
- `-P, --project <name>` - The Project to create the new item in, chosen from the team's live Projects (only when no target is given; always asked, never defaulted).
|
|
147
147
|
- `-p, --source-path <path>` - Path to source directory.
|
|
148
|
-
- `-n, --branch-name <name>` - Branch name (auto-generated from the item description if not provided).
|
|
148
|
+
- `-n, --branch-name <name>` - Branch name (auto-generated from the item description if not provided). Asked, blank to generate one, only when the item has no branch yet.
|
|
149
149
|
- `-b, --base-branch <branch>` - Base branch / PR target (default: `working/release`).
|
|
150
|
-
- `-w, --workflow-type <type>` - `independent` or `integration`; you also choose any stack branch and (for integration) the integration branch.
|
|
150
|
+
- `-w, --workflow-type <type>` - `independent` or `integration`; you also choose any stack branch and (for integration) the integration branch. These are asked only when the command gives the item its branch, never for an item whose workflow context already holds one, and an option given on the command line is not asked. Carried local changes go onto an independent branch.
|
|
151
151
|
- `-c, --carry-local-changes` - Make the uncommitted changes of your base branch checkout the item's work. See [Carrying local changes](#carrying-local-changes).
|
|
152
152
|
- `--approve-and-merge` - Advance the item through every state up to **Approved and Merged** without prompting. See [Carrying local changes](#carrying-local-changes).
|
|
153
153
|
- `-M, --commit-message <message>` - Commit message for carried changes (default: the new item's title).
|
|
@@ -284,7 +284,7 @@ idea1 a --target <url>
|
|
|
284
284
|
- `-t, --title <title>` - Title for the new project item (only when no target is given).
|
|
285
285
|
- `-p, --source-path <path>` - Path to source directory.
|
|
286
286
|
- `-b, --base-branch <branch>` - Base branch / PR target for an independent feature (default: `working/release`).
|
|
287
|
-
- `-w, --workflow-type <type>` - Development workflow type: `independent` or `integration`. You also choose any stack branch and (for integration) the integration branch.
|
|
287
|
+
- `-w, --workflow-type <type>` - Development workflow type: `independent` or `integration`. You also choose any stack branch and (for integration) the integration branch. Asked here because attaching records a new branch on the item; an option given on the command line is not asked.
|
|
288
288
|
- `-c, --carry-local-changes`, `--approve-and-merge`, `-n, --branch-name`, `-M, --commit-message`, `-iso, --isolation`, `-r, --reviewers` - As for `start`.
|
|
289
289
|
|
|
290
290
|
**What it does:**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attach-project-item.d.ts","sourceRoot":"","sources":["../../src/commands/attach-project-item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAmBjD,eAAO,MAAM,wBAAwB,EAAE,
|
|
1
|
+
{"version":3,"file":"attach-project-item.d.ts","sourceRoot":"","sources":["../../src/commands/attach-project-item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAmBjD,eAAO,MAAM,wBAAwB,EAAE,OA+GtC,CAAC"}
|
|
@@ -15,10 +15,7 @@ export const attachProjectItemCommand = {
|
|
|
15
15
|
carryLocalChangesOption,
|
|
16
16
|
approveAndMergeOption,
|
|
17
17
|
...projectItemTargetOptions,
|
|
18
|
-
|
|
19
|
-
...branchCreationOptionsWithCarrying.map(option => option.longName === 'branch-name'
|
|
20
|
-
? { ...option, dependsOn: carriesLocalChanges }
|
|
21
|
-
: option),
|
|
18
|
+
...branchCreationOptionsWithCarrying,
|
|
22
19
|
// An attached branch is worked where it is checked out; only a branch created for carried changes needs a checkout.
|
|
23
20
|
...shipOptions.map(option => option.longName === isolationModeOption.longName
|
|
24
21
|
? { ...option, dependsOn: carriesLocalChanges }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attach-project-item.js","sourceRoot":"","sources":["../../src/commands/attach-project-item.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC/G,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,iCAAiC,EACjC,mBAAmB,EACnB,uBAAuB,EACvB,WAAW,EACZ,MAAM,iCAAiC,CAAC;AACzC,OAAO,EA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e,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,wBAAwB,cAAc,6BAA6B,CAAC,CAAC;QACvF,CAAC;QAED,MAAM,aAAa,GAAG,sBAAsB,CAAC,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,IAAI,cAAc,CAAC,mBAAmB,CAAC;QACxH,MAAM,CAAC,IAAI,CAAC,4BAA4B,aAAa,QAAQ,cAAc,YAAY,aAAa,GAAG,CAAC,CAAC;QAEzG,4EAA4E;QAC5E,+EAA+E;QAC/E,IAAI,gBAAgB,CAAC,aAAa,EAAE,cAAc,CAAC,iBAAiB,CAAC,EAAE,CAAC;YACtE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,aAAa,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;YAC5F,IAAI,MAAM,EAAE,CAAC;gBACX,MAAM,CAAC,IAAI,CAAC,OAAO,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;YACnC,CAAC;QACH,CAAC;QAED,MAAM,CAAC,OAAO,CAAC,YAAY,aAAa,OAAO,cAAc,EAAE,CAAC,CAAC;QAEjE,IAAI,iBAAiB,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChC,MAAM,eAAe,CAAC,MAAM,iBAAiB,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;YAC9F,OAAO;QACT,CAAC;QAED,MAAM,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,CAAC,IAAI,CAAC,sEAAsE,CAAC,CAAC;IACtF,CAAC;CACF,CAAC"}
|
|
@@ -27,8 +27,8 @@ export const nextWorkflowStepCommand = {
|
|
|
27
27
|
promptWhenDefaultExists: false
|
|
28
28
|
},
|
|
29
29
|
// Branch creation choices apply when the item has no branch yet; the engine
|
|
30
|
-
// prompts for what it needs
|
|
31
|
-
...branchCreationOptions
|
|
30
|
+
// prompts for what it needs.
|
|
31
|
+
...branchCreationOptions,
|
|
32
32
|
...deferredHandlerOptions([])
|
|
33
33
|
],
|
|
34
34
|
async execute(resolved) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-workflow-step.js","sourceRoot":"","sources":["../../src/commands/next-workflow-step.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,sBAAsB,EAAsB,MAAM,qCAAqC,CAAC;AACxI,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC7F,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEjE,MAAM,CAAC,MAAM,uBAAuB,GAAY;IAC9C,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC;IACtB,WAAW,EAAE,4JAA4J;IACzK,OAAO,EAAE;QACP,YAAY,CAAC,KAAK,CAAC;QACnB;YACE,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,+IAA+I;YAC5J,YAAY,EAAE,EAAE;YAChB,uBAAuB,EAAE,KAAK;YAC9B,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,EAAE,IAAI,sBAAsB,CAAC,KAAK,CAAC,KAAK,IAAI;gBAClF,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,2BAA2B,KAAK,cAAc,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;SAChF;QACD;YACE,QAAQ,EAAE,aAAa;YACvB,SAAS,EAAE,GAAG;YACd,WAAW,EAAE,0BAA0B;YACvC,YAAY,EAAE,EAAE;YAChB,uBAAuB,EAAE,KAAK;SAC/B;QACD,4EAA4E;QAC5E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,CAAC"}
|
|
@@ -18,7 +18,7 @@ export const shipLocalChangesCommand = {
|
|
|
18
18
|
: option),
|
|
19
19
|
...branchCreationOptions
|
|
20
20
|
.filter(option => option.longName !== 'workflow-type')
|
|
21
|
-
.map(option => ({ ...option, defaultValue: '', promptWhenDefaultExists: false })),
|
|
21
|
+
.map(option => ({ ...option, dependsOn: undefined, defaultValue: '', promptWhenDefaultExists: false })),
|
|
22
22
|
commitMessageOption,
|
|
23
23
|
{ ...isolationModeOption, description: 'Where to work on the branch while it is shipped', defaultValue: 'worktree', promptWhenDefaultExists: false },
|
|
24
24
|
unpromptedReviewersOption
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ship-local-changes.js","sourceRoot":"","sources":["../../src/commands/ship-local-changes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAExE;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAY;IAC9C,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,CAAC,MAAM,CAAC;IACjB,WAAW,EAAE,0MAA0M;IACvN,OAAO,EAAE;QACP,GAAG,wBAAwB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,KAAK,kBAAkB;YAC9E,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,WAAW,EAAE,6EAA6E,EAAE,uBAAuB,EAAE,KAAK,EAAE;YAC3I,CAAC,CAAC,MAAM,CAAC;QACX,GAAG,qBAAqB;aACrB,MAA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,KAAK,EAAE,CAAC,CAAC;QACzG,mBAAmB;QACnB,EAAE,GAAG,mBAAmB,EAAE,WAAW,EAAE,iDAAiD,EAAE,YAAY,EAAE,UAAU,EAAE,uBAAuB,EAAE,KAAK,EAAE;QACpJ,yBAAyB;KAC1B;IAED,KAAK,CAAC,OAAO,CAAC,QAAgC;QAC5C,MAAM,gBAAgB,CAAC;YACrB,GAAG,QAAQ;YACX,CAAC,uBAAuB,CAAC,QAAQ,CAAC,EAAE,MAAM;YAC1C,CAAC,qBAAqB,CAAC,QAAQ,CAAC,EAAE,MAAM;SACzC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
package/dist/index.js
CHANGED
|
File without changes
|
|
@@ -12,6 +12,11 @@ export interface IntegrationBranchSelection {
|
|
|
12
12
|
/**
|
|
13
13
|
* The options every command that can create an item's branch shares: which
|
|
14
14
|
* branch to base it on and which branching workflow to use.
|
|
15
|
+
*
|
|
16
|
+
* The branch name and workflow type are not asked up front: whether a branch is created at all
|
|
17
|
+
* depends on the item's workflow context, which the option resolver cannot see. The engine asks
|
|
18
|
+
* for them in `collectBranchCreationChoices` when it creates a branch, and never for an item whose
|
|
19
|
+
* context already holds one. A value passed on the command line is used as given.
|
|
15
20
|
*/
|
|
16
21
|
export declare const branchCreationOptions: CommandOption[];
|
|
17
22
|
/**
|
|
@@ -25,8 +30,9 @@ export interface BranchCreationChoices {
|
|
|
25
30
|
integrationSelection: IntegrationBranchSelection | null;
|
|
26
31
|
}
|
|
27
32
|
/**
|
|
28
|
-
* Collect every branching decision up front (
|
|
29
|
-
* so all user questions are asked before any slow git or MCP work starts.
|
|
33
|
+
* Collect every branching decision up front (workflow type, branch name, stack branch,
|
|
34
|
+
* integration branch) so all user questions are asked before any slow git or MCP work starts.
|
|
35
|
+
* Decisions already given as options are not asked again.
|
|
30
36
|
*/
|
|
31
37
|
export declare function collectBranchCreationChoices(resolved: Record<string, string>): Promise<BranchCreationChoices>;
|
|
32
38
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"branch-setup.d.ts","sourceRoot":"","sources":["../../../src/workflow/engine/branch-setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAK1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGnE,eAAO,MAAM,gBAAgB;;;GAG5B,CAAC;AAaF,MAAM,WAAW,0BAA0B;IACzC,eAAe,EAAE,MAAM,CAAC;IACxB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,KAAK,EAAE,OAAO,CAAC;CAChB;AAED
|
|
1
|
+
{"version":3,"file":"branch-setup.d.ts","sourceRoot":"","sources":["../../../src/workflow/engine/branch-setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAK1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGnE,eAAO,MAAM,gBAAgB;;;GAG5B,CAAC;AAaF,MAAM,WAAW,0BAA0B;IACzC,eAAe,EAAE,MAAM,CAAC;IACxB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,EAAE,aAAa,EA2BhD,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,eAAe,CAAC;IAC9B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,oBAAoB,EAAE,0BAA0B,GAAG,IAAI,CAAC;CACzD;AAED;;;;GAIG;AACH,wBAAsB,4BAA4B,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAcnH;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA6BnE;AAED;;;GAGG;AACH,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,0BAA0B,CAAC,CAoBtF"}
|
|
@@ -19,6 +19,11 @@ const INTEGRATION_BRANCH_CHOICES = [
|
|
|
19
19
|
/**
|
|
20
20
|
* The options every command that can create an item's branch shares: which
|
|
21
21
|
* branch to base it on and which branching workflow to use.
|
|
22
|
+
*
|
|
23
|
+
* The branch name and workflow type are not asked up front: whether a branch is created at all
|
|
24
|
+
* depends on the item's workflow context, which the option resolver cannot see. The engine asks
|
|
25
|
+
* for them in `collectBranchCreationChoices` when it creates a branch, and never for an item whose
|
|
26
|
+
* context already holds one. A value passed on the command line is used as given.
|
|
22
27
|
*/
|
|
23
28
|
export const branchCreationOptions = [
|
|
24
29
|
{
|
|
@@ -26,7 +31,8 @@ export const branchCreationOptions = [
|
|
|
26
31
|
shortName: 'n',
|
|
27
32
|
description: 'Branch name (auto-generated if not provided)',
|
|
28
33
|
defaultValue: undefined,
|
|
29
|
-
promptWhenDefaultExists: true
|
|
34
|
+
promptWhenDefaultExists: true,
|
|
35
|
+
dependsOn: () => false
|
|
30
36
|
},
|
|
31
37
|
{
|
|
32
38
|
// Left empty so the repo's `.idea1/settings.json` still has a say: a default here
|
|
@@ -43,19 +49,23 @@ export const branchCreationOptions = [
|
|
|
43
49
|
shortName: 'w',
|
|
44
50
|
description: 'Development workflow type',
|
|
45
51
|
defaultValue: undefined,
|
|
46
|
-
choices: WORKFLOW_CHOICES
|
|
52
|
+
choices: WORKFLOW_CHOICES,
|
|
53
|
+
dependsOn: () => false
|
|
47
54
|
}
|
|
48
55
|
];
|
|
49
56
|
/**
|
|
50
|
-
* Collect every branching decision up front (
|
|
51
|
-
* so all user questions are asked before any slow git or MCP work starts.
|
|
57
|
+
* Collect every branching decision up front (workflow type, branch name, stack branch,
|
|
58
|
+
* integration branch) so all user questions are asked before any slow git or MCP work starts.
|
|
59
|
+
* Decisions already given as options are not asked again.
|
|
52
60
|
*/
|
|
53
61
|
export async function collectBranchCreationChoices(resolved) {
|
|
54
|
-
const workflowType = (resolved['workflow-type']
|
|
62
|
+
const workflowType = (resolved['workflow-type']
|
|
63
|
+
|| await promptSelect('Development workflow type', WORKFLOW_CHOICES));
|
|
64
|
+
const shortBranchName = resolved['branch-name'] ?? await promptInput('Branch name (blank to generate one)');
|
|
55
65
|
const stackBranch = await promptForStackBranch();
|
|
56
66
|
const integrationSelection = workflowType === 'integration' ? await promptForIntegrationBranch() : null;
|
|
57
67
|
return {
|
|
58
|
-
shortBranchName:
|
|
68
|
+
shortBranchName: shortBranchName || null,
|
|
59
69
|
baseBranch: resolved['base-branch'] || await worktree.resolveBaseBranch(),
|
|
60
70
|
workflowType,
|
|
61
71
|
stackBranch,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"branch-setup.js","sourceRoot":"","sources":["../../../src/workflow/engine/branch-setup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,4BAA4B,CAAC;AAEvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAE,aAAa,EAAE;IACtD,EAAE,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,aAAa,EAAE;CACxD,CAAC;AAEF,MAAM,aAAa,GAAG;IACpB,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;IAC5B,EAAE,KAAK,EAAE,wBAAwB,EAAE,KAAK,EAAE,QAAQ,EAAE;IACpD,EAAE,KAAK,EAAE,k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CAAC,CAAC,KAAK,CAAC;IAEV,IAAI,YAAY,KAAK,UAAU,EAAE,CAAC;QAChC,MAAM,aAAa,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC1E,MAAM,qBAAqB,GAAG,MAAM,YAAY,CAAC,2BAA2B,EAAE,aAAa,CAAC,CAAC;QAC7F,MAAM,eAAe,GAAG,MAAM,QAAQ,CAAC,sBAAsB,CAAC,qBAAqB,CAAC,CAAC;QACrF,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IAClE,CAAC;IAED,MAAM,eAAe,GAAG,MAAM,WAAW,CAAC,0CAA0C,CAAC,CAAC;IACtF,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;IACD,MAAM,qBAAqB,GAAG,MAAM,QAAQ,CAAC,0BAA0B,CAAC,eAAe,CAAC,CAAC;IACzF,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACjE,CAAC"}
|
|
@@ -25,8 +25,9 @@ export declare function carriesLocalChanges(resolved: Record<string, string>): b
|
|
|
25
25
|
*/
|
|
26
26
|
export declare function approvesAndMerges(resolved: Record<string, string>): boolean;
|
|
27
27
|
/**
|
|
28
|
-
* The branch creation options alongside carrying
|
|
29
|
-
*
|
|
28
|
+
* The branch creation options alongside carrying. Carried changes go onto an independent branch
|
|
29
|
+
* that is named up front, since no engine step asks for the name; otherwise the engine asks for
|
|
30
|
+
* the branch's name and workflow type when it creates the branch.
|
|
30
31
|
*/
|
|
31
32
|
export declare const branchCreationOptionsWithCarrying: CommandOption[];
|
|
32
33
|
export declare const commitMessageOption: CommandOption;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ship-flow.d.ts","sourceRoot":"","sources":["../../../src/workflow/engine/ship-flow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAY1D,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,uBAAuB,EAAE,aAKrC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,aAInC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAE7E;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAE3E;AAED
|
|
1
|
+
{"version":3,"file":"ship-flow.d.ts","sourceRoot":"","sources":["../../../src/workflow/engine/ship-flow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAY1D,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,uBAAuB,EAAE,aAKrC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,aAInC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAE7E;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAE3E;AAED;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,EAAE,aAAa,EAI5D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,aAMjC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,aAA8D,CAAC;AAEvG;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,aAAa,EAOtC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,sFAAsF;IACtF,YAAY,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,oBAAoB,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CA0BxG;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,kBAAkB,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAsD5G;AAoCD;;;;;;;GAOG;AACH,wBAAsB,eAAe,CAAC,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAYnF"}
|
|
@@ -48,11 +48,12 @@ export function approvesAndMerges(resolved) {
|
|
|
48
48
|
return resolved[approveAndMergeOption.longName] === 'true';
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
|
-
* The branch creation options alongside carrying
|
|
52
|
-
*
|
|
51
|
+
* The branch creation options alongside carrying. Carried changes go onto an independent branch
|
|
52
|
+
* that is named up front, since no engine step asks for the name; otherwise the engine asks for
|
|
53
|
+
* the branch's name and workflow type when it creates the branch.
|
|
53
54
|
*/
|
|
54
|
-
export const branchCreationOptionsWithCarrying = branchCreationOptions.map(option => option.longName === '
|
|
55
|
-
? { ...option, dependsOn:
|
|
55
|
+
export const branchCreationOptionsWithCarrying = branchCreationOptions.map(option => option.longName === 'branch-name'
|
|
56
|
+
? { ...option, dependsOn: carriesLocalChanges }
|
|
56
57
|
: option);
|
|
57
58
|
export const commitMessageOption = {
|
|
58
59
|
longName: 'commit-message',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ship-flow.js","sourceRoot":"","sources":["../../../src/workfl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C9E,CAAC,uBAAuB,CAAC,QAAQ,CAAC,EAAE,MAAM;KAC3C,CAAC,CAAC;IAEH,MAAM,iBAAiB,CAAC,UAAU,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAC;AACxE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Command } from '../types/index.js';
|
|
2
|
-
/**
|
|
3
|
-
* Stage 1 of change management for an integration branch (change-management-policy.md clause 2):
|
|
4
|
-
* the work items merged into `working/integration/<name>-main` were each approved there by their
|
|
5
|
-
* assignee; this command carries the integration branch into the release branch through its own
|
|
6
|
-
* PR, assigned to its approver. The assignee approves by merging it - after the required CI/CD
|
|
7
|
-
* checks pass - with the same sequence and the same recorded admin override as `idea1 release`.
|
|
8
|
-
*
|
|
9
|
-
* Creating the PR and merging it are usually done by different people at different times, so
|
|
10
|
-
* the command reuses an open PR when one exists and the assignee runs it in `merge` mode.
|
|
11
|
-
*/
|
|
12
|
-
export declare const integrateCommand: Command;
|
|
13
|
-
//# sourceMappingURL=integrate.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"integrate.d.ts","sourceRoot":"","sources":["../../src/commands/integrate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AA6DjD;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,EAAE,OAuF9B,CAAC"}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { logger } from '../lib/logger.js';
|
|
2
|
-
import { promptInput, promptSelect } from '../lib/prompt.js';
|
|
3
|
-
import { resolveNamedList } from '../cli/named-lists.js';
|
|
4
|
-
import * as git from '../services/git.js';
|
|
5
|
-
import * as github from '../services/github.js';
|
|
6
|
-
import * as worktree from '../services/worktree.js';
|
|
7
|
-
import { INTEGRATION_KIND, PR_MODE_OPTION, createGatedPr, runPrMode, validateSourceBranch } from '../services/release-flow.js';
|
|
8
|
-
/**
|
|
9
|
-
* The integration branch to integrate: the one given, else the current branch when it is one,
|
|
10
|
-
* else a pick from the integration branches on origin.
|
|
11
|
-
*/
|
|
12
|
-
async function resolveIntegrationBranch(cliBranch) {
|
|
13
|
-
const integrationBranches = await worktree.listExistingIntegrationBranches();
|
|
14
|
-
if (cliBranch) {
|
|
15
|
-
if (!integrationBranches.includes(cliBranch)) {
|
|
16
|
-
throw new Error(`'${cliBranch}' is not an integration branch on origin.` +
|
|
17
|
-
(integrationBranches.length > 0 ? `\nIntegration branches: ${integrationBranches.join(', ')}` : ''));
|
|
18
|
-
}
|
|
19
|
-
return cliBranch;
|
|
20
|
-
}
|
|
21
|
-
const currentBranch = await git.getCurrentBranch();
|
|
22
|
-
if (integrationBranches.includes(currentBranch)) {
|
|
23
|
-
return currentBranch;
|
|
24
|
-
}
|
|
25
|
-
if (integrationBranches.length === 0) {
|
|
26
|
-
throw new Error('No integration branches exist on origin.');
|
|
27
|
-
}
|
|
28
|
-
return promptSelect('Which integration branch?', integrationBranches.map(branch => ({ label: branch, value: branch })));
|
|
29
|
-
}
|
|
30
|
-
async function promptAssignee() {
|
|
31
|
-
return promptSelect('Who approves this integration by merging its PR? (the approver of record)', await resolveNamedList('github-members'));
|
|
32
|
-
}
|
|
33
|
-
async function promptPrTitle(integrationBranch) {
|
|
34
|
-
const integrationName = await worktree.extractIntegrationName(integrationBranch);
|
|
35
|
-
const defaultTitle = `Integration ${integrationName} ${new Date().toISOString().split('T')[0]}`;
|
|
36
|
-
return promptInput('Enter PR title:', { default: defaultTitle });
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Stage 1 of change management for an integration branch (change-management-policy.md clause 2):
|
|
40
|
-
* the work items merged into `working/integration/<name>-main` were each approved there by their
|
|
41
|
-
* assignee; this command carries the integration branch into the release branch through its own
|
|
42
|
-
* PR, assigned to its approver. The assignee approves by merging it - after the required CI/CD
|
|
43
|
-
* checks pass - with the same sequence and the same recorded admin override as `idea1 release`.
|
|
44
|
-
*
|
|
45
|
-
* Creating the PR and merging it are usually done by different people at different times, so
|
|
46
|
-
* the command reuses an open PR when one exists and the assignee runs it in `merge` mode.
|
|
47
|
-
*/
|
|
48
|
-
export const integrateCommand = {
|
|
49
|
-
name: 'integrate',
|
|
50
|
-
aliases: ['int'],
|
|
51
|
-
description: 'Open the PR from an integration branch into the release branch, assigned to its approver, and (as the assignee) merge it once the checks pass',
|
|
52
|
-
options: [
|
|
53
|
-
{
|
|
54
|
-
longName: 'branch',
|
|
55
|
-
shortName: 'b',
|
|
56
|
-
description: 'Integration branch to integrate (default: the current branch, or a pick from origin)',
|
|
57
|
-
defaultValue: '',
|
|
58
|
-
promptWhenDefaultExists: false
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
longName: 'target',
|
|
62
|
-
shortName: 't',
|
|
63
|
-
description: 'Branch to integrate into (default: baseBranch)',
|
|
64
|
-
defaultValue: '',
|
|
65
|
-
promptWhenDefaultExists: false
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
longName: 'assignee',
|
|
69
|
-
shortName: 'a',
|
|
70
|
-
description: 'Who approves the integration by merging its PR - the approver of record (prompted when the PR is created)',
|
|
71
|
-
defaultValue: '',
|
|
72
|
-
promptWhenDefaultExists: false
|
|
73
|
-
},
|
|
74
|
-
PR_MODE_OPTION,
|
|
75
|
-
{
|
|
76
|
-
longName: 'title',
|
|
77
|
-
description: 'PR title',
|
|
78
|
-
defaultValue: '',
|
|
79
|
-
promptWhenDefaultExists: false
|
|
80
|
-
}
|
|
81
|
-
],
|
|
82
|
-
async execute(resolved) {
|
|
83
|
-
const branchArg = resolved['branch'] || undefined;
|
|
84
|
-
const targetArg = resolved['target'] || undefined;
|
|
85
|
-
const assigneeArg = resolved['assignee'] || undefined;
|
|
86
|
-
const prMode = resolved['pr-mode'];
|
|
87
|
-
const titleArg = resolved['title'] || undefined;
|
|
88
|
-
await github.ensureGitHubCli();
|
|
89
|
-
const integrationBranch = await resolveIntegrationBranch(branchArg);
|
|
90
|
-
const targetBranch = targetArg ?? await worktree.resolveBaseBranch();
|
|
91
|
-
logger.header(`Integration: ${integrationBranch} -> ${targetBranch}`);
|
|
92
|
-
logger.newline();
|
|
93
|
-
logger.info(`PR mode: ${prMode}`);
|
|
94
|
-
logger.newline();
|
|
95
|
-
const existingPr = await github.checkPrExists(integrationBranch, targetBranch);
|
|
96
|
-
let prUrl;
|
|
97
|
-
if (existingPr) {
|
|
98
|
-
logger.info(`Using the open PR #${existingPr.number}`);
|
|
99
|
-
prUrl = existingPr.url;
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
await validateSourceBranch(integrationBranch);
|
|
103
|
-
const assignee = assigneeArg ?? await promptAssignee();
|
|
104
|
-
const prTitle = titleArg ?? await promptPrTitle(integrationBranch);
|
|
105
|
-
logger.info(`Using title: ${prTitle}`);
|
|
106
|
-
logger.newline();
|
|
107
|
-
prUrl = await createGatedPr({
|
|
108
|
-
sourceBranch: integrationBranch,
|
|
109
|
-
targetBranch,
|
|
110
|
-
title: prTitle,
|
|
111
|
-
assignee,
|
|
112
|
-
kind: INTEGRATION_KIND
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
logger.newline();
|
|
116
|
-
await runPrMode({
|
|
117
|
-
mode: prMode,
|
|
118
|
-
sourceBranch: integrationBranch,
|
|
119
|
-
targetBranch,
|
|
120
|
-
prUrl,
|
|
121
|
-
kind: INTEGRATION_KIND,
|
|
122
|
-
openActionsAfterMerge: false
|
|
123
|
-
});
|
|
124
|
-
logger.newline();
|
|
125
|
-
logger.hint(`PR: ${prUrl}`);
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
//# sourceMappingURL=integrate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"integrate.js","sourceRoot":"","sources":["../../src/commands/integrate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,WAAW,EA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AAgB,OAAO,EAAE,CAAC,CAAC;YACvC,MAAM,CAAC,OAAO,EAAE,CAAC;YAEjB,KAAK,GAAG,MAAM,aAAa,CAAC;gBAC1B,YAAY,EAAE,iBAAiB;gBAC/B,YAAY;gBACZ,KAAK,EAAE,OAAO;gBACd,QAAQ;gBACR,IAAI,EAAE,gBAAgB;aACvB,CAAC,CAAC;QACL,CAAC;QACD,MAAM,CAAC,OAAO,EAAE,CAAC;QAEjB,MAAM,SAAS,CAAC;YACd,IAAI,EAAE,MAAM;YACZ,YAAY,EAAE,iBAAiB;YAC/B,YAAY;YACZ,KAAK;YACL,IAAI,EAAE,gBAAgB;YACtB,qBAAqB,EAAE,KAAK;SAC7B,CAAC,CAAC;QAEH,MAAM,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC;IAC9B,CAAC;CACF,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { Command, ClaudePermissionMode, ClaudeEffortLevel } from '../types/index.js';
|
|
2
|
-
export declare const VALID_PERMISSION_MODES: ClaudePermissionMode[];
|
|
3
|
-
export declare const VALID_EFFORT_LEVELS: ClaudeEffortLevel[];
|
|
4
|
-
export declare const WORKFLOW_CHOICES: {
|
|
5
|
-
label: string;
|
|
6
|
-
value: string;
|
|
7
|
-
}[];
|
|
8
|
-
export interface IntegrationBranchSelection {
|
|
9
|
-
integrationName: string;
|
|
10
|
-
integrationBranchName: string;
|
|
11
|
-
isNew: boolean;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Prompt the user whether to stack this branch on another and resolve the
|
|
15
|
-
* chosen stack branch. Prompt-only: performs no branch writes. Returns the
|
|
16
|
-
* resolved stack branch name, or null when the user opts not to stack.
|
|
17
|
-
* Shared by start-project-item and attach-project-item.
|
|
18
|
-
*/
|
|
19
|
-
export declare function promptForStackBranch(): Promise<string | null>;
|
|
20
|
-
/**
|
|
21
|
-
* Prompt the user for integration-branch selection. Prompt-only: does not
|
|
22
|
-
* perform any branch writes. Must be invoked before setWorkflowStatus so the
|
|
23
|
-
* user completes all setup questions up front.
|
|
24
|
-
*/
|
|
25
|
-
export declare function promptForIntegrationBranch(): Promise<IntegrationBranchSelection>;
|
|
26
|
-
export declare const startProjectItemCommand: Command;
|
|
27
|
-
//# sourceMappingURL=start-project-item.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"start-project-item.d.ts","sourceRoot":"","sources":["../../src/commands/start-project-item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,oBAAoB,EAAwB,iBAAiB,EAAkC,MAAM,mBAAmB,CAAC;AAUhJ,eAAO,MAAM,sBAAsB,EAAE,oBAAoB,EAAmF,CAAC;AAE7I,eAAO,MAAM,mBAAmB,EAAE,iBAAiB,EAA8C,CAAC;AAQlG,eAAO,MAAM,gBAAgB;;;GAG5B,CAAC;AAkBF,MAAM,WAAW,0BAA0B;IACzC,eAAe,EAAE,MAAM,CAAC;IACxB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA6BnE;AAED;;;;GAIG;AACH,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,0BAA0B,CAAC,CAoBtF;AAED,eAAO,MAAM,uBAAuB,EAAE,OAqLrC,CAAC"}
|
|
@@ -1,325 +0,0 @@
|
|
|
1
|
-
import { logger } from '../lib/logger.js';
|
|
2
|
-
import { promptInput, promptSelect } from '../lib/prompt.js';
|
|
3
|
-
import { isolationModeOption, resolveIsolationMode } from '../lib/isolation.js';
|
|
4
|
-
import * as git from '../services/git.js';
|
|
5
|
-
import * as claude from '../services/claude.js';
|
|
6
|
-
import * as worktree from '../services/worktree.js';
|
|
7
|
-
import { configService } from '../services/config.js';
|
|
8
|
-
import { isProjectItemUrl, validateProjectItemUrl } from '../lib/project-item-url.js';
|
|
9
|
-
export const VALID_PERMISSION_MODES = ['acceptEdits', 'bypassPermissions', 'default', 'delegate', 'dontAsk', 'plan'];
|
|
10
|
-
const VALID_ENTRY_POINT_MODES = ['launch', 'inline', 'none'];
|
|
11
|
-
export const VALID_EFFORT_LEVELS = ['low', 'medium', 'high', 'xhigh', 'max'];
|
|
12
|
-
const ENTRY_POINT_MODE_CHOICES = [
|
|
13
|
-
{ label: 'Launch new Claude session', value: 'launch' },
|
|
14
|
-
{ label: 'Output prompt for current Claude session', value: 'inline' },
|
|
15
|
-
{ label: 'Do not invoke Claude', value: 'none' }
|
|
16
|
-
];
|
|
17
|
-
export const WORKFLOW_CHOICES = [
|
|
18
|
-
{ label: 'Independent Feature', value: 'independent' },
|
|
19
|
-
{ label: 'Work for Integration', value: 'integration' }
|
|
20
|
-
];
|
|
21
|
-
const IMPLEMENT_AFTER_CREATE_CHOICES = [
|
|
22
|
-
{ label: 'Start implementing now', value: 'yes' },
|
|
23
|
-
{ label: 'Just set up the branch and automation (stop before Claude)', value: 'no' }
|
|
24
|
-
];
|
|
25
|
-
const STACK_CHOICES = [
|
|
26
|
-
{ label: 'No', value: 'no' },
|
|
27
|
-
{ label: 'Yes - specify a branch', value: 'branch' },
|
|
28
|
-
{ label: 'Yes - specify a project item URL', value: 'url' }
|
|
29
|
-
];
|
|
30
|
-
const INTEGRATION_BRANCH_CHOICES = [
|
|
31
|
-
{ label: 'Create new integration branch', value: 'new' },
|
|
32
|
-
{ label: 'Use existing integration branch', value: 'existing' }
|
|
33
|
-
];
|
|
34
|
-
/**
|
|
35
|
-
* Prompt the user whether to stack this branch on another and resolve the
|
|
36
|
-
* chosen stack branch. Prompt-only: performs no branch writes. Returns the
|
|
37
|
-
* resolved stack branch name, or null when the user opts not to stack.
|
|
38
|
-
* Shared by start-project-item and attach-project-item.
|
|
39
|
-
*/
|
|
40
|
-
export async function promptForStackBranch() {
|
|
41
|
-
const stackChoice = await promptSelect('Stack this branch on another?', STACK_CHOICES);
|
|
42
|
-
if (stackChoice === 'branch') {
|
|
43
|
-
const stackBranch = await promptInput('Branch to stack on');
|
|
44
|
-
if (!stackBranch) {
|
|
45
|
-
throw new Error('Stack branch is required when stacking');
|
|
46
|
-
}
|
|
47
|
-
const stackExists = await git.branchExists(stackBranch);
|
|
48
|
-
if (!stackExists) {
|
|
49
|
-
throw new Error(`Stack branch '${stackBranch}' does not exist locally or on origin`);
|
|
50
|
-
}
|
|
51
|
-
return stackBranch;
|
|
52
|
-
}
|
|
53
|
-
if (stackChoice === 'url') {
|
|
54
|
-
const stackUrl = await promptInput('Project item URL to stack on');
|
|
55
|
-
if (!stackUrl) {
|
|
56
|
-
throw new Error('Project item URL is required when stacking by URL');
|
|
57
|
-
}
|
|
58
|
-
const stackBranch = await git.resolveBranchFromProjectItemUrl(stackUrl);
|
|
59
|
-
if (!stackBranch) {
|
|
60
|
-
throw new Error(`No branch found for project item URL: ${stackUrl}. Make sure the project item has been started.`);
|
|
61
|
-
}
|
|
62
|
-
logger.info(`Resolved stack branch: ${stackBranch}`);
|
|
63
|
-
return stackBranch;
|
|
64
|
-
}
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Prompt the user for integration-branch selection. Prompt-only: does not
|
|
69
|
-
* perform any branch writes. Must be invoked before setWorkflowStatus so the
|
|
70
|
-
* user completes all setup questions up front.
|
|
71
|
-
*/
|
|
72
|
-
export async function promptForIntegrationBranch() {
|
|
73
|
-
const existingBranches = await worktree.listExistingIntegrationBranches();
|
|
74
|
-
const branchChoice = existingBranches.length > 0
|
|
75
|
-
? await promptSelect('Integration branch', INTEGRATION_BRANCH_CHOICES)
|
|
76
|
-
: 'new';
|
|
77
|
-
if (branchChoice === 'existing') {
|
|
78
|
-
const branchChoices = existingBranches.map(b => ({ label: b, value: b }));
|
|
79
|
-
const integrationBranchName = await promptSelect('Select integration branch', branchChoices);
|
|
80
|
-
const integrationName = await worktree.extractIntegrationName(integrationBranchName);
|
|
81
|
-
return { integrationName, integrationBranchName, isNew: false };
|
|
82
|
-
}
|
|
83
|
-
const integrationName = await promptInput('Integration name (e.g., my-cool-feature)');
|
|
84
|
-
if (!integrationName) {
|
|
85
|
-
throw new Error('Integration name is required');
|
|
86
|
-
}
|
|
87
|
-
const integrationBranchName = await worktree.buildIntegrationBranchName(integrationName);
|
|
88
|
-
return { integrationName, integrationBranchName, isNew: true };
|
|
89
|
-
}
|
|
90
|
-
export const startProjectItemCommand = {
|
|
91
|
-
name: 'start-project-item',
|
|
92
|
-
aliases: ['s', 'start'],
|
|
93
|
-
description: 'Start implementing a project item on a new branch, in a worktree or the main repo',
|
|
94
|
-
options: [
|
|
95
|
-
{
|
|
96
|
-
// Declared first so it's the very first thing prompted, before every
|
|
97
|
-
// other choice — later choices depend on whether it was provided.
|
|
98
|
-
longName: 'url',
|
|
99
|
-
description: 'Project item URL (leave blank to create a new item)',
|
|
100
|
-
defaultValue: '',
|
|
101
|
-
promptWhenDefaultExists: true,
|
|
102
|
-
// Allow blank (signals "create a new item"); validate format otherwise.
|
|
103
|
-
validate: (value) => (value ? validateProjectItemUrl(value) : undefined)
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
// Only prompted (and required) when no URL was given, i.e. the user is
|
|
107
|
-
// creating a new item. Declared after 'url' so it can read its value.
|
|
108
|
-
longName: 'title',
|
|
109
|
-
shortName: 't',
|
|
110
|
-
description: 'Title for the new project item',
|
|
111
|
-
dependsOn: (resolved) => !resolved['url'],
|
|
112
|
-
validate: (value) => value.trim() ? undefined : 'A title is required to create a project item'
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
// Only relevant when creating a new item. Declared after 'title' so it's
|
|
116
|
-
// asked once the item to create is named.
|
|
117
|
-
longName: 'implement-after-create',
|
|
118
|
-
shortName: 'ic',
|
|
119
|
-
description: 'After creating the new item, start implementing it now or just set up the branch?',
|
|
120
|
-
choices: IMPLEMENT_AFTER_CREATE_CHOICES,
|
|
121
|
-
dependsOn: (resolved) => !resolved['url'],
|
|
122
|
-
validate: (value) => value === 'yes' || value === 'no' ? undefined : 'Choose whether to start implementing'
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
longName: 'branch-name',
|
|
126
|
-
shortName: 'n',
|
|
127
|
-
description: 'Branch name (auto-generated if not provided)',
|
|
128
|
-
defaultValue: undefined,
|
|
129
|
-
promptWhenDefaultExists: true
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
longName: 'source-path',
|
|
133
|
-
shortName: 'p',
|
|
134
|
-
description: 'Path to source directory',
|
|
135
|
-
defaultValue: '',
|
|
136
|
-
promptWhenDefaultExists: false
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
longName: 'base-branch',
|
|
140
|
-
shortName: 'b',
|
|
141
|
-
description: 'Base branch',
|
|
142
|
-
defaultValue: () => configService.getDefaultBaseBranch(),
|
|
143
|
-
promptWhenDefaultExists: false
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
longName: 'permission-mode',
|
|
147
|
-
shortName: 'pm',
|
|
148
|
-
description: 'Claude permission mode',
|
|
149
|
-
defaultValue: 'plan',
|
|
150
|
-
promptWhenDefaultExists: true,
|
|
151
|
-
choices: VALID_PERMISSION_MODES.map(m => ({ label: m, value: m })),
|
|
152
|
-
validate: (value) => {
|
|
153
|
-
if (!VALID_PERMISSION_MODES.includes(value)) {
|
|
154
|
-
return `Must be one of: ${VALID_PERMISSION_MODES.join(', ')}`;
|
|
155
|
-
}
|
|
156
|
-
return undefined;
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
longName: 'workflow-type',
|
|
161
|
-
shortName: 'w',
|
|
162
|
-
description: 'Development workflow type',
|
|
163
|
-
defaultValue: undefined,
|
|
164
|
-
choices: WORKFLOW_CHOICES
|
|
165
|
-
},
|
|
166
|
-
isolationModeOption,
|
|
167
|
-
{
|
|
168
|
-
longName: 'effort',
|
|
169
|
-
shortName: 'e',
|
|
170
|
-
description: 'Claude effort level (reasoning depth)',
|
|
171
|
-
defaultValue: 'high',
|
|
172
|
-
promptWhenDefaultExists: true,
|
|
173
|
-
choices: VALID_EFFORT_LEVELS.map(l => ({ label: l, value: l })),
|
|
174
|
-
validate: (value) => {
|
|
175
|
-
if (!VALID_EFFORT_LEVELS.includes(value)) {
|
|
176
|
-
return `Must be one of: ${VALID_EFFORT_LEVELS.join(', ')}`;
|
|
177
|
-
}
|
|
178
|
-
return undefined;
|
|
179
|
-
}
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
longName: 'claude-entry-point',
|
|
183
|
-
shortName: 'im',
|
|
184
|
-
description: 'How to invoke Claude after setup',
|
|
185
|
-
defaultValue: 'launch',
|
|
186
|
-
promptWhenDefaultExists: false,
|
|
187
|
-
choices: ENTRY_POINT_MODE_CHOICES,
|
|
188
|
-
validate: (value) => {
|
|
189
|
-
if (!VALID_ENTRY_POINT_MODES.includes(value)) {
|
|
190
|
-
return `Must be one of: ${VALID_ENTRY_POINT_MODES.join(', ')}`;
|
|
191
|
-
}
|
|
192
|
-
return undefined;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
],
|
|
196
|
-
async execute(resolved) {
|
|
197
|
-
let projectItemUrl = resolved['url'];
|
|
198
|
-
const sourcePath = resolved['source-path'];
|
|
199
|
-
const baseBranch = resolved['base-branch'];
|
|
200
|
-
const permissionMode = resolved['permission-mode'];
|
|
201
|
-
const effort = (resolved['effort'] ?? 'high');
|
|
202
|
-
const workflowType = (resolved['workflow-type'] ?? 'independent');
|
|
203
|
-
const isolationMode = resolveIsolationMode(resolved);
|
|
204
|
-
let claudeEntryPointMode = (resolved['claude-entry-point'] ?? 'launch');
|
|
205
|
-
let shortBranchName = resolved['branch-name'] || undefined;
|
|
206
|
-
// Navigate to source path if provided
|
|
207
|
-
if (sourcePath) {
|
|
208
|
-
process.chdir(sourcePath);
|
|
209
|
-
}
|
|
210
|
-
// The URL is resolved up front (asked before any other choice). A blank
|
|
211
|
-
// value means the user wants to create a brand new item here; in that case
|
|
212
|
-
// the dependent 'title' and 'implement-after-create' options were also
|
|
213
|
-
// prompted and required.
|
|
214
|
-
if (!projectItemUrl) {
|
|
215
|
-
projectItemUrl = await claude.createProjectItem(resolved['title'].trim());
|
|
216
|
-
if (resolved['implement-after-create'] === 'no') {
|
|
217
|
-
// Stop before invoking Claude: set up the branch and all automation,
|
|
218
|
-
// but don't launch the implementation session.
|
|
219
|
-
claudeEntryPointMode = 'none';
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
// Validate URL format
|
|
223
|
-
if (!isProjectItemUrl(projectItemUrl)) {
|
|
224
|
-
logger.warning('URL does not appear to be an idea1.ai project item URL');
|
|
225
|
-
}
|
|
226
|
-
// Prompt for stack option (before MCP calls so all user questions are asked first)
|
|
227
|
-
const stackBranch = await promptForStackBranch();
|
|
228
|
-
// Collect integration-branch answers before the slow workflow status update,
|
|
229
|
-
// so every setup question is asked up front.
|
|
230
|
-
let integrationSelection = null;
|
|
231
|
-
if (workflowType === 'integration') {
|
|
232
|
-
integrationSelection = await promptForIntegrationBranch();
|
|
233
|
-
}
|
|
234
|
-
// Set workflow status to "Agent Implementation"
|
|
235
|
-
await claude.setWorkflowStatus(projectItemUrl, 'Agent Implementation');
|
|
236
|
-
// Generate branch name if not provided
|
|
237
|
-
if (!shortBranchName) {
|
|
238
|
-
shortBranchName = await claude.generateBranchName(projectItemUrl);
|
|
239
|
-
}
|
|
240
|
-
logger.info(`Using branch name: ${shortBranchName}`);
|
|
241
|
-
if (!shortBranchName) {
|
|
242
|
-
throw new Error('Failed to generate a branch name');
|
|
243
|
-
}
|
|
244
|
-
if (stackBranch) {
|
|
245
|
-
await git.ensureStackBranchReady(stackBranch);
|
|
246
|
-
}
|
|
247
|
-
if (workflowType === 'independent') {
|
|
248
|
-
await startIndependentFeature(projectItemUrl, shortBranchName, baseBranch, permissionMode, effort, claudeEntryPointMode, stackBranch, isolationMode);
|
|
249
|
-
}
|
|
250
|
-
else {
|
|
251
|
-
if (!integrationSelection) {
|
|
252
|
-
throw new Error('Integration selection was not collected');
|
|
253
|
-
}
|
|
254
|
-
await startWorkForIntegration(projectItemUrl, shortBranchName, baseBranch, permissionMode, effort, claudeEntryPointMode, stackBranch, integrationSelection, isolationMode);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
};
|
|
258
|
-
/**
|
|
259
|
-
* Start an Independent Feature workflow
|
|
260
|
-
*/
|
|
261
|
-
async function startIndependentFeature(projectItemUrl, shortBranchName, baseBranch, permissionMode, effort, claudeEntryPointMode, stackBranch, isolationMode) {
|
|
262
|
-
logger.section('Independent Feature Workflow');
|
|
263
|
-
// Resolve branch prefix
|
|
264
|
-
const branchPrefix = await worktree.resolveBranchPrefix();
|
|
265
|
-
// Determine which branch to base off of
|
|
266
|
-
const sourceBranch = stackBranch ?? baseBranch;
|
|
267
|
-
// PR always targets baseBranch for independent features
|
|
268
|
-
const prTargetBranch = baseBranch;
|
|
269
|
-
const fullBranchName = `${branchPrefix}/${shortBranchName}`;
|
|
270
|
-
if (stackBranch) {
|
|
271
|
-
logger.info(`Stacked workflow: branching from ${stackBranch}, PR will target ${baseBranch}`);
|
|
272
|
-
}
|
|
273
|
-
// Prepare branch
|
|
274
|
-
await worktree.prepareBranchForWorktreeWithFullName(fullBranchName, shortBranchName, sourceBranch, prTargetBranch);
|
|
275
|
-
// Store workflow state in git config
|
|
276
|
-
await git.storeWorkflowState('Agent Implementation', fullBranchName);
|
|
277
|
-
await git.storeDevWorkflowType('independent', fullBranchName);
|
|
278
|
-
if (stackBranch) {
|
|
279
|
-
await git.storeStackBranch(stackBranch, fullBranchName);
|
|
280
|
-
}
|
|
281
|
-
await worktree.setupBranchEnvironment(isolationMode, fullBranchName, shortBranchName, prTargetBranch, {
|
|
282
|
-
projectItemUrl,
|
|
283
|
-
permissionMode,
|
|
284
|
-
effort,
|
|
285
|
-
claudeEntryPointMode
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* Start a Work for Integration workflow
|
|
290
|
-
*/
|
|
291
|
-
async function startWorkForIntegration(projectItemUrl, shortBranchName, baseBranch, permissionMode, effort, claudeEntryPointMode, stackBranch, integrationSelection, isolationMode) {
|
|
292
|
-
logger.section('Work for Integration Workflow');
|
|
293
|
-
const { integrationName, integrationBranchName, isNew } = integrationSelection;
|
|
294
|
-
if (isNew) {
|
|
295
|
-
// Create the integration branch from baseBranch if it doesn't exist.
|
|
296
|
-
// Runs after setWorkflowStatus so the slow remote write is not blocking user prompts.
|
|
297
|
-
await worktree.ensureIntegrationBranch(integrationBranchName, baseBranch);
|
|
298
|
-
}
|
|
299
|
-
logger.info(`Integration branch: ${integrationBranchName}`);
|
|
300
|
-
// For integration workflow, the integration branch acts as the base for PRs
|
|
301
|
-
const prTargetBranch = integrationBranchName;
|
|
302
|
-
// Determine which branch to base off of
|
|
303
|
-
const sourceBranch = stackBranch ?? integrationBranchName;
|
|
304
|
-
// Build the full work branch name using integration template
|
|
305
|
-
const fullBranchName = await worktree.buildIntegrationWorkBranchName(integrationName, shortBranchName);
|
|
306
|
-
if (stackBranch) {
|
|
307
|
-
logger.info(`Stacked workflow: branching from ${stackBranch}, PR will target ${integrationBranchName}`);
|
|
308
|
-
}
|
|
309
|
-
// Prepare branch
|
|
310
|
-
await worktree.prepareBranchForWorktreeWithFullName(fullBranchName, shortBranchName, sourceBranch, prTargetBranch);
|
|
311
|
-
// Store workflow state in git config
|
|
312
|
-
await git.storeWorkflowState('Agent Implementation', fullBranchName);
|
|
313
|
-
await git.storeDevWorkflowType('integration', fullBranchName);
|
|
314
|
-
await git.storeIntegrationBranch(integrationBranchName, fullBranchName);
|
|
315
|
-
if (stackBranch) {
|
|
316
|
-
await git.storeStackBranch(stackBranch, fullBranchName);
|
|
317
|
-
}
|
|
318
|
-
await worktree.setupBranchEnvironment(isolationMode, fullBranchName, shortBranchName, prTargetBranch, {
|
|
319
|
-
projectItemUrl,
|
|
320
|
-
permissionMode,
|
|
321
|
-
effort,
|
|
322
|
-
claudeEntryPointMode
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
//# sourceMappingURL=start-project-item.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"start-project-item.js","sourceRoot":"","sources":["../../src/commands/start-project-item.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEtF,MAAM,CAAC,MAAM,sBAAsB,GAA2B,CAAC,aAAa,EAAE,mBAAmB,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AAC7I,MAAM,uBAAuB,GAA2B,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AACrF,MAAM,CAAC,MAAM,mBAAmB,GAAwB,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAElG,MAAM,wBAAwB,GAAG;IAC/B,EAAE,KAAK,EAAE,2BAA2B,EAAE,KAAK,EAAE,QAAQ,EAAE;IACvD,EAAE,KAAK,EAAE,0CAA0C,EAAE,KAAK,EAAE,QAAQ,EAAE;IACtE,EAAE,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,EAAE;CACjD,CAAC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ts","sourceRoot":"","sources":["../../src/services/hooks.ts"],"names":[],"mappings":"AAoDA;;GAEG;AACH,wBAAsB,OAAO,CAC3B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAqCjD"}
|
package/dist/services/hooks.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
import { promptSelect, promptInput } from '../lib/prompt.js';
|
|
3
|
-
import { logger } from '../lib/logger.js';
|
|
4
|
-
import { execWithOutput, resolveBash, flushStdout } from '../lib/shell.js';
|
|
5
|
-
import { readSettings } from '../lib/settings.js';
|
|
6
|
-
/**
|
|
7
|
-
* Normalize a hook to HookConfig format
|
|
8
|
-
*/
|
|
9
|
-
function normalizeHook(hook) {
|
|
10
|
-
if (typeof hook === 'string') {
|
|
11
|
-
return { command: hook, inputs: [] };
|
|
12
|
-
}
|
|
13
|
-
return hook;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Collect inputs from user based on hook configuration
|
|
17
|
-
*/
|
|
18
|
-
async function collectHookInputs(inputs) {
|
|
19
|
-
const collected = {};
|
|
20
|
-
for (const input of inputs) {
|
|
21
|
-
if (input.type === 'select' && input.choices) {
|
|
22
|
-
collected[input.name] = await promptSelect(input.label, input.choices, { default: input.default });
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
collected[input.name] = await promptInput(input.label, { default: input.default });
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return collected;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Build command arguments from collected inputs
|
|
32
|
-
*/
|
|
33
|
-
function buildHookArgs(inputs) {
|
|
34
|
-
const args = [];
|
|
35
|
-
for (const [name, value] of Object.entries(inputs)) {
|
|
36
|
-
args.push(`--${name}`, value);
|
|
37
|
-
}
|
|
38
|
-
return args;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Run a hook with input collection
|
|
42
|
-
*/
|
|
43
|
-
export async function runHook(hookName, repoRoot) {
|
|
44
|
-
const settings = await readSettings(repoRoot);
|
|
45
|
-
const hook = settings?.hooks?.[hookName];
|
|
46
|
-
if (!hook) {
|
|
47
|
-
logger.dim(`No ${hookName} hook defined`);
|
|
48
|
-
return { success: true, skipped: true };
|
|
49
|
-
}
|
|
50
|
-
const config = normalizeHook(hook);
|
|
51
|
-
// Collect inputs if any
|
|
52
|
-
let args = [];
|
|
53
|
-
if (config.inputs && config.inputs.length > 0) {
|
|
54
|
-
logger.newline();
|
|
55
|
-
const inputs = await collectHookInputs(config.inputs);
|
|
56
|
-
args = buildHookArgs(inputs);
|
|
57
|
-
}
|
|
58
|
-
// Determine working directory (default to repo root)
|
|
59
|
-
const hookCwd = config.cwd ? path.join(repoRoot, config.cwd) : repoRoot;
|
|
60
|
-
logger.step(`Running ${hookName} hook: ${config.command}`);
|
|
61
|
-
const bash = resolveBash();
|
|
62
|
-
const exitCode = await execWithOutput(bash, [config.command, ...args], { cwd: hookCwd });
|
|
63
|
-
// Ensure terminal is ready before continuing with interactive prompts
|
|
64
|
-
await flushStdout();
|
|
65
|
-
if (exitCode !== 0) {
|
|
66
|
-
logger.error(`${hookName} hook failed with exit code ${exitCode}`);
|
|
67
|
-
return { success: false, skipped: false };
|
|
68
|
-
}
|
|
69
|
-
logger.success(`${hookName} hook completed`);
|
|
70
|
-
return { success: true, skipped: false };
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=hooks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/services/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB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,CAAC;IAEzF,sEAAsE;IACtE,MAAM,WAAW,EAAE,CAAC;IAEpB,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACnB,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,+BAA+B,QAAQ,EAAE,CAAC,CAAC;QACnE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5C,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,GAAG,QAAQ,iBAAiB,CAAC,CAAC;IAC7C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC3C,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { WorkflowState, PrInfo } from '../types/index.js';
|
|
2
|
-
/**
|
|
3
|
-
* Get comprehensive workflow status for the current branch: the item it implements, the item's
|
|
4
|
-
* state and the branch record, from the platform (see `workflow-branch`). A branch this clone has
|
|
5
|
-
* never resolved as an item's is reported as unmanaged without a platform read, so the interactive
|
|
6
|
-
* header is instant on ordinary branches.
|
|
7
|
-
*/
|
|
8
|
-
export declare function getWorkflowStatus(options?: {
|
|
9
|
-
includePrInfo?: boolean;
|
|
10
|
-
}): Promise<{
|
|
11
|
-
branch: string;
|
|
12
|
-
baseBranch: string | null;
|
|
13
|
-
projectItemUrl: string | null;
|
|
14
|
-
workflowState: WorkflowState | null;
|
|
15
|
-
prInfo: PrInfo | null;
|
|
16
|
-
}>;
|
|
17
|
-
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/services/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAM/D;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,CAAC,EAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC;IACtF,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;IACpC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC,CA4BD"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import * as git from './git.js';
|
|
2
|
-
import * as github from './github.js';
|
|
3
|
-
import * as workflowBranch from './workflow-branch.js';
|
|
4
|
-
import { normalizeWorkflowState } from '../lib/workflow-states.js';
|
|
5
|
-
/**
|
|
6
|
-
* Get comprehensive workflow status for the current branch: the item it implements, the item's
|
|
7
|
-
* state and the branch record, from the platform (see `workflow-branch`). A branch this clone has
|
|
8
|
-
* never resolved as an item's is reported as unmanaged without a platform read, so the interactive
|
|
9
|
-
* header is instant on ordinary branches.
|
|
10
|
-
*/
|
|
11
|
-
export async function getWorkflowStatus(options) {
|
|
12
|
-
let branch = '';
|
|
13
|
-
try {
|
|
14
|
-
branch = await git.getCurrentBranch();
|
|
15
|
-
}
|
|
16
|
-
catch {
|
|
17
|
-
// Not in a repository
|
|
18
|
-
}
|
|
19
|
-
const context = branch && branch !== 'HEAD' && await workflowBranch.getRememberedProjectItemUrl(branch)
|
|
20
|
-
? await workflowBranch.getBranchContext(branch).catch(() => null)
|
|
21
|
-
: null;
|
|
22
|
-
let prInfo = null;
|
|
23
|
-
if (options?.includePrInfo !== false && branch) {
|
|
24
|
-
try {
|
|
25
|
-
prInfo = await github.getPrInfo(branch);
|
|
26
|
-
}
|
|
27
|
-
catch {
|
|
28
|
-
// Ignore error, prInfo will be null
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return {
|
|
32
|
-
branch,
|
|
33
|
-
baseBranch: context?.branch?.baseBranch ?? null,
|
|
34
|
-
projectItemUrl: context?.projectItem.url ?? null,
|
|
35
|
-
workflowState: normalizeWorkflowState(context?.projectItem.workflowStatus),
|
|
36
|
-
prInfo
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=workflow.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../src/services/workflow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAAqC;IAO3E,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,GAAG,CAAC,gBAAgB,EAAE,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,sBAAsB;IACxB,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,cAAc,CAAC,2BAA2B,CAAC,MAAM,CAAC;QACrG,CAAC,CAAC,MAAM,cAAc,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;QACjE,CAAC,CAAC,IAAI,CAAC;IAET,IAAI,MAAM,GAAkB,IAAI,CAAC;IACjC,IAAI,OAAO,EAAE,aAAa,KAAK,KAAK,IAAI,MAAM,EAAE,CAAC;QAC/C,IAAI,CAAC;YACH,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC1C,CAAC;QAAC,MAAM,CAAC;YACP,oCAAoC;QACtC,CAAC;IACH,CAAC;IAED,OAAO;QACL,MAAM;QACN,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,IAAI,IAAI;QAC/C,cAAc,EAAE,OAAO,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