@planu/cli 0.77.0 → 0.79.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/dist/cli/commands/serve.d.ts.map +1 -1
- package/dist/cli/commands/serve.js +1 -1
- package/dist/cli/commands/serve.js.map +1 -1
- package/dist/config/contradiction-patterns.json +83 -0
- package/dist/config/estimation-tables.json +49 -0
- package/dist/config/license-plans.json +6 -1
- package/dist/engine/ci-generator/local-script.d.ts +8 -0
- package/dist/engine/ci-generator/local-script.d.ts.map +1 -0
- package/dist/engine/ci-generator/local-script.js +177 -0
- package/dist/engine/ci-generator/local-script.js.map +1 -0
- package/dist/engine/ci-generator/planu-steps.d.ts.map +1 -1
- package/dist/engine/ci-generator/planu-steps.js +37 -22
- package/dist/engine/ci-generator/planu-steps.js.map +1 -1
- package/dist/engine/config-loader.d.ts +73 -0
- package/dist/engine/config-loader.d.ts.map +1 -0
- package/dist/engine/config-loader.js +246 -0
- package/dist/engine/config-loader.js.map +1 -0
- package/dist/engine/config-schemas.d.ts +64 -0
- package/dist/engine/config-schemas.d.ts.map +1 -0
- package/dist/engine/config-schemas.js +55 -0
- package/dist/engine/config-schemas.js.map +1 -0
- package/dist/engine/telemetry/index.d.ts +3 -0
- package/dist/engine/telemetry/index.d.ts.map +1 -0
- package/dist/engine/telemetry/index.js +4 -0
- package/dist/engine/telemetry/index.js.map +1 -0
- package/dist/engine/telemetry/telemetry-client.d.ts +7 -0
- package/dist/engine/telemetry/telemetry-client.d.ts.map +1 -0
- package/dist/engine/telemetry/telemetry-client.js +29 -0
- package/dist/engine/telemetry/telemetry-client.js.map +1 -0
- package/dist/engine/telemetry/telemetry-store.d.ts +11 -0
- package/dist/engine/telemetry/telemetry-store.d.ts.map +1 -0
- package/dist/engine/telemetry/telemetry-store.js +55 -0
- package/dist/engine/telemetry/telemetry-store.js.map +1 -0
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/storage/ideas-store.d.ts +15 -0
- package/dist/storage/ideas-store.d.ts.map +1 -0
- package/dist/storage/ideas-store.js +37 -0
- package/dist/storage/ideas-store.js.map +1 -0
- package/dist/tools/capture-idea-handler.d.ts +4 -0
- package/dist/tools/capture-idea-handler.d.ts.map +1 -0
- package/dist/tools/capture-idea-handler.js +39 -0
- package/dist/tools/capture-idea-handler.js.map +1 -0
- package/dist/tools/ci-planu-handler.d.ts +2 -2
- package/dist/tools/ci-planu-handler.d.ts.map +1 -1
- package/dist/tools/ci-planu-handler.js +55 -22
- package/dist/tools/ci-planu-handler.js.map +1 -1
- package/dist/tools/configure-telemetry.d.ts +3 -0
- package/dist/tools/configure-telemetry.d.ts.map +1 -0
- package/dist/tools/configure-telemetry.js +55 -0
- package/dist/tools/configure-telemetry.js.map +1 -0
- package/dist/tools/discard-idea-handler.d.ts +4 -0
- package/dist/tools/discard-idea-handler.d.ts.map +1 -0
- package/dist/tools/discard-idea-handler.js +27 -0
- package/dist/tools/discard-idea-handler.js.map +1 -0
- package/dist/tools/git/cleanup-ops.d.ts +15 -0
- package/dist/tools/git/cleanup-ops.d.ts.map +1 -0
- package/dist/tools/git/cleanup-ops.js +417 -0
- package/dist/tools/git/cleanup-ops.js.map +1 -0
- package/dist/tools/init-project/handler.d.ts.map +1 -1
- package/dist/tools/init-project/handler.js +22 -0
- package/dist/tools/init-project/handler.js.map +1 -1
- package/dist/tools/init-project/result-builder.d.ts.map +1 -1
- package/dist/tools/init-project/result-builder.js +5 -1
- package/dist/tools/init-project/result-builder.js.map +1 -1
- package/dist/tools/license-gate.d.ts +6 -0
- package/dist/tools/license-gate.d.ts.map +1 -1
- package/dist/tools/license-gate.js +14 -0
- package/dist/tools/license-gate.js.map +1 -1
- package/dist/tools/list-backlog-handler.d.ts +4 -0
- package/dist/tools/list-backlog-handler.d.ts.map +1 -0
- package/dist/tools/list-backlog-handler.js +60 -0
- package/dist/tools/list-backlog-handler.js.map +1 -0
- package/dist/tools/manage-git.d.ts.map +1 -1
- package/dist/tools/manage-git.js +3 -0
- package/dist/tools/manage-git.js.map +1 -1
- package/dist/tools/promote-idea-handler.d.ts +4 -0
- package/dist/tools/promote-idea-handler.d.ts.map +1 -0
- package/dist/tools/promote-idea-handler.js +51 -0
- package/dist/tools/promote-idea-handler.js.map +1 -0
- package/dist/tools/register-backlog-tools.d.ts +3 -0
- package/dist/tools/register-backlog-tools.d.ts.map +1 -0
- package/dist/tools/register-backlog-tools.js +81 -0
- package/dist/tools/register-backlog-tools.js.map +1 -0
- package/dist/tools/register-ci-tools.d.ts.map +1 -1
- package/dist/tools/register-ci-tools.js +8 -0
- package/dist/tools/register-ci-tools.js.map +1 -1
- package/dist/tools/register-telemetry-tools.d.ts +3 -0
- package/dist/tools/register-telemetry-tools.d.ts.map +1 -0
- package/dist/tools/register-telemetry-tools.js +19 -0
- package/dist/tools/register-telemetry-tools.js.map +1 -0
- package/dist/tools/schemas/infra.d.ts +1 -1
- package/dist/tools/schemas/lifecycle.d.ts +1 -0
- package/dist/tools/schemas/lifecycle.d.ts.map +1 -1
- package/dist/tools/schemas/lifecycle.js +2 -1
- package/dist/tools/schemas/lifecycle.js.map +1 -1
- package/dist/tools/update-status-actions.d.ts.map +1 -1
- package/dist/tools/update-status-actions.js +12 -0
- package/dist/tools/update-status-actions.js.map +1 -1
- package/dist/types/ci.d.ts +16 -1
- package/dist/types/ci.d.ts.map +1 -1
- package/dist/types/common/tech-enums.d.ts +1 -1
- package/dist/types/common/tech-enums.d.ts.map +1 -1
- package/dist/types/estimation.d.ts +34 -0
- package/dist/types/estimation.d.ts.map +1 -1
- package/dist/types/git.d.ts +24 -0
- package/dist/types/git.d.ts.map +1 -1
- package/dist/types/ideas.d.ts +37 -0
- package/dist/types/ideas.d.ts.map +1 -0
- package/dist/types/ideas.js +3 -0
- package/dist/types/ideas.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/project/planu-config.d.ts +2 -0
- package/dist/types/project/planu-config.d.ts.map +1 -1
- package/dist/types/telemetry.d.ts +24 -0
- package/dist/types/telemetry.d.ts.map +1 -0
- package/dist/types/telemetry.js +3 -0
- package/dist/types/telemetry.js.map +1 -0
- package/package.json +1 -1
- package/src/config/contradiction-patterns.json +83 -0
- package/src/config/estimation-tables.json +49 -0
- package/src/config/license-plans.json +6 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { readJson, writeJson, hashProjectPath } from './base-store.js';
|
|
2
|
+
function ideasFile(projectPath) {
|
|
3
|
+
const hash = hashProjectPath(projectPath);
|
|
4
|
+
return `data/projects/${hash}/backlog/ideas.json`;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Save a new idea (appends to existing list).
|
|
8
|
+
*/
|
|
9
|
+
export async function saveIdea(projectPath, idea) {
|
|
10
|
+
const file = ideasFile(projectPath);
|
|
11
|
+
const existing = await readJson(file, []);
|
|
12
|
+
existing.push(idea);
|
|
13
|
+
await writeJson(file, existing);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Load all ideas for a project.
|
|
17
|
+
*/
|
|
18
|
+
export async function loadIdeas(projectPath) {
|
|
19
|
+
const file = ideasFile(projectPath);
|
|
20
|
+
return readJson(file, []);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Update a single idea by ID, applying partial patch.
|
|
24
|
+
* Returns the updated idea, or null if not found.
|
|
25
|
+
*/
|
|
26
|
+
export async function updateIdea(projectPath, id, patch) {
|
|
27
|
+
const file = ideasFile(projectPath);
|
|
28
|
+
const existing = await readJson(file, []);
|
|
29
|
+
const idx = existing.findIndex((i) => i.id === id);
|
|
30
|
+
if (idx === -1) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
existing[idx] = { ...existing[idx], ...patch };
|
|
34
|
+
await writeJson(file, existing);
|
|
35
|
+
return existing[idx] ?? null;
|
|
36
|
+
}
|
|
37
|
+
//# sourceM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,OAAO,IAAI,CAAC;IAAC,CAAC;IAChC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,EAAE,GAAG,KAAK,EAAc,CAAC;IAC3D,MAAM,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAChC,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture-idea-handler.d.ts","sourceRoot":"","sources":["../../src/tools/capture-idea-handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAY,MAAM,mBAAmB,CAAC;AAuBhF,qCAAqC;AACrC,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,CAsBpF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { loadIdeas, saveIdea } from '../storage/ideas-store.js';
|
|
2
|
+
const EXPIRY_DAYS = 90;
|
|
3
|
+
/** Generate a unique idea ID based on date and sequence number. */
|
|
4
|
+
async function generateIdeaId(projectPath) {
|
|
5
|
+
const ideas = await loadIdeas(projectPath);
|
|
6
|
+
const today = new Date();
|
|
7
|
+
const dateStr = today.toISOString().slice(0, 10).replace(/-/g, '');
|
|
8
|
+
const todayPrefix = `idea-${dateStr}-`;
|
|
9
|
+
const todayCount = ideas.filter((i) => i.id.startsWith(todayPrefix)).length;
|
|
10
|
+
const seq = String(todayCount + 1).padStart(3, '0');
|
|
11
|
+
return `${todayPrefix}${seq}`;
|
|
12
|
+
}
|
|
13
|
+
/** Calculate expiry date 90 days from now. */
|
|
14
|
+
function calculateExpiry() {
|
|
15
|
+
const expiry = new Date();
|
|
16
|
+
expiry.setDate(expiry.getDate() + EXPIRY_DAYS);
|
|
17
|
+
return expiry.toISOString();
|
|
18
|
+
}
|
|
19
|
+
/** Handle capture_idea tool call. */
|
|
20
|
+
export async function handleCaptureIdea(input) {
|
|
21
|
+
const { projectPath, title, description, tags = [] } = input;
|
|
22
|
+
const id = await generateIdeaId(projectPath);
|
|
23
|
+
const now = new Date().toISOString();
|
|
24
|
+
const idea = {
|
|
25
|
+
id,
|
|
26
|
+
title,
|
|
27
|
+
description,
|
|
28
|
+
tags,
|
|
29
|
+
capturedAt: now,
|
|
30
|
+
capturedFrom: 'tool',
|
|
31
|
+
status: 'new',
|
|
32
|
+
expiresAt: calculateExpiry(),
|
|
33
|
+
};
|
|
34
|
+
await saveIdea(projectPath, idea);
|
|
35
|
+
return {
|
|
36
|
+
content: [{ type: 'text', text: `Idea guardada: [${id}] ${title}` }],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=capture-idea-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture-idea-handler.js","sourceRoot":"","sources":["../../src/tools/capture-idea-handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEhE,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB,mEAAmE;AACnE,KAAK,UAAU,cAAc,CAAC,WAAmB;IAC/C,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,WAAW,CAAC,CAAC;IAC3C,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;IACzB,MAAM,OAAO,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACnE,MAAM,WAAW,GAAG,QAAQ,OAAO,GAAG,CAAC;IACvC,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC;IAC5E,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACpD,OAAO,GAAG,WAAW,GAAG,GAAG,EAAE,CAAC;AAChC,CAAC;AAED,8CAA8C;AAC9C,SAAS,eAAe;IACtB,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;IAC1B,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC,CAAC;IAC/C,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC;AAC9B,CAAC;AAED,qCAAqC;AACrC,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,KAAuB;IAC7D,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,GAAG,EAAE,EAAE,GAAG,KAAK,CAAC;IAE7D,MAAM,EAAE,GAAG,MAAM,cAAc,CAAC,WAAW,CAAC,CAAC;IAC7C,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAErC,MAAM,IAAI,GAAa;QACrB,EAAE;QACF,KAAK;QACL,WAAW;QACX,IAAI;QACJ,UAAU,EAAE,GAAG;QACf,YAAY,EAAE,MAAM;QACpB,MAAM,EAAE,KAAK;QACb,SAAS,EAAE,eAAe,EAAE;KAC7B,CAAC;IAEF,MAAM,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAElC,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,KAAK,EAAE,EAAE,CAAC;KACrE,CAAC;AACJ,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { GeneratePlanuCIInput, ToolResult } from '../types/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Handle the generate_planu_ci tool.
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Always generates a local planu-check.sh script (no GitHub billing required).
|
|
5
|
+
* Optionally generates a GitHub Actions workflow YAML for cloud CI.
|
|
6
6
|
*/
|
|
7
7
|
export declare function handleGeneratePlanuCI(args: GeneratePlanuCIInput): ToolResult;
|
|
8
8
|
//# sourceMappingURL=ci-planu-handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-planu-handler.d.ts","sourceRoot":"","sources":["../../src/tools/ci-planu-handler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG1E;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,oBAAoB,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"ci-planu-handler.d.ts","sourceRoot":"","sources":["../../src/tools/ci-planu-handler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG1E;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,oBAAoB,GAAG,UAAU,CAqF5E"}
|
|
@@ -1,42 +1,75 @@
|
|
|
1
|
-
// tools/ci-planu-handler.ts — Handle generate_planu_ci tool calls (SPEC-066 AC-02..07)
|
|
1
|
+
// tools/ci-planu-handler.ts — Handle generate_planu_ci tool calls (SPEC-066 AC-02..07, SPEC-201)
|
|
2
2
|
import { generatePlanuCI } from '../engine/ci-generator/planu-steps.js';
|
|
3
3
|
/**
|
|
4
4
|
* Handle the generate_planu_ci tool.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Always generates a local planu-check.sh script (no GitHub billing required).
|
|
6
|
+
* Optionally generates a GitHub Actions workflow YAML for cloud CI.
|
|
7
7
|
*/
|
|
8
8
|
export function handleGeneratePlanuCI(args) {
|
|
9
|
+
const includeGithubActions = args.includeGithubActions ?? true;
|
|
9
10
|
const result = generatePlanuCI(args);
|
|
10
11
|
const lines = [
|
|
11
12
|
'## Planu CI Workflow Generated',
|
|
12
13
|
'',
|
|
13
14
|
`**Features enabled**: ${result.features.join(', ')}`,
|
|
14
|
-
`**Workflow path**: \`${result.workflowPath}\``,
|
|
15
15
|
'',
|
|
16
|
-
'
|
|
16
|
+
'---',
|
|
17
17
|
'',
|
|
18
|
-
'
|
|
19
|
-
|
|
18
|
+
'### Option 1 — Local script (no GitHub billing required)',
|
|
19
|
+
'',
|
|
20
|
+
'Save `planu-check.sh` to your project root and run it directly:',
|
|
21
|
+
'',
|
|
22
|
+
'```bash',
|
|
23
|
+
'chmod +x planu-check.sh',
|
|
24
|
+
'./planu-check.sh',
|
|
25
|
+
'```',
|
|
26
|
+
'',
|
|
27
|
+
'```bash',
|
|
28
|
+
result.localScript.trimEnd(),
|
|
29
|
+
'```',
|
|
30
|
+
'',
|
|
31
|
+
'**Optional: run as git pre-push hook** (catches issues before pushing):',
|
|
32
|
+
'',
|
|
33
|
+
'```bash',
|
|
34
|
+
'ln -s ../../planu-check.sh .git/hooks/pre-push',
|
|
35
|
+
'```',
|
|
36
|
+
'',
|
|
37
|
+
'---',
|
|
38
|
+
'',
|
|
39
|
+
'### Option 2 — Run GitHub Actions locally with act (no billing)',
|
|
40
|
+
'',
|
|
41
|
+
'[act](https://github.com/nektos/act) runs GitHub Actions workflows on your machine.',
|
|
42
|
+
'The generated workflow is fully compatible with act:',
|
|
43
|
+
'',
|
|
44
|
+
'```bash',
|
|
45
|
+
'# Install act (macOS)',
|
|
46
|
+
'brew install act',
|
|
47
|
+
'',
|
|
48
|
+
'# Run the Planu check locally',
|
|
49
|
+
'act -j planu-check',
|
|
20
50
|
'```',
|
|
21
51
|
'',
|
|
22
52
|
];
|
|
53
|
+
if (includeGithubActions && result.workflowYaml) {
|
|
54
|
+
lines.push('---', '', `### Option 3 — GitHub Actions (requires billing for private repos)`, '', `**Workflow path**: \`${result.workflowPath}\``, '', '```yaml', result.workflowYaml.trimEnd(), '```', '');
|
|
55
|
+
}
|
|
23
56
|
// .planu.yml config
|
|
24
|
-
lines.push('### Generated .planu.yml Configuration');
|
|
25
|
-
lines.push('');
|
|
26
|
-
lines.push('```yaml');
|
|
57
|
+
lines.push('---', '', '### Generated .planu.yml Configuration', '', '```yaml');
|
|
27
58
|
lines.push(result.planuConfigYaml.trimEnd());
|
|
28
|
-
lines.push('```');
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
lines.push(
|
|
38
|
-
|
|
39
|
-
|
|
59
|
+
lines.push('```', '');
|
|
60
|
+
// Badge (only if GitHub Actions enabled)
|
|
61
|
+
if (includeGithubActions && result.badgeMarkdown) {
|
|
62
|
+
lines.push('### Badge for README', '');
|
|
63
|
+
lines.push('Add this to your README.md (replace `{owner}` and `{repo}` with your values):');
|
|
64
|
+
lines.push('', '```markdown');
|
|
65
|
+
lines.push(result.badgeMarkdown);
|
|
66
|
+
lines.push('```', '');
|
|
67
|
+
}
|
|
68
|
+
lines.push(`> **Save**: \`${result.localScriptPath}\` (local script, always)`);
|
|
69
|
+
if (includeGithubActions && result.workflowPath) {
|
|
70
|
+
lines.push(`> **Save**: \`${result.workflowPath}\` (GitHub Actions, optional)`);
|
|
71
|
+
}
|
|
72
|
+
lines.push('> **Save**: `.planu.yml` (shared config for both modes)');
|
|
40
73
|
return {
|
|
41
74
|
content: [{ type: 'text', text: lines.join('\n') }],
|
|
42
75
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-planu-handler.js","sourceRoot":"","sources":["../../src/tools/ci-planu-handler.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"ci-planu-handler.js","sourceRoot":"","sources":["../../src/tools/ci-planu-handler.ts"],"names":[],"mappings":"AAAA,iGAAiG;AAGjG,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,C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C,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAEtB,yCAAyC;IACzC,IAAI,oBAAoB,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;QACjD,KAAK,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC;QACvC,KAAK,CAAC,IAAI,CAAC,+EAA+E,CAAC,CAAC;QAC5F,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;QAC9B,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QACjC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,iBAAiB,MAAM,CAAC,eAAe,2BAA2B,CAAC,CAAC;IAC/E,IAAI,oBAAoB,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;QAChD,KAAK,CAAC,IAAI,CAAC,iBAAiB,MAAM,CAAC,YAAY,+BAA+B,CAAC,CAAC;IAClF,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC;IAEtE,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;KAC7D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configure-telemetry.d.ts","sourceRoot":"","sources":["../../src/tools/configure-telemetry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAmB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAO9F,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,uBAAuB,GAC7B,OAAO,CAAC,UAAU,CAAC,CAuDrB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { readTelemetryConfig, writeTelemetryConfig, getOrCreateInstallationId, } from '../engine/telemetry/index.js';
|
|
2
|
+
export async function handleConfigureTelemetry(input) {
|
|
3
|
+
try {
|
|
4
|
+
const installationId = await getOrCreateInstallationId();
|
|
5
|
+
const existing = await readTelemetryConfig();
|
|
6
|
+
if (input.action === 'status') {
|
|
7
|
+
const result = {
|
|
8
|
+
action: 'status',
|
|
9
|
+
enabled: existing?.enabled ?? false,
|
|
10
|
+
installationId,
|
|
11
|
+
message: existing?.enabled
|
|
12
|
+
? 'Telemetry is ENABLED. Anonymous usage events are being sent to help improve Planu.'
|
|
13
|
+
: 'Telemetry is DISABLED. No data is being collected.',
|
|
14
|
+
};
|
|
15
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
16
|
+
}
|
|
17
|
+
if (input.action === 'enable') {
|
|
18
|
+
await writeTelemetryConfig({
|
|
19
|
+
enabled: true,
|
|
20
|
+
installationId,
|
|
21
|
+
promptedAt: existing?.promptedAt ?? new Date().toISOString(),
|
|
22
|
+
});
|
|
23
|
+
const result = {
|
|
24
|
+
action: 'enable',
|
|
25
|
+
enabled: true,
|
|
26
|
+
installationId,
|
|
27
|
+
message: 'Telemetry ENABLED. Thank you! Only anonymous usage data is collected — ' +
|
|
28
|
+
'no paths, emails, or personal info. Your installation ID is ' +
|
|
29
|
+
`${installationId}. Run configure_telemetry with action=disable to opt out anytime.`,
|
|
30
|
+
};
|
|
31
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
32
|
+
}
|
|
33
|
+
// disable
|
|
34
|
+
await writeTelemetryConfig({
|
|
35
|
+
enabled: false,
|
|
36
|
+
installationId,
|
|
37
|
+
promptedAt: existing?.promptedAt ?? new Date().toISOString(),
|
|
38
|
+
});
|
|
39
|
+
const result = {
|
|
40
|
+
action: 'disable',
|
|
41
|
+
enabled: false,
|
|
42
|
+
installationId,
|
|
43
|
+
message: 'Telemetry DISABLED. No usage data will be sent.',
|
|
44
|
+
};
|
|
45
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
49
|
+
return {
|
|
50
|
+
content: [{ type: 'text', text: JSON.stringify({ error: message }, null, 2) }],
|
|
51
|
+
isError: true,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=configure-telemetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configure-telemetry.js","sourceRoot":"","sources":["../../src/tools/configure-telemetry.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,8BAA8B,CAAC;AAEtC,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,KAA8B;IAE9B,IAAI,CAAC;QACH,MAAM,cAAc,GAAG,MAAM,yBAAyB,EAAE,CAAC;QACzD,MAAM,QAAQ,GAAG,MAAM,mBAAmB,EAAE,CAAC;QAE7C,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,MAAM,GAAoB;gBAC9B,MAAM,EAAE,QAAQ;gBAChB,OAAO,EAAE,QAAQ,EAAE,OAAO,IAAI,KAAK;gBACnC,cAAc;gBACd,OAAO,EAAE,QAAQ,EAAE,OAAO;oBACxB,CAAC,CAAC,oFAAoF;oBACtF,CAAC,CAAC,oDAAoD;aACzD,CAAC;YACF,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QAChF,CAAC;QAED,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,oBAAoB,CAAC;gBACzB,OAAO,EAAE,IAAI;gBACb,cAAc;gBACd,UAAU,EAAE,QAAQ,EAAE,UAAU,IAAI,IAAI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AC;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ToolResult, DiscardIdeaInput } from '../types/index.js';
|
|
2
|
+
/** Handle discard_idea tool call. Idempotent if already discarded. */
|
|
3
|
+
export declare function handleDiscardIdea(input: DiscardIdeaInput): Promise<ToolResult>;
|
|
4
|
+
//# sourceMappingURL=discard-idea-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discard-idea-handler.d.ts","sourceRoot":"","sources":["../../src/tools/discard-idea-handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGtE,sEAAsE;AACtE,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,CA4BpF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { loadIdeas, updateIdea } from '../storage/ideas-store.js';
|
|
2
|
+
/** Handle discard_idea tool call. Idempotent if already discarded. */
|
|
3
|
+
export async function handleDiscardIdea(input) {
|
|
4
|
+
const { projectPath, ideaId, reason } = input;
|
|
5
|
+
const ideas = await loadIdeas(projectPath);
|
|
6
|
+
const idea = ideas.find((i) => i.id === ideaId);
|
|
7
|
+
if (!idea) {
|
|
8
|
+
return {
|
|
9
|
+
content: [{ type: 'text', text: `Idea not found: ${ideaId}` }],
|
|
10
|
+
isError: true,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
// Idempotent: already discarded
|
|
14
|
+
if (idea.status === 'discarded') {
|
|
15
|
+
return {
|
|
16
|
+
content: [{ type: 'text', text: `Idea "${idea.title}" was already discarded.` }],
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
await updateIdea(projectPath, ideaId, {
|
|
20
|
+
status: 'discarded',
|
|
21
|
+
discardedReason: reason,
|
|
22
|
+
});
|
|
23
|
+
return {
|
|
24
|
+
content: [{ type: 'text', text: `Idea "${idea.title}" discarded. Reason: ${reason}` }],
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=discard-idea-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discard-idea-handler.js","sourceRoot":"","sources":["../../src/tools/discard-idea-handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAElE,sEAAsE;AACtE,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,KAAuB;IAC7D,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAE9C,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,WAAW,CAAC,CAAC;IAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC;IAEhD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,MAAM,EAAE,EAAE,CAAC;YAC9D,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IAED,gCAAgC;IAChC,IAAI,IAAI,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;QAChC,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,IAAI,CAAC,KAAK,0BAA0B,EAAE,CAAC;SACjF,CAAC;IACJ,CAAC;IAED,MAAM,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE;QACpC,MAAM,EAAE,WAAW;QACnB,eAAe,EAAE,MAAM;KACxB,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,IAAI,CAAC,KAAK,wBAAwB,MAAM,EAAE,EAAE,CAAC;KACvF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ToolResult, GitConfig, SpecDoneCleanupResult } from '../../types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* AC-02: Eliminate gone branches + remote prune.
|
|
4
|
+
* AC-03: List stale stashes (>7d); drop if force=true.
|
|
5
|
+
* AC-05: Idempotent.
|
|
6
|
+
* AC-06: Never deletes active branch or current HEAD.
|
|
7
|
+
* AC-07: Returns detailed report.
|
|
8
|
+
*/
|
|
9
|
+
export declare function handleCleanup(projectId: string, config?: GitConfig): Promise<ToolResult>;
|
|
10
|
+
/**
|
|
11
|
+
* AC-01: When a spec is marked done, clean its worktree, local branch, and remote branch.
|
|
12
|
+
* Best-effort — never throws. Caller should fire-and-forget or log result.
|
|
13
|
+
*/
|
|
14
|
+
export declare function cleanupSpecOnDone(projectPath: string, specId: string, gitBranch: string | undefined): Promise<SpecDoneCleanupResult>;
|
|
15
|
+
//# sourceMappingURL=cleanup-ops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleanup-ops.d.ts","sourceRoot":"","sources":["../../../src/tools/git/cleanup-ops.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,UAAU,EAGV,SAAS,EACT,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAgR9B;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CA8E9F;AAsBD;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,OAAO,CAAC,qBAAqB,CAAC,CAqFhC"}
|