logwork-cli 0.0.0-stage → 1.1.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.
Files changed (96) hide show
  1. package/LICENSE +11 -0
  2. package/README.md +330 -2
  3. package/RELEASE.md +89 -0
  4. package/bin/logwork.mjs +104 -0
  5. package/commands/auth.mjs +227 -0
  6. package/commands/commits.mjs +82 -0
  7. package/commands/delete.mjs +69 -0
  8. package/commands/doctor.mjs +24 -0
  9. package/commands/edit.mjs +88 -0
  10. package/commands/history.mjs +62 -0
  11. package/commands/query.mjs +52 -0
  12. package/commands/quick.mjs +163 -0
  13. package/commands/reconcile.mjs +55 -0
  14. package/commands/release.mjs +77 -0
  15. package/commands/reminder.mjs +172 -0
  16. package/commands/setup.mjs +508 -0
  17. package/commands/skill.mjs +91 -0
  18. package/commands/tui.mjs +50 -0
  19. package/commands/update.mjs +161 -0
  20. package/docs/advanced.md +334 -0
  21. package/docs/mcp-setup.md +368 -0
  22. package/docs/operations-guide.md +587 -0
  23. package/docs/recipes.md +259 -0
  24. package/docs/security.md +151 -0
  25. package/examples/mcp/antigravity.mcp_config.json +8 -0
  26. package/examples/mcp/codex.config.toml +5 -0
  27. package/examples/mcp/copilot.mcp.json +9 -0
  28. package/lib/agent-skill.mjs +16 -0
  29. package/lib/api-auth.mjs +1259 -0
  30. package/lib/api.mjs +1422 -0
  31. package/lib/apply-ledger.mjs +227 -0
  32. package/lib/atomic-file.mjs +24 -0
  33. package/lib/auth-diagnostics.mjs +113 -0
  34. package/lib/auth-errors.mjs +22 -0
  35. package/lib/auth-redaction.mjs +78 -0
  36. package/lib/auth-terminal.mjs +97 -0
  37. package/lib/auth.mjs +323 -0
  38. package/lib/batch-parser.mjs +145 -0
  39. package/lib/batch-workflow.mjs +842 -0
  40. package/lib/commit-workflow.mjs +402 -0
  41. package/lib/config.mjs +191 -0
  42. package/lib/credential-store.mjs +130 -0
  43. package/lib/diagnostics.mjs +307 -0
  44. package/lib/entrypoint.mjs +14 -0
  45. package/lib/file-lock.mjs +44 -0
  46. package/lib/http.mjs +125 -0
  47. package/lib/jira-api.mjs +258 -0
  48. package/lib/jira-auth.mjs +203 -0
  49. package/lib/jira-workflow.mjs +523 -0
  50. package/lib/keychain.mjs +105 -0
  51. package/lib/legacy-migration.mjs +66 -0
  52. package/lib/list-navigation.mjs +19 -0
  53. package/lib/logwork-config.mjs +199 -0
  54. package/lib/logwork-f03-enrich.mjs +41 -0
  55. package/lib/macos.mjs +33 -0
  56. package/lib/manual-apply-state.mjs +35 -0
  57. package/lib/manual-commands.mjs +294 -0
  58. package/lib/manual-drafts.mjs +154 -0
  59. package/lib/manual-ink-app.mjs +1654 -0
  60. package/lib/manual-ink-auth.mjs +349 -0
  61. package/lib/manual-ink-ui.mjs +675 -0
  62. package/lib/manual-input.mjs +21 -0
  63. package/lib/manual-logwork-wizard.mjs +310 -0
  64. package/lib/manual-mcp.mjs +187 -0
  65. package/lib/manual-repl.mjs +1037 -0
  66. package/lib/manual-targets.mjs +78 -0
  67. package/lib/mcp-server.mjs +833 -0
  68. package/lib/os-notification.mjs +105 -0
  69. package/lib/package-info.mjs +17 -0
  70. package/lib/paths.mjs +68 -0
  71. package/lib/project-identity.mjs +66 -0
  72. package/lib/project-mapping-workflow.mjs +309 -0
  73. package/lib/project-resolver.mjs +373 -0
  74. package/lib/query-workflow.mjs +553 -0
  75. package/lib/reconciliation-workflow.mjs +446 -0
  76. package/lib/release-doctor.mjs +448 -0
  77. package/lib/reminder-config.mjs +71 -0
  78. package/lib/reminder-scheduler.mjs +301 -0
  79. package/lib/reminder-service.mjs +118 -0
  80. package/lib/reminder-state.mjs +38 -0
  81. package/lib/reminder-workflow.mjs +299 -0
  82. package/lib/ro-delete-args.mjs +38 -0
  83. package/lib/ro-delete-workflow.mjs +115 -0
  84. package/lib/ro-edit-args.mjs +142 -0
  85. package/lib/ro-edit-workflow.mjs +632 -0
  86. package/lib/ro-entry-reader.mjs +56 -0
  87. package/lib/ro-resubmit-workflow.mjs +134 -0
  88. package/lib/terminal-auth-prompts.mjs +120 -0
  89. package/lib/ui.mjs +133 -0
  90. package/lib/update-service.mjs +350 -0
  91. package/lib/util.mjs +66 -0
  92. package/lib/windows-credential-manager.mjs +260 -0
  93. package/lib/worklog-task-resolver.mjs +113 -0
  94. package/package.json +73 -4
  95. package/setup.sh +22 -0
  96. package/skills/logwork/SKILL.md +43 -0
