@openpome/cli 0.16.0-alpha.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/LICENSE +158 -0
- package/README.md +11 -0
- package/dist/commands/auth.d.ts +3 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +32 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/core.d.ts +3 -0
- package/dist/commands/core.d.ts.map +1 -0
- package/dist/commands/core.js +27 -0
- package/dist/commands/core.js.map +1 -0
- package/dist/commands/drafts.d.ts +3 -0
- package/dist/commands/drafts.d.ts.map +1 -0
- package/dist/commands/drafts.js +81 -0
- package/dist/commands/drafts.js.map +1 -0
- package/dist/commands/sessions.d.ts +3 -0
- package/dist/commands/sessions.d.ts.map +1 -0
- package/dist/commands/sessions.js +77 -0
- package/dist/commands/sessions.js.map +1 -0
- package/dist/commands/types.d.ts +2 -0
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/commands/types.js +2 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/commands/work-items.d.ts +3 -0
- package/dist/commands/work-items.d.ts.map +1 -0
- package/dist/commands/work-items.js +56 -0
- package/dist/commands/work-items.js.map +1 -0
- package/dist/commands/workspaces.d.ts +3 -0
- package/dist/commands/workspaces.d.ts.map +1 -0
- package/dist/commands/workspaces.js +33 -0
- package/dist/commands/workspaces.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/presentation.d.ts +40 -0
- package/dist/presentation.d.ts.map +1 -0
- package/dist/presentation.js +655 -0
- package/dist/presentation.js.map +1 -0
- package/package.json +53 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction, and
|
|
10
|
+
distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by the
|
|
13
|
+
copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all other
|
|
16
|
+
entities that control, are controlled by, or are under common control with
|
|
17
|
+
that entity. For the purposes of this definition, "control" means (i) the
|
|
18
|
+
power, direct or indirect, to cause the direction or management of such
|
|
19
|
+
entity, whether by contract or otherwise, or (ii) ownership of fifty percent
|
|
20
|
+
(50%) or more of the outstanding shares, or (iii) beneficial ownership of
|
|
21
|
+
such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
|
24
|
+
permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation source, and
|
|
28
|
+
configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical transformation
|
|
31
|
+
or translation of a Source form, including but not limited to compiled object
|
|
32
|
+
code, generated documentation, and conversions to other media types.
|
|
33
|
+
|
|
34
|
+
"Work" shall mean the work of authorship, whether in Source or Object form,
|
|
35
|
+
made available under the License, as indicated by a copyright notice that is
|
|
36
|
+
included in or attached to the work.
|
|
37
|
+
|
|
38
|
+
"Derivative Works" shall mean any work, whether in Source or Object form,
|
|
39
|
+
that is based on (or derived from) the Work and for which the editorial
|
|
40
|
+
revisions, annotations, elaborations, or other modifications represent, as a
|
|
41
|
+
whole, an original work of authorship. For the purposes of this License,
|
|
42
|
+
Derivative Works shall not include works that remain separable from, or
|
|
43
|
+
merely link (or bind by name) to the interfaces of, the Work and Derivative
|
|
44
|
+
Works thereof.
|
|
45
|
+
|
|
46
|
+
"Contribution" shall mean any work of authorship, including the original
|
|
47
|
+
version of the Work and any modifications or additions to that Work or
|
|
48
|
+
Derivative Works thereof, that is intentionally submitted to Licensor for
|
|
49
|
+
inclusion in the Work by the copyright owner or by an individual or Legal
|
|
50
|
+
Entity authorized to submit on behalf of the copyright owner. For the purposes
|
|
51
|
+
of this definition, "submitted" means any form of electronic, verbal, or
|
|
52
|
+
written communication sent to the Licensor or its representatives, including
|
|
53
|
+
but not limited to communication on electronic mailing lists, source code
|
|
54
|
+
control systems, and issue tracking systems that are managed by, or on behalf
|
|
55
|
+
of, the Licensor for the purpose of discussing and improving the Work, but
|
|
56
|
+
excluding communication that is conspicuously marked or otherwise designated
|
|
57
|
+
in writing by the copyright owner as "Not a Contribution."
|
|
58
|
+
|
|
59
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on
|
|
60
|
+
behalf of whom a Contribution has been received by Licensor and subsequently
|
|
61
|
+
incorporated within the Work.
|
|
62
|
+
|
|
63
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this
|
|
64
|
+
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
65
|
+
non-exclusive, no-charge, royalty-free, irrevocable copyright license to
|
|
66
|
+
reproduce, prepare Derivative Works of, publicly display, publicly perform,
|
|
67
|
+
sublicense, and distribute the Work and such Derivative Works in Source or
|
|
68
|
+
Object form.
|
|
69
|
+
|
|
70
|
+
3. Grant of Patent License. Subject to the terms and conditions of this
|
|
71
|
+
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
72
|
+
non-exclusive, no-charge, royalty-free, irrevocable patent license to make,
|
|
73
|
+
have made, use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
74
|
+
where such license applies only to those patent claims licensable by such
|
|
75
|
+
Contributor that are necessarily infringed by their Contribution alone or by
|
|
76
|
+
combination of their Contribution with the Work to which such Contribution was
|
|
77
|
+
submitted. If You institute patent litigation against any entity alleging that
|
|
78
|
+
the Work or a Contribution incorporated within the Work constitutes direct or
|
|
79
|
+
contributory patent infringement, then any patent licenses granted to You
|
|
80
|
+
under this License for that Work shall terminate as of the date such
|
|
81
|
+
litigation is filed.
|
|
82
|
+
|
|
83
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or
|
|
84
|
+
Derivative Works thereof in any medium, with or without modifications, and in
|
|
85
|
+
Source or Object form, provided that You meet the following conditions:
|
|
86
|
+
|
|
87
|
+
(a) You must give any other recipients of the Work or Derivative Works a copy
|
|
88
|
+
of this License; and
|
|
89
|
+
|
|
90
|
+
(b) You must cause any modified files to carry prominent notices stating that
|
|
91
|
+
You changed the files; and
|
|
92
|
+
|
|
93
|
+
(c) You must retain, in the Source form of any Derivative Works that You
|
|
94
|
+
distribute, all copyright, patent, trademark, and attribution notices from the
|
|
95
|
+
Source form of the Work, excluding those notices that do not pertain to any
|
|
96
|
+
part of the Derivative Works; and
|
|
97
|
+
|
|
98
|
+
(d) If the Work includes a "NOTICE" text file as part of its distribution,
|
|
99
|
+
then any Derivative Works that You distribute must include a readable copy of
|
|
100
|
+
the attribution notices contained within such NOTICE file, excluding those
|
|
101
|
+
notices that do not pertain to any part of the Derivative Works, in at least
|
|
102
|
+
one of the following places: within a NOTICE text file distributed as part of
|
|
103
|
+
the Derivative Works; within the Source form or documentation, if provided
|
|
104
|
+
along with the Derivative Works; or, within a display generated by the
|
|
105
|
+
Derivative Works, if and wherever such third-party notices normally appear.
|
|
106
|
+
The contents of the NOTICE file are for informational purposes only and do not
|
|
107
|
+
modify the License. You may add Your own attribution notices within Derivative
|
|
108
|
+
Works that You distribute, alongside or as an addendum to the NOTICE text from
|
|
109
|
+
the Work, provided that such additional attribution notices cannot be construed
|
|
110
|
+
as modifying the License.
|
|
111
|
+
|
|
112
|
+
You may add Your own copyright statement to Your modifications and may provide
|
|
113
|
+
additional or different license terms and conditions for use, reproduction, or
|
|
114
|
+
distribution of Your modifications, or for any such Derivative Works as a
|
|
115
|
+
whole, provided Your use, reproduction, and distribution of the Work otherwise
|
|
116
|
+
complies with the conditions stated in this License.
|
|
117
|
+
|
|
118
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any
|
|
119
|
+
Contribution intentionally submitted for inclusion in the Work by You to the
|
|
120
|
+
Licensor shall be under the terms and conditions of this License, without any
|
|
121
|
+
additional terms or conditions. Notwithstanding the above, nothing herein shall
|
|
122
|
+
supersede or modify the terms of any separate license agreement you may have
|
|
123
|
+
executed with Licensor regarding such Contributions.
|
|
124
|
+
|
|
125
|
+
6. Trademarks. This License does not grant permission to use the trade names,
|
|
126
|
+
trademarks, service marks, or product names of the Licensor, except as
|
|
127
|
+
required for reasonable and customary use in describing the origin of the Work
|
|
128
|
+
and reproducing the content of the NOTICE file.
|
|
129
|
+
|
|
130
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
|
|
131
|
+
writing, Licensor provides the Work on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
132
|
+
CONDITIONS OF ANY KIND, either express or implied, including, without
|
|
133
|
+
limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
|
|
134
|
+
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely
|
|
135
|
+
responsible for determining the appropriateness of using or redistributing the
|
|
136
|
+
Work and assume any risks associated with Your exercise of permissions under
|
|
137
|
+
this License.
|
|
138
|
+
|
|
139
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in
|
|
140
|
+
tort (including negligence), contract, or otherwise, unless required by
|
|
141
|
+
applicable law (such as deliberate and grossly negligent acts) or agreed to in
|
|
142
|
+
writing, shall any Contributor be liable to You for damages, including any
|
|
143
|
+
direct, indirect, special, incidental, or consequential damages of any
|
|
144
|
+
character arising as a result of this License or out of the use or inability
|
|
145
|
+
to use the Work, even if such Contributor has been advised of the possibility
|
|
146
|
+
of such damages.
|
|
147
|
+
|
|
148
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work
|
|
149
|
+
or Derivative Works thereof, You may choose to offer, and charge a fee for,
|
|
150
|
+
acceptance of support, warranty, indemnity, or other liability obligations
|
|
151
|
+
and/or rights consistent with this License. However, in accepting such
|
|
152
|
+
obligations, You may act only on Your own behalf and on Your sole
|
|
153
|
+
responsibility, not on behalf of any other Contributor, and only if You agree
|
|
154
|
+
to indemnify, defend, and hold each Contributor harmless for any liability
|
|
155
|
+
incurred by, or claims asserted against, such Contributor by reason of your
|
|
156
|
+
accepting any such warranty or additional liability.
|
|
157
|
+
|
|
158
|
+
END OF TERMS AND CONDITIONS
|
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# OpenPome CLI
|
|
2
|
+
|
|
3
|
+
Work-item-first AI developer workbench CLI.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install -g @openpome/cli
|
|
7
|
+
pome init
|
|
8
|
+
pome doctor
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
OpenPome starts from assigned work, resolves the right workspace, creates a task session, generates a plan, and records approval checkpoints.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,eAAO,MAAM,iBAAiB,EAAE,cAiC/B,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { completeJiraOAuthCode, createJiraOAuthLogin, getJiraAuthStatus, listenForJiraOAuthCallback } from "@openpome/local-gateway";
|
|
2
|
+
import { printJiraOAuthCompletion, printJiraOAuthLogin } from "../presentation.js";
|
|
3
|
+
export const handleAuthCommand = async (argv) => {
|
|
4
|
+
const [command, subcommand, value, extra] = argv;
|
|
5
|
+
if (command === "auth" && subcommand === "jira" && value === "status") {
|
|
6
|
+
const status = await getJiraAuthStatus();
|
|
7
|
+
console.log(`Jira auth: ${status.mode}`);
|
|
8
|
+
console.log(`Configured: ${status.configured ? "yes" : "no"}`);
|
|
9
|
+
if (status.expiresAt) {
|
|
10
|
+
console.log(`Expires: ${status.expiresAt}`);
|
|
11
|
+
}
|
|
12
|
+
if (status.mode === "oauth-3lo") {
|
|
13
|
+
console.log(`Refresh: ${status.refreshAvailable ? "available" : "not available"}`);
|
|
14
|
+
}
|
|
15
|
+
console.log(status.detail);
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
if (command === "auth" && subcommand === "jira" && value === "login") {
|
|
19
|
+
if (extra === "--listen") {
|
|
20
|
+
printJiraOAuthCompletion(await listenForJiraOAuthCallback());
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
printJiraOAuthLogin(createJiraOAuthLogin());
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
if (command === "auth" && subcommand === "jira" && value === "callback" && extra) {
|
|
27
|
+
printJiraOAuthCompletion(await completeJiraOAuthCode(extra));
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,0BAA0B,EAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGnF,MAAM,CAAC,MAAM,iBAAiB,GAAmB,KAAK,EAAE,IAAI,EAAE,EAAE;IAC9D,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;IAEjD,IAAI,OAAO,KAAK,MAAM,IAAI,UAAU,KAAK,MAAM,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;QACtE,MAAM,MAAM,GAAG,MAAM,iBAAiB,EAAE,CAAC;QACzC,OAAO,CAAC,GAAG,CAAC,cAAc,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QACzC,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,eAAO,MAAM,iBAAiB,EAAE,cA6B/B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { getConfigPaths, initOpenPome, resetOpenPomeConfig, runDoctor, showOpenPomeConfig } from "@openpome/local-gateway";
|
|
2
|
+
import { printConfigPaths, printConfigReset, printConfigShow, printDoctorResult, printInitResult } from "../presentation.js";
|
|
3
|
+
export const handleCoreCommand = async (argv) => {
|
|
4
|
+
const [command] = argv;
|
|
5
|
+
if (command === "init") {
|
|
6
|
+
printInitResult(await initOpenPome());
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
if (command === "doctor") {
|
|
10
|
+
printDoctorResult(await runDoctor());
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
if (command === "config" && argv[1] === "path") {
|
|
14
|
+
printConfigPaths(await getConfigPaths());
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
if (command === "config" && argv[1] === "show") {
|
|
18
|
+
printConfigShow(await showOpenPomeConfig());
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
if (command === "config" && argv[1] === "reset") {
|
|
22
|
+
printConfigReset(await resetOpenPomeConfig());
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
return false;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/commands/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,mBAAmB,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC3H,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG7H,MAAM,CAAC,MAAM,iBAAiB,GAAmB,KAAK,EAAE,IAAI,EAAE,EAAE;IAC9D,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAEvB,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QACvB,eAAe,CAAC,MAAM,YAAY,EAAE,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;QACzB,iBAAiB,CAAC,MAAM,SAAS,EAAE,CAAC,CAAC;QACrC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,OAAO,KAAK,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE,CAAC;QAC/C,gBAAgB,CAAC,MAAM,cAAc,EAAE,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,OAAO,KAAK,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE,CAAC;QAC/C,eAAe,CAAC,MAAM,kBAAkB,EAAE,CAAC,CAAC;QAC5C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,OAAO,KAAK,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC;QAChD,gBAAgB,CAAC,MAAM,mBAAmB,EAAE,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drafts.d.ts","sourceRoot":"","sources":["../../src/commands/drafts.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,eAAO,MAAM,kBAAkB,EAAE,cAqGhC,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { createManualCopyAIContext, createManualCopyAIPrompt, createPullRequestDraft, createPullRequestExternalGuard, createWorkItemUpdateDraft, discoverTestCommands, getDiffSummary, getGitHubAuthStatus, getTestCommandHistory, postWorkItemUpdateExternalGuard, runApprovedTestCommand } from "@openpome/local-gateway";
|
|
2
|
+
import { printCommandFailure, printDiffSummary, printExternalActionGuard, printGitHubAuthStatus, printManualCopyAIContext, printManualCopyAIPrompt, printPullRequestDraft, printTestCommandDiscovery, printTestCommandHistory, printTestRunEvidence, printWorkItemUpdateDraft } from "../presentation.js";
|
|
3
|
+
export const handleDraftCommand = async (argv) => {
|
|
4
|
+
const [command, subcommand] = argv;
|
|
5
|
+
if (command === "test" && (!subcommand || subcommand === "discover")) {
|
|
6
|
+
printTestCommandDiscovery(await discoverTestCommands());
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
if (command === "test" && subcommand === "history") {
|
|
10
|
+
printTestCommandHistory(await getTestCommandHistory());
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
if (command === "test" && subcommand === "run") {
|
|
14
|
+
const evidence = await runApprovedTestCommand(argv.slice(2).join(" ").trim() || undefined);
|
|
15
|
+
if (!evidence) {
|
|
16
|
+
printCommandFailure("No active task session.", "Run `pome start <KEY>` first.");
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
printTestRunEvidence(evidence);
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
if (command === "ai" && subcommand === "context") {
|
|
23
|
+
const result = await createManualCopyAIContext();
|
|
24
|
+
if (!result.active || !result.context) {
|
|
25
|
+
printCommandFailure("No active task session.", "Run `pome start <KEY>` first.");
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
printManualCopyAIContext(result);
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
if (command === "ai" && subcommand === "prompt") {
|
|
32
|
+
const result = await createManualCopyAIPrompt();
|
|
33
|
+
if (!result.active || !result.prompt) {
|
|
34
|
+
printCommandFailure("No active task session.", "Run `pome start <KEY>` first.");
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
printManualCopyAIPrompt(result);
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
if (command === "diff") {
|
|
41
|
+
const result = await getDiffSummary();
|
|
42
|
+
if (!result.active || !result.summary) {
|
|
43
|
+
printCommandFailure("No active task session.", "Run `pome start <KEY>` first.");
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
printDiffSummary(result);
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
if (command === "github" && subcommand === "auth" && argv[2] === "status") {
|
|
50
|
+
printGitHubAuthStatus(await getGitHubAuthStatus());
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
if (command === "pr" && subcommand === "draft") {
|
|
54
|
+
const result = await createPullRequestDraft();
|
|
55
|
+
if (!result.active || !result.draft) {
|
|
56
|
+
printCommandFailure("No active task session.", "Run `pome start <KEY>` first.");
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
printPullRequestDraft(result);
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
if (command === "pr" && subcommand === "create") {
|
|
63
|
+
printExternalActionGuard(await createPullRequestExternalGuard());
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
if (command === "work-item" && subcommand === "update-draft") {
|
|
67
|
+
const result = await createWorkItemUpdateDraft();
|
|
68
|
+
if (!result.active || !result.draft) {
|
|
69
|
+
printCommandFailure("No active task session.", "Run `pome start <KEY>` first.");
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
printWorkItemUpdateDraft(result);
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
if (command === "work-item" && subcommand === "post-update") {
|
|
76
|
+
printExternalActionGuard(await postWorkItemUpdateExternalGuard());
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
return false;
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=drafts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drafts.js","sourceRoot":"","sources":["../../src/commands/drafts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB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E,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,eAAO,MAAM,oBAAoB,EAAE,cA+FlC,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { approveTaskSessionPlan, approveTestCommand, createTaskSessionPlan, getTaskSessionApprovalHistory, getTaskSessionStatus, getTaskSessionTimeline, rejectTaskSessionPlan, resetTaskSession, resumeTaskSession, startTaskSession, stopTaskSession } from "@openpome/local-gateway";
|
|
2
|
+
import { printCommandFailure, printCommandApprovalEvidence, printTaskSessionApprovalHistory, printTaskSessionApproval, printTaskSessionLifecycle, printTaskSessionPlan, printTaskSessionStart, printTaskSessionStatus, printTaskSessionTimeline } from "../presentation.js";
|
|
3
|
+
export const handleSessionCommand = async (argv) => {
|
|
4
|
+
const [command, subcommand] = argv;
|
|
5
|
+
if (command === "start" && subcommand) {
|
|
6
|
+
const result = await startTaskSession(subcommand);
|
|
7
|
+
if (!result) {
|
|
8
|
+
printCommandFailure(`Work item not found: ${subcommand}`, "Run `pome work-item list` to choose an assigned work item.");
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
printTaskSessionStart(result);
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
if (command === "status") {
|
|
15
|
+
printTaskSessionStatus(await getTaskSessionStatus());
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
if (command === "stop") {
|
|
19
|
+
printTaskSessionLifecycle(await stopTaskSession());
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
if (command === "resume") {
|
|
23
|
+
printTaskSessionLifecycle(await resumeTaskSession(subcommand));
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
if (command === "reset") {
|
|
27
|
+
printTaskSessionLifecycle(await resetTaskSession());
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
if (command === "timeline") {
|
|
31
|
+
printTaskSessionTimeline(await getTaskSessionTimeline());
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
if (command === "approvals") {
|
|
35
|
+
printTaskSessionApprovalHistory(await getTaskSessionApprovalHistory());
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
if (command === "plan") {
|
|
39
|
+
const result = await createTaskSessionPlan();
|
|
40
|
+
if (!result) {
|
|
41
|
+
printCommandFailure("No active task session.", "Run `pome start <KEY>` first.");
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
printTaskSessionPlan(result);
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
if (command === "approve" && subcommand === "plan") {
|
|
48
|
+
const result = await approveTaskSessionPlan();
|
|
49
|
+
if (!result) {
|
|
50
|
+
printCommandFailure("No active task session.", "Run `pome start <KEY>` first.");
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
printTaskSessionApproval(result);
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
if (command === "approve" && subcommand === "command") {
|
|
57
|
+
const evidence = await approveTestCommand(argv.slice(2).join(" ").trim() || undefined);
|
|
58
|
+
if (!evidence) {
|
|
59
|
+
printCommandFailure("No active task session.", "Run `pome start <KEY>` first.");
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
printCommandApprovalEvidence(evidence);
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
if (command === "reject") {
|
|
66
|
+
const reason = argv.slice(1).join(" ").trim() || undefined;
|
|
67
|
+
const result = await rejectTaskSessionPlan(reason);
|
|
68
|
+
if (!result) {
|
|
69
|
+
printCommandFailure("No active task session.", "Run `pome start <KEY>` first.");
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
printTaskSessionApproval(result);
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
return false;
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=sessions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../src/commands/sessions.ts"],"names":[],"m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QAAQ,EAAE,CAAC;YACd,mBAAmB,CAAC,yBAAyB,EAAE,+BAA+B,CAAC,CAAC;YAChF,OAAO,IAAI,CAAC;QACd,CAAC;QAED,4BAA4B,CAAC,QAAQ,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,SAAS,CAAC;QAC3D,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAEnD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,mBAAmB,CAAC,yBAAyB,EAAE,+BAA+B,CAAC,CAAC;YAChF,OAAO,IAAI,CAAC;QACd,CAAC;QAED,wBAAwB,CAAC,MAAM,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/commands/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/commands/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-items.d.ts","sourceRoot":"","sources":["../../src/commands/work-items.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,eAAO,MAAM,qBAAqB,EAAE,cAqEnC,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { listAssignedWork, listJiraBoards, listWorkItemScopes, showWorkItem, useJiraBoard, useWorkItemScope } from "@openpome/local-gateway";
|
|
2
|
+
import { printAssignedWork, printJiraBoardSelection, printJiraBoards, printCommandFailure, printWorkItem, printWorkItemScopeSelection, printWorkItemScopes } from "../presentation.js";
|
|
3
|
+
export const handleWorkItemCommand = async (argv) => {
|
|
4
|
+
const [command, subcommand, value] = argv;
|
|
5
|
+
if ((command === "jira" || command === "work-item") && subcommand === "list") {
|
|
6
|
+
printAssignedWork(await listAssignedWork());
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
if (command === "work-item" && subcommand === "scopes") {
|
|
10
|
+
printWorkItemScopes(await listWorkItemScopes());
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
if (command === "work-item" && subcommand === "scope" && value === "use") {
|
|
14
|
+
const scopeId = argv[3];
|
|
15
|
+
if (!scopeId) {
|
|
16
|
+
printCommandFailure("Missing work item scope id.", "Usage: pome work-item scope use <SCOPE_ID>");
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
const result = await useWorkItemScope(scopeId);
|
|
20
|
+
if (!result) {
|
|
21
|
+
printCommandFailure(`Work item scope not found: ${scopeId}`, "Run `pome work-item scopes` to list available scopes.");
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
printWorkItemScopeSelection(result);
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
if (command === "jira" && subcommand === "boards") {
|
|
28
|
+
printJiraBoards(await listJiraBoards());
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
if (command === "jira" && subcommand === "board" && value === "use") {
|
|
32
|
+
const boardId = argv[3];
|
|
33
|
+
if (!boardId) {
|
|
34
|
+
printCommandFailure("Missing Jira board id.", "Usage: pome jira board use <BOARD_ID>");
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
const result = await useJiraBoard(boardId);
|
|
38
|
+
if (!result) {
|
|
39
|
+
printCommandFailure(`Jira board not found: ${boardId}`, "Run `pome jira boards` to list available boards.");
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
printJiraBoardSelection(result);
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
if ((command === "jira" || command === "work-item") && subcommand === "show" && value) {
|
|
46
|
+
const item = await showWorkItem(value);
|
|
47
|
+
if (!item) {
|
|
48
|
+
printCommandFailure(`Work item not found: ${value}`, "Run `pome work-item list` to choose an assigned work item.");
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
printWorkItem(item);
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=work-items.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-items.js","sourceRoot":"","sources":["../../src/commands/work-items.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,kBAAkB,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC7I,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,2BAA2B,EAC3B,mBAAmB,EACpB,MAAM,oBAAoB,CAAC;AAG5B,MAAM,CAAC,MAAM,qBAAqB,GAAmB,KAAK,EAAE,IAAI,EAAE,EAAE;IAClE,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;IAE1C,IAAI,CAAC,OAAO,KAAK,MAAM,IAAI,OAAO,KAAK,WAAW,CAAC,IAAI,UAAU,KAAK,MAAM,EAAE,CAAC;QAC7E,iBAAiB,CAAC,MAAM,gBAAgB,EAAE,CAAC,CAAC;QAC5C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,OAAO,KAAK,WAAW,IAAI,UAAU,KAAK,QAAQ,EAAE,CAAC;QACvD,mBAAmB,CAAC,MAAM,kBAAkB,EAAE,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AAC,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,OAAO,KAAK,MAAM,IAAI,OAAO,KAAK,WAAW,CAAC,IAAI,UAAU,KAAK,MAAM,IAAI,KAAK,EAAE,CAAC;QACtF,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,KAAK,CAAC,CAAC;QAEvC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,mBAAmB,CAAC,wBAAwB,KAAK,EAAE,EAAE,4DAA4D,CAAC,CAAC;YACnH,OAAO,IAAI,CAAC;QACd,CAAC;QAED,aAAa,CAAC,IAAI,CAAC,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../../src/commands/workspaces.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,eAAO,MAAM,sBAAsB,EAAE,cAsCpC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { linkWorkspaceToWorkItem, listWorkspaces, resolveWorkspaceForWorkItem, scanWorkspaces } from "@openpome/local-gateway";
|
|
2
|
+
import { printCommandFailure, printWorkspaceLink, printWorkspaceList, printWorkspaceResolution, printWorkspaceScan } from "../presentation.js";
|
|
3
|
+
export const handleWorkspaceCommand = async (argv) => {
|
|
4
|
+
const [command, subcommand, value, extra] = argv;
|
|
5
|
+
if (command === "workspace" && subcommand === "scan") {
|
|
6
|
+
printWorkspaceScan(await scanWorkspaces());
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
if (command === "workspace" && subcommand === "list") {
|
|
10
|
+
printWorkspaceList(await listWorkspaces());
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
if (command === "workspace" && subcommand === "resolve" && value) {
|
|
14
|
+
const result = await resolveWorkspaceForWorkItem(value);
|
|
15
|
+
if (!result) {
|
|
16
|
+
printCommandFailure(`Work item not found: ${value}`, "Run `pome work-item list` to choose an assigned work item.");
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
printWorkspaceResolution(result);
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
if (command === "workspace" && subcommand === "link" && value && extra) {
|
|
23
|
+
const result = await linkWorkspaceToWorkItem(value, extra);
|
|
24
|
+
if (!result) {
|
|
25
|
+
printCommandFailure(`Work item not found: ${value}`, "Run `pome work-item list` to choose an assigned work item.");
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
printWorkspaceLink(result);
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
return false;
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=workspaces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../../src/commands/workspaces.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,cAAc,EACd,2BAA2B,EAC3B,cAAc,EACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,MAAM,CAAC,MAAM,sBAAsB,GAAmB,KAAK,EAAE,IAAI,EAAE,EAAE;IACnE,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;IAEjD,IAAI,OAAO,KAAK,WAAW,IAAI,UAAU,KAAK,MAAM,EAAE,CAAC;QACrD,kBAAkB,CAAC,MAAM,cAAc,EAAE,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,OAAO,KAAK,WAAW,IAAI,UAAU,KAAK,MAAM,EAAE,CAAC;QACrD,kBAAkB,CAAC,MAAM,cAAc,EAA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