dev3000 0.0.186 → 0.0.187
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 +102 -13
- package/bin/dev3000 +1 -2
- package/dist/cdp-monitor.d.ts +7 -12
- package/dist/cdp-monitor.d.ts.map +1 -1
- package/dist/cdp-monitor.js +86 -170
- package/dist/cdp-monitor.js.map +1 -1
- package/dist/cli.d.ts +1 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1369
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/portless.d.ts +3 -0
- package/dist/portless.d.ts.map +1 -1
- package/dist/portless.js +10 -0
- package/dist/portless.js.map +1 -1
- package/dist/runtime/bridge.d.ts +26 -0
- package/dist/runtime/bridge.d.ts.map +1 -0
- package/dist/runtime/bridge.js +340 -0
- package/dist/runtime/bridge.js.map +1 -0
- package/dist/runtime/chrome-isolation.d.ts +16 -0
- package/dist/runtime/chrome-isolation.d.ts.map +1 -0
- package/dist/runtime/chrome-isolation.js +97 -0
- package/dist/runtime/chrome-isolation.js.map +1 -0
- package/dist/runtime/cli.js +116 -26
- package/dist/runtime/cli.js.map +1 -1
- package/dist/runtime/event-views.d.ts +21 -0
- package/dist/runtime/event-views.d.ts.map +1 -0
- package/dist/runtime/event-views.js +53 -0
- package/dist/runtime/event-views.js.map +1 -0
- package/dist/runtime/harness.d.ts +16 -0
- package/dist/runtime/harness.d.ts.map +1 -0
- package/dist/runtime/harness.js +68 -0
- package/dist/runtime/harness.js.map +1 -0
- package/dist/runtime/local-proxy.d.ts +12 -0
- package/dist/runtime/local-proxy.d.ts.map +1 -0
- package/dist/runtime/local-proxy.js +114 -0
- package/dist/runtime/local-proxy.js.map +1 -0
- package/dist/runtime/runtime.d.ts +14 -0
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +80 -19
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/runtime/sandbox-agent.d.ts +6 -0
- package/dist/runtime/sandbox-agent.d.ts.map +1 -0
- package/dist/runtime/sandbox-agent.js +35 -0
- package/dist/runtime/sandbox-agent.js.map +1 -0
- package/dist/runtime/sandbox-command.d.ts +9 -0
- package/dist/runtime/sandbox-command.d.ts.map +1 -0
- package/dist/runtime/sandbox-command.js +101 -0
- package/dist/runtime/sandbox-command.js.map +1 -0
- package/dist/runtime/sandbox-proxy.d.ts +11 -0
- package/dist/runtime/sandbox-proxy.d.ts.map +1 -0
- package/dist/runtime/sandbox-proxy.js +123 -0
- package/dist/runtime/sandbox-proxy.js.map +1 -0
- package/dist/runtime/sandbox-sessions.d.ts +31 -0
- package/dist/runtime/sandbox-sessions.d.ts.map +1 -0
- package/dist/runtime/sandbox-sessions.js +102 -0
- package/dist/runtime/sandbox-sessions.js.map +1 -0
- package/dist/runtime/sandbox.d.ts +21 -0
- package/dist/runtime/sandbox.d.ts.map +1 -0
- package/dist/runtime/sandbox.js +481 -0
- package/dist/runtime/sandbox.js.map +1 -0
- package/dist/utils/agent-browser.d.ts +2 -120
- package/dist/utils/agent-browser.d.ts.map +1 -1
- package/dist/utils/agent-browser.js +13 -376
- package/dist/utils/agent-browser.js.map +1 -1
- package/dist/utils/project-name.d.ts +2 -2
- package/dist/utils/project-name.js +2 -2
- package/package.json +13 -22
- package/skills/d3k/SKILL.md +23 -1
- package/dist/commands/crawl.d.ts +0 -12
- package/dist/commands/crawl.d.ts.map +0 -1
- package/dist/commands/crawl.js +0 -101
- package/dist/commands/crawl.js.map +0 -1
- package/dist/commands/errors.d.ts +0 -14
- package/dist/commands/errors.d.ts.map +0 -1
- package/dist/commands/errors.js +0 -246
- package/dist/commands/errors.js.map +0 -1
- package/dist/commands/fix.d.ts +0 -13
- package/dist/commands/fix.d.ts.map +0 -1
- package/dist/commands/fix.js +0 -219
- package/dist/commands/fix.js.map +0 -1
- package/dist/commands/logs.d.ts +0 -13
- package/dist/commands/logs.d.ts.map +0 -1
- package/dist/commands/logs.js +0 -146
- package/dist/commands/logs.js.map +0 -1
- package/dist/commands/resume.d.ts +0 -11
- package/dist/commands/resume.d.ts.map +0 -1
- package/dist/commands/resume.js +0 -75
- package/dist/commands/resume.js.map +0 -1
- package/dist/commands/status.d.ts +0 -21
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js +0 -44
- package/dist/commands/status.js.map +0 -1
- package/dist/components/AgentSelector.d.ts +0 -12
- package/dist/components/AgentSelector.d.ts.map +0 -1
- package/dist/components/AgentSelector.js +0 -99
- package/dist/components/AgentSelector.js.map +0 -1
- package/dist/components/PackageSelector.d.ts +0 -13
- package/dist/components/PackageSelector.d.ts.map +0 -1
- package/dist/components/PackageSelector.js +0 -79
- package/dist/components/PackageSelector.js.map +0 -1
- package/dist/constants/log-colors.d.ts +0 -43
- package/dist/constants/log-colors.d.ts.map +0 -1
- package/dist/constants/log-colors.js +0 -59
- package/dist/constants/log-colors.js.map +0 -1
- package/dist/dev-environment.d.ts +0 -187
- package/dist/dev-environment.d.ts.map +0 -1
- package/dist/dev-environment.js +0 -2248
- package/dist/dev-environment.js.map +0 -1
- package/dist/screencast-manager.d.ts +0 -78
- package/dist/screencast-manager.d.ts.map +0 -1
- package/dist/screencast-manager.js +0 -529
- package/dist/screencast-manager.js.map +0 -1
- package/dist/services/parsers/error-detectors/base.d.ts +0 -24
- package/dist/services/parsers/error-detectors/base.d.ts.map +0 -1
- package/dist/services/parsers/error-detectors/base.js +0 -44
- package/dist/services/parsers/error-detectors/base.js.map +0 -1
- package/dist/services/parsers/error-detectors/index.d.ts +0 -6
- package/dist/services/parsers/error-detectors/index.d.ts.map +0 -1
- package/dist/services/parsers/error-detectors/index.js +0 -6
- package/dist/services/parsers/error-detectors/index.js.map +0 -1
- package/dist/services/parsers/error-detectors/nextjs.d.ts +0 -9
- package/dist/services/parsers/error-detectors/nextjs.d.ts.map +0 -1
- package/dist/services/parsers/error-detectors/nextjs.js +0 -52
- package/dist/services/parsers/error-detectors/nextjs.js.map +0 -1
- package/dist/services/parsers/index.d.ts +0 -9
- package/dist/services/parsers/index.d.ts.map +0 -1
- package/dist/services/parsers/index.js +0 -10
- package/dist/services/parsers/index.js.map +0 -1
- package/dist/services/parsers/log-parsers/base.d.ts +0 -26
- package/dist/services/parsers/log-parsers/base.d.ts.map +0 -1
- package/dist/services/parsers/log-parsers/base.js +0 -6
- package/dist/services/parsers/log-parsers/base.js.map +0 -1
- package/dist/services/parsers/log-parsers/index.d.ts +0 -6
- package/dist/services/parsers/log-parsers/index.d.ts.map +0 -1
- package/dist/services/parsers/log-parsers/index.js +0 -5
- package/dist/services/parsers/log-parsers/index.js.map +0 -1
- package/dist/services/parsers/log-parsers/standard.d.ts +0 -9
- package/dist/services/parsers/log-parsers/standard.d.ts.map +0 -1
- package/dist/services/parsers/log-parsers/standard.js +0 -17
- package/dist/services/parsers/log-parsers/standard.js.map +0 -1
- package/dist/services/parsers/output-processor.d.ts +0 -39
- package/dist/services/parsers/output-processor.d.ts.map +0 -1
- package/dist/services/parsers/output-processor.js +0 -54
- package/dist/services/parsers/output-processor.js.map +0 -1
- package/dist/skills/d3k/internal-skill.md +0 -32
- package/dist/skills/index.d.ts +0 -54
- package/dist/skills/index.d.ts.map +0 -1
- package/dist/skills/index.js +0 -214
- package/dist/skills/index.js.map +0 -1
- package/dist/src/tui-interface-impl.tsx +0 -644
- package/dist/tui-interface-impl.d.ts +0 -30
- package/dist/tui-interface-impl.d.ts.map +0 -1
- package/dist/tui-interface-impl.js +0 -403
- package/dist/tui-interface-impl.js.map +0 -1
- package/dist/tui-interface-opentui.d.ts +0 -33
- package/dist/tui-interface-opentui.d.ts.map +0 -1
- package/dist/tui-interface-opentui.js +0 -1128
- package/dist/tui-interface-opentui.js.map +0 -1
- package/dist/tui-interface.d.ts +0 -38
- package/dist/tui-interface.d.ts.map +0 -1
- package/dist/tui-interface.js +0 -84
- package/dist/tui-interface.js.map +0 -1
- package/dist/utils/agent-detection.d.ts +0 -17
- package/dist/utils/agent-detection.d.ts.map +0 -1
- package/dist/utils/agent-detection.js +0 -81
- package/dist/utils/agent-detection.js.map +0 -1
- package/dist/utils/agent-selection.d.ts +0 -25
- package/dist/utils/agent-selection.d.ts.map +0 -1
- package/dist/utils/agent-selection.js +0 -73
- package/dist/utils/agent-selection.js.map +0 -1
- package/dist/utils/browser-command-argv.d.ts +0 -19
- package/dist/utils/browser-command-argv.d.ts.map +0 -1
- package/dist/utils/browser-command-argv.js +0 -149
- package/dist/utils/browser-command-argv.js.map +0 -1
- package/dist/utils/build-version.d.ts +0 -2
- package/dist/utils/build-version.d.ts.map +0 -1
- package/dist/utils/build-version.js +0 -8
- package/dist/utils/build-version.js.map +0 -1
- package/dist/utils/cli-options.d.ts +0 -5
- package/dist/utils/cli-options.d.ts.map +0 -1
- package/dist/utils/cli-options.js +0 -36
- package/dist/utils/cli-options.js.map +0 -1
- package/dist/utils/d3k-dir.d.ts +0 -3
- package/dist/utils/d3k-dir.d.ts.map +0 -1
- package/dist/utils/d3k-dir.js +0 -12
- package/dist/utils/d3k-dir.js.map +0 -1
- package/dist/utils/d3k-skill-installer.d.ts +0 -4
- package/dist/utils/d3k-skill-installer.d.ts.map +0 -1
- package/dist/utils/d3k-skill-installer.js +0 -30
- package/dist/utils/d3k-skill-installer.js.map +0 -1
- package/dist/utils/log-filename.d.ts +0 -30
- package/dist/utils/log-filename.d.ts.map +0 -1
- package/dist/utils/log-filename.js +0 -60
- package/dist/utils/log-filename.js.map +0 -1
- package/dist/utils/project-detector.d.ts +0 -25
- package/dist/utils/project-detector.d.ts.map +0 -1
- package/dist/utils/project-detector.js +0 -153
- package/dist/utils/project-detector.js.map +0 -1
- package/dist/utils/project-metadata.d.ts +0 -4
- package/dist/utils/project-metadata.d.ts.map +0 -1
- package/dist/utils/project-metadata.js +0 -48
- package/dist/utils/project-metadata.js.map +0 -1
- package/dist/utils/repo-validate.d.ts +0 -2
- package/dist/utils/repo-validate.d.ts.map +0 -1
- package/dist/utils/repo-validate.js +0 -10
- package/dist/utils/repo-validate.js.map +0 -1
- package/dist/utils/session.d.ts +0 -19
- package/dist/utils/session.d.ts.map +0 -1
- package/dist/utils/session.js +0 -65
- package/dist/utils/session.js.map +0 -1
- package/dist/utils/skill-installer.d.ts +0 -65
- package/dist/utils/skill-installer.d.ts.map +0 -1
- package/dist/utils/skill-installer.js +0 -265
- package/dist/utils/skill-installer.js.map +0 -1
- package/dist/utils/timestamp.d.ts +0 -20
- package/dist/utils/timestamp.d.ts.map +0 -1
- package/dist/utils/timestamp.js +0 -57
- package/dist/utils/timestamp.js.map +0 -1
- package/dist/utils/tmux-helpers.d.ts +0 -36
- package/dist/utils/tmux-helpers.d.ts.map +0 -1
- package/dist/utils/tmux-helpers.js +0 -118
- package/dist/utils/tmux-helpers.js.map +0 -1
- package/dist/utils/user-config.d.ts +0 -12
- package/dist/utils/user-config.d.ts.map +0 -1
- package/dist/utils/user-config.js +0 -46
- package/dist/utils/user-config.js.map +0 -1
- package/dist/utils/version-check.d.ts +0 -52
- package/dist/utils/version-check.d.ts.map +0 -1
- package/dist/utils/version-check.js +0 -304
- package/dist/utils/version-check.js.map +0 -1
- package/src/tui-interface-impl.tsx +0 -644
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nextjs.d.ts","sourceRoot":"","sources":["../../../../src/services/parsers/error-detectors/nextjs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAE7C,qBAAa,mBAAoB,SAAQ,iBAAiB;IACxD,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAqDnC;CACF"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Next.js error detector for Next.js applications
|
|
3
|
-
* Extends base detector with Next.js-specific error patterns
|
|
4
|
-
*/
|
|
5
|
-
import { BaseErrorDetector } from "./base.js";
|
|
6
|
-
export class NextJsErrorDetector extends BaseErrorDetector {
|
|
7
|
-
isCritical(message) {
|
|
8
|
-
// Next.js-specific exclusions that must be handled BEFORE calling super
|
|
9
|
-
// These patterns would normally be flagged as critical by the base detector
|
|
10
|
-
const exclusionPatterns = [
|
|
11
|
-
/FATAL.*generateStaticParams|generateStaticParams.*FATAL/, // FATAL errors during static generation (either order)
|
|
12
|
-
/Cannot find module.*\.next|Module not found.*\.next/ // Missing .next build artifacts (both error formats)
|
|
13
|
-
];
|
|
14
|
-
if (exclusionPatterns.some((pattern) => pattern.test(message))) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
// Check base class for framework-agnostic critical errors
|
|
18
|
-
if (super.isCritical(message)) {
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
// Next.js-specific critical errors that prevent development/building
|
|
22
|
-
const criticalPatterns = [
|
|
23
|
-
// Build/compilation failures that stop the dev server
|
|
24
|
-
/Failed to compile/, // Compilation failures (most critical)
|
|
25
|
-
/webpack.*compilation.*failed/i, // Webpack compilation failures
|
|
26
|
-
/Build optimization failed/, // Build failures
|
|
27
|
-
// Missing dependencies/modules that prevent compilation
|
|
28
|
-
/Module not found.*Can't resolve/, // Missing module imports
|
|
29
|
-
/Cannot resolve dependency/, // Dependency resolution failures
|
|
30
|
-
// Configuration errors that prevent startup
|
|
31
|
-
/Invalid configuration/, // Next.js config errors
|
|
32
|
-
/Configuration error/, // Config parsing errors
|
|
33
|
-
// Build directory issues
|
|
34
|
-
/Error: ENOENT.*\.next/, // Missing .next directory (build artifacts)
|
|
35
|
-
/Failed to read.*\.next/, // Can't read build artifacts
|
|
36
|
-
// Memory/resource issues during build
|
|
37
|
-
/JavaScript heap out of memory/, // Out of memory during build
|
|
38
|
-
/Process out of memory/, // Process memory exhaustion
|
|
39
|
-
// SSG/SSR build-time errors (prevent build completion)
|
|
40
|
-
/Error occurred prerendering page.*build/i, // Build-time prerender failures
|
|
41
|
-
/getStaticPaths.*error.*build/i, // Build-time getStaticPaths errors
|
|
42
|
-
/getStaticProps.*error.*build/i, // Build-time getStaticProps errors
|
|
43
|
-
// Syntax errors that prevent compilation
|
|
44
|
-
/SyntaxError.*Unexpected token/, // JS/TS syntax errors
|
|
45
|
-
/TSError.*TypeScript error/, // TypeScript compilation errors
|
|
46
|
-
/ESLint.*Parsing error/ // ESLint parsing failures
|
|
47
|
-
];
|
|
48
|
-
// Check for critical patterns
|
|
49
|
-
return criticalPatterns.some((pattern) => pattern.test(message));
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=nextjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nextjs.js","sourceRoot":"","sources":["../../../../src/services/parsers/error-detectors/nextjs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAE7C,MAAM,OAAO,mBAAoB,SAAQ,iBAAiB;IACxD,UAAU,CAAC,OAAe;QACxB,wEAAwE;QACxE,4EAA4E;QAC5E,MAAM,iBAAiB,GAAG;YACxB,yDAAyD,EAAE,uDAAuD;YAClH,qDAAqD,CAAC,qDAAqD;SAC5G,CAAA;QAED,IAAI,iBAAiB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;YAC/D,OAAO,KAAK,CAAA;QACd,CAAC;QAED,0DAA0D;QAC1D,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAA;QACb,CAAC;QAED,qEAAqE;QACrE,MAAM,gBAAgB,GAAG;YACvB,sDAAsD;YACtD,mBAAmB,EAAE,uCAAuC;YAC5D,+BAA+B,EAAE,+BAA+B;YAChE,2BAA2B,EAAE,iBAAiB;YAE9C,wDAAwD;YACxD,iCAAiC,EAAE,yBAAyB;YAC5D,2BAA2B,EAAE,iCAAiC;YAE9D,4CAA4C;YAC5C,uBAAuB,EAAE,wBAAwB;YACjD,qBAAqB,EAAE,wBAAwB;YAE/C,yBAAyB;YACzB,uBAAuB,EAAE,4CAA4C;YACrE,wBAAwB,EAAE,6BAA6B;YAEvD,sCAAsC;YACtC,+BAA+B,EAAE,6BAA6B;YAC9D,uBAAuB,EAAE,4BAA4B;YAErD,uDAAuD;YACvD,0CAA0C,EAAE,gCAAgC;YAC5E,+BAA+B,EAAE,mCAAmC;YACpE,+BAA+B,EAAE,mCAAmC;YAEpE,yCAAyC;YACzC,+BAA+B,EAAE,sBAAsB;YACvD,2BAA2B,EAAE,gCAAgC;YAC7D,uBAAuB,CAAC,0BAA0B;SACnD,CAAA;QAED,8BAA8B;QAC9B,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;IAClE,CAAC;CACF"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Public API for the log parsers module
|
|
3
|
-
* Only exposes what external consumers need
|
|
4
|
-
*/
|
|
5
|
-
export { NextJsErrorDetector } from "./error-detectors/nextjs.js";
|
|
6
|
-
export { StandardLogParser } from "./log-parsers/standard.js";
|
|
7
|
-
export type { LogEntry } from "./output-processor.js";
|
|
8
|
-
export { OutputProcessor } from "./output-processor.js";
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/parsers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAGjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,YAAY,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Public API for the log parsers module
|
|
3
|
-
* Only exposes what external consumers need
|
|
4
|
-
*/
|
|
5
|
-
export { NextJsErrorDetector } from "./error-detectors/nextjs.js";
|
|
6
|
-
// Concrete implementations for Next.js
|
|
7
|
-
export { StandardLogParser } from "./log-parsers/standard.js";
|
|
8
|
-
// Main output processor and types
|
|
9
|
-
export { OutputProcessor } from "./output-processor.js";
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/parsers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE,uCAAuC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAE7D,kCAAkC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base interfaces and types for log format parsers
|
|
3
|
-
* Responsible for parsing log formats from different process managers
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Parsed log line structure after format parsing
|
|
7
|
-
*/
|
|
8
|
-
export interface ParsedLogLine {
|
|
9
|
-
formatted: string;
|
|
10
|
-
message: string;
|
|
11
|
-
processName?: string;
|
|
12
|
-
metadata?: Record<string, unknown>;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Base interface for log format parsers
|
|
16
|
-
* Responsible for parsing the structure/format of server logs (timestamps, process names, etc.)
|
|
17
|
-
*/
|
|
18
|
-
export interface LogFormatParser {
|
|
19
|
-
/**
|
|
20
|
-
* Parse log text into structured lines
|
|
21
|
-
* @param text Raw log text to parse
|
|
22
|
-
* @returns Array of parsed log lines with formatting and metadata
|
|
23
|
-
*/
|
|
24
|
-
parse(text: string): ParsedLogLine[];
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/services/parsers/log-parsers/base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,EAAE,CAAA;CACrC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../src/services/parsers/log-parsers/base.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/parsers/log-parsers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/parsers/log-parsers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Standard log parser for basic server logs
|
|
3
|
-
* Handles standard server logs without special process manager formatting
|
|
4
|
-
*/
|
|
5
|
-
import type { LogFormatParser, ParsedLogLine } from "./base.js";
|
|
6
|
-
export declare class StandardLogParser implements LogFormatParser {
|
|
7
|
-
parse(text: string): ParsedLogLine[];
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=standard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"standard.d.ts","sourceRoot":"","sources":["../../../../src/services/parsers/log-parsers/standard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAE/D,qBAAa,iBAAkB,YAAW,eAAe;IACvD,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,EAAE,CAUnC;CACF"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Standard log parser for basic server logs
|
|
3
|
-
* Handles standard server logs without special process manager formatting
|
|
4
|
-
*/
|
|
5
|
-
export class StandardLogParser {
|
|
6
|
-
parse(text) {
|
|
7
|
-
if (!text?.trim()) {
|
|
8
|
-
return [];
|
|
9
|
-
}
|
|
10
|
-
const lines = text.trim().split("\n").filter(Boolean);
|
|
11
|
-
return lines.map((line) => ({
|
|
12
|
-
formatted: line,
|
|
13
|
-
message: line
|
|
14
|
-
}));
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=standard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"standard.js","sourceRoot":"","sources":["../../../../src/services/parsers/log-parsers/standard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,OAAO,iBAAiB;IAC5B,KAAK,CAAC,IAAY;QAChB,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC;YAClB,OAAO,EAAE,CAAA;QACX,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QACrD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC1B,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,IAAI;SACd,CAAC,CAAC,CAAA;IACL,CAAC;CACF"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Output processor that composes log format parsers and error detectors
|
|
3
|
-
* Provides the main API for processing server log output
|
|
4
|
-
*/
|
|
5
|
-
import type { ErrorDetector } from "./error-detectors/index.js";
|
|
6
|
-
import type { LogFormatParser } from "./log-parsers/index.js";
|
|
7
|
-
/**
|
|
8
|
-
* Log entry structure for processed output
|
|
9
|
-
*/
|
|
10
|
-
export interface LogEntry {
|
|
11
|
-
formatted: string;
|
|
12
|
-
isCritical?: boolean;
|
|
13
|
-
rawMessage?: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Output processor that combines log format parsing and error detection
|
|
17
|
-
* This is the main class that should be used for processing server log output
|
|
18
|
-
*/
|
|
19
|
-
export declare class OutputProcessor {
|
|
20
|
-
private logFormatParser;
|
|
21
|
-
private errorDetector;
|
|
22
|
-
constructor(logFormatParser: LogFormatParser, errorDetector: ErrorDetector);
|
|
23
|
-
/**
|
|
24
|
-
* Process log text output from the server
|
|
25
|
-
* @param text Raw log text to process
|
|
26
|
-
* @param isError Whether this is from stderr (error stream)
|
|
27
|
-
* @returns Array of processed log entries
|
|
28
|
-
*/
|
|
29
|
-
process(text: string, isError?: boolean): LogEntry[];
|
|
30
|
-
/**
|
|
31
|
-
* Get the current log format parser
|
|
32
|
-
*/
|
|
33
|
-
getLogFormatParser(): LogFormatParser;
|
|
34
|
-
/**
|
|
35
|
-
* Get the current error detector
|
|
36
|
-
*/
|
|
37
|
-
getErrorDetector(): ErrorDetector;
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=output-processor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"output-processor.d.ts","sourceRoot":"","sources":["../../../src/services/parsers/output-processor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAE7D;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;;GAGG;AACH,qBAAa,eAAe;IAExB,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,aAAa;IAFvB,YACU,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa,EAClC;IAEJ;;;;;OAKG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,OAAe,GAAG,QAAQ,EAAE,CAsB1D;IAED;;OAEG;IACH,kBAAkB,IAAI,eAAe,CAEpC;IAED;;OAEG;IACH,gBAAgB,IAAI,aAAa,CAEhC;CACF"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Output processor that composes log format parsers and error detectors
|
|
3
|
-
* Provides the main API for processing server log output
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Output processor that combines log format parsing and error detection
|
|
7
|
-
* This is the main class that should be used for processing server log output
|
|
8
|
-
*/
|
|
9
|
-
export class OutputProcessor {
|
|
10
|
-
logFormatParser;
|
|
11
|
-
errorDetector;
|
|
12
|
-
constructor(logFormatParser, errorDetector) {
|
|
13
|
-
this.logFormatParser = logFormatParser;
|
|
14
|
-
this.errorDetector = errorDetector;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Process log text output from the server
|
|
18
|
-
* @param text Raw log text to process
|
|
19
|
-
* @param isError Whether this is from stderr (error stream)
|
|
20
|
-
* @returns Array of processed log entries
|
|
21
|
-
*/
|
|
22
|
-
process(text, isError = false) {
|
|
23
|
-
// First, parse the log format to extract structured information
|
|
24
|
-
const parsedLines = this.logFormatParser.parse(text);
|
|
25
|
-
// Then, apply error detection and create log entries
|
|
26
|
-
return parsedLines.map((line) => {
|
|
27
|
-
// For error output, check if it's critical
|
|
28
|
-
const isCritical = isError && this.errorDetector.isCritical(line.message);
|
|
29
|
-
// Build the log entry - only label truly critical errors, not all stderr
|
|
30
|
-
const entry = {
|
|
31
|
-
formatted: isCritical ? `ERROR: ${line.formatted}` : line.formatted
|
|
32
|
-
};
|
|
33
|
-
// Add critical error information if applicable
|
|
34
|
-
if (isCritical) {
|
|
35
|
-
entry.isCritical = true;
|
|
36
|
-
entry.rawMessage = line.message;
|
|
37
|
-
}
|
|
38
|
-
return entry;
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Get the current log format parser
|
|
43
|
-
*/
|
|
44
|
-
getLogFormatParser() {
|
|
45
|
-
return this.logFormatParser;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Get the current error detector
|
|
49
|
-
*/
|
|
50
|
-
getErrorDetector() {
|
|
51
|
-
return this.errorDetector;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=output-processor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"output-processor.js","sourceRoot":"","sources":["../../../src/services/parsers/output-processor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH;;;GAGG;AACH,MAAM,OAAO,eAAe;IAEhB,eAAe;IACf,aAAa;IAFvB,YACU,eAAgC,EAChC,aAA4B;+BAD5B,eAAe;6BACf,aAAa;IACpB,CAAC;IAEJ;;;;;OAKG;IACH,OAAO,CAAC,IAAY,EAAE,OAAO,GAAY,KAAK;QAC5C,gEAAgE;QAChE,MAAM,WAAW,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAEpD,qDAAqD;QACrD,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAC9B,2CAA2C;YAC3C,MAAM,UAAU,GAAG,OAAO,IAAI,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YAEzE,yEAAyE;YACzE,MAAM,KAAK,GAAa;gBACtB,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS;aACpE,CAAA;YAED,+CAA+C;YAC/C,IAAI,UAAU,EAAE,CAAC;gBACf,KAAK,CAAC,UAAU,GAAG,IAAI,CAAA;gBACvB,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,OAAO,CAAA;YACjC,CAAC;YAED,OAAO,KAAK,CAAA;QACd,CAAC,CAAC,CAAA;IACJ,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,OAAO,IAAI,CAAC,eAAe,CAAA;IAC7B,CAAC;IAED;;OAEG;IACH,gBAAgB;QACd,OAAO,IAAI,CAAC,aAAa,CAAA;IAC3B,CAAC;CACF"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: d3k
|
|
3
|
-
description: Run and debug a local web app with a managed browser and a shared server/browser evidence timeline. Use when asked to develop, test, or reproduce a browser issue with d3k.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# d3k
|
|
7
|
-
|
|
8
|
-
Own the project's dev server and monitored browser through a small background runtime. No global d3k installation is needed. Evidence stays in bounded memory; browser authentication stays in the project Chrome profile.
|
|
9
|
-
|
|
10
|
-
Use `d3k-runtime` as `runtime` below when running from an installed dev3000 package, or `node <skill-directory>/scripts/runtime.mjs` without a global install (the helper isolates package acquisition from the app’s workspace settings). Run from the **target project root**. For unreleased development use `node <dev3000-checkout>/skills/d3k/scripts/runtime.mjs` instead; that helper runs the checkout source without downloading a published version.
|
|
11
|
-
|
|
12
|
-
## Prepare
|
|
13
|
-
|
|
14
|
-
1. Run `runtime portless status`. Canonical HTTPS must be ready (`canonical: true`, `serviceInstalled: true`, `setupRequired: false`) before starting the app or browser. If needed run `runtime portless setup`, wait for the one-time administrator authorization, then check again. Stop if setup is unavailable; never silently substitute direct localhost.
|
|
15
|
-
2. Run `runtime status`. Reuse a ready runtime for this project. If it is starting, wait for readiness. Do not start another dev server. A legacy d3k session must be stopped before switching runtimes.
|
|
16
|
-
3. Start `runtime start` in a retained background tool session. Keep its process handle. The runtime detects the package manager and `dev` script; use `--command '<dev command>'` when needed. Poll `runtime status` until `ready: true` and `browserConnected: true` with a port-free `https://...localhost` URL. Inspect `runtime events` if startup fails while the runtime is still alive, and the retained process output if it exits.
|
|
17
|
-
|
|
18
|
-
## Reproduce and inspect
|
|
19
|
-
|
|
20
|
-
- For “let me test,” give the user the app URL and leave the browser running while they reproduce the issue.
|
|
21
|
-
- For autonomous debugging, drive the same browser with `runtime browser snapshot -i`, `runtime browser click @e2`, and other agent-browser commands. The runtime supplies the CDP connection; never open a separate browser or profile.
|
|
22
|
-
- Before a reproduction, read `runtime status` and keep its `sessionId` and `cursor`.
|
|
23
|
-
- After the interaction, read `runtime events --session <id> --after <cursor>`. Server output, console messages, exceptions, network requests, and navigation share sequence numbers. Requests and responses carry CDP request IDs; adjacent server lines are chronological context, not proof of causation.
|
|
24
|
-
- Continue from the returned `cursor` while `hasMore` is true. Use `--limit 1..500`, `--source server|browser|runtime`, or `--level error` for focused reads. For error context, read the unfiltered interval as well. Filters advance the cursor through examined events; retain the original cursor if you need another view of the same interval.
|
|
25
|
-
- `reset: true` means the runtime restarted. `dropped` reports evicted events. Never claim complete evidence across either gap. Replay the interaction if necessary.
|
|
26
|
-
- Fix the code and repeat the same interaction, then inspect the new interval. Keep the runtime alive across edits.
|
|
27
|
-
|
|
28
|
-
## Lifecycle
|
|
29
|
-
|
|
30
|
-
Keep the runtime's project-stable profile for sign-in state. Use `--headless` for CI or when requested; `--servers-only` deliberately omits the browser. Automatic screenshots and persistent log files are off; request a screenshot through `runtime browser screenshot <absolute-path>` when visual evidence is needed.
|
|
31
|
-
|
|
32
|
-
Stop with `runtime stop` or the retained process handle when asked. Leaving the browser open for user testing means leaving the runtime alive. Events are lost when it exits; only profile and session discovery data persist. Console/server text may contain application secrets; inspect selectively and avoid copying sensitive values into reports.
|
package/dist/skills/index.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skill module for d3k
|
|
3
|
-
*
|
|
4
|
-
* Skills are managed by `npx skills` and stored in .agents/skills/
|
|
5
|
-
* d3k also bundles a project-local fallback for agents without a global d3k skill.
|
|
6
|
-
*/
|
|
7
|
-
export interface SkillInfo {
|
|
8
|
-
name: string;
|
|
9
|
-
description: string;
|
|
10
|
-
path: string;
|
|
11
|
-
}
|
|
12
|
-
export interface SkillResult {
|
|
13
|
-
found: boolean;
|
|
14
|
-
name: string;
|
|
15
|
-
content?: string;
|
|
16
|
-
path?: string;
|
|
17
|
-
error?: string;
|
|
18
|
-
availableSkills?: string[];
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Get the path to d3k's bundled skills directory.
|
|
22
|
-
* Returns null if not found (e.g., running in development without build).
|
|
23
|
-
*/
|
|
24
|
-
export declare function getBundledSkillsPath(): string | null;
|
|
25
|
-
/**
|
|
26
|
-
* Get d3k's bundled internal skill file.
|
|
27
|
-
*
|
|
28
|
-
* The bundled package stores this as internal-skill.md so the repository has a
|
|
29
|
-
* single public SKILL.md at skills/d3k/SKILL.md. When d3k installs the skill
|
|
30
|
-
* into an agent skills directory, it still writes the target as SKILL.md.
|
|
31
|
-
*/
|
|
32
|
-
export declare function getBundledD3kSkillPath(): string | null;
|
|
33
|
-
/**
|
|
34
|
-
* Get directories where skills can be found.
|
|
35
|
-
* Skills are managed by `npx skills` in .agents/skills/
|
|
36
|
-
*/
|
|
37
|
-
export declare function getSkillDirectories(cwd?: string): string[];
|
|
38
|
-
/**
|
|
39
|
-
* Find a skill by name.
|
|
40
|
-
*/
|
|
41
|
-
export declare function findSkill(name: string, cwd?: string): string | null;
|
|
42
|
-
/**
|
|
43
|
-
* Get the content of a skill by name.
|
|
44
|
-
*/
|
|
45
|
-
export declare function getSkill(name: string, cwd?: string): SkillResult;
|
|
46
|
-
/**
|
|
47
|
-
* List all available skills.
|
|
48
|
-
*/
|
|
49
|
-
export declare function listAvailableSkills(cwd?: string): string[];
|
|
50
|
-
/**
|
|
51
|
-
* Get detailed info about all available skills.
|
|
52
|
-
*/
|
|
53
|
-
export declare function getSkillsInfo(cwd?: string): SkillInfo[];
|
|
54
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/skills/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,OAAO,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAC3B;AAQD;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,GAAG,IAAI,CAkCpD;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,GAAG,IAAI,CAetD;AAoBD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAiB1D;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQnE;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,WAAW,CAuBhE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAgB1D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,CA4BvD"}
|
package/dist/skills/index.js
DELETED
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skill module for d3k
|
|
3
|
-
*
|
|
4
|
-
* Skills are managed by `npx skills` and stored in .agents/skills/
|
|
5
|
-
* d3k also bundles a project-local fallback for agents without a global d3k skill.
|
|
6
|
-
*/
|
|
7
|
-
import { existsSync, readdirSync, readFileSync } from "fs";
|
|
8
|
-
import { homedir } from "os";
|
|
9
|
-
import { dirname, join, resolve } from "path";
|
|
10
|
-
import { fileURLToPath } from "url";
|
|
11
|
-
const SKILL_FILENAME = "SKILL.md";
|
|
12
|
-
const BUNDLED_D3K_SKILL_FILENAME = "internal-skill.md";
|
|
13
|
-
function hasBundledD3kSkill(skillsDir) {
|
|
14
|
-
return (existsSync(join(skillsDir, "d3k", BUNDLED_D3K_SKILL_FILENAME)) || existsSync(join(skillsDir, "d3k", SKILL_FILENAME)));
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Get the path to d3k's bundled skills directory.
|
|
18
|
-
* Returns null if not found (e.g., running in development without build).
|
|
19
|
-
*/
|
|
20
|
-
export function getBundledSkillsPath() {
|
|
21
|
-
// Check if running from compiled binary
|
|
22
|
-
const moduleUrl = import.meta.url;
|
|
23
|
-
const isCompiledBinary = moduleUrl.startsWith("file:///$bunfs") || moduleUrl.startsWith("/$bunfs");
|
|
24
|
-
if (isCompiledBinary) {
|
|
25
|
-
// Try process.argv[0] first (more reliable for Bun compiled binaries)
|
|
26
|
-
// Then fall back to process.execPath
|
|
27
|
-
const possiblePaths = [process.argv[0], process.execPath].filter(Boolean);
|
|
28
|
-
for (const binaryPath of possiblePaths) {
|
|
29
|
-
if (binaryPath && existsSync(binaryPath)) {
|
|
30
|
-
const binDir = dirname(binaryPath);
|
|
31
|
-
const packageDir = dirname(binDir);
|
|
32
|
-
const skillsDir = join(packageDir, "skills");
|
|
33
|
-
if (existsSync(skillsDir)) {
|
|
34
|
-
return skillsDir;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
// Fallback for npm-installed package: look for dist/skills relative to this module
|
|
40
|
-
// import.meta.url is like "file:///path/to/node_modules/dev3000/dist/skills/index.js"
|
|
41
|
-
if (moduleUrl.startsWith("file://")) {
|
|
42
|
-
const modulePath = fileURLToPath(moduleUrl);
|
|
43
|
-
// This file is at dist/skills/index.js, so skills are at dist/skills/
|
|
44
|
-
const skillsDir = dirname(modulePath);
|
|
45
|
-
if (hasBundledD3kSkill(skillsDir)) {
|
|
46
|
-
return skillsDir;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Get d3k's bundled internal skill file.
|
|
53
|
-
*
|
|
54
|
-
* The bundled package stores this as internal-skill.md so the repository has a
|
|
55
|
-
* single public SKILL.md at skills/d3k/SKILL.md. When d3k installs the skill
|
|
56
|
-
* into an agent skills directory, it still writes the target as SKILL.md.
|
|
57
|
-
*/
|
|
58
|
-
export function getBundledD3kSkillPath() {
|
|
59
|
-
const bundledSkillsDir = getBundledSkillsPath();
|
|
60
|
-
if (!bundledSkillsDir)
|
|
61
|
-
return null;
|
|
62
|
-
const internalSkillPath = join(bundledSkillsDir, "d3k", BUNDLED_D3K_SKILL_FILENAME);
|
|
63
|
-
if (existsSync(internalSkillPath)) {
|
|
64
|
-
return internalSkillPath;
|
|
65
|
-
}
|
|
66
|
-
const legacySkillPath = join(bundledSkillsDir, "d3k", SKILL_FILENAME);
|
|
67
|
-
if (existsSync(legacySkillPath)) {
|
|
68
|
-
return legacySkillPath;
|
|
69
|
-
}
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
function isBundledSkillsDirectory(dir) {
|
|
73
|
-
const bundledSkillsDir = getBundledSkillsPath();
|
|
74
|
-
return bundledSkillsDir !== null && resolve(dir) === resolve(bundledSkillsDir);
|
|
75
|
-
}
|
|
76
|
-
function getSkillPathInDirectory(dir, name) {
|
|
77
|
-
const skillPath = join(dir, name, SKILL_FILENAME);
|
|
78
|
-
if (existsSync(skillPath)) {
|
|
79
|
-
return skillPath;
|
|
80
|
-
}
|
|
81
|
-
if (name === "d3k" && isBundledSkillsDirectory(dir)) {
|
|
82
|
-
return getBundledD3kSkillPath();
|
|
83
|
-
}
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Get directories where skills can be found.
|
|
88
|
-
* Skills are managed by `npx skills` in .agents/skills/
|
|
89
|
-
*/
|
|
90
|
-
export function getSkillDirectories(cwd) {
|
|
91
|
-
const dirs = [];
|
|
92
|
-
const projectDir = cwd || process.cwd();
|
|
93
|
-
// Project-local skills (highest priority)
|
|
94
|
-
dirs.push(join(projectDir, ".agents", "skills"));
|
|
95
|
-
// Global skills
|
|
96
|
-
dirs.push(join(homedir(), ".agents", "skills"));
|
|
97
|
-
// d3k's bundled skills (fallback for d3k skill before it's copied)
|
|
98
|
-
const bundled = getBundledSkillsPath();
|
|
99
|
-
if (bundled) {
|
|
100
|
-
dirs.push(bundled);
|
|
101
|
-
}
|
|
102
|
-
return dirs.filter((dir) => existsSync(dir));
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Find a skill by name.
|
|
106
|
-
*/
|
|
107
|
-
export function findSkill(name, cwd) {
|
|
108
|
-
for (const dir of getSkillDirectories(cwd)) {
|
|
109
|
-
const skillPath = getSkillPathInDirectory(dir, name);
|
|
110
|
-
if (skillPath) {
|
|
111
|
-
return skillPath;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return null;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Get the content of a skill by name.
|
|
118
|
-
*/
|
|
119
|
-
export function getSkill(name, cwd) {
|
|
120
|
-
const skillPath = findSkill(name, cwd);
|
|
121
|
-
if (skillPath) {
|
|
122
|
-
try {
|
|
123
|
-
const content = readFileSync(skillPath, "utf-8");
|
|
124
|
-
return { found: true, name, content, path: skillPath };
|
|
125
|
-
}
|
|
126
|
-
catch (error) {
|
|
127
|
-
return {
|
|
128
|
-
found: false,
|
|
129
|
-
name,
|
|
130
|
-
error: `Failed to read skill: ${error instanceof Error ? error.message : String(error)}`,
|
|
131
|
-
availableSkills: listAvailableSkills(cwd)
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
return {
|
|
136
|
-
found: false,
|
|
137
|
-
name,
|
|
138
|
-
error: `Skill "${name}" not found`,
|
|
139
|
-
availableSkills: listAvailableSkills(cwd)
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* List all available skills.
|
|
144
|
-
*/
|
|
145
|
-
export function listAvailableSkills(cwd) {
|
|
146
|
-
const skills = new Set();
|
|
147
|
-
for (const dir of getSkillDirectories(cwd)) {
|
|
148
|
-
try {
|
|
149
|
-
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
150
|
-
if (entry.isDirectory() && getSkillPathInDirectory(dir, entry.name)) {
|
|
151
|
-
skills.add(entry.name);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
catch {
|
|
156
|
-
// Directory not readable
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
return Array.from(skills).sort();
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Get detailed info about all available skills.
|
|
163
|
-
*/
|
|
164
|
-
export function getSkillsInfo(cwd) {
|
|
165
|
-
const skillsMap = new Map();
|
|
166
|
-
for (const dir of getSkillDirectories(cwd)) {
|
|
167
|
-
try {
|
|
168
|
-
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
169
|
-
if (entry.isDirectory() && !skillsMap.has(entry.name)) {
|
|
170
|
-
const skillPath = getSkillPathInDirectory(dir, entry.name);
|
|
171
|
-
if (skillPath) {
|
|
172
|
-
try {
|
|
173
|
-
const content = readFileSync(skillPath, "utf-8");
|
|
174
|
-
skillsMap.set(entry.name, {
|
|
175
|
-
name: entry.name,
|
|
176
|
-
description: extractDescription(content),
|
|
177
|
-
path: skillPath
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
catch {
|
|
181
|
-
// Skip unreadable
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
catch {
|
|
188
|
-
// Directory not readable
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
return Array.from(skillsMap.values()).sort((a, b) => a.name.localeCompare(b.name));
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Extract description from SKILL.md frontmatter or first paragraph.
|
|
195
|
-
*/
|
|
196
|
-
function extractDescription(content) {
|
|
197
|
-
// Try YAML frontmatter
|
|
198
|
-
const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
|
|
199
|
-
if (frontmatterMatch) {
|
|
200
|
-
const descMatch = frontmatterMatch[1].match(/description:\s*(.+)/);
|
|
201
|
-
if (descMatch) {
|
|
202
|
-
return descMatch[1].trim();
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
// Fallback: first non-heading, non-empty line
|
|
206
|
-
for (const line of content.split("\n")) {
|
|
207
|
-
const trimmed = line.trim();
|
|
208
|
-
if (trimmed && !trimmed.startsWith("#") && !trimmed.startsWith("---")) {
|
|
209
|
-
return trimmed.length > 100 ? `${trimmed.slice(0, 97)}...` : trimmed;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
return "No description available";
|
|
213
|
-
}
|
|
214
|
-
//# sourceMappingURL=index.js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