@laxture/vibe-pm 0.1.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.
Files changed (63) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +120 -0
  3. package/README.zh-CN.md +119 -0
  4. package/dist/core/commands.d.ts +17 -0
  5. package/dist/core/config.d.ts +12 -0
  6. package/dist/core/index.d.ts +8 -0
  7. package/dist/core/logger.d.ts +23 -0
  8. package/dist/core/plugin.d.ts +2 -0
  9. package/dist/core/types.d.ts +42 -0
  10. package/dist/docs/template/_coding_style/general.md +114 -0
  11. package/dist/docs/template/_coding_style/go.md +158 -0
  12. package/dist/docs/template/_coding_style/java.md +154 -0
  13. package/dist/docs/template/_coding_style/python.md +195 -0
  14. package/dist/docs/template/_coding_style/rust.md +161 -0
  15. package/dist/docs/template/_coding_style/sql.md +321 -0
  16. package/dist/docs/template/_coding_style/typescript.md +237 -0
  17. package/dist/docs/template/agents-template.md +38 -0
  18. package/dist/docs/template/bug-fix/flow.md +189 -0
  19. package/dist/docs/template/constitution-template.md +119 -0
  20. package/dist/docs/template/design-spec/flow.md +194 -0
  21. package/dist/docs/template/dictionary-template.md +40 -0
  22. package/dist/docs/template/large-refactor/flow.md +242 -0
  23. package/dist/docs/template/large-refactor/regulations/migration-checklist.md +28 -0
  24. package/dist/docs/template/research/flow.md +161 -0
  25. package/dist/docs/template/side-job/flow.md +147 -0
  26. package/dist/docs/template/spec-driven-dev/flow.md +420 -0
  27. package/dist/docs/template/spec-template.md +190 -0
  28. package/dist/engine/errors.d.ts +28 -0
  29. package/dist/engine/flow-engine.d.ts +32 -0
  30. package/dist/engine/index.d.ts +3 -0
  31. package/dist/i18n/index.d.ts +2 -0
  32. package/dist/i18n/loader.d.ts +23 -0
  33. package/dist/i18n/prompts-en-US.d.ts +47 -0
  34. package/dist/i18n/prompts-zh-CN.d.ts +50 -0
  35. package/dist/i18n/types.d.ts +51 -0
  36. package/dist/index.d.ts +5 -0
  37. package/dist/index.js +4886 -0
  38. package/dist/integration/dcp.d.ts +7 -0
  39. package/dist/integration/index.d.ts +1 -0
  40. package/dist/memory/errors.d.ts +11 -0
  41. package/dist/memory/index.d.ts +3 -0
  42. package/dist/memory/memory-system.d.ts +80 -0
  43. package/dist/memory/types.d.ts +157 -0
  44. package/dist/template/index.d.ts +3 -0
  45. package/dist/template/template-manager.d.ts +26 -0
  46. package/dist/template/types.d.ts +16 -0
  47. package/dist/token/backends/anthropic.d.ts +5 -0
  48. package/dist/token/backends/llama.d.ts +7 -0
  49. package/dist/token/backends/tiktoken.d.ts +7 -0
  50. package/dist/token/index.d.ts +3 -0
  51. package/dist/token/model-registry.d.ts +9 -0
  52. package/dist/token/token-counter.d.ts +17 -0
  53. package/dist/token/types.d.ts +39 -0
  54. package/dist/tui/components/collapsible.d.ts +9 -0
  55. package/dist/tui/components/empty-state.d.ts +7 -0
  56. package/dist/tui/data/task-status.d.ts +16 -0
  57. package/dist/tui/data/token-data.d.ts +16 -0
  58. package/dist/tui/index.d.ts +13 -0
  59. package/dist/tui/index.js +3293 -0
  60. package/dist/tui/slots/sidebar-content.d.ts +10 -0
  61. package/dist/tui/tui-plugin.d.ts +9 -0
  62. package/dist/tui/types.d.ts +63 -0
  63. package/package.json +63 -0
