open-multi-agent-kit 0.94.0 → 0.95.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/CHANGELOG.md +38 -0
- package/README.md +100 -646
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +11 -11
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +27 -2
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +239 -56
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/context-budget-v2-cache-invalidation.d.ts.map +1 -1
- package/dist/core/context-budget-v2-cache-invalidation.js +1 -1
- package/dist/core/context-budget-v2-cache-invalidation.js.map +1 -1
- package/dist/core/context-budget-v2-cache-provider.d.ts +5 -1
- package/dist/core/context-budget-v2-cache-provider.d.ts.map +1 -1
- package/dist/core/context-budget-v2-cache-provider.js +37 -7
- package/dist/core/context-budget-v2-cache-provider.js.map +1 -1
- package/dist/core/context-budget-v2-cache-telemetry.d.ts +1 -1
- package/dist/core/context-budget-v2-cache-telemetry.d.ts.map +1 -1
- package/dist/core/context-budget-v2-cache-telemetry.js +2 -1
- package/dist/core/context-budget-v2-cache-telemetry.js.map +1 -1
- package/dist/core/context-budget-v2-cache.d.ts.map +1 -1
- package/dist/core/context-budget-v2-cache.js +3 -0
- package/dist/core/context-budget-v2-cache.js.map +1 -1
- package/dist/core/context-budget-v2-representation-cache.d.ts.map +1 -1
- package/dist/core/context-budget-v2-representation-cache.js +4 -3
- package/dist/core/context-budget-v2-representation-cache.js.map +1 -1
- package/dist/core/context-budget-v2-selection.d.ts.map +1 -1
- package/dist/core/context-budget-v2-selection.js +4 -0
- package/dist/core/context-budget-v2-selection.js.map +1 -1
- package/dist/core/context-budget-v2-types.d.ts +3 -0
- package/dist/core/context-budget-v2-types.d.ts.map +1 -1
- package/dist/core/context-budget-v2-types.js.map +1 -1
- package/dist/core/extensions/types.d.ts +2 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/github-repository.d.ts +3 -0
- package/dist/core/github-repository.d.ts.map +1 -0
- package/dist/core/github-repository.js +3 -0
- package/dist/core/github-repository.js.map +1 -0
- package/dist/core/model-registry.d.ts +3 -3
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +9 -8
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/provider-usage.d.ts +48 -0
- package/dist/core/provider-usage.d.ts.map +1 -0
- package/dist/core/provider-usage.js +780 -0
- package/dist/core/provider-usage.js.map +1 -0
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +10 -0
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-termination.d.ts.map +1 -1
- package/dist/core/session-termination.js +8 -1
- package/dist/core/session-termination.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +15 -8
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills-catalog-cache.d.ts +1 -0
- package/dist/core/skills-catalog-cache.d.ts.map +1 -1
- package/dist/core/skills-catalog-cache.js +42 -11
- package/dist/core/skills-catalog-cache.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/tools/read.d.ts +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +1 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +1 -0
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +5 -3
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-account-selector.d.ts +16 -0
- package/dist/modes/interactive/components/oauth-account-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/oauth-account-selector.js +61 -0
- package/dist/modes/interactive/components/oauth-account-selector.js.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +25 -4
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/status-sidebar.d.ts +21 -1
- package/dist/modes/interactive/components/status-sidebar.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-sidebar.js +165 -6
- package/dist/modes/interactive/components/status-sidebar.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +2 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +99 -15
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/utils/image-resize-core.d.ts.map +1 -1
- package/dist/utils/image-resize-core.js +2 -2
- package/dist/utils/image-resize-core.js.map +1 -1
- package/docs/development.md +3 -2
- package/docs/providers.md +19 -4
- package/docs/settings.md +9 -9
- package/docs/usage.md +10 -9
- 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/npm-shrinkwrap.json +24 -24
- package/package.json +6 -6
|
@@ -16,6 +16,7 @@ import { parseSkillBlock } from "../../core/agent-session.js";
|
|
|
16
16
|
import { SessionImportFileNotFoundError } from "../../core/agent-session-runtime.js";
|
|
17
17
|
import { parseBangInvocation } from "../../core/bang-skill-invocation.js";
|
|
18
18
|
import { FooterDataProvider } from "../../core/footer-data-provider.js";
|
|
19
|
+
import { OMK_GITHUB_REPOSITORY_URL } from "../../core/github-repository.js";
|
|
19
20
|
import { configureHttpDispatcher, formatHttpIdleTimeoutMs } from "../../core/http-dispatcher.js";
|
|
20
21
|
import { KeybindingsManager } from "../../core/keybindings.js";
|
|
21
22
|
import { createCompactionSummaryMessage } from "../../core/messages.js";
|
|
@@ -31,6 +32,7 @@ import { getChangelogPath, getNewEntries, parseChangelog } from "../../utils/cha
|
|
|
31
32
|
import { copyToClipboard } from "../../utils/clipboard.js";
|
|
32
33
|
import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
|
|
33
34
|
import { parseGitUrl } from "../../utils/git.js";
|
|
35
|
+
import { openBrowser } from "../../utils/open-browser.js";
|
|
34
36
|
import { getCwdRelativePath } from "../../utils/paths.js";
|
|
35
37
|
import { killTrackedDetachedChildren } from "../../utils/shell.js";
|
|
36
38
|
import { ensureTool } from "../../utils/tools-manager.js";
|
|
@@ -57,6 +59,7 @@ import { FooterComponent } from "./components/footer.js";
|
|
|
57
59
|
import { formatKeyText, keyDisplayText, keyHint, keyText, rawKeyHint } from "./components/keybinding-hints.js";
|
|
58
60
|
import { LoginDialogComponent } from "./components/login-dialog.js";
|
|
59
61
|
import { ModelSelectorComponent } from "./components/model-selector.js";
|
|
62
|
+
import { OAuthAccountSelectorComponent } from "./components/oauth-account-selector.js";
|
|
60
63
|
import { OAuthSelectorComponent } from "./components/oauth-selector.js";
|
|
61
64
|
import { ScopedModelsSelectorComponent } from "./components/scoped-models-selector.js";
|
|
62
65
|
import { SessionSelectorComponent } from "./components/session-selector.js";
|
|
@@ -642,7 +645,7 @@ export class InteractiveMode {
|
|
|
642
645
|
// rail is actually visible, so the same data is never rendered twice.
|
|
643
646
|
this.statusSidebarPinned = this.settingsManager.getPinStatusSidebar();
|
|
644
647
|
this.ui.addChild(this.footerSlot);
|
|
645
|
-
this.statusSidebar = new StatusSidebarComponent(() => this.session, this.footerDataProvider, () => this.session.autoCompactionEnabled, () => this.ui.terminal.rows);
|
|
648
|
+
this.statusSidebar = new StatusSidebarComponent(() => this.session, this.footerDataProvider, () => this.session.autoCompactionEnabled, () => this.ui.terminal.rows, { requestRender: () => this.ui.requestRender() });
|
|
646
649
|
this.ui.showOverlay(this.statusSidebar, {
|
|
647
650
|
anchor: "top-right",
|
|
648
651
|
// Responsive: ~26% of the terminal, clamped — grows on fullscreen.
|
|
@@ -2267,6 +2270,10 @@ export class InteractiveMode {
|
|
|
2267
2270
|
this.editor.setText("");
|
|
2268
2271
|
return;
|
|
2269
2272
|
}
|
|
2273
|
+
if (text === "/star") {
|
|
2274
|
+
this.handleStarCommand();
|
|
2275
|
+
return true;
|
|
2276
|
+
}
|
|
2270
2277
|
if (text === "/changelog") {
|
|
2271
2278
|
this.handleChangelogCommand();
|
|
2272
2279
|
this.editor.setText("");
|
|
@@ -2622,12 +2629,7 @@ export class InteractiveMode {
|
|
|
2622
2629
|
this.statusContainer.clear();
|
|
2623
2630
|
}
|
|
2624
2631
|
if (event.aborted) {
|
|
2625
|
-
|
|
2626
|
-
this.showError("Compaction cancelled");
|
|
2627
|
-
}
|
|
2628
|
-
else {
|
|
2629
|
-
this.showStatus("Auto-compaction cancelled");
|
|
2630
|
-
}
|
|
2632
|
+
this.showStatus(event.reason === "manual" ? "Compaction cancelled" : "Auto-compaction cancelled");
|
|
2631
2633
|
}
|
|
2632
2634
|
else if (event.result) {
|
|
2633
2635
|
this.chatContainer.clear();
|
|
@@ -2740,6 +2742,9 @@ export class InteractiveMode {
|
|
|
2740
2742
|
if (termination.kind === "completed" || this.lastRenderedTermination === termination)
|
|
2741
2743
|
return;
|
|
2742
2744
|
this.lastRenderedTermination = termination;
|
|
2745
|
+
// compaction_end owns the concise cancellation status; rendering this too duplicates it as a scary error.
|
|
2746
|
+
if (termination.causeCode === "compaction.aborted")
|
|
2747
|
+
return;
|
|
2743
2748
|
this.showError(formatSessionTermination(termination));
|
|
2744
2749
|
}
|
|
2745
2750
|
showPromptError(error, previousTermination) {
|
|
@@ -3027,15 +3032,21 @@ export class InteractiveMode {
|
|
|
3027
3032
|
try {
|
|
3028
3033
|
this.unregisterSignalHandlers();
|
|
3029
3034
|
}
|
|
3030
|
-
catch {
|
|
3035
|
+
catch (cleanupError) {
|
|
3036
|
+
void cleanupError;
|
|
3037
|
+
}
|
|
3031
3038
|
try {
|
|
3032
3039
|
killTrackedDetachedChildren();
|
|
3033
3040
|
}
|
|
3034
|
-
catch {
|
|
3041
|
+
catch (cleanupError) {
|
|
3042
|
+
void cleanupError;
|
|
3043
|
+
}
|
|
3035
3044
|
try {
|
|
3036
3045
|
this.ui.stop();
|
|
3037
3046
|
}
|
|
3038
|
-
catch {
|
|
3047
|
+
catch (cleanupError) {
|
|
3048
|
+
void cleanupError;
|
|
3049
|
+
}
|
|
3039
3050
|
console.error("OMK exiting due to uncaughtException:");
|
|
3040
3051
|
console.error(error);
|
|
3041
3052
|
process.exit(1);
|
|
@@ -4186,7 +4197,13 @@ export class InteractiveMode {
|
|
|
4186
4197
|
return;
|
|
4187
4198
|
}
|
|
4188
4199
|
if (providerOption.authType === "oauth") {
|
|
4189
|
-
|
|
4200
|
+
const accounts = this.session.modelRegistry.authStorage.listOAuthAccounts(providerOption.id);
|
|
4201
|
+
if (accounts.length > 0) {
|
|
4202
|
+
this.showOAuthAccountSelector(providerOption);
|
|
4203
|
+
}
|
|
4204
|
+
else {
|
|
4205
|
+
await this.showLoginDialog(providerOption.id, providerOption.name);
|
|
4206
|
+
}
|
|
4190
4207
|
}
|
|
4191
4208
|
else if (providerOption.id === BEDROCK_PROVIDER_ID) {
|
|
4192
4209
|
this.showBedrockSetupDialog(providerOption.id, providerOption.name);
|
|
@@ -4201,6 +4218,39 @@ export class InteractiveMode {
|
|
|
4201
4218
|
return { component: selector, focus: selector };
|
|
4202
4219
|
});
|
|
4203
4220
|
}
|
|
4221
|
+
showOAuthAccountSelector(provider) {
|
|
4222
|
+
const authStorage = this.session.modelRegistry.authStorage;
|
|
4223
|
+
const accounts = authStorage.listOAuthAccounts(provider.id);
|
|
4224
|
+
if (accounts.length === 0) {
|
|
4225
|
+
void this.showLoginDialog(provider.id, provider.name);
|
|
4226
|
+
return;
|
|
4227
|
+
}
|
|
4228
|
+
this.showSelector((done) => {
|
|
4229
|
+
const selector = new OAuthAccountSelectorComponent(provider.name, accounts, async (selection) => {
|
|
4230
|
+
done();
|
|
4231
|
+
if (selection.kind === "add") {
|
|
4232
|
+
await this.showLoginDialog(provider.id, provider.name);
|
|
4233
|
+
return;
|
|
4234
|
+
}
|
|
4235
|
+
try {
|
|
4236
|
+
authStorage.selectOAuthAccount(provider.id, selection.index);
|
|
4237
|
+
this.session.modelRegistry.refresh();
|
|
4238
|
+
await this.updateAvailableProviderCount();
|
|
4239
|
+
this.footer.invalidate();
|
|
4240
|
+
this.updateEditorBorderColor();
|
|
4241
|
+
const label = authStorage.getOAuthAccountLabel(provider.id) ?? `Account ${selection.index + 1}`;
|
|
4242
|
+
this.showStatus(`Active ${provider.name} account: ${label}.`);
|
|
4243
|
+
}
|
|
4244
|
+
catch (error) {
|
|
4245
|
+
this.showError(`Account selection failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
4246
|
+
}
|
|
4247
|
+
}, () => {
|
|
4248
|
+
done();
|
|
4249
|
+
this.showLoginProviderSelector("oauth");
|
|
4250
|
+
});
|
|
4251
|
+
return { component: selector, focus: selector };
|
|
4252
|
+
});
|
|
4253
|
+
}
|
|
4204
4254
|
async showOAuthSelector(mode) {
|
|
4205
4255
|
if (mode === "login") {
|
|
4206
4256
|
this.showLoginAuthTypeSelector();
|
|
@@ -4219,12 +4269,20 @@ export class InteractiveMode {
|
|
|
4219
4269
|
return;
|
|
4220
4270
|
}
|
|
4221
4271
|
try {
|
|
4272
|
+
const oauthAccountCount = this.session.modelRegistry.authStorage.getOAuthAccountCount(providerOption.id);
|
|
4222
4273
|
this.session.modelRegistry.authStorage.logout(providerOption.id);
|
|
4223
4274
|
this.session.modelRegistry.refresh();
|
|
4224
4275
|
await this.updateAvailableProviderCount();
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4276
|
+
let message;
|
|
4277
|
+
if (providerOption.authType === "oauth") {
|
|
4278
|
+
message =
|
|
4279
|
+
oauthAccountCount > 1
|
|
4280
|
+
? `Logged out of ${providerOption.name}. Removed ${oauthAccountCount} subscription accounts.`
|
|
4281
|
+
: `Logged out of ${providerOption.name}`;
|
|
4282
|
+
}
|
|
4283
|
+
else {
|
|
4284
|
+
message = `Removed stored API key for ${providerOption.name}. Environment variables and models.json config are unchanged.`;
|
|
4285
|
+
}
|
|
4228
4286
|
this.showStatus(message);
|
|
4229
4287
|
}
|
|
4230
4288
|
catch (error) {
|
|
@@ -4239,7 +4297,18 @@ export class InteractiveMode {
|
|
|
4239
4297
|
}
|
|
4240
4298
|
async completeProviderAuthentication(providerId, providerName, authType, previousModel) {
|
|
4241
4299
|
this.session.modelRegistry.refresh();
|
|
4242
|
-
const
|
|
4300
|
+
const oauthAccountCount = this.session.modelRegistry.authStorage.getOAuthAccountCount(providerId);
|
|
4301
|
+
const oauthAccountLabel = this.session.modelRegistry.authStorage.getOAuthAccountLabel(providerId);
|
|
4302
|
+
let actionLabel;
|
|
4303
|
+
if (authType === "oauth") {
|
|
4304
|
+
actionLabel = `Logged in to ${providerName}${oauthAccountLabel ? ` as ${oauthAccountLabel}` : ""}`;
|
|
4305
|
+
if (oauthAccountCount > 1) {
|
|
4306
|
+
actionLabel += ` (${oauthAccountCount} subscription accounts; use /login to switch)`;
|
|
4307
|
+
}
|
|
4308
|
+
}
|
|
4309
|
+
else {
|
|
4310
|
+
actionLabel = `Saved API key for ${providerName}`;
|
|
4311
|
+
}
|
|
4243
4312
|
let selectedModel;
|
|
4244
4313
|
let selectionError;
|
|
4245
4314
|
if (isUnknownModel(previousModel)) {
|
|
@@ -4758,6 +4827,21 @@ export class InteractiveMode {
|
|
|
4758
4827
|
this.chatContainer.addChild(new Text(info, 1, 0));
|
|
4759
4828
|
this.ui.requestRender();
|
|
4760
4829
|
}
|
|
4830
|
+
handleStarCommand() {
|
|
4831
|
+
openBrowser(OMK_GITHUB_REPOSITORY_URL);
|
|
4832
|
+
const repositoryLink = getCapabilities().hyperlinks
|
|
4833
|
+
? hyperlink(theme.fg("accent", OMK_GITHUB_REPOSITORY_URL), OMK_GITHUB_REPOSITORY_URL)
|
|
4834
|
+
: theme.fg("accent", OMK_GITHUB_REPOSITORY_URL);
|
|
4835
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
4836
|
+
this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("accent", text)));
|
|
4837
|
+
this.chatContainer.addChild(new Text([
|
|
4838
|
+
theme.bold(theme.fg("accent", "OMK on GitHub")),
|
|
4839
|
+
theme.fg("muted", "Opened the OMK repository in your browser."),
|
|
4840
|
+
`${theme.fg("muted", "Repository: ")}${repositoryLink}`,
|
|
4841
|
+
].join("\n"), 1, 0));
|
|
4842
|
+
this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("accent", text)));
|
|
4843
|
+
this.ui.requestRender();
|
|
4844
|
+
}
|
|
4761
4845
|
handleChangelogCommand() {
|
|
4762
4846
|
const changelogPath = getChangelogPath();
|
|
4763
4847
|
const allEntries = parseChangelog(changelogPath);
|