@krtclcdy/tersio 2.23.0 → 2.24.1

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 (58) hide show
  1. package/README.md +56 -45
  2. package/cli/agent-hosts.js +42 -0
  3. package/cli/agents.js +266 -0
  4. package/cli/banner.js +2 -3
  5. package/cli/common.js +16 -20
  6. package/cli/currency.js +11 -19
  7. package/cli/dashboard.js +216 -40
  8. package/cli/doctor-fix.js +40 -26
  9. package/cli/doctor.js +41 -41
  10. package/cli/hosts.js +114 -0
  11. package/cli/install.js +284 -179
  12. package/cli/interactive.js +62 -2
  13. package/cli/layer.js +22 -0
  14. package/cli/manifest.js +33 -0
  15. package/cli/omp-layer.js +51 -0
  16. package/cli/pi-layer.js +37 -0
  17. package/cli/pi-wiring.js +92 -0
  18. package/cli/profile.js +48 -48
  19. package/cli/reset.js +5 -32
  20. package/cli/rtk-wiring.js +7 -17
  21. package/cli/settings.js +3 -8
  22. package/cli/uninstall.js +162 -52
  23. package/cli/update.js +19 -27
  24. package/cli/usage.js +15 -5
  25. package/dashboard/dist/index.html +18 -18
  26. package/extensions/ai-addons-updater/index.js +37 -29
  27. package/extensions/ai-addons-updater/index.ts +39 -38
  28. package/extensions/caveman-session/index.js +19 -34
  29. package/extensions/caveman-session/index.ts +20 -35
  30. package/extensions/combo-toggle/index.js +47 -49
  31. package/extensions/combo-toggle/index.ts +42 -58
  32. package/extensions/lib/utils.js +40 -9
  33. package/extensions/lib/utils.ts +40 -9
  34. package/extensions/rtk-session/index.js +34 -38
  35. package/extensions/rtk-session/index.ts +32 -41
  36. package/extensions/shared/carbon.js +3 -11
  37. package/extensions/shared/carbon.ts +4 -11
  38. package/extensions/shared/host.js +58 -0
  39. package/extensions/shared/host.ts +94 -0
  40. package/extensions/shared/omp-prompt.js +12 -0
  41. package/extensions/shared/plugin-settings.js +33 -30
  42. package/extensions/shared/plugin-settings.ts +35 -26
  43. package/extensions/shared/pricing.js +25 -16
  44. package/extensions/shared/pricing.ts +27 -17
  45. package/extensions/shared/rtk-gain.js +6 -22
  46. package/extensions/shared/rtk-gain.ts +6 -22
  47. package/extensions/shared/session-state.js +44 -36
  48. package/extensions/shared/session-state.ts +48 -35
  49. package/extensions/shared/types.ts +10 -3
  50. package/extensions/shared/usage-ledger.js +160 -51
  51. package/extensions/shared/usage-ledger.ts +170 -67
  52. package/extensions/shared/usage-store.js +178 -24
  53. package/extensions/shared/usage-store.ts +176 -25
  54. package/extensions/tersio-commands/index.js +3 -6
  55. package/extensions/tersio-commands/index.ts +3 -6
  56. package/package.json +6 -5
  57. package/tersio.js +4 -6
  58. package/extensions/shared/mode-reinforcement.js +0 -26
@@ -1,13 +1,10 @@
1
- // /tersio root command — status, check, update, dashboard, usage, help.
2
- // Mode switches live on their own commands (/caveman, /rtk, /combo, and the
3
- // upstream /ponytail): the router keeps no redundant copies. Shared-state
4
- // publishes sync sibling mirrors live, so switches notify and take effect
5
- // next turn — no reload.
1
+ // Root command plus mode switches; sibling mirrors sync with no reload.
6
2
  import {
7
3
  getSharedComboState,
8
4
  reconcileSharedComboEntries,
9
5
  sessionEntries,
10
6
  } from '../shared/session-state.ts';
7
+ import { setExtensionLabel } from '../shared/host.ts';
11
8
  import os from 'node:os';
12
9
  import path from 'node:path';
13
10
  import { appendUsage, readUsage } from '../shared/usage-ledger.ts';
@@ -54,7 +51,7 @@ async function openDashboard(pi: ExtensionApi, ctx?: ExtensionCtx): Promise<void
54
51
  }
55
52
 