@@ -0,0 +1,78 @@
1
+ export const RO_TARGET = 'ro';
2
+ export const JIRA_TARGET = 'jira';
3
+ export const BOTH_TARGET = 'both';
4
+
5
+ export const LOGWORK_TARGETS = Object.freeze([
6
+ {
7
+ key: RO_TARGET,
8
+ label: 'Resource Optimiser',
9
+ description: 'Log work to Resource Optimiser only.'
10
+ },
11
+ {
12
+ key: JIRA_TARGET,
13
+ label: 'Jira',
14
+ description: 'Log Jira worklogs only.'
15
+ },
16
+ {
17
+ key: BOTH_TARGET,
18
+ label: 'Both',
19
+ description: 'Preview and apply Resource Optimiser and Jira separately.'
20
+ }
21
+ ]);
22
+
23
+ export const AUTH_TARGETS = Object.freeze([
24
+ {
25
+ key: RO_TARGET,
26
+ label: 'Resource Optimiser',
27
+ description: 'Run Resource Optimiser API auth.'
28
+ },
29
+ {
30
+ key: JIRA_TARGET,
31
+ label: 'Jira',
32
+ description: 'Show Jira PAT login command.'
33
+ }
34
+ ]);
35
+
36
+ export function parseTargetToken(value, {
37
+ allowBoth = true
38
+ } = {}) {
39
+ const normalized = normalizeTargetToken(value);
40
+ if (!normalized) {
41
+ return null;
42
+ }
43
+
44
+ if (['ro', 'resource', 'resource-optimiser', 'resource-optimizer', 'resource_optimiser', 'resource_optimizer'].includes(normalized)) {
45
+ return RO_TARGET;
46
+ }
47
+ if (normalized === 'jira') {
48
+ return JIRA_TARGET;
49
+ }
50
+ if (allowBoth && normalized === 'both') {
51
+ return BOTH_TARGET;
52
+ }
53
+ return null;
54
+ }
55
+
56
+ export function targetLabel(target) {
57
+ return LOGWORK_TARGETS.find((option) => option.key === target)?.label ||
58
+ AUTH_TARGETS.find((option) => option.key === target)?.label ||
59
+ String(target || 'unknown');
60
+ }
61
+
62
+ export function previewTargets(target) {
63
+ if (target === BOTH_TARGET) {
64
+ return [RO_TARGET, JIRA_TARGET];
65
+ }
66
+ return [target || RO_TARGET];
67
+ }
68
+
69
+ export function jiraLoginInstruction() {
70
+ return 'Jira authentication required. Run `logwork login jira` in a terminal, then retry this command.';
71
+ }
72
+
73
+ function normalizeTargetToken(value) {
74
+ return String(value || '')
75
+ .trim()
76
+ .toLowerCase()
77
+ .replace(/\s+/g, '-');
78
+ }