@zerwiz/ymir 0.1.16 → 0.1.18
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/.agents/config/app-repos.yaml +38 -0
- package/.claude/settings.json +31 -0
- package/.codex/hooks.json +43 -0
- package/.cursor/hooks.json +33 -0
- package/.pi/extensions/README.md +39 -0
- package/.pi/extensions/gna-pi-watch.ts +15 -0
- package/.pi/extensions/lib/ro-assistant-layout.ts +96 -0
- package/.pi/extensions/lib/ro-operational-user-layout.ts +145 -0
- package/.pi/extensions/lib/ro-visibility.ts +99 -0
- package/.pi/extensions/lib/ro-working-ship.ts +243 -0
- package/.pi/extensions/lib/rodd-operational-input.ts +62 -0
- package/.pi/extensions/lib/skuld-branch-dispatch.ts +252 -0
- package/.pi/extensions/lib/skuld-branch-model-picker.ts +77 -0
- package/.pi/extensions/lib/vordr-sessionstart-supervisor.mjs +48 -0
- package/.pi/extensions/ro.ts +11 -0
- package/.pi/extensions/skuld-branch-supervision.ts +11 -0
- package/.pi/extensions/syn-turnend-guard.ts +11 -0
- package/.pi/mcp.json +16 -0
- package/.pi/mcp.json.example +11 -0
- package/.pi/npm/.gitignore +2 -0
- package/.pi/settings.json +8 -0
- package/.pi/shared/extensions/gna-pi-watch.ts +750 -0
- package/.pi/shared/extensions/herdr-agent-state.ts +257 -0
- package/.pi/shared/extensions/open-editor.ts +509 -0
- package/.pi/shared/extensions/ro.ts +504 -0
- package/.pi/shared/extensions/skuld-branch-supervision.ts +1535 -0
- package/.pi/shared/extensions/syn-turnend-guard.ts +683 -0
- package/.pi/shared/extensions/todo.ts +133 -0
- package/.pi/shared/extensions/ymir-subagents.ts +287 -0
- package/.pi/shared/extensions/ymir-well.ts +130 -0
- package/CHANGELOG.md +23 -0
- package/assets/Ymir.md +4654 -0
- package/assets/healer.html +717 -0
- package/assets/icon-family/family-sheet.png +0 -0
- package/assets/icon-family/hlidskjalf.svg +1 -0
- package/assets/icon-family/sessrumnir.svg +1 -0
- package/assets/icon-family/smidja.svg +1 -0
- package/assets/icon-family/ymir.svg +1 -0
- package/assets/mimirswell.html +880 -0
- package/assets/mock/README.md +16 -0
- package/assets/mock/feeds.ts +175 -0
- package/assets/mock/mock.ts +408 -0
- package/assets/reference/docs/agent-control.md +122 -0
- package/assets/reference/docs/apodex/Appdex_as_Orchestrator_Planner_Reviewer_Assessment.md +176 -0
- package/assets/reference/docs/apodex/Final Report(1).md +198 -0
- package/assets/reference/docs/apodex/Final Report(2).md +54 -0
- package/assets/reference/docs/apodex/Final Report(3).md +40 -0
- package/assets/reference/docs/apodex/Final Report(4).md +234 -0
- package/assets/reference/docs/apodex/Final Report(5).md +13 -0
- package/assets/reference/docs/apodex/Final Report.md +82 -0
- package/assets/reference/docs/architecture.md +392 -0
- package/assets/reference/docs/arm-pretool-check.md +247 -0
- package/assets/reference/docs/calm-mode-feasibility.md +541 -0
- package/assets/reference/docs/calm.md +59 -0
- package/assets/reference/docs/captain-hold-lifecycle.md +96 -0
- package/assets/reference/docs/cd-guard.md +165 -0
- package/assets/reference/docs/cmux-backend.md +133 -0
- package/assets/reference/docs/codex-app-backend.md +57 -0
- package/assets/reference/docs/configuration.md +924 -0
- package/assets/reference/docs/documentation-audiences.json +468 -0
- package/assets/reference/docs/documentation-audiences.md +28 -0
- package/assets/reference/docs/examples/crew-dispatch.json +26 -0
- package/assets/reference/docs/examples/process-event-extension/file-signal.mjs +96 -0
- package/assets/reference/docs/examples/process-event-extension/firstmate-extension.json +15 -0
- package/assets/reference/docs/examples/watched-tools.json +24 -0
- package/assets/reference/docs/examples/wedge-alarm +22 -0
- package/assets/reference/docs/extension-bindings.md +237 -0
- package/assets/reference/docs/fm-test-isolation-proof.json +37 -0
- package/assets/reference/docs/fm-test-isolation-proof.md +149 -0
- package/assets/reference/docs/fm-test-portable-shards.md +118 -0
- package/assets/reference/docs/gitlab-merge-watch.md +275 -0
- package/assets/reference/docs/herdr-backend.md +346 -0
- package/assets/reference/docs/orca-backend.md +84 -0
- package/assets/reference/docs/pi-supervision-branch-poster.svg +125 -0
- package/assets/reference/docs/pi-supervision-branch.md +96 -0
- package/assets/reference/docs/plans/agentic-engineering-workflow.md +395 -0
- package/assets/reference/docs/plans/agentic-factory-implementation-plan.md +615 -0
- package/assets/reference/docs/plans/command-factory-enhancement-plan.md +420 -0
- package/assets/reference/docs/plans/phase-1-layer3-program-design.md +134 -0
- package/assets/reference/docs/plans/phase-2-vertical-slices.md +100 -0
- package/assets/reference/docs/plans/phase-3-measurable-goals.md +106 -0
- package/assets/reference/docs/plans/phase-4-context-budget.md +106 -0
- package/assets/reference/docs/plans/phase-5-pre-mortem-confidence.md +100 -0
- package/assets/reference/docs/plans/phase-6-incident-to-agent.md +109 -0
- package/assets/reference/docs/remote-secondmates.md +268 -0
- package/assets/reference/docs/scripts.md +146 -0
- package/assets/reference/docs/sessionstart-nudge.md +115 -0
- package/assets/reference/docs/subagent-guard.md +383 -0
- package/assets/reference/docs/supervision-protocols/claude.md +27 -0
- package/assets/reference/docs/supervision-protocols/codex.md +16 -0
- package/assets/reference/docs/supervision-protocols/cursor.md +31 -0
- package/assets/reference/docs/supervision-protocols/grok.md +39 -0
- package/assets/reference/docs/supervision-protocols/opencode.md +17 -0
- package/assets/reference/docs/supervision-protocols/pi.md +33 -0
- package/assets/reference/docs/supervision-protocols/unknown.md +13 -0
- package/assets/reference/docs/tmux-backend.md +115 -0
- package/assets/reference/docs/trace-context.md +117 -0
- package/assets/reference/docs/turnend-guard.md +170 -0
- package/assets/reference/docs/verification/dispatch-auth.md +204 -0
- package/assets/reference/docs/verification/muse.md +221 -0
- package/assets/reference/docs/verification/process-event-sources.md +208 -0
- package/assets/reference/docs/verification/public-followup.md +119 -0
- package/assets/reference/docs/verification/runtime-backends.md +1022 -0
- package/assets/reference/docs/verification/stow-memory.md +53 -0
- package/assets/reference/docs/verification/supervision.md +534 -0
- package/assets/reference/docs/verification/trace-context.md +31 -0
- package/assets/reference/docs/voice-relay.md +295 -0
- package/assets/reference/docs/watcher-continuity.md +119 -0
- package/assets/reference/docs/wedge-alarm.md +39 -0
- package/assets/reference/docs/zellij-backend.md +114 -0
- package/assets/reference/index.html +1172 -0
- package/assets/reference/skills/afk/SKILL.md +241 -0
- package/assets/reference/skills/ahoy/SKILL.md +56 -0
- package/assets/reference/skills/ask-user-authority/SKILL.md +56 -0
- package/assets/reference/skills/bearings/SKILL.md +161 -0
- package/assets/reference/skills/bearings/assets/board-template.html +731 -0
- package/assets/reference/skills/bootstrap-diagnostics/SKILL.md +68 -0
- package/assets/reference/skills/captain-hold-lifecycle/SKILL.md +54 -0
- package/assets/reference/skills/decision-hold-lifecycle/SKILL.md +15 -0
- package/assets/reference/skills/diagnostic-reasoning/SKILL.md +53 -0
- package/assets/reference/skills/firstmate-codexapp/SKILL.md +110 -0
- package/assets/reference/skills/firstmate-codexapp/agents/openai.yaml +4 -0
- package/assets/reference/skills/firstmate-coding-guidelines/SKILL.md +127 -0
- package/assets/reference/skills/firstmate-orca/SKILL.md +92 -0
- package/assets/reference/skills/fmx-respond/SKILL.md +283 -0
- package/assets/reference/skills/harness-adapters/SKILL.md +95 -0
- package/assets/reference/skills/harness-adapters/references/common/control-and-recovery.md +37 -0
- package/assets/reference/skills/harness-adapters/references/common/dispatch.md +32 -0
- package/assets/reference/skills/harness-adapters/references/common/model-and-effort.md +42 -0
- package/assets/reference/skills/harness-adapters/references/common/primary-hooks.md +40 -0
- package/assets/reference/skills/harness-adapters/references/harness/claude.md +55 -0
- package/assets/reference/skills/harness-adapters/references/harness/codex.md +43 -0
- package/assets/reference/skills/harness-adapters/references/harness/cursor.md +75 -0
- package/assets/reference/skills/harness-adapters/references/harness/grok.md +69 -0
- package/assets/reference/skills/harness-adapters/references/harness/kimi.md +51 -0
- package/assets/reference/skills/harness-adapters/references/harness/muse.md +70 -0
- package/assets/reference/skills/harness-adapters/references/harness/opencode.md +42 -0
- package/assets/reference/skills/harness-adapters/references/harness/pi.md +56 -0
- package/assets/reference/skills/process-event-sources/SKILL.md +137 -0
- package/assets/reference/skills/project-management/SKILL.md +92 -0
- package/assets/reference/skills/quota-array-dispatch/SKILL.md +131 -0
- package/assets/reference/skills/secondmate-provisioning/SKILL.md +254 -0
- package/assets/reference/skills/stow/SKILL.md +309 -0
- package/assets/reference/skills/stuck-crewmate-recovery/SKILL.md +54 -0
- package/assets/reference/skills/updatefirstmate/SKILL.md +64 -0
- package/assets/skills/README.md +5 -0
- package/assets/yggdrasil.html +649 -0
- package/assets/ymir-banner-01.png +0 -0
- package/assets/ymir-banner-02.png +0 -0
- package/assets/ymir-banner-03.png +0 -0
- package/assets/ymir-banner-04.png +0 -0
- package/assets/ymir-banner-05.png +0 -0
- package/assets/ymir-banner-06.png +0 -0
- package/assets/ymir-emblem-darksteel.svg +63 -0
- package/assets/ymir-emblem-forged.svg +55 -0
- package/assets/ymir-emblem-slate.svg +55 -0
- package/assets/ymir-mark-algiz-anvil.svg +9 -0
- package/assets/ymir-stave.svg +53 -0
- package/assets/ymir.html +563 -0
- package/bin/ymir-install.sh +6 -1
- package/data/learnings.md +33 -0
- package/data/local-models.md +34 -0
- package/data/operator.md +15 -0
- package/data/projects.md +28 -0
- package/data/realm.md +1 -0
- package/deploy/Containerfile +27 -0
- package/deploy/README.md +104 -0
- package/deploy/compose/compose.yaml +45 -0
- package/deploy/env.example +30 -0
- package/deploy/quadlet/ymir.container +57 -0
- package/package.json +10 -8
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
// installed by herdr
|
|
2
|
+
// managed by herdr; reinstalling or updating the integration overwrites this file.
|
|
3
|
+
// add custom hooks/plugins beside this file instead of editing it.
|
|
4
|
+
// HERDR_INTEGRATION_ID=pi
|
|
5
|
+
// HERDR_INTEGRATION_VERSION=8
|
|
6
|
+
// @ts-nocheck
|
|
7
|
+
|
|
8
|
+
import net from "node:net";
|
|
9
|
+
|
|
10
|
+
const HERDR_ENV = process.env.HERDR_ENV;
|
|
11
|
+
const socketPath = process.env.HERDR_SOCKET_PATH;
|
|
12
|
+
const socketEndpoint =
|
|
13
|
+
process.platform === "win32" && socketPath ? `\\\\.\\pipe\\${socketPath}` : socketPath;
|
|
14
|
+
const paneId = process.env.HERDR_PANE_ID;
|
|
15
|
+
const source = "herdr:pi";
|
|
16
|
+
|
|
17
|
+
function enabled() {
|
|
18
|
+
return HERDR_ENV === "1" && !!socketPath && !!paneId;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function sendRequestAttempt(request: unknown, timeoutMs: number): Promise<boolean> {
|
|
22
|
+
if (!enabled()) {
|
|
23
|
+
return Promise.resolve(true);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return new Promise((resolve) => {
|
|
27
|
+
let done = false;
|
|
28
|
+
let timeout: ReturnType<typeof setTimeout> | undefined;
|
|
29
|
+
const finish = (delivered: boolean) => {
|
|
30
|
+
if (done) return;
|
|
31
|
+
done = true;
|
|
32
|
+
if (timeout) {
|
|
33
|
+
clearTimeout(timeout);
|
|
34
|
+
}
|
|
35
|
+
socket.destroy();
|
|
36
|
+
resolve(delivered);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const socket = net.createConnection(socketEndpoint!);
|
|
40
|
+
socket.on("error", () => finish(false));
|
|
41
|
+
socket.on("connect", () => socket.write(`${JSON.stringify(request)}\n`));
|
|
42
|
+
socket.on("data", () => finish(true));
|
|
43
|
+
socket.on("end", () => finish(false));
|
|
44
|
+
timeout = setTimeout(() => finish(false), timeoutMs);
|
|
45
|
+
timeout.unref?.();
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async function sendRequest(request: unknown): Promise<void> {
|
|
50
|
+
if (await sendRequestAttempt(request, 500)) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
await sendRequestAttempt(request, 1500);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
type AgentState = "working" | "blocked" | "idle";
|
|
57
|
+
|
|
58
|
+
type QueuedState = {
|
|
59
|
+
state: AgentState;
|
|
60
|
+
message?: string;
|
|
61
|
+
seq: number;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
let reportSeq = Date.now() * 1000;
|
|
65
|
+
let currentAgentSessionId: string | undefined;
|
|
66
|
+
let currentAgentSessionPath: string | undefined;
|
|
67
|
+
|
|
68
|
+
function nextReportSeq(): number {
|
|
69
|
+
reportSeq += 1;
|
|
70
|
+
return reportSeq;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function updateSessionRef(ctx: any): void {
|
|
74
|
+
try {
|
|
75
|
+
const file = ctx?.sessionManager?.getSessionFile?.();
|
|
76
|
+
currentAgentSessionPath =
|
|
77
|
+
typeof file === "string" && file.startsWith("/") ? file : undefined;
|
|
78
|
+
} catch {
|
|
79
|
+
currentAgentSessionPath = undefined;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
try {
|
|
83
|
+
const id = ctx?.sessionManager?.getSessionId?.();
|
|
84
|
+
currentAgentSessionId = typeof id === "string" && id.length > 0 ? id : undefined;
|
|
85
|
+
} catch {
|
|
86
|
+
currentAgentSessionId = undefined;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function withSessionRef(params: Record<string, unknown>): Record<string, unknown> {
|
|
91
|
+
if (currentAgentSessionPath) {
|
|
92
|
+
return { ...params, agent_session_path: currentAgentSessionPath };
|
|
93
|
+
}
|
|
94
|
+
if (currentAgentSessionId) {
|
|
95
|
+
return { ...params, agent_session_id: currentAgentSessionId };
|
|
96
|
+
}
|
|
97
|
+
return params;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function currentSessionRef(): Record<string, unknown> | undefined {
|
|
101
|
+
if (currentAgentSessionPath) {
|
|
102
|
+
return { agent_session_path: currentAgentSessionPath };
|
|
103
|
+
}
|
|
104
|
+
if (currentAgentSessionId) {
|
|
105
|
+
return { agent_session_id: currentAgentSessionId };
|
|
106
|
+
}
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function reportSession(sessionStartSource?: string): Promise<void> {
|
|
111
|
+
const sessionRef = currentSessionRef();
|
|
112
|
+
if (!sessionRef) {
|
|
113
|
+
return Promise.resolve();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return sendRequest({
|
|
117
|
+
id: `${source}:session:${Date.now()}:${Math.random().toString(36).slice(2)}`,
|
|
118
|
+
method: "pane.report_agent_session",
|
|
119
|
+
params: {
|
|
120
|
+
pane_id: paneId,
|
|
121
|
+
source,
|
|
122
|
+
agent: "pi",
|
|
123
|
+
seq: nextReportSeq(),
|
|
124
|
+
session_start_source: sessionStartSource,
|
|
125
|
+
...sessionRef,
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function sendState(state: AgentState, message?: string, seq = nextReportSeq()): Promise<void> {
|
|
131
|
+
return sendRequest({
|
|
132
|
+
id: `${source}:${Date.now()}:${Math.random().toString(36).slice(2)}`,
|
|
133
|
+
method: "pane.report_agent",
|
|
134
|
+
params: withSessionRef({
|
|
135
|
+
pane_id: paneId,
|
|
136
|
+
source,
|
|
137
|
+
agent: "pi",
|
|
138
|
+
state,
|
|
139
|
+
message,
|
|
140
|
+
seq,
|
|
141
|
+
}),
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
let sendInFlight = false;
|
|
146
|
+
let queuedState: QueuedState | undefined;
|
|
147
|
+
|
|
148
|
+
function queueState(state: AgentState, message?: string): void {
|
|
149
|
+
queuedState = { state, message, seq: nextReportSeq() };
|
|
150
|
+
if (!sendInFlight) {
|
|
151
|
+
void drainStateQueue();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
async function drainStateQueue(): Promise<void> {
|
|
156
|
+
if (sendInFlight) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
sendInFlight = true;
|
|
161
|
+
try {
|
|
162
|
+
while (queuedState) {
|
|
163
|
+
const next = queuedState;
|
|
164
|
+
queuedState = undefined;
|
|
165
|
+
await sendState(next.state, next.message, next.seq);
|
|
166
|
+
}
|
|
167
|
+
} finally {
|
|
168
|
+
sendInFlight = false;
|
|
169
|
+
if (queuedState) {
|
|
170
|
+
void drainStateQueue();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export default function (pi) {
|
|
176
|
+
if (!enabled()) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
let agentActive = false;
|
|
181
|
+
let blockedCount = 0;
|
|
182
|
+
let blockedMessage: string | undefined;
|
|
183
|
+
let lastState: AgentState | undefined;
|
|
184
|
+
let lastMessage: string | undefined;
|
|
185
|
+
let rootSession = false;
|
|
186
|
+
|
|
187
|
+
function desiredState() {
|
|
188
|
+
if (blockedCount > 0) {
|
|
189
|
+
return { state: "blocked" as const, message: blockedMessage };
|
|
190
|
+
}
|
|
191
|
+
if (agentActive) {
|
|
192
|
+
return { state: "working" as const, message: undefined };
|
|
193
|
+
}
|
|
194
|
+
return { state: "idle" as const, message: undefined };
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function publishState(force = false) {
|
|
198
|
+
const next = desiredState();
|
|
199
|
+
if (!force && next.state === lastState && next.message === lastMessage) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
lastState = next.state;
|
|
203
|
+
lastMessage = next.message;
|
|
204
|
+
queueState(next.state, next.message);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
pi.events.on("herdr:blocked", (data) => {
|
|
208
|
+
if (!rootSession) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
if (!data?.active) {
|
|
212
|
+
blockedCount = Math.max(0, blockedCount - 1);
|
|
213
|
+
if (blockedCount === 0) {
|
|
214
|
+
blockedMessage = undefined;
|
|
215
|
+
}
|
|
216
|
+
publishState();
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
blockedCount += 1;
|
|
221
|
+
blockedMessage = data.label;
|
|
222
|
+
publishState();
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
pi.on("session_start", async (event, ctx) => {
|
|
226
|
+
// TUI only: RPC/JSON/print modes are headless (no PTY herdr can display),
|
|
227
|
+
// and RPC still reports hasUI=true, so mode is the reliable gate.
|
|
228
|
+
if (ctx?.mode !== "tui") {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
rootSession = true;
|
|
232
|
+
updateSessionRef(ctx);
|
|
233
|
+
await reportSession(event?.reason);
|
|
234
|
+
// A reload can replace this extension mid-run without emitting another agent_start.
|
|
235
|
+
agentActive = ctx?.isIdle?.() === false;
|
|
236
|
+
publishState(true);
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
pi.on("agent_start", (_event, ctx) => {
|
|
240
|
+
if (!rootSession) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
updateSessionRef(ctx);
|
|
244
|
+
void reportSession();
|
|
245
|
+
agentActive = true;
|
|
246
|
+
publishState();
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
pi.on("agent_settled", (_event, ctx) => {
|
|
250
|
+
if (!rootSession || ctx?.isIdle?.() !== true) {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
agentActive = false;
|
|
255
|
+
publishState();
|
|
256
|
+
});
|
|
257
|
+
}
|