56
53
  export default function tersioCommandsExtension(pi: ExtensionApi): void {
57
- pi.setLabel?.('Tersio unified root command');
54
+ setExtensionLabel(pi, 'Tersio unified root command');
58
55
 
59
56
 
60
57
  pi.registerCommand?.('tersio', {
package/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "name": "@krtclcdy/tersio",
3
- "version": "2.23.0",
4
- "description": "✂️ Token-saving OMP add-ons: terse Caveman replies, compact RTK shell output, lean Ponytail code calls — one-command combo presets.",
3
+ "version": "2.24.1",
4
+ "description": "\u2702\ufe0f Token saver and usage tracker for coding agents: terse Caveman replies, compact RTK shell output, lean Ponytail code calls, and a gain dashboard \u2014 one-command combo presets over one shared extension tree.",
5
5
  "keywords": [
6
- "omp",
7
6
  "token-saving",
8
7
  "ai-tools",
9
8
  "developer-tools",
10
9
  "caveman-mode",
11
10
  "rtk-rust-token-killer",
12
- "ponytail-omp",
13
- "extensions"
11
+ "ponytail",
12
+ "extensions",
13
+ "pi",
14
+ "pi-package"
14
15
  ],
15
16
  "license": "MIT",
16
17
  "author": "KurutoDenzeru",
package/tersio.js CHANGED
@@ -1,7 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // tersio.ts — Install Tersio (caveman/rtk/ponytail) add-ons on any OMP device.
3
- // Usage: node tersio.js [install|update|reinstall|doctor|dashboard|uninstall|version|help] [options]
4
- // Requires: node/npm and omp CLI
2
+ // Install Tersio add-ons on any OMP device; see help for commands.
5
3
  import { PACKAGE_BIN, PACKAGE_VERSION, applyUpdate, commandArg, dashboard, dashboardExport, dashboardOpen, dashboardPort, doctor, reset, settings, showHelp, showVersion, uninstall, unknownCommand, update, usage, } from './cli/common.js';
6
4
  import { closeRL } from './cli/interactive.js';
7
5
  import { runInstall } from './cli/install.js';
@@ -16,9 +14,8 @@ function printHelp() {
16
14
  console.log(`Usage: ${PACKAGE_BIN} [command] [options]
17
15
 
18
16
  Commands:
19
- install Install the add-ons (user scope: all OMP sessions)
17
+ install Install the add-ons for one agent (--host omp|pi, or ask at a terminal)
20
18
  update Refresh the CLI and add-ons (RTK binary, Caveman rule, Ponytail)
21
- reinstall Clean and reinstall the user-scope add-ons
22
19
  doctor Check the current installation (--fix repairs, --dry-run previews)
23
20
  usage Ledger-backed usage + savings report
24
21
  dashboard Open the Dashboard (localhost only)
@@ -31,8 +28,9 @@ Commands:
31
28
  Options:
32
29
  --fix (doctor: repairs all; --fix=<scope> repairs one of extensions, registrations, rtk, ponytail, cli)
33
30
  --scope user (legacy; accepted and ignored — user scope is the only scope)
31
+ --host omp|pi (install|uninstall: target agent; a terminal asks instead)
34
32
  --keep-ponytail (uninstall: keep the bundled Ponytail copy — removed by default)
35
- --remove-rtk (uninstall: also remove the RTK binary)
33
+ --remove-rtk (uninstall: also remove the RTK binary; its OMP wiring always goes)
36
34
  --combo-default off|medium|balanced|max (implies caveman, rtk, ponytail)
37
35
  --caveman-default off|lite|full|ultra|wenyan-lite|wenyan-full|wenyan-ultra (override; default follows combo)
38
36
  --ponytail-default off|lite|full|ultra (override; default follows combo)
@@ -1,26 +0,0 @@
1
- import { asPromptArray, reconcileSharedComboEntries, sessionEntries, systemPromptIncludes } from './session-state.js';
2
- const MARKER = 'SUPREME TOKEN SAVER MODES ACTIVE';
3
- function instruction(state) {
4
- const modes = [
5
- state.caveman !== 'off' && `caveman=${state.caveman}`,
6
- state.rtk === 'on' && 'rtk=on',
7
- state.ponytail !== 'off' && `ponytail=${state.ponytail}`,
8
- ].filter(Boolean);
9
- if (!modes.length)
10
- return null;
11
- return `${MARKER}: ${modes.join(' · ')}. Keep these active for the entire response: concise Caveman prose, RTK for eligible noisy shell output, and the smallest correct Ponytail solution. Do not weaken or disable a mode unless the user explicitly asks.`;
12
- }
13
- export default function modeReinforcementExtension(pi) {
14
- pi.setLabel?.('Tersio mode reinforcement');
15
- pi.on('before_agent_start', async (event, ctx) => {
16
- if (!ctx?.hasUI)
17
- return;
18
- const text = instruction(reconcileSharedComboEntries(sessionEntries(ctx)));
19
- if (!text)
20
- return;
21
- const base = asPromptArray(event.systemPrompt);
22
- if (systemPromptIncludes(base, MARKER))
23
- return;
24
- return { systemPrompt: [...base, text] };
25
- });
26
- }