@openma/cli 0.6.1 → 0.6.3
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/index.js +102 -60
- package/package.json +4 -4
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();
|
|
@@ -25642,11 +25642,30 @@ function dirNameFor(sessionId) {
|
|
|
25642
25642
|
if (/^[a-f0-9]{1,12}$/i.test(sessionId)) return sessionId.toLowerCase();
|
|
25643
25643
|
return createHash("sha256").update(sessionId).digest("hex").slice(0, DIR_NAME_LEN);
|
|
25644
25644
|
}
|
|
25645
|
+
function sessionScratchDirPath(sessionId) {
|
|
25646
|
+
return join5(paths().sessionsDir, dirNameFor(sessionId));
|
|
25647
|
+
}
|
|
25645
25648
|
async function ensureSessionCwd(sessionId) {
|
|
25646
|
-
const cwd =
|
|
25649
|
+
const cwd = sessionScratchDirPath(sessionId);
|
|
25647
25650
|
await mkdir6(cwd, { recursive: true });
|
|
25648
25651
|
return cwd;
|
|
25649
25652
|
}
|
|
25653
|
+
function acpProcessCwd(scratchDir, requestedCwd) {
|
|
25654
|
+
const requested = requestedCwd?.trim();
|
|
25655
|
+
return requested ? requested : scratchDir;
|
|
25656
|
+
}
|
|
25657
|
+
function acpSessionReadyOut(params) {
|
|
25658
|
+
const base = {
|
|
25659
|
+
type: "session.ready",
|
|
25660
|
+
session_id: params.session_id,
|
|
25661
|
+
tenant_id: params.tenant_id,
|
|
25662
|
+
acp_session_id: params.acp_session_id
|
|
25663
|
+
};
|
|
25664
|
+
if (params.freshSpawn && params.scratchDir) {
|
|
25665
|
+
return { ...base, bundle_dir: params.scratchDir, fresh: true };
|
|
25666
|
+
}
|
|
25667
|
+
return base;
|
|
25668
|
+
}
|
|
25650
25669
|
async function writeBundle(cwd, files) {
|
|
25651
25670
|
for (const f of files) {
|
|
25652
25671
|
if (f.path.startsWith("/") || f.path.includes("..")) continue;
|
|
@@ -25777,6 +25796,8 @@ var init_session_manager = __esm({
|
|
|
25777
25796
|
* doesn't hit "session not ready" mid-stream just because the daemon
|
|
25778
25797
|
* is on its way out. */
|
|
25779
25798
|
#draining = false;
|
|
25799
|
+
/** Sessions awaiting their first session.ready on the managed runtime path. */
|
|
25800
|
+
#freshSpawnPending = /* @__PURE__ */ new Set();
|
|
25780
25801
|
constructor(send, runtimeDependencies) {
|
|
25781
25802
|
this.#send = send;
|
|
25782
25803
|
if (runtimeDependencies) {
|
|
@@ -25809,11 +25830,25 @@ var init_session_manager = __esm({
|
|
|
25809
25830
|
}
|
|
25810
25831
|
#publishManagedRuntimeEvent(event) {
|
|
25811
25832
|
const scope = this.#runtimeScopes.get(event.sessionId);
|
|
25812
|
-
this.#
|
|
25813
|
-
|
|
25814
|
-
|
|
25833
|
+
if (event.type === "session.ready" && this.#freshSpawnPending.delete(event.sessionId)) {
|
|
25834
|
+
this.#send(acpSessionReadyOut({
|
|
25835
|
+
session_id: event.sessionId,
|
|
25836
|
+
tenant_id: scope?.id ?? "",
|
|
25837
|
+
acp_session_id: event.acpSessionId,
|
|
25838
|
+
scratchDir: sessionScratchDirPath(event.sessionId),
|
|
25839
|
+
freshSpawn: true
|
|
25840
|
+
}));
|
|
25841
|
+
} else {
|
|
25842
|
+
this.#send(encodeSessionHostEvent(event, {
|
|
25843
|
+
tenantId: scope?.id
|
|
25844
|
+
}));
|
|
25845
|
+
}
|
|
25815
25846
|
if (event.type === "session.disposed") {
|
|
25816
25847
|
this.#runtimeScopes.delete(event.sessionId);
|
|
25848
|
+
this.#freshSpawnPending.delete(event.sessionId);
|
|
25849
|
+
}
|
|
25850
|
+
if (event.type === "session.error") {
|
|
25851
|
+
this.#freshSpawnPending.delete(event.sessionId);
|
|
25817
25852
|
}
|
|
25818
25853
|
}
|
|
25819
25854
|
setSpawnEnv(env) {
|
|
@@ -25863,7 +25898,11 @@ var init_session_manager = __esm({
|
|
|
25863
25898
|
return;
|
|
25864
25899
|
}
|
|
25865
25900
|
for (const [session_id, sess] of this.#sessions) {
|
|
25866
|
-
this.#send({
|
|
25901
|
+
this.#send(acpSessionReadyOut({
|
|
25902
|
+
session_id,
|
|
25903
|
+
tenant_id: sess.tenantId,
|
|
25904
|
+
acp_session_id: sess.acpSessionId
|
|
25905
|
+
}));
|
|
25867
25906
|
}
|
|
25868
25907
|
}
|
|
25869
25908
|
async start(p) {
|
|
@@ -25908,6 +25947,7 @@ var init_session_manager = __esm({
|
|
|
25908
25947
|
id: tenantId,
|
|
25909
25948
|
agentApiKey: tenantKey
|
|
25910
25949
|
});
|
|
25950
|
+
this.#freshSpawnPending.add(p.session_id);
|
|
25911
25951
|
}
|
|
25912
25952
|
await this.#managedRuntime.dispatch({
|
|
25913
25953
|
type: "session.start",
|
|
@@ -25921,12 +25961,11 @@ var init_session_manager = __esm({
|
|
|
25921
25961
|
}
|
|
25922
25962
|
const existing = this.#sessions.get(p.session_id);
|
|
25923
25963
|
if (existing) {
|
|
25924
|
-
this.#send({
|
|
25925
|
-
type: "session.ready",
|
|
25964
|
+
this.#send(acpSessionReadyOut({
|
|
25926
25965
|
session_id: p.session_id,
|
|
25927
25966
|
tenant_id: existing.tenantId,
|
|
25928
25967
|
acp_session_id: existing.acpSessionId
|
|
25929
|
-
});
|
|
25968
|
+
}));
|
|
25930
25969
|
return;
|
|
25931
25970
|
}
|
|
25932
25971
|
const agent = resolveKnownAgent(p.agent_id);
|
|
@@ -25958,14 +25997,15 @@ var init_session_manager = __esm({
|
|
|
25958
25997
|
});
|
|
25959
25998
|
return;
|
|
25960
25999
|
}
|
|
25961
|
-
const
|
|
26000
|
+
const scratchDir = await ensureSessionCwd(p.session_id);
|
|
26001
|
+
const processCwd = acpProcessCwd(scratchDir, p.cwd);
|
|
25962
26002
|
let blocklist = [];
|
|
25963
26003
|
let bundleMcpServers = [];
|
|
25964
26004
|
let bundleEnv = [];
|
|
25965
26005
|
try {
|
|
25966
26006
|
const bundle = await this.#fetchBundle(p.session_id, agent.id);
|
|
25967
26007
|
if (bundle) {
|
|
25968
|
-
await writeBundle(
|
|
26008
|
+
await writeBundle(scratchDir, bundle.files);
|
|
25969
26009
|
blocklist = bundle.local_skill_blocklist ?? [];
|
|
25970
26010
|
bundleMcpServers = bundle.mcp_servers ?? [];
|
|
25971
26011
|
bundleEnv = bundle.env ?? [];
|
|
@@ -25977,7 +26017,7 @@ var init_session_manager = __esm({
|
|
|
25977
26017
|
const extraEnv = {};
|
|
25978
26018
|
if (agent.id === "claude-acp") {
|
|
25979
26019
|
try {
|
|
25980
|
-
const cfgDir = await setupClaudeConfigDir(
|
|
26020
|
+
const cfgDir = await setupClaudeConfigDir(scratchDir, new Set(blocklist));
|
|
25981
26021
|
extraEnv.CLAUDE_CONFIG_DIR = cfgDir;
|
|
25982
26022
|
} catch (e) {
|
|
25983
26023
|
process.stderr.write(
|
|
@@ -25995,7 +26035,7 @@ var init_session_manager = __esm({
|
|
|
25995
26035
|
headers: tenantKey ? [{ name: "Authorization", value: `Bearer ${tenantKey}` }] : []
|
|
25996
26036
|
}));
|
|
25997
26037
|
process.stderr.write(
|
|
25998
|
-
` \u2192 SessionManager.start ${agent.spec.command} cwd=${
|
|
26038
|
+
` \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
|
|
25999
26039
|
// user-supplied session resources and may be sensitive even if not
|
|
26000
26040
|
// formally encrypted. Only the count is observable.
|
|
26001
26041
|
"\n"
|
|
@@ -26004,7 +26044,7 @@ var init_session_manager = __esm({
|
|
|
26004
26044
|
const session = await this.#runtime.start({
|
|
26005
26045
|
agent: {
|
|
26006
26046
|
...agent.spec,
|
|
26007
|
-
cwd:
|
|
26047
|
+
cwd: processCwd,
|
|
26008
26048
|
env: scrubAcpSpawnEnv({ ...agent.spec.env ?? {}, ...envFromBundle, ...extraEnv })
|
|
26009
26049
|
},
|
|
26010
26050
|
mcpServers: mcpServersForAcp,
|
|
@@ -26016,12 +26056,13 @@ var init_session_manager = __esm({
|
|
|
26016
26056
|
tenantId,
|
|
26017
26057
|
turns: /* @__PURE__ */ new Map()
|
|
26018
26058
|
});
|
|
26019
|
-
this.#send({
|
|
26020
|
-
type: "session.ready",
|
|
26059
|
+
this.#send(acpSessionReadyOut({
|
|
26021
26060
|
session_id: p.session_id,
|
|
26022
26061
|
tenant_id: tenantId,
|
|
26023
|
-
acp_session_id: session.acpSessionId
|
|
26024
|
-
|
|
26062
|
+
acp_session_id: session.acpSessionId,
|
|
26063
|
+
scratchDir,
|
|
26064
|
+
freshSpawn: true
|
|
26065
|
+
}));
|
|
26025
26066
|
} catch (e) {
|
|
26026
26067
|
this.#send({
|
|
26027
26068
|
type: "session.error",
|
|
@@ -26265,7 +26306,8 @@ async function prepareNodeSession(input) {
|
|
|
26265
26306
|
`binary not on PATH for ${agent.id}: \`${agent.spec.command}\`` + (agent.installHint ? `. Install: ${agent.installHint}` : "")
|
|
26266
26307
|
);
|
|
26267
26308
|
}
|
|
26268
|
-
const
|
|
26309
|
+
const scratchDir = await ensureSessionCwd(input.command.sessionId);
|
|
26310
|
+
const processCwd = acpProcessCwd(scratchDir, input.command.cwd);
|
|
26269
26311
|
let blocklist = [];
|
|
26270
26312
|
let bundleMcpServers = [];
|
|
26271
26313
|
let bundleEnv = [];
|
|
@@ -26276,7 +26318,7 @@ async function prepareNodeSession(input) {
|
|
|
26276
26318
|
agent.id
|
|
26277
26319
|
);
|
|
26278
26320
|
if (bundle) {
|
|
26279
|
-
await writeBundle(
|
|
26321
|
+
await writeBundle(scratchDir, bundle.files);
|
|
26280
26322
|
blocklist = bundle.local_skill_blocklist ?? [];
|
|
26281
26323
|
bundleMcpServers = bundle.mcp_servers ?? [];
|
|
26282
26324
|
bundleEnv = bundle.env ?? [];
|
|
@@ -26291,7 +26333,7 @@ async function prepareNodeSession(input) {
|
|
|
26291
26333
|
if (agent.id === "claude-acp") {
|
|
26292
26334
|
try {
|
|
26293
26335
|
extraEnv.CLAUDE_CONFIG_DIR = await setupClaudeConfigDir(
|
|
26294
|
-
|
|
26336
|
+
scratchDir,
|
|
26295
26337
|
new Set(blocklist)
|
|
26296
26338
|
);
|
|
26297
26339
|
} catch (error40) {
|
|
@@ -26315,12 +26357,12 @@ async function prepareNodeSession(input) {
|
|
|
26315
26357
|
}]
|
|
26316
26358
|
}));
|
|
26317
26359
|
process.stderr.write(
|
|
26318
|
-
` \u2192 SessionManager.start ${agent.spec.command} cwd=${
|
|
26360
|
+
` \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"
|
|
26319
26361
|
);
|
|
26320
26362
|
return {
|
|
26321
26363
|
agent: {
|
|
26322
26364
|
...agent.spec,
|
|
26323
|
-
cwd:
|
|
26365
|
+
cwd: processCwd,
|
|
26324
26366
|
env: scrubAcpSpawnEnv2({
|
|
26325
26367
|
...agent.spec.env ?? {},
|
|
26326
26368
|
...envFromBundle,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openma/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
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",
|
|
48
47
|
"@open-managed-agents/api-types": "0.1.0",
|
|
49
|
-
"@open-managed-agents/runtime": "0.1.0"
|
|
48
|
+
"@open-managed-agents/runtime": "0.1.0",
|
|
49
|
+
"@open-managed-agents/acp-runtime": "0.0.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);\"",
|