@specship/specship-win32-arm64 0.13.0 → 0.14.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/lib/dist/bin/specship.js +180 -1
- package/lib/dist/bin/specship.js.map +1 -1
- package/lib/dist/jira/auth.d.ts +17 -0
- package/lib/dist/jira/auth.d.ts.map +1 -0
- package/lib/dist/jira/auth.js +33 -0
- package/lib/dist/jira/auth.js.map +1 -0
- package/lib/dist/jira/client.d.ts +120 -0
- package/lib/dist/jira/client.d.ts.map +1 -0
- package/lib/dist/jira/client.js +316 -0
- package/lib/dist/jira/client.js.map +1 -0
- package/lib/dist/jira/config.d.ts +45 -0
- package/lib/dist/jira/config.d.ts.map +1 -0
- package/lib/dist/jira/config.js +178 -0
- package/lib/dist/jira/config.js.map +1 -0
- package/lib/dist/jira/index.d.ts +8 -0
- package/lib/dist/jira/index.d.ts.map +1 -0
- package/lib/dist/jira/index.js +24 -0
- package/lib/dist/jira/index.js.map +1 -0
- package/lib/dist/jira/pull-request.d.ts +72 -0
- package/lib/dist/jira/pull-request.d.ts.map +1 -0
- package/lib/dist/jira/pull-request.js +127 -0
- package/lib/dist/jira/pull-request.js.map +1 -0
- package/lib/dist/jira/spec-generator.d.ts +34 -0
- package/lib/dist/jira/spec-generator.d.ts.map +1 -0
- package/lib/dist/jira/spec-generator.js +138 -0
- package/lib/dist/jira/spec-generator.js.map +1 -0
- package/lib/dist/jira/spec-writer.d.ts +36 -0
- package/lib/dist/jira/spec-writer.d.ts.map +1 -0
- package/lib/dist/jira/spec-writer.js +143 -0
- package/lib/dist/jira/spec-writer.js.map +1 -0
- package/lib/dist/jira/types.d.ts +174 -0
- package/lib/dist/jira/types.d.ts.map +1 -0
- package/lib/dist/jira/types.js +60 -0
- package/lib/dist/jira/types.js.map +1 -0
- package/lib/dist/mcp/jira-tools.d.ts +234 -0
- package/lib/dist/mcp/jira-tools.d.ts.map +1 -0
- package/lib/dist/mcp/jira-tools.js +787 -0
- package/lib/dist/mcp/jira-tools.js.map +1 -0
- package/lib/dist/mcp/server-instructions.d.ts +1 -1
- package/lib/dist/mcp/server-instructions.d.ts.map +1 -1
- package/lib/dist/mcp/server-instructions.js +10 -0
- package/lib/dist/mcp/server-instructions.js.map +1 -1
- package/lib/dist/mcp/tools.d.ts.map +1 -1
- package/lib/dist/mcp/tools.js +32 -0
- package/lib/dist/mcp/tools.js.map +1 -1
- package/lib/dist/server/cli.js +1 -1
- package/lib/dist/server/routes/sse.js +1 -1
- package/lib/dist/server/server.js +1 -1
- package/lib/dist/statusline/index.d.ts +19 -0
- package/lib/dist/statusline/index.d.ts.map +1 -1
- package/lib/dist/statusline/index.js +96 -3
- package/lib/dist/statusline/index.js.map +1 -1
- package/lib/dist/statusline/render.d.ts +24 -0
- package/lib/dist/statusline/render.d.ts.map +1 -1
- package/lib/dist/statusline/render.js +26 -5
- package/lib/dist/statusline/render.js.map +1 -1
- package/lib/dist/workflows/executor.d.ts +25 -1
- package/lib/dist/workflows/executor.d.ts.map +1 -1
- package/lib/dist/workflows/executor.js +28 -3
- package/lib/dist/workflows/executor.js.map +1 -1
- package/lib/node_modules/.package-lock.json +11 -20
- package/lib/node_modules/ajv/node_modules/fast-uri/index.js +1 -1
- package/lib/node_modules/ajv/node_modules/fast-uri/package.json +1 -1
- package/lib/node_modules/ajv/node_modules/fast-uri/test/security.test.js +28 -0
- package/lib/node_modules/toad-cache/README.md +10 -9
- package/lib/node_modules/toad-cache/dist/toad-cache.cjs +139 -139
- package/lib/node_modules/toad-cache/dist/toad-cache.mjs +136 -140
- package/lib/node_modules/toad-cache/package.json +8 -8
- package/lib/node_modules/toad-cache/toad-cache.d.cts +20 -14
- package/lib/node_modules/toad-cache/toad-cache.d.ts +18 -14
- package/lib/node_modules/yaml/README.md +14 -31
- package/lib/node_modules/yaml/browser/dist/compose/compose-collection.js +3 -3
- package/lib/node_modules/yaml/browser/dist/compose/compose-doc.js +0 -1
- package/lib/node_modules/yaml/browser/dist/compose/compose-node.js +4 -21
- package/lib/node_modules/yaml/browser/dist/compose/compose-scalar.js +8 -14
- package/lib/node_modules/yaml/browser/dist/compose/composer.js +2 -4
- package/lib/node_modules/yaml/browser/dist/compose/resolve-block-map.js +0 -2
- package/lib/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +1 -3
- package/lib/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +2 -8
- package/lib/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +4 -6
- package/lib/node_modules/yaml/browser/dist/compose/resolve-props.js +5 -3
- package/lib/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +2 -1
- package/lib/node_modules/yaml/browser/dist/compose/util-map-includes.js +5 -1
- package/lib/node_modules/yaml/browser/dist/doc/Document.js +2 -3
- package/lib/node_modules/yaml/browser/dist/doc/anchors.js +2 -1
- package/lib/node_modules/yaml/browser/dist/doc/applyReviver.js +0 -1
- package/lib/node_modules/yaml/browser/dist/doc/createNode.js +2 -1
- package/lib/node_modules/yaml/browser/dist/errors.js +1 -1
- package/lib/node_modules/yaml/browser/dist/log.js +6 -1
- package/lib/node_modules/yaml/browser/dist/node_modules/tslib/tslib.es6.js +21 -0
- package/lib/node_modules/yaml/browser/dist/nodes/Alias.js +12 -27
- package/lib/node_modules/yaml/browser/dist/nodes/YAMLMap.js +1 -1
- package/lib/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +49 -8
- package/lib/node_modules/yaml/browser/dist/parse/lexer.js +24 -28
- package/lib/node_modules/yaml/browser/dist/parse/parser.js +8 -31
- package/lib/node_modules/yaml/browser/dist/public-api.js +0 -3
- package/lib/node_modules/yaml/browser/dist/schema/Schema.js +2 -1
- package/lib/node_modules/yaml/browser/dist/schema/json/schema.js +1 -1
- package/lib/node_modules/yaml/browser/dist/schema/tags.js +16 -29
- package/lib/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +13 -5
- package/lib/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +1 -1
- package/lib/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +0 -2
- package/lib/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +1 -1
- package/lib/node_modules/yaml/browser/dist/stringify/stringify.js +5 -10
- package/lib/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +3 -13
- package/lib/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +2 -3
- package/lib/node_modules/yaml/browser/dist/stringify/stringifyPair.js +1 -1
- package/lib/node_modules/yaml/browser/dist/stringify/stringifyString.js +16 -24
- package/lib/node_modules/yaml/browser/dist/util.js +1 -1
- package/lib/node_modules/yaml/dist/cli.d.ts +1 -1
- package/lib/node_modules/yaml/dist/cli.mjs +3 -5
- package/lib/node_modules/yaml/dist/compose/compose-collection.d.ts +4 -4
- package/lib/node_modules/yaml/dist/compose/compose-collection.js +3 -3
- package/lib/node_modules/yaml/dist/compose/compose-doc.d.ts +6 -6
- package/lib/node_modules/yaml/dist/compose/compose-doc.js +0 -1
- package/lib/node_modules/yaml/dist/compose/compose-node.d.ts +7 -8
- package/lib/node_modules/yaml/dist/compose/compose-node.js +4 -21
- package/lib/node_modules/yaml/dist/compose/compose-scalar.d.ts +4 -4
- package/lib/node_modules/yaml/dist/compose/compose-scalar.js +7 -13
- package/lib/node_modules/yaml/dist/compose/composer.d.ts +6 -7
- package/lib/node_modules/yaml/dist/compose/composer.js +3 -6
- package/lib/node_modules/yaml/dist/compose/resolve-block-map.d.ts +5 -5
- package/lib/node_modules/yaml/dist/compose/resolve-block-map.js +0 -2
- package/lib/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +5 -5
- package/lib/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +5 -5
- package/lib/node_modules/yaml/dist/compose/resolve-block-seq.js +1 -3
- package/lib/node_modules/yaml/dist/compose/resolve-end.d.ts +2 -2
- package/lib/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -7
- package/lib/node_modules/yaml/dist/compose/resolve-flow-collection.js +2 -8
- package/lib/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +4 -4
- package/lib/node_modules/yaml/dist/compose/resolve-flow-scalar.js +4 -6
- package/lib/node_modules/yaml/dist/compose/resolve-props.d.ts +2 -2
- package/lib/node_modules/yaml/dist/compose/resolve-props.js +5 -3
- package/lib/node_modules/yaml/dist/compose/util-contains-newline.d.ts +1 -1
- package/lib/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +1 -1
- package/lib/node_modules/yaml/dist/compose/util-empty-scalar-position.js +2 -1
- package/lib/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +2 -2
- package/lib/node_modules/yaml/dist/compose/util-map-includes.d.ts +3 -3
- package/lib/node_modules/yaml/dist/compose/util-map-includes.js +5 -1
- package/lib/node_modules/yaml/dist/doc/Document.d.ts +11 -11
- package/lib/node_modules/yaml/dist/doc/Document.js +2 -3
- package/lib/node_modules/yaml/dist/doc/anchors.d.ts +2 -2
- package/lib/node_modules/yaml/dist/doc/anchors.js +2 -1
- package/lib/node_modules/yaml/dist/doc/applyReviver.js +0 -1
- package/lib/node_modules/yaml/dist/doc/createNode.d.ts +4 -4
- package/lib/node_modules/yaml/dist/doc/createNode.js +2 -1
- package/lib/node_modules/yaml/dist/doc/directives.d.ts +1 -1
- package/lib/node_modules/yaml/dist/errors.d.ts +1 -1
- package/lib/node_modules/yaml/dist/errors.js +1 -1
- package/lib/node_modules/yaml/dist/index.d.ts +18 -21
- package/lib/node_modules/yaml/dist/log.js +4 -4
- package/lib/node_modules/yaml/dist/nodes/Alias.d.ts +9 -10
- package/lib/node_modules/yaml/dist/nodes/Alias.js +11 -26
- package/lib/node_modules/yaml/dist/nodes/Collection.d.ts +4 -4
- package/lib/node_modules/yaml/dist/nodes/Node.d.ts +9 -16
- package/lib/node_modules/yaml/dist/nodes/Pair.d.ts +8 -9
- package/lib/node_modules/yaml/dist/nodes/Scalar.d.ts +4 -9
- package/lib/node_modules/yaml/dist/nodes/YAMLMap.d.ts +10 -10
- package/lib/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +10 -10
- package/lib/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +3 -3
- package/lib/node_modules/yaml/dist/nodes/addPairToJSMap.js +48 -7
- package/lib/node_modules/yaml/dist/nodes/identity.d.ts +7 -7
- package/lib/node_modules/yaml/dist/nodes/toJS.d.ts +2 -4
- package/lib/node_modules/yaml/dist/options.d.ts +10 -22
- package/lib/node_modules/yaml/dist/parse/cst-scalar.d.ts +4 -4
- package/lib/node_modules/yaml/dist/parse/cst-stringify.d.ts +1 -1
- package/lib/node_modules/yaml/dist/parse/cst-visit.d.ts +2 -2
- package/lib/node_modules/yaml/dist/parse/cst.d.ts +3 -4
- package/lib/node_modules/yaml/dist/parse/lexer.d.ts +1 -1
- package/lib/node_modules/yaml/dist/parse/lexer.js +24 -28
- package/lib/node_modules/yaml/dist/parse/parser.d.ts +4 -4
- package/lib/node_modules/yaml/dist/parse/parser.js +9 -33
- package/lib/node_modules/yaml/dist/public-api.d.ts +5 -6
- package/lib/node_modules/yaml/dist/public-api.js +0 -3
- package/lib/node_modules/yaml/dist/schema/Schema.d.ts +5 -4
- package/lib/node_modules/yaml/dist/schema/Schema.js +2 -1
- package/lib/node_modules/yaml/dist/schema/common/map.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/common/null.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/common/seq.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/common/string.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/core/bool.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/core/float.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/core/int.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/core/schema.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/json/schema.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/json/schema.js +1 -1
- package/lib/node_modules/yaml/dist/schema/tags.d.ts +3 -11
- package/lib/node_modules/yaml/dist/schema/tags.js +13 -26
- package/lib/node_modules/yaml/dist/schema/types.d.ts +12 -14
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/binary.js +7 -9
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +17 -11
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +7 -7
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/schema.js +0 -2
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +9 -9
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +1 -1
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +1 -1
- package/lib/node_modules/yaml/dist/stringify/stringify.d.ts +3 -3
- package/lib/node_modules/yaml/dist/stringify/stringify.js +5 -10
- package/lib/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +2 -2
- package/lib/node_modules/yaml/dist/stringify/stringifyCollection.js +3 -13
- package/lib/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +3 -3
- package/lib/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +1 -1
- package/lib/node_modules/yaml/dist/stringify/stringifyNumber.js +2 -3
- package/lib/node_modules/yaml/dist/stringify/stringifyPair.d.ts +2 -2
- package/lib/node_modules/yaml/dist/stringify/stringifyPair.js +1 -1
- package/lib/node_modules/yaml/dist/stringify/stringifyString.d.ts +2 -2
- package/lib/node_modules/yaml/dist/stringify/stringifyString.js +15 -23
- package/lib/node_modules/yaml/dist/util.d.ts +12 -16
- package/lib/node_modules/yaml/dist/util.js +2 -2
- package/lib/node_modules/yaml/dist/visit.d.ts +7 -7
- package/lib/node_modules/yaml/package.json +14 -13
- package/lib/package.json +5 -6
- package/package.json +1 -1
- package/lib/node_modules/jsonc-parser/CHANGELOG.md +0 -76
- package/lib/node_modules/jsonc-parser/LICENSE.md +0 -21
- package/lib/node_modules/jsonc-parser/README.md +0 -364
- package/lib/node_modules/jsonc-parser/SECURITY.md +0 -41
- package/lib/node_modules/jsonc-parser/lib/esm/impl/edit.js +0 -185
- package/lib/node_modules/jsonc-parser/lib/esm/impl/format.js +0 -261
- package/lib/node_modules/jsonc-parser/lib/esm/impl/parser.js +0 -659
- package/lib/node_modules/jsonc-parser/lib/esm/impl/scanner.js +0 -443
- package/lib/node_modules/jsonc-parser/lib/esm/impl/string-intern.js +0 -29
- package/lib/node_modules/jsonc-parser/lib/esm/main.d.ts +0 -351
- package/lib/node_modules/jsonc-parser/lib/esm/main.js +0 -178
- package/lib/node_modules/jsonc-parser/lib/umd/impl/edit.js +0 -201
- package/lib/node_modules/jsonc-parser/lib/umd/impl/format.js +0 -275
- package/lib/node_modules/jsonc-parser/lib/umd/impl/parser.js +0 -682
- package/lib/node_modules/jsonc-parser/lib/umd/impl/scanner.js +0 -456
- package/lib/node_modules/jsonc-parser/lib/umd/impl/string-intern.js +0 -42
- package/lib/node_modules/jsonc-parser/lib/umd/main.d.ts +0 -351
- package/lib/node_modules/jsonc-parser/lib/umd/main.js +0 -194
- package/lib/node_modules/jsonc-parser/package.json +0 -37
- package/lib/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +0 -67
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +0 -9
- package/lib/node_modules/yaml/dist/schema/yaml-1.1/merge.js +0 -71
package/lib/dist/bin/specship.js
CHANGED
|
@@ -2699,11 +2699,21 @@ function main() {
|
|
|
2699
2699
|
const { discoverWorkflows, loadWorkflowByName } = await Promise.resolve().then(() => __importStar(require('../workflows/discovery')));
|
|
2700
2700
|
const { WorkflowExecutor } = await Promise.resolve().then(() => __importStar(require('../workflows/executor')));
|
|
2701
2701
|
const { WorktreeProvider } = await Promise.resolve().then(() => __importStar(require('../isolation/worktree')));
|
|
2702
|
+
const { handleJiraRunCompletion } = await Promise.resolve().then(() => __importStar(require('../mcp/jira-tools')));
|
|
2702
2703
|
const cg = await SpecShip.open(projectRoot);
|
|
2703
2704
|
try {
|
|
2704
2705
|
const specQueries = cg.getSpecQueries();
|
|
2705
2706
|
const worktrees = new WorktreeProvider(specQueries);
|
|
2706
|
-
|
|
2707
|
+
// On completion, a JIRA-started run raises its PR (REQ-JIRA-006); the hook
|
|
2708
|
+
// is a silent no-op for any run without `metadata.jira`.
|
|
2709
|
+
const executor = new WorkflowExecutor(specQueries, worktrees, projectRoot, async (run) => {
|
|
2710
|
+
await handleJiraRunCompletion(run, {
|
|
2711
|
+
getIsolationEnvById: (id) => specQueries.getIsolationEnvById(id),
|
|
2712
|
+
projectRoot,
|
|
2713
|
+
// eslint-disable-next-line no-console
|
|
2714
|
+
log: (m) => console.log(m),
|
|
2715
|
+
});
|
|
2716
|
+
});
|
|
2707
2717
|
switch (action) {
|
|
2708
2718
|
case 'list': {
|
|
2709
2719
|
const result = discoverWorkflows(projectRoot);
|
|
@@ -2928,6 +2938,175 @@ function main() {
|
|
|
2928
2938
|
if (result.exitCode !== 0)
|
|
2929
2939
|
process.exit(result.exitCode);
|
|
2930
2940
|
});
|
|
2941
|
+
/**
|
|
2942
|
+
* specship jira — connect SpecShip to a JIRA instance (REQ-JIRA-001).
|
|
2943
|
+
*
|
|
2944
|
+
* Two subcommands:
|
|
2945
|
+
* - `configure` — collect base URL + credentials, infer the deployment,
|
|
2946
|
+
* save to `~/.specship/jira.json` (0600, user-level only), then probe.
|
|
2947
|
+
* - `test` — resolve the stored/env credentials and probe `/myself`.
|
|
2948
|
+
*
|
|
2949
|
+
* SECURITY: the token/PAT is NEVER echoed — not in a confirmation, not in
|
|
2950
|
+
* `test` output, not in an error message. On success we print only
|
|
2951
|
+
* "connected as <displayName>". Errors from the jira module are already
|
|
2952
|
+
* scrubbed of secrets (REQ-JIRA-009 builds on this).
|
|
2953
|
+
*/
|
|
2954
|
+
const jira = program
|
|
2955
|
+
.command('jira')
|
|
2956
|
+
.description('Connect SpecShip to a JIRA instance (Cloud or Data Center).');
|
|
2957
|
+
jira
|
|
2958
|
+
.command('configure')
|
|
2959
|
+
.description('Save JIRA credentials to ~/.specship/jira.json (0600) and test the connection.')
|
|
2960
|
+
.option('--base-url <url>', 'JIRA base URL, e.g. https://acme.atlassian.net')
|
|
2961
|
+
.option('--email <email>', 'Cloud: account email (paired with --api-token)')
|
|
2962
|
+
.option('--api-token <token>', 'Cloud: API token (paired with --email)')
|
|
2963
|
+
.option('--pat <token>', 'Data Center: personal access token')
|
|
2964
|
+
.option('--deployment <kind>', 'Deployment kind: "cloud" or "datacenter" (inferred if omitted)')
|
|
2965
|
+
.action(async (opts) => {
|
|
2966
|
+
const { saveJiraConfig, resolveJiraCredentials, inferDeployment, jiraConfigPath, JiraClient, JiraAuthError, } = await Promise.resolve().then(() => __importStar(require('../jira')));
|
|
2967
|
+
const clack = await importESM('@clack/prompts');
|
|
2968
|
+
const cancelled = (v) => clack.isCancel(v);
|
|
2969
|
+
// Fully-flagged (non-interactive) path: base URL + a complete credential set.
|
|
2970
|
+
const flagged = Boolean(opts.baseUrl && (opts.pat || (opts.email && opts.apiToken)));
|
|
2971
|
+
clack.intro('Configure JIRA');
|
|
2972
|
+
try {
|
|
2973
|
+
let config;
|
|
2974
|
+
if (flagged) {
|
|
2975
|
+
const deployment = inferDeployment({
|
|
2976
|
+
deployment: opts.deployment,
|
|
2977
|
+
email: opts.email,
|
|
2978
|
+
apiToken: opts.apiToken,
|
|
2979
|
+
pat: opts.pat,
|
|
2980
|
+
});
|
|
2981
|
+
config = {
|
|
2982
|
+
baseUrl: opts.baseUrl.trim(),
|
|
2983
|
+
deployment,
|
|
2984
|
+
email: opts.email,
|
|
2985
|
+
apiToken: opts.apiToken,
|
|
2986
|
+
pat: opts.pat,
|
|
2987
|
+
};
|
|
2988
|
+
}
|
|
2989
|
+
else {
|
|
2990
|
+
const baseUrl = opts.baseUrl ?? (await clack.text({
|
|
2991
|
+
message: 'JIRA base URL',
|
|
2992
|
+
placeholder: 'https://acme.atlassian.net',
|
|
2993
|
+
validate: (v) => (v && v.trim() ? undefined : 'Required'),
|
|
2994
|
+
}));
|
|
2995
|
+
if (cancelled(baseUrl)) {
|
|
2996
|
+
clack.cancel('Cancelled — nothing saved.');
|
|
2997
|
+
return;
|
|
2998
|
+
}
|
|
2999
|
+
const deployment = (opts.deployment ?? (await clack.select({
|
|
3000
|
+
message: 'Deployment',
|
|
3001
|
+
options: [
|
|
3002
|
+
{ value: 'cloud', label: 'Cloud (email + API token)' },
|
|
3003
|
+
{ value: 'datacenter', label: 'Data Center / Server (personal access token)' },
|
|
3004
|
+
],
|
|
3005
|
+
})));
|
|
3006
|
+
if (cancelled(deployment)) {
|
|
3007
|
+
clack.cancel('Cancelled — nothing saved.');
|
|
3008
|
+
return;
|
|
3009
|
+
}
|
|
3010
|
+
config = { baseUrl: String(baseUrl).trim(), deployment };
|
|
3011
|
+
if (deployment === 'cloud') {
|
|
3012
|
+
const email = opts.email ?? (await clack.text({
|
|
3013
|
+
message: 'Account email',
|
|
3014
|
+
validate: (v) => (v && v.trim() ? undefined : 'Required'),
|
|
3015
|
+
}));
|
|
3016
|
+
if (cancelled(email)) {
|
|
3017
|
+
clack.cancel('Cancelled — nothing saved.');
|
|
3018
|
+
return;
|
|
3019
|
+
}
|
|
3020
|
+
const apiToken = opts.apiToken ?? (await clack.password({
|
|
3021
|
+
message: 'API token (input hidden, never printed)',
|
|
3022
|
+
validate: (v) => (v ? undefined : 'Required'),
|
|
3023
|
+
}));
|
|
3024
|
+
if (cancelled(apiToken)) {
|
|
3025
|
+
clack.cancel('Cancelled — nothing saved.');
|
|
3026
|
+
return;
|
|
3027
|
+
}
|
|
3028
|
+
config.email = String(email).trim();
|
|
3029
|
+
config.apiToken = String(apiToken);
|
|
3030
|
+
}
|
|
3031
|
+
else {
|
|
3032
|
+
const pat = opts.pat ?? (await clack.password({
|
|
3033
|
+
message: 'Personal access token (input hidden, never printed)',
|
|
3034
|
+
validate: (v) => (v ? undefined : 'Required'),
|
|
3035
|
+
}));
|
|
3036
|
+
if (cancelled(pat)) {
|
|
3037
|
+
clack.cancel('Cancelled — nothing saved.');
|
|
3038
|
+
return;
|
|
3039
|
+
}
|
|
3040
|
+
config.pat = String(pat);
|
|
3041
|
+
}
|
|
3042
|
+
}
|
|
3043
|
+
saveJiraConfig(config);
|
|
3044
|
+
// NOTE: never print the credential — only the path.
|
|
3045
|
+
clack.log.success(`Saved credentials to ${jiraConfigPath()} (permissions 0600).`);
|
|
3046
|
+
// Probe the connection so the user knows immediately whether it works.
|
|
3047
|
+
const client = new JiraClient(resolveJiraCredentials());
|
|
3048
|
+
const result = await client.testConnection();
|
|
3049
|
+
clack.outro(`Connected as ${result.displayName ?? 'unknown user'}.`);
|
|
3050
|
+
}
|
|
3051
|
+
catch (err) {
|
|
3052
|
+
// Messages from the jira module are already scrubbed of the secret.
|
|
3053
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
3054
|
+
const label = err instanceof JiraAuthError ? 'Authentication failed' : 'Connection failed';
|
|
3055
|
+
clack.log.error(`${label}: ${msg}`);
|
|
3056
|
+
process.exit(1);
|
|
3057
|
+
}
|
|
3058
|
+
});
|
|
3059
|
+
jira
|
|
3060
|
+
.command('test')
|
|
3061
|
+
.description('Test the configured JIRA connection (uses ~/.specship/jira.json or SPECSHIP_JIRA_* env).')
|
|
3062
|
+
.action(async () => {
|
|
3063
|
+
const { resolveJiraCredentials, JiraClient, JiraAuthError } = await Promise.resolve().then(() => __importStar(require('../jira')));
|
|
3064
|
+
try {
|
|
3065
|
+
const creds = resolveJiraCredentials();
|
|
3066
|
+
const client = new JiraClient(creds);
|
|
3067
|
+
const result = await client.testConnection();
|
|
3068
|
+
const kind = creds.deployment === 'cloud' ? 'JIRA Cloud' : 'JIRA Data Center';
|
|
3069
|
+
// Never print the credential — only the resolved identity.
|
|
3070
|
+
success(`Connected to ${kind} as ${result.displayName ?? 'unknown user'}.`);
|
|
3071
|
+
}
|
|
3072
|
+
catch (err) {
|
|
3073
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
3074
|
+
const label = err instanceof JiraAuthError ? 'Authentication failed' : 'Connection failed';
|
|
3075
|
+
error(`${label}: ${msg}`);
|
|
3076
|
+
process.exit(1);
|
|
3077
|
+
}
|
|
3078
|
+
});
|
|
3079
|
+
/**
|
|
3080
|
+
* specship jira track — read-only tracking view (REQ-JIRA-008). Joins each
|
|
3081
|
+
* picked issue's SpecShip work-state (from its workflow run) with its LIVE JIRA
|
|
3082
|
+
* status (a fresh read at track time). Never re-picks or re-starts anything.
|
|
3083
|
+
*/
|
|
3084
|
+
jira
|
|
3085
|
+
.command('track')
|
|
3086
|
+
.description('Show each picked JIRA issue with its SpecShip work-state + live JIRA status.')
|
|
3087
|
+
.option('--project <key>', 'narrow the live JIRA read to a project (e.g., "PROJ")')
|
|
3088
|
+
.option('--path <projectRoot>', 'project root (default: cwd)')
|
|
3089
|
+
.action(async (options) => {
|
|
3090
|
+
const projectRoot = path.resolve(options.path ?? process.cwd());
|
|
3091
|
+
if (!(0, directory_1.isInitialized)(projectRoot)) {
|
|
3092
|
+
error(`SpecShip not initialized in ${projectRoot}. Run \`specship init -i\` first.`);
|
|
3093
|
+
process.exit(1);
|
|
3094
|
+
}
|
|
3095
|
+
const { SpecShip } = await loadSpecShip();
|
|
3096
|
+
const { handleSpecshipJiraTrack } = await Promise.resolve().then(() => __importStar(require('../mcp/jira-tools')));
|
|
3097
|
+
const cg = await SpecShip.open(projectRoot);
|
|
3098
|
+
try {
|
|
3099
|
+
const result = await handleSpecshipJiraTrack({ project: options.project }, { specQueries: cg.getSpecQueries() });
|
|
3100
|
+
const out = result.content.map((c) => c.text).join('\n');
|
|
3101
|
+
// eslint-disable-next-line no-console
|
|
3102
|
+
console.log(out);
|
|
3103
|
+
if (result.isError)
|
|
3104
|
+
process.exit(1);
|
|
3105
|
+
}
|
|
3106
|
+
finally {
|
|
3107
|
+
cg.close();
|
|
3108
|
+
}
|
|
3109
|
+
});
|
|
2931
3110
|
// Parse and run
|
|
2932
3111
|
program.parse();
|
|
2933
3112
|
} // end main()
|