gnosys 5.5.0 → 5.6.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 (60) hide show
  1. package/README.md +44 -0
  2. package/dist/cli.js +204 -18
  3. package/dist/cli.js.map +1 -1
  4. package/dist/lib/chat/choose.d.ts +75 -0
  5. package/dist/lib/chat/choose.d.ts.map +1 -0
  6. package/dist/lib/chat/choose.js +146 -0
  7. package/dist/lib/chat/choose.js.map +1 -0
  8. package/dist/lib/chat/commands.d.ts +96 -0
  9. package/dist/lib/chat/commands.d.ts.map +1 -0
  10. package/dist/lib/chat/commands.js +367 -0
  11. package/dist/lib/chat/commands.js.map +1 -0
  12. package/dist/lib/chat/focus.d.ts +70 -0
  13. package/dist/lib/chat/focus.d.ts.map +1 -0
  14. package/dist/lib/chat/focus.js +120 -0
  15. package/dist/lib/chat/focus.js.map +1 -0
  16. package/dist/lib/chat/index.d.ts +32 -0
  17. package/dist/lib/chat/index.d.ts.map +1 -0
  18. package/dist/lib/chat/index.js +151 -0
  19. package/dist/lib/chat/index.js.map +1 -0
  20. package/dist/lib/chat/intent.d.ts +100 -0
  21. package/dist/lib/chat/intent.d.ts.map +1 -0
  22. package/dist/lib/chat/intent.js +192 -0
  23. package/dist/lib/chat/intent.js.map +1 -0
  24. package/dist/lib/chat/llmTurn.d.ts +37 -0
  25. package/dist/lib/chat/llmTurn.d.ts.map +1 -0
  26. package/dist/lib/chat/llmTurn.js +61 -0
  27. package/dist/lib/chat/llmTurn.js.map +1 -0
  28. package/dist/lib/chat/recall.d.ts +58 -0
  29. package/dist/lib/chat/recall.d.ts.map +1 -0
  30. package/dist/lib/chat/recall.js +109 -0
  31. package/dist/lib/chat/recall.js.map +1 -0
  32. package/dist/lib/chat/render.d.ts +30 -0
  33. package/dist/lib/chat/render.d.ts.map +1 -0
  34. package/dist/lib/chat/render.js +737 -0
  35. package/dist/lib/chat/render.js.map +1 -0
  36. package/dist/lib/chat/session.d.ts +121 -0
  37. package/dist/lib/chat/session.d.ts.map +1 -0
  38. package/dist/lib/chat/session.js +148 -0
  39. package/dist/lib/chat/session.js.map +1 -0
  40. package/dist/lib/chat/types.d.ts +42 -0
  41. package/dist/lib/chat/types.d.ts.map +1 -0
  42. package/dist/lib/chat/types.js +6 -0
  43. package/dist/lib/chat/types.js.map +1 -0
  44. package/dist/lib/chat/write.d.ts +66 -0
  45. package/dist/lib/chat/write.d.ts.map +1 -0
  46. package/dist/lib/chat/write.js +203 -0
  47. package/dist/lib/chat/write.js.map +1 -0
  48. package/dist/lib/db.d.ts +3 -1
  49. package/dist/lib/db.d.ts.map +1 -1
  50. package/dist/lib/db.js +18 -2
  51. package/dist/lib/db.js.map +1 -1
  52. package/dist/lib/exportProject.d.ts +51 -0
  53. package/dist/lib/exportProject.d.ts.map +1 -0
  54. package/dist/lib/exportProject.js +72 -0
  55. package/dist/lib/exportProject.js.map +1 -0
  56. package/dist/lib/importProject.d.ts +35 -0
  57. package/dist/lib/importProject.d.ts.map +1 -0
  58. package/dist/lib/importProject.js +135 -0
  59. package/dist/lib/importProject.js.map +1 -0
  60. package/package.json +7 -1
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Multi-choice protocol — gnosys-choose fenced YAML.
3
+ *
4
+ * The LLM is taught (via system prompt) to emit a fenced block when it wants
5
+ * the user to pick from a small set of options:
6
+ *
7
+ * ```gnosys-choose
8
+ * prompt: Which approach should we take?
9
+ * options:
10
+ * - id: a
11
+ * label: Refactor in place — keep the same module
12
+ * detail: Lower risk, but the existing API stays awkward
13
+ * - id: b
14
+ * label: Extract to a new module
15
+ * detail: Cleaner separation; one-time migration cost
16
+ * ```
17
+ *
18
+ * The TUI parses the fence after the assistant turn completes, renders an
19
+ * arrow-key selectable list, and on selection injects a synthetic user turn
20
+ * "[picked: <id> — <label>]" before running the next LLM call.
21
+ *
22
+ * The protocol works in reverse too — TUI helpers can pose multiple-choice
23
+ * questions to the user using the same parser/renderer pieces.
24
+ *
25
+ * Failures are soft: a malformed fence renders as plain text in the
26
+ * conversation buffer. We log a `chat_choose_parse_error` style notice so
27
+ * agents can debug without blocking the chat.
28
+ */
29
+ export interface ChooseOption {
30
+ id: string;
31
+ label: string;
32
+ detail?: string;
33
+ }
34
+ export interface ChooseBlock {
35
+ prompt: string;
36
+ options: ChooseOption[];
37
+ }
38
+ /** System prompt addendum that teaches the LLM the fence syntax. */
39
+ export declare const CHOOSE_SYSTEM_PROMPT_ADDENDUM = "\nWhen you want the user to pick from a SHORT set of options (2\u20136), emit a fenced block:\n\n```gnosys-choose\nprompt: <one-line question>\noptions:\n - id: a\n label: <short>\n detail: <one-line context, optional>\n - id: b\n label: <short>\n```\n\nUse this only when a discrete choice will materially change what you do next. Don't use it for yes/no \u2014 just ask in prose. Don't use it to summarize options that the user has already chosen between.";
40
+ /**
41
+ * Find the first gnosys-choose fence in a text and parse it. Returns
42
+ * - { block, before, after } when a well-formed fence is present
43
+ * - { error } when a fence exists but failed to parse
44
+ * - null when no fence is present
45
+ */
46
+ export type ExtractResult = {
47
+ kind: "ok";
48
+ block: ChooseBlock;
49
+ before: string;
50
+ after: string;
51
+ } | {
52
+ kind: "parse-error";
53
+ before: string;
54
+ rawFence: string;
55
+ after: string;
56
+ reason: string;
57
+ } | null;
58
+ export declare function extractChooseFence(text: string): ExtractResult;
59
+ /**
60
+ * Hand-rolled YAML parser for the minimal gnosys-choose schema.
61
+ * No external dependency. Tolerates Windows line endings and trailing whitespace.
62
+ *
63
+ * Accepts:
64
+ * prompt: <text> # one-line scalar
65
+ * options: # list literal follows
66
+ * - id: <token>
67
+ * label: <text>
68
+ * detail: <text> # optional
69
+ * - id: <token>
70
+ * label: <text>
71
+ */
72
+ export declare function parseChooseYaml(yaml: string): ChooseBlock;
73
+ /** Format a user's selection as a synthetic user turn. */
74
+ export declare function formatSelection(option: ChooseOption): string;
75
+ //# sourceMappingURL=choose.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"choose.d.ts","sourceRoot":"","sources":["../../../src/lib/chat/choose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAED,oEAAoE;AACpE,eAAO,MAAM,6BAA6B,ydAa6J,CAAC;AAIxM;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjE;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACxF,IAAI,CAAC;AAET,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CA+B9D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAsDzD;AAED,0DAA0D;AAC1D,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAG5D"}
@@ -0,0 +1,146 @@
1
+ /**
2
+ * Multi-choice protocol — gnosys-choose fenced YAML.
3
+ *
4
+ * The LLM is taught (via system prompt) to emit a fenced block when it wants
5
+ * the user to pick from a small set of options:
6
+ *
7
+ * ```gnosys-choose
8
+ * prompt: Which approach should we take?
9
+ * options:
10
+ * - id: a
11
+ * label: Refactor in place — keep the same module
12
+ * detail: Lower risk, but the existing API stays awkward
13
+ * - id: b
14
+ * label: Extract to a new module
15
+ * detail: Cleaner separation; one-time migration cost
16
+ * ```
17
+ *
18
+ * The TUI parses the fence after the assistant turn completes, renders an
19
+ * arrow-key selectable list, and on selection injects a synthetic user turn
20
+ * "[picked: <id> — <label>]" before running the next LLM call.
21
+ *
22
+ * The protocol works in reverse too — TUI helpers can pose multiple-choice
23
+ * questions to the user using the same parser/renderer pieces.
24
+ *
25
+ * Failures are soft: a malformed fence renders as plain text in the
26
+ * conversation buffer. We log a `chat_choose_parse_error` style notice so
27
+ * agents can debug without blocking the chat.
28
+ */
29
+ /** System prompt addendum that teaches the LLM the fence syntax. */
30
+ export const CHOOSE_SYSTEM_PROMPT_ADDENDUM = `
31
+ When you want the user to pick from a SHORT set of options (2–6), emit a fenced block:
32
+
33
+ \`\`\`gnosys-choose
34
+ prompt: <one-line question>
35
+ options:
36
+ - id: a
37
+ label: <short>
38
+ detail: <one-line context, optional>
39
+ - id: b
40
+ label: <short>
41
+ \`\`\`
42
+
43
+ Use this only when a discrete choice will materially change what you do next. Don't use it for yes/no — just ask in prose. Don't use it to summarize options that the user has already chosen between.`;
44
+ const FENCE_OPEN = /```\s*gnosys-choose\s*\n([\s\S]*?)```/;
45
+ export function extractChooseFence(text) {
46
+ const match = text.match(FENCE_OPEN);
47
+ if (!match)
48
+ return null;
49
+ const fenceContent = match[1].trim();
50
+ const start = match.index ?? 0;
51
+ const end = start + match[0].length;
52
+ const before = text.slice(0, start).trimEnd();
53
+ const after = text.slice(end).trimStart();
54
+ try {
55
+ const block = parseChooseYaml(fenceContent);
56
+ if (!block.prompt || block.options.length === 0) {
57
+ return {
58
+ kind: "parse-error",
59
+ before,
60
+ rawFence: match[0],
61
+ after,
62
+ reason: "missing prompt or empty options",
63
+ };
64
+ }
65
+ return { kind: "ok", block, before, after };
66
+ }
67
+ catch (err) {
68
+ return {
69
+ kind: "parse-error",
70
+ before,
71
+ rawFence: match[0],
72
+ after,
73
+ reason: err instanceof Error ? err.message : String(err),
74
+ };
75
+ }
76
+ }
77
+ /**
78
+ * Hand-rolled YAML parser for the minimal gnosys-choose schema.
79
+ * No external dependency. Tolerates Windows line endings and trailing whitespace.
80
+ *
81
+ * Accepts:
82
+ * prompt: <text> # one-line scalar
83
+ * options: # list literal follows
84
+ * - id: <token>
85
+ * label: <text>
86
+ * detail: <text> # optional
87
+ * - id: <token>
88
+ * label: <text>
89
+ */
90
+ export function parseChooseYaml(yaml) {
91
+ const lines = yaml.replace(/\r\n/g, "\n").split("\n");
92
+ let prompt = "";
93
+ const options = [];
94
+ let inOptions = false;
95
+ let current = null;
96
+ for (let i = 0; i < lines.length; i++) {
97
+ const line = lines[i];
98
+ if (!line.trim())
99
+ continue;
100
+ // Top-level "prompt:" line
101
+ if (!inOptions) {
102
+ const m = line.match(/^prompt:\s*(.+?)\s*$/);
103
+ if (m) {
104
+ prompt = m[1];
105
+ continue;
106
+ }
107
+ if (/^options:\s*$/.test(line)) {
108
+ inOptions = true;
109
+ continue;
110
+ }
111
+ // Unknown top-level field — skip (forward-compat)
112
+ continue;
113
+ }
114
+ // Inside options:
115
+ const itemStart = line.match(/^\s*-\s*id:\s*(.+?)\s*$/);
116
+ if (itemStart) {
117
+ // Push previous item if any
118
+ if (current && current.label)
119
+ options.push(current);
120
+ current = { id: itemStart[1], label: "" };
121
+ continue;
122
+ }
123
+ if (!current)
124
+ continue;
125
+ const labelMatch = line.match(/^\s*label:\s*(.+?)\s*$/);
126
+ if (labelMatch) {
127
+ current.label = labelMatch[1];
128
+ continue;
129
+ }
130
+ const detailMatch = line.match(/^\s*detail:\s*(.+?)\s*$/);
131
+ if (detailMatch) {
132
+ current.detail = detailMatch[1];
133
+ continue;
134
+ }
135
+ }
136
+ // Flush the last option
137
+ if (current && current.label)
138
+ options.push(current);
139
+ return { prompt, options };
140
+ }
141
+ /** Format a user's selection as a synthetic user turn. */
142
+ export function formatSelection(option) {
143
+ const detail = option.detail ? ` (${option.detail})` : "";
144
+ return `[picked: ${option.id} — ${option.label}${detail}]`;
145
+ }
146
+ //# sour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ing what
5
+ * happened. The TUI translates the result into UI updates (system messages,
6
+ * exit, conversation buffer changes, etc.). Commands run synchronously when
7
+ * possible; async ones return a Promise.
8
+ *
9
+ * Phase 2 commands: /help, /clear, /history, /read, /list, /tags, /dashboard,
10
+ * /quit, /provider. Phases 3–7 add /pin, /scope, /recall, /threshold,
11
+ * /reinforce, /remember, /save-turn, /attach, /focus, /branch, /resume-focus,
12
+ * /dream-here, /search-chats, /export.
13
+ */
14
+ import { Turn } from "./types.js";
15
+ export interface CommandContext {
16
+ /** Current session ID. */
17
+ sessionId: string;
18
+ /** Conversation buffer as the LLM sees it. Commands may read or mutate (via the result's nextBuffer). */
19
+ buffer: Turn[];
20
+ /** Current provider name. */
21
+ provider: string;
22
+ /** Current model. */
23
+ model: string;
24
+ }
25
+ export type CommandResult = {
26
+ kind: "ok";
27
+ message?: string;
28
+ } | {
29
+ kind: "clear-buffer";
30
+ } | {
31
+ kind: "exit";
32
+ } | {
33
+ kind: "switch-provider";
34
+ provider: string;
35
+ model?: string;
36
+ } | {
37
+ kind: "show";
38
+ lines: string[];
39
+ } | {
40
+ kind: "pin";
41
+ memoryId: string;
42
+ } | {
43
+ kind: "unpin";
44
+ memoryId: string;
45
+ } | {
46
+ kind: "scope";
47
+ scope: "project" | "user" | "global" | "federated";
48
+ } | {
49
+ kind: "threshold";
50
+ value: number;
51
+ } | {
52
+ kind: "preview-recall";
53
+ query: string;
54
+ } | {
55
+ kind: "reinforce";
56
+ memoryId: string;
57
+ } | {
58
+ kind: "remember";
59
+ text: string;
60
+ } | {
61
+ kind: "save-turn";
62
+ } | {
63
+ kind: "attach";
64
+ filePath: string;
65
+ } | {
66
+ kind: "focus";
67
+ topic: string;
68
+ } | {
69
+ kind: "branch";
70
+ } | {
71
+ kind: "resume-focus";
72
+ topic?: string;
73
+ } | {
74
+ kind: "export-session";
75
+ filePath: string;
76
+ } | {
77
+ kind: "search-chats";
78
+ query: string;
79
+ } | {
80
+ kind: "dream-here";
81
+ } | {
82
+ kind: "error";
83
+ message: string;
84
+ };
85
+ export interface CommandSpec {
86
+ name: string;
87
+ aliases?: string[];
88
+ summary: string;
89
+ usage?: string;
90
+ handler: (ctx: CommandContext, args: string[]) => CommandResult | Promise<CommandResult>;
91
+ }
92
+ export declare function listCommands(): CommandSpec[];
93
+ export declare function findCommand(name: string): CommandSpec | undefined;
94
+ /** Parse a raw input line and dispatch if it's a slash command. Returns null if it's not a command. */
95
+ export declare function dispatchCommand(raw: string, ctx: CommandContext): Promise<CommandResult | null>;
96
+ //# sourceMappingURL=commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/lib/chat/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,MAAM,WAAW,cAAc;IAC7B,0BAA0B;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,yGAAyG;IACzG,MAAM,EAAE,IAAI,EAAE,CAAC;IACf,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,GACxB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7D;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,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