@caupulican/pi-adaptative 0.80.100 → 0.80.103
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/CHANGELOG.md +201 -0
- package/dist/config.d.ts +11 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +17 -3
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +72 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +437 -46
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/autonomy/envelope-enforcement.d.ts +5 -0
- package/dist/core/autonomy/envelope-enforcement.d.ts.map +1 -1
- package/dist/core/autonomy/envelope-enforcement.js +28 -4
- package/dist/core/autonomy/envelope-enforcement.js.map +1 -1
- package/dist/core/autonomy/path-scope.d.ts.map +1 -1
- package/dist/core/autonomy/path-scope.js +33 -2
- package/dist/core/autonomy/path-scope.js.map +1 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +15 -7
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/context/brain-curator.d.ts +10 -0
- package/dist/core/context/brain-curator.d.ts.map +1 -1
- package/dist/core/context/brain-curator.js +19 -2
- package/dist/core/context/brain-curator.js.map +1 -1
- package/dist/core/context-gc.d.ts +8 -3
- package/dist/core/context-gc.d.ts.map +1 -1
- package/dist/core/context-gc.js +5 -0
- package/dist/core/context-gc.js.map +1 -1
- package/dist/core/delegation/worker-actions.d.ts +0 -10
- package/dist/core/delegation/worker-actions.d.ts.map +1 -1
- package/dist/core/delegation/worker-actions.js +5 -7
- package/dist/core/delegation/worker-actions.js.map +1 -1
- package/dist/core/delegation/worker-result.d.ts +6 -0
- package/dist/core/delegation/worker-result.d.ts.map +1 -1
- package/dist/core/delegation/worker-result.js +10 -4
- package/dist/core/delegation/worker-result.js.map +1 -1
- package/dist/core/delegation/worker-runner.d.ts +3 -0
- package/dist/core/delegation/worker-runner.d.ts.map +1 -1
- package/dist/core/delegation/worker-runner.js +6 -1
- package/dist/core/delegation/worker-runner.js.map +1 -1
- package/dist/core/doctor.d.ts +66 -0
- package/dist/core/doctor.d.ts.map +1 -0
- package/dist/core/doctor.js +144 -0
- package/dist/core/doctor.js.map +1 -0
- package/dist/core/learning/learning-audit.d.ts +13 -1
- package/dist/core/learning/learning-audit.d.ts.map +1 -1
- package/dist/core/learning/learning-audit.js +22 -1
- package/dist/core/learning/learning-audit.js.map +1 -1
- package/dist/core/learning/learning-gate.d.ts +3 -0
- package/dist/core/learning/learning-gate.d.ts.map +1 -1
- package/dist/core/learning/learning-gate.js +13 -4
- package/dist/core/learning/learning-gate.js.map +1 -1
- package/dist/core/models/local-registration.d.ts +2 -0
- package/dist/core/models/local-registration.d.ts.map +1 -1
- package/dist/core/models/local-registration.js +2 -1
- package/dist/core/models/local-registration.js.map +1 -1
- package/dist/core/models/local-runtime.d.ts +76 -2
- package/dist/core/models/local-runtime.d.ts.map +1 -1
- package/dist/core/models/local-runtime.js +233 -21
- package/dist/core/models/local-runtime.js.map +1 -1
- package/dist/core/profile-resource-selection.d.ts +15 -3
- package/dist/core/profile-resource-selection.d.ts.map +1 -1
- package/dist/core/profile-resource-selection.js +19 -9
- package/dist/core/profile-resource-selection.js.map +1 -1
- package/dist/core/resource-loader.d.ts +20 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +42 -16
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/settings-manager.d.ts +30 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +65 -3
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts +14 -0
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +8 -0
- package/dist/core/skills.js.map +1 -1
- package/dist/core/tools/fff-search-backend.d.ts +34 -1
- package/dist/core/tools/fff-search-backend.d.ts.map +1 -1
- package/dist/core/tools/fff-search-backend.js +43 -4
- package/dist/core/tools/fff-search-backend.js.map +1 -1
- package/dist/core/tools/find.d.ts +16 -0
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +17 -3
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +20 -0
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +15 -3
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +17 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/fitness-role-selector.d.ts +6 -2
- package/dist/modes/interactive/components/fitness-role-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/fitness-role-selector.js +55 -45
- package/dist/modes/interactive/components/fitness-role-selector.js.map +1 -1
- package/dist/modes/interactive/components/model-suggestion-selector.d.ts +13 -0
- package/dist/modes/interactive/components/model-suggestion-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/model-suggestion-selector.js +40 -0
- package/dist/modes/interactive/components/model-suggestion-selector.js.map +1 -0
- package/dist/modes/interactive/components/profile-resource-editor.d.ts +3 -0
- package/dist/modes/interactive/components/profile-resource-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/profile-resource-editor.js +16 -2
- package/dist/modes/interactive/components/profile-resource-editor.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +98 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +8 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +50 -12
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/utils/safe-write-stream.d.ts +8 -0
- package/dist/utils/safe-write-stream.d.ts.map +1 -1
- package/dist/utils/safe-write-stream.js +32 -0
- package/dist/utils/safe-write-stream.js.map +1 -1
- package/dist/utils/tools-manager.d.ts +92 -2
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +172 -32
- package/dist/utils/tools-manager.js.map +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -36
- package/package.json +4 -4
|
@@ -22,10 +22,9 @@ import { configureHttpDispatcher, formatHttpIdleTimeoutMs } from "../../core/htt
|
|
|
22
22
|
import { KeybindingsManager } from "../../core/keybindings.js";
|
|
23
23
|
import { createCompactionSummaryMessage } from "../../core/messages.js";
|
|
24
24
|
import { cliProviderAliases, defaultModelPerProvider, findExactModelReferenceMatch, resolveCliModel, resolveModelScope, } from "../../core/model-resolver.js";
|
|
25
|
-
import {
|
|
25
|
+
import { DEFAULT_MODEL_SUGGESTIONS } from "../../core/models/default-model-suggestions.js";
|
|
26
26
|
import { FitnessStore } from "../../core/models/fitness-store.js";
|
|
27
27
|
import { registerLocalModel, unregisterLocalModel } from "../../core/models/local-registration.js";
|
|
28
|
-
import { OllamaRuntime } from "../../core/models/local-runtime.js";
|
|
29
28
|
import { normalizeModelSource } from "../../core/models/model-ref.js";
|
|
30
29
|
import { DefaultPackageManager } from "../../core/package-manager.js";
|
|
31
30
|
import { BUILT_IN_PROVIDER_DISPLAY_NAMES } from "../../core/provider-display-names.js";
|
|
@@ -69,6 +68,7 @@ import { FooterComponent } from "./components/footer.js";
|
|
|
69
68
|
import { formatKeyText, keyDisplayText, keyHint, keyText, rawKeyHint } from "./components/keybinding-hints.js";
|
|
70
69
|
import { LoginDialogComponent } from "./components/login-dialog.js";
|
|
71
70
|
import { ModelSelectorComponent } from "./components/model-selector.js";
|
|
71
|
+
import { ModelSuggestionSelectorComponent } from "./components/model-suggestion-selector.js";
|
|
72
72
|
import { OAuthSelectorComponent } from "./components/oauth-selector.js";
|
|
73
73
|
import { ProfileResourceEditorComponent, resolveResourceEditPath, } from "./components/profile-resource-editor.js";
|
|
74
74
|
import { ProfileSelectorComponent } from "./components/profile-selector.js";
|
|
@@ -2691,6 +2691,25 @@ export class InteractiveMode {
|
|
|
2691
2691
|
}
|
|
2692
2692
|
this.footer.invalidate();
|
|
2693
2693
|
switch (event.type) {
|
|
2694
|
+
// Part B: general "the system is processing" feedback for the routing/prep gap before a
|
|
2695
|
+
// turn starts streaming (the judge is a real bounded LLM call, not instant) — independent
|
|
2696
|
+
// of thinking level, since this isn't model-thinking. Reuses the same working loader
|
|
2697
|
+
// agent_start below uses, so the hand-off into real streaming is the same
|
|
2698
|
+
// stop-then-recreate it already does — no distinct spinner, no double-render.
|
|
2699
|
+
case "routing_start":
|
|
2700
|
+
if (!this.session.isStreaming && !this.loadingAnimation && this.workingVisible) {
|
|
2701
|
+
this.loadingAnimation = this.createWorkingLoader();
|
|
2702
|
+
this.statusContainer.addChild(this.loadingAnimation);
|
|
2703
|
+
this.ui.requestRender();
|
|
2704
|
+
}
|
|
2705
|
+
break;
|
|
2706
|
+
case "routing_end":
|
|
2707
|
+
// Unconditional: covers both a clean hand-off into agent_start (which immediately
|
|
2708
|
+
// stops-and-recreates its own loader anyway) and a turn that failed before ever
|
|
2709
|
+
// starting, which must not leave the indicator spinning forever.
|
|
2710
|
+
this.stopWorkingLoader();
|
|
2711
|
+
this.ui.requestRender();
|
|
2712
|
+
break;
|
|
2694
2713
|
case "agent_start":
|
|
2695
2714
|
this.clearActiveToolCalls();
|
|
2696
2715
|
if (this.settingsManager.getShowTerminalProgress()) {
|
|
@@ -5139,10 +5158,14 @@ export class InteractiveMode {
|
|
|
5139
5158
|
this.settingsManager.setAutoLearnSettings(preset, scope);
|
|
5140
5159
|
this.updateAutoLearnFooter();
|
|
5141
5160
|
}
|
|
5142
|
-
|
|
5161
|
+
/**
|
|
5162
|
+
* Delegates to the session rather than keeping its own instance (#27): the model router boots a
|
|
5163
|
+
* local server through AgentSession.getLocalRuntime() before a routed turn, and `/models`
|
|
5164
|
+
* commands need to see and be able to stop that SAME pi-managed process, not an unrelated one
|
|
5165
|
+
* tracked separately here.
|
|
5166
|
+
*/
|
|
5143
5167
|
get localRuntime() {
|
|
5144
|
-
this.
|
|
5145
|
-
return this._localRuntime;
|
|
5168
|
+
return this.session.getLocalRuntime();
|
|
5146
5169
|
}
|
|
5147
5170
|
/**
|
|
5148
5171
|
* /models — USER-invoked local model lifecycle (never a model-invokable tool):
|
|
@@ -5153,8 +5176,7 @@ export class InteractiveMode {
|
|
|
5153
5176
|
const [action = "list", ...rest] = argsText.split(/\s+/).filter(Boolean);
|
|
5154
5177
|
try {
|
|
5155
5178
|
if (action === "suggest" || action === "suggestions") {
|
|
5156
|
-
|
|
5157
|
-
this.showStatus(line);
|
|
5179
|
+
this.showModelSuggestionSelector();
|
|
5158
5180
|
return;
|
|
5159
5181
|
}
|
|
5160
5182
|
if (action === "stop") {
|
|
@@ -5247,7 +5269,7 @@ export class InteractiveMode {
|
|
|
5247
5269
|
for (const line of lines)
|
|
5248
5270
|
this.showStatus(line);
|
|
5249
5271
|
}
|
|
5250
|
-
async addLocalModel(pullRef) {
|
|
5272
|
+
async addLocalModel(pullRef, preselectRole) {
|
|
5251
5273
|
if (!(await this.ensureLocalServer()))
|
|
5252
5274
|
return;
|
|
5253
5275
|
this.showStatus(`Pulling ${pullRef}… (weights land in the server's model storage)`);
|
|
@@ -5277,7 +5299,7 @@ export class InteractiveMode {
|
|
|
5277
5299
|
}
|
|
5278
5300
|
this.session.modelRegistry.refresh();
|
|
5279
5301
|
this.showStatus(`${pullRef} installed and registered as ollama/${pullRef}. Probing fitness…`);
|
|
5280
|
-
await this.runFitnessAndAssign(`ollama/${pullRef}
|
|
5302
|
+
await this.runFitnessAndAssign(`ollama/${pullRef}`, preselectRole);
|
|
5281
5303
|
}
|
|
5282
5304
|
async removeLocalModel(ref, confirmed) {
|
|
5283
5305
|
const status = await this.localRuntime.detect();
|
|
@@ -5314,6 +5336,21 @@ export class InteractiveMode {
|
|
|
5314
5336
|
this.showStatus(`${ref} removed: weights deleted, registration and fitness report dropped.`);
|
|
5315
5337
|
}
|
|
5316
5338
|
/** /fitness with no args: pick a model from the configured registry, probe it, assign a role. */
|
|
5339
|
+
/** Pick a validated suggestion → install it → probe on this host → land its shaped role. */
|
|
5340
|
+
showModelSuggestionSelector() {
|
|
5341
|
+
this.showSelector((done) => {
|
|
5342
|
+
const selector = new ModelSuggestionSelectorComponent(DEFAULT_MODEL_SUGGESTIONS, async (suggestion) => {
|
|
5343
|
+
done();
|
|
5344
|
+
// The shaped role rides along so the post-probe selector lands on it pre-selected;
|
|
5345
|
+
// non-tool-callers carry curator/judge/none, never executor, so this can't footgun.
|
|
5346
|
+
await this.addLocalModel(suggestion.pullRef, suggestion.assignRole);
|
|
5347
|
+
}, () => {
|
|
5348
|
+
done();
|
|
5349
|
+
this.ui.requestRender();
|
|
5350
|
+
});
|
|
5351
|
+
return { component: selector, focus: selector };
|
|
5352
|
+
});
|
|
5353
|
+
}
|
|
5317
5354
|
showFitnessModelSelector() {
|
|
5318
5355
|
this.showSelector((done) => {
|
|
5319
5356
|
const selector = new ModelSelectorComponent(this.ui, this.session.model, this.settingsManager, this.session.modelRegistry, this.session.scopedModels, async (model) => {
|
|
@@ -5326,8 +5363,9 @@ export class InteractiveMode {
|
|
|
5326
5363
|
return { component: selector, focus: selector };
|
|
5327
5364
|
});
|
|
5328
5365
|
}
|
|
5329
|
-
/** Probe a model's fitness, show the report, then offer one-step role assignment.
|
|
5330
|
-
|
|
5366
|
+
/** Probe a model's fitness, show the report, then offer one-step role assignment. When the model
|
|
5367
|
+
* came from a validated suggestion, `preselectRole` lands its shaped role already highlighted. */
|
|
5368
|
+
async runFitnessAndAssign(modelRef, preselectRole) {
|
|
5331
5369
|
this.showStatus(`Model fitness probe running on ${modelRef}… (6 surfaces; local models may take a few minutes)`);
|
|
5332
5370
|
try {
|
|
5333
5371
|
const outcome = await this.session.runModelFitness({ model: modelRef });
|
|
@@ -5345,7 +5383,7 @@ export class InteractiveMode {
|
|
|
5345
5383
|
}, () => {
|
|
5346
5384
|
done();
|
|
5347
5385
|
this.ui.requestRender();
|
|
5348
|
-
});
|
|
5386
|
+
}, preselectRole);
|
|
5349
5387
|
return { component: selector, focus: selector };
|
|
5350
5388
|
});
|
|
5351
5389
|
}
|