@pentoshi/clai 4.3.0 → 4.4.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.
- package/README.md +1 -1
- package/dist/agent/runner.js +8 -9
- package/dist/agent/runner.js.map +1 -1
- package/dist/app/commands/catalog.js +4 -5
- package/dist/app/commands/catalog.js.map +1 -1
- package/dist/app/commands/registry.js +0 -1
- package/dist/app/commands/registry.js.map +1 -1
- package/dist/app/controllers/session-controller.d.ts +3 -0
- package/dist/app/controllers/session-controller.js +11 -25
- package/dist/app/controllers/session-controller.js.map +1 -1
- package/dist/app/controllers/session-persistence.d.ts +4 -1
- package/dist/app/controllers/session-persistence.js +23 -5
- package/dist/app/controllers/session-persistence.js.map +1 -1
- package/dist/app/controllers/session-responder.d.ts +1 -0
- package/dist/app/controllers/session-responder.js +8 -0
- package/dist/app/controllers/session-responder.js.map +1 -1
- package/dist/app/controllers/session-usage-ledger.d.ts +63 -0
- package/dist/app/controllers/session-usage-ledger.js +232 -0
- package/dist/app/controllers/session-usage-ledger.js.map +1 -0
- package/dist/classic/app/ClassicApp.js +2 -1
- package/dist/classic/app/ClassicApp.js.map +1 -1
- package/dist/classic/chrome/toast-rows.d.ts +1 -0
- package/dist/classic/chrome/toast-rows.js +18 -0
- package/dist/classic/chrome/toast-rows.js.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/llm/custom-provider-profile.js +2 -2
- package/dist/llm/custom-provider-profile.js.map +1 -1
- package/dist/llm/http.js +33 -0
- package/dist/llm/http.js.map +1 -1
- package/dist/llm/key-rotation.d.ts +1 -0
- package/dist/llm/key-rotation.js +8 -0
- package/dist/llm/key-rotation.js.map +1 -1
- package/dist/llm/provider-profile-layers.js +14 -13
- package/dist/llm/provider-profile-layers.js.map +1 -1
- package/dist/llm/provider-profile.d.ts +1 -0
- package/dist/llm/provider-profile.js +5 -0
- package/dist/llm/provider-profile.js.map +1 -1
- package/dist/llm/provider-profiles.js +2 -2
- package/dist/llm/provider-profiles.js.map +1 -1
- package/dist/llm/stream-terminal.js +2 -1
- package/dist/llm/stream-terminal.js.map +1 -1
- package/dist/store/history.d.ts +1 -0
- package/dist/store/history.js +7 -0
- package/dist/store/history.js.map +1 -1
- package/dist/store/scope.d.ts +8 -0
- package/dist/store/scope.js +138 -1
- package/dist/store/scope.js.map +1 -1
- package/dist/tools/interactive-session-tools.js +5 -5
- package/dist/tools/interactive-session-tools.js.map +1 -1
- package/dist/tools/registry.js +2 -2
- package/dist/tools/registry.js.map +1 -1
- package/dist/ui-core/bootstrap/composition-root.js +8 -2
- package/dist/ui-core/bootstrap/composition-root.js.map +1 -1
- package/dist/ui-core/commands/command-handlers.js +2 -1
- package/dist/ui-core/commands/command-handlers.js.map +1 -1
- package/dist/ui-core/commands/config-commands.js +17 -14
- package/dist/ui-core/commands/config-commands.js.map +1 -1
- package/dist/ui-core/commands/session-commands.d.ts +1 -0
- package/dist/ui-core/commands/session-commands.js +20 -0
- package/dist/ui-core/commands/session-commands.js.map +1 -1
- package/dist/ui-core/rendering/format-help.js +2 -2
- package/dist/ui-core/rendering/format-help.js.map +1 -1
- package/dist/ui-core/rendering/format-usage.d.ts +6 -0
- package/dist/ui-core/rendering/format-usage.js +116 -0
- package/dist/ui-core/rendering/format-usage.js.map +1 -0
- package/dist/version.generated.d.ts +2 -2
- package/dist/version.generated.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -412,7 +412,7 @@ Tool cards show the command/input clearly, with a live elapsed timer next to the
|
|
|
412
412
|
|---------|------|
|
|
413
413
|
| `/ask` · `/agent` · `/plan` | Switch mode (plan = design-then-approve) |
|
|
414
414
|
| `/implement` · `/discard` | Approve+execute or drop the current plan |
|
|
415
|
-
| `/model [name\|#]` · `/provider [name]`
|
|
415
|
+
| `/model [name\|#]` · `/provider [name]` | Pick model / switch provider |
|
|
416
416
|
| `/set [provider]` · `/unset [provider]` · `/keys` · `/info [provider]` | Manage API keys, endpoint URLs, and view provider setup / pricing info |
|
|
417
417
|
| `/effort [level]` · `/reasoning [level]` | Thinking / reasoning effort |
|
|
418
418
|
| `/freeonly [on\|off]` · `/fallback [on\|off]` | Free-only filter · cross-provider fallback |
|
package/dist/agent/runner.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { streamWithProvider } from "../llm/router.js";
|
|
3
|
+
import { isProviderFailureStatus } from "../llm/key-rotation.js";
|
|
3
4
|
import { operationUsageFromError } from "../llm/operation-ledger.js";
|
|
4
5
|
import { contextAttemptFromOperationUsage } from "../llm/context-snapshot.js";
|
|
5
6
|
import { modelContextWindow } from "../llm/token-usage.js";
|
|
@@ -50,7 +51,7 @@ import { accountAssembledRequest, RequestOverLimitError, } from "./request-accou
|
|
|
50
51
|
import { autoCompactTriggerTokens, dedupeToolContextOutput, freeTierGuardNotices, getReliabilityPolicy, resolveStepMaxTokens, } from "./reliability-policy.js";
|
|
51
52
|
import { auditLog } from "../store/logs.js";
|
|
52
53
|
import { loadProjectContext } from "../store/project.js";
|
|
53
|
-
import {
|
|
54
|
+
import { loadScopeForSession, isScopeActive } from "../store/scope.js";
|
|
54
55
|
import { ensureProviderConfigured } from "../commands/providers.js";
|
|
55
56
|
import { createThinkingStreamParser, rememberThinking, stripThinking, } from "../ui/thinking.js";
|
|
56
57
|
import { hasReasoningMarker } from "../llm/reasoning-marker.js";
|
|
@@ -640,7 +641,7 @@ export async function runAgentTurn(prompt, options = {}) {
|
|
|
640
641
|
systemSections.push(pentestNoLocalServerDirective());
|
|
641
642
|
}
|
|
642
643
|
{
|
|
643
|
-
const engScope = await
|
|
644
|
+
const engScope = await loadScopeForSession(session.sessionId).catch(() => undefined);
|
|
644
645
|
const scopeBlock = scopeContextMessage(engScope);
|
|
645
646
|
if (scopeBlock && (pentestSession || pentestLikeTurn) && !idleOrSocialPrompt) {
|
|
646
647
|
systemSections.push(scopeBlock);
|
|
@@ -1567,7 +1568,7 @@ export async function runAgentTurn(prompt, options = {}) {
|
|
|
1567
1568
|
};
|
|
1568
1569
|
}
|
|
1569
1570
|
}
|
|
1570
|
-
const scope = await
|
|
1571
|
+
const scope = await loadScopeForSession(session.sessionId);
|
|
1571
1572
|
const decision = classifyToolCall(call, { scope });
|
|
1572
1573
|
await auditLog("tool.classified", {
|
|
1573
1574
|
call,
|
|
@@ -3261,11 +3262,9 @@ export async function runAgentTurn(prompt, options = {}) {
|
|
|
3261
3262
|
}, {
|
|
3262
3263
|
onStatus: (status) => {
|
|
3263
3264
|
writeStatus(status);
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
writeNotice("warn", status.trim());
|
|
3268
|
-
}
|
|
3265
|
+
const full = status.replace(/\s+/g, " ").trim();
|
|
3266
|
+
if (isProviderFailureStatus(full))
|
|
3267
|
+
writeNotice("warn", full);
|
|
3269
3268
|
},
|
|
3270
3269
|
onStreamEvent: (event) => {
|
|
3271
3270
|
if (event.type !== "reasoning_delta")
|
|
@@ -4421,7 +4420,7 @@ export async function runAgentTurn(prompt, options = {}) {
|
|
|
4421
4420
|
.join("\n\n");
|
|
4422
4421
|
pushAssistantHistory(standardizedContent, completion);
|
|
4423
4422
|
}
|
|
4424
|
-
const scopeForBatch = await
|
|
4423
|
+
const scopeForBatch = await loadScopeForSession(session.sessionId).catch(() => undefined);
|
|
4425
4424
|
const isParallelSafe = (c) => {
|
|
4426
4425
|
if (c.name === "pentest.recon" ||
|
|
4427
4426
|
c.name === "net.context" ||
|