super-dsh 0.1.0 → 0.1.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/agent-agy/bridge/agy_bridge.py +250 -0
- package/agent-agy/bridge/gemini_openai_server.mjs +98 -0
- package/agent-agy/cordis.patch.yml +49 -0
- package/agent-agy/dist/adapter.d.ts +15 -0
- package/agent-agy/dist/adapter.js +42 -0
- package/agent-agy/dist/agent-preset-agy.d.ts +47 -0
- package/agent-agy/dist/agent-preset-agy.js +169 -0
- package/agent-agy/dist/agent-preset-projection.d.ts +31 -0
- package/agent-agy/dist/agent-preset-projection.js +33 -0
- package/agent-agy/dist/agent.d.ts +137 -0
- package/agent-agy/dist/agent.js +493 -0
- package/agent-agy/dist/agy-cli-client.d.ts +137 -0
- package/agent-agy/dist/agy-cli-client.js +301 -0
- package/agent-agy/dist/agy-client.d.ts +160 -0
- package/agent-agy/dist/agy-client.js +252 -0
- package/agent-agy/dist/agy-sessions.d.ts +24 -0
- package/agent-agy/dist/agy-sessions.js +116 -0
- package/agent-agy/dist/agy-store.d.ts +39 -0
- package/agent-agy/dist/agy-store.js +83 -0
- package/agent-agy/dist/inbox.d.ts +26 -0
- package/agent-agy/dist/inbox.js +53 -0
- package/agent-agy/dist/index.d.ts +80 -0
- package/agent-agy/dist/index.js +505 -0
- package/agent-agy/dist/models.d.ts +41 -0
- package/agent-agy/dist/models.js +74 -0
- package/agent-agy/dist/world-plugin.d.ts +9 -0
- package/agent-agy/dist/world-plugin.js +97 -0
- package/agent-agy/package.json +64 -0
- package/agent-claude/cordis.patch.yml +42 -0
- package/agent-claude/dist/adapter.js +62 -0
- package/agent-claude/dist/agent-preset-claude.js +169 -0
- package/agent-claude/dist/agent-preset-projection.js +30 -0
- package/agent-claude/dist/agent.js +1271 -0
- package/agent-claude/dist/claude-client.js +357 -0
- package/agent-claude/dist/claude-events.js +223 -0
- package/agent-claude/dist/claude-home.js +29 -0
- package/agent-claude/dist/commands.js +182 -0
- package/agent-claude/dist/content.js +134 -0
- package/agent-claude/dist/inbox.js +53 -0
- package/agent-claude/dist/index.js +555 -0
- package/agent-claude/dist/input-queue.js +64 -0
- package/agent-claude/dist/interaction.js +271 -0
- package/agent-claude/dist/models.js +158 -0
- package/agent-claude/dist/permission.js +120 -0
- package/agent-claude/dist/session-id.js +20 -0
- package/agent-claude/dist/session-map.js +165 -0
- package/agent-claude/dist/world-plugin.js +14 -0
- package/agent-claude/package.json +74 -0
- package/agent-codex/README.md +74 -0
- package/agent-codex/cordis.patch.yml +77 -0
- package/agent-codex/dist/adapter.js +55 -0
- package/agent-codex/dist/agent-preset-codex.js +171 -0
- package/agent-codex/dist/agent-preset-projection.js +37 -0
- package/agent-codex/dist/agent.js +1056 -0
- package/agent-codex/dist/app-home.js +65 -0
- package/agent-codex/dist/codex-client.js +469 -0
- package/agent-codex/dist/codex-events.js +297 -0
- package/agent-codex/dist/codex-store.js +190 -0
- package/agent-codex/dist/inbox.js +53 -0
- package/agent-codex/dist/index.js +605 -0
- package/agent-codex/dist/models.js +152 -0
- package/agent-codex/dist/permission.js +71 -0
- package/agent-codex/dist/session-map.js +170 -0
- package/agent-codex/dist/spike.js +46 -0
- package/agent-codex/dist/world-plugin.js +96 -0
- package/agent-codex/package.json +78 -0
- package/agent-hermes/README.md +144 -0
- package/agent-hermes/cordis.patch.yml +83 -0
- package/agent-hermes/dist/adapter.js +83 -0
- package/agent-hermes/dist/agent-preset-hermes.js +171 -0
- package/agent-hermes/dist/agent-preset-projection.js +34 -0
- package/agent-hermes/dist/agent.js +1068 -0
- package/agent-hermes/dist/hermes-client.js +953 -0
- package/agent-hermes/dist/hermes-events.js +289 -0
- package/agent-hermes/dist/hermes-store.js +158 -0
- package/agent-hermes/dist/inbox.js +53 -0
- package/agent-hermes/dist/index.js +541 -0
- package/agent-hermes/dist/models.js +324 -0
- package/agent-hermes/dist/permission.js +60 -0
- package/agent-hermes/dist/world-plugin.js +101 -0
- package/agent-hermes/package.json +76 -0
- package/agent-hub/cordis.patch.yml +12 -0
- package/agent-hub/dist/agent-roster.d.ts +34 -0
- package/agent-hub/dist/agent-roster.js +27 -0
- package/agent-hub/dist/carrier.d.ts +43 -0
- package/agent-hub/dist/carrier.js +241 -0
- package/agent-hub/dist/client-shim.d.ts +28 -0
- package/agent-hub/dist/client-shim.js +251 -0
- package/agent-hub/dist/envelope.d.ts +54 -0
- package/agent-hub/dist/envelope.js +92 -0
- package/agent-hub/dist/gateway.d.ts +28 -0
- package/agent-hub/dist/gateway.js +18 -0
- package/agent-hub/dist/index-pass.d.ts +22 -0
- package/agent-hub/dist/index-pass.js +47 -0
- package/agent-hub/dist/index.d.ts +29 -0
- package/agent-hub/dist/index.js +29 -0
- package/agent-hub/dist/labels.d.ts +45 -0
- package/agent-hub/dist/labels.js +83 -0
- package/agent-hub/dist/ownership.d.ts +37 -0
- package/agent-hub/dist/ownership.js +54 -0
- package/agent-hub/dist/roster.d.ts +28 -0
- package/agent-hub/dist/roster.js +38 -0
- package/agent-hub/dist/rpc.d.ts +38 -0
- package/agent-hub/dist/rpc.js +52 -0
- package/agent-hub/dist/spawn-world.d.ts +46 -0
- package/agent-hub/dist/spawn-world.js +72 -0
- package/agent-hub/dist/targets.d.ts +33 -0
- package/agent-hub/dist/targets.js +30 -0
- package/agent-hub/dist/world-entry.d.ts +31 -0
- package/agent-hub/dist/world-entry.js +51 -0
- package/agent-hub/dist/world-host.d.ts +69 -0
- package/agent-hub/dist/world-host.js +44 -0
- package/agent-hub/dist/world-join.d.ts +16 -0
- package/agent-hub/dist/world-join.js +122 -0
- package/agent-hub/dist/world-mount.d.ts +52 -0
- package/agent-hub/dist/world-mount.js +52 -0
- package/agent-hub/dist/world-mux.d.ts +72 -0
- package/agent-hub/dist/world-mux.js +224 -0
- package/agent-hub/dist/world-provision.d.ts +20 -0
- package/agent-hub/dist/world-provision.js +122 -0
- package/agent-hub/dist/world-web-server.d.ts +162 -0
- package/agent-hub/dist/world-web-server.js +248 -0
- package/agent-hub/lib/client/index.js +242 -0
- package/agent-hub/package.json +65 -0
- package/agent-omp/README.md +77 -0
- package/agent-omp/cordis.patch.yml +92 -0
- package/agent-omp/dist/adapter.js +36 -0
- package/agent-omp/dist/agent-preset-omp.js +171 -0
- package/agent-omp/dist/agent-preset-projection.js +36 -0
- package/agent-omp/dist/agent.js +1145 -0
- package/agent-omp/dist/app-home.js +86 -0
- package/agent-omp/dist/discovery.js +116 -0
- package/agent-omp/dist/inbox.js +53 -0
- package/agent-omp/dist/index.js +574 -0
- package/agent-omp/dist/knobs.js +50 -0
- package/agent-omp/dist/lazy-rpc.js +161 -0
- package/agent-omp/dist/mobile/gesture.js +148 -0
- package/agent-omp/dist/mobile/zoom-guard.js +294 -0
- package/agent-omp/dist/mobile-boot.js +38 -0
- package/agent-omp/dist/models.js +299 -0
- package/agent-omp/dist/omp-cli.js +147 -0
- package/agent-omp/dist/omp-disk-discovery.js +178 -0
- package/agent-omp/dist/omp-store.js +518 -0
- package/agent-omp/dist/pairing.js +45 -0
- package/agent-omp/dist/permission.js +96 -0
- package/agent-omp/dist/protocol.js +13 -0
- package/agent-omp/dist/rpc-types.js +1 -0
- package/agent-omp/dist/sdk-client.js +378 -0
- package/agent-omp/dist/sidecar-client.js +195 -0
- package/agent-omp/dist/store/adapter.js +47 -0
- package/agent-omp/dist/store/db.js +210 -0
- package/agent-omp/dist/store/index.js +59 -0
- package/agent-omp/dist/store/reconcile.js +51 -0
- package/agent-omp/dist/store/schema.js +40 -0
- package/agent-omp/dist/world-plugin.js +96 -0
- package/agent-omp/package.json +97 -0
- package/agent-omp/sidecar/main.ts +481 -0
- package/agent-pi/README.md +67 -0
- package/agent-pi/cordis.patch.yml +80 -0
- package/agent-pi/dist/adapter.js +53 -0
- package/agent-pi/dist/agent-preset-pi.js +169 -0
- package/agent-pi/dist/agent-preset-projection.js +29 -0
- package/agent-pi/dist/agent.js +949 -0
- package/agent-pi/dist/inbox.js +53 -0
- package/agent-pi/dist/index.js +595 -0
- package/agent-pi/dist/knobs.js +24 -0
- package/agent-pi/dist/models.js +200 -0
- package/agent-pi/dist/permission.js +66 -0
- package/agent-pi/dist/pi-client.js +224 -0
- package/agent-pi/dist/pi-events.js +155 -0
- package/agent-pi/dist/pi-home.js +55 -0
- package/agent-pi/dist/safe-json.js +25 -0
- package/agent-pi/dist/session-map.js +119 -0
- package/agent-pi/dist/world-plugin.js +97 -0
- package/agent-pi/package.json +77 -0
- package/cordis.patch.yml +22 -19
- package/package.json +88 -25
- package/client.js +0 -4
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OMP runtime app home bootstrap — idempotently creates the runtime's OMP home
|
|
3
|
+
* (`<DSH_HOME>/agents/omp/.omp`) and seeds it with the OMP config (config.yml /
|
|
4
|
+
* mcp.json / models.yml / .env) copied once from `~/.omp/agent`. Fail-soft: any
|
|
5
|
+
* error is reported and the host boot continues — the app home is derived state,
|
|
6
|
+
* never a boot gate.
|
|
7
|
+
*/
|
|
8
|
+
import { copyFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
import { OMP_HOME, OMP_NATIVE_HOME } from "./knobs.js";
|
|
11
|
+
/** Config files seeded into the app home from the native OMP agent dir. */
|
|
12
|
+
export const APP_HOME_CONFIG_FILES = ["config.yml", "mcp.json", "models.yml", ".env"];
|
|
13
|
+
/**
|
|
14
|
+
* Comma/space separated `mcpServers` names the launcher refuses to inherit
|
|
15
|
+
* (`AW_OMP_MCP_EXCLUDE=zai-vision`). Deployment policy lives in the launcher, so
|
|
16
|
+
* this module never names a vendor.
|
|
17
|
+
*/
|
|
18
|
+
export const OMP_MCP_EXCLUDE_ENV = "AW_OMP_MCP_EXCLUDE";
|
|
19
|
+
/** Native OMP agent dir (`<OMP_NATIVE_HOME>/agent`) — the copy source. */
|
|
20
|
+
function defaultSourceAgentDir() {
|
|
21
|
+
return join(OMP_NATIVE_HOME, "agent");
|
|
22
|
+
}
|
|
23
|
+
/** Parse {@link OMP_MCP_EXCLUDE_ENV} into server names. */
|
|
24
|
+
function excludedMcpServers() {
|
|
25
|
+
return (process.env[OMP_MCP_EXCLUDE_ENV] ?? "")
|
|
26
|
+
.split(/[\s,]+/)
|
|
27
|
+
.map((name) => name.trim())
|
|
28
|
+
.filter((name) => name !== "");
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Drop excluded stdio MCP servers from the app home's `mcp.json`.
|
|
32
|
+
*
|
|
33
|
+
* Why this exists: the native `~/.omp/agent/mcp.json` carries a `npx -y
|
|
34
|
+
* @z_ai/mcp-server@latest` stdio server, and every spawned MCP child is a real
|
|
35
|
+
* process (a live npx install ~200 MB) that this runtime does not need. Seeding
|
|
36
|
+
* copies the file verbatim, so the filter runs after seeding and is idempotent:
|
|
37
|
+
* it only rewrites the document when a listed server was actually present.
|
|
38
|
+
*/
|
|
39
|
+
function pruneMcpServers(appHome, names, warn) {
|
|
40
|
+
if (names.length === 0)
|
|
41
|
+
return;
|
|
42
|
+
const file = join(appHome, "mcp.json");
|
|
43
|
+
if (!existsSync(file))
|
|
44
|
+
return;
|
|
45
|
+
const parsed = JSON.parse(readFileSync(file, "utf8"));
|
|
46
|
+
const servers = parsed.mcpServers;
|
|
47
|
+
if (servers === undefined || typeof servers !== "object" || servers === null)
|
|
48
|
+
return;
|
|
49
|
+
const removed = names.filter((name) => Object.hasOwn(servers, name));
|
|
50
|
+
if (removed.length === 0)
|
|
51
|
+
return;
|
|
52
|
+
for (const name of removed)
|
|
53
|
+
delete servers[name];
|
|
54
|
+
writeFileSync(file, `${JSON.stringify(parsed, null, 2)}\n`);
|
|
55
|
+
warn?.(`omp-provider: pruned MCP servers from ${file}: ${removed.join(", ")}`);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Ensure the app home exists and is seeded. Never overwrites an existing file
|
|
59
|
+
* (an already-provisioned app home wins); a missing source file is skipped.
|
|
60
|
+
* Returns the resolved app home path.
|
|
61
|
+
*/
|
|
62
|
+
export function ensureOmpAppHome(options = {}) {
|
|
63
|
+
const appHome = options.appHome ?? OMP_HOME;
|
|
64
|
+
const source = options.sourceAgentDir ?? defaultSourceAgentDir();
|
|
65
|
+
const files = options.files ?? APP_HOME_CONFIG_FILES;
|
|
66
|
+
try {
|
|
67
|
+
mkdirSync(appHome, { recursive: true });
|
|
68
|
+
for (const name of files) {
|
|
69
|
+
const dest = join(appHome, name);
|
|
70
|
+
if (existsSync(dest))
|
|
71
|
+
continue;
|
|
72
|
+
const src = join(source, name);
|
|
73
|
+
if (!existsSync(src))
|
|
74
|
+
continue;
|
|
75
|
+
copyFileSync(src, dest);
|
|
76
|
+
}
|
|
77
|
+
// Deployment policy, data-side: a seeded/kept `mcp.json` may still carry
|
|
78
|
+
// heavy stdio servers this runtime must not inherit (a vendor name does not
|
|
79
|
+
// belong in adapter code, so the launcher names them here).
|
|
80
|
+
pruneMcpServers(appHome, options.excludeMcpServers ?? excludedMcpServers(), options.warn);
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
options.warn?.(`omp-provider: app-home bootstrap failed (fail-soft): ${String(error)}`);
|
|
84
|
+
}
|
|
85
|
+
return appHome;
|
|
86
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { OMP_DISCOVERY_REFRESH_INTERVAL_MS } from "./knobs.js";
|
|
3
|
+
import { readSkills, readSlashCommands, } from "./omp-disk-discovery.js";
|
|
4
|
+
/** Strip a slash-command name to the host's `/^[a-z][a-z0-9_-]*$/` shape. */
|
|
5
|
+
function sanitizeCommandName(name) {
|
|
6
|
+
const cleaned = name.toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+/, "").slice(0, 64);
|
|
7
|
+
return cleaned === "" ? "omp-command" : cleaned;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Register one set of disk-scanned OMP slash commands on the host runtime.
|
|
11
|
+
* The handler echoes the command body as the result text — a first-pass
|
|
12
|
+
* surface; a deeper integration would route execution through the bridged
|
|
13
|
+
* Agent. Returns a disposer for the whole set.
|
|
14
|
+
*/
|
|
15
|
+
export function mountSlashCommands(commands, found) {
|
|
16
|
+
const disposers = found.map((command) => commands.register({
|
|
17
|
+
name: sanitizeCommandName(command.name),
|
|
18
|
+
description: command.description,
|
|
19
|
+
handler: () => ({ kind: "success", text: command.content }),
|
|
20
|
+
}));
|
|
21
|
+
return () => {
|
|
22
|
+
for (const dispose of disposers) {
|
|
23
|
+
try {
|
|
24
|
+
dispose();
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
// A host-side double-dispose must not break the refresh cycle.
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A refreshable slash-command mount: registers the boot scan immediately,
|
|
34
|
+
* then `refresh()` swaps the live set for a fresh disk scan (dispose-then-
|
|
35
|
+
* register, so a removed command file disappears from the `/` menu).
|
|
36
|
+
*/
|
|
37
|
+
export function createSlashCommandMount(commands, cwd) {
|
|
38
|
+
let dispose = () => { };
|
|
39
|
+
const refresh = () => {
|
|
40
|
+
dispose();
|
|
41
|
+
dispose = mountSlashCommands(commands, readSlashCommands(cwd));
|
|
42
|
+
};
|
|
43
|
+
refresh();
|
|
44
|
+
return {
|
|
45
|
+
refresh,
|
|
46
|
+
disposeAll: () => dispose(),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Mount OMP discovery on the host seams. Fail-open: a missing `skills` or
|
|
51
|
+
* `commands` service leaves the feature dormant, never blocks host boot.
|
|
52
|
+
*
|
|
53
|
+
* @param ctx - host plugin context.
|
|
54
|
+
*/
|
|
55
|
+
export function installOmpDiscovery(ctx) {
|
|
56
|
+
// Skills: a discovery provider whose `list(cwd)` scans OMP's disk roots for
|
|
57
|
+
// the caller's workspace; the body is read lazily from SKILL.md in `get`.
|
|
58
|
+
ctx.inject(["skills"], (scoped) => {
|
|
59
|
+
const skills = scoped.get("skills");
|
|
60
|
+
if (skills === undefined)
|
|
61
|
+
return;
|
|
62
|
+
skills.registerProvider(() => ({
|
|
63
|
+
name: "omp",
|
|
64
|
+
list: async (options) => {
|
|
65
|
+
const found = readSkills(options.cwd);
|
|
66
|
+
return found.map((skill, rank) => ({
|
|
67
|
+
name: skill.name,
|
|
68
|
+
description: skill.description,
|
|
69
|
+
rank,
|
|
70
|
+
locator: skill.filePath,
|
|
71
|
+
path: skill.filePath,
|
|
72
|
+
invocation: { modelInvocable: true, userInvocable: true },
|
|
73
|
+
source: "custom",
|
|
74
|
+
provider: "omp",
|
|
75
|
+
}));
|
|
76
|
+
},
|
|
77
|
+
get: async (candidate) => {
|
|
78
|
+
const content = await readFile(String(candidate.locator), "utf8").catch(() => "");
|
|
79
|
+
return {
|
|
80
|
+
name: candidate.name,
|
|
81
|
+
description: candidate.description,
|
|
82
|
+
content,
|
|
83
|
+
invocation: { modelInvocable: true, userInvocable: true },
|
|
84
|
+
source: "custom",
|
|
85
|
+
provider: "omp",
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
}));
|
|
89
|
+
});
|
|
90
|
+
// Slash commands: mount the boot scan, then re-scan on the hourly discovery
|
|
91
|
+
// cadence (pure disk reads; `0` disables). The interval + live registrations
|
|
92
|
+
// are fiber-owned: torn down with the plugin context.
|
|
93
|
+
ctx.inject(["commands"], (scoped) => {
|
|
94
|
+
const commands = scoped.get("commands");
|
|
95
|
+
if (commands === undefined)
|
|
96
|
+
return;
|
|
97
|
+
const mount = createSlashCommandMount(commands);
|
|
98
|
+
let timer;
|
|
99
|
+
if (OMP_DISCOVERY_REFRESH_INTERVAL_MS > 0) {
|
|
100
|
+
timer = setInterval(() => {
|
|
101
|
+
try {
|
|
102
|
+
mount.refresh();
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
// A bad refresh must never kill the interval or the host.
|
|
106
|
+
}
|
|
107
|
+
}, OMP_DISCOVERY_REFRESH_INTERVAL_MS);
|
|
108
|
+
timer.unref?.();
|
|
109
|
+
}
|
|
110
|
+
ctx.effect(() => () => {
|
|
111
|
+
if (timer !== undefined)
|
|
112
|
+
clearInterval(timer);
|
|
113
|
+
mount.disposeAll();
|
|
114
|
+
}, "ompDiscovery.slashCommands");
|
|
115
|
+
});
|
|
116
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export class Inbox {
|
|
2
|
+
#nextTurn = [];
|
|
3
|
+
#nextStep = [];
|
|
4
|
+
get nextTurn() {
|
|
5
|
+
return this.#nextTurn;
|
|
6
|
+
}
|
|
7
|
+
get nextStep() {
|
|
8
|
+
return this.#nextStep;
|
|
9
|
+
}
|
|
10
|
+
clear() {
|
|
11
|
+
this.#nextTurn = [];
|
|
12
|
+
this.#nextStep = [];
|
|
13
|
+
}
|
|
14
|
+
append(target, message) {
|
|
15
|
+
this.#list(target).push(message);
|
|
16
|
+
}
|
|
17
|
+
prepend(target, message) {
|
|
18
|
+
this.#list(target).unshift(message);
|
|
19
|
+
}
|
|
20
|
+
replace(messageId, newMessage) {
|
|
21
|
+
const list = this.#find(messageId);
|
|
22
|
+
if (list === undefined)
|
|
23
|
+
return false;
|
|
24
|
+
const index = list.findIndex((message) => message.id === messageId);
|
|
25
|
+
if (index < 0)
|
|
26
|
+
return false;
|
|
27
|
+
list.splice(index, 1, newMessage);
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
remove(messageId) {
|
|
31
|
+
const list = this.#find(messageId);
|
|
32
|
+
if (list === undefined)
|
|
33
|
+
return false;
|
|
34
|
+
const index = list.findIndex((message) => message.id === messageId);
|
|
35
|
+
if (index < 0)
|
|
36
|
+
return false;
|
|
37
|
+
list.splice(index, 1);
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
splice(target, start, deleteCount, inserted) {
|
|
41
|
+
return this.#list(target).splice(start, deleteCount, ...inserted);
|
|
42
|
+
}
|
|
43
|
+
#list(target) {
|
|
44
|
+
return target === "next-turn" ? this.#nextTurn : this.#nextStep;
|
|
45
|
+
}
|
|
46
|
+
#find(messageId) {
|
|
47
|
+
if (this.#nextTurn.some((message) => message.id === messageId))
|
|
48
|
+
return this.#nextTurn;
|
|
49
|
+
if (this.#nextStep.some((message) => message.id === messageId))
|
|
50
|
+
return this.#nextStep;
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
}
|