@openma/cli 0.6.0 → 0.6.2
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/README.md +17 -0
- package/dist/index.js +134 -48
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -35,6 +35,23 @@ oma api # HTTP API quick reference
|
|
|
35
35
|
|
|
36
36
|
Run `oma --help` for the full command tree.
|
|
37
37
|
|
|
38
|
+
## Local daemon power management
|
|
39
|
+
|
|
40
|
+
`oma bridge daemon` automatically keeps the machine available for local tasks
|
|
41
|
+
while it is running, including while idle and during graceful shutdown. The
|
|
42
|
+
screen can still turn off. No extra switch is required.
|
|
43
|
+
|
|
44
|
+
The adapter uses macOS `caffeinate`, Linux `systemd-inhibit`, or the Windows
|
|
45
|
+
power-management API through PowerShell. It releases the sleep assertion when
|
|
46
|
+
the daemon exits. If the OS denies the request or the helper is missing, the
|
|
47
|
+
daemon logs a warning and retries every 30 seconds. Linux requires logind and
|
|
48
|
+
permission to acquire an inhibitor; explicit sleep and OS policy may override
|
|
49
|
+
power requests.
|
|
50
|
+
|
|
51
|
+
Service-mode process recovery continues to use launchd KeepAlive on macOS and
|
|
52
|
+
systemd Restart=always on Linux. Windows currently installs a logon task, not a
|
|
53
|
+
crash-restart policy. Foreground execution has no external process supervisor.
|
|
54
|
+
|
|
38
55
|
## License
|
|
39
56
|
|
|
40
57
|
MIT
|
package/dist/index.js
CHANGED
|
@@ -4797,7 +4797,7 @@ var init_probe = __esm({
|
|
|
4797
4797
|
}
|
|
4798
4798
|
});
|
|
4799
4799
|
|
|
4800
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
4800
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/key.js
|
|
4801
4801
|
function isKeybinding(value) {
|
|
4802
4802
|
return keybindingLookup.has(value);
|
|
4803
4803
|
}
|
|
@@ -4809,7 +4809,7 @@ function getDefaultKeybindings() {
|
|
|
4809
4809
|
}
|
|
4810
4810
|
var keybindings, keybindingLookup, isUpKey, isDownKey, isSpaceKey, isNumberKey, isEnterKey;
|
|
4811
4811
|
var init_key = __esm({
|
|
4812
|
-
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
4812
|
+
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/key.js"() {
|
|
4813
4813
|
keybindings = ["emacs", "vim"];
|
|
4814
4814
|
keybindingLookup = new Set(keybindings);
|
|
4815
4815
|
isUpKey = (key, keybindings2 = []) => (
|
|
@@ -4830,10 +4830,10 @@ var init_key = __esm({
|
|
|
4830
4830
|
}
|
|
4831
4831
|
});
|
|
4832
4832
|
|
|
4833
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
4833
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/errors.js
|
|
4834
4834
|
var AbortPromptError, CancelPromptError, ExitPromptError, HookError, ValidationError;
|
|
4835
4835
|
var init_errors = __esm({
|
|
4836
|
-
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
4836
|
+
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/errors.js"() {
|
|
4837
4837
|
AbortPromptError = class extends Error {
|
|
4838
4838
|
name = "AbortPromptError";
|
|
4839
4839
|
message = "Prompt was aborted";
|
|
@@ -4858,7 +4858,7 @@ var init_errors = __esm({
|
|
|
4858
4858
|
}
|
|
4859
4859
|
});
|
|
4860
4860
|
|
|
4861
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
4861
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/hook-engine.js
|
|
4862
4862
|
import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
|
|
4863
4863
|
function createStore(rl) {
|
|
4864
4864
|
const store = {
|
|
@@ -4933,7 +4933,7 @@ function handleChange() {
|
|
|
4933
4933
|
}
|
|
4934
4934
|
var hookStorage, effectScheduler;
|
|
4935
4935
|
var init_hook_engine = __esm({
|
|
4936
|
-
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
4936
|
+
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/hook-engine.js"() {
|
|
4937
4937
|
init_errors();
|
|
4938
4938
|
hookStorage = new AsyncLocalStorage();
|
|
4939
4939
|
effectScheduler = {
|
|
@@ -4970,7 +4970,7 @@ var init_hook_engine = __esm({
|
|
|
4970
4970
|
}
|
|
4971
4971
|
});
|
|
4972
4972
|
|
|
4973
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
4973
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
4974
4974
|
import { AsyncResource as AsyncResource2 } from "node:async_hooks";
|
|
4975
4975
|
function isFactory(value) {
|
|
4976
4976
|
return typeof value === "function";
|
|
@@ -4992,12 +4992,12 @@ function useState(defaultValue) {
|
|
|
4992
4992
|
});
|
|
4993
4993
|
}
|
|
4994
4994
|
var init_use_state = __esm({
|
|
4995
|
-
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
4995
|
+
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/use-state.js"() {
|
|
4996
4996
|
init_hook_engine();
|
|
4997
4997
|
}
|
|
4998
4998
|
});
|
|
4999
4999
|
|
|
5000
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
5000
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/use-effect.js
|
|
5001
5001
|
function useEffect(cb, depArray) {
|
|
5002
5002
|
withPointer((pointer) => {
|
|
5003
5003
|
const oldDeps = pointer.get();
|
|
@@ -5009,7 +5009,7 @@ function useEffect(cb, depArray) {
|
|
|
5009
5009
|
});
|
|
5010
5010
|
}
|
|
5011
5011
|
var init_use_effect = __esm({
|
|
5012
|
-
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
5012
|
+
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/use-effect.js"() {
|
|
5013
5013
|
init_hook_engine();
|
|
5014
5014
|
}
|
|
5015
5015
|
});
|
|
@@ -5312,7 +5312,7 @@ var init_dist = __esm({
|
|
|
5312
5312
|
}
|
|
5313
5313
|
});
|
|
5314
5314
|
|
|
5315
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
5315
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/theme.js
|
|
5316
5316
|
import { styleText } from "node:util";
|
|
5317
5317
|
function getDefaultTheme() {
|
|
5318
5318
|
return {
|
|
@@ -5322,7 +5322,7 @@ function getDefaultTheme() {
|
|
|
5322
5322
|
}
|
|
5323
5323
|
var defaultTheme;
|
|
5324
5324
|
var init_theme = __esm({
|
|
5325
|
-
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
5325
|
+
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/theme.js"() {
|
|
5326
5326
|
init_dist();
|
|
5327
5327
|
init_key();
|
|
5328
5328
|
defaultTheme = {
|
|
@@ -5348,7 +5348,7 @@ var init_theme = __esm({
|
|
|
5348
5348
|
}
|
|
5349
5349
|
});
|
|
5350
5350
|
|
|
5351
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
5351
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/make-theme.js
|
|
5352
5352
|
function isPlainObject(value) {
|
|
5353
5353
|
if (typeof value !== "object" || value === null)
|
|
5354
5354
|
return false;
|
|
@@ -5376,12 +5376,12 @@ function makeTheme(...themes) {
|
|
|
5376
5376
|
return deepMerge(...themesToMerge);
|
|
5377
5377
|
}
|
|
5378
5378
|
var init_make_theme = __esm({
|
|
5379
|
-
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
5379
|
+
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/make-theme.js"() {
|
|
5380
5380
|
init_theme();
|
|
5381
5381
|
}
|
|
5382
5382
|
});
|
|
5383
5383
|
|
|
5384
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
5384
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/use-prefix.js
|
|
5385
5385
|
function usePrefix({ status = "idle", theme }) {
|
|
5386
5386
|
const [showLoader, setShowLoader] = useState(false);
|
|
5387
5387
|
const [tick, setTick] = useState(0);
|
|
@@ -5412,14 +5412,14 @@ function usePrefix({ status = "idle", theme }) {
|
|
|
5412
5412
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
|
5413
5413
|
}
|
|
5414
5414
|
var init_use_prefix = __esm({
|
|
5415
|
-
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
5415
|
+
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/use-prefix.js"() {
|
|
5416
5416
|
init_use_state();
|
|
5417
5417
|
init_use_effect();
|
|
5418
5418
|
init_make_theme();
|
|
5419
5419
|
}
|
|
5420
5420
|
});
|
|
5421
5421
|
|
|
5422
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
5422
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/use-memo.js
|
|
5423
5423
|
function useMemo(fn, dependencies) {
|
|
5424
5424
|
return withPointer((pointer) => {
|
|
5425
5425
|
const prev = pointer.get();
|
|
@@ -5432,22 +5432,22 @@ function useMemo(fn, dependencies) {
|
|
|
5432
5432
|
});
|
|
5433
5433
|
}
|
|
5434
5434
|
var init_use_memo = __esm({
|
|
5435
|
-
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
5435
|
+
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/use-memo.js"() {
|
|
5436
5436
|
init_hook_engine();
|
|
5437
5437
|
}
|
|
5438
5438
|
});
|
|
5439
5439
|
|
|
5440
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
5440
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/use-ref.js
|
|
5441
5441
|
function useRef(val) {
|
|
5442
5442
|
return useState({ current: val })[0];
|
|
5443
5443
|
}
|
|
5444
5444
|
var init_use_ref = __esm({
|
|
5445
|
-
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
5445
|
+
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/use-ref.js"() {
|
|
5446
5446
|
init_use_state();
|
|
5447
5447
|
}
|
|
5448
5448
|
});
|
|
5449
5449
|
|
|
5450
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
5450
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/use-keypress.js
|
|
5451
5451
|
function useKeypress(userHandler) {
|
|
5452
5452
|
const signal = useRef(userHandler);
|
|
5453
5453
|
signal.current = userHandler;
|
|
@@ -5466,7 +5466,7 @@ function useKeypress(userHandler) {
|
|
|
5466
5466
|
}, []);
|
|
5467
5467
|
}
|
|
5468
5468
|
var init_use_keypress = __esm({
|
|
5469
|
-
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
5469
|
+
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/use-keypress.js"() {
|
|
5470
5470
|
init_use_ref();
|
|
5471
5471
|
init_use_effect();
|
|
5472
5472
|
init_hook_engine();
|
|
@@ -5875,7 +5875,7 @@ var init_main = __esm({
|
|
|
5875
5875
|
}
|
|
5876
5876
|
});
|
|
5877
5877
|
|
|
5878
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
5878
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/utils.js
|
|
5879
5879
|
function breakLines(content, width) {
|
|
5880
5880
|
return content.split("\n").flatMap((line) => wrapAnsi(line, width, { trim: false, wordWrap: false }).split("\n").map((str) => str.trimEnd())).join("\n");
|
|
5881
5881
|
}
|
|
@@ -5884,14 +5884,14 @@ function readlineWidth() {
|
|
|
5884
5884
|
}
|
|
5885
5885
|
var import_cli_width;
|
|
5886
5886
|
var init_utils2 = __esm({
|
|
5887
|
-
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
5887
|
+
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/utils.js"() {
|
|
5888
5888
|
import_cli_width = __toESM(require_cli_width(), 1);
|
|
5889
5889
|
init_main();
|
|
5890
5890
|
init_hook_engine();
|
|
5891
5891
|
}
|
|
5892
5892
|
});
|
|
5893
5893
|
|
|
5894
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
5894
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
|
|
5895
5895
|
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
|
5896
5896
|
const state = useRef({
|
|
5897
5897
|
lastPointer: active,
|
|
@@ -5980,7 +5980,7 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
|
5980
5980
|
return pageBuffer.filter((line) => typeof line === "string").join("\n");
|
|
5981
5981
|
}
|
|
5982
5982
|
var init_use_pagination = __esm({
|
|
5983
|
-
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
5983
|
+
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js"() {
|
|
5984
5984
|
init_use_ref();
|
|
5985
5985
|
init_utils2();
|
|
5986
5986
|
}
|
|
@@ -6397,11 +6397,11 @@ var init_dist4 = __esm({
|
|
|
6397
6397
|
}
|
|
6398
6398
|
});
|
|
6399
6399
|
|
|
6400
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
6400
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
6401
6401
|
import { stripVTControlCharacters } from "node:util";
|
|
6402
6402
|
var height, lastLine, ScreenManager;
|
|
6403
6403
|
var init_screen_manager = __esm({
|
|
6404
|
-
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
6404
|
+
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/screen-manager.js"() {
|
|
6405
6405
|
init_utils2();
|
|
6406
6406
|
init_dist4();
|
|
6407
6407
|
height = (content) => content.split("\n").length;
|
|
@@ -6466,10 +6466,10 @@ var init_screen_manager = __esm({
|
|
|
6466
6466
|
}
|
|
6467
6467
|
});
|
|
6468
6468
|
|
|
6469
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
6469
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/promise-polyfill.js
|
|
6470
6470
|
var PromisePolyfill;
|
|
6471
6471
|
var init_promise_polyfill = __esm({
|
|
6472
|
-
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
6472
|
+
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/promise-polyfill.js"() {
|
|
6473
6473
|
PromisePolyfill = class extends Promise {
|
|
6474
6474
|
// Available starting from Node 22
|
|
6475
6475
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers
|
|
@@ -6486,7 +6486,7 @@ var init_promise_polyfill = __esm({
|
|
|
6486
6486
|
}
|
|
6487
6487
|
});
|
|
6488
6488
|
|
|
6489
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
6489
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
6490
6490
|
import * as readline2 from "node:readline";
|
|
6491
6491
|
import { AsyncResource as AsyncResource3 } from "node:async_hooks";
|
|
6492
6492
|
import path from "node:path";
|
|
@@ -6600,7 +6600,7 @@ function createPrompt(view) {
|
|
|
6600
6600
|
}
|
|
6601
6601
|
var import_mute_stream, nativeSetImmediate;
|
|
6602
6602
|
var init_create_prompt = __esm({
|
|
6603
|
-
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
6603
|
+
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/create-prompt.js"() {
|
|
6604
6604
|
import_mute_stream = __toESM(require_lib(), 1);
|
|
6605
6605
|
init_mjs();
|
|
6606
6606
|
init_screen_manager();
|
|
@@ -6611,11 +6611,11 @@ var init_create_prompt = __esm({
|
|
|
6611
6611
|
}
|
|
6612
6612
|
});
|
|
6613
6613
|
|
|
6614
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
6614
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/Separator.js
|
|
6615
6615
|
import { styleText as styleText2 } from "node:util";
|
|
6616
6616
|
var Separator;
|
|
6617
6617
|
var init_Separator = __esm({
|
|
6618
|
-
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
6618
|
+
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/lib/Separator.js"() {
|
|
6619
6619
|
init_dist();
|
|
6620
6620
|
Separator = class {
|
|
6621
6621
|
separator = styleText2("dim", Array.from({ length: 15 }).join(dist_default.line));
|
|
@@ -6632,9 +6632,9 @@ var init_Separator = __esm({
|
|
|
6632
6632
|
}
|
|
6633
6633
|
});
|
|
6634
6634
|
|
|
6635
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
6635
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/index.js
|
|
6636
6636
|
var init_dist5 = __esm({
|
|
6637
|
-
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.
|
|
6637
|
+
"../../node_modules/.pnpm/@inquirer+core@11.2.1_@types+node@26.6.3/node_modules/@inquirer/core/dist/index.js"() {
|
|
6638
6638
|
init_key();
|
|
6639
6639
|
init_errors();
|
|
6640
6640
|
init_use_prefix();
|
|
@@ -6648,7 +6648,7 @@ var init_dist5 = __esm({
|
|
|
6648
6648
|
}
|
|
6649
6649
|
});
|
|
6650
6650
|
|
|
6651
|
-
// ../../node_modules/.pnpm/@inquirer+checkbox@5.2.1_@types+node@26.
|
|
6651
|
+
// ../../node_modules/.pnpm/@inquirer+checkbox@5.2.1_@types+node@26.6.3/node_modules/@inquirer/checkbox/dist/index.js
|
|
6652
6652
|
import { styleText as styleText3 } from "node:util";
|
|
6653
6653
|
function isSelectable(item) {
|
|
6654
6654
|
return !Separator.isSeparator(item) && !item.disabled;
|
|
@@ -6699,7 +6699,7 @@ function normalizeChoices(choices) {
|
|
|
6699
6699
|
}
|
|
6700
6700
|
var checkboxTheme, dist_default4;
|
|
6701
6701
|
var init_dist6 = __esm({
|
|
6702
|
-
"../../node_modules/.pnpm/@inquirer+checkbox@5.2.1_@types+node@26.
|
|
6702
|
+
"../../node_modules/.pnpm/@inquirer+checkbox@5.2.1_@types+node@26.6.3/node_modules/@inquirer/checkbox/dist/index.js"() {
|
|
6703
6703
|
init_dist5();
|
|
6704
6704
|
init_dist4();
|
|
6705
6705
|
init_dist();
|
|
@@ -7517,6 +7517,83 @@ var init_setup = __esm({
|
|
|
7517
7517
|
}
|
|
7518
7518
|
});
|
|
7519
7519
|
|
|
7520
|
+
// src/bridge/lib/keep-awake.ts
|
|
7521
|
+
import { spawn as spawn8 } from "node:child_process";
|
|
7522
|
+
function keepAwakeCommand(platform2, pid, node) {
|
|
7523
|
+
if (platform2 === "darwin") return { command: "/usr/bin/caffeinate", args: ["-i", "-w", String(pid)] };
|
|
7524
|
+
if (platform2 === "linux") return {
|
|
7525
|
+
command: "systemd-inhibit",
|
|
7526
|
+
args: [
|
|
7527
|
+
"--what=idle:sleep",
|
|
7528
|
+
"--who=OpenMA",
|
|
7529
|
+
"--why=OpenMA runner is available for local tasks",
|
|
7530
|
+
"--mode=block",
|
|
7531
|
+
node,
|
|
7532
|
+
"-e",
|
|
7533
|
+
'process.stdin.resume(); process.stdin.on("end", () => process.exit(0));'
|
|
7534
|
+
]
|
|
7535
|
+
};
|
|
7536
|
+
if (platform2 === "win32") return {
|
|
7537
|
+
command: "powershell.exe",
|
|
7538
|
+
args: ["-NoLogo", "-NoProfile", "-NonInteractive", "-Command", `
|
|
7539
|
+
$ErrorActionPreference = 'Stop'
|
|
7540
|
+
Add-Type -TypeDefinition 'using System; using System.Runtime.InteropServices; public static class OpenMAPower { [DllImport("kernel32.dll")] public static extern uint SetThreadExecutionState(uint flags); }'
|
|
7541
|
+
if ([OpenMAPower]::SetThreadExecutionState([uint32]2147483649) -eq 0) { throw 'Cannot prevent system idle sleep' }
|
|
7542
|
+
try { [Console]::In.ReadToEnd() | Out-Null } finally { [OpenMAPower]::SetThreadExecutionState([uint32]2147483648) | Out-Null }
|
|
7543
|
+
`]
|
|
7544
|
+
};
|
|
7545
|
+
return null;
|
|
7546
|
+
}
|
|
7547
|
+
function startKeepAwake(options) {
|
|
7548
|
+
const command = keepAwakeCommand(options.platform ?? process.platform, process.pid, process.execPath);
|
|
7549
|
+
if (!command) {
|
|
7550
|
+
options.warn("Automatic sleep prevention is unavailable on this platform");
|
|
7551
|
+
return () => {
|
|
7552
|
+
};
|
|
7553
|
+
}
|
|
7554
|
+
let stopped = false;
|
|
7555
|
+
let child;
|
|
7556
|
+
let retry;
|
|
7557
|
+
const launch = () => {
|
|
7558
|
+
if (stopped) return;
|
|
7559
|
+
let finished = false;
|
|
7560
|
+
const failed = () => {
|
|
7561
|
+
if (finished || stopped) return;
|
|
7562
|
+
finished = true;
|
|
7563
|
+
child = void 0;
|
|
7564
|
+
options.warn("Sleep prevention helper unavailable or exited; retrying in 30s. The OS may allow this runner to sleep.");
|
|
7565
|
+
retry = setTimeout(launch, 3e4);
|
|
7566
|
+
retry.unref();
|
|
7567
|
+
};
|
|
7568
|
+
try {
|
|
7569
|
+
child = (options.spawn ?? spawn8)(command.command, command.args, {
|
|
7570
|
+
stdio: ["pipe", "ignore", "ignore"],
|
|
7571
|
+
windowsHide: true
|
|
7572
|
+
});
|
|
7573
|
+
child.stdin?.on("error", () => {
|
|
7574
|
+
});
|
|
7575
|
+
child.once("error", failed);
|
|
7576
|
+
child.once("exit", failed);
|
|
7577
|
+
} catch {
|
|
7578
|
+
failed();
|
|
7579
|
+
}
|
|
7580
|
+
};
|
|
7581
|
+
launch();
|
|
7582
|
+
return () => {
|
|
7583
|
+
if (stopped) return;
|
|
7584
|
+
stopped = true;
|
|
7585
|
+
if (retry) clearTimeout(retry);
|
|
7586
|
+
child?.stdin?.end();
|
|
7587
|
+
if ((options.platform ?? process.platform) !== "linux") child?.kill();
|
|
7588
|
+
child = void 0;
|
|
7589
|
+
};
|
|
7590
|
+
}
|
|
7591
|
+
var init_keep_awake = __esm({
|
|
7592
|
+
"src/bridge/lib/keep-awake.ts"() {
|
|
7593
|
+
"use strict";
|
|
7594
|
+
}
|
|
7595
|
+
});
|
|
7596
|
+
|
|
7520
7597
|
// ../../node_modules/.pnpm/@openma+common@https+++codeload.github.com+openma-ai+openma-common+tar.gz+e196bdcac3d5f_8dd65d357989ef6fbff39c697b76e639/node_modules/@openma/common/dist/local-runtime/session-host.js
|
|
7521
7598
|
var systemRuntimeScheduler, ManagedAgentsSessionHost;
|
|
7522
7599
|
var init_session_host = __esm({
|
|
@@ -25570,6 +25647,10 @@ async function ensureSessionCwd(sessionId) {
|
|
|
25570
25647
|
await mkdir6(cwd, { recursive: true });
|
|
25571
25648
|
return cwd;
|
|
25572
25649
|
}
|
|
25650
|
+
function acpProcessCwd(scratchDir, requestedCwd) {
|
|
25651
|
+
const requested = requestedCwd?.trim();
|
|
25652
|
+
return requested ? requested : scratchDir;
|
|
25653
|
+
}
|
|
25573
25654
|
async function writeBundle(cwd, files) {
|
|
25574
25655
|
for (const f of files) {
|
|
25575
25656
|
if (f.path.startsWith("/") || f.path.includes("..")) continue;
|
|
@@ -25881,14 +25962,15 @@ var init_session_manager = __esm({
|
|
|
25881
25962
|
});
|
|
25882
25963
|
return;
|
|
25883
25964
|
}
|
|
25884
|
-
const
|
|
25965
|
+
const scratchDir = await ensureSessionCwd(p.session_id);
|
|
25966
|
+
const processCwd = acpProcessCwd(scratchDir, p.cwd);
|
|
25885
25967
|
let blocklist = [];
|
|
25886
25968
|
let bundleMcpServers = [];
|
|
25887
25969
|
let bundleEnv = [];
|
|
25888
25970
|
try {
|
|
25889
25971
|
const bundle = await this.#fetchBundle(p.session_id, agent.id);
|
|
25890
25972
|
if (bundle) {
|
|
25891
|
-
await writeBundle(
|
|
25973
|
+
await writeBundle(scratchDir, bundle.files);
|
|
25892
25974
|
blocklist = bundle.local_skill_blocklist ?? [];
|
|
25893
25975
|
bundleMcpServers = bundle.mcp_servers ?? [];
|
|
25894
25976
|
bundleEnv = bundle.env ?? [];
|
|
@@ -25900,7 +25982,7 @@ var init_session_manager = __esm({
|
|
|
25900
25982
|
const extraEnv = {};
|
|
25901
25983
|
if (agent.id === "claude-acp") {
|
|
25902
25984
|
try {
|
|
25903
|
-
const cfgDir = await setupClaudeConfigDir(
|
|
25985
|
+
const cfgDir = await setupClaudeConfigDir(scratchDir, new Set(blocklist));
|
|
25904
25986
|
extraEnv.CLAUDE_CONFIG_DIR = cfgDir;
|
|
25905
25987
|
} catch (e) {
|
|
25906
25988
|
process.stderr.write(
|
|
@@ -25918,7 +26000,7 @@ var init_session_manager = __esm({
|
|
|
25918
26000
|
headers: tenantKey ? [{ name: "Authorization", value: `Bearer ${tenantKey}` }] : []
|
|
25919
26001
|
}));
|
|
25920
26002
|
process.stderr.write(
|
|
25921
|
-
` \u2192 SessionManager.start ${agent.spec.command} cwd=${
|
|
26003
|
+
` \u2192 SessionManager.start ${agent.spec.command} cwd=${processCwd}` + (processCwd === scratchDir ? "" : ` scratch=${scratchDir}`) + (extraEnv.CLAUDE_CONFIG_DIR ? ` cfg=${extraEnv.CLAUDE_CONFIG_DIR}` : "") + (blocklist.length ? ` blocklist=${blocklist.length}` : "") + (mcpServersForAcp.length ? ` mcp=${mcpServersForAcp.length}` : "") + (bundleEnv.length ? ` env=${bundleEnv.length}` : "") + // Intentionally NOT logging env names or values — these come from
|
|
25922
26004
|
// user-supplied session resources and may be sensitive even if not
|
|
25923
26005
|
// formally encrypted. Only the count is observable.
|
|
25924
26006
|
"\n"
|
|
@@ -25927,7 +26009,7 @@ var init_session_manager = __esm({
|
|
|
25927
26009
|
const session = await this.#runtime.start({
|
|
25928
26010
|
agent: {
|
|
25929
26011
|
...agent.spec,
|
|
25930
|
-
cwd:
|
|
26012
|
+
cwd: processCwd,
|
|
25931
26013
|
env: scrubAcpSpawnEnv({ ...agent.spec.env ?? {}, ...envFromBundle, ...extraEnv })
|
|
25932
26014
|
},
|
|
25933
26015
|
mcpServers: mcpServersForAcp,
|
|
@@ -26188,7 +26270,8 @@ async function prepareNodeSession(input) {
|
|
|
26188
26270
|
`binary not on PATH for ${agent.id}: \`${agent.spec.command}\`` + (agent.installHint ? `. Install: ${agent.installHint}` : "")
|
|
26189
26271
|
);
|
|
26190
26272
|
}
|
|
26191
|
-
const
|
|
26273
|
+
const scratchDir = await ensureSessionCwd(input.command.sessionId);
|
|
26274
|
+
const processCwd = acpProcessCwd(scratchDir, input.command.cwd);
|
|
26192
26275
|
let blocklist = [];
|
|
26193
26276
|
let bundleMcpServers = [];
|
|
26194
26277
|
let bundleEnv = [];
|
|
@@ -26199,7 +26282,7 @@ async function prepareNodeSession(input) {
|
|
|
26199
26282
|
agent.id
|
|
26200
26283
|
);
|
|
26201
26284
|
if (bundle) {
|
|
26202
|
-
await writeBundle(
|
|
26285
|
+
await writeBundle(scratchDir, bundle.files);
|
|
26203
26286
|
blocklist = bundle.local_skill_blocklist ?? [];
|
|
26204
26287
|
bundleMcpServers = bundle.mcp_servers ?? [];
|
|
26205
26288
|
bundleEnv = bundle.env ?? [];
|
|
@@ -26214,7 +26297,7 @@ async function prepareNodeSession(input) {
|
|
|
26214
26297
|
if (agent.id === "claude-acp") {
|
|
26215
26298
|
try {
|
|
26216
26299
|
extraEnv.CLAUDE_CONFIG_DIR = await setupClaudeConfigDir(
|
|
26217
|
-
|
|
26300
|
+
scratchDir,
|
|
26218
26301
|
new Set(blocklist)
|
|
26219
26302
|
);
|
|
26220
26303
|
} catch (error40) {
|
|
@@ -26238,12 +26321,12 @@ async function prepareNodeSession(input) {
|
|
|
26238
26321
|
}]
|
|
26239
26322
|
}));
|
|
26240
26323
|
process.stderr.write(
|
|
26241
|
-
` \u2192 SessionManager.start ${agent.spec.command} cwd=${
|
|
26324
|
+
` \u2192 SessionManager.start ${agent.spec.command} cwd=${processCwd}` + (processCwd === scratchDir ? "" : ` scratch=${scratchDir}`) + (extraEnv.CLAUDE_CONFIG_DIR ? ` cfg=${extraEnv.CLAUDE_CONFIG_DIR}` : "") + (blocklist.length ? ` blocklist=${blocklist.length}` : "") + (mcpServers.length ? ` mcp=${mcpServers.length}` : "") + (bundleEnv.length ? ` env=${bundleEnv.length}` : "") + "\n"
|
|
26242
26325
|
);
|
|
26243
26326
|
return {
|
|
26244
26327
|
agent: {
|
|
26245
26328
|
...agent.spec,
|
|
26246
|
-
cwd:
|
|
26329
|
+
cwd: processCwd,
|
|
26247
26330
|
env: scrubAcpSpawnEnv2({
|
|
26248
26331
|
...agent.spec.env ?? {},
|
|
26249
26332
|
...envFromBundle,
|
|
@@ -26667,6 +26750,7 @@ async function runDaemon() {
|
|
|
26667
26750
|
process.on("SIGTERM", onTerminate);
|
|
26668
26751
|
process.on("SIGINT", onInterrupt);
|
|
26669
26752
|
process.on("SIGHUP", onRefresh);
|
|
26753
|
+
const stopKeepAwake = startKeepAwake({ warn: (message) => log.warn(message) });
|
|
26670
26754
|
const pidPath = join8(paths().configDir, "daemon.pid");
|
|
26671
26755
|
try {
|
|
26672
26756
|
try {
|
|
@@ -26678,6 +26762,7 @@ async function runDaemon() {
|
|
|
26678
26762
|
host.start();
|
|
26679
26763
|
await stopped;
|
|
26680
26764
|
} finally {
|
|
26765
|
+
stopKeepAwake();
|
|
26681
26766
|
process.off("SIGTERM", onTerminate);
|
|
26682
26767
|
process.off("SIGINT", onInterrupt);
|
|
26683
26768
|
process.off("SIGHUP", onRefresh);
|
|
@@ -26692,6 +26777,7 @@ async function runDaemon() {
|
|
|
26692
26777
|
var init_daemon = __esm({
|
|
26693
26778
|
"src/bridge/commands/daemon.ts"() {
|
|
26694
26779
|
"use strict";
|
|
26780
|
+
init_keep_awake();
|
|
26695
26781
|
init_local_runtime();
|
|
26696
26782
|
init_config();
|
|
26697
26783
|
init_platform();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openma/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "CLI for the openma managed agents platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -37,16 +37,16 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@inquirer/checkbox": "^5.2.1",
|
|
39
39
|
"@openma/common": "git+https://github.com/openma-ai/openma-common.git#e196bdcac3d5f3165d6833c2531d4255a51620e9",
|
|
40
|
-
"@types/node": "^26.
|
|
40
|
+
"@types/node": "^26.6.3",
|
|
41
41
|
"@types/ws": "^8.5.0",
|
|
42
42
|
"esbuild": "^0.25.0",
|
|
43
43
|
"tsx": "^4.19.0",
|
|
44
44
|
"typescript": "^7.0.2",
|
|
45
45
|
"vitest": "^4.1.3",
|
|
46
46
|
"ws": "^8.18.0",
|
|
47
|
+
"@open-managed-agents/acp-runtime": "0.0.0",
|
|
47
48
|
"@open-managed-agents/api-types": "0.1.0",
|
|
48
|
-
"@open-managed-agents/runtime": "0.1.0"
|
|
49
|
-
"@open-managed-agents/acp-runtime": "0.0.0"
|
|
49
|
+
"@open-managed-agents/runtime": "0.1.0"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "esbuild src/index.ts --bundle --platform=node --format=esm --outfile=dist/index.js --banner:js=\"#!/usr/bin/env node\nimport { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);\"",
|