@qloo/qloo-harness 0.1.19 → 0.1.20

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 CHANGED
@@ -358,6 +358,8 @@ and normalized outputs at the project's existing code boundary.
358
358
 
359
359
  Inside chat, `/start` offers guided goals and `/status` reports the active
360
360
  profile, actual transport, model, workspace, context use, and turn budget.
361
+ `/usage` shows the current model's context-window use as a raw token count and
362
+ percentage, while `/exit` closes the harness cleanly.
361
363
  `/why`, `/sources`, `/request`, and `/trace` show the latest normalized query
362
364
  intent, provenance, safe underlying GET request preview, and privacy-safe
363
365
  execution metadata respectively. `/next` offers operation-aware continuations.
package/dist/cli.js CHANGED
@@ -5,7 +5,7 @@ const require = __qlooCreateRequire(import.meta.url);
5
5
  import { launchInteractiveHarness } from "./app.js";
6
6
  import { isQlooHarnessProfile, QLOO_DEFAULT_PROFILE, QLOO_HARNESS_PROFILES } from "./profiles.js";
7
7
  import { MissingModelAuthenticationError } from "./runtime/pi-adapter.js";
8
- var HARNESS_VERSION = "0.1.19";
8
+ var HARNESS_VERSION = "0.1.20";
9
9
  var HARNESS_HELP = `Qloo terminal harness
10
10
 
11
11
  Usage:
package/dist/index.d.ts CHANGED
@@ -674,7 +674,7 @@ interface LaunchInteractiveHarnessOptions {
674
674
  }
675
675
  declare function launchInteractiveHarness(options?: LaunchInteractiveHarnessOptions): Promise<void>;
676
676
 
677
- declare const HARNESS_VERSION = "0.1.19";
677
+ declare const HARNESS_VERSION = "0.1.20";
678
678
  declare const HARNESS_HELP = "Qloo terminal harness\n\nUsage:\n qloo Start guided Qloo chat\n qloo chat Start guided Qloo chat explicitly\n qloo explore Ask grounded Qloo questions (read-only workspace)\n qloo integrate Inspect and design a Qloo integration\n qloo plan Open interactive read-only planning\n qloo plan \"<goal>\" --json\n Create a typed, evidence-backed plan\n qloo build Open approval-gated build mode\n qloo build --plan <plan-id>\n Build from a validated integration plan\n qloo chat --mode <explore|integrate|plan|build>\n qloo --help Show this help\n qloo --version Show the harness version\n\nThe deterministic API CLI and additional harness commands are attached by the\ntop-level qloo command router.";
679
679
  interface HarnessCliDependencies {
680
680
  launch: (profile: QlooHarnessProfile) => Promise<void>;
@@ -26,6 +26,12 @@ var AUTOMATIC_DIAGNOSTIC_CODES = /* @__PURE__ */ new Set([
26
26
  "RESOLVER_CONNECT",
27
27
  "RESOLVER_TIMEOUT"
28
28
  ]);
29
+ function formatContextUsage(usage) {
30
+ const tokens = usage?.tokens ?? "unknown";
31
+ const contextWindow = usage?.contextWindow ?? "unknown";
32
+ const percentage = usage?.percent === null || usage?.percent === void 0 ? "percentage unavailable" : `${usage.percent.toFixed(1)}%`;
33
+ return `${tokens} / ${contextWindow} tokens (${percentage})`;
34
+ }
29
35
  var reservedBuiltInTools = /* @__PURE__ */ new Set([
30
36
  ...QLOO_WORKSPACE_TOOL_NAMES,
31
37
  "grep",
@@ -432,6 +438,10 @@ ${bounded}`);
432
438
  description: "Choose a guided Qloo goal and editable starter prompt",
433
439
  handler: async (_args, context) => showGuidedStart(context)
434
440
  });
441
+ pi.registerCommand("exit", {
442
+ description: "Exit the Qloo harness cleanly",
443
+ handler: async (_args, context) => context.shutdown()
444
+ });
435
445
  pi.registerCommand("status", {
436
446
  description: "Show Qloo profile, transport, model, workspace, and context usage",
437
447
  handler: async (_args, context) => {
@@ -446,11 +456,22 @@ ${bounded}`);
446
456
  `Model: ${model}`,
447
457
  `Workspace: ${context.cwd}`,
448
458
  `Remembered matches: ${resolutionMemory.list().length}`,
449
- `Context: ${usage?.tokens ?? "unknown"}/${usage?.contextWindow ?? "unknown"} tokens${usage?.percent === null || usage?.percent === void 0 ? "" : ` (${usage.percent.toFixed(1)}%)`}`,
459
+ `Context: ${formatContextUsage(usage)}`,
450
460
  `Turn budget: ${activeDefinition().maxToolCallsPerTurn} calls; ${activeDefinition().maxIdenticalToolCallsPerTurn} identical calls`
451
461
  ].join("\n"));
452
462
  }
453
463
  });
464
+ pi.registerCommand("usage", {
465
+ description: "Show current model context-window usage",
466
+ handler: async (_args, context) => {
467
+ const model = context.model ? `${context.model.provider}/${context.model.id}` : "unavailable";
468
+ context.ui.notify([
469
+ "Qloo context usage",
470
+ `Model: ${model}`,
471
+ `Context used: ${formatContextUsage(context.getContextUsage())}`
472
+ ].join("\n"));
473
+ }
474
+ });
454
475
  pi.registerCommand("why", {
455
476
  description: "Show the normalized intent for the latest Qloo workflow",
456
477
  handler: async (_args, context) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qloo/qloo-harness",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "description": "Qloo-focused terminal agent built on the Pi SDK",
5
5
  "private": false,
6
6
  "publishConfig": {