@tacuchi/agent-workflow-cli 6.2.0 → 7.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -12
- package/dist/application/profile/profile-service.d.ts +53 -0
- package/dist/application/profile/profile-service.d.ts.map +1 -0
- package/dist/application/profile/profile-service.js +210 -0
- package/dist/application/profile/profile-service.js.map +1 -0
- package/dist/application/self/bootstrap.js +2 -1
- package/dist/application/self/bootstrap.js.map +1 -1
- package/dist/application/self/detect-hosts.d.ts +18 -0
- package/dist/application/self/detect-hosts.d.ts.map +1 -0
- package/dist/application/self/detect-hosts.js +37 -0
- package/dist/application/self/detect-hosts.js.map +1 -0
- package/dist/application/self/install-hooks.d.ts +30 -0
- package/dist/application/self/install-hooks.d.ts.map +1 -0
- package/dist/application/self/install-hooks.js +253 -0
- package/dist/application/self/install-hooks.js.map +1 -0
- package/dist/application/self/install-skill.d.ts +2 -0
- package/dist/application/self/install-skill.d.ts.map +1 -1
- package/dist/application/self/install-skill.js +69 -3
- package/dist/application/self/install-skill.js.map +1 -1
- package/dist/cli/commands/self.d.ts.map +1 -1
- package/dist/cli/commands/self.js +9 -1
- package/dist/cli/commands/self.js.map +1 -1
- package/dist/cli/tui/tabs/skills-tab.d.ts.map +1 -1
- package/dist/cli/tui/tabs/skills-tab.js +100 -24
- package/dist/cli/tui/tabs/skills-tab.js.map +1 -1
- package/package.json +2 -2
- package/skills/agent-workflow/commands/README.md +26 -0
- package/skills/agent-workflow/commands/compact.md +24 -0
- package/skills/agent-workflow/commands/doctor.md +100 -0
- package/skills/agent-workflow/commands/export-arq.md +77 -0
- package/skills/agent-workflow/commands/export-conclusions.md +78 -0
- package/skills/agent-workflow/commands/export-plan.md +74 -0
- package/skills/agent-workflow/commands/export-qa-note.md +30 -0
- package/skills/agent-workflow/commands/export-report.md +78 -0
- package/skills/agent-workflow/commands/export-requirement.md +30 -0
- package/skills/agent-workflow/commands/export-scripts.md +92 -0
- package/skills/agent-workflow/commands/export-tech-manuals.md +75 -0
- package/skills/agent-workflow/commands/export-tech-note.md +30 -0
- package/skills/agent-workflow/commands/hub-init.md +82 -0
- package/skills/agent-workflow/commands/migrate.md +56 -0
- package/skills/agent-workflow/commands/project-init.md +60 -0
- package/skills/agent-workflow/commands/resume.md +22 -0
- package/skills/agent-workflow/commands/rules.md +40 -0
- package/skills/agent-workflow/commands/session.md +35 -0
- package/skills/agent-workflow/doctrine/README.md +15 -0
- package/skills/agent-workflow/doctrine/compact/SKILL.md +145 -0
- package/skills/agent-workflow/doctrine/doctor/SKILL.md +86 -0
- package/skills/agent-workflow/doctrine/doctor/SKILL.md.tmp +0 -0
- package/skills/agent-workflow/doctrine/hub-init/SKILL.md +157 -0
- package/skills/agent-workflow/doctrine/hub-init/SKILL.md.tmp +0 -0
- package/skills/agent-workflow/doctrine/hub-init/references/multiroot-manual.md +51 -0
- package/skills/agent-workflow/doctrine/implement/SKILL.md +290 -0
- package/skills/agent-workflow/doctrine/implement/references/branch-verification.md +16 -0
- package/skills/agent-workflow/doctrine/implement/references/design-md-template.md +108 -0
- package/skills/agent-workflow/doctrine/implement/references/rollback-guide.md +81 -0
- package/skills/agent-workflow/doctrine/migrate/SKILL.md +281 -0
- package/skills/agent-workflow/doctrine/migrate/SKILL.md.tmp +0 -0
- package/skills/agent-workflow/doctrine/project-init/SKILL.md +100 -0
- package/skills/agent-workflow/doctrine/project-init/SKILL.md.tmp +0 -0
- package/skills/agent-workflow/doctrine/refactor/SKILL.md +208 -0
- package/skills/agent-workflow/doctrine/refactor/references/refactor-md-template.md +108 -0
- package/skills/agent-workflow/doctrine/refactor/references/strangler-checklist.md +116 -0
- package/skills/agent-workflow/doctrine/resume/SKILL.md +199 -0
- package/skills/agent-workflow/doctrine/rules/SKILL.md +224 -0
- package/skills/agent-workflow/doctrine/rules/SKILL.md.tmp +0 -0
- package/skills/agent-workflow/doctrine/session/SKILL.md +383 -0
- package/skills/agent-workflow/doctrine/session/references/auto-plan-rules.md +63 -0
- package/skills/agent-workflow/doctrine/session/references/backlog-template.md +95 -0
- package/skills/agent-workflow/doctrine/session/references/branch-verification.md +198 -0
- package/skills/agent-workflow/doctrine/session/references/commits-policy.md +111 -0
- package/skills/agent-workflow/doctrine/session/references/communication-style.md +50 -0
- package/skills/agent-workflow/doctrine/session/references/graduacion-routing.md +88 -0
- package/skills/agent-workflow/doctrine/session/references/lifecycle-deep.md +160 -0
- package/skills/agent-workflow/doctrine/session/references/prompts/C1-specialty-selection.md +11 -0
- package/skills/agent-workflow/doctrine/session/references/prompts/C2-cost-guard.md +14 -0
- package/skills/agent-workflow/doctrine/session/references/prompts/M1-closure-commit-prompt.md +104 -0
- package/skills/agent-workflow/doctrine/session/references/prompts/M10-next-step.md +17 -0
- package/skills/agent-workflow/doctrine/session/references/prompts/M11-context.md +16 -0
- package/skills/agent-workflow/doctrine/session/references/prompts/M2-branch-caso-A.md +14 -0
- package/skills/agent-workflow/doctrine/session/references/prompts/M3-branch-caso-C.md +33 -0
- package/skills/agent-workflow/doctrine/session/references/prompts/M4-cross-source-hard-gate.md +33 -0
- package/skills/agent-workflow/doctrine/session/references/prompts/M5-modality-analyze.md +15 -0
- package/skills/agent-workflow/doctrine/session/references/prompts/M6-phase-gate.md +31 -0
- package/skills/agent-workflow/doctrine/session/references/prompts/M7-refactor-legacy-detected.md +28 -0
- package/skills/agent-workflow/doctrine/session/references/prompts/M8-refactor-cleanup.md +16 -0
- package/skills/agent-workflow/doctrine/session/references/prompts/M9-contract-review.md +39 -0
- package/skills/agent-workflow/doctrine/session/references/prompts/S1-type-design.md +15 -0
- package/skills/agent-workflow/doctrine/session/references/prompts/S2-topic-change-detection.md +14 -0
- package/skills/agent-workflow/doctrine/session/references/prompts/S3-flow-detection.md +28 -0
- package/skills/agent-workflow/doctrine/session/references/prompts/S4-resume.md +27 -0
- package/skills/agent-workflow/doctrine/session/references/prompts/S5-post-compact.md +17 -0
- package/skills/agent-workflow/doctrine/session/references/prompts/S6-scope.md +16 -0
- package/skills/agent-workflow/doctrine/session/references/prompts/S7-design-review.md +37 -0
- package/skills/agent-workflow/doctrine/session/references/prompts-catalog.md +210 -0
- package/skills/agent-workflow/doctrine/session/references/sandbox-readonly-rules.md +82 -0
- package/skills/agent-workflow/doctrine/session/references/specialty-decision-tree.md +56 -0
- package/skills/agent-workflow/doctrine/session/references/topic-change-rules.md +67 -0
- package/skills/agent-workflow/exports/README.md +15 -0
- package/skills/agent-workflow/exports/export-arq/SKILL.md +229 -0
- package/skills/agent-workflow/exports/export-arq/SKILL.md.tmp +0 -0
- package/skills/agent-workflow/exports/export-arq/references/lexico-tecnico.md +94 -0
- package/skills/agent-workflow/exports/export-arq/references/template-c4.md +293 -0
- package/skills/agent-workflow/exports/export-arq/references/template-plantuml.puml +77 -0
- package/skills/agent-workflow/exports/export-arq/references/template-structurizr.dsl +72 -0
- package/skills/agent-workflow/exports/export-arq/references/validations.md +231 -0
- package/skills/agent-workflow/exports/export-conclusions/SKILL.md +169 -0
- package/skills/agent-workflow/exports/export-conclusions/references/dedup-rules.md +154 -0
- package/skills/agent-workflow/exports/export-conclusions/references/template-conclusions.md +158 -0
- package/skills/agent-workflow/exports/export-plan/SKILL.md +225 -0
- package/skills/agent-workflow/exports/export-plan/references/state-transitions.md +141 -0
- package/skills/agent-workflow/exports/export-plan/references/template-plan.md +132 -0
- package/skills/agent-workflow/exports/export-qa-note/SKILL.md +31 -0
- package/skills/agent-workflow/exports/export-report/SKILL.md +262 -0
- package/skills/agent-workflow/exports/export-report/SKILL.md.tmp +0 -0
- package/skills/agent-workflow/exports/export-report/references/lexico.md +174 -0
- package/skills/agent-workflow/exports/export-report/references/template-a.md +95 -0
- package/skills/agent-workflow/exports/export-report/references/template-b.md +221 -0
- package/skills/agent-workflow/exports/export-report/references/template-c.md +180 -0
- package/skills/agent-workflow/exports/export-report/references/validations.md +255 -0
- package/skills/agent-workflow/exports/export-requirement/SKILL.md +31 -0
- package/skills/agent-workflow/exports/export-scripts/SKILL.md +324 -0
- package/skills/agent-workflow/exports/export-scripts/references/code-scan-recommendations.md +83 -0
- package/skills/agent-workflow/exports/export-scripts/references/deprecation-plan.md +80 -0
- package/skills/agent-workflow/exports/export-scripts/references/lexico-tecnico.md +80 -0
- package/skills/agent-workflow/exports/export-scripts/references/manifest-template.md +253 -0
- package/skills/agent-workflow/exports/export-scripts/references/readme-template.md +79 -0
- package/skills/agent-workflow/exports/export-scripts/references/theme-handling.md +168 -0
- package/skills/agent-workflow/exports/export-scripts/references/validations.md +242 -0
- package/skills/agent-workflow/exports/export-tech-manuals/SKILL.md +214 -0
- package/skills/agent-workflow/exports/export-tech-manuals/references/lexico-tecnico.md +97 -0
- package/skills/agent-workflow/exports/export-tech-manuals/references/template-index.md +123 -0
- package/skills/agent-workflow/exports/export-tech-manuals/references/template-manual.md +143 -0
- package/skills/agent-workflow/exports/export-tech-manuals/references/validations.md +211 -0
- package/skills/agent-workflow/exports/export-tech-note/SKILL.md +31 -0
- package/skills/agent-workflow/hooks/README.md +15 -0
- package/skills/agent-workflow/hooks/hooks.template.json +90 -0
- package/skills/agent-workflow/references/README.md +12 -0
- package/skills/agent-workflow/references/legacy-anchors.md +50 -0
- package/skills/agent-workflow/references/profile-parametrization.md +88 -0
- package/skills/agent-workflow/specialties/README.md +14 -0
- package/skills/agent-workflow/specialties/analyze-conclude/SKILL.md +175 -0
- package/skills/agent-workflow/specialties/analyze-conclude/references/incident-classification.md +61 -0
- package/skills/agent-workflow/specialties/analyze-investigate/SKILL.md +148 -0
- package/skills/agent-workflow/specialties/analyze-investigate/SKILL.md.tmp +0 -0
- package/skills/agent-workflow/specialties/analyze-investigate/references/cost-guard.md +85 -0
- package/skills/agent-workflow/specialties/analyze-synthesize/SKILL.md +127 -0
- package/skills/agent-workflow/specialties/design-brief/SKILL.md +90 -0
- package/skills/agent-workflow/specialties/design-deliver/SKILL.md +121 -0
- package/skills/agent-workflow/specialties/design-develop/SKILL.md +115 -0
- package/skills/agent-workflow/specialties/design-discover/SKILL.md +103 -0
- package/skills/agent-workflow/standards/README.md +12 -0
- package/skills/agent-workflow/standards/coding-standards/SKILL.md +102 -0
- package/skills/agent-workflow/standards/coding-standards/SKILL.md.tmp +0 -0
- package/skills/agent-workflow/standards/coding-standards/references/angular-typescript.md +266 -0
- package/skills/agent-workflow/standards/coding-standards/references/database-conventions.md +170 -0
- package/skills/agent-workflow/standards/coding-standards/references/fe-be-integration.md +300 -0
- package/skills/agent-workflow/standards/coding-standards/references/frontend-structure.md +182 -0
- package/skills/agent-workflow/standards/coding-standards/references/java-spring.md +244 -0
- package/skills/agent-workflow/standards/coding-standards/references/project-structure.md +197 -0
- package/skills/agent-workflow/standards/frontend-design/SKILL.md +62 -0
- package/skills/agent-workflow/standards/frontend-design/references/feedback-toasts-patterns.md +249 -0
- package/skills/agent-workflow/standards/frontend-design/references/form-patterns.md +278 -0
- package/skills/agent-workflow/standards/frontend-design/references/list-patterns.md +256 -0
- package/skills/agent-workflow/standards/frontend-design/references/modal-patterns.md +220 -0
- package/skills/agent-workflow/standards/frontend-design/references/navigation-patterns.md +224 -0
- package/skills/agent-workflow/standards/redaccion-simple/SKILL.md +128 -0
- package/skills/agent-workflow/standards/sql-rollback-generator/SKILL.md +197 -0
- package/skills/agent-workflow/standards/sql-rollback-generator/references/irreversible-checklist.md +161 -0
- package/skills/agent-workflow/standards/sql-rollback-generator/references/release-rollback.md +131 -0
- package/skills/agent-workflow/standards/sql-rollback-generator/references/rollback-patterns.md +255 -0
- package/skills/agent-workflow/standards/sql-script-organizer/SKILL.md +244 -0
- package/skills/agent-workflow/standards/sql-script-organizer/references/bundle-readme-template.md +82 -0
- package/skills/agent-workflow/standards/sql-script-organizer/references/categorization-rules.md +122 -0
- package/skills/agent-workflow/standards/sql-script-organizer/references/consolidation-cross-session.md +125 -0
- package/skills/agent-workflow/standards/sql-script-organizer/references/scripts-sql-format.md +140 -0
- package/skills/agent-workflow/standards/testing-strategy/SKILL.md +113 -0
- package/skills/agent-workflow/standards/testing-strategy/references/test-levels.md +255 -0
- package/skills/agent-workflow/workflows/README.md +12 -0
- package/skills/agent-workflow/workflows/analyze-workflow/SKILL.md +107 -0
- package/skills/agent-workflow/workflows/design-workflow/SKILL.md +100 -0
- package/skills/agent-workflow/workflows/dev-workflow/SKILL.md +195 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @tacuchi/agent-workflow-cli
|
|
2
2
|
|
|
3
|
-
Agnostic runtime CLI for session-lifecycle workflows.
|
|
3
|
+
Agnostic runtime CLI for session-lifecycle workflows. Bundles the universal `agent-workflow` skill (35 skills + 17 commands + 7 hooks template) and supports multi-empresa parametrization via `profile.json` cascade. Pairs with optional company-specific plugins for legacy aliases.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -10,31 +10,84 @@ npm install -g @tacuchi/agent-workflow-cli
|
|
|
10
10
|
|
|
11
11
|
The CLI exposes two binaries: `agent-workflow` (canonical) and `aw` (short alias).
|
|
12
12
|
|
|
13
|
-
## Bundled
|
|
13
|
+
## Bundled SKILL (v7.0.0+)
|
|
14
14
|
|
|
15
|
-
The published tarball bundles the `agent-workflow
|
|
15
|
+
The published tarball bundles the universal `agent-workflow` SKILL under `skills/agent-workflow/`. Install it into your host's skill directory with `--target` (obligatorio desde v7.0.0):
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
|
|
18
|
+
# Specific host
|
|
19
|
+
agent-workflow self install-skill --target claude
|
|
20
|
+
agent-workflow self install-skill --target codex
|
|
21
|
+
agent-workflow self install-skill --target warp
|
|
22
|
+
|
|
23
|
+
# All detected hosts (requires --confirm-all)
|
|
24
|
+
agent-workflow self install-skill --target all --confirm-all
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
By default, the CLI clears any plugin cache for the target host before installing. Opt out with `--keep-cache`.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Detect which hosts are present + which already have the SKILL
|
|
31
|
+
agent-workflow self detect-hosts
|
|
32
|
+
|
|
33
|
+
# Install hooks into ~/.claude/settings.json (claude only for now)
|
|
34
|
+
agent-workflow self install-hooks --target claude
|
|
35
|
+
|
|
36
|
+
# Dry-run
|
|
37
|
+
agent-workflow self install-skill --target claude --dry-run
|
|
19
38
|
```
|
|
20
39
|
|
|
21
|
-
|
|
40
|
+
## Multi-empresa via profile.json
|
|
41
|
+
|
|
42
|
+
The universal SKILL reads a `profile.json` to parametrize 10 sensitive skills (project-init, hub-init, doctor, migrate, rules, analyze-investigate, coding-standards, export-arq, export-report, refactor). Profile resolution cascade (highest precedence first):
|
|
43
|
+
|
|
44
|
+
1. `--profile <path>` flag (explicit)
|
|
45
|
+
2. `AW_PROFILE` env var
|
|
46
|
+
3. `~/.config/agent-workflow/profile.json` (user-level)
|
|
47
|
+
4. `<cwd>/.<namespace>/profile.json` (workspace-level)
|
|
48
|
+
5. Embedded `DEFAULT_PROFILE` (8 fields with agnostic defaults)
|
|
49
|
+
|
|
50
|
+
Schema (8 fields): `namespace` (kebab) · `company` · `claude_md_block` (`[A-Z][A-Z0-9_-]*`) · `mcp_databases[]` · `lexicon_path` · `examples_path` · `migrate_legacy_rules[]` · `custom_anchors[]`. See `skills/agent-workflow/references/profile-parametrization.md` for the per-skill contract.
|
|
51
|
+
|
|
52
|
+
Example QTC profile:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"namespace": "qtc",
|
|
57
|
+
"company": "QuetalCompra",
|
|
58
|
+
"claude_md_block": "QTC-PROJECT",
|
|
59
|
+
"mcp_databases": [
|
|
60
|
+
{ "alias": "qtc-cert", "host": "10.0.0.10", "port": 5432, "database": "qtc_cert" },
|
|
61
|
+
{ "alias": "qtc-prod", "host": "10.0.0.11", "port": 5432, "database": "qtc_prod" }
|
|
62
|
+
],
|
|
63
|
+
"lexicon_path": "profiles/lexico-qtc.md",
|
|
64
|
+
"examples_path": "profiles/examples-qtc.md",
|
|
65
|
+
"migrate_legacy_rules": [
|
|
66
|
+
{ "from": ".claude/sessions", "to": ".workflow/sessions", "scope": "anchor" }
|
|
67
|
+
],
|
|
68
|
+
"custom_anchors": [
|
|
69
|
+
{ "anchor": "qtc:super-admin-bypass", "target": "profiles/anchors/qtc-super-admin-bypass.md" }
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The QTC profile + legacy aliases ship in the `qtc-workflow-plugin` companion plugin (v4.0.0+).
|
|
22
75
|
|
|
23
76
|
### Override the source
|
|
24
77
|
|
|
25
|
-
Power users who want a specific revision
|
|
78
|
+
Power users who want a specific revision can pass `--from`:
|
|
26
79
|
|
|
27
80
|
```bash
|
|
28
|
-
#
|
|
29
|
-
agent-workflow self install-skill --from
|
|
30
|
-
|
|
31
|
-
# Copy from a local checkout
|
|
32
|
-
agent-workflow self install-skill --from /path/to/agent-workflow-manager
|
|
81
|
+
# Copy from a local checkout (skill development)
|
|
82
|
+
agent-workflow self install-skill --target claude --from /path/to/agent-workflow-cli/skills/agent-workflow
|
|
33
83
|
```
|
|
34
84
|
|
|
35
85
|
Flags:
|
|
36
86
|
|
|
37
|
-
- `--
|
|
87
|
+
- `--target <claude|codex|warp|oz|agents|all>` — obligatorio.
|
|
88
|
+
- `--confirm-all` — required when `--target all`.
|
|
89
|
+
- `--keep-cache` — skip the automatic plugin cache clear before install.
|
|
90
|
+
- `--force` — overwrite existing destination.
|
|
38
91
|
- `--dry-run` — preview without writing.
|
|
39
92
|
|
|
40
93
|
## Namespace resolution
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { EnvPort } from "../../ports/env.js";
|
|
2
|
+
import type { FileSystemPort } from "../../ports/file-system.js";
|
|
3
|
+
export declare const ENV_VAR_PROFILE = "AW_PROFILE";
|
|
4
|
+
export declare const USER_CONFIG_RELPATH: string;
|
|
5
|
+
export declare const WORKSPACE_PROFILE_FILENAME = "profile.json";
|
|
6
|
+
export declare const DEFAULT_NAMESPACE = "agent-workflow";
|
|
7
|
+
export interface ProfileMcpDatabase {
|
|
8
|
+
alias: string;
|
|
9
|
+
host: string;
|
|
10
|
+
port: number;
|
|
11
|
+
database: string;
|
|
12
|
+
schema?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ProfileLegacyRule {
|
|
15
|
+
from: string;
|
|
16
|
+
to: string;
|
|
17
|
+
scope?: "skill" | "command" | "hook" | "anchor";
|
|
18
|
+
}
|
|
19
|
+
export interface ProfileCustomAnchor {
|
|
20
|
+
anchor: string;
|
|
21
|
+
target: string;
|
|
22
|
+
}
|
|
23
|
+
export interface Profile {
|
|
24
|
+
namespace: string;
|
|
25
|
+
company: string;
|
|
26
|
+
claude_md_block: string;
|
|
27
|
+
mcp_databases: ProfileMcpDatabase[];
|
|
28
|
+
lexicon_path: string | null;
|
|
29
|
+
examples_path: string | null;
|
|
30
|
+
migrate_legacy_rules: ProfileLegacyRule[];
|
|
31
|
+
custom_anchors: ProfileCustomAnchor[];
|
|
32
|
+
}
|
|
33
|
+
export declare const DEFAULT_PROFILE: Profile;
|
|
34
|
+
export type ProfileSource = "flag" | "env" | "user-config" | "workspace" | "default";
|
|
35
|
+
export interface ResolvedProfile {
|
|
36
|
+
profile: Profile;
|
|
37
|
+
source: ProfileSource;
|
|
38
|
+
path: string | null;
|
|
39
|
+
}
|
|
40
|
+
export type ProfileErrorCode = "PROFILE_NOT_FOUND" | "PROFILE_INVALID_JSON" | "PROFILE_INVALID_SCHEMA";
|
|
41
|
+
export interface ProfileError {
|
|
42
|
+
code: ProfileErrorCode;
|
|
43
|
+
message: string;
|
|
44
|
+
path?: string;
|
|
45
|
+
field?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface ResolveProfileInput {
|
|
48
|
+
flagPath?: string | null;
|
|
49
|
+
workspaceNamespace?: string;
|
|
50
|
+
}
|
|
51
|
+
export declare function resolveProfile(fs: FileSystemPort, env: EnvPort, input?: ResolveProfileInput): Promise<ResolvedProfile | ProfileError>;
|
|
52
|
+
export declare function validateProfile(raw: unknown, path?: string): Profile | ProfileError;
|
|
53
|
+
//# sourceMappingURL=profile-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-service.d.ts","sourceRoot":"","sources":["../../../src/application/profile/profile-service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,eAAO,MAAM,eAAe,eAAe,CAAC;AAC5C,eAAO,MAAM,mBAAmB,QAAoD,CAAC;AACrF,eAAO,MAAM,0BAA0B,iBAAiB,CAAC;AACzD,eAAO,MAAM,iBAAiB,mBAAmB,CAAC;AAElD,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;CACjD;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,OAAO;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,kBAAkB,EAAE,CAAC;IACpC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,oBAAoB,EAAE,iBAAiB,EAAE,CAAC;IAC1C,cAAc,EAAE,mBAAmB,EAAE,CAAC;CACvC;AAED,eAAO,MAAM,eAAe,EAAE,OASjB,CAAC;AAEd,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,KAAK,GAAG,aAAa,GAAG,WAAW,GAAG,SAAS,CAAC;AAErF,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,aAAa,CAAC;IACtB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,MAAM,gBAAgB,GACxB,mBAAmB,GACnB,sBAAsB,GACtB,wBAAwB,CAAC;AAE7B,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAsB,cAAc,CAClC,EAAE,EAAE,cAAc,EAClB,GAAG,EAAE,OAAO,EACZ,KAAK,GAAE,mBAAwB,GAC9B,OAAO,CAAC,eAAe,GAAG,YAAY,CAAC,CA4BzC;AAkCD,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,YAAY,CAgBnF"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { isAbsolute, join } from "node:path";
|
|
2
|
+
export const ENV_VAR_PROFILE = "AW_PROFILE";
|
|
3
|
+
export const USER_CONFIG_RELPATH = join(".config", "agent-workflow", "profile.json");
|
|
4
|
+
export const WORKSPACE_PROFILE_FILENAME = "profile.json";
|
|
5
|
+
export const DEFAULT_NAMESPACE = "agent-workflow";
|
|
6
|
+
export const DEFAULT_PROFILE = Object.freeze({
|
|
7
|
+
namespace: DEFAULT_NAMESPACE,
|
|
8
|
+
company: "agent-workflow",
|
|
9
|
+
claude_md_block: "AW-PROJECT",
|
|
10
|
+
mcp_databases: [],
|
|
11
|
+
lexicon_path: null,
|
|
12
|
+
examples_path: null,
|
|
13
|
+
migrate_legacy_rules: [],
|
|
14
|
+
custom_anchors: [],
|
|
15
|
+
});
|
|
16
|
+
export async function resolveProfile(fs, env, input = {}) {
|
|
17
|
+
const cwd = env.cwd();
|
|
18
|
+
const home = env.homeDir();
|
|
19
|
+
const wsNs = (input.workspaceNamespace ?? DEFAULT_NAMESPACE).trim() || DEFAULT_NAMESPACE;
|
|
20
|
+
const flagPath = (input.flagPath ?? "").trim();
|
|
21
|
+
if (flagPath.length > 0) {
|
|
22
|
+
const abs = isAbsolute(flagPath) ? flagPath : join(cwd, flagPath);
|
|
23
|
+
return loadOrFail(fs, abs, "flag");
|
|
24
|
+
}
|
|
25
|
+
const envValue = (env.get(ENV_VAR_PROFILE) ?? "").trim();
|
|
26
|
+
if (envValue.length > 0) {
|
|
27
|
+
const abs = isAbsolute(envValue) ? envValue : join(cwd, envValue);
|
|
28
|
+
return loadOrFail(fs, abs, "env");
|
|
29
|
+
}
|
|
30
|
+
const userPath = join(home, USER_CONFIG_RELPATH);
|
|
31
|
+
if (await fs.exists(userPath)) {
|
|
32
|
+
return loadOrFail(fs, userPath, "user-config");
|
|
33
|
+
}
|
|
34
|
+
const workspacePath = join(cwd, `.${wsNs}`, WORKSPACE_PROFILE_FILENAME);
|
|
35
|
+
if (await fs.exists(workspacePath)) {
|
|
36
|
+
return loadOrFail(fs, workspacePath, "workspace");
|
|
37
|
+
}
|
|
38
|
+
return { profile: cloneProfile(DEFAULT_PROFILE), source: "default", path: null };
|
|
39
|
+
}
|
|
40
|
+
async function loadOrFail(fs, path, source) {
|
|
41
|
+
if (!(await fs.exists(path))) {
|
|
42
|
+
return {
|
|
43
|
+
code: "PROFILE_NOT_FOUND",
|
|
44
|
+
message: `profile no encontrado (${source}): ${path}`,
|
|
45
|
+
path,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const text = await fs.readText(path);
|
|
49
|
+
const parsed = parseAndValidate(text, path);
|
|
50
|
+
if ("code" in parsed)
|
|
51
|
+
return parsed;
|
|
52
|
+
return { profile: parsed, source, path };
|
|
53
|
+
}
|
|
54
|
+
function parseAndValidate(text, path) {
|
|
55
|
+
let raw;
|
|
56
|
+
try {
|
|
57
|
+
raw = JSON.parse(text);
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
return {
|
|
61
|
+
code: "PROFILE_INVALID_JSON",
|
|
62
|
+
message: `JSON inválido en ${path}: ${err.message}`,
|
|
63
|
+
path,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
return validateProfile(raw, path);
|
|
67
|
+
}
|
|
68
|
+
export function validateProfile(raw, path) {
|
|
69
|
+
if (!isObject(raw))
|
|
70
|
+
return failSchema("root", "objeto esperado", path);
|
|
71
|
+
const scalarErr = validateScalarFields(raw, path);
|
|
72
|
+
if (scalarErr !== null)
|
|
73
|
+
return scalarErr;
|
|
74
|
+
const arrayErr = validateArrayFields(raw, path);
|
|
75
|
+
if (arrayErr !== null)
|
|
76
|
+
return arrayErr;
|
|
77
|
+
return {
|
|
78
|
+
namespace: raw.namespace,
|
|
79
|
+
company: raw.company,
|
|
80
|
+
claude_md_block: raw.claude_md_block,
|
|
81
|
+
mcp_databases: raw.mcp_databases.map((d) => ({ ...d })),
|
|
82
|
+
lexicon_path: (raw.lexicon_path ?? null),
|
|
83
|
+
examples_path: (raw.examples_path ?? null),
|
|
84
|
+
migrate_legacy_rules: raw.migrate_legacy_rules.map((r) => ({ ...r })),
|
|
85
|
+
custom_anchors: raw.custom_anchors.map((a) => ({ ...a })),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function validateScalarFields(raw, path) {
|
|
89
|
+
if (!isNonEmptyString(raw.namespace) || !isKebab(raw.namespace)) {
|
|
90
|
+
return failSchema("namespace", "string kebab no vacío (^[a-z][a-z0-9-]*$)", path);
|
|
91
|
+
}
|
|
92
|
+
if (!isNonEmptyString(raw.company)) {
|
|
93
|
+
return failSchema("company", "string no vacío", path);
|
|
94
|
+
}
|
|
95
|
+
if (!isNonEmptyString(raw.claude_md_block) ||
|
|
96
|
+
!/^[A-Z][A-Z0-9_-]*$/.test(raw.claude_md_block)) {
|
|
97
|
+
return failSchema("claude_md_block", "string [A-Z][A-Z0-9_-]*", path);
|
|
98
|
+
}
|
|
99
|
+
const lexErr = validateNullableString(raw.lexicon_path, "lexicon_path", path);
|
|
100
|
+
if (lexErr !== null)
|
|
101
|
+
return lexErr;
|
|
102
|
+
const exErr = validateNullableString(raw.examples_path, "examples_path", path);
|
|
103
|
+
if (exErr !== null)
|
|
104
|
+
return exErr;
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
function validateNullableString(value, field, path) {
|
|
108
|
+
if (value === null || value === undefined)
|
|
109
|
+
return null;
|
|
110
|
+
if (!isNonEmptyString(value))
|
|
111
|
+
return failSchema(field, "string no vacío o null", path);
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
function validateArrayFields(raw, path) {
|
|
115
|
+
const mcpErr = validateArray(raw.mcp_databases, "mcp_databases", validateMcpDatabase, path);
|
|
116
|
+
if (mcpErr !== null)
|
|
117
|
+
return mcpErr;
|
|
118
|
+
const ruleErr = validateArray(raw.migrate_legacy_rules, "migrate_legacy_rules", validateLegacyRule, path);
|
|
119
|
+
if (ruleErr !== null)
|
|
120
|
+
return ruleErr;
|
|
121
|
+
const anchorErr = validateArray(raw.custom_anchors, "custom_anchors", validateAnchor, path);
|
|
122
|
+
if (anchorErr !== null)
|
|
123
|
+
return anchorErr;
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
function validateArray(value, field, item, path) {
|
|
127
|
+
if (!Array.isArray(value))
|
|
128
|
+
return failSchema(field, "array", path);
|
|
129
|
+
for (let i = 0; i < value.length; i++) {
|
|
130
|
+
const err = item(value[i], i, path);
|
|
131
|
+
if (err !== null)
|
|
132
|
+
return err;
|
|
133
|
+
}
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
function validateMcpDatabase(raw, idx, path) {
|
|
137
|
+
const field = `mcp_databases[${idx}]`;
|
|
138
|
+
if (!isObject(raw))
|
|
139
|
+
return failSchema(field, "objeto esperado", path);
|
|
140
|
+
if (!isNonEmptyString(raw.alias))
|
|
141
|
+
return failSchema(`${field}.alias`, "string no vacío", path);
|
|
142
|
+
if (!isNonEmptyString(raw.host))
|
|
143
|
+
return failSchema(`${field}.host`, "string no vacío", path);
|
|
144
|
+
if (typeof raw.port !== "number" ||
|
|
145
|
+
!Number.isInteger(raw.port) ||
|
|
146
|
+
raw.port <= 0 ||
|
|
147
|
+
raw.port > 65535) {
|
|
148
|
+
return failSchema(`${field}.port`, "entero 1-65535", path);
|
|
149
|
+
}
|
|
150
|
+
if (!isNonEmptyString(raw.database))
|
|
151
|
+
return failSchema(`${field}.database`, "string no vacío", path);
|
|
152
|
+
if (raw.schema !== undefined && !isNonEmptyString(raw.schema)) {
|
|
153
|
+
return failSchema(`${field}.schema`, "string no vacío o undefined", path);
|
|
154
|
+
}
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
function validateLegacyRule(raw, idx, path) {
|
|
158
|
+
const field = `migrate_legacy_rules[${idx}]`;
|
|
159
|
+
if (!isObject(raw))
|
|
160
|
+
return failSchema(field, "objeto esperado", path);
|
|
161
|
+
if (!isNonEmptyString(raw.from))
|
|
162
|
+
return failSchema(`${field}.from`, "string no vacío", path);
|
|
163
|
+
if (!isNonEmptyString(raw.to))
|
|
164
|
+
return failSchema(`${field}.to`, "string no vacío", path);
|
|
165
|
+
if (raw.scope !== undefined &&
|
|
166
|
+
!["skill", "command", "hook", "anchor"].includes(raw.scope)) {
|
|
167
|
+
return failSchema(`${field}.scope`, "skill|command|hook|anchor o undefined", path);
|
|
168
|
+
}
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
function validateAnchor(raw, idx, path) {
|
|
172
|
+
const field = `custom_anchors[${idx}]`;
|
|
173
|
+
if (!isObject(raw))
|
|
174
|
+
return failSchema(field, "objeto esperado", path);
|
|
175
|
+
if (!isNonEmptyString(raw.anchor))
|
|
176
|
+
return failSchema(`${field}.anchor`, "string no vacío", path);
|
|
177
|
+
if (!isNonEmptyString(raw.target))
|
|
178
|
+
return failSchema(`${field}.target`, "string no vacío", path);
|
|
179
|
+
return null;
|
|
180
|
+
}
|
|
181
|
+
function isObject(v) {
|
|
182
|
+
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
183
|
+
}
|
|
184
|
+
function isNonEmptyString(v) {
|
|
185
|
+
return typeof v === "string" && v.trim().length > 0;
|
|
186
|
+
}
|
|
187
|
+
function isKebab(s) {
|
|
188
|
+
return /^[a-z][a-z0-9-]*$/.test(s);
|
|
189
|
+
}
|
|
190
|
+
function failSchema(field, expected, path) {
|
|
191
|
+
return {
|
|
192
|
+
code: "PROFILE_INVALID_SCHEMA",
|
|
193
|
+
message: `${field}: ${expected}`,
|
|
194
|
+
field,
|
|
195
|
+
...(path !== undefined ? { path } : {}),
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
function cloneProfile(p) {
|
|
199
|
+
return {
|
|
200
|
+
namespace: p.namespace,
|
|
201
|
+
company: p.company,
|
|
202
|
+
claude_md_block: p.claude_md_block,
|
|
203
|
+
mcp_databases: p.mcp_databases.map((d) => ({ ...d })),
|
|
204
|
+
lexicon_path: p.lexicon_path,
|
|
205
|
+
examples_path: p.examples_path,
|
|
206
|
+
migrate_legacy_rules: p.migrate_legacy_rules.map((r) => ({ ...r })),
|
|
207
|
+
custom_anchors: p.custom_anchors.map((a) => ({ ...a })),
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=profile-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-service.js","sourceRoot":"","sources":["../../../src/application/profile/profile-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE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CAAC,CAAC;QACrD,YAAY,EAAE,CAAC,CAAC,YAAY;QAC5B,aAAa,EAAE,CAAC,CAAC,aAAa;QAC9B,oBAAoB,EAAE,CAAC,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;QACnE,cAAc,EAAE,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;KACxD,CAAC;AACJ,CAAC"}
|
|
@@ -68,10 +68,11 @@ function buildUninstallArgs(dryRun) {
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
function buildInstallArgs(dryRun) {
|
|
71
|
+
const baseFlags = dryRun ? ["--force", "--dry-run"] : ["--force", "--confirm-all"];
|
|
71
72
|
return {
|
|
72
73
|
rest: [],
|
|
73
74
|
plugin: {},
|
|
74
|
-
flags: new Set(
|
|
75
|
+
flags: new Set(baseFlags),
|
|
75
76
|
values: new Map([["target", "all"]]),
|
|
76
77
|
valuesMulti: new Map(),
|
|
77
78
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../src/application/self/bootstrap.ts"],"names":[],"mappings":"AAGA,OAAO,EAAyB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAGL,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAA+B,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAsBvF,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,IAAgB,EAChB,GAAe;IAEf,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC3C,MAAM,KAAK,GAAoB,EAAE,CAAC;IAElC,MAAM,YAAY,GAAG,MAAM,UAAU,CAAC,GAAG,CAAC,CAAC;IA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EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAC3E,MAAM,gBAAgB,GACpB,QAAQ,CAAC,MAAM,GAAG,CAAC;QACjB,CAAC,CAAC,yBAAyB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;QACjD,CAAC,CAAC,0EAA0E,CAAC;IACjF,OAAO,uBAAuB,EAAE,cAAc,OAAO,cAAc,gBAAgB,gEAAgE,CAAC;AACtJ,CAAC;AAED,SAAS,YAAY,CAAC,KAAsB,EAAE,OAAe;IAC3D,OAAO;QACL,EAAE,EAAE,IAAI;QACR,IAAI,EAAE;YACJ,KAAK;YACL,UAAU,EAAE,EAAE;YACd,OAAO;SACR;QACD,QAAQ,EAAE,CAAC;KACZ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CliContext } from "../../cli/types.js";
|
|
2
|
+
import type { CommandResult } from "../../domain/types.js";
|
|
3
|
+
import { type InstallTarget } from "./install-skill.js";
|
|
4
|
+
export interface DetectedHost {
|
|
5
|
+
target: InstallTarget;
|
|
6
|
+
config_dir: string;
|
|
7
|
+
config_dir_present: boolean;
|
|
8
|
+
skill_installed: boolean;
|
|
9
|
+
skill_path: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SelfDetectHostsData {
|
|
12
|
+
hosts: DetectedHost[];
|
|
13
|
+
detected_count: number;
|
|
14
|
+
installed_count: number;
|
|
15
|
+
summary: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function selfDetectHosts(ctx: CliContext): Promise<CommandResult<SelfDetectHostsData>>;
|
|
18
|
+
//# sourceMappingURL=detect-hosts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-hosts.d.ts","sourceRoot":"","sources":["../../../src/application/self/detect-hosts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,KAAK,aAAa,EAAgC,MAAM,oBAAoB,CAAC;AAEtF,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,aAAa,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB;AAID,wBAAsB,eAAe,CACnC,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC,CA6B7C"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { SKILL_DIR_NAME, TARGET_ROOTS } from "./install-skill.js";
|
|
3
|
+
const HOST_ORDER = ["claude", "codex", "warp", "oz", "agents"];
|
|
4
|
+
export async function selfDetectHosts(ctx) {
|
|
5
|
+
const home = ctx.env.homeDir();
|
|
6
|
+
const hosts = [];
|
|
7
|
+
for (const target of HOST_ORDER) {
|
|
8
|
+
const skillPath = join(home, ...TARGET_ROOTS[target], SKILL_DIR_NAME);
|
|
9
|
+
const configDir = join(home, `.${target}`);
|
|
10
|
+
const [configPresent, skillInstalled] = await Promise.all([
|
|
11
|
+
ctx.fs.exists(configDir),
|
|
12
|
+
ctx.fs.exists(skillPath),
|
|
13
|
+
]);
|
|
14
|
+
hosts.push({
|
|
15
|
+
target,
|
|
16
|
+
config_dir: configDir,
|
|
17
|
+
config_dir_present: configPresent,
|
|
18
|
+
skill_installed: skillInstalled,
|
|
19
|
+
skill_path: skillPath,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
const detectedCount = hosts.filter((h) => h.config_dir_present).length;
|
|
23
|
+
const installedCount = hosts.filter((h) => h.skill_installed).length;
|
|
24
|
+
const summary = buildSummary(detectedCount, installedCount);
|
|
25
|
+
return {
|
|
26
|
+
ok: true,
|
|
27
|
+
data: { hosts, detected_count: detectedCount, installed_count: installedCount, summary },
|
|
28
|
+
exitCode: 0,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function buildSummary(detected, installed) {
|
|
32
|
+
if (detected === 0) {
|
|
33
|
+
return "No host config directories detected. Run any host (Claude Code / Codex / Warp / OZ) once to create them.";
|
|
34
|
+
}
|
|
35
|
+
return `Detected ${detected} host config dir(s); SKILL installed in ${installed}.`;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=detect-hosts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-hosts.js","sourceRoot":"","sources":["../../../src/application/self/detect-hosts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAsB,cAAc,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAiBtF,MAAM,UAAU,GAA6B,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AAEzF,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,GAAe;IAEf,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IAC/B,MAAM,KAAK,GAAmB,EAAE,CAAC;IAEjC,KAAK,MAAM,MAAM,IAAI,UAAU,EAAE,CAAC;QAChC,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,EAAE,GAAG,YAAY,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC,CAAC;QACtE,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,MAAM,EAAE,CAAC,CAAC;QAC3C,MAAM,CAAC,aAAa,EAAE,cAAc,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACxD,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC;YACxB,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC;SACzB,CAAC,CAAC;QACH,KAAK,CAAC,IAAI,CAAC;YACT,MAAM;YACN,UAAU,EAAE,SAAS;YACrB,kBAAkB,EAAE,aAAa;YACjC,eAAe,EAAE,cAAc;YAC/B,UAAU,EAAE,SAAS;SACtB,CAAC,CAAC;IACL,CAAC;IAED,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC;IACvE,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC;IACrE,MAAM,OAAO,GAAG,YAAY,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;IAE5D,OAAO;QACL,EAAE,EAAE,IAAI;QACR,IAAI,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO,EAAE;QACxF,QAAQ,EAAE,CAAC;KACZ,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,QAAgB,EAAE,SAAiB;IACvD,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACnB,OAAO,0GAA0G,CAAC;IACpH,CAAC;IACD,OAAO,YAAY,QAAQ,2CAA2C,SAAS,GAAG,CAAC;AACrF,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ParsedArgs } from "../../cli/parser.js";
|
|
2
|
+
import type { CliContext } from "../../cli/types.js";
|
|
3
|
+
import type { CommandResult } from "../../domain/types.js";
|
|
4
|
+
import type { InstallTarget } from "./install-skill.js";
|
|
5
|
+
export interface HookEntry {
|
|
6
|
+
matcher?: string;
|
|
7
|
+
hooks: HookCommand[];
|
|
8
|
+
}
|
|
9
|
+
export interface HookCommand {
|
|
10
|
+
type: string;
|
|
11
|
+
command?: string;
|
|
12
|
+
prompt?: string;
|
|
13
|
+
timeout?: number;
|
|
14
|
+
statusMessage?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface HooksTemplate {
|
|
17
|
+
hooks: Record<string, HookEntry[]>;
|
|
18
|
+
}
|
|
19
|
+
export interface SelfInstallHooksData {
|
|
20
|
+
status: "installed" | "dry-run" | "noop" | "unsupported";
|
|
21
|
+
target: InstallTarget;
|
|
22
|
+
config_path: string | null;
|
|
23
|
+
events_installed: string[];
|
|
24
|
+
events_already_present: string[];
|
|
25
|
+
backup_path: string | null;
|
|
26
|
+
warning?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function selfInstallHooks(args: ParsedArgs, ctx: CliContext, resolveTemplate?: () => Promise<string | null>): Promise<CommandResult<SelfInstallHooksData>>;
|
|
29
|
+
export declare function resolveBundledHookTemplate(): Promise<string | null>;
|
|
30
|
+
//# sourceMappingURL=install-hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-hooks.d.ts","sourceRoot":"","sources":["../../../src/application/self/install-hooks.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,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