amalgm 0.1.64 → 0.1.66
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/package.json
CHANGED
|
@@ -29,6 +29,10 @@ const fileWatchers = new Map();
|
|
|
29
29
|
const uploadWatchers = new Map();
|
|
30
30
|
let uploadsPublishTimer = null;
|
|
31
31
|
|
|
32
|
+
function isHiddenFilesystemEntry(name) {
|
|
33
|
+
return typeof name === 'string' && name.startsWith('.');
|
|
34
|
+
}
|
|
35
|
+
|
|
32
36
|
function expandHome(targetPath) {
|
|
33
37
|
if (targetPath === '~') return os.homedir();
|
|
34
38
|
if (typeof targetPath === 'string' && targetPath.startsWith('~/')) {
|
|
@@ -280,16 +284,12 @@ function classifyFile(targetPath) {
|
|
|
280
284
|
|
|
281
285
|
function directorySnapshot(targetPath) {
|
|
282
286
|
const entries = fs.readdirSync(targetPath, { withFileTypes: true });
|
|
283
|
-
const files = entries
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
return {
|
|
287
|
+
const files = entries
|
|
288
|
+
.filter((entry) => !isHiddenFilesystemEntry(entry.name))
|
|
289
|
+
.map((entry) => ({
|
|
287
290
|
name: entry.name,
|
|
288
|
-
isDir:
|
|
289
|
-
|
|
290
|
-
modTime: stats.mtime.toISOString(),
|
|
291
|
-
};
|
|
292
|
-
});
|
|
291
|
+
isDir: entry.isDirectory(),
|
|
292
|
+
}));
|
|
293
293
|
|
|
294
294
|
files.sort((a, b) => {
|
|
295
295
|
if (a.isDir !== b.isDir) return a.isDir ? -1 : 1;
|
|
@@ -72,7 +72,7 @@ function sanitizeRunModelSettings(settings, harness) {
|
|
|
72
72
|
: new Set();
|
|
73
73
|
return {
|
|
74
74
|
...(effort && allowedEfforts.has(effort) ? { effort } : {}),
|
|
75
|
-
...(harness === 'claude_code' && settings.fastMode === true ? { fastMode: true } : {}),
|
|
75
|
+
...((harness === 'claude_code' || harness === 'codex') && settings.fastMode === true ? { fastMode: true } : {}),
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const test = require('node:test');
|
|
4
|
+
const assert = require('node:assert/strict');
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
const os = require('os');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
|
|
9
|
+
const { buildFilesResource } = require('../fs/rest')._private;
|
|
10
|
+
|
|
11
|
+
test('files resource omits dot-prefixed filesystem entries', (t) => {
|
|
12
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'amalgm-files-resource-'));
|
|
13
|
+
t.after(() => fs.rmSync(dir, { recursive: true, force: true }));
|
|
14
|
+
|
|
15
|
+
fs.mkdirSync(path.join(dir, 'visible-dir'));
|
|
16
|
+
fs.mkdirSync(path.join(dir, '.hidden-dir'));
|
|
17
|
+
fs.writeFileSync(path.join(dir, 'visible.txt'), 'hello');
|
|
18
|
+
fs.writeFileSync(path.join(dir, '.env'), 'SECRET=value');
|
|
19
|
+
|
|
20
|
+
const snapshot = buildFilesResource(dir, { watch: false });
|
|
21
|
+
|
|
22
|
+
assert.deepEqual(
|
|
23
|
+
snapshot.files.map((file) => file.name),
|
|
24
|
+
['visible-dir', 'visible.txt'],
|
|
25
|
+
);
|
|
26
|
+
assert.equal(snapshot.files.some((file) => file.name.startsWith('.')), false);
|
|
27
|
+
});
|
|
@@ -173,6 +173,10 @@ function modelWindowConfigLines(contract) {
|
|
|
173
173
|
];
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
+
function serviceTierForContract(contract) {
|
|
177
|
+
return contract.fastMode ? 'fast' : null;
|
|
178
|
+
}
|
|
179
|
+
|
|
176
180
|
function isCompactCommand(text) {
|
|
177
181
|
return String(text || '').trim().toLowerCase() === '/compact';
|
|
178
182
|
}
|
|
@@ -378,6 +382,7 @@ class CodexAdapter {
|
|
|
378
382
|
approvalPolicy: 'never',
|
|
379
383
|
sandbox: 'danger-full-access',
|
|
380
384
|
modelProvider: contract.authMethod === 'amalgm' ? 'amalgm' : 'openai',
|
|
385
|
+
serviceTier: serviceTierForContract(contract),
|
|
381
386
|
developerInstructions: composeSystemPrompt(contract) || null,
|
|
382
387
|
persistExtendedHistory: true,
|
|
383
388
|
};
|
|
@@ -460,6 +465,7 @@ class CodexAdapter {
|
|
|
460
465
|
cwd: contract.cwd,
|
|
461
466
|
model: contract.cliModel.replace(/\/(?:low|medium|high|xhigh)$/i, ''),
|
|
462
467
|
effort: contract.reasoningEffort || undefined,
|
|
468
|
+
serviceTier: serviceTierForContract(contract),
|
|
463
469
|
approvalPolicy: 'never',
|
|
464
470
|
});
|
|
465
471
|
startRequest.then((result) => {
|
|
@@ -504,6 +510,7 @@ module.exports = {
|
|
|
504
510
|
modelWindowConfigLines,
|
|
505
511
|
removeTomlSections,
|
|
506
512
|
removeTopLevelKeys,
|
|
513
|
+
serviceTierForContract,
|
|
507
514
|
writeConfig,
|
|
508
515
|
},
|
|
509
516
|
};
|