@qloo/qloo-harness 0.1.19 → 0.1.21
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 +21 -0
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/runtime/explore-policy.js +31 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -83,6 +83,25 @@ qloo --version
|
|
|
83
83
|
qloo
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
+
### Uninstall
|
|
87
|
+
|
|
88
|
+
Remove the global package with the same package manager you used to install it:
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
pnpm remove --global @qloo/qloo-harness
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Or with npm:
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
npm uninstall --global @qloo/qloo-harness
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Package removal intentionally leaves credentials, settings, and sessions in
|
|
101
|
+
`~/.qloo` (or the directory selected by `QLOO_HOME`). A later reinstall reuses
|
|
102
|
+
that state and will not ask for keys again. Delete only that dedicated state
|
|
103
|
+
directory separately if you also want to erase the saved configuration.
|
|
104
|
+
|
|
86
105
|
### Run from Source
|
|
87
106
|
|
|
88
107
|
Contributors can prepare the repository once instead of installing the public
|
|
@@ -358,6 +377,8 @@ and normalized outputs at the project's existing code boundary.
|
|
|
358
377
|
|
|
359
378
|
Inside chat, `/start` offers guided goals and `/status` reports the active
|
|
360
379
|
profile, actual transport, model, workspace, context use, and turn budget.
|
|
380
|
+
`/usage` shows the current model's context-window use as a raw token count and
|
|
381
|
+
percentage, while `/exit` closes the harness cleanly.
|
|
361
382
|
`/why`, `/sources`, `/request`, and `/trace` show the latest normalized query
|
|
362
383
|
intent, provenance, safe underlying GET request preview, and privacy-safe
|
|
363
384
|
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.
|
|
8
|
+
var HARNESS_VERSION = "0.1.21";
|
|
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.
|
|
677
|
+
declare const HARNESS_VERSION = "0.1.21";
|
|
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",
|
|
@@ -184,12 +190,19 @@ function createHarnessPolicyExtension(profile, allowedToolNames, runtimeInfo, co
|
|
|
184
190
|
return;
|
|
185
191
|
}
|
|
186
192
|
};
|
|
193
|
+
const notifyReadable = (context, label, body) => {
|
|
194
|
+
const message = context.mode === "tui" ? [
|
|
195
|
+
context.ui.theme.fg("accent", label),
|
|
196
|
+
context.ui.theme.fg("text", body)
|
|
197
|
+
].join("\n") : `${label}
|
|
198
|
+
${body}`;
|
|
199
|
+
context.ui.notify(message);
|
|
200
|
+
};
|
|
187
201
|
const notifyJson = (context, label, value, maximumCharacters = 4e3) => {
|
|
188
202
|
const serialized = JSON.stringify(redactSensitiveResult(value), null, 2);
|
|
189
203
|
const bounded = serialized.length > maximumCharacters ? `${serialized.slice(0, maximumCharacters)}
|
|
190
204
|
\u2026` : serialized;
|
|
191
|
-
context
|
|
192
|
-
${bounded}`);
|
|
205
|
+
notifyReadable(context, label, bounded);
|
|
193
206
|
};
|
|
194
207
|
const setNextWidget = (context) => {
|
|
195
208
|
if (context?.mode !== "tui" || !context.ui?.setWidget)
|
|
@@ -432,13 +445,16 @@ ${bounded}`);
|
|
|
432
445
|
description: "Choose a guided Qloo goal and editable starter prompt",
|
|
433
446
|
handler: async (_args, context) => showGuidedStart(context)
|
|
434
447
|
});
|
|
448
|
+
pi.registerCommand("exit", {
|
|
449
|
+
description: "Exit the Qloo harness cleanly",
|
|
450
|
+
handler: async (_args, context) => context.shutdown()
|
|
451
|
+
});
|
|
435
452
|
pi.registerCommand("status", {
|
|
436
453
|
description: "Show Qloo profile, transport, model, workspace, and context usage",
|
|
437
454
|
handler: async (_args, context) => {
|
|
438
455
|
const usage = context.getContextUsage();
|
|
439
456
|
const model = context.model ? `${context.model.provider}/${context.model.id}` : "unavailable";
|
|
440
|
-
context
|
|
441
|
-
"Qloo status",
|
|
457
|
+
notifyReadable(context, "Qloo status", [
|
|
442
458
|
`Profile: ${activeProfile}`,
|
|
443
459
|
`Transport: ${runtimeInfo ? `${runtimeInfo.transport} (${runtimeInfo.transportName})` : "not declared"}`,
|
|
444
460
|
`Resolution: ${runtimeInfo?.resolution ? `${runtimeInfo.resolution.name} (${runtimeInfo.resolution.tag_strategy}${runtimeInfo.resolution.uses_model ? ", model-assisted" : ""})` : "not declared"}`,
|
|
@@ -446,11 +462,21 @@ ${bounded}`);
|
|
|
446
462
|
`Model: ${model}`,
|
|
447
463
|
`Workspace: ${context.cwd}`,
|
|
448
464
|
`Remembered matches: ${resolutionMemory.list().length}`,
|
|
449
|
-
`Context: ${
|
|
465
|
+
`Context: ${formatContextUsage(usage)}`,
|
|
450
466
|
`Turn budget: ${activeDefinition().maxToolCallsPerTurn} calls; ${activeDefinition().maxIdenticalToolCallsPerTurn} identical calls`
|
|
451
467
|
].join("\n"));
|
|
452
468
|
}
|
|
453
469
|
});
|
|
470
|
+
pi.registerCommand("usage", {
|
|
471
|
+
description: "Show current model context-window usage",
|
|
472
|
+
handler: async (_args, context) => {
|
|
473
|
+
const model = context.model ? `${context.model.provider}/${context.model.id}` : "unavailable";
|
|
474
|
+
notifyReadable(context, "Qloo context usage", [
|
|
475
|
+
`Model: ${model}`,
|
|
476
|
+
`Context used: ${formatContextUsage(context.getContextUsage())}`
|
|
477
|
+
].join("\n"));
|
|
478
|
+
}
|
|
479
|
+
});
|
|
454
480
|
pi.registerCommand("why", {
|
|
455
481
|
description: "Show the normalized intent for the latest Qloo workflow",
|
|
456
482
|
handler: async (_args, context) => {
|