@@ -0,0 +1,10 @@
1
+ import type { JSX } from 'solid-js';
2
+ import type { TuiPluginApi } from '@opencode-ai/plugin/tui';
3
+ import type { TaskStatusData, TokenData } from '../types.js';
4
+ interface SidebarContentProps {
5
+ api: TuiPluginApi;
6
+ taskStatus: () => TaskStatusData;
7
+ tokenData: () => TokenData;
8
+ }
9
+ export declare function SidebarContent(props: SidebarContentProps): JSX.Element;
10
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * TuiPlugin entry point
3
+ *
4
+ * - createSignal + setInterval + onCleanup all inside the slot callback
5
+ * - session_id obtained from props
6
+ * - TUI always creates an independent MemorySystem instance (not shared across processes)
7
+ */
8
+ import type { TuiPlugin } from '@opencode-ai/plugin/tui';
9
+ export declare function createTuiPlugin(): TuiPlugin;
@@ -0,0 +1,63 @@
1
+ /**
2
+ * TUI component shared type definitions
3
+ *
4
+ * Defines TaskStatusData, TokenData, and color mapping constants.
5
+ */
6
+ import { RGBA } from '@opentui/core';
7
+ export interface TaskStatusData {
8
+ type: 'active' | 'last' | 'empty';
9
+ flow?: string;
10
+ currentStep?: string;
11
+ currentStepName?: string;
12
+ startAt?: string;
13
+ endAt?: string;
14
+ /** Formatted elapsed time e.g. "22min" / "1h 15min" */
15
+ elapsed?: string;
16
+ }
17
+ export interface TokenData {
18
+ /** Session-level total tokens — prefers LLM API returned data (apiInput + apiOutput), falls back to local tiktoken sum */
19
+ totalTokens: number;
20
+ sourceBreakdown: TokenSourceEntry[];
21
+ stepBreakdown: StepTokenEntry[];
22
+ /** Cache token count = apiCacheRead + apiCacheWrite */
23
+ cachedTokens: number;
24
+ /** Cache percentage baseline = user + assistant (role dimension sum in TokenCount) */
25
+ uncachedTokens: number;
26
+ }
27
+ export interface TokenSourceEntry {
28
+ source: string;
29
+ tokens: number;
30
+ }
31
+ export interface StepTokenEntry {
32
+ step: string;
33
+ stepName: string;
34
+ stepInCount: number;
35
+ tokensConsumed: number;
36
+ }
37
+ /**
38
+ * Source → color mapping (fixed, inspired by magic-context cool/warm color design).
39
+ *
40
+ * Cool: System (blue), FlowControl (cyan)
41
+ * Warm: User (orange), Assistant (green), Tool (purple), Reasoning (gray)
42
+ */
43
+ export declare const SOURCE_COLORS: Record<string, RGBA>;
44
+ /** Format elapsed time as a human-readable string */
45
+ export declare function formatElapsed(startAt: string, endAt?: string): string;
46
+ /** Format token count to compact form (e.g. 12.5K, 16.4M) */
47
+ export declare function compactTokens(tokens: number): string;
48
+ /**
49
+ * Calculate the visual width of a string (CJK characters count as 2 columns, ASCII as 1).
50
+ *
51
+ * Used for manual string padding as a substitute for flexbox layout.
52
+ * Coverage: CJK unified ideographs, CJK punctuation, fullwidth characters.
53
+ */
54
+ export declare function visualWidth(s: string): number;
55
+ /**
56
+ * CJK-aware justified alignment.
57
+ *
58
+ * Pads spaces between left and right so the total visual width equals the specified width.
59
+ * When content already exceeds width, at least 1 space separator is preserved.
60
+ *
61
+ * Used as a flexbox layout alternative to avoid right-side text truncation in narrow sidebars.
62
+ */
63
+ export declare function justify(left: string, right: string, width: number): string;
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@laxture/vibe-pm",
3
+ "version": "0.1.0",
4
+ "license": "Apache-2.0",
5
+ "repository": "https://github.com/hank-cp/opencode-vibe-pm",
6
+ "keywords": ["opencode", "plugin", "llm", "task", "flow", "vibe-coding"],
7
+ "author": "@laxture/hank-cp",
8
+ "type": "module",
9
+ "description": "OpenCode plugin that ensure llm processes tasks follow the given flow",
10
+ "main": "./dist/index.js",
11
+ "types": "./dist/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.js"
16
+ },
17
+ "./server": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.js"
20
+ },
21
+ "./tui": {
22
+ "types": "./dist/tui/index.d.ts",
23
+ "import": "./dist/tui/index.js"
24
+ }
25
+ },
26
+ "publishConfig": {
27
+ "access": "public",
28
+ "provenance": true
29
+ },
30
+ "files": ["dist", "LICENSE", "README.md", "README.zh-CN.md"],
31
+ "scripts": {
32
+ "build": "tsc --emitDeclarationOnly && bun run scripts/build-tui.ts",
33
+ "test": "bun test",
34
+ "test:watch": "bun test --watch",
35
+ "typecheck": "tsc --noEmit",
36
+ "lint": "eslint .",
37
+ "format": "prettier --write \"src/**/*.ts\" \"src/**/*.tsx\""
38
+ },
39
+ "devDependencies": {
40
+ "@eslint/js": "^9.39.1",
41
+ "@opentui/core": "^0.3.4",
42
+ "@opentui/keymap": "^0.3.4",
43
+ "@opentui/solid": "^0.3.4",
44
+ "@types/bun": "^1.3.14",
45
+ "eslint": "^9.39.1",
46
+ "eslint-config-prettier": "^10.1.8",
47
+ "eslint-plugin-prettier": "^5.1.3",
48
+ "prettier": "^3.2.4",
49
+ "typescript": "^5.5.0",
50
+ "typescript-eslint": "^8.47.0"
51
+ },
52
+ "dependencies": {
53
+ "@anthropic-ai/tokenizer": "^0.0.4",
54
+ "llama-tokenizer-js": "^1.2.2",
55
+ "llama3-tokenizer-js": "^1.2.0",
56
+ "solid-js": "^1.9.13",
57
+ "tiktoken": "^1.0.22",
58
+ "zod": "^3.23.0"
59
+ },
60
+ "peerDependencies": {
61
+ "@opencode-ai/plugin": "^1.17.4"
62
+ }
63
+ }