mindvest-atlas 0.65.0 → 0.66.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/package.json +1 -1
- package/src/config.js +1 -1
- package/src/helpers/atlas_env.js +31 -4
package/package.json
CHANGED
package/src/config.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import os from 'node:os';
|
|
4
4
|
|
|
5
|
-
export const VERSION = '0.
|
|
5
|
+
export const VERSION = '0.66.0';
|
|
6
6
|
export const DEFAULT_BASE_URL = 'https://atlasmcp.finmanagerai.com';
|
|
7
7
|
export const DEFAULT_SCOPE = 'atlas broker';
|
|
8
8
|
export const CLIENT_NAME = 'Atlas CLI';
|
package/src/helpers/atlas_env.js
CHANGED
|
@@ -346,19 +346,30 @@ export const dashboard = {
|
|
|
346
346
|
* await computer.type("hello");
|
|
347
347
|
* await computer.note("signing in");
|
|
348
348
|
*
|
|
349
|
+
* ONE CALL IS ONE PYTHON. Each of those starts an interpreter, so a sequence of
|
|
350
|
+
* them pays that start-up per click and the run crawls (owner, 2026-09-10: "the
|
|
351
|
+
* slowness is the per command round trip"). Say the whole sequence instead and
|
|
352
|
+
* it is ONE start, with the picture already taken at the end:
|
|
353
|
+
*
|
|
354
|
+
* await computer.do([["click", x, y, "Sign in"],
|
|
355
|
+
* ["type", "someone@example.com"],
|
|
356
|
+
* ["key", "tab"],
|
|
357
|
+
* ["type", secret("PASSWORD")],
|
|
358
|
+
* ["key", "enter"]]);
|
|
359
|
+
*
|
|
349
360
|
* Off until the person turns it on, under This Computer in Atlas Studio. Read skills/computer-use before using any of it.
|
|
350
361
|
*/
|
|
351
|
-
async function useComputer(op, args = []) {
|
|
362
|
+
async function useComputer(op, args = [], kw = {}) {
|
|
352
363
|
const { spawn } = await import("node:child_process");
|
|
353
364
|
const dir = path.dirname(url_.fileURLToPath(import.meta.url));
|
|
354
365
|
const py = process.env.ATLAS_PYTHON || (process.platform === "win32" ? "python" : "python3");
|
|
355
366
|
const code =
|
|
356
367
|
"import json,sys,atlas_env\n"
|
|
357
|
-
+ "op=sys.argv[1]; args=json.loads(sys.argv[2])\n"
|
|
358
|
-
+ "out=getattr(atlas_env,op)(*args)\n"
|
|
368
|
+
+ "op=sys.argv[1]; args=json.loads(sys.argv[2]); kw=json.loads(sys.argv[3])\n"
|
|
369
|
+
+ "out=getattr(atlas_env,op)(*args,**kw)\n"
|
|
359
370
|
+ "sys.stdout.write('\\n__ATLAS__'+json.dumps(out,default=str))\n";
|
|
360
371
|
return await new Promise((done, fail) => {
|
|
361
|
-
const p = spawn(py, ["-c", code, op, JSON.stringify(args)], { cwd: dir });
|
|
372
|
+
const p = spawn(py, ["-c", code, op, JSON.stringify(args), JSON.stringify(kw || {})], { cwd: dir });
|
|
362
373
|
let out = "", err = "";
|
|
363
374
|
p.stdout.on("data", (d) => { out += d; });
|
|
364
375
|
p.stderr.on("data", (d) => { err += d; });
|
|
@@ -392,6 +403,22 @@ export const computer = {
|
|
|
392
403
|
region: (x, y, w, h) => useComputer("region", [x, y, w, h]),
|
|
393
404
|
screens: () => useComputer("screens"),
|
|
394
405
|
useScreen: (n) => useComputer("use_screen", [n]),
|
|
406
|
+
/**
|
|
407
|
+
* SEVERAL THINGS, ONE ROUND TRIP, ONE LOOK AT THE END. The fast loop, and the
|
|
408
|
+
* answer to a run that feels slow: every other call here starts its own
|
|
409
|
+
* Python, so five separate steps pay that five times before anything is even
|
|
410
|
+
* clicked (owner, 2026-09-10: "add option to batch command, this is better").
|
|
411
|
+
*
|
|
412
|
+
* await computer.do([["click", 820, 410, "Sign in"], ["type", "hi"], ["key", "enter"]]);
|
|
413
|
+
* // -> { did: [...], screen: "...png", changed: true, x: 1920, y: 0 }
|
|
414
|
+
*
|
|
415
|
+
* Each step is [name, ...args] with the same names the calls below use.
|
|
416
|
+
* Stops at the first refusal and says what had already happened, with a
|
|
417
|
+
* picture of where it stopped. `settle` is a CEILING in seconds (default 1.2)
|
|
418
|
+
* on waiting for the screen to stop moving, not a pause; `look: false` skips
|
|
419
|
+
* the picture when the next thing you do does not depend on it.
|
|
420
|
+
*/
|
|
421
|
+
do: (steps, opts = {}) => useComputer("do", (steps || []).map((s) => (Array.isArray(s) ? s : [s])), opts),
|
|
395
422
|
click: (x, y) => useComputer("click", [x, y]),
|
|
396
423
|
doubleClick: (x, y) => useComputer("double_click", [x, y]),
|
|
397
424
|
rightClick: (x, y) => useComputer("right_click", [x, y]),
|