deuk-agent-flow 4.0.37 → 5.0.2
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/CHANGELOG.ko.md +282 -0
- package/CHANGELOG.md +788 -120
- package/LICENSE +0 -0
- package/README.ko.md +97 -17
- package/README.md +108 -25
- package/bin/deuk-agent-flow.js +11 -13
- package/bin/deuk-agent-rule.js +1 -1
- package/bundled/README.md +3 -0
- package/bundled/deuk-agent-flow.vsix +0 -0
- package/core-rules/AGENTS.md +30 -118
- package/docs/architecture.ko.md +155 -2
- package/docs/architecture.md +155 -2
- package/docs/assets/agentflow-panel-skills.png +0 -0
- package/docs/assets/agentflow-panel.png +0 -0
- package/docs/how-it-works.ko.md +109 -52
- package/docs/how-it-works.md +128 -71
- package/docs/principles.ko.md +68 -68
- package/docs/principles.md +68 -68
- package/docs/usage-guide.ko.md +251 -212
- package/package.json +41 -34
- package/scripts/bundle-vscode-vsix.ts +67 -0
- package/scripts/{cli-args.mjs → cli-args.ts} +49 -12
- package/scripts/cli-init-commands.ts +99 -0
- package/scripts/cli-init-logic.ts +46 -0
- package/scripts/{cli-prompts.mjs → cli-prompts.ts} +19 -34
- package/scripts/{cli-rule-compiler.mjs → cli-rule-compiler.ts} +128 -112
- package/scripts/cli-skill-commands.ts +707 -0
- package/scripts/{cli-telemetry-commands.mjs → cli-telemetry-commands.ts} +25 -22
- package/scripts/cli-ticket-command-shared.ts +4 -0
- package/scripts/cli-ticket-commands.ts +3723 -0
- package/scripts/cli-ticket-index.ts +283 -0
- package/scripts/{cli-ticket-migration.mjs → cli-ticket-migration.ts} +44 -68
- package/scripts/cli-ticket-parser.ts +100 -0
- package/scripts/{cli-usage-commands.mjs → cli-usage-commands.ts} +325 -326
- package/scripts/cli-utils.ts +1560 -0
- package/scripts/cli.ts +695 -0
- package/scripts/{lint-md.mjs → lint-md.ts} +32 -42
- package/scripts/lint-rules.ts +203 -0
- package/scripts/{merge-logic.mjs → merge-logic.ts} +44 -44
- package/scripts/{plan-parser.mjs → plan-parser.ts} +53 -53
- package/templates/MODULE_RULE_TEMPLATE.md +11 -11
- package/templates/PROJECT_RULE.md +46 -47
- package/templates/TICKET_TEMPLATE.ko.md +48 -44
- package/templates/TICKET_TEMPLATE.md +48 -44
- package/templates/project-memory.md +19 -0
- package/templates/project-pilot/CONFORMANCE_GATE_TEMPLATE.md +25 -23
- package/templates/project-pilot/DRIFT_CHECKLIST.md +27 -19
- package/templates/project-pilot/FLOW_CONTRACT_TEMPLATE.md +26 -26
- package/templates/project-pilot/IMPLEMENTATION_MATRIX_TEMPLATE.md +30 -30
- package/templates/project-pilot/INTEGRATION_CONTRACT_TEMPLATE.md +26 -26
- package/templates/project-pilot/OWNER_MAP_TEMPLATE.md +15 -15
- package/templates/project-pilot/PROJECT_PILOT_RULE_TEMPLATE.md +34 -34
- package/templates/project-pilot/REFACTOR_CONTRACT_TEMPLATE.md +32 -32
- package/templates/project-pilot/REMEDIATION_PLAN_TEMPLATE.md +33 -33
- package/templates/rules.d/deukcontext-mcp.md +31 -31
- package/templates/rules.d/platform-coexistence.md +29 -29
- package/templates/skills/context-recall/SKILL.md +3 -1
- package/templates/skills/doc-sync/SKILL.md +111 -0
- package/templates/skills/generated-file-guard/SKILL.md +3 -1
- package/templates/skills/persona-maid/SKILL.md +65 -0
- package/templates/skills/project-pilot/SKILL.md +13 -52
- package/templates/skills/safe-refactor/SKILL.md +3 -1
- package/templates/skills/ticket-status-surface/SKILL.md +17 -0
- package/core-rules/GEMINI.md +0 -7
- package/docs/badges/npm-downloads.json +0 -8
- package/scripts/cli-init-commands.mjs +0 -1750
- package/scripts/cli-init-logic.mjs +0 -64
- package/scripts/cli-skill-commands.mjs +0 -201
- package/scripts/cli-ticket-commands.mjs +0 -2427
- package/scripts/cli-ticket-index.mjs +0 -298
- package/scripts/cli-ticket-parser.mjs +0 -209
- package/scripts/cli-utils.mjs +0 -602
- package/scripts/cli.mjs +0 -256
- package/scripts/lint-rules.mjs +0 -196
- package/scripts/publish-dual-npm.mjs +0 -141
- package/scripts/smoke-npm-docker.mjs +0 -102
- package/scripts/smoke-npm-local.mjs +0 -109
- package/scripts/update-download-badge.mjs +0 -103
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, writeFileSync, appendFileSync } from "fs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const TELEMETRY_FILE = `${AGENT_ROOT_DIR}/telemetry.jsonl`;
|
|
2
|
+
import { CliOpts, SPOKE_REGISTRY, loadInitConfig, makePath, toSlug } from "./cli-utils.js";
|
|
3
|
+
import { resolveHomeTicketDirForWorkspace } from "./cli-ticket-home.js";
|
|
6
4
|
const RAG_RESULTS = new Set(["hit", "weak-hit", "miss", "stale"]);
|
|
7
5
|
const KNOWLEDGE_ACTIONS = new Set(["none", "add_knowledge", "refresh_document"]);
|
|
8
6
|
const TOKEN_QUALITIES = new Set(["useful", "waste", "rework", "saved"]);
|
|
@@ -47,11 +45,15 @@ function accumulateTotals(logs, keySelector) {
|
|
|
47
45
|
}, {});
|
|
48
46
|
}
|
|
49
47
|
|
|
48
|
+
function resolveTelemetryPath(cwd) {
|
|
49
|
+
return makePath(resolveHomeTicketDirForWorkspace(cwd), "telemetry.jsonl");
|
|
50
|
+
}
|
|
51
|
+
|
|
50
52
|
function loadTelemetryEntries(cwd) {
|
|
51
|
-
const absPath =
|
|
53
|
+
const absPath = resolveTelemetryPath(cwd);
|
|
52
54
|
if (!existsSync(absPath)) return null;
|
|
53
55
|
const lines = readFileSync(absPath, "utf8").split("\n").filter(l => l.trim());
|
|
54
|
-
return lines.map(l => JSON.parse(l));
|
|
56
|
+
return lines.map(l => JSON.parse(l) as Record<string, any>);
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
export function buildTelemetrySummary(cwd) {
|
|
@@ -200,11 +202,11 @@ async function logAction(opts) {
|
|
|
200
202
|
occurredAt: opts.occurredAt || ""
|
|
201
203
|
});
|
|
202
204
|
|
|
203
|
-
console.log(`[TELEMETRY] Logged ${entry.tokens} tokens for ticket ${entry.ticket}
|
|
205
|
+
console.log(`[TELEMETRY] Logged ${entry.tokens} tokens for ticket ${entry.ticket}`);
|
|
204
206
|
}
|
|
205
207
|
|
|
206
208
|
async function syncAction(opts) {
|
|
207
|
-
const absPath =
|
|
209
|
+
const absPath = resolveTelemetryPath(opts.cwd);
|
|
208
210
|
if (!existsSync(absPath)) {
|
|
209
211
|
console.log("[TELEMETRY] No local logs to sync.");
|
|
210
212
|
return;
|
|
@@ -214,7 +216,7 @@ async function syncAction(opts) {
|
|
|
214
216
|
const pipelineUrl = opts.remote || config?.pipelineUrl || "http://localhost:8001/api/telemetry/ingest";
|
|
215
217
|
|
|
216
218
|
const lines = readFileSync(absPath, "utf8").split("\n").filter(l => l.trim());
|
|
217
|
-
const entries = lines.map(l => JSON.parse(l));
|
|
219
|
+
const entries = lines.map(l => JSON.parse(l) as Record<string, any>);
|
|
218
220
|
const unsynced = entries.filter(e => !e.synced);
|
|
219
221
|
|
|
220
222
|
if (unsynced.length === 0) {
|
|
@@ -309,14 +311,14 @@ async function summaryAction(opts) {
|
|
|
309
311
|
}
|
|
310
312
|
|
|
311
313
|
async function migrateAction(opts) {
|
|
312
|
-
const absPath =
|
|
314
|
+
const absPath = resolveTelemetryPath(opts.cwd);
|
|
313
315
|
if (!existsSync(absPath)) {
|
|
314
316
|
console.log("[TELEMETRY] No logs found.");
|
|
315
317
|
return;
|
|
316
318
|
}
|
|
317
319
|
|
|
318
320
|
const lines = readFileSync(absPath, "utf8").split("\n").filter(l => l.trim());
|
|
319
|
-
const entries = lines.map(l => JSON.parse(l));
|
|
321
|
+
const entries = lines.map(l => JSON.parse(l) as Record<string, any>);
|
|
320
322
|
const migrated = entries.map(entry => normalizeTelemetryRecord(entry));
|
|
321
323
|
const changedCount = migrated.filter((entry, index) => JSON.stringify(entry) !== JSON.stringify(entries[index])).length;
|
|
322
324
|
|
|
@@ -329,10 +331,10 @@ async function migrateAction(opts) {
|
|
|
329
331
|
console.log(`[TELEMETRY] Migrated ${changedCount} telemetry entries.`);
|
|
330
332
|
}
|
|
331
333
|
|
|
332
|
-
export function appendTelemetryRecord(cwd, entry = {}) {
|
|
333
|
-
const
|
|
334
|
+
export function appendTelemetryRecord(cwd, entry: Record<string, any> = {}) {
|
|
335
|
+
const telemetryPath = resolveTelemetryPath(cwd);
|
|
336
|
+
const telemetryDir = makePath(resolveHomeTicketDirForWorkspace(cwd));
|
|
334
337
|
if (!existsSync(telemetryDir)) mkdirSync(telemetryDir, { recursive: true });
|
|
335
|
-
const telemetryPath = join(cwd, TELEMETRY_FILE);
|
|
336
338
|
const occurredAt = entry.occurredAt || new Date().toISOString();
|
|
337
339
|
const event = resolveTelemetryEvent(entry);
|
|
338
340
|
const payload = {
|
|
@@ -374,7 +376,7 @@ export function appendTelemetryRecord(cwd, entry = {}) {
|
|
|
374
376
|
return payload;
|
|
375
377
|
}
|
|
376
378
|
|
|
377
|
-
export function appendInternalWorkflowEvent(cwd, event = {}) {
|
|
379
|
+
export function appendInternalWorkflowEvent(cwd, event: Record<string, any> = {}) {
|
|
378
380
|
return appendTelemetryRecord(cwd, {
|
|
379
381
|
...event,
|
|
380
382
|
source: INTERNAL_SOURCE,
|
|
@@ -387,7 +389,7 @@ export function appendInternalWorkflowEvent(cwd, event = {}) {
|
|
|
387
389
|
});
|
|
388
390
|
}
|
|
389
391
|
|
|
390
|
-
function resolveTelemetryEvent(entry = {}) {
|
|
392
|
+
function resolveTelemetryEvent(entry: Record<string, any> = {}) {
|
|
391
393
|
const explicitEvent = normalizeText(entry.event);
|
|
392
394
|
if (explicitEvent) return explicitEvent;
|
|
393
395
|
|
|
@@ -401,7 +403,7 @@ function resolveTelemetryEvent(entry = {}) {
|
|
|
401
403
|
return normalizeText(entry.kind) || "work";
|
|
402
404
|
}
|
|
403
405
|
|
|
404
|
-
function normalizeTelemetryRecord(entry = {}) {
|
|
406
|
+
function normalizeTelemetryRecord(entry: Record<string, any> = {}) {
|
|
405
407
|
const cloned = { ...entry };
|
|
406
408
|
cloned.source = cloned.source || "manual";
|
|
407
409
|
cloned.kind = cloned.kind || "work";
|
|
@@ -431,12 +433,12 @@ function normalizeSyncedState(value) {
|
|
|
431
433
|
return value === true || value === "true";
|
|
432
434
|
}
|
|
433
435
|
|
|
434
|
-
function countBy(logs, key) {
|
|
435
|
-
return logs.reduce((acc, log) => {
|
|
436
|
+
function countBy(logs, key): Record<string, number> {
|
|
437
|
+
return logs.reduce((acc: Record<string, number>, log) => {
|
|
436
438
|
const value = log[key];
|
|
437
439
|
if (value) acc[value] = (acc[value] || 0) + 1;
|
|
438
440
|
return acc;
|
|
439
|
-
}, {});
|
|
441
|
+
}, {} as Record<string, number>);
|
|
440
442
|
}
|
|
441
443
|
|
|
442
444
|
function isInternalWorkflowEvent(log) {
|
|
@@ -478,7 +480,7 @@ function summarizeWorkflowEvents(events) {
|
|
|
478
480
|
}
|
|
479
481
|
|
|
480
482
|
function summarizeSessionModes(logs) {
|
|
481
|
-
const grouped = {};
|
|
483
|
+
const grouped: Record<string, any> = {};
|
|
482
484
|
for (const log of logs) {
|
|
483
485
|
const mode = normalizeEnum(log.sessionMode, SESSION_MODES);
|
|
484
486
|
if (!mode) continue;
|
|
@@ -594,6 +596,7 @@ function printSessionModeComparison(summary) {
|
|
|
594
596
|
if (entries.length === 0) return;
|
|
595
597
|
console.log(`Session Mode Comparison:`);
|
|
596
598
|
for (const [mode, row] of entries) {
|
|
597
|
-
|
|
599
|
+
const r = row as Record<string, any>;
|
|
600
|
+
console.log(` - ${mode}: entries=${r.entries}, tokens=${r.tokens}, retries=${r.retries}, turns=${r.turns}, failures=${r.failures}, success=${formatRate(r.successCount, r.entries)}, quality=${r.averageQualityScore.toFixed(1)}`);
|
|
598
601
|
}
|
|
599
602
|
}
|