@monoes/monomindcli 2.16.13 → 2.16.14
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 +1 -1
- package/dist/src/commands/org-control.d.ts +117 -0
- package/dist/src/commands/org-control.d.ts.map +1 -0
- package/dist/src/commands/org-control.js +274 -0
- package/dist/src/commands/org-control.js.map +1 -0
- package/dist/src/commands/org-lifecycle.d.ts +7 -0
- package/dist/src/commands/org-lifecycle.d.ts.map +1 -0
- package/dist/src/commands/org-lifecycle.js +298 -0
- package/dist/src/commands/org-lifecycle.js.map +1 -0
- package/dist/src/commands/org-manage.d.ts +7 -0
- package/dist/src/commands/org-manage.d.ts.map +1 -0
- package/dist/src/commands/org-manage.js +357 -0
- package/dist/src/commands/org-manage.js.map +1 -0
- package/dist/src/commands/org-memory-command.d.ts +3 -0
- package/dist/src/commands/org-memory-command.d.ts.map +1 -0
- package/dist/src/commands/org-memory-command.js +178 -0
- package/dist/src/commands/org-memory-command.js.map +1 -0
- package/dist/src/commands/org-observe-approvals.d.ts +8 -0
- package/dist/src/commands/org-observe-approvals.d.ts.map +1 -0
- package/dist/src/commands/org-observe-approvals.js +211 -0
- package/dist/src/commands/org-observe-approvals.js.map +1 -0
- package/dist/src/commands/org-observe-checkpoint.d.ts +26 -0
- package/dist/src/commands/org-observe-checkpoint.d.ts.map +1 -0
- package/dist/src/commands/org-observe-checkpoint.js +180 -0
- package/dist/src/commands/org-observe-checkpoint.js.map +1 -0
- package/dist/src/commands/org-observe-config.d.ts +8 -0
- package/dist/src/commands/org-observe-config.d.ts.map +1 -0
- package/dist/src/commands/org-observe-config.js +160 -0
- package/dist/src/commands/org-observe-config.js.map +1 -0
- package/dist/src/commands/org-observe-gates.d.ts +4 -0
- package/dist/src/commands/org-observe-gates.d.ts.map +1 -0
- package/dist/src/commands/org-observe-gates.js +182 -0
- package/dist/src/commands/org-observe-gates.js.map +1 -0
- package/dist/src/commands/org-observe-inbox.d.ts +18 -0
- package/dist/src/commands/org-observe-inbox.d.ts.map +1 -0
- package/dist/src/commands/org-observe-inbox.js +154 -0
- package/dist/src/commands/org-observe-inbox.js.map +1 -0
- package/dist/src/commands/org-observe-logs.d.ts +31 -0
- package/dist/src/commands/org-observe-logs.d.ts.map +1 -0
- package/dist/src/commands/org-observe-logs.js +272 -0
- package/dist/src/commands/org-observe-logs.js.map +1 -0
- package/dist/src/commands/org-observe-questions.d.ts +8 -0
- package/dist/src/commands/org-observe-questions.d.ts.map +1 -0
- package/dist/src/commands/org-observe-questions.js +201 -0
- package/dist/src/commands/org-observe-questions.js.map +1 -0
- package/dist/src/commands/org-observe-report.d.ts +8 -0
- package/dist/src/commands/org-observe-report.d.ts.map +1 -0
- package/dist/src/commands/org-observe-report.js +366 -0
- package/dist/src/commands/org-observe-report.js.map +1 -0
- package/dist/src/commands/org-observe-shared.d.ts +20 -0
- package/dist/src/commands/org-observe-shared.d.ts.map +1 -0
- package/dist/src/commands/org-observe-shared.js +55 -0
- package/dist/src/commands/org-observe-shared.js.map +1 -0
- package/dist/src/commands/org-observe.d.ts +9 -101
- package/dist/src/commands/org-observe.d.ts.map +1 -1
- package/dist/src/commands/org-observe.js +12 -1675
- package/dist/src/commands/org-observe.js.map +1 -1
- package/dist/src/commands/org-poll.d.ts +57 -0
- package/dist/src/commands/org-poll.d.ts.map +1 -0
- package/dist/src/commands/org-poll.js +194 -0
- package/dist/src/commands/org-poll.js.map +1 -0
- package/dist/src/commands/org-run.d.ts +3 -0
- package/dist/src/commands/org-run.d.ts.map +1 -0
- package/dist/src/commands/org-run.js +449 -0
- package/dist/src/commands/org-run.js.map +1 -0
- package/dist/src/commands/org-serve.d.ts +19 -0
- package/dist/src/commands/org-serve.d.ts.map +1 -0
- package/dist/src/commands/org-serve.js +395 -0
- package/dist/src/commands/org-serve.js.map +1 -0
- package/dist/src/commands/org-subcommands-config.d.ts +8 -0
- package/dist/src/commands/org-subcommands-config.d.ts.map +1 -0
- package/dist/src/commands/org-subcommands-config.js +93 -0
- package/dist/src/commands/org-subcommands-config.js.map +1 -0
- package/dist/src/commands/org-subcommands-hil.d.ts +11 -0
- package/dist/src/commands/org-subcommands-hil.d.ts.map +1 -0
- package/dist/src/commands/org-subcommands-hil.js +216 -0
- package/dist/src/commands/org-subcommands-hil.js.map +1 -0
- package/dist/src/commands/org-subcommands-observe.d.ts +12 -0
- package/dist/src/commands/org-subcommands-observe.d.ts.map +1 -0
- package/dist/src/commands/org-subcommands-observe.js +249 -0
- package/dist/src/commands/org-subcommands-observe.js.map +1 -0
- package/dist/src/commands/org-subcommands-runtime.d.ts +12 -0
- package/dist/src/commands/org-subcommands-runtime.d.ts.map +1 -0
- package/dist/src/commands/org-subcommands-runtime.js +163 -0
- package/dist/src/commands/org-subcommands-runtime.js.map +1 -0
- package/dist/src/commands/org.d.ts +3 -151
- package/dist/src/commands/org.d.ts.map +1 -1
- package/dist/src/commands/org.js +43 -2735
- package/dist/src/commands/org.js.map +1 -1
- package/dist/src/orgrt/daemon-types.d.ts +196 -0
- package/dist/src/orgrt/daemon-types.d.ts.map +1 -0
- package/dist/src/orgrt/daemon-types.js +38 -0
- package/dist/src/orgrt/daemon-types.js.map +1 -0
- package/dist/src/orgrt/daemon.d.ts +70 -300
- package/dist/src/orgrt/daemon.d.ts.map +1 -1
- package/dist/src/orgrt/daemon.js +41 -2536
- package/dist/src/orgrt/daemon.js.map +1 -1
- package/dist/src/orgrt/idle-watchdog.d.ts +39 -0
- package/dist/src/orgrt/idle-watchdog.d.ts.map +1 -0
- package/dist/src/orgrt/idle-watchdog.js +289 -0
- package/dist/src/orgrt/idle-watchdog.js.map +1 -0
- package/dist/src/orgrt/org-reload.d.ts +7 -0
- package/dist/src/orgrt/org-reload.d.ts.map +1 -0
- package/dist/src/orgrt/org-reload.js +111 -0
- package/dist/src/orgrt/org-reload.js.map +1 -0
- package/dist/src/orgrt/org-start-steps.d.ts +21 -0
- package/dist/src/orgrt/org-start-steps.d.ts.map +1 -0
- package/dist/src/orgrt/org-start-steps.js +305 -0
- package/dist/src/orgrt/org-start-steps.js.map +1 -0
- package/dist/src/orgrt/org-start.d.ts +7 -0
- package/dist/src/orgrt/org-start.d.ts.map +1 -0
- package/dist/src/orgrt/org-start.js +435 -0
- package/dist/src/orgrt/org-start.js.map +1 -0
- package/dist/src/orgrt/org-state-file.d.ts +8 -0
- package/dist/src/orgrt/org-state-file.d.ts.map +1 -0
- package/dist/src/orgrt/org-state-file.js +116 -0
- package/dist/src/orgrt/org-state-file.js.map +1 -0
- package/dist/src/orgrt/org-stop.d.ts +6 -0
- package/dist/src/orgrt/org-stop.d.ts.map +1 -0
- package/dist/src/orgrt/org-stop.js +332 -0
- package/dist/src/orgrt/org-stop.js.map +1 -0
- package/dist/src/orgrt/org-tools.d.ts +11 -0
- package/dist/src/orgrt/org-tools.d.ts.map +1 -0
- package/dist/src/orgrt/org-tools.js +305 -0
- package/dist/src/orgrt/org-tools.js.map +1 -0
- package/dist/src/orgrt/role-incarnation.d.ts +18 -0
- package/dist/src/orgrt/role-incarnation.d.ts.map +1 -0
- package/dist/src/orgrt/role-incarnation.js +374 -0
- package/dist/src/orgrt/role-incarnation.js.map +1 -0
- package/dist/src/orgrt/role-respawn.d.ts +7 -0
- package/dist/src/orgrt/role-respawn.d.ts.map +1 -0
- package/dist/src/orgrt/role-respawn.js +318 -0
- package/dist/src/orgrt/role-respawn.js.map +1 -0
- package/dist/src/orgrt/role-session-opts.d.ts +389 -0
- package/dist/src/orgrt/role-session-opts.d.ts.map +1 -0
- package/dist/src/orgrt/role-session-opts.js +289 -0
- package/dist/src/orgrt/role-session-opts.js.map +1 -0
- package/dist/src/orgrt/runner-resolve.d.ts +43 -0
- package/dist/src/orgrt/runner-resolve.d.ts.map +1 -0
- package/dist/src/orgrt/runner-resolve.js +77 -0
- package/dist/src/orgrt/runner-resolve.js.map +1 -0
- package/dist/src/orgrt/session-gate.d.ts +34 -0
- package/dist/src/orgrt/session-gate.d.ts.map +1 -0
- package/dist/src/orgrt/session-gate.js +74 -0
- package/dist/src/orgrt/session-gate.js.map +1 -0
- package/dist/src/orgrt/session-prompt.d.ts +31 -0
- package/dist/src/orgrt/session-prompt.d.ts.map +1 -0
- package/dist/src/orgrt/session-prompt.js +115 -0
- package/dist/src/orgrt/session-prompt.js.map +1 -0
- package/dist/src/orgrt/session-run.d.ts +18 -0
- package/dist/src/orgrt/session-run.d.ts.map +1 -0
- package/dist/src/orgrt/session-run.js +429 -0
- package/dist/src/orgrt/session-run.js.map +1 -0
- package/dist/src/orgrt/session-stream.d.ts +21 -0
- package/dist/src/orgrt/session-stream.d.ts.map +1 -0
- package/dist/src/orgrt/session-stream.js +173 -0
- package/dist/src/orgrt/session-stream.js.map +1 -0
- package/dist/src/orgrt/session-types.d.ts +219 -0
- package/dist/src/orgrt/session-types.d.ts.map +1 -0
- package/dist/src/orgrt/session-types.js +2 -0
- package/dist/src/orgrt/session-types.js.map +1 -0
- package/dist/src/orgrt/session-usage.d.ts +29 -0
- package/dist/src/orgrt/session-usage.d.ts.map +1 -0
- package/dist/src/orgrt/session-usage.js +64 -0
- package/dist/src/orgrt/session-usage.js.map +1 -0
- package/dist/src/orgrt/session.d.ts +5 -281
- package/dist/src/orgrt/session.d.ts.map +1 -1
- package/dist/src/orgrt/session.js +8 -1117
- package/dist/src/orgrt/session.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
// packages/@monomind/cli/src/commands/org-serve.ts
|
|
2
|
+
//
|
|
3
|
+
// `monomind org serve | supervisor` — the long-running daemon that hosts
|
|
4
|
+
// scheduled orgs, and the launchd/systemd unit that keeps it running.
|
|
5
|
+
import { createHash } from 'node:crypto';
|
|
6
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
7
|
+
import { dirname, join, resolve } from 'node:path';
|
|
8
|
+
import { OrgDaemon } from '../orgrt/daemon.js';
|
|
9
|
+
import { readHistory } from '../orgrt/reporting.js';
|
|
10
|
+
import { startOrgServer } from '../orgrt/server.js';
|
|
11
|
+
import { ORG_DIR } from '../orgrt/types.js';
|
|
12
|
+
import { output } from '../output.js';
|
|
13
|
+
import { checkServeLock, clearStaleControlFiles, isOrgPaused, listOrgConfigFiles, } from './org-control.js';
|
|
14
|
+
import { pollReloadfiles, pollRunfiles, pollStopfiles } from './org-poll.js';
|
|
15
|
+
const log = (text) => {
|
|
16
|
+
console.log(text);
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Emit a supervisor unit for `org serve`.
|
|
20
|
+
*
|
|
21
|
+
* Why this is an EXTERNAL supervisor and not an `--supervise` flag: the daemon
|
|
22
|
+
* already logs every death it can observe — signals, uncaught exceptions,
|
|
23
|
+
* unhandled rejections, and the event loop draining. The one death it cannot
|
|
24
|
+
* observe is SIGKILL, which is what the OOM killer sends, and which is the
|
|
25
|
+
* suspected cause of the reported disappearance (its org logs showed repeated
|
|
26
|
+
* low-memory warnings). No in-process handler survives SIGKILL, so a daemon
|
|
27
|
+
* that restarts itself is theatre for exactly the case that matters. Only
|
|
28
|
+
* something outside the process can bring it back.
|
|
29
|
+
*
|
|
30
|
+
* launchd and systemd both already do this well, so this generates a correct
|
|
31
|
+
* unit rather than reimplementing them.
|
|
32
|
+
*/
|
|
33
|
+
export const supervisorAction = async (ctx) => {
|
|
34
|
+
const cwd = resolve(ctx.cwd || process.cwd());
|
|
35
|
+
const requested = String(ctx.flags.format ?? '')
|
|
36
|
+
.trim()
|
|
37
|
+
.toLowerCase();
|
|
38
|
+
const format = requested || (process.platform === 'darwin' ? 'launchd' : 'systemd');
|
|
39
|
+
if (format !== 'launchd' && format !== 'systemd') {
|
|
40
|
+
log(output.error(`Unknown --format "${requested}" — expected launchd or systemd.`));
|
|
41
|
+
return { success: false, message: 'unknown supervisor format' };
|
|
42
|
+
}
|
|
43
|
+
// argv[1] is this CLI's entry point — the same resolution `init` uses when it
|
|
44
|
+
// spawns a watcher. A supervisor must not depend on PATH or npx resolving to
|
|
45
|
+
// the same version later.
|
|
46
|
+
const cliEntry = process.argv[1] ? resolve(process.argv[1]) : 'monomind';
|
|
47
|
+
const node = process.execPath;
|
|
48
|
+
// Per-project identity. The unit bakes in a WorkingDirectory, so a constant
|
|
49
|
+
// Label and filename meant `--install` from a second project silently
|
|
50
|
+
// OVERWROTE the first project's unit — one file, the first daemon left
|
|
51
|
+
// unsupervised, no warning. Verified before fixing: installing from projA
|
|
52
|
+
// then projB left a single unit pointing at projB.
|
|
53
|
+
//
|
|
54
|
+
// The hash keeps it unique for two directories with the same basename; the
|
|
55
|
+
// basename keeps it recognisable in `launchctl list` / `systemctl --user`.
|
|
56
|
+
const slug = `${(cwd.split(/[\\/]/).pop() || 'org').replace(/[^A-Za-z0-9._-]/g, '-')}-${createHash('sha256').update(cwd).digest('hex').slice(0, 8)}`;
|
|
57
|
+
const label = `com.monomind.org-serve.${slug}`;
|
|
58
|
+
const logPath = join(cwd, '.monomind', 'org-serve.log');
|
|
59
|
+
const unit = format === 'launchd'
|
|
60
|
+
? `<?xml version="1.0" encoding="UTF-8"?>
|
|
61
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
62
|
+
<plist version="1.0">
|
|
63
|
+
<dict>
|
|
64
|
+
<key>Label</key><string>${label}</string>
|
|
65
|
+
<key>ProgramArguments</key>
|
|
66
|
+
<array>
|
|
67
|
+
<string>${node}</string>
|
|
68
|
+
<string>${cliEntry}</string>
|
|
69
|
+
<string>org</string>
|
|
70
|
+
<string>serve</string>
|
|
71
|
+
</array>
|
|
72
|
+
<key>WorkingDirectory</key><string>${cwd}</string>
|
|
73
|
+
<!-- KeepAlive restarts the daemon however it died, including SIGKILL. -->
|
|
74
|
+
<key>KeepAlive</key><true/>
|
|
75
|
+
<key>RunAtLoad</key><true/>
|
|
76
|
+
<key>StandardOutPath</key><string>${logPath}</string>
|
|
77
|
+
<key>StandardErrorPath</key><string>${logPath}</string>
|
|
78
|
+
</dict>
|
|
79
|
+
</plist>
|
|
80
|
+
`
|
|
81
|
+
: `[Unit]
|
|
82
|
+
Description=monomind org serve (${cwd})
|
|
83
|
+
After=network.target
|
|
84
|
+
|
|
85
|
+
[Service]
|
|
86
|
+
Type=simple
|
|
87
|
+
WorkingDirectory=${cwd}
|
|
88
|
+
ExecStart=${node} ${cliEntry} org serve
|
|
89
|
+
# Restart however it died, including an OOM kill.
|
|
90
|
+
Restart=always
|
|
91
|
+
RestartSec=5
|
|
92
|
+
StandardOutput=append:${logPath}
|
|
93
|
+
StandardError=append:${logPath}
|
|
94
|
+
|
|
95
|
+
[Install]
|
|
96
|
+
WantedBy=default.target
|
|
97
|
+
`;
|
|
98
|
+
const target = format === 'launchd'
|
|
99
|
+
? `~/Library/LaunchAgents/${label}.plist`
|
|
100
|
+
: `~/.config/systemd/user/monomind-org-serve-${slug}.service`;
|
|
101
|
+
if (ctx.flags.install === true) {
|
|
102
|
+
const home = process.env.HOME || process.env.USERPROFILE || '';
|
|
103
|
+
if (!home) {
|
|
104
|
+
log(output.error('Cannot resolve a home directory to install into — write the unit manually.'));
|
|
105
|
+
return { success: false, message: 'no home directory' };
|
|
106
|
+
}
|
|
107
|
+
const dest = format === 'launchd'
|
|
108
|
+
? join(home, 'Library', 'LaunchAgents', `${label}.plist`)
|
|
109
|
+
: join(home, '.config', 'systemd', 'user', `monomind-org-serve-${slug}.service`);
|
|
110
|
+
mkdirSync(dirname(dest), { recursive: true });
|
|
111
|
+
writeFileSync(dest, unit);
|
|
112
|
+
log(output.success(`Wrote ${dest}`));
|
|
113
|
+
log(output.info(format === 'launchd'
|
|
114
|
+
? `Load it with: launchctl load -w ${dest}`
|
|
115
|
+
: `Load it with: systemctl --user daemon-reload && systemctl --user enable --now monomind-org-serve-${slug}`));
|
|
116
|
+
return { success: true, message: `supervisor unit written to ${dest}` };
|
|
117
|
+
}
|
|
118
|
+
log(unit);
|
|
119
|
+
log(output.info(`Write this to ${target}, or re-run with --install to do it for you.`));
|
|
120
|
+
log(output.info('Why a supervisor: the daemon logs every death it can observe, but an OOM kill is SIGKILL — ' +
|
|
121
|
+
'uncatchable by design, so nothing in-process can restart after one.'));
|
|
122
|
+
return { success: true, message: `${format} unit emitted` };
|
|
123
|
+
};
|
|
124
|
+
export const serveAction = async (ctx) => {
|
|
125
|
+
// Mutual exclusion: refuse to start a second `org serve` for this project
|
|
126
|
+
// root. Checked before anything else so a refusal never opens a port,
|
|
127
|
+
// registers a broker lease, or starts a scheduled org that a live daemon
|
|
128
|
+
// is already running — see checkServeLock's header for the failure mode
|
|
129
|
+
// this prevents.
|
|
130
|
+
const lock = checkServeLock(ctx.cwd);
|
|
131
|
+
if (!lock.ok) {
|
|
132
|
+
log(output.error(`org serve: another daemon (pid ${lock.pid}) is already running for this project root.`));
|
|
133
|
+
log(output.info(` Check what it's doing with: monomind org status`));
|
|
134
|
+
log(output.info(` Stop it first (Ctrl-C in its terminal, or "kill ${lock.pid}"), then retry.`));
|
|
135
|
+
return { success: false, message: `org serve already running (pid ${lock.pid})` };
|
|
136
|
+
}
|
|
137
|
+
if (lock.staleHeartbeatRemoved) {
|
|
138
|
+
log(output.warning('org serve: cleaned up a stale heartbeat left by a previous daemon that did not shut down cleanly.'));
|
|
139
|
+
}
|
|
140
|
+
// See the matching comment in runAction — same rationale, same guard
|
|
141
|
+
// (embedder and reranker, scoped to this process, not exported to roles).
|
|
142
|
+
const { disableLocalModels } = await import('../memory/memory-bridge.js');
|
|
143
|
+
disableLocalModels();
|
|
144
|
+
const crossProcess = ctx.flags.crossProcess !== false;
|
|
145
|
+
const daemon = new OrgDaemon(ctx.cwd, { crossProcess });
|
|
146
|
+
let srv;
|
|
147
|
+
if (crossProcess) {
|
|
148
|
+
srv = await startOrgServer(daemon, 0);
|
|
149
|
+
daemon.setInboxUrl(`http://127.0.0.1:${srv.port}`, srv.operatorCredential);
|
|
150
|
+
}
|
|
151
|
+
// Crash handlers: log the reason and persist crashed state so `org status`
|
|
152
|
+
// shows what happened instead of a silent "pid is gone". A truly unknown
|
|
153
|
+
// uncaught exception's blast radius can't always be attributed to one org,
|
|
154
|
+
// so the whole process still exits (the safety-first default) — but naming
|
|
155
|
+
// which orgs were in flight at the moment it fired at least tells the
|
|
156
|
+
// operator the blast radius they actually hit, instead of leaving them to
|
|
157
|
+
// guess from an error with no org context.
|
|
158
|
+
const crashExit = (label, err) => {
|
|
159
|
+
try {
|
|
160
|
+
const running = daemon.listRunning();
|
|
161
|
+
console.error(`[org serve] ${label}:`, err, running.length ? `— orgs in flight: ${running.join(', ')}` : '— no orgs were running');
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
try {
|
|
165
|
+
console.error(`[org serve] ${label}:`, err);
|
|
166
|
+
}
|
|
167
|
+
catch {
|
|
168
|
+
/* stderr gone */
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
daemon.persistCrashStateAll(`${label}: ${err instanceof Error ? err.message : String(err)}`);
|
|
172
|
+
daemon.clearHeartbeat();
|
|
173
|
+
process.exitCode = 1;
|
|
174
|
+
};
|
|
175
|
+
process.on('uncaughtException', (err) => {
|
|
176
|
+
crashExit('uncaughtException', err);
|
|
177
|
+
process.exit(1);
|
|
178
|
+
});
|
|
179
|
+
process.on('unhandledRejection', (err) => {
|
|
180
|
+
crashExit('unhandledRejection', err);
|
|
181
|
+
process.exit(1);
|
|
182
|
+
});
|
|
183
|
+
// Termination diagnostics (#45). The two handlers above only cover errors
|
|
184
|
+
// raised *inside* the daemon. A report of the daemon vanishing after hours
|
|
185
|
+
// had a log holding nothing but its startup lines, because the ways a daemon
|
|
186
|
+
// usually dies were all unhandled:
|
|
187
|
+
//
|
|
188
|
+
// - a signal (SIGTERM from a supervisor/OS, SIGHUP when a terminal closes)
|
|
189
|
+
// - the event loop simply draining, which exits 0 and says nothing at all
|
|
190
|
+
//
|
|
191
|
+
// Both now announce themselves. Note what this deliberately cannot cover:
|
|
192
|
+
// SIGKILL, which is what the OOM killer sends, is uncatchable by design — no
|
|
193
|
+
// in-process handler can ever log it. That case is instead made *inferable*:
|
|
194
|
+
// every shutdown path below prints a terminal line, so a log that starts and
|
|
195
|
+
// then stops with no such line means the process was killed from outside
|
|
196
|
+
// (OOM being the usual culprit, and the reporter's org logs did show memory
|
|
197
|
+
// pressure). Absence of a shutdown line is now evidence, not ambiguity.
|
|
198
|
+
let shuttingDown = false;
|
|
199
|
+
const announceExit = (reason) => {
|
|
200
|
+
if (shuttingDown)
|
|
201
|
+
return;
|
|
202
|
+
shuttingDown = true;
|
|
203
|
+
try {
|
|
204
|
+
console.error(`[org serve] shutting down: ${reason}`);
|
|
205
|
+
}
|
|
206
|
+
catch {
|
|
207
|
+
/* stderr gone */
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
for (const sig of ['SIGTERM', 'SIGINT', 'SIGHUP']) {
|
|
211
|
+
process.on(sig, () => {
|
|
212
|
+
announceExit(`received ${sig}`);
|
|
213
|
+
try {
|
|
214
|
+
daemon.persistCrashStateAll();
|
|
215
|
+
daemon.clearHeartbeat();
|
|
216
|
+
}
|
|
217
|
+
catch {
|
|
218
|
+
/* best effort */
|
|
219
|
+
}
|
|
220
|
+
// A daemon holds ref'd timers, so it will not drain on its own; an
|
|
221
|
+
// explicit exit is required here and is the intended signal semantics.
|
|
222
|
+
process.exit(sig === 'SIGTERM' || sig === 'SIGINT' ? 0 : 1);
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
process.on('exit', (code) => {
|
|
226
|
+
// Last word on the way out. Reached for the "event loop drained" case,
|
|
227
|
+
// which previously produced a completely silent disappearance.
|
|
228
|
+
announceExit(`process exiting with code ${code}`);
|
|
229
|
+
});
|
|
230
|
+
// Heartbeat: write every 30s so `org status` can tell "alive but busy" from
|
|
231
|
+
// "daemon gone" without relying on pid liveness alone.
|
|
232
|
+
daemon.writeHeartbeat();
|
|
233
|
+
const heartbeatInterval = setInterval(() => {
|
|
234
|
+
daemon.writeHeartbeat();
|
|
235
|
+
}, 30_000);
|
|
236
|
+
heartbeatInterval.unref?.();
|
|
237
|
+
log(output.info('org daemon serving — Ctrl-C to stop'));
|
|
238
|
+
// schedule orgs whose definition declares an interval (e.g. "15m", "2h")
|
|
239
|
+
const { OrgScheduler, parseSchedule } = await import('../orgrt/scheduler.js');
|
|
240
|
+
const sched = new OrgScheduler(async (name, intervalMs) => {
|
|
241
|
+
if (isOrgPaused(ctx.cwd, name))
|
|
242
|
+
return;
|
|
243
|
+
// Run precondition checks before starting a scheduled run
|
|
244
|
+
try {
|
|
245
|
+
const defPath = join(ctx.cwd, ORG_DIR, `${name}.json`);
|
|
246
|
+
if (existsSync(defPath)) {
|
|
247
|
+
const rawDef = JSON.parse(readFileSync(defPath, 'utf8'));
|
|
248
|
+
const checks = rawDef?.run_config?.prechecks;
|
|
249
|
+
if (Array.isArray(checks) && checks.length > 0) {
|
|
250
|
+
const { runPrechecks } = await import('../orgrt/prechecks.js');
|
|
251
|
+
const { ok, results } = await runPrechecks(checks, ctx.cwd);
|
|
252
|
+
if (!ok) {
|
|
253
|
+
const failed = results.find((r) => !r.passed);
|
|
254
|
+
log(output.warning(`org ${name}: precheck "${failed?.name}" failed — skipping scheduled run`));
|
|
255
|
+
if (failed?.output)
|
|
256
|
+
log(output.warning(` ${failed.output.slice(0, 200)}`));
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
catch (err) {
|
|
263
|
+
log(output.warning(`org ${name}: precheck evaluation error — ${err instanceof Error ? err.message : 'unknown'}`));
|
|
264
|
+
}
|
|
265
|
+
// Only ever stop a run THIS tick started. The runfile poll can start an org
|
|
266
|
+
// out-of-band, and the scheduler has no visibility into that — so a tick
|
|
267
|
+
// landing on an already-running org threw "already running", fell into the
|
|
268
|
+
// finally, and stopped a healthy run that had nothing to do with it. The
|
|
269
|
+
// tick's job in that case is simply to yield.
|
|
270
|
+
let startedHere = false;
|
|
271
|
+
try {
|
|
272
|
+
await daemon.startOrg(name);
|
|
273
|
+
startedHere = true;
|
|
274
|
+
// Scheduled iterations are time-bounded: agents' `done` promises only
|
|
275
|
+
// resolve after stopOrg closes the mailboxes, so waiting on them alone
|
|
276
|
+
// deadlocks. Race against a max-run timeout, then ALWAYS stopOrg
|
|
277
|
+
// (idempotent — it resolves `done` and flushes).
|
|
278
|
+
const org = daemon.getOrg(name);
|
|
279
|
+
const allDone = org
|
|
280
|
+
? Promise.allSettled([...org.agents.values()].map((a) => a.done))
|
|
281
|
+
: Promise.resolve([]);
|
|
282
|
+
const maxRun = org?.def
|
|
283
|
+
?.run_config?.max_run;
|
|
284
|
+
// Default to the full interval. The old `min(interval, 10min)` clamp
|
|
285
|
+
// silently guillotined every org that didn't set max_run: real cycles
|
|
286
|
+
// here run 75-93 minutes, so a 2h-scheduled org was being force-stopped
|
|
287
|
+
// a twelfth of the way in, every time, with nothing saying so. Ten
|
|
288
|
+
// minutes was never a considered bound for agent work — it only looked
|
|
289
|
+
// safe because overrunning the interval used to cost a whole idle
|
|
290
|
+
// period. Now that a missed tick catches up the moment a run ends
|
|
291
|
+
// (OrgScheduler.pending), a run may safely use its whole interval.
|
|
292
|
+
// Set run_config.max_run to bound it tighter — or looser.
|
|
293
|
+
const maxMs = parseSchedule(maxRun) ?? intervalMs;
|
|
294
|
+
let timer;
|
|
295
|
+
await Promise.race([
|
|
296
|
+
allDone,
|
|
297
|
+
new Promise((r) => {
|
|
298
|
+
timer = setTimeout(r, maxMs);
|
|
299
|
+
timer.unref?.();
|
|
300
|
+
}),
|
|
301
|
+
]);
|
|
302
|
+
if (timer)
|
|
303
|
+
clearTimeout(timer);
|
|
304
|
+
}
|
|
305
|
+
catch (err) {
|
|
306
|
+
console.error(`org ${name}: scheduled run failed:`, err);
|
|
307
|
+
}
|
|
308
|
+
finally {
|
|
309
|
+
// A deadline stop still lands on agents mid-tool-call. The 15s abort
|
|
310
|
+
// bound threw that work away; a minute is enough to finish an edit or a
|
|
311
|
+
// test run and flush, and still well inside any sane interval.
|
|
312
|
+
if (startedHere) {
|
|
313
|
+
// #302: tag the real cause — a scheduled run hitting its own
|
|
314
|
+
// deadline is the same shape as an idle-stop (a timeout ending the
|
|
315
|
+
// run with possible backlog, not boss consent) and must not be
|
|
316
|
+
// rendered as a clean, boss-attributed outcome.
|
|
317
|
+
await daemon
|
|
318
|
+
.stopOrg(name, { drainMs: 60_000, closedBy: 'scheduled-deadline' })
|
|
319
|
+
.catch((err) => console.error(`org ${name}: stop failed:`, err));
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
// #264: before anything here can start an org — and so before the stop and
|
|
324
|
+
// reload polls below get their first pass — drop control files a previous
|
|
325
|
+
// daemon left behind, which this one would otherwise act on immediately.
|
|
326
|
+
clearStaleControlFiles(ctx.cwd);
|
|
327
|
+
const orgDir = join(ctx.cwd, ORG_DIR);
|
|
328
|
+
if (existsSync(orgDir)) {
|
|
329
|
+
for (const f of listOrgConfigFiles(orgDir)) {
|
|
330
|
+
try {
|
|
331
|
+
const def = JSON.parse(readFileSync(join(orgDir, f), 'utf8'));
|
|
332
|
+
const ms = parseSchedule(def.schedule);
|
|
333
|
+
if (ms) {
|
|
334
|
+
// register by filename stem — that's what startOrg loads
|
|
335
|
+
const stem = f.replace(/\.json$/, '');
|
|
336
|
+
if (def.name && def.name !== stem)
|
|
337
|
+
log(output.warning(`org file ${f}: def.name "${def.name}" differs from filename — scheduling as "${stem}"`));
|
|
338
|
+
// Due = never run, or last run ended longer ago than the interval.
|
|
339
|
+
// Without this, starting the daemon meant waiting a full period
|
|
340
|
+
// before anything happened at all; gating on due-ness means a
|
|
341
|
+
// restart doesn't stampede every scheduled org back into a run.
|
|
342
|
+
const lastEnded = readHistory(ctx.cwd, stem).at(-1)?.endedAt ?? 0;
|
|
343
|
+
const since = lastEnded ? Date.now() - lastEnded : undefined;
|
|
344
|
+
const due = (since ?? Infinity) >= ms;
|
|
345
|
+
sched.add(stem, ms, due, since);
|
|
346
|
+
const waitMin = due ? 0 : Math.round((ms - (since ?? 0)) / 60_000);
|
|
347
|
+
log(output.info(`scheduled org ${stem} every ${Math.round(ms / 60_000)}m${due ? ' — due now, starting first run' : ` — next run in ~${waitMin}m`}`));
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
catch (err) {
|
|
351
|
+
log(output.warning(`org file ${f}: could not parse — skipping (${err instanceof Error ? err.message : 'invalid JSON'})`));
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
// Each poll pass already wraps its own per-org daemon calls in try/catch,
|
|
356
|
+
// but a synchronous throw from something ahead of those (e.g.
|
|
357
|
+
// daemon.listRunning(), listOrgConfigFiles()) still rejects the async
|
|
358
|
+
// function itself. `void`-ing that call, as before, discards the promise
|
|
359
|
+
// without observing a rejection — which becomes an unhandled rejection at
|
|
360
|
+
// the process level and takes down every other org's in-flight run via
|
|
361
|
+
// crashExit, even though the failure was local to one poll pass. .catch()
|
|
362
|
+
// keeps it a per-pass, logged failure instead.
|
|
363
|
+
const stopPoll = setInterval(() => {
|
|
364
|
+
pollStopfiles(ctx.cwd, daemon).catch((err) => {
|
|
365
|
+
console.error('[org serve] stopfile poll failed:', err);
|
|
366
|
+
});
|
|
367
|
+
}, 2000);
|
|
368
|
+
stopPoll.unref?.();
|
|
369
|
+
const runPoll = setInterval(() => {
|
|
370
|
+
pollRunfiles(ctx.cwd, daemon).catch((err) => {
|
|
371
|
+
console.error('[org serve] runfile poll failed:', err);
|
|
372
|
+
});
|
|
373
|
+
}, 2000);
|
|
374
|
+
runPoll.unref?.();
|
|
375
|
+
const reloadPoll = setInterval(() => {
|
|
376
|
+
pollReloadfiles(ctx.cwd, daemon).catch((err) => {
|
|
377
|
+
console.error('[org serve] reloadfile poll failed:', err);
|
|
378
|
+
});
|
|
379
|
+
}, 2000);
|
|
380
|
+
reloadPoll.unref?.();
|
|
381
|
+
await new Promise((r) => {
|
|
382
|
+
process.once('SIGINT', () => r());
|
|
383
|
+
process.once('SIGTERM', () => r());
|
|
384
|
+
});
|
|
385
|
+
clearInterval(stopPoll);
|
|
386
|
+
clearInterval(runPoll);
|
|
387
|
+
clearInterval(reloadPoll);
|
|
388
|
+
clearInterval(heartbeatInterval);
|
|
389
|
+
sched.stop();
|
|
390
|
+
await daemon.stopAll();
|
|
391
|
+
daemon.clearHeartbeat();
|
|
392
|
+
srv?.close();
|
|
393
|
+
return { success: true };
|
|
394
|
+
};
|
|
395
|
+
//# sourceMappingURL=org-serve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org-serve.js","sourceRoot":"","sources":["../../../src/commands/org-serve.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EAAE;AACF,yEAAyE;AACzE,sEAAsE;AAEtE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,WAAW,EACX,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE7E,MAAM,GAAG,GAAG,CAAC,IAAY,EAAQ,EAAE;IACjC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;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AK,CAAC,qCAAqC,EAAE,GAAG,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,IAAI,CAAC,CAAC;IACT,UAAU,CAAC,KAAK,EAAE,EAAE,CAAC;IAErB,MAAM,IAAI,OAAO,CAAO,CAAC,CAAC,EAAE,EAAE;QAC5B,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IACH,aAAa,CAAC,QAAQ,CAAC,CAAC;IACxB,aAAa,CAAC,OAAO,CAAC,CAAC;IACvB,aAAa,CAAC,UAAU,CAAC,CAAC;IAC1B,aAAa,CAAC,iBAAiB,CAAC,CAAC;IACjC,KAAK,CAAC,IAAI,EAAE,CAAC;IACb,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;IACvB,MAAM,CAAC,cAAc,EAAE,CAAC;IACxB,GAAG,EAAE,KAAK,EAAE,CAAC;IACb,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Command } from '../types.js';
|
|
2
|
+
export declare const createSubcommand: Command;
|
|
3
|
+
export declare const validateSubcommand: Command;
|
|
4
|
+
export declare const migrateSubcommand: Command;
|
|
5
|
+
export declare const listSubcommand: Command;
|
|
6
|
+
export declare const deleteSubcommand: Command;
|
|
7
|
+
export declare const markCompleteSubcommand: Command;
|
|
8
|
+
//# sourceMappingURL=org-subcommands-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org-subcommands-config.d.ts","sourceRoot":"","sources":["../../../src/commands/org-subcommands-config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAiC,MAAM,aAAa,CAAC;AAI1E,eAAO,MAAM,gBAAgB,EAAE,OAmC9B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,OAchC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,OAU/B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,OAI5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,OAY9B,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,OAIpC,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// packages/@monomind/cli/src/commands/org-subcommands-config.ts
|
|
2
|
+
//
|
|
3
|
+
// `monomind org` config management subcommands: create, validate, migrate,
|
|
4
|
+
// list, delete, mark-complete.
|
|
5
|
+
import { validateOrgName } from './org-control.js';
|
|
6
|
+
import { deleteAction, listAction, markCompleteAction, migrateAction } from './org-manage.js';
|
|
7
|
+
export const createSubcommand = {
|
|
8
|
+
name: 'create',
|
|
9
|
+
description: 'Scaffold an org config from a starter template',
|
|
10
|
+
options: [
|
|
11
|
+
{
|
|
12
|
+
name: 'template',
|
|
13
|
+
description: 'content-team | dev-team | research-pod | kg-extraction | advisor-orchestrator',
|
|
14
|
+
type: 'string',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'goal',
|
|
18
|
+
description: "Org goal (defaults to the template's placeholder)",
|
|
19
|
+
type: 'string',
|
|
20
|
+
},
|
|
21
|
+
{ name: 'schedule', description: 'Daemon schedule, e.g. 30m or 2h', type: 'string' },
|
|
22
|
+
{ name: 'force', description: 'Overwrite an existing org config', type: 'boolean' },
|
|
23
|
+
{
|
|
24
|
+
name: 'yes',
|
|
25
|
+
short: 'y',
|
|
26
|
+
description: 'Skip the per-role model confirmation prompt (TTY only)',
|
|
27
|
+
type: 'boolean',
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
examples: [
|
|
31
|
+
{
|
|
32
|
+
command: 'monomind org create blog --template content-team --goal "3 posts/week"',
|
|
33
|
+
description: 'Create a content org',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
action: async (ctx) => {
|
|
37
|
+
const v = validateOrgName(ctx.args[0]);
|
|
38
|
+
if (!v.ok)
|
|
39
|
+
return v.result;
|
|
40
|
+
const { createAction } = await import('./org-observe.js');
|
|
41
|
+
return createAction(ctx, v.name);
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
export const validateSubcommand = {
|
|
45
|
+
name: 'validate',
|
|
46
|
+
description: 'Validate org config(s) against the runtime schema and structural invariants',
|
|
47
|
+
examples: [
|
|
48
|
+
{ command: 'monomind org validate growth', description: 'Validate one org config' },
|
|
49
|
+
{
|
|
50
|
+
command: 'monomind org validate',
|
|
51
|
+
description: 'Validate every org config in the project',
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
action: async (ctx) => {
|
|
55
|
+
const { validateAction } = await import('./org-observe.js');
|
|
56
|
+
return validateAction(ctx);
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
export const migrateSubcommand = {
|
|
60
|
+
name: 'migrate',
|
|
61
|
+
description: 'Convert a legacy-format org config (topology/board/loop) to the current format',
|
|
62
|
+
examples: [
|
|
63
|
+
{
|
|
64
|
+
command: 'monomind org migrate growth',
|
|
65
|
+
description: 'Migrate one org; original saved as growth.v1.json',
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
action: migrateAction,
|
|
69
|
+
};
|
|
70
|
+
export const listSubcommand = {
|
|
71
|
+
name: 'list',
|
|
72
|
+
description: 'List all orgs in the current project',
|
|
73
|
+
action: listAction,
|
|
74
|
+
};
|
|
75
|
+
export const deleteSubcommand = {
|
|
76
|
+
name: 'delete',
|
|
77
|
+
description: 'Delete an org and all its data',
|
|
78
|
+
options: [
|
|
79
|
+
{ name: 'yes', short: 'y', description: 'Skip confirmation', type: 'boolean' },
|
|
80
|
+
{
|
|
81
|
+
name: 'force',
|
|
82
|
+
description: 'Delete even if the org appears to be running',
|
|
83
|
+
type: 'boolean',
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
action: deleteAction,
|
|
87
|
+
};
|
|
88
|
+
export const markCompleteSubcommand = {
|
|
89
|
+
name: 'mark-complete',
|
|
90
|
+
description: 'Manually close a stale/crashed run',
|
|
91
|
+
action: markCompleteAction,
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=org-subcommands-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org-subcommands-config.js","sourceRoot":"","sources":["../../../src/commands/org-subcommands-config.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,EAAE;AACF,2EAA2E;AAC3E,+BAA+B;AAG/B,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE9F,MAAM,CAAC,MAAM,gBAAgB,GAAY;IACvC,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,gDAAgD;IAC7D,OAAO,EAAE;QACP;YACE,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,+EAA+E;YAC5F,IAAI,EAAE,QAAQ;SACf;QACD;YACE,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,mDAAmD;YAChE,IAAI,EAAE,QAAQ;SACf;QACD,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,iCAAiC,EAAE,IAAI,EAAE,QAAQ,EAAE;QACpF,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,kCAAkC,EAAE,IAAI,EAAE,SAAS,EAAE;QACnF;YACE,IAAI,EAAE,KAAK;YACX,KAAK,EAAE,GAAG;YACV,WAAW,EAAE,wDAAwD;YACrE,IAAI,EAAE,SAAS;SAChB;KACF;IACD,QAAQ,EAAE;QACR;YACE,OAAO,EAAE,wEAAwE;YACjF,WAAW,EAAE,sBAAsB;SACpC;KACF;IACD,MAAM,EAAE,KAAK,EAAE,GAAmB,EAA0B,EAAE;QAC5D,MAAM,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,GAAG,EAAE,WAAW,EAAE,mBAAmB,EAAE,IAAI,EAAE,SAAS,EAAE;QAC9E;YACE,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,8CAA8C;YAC3D,IAAI,EAAE,SAAS;SAChB;KACF;IACD,MAAM,EAAE,YAAY;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAY;IAC7C,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,oCAAoC;IACjD,MAAM,EAAE,kBAAkB;CAC3B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Command } from '../types.js';
|
|
2
|
+
export declare const inboxSubcommand: Command;
|
|
3
|
+
export declare const questionsSubcommand: Command;
|
|
4
|
+
export declare const approvalsSubcommand: Command;
|
|
5
|
+
export declare const answerSubcommand: Command;
|
|
6
|
+
export declare const approveSubcommand: Command;
|
|
7
|
+
export declare const denySubcommand: Command;
|
|
8
|
+
export declare const gatesSubcommand: Command;
|
|
9
|
+
export declare const gateApproveSubcommand: Command;
|
|
10
|
+
export declare const gateRejectSubcommand: Command;
|
|
11
|
+
//# sourceMappingURL=org-subcommands-hil.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org-subcommands-hil.d.ts","sourceRoot":"","sources":["../../../src/commands/org-subcommands-hil.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAiC,MAAM,aAAa,CAAC;AAG1E,eAAO,MAAM,eAAe,EAAE,OAsC7B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,OAajC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,OAWjC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,OAsB9B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,OA2B/B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,OA2B5B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,OAc7B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,OAsBnC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,OAsBlC,CAAC"}
|