@atomic-chat/core 0.20.6 → 0.21.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/dist/audio/jobs.js +4 -0
- package/dist/audio/jobs.js.map +1 -1
- package/dist/audio/service.d.ts +1 -1
- package/dist/audio/service.js +3 -1
- package/dist/audio/service.js.map +1 -1
- package/dist/audio/session.js +28 -16
- package/dist/audio/session.js.map +1 -1
- package/dist/audio/state.d.ts +3 -1
- package/dist/audio/state.js +3 -1
- package/dist/audio/state.js.map +1 -1
- package/dist/cli/launch.d.ts +23 -3
- package/dist/cli/launch.js +59 -8
- package/dist/cli/launch.js.map +1 -1
- package/dist/cli/main.d.ts +1 -1
- package/dist/contracts/events.d.ts +8 -0
- package/dist/contracts/settings.d.ts +5 -0
- package/dist/contracts/settings.js.map +1 -1
- package/dist/core/atomic-core.d.ts +3 -1
- package/dist/core/atomic-core.js +4 -1
- package/dist/core/atomic-core.js.map +1 -1
- package/dist/core/create.js +4 -1
- package/dist/core/create.js.map +1 -1
- package/dist/core/sessions.js +1 -0
- package/dist/core/sessions.js.map +1 -1
- package/dist/integrations/catalog.d.ts +25 -8
- package/dist/integrations/catalog.js +105 -38
- package/dist/integrations/catalog.js.map +1 -1
- package/dist/integrations/configure/atomic-agent.d.ts +9 -1
- package/dist/integrations/configure/atomic-agent.js +42 -3
- package/dist/integrations/configure/atomic-agent.js.map +1 -1
- package/dist/integrations/configure/backup.d.ts +21 -0
- package/dist/integrations/configure/backup.js +52 -0
- package/dist/integrations/configure/backup.js.map +1 -0
- package/dist/integrations/configure/claude-code.d.ts +11 -4
- package/dist/integrations/configure/claude-code.js +73 -24
- package/dist/integrations/configure/claude-code.js.map +1 -1
- package/dist/integrations/configure/cline.d.ts +14 -4
- package/dist/integrations/configure/cline.js +78 -6
- package/dist/integrations/configure/cline.js.map +1 -1
- package/dist/integrations/configure/codex.d.ts +5 -3
- package/dist/integrations/configure/codex.js +12 -5
- package/dist/integrations/configure/codex.js.map +1 -1
- package/dist/integrations/configure/copilot.d.ts +28 -5
- package/dist/integrations/configure/copilot.js +124 -8
- package/dist/integrations/configure/copilot.js.map +1 -1
- package/dist/integrations/configure/droid.d.ts +13 -7
- package/dist/integrations/configure/droid.js +48 -17
- package/dist/integrations/configure/droid.js.map +1 -1
- package/dist/integrations/configure/dsh.d.ts +36 -20
- package/dist/integrations/configure/dsh.js +250 -48
- package/dist/integrations/configure/dsh.js.map +1 -1
- package/dist/integrations/configure/goose.d.ts +21 -7
- package/dist/integrations/configure/goose.js +141 -10
- package/dist/integrations/configure/goose.js.map +1 -1
- package/dist/integrations/configure/hermes.d.ts +63 -10
- package/dist/integrations/configure/hermes.js +360 -75
- package/dist/integrations/configure/hermes.js.map +1 -1
- package/dist/integrations/configure/json-backup.d.ts +73 -0
- package/dist/integrations/configure/json-backup.js +292 -0
- package/dist/integrations/configure/json-backup.js.map +1 -0
- package/dist/integrations/configure/json-key-backup.d.ts +43 -0
- package/dist/integrations/configure/json-key-backup.js +113 -0
- package/dist/integrations/configure/json-key-backup.js.map +1 -0
- package/dist/integrations/configure/kilo.d.ts +4 -4
- package/dist/integrations/configure/kilo.js +6 -9
- package/dist/integrations/configure/kilo.js.map +1 -1
- package/dist/integrations/configure/legacy-env-block.d.ts +18 -0
- package/dist/integrations/configure/legacy-env-block.js +47 -0
- package/dist/integrations/configure/legacy-env-block.js.map +1 -0
- package/dist/integrations/configure/mimo.d.ts +3 -2
- package/dist/integrations/configure/mimo.js +8 -9
- package/dist/integrations/configure/mimo.js.map +1 -1
- package/dist/integrations/configure/muse.d.ts +3 -3
- package/dist/integrations/configure/muse.js +5 -6
- package/dist/integrations/configure/muse.js.map +1 -1
- package/dist/integrations/configure/openclaude.d.ts +22 -7
- package/dist/integrations/configure/openclaude.js +132 -39
- package/dist/integrations/configure/openclaude.js.map +1 -1
- package/dist/integrations/configure/openclaw.d.ts +19 -5
- package/dist/integrations/configure/openclaw.js +79 -23
- package/dist/integrations/configure/openclaw.js.map +1 -1
- package/dist/integrations/configure/opencode-style.d.ts +53 -11
- package/dist/integrations/configure/opencode-style.js +218 -23
- package/dist/integrations/configure/opencode-style.js.map +1 -1
- package/dist/integrations/configure/opencode.d.ts +5 -4
- package/dist/integrations/configure/opencode.js +8 -10
- package/dist/integrations/configure/opencode.js.map +1 -1
- package/dist/integrations/configure/openhands.d.ts +5 -4
- package/dist/integrations/configure/openhands.js +7 -7
- package/dist/integrations/configure/openhands.js.map +1 -1
- package/dist/integrations/configure/pi.d.ts +6 -5
- package/dist/integrations/configure/pi.js +79 -30
- package/dist/integrations/configure/pi.js.map +1 -1
- package/dist/integrations/configure/poolside.d.ts +5 -4
- package/dist/integrations/configure/poolside.js +7 -7
- package/dist/integrations/configure/poolside.js.map +1 -1
- package/dist/integrations/configure/registry.d.ts +6 -0
- package/dist/integrations/configure/registry.js +1 -0
- package/dist/integrations/configure/registry.js.map +1 -1
- package/dist/integrations/configure/zcode.d.ts +6 -7
- package/dist/integrations/configure/zcode.js +26 -11
- package/dist/integrations/configure/zcode.js.map +1 -1
- package/dist/integrations/configure/zed.d.ts +16 -4
- package/dist/integrations/configure/zed.js +61 -13
- package/dist/integrations/configure/zed.js.map +1 -1
- package/dist/models/gguf/kv-cache.d.ts +20 -1
- package/dist/models/gguf/kv-cache.js +97 -7
- package/dist/models/gguf/kv-cache.js.map +1 -1
- package/dist/models/gguf/reader.d.ts +5 -3
- package/dist/models/gguf/reader.js +10 -6
- package/dist/models/gguf/reader.js.map +1 -1
- package/dist/runtime/llamacpp/args.d.ts +14 -0
- package/dist/runtime/llamacpp/args.js +48 -4
- package/dist/runtime/llamacpp/args.js.map +1 -1
- package/dist/runtime/llamacpp/ctx-ladder.d.ts +6 -3
- package/dist/runtime/llamacpp/ctx-ladder.js +6 -3
- package/dist/runtime/llamacpp/ctx-ladder.js.map +1 -1
- package/dist/runtime/llamacpp/fit-margin.d.ts +24 -0
- package/dist/runtime/llamacpp/fit-margin.js +31 -0
- package/dist/runtime/llamacpp/fit-margin.js.map +1 -1
- package/dist/runtime/llamacpp/generation-limits.d.ts +45 -0
- package/dist/runtime/llamacpp/generation-limits.js +61 -0
- package/dist/runtime/llamacpp/generation-limits.js.map +1 -0
- package/dist/runtime/llamacpp/load-plan.d.ts +14 -2
- package/dist/runtime/llamacpp/load-plan.js +64 -13
- package/dist/runtime/llamacpp/load-plan.js.map +1 -1
- package/dist/runtime/llamacpp/runtime.d.ts +1 -0
- package/dist/runtime/llamacpp/runtime.js +2 -0
- package/dist/runtime/llamacpp/runtime.js.map +1 -1
- package/dist/runtime/managed-engines/runtime.js +13 -2
- package/dist/runtime/managed-engines/runtime.js.map +1 -1
- package/dist/runtime/managed-engines/spec.d.ts +6 -0
- package/dist/runtime/managed-engines/spec.js.map +1 -1
- package/dist/runtime/managed-models/auto-limits.d.ts +47 -0
- package/dist/runtime/managed-models/auto-limits.js +60 -0
- package/dist/runtime/managed-models/auto-limits.js.map +1 -0
- package/dist/runtime/managed-models/index.d.ts +1 -0
- package/dist/runtime/managed-models/index.js +1 -0
- package/dist/runtime/managed-models/index.js.map +1 -1
- package/dist/runtime/mlx/config.d.ts +9 -5
- package/dist/runtime/mlx/config.js +12 -6
- package/dist/runtime/mlx/config.js.map +1 -1
- package/dist/runtime/mlx/model-files.d.ts +9 -0
- package/dist/runtime/mlx/model-files.js +26 -0
- package/dist/runtime/mlx/model-files.js.map +1 -1
- package/dist/runtime/mlx/runtime.d.ts +7 -0
- package/dist/runtime/mlx/runtime.js +24 -2
- package/dist/runtime/mlx/runtime.js.map +1 -1
- package/dist/runtime/sglang/adapter.d.ts +4 -0
- package/dist/runtime/sglang/adapter.js +9 -6
- package/dist/runtime/sglang/adapter.js.map +1 -1
- package/dist/runtime/sglang/engine.js +2 -1
- package/dist/runtime/sglang/engine.js.map +1 -1
- package/dist/runtime/sglang/memory.d.ts +11 -1
- package/dist/runtime/sglang/memory.js +34 -3
- package/dist/runtime/sglang/memory.js.map +1 -1
- package/dist/runtime/sglang/settings.d.ts +2 -1
- package/dist/runtime/sglang/settings.js +11 -7
- package/dist/runtime/sglang/settings.js.map +1 -1
- package/dist/runtime/vllm/adapter.d.ts +4 -0
- package/dist/runtime/vllm/adapter.js +9 -6
- package/dist/runtime/vllm/adapter.js.map +1 -1
- package/dist/runtime/vllm/engine.js +1 -0
- package/dist/runtime/vllm/engine.js.map +1 -1
- package/dist/runtime/vllm/memory.d.ts +12 -1
- package/dist/runtime/vllm/memory.js +44 -2
- package/dist/runtime/vllm/memory.js.map +1 -1
- package/dist/runtime/vllm/settings.d.ts +2 -1
- package/dist/runtime/vllm/settings.js +12 -7
- package/dist/runtime/vllm/settings.js.map +1 -1
- package/dist/server/public/context-window.d.ts +29 -0
- package/dist/server/public/context-window.js +77 -0
- package/dist/server/public/context-window.js.map +1 -0
- package/dist/server/public/decision-preview.js +1 -0
- package/dist/server/public/decision-preview.js.map +1 -1
- package/dist/server/public/errors.d.ts +15 -4
- package/dist/server/public/errors.js +53 -7
- package/dist/server/public/errors.js.map +1 -1
- package/dist/server/public/forward.js +65 -5
- package/dist/server/public/forward.js.map +1 -1
- package/dist/server/public/index.d.ts +1 -0
- package/dist/server/public/index.js +1 -0
- package/dist/server/public/index.js.map +1 -1
- package/dist/server/public/listing.d.ts +9 -2
- package/dist/server/public/listing.js +30 -9
- package/dist/server/public/listing.js.map +1 -1
- package/dist/server/public/responses.js +9 -5
- package/dist/server/public/responses.js.map +1 -1
- package/dist/server/public/system-messages.d.ts +39 -0
- package/dist/server/public/system-messages.js +166 -0
- package/dist/server/public/system-messages.js.map +1 -0
- package/dist/server/public/telemetry.d.ts +9 -0
- package/dist/server/public/telemetry.js +42 -6
- package/dist/server/public/telemetry.js.map +1 -1
- package/dist/server/public/thinking.d.ts +26 -0
- package/dist/server/public/thinking.js +62 -0
- package/dist/server/public/thinking.js.map +1 -0
- package/dist/server/public/trace.d.ts +8 -0
- package/dist/server/public/trace.js +17 -0
- package/dist/server/public/trace.js.map +1 -1
- package/dist/server/public/types.d.ts +8 -0
- package/dist/server/shims/index.d.ts +1 -0
- package/dist/server/shims/index.js +1 -0
- package/dist/server/shims/index.js.map +1 -1
- package/dist/server/shims/reminders.d.ts +8 -0
- package/dist/server/shims/reminders.js +14 -0
- package/dist/server/shims/reminders.js.map +1 -0
- package/dist/server/shims/responses.d.ts +33 -9
- package/dist/server/shims/responses.js +160 -36
- package/dist/server/shims/responses.js.map +1 -1
- package/dist/settings/default-migrations.d.ts +34 -0
- package/dist/settings/default-migrations.js +47 -0
- package/dist/settings/default-migrations.js.map +1 -0
- package/dist/settings/schema/atomic-prism.json +23 -9
- package/dist/settings/schema/llamacpp-upstream.json +23 -9
- package/dist/settings/schema/llamacpp.json +23 -9
- package/dist/settings/schema/sglang.json +8 -8
- package/dist/settings/schema/vllm.json +8 -8
- package/dist/settings/schema.js +1 -0
- package/dist/settings/schema.js.map +1 -1
- package/dist/settings/store.d.ts +6 -0
- package/dist/settings/store.js +18 -1
- package/dist/settings/store.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../../src/integrations/configure/claude-code.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../../src/integrations/configure/claude-code.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEvE,OAAO,EACL,aAAa,EACb,KAAK,EACL,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,IAAI,EACJ,WAAW,EACX,eAAe,GAChB,MAAM,kBAAkB,CAAA;AAEzB,OAA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
2
|
-
* Cline —
|
|
2
|
+
* Cline — configured by its own `cline auth` subcommand.
|
|
3
3
|
*
|
|
4
|
-
* Port of `configure_cline` in `src-tauri/src/core/system/commands.rs
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Port of `configure_cline` in `src-tauri/src/core/system/commands.rs` and `cline_config.rs`. The
|
|
5
|
+
* supported way in is `cline auth --provider openai-compatible …`, which saves the provider into
|
|
6
|
+
* Cline's `providers.json` (`<CLINE_DIR>/data/settings/providers.json`) and makes it
|
|
7
|
+
* `lastUsedProvider`, so configuring it means running a process and reporting what it said. It has
|
|
8
|
+
* no flag for the context window, which Cline 3.x reads from the entry's `contextWindow` (and the
|
|
9
|
+
* reply cap from `maxTokens`): both are set on the saved entry afterwards, and removed when the
|
|
10
|
+
* window is unknown. The entry and `lastUsedProvider` from before are kept in the backup sidecar for
|
|
11
|
+
* the desktop's Disconnect, read before `cline auth` rewrites them.
|
|
7
12
|
*
|
|
8
13
|
* On Windows the npm-installed `cline` is a batch shim (`cline.cmd`), which `CreateProcessW` refuses
|
|
9
14
|
* to execute directly, so the call is routed through `cmd /C`.
|
|
@@ -25,4 +30,9 @@ export declare function clineAuthCommand(apiUrl: string, model: string, apiKey:
|
|
|
25
30
|
* outcomes Cline's caller has to report differently.
|
|
26
31
|
*/
|
|
27
32
|
export declare function spawnProcess(program: string, args: string[]): Promise<SpawnResult>;
|
|
33
|
+
/**
|
|
34
|
+
* `providers.json` where Cline resolves it: `$CLINE_PROVIDER_SETTINGS_PATH`, else
|
|
35
|
+
* `$CLINE_DATA_DIR/settings`, else `$CLINE_DIR/data/settings`, else `~/.cline/data/settings`.
|
|
36
|
+
*/
|
|
37
|
+
export declare function clineProvidersPath(env: NodeJS.ProcessEnv, home: string): string;
|
|
28
38
|
export declare function configureCline(input: ConfigureInput): Promise<void>;
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Cline —
|
|
2
|
+
* Cline — configured by its own `cline auth` subcommand.
|
|
3
3
|
*
|
|
4
|
-
* Port of `configure_cline` in `src-tauri/src/core/system/commands.rs
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Port of `configure_cline` in `src-tauri/src/core/system/commands.rs` and `cline_config.rs`. The
|
|
5
|
+
* supported way in is `cline auth --provider openai-compatible …`, which saves the provider into
|
|
6
|
+
* Cline's `providers.json` (`<CLINE_DIR>/data/settings/providers.json`) and makes it
|
|
7
|
+
* `lastUsedProvider`, so configuring it means running a process and reporting what it said. It has
|
|
8
|
+
* no flag for the context window, which Cline 3.x reads from the entry's `contextWindow` (and the
|
|
9
|
+
* reply cap from `maxTokens`): both are set on the saved entry afterwards, and removed when the
|
|
10
|
+
* window is unknown. The entry and `lastUsedProvider` from before are kept in the backup sidecar for
|
|
11
|
+
* the desktop's Disconnect, read before `cline auth` rewrites them.
|
|
7
12
|
*
|
|
8
13
|
* On Windows the npm-installed `cline` is a batch shim (`cline.cmd`), which `CreateProcessW` refuses
|
|
9
14
|
* to execute directly, so the call is routed through `cmd /C`.
|
|
10
15
|
*/
|
|
11
16
|
import { execFile } from 'node:child_process';
|
|
12
17
|
import { AtomicCoreError } from '../../contracts/index.js';
|
|
13
|
-
import { keyOr } from '../config-io.js';
|
|
18
|
+
import { canonicalJson, expandTilde, keyOr, parseJsonStrict } from '../config-io.js';
|
|
19
|
+
import { knownWindow, outputCap, readSidecar, sameJson, writeSidecar } from './backup.js';
|
|
20
|
+
import { asJsonObject } from './json-tree.js';
|
|
14
21
|
import { registerWriter } from './registry.js';
|
|
22
|
+
const PROVIDER = 'openai-compatible';
|
|
15
23
|
/** Argv for `cline auth`, split out so both the writer and its tests can name the exact command. */
|
|
16
24
|
export function clineAuthCommand(apiUrl, model, apiKey, platform) {
|
|
17
25
|
// Cline rejects an empty `--apikey` (and an empty `--modelid`), so a keyless local server gets a
|
|
@@ -19,7 +27,7 @@ export function clineAuthCommand(apiUrl, model, apiKey, platform) {
|
|
|
19
27
|
const args = [
|
|
20
28
|
'auth',
|
|
21
29
|
'--provider',
|
|
22
|
-
|
|
30
|
+
PROVIDER,
|
|
23
31
|
'--apikey',
|
|
24
32
|
keyOr(apiKey, 'local'),
|
|
25
33
|
'--modelid',
|
|
@@ -49,9 +57,52 @@ export function spawnProcess(program, args) {
|
|
|
49
57
|
});
|
|
50
58
|
});
|
|
51
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* `providers.json` where Cline resolves it: `$CLINE_PROVIDER_SETTINGS_PATH`, else
|
|
62
|
+
* `$CLINE_DATA_DIR/settings`, else `$CLINE_DIR/data/settings`, else `~/.cline/data/settings`.
|
|
63
|
+
*/
|
|
64
|
+
export function clineProvidersPath(env, home) {
|
|
65
|
+
const value = (name) => {
|
|
66
|
+
const raw = env[name]?.trim();
|
|
67
|
+
return raw ? expandTilde(raw, home) : undefined;
|
|
68
|
+
};
|
|
69
|
+
const file = value('CLINE_PROVIDER_SETTINGS_PATH');
|
|
70
|
+
if (file !== undefined)
|
|
71
|
+
return file;
|
|
72
|
+
const data = value('CLINE_DATA_DIR') ?? `${value('CLINE_DIR') ?? '.cline'}/data`;
|
|
73
|
+
return `${data}/settings/providers.json`;
|
|
74
|
+
}
|
|
75
|
+
async function readProviders(fs, path) {
|
|
76
|
+
const text = await fs.read(path);
|
|
77
|
+
const parsed = text === undefined ? {} : parseJsonStrict(text, fs.absolute(path));
|
|
78
|
+
const root = asJsonObject(parsed);
|
|
79
|
+
if (!root)
|
|
80
|
+
throw new AtomicCoreError('IO_ERROR', `${fs.absolute(path)} is not a JSON object`);
|
|
81
|
+
return root;
|
|
82
|
+
}
|
|
83
|
+
const entrySettings = (root) => asJsonObject(asJsonObject(asJsonObject(root['providers'])?.[PROVIDER])?.['settings']);
|
|
84
|
+
/** Whether the entry still points where we pointed it. */
|
|
85
|
+
function holdsOurs(root, written) {
|
|
86
|
+
const settings = entrySettings(root);
|
|
87
|
+
const ours = asJsonObject(written);
|
|
88
|
+
return (settings !== undefined &&
|
|
89
|
+
ours !== undefined &&
|
|
90
|
+
sameJson(settings['baseUrl'], ours['baseUrl']) &&
|
|
91
|
+
sameJson(settings['model'], ours['model']));
|
|
92
|
+
}
|
|
52
93
|
export async function configureCline(input) {
|
|
53
94
|
const { program, args } = clineAuthCommand(input.apiUrl, input.model, input.apiKey, input.platform);
|
|
54
95
|
const spawn = input.spawn ?? spawnProcess;
|
|
96
|
+
// What the desktop's Disconnect restores, read before `cline auth` rewrites it — and kept as it
|
|
97
|
+
// is across reconnects while the file still holds ours.
|
|
98
|
+
const path = clineProvidersPath(input.env, input.fs.home);
|
|
99
|
+
const before = await readProviders(input.fs, path);
|
|
100
|
+
const backup = await readSidecar(input.fs, path);
|
|
101
|
+
const kept = backup !== undefined && holdsOurs(before, backup['written']) ? backup['previous'] : undefined;
|
|
102
|
+
const previous = kept ?? {
|
|
103
|
+
lastUsedProvider: before['lastUsedProvider'] ?? null,
|
|
104
|
+
entry: asJsonObject(before['providers'])?.[PROVIDER] ?? null,
|
|
105
|
+
};
|
|
55
106
|
let result;
|
|
56
107
|
try {
|
|
57
108
|
result = await spawn(program, args);
|
|
@@ -65,6 +116,27 @@ export async function configureCline(input) {
|
|
|
65
116
|
const detail = stderr === '' ? result.stdout.trim() : stderr;
|
|
66
117
|
throw new AtomicCoreError('INTERNAL_ERROR', `\`cline auth\` failed: ${detail}`);
|
|
67
118
|
}
|
|
119
|
+
// `cline auth` has no flag for the window; set it on the entry it saved, or clear what the entry
|
|
120
|
+
// carried for the endpoint it pointed at before.
|
|
121
|
+
const after = await readProviders(input.fs, path);
|
|
122
|
+
const settings = entrySettings(after);
|
|
123
|
+
if (settings !== undefined) {
|
|
124
|
+
const was = canonicalJson(settings);
|
|
125
|
+
const window = knownWindow(input.contextLength);
|
|
126
|
+
if (window !== undefined) {
|
|
127
|
+
settings['contextWindow'] = window;
|
|
128
|
+
settings['maxTokens'] = outputCap(window);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
delete settings['contextWindow'];
|
|
132
|
+
delete settings['maxTokens'];
|
|
133
|
+
}
|
|
134
|
+
// Cline keeps the file owner-only: it holds every provider's key.
|
|
135
|
+
if (canonicalJson(settings) !== was) {
|
|
136
|
+
await input.fs.write(path, canonicalJson(after), input.platform === 'win32' ? {} : { mode: 0o600 });
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
await writeSidecar(input.fs, path, { previous, written: { baseUrl: input.apiUrl, model: input.model } }, input.platform);
|
|
68
140
|
}
|
|
69
141
|
registerWriter('cline', configureCline);
|
|
70
142
|
//# sourceMappingURL=cline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cline.js","sourceRoot":"","sources":["../../../src/integrations/configure/cline.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cline.js","sourceRoot":"","sources":["../../../src/integrations/configure/cline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE1D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACpF,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAEzF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,QAAQ,GAAG,mBAAmB,CAAA;AAQpC,oGAAoG;AACpG,MAAM,UAAU,gBAAgB,CAC9B,MAAc,EACd,KAAa,EACb,MAAc,EACd,QAAyB;IAEzB,iGAAiG;IACjG,gGAAgG;IAChG,MAAM,IAAI,GAAG;QACX,MAAM;QACN,YAAY;QACZ,QAAQ;QACR,UAAU;QACV,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC;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pC,MAAM,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;QACrG,CAAC;IACH,CAAC;IACD,MAAM,YAAY,CAChB,KAAK,CAAC,EAAE,EACR,IAAI,EACJ,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,EAAE,EACpE,KAAK,CAAC,QAAQ,CACf,CAAA;AACH,CAAC;AAED,cAAc,CAAC,OAAO,EAAE,cAAc,CAAC,CAAA"}
|
|
@@ -41,9 +41,11 @@ export declare function codexHome(env: NodeJS.ProcessEnv, home: string): string;
|
|
|
41
41
|
export declare function codexProfilePath(dir: string): string;
|
|
42
42
|
/**
|
|
43
43
|
* The profile's exact bytes. Codex reads the key from the variable `env_key` names, never inline, so
|
|
44
|
-
* a keyless server gets no `env_key` line at all and `launch` sets the variable on the child.
|
|
44
|
+
* a keyless server gets no `env_key` line at all and `launch` sets the variable on the child. A known
|
|
45
|
+
* served window is written as `model_context_window` (Codex otherwise assumes 272K for a model it
|
|
46
|
+
* does not know) with compaction at three quarters of it; an unknown one writes neither line.
|
|
45
47
|
*/
|
|
46
|
-
export declare function renderCodexProfile(apiUrl: string, model: string, apiKey: string): string;
|
|
48
|
+
export declare function renderCodexProfile(apiUrl: string, model: string, apiKey: string, contextLength?: number): string;
|
|
47
49
|
/** `codex --version` prints `codex-cli 0.146.0`: the first `x.y.z` in the output. */
|
|
48
50
|
export declare function parseCodexVersion(output: string): CodexVersion | undefined;
|
|
49
51
|
export declare function isCodexTooOld([major, minor, patch]: CodexVersion): boolean;
|
|
@@ -51,5 +53,5 @@ export declare function isCodexTooOld([major, minor, patch]: CodexVersion): bool
|
|
|
51
53
|
* Write the profile, refusing to replace a file of that name Atomic Chat did not write. Returns its
|
|
52
54
|
* path. A profile that cannot be read is an error, never "absent"; a symbolic link is written through.
|
|
53
55
|
*/
|
|
54
|
-
export declare function writeCodexProfile(fs: ConfigFs, dir: string, apiUrl: string, model: string, apiKey: string): Promise<string>;
|
|
56
|
+
export declare function writeCodexProfile(fs: ConfigFs, dir: string, apiUrl: string, model: string, apiKey: string, contextLength?: number): Promise<string>;
|
|
55
57
|
export declare function configureCodex(input: ConfigureInput): Promise<void>;
|
|
@@ -49,13 +49,20 @@ export function codexProfilePath(dir) {
|
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* The profile's exact bytes. Codex reads the key from the variable `env_key` names, never inline, so
|
|
52
|
-
* a keyless server gets no `env_key` line at all and `launch` sets the variable on the child.
|
|
52
|
+
* a keyless server gets no `env_key` line at all and `launch` sets the variable on the child. A known
|
|
53
|
+
* served window is written as `model_context_window` (Codex otherwise assumes 272K for a model it
|
|
54
|
+
* does not know) with compaction at three quarters of it; an unknown one writes neither line.
|
|
53
55
|
*/
|
|
54
|
-
export function renderCodexProfile(apiUrl, model, apiKey) {
|
|
56
|
+
export function renderCodexProfile(apiUrl, model, apiKey, contextLength) {
|
|
57
|
+
const window = contextLength !== undefined && contextLength > 0
|
|
58
|
+
? `model_context_window = ${contextLength}\n` +
|
|
59
|
+
`model_auto_compact_token_limit = ${Math.floor((contextLength * 3) / 4)}\n`
|
|
60
|
+
: '';
|
|
55
61
|
return (`${CODEX_PROFILE_OWNER_PREFIX}: \`codex --profile ${CODEX_PROFILE}\` runs Codex on your local models.\n` +
|
|
56
62
|
'# Atomic Chat rewrites this file when Codex is connected again and deletes it on disconnect.\n' +
|
|
57
63
|
`model = "${tomlBasicStringEscape(model)}"\n` +
|
|
58
64
|
`model_provider = "${CODEX_PROFILE}"\n` +
|
|
65
|
+
window +
|
|
59
66
|
'\n' +
|
|
60
67
|
`[model_providers.${CODEX_PROFILE}]\n` +
|
|
61
68
|
'name = "Atomic Chat"\n' +
|
|
@@ -79,9 +86,9 @@ export function isCodexTooOld([major, minor, patch]) {
|
|
|
79
86
|
* Write the profile, refusing to replace a file of that name Atomic Chat did not write. Returns its
|
|
80
87
|
* path. A profile that cannot be read is an error, never "absent"; a symbolic link is written through.
|
|
81
88
|
*/
|
|
82
|
-
export async function writeCodexProfile(fs, dir, apiUrl, model, apiKey) {
|
|
89
|
+
export async function writeCodexProfile(fs, dir, apiUrl, model, apiKey, contextLength) {
|
|
83
90
|
const path = codexProfilePath(dir);
|
|
84
|
-
const contents = renderCodexProfile(apiUrl, model, apiKey);
|
|
91
|
+
const contents = renderCodexProfile(apiUrl, model, apiKey, contextLength);
|
|
85
92
|
// Cannot fail with the escaping above; it keeps a future edit of the template from shipping a file
|
|
86
93
|
// Codex would reject.
|
|
87
94
|
parseToml(contents);
|
|
@@ -131,7 +138,7 @@ export async function configureCodex(input) {
|
|
|
131
138
|
const repair = await repairLegacyCodexConfig(input.fs, dir, input.platform);
|
|
132
139
|
if (repair.kind === 'conflict')
|
|
133
140
|
throw new AtomicCoreError('IO_ERROR', repair.reason);
|
|
134
|
-
await writeCodexProfile(input.fs, dir, input.apiUrl, input.model, input.apiKey);
|
|
141
|
+
await writeCodexProfile(input.fs, dir, input.apiUrl, input.model, input.apiKey, input.contextLength);
|
|
135
142
|
}
|
|
136
143
|
registerWriter('codex', configureCodex);
|
|
137
144
|
//# sourceMappingURL=codex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex.js","sourceRoot":"","sources":["../../../src/integrations/configure/codex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAE,WA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M,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IACzE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,KAAqB;IACxD,MAAM,OAAO,GAAG,MAAM,qBAAqB,CAAC,KAAK,CAAC,CAAA;IAClD,IAAI,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,eAAe,CACvB,UAAU,EACV,aAAa,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,6EAA6E,CAC5G,CAAA;IACH,CAAC;IAED,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;IAC/C,MAAM,MAAM,GAAG,MAAM,uBAAuB,CAAC,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;IAC3E,IAAI,MAAM,CAAC,IAAI,KAAK,UAAU;QAAE,MAAM,IAAI,eAAe,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;IAEpF,MAAM,iBAAiB,CAAC,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,CAAA;AACtG,CAAC;AAED,cAAc,CAAC,OAAO,EAAE,cAAc,CAAC,CAAA"}
|
|
@@ -1,10 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* GitHub Copilot CLI
|
|
3
|
-
*
|
|
4
|
-
* `COPILOT_OFFLINE` is on so no GitHub sign-in is required and traffic stays on the local provider.
|
|
2
|
+
* GitHub Copilot CLI — an `atomic-chat` provider and its model in Copilot's `providers.json`.
|
|
3
|
+
* Twin of `copilot_config.rs` in the app.
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Earlier releases persisted `COPILOT_PROVIDER_*`, `COPILOT_MODEL` and `COPILOT_OFFLINE=true`
|
|
6
|
+
* user-wide (a marked block in the shell rc, `setx` on Windows), which put every `copilot` the user
|
|
7
|
+
* ran on the local server — and a `providers.json` with any provider in it overrides those
|
|
8
|
+
* variables anyway. The file is Copilot's documented home for named providers, holds the window
|
|
9
|
+
* limits the variables could not, and lists the model beside the user's own; `launch` selects it for
|
|
10
|
+
* the run through `COPILOT_MODEL=atomic-chat/<model>` (catalog `childEnv`), which Copilot reads like
|
|
11
|
+
* `--model`. Our entries are replaced in place; every other provider and model is kept.
|
|
12
|
+
*
|
|
13
|
+
* Copilot reads `apiKey` literally (no variable references), so a keyed server's key is written into
|
|
14
|
+
* the owner-only file, and a keyless one gets no key at all, as Copilot allows for a local server.
|
|
15
|
+
*
|
|
16
|
+
* Connect also removes exactly the rc blocks an earlier release wrote: a block must open and close
|
|
17
|
+
* with our marker and hold only `export COPILOT_…` and blank lines, or the file stays as it is. The
|
|
18
|
+
* Windows variables are removed by the desktop app.
|
|
8
19
|
*/
|
|
9
20
|
import type { ConfigureWriter } from './registry.js';
|
|
21
|
+
/** Our provider's `name`; Copilot addresses the model as `atomic-chat/<model id>`. */
|
|
22
|
+
export declare const COPILOT_PROVIDER_NAME = "atomic-chat";
|
|
23
|
+
/**
|
|
24
|
+
* `providers.json` where Copilot reads it: `$COPILOT_PROVIDERS_CONFIG`, else
|
|
25
|
+
* `$COPILOT_HOME/providers.json`, else `~/.copilot/providers.json`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function copilotProvidersPath(env: NodeJS.ProcessEnv, home: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* `text` without the blocks an earlier release wrote, or `undefined` when there is nothing it can
|
|
30
|
+
* vouch for.
|
|
31
|
+
*/
|
|
32
|
+
export declare function stripLegacyCopilotBlock(text: string): string | undefined;
|
|
10
33
|
export declare const configureCopilot: ConfigureWriter;
|
|
@@ -1,14 +1,130 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* GitHub Copilot CLI
|
|
3
|
-
*
|
|
4
|
-
* `COPILOT_OFFLINE` is on so no GitHub sign-in is required and traffic stays on the local provider.
|
|
2
|
+
* GitHub Copilot CLI — an `atomic-chat` provider and its model in Copilot's `providers.json`.
|
|
3
|
+
* Twin of `copilot_config.rs` in the app.
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Earlier releases persisted `COPILOT_PROVIDER_*`, `COPILOT_MODEL` and `COPILOT_OFFLINE=true`
|
|
6
|
+
* user-wide (a marked block in the shell rc, `setx` on Windows), which put every `copilot` the user
|
|
7
|
+
* ran on the local server — and a `providers.json` with any provider in it overrides those
|
|
8
|
+
* variables anyway. The file is Copilot's documented home for named providers, holds the window
|
|
9
|
+
* limits the variables could not, and lists the model beside the user's own; `launch` selects it for
|
|
10
|
+
* the run through `COPILOT_MODEL=atomic-chat/<model>` (catalog `childEnv`), which Copilot reads like
|
|
11
|
+
* `--model`. Our entries are replaced in place; every other provider and model is kept.
|
|
12
|
+
*
|
|
13
|
+
* Copilot reads `apiKey` literally (no variable references), so a keyed server's key is written into
|
|
14
|
+
* the owner-only file, and a keyless one gets no key at all, as Copilot allows for a local server.
|
|
15
|
+
*
|
|
16
|
+
* Connect also removes exactly the rc blocks an earlier release wrote: a block must open and close
|
|
17
|
+
* with our marker and hold only `export COPILOT_…` and blank lines, or the file stays as it is. The
|
|
18
|
+
* Windows variables are removed by the desktop app.
|
|
8
19
|
*/
|
|
20
|
+
import { AtomicCoreError } from '../../contracts/index.js';
|
|
21
|
+
import { canonicalJson, expandTilde, parseJsonStrict } from '../config-io.js';
|
|
22
|
+
import { knownWindow, outputCap } from './backup.js';
|
|
23
|
+
import { asJsonObject } from './json-tree.js';
|
|
9
24
|
import { registerWriter } from './registry.js';
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
25
|
+
/** Our provider's `name`; Copilot addresses the model as `atomic-chat/<model id>`. */
|
|
26
|
+
export const COPILOT_PROVIDER_NAME = 'atomic-chat';
|
|
27
|
+
const LEGACY_MARKER = '# Atomic Chat - Copilot CLI Config';
|
|
28
|
+
/** Every rc file an earlier release could have written to. */
|
|
29
|
+
const LEGACY_RC_FILES = ['.zshenv', '.bash_profile', '.bashrc'];
|
|
30
|
+
/**
|
|
31
|
+
* `providers.json` where Copilot reads it: `$COPILOT_PROVIDERS_CONFIG`, else
|
|
32
|
+
* `$COPILOT_HOME/providers.json`, else `~/.copilot/providers.json`.
|
|
33
|
+
*/
|
|
34
|
+
export function copilotProvidersPath(env, home) {
|
|
35
|
+
const value = (name) => {
|
|
36
|
+
const raw = env[name]?.trim();
|
|
37
|
+
return raw ? expandTilde(raw, home) : undefined;
|
|
38
|
+
};
|
|
39
|
+
return value('COPILOT_PROVIDERS_CONFIG') ?? `${value('COPILOT_HOME') ?? '.copilot'}/providers.json`;
|
|
40
|
+
}
|
|
41
|
+
const named = (entry, field) => asJsonObject(entry)?.[field] === COPILOT_PROVIDER_NAME;
|
|
42
|
+
/** `root[key]` as a list, created when absent or null (Copilot reads both as empty). */
|
|
43
|
+
function list(root, key, path) {
|
|
44
|
+
const value = root[key];
|
|
45
|
+
if (value === undefined || value === null)
|
|
46
|
+
root[key] = [];
|
|
47
|
+
const out = root[key];
|
|
48
|
+
if (!Array.isArray(out)) {
|
|
49
|
+
throw new AtomicCoreError('IO_ERROR', `\`${key}\` in ${path} is not a list. Fix or remove it and try again.`);
|
|
50
|
+
}
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* `text` without the blocks an earlier release wrote, or `undefined` when there is nothing it can
|
|
55
|
+
* vouch for.
|
|
56
|
+
*/
|
|
57
|
+
export function stripLegacyCopilotBlock(text) {
|
|
58
|
+
const isMarker = (line) => line.replace(/[\r\n]+$/, '') === LEGACY_MARKER;
|
|
59
|
+
const lines = text.split(/(?<=\n)/);
|
|
60
|
+
if (!lines.some(isMarker))
|
|
61
|
+
return undefined;
|
|
62
|
+
const kept = [];
|
|
63
|
+
let open = false;
|
|
64
|
+
for (const line of lines) {
|
|
65
|
+
if (isMarker(line)) {
|
|
66
|
+
open = !open;
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
if (open) {
|
|
70
|
+
const bare = line.replace(/[\r\n]+$/, '');
|
|
71
|
+
if (bare.trim() !== '' && !bare.startsWith('export COPILOT_'))
|
|
72
|
+
return undefined;
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
kept.push(line);
|
|
76
|
+
}
|
|
77
|
+
return open ? undefined : kept.join('');
|
|
78
|
+
}
|
|
79
|
+
export const configureCopilot = async ({ apiUrl, model, apiKey, fs, env, platform, contextLength, }) => {
|
|
80
|
+
const path = copilotProvidersPath(env, fs.home);
|
|
81
|
+
const text = await fs.read(path);
|
|
82
|
+
const root = asJsonObject(text === undefined ? {} : parseJsonStrict(text, fs.absolute(path)));
|
|
83
|
+
if (!root)
|
|
84
|
+
throw new AtomicCoreError('IO_ERROR', `${fs.absolute(path)} is not a JSON object`);
|
|
85
|
+
const providers = list(root, 'providers', fs.absolute(path));
|
|
86
|
+
const provider = {
|
|
87
|
+
name: COPILOT_PROVIDER_NAME,
|
|
88
|
+
type: 'openai',
|
|
89
|
+
baseUrl: apiUrl,
|
|
90
|
+
...(apiKey ? { apiKey } : {}),
|
|
91
|
+
};
|
|
92
|
+
const at = providers.findIndex((p) => named(p, 'name'));
|
|
93
|
+
if (at >= 0) {
|
|
94
|
+
providers[at] = provider;
|
|
95
|
+
root['providers'] = providers.filter((p, i) => i <= at || !named(p, 'name'));
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
providers.push(provider);
|
|
99
|
+
}
|
|
100
|
+
const models = list(root, 'models', fs.absolute(path));
|
|
101
|
+
const first = models.findIndex((m) => named(m, 'provider'));
|
|
102
|
+
const others = models.filter((m) => !named(m, 'provider'));
|
|
103
|
+
// A known window becomes Copilot's limits: the reply capped at a quarter of it (8192 at most) and
|
|
104
|
+
// the prompt given the rest. Unknown, Copilot assumes 128K for a model it does not know.
|
|
105
|
+
const window = knownWindow(contextLength);
|
|
106
|
+
const ours = {
|
|
107
|
+
id: model,
|
|
108
|
+
provider: COPILOT_PROVIDER_NAME,
|
|
109
|
+
...(window !== undefined
|
|
110
|
+
? {
|
|
111
|
+
maxContextWindowTokens: window,
|
|
112
|
+
maxPromptTokens: window - outputCap(window),
|
|
113
|
+
maxOutputTokens: outputCap(window),
|
|
114
|
+
}
|
|
115
|
+
: {}),
|
|
116
|
+
};
|
|
117
|
+
others.splice(first >= 0 ? Math.min(first, others.length) : others.length, 0, ours);
|
|
118
|
+
root['models'] = others;
|
|
119
|
+
// Plain text keys, the user's own among them.
|
|
120
|
+
await fs.write(path, canonicalJson(root), platform === 'win32' ? {} : { mode: 0o600 });
|
|
121
|
+
for (const rc of LEGACY_RC_FILES) {
|
|
122
|
+
const existing = await fs.read(rc);
|
|
123
|
+
const stripped = existing === undefined ? undefined : stripLegacyCopilotBlock(existing);
|
|
124
|
+
// Written through a symbolic link (dotfile managers link rc files), never over it.
|
|
125
|
+
if (stripped !== undefined)
|
|
126
|
+
await fs.write(await fs.linkTarget(rc), stripped);
|
|
127
|
+
}
|
|
128
|
+
};
|
|
13
129
|
registerWriter('copilot', configureCopilot);
|
|
14
130
|
//# sourceMappingURL=copilot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copilot.js","sourceRoot":"","sources":["../../../src/integrations/configure/copilot.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"copilot.js","sourceRoot":"","sources":["../../../src/integrations/configure/copilot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE1D,OAAO,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AE,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;IAEtF,KAAK,MAAM,EAAE,IAAI,eAAe,EAAE,CAAC;QACjC,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAClC,MAAM,QAAQ,GAAG,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAA;QACvF,mFAAmF;QACnF,IAAI,QAAQ,KAAK,SAAS;YAAE,MAAM,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAA;IAC/E,CAAC;AACH,CAAC,CAAA;AAED,cAAc,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAA"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Factory Droid keeps its BYOK providers in `~/.factory/settings.json` as a `customModels` array
|
|
3
|
-
*
|
|
2
|
+
* Factory Droid keeps its BYOK providers in `~/.factory/settings.json` as a `customModels` array.
|
|
3
|
+
* Twin of `droid_config.rs` in the app.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* Droid addresses a custom model by its `id`, `custom:<displayName with dashes>-<n>`; our entry
|
|
6
|
+
* carries `id` and `index` explicitly so the selector cannot drift when other entries move, and we
|
|
7
|
+
* upsert by `displayName` (our managed marker) so a rerun replaces it in place. The default for new
|
|
8
|
+
* sessions lives in `sessionDefaultSettings.model`: Droid moves a legacy top-level `model` there only
|
|
9
|
+
* when that key is empty, so the top-level value earlier releases wrote lost to any default the user
|
|
10
|
+
* had. That one is removed; the default the user had before is kept in the backup sidecar for the
|
|
11
|
+
* desktop's Disconnect.
|
|
12
|
+
*
|
|
13
|
+
* A known served window caps the reply at a quarter of it (8192 at most) and gives Droid the rest
|
|
14
|
+
* as `maxContextLimit`; an unknown one writes neither, where earlier releases claimed 16384 output
|
|
15
|
+
* tokens — the whole of a 16K window.
|
|
10
16
|
*/
|
|
11
17
|
import type { ConfigureWriter } from './registry.js';
|
|
12
18
|
export declare const configureDroid: ConfigureWriter;
|
|
@@ -1,47 +1,78 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Factory Droid keeps its BYOK providers in `~/.factory/settings.json` as a `customModels` array
|
|
3
|
-
*
|
|
2
|
+
* Factory Droid keeps its BYOK providers in `~/.factory/settings.json` as a `customModels` array.
|
|
3
|
+
* Twin of `droid_config.rs` in the app.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* Droid addresses a custom model by its `id`, `custom:<displayName with dashes>-<n>`; our entry
|
|
6
|
+
* carries `id` and `index` explicitly so the selector cannot drift when other entries move, and we
|
|
7
|
+
* upsert by `displayName` (our managed marker) so a rerun replaces it in place. The default for new
|
|
8
|
+
* sessions lives in `sessionDefaultSettings.model`: Droid moves a legacy top-level `model` there only
|
|
9
|
+
* when that key is empty, so the top-level value earlier releases wrote lost to any default the user
|
|
10
|
+
* had. That one is removed; the default the user had before is kept in the backup sidecar for the
|
|
11
|
+
* desktop's Disconnect.
|
|
12
|
+
*
|
|
13
|
+
* A known served window caps the reply at a quarter of it (8192 at most) and gives Droid the rest
|
|
14
|
+
* as `maxContextLimit`; an unknown one writes neither, where earlier releases claimed 16384 output
|
|
15
|
+
* tokens — the whole of a 16K window.
|
|
10
16
|
*/
|
|
11
17
|
import { AtomicCoreError } from '../../contracts/index.js';
|
|
12
18
|
import { canonicalJson, keyOr, parseJsonStrict } from '../config-io.js';
|
|
19
|
+
import { knownWindow, outputCap, readSidecar, sameJson, writeSidecar } from './backup.js';
|
|
13
20
|
import { asJsonArray, asJsonObject } from './json-tree.js';
|
|
14
21
|
import { registerWriter } from './registry.js';
|
|
15
22
|
const DISPLAY_NAME = 'Atomic Chat';
|
|
23
|
+
/** `custom:` + the display name with whitespace runs turned into dashes. */
|
|
24
|
+
const SELECTOR_PREFIX = 'custom:Atomic-Chat-';
|
|
16
25
|
const SETTINGS_PATH = '.factory/settings.json';
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
export const configureDroid = async ({ apiUrl, model, apiKey, fs }) => {
|
|
26
|
+
const SESSION_DEFAULTS = 'sessionDefaultSettings';
|
|
27
|
+
const isOurSelector = (value) => typeof value === 'string' && value.startsWith(SELECTOR_PREFIX);
|
|
28
|
+
export const configureDroid = async ({ apiUrl, model, apiKey, fs, platform, contextLength, }) => {
|
|
20
29
|
const text = await fs.read(SETTINGS_PATH);
|
|
21
30
|
const parsed = text === undefined ? {} : parseJsonStrict(text, fs.absolute(SETTINGS_PATH));
|
|
22
31
|
const root = asJsonObject(parsed);
|
|
23
32
|
if (!root)
|
|
24
33
|
throw new AtomicCoreError('IO_ERROR', 'settings.json is not a JSON object');
|
|
34
|
+
// What the desktop's Disconnect puts back: the default before the first Connect, kept across
|
|
35
|
+
// reconnects while the file still has ours.
|
|
36
|
+
const currentDefault = asJsonObject(root[SESSION_DEFAULTS])?.['model'];
|
|
37
|
+
const backup = await readSidecar(fs, SETTINGS_PATH);
|
|
38
|
+
const previous = backup !== undefined &&
|
|
39
|
+
currentDefault !== undefined &&
|
|
40
|
+
sameJson(asJsonObject(backup['written'])?.['defaultModel'], currentDefault)
|
|
41
|
+
? (backup['previous'] ?? null)
|
|
42
|
+
: {
|
|
43
|
+
defaultModel: currentDefault ?? null,
|
|
44
|
+
sessionDefaultSettings: Object.hasOwn(root, SESSION_DEFAULTS),
|
|
45
|
+
};
|
|
25
46
|
// A `customModels` that is not an array is unusable to Droid anyway, so it is replaced rather than
|
|
26
47
|
// preserved — unlike the individual entries inside it, which are the user's own providers.
|
|
27
48
|
const models = asJsonArray(root['customModels']) ?? [];
|
|
49
|
+
const found = models.findIndex((m) => asJsonObject(m)?.['displayName'] === DISPLAY_NAME);
|
|
50
|
+
const index = found >= 0 ? found : models.length;
|
|
51
|
+
const selector = `${SELECTOR_PREFIX}${index}`;
|
|
52
|
+
const window = knownWindow(contextLength);
|
|
28
53
|
const entry = {
|
|
29
54
|
model,
|
|
55
|
+
id: selector,
|
|
56
|
+
index,
|
|
30
57
|
displayName: DISPLAY_NAME,
|
|
31
58
|
baseUrl: apiUrl,
|
|
32
59
|
// Droid rejects an empty apiKey outright, so a keyless local server still needs a placeholder.
|
|
33
60
|
apiKey: keyOr(apiKey, 'atomic'),
|
|
34
61
|
provider: 'generic-chat-completion-api',
|
|
35
|
-
|
|
62
|
+
...(window !== undefined
|
|
63
|
+
? { maxOutputTokens: outputCap(window), maxContextLimit: window - outputCap(window) }
|
|
64
|
+
: {}),
|
|
36
65
|
};
|
|
37
|
-
|
|
38
|
-
if (index >= 0)
|
|
39
|
-
models[index] = entry;
|
|
40
|
-
else
|
|
41
|
-
index = models.push(entry) - 1;
|
|
66
|
+
models[index] = entry;
|
|
42
67
|
root['customModels'] = models;
|
|
43
|
-
|
|
68
|
+
// Earlier releases selected us through the legacy top-level key.
|
|
69
|
+
if (isOurSelector(root['model']))
|
|
70
|
+
delete root['model'];
|
|
71
|
+
const defaults = asJsonObject(root[SESSION_DEFAULTS]) ?? {};
|
|
72
|
+
defaults['model'] = selector;
|
|
73
|
+
root[SESSION_DEFAULTS] = defaults;
|
|
44
74
|
await fs.write(SETTINGS_PATH, canonicalJson(root));
|
|
75
|
+
await writeSidecar(fs, SETTINGS_PATH, { previous, written: { defaultModel: selector } }, platform);
|
|
45
76
|
};
|
|
46
77
|
registerWriter('droid', configureDroid);
|
|
47
78
|
//# sourceMappingURL=droid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"droid.js","sourceRoot":"","sources":["../../../src/integrations/configure/droid.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
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