@polderlabs/bizar-omp 0.7.4 → 0.7.6
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 +4 -4
- package/dist/cli/doctor.d.ts +4 -4
- package/dist/cli/install.d.ts +5 -1
- package/dist/cli/install.d.ts.map +1 -1
- package/dist/cli/install.js +17 -7
- package/dist/cli/install.js.map +1 -1
- package/dist/cli/main.js +2 -0
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/omb-update.d.ts +9 -0
- package/dist/cli/omb-update.d.ts.map +1 -1
- package/dist/cli/omb-update.js +74 -8
- package/dist/cli/omb-update.js.map +1 -1
- package/dist/cli/update-ink.d.ts +1 -1
- package/dist/cli/update-ink.d.ts.map +1 -1
- package/dist/cli/update-ink.js +59 -10
- package/dist/cli/update-ink.js.map +1 -1
- package/dist/extension.d.ts +4 -6
- package/dist/extension.d.ts.map +1 -1
- package/dist/extension.js +69 -30
- package/dist/extension.js.map +1 -1
- package/dist/omp/compatibility.d.ts +13 -5
- package/dist/omp/compatibility.d.ts.map +1 -1
- package/dist/omp/compatibility.js +15 -2
- package/dist/omp/compatibility.js.map +1 -1
- package/dist/omp/context.d.ts +0 -7
- package/dist/omp/context.d.ts.map +1 -1
- package/dist/omp/context.js +0 -1
- package/dist/omp/context.js.map +1 -1
- package/docs/compatibility/baseline.json +10 -8
- package/docs/compatibility/supported-surfaces.json +3 -1
- package/docs/development/ci-release-implementation-guide.md +9 -4
- package/docs/development/contributing-and-releasing.md +17 -4
- package/docs/releases/0.7.5.md +3 -0
- package/docs/releases/0.7.6.md +34 -0
- package/docs/releases/npm-publishing.md +9 -7
- package/docs/releases/support-matrix.md +1 -1
- package/package.json +1 -1
- package/skills/omp-native-development/SKILL.md +1 -1
- package/skills/omp-native-development/references/accuracy-and-versioning.md +1 -1
- package/skills/omp-native-development/references/source-manifest.json +3 -3
package/dist/cli/update-ink.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Text, render, useApp, useInput } from "ink";
|
|
3
3
|
import { OMP_THEME } from "./omp-theme.js";
|
|
4
|
-
import { PACKAGE_NAME, compareVersions, validVersion } from "./omb-update.js";
|
|
5
|
-
export const UPDATE_STAGE_KEYS = ["checking", "installing", "refreshing"];
|
|
4
|
+
import { OMP_PACKAGE_NAME, PACKAGE_NAME, compareVersions, validOmpVersion, validVersion } from "./omb-update.js";
|
|
5
|
+
export const UPDATE_STAGE_KEYS = ["checking", "updating-omp", "installing", "refreshing"];
|
|
6
6
|
export const UPDATE_STAGE_LABELS = {
|
|
7
7
|
checking: "Checking npm registry",
|
|
8
|
+
"updating-omp": "Updating OMP",
|
|
8
9
|
installing: "Installing global package",
|
|
9
10
|
refreshing: "Refreshing OMP plugin",
|
|
10
11
|
};
|
|
@@ -30,7 +31,7 @@ const initialProgress = () => ({
|
|
|
30
31
|
currentVersion: "checking…",
|
|
31
32
|
latestVersion: "checking…",
|
|
32
33
|
updateAvailable: false,
|
|
33
|
-
stages: { checking: "pending", installing: "pending", refreshing: "pending" },
|
|
34
|
+
stages: { checking: "pending", "updating-omp": "pending", installing: "pending", refreshing: "pending" },
|
|
34
35
|
});
|
|
35
36
|
/**
|
|
36
37
|
* The update pipeline behind the Ink view. Runs the same services as the text
|
|
@@ -60,8 +61,10 @@ export async function performUpdate(services, env, onProgress) {
|
|
|
60
61
|
progress: snapshot(),
|
|
61
62
|
report: {
|
|
62
63
|
ok: false, command: "update", currentVersion: "unknown", latestVersion: "unknown",
|
|
63
|
-
updateAvailable: false, dryRun: false, checked: false,
|
|
64
|
-
|
|
64
|
+
updateAvailable: false, dryRun: false, checked: false,
|
|
65
|
+
global: "failed", ompUpdate: "skipped", ompUpdateReason: "version lookup failed",
|
|
66
|
+
plugin: "skipped", pluginReason: "version lookup failed",
|
|
67
|
+
error: error instanceof Error ? error.message : String(error),
|
|
65
68
|
},
|
|
66
69
|
};
|
|
67
70
|
}
|
|
@@ -69,6 +72,33 @@ export async function performUpdate(services, env, onProgress) {
|
|
|
69
72
|
progress.latestVersion = latestVersion;
|
|
70
73
|
progress.updateAvailable = compareVersions(latestVersion, currentVersion) > 0;
|
|
71
74
|
setStage("checking", "ok");
|
|
75
|
+
setStage("updating-omp", "running");
|
|
76
|
+
let ompVersion;
|
|
77
|
+
let ompUpdateResult = "skipped";
|
|
78
|
+
let ompUpdateReason;
|
|
79
|
+
try {
|
|
80
|
+
ompVersion = services.ompCurrentVersion();
|
|
81
|
+
const ompLatest = validOmpVersion(services.ompLatestVersion());
|
|
82
|
+
if (ompVersion && compareVersions(ompLatest, ompVersion) > 0) {
|
|
83
|
+
try {
|
|
84
|
+
services.installOmp(`${OMP_PACKAGE_NAME}@${ompLatest}`);
|
|
85
|
+
ompUpdateResult = "updated";
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
ompUpdateResult = "failed";
|
|
89
|
+
ompUpdateReason = error instanceof Error ? error.message : String(error);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
ompUpdateResult = "current";
|
|
94
|
+
}
|
|
95
|
+
setStage("updating-omp", ompUpdateResult === "failed" ? "failed" : "ok");
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
ompUpdateResult = "skipped";
|
|
99
|
+
ompUpdateReason = error instanceof Error ? error.message : String(error);
|
|
100
|
+
setStage("updating-omp", "failed");
|
|
101
|
+
}
|
|
72
102
|
if (!progress.updateAvailable) {
|
|
73
103
|
setStage("installing", "ok");
|
|
74
104
|
}
|
|
@@ -85,8 +115,10 @@ export async function performUpdate(services, env, onProgress) {
|
|
|
85
115
|
progress: snapshot(),
|
|
86
116
|
report: {
|
|
87
117
|
ok: false, command: "update", currentVersion, latestVersion, updateAvailable: true,
|
|
88
|
-
dryRun: false, checked: false,
|
|
89
|
-
|
|
118
|
+
dryRun: false, checked: false,
|
|
119
|
+
global: "failed", ompUpdate: ompUpdateResult, ...(ompUpdateReason ? { ompUpdateReason } : {}),
|
|
120
|
+
plugin: "skipped", pluginReason: "global package was not updated",
|
|
121
|
+
...(ompVersion ? { ompVersion } : {}),
|
|
90
122
|
error: error instanceof Error ? error.message : String(error),
|
|
91
123
|
},
|
|
92
124
|
};
|
|
@@ -95,15 +127,29 @@ export async function performUpdate(services, env, onProgress) {
|
|
|
95
127
|
}
|
|
96
128
|
setStage("refreshing", "running");
|
|
97
129
|
try {
|
|
98
|
-
const
|
|
130
|
+
const pluginResult = services.refreshPlugin(spec, env);
|
|
131
|
+
const pluginSkipped = pluginResult === undefined;
|
|
132
|
+
const pluginOutput = typeof pluginResult === "string"
|
|
133
|
+
? (() => { try {
|
|
134
|
+
return JSON.parse(pluginResult);
|
|
135
|
+
}
|
|
136
|
+
catch {
|
|
137
|
+
return {};
|
|
138
|
+
} })()
|
|
139
|
+
: {};
|
|
99
140
|
setStage("refreshing", "ok");
|
|
100
141
|
return {
|
|
101
142
|
exitCode: 0,
|
|
102
143
|
progress: snapshot(),
|
|
103
144
|
report: {
|
|
104
145
|
ok: true, command: "update", currentVersion, latestVersion, updateAvailable: progress.updateAvailable,
|
|
105
|
-
dryRun: false, checked: false,
|
|
146
|
+
dryRun: false, checked: false,
|
|
147
|
+
global: progress.updateAvailable ? "updated" : "current",
|
|
148
|
+
ompUpdate: ompUpdateResult, ...(ompUpdateReason ? { ompUpdateReason } : {}),
|
|
149
|
+
plugin: pluginSkipped ? "skipped" : "updated",
|
|
106
150
|
...(pluginSkipped ? { pluginReason: progress.updateAvailable ? "omp executable not found" : "omp executable not found; no package update required" } : {}),
|
|
151
|
+
...(ompVersion ? { ompVersion } : {}),
|
|
152
|
+
...(pluginOutput.notice ? { notice: pluginOutput.notice } : {}),
|
|
107
153
|
},
|
|
108
154
|
};
|
|
109
155
|
}
|
|
@@ -114,7 +160,10 @@ export async function performUpdate(services, env, onProgress) {
|
|
|
114
160
|
progress: snapshot(),
|
|
115
161
|
report: {
|
|
116
162
|
ok: false, command: "update", currentVersion, latestVersion, updateAvailable: progress.updateAvailable,
|
|
117
|
-
dryRun: false, checked: false,
|
|
163
|
+
dryRun: false, checked: false,
|
|
164
|
+
global: progress.updateAvailable ? "updated" : "current",
|
|
165
|
+
ompUpdate: ompUpdateResult, ...(ompUpdateReason ? { ompUpdateReason } : {}),
|
|
166
|
+
plugin: "failed", ...(ompVersion ? { ompVersion } : {}),
|
|
118
167
|
error: `${progress.updateAvailable ? "global package updated" : "global package is current"}, but OMP plugin refresh failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
119
168
|
},
|
|
120
169
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-ink.js","sourceRoot":"","sources":["../../src/cli/update-ink.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,YAAY,EAA0C,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"update-ink.js","sourceRoot":"","sources":["../../src/cli/update-ink.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAA0C,MAAM,iBAAiB,CAAC;AAKzJ,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,CAAU,CAAC;AAGnG,MAAM,CAAC,MAAM,mBAAmB,GAAmC;IACjE,QAAQ,EAAE,uBAAuB;IACj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,OAAO,CAAC,MAAM,CAAC;IAC1D,IAAI,OAAO,CAAC,MAAM;QAAE,aAAa,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAE1D,MAAM,GAAG,GAAG,MAAM,CAAC,KAAC,QAAQ,IAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAI,EAAE,aAAa,CAAC,CAAC;IAEpF,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE;YACvD,QAAQ,GAAG,IAAI,CAAC;YAChB,GAAG,CAAC,QAAQ,CAAC,KAAC,QAAQ,IAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAI,CAAC,CAAC;QACjE,CAAC,CAAC,CAAC;QACH,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QACvB,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IAC7B,CAAC;YAAS,CAAC;QACT,GAAG,CAAC,QAAQ,CAAC,KAAC,QAAQ,IAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAI,CAAC,CAAC;QAC/D,GAAG,CAAC,OAAO,EAAE,CAAC;IAChB,CAAC;IAED,OAAO,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5B,CAAC"}
|
package/dist/extension.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AvailableModel } from "./omp/model-role-assignment.js";
|
|
2
2
|
interface NativeSettings {
|
|
3
|
-
get(path: string): unknown;
|
|
3
|
+
get?(path: string): unknown;
|
|
4
4
|
set?(path: string, value: unknown): void;
|
|
5
5
|
setModelRole?(role: string, selector: string): void;
|
|
6
6
|
setProjectModelRole?(role: string, selector: string): void;
|
|
@@ -40,11 +40,9 @@ interface OmpZod {
|
|
|
40
40
|
}>;
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
|
-
* Mirrors `SendUserMessageOptions` from the qualified OMP public contract
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* who initiated the message. Defaults record `"user"`; `"agent"` marks
|
|
47
|
-
* extension-generated guidance as agent-authored.
|
|
43
|
+
* Mirrors `SendUserMessageOptions` from the qualified OMP public contract.
|
|
44
|
+
* The command is explicitly invoked by the user, so its resulting request stays
|
|
45
|
+
* attributed to the user in the native session.
|
|
48
46
|
*/
|
|
49
47
|
interface OmpSendUserMessageOptions {
|
|
50
48
|
deliverAs?: "steer" | "followUp" | "aside";
|
package/dist/extension.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAKrE,UAAU,cAAc;IACtB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAKrE,UAAU,cAAc;IACtB,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACzC,YAAY,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACpD,mBAAmB,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5D;AAED,UAAU,aAAa;IACrB,IAAI,CAAC,IAAI,cAAc,EAAE,CAAC;IAC1B,OAAO,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,OA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C,OAAO,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC;IAClG,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClI;AAmYD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,EAAE,KAAK,QAkZ/C"}
|
package/dist/extension.js
CHANGED
|
@@ -186,41 +186,69 @@ function applyBizarModelRoles(pi, assignments) {
|
|
|
186
186
|
settings.setModelRole(assignment.role, assignment.selector);
|
|
187
187
|
return "global";
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
async function setNativeSetting(pi, settings, key, value, cwd) {
|
|
190
|
+
if (settings?.set) {
|
|
191
|
+
settings.set(key, value);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
if (!pi.exec)
|
|
195
|
+
throw new ContractError(`OMP cannot update ${key}: its settings writer is unavailable`);
|
|
196
|
+
const command = findOnPath("omp", process.env) ?? "omp";
|
|
197
|
+
const result = await pi.exec(command, ["config", "set", key, JSON.stringify(value)], { cwd });
|
|
198
|
+
if (result.code !== 0)
|
|
199
|
+
throw new ContractError(`OMP could not update ${key} through its config command (exit ${result.code ?? "unknown"})`);
|
|
200
|
+
}
|
|
201
|
+
async function getNativeSetting(pi, settings, key, cwd) {
|
|
202
|
+
if (settings?.get)
|
|
203
|
+
return settings.get(key);
|
|
204
|
+
if (!pi.exec)
|
|
205
|
+
throw new ContractError(`OMP cannot read ${key}: its config command is unavailable`);
|
|
206
|
+
const command = findOnPath("omp", process.env) ?? "omp";
|
|
207
|
+
const result = await pi.exec(command, ["config", "get", key, "--json"], { cwd });
|
|
208
|
+
if (result.code !== 0)
|
|
209
|
+
throw new ContractError(`OMP could not read ${key} through its config command (exit ${result.code ?? "unknown"})`);
|
|
210
|
+
try {
|
|
211
|
+
return JSON.parse(result.stdout ?? "").value;
|
|
212
|
+
}
|
|
213
|
+
catch {
|
|
214
|
+
throw new ContractError(`OMP returned invalid JSON while reading ${key}`);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
async function ensureBizarModelRoles(pi, cwd) {
|
|
190
218
|
const settings = pi.pi?.settings;
|
|
191
|
-
if (!settings
|
|
219
|
+
if (!settings && !pi.exec)
|
|
192
220
|
return;
|
|
193
|
-
const currentRoles = recordOf(settings
|
|
221
|
+
const currentRoles = recordOf(await getNativeSetting(pi, settings, "modelRoles", cwd));
|
|
194
222
|
const missingRoles = Object.entries(BIZAR_MODEL_ROLES).filter(([role]) => typeof currentRoles[role] !== "string");
|
|
195
|
-
const projectStorage = settings
|
|
196
|
-
const roleSetter = projectStorage ? settings
|
|
223
|
+
const projectStorage = await getNativeSetting(pi, settings, "modelRoleStorage", cwd) === "project";
|
|
224
|
+
const roleSetter = projectStorage ? settings?.setProjectModelRole : settings?.setModelRole;
|
|
197
225
|
if (roleSetter) {
|
|
198
226
|
for (const [role, selector] of missingRoles)
|
|
199
227
|
roleSetter.call(settings, role, selector);
|
|
200
228
|
}
|
|
201
|
-
const currentTags = recordOf(settings
|
|
229
|
+
const currentTags = recordOf(await getNativeSetting(pi, settings, "modelTags", cwd));
|
|
202
230
|
const nextTags = { ...currentTags };
|
|
203
231
|
for (const [role, tag] of Object.entries(BIZAR_MODEL_TAGS))
|
|
204
232
|
if (!Object.hasOwn(nextTags, role))
|
|
205
233
|
nextTags[role] = tag;
|
|
206
|
-
if (
|
|
207
|
-
settings
|
|
208
|
-
const currentCycle = settings
|
|
234
|
+
if (JSON.stringify(nextTags) !== JSON.stringify(currentTags))
|
|
235
|
+
await setNativeSetting(pi, settings, "modelTags", nextTags, cwd);
|
|
236
|
+
const currentCycle = await getNativeSetting(pi, settings, "cycleOrder", cwd);
|
|
209
237
|
const nextCycle = Array.isArray(currentCycle) ? currentCycle.filter((role) => typeof role === "string") : [];
|
|
210
238
|
for (const role of Object.keys(BIZAR_MODEL_ROLES))
|
|
211
239
|
if (!nextCycle.includes(role))
|
|
212
240
|
nextCycle.push(role);
|
|
213
|
-
if (
|
|
214
|
-
settings
|
|
241
|
+
if (JSON.stringify(nextCycle) !== JSON.stringify(currentCycle))
|
|
242
|
+
await setNativeSetting(pi, settings, "cycleOrder", nextCycle, cwd);
|
|
215
243
|
}
|
|
216
|
-
function modelRoleHealth(pi, ctx, routeResponses) {
|
|
244
|
+
async function modelRoleHealth(pi, ctx, routeResponses) {
|
|
217
245
|
const settings = pi.pi?.settings;
|
|
218
|
-
if (!settings?.get)
|
|
246
|
+
if (!settings?.get && !pi.exec)
|
|
219
247
|
throw new ContractError("OMP settings API is unavailable; cannot inspect configured Bizar model roles");
|
|
220
248
|
const resolver = ctx.models?.resolve;
|
|
221
249
|
if (!resolver)
|
|
222
250
|
throw new ContractError("OMP model resolver is unavailable; cannot verify configured Bizar model roles");
|
|
223
|
-
const configured = settings
|
|
251
|
+
const configured = await getNativeSetting(pi, settings, "modelRoles", ctx.cwd ?? process.cwd());
|
|
224
252
|
const bizarEntries = configured && typeof configured === "object" && !Array.isArray(configured)
|
|
225
253
|
? Object.entries(configured).filter(([role]) => role.startsWith("bizar_"))
|
|
226
254
|
: [];
|
|
@@ -244,9 +272,9 @@ function modelRoleHealth(pi, ctx, routeResponses) {
|
|
|
244
272
|
return `Bizar model-role health: ${assignments.length} configured roles resolve in OMP.${routeNotes.length ? `\n${routeNotes.join("\n")}.` : ""}`;
|
|
245
273
|
}
|
|
246
274
|
/**
|
|
247
|
-
* Plan-only inspection: scores the live catalog without
|
|
275
|
+
* Plan-only inspection: scores the live catalog without sending a message and
|
|
248
276
|
* without touching settings, so an operator can see the deterministic baseline
|
|
249
|
-
* and which roles it cannot cover before
|
|
277
|
+
* and which roles it cannot cover before deferring the decision.
|
|
250
278
|
*/
|
|
251
279
|
function previewModelRoles(ctx) {
|
|
252
280
|
const models = ctx.models?.list?.();
|
|
@@ -258,7 +286,7 @@ function previewModelRoles(ctx) {
|
|
|
258
286
|
// sentence would be clipped away exactly when it matters most.
|
|
259
287
|
return [
|
|
260
288
|
formatCatalogDelta(diffCatalog(loadOmbSettings().modelCatalog, snapshotCatalog(models))),
|
|
261
|
-
"Preview only: no
|
|
289
|
+
"Preview only: no message was sent and no settings were written.",
|
|
262
290
|
formatRoleAssignmentPlan(plan),
|
|
263
291
|
].join("\n");
|
|
264
292
|
}
|
|
@@ -272,22 +300,22 @@ async function runModelRoleCommand(pi, args, ctx, routeResponses = new Map()) {
|
|
|
272
300
|
// OMP 18.2.6 exposes the authenticated catalog directly, but an extension
|
|
273
301
|
// command cannot make a model call itself. The live catalog plus the
|
|
274
302
|
// deterministic baseline are handed to the active agent as one bounded
|
|
275
|
-
// evaluation task; the
|
|
276
|
-
// BIZAR_MODEL_ROLE_TOOL, while a host without
|
|
303
|
+
// evaluation task; the resulting distribution is persisted through
|
|
304
|
+
// BIZAR_MODEL_ROLE_TOOL, while a host without this handoff applies the
|
|
277
305
|
// deterministic plan directly.
|
|
278
306
|
const sendUserMessage = pi.sendUserMessage?.bind(pi);
|
|
279
307
|
const route = roleAssignmentRoute({
|
|
280
308
|
settings: pi.pi?.settings,
|
|
281
309
|
models: ctx.models?.list?.(),
|
|
282
310
|
sendUserMessage: sendUserMessage
|
|
283
|
-
? (content, options) => sendUserMessage(content, { ...options, attribution: "
|
|
311
|
+
? (content, options) => sendUserMessage(content, { ...options, attribution: "user" })
|
|
284
312
|
: undefined,
|
|
285
313
|
});
|
|
286
314
|
if (route.kind === "unsupported")
|
|
287
315
|
throw new ContractError("OMP model catalog and messaging APIs are unavailable; model-role assignment was not requested");
|
|
288
316
|
if (route.kind === "agent-prompt-only") {
|
|
289
317
|
route.send(BIZAR_MODEL_ROLE_AGENT_PROMPT);
|
|
290
|
-
return "
|
|
318
|
+
return "Model-role assignment request sent. Report the resulting compact mapping in the session.";
|
|
291
319
|
}
|
|
292
320
|
const snapshot = snapshotCatalog(route.models);
|
|
293
321
|
const delta = diffCatalog(loadOmbSettings().modelCatalog, snapshot);
|
|
@@ -304,7 +332,7 @@ async function runModelRoleCommand(pi, args, ctx, routeResponses = new Map()) {
|
|
|
304
332
|
resolve: selector => ctx.models?.resolve?.(selector),
|
|
305
333
|
plan: baseline,
|
|
306
334
|
delta,
|
|
307
|
-
source: "deterministic scoring;
|
|
335
|
+
source: "deterministic scoring; native request handoff unavailable",
|
|
308
336
|
})}${observationNote}`;
|
|
309
337
|
}
|
|
310
338
|
route.send(buildAgentEvaluationRequest({
|
|
@@ -324,11 +352,12 @@ async function runModelRoleCommand(pi, args, ctx, routeResponses = new Map()) {
|
|
|
324
352
|
return [
|
|
325
353
|
formatCatalogDelta(delta),
|
|
326
354
|
`Re-evaluated ${Object.keys(BIZAR_MODEL_ROLES).length} Bizar roles against ${route.models.length} live models, including roles that already hold a value.`,
|
|
327
|
-
`The
|
|
355
|
+
`The distribution request was sent for evaluation and will be persisted through ${BIZAR_MODEL_ROLE_TOOL}. Deterministic baseline: ${assigned}.${unresolved}${leftUnchanged}`,
|
|
328
356
|
].join("\n") + observationNote;
|
|
329
357
|
}
|
|
330
358
|
const runVerificationWithSignal = runVerification;
|
|
331
|
-
const
|
|
359
|
+
const USER_IDENTITY_INVARIANT = "All authored work and external actions use the user's identity. Do not add self-credit or self-identification to content, code comments, Git metadata, pull requests, releases, or GitHub interactions. If the user's authorized identity is unavailable, stop before the external write.";
|
|
360
|
+
const MAIN_CONTEXT_GUIDANCE = "BizarHarness OMP is installed and this main session is the Bizar Orchestrator. Talk to the user as the orchestrator by default: understand the request, choose the focused, bounded, or full Bizar method tier from scope, ambiguity, risk, file count, and change type, and delegate to specialist agents only when that improves the result. Use the native bizar-omp skill for Bizar's ownership boundaries, adaptive workflow tiers, workflow/evidence tools, model-role command, and omp-versus-omb launcher contract. The native OMP Advisor reviews passively when the install preset enabled it; incorporate useful concerns without creating a second orchestration runtime. Focused work is direct with targeted proof; bounded work uses a lightweight Bizar workflow with acceptance and targeted checks; full work uses planning, isolation, evidence, review, and serialized integration. Do not add full planning or delegation as ceremony; escalate when scope or risk grows and never downgrade after escalation. All authored work and external actions use the user's identity. Do not add self-credit or self-identification to content, code comments, Git metadata, pull requests, releases, or GitHub interactions. If the user's authorized identity is unavailable, stop before the external write. Inspect relevant code and tests, make the smallest safe change, run proportional verification, and report concrete evidence. Do not claim completion without fresh verification; surface only material blockers. Create and pursue a native goal only when the user explicitly requests a goal.";
|
|
332
361
|
function appendMainContextGuidance(systemPrompt) {
|
|
333
362
|
if (typeof systemPrompt === "string") {
|
|
334
363
|
return systemPrompt.includes(MAIN_CONTEXT_GUIDANCE)
|
|
@@ -343,10 +372,20 @@ function appendMainContextGuidance(systemPrompt) {
|
|
|
343
372
|
}
|
|
344
373
|
return [MAIN_CONTEXT_GUIDANCE];
|
|
345
374
|
}
|
|
375
|
+
function appendUserIdentityInvariant(systemPrompt) {
|
|
376
|
+
if (typeof systemPrompt === "string") {
|
|
377
|
+
return systemPrompt.includes(USER_IDENTITY_INVARIANT) ? systemPrompt : `${systemPrompt}\n\n${USER_IDENTITY_INVARIANT}`;
|
|
378
|
+
}
|
|
379
|
+
if (Array.isArray(systemPrompt)) {
|
|
380
|
+
const prompts = systemPrompt.map(String);
|
|
381
|
+
return prompts.some(prompt => prompt.includes(USER_IDENTITY_INVARIANT)) ? prompts : [...prompts, USER_IDENTITY_INVARIANT];
|
|
382
|
+
}
|
|
383
|
+
return [USER_IDENTITY_INVARIANT];
|
|
384
|
+
}
|
|
346
385
|
/**
|
|
347
386
|
* Universal Bizar OMP invariants injected into every session (main and task children).
|
|
348
387
|
*/
|
|
349
|
-
const BIZAR_INVARIANTS = "BizarHarness OMP is installed. Use the native bizar-omp skill for Bizar's ownership boundaries, adaptive workflow tiers, workflow/evidence tools, model-role command, and omp-versus-omb launcher contract. Focused work is direct with targeted proof; bounded work uses a lightweight Bizar workflow with acceptance and targeted checks; full work uses planning, isolation, evidence, review, and serialized integration. The native OMP Advisor is enabled by default and may provide passive independent review; incorporate useful concerns without creating a second orchestration runtime.";
|
|
388
|
+
const BIZAR_INVARIANTS = "BizarHarness OMP is installed. Use the native bizar-omp skill for Bizar's ownership boundaries, adaptive workflow tiers, workflow/evidence tools, model-role command, and omp-versus-omb launcher contract. Focused work is direct with targeted proof; bounded work uses a lightweight Bizar workflow with acceptance and targeted checks; full work uses planning, isolation, evidence, review, and serialized integration. The native OMP Advisor is enabled by default and may provide passive independent review; incorporate useful concerns without creating a second orchestration runtime. Before acting on a todo that asks to commit or push, check the working tree and upstream Git state. When `git status --short` is empty and `git rev-parse HEAD` matches the relevant upstream branch, complete the satisfied commit/push todo items with the native todo tool and continue; do not create a duplicate commit, push, or prompt for either action.";
|
|
350
389
|
/**
|
|
351
390
|
* Orchestrator-only role assertion and delegation guidance. Applied only after an
|
|
352
391
|
* operator explicitly activates the main orchestrator role via `bizar_apply_main_orchestrator_role`.
|
|
@@ -442,7 +481,7 @@ export default function bizarExtension(pi) {
|
|
|
442
481
|
}
|
|
443
482
|
}
|
|
444
483
|
try {
|
|
445
|
-
ensureBizarModelRoles(pi);
|
|
484
|
+
await ensureBizarModelRoles(pi, ctx.cwd ?? process.cwd());
|
|
446
485
|
}
|
|
447
486
|
catch (error) {
|
|
448
487
|
ctx.ui?.notify(`Bizar could not apply its OMP settings; continuing without the failed setting update. ${error instanceof Error ? error.message : String(error)}`, "warning");
|
|
@@ -511,9 +550,9 @@ export default function bizarExtension(pi) {
|
|
|
511
550
|
});
|
|
512
551
|
pi.on("session_shutdown", async () => { releaseNativeLease(); binding = undefined; orchestratorActive = false; });
|
|
513
552
|
pi.on("before_agent_start", event => ({
|
|
514
|
-
systemPrompt: orchestratorActive
|
|
553
|
+
systemPrompt: appendUserIdentityInvariant(orchestratorActive
|
|
515
554
|
? applyOrchestratorPolicy(appendBizarInvariant(paramsOf(event).systemPrompt))
|
|
516
|
-
: appendBizarInvariant(paramsOf(event).systemPrompt),
|
|
555
|
+
: appendBizarInvariant(paramsOf(event).systemPrompt)),
|
|
517
556
|
}));
|
|
518
557
|
// A002: managed task isolation/admission pre-execution gate.
|
|
519
558
|
const BIZAR_PACKAGED_AGENTS = new Set([
|
|
@@ -771,7 +810,7 @@ export default function bizarExtension(pi) {
|
|
|
771
810
|
});
|
|
772
811
|
pi.registerTool({
|
|
773
812
|
name: BIZAR_MODEL_ROLE_TOOL, label: "Bizar Apply Model Roles",
|
|
774
|
-
description: "Validate
|
|
813
|
+
description: "Validate a proposed Bizar model-role distribution against the live OMP catalog and persist it atomically; the whole mapping is refused when any selector is not a resolvable catalog entry, and a selector that only differs in casing is stored under the catalog's spelling.",
|
|
775
814
|
parameters: pi.zod.object({
|
|
776
815
|
assignment: pi.zod.array(pi.zod.object({
|
|
777
816
|
role: pi.zod.string(),
|
|
@@ -802,7 +841,7 @@ export default function bizarExtension(pi) {
|
|
|
802
841
|
resolve,
|
|
803
842
|
plan: planFromRecommendations(review, host.models),
|
|
804
843
|
delta: diffCatalog(loadOmbSettings().modelCatalog, snapshot),
|
|
805
|
-
source: "
|
|
844
|
+
source: "catalog-evaluated distribution",
|
|
806
845
|
});
|
|
807
846
|
// A recommendation that only differed in casing is stored under the
|
|
808
847
|
// catalog's own spelling; the repair is reported so the persisted mapping
|