Amit Haridas
cb0b2eac3d
feat(ai-assist): pure prompt builder + result applier
...
buildAssistPrompt(action, selection) returns the {system, messages}
payload for rewrite/shorten/expand. Enforces 8KB selection cap and
typed errors with codes (unknown_action, bad_selection,
empty_selection, selection_too_large) so the IPC layer can map them
to user-friendly messages.
applyAssistResult(original, newText) trims the response and rejects
empty/unchanged payloads so a no-op streaming chunk doesn't churn
the editor.
15 new tests cover action coverage, prompt content, all four error
codes, cap-edge (exactly 8KB OK, 8KB+1 rejected), and trim semantics.
Amit Haridas
2026-09-30 20:01:54 +05:30
..
2026-09-14 21:36:02 +05:30
2026-09-14 20:46:49 +05:30
2026-09-05 20:48:39 +05:30
2026-09-14 22:37:02 +05:30
2026-09-14 00:00:16 +05:30
2026-09-14 00:00:16 +05:30
2026-09-05 21:53:34 +05:30
2026-06-30 12:56:33 +05:30
2026-08-23 19:31:33 +05:30
2026-09-14 14:56:05 +05:30
2026-09-14 14:56:05 +05:30
2026-09-14 14:56:05 +05:30
2026-08-23 19:31:33 +05:30
2026-08-23 19:31:33 +05:30
2026-09-14 21:36:02 +05:30
2026-06-30 12:56:33 +05:30
2026-09-14 21:36:02 +05:30
2026-08-23 19:31:33 +05:30
2026-08-23 19:31:33 +05:30
2026-09-14 21:41:58 +05:30
2026-09-15 09:23:58 +05:30
2026-09-14 21:36:02 +05:30
2026-09-14 23:09:23 +05:30
2026-09-15 09:23:58 +05:30
2026-09-15 09:23:58 +05:30
2026-09-14 14:56:05 +05:30
2026-08-23 19:31:33 +05:30
2026-06-30 12:56:33 +05:30
2026-08-23 19:31:33 +05:30
2026-09-05 21:53:34 +05:30
2026-09-30 20:01:54 +05:30
2026-08-23 19:31:33 +05:30
2026-06-30 12:56:33 +05:30
2026-06-30 12:56:33 +05:30
2026-06-30 12:56:33 +05:30
2026-09-14 00:00:16 +05:30
2026-06-30 12:56:33 +05:30
2026-09-05 23:59:53 +05:30
2026-08-23 19:31:33 +05:30
2026-06-30 12:56:33 +05:30
2026-09-05 22:48:45 +05:30
2026-08-23 19:31:33 +05:30
2026-08-23 19:31:33 +05:30
2026-06-30 12:56:33 +05:30
2026-04-23 22:55:12 +05:30
2026-08-23 19:31:33 +05:30
2026-06-30 12:56:33 +05:30
2026-08-23 19:31:33 +05:30
2026-09-14 21:06:28 +05:30
2026-09-14 21:06:28 +05:30
2026-06-30 12:56:33 +05:30
2026-09-05 21:53:34 +05:30
2026-06-30 13:57:34 +05:30
2026-09-30 19:53:44 +05:30
2026-09-30 19:58:18 +05:30
2026-09-14 14:56:05 +05:30
2026-06-30 12:56:33 +05:30
2026-09-05 20:48:39 +05:30
2026-06-30 12:56:33 +05:30
2026-08-23 19:31:33 +05:30
2026-06-30 12:56:33 +05:30
2026-09-14 14:56:05 +05:30
2026-08-23 19:31:33 +05:30
2026-09-05 21:53:34 +05:30
2026-06-30 12:56:33 +05:30
2026-09-14 20:11:44 +05:30
2026-08-23 19:31:33 +05:30
2026-09-05 20:48:39 +05:30
2026-08-23 19:31:33 +05:30
2026-09-30 19:56:50 +05:30
2026-09-14 14:56:05 +05:30