@bastani/atomic 0.8.30-alpha.3 → 0.8.31-alpha.1
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 +20 -0
- package/dist/builtin/cursor/CHANGELOG.md +7 -1
- package/dist/builtin/cursor/package.json +2 -2
- package/dist/builtin/intercom/CHANGELOG.md +6 -0
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/mcp/CHANGELOG.md +6 -0
- package/dist/builtin/mcp/package.json +3 -3
- package/dist/builtin/subagents/CHANGELOG.md +6 -0
- package/dist/builtin/subagents/package.json +4 -4
- package/dist/builtin/web-access/CHANGELOG.md +6 -0
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +12 -0
- package/dist/builtin/workflows/builtin/deep-research-codebase.ts +1 -1
- package/dist/builtin/workflows/builtin/goal.ts +2 -2
- package/dist/builtin/workflows/builtin/open-claude-design.ts +1 -1
- package/dist/builtin/workflows/builtin/ralph.ts +61 -11
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/src/extension/workflow-schema.ts +3 -1
- package/dist/builtin/workflows/src/runs/foreground/stage-runner.ts +5 -0
- package/dist/builtin/workflows/src/runs/shared/model-fallback.ts +95 -8
- package/dist/builtin/workflows/src/shared/authoring-contract.d.ts +11 -0
- package/dist/cli/args.d.ts +1 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +20 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +2 -1
- package/dist/cli/list-models.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +2 -0
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +2 -0
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +17 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +161 -18
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +20 -5
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/context-compaction.d.ts.map +1 -1
- package/dist/core/compaction/context-compaction.js +14 -3
- package/dist/core/compaction/context-compaction.js.map +1 -1
- package/dist/core/context-window.d.ts +29 -0
- package/dist/core/context-window.d.ts.map +1 -0
- package/dist/core/context-window.js +86 -0
- package/dist/core/context-window.js.map +1 -0
- package/dist/core/copilot-errors.d.ts +9 -0
- package/dist/core/copilot-errors.d.ts.map +1 -0
- package/dist/core/copilot-errors.js +32 -0
- package/dist/core/copilot-errors.js.map +1 -0
- package/dist/core/copilot-model-catalog.d.ts +132 -0
- package/dist/core/copilot-model-catalog.d.ts.map +1 -0
- package/dist/core/copilot-model-catalog.js +254 -0
- package/dist/core/copilot-model-catalog.js.map +1 -0
- package/dist/core/export-html/template.js +10 -1
- package/dist/core/extensions/types.d.ts +3 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/model-registry.d.ts +10 -0
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +107 -4
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +4 -0
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/provider-attribution.d.ts.map +1 -1
- package/dist/core/provider-attribution.js +17 -7
- package/dist/core/provider-attribution.js.map +1 -1
- package/dist/core/sdk.d.ts +8 -0
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +47 -0
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +8 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +19 -3
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +6 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +69 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +24 -1
- package/dist/main.js.map +1 -1
- package/dist/modes/index.d.ts +1 -1
- package/dist/modes/index.d.ts.map +1 -1
- package/dist/modes/index.js.map +1 -1
- package/dist/modes/interactive/components/context-window-selector.d.ts +53 -0
- package/dist/modes/interactive/components/context-window-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/context-window-selector.js +136 -0
- package/dist/modes/interactive/components/context-window-selector.js.map +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +7 -0
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +5 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +91 -1
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +14 -2
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +23 -3
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +30 -1
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +23 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/docs/custom-provider.md +4 -1
- package/docs/json.md +3 -1
- package/docs/models.md +78 -2
- package/docs/providers.md +3 -0
- package/docs/rpc.md +80 -1
- package/docs/sdk.md +23 -3
- package/docs/session-format.md +15 -1
- package/docs/sessions.md +1 -1
- package/docs/settings.md +7 -2
- package/docs/workflows.md +26 -4
- package/package.json +5 -5
|
@@ -48,6 +48,9 @@ import { CustomMessageComponent } from "./components/custom-message.js";
|
|
|
48
48
|
import { DaxnutsComponent } from "./components/daxnuts.js";
|
|
49
49
|
import { renderAtomicAnsiBanner } from "./components/atomic-banner.js";
|
|
50
50
|
import { DynamicBorder } from "./components/dynamic-border.js";
|
|
51
|
+
import { ContextWindowSelectorComponent } from "./components/context-window-selector.js";
|
|
52
|
+
import { formatContextWindow } from "../../core/context-window.js";
|
|
53
|
+
import { copilotApiBaseUrlFromToken, copilotCatalogCacheHost, copilotCatalogCachePath, fetchCopilotModelCatalog, readCopilotCatalogCache, setActiveCopilotModelCatalog, writeCopilotCatalogCache, } from "../../core/copilot-model-catalog.js";
|
|
51
54
|
import { EarendilAnnouncementComponent } from "./components/earendil-announcement.js";
|
|
52
55
|
import { ExtensionEditorComponent } from "./components/extension-editor.js";
|
|
53
56
|
import { ExtensionInputComponent } from "./components/extension-input.js";
|
|
@@ -161,6 +164,8 @@ export class InteractiveMode {
|
|
|
161
164
|
constructor(runtimeHost, options = {}) {
|
|
162
165
|
this.autocompleteProviderWrappers = [];
|
|
163
166
|
this.isInitialized = false;
|
|
167
|
+
// GitHub Copilot CAPI context-window catalog load state (gated on the Copilot provider).
|
|
168
|
+
this.copilotCatalogApplied = false;
|
|
164
169
|
this.pendingUserInputs = [];
|
|
165
170
|
this.loadingAnimation = undefined;
|
|
166
171
|
this.workingMessage = undefined;
|
|
@@ -541,6 +546,9 @@ export class InteractiveMode {
|
|
|
541
546
|
*/
|
|
542
547
|
async run() {
|
|
543
548
|
await this.init();
|
|
549
|
+
// Load GitHub Copilot context-window tiers from CAPI early (gated on the Copilot provider) so
|
|
550
|
+
// the footer and /model picker reflect GitHub's real windows. Best-effort, never blocks startup.
|
|
551
|
+
void this.refreshCopilotModelCatalog();
|
|
544
552
|
// Start version check asynchronously
|
|
545
553
|
checkForNewPiVersion(this.version).then((newVersion) => {
|
|
546
554
|
if (newVersion) {
|
|
@@ -2619,6 +2627,11 @@ export class InteractiveMode {
|
|
|
2619
2627
|
this.refreshBuiltInHeader();
|
|
2620
2628
|
this.updateEditorBorderColor();
|
|
2621
2629
|
break;
|
|
2630
|
+
case "context_window_changed":
|
|
2631
|
+
this.footer.invalidate();
|
|
2632
|
+
this.usageMeter.invalidate();
|
|
2633
|
+
this.ui.requestRender();
|
|
2634
|
+
break;
|
|
2622
2635
|
case "message_start":
|
|
2623
2636
|
if (event.message.role === "custom") {
|
|
2624
2637
|
this.addMessageToChat(event.message);
|
|
@@ -3832,6 +3845,7 @@ export class InteractiveMode {
|
|
|
3832
3845
|
if (this.session.scopedModels.length > 0) {
|
|
3833
3846
|
return this.session.scopedModels.map((scoped) => scoped.model);
|
|
3834
3847
|
}
|
|
3848
|
+
await this.refreshCopilotModelCatalog();
|
|
3835
3849
|
this.session.modelRegistry.refresh();
|
|
3836
3850
|
try {
|
|
3837
3851
|
return await this.session.modelRegistry.getAvailable();
|
|
@@ -3840,6 +3854,51 @@ export class InteractiveMode {
|
|
|
3840
3854
|
return [];
|
|
3841
3855
|
}
|
|
3842
3856
|
}
|
|
3857
|
+
/**
|
|
3858
|
+
* Load GitHub Copilot's context-window tiers from the live CAPI catalog, but only when the user
|
|
3859
|
+
* actually has the GitHub Copilot provider authenticated. Cache-first (30-min TTL); on a
|
|
3860
|
+
* successful load the model registry is refreshed so the /model context-window picker reflects
|
|
3861
|
+
* GitHub's real tiers (e.g. gpt-5.5 1.05m, Claude/Gemini 1m). Best-effort and gated: offline,
|
|
3862
|
+
* unauthenticated, or non-Copilot sessions silently keep no long-context options.
|
|
3863
|
+
*/
|
|
3864
|
+
async refreshCopilotModelCatalog() {
|
|
3865
|
+
if (this.copilotCatalogApplied)
|
|
3866
|
+
return;
|
|
3867
|
+
if (!this.copilotCatalogInFlight) {
|
|
3868
|
+
this.copilotCatalogInFlight = this.loadCopilotModelCatalog();
|
|
3869
|
+
}
|
|
3870
|
+
try {
|
|
3871
|
+
await this.copilotCatalogInFlight;
|
|
3872
|
+
}
|
|
3873
|
+
finally {
|
|
3874
|
+
this.copilotCatalogInFlight = undefined;
|
|
3875
|
+
}
|
|
3876
|
+
}
|
|
3877
|
+
async loadCopilotModelCatalog() {
|
|
3878
|
+
const registry = this.session.modelRegistry;
|
|
3879
|
+
const cred = registry.authStorage.get("github-copilot");
|
|
3880
|
+
// Gate: do nothing unless the user has the GitHub Copilot provider.
|
|
3881
|
+
if (!cred || cred.type !== "oauth")
|
|
3882
|
+
return;
|
|
3883
|
+
try {
|
|
3884
|
+
const token = await registry.getApiKeyForProvider("github-copilot");
|
|
3885
|
+
if (!token)
|
|
3886
|
+
return;
|
|
3887
|
+
const baseUrl = copilotApiBaseUrlFromToken(token);
|
|
3888
|
+
const cachePath = copilotCatalogCachePath(getAgentDir());
|
|
3889
|
+
let catalog = readCopilotCatalogCache(cachePath, { host: copilotCatalogCacheHost(baseUrl) });
|
|
3890
|
+
if (!catalog) {
|
|
3891
|
+
catalog = await fetchCopilotModelCatalog({ token, baseUrl });
|
|
3892
|
+
writeCopilotCatalogCache(cachePath, baseUrl, catalog);
|
|
3893
|
+
}
|
|
3894
|
+
setActiveCopilotModelCatalog(catalog);
|
|
3895
|
+
registry.refresh();
|
|
3896
|
+
this.copilotCatalogApplied = true;
|
|
3897
|
+
}
|
|
3898
|
+
catch {
|
|
3899
|
+
// Best-effort: leave the active catalog as-is on any failure (offline, auth, parse).
|
|
3900
|
+
}
|
|
3901
|
+
}
|
|
3843
3902
|
/** Update the footer's available provider count from current model candidates */
|
|
3844
3903
|
async updateAvailableProviderCount() {
|
|
3845
3904
|
const models = await this.getModelCandidates();
|
|
@@ -3882,9 +3941,14 @@ export class InteractiveMode {
|
|
|
3882
3941
|
this.footer.invalidate();
|
|
3883
3942
|
this.updateEditorBorderColor();
|
|
3884
3943
|
done();
|
|
3885
|
-
this.showStatus(`Model: ${model.id}`);
|
|
3886
3944
|
void this.maybeWarnAboutAnthropicSubscriptionAuth(model);
|
|
3887
3945
|
this.checkDaxnutsEasterEgg(model);
|
|
3946
|
+
if (this.session.supportsContextWindowSelection()) {
|
|
3947
|
+
this.showContextWindowSelector(model);
|
|
3948
|
+
}
|
|
3949
|
+
else {
|
|
3950
|
+
this.showStatus(`Model: ${model.id}`);
|
|
3951
|
+
}
|
|
3888
3952
|
}
|
|
3889
3953
|
catch (error) {
|
|
3890
3954
|
done();
|
|
@@ -3897,6 +3961,32 @@ export class InteractiveMode {
|
|
|
3897
3961
|
return { component: selector, focus: selector };
|
|
3898
3962
|
});
|
|
3899
3963
|
}
|
|
3964
|
+
showContextWindowSelector(model) {
|
|
3965
|
+
const availableContextWindows = this.session.getAvailableContextWindows();
|
|
3966
|
+
const currentContextWindow = this.session.model?.contextWindow ?? availableContextWindows[0] ?? 0;
|
|
3967
|
+
this.showSelector((done) => {
|
|
3968
|
+
const selector = new ContextWindowSelectorComponent(model.name ?? model.id, availableContextWindows, currentContextWindow, (contextWindow) => {
|
|
3969
|
+
try {
|
|
3970
|
+
this.session.setContextWindow(contextWindow, {
|
|
3971
|
+
persistDefault: true,
|
|
3972
|
+
});
|
|
3973
|
+
this.footer.invalidate();
|
|
3974
|
+
this.usageMeter.invalidate();
|
|
3975
|
+
this.updateEditorBorderColor();
|
|
3976
|
+
done();
|
|
3977
|
+
this.showStatus(`Model: ${model.id} \u00b7 ${formatContextWindow(contextWindow)} context`);
|
|
3978
|
+
}
|
|
3979
|
+
catch (error) {
|
|
3980
|
+
done();
|
|
3981
|
+
this.showError(error instanceof Error ? error.message : String(error));
|
|
3982
|
+
}
|
|
3983
|
+
}, () => {
|
|
3984
|
+
done();
|
|
3985
|
+
this.showStatus(`Model: ${model.id}`);
|
|
3986
|
+
});
|
|
3987
|
+
return { component: selector, focus: selector };
|
|
3988
|
+
});
|
|
3989
|
+
}
|
|
3900
3990
|
async showModelsSelector() {
|
|
3901
3991
|
// Get all available models
|
|
3902
3992
|
this.session.modelRegistry.refresh();
|