@humain/terminal 0.0.1 → 0.0.2
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 +46 -1
- package/README.md +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +8 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/credential-print.d.ts +23 -0
- package/dist/cli/credential-print.d.ts.map +1 -0
- package/dist/cli/credential-print.js +117 -0
- package/dist/cli/credential-print.js.map +1 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +3 -0
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +13 -6
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +7 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +7 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +10 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +1 -1
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/model-runtime.d.ts +2 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +13 -6
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/resource-loader.d.ts +15 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +63 -9
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +1 -1
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/humain/index.d.ts.map +1 -1
- package/dist/humain/index.js +3 -3
- package/dist/humain/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +43 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +4 -1
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +20 -6
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +13 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/docs/custom-provider.md +9 -3
- package/docs/extensions.md +3 -1
- package/docs/providers.md +1 -0
- package/docs/session-format.md +2 -0
- package/examples/extensions/custom-provider-anthropic/index.ts +8 -2
- 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/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/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/examples/sdk/12-full-control.ts +2 -0
- package/npm-shrinkwrap.json +26 -26
- package/package.json +7 -7
|
@@ -102,7 +102,7 @@ export class AgentSession {
|
|
|
102
102
|
_retryAbortController = undefined;
|
|
103
103
|
_retryAttempt = 0;
|
|
104
104
|
// Bash execution state
|
|
105
|
-
|
|
105
|
+
_bashAbortControllers = new Set();
|
|
106
106
|
_pendingBashMessages = [];
|
|
107
107
|
// Extension system
|
|
108
108
|
_extensionRunner;
|
|
@@ -1892,6 +1892,7 @@ export class AgentSession {
|
|
|
1892
1892
|
setThinkingLevel: (level) => this.setThinkingLevel(level),
|
|
1893
1893
|
}, {
|
|
1894
1894
|
getModel: () => this.model,
|
|
1895
|
+
getScopedModels: () => this._scopedModels,
|
|
1895
1896
|
isIdle: () => this.isIdle,
|
|
1896
1897
|
isProjectTrusted: () => this.settingsManager.isProjectTrusted(),
|
|
1897
1898
|
getSignal: () => this.agent.signal,
|
|
@@ -2194,7 +2195,8 @@ export class AgentSession {
|
|
|
2194
2195
|
* @param options.operations Custom BashOperations for remote execution
|
|
2195
2196
|
*/
|
|
2196
2197
|
async executeBash(command, onChunk, options) {
|
|
2197
|
-
|
|
2198
|
+
const abortController = new AbortController();
|
|
2199
|
+
this._bashAbortControllers.add(abortController);
|
|
2198
2200
|
// Apply command prefix if configured (e.g., "shopt -s expand_aliases" for alias support)
|
|
2199
2201
|
const prefix = this.settingsManager.getShellCommandPrefix();
|
|
2200
2202
|
const shellPath = this.settingsManager.getShellPath();
|
|
@@ -2205,13 +2207,13 @@ export class AgentSession {
|
|
|
2205
2207
|
onChunk?.(delta);
|
|
2206
2208
|
this._emit({ type: "bash_execution_update", id: options?.id, delta });
|
|
2207
2209
|
},
|
|
2208
|
-
signal:
|
|
2210
|
+
signal: abortController.signal,
|
|
2209
2211
|
});
|
|
2210
2212
|
this.recordBashResult(command, result, options);
|
|
2211
2213
|
return result;
|
|
2212
2214
|
}
|
|
2213
2215
|
finally {
|
|
2214
|
-
this.
|
|
2216
|
+
this._bashAbortControllers.delete(abortController);
|
|
2215
2217
|
}
|
|
2216
2218
|
}
|
|
2217
2219
|
/**
|
|
@@ -2246,11 +2248,13 @@ export class AgentSession {
|
|
|
2246
2248
|
* Cancel running bash command.
|
|
2247
2249
|
*/
|
|
2248
2250
|
abortBash() {
|
|
2249
|
-
this.
|
|
2251
|
+
for (const abortController of [...this._bashAbortControllers]) {
|
|
2252
|
+
abortController.abort();
|
|
2253
|
+
}
|
|
2250
2254
|
}
|
|
2251
2255
|
/** Whether a bash command is currently running */
|
|
2252
2256
|
get isBashRunning() {
|
|
2253
|
-
return this.
|
|
2257
|
+
return this._bashAbortControllers.size > 0;
|
|
2254
2258
|
}
|
|
2255
2259
|
/** Whether there are pending bash messages waiting to be flushed */
|
|
2256
2260
|
get hasPendingBashMessages() {
|
|
@@ -2298,6 +2302,9 @@ export class AgentSession {
|
|
|
2298
2302
|
* @returns Result with editorText (if user message) and cancelled status
|
|
2299
2303
|
*/
|
|
2300
2304
|
async navigateTree(targetId, options = {}) {
|
|
2305
|
+
if (this.isStreaming) {
|
|
2306
|
+
throw new Error("Wait for the current response to finish before navigating the session tree.");
|
|
2307
|
+
}
|
|
2301
2308
|
const oldLeafId = this.sessionManager.getLeafId();
|
|
2302
2309
|
// No-op if already at target
|
|
2303
2310
|
if (targetId === oldLeafId) {
|