@thiagodiogo/pscode 1.0.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 +22 -0
- package/README.md +142 -0
- package/bin/pscode.js +5 -0
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/index.js +526 -0
- package/dist/commands/change.d.ts +35 -0
- package/dist/commands/change.js +277 -0
- package/dist/commands/completion.d.ts +72 -0
- package/dist/commands/completion.js +264 -0
- package/dist/commands/config.d.ts +36 -0
- package/dist/commands/config.js +611 -0
- package/dist/commands/context-store.d.ts +3 -0
- package/dist/commands/context-store.js +282 -0
- package/dist/commands/feedback.d.ts +9 -0
- package/dist/commands/feedback.js +183 -0
- package/dist/commands/initiative.d.ts +13 -0
- package/dist/commands/initiative.js +318 -0
- package/dist/commands/schema.d.ts +6 -0
- package/dist/commands/schema.js +869 -0
- package/dist/commands/show.d.ts +14 -0
- package/dist/commands/show.js +132 -0
- package/dist/commands/spec.d.ts +15 -0
- package/dist/commands/spec.js +225 -0
- package/dist/commands/validate.d.ts +24 -0
- package/dist/commands/validate.js +294 -0
- package/dist/commands/workflow/index.d.ts +19 -0
- package/dist/commands/workflow/index.js +13 -0
- package/dist/commands/workflow/initiative-link.d.ts +24 -0
- package/dist/commands/workflow/initiative-link.js +47 -0
- package/dist/commands/workflow/instructions.d.ts +29 -0
- package/dist/commands/workflow/instructions.js +344 -0
- package/dist/commands/workflow/new-change.d.ts +17 -0
- package/dist/commands/workflow/new-change.js +141 -0
- package/dist/commands/workflow/schemas.d.ts +10 -0
- package/dist/commands/workflow/schemas.js +34 -0
- package/dist/commands/workflow/set-change.d.ts +13 -0
- package/dist/commands/workflow/set-change.js +87 -0
- package/dist/commands/workflow/shared.d.ts +59 -0
- package/dist/commands/workflow/shared.js +116 -0
- package/dist/commands/workflow/status.d.ts +14 -0
- package/dist/commands/workflow/status.js +90 -0
- package/dist/commands/workflow/templates.d.ts +16 -0
- package/dist/commands/workflow/templates.js +69 -0
- package/dist/commands/workspace/context-status.d.ts +4 -0
- package/dist/commands/workspace/context-status.js +59 -0
- package/dist/commands/workspace/open-view.d.ts +62 -0
- package/dist/commands/workspace/open-view.js +228 -0
- package/dist/commands/workspace/open.d.ts +37 -0
- package/dist/commands/workspace/open.js +102 -0
- package/dist/commands/workspace/opener-selection.d.ts +11 -0
- package/dist/commands/workspace/opener-selection.js +93 -0
- package/dist/commands/workspace/operations.d.ts +28 -0
- package/dist/commands/workspace/operations.js +543 -0
- package/dist/commands/workspace/prompt-theme.d.ts +29 -0
- package/dist/commands/workspace/prompt-theme.js +24 -0
- package/dist/commands/workspace/registration.d.ts +13 -0
- package/dist/commands/workspace/registration.js +84 -0
- package/dist/commands/workspace/selection.d.ts +6 -0
- package/dist/commands/workspace/selection.js +122 -0
- package/dist/commands/workspace/types.d.ts +103 -0
- package/dist/commands/workspace/types.js +36 -0
- package/dist/commands/workspace.d.ts +6 -0
- package/dist/commands/workspace.js +678 -0
- package/dist/core/archive.d.ts +11 -0
- package/dist/core/archive.js +318 -0
- package/dist/core/artifact-graph/graph.d.ts +56 -0
- package/dist/core/artifact-graph/graph.js +141 -0
- package/dist/core/artifact-graph/index.d.ts +9 -0
- package/dist/core/artifact-graph/index.js +14 -0
- package/dist/core/artifact-graph/instruction-loader.d.ts +183 -0
- package/dist/core/artifact-graph/instruction-loader.js +256 -0
- package/dist/core/artifact-graph/outputs.d.ts +14 -0
- package/dist/core/artifact-graph/outputs.js +39 -0
- package/dist/core/artifact-graph/resolver.d.ts +81 -0
- package/dist/core/artifact-graph/resolver.js +257 -0
- package/dist/core/artifact-graph/schema.d.ts +13 -0
- package/dist/core/artifact-graph/schema.js +108 -0
- package/dist/core/artifact-graph/state.d.ts +12 -0
- package/dist/core/artifact-graph/state.js +31 -0
- package/dist/core/artifact-graph/types.d.ts +40 -0
- package/dist/core/artifact-graph/types.js +29 -0
- package/dist/core/available-tools.d.ts +17 -0
- package/dist/core/available-tools.js +43 -0
- package/dist/core/change-metadata/index.d.ts +2 -0
- package/dist/core/change-metadata/index.js +2 -0
- package/dist/core/change-metadata/schema.d.ts +18 -0
- package/dist/core/change-metadata/schema.js +28 -0
- package/dist/core/change-status-policy.d.ts +50 -0
- package/dist/core/change-status-policy.js +70 -0
- package/dist/core/collections/index.d.ts +3 -0
- package/dist/core/collections/index.js +3 -0
- package/dist/core/collections/initiatives/collection.d.ts +4 -0
- package/dist/core/collections/initiatives/collection.js +17 -0
- package/dist/core/collections/initiatives/index.d.ts +6 -0
- package/dist/core/collections/initiatives/index.js +6 -0
- package/dist/core/collections/initiatives/operations.d.ts +49 -0
- package/dist/core/collections/initiatives/operations.js +175 -0
- package/dist/core/collections/initiatives/resolution.d.ts +87 -0
- package/dist/core/collections/initiatives/resolution.js +374 -0
- package/dist/core/collections/initiatives/schema.d.ts +41 -0
- package/dist/core/collections/initiatives/schema.js +134 -0
- package/dist/core/collections/initiatives/templates.d.ts +12 -0
- package/dist/core/collections/initiatives/templates.js +90 -0
- package/dist/core/collections/runtime.d.ts +46 -0
- package/dist/core/collections/runtime.js +194 -0
- package/dist/core/command-generation/adapters/claude.d.ts +13 -0
- package/dist/core/command-generation/adapters/claude.js +50 -0
- package/dist/core/command-generation/adapters/codex.d.ts +16 -0
- package/dist/core/command-generation/adapters/codex.js +39 -0
- package/dist/core/command-generation/adapters/cursor.d.ts +14 -0
- package/dist/core/command-generation/adapters/cursor.js +44 -0
- package/dist/core/command-generation/adapters/gemini.d.ts +13 -0
- package/dist/core/command-generation/adapters/gemini.js +26 -0
- package/dist/core/command-generation/adapters/github-copilot.d.ts +13 -0
- package/dist/core/command-generation/adapters/github-copilot.js +26 -0
- package/dist/core/command-generation/adapters/index.d.ts +11 -0
- package/dist/core/command-generation/adapters/index.js +11 -0
- package/dist/core/command-generation/generator.d.ts +21 -0
- package/dist/core/command-generation/generator.js +27 -0
- package/dist/core/command-generation/index.d.ts +22 -0
- package/dist/core/command-generation/index.js +24 -0
- package/dist/core/command-generation/registry.d.ts +35 -0
- package/dist/core/command-generation/registry.js +55 -0
- package/dist/core/command-generation/types.d.ts +56 -0
- package/dist/core/command-generation/types.js +8 -0
- package/dist/core/completions/command-registry.d.ts +3 -0
- package/dist/core/completions/command-registry.js +939 -0
- package/dist/core/completions/completion-provider.d.ts +71 -0
- package/dist/core/completions/completion-provider.js +129 -0
- package/dist/core/completions/factory.d.ts +64 -0
- package/dist/core/completions/factory.js +75 -0
- package/dist/core/completions/generators/bash-generator.d.ts +35 -0
- package/dist/core/completions/generators/bash-generator.js +230 -0
- package/dist/core/completions/generators/fish-generator.d.ts +32 -0
- package/dist/core/completions/generators/fish-generator.js +160 -0
- package/dist/core/completions/generators/powershell-generator.d.ts +36 -0
- package/dist/core/completions/generators/powershell-generator.js +266 -0
- package/dist/core/completions/generators/zsh-generator.d.ts +47 -0
- package/dist/core/completions/generators/zsh-generator.js +274 -0
- package/dist/core/completions/installers/bash-installer.d.ts +87 -0
- package/dist/core/completions/installers/bash-installer.js +318 -0
- package/dist/core/completions/installers/fish-installer.d.ts +43 -0
- package/dist/core/completions/installers/fish-installer.js +143 -0
- package/dist/core/completions/installers/powershell-installer.d.ts +102 -0
- package/dist/core/completions/installers/powershell-installer.js +387 -0
- package/dist/core/completions/installers/zsh-installer.d.ts +117 -0
- package/dist/core/completions/installers/zsh-installer.js +421 -0
- package/dist/core/completions/shared-flags.d.ts +12 -0
- package/dist/core/completions/shared-flags.js +28 -0
- package/dist/core/completions/templates/bash-templates.d.ts +6 -0
- package/dist/core/completions/templates/bash-templates.js +30 -0
- package/dist/core/completions/templates/fish-templates.d.ts +7 -0
- package/dist/core/completions/templates/fish-templates.js +45 -0
- package/dist/core/completions/templates/powershell-templates.d.ts +6 -0
- package/dist/core/completions/templates/powershell-templates.js +34 -0
- package/dist/core/completions/templates/zsh-templates.d.ts +6 -0
- package/dist/core/completions/templates/zsh-templates.js +45 -0
- package/dist/core/completions/types.d.ts +101 -0
- package/dist/core/completions/types.js +2 -0
- package/dist/core/config-prompts.d.ts +9 -0
- package/dist/core/config-prompts.js +34 -0
- package/dist/core/config-schema.d.ts +86 -0
- package/dist/core/config-schema.js +213 -0
- package/dist/core/config.d.ts +18 -0
- package/dist/core/config.js +13 -0
- package/dist/core/context-store/binding.d.ts +53 -0
- package/dist/core/context-store/binding.js +197 -0
- package/dist/core/context-store/errors.d.ts +20 -0
- package/dist/core/context-store/errors.js +22 -0
- package/dist/core/context-store/foundation.d.ts +54 -0
- package/dist/core/context-store/foundation.js +318 -0
- package/dist/core/context-store/index.d.ts +6 -0
- package/dist/core/context-store/index.js +6 -0
- package/dist/core/context-store/operations.d.ts +62 -0
- package/dist/core/context-store/operations.js +352 -0
- package/dist/core/context-store/registry.d.ts +35 -0
- package/dist/core/context-store/registry.js +158 -0
- package/dist/core/converters/json-converter.d.ts +6 -0
- package/dist/core/converters/json-converter.js +51 -0
- package/dist/core/global-config.d.ts +49 -0
- package/dist/core/global-config.js +124 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.js +7 -0
- package/dist/core/init.d.ts +40 -0
- package/dist/core/init.js +676 -0
- package/dist/core/legacy-cleanup.d.ts +162 -0
- package/dist/core/legacy-cleanup.js +489 -0
- package/dist/core/list.d.ts +9 -0
- package/dist/core/list.js +171 -0
- package/dist/core/migration.d.ts +23 -0
- package/dist/core/migration.js +108 -0
- package/dist/core/openspec-migration.d.ts +71 -0
- package/dist/core/openspec-migration.js +320 -0
- package/dist/core/parsers/change-parser.d.ts +13 -0
- package/dist/core/parsers/change-parser.js +197 -0
- package/dist/core/parsers/markdown-parser.d.ts +26 -0
- package/dist/core/parsers/markdown-parser.js +227 -0
- package/dist/core/parsers/requirement-blocks.d.ts +37 -0
- package/dist/core/parsers/requirement-blocks.js +201 -0
- package/dist/core/parsers/spec-structure.d.ts +9 -0
- package/dist/core/parsers/spec-structure.js +88 -0
- package/dist/core/planning-home.d.ts +21 -0
- package/dist/core/planning-home.js +108 -0
- package/dist/core/profile-sync-drift.d.ts +38 -0
- package/dist/core/profile-sync-drift.js +203 -0
- package/dist/core/profiles.d.ts +26 -0
- package/dist/core/profiles.js +43 -0
- package/dist/core/project-config.d.ts +64 -0
- package/dist/core/project-config.js +223 -0
- package/dist/core/schemas/base.schema.d.ts +13 -0
- package/dist/core/schemas/base.schema.js +13 -0
- package/dist/core/schemas/change.schema.d.ts +73 -0
- package/dist/core/schemas/change.schema.js +31 -0
- package/dist/core/schemas/index.d.ts +4 -0
- package/dist/core/schemas/index.js +4 -0
- package/dist/core/schemas/spec.schema.d.ts +18 -0
- package/dist/core/schemas/spec.schema.js +15 -0
- package/dist/core/shared/index.d.ts +8 -0
- package/dist/core/shared/index.js +8 -0
- package/dist/core/shared/skill-generation.d.ts +49 -0
- package/dist/core/shared/skill-generation.js +102 -0
- package/dist/core/shared/tool-detection.d.ts +71 -0
- package/dist/core/shared/tool-detection.js +158 -0
- package/dist/core/specs-apply.d.ts +73 -0
- package/dist/core/specs-apply.js +392 -0
- package/dist/core/styles/palette.d.ts +7 -0
- package/dist/core/styles/palette.js +8 -0
- package/dist/core/templates/index.d.ts +8 -0
- package/dist/core/templates/index.js +9 -0
- package/dist/core/templates/skill-templates.d.ts +21 -0
- package/dist/core/templates/skill-templates.js +21 -0
- package/dist/core/templates/types.d.ts +19 -0
- package/dist/core/templates/types.js +5 -0
- package/dist/core/templates/workflows/apply-change.d.ts +10 -0
- package/dist/core/templates/workflows/apply-change.js +287 -0
- package/dist/core/templates/workflows/archive-change.d.ts +10 -0
- package/dist/core/templates/workflows/archive-change.js +227 -0
- package/dist/core/templates/workflows/bulk-archive-change.d.ts +10 -0
- package/dist/core/templates/workflows/bulk-archive-change.js +492 -0
- package/dist/core/templates/workflows/continue-change.d.ts +10 -0
- package/dist/core/templates/workflows/continue-change.js +234 -0
- package/dist/core/templates/workflows/explore.d.ts +10 -0
- package/dist/core/templates/workflows/explore.js +755 -0
- package/dist/core/templates/workflows/feedback.d.ts +9 -0
- package/dist/core/templates/workflows/feedback.js +108 -0
- package/dist/core/templates/workflows/ff-change.d.ts +10 -0
- package/dist/core/templates/workflows/ff-change.js +200 -0
- package/dist/core/templates/workflows/new-change.d.ts +10 -0
- package/dist/core/templates/workflows/new-change.js +143 -0
- package/dist/core/templates/workflows/onboard.d.ts +10 -0
- package/dist/core/templates/workflows/onboard.js +607 -0
- package/dist/core/templates/workflows/propose.d.ts +10 -0
- package/dist/core/templates/workflows/propose.js +347 -0
- package/dist/core/templates/workflows/sync-specs.d.ts +10 -0
- package/dist/core/templates/workflows/sync-specs.js +290 -0
- package/dist/core/templates/workflows/trello-draft.d.ts +12 -0
- package/dist/core/templates/workflows/trello-draft.js +217 -0
- package/dist/core/templates/workflows/trello-setup.d.ts +12 -0
- package/dist/core/templates/workflows/trello-setup.js +315 -0
- package/dist/core/templates/workflows/verify-change.d.ts +10 -0
- package/dist/core/templates/workflows/verify-change.js +338 -0
- package/dist/core/trello-config.d.ts +90 -0
- package/dist/core/trello-config.js +86 -0
- package/dist/core/trello-init-prompt.d.ts +61 -0
- package/dist/core/trello-init-prompt.js +180 -0
- package/dist/core/update.d.ts +82 -0
- package/dist/core/update.js +560 -0
- package/dist/core/validation/constants.d.ts +34 -0
- package/dist/core/validation/constants.js +40 -0
- package/dist/core/validation/types.d.ts +18 -0
- package/dist/core/validation/types.js +2 -0
- package/dist/core/validation/validator.d.ts +33 -0
- package/dist/core/validation/validator.js +418 -0
- package/dist/core/view.d.ts +8 -0
- package/dist/core/view.js +168 -0
- package/dist/core/workspace/foundation.d.ts +62 -0
- package/dist/core/workspace/foundation.js +274 -0
- package/dist/core/workspace/index.d.ts +8 -0
- package/dist/core/workspace/index.js +8 -0
- package/dist/core/workspace/legacy-state.d.ts +28 -0
- package/dist/core/workspace/legacy-state.js +200 -0
- package/dist/core/workspace/link-input.d.ts +9 -0
- package/dist/core/workspace/link-input.js +32 -0
- package/dist/core/workspace/open-surface.d.ts +43 -0
- package/dist/core/workspace/open-surface.js +214 -0
- package/dist/core/workspace/openers.d.ts +21 -0
- package/dist/core/workspace/openers.js +119 -0
- package/dist/core/workspace/registry.d.ts +24 -0
- package/dist/core/workspace/registry.js +146 -0
- package/dist/core/workspace/skills.d.ts +57 -0
- package/dist/core/workspace/skills.js +334 -0
- package/dist/core/workspace/state-io.d.ts +10 -0
- package/dist/core/workspace/state-io.js +119 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/prompts/searchable-multi-select.d.ts +28 -0
- package/dist/prompts/searchable-multi-select.js +159 -0
- package/dist/telemetry/config.d.ts +38 -0
- package/dist/telemetry/config.js +136 -0
- package/dist/telemetry/index.d.ts +31 -0
- package/dist/telemetry/index.js +164 -0
- package/dist/ui/ascii-patterns.d.ts +16 -0
- package/dist/ui/ascii-patterns.js +133 -0
- package/dist/ui/welcome-screen.d.ts +10 -0
- package/dist/ui/welcome-screen.js +146 -0
- package/dist/utils/change-metadata.d.ts +54 -0
- package/dist/utils/change-metadata.js +141 -0
- package/dist/utils/change-utils.d.ts +71 -0
- package/dist/utils/change-utils.js +123 -0
- package/dist/utils/command-references.d.ts +18 -0
- package/dist/utils/command-references.js +20 -0
- package/dist/utils/file-system.d.ts +41 -0
- package/dist/utils/file-system.js +301 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/interactive.d.ts +18 -0
- package/dist/utils/interactive.js +21 -0
- package/dist/utils/item-discovery.d.ts +4 -0
- package/dist/utils/item-discovery.js +72 -0
- package/dist/utils/match.d.ts +3 -0
- package/dist/utils/match.js +22 -0
- package/dist/utils/shell-detection.d.ts +20 -0
- package/dist/utils/shell-detection.js +41 -0
- package/dist/utils/task-progress.d.ts +8 -0
- package/dist/utils/task-progress.js +36 -0
- package/package.json +84 -0
- package/schemas/spec-driven/schema.yaml +153 -0
- package/schemas/spec-driven/templates/design.md +19 -0
- package/schemas/spec-driven/templates/proposal.md +23 -0
- package/schemas/spec-driven/templates/spec.md +8 -0
- package/schemas/spec-driven/templates/tasks.md +9 -0
- package/schemas/workspace-planning/schema.yaml +72 -0
- package/schemas/workspace-planning/templates/design.md +33 -0
- package/schemas/workspace-planning/templates/proposal.md +28 -0
- package/schemas/workspace-planning/templates/spec.md +9 -0
- package/schemas/workspace-planning/templates/tasks.md +15 -0
- package/scripts/postinstall.js +83 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trello Init Prompt
|
|
3
|
+
*
|
|
4
|
+
* Handles the interactive Trello setup questions during `pscode init`.
|
|
5
|
+
* Saves a partial `pscode/trello.yaml` with `configured: false` so that
|
|
6
|
+
* `/ps:trello-setup` (in Claude Code) can pick up where the CLI left off
|
|
7
|
+
* and only needs to perform the MCP-dependent steps (list lookup/creation).
|
|
8
|
+
*/
|
|
9
|
+
import chalk from 'chalk';
|
|
10
|
+
import { stringify as stringifyYaml } from 'yaml';
|
|
11
|
+
import * as fs from 'fs';
|
|
12
|
+
import * as path from 'path';
|
|
13
|
+
import { DEFAULT_LABEL_DEFINITIONS } from './trello-config.js';
|
|
14
|
+
export const ALL_STAGES = [
|
|
15
|
+
{ key: 'backlog', defaultName: 'Backlog', emoji: '📋', description: 'Ideias, rascunhos e tarefas pré-refinadas', required: true },
|
|
16
|
+
{ key: 'refining', defaultName: 'Em Refinamento', emoji: '🔍', description: 'Em discussão/especificação' },
|
|
17
|
+
{ key: 'ready', defaultName: 'Ready to Dev', emoji: '✅', description: 'Aprovadas para desenvolvimento' },
|
|
18
|
+
{ key: 'developing', defaultName: 'Em Desenvolvimento', emoji: '🚧', description: 'Em implementação' },
|
|
19
|
+
{ key: 'testing', defaultName: 'Em Teste', emoji: '🧪', description: 'Em validação/QA' },
|
|
20
|
+
{ key: 'deploy', defaultName: 'Ready to Deploy', emoji: '🚀', description: 'Prontas para produção' },
|
|
21
|
+
{ key: 'done', defaultName: 'Concluído', emoji: '✅', description: 'Entregues/arquivadas', required: true },
|
|
22
|
+
{ key: 'cancelled', defaultName: 'Cancelado', emoji: '❌', description: 'Descartadas' },
|
|
23
|
+
];
|
|
24
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
25
|
+
// Main prompt flow
|
|
26
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
27
|
+
/**
|
|
28
|
+
* Runs the interactive Trello setup questions during `pscode init`.
|
|
29
|
+
* Returns whether the user chose to set up Trello.
|
|
30
|
+
*/
|
|
31
|
+
export async function runTrelloInitPrompt(pscodePath) {
|
|
32
|
+
const configPath = path.join(pscodePath, 'trello.yaml');
|
|
33
|
+
// If already configured (completed), skip silently
|
|
34
|
+
if (fs.existsSync(configPath)) {
|
|
35
|
+
try {
|
|
36
|
+
const { parse } = await import('yaml');
|
|
37
|
+
const existing = parse(fs.readFileSync(configPath, 'utf-8'));
|
|
38
|
+
if (existing?.configured === true) {
|
|
39
|
+
console.log(chalk.dim(' Trello: already configured (skipping)'));
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// Malformed file — allow re-prompt
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const { confirm, select, checkbox, input } = await import('@inquirer/prompts');
|
|
48
|
+
console.log();
|
|
49
|
+
console.log(chalk.bold('Trello Integration'));
|
|
50
|
+
console.log(chalk.dim(' Sync cards automatically as changes move through your workflow.'));
|
|
51
|
+
console.log();
|
|
52
|
+
// ── Step 1: opt-in ─────────────────────────────────────────────────────────
|
|
53
|
+
const wantsTrello = await confirm({
|
|
54
|
+
message: 'Configure Trello integration?',
|
|
55
|
+
default: false,
|
|
56
|
+
});
|
|
57
|
+
if (!wantsTrello) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
// ── Step 2: existing board or create new ───────────────────────────────────
|
|
61
|
+
const boardChoice = await select({
|
|
62
|
+
message: 'Do you have a Trello board already set up for this project?',
|
|
63
|
+
choices: [
|
|
64
|
+
{ value: 'existing', name: 'Yes, I have an existing board' },
|
|
65
|
+
{ value: 'new', name: 'No, create a new board when I run /ps:trello-setup' },
|
|
66
|
+
],
|
|
67
|
+
});
|
|
68
|
+
let boardId;
|
|
69
|
+
if (boardChoice === 'existing') {
|
|
70
|
+
boardId = await input({
|
|
71
|
+
message: 'Board ID or URL (from trello.com/b/<id>/...):',
|
|
72
|
+
validate: (v) => {
|
|
73
|
+
const cleaned = extractBoardId(v.trim());
|
|
74
|
+
return cleaned.length > 0 || 'Please enter a valid board ID or URL';
|
|
75
|
+
},
|
|
76
|
+
transformer: (v) => extractBoardId(v.trim()) || v.trim(),
|
|
77
|
+
});
|
|
78
|
+
boardId = extractBoardId(boardId.trim());
|
|
79
|
+
}
|
|
80
|
+
// ── Step 3: choose stages ──────────────────────────────────────────────────
|
|
81
|
+
console.log();
|
|
82
|
+
console.log(chalk.dim(' Select the workflow stages (columns) you want to use.'));
|
|
83
|
+
console.log(chalk.dim(' Required stages are pre-selected and cannot be removed.'));
|
|
84
|
+
console.log();
|
|
85
|
+
const selectedKeys = await checkbox({
|
|
86
|
+
message: 'Which workflow stages do you want?',
|
|
87
|
+
choices: ALL_STAGES.map((s) => ({
|
|
88
|
+
value: s.key,
|
|
89
|
+
name: `${s.emoji} ${s.defaultName.padEnd(22)} — ${s.description}`,
|
|
90
|
+
checked: true, // all pre-selected; user unchecks what they don't want
|
|
91
|
+
disabled: s.required ? '(required)' : false,
|
|
92
|
+
})),
|
|
93
|
+
});
|
|
94
|
+
// Ensure required stages are always included
|
|
95
|
+
const stages = Array.from(new Set([
|
|
96
|
+
...ALL_STAGES.filter((s) => s.required).map((s) => s.key),
|
|
97
|
+
...selectedKeys,
|
|
98
|
+
])).filter((key) => ALL_STAGES.some((s) => s.key === key));
|
|
99
|
+
// ── Step 4: optional rename ────────────────────────────────────────────────
|
|
100
|
+
const wantsRename = await confirm({
|
|
101
|
+
message: 'Rename any columns? (leave defaults if not)',
|
|
102
|
+
default: false,
|
|
103
|
+
});
|
|
104
|
+
const stageNames = {};
|
|
105
|
+
if (wantsRename) {
|
|
106
|
+
console.log(chalk.dim(' Press Enter to keep the default name.'));
|
|
107
|
+
console.log();
|
|
108
|
+
for (const key of stages) {
|
|
109
|
+
const def = ALL_STAGES.find((s) => s.key === key);
|
|
110
|
+
const customName = await input({
|
|
111
|
+
message: `${def.emoji} ${key} column name:`,
|
|
112
|
+
default: def.defaultName,
|
|
113
|
+
});
|
|
114
|
+
stageNames[key] = customName.trim() || def.defaultName;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
for (const key of stages) {
|
|
119
|
+
const def = ALL_STAGES.find((s) => s.key === key);
|
|
120
|
+
stageNames[key] = def.defaultName;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
// ── Step 5: labels/etiquetas ───────────────────────────────────────────────
|
|
124
|
+
console.log();
|
|
125
|
+
console.log(chalk.dim(' Labels categorizam cada card automaticamente (ex: BUG, IMPLEMENTAÇÃO).'));
|
|
126
|
+
console.log(chalk.dim(' O agente analisa o contexto e aplica a label correta ao criar o card.'));
|
|
127
|
+
console.log();
|
|
128
|
+
const wantsLabels = await confirm({
|
|
129
|
+
message: 'Usar labels/etiquetas nos cards? (o agente categoriza automaticamente)',
|
|
130
|
+
default: true,
|
|
131
|
+
});
|
|
132
|
+
let labels;
|
|
133
|
+
if (wantsLabels) {
|
|
134
|
+
const selectedLabelKeys = await checkbox({
|
|
135
|
+
message: 'Quais labels deseja usar?',
|
|
136
|
+
choices: DEFAULT_LABEL_DEFINITIONS.map((l) => ({
|
|
137
|
+
value: l.key,
|
|
138
|
+
name: `${l.emoji} ${l.name.padEnd(20)} — ${l.description}`,
|
|
139
|
+
checked: true, // todas pré-selecionadas
|
|
140
|
+
})),
|
|
141
|
+
});
|
|
142
|
+
const resolvedKeys = (selectedLabelKeys.length > 0
|
|
143
|
+
? selectedLabelKeys
|
|
144
|
+
: DEFAULT_LABEL_DEFINITIONS.map((l) => l.key));
|
|
145
|
+
labels = { enabled: true, selected: resolvedKeys };
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
labels = { enabled: false };
|
|
149
|
+
}
|
|
150
|
+
// ── Step 6: save partial config ────────────────────────────────────────────
|
|
151
|
+
const pendingConfig = {
|
|
152
|
+
configured: false,
|
|
153
|
+
hasExistingBoard: boardChoice === 'existing',
|
|
154
|
+
...(boardId ? { boardId } : {}),
|
|
155
|
+
stages,
|
|
156
|
+
stageNames,
|
|
157
|
+
labels,
|
|
158
|
+
};
|
|
159
|
+
fs.mkdirSync(pscodePath, { recursive: true });
|
|
160
|
+
fs.writeFileSync(configPath, stringifyYaml(pendingConfig, { lineWidth: 0 }), 'utf-8');
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
164
|
+
// Helpers
|
|
165
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
166
|
+
/**
|
|
167
|
+
* Extracts a Trello board ID from either a raw ID or a full URL.
|
|
168
|
+
* https://trello.com/b/<id>/<name> → <id>
|
|
169
|
+
*/
|
|
170
|
+
function extractBoardId(input) {
|
|
171
|
+
// Full URL pattern
|
|
172
|
+
const urlMatch = input.match(/trello\.com\/b\/([a-zA-Z0-9]+)/);
|
|
173
|
+
if (urlMatch)
|
|
174
|
+
return urlMatch[1];
|
|
175
|
+
// Raw ID (alphanumeric, 8+ chars)
|
|
176
|
+
if (/^[a-zA-Z0-9]{6,}$/.test(input))
|
|
177
|
+
return input;
|
|
178
|
+
return '';
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=trello-init-prompt.js.map
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update Command
|
|
3
|
+
*
|
|
4
|
+
* Refreshes Pscode skills and commands for configured tools.
|
|
5
|
+
* Supports profile-aware updates, delivery changes, migration, and smart update detection.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Options for the update command.
|
|
9
|
+
*/
|
|
10
|
+
export interface UpdateCommandOptions {
|
|
11
|
+
/** Force update even when tools are up to date */
|
|
12
|
+
force?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Scans installed workflow artifacts (skills and managed commands) across all configured tools.
|
|
16
|
+
* Returns the union of detected workflow IDs that match ALL_WORKFLOWS.
|
|
17
|
+
*
|
|
18
|
+
* Wrapper around the shared migration module's scanInstalledWorkflows that accepts tool IDs.
|
|
19
|
+
*/
|
|
20
|
+
export declare function scanInstalledWorkflows(projectPath: string, toolIds: string[]): string[];
|
|
21
|
+
export declare class UpdateCommand {
|
|
22
|
+
private readonly force;
|
|
23
|
+
constructor(options?: UpdateCommandOptions);
|
|
24
|
+
execute(projectPath: string): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Display message when all tools are up to date.
|
|
27
|
+
*/
|
|
28
|
+
private displayUpToDateMessage;
|
|
29
|
+
/**
|
|
30
|
+
* Display the update plan showing which tools need updating.
|
|
31
|
+
*/
|
|
32
|
+
private displayUpdatePlan;
|
|
33
|
+
/**
|
|
34
|
+
* Detects new tool directories that aren't currently configured and displays a hint.
|
|
35
|
+
*/
|
|
36
|
+
private detectNewTools;
|
|
37
|
+
/**
|
|
38
|
+
* Displays a note about extra workflows installed that aren't in the current profile.
|
|
39
|
+
*/
|
|
40
|
+
private displayExtraWorkflowsNote;
|
|
41
|
+
/**
|
|
42
|
+
* Suggest opting back into core when a custom profile still matches the old
|
|
43
|
+
* pre-sync core set. Keep custom profiles user-owned; do not mutate them.
|
|
44
|
+
*/
|
|
45
|
+
private displayOldCoreCustomProfileNote;
|
|
46
|
+
/**
|
|
47
|
+
* Removes skill directories for workflows when delivery changed to commands-only.
|
|
48
|
+
* Returns the number of directories removed.
|
|
49
|
+
*/
|
|
50
|
+
private removeSkillDirs;
|
|
51
|
+
/**
|
|
52
|
+
* Removes skill directories for workflows that are no longer selected in the active profile.
|
|
53
|
+
* Returns the number of directories removed.
|
|
54
|
+
*/
|
|
55
|
+
private removeUnselectedSkillDirs;
|
|
56
|
+
/**
|
|
57
|
+
* Removes command files for workflows when delivery changed to skills-only.
|
|
58
|
+
* Returns the number of files removed.
|
|
59
|
+
*/
|
|
60
|
+
private removeCommandFiles;
|
|
61
|
+
/**
|
|
62
|
+
* Removes command files for workflows that are no longer selected in the active profile.
|
|
63
|
+
* Returns the number of files removed.
|
|
64
|
+
*/
|
|
65
|
+
private removeUnselectedCommandFiles;
|
|
66
|
+
/**
|
|
67
|
+
* Detect and handle legacy Pscode artifacts.
|
|
68
|
+
* Unlike init, update warns but continues if legacy files found in non-interactive mode.
|
|
69
|
+
* Returns array of tool IDs that were newly configured during legacy upgrade.
|
|
70
|
+
*/
|
|
71
|
+
private handleLegacyCleanup;
|
|
72
|
+
/**
|
|
73
|
+
* Perform cleanup of legacy artifacts.
|
|
74
|
+
*/
|
|
75
|
+
private performLegacyCleanup;
|
|
76
|
+
/**
|
|
77
|
+
* Upgrade legacy tools to new skills system.
|
|
78
|
+
* Returns array of tool IDs that were newly configured.
|
|
79
|
+
*/
|
|
80
|
+
private upgradeLegacyTools;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=update.d.ts.map
|