omp-fabric 1.0.4 → 1.0.5
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/CHANGELOG.md +6 -0
- package/dist/chunks/{chunk-DOKANNFC.js → chunk-TLSJXU4F.js} +7 -18
- package/dist/chunks/chunk-TLSJXU4F.js.map +7 -0
- package/dist/core/skill-block.d.ts +1 -1
- package/dist/core/skill-block.d.ts.map +1 -1
- package/dist/core/skill-prompt.d.ts +3 -1
- package/dist/core/skill-prompt.d.ts.map +1 -1
- package/dist/core/skill-references.d.ts +1 -1
- package/dist/core/skill-references.d.ts.map +1 -1
- package/dist/fabric-runtime-state.js +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -16
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/dist/chunks/chunk-DOKANNFC.js.map +0 -7
package/dist/index.js
CHANGED
|
@@ -60,14 +60,14 @@ import {
|
|
|
60
60
|
expandSkillDirMarkersForRead,
|
|
61
61
|
expandSkillDirMarkersInSkillBlock,
|
|
62
62
|
filterPrewalkContinuationMessages,
|
|
63
|
-
|
|
63
|
+
formatSkillsSection,
|
|
64
64
|
hasPrewalkArmedPrompt,
|
|
65
65
|
prewalkArmedPrompt,
|
|
66
66
|
repairFabricGuestCode,
|
|
67
67
|
resolveFabricIdentity,
|
|
68
68
|
settleInPlacePrewalk,
|
|
69
69
|
streamedToolCallName
|
|
70
|
-
} from "./chunks/chunk-
|
|
70
|
+
} from "./chunks/chunk-TLSJXU4F.js";
|
|
71
71
|
import "./chunks/chunk-7VIQNUPS.js";
|
|
72
72
|
import {
|
|
73
73
|
AgentTranscriptReader
|
|
@@ -2175,23 +2175,35 @@ var fabricSchemaGuidance = (mode) => {
|
|
|
2175
2175
|
};
|
|
2176
2176
|
|
|
2177
2177
|
// src/core/skill-prompt.ts
|
|
2178
|
+
import { getActiveSkills, Settings } from "@oh-my-pi/pi-coding-agent";
|
|
2178
2179
|
var OMP_SKILL_SECTION_MARKER = "<skills>";
|
|
2180
|
+
var OMP_SKILL_SECTION_HEADING = "# Skills & Rules\n";
|
|
2179
2181
|
var OMP_SKILL_LOAD_INSTRUCTION = "Matching skill \u2192 MUST read `skill://<name>` first.";
|
|
2182
|
+
var OMP_CUSTOM_SKILL_LOAD_INSTRUCTION = "If a skill applies, you MUST read `skill://<name>` before proceeding.";
|
|
2180
2183
|
var FABRIC_OMP_SKILL_LOAD_INSTRUCTION = "Matching skill \u2192 MUST read `skill://<name>` through `omp.read` inside `fabric_exec` first.";
|
|
2181
|
-
var
|
|
2182
|
-
var
|
|
2184
|
+
var FABRIC_CUSTOM_SKILL_LOAD_INSTRUCTION = "If a skill applies, you MUST read `skill://<name>` through `omp.read` inside `fabric_exec` before proceeding.";
|
|
2185
|
+
var activeSkills = () => getActiveSkills();
|
|
2186
|
+
var listableSkills = (skills) => {
|
|
2187
|
+
try {
|
|
2188
|
+
if (Settings.instance.get("skillful") === false) return [];
|
|
2189
|
+
} catch {
|
|
2190
|
+
return skills;
|
|
2191
|
+
}
|
|
2192
|
+
return skills;
|
|
2193
|
+
};
|
|
2183
2194
|
var restoreSkillsForFullCodePrompt = (systemPrompt, skills) => {
|
|
2184
2195
|
if (systemPrompt.includes(OMP_SKILL_SECTION_MARKER)) {
|
|
2185
|
-
return systemPrompt.replace(
|
|
2186
|
-
OMP_SKILL_LOAD_INSTRUCTION,
|
|
2187
|
-
FABRIC_OMP_SKILL_LOAD_INSTRUCTION
|
|
2188
|
-
);
|
|
2196
|
+
return systemPrompt.replace(OMP_SKILL_LOAD_INSTRUCTION, FABRIC_OMP_SKILL_LOAD_INSTRUCTION).replace(OMP_CUSTOM_SKILL_LOAD_INSTRUCTION, FABRIC_CUSTOM_SKILL_LOAD_INSTRUCTION);
|
|
2189
2197
|
}
|
|
2190
|
-
const section =
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
)
|
|
2194
|
-
|
|
2198
|
+
const section = formatSkillsSection(skills, FABRIC_OMP_SKILL_LOAD_INSTRUCTION);
|
|
2199
|
+
if (!section) return systemPrompt;
|
|
2200
|
+
const heading = systemPrompt.indexOf(OMP_SKILL_SECTION_HEADING);
|
|
2201
|
+
if (heading < 0) return `${systemPrompt}
|
|
2202
|
+
|
|
2203
|
+
${section}`;
|
|
2204
|
+
const insertAt = heading + OMP_SKILL_SECTION_HEADING.length;
|
|
2205
|
+
return `${systemPrompt.slice(0, insertAt)}${section}
|
|
2206
|
+
${systemPrompt.slice(insertAt)}`;
|
|
2195
2207
|
};
|
|
2196
2208
|
|
|
2197
2209
|
// src/core/proxy-contract.ts
|
|
@@ -2346,7 +2358,7 @@ var buildSkillReferenceGuidance = (prompt, skills) => {
|
|
|
2346
2358
|
const body = prompt.slice(openingEnd + 2, closingTag);
|
|
2347
2359
|
const invocationLines = body.split("\n").filter((line) => INVOCATION_VERB.test(line) && !NEGATED_INVOCATION.test(line));
|
|
2348
2360
|
const referenced = skills.filter(
|
|
2349
|
-
(skill) => skill.name !== active.name && skill.
|
|
2361
|
+
(skill) => skill.name !== active.name && skill.hide !== true && invocationLines.some((line) => referencesSkill(line, skill.name))
|
|
2350
2362
|
);
|
|
2351
2363
|
if (referenced.length === 0) return void 0;
|
|
2352
2364
|
const mappings = referenced.map((skill) => `- /${skill.name} -> ${JSON.stringify(skill.filePath)}`).join("\n");
|
|
@@ -5595,9 +5607,12 @@ async function ompFabric(omp) {
|
|
|
5595
5607
|
reassertToolOwnership();
|
|
5596
5608
|
const effectiveFullCodeMode = fullCodeMode || schemaMode === "enforce";
|
|
5597
5609
|
if (!omp.getActiveTools().includes("fabric_exec")) return;
|
|
5598
|
-
const skills =
|
|
5610
|
+
const skills = activeSkills();
|
|
5599
5611
|
const captureSnapshot = state.cwd ? capturePolicy() : void 0;
|
|
5600
|
-
const systemPrompt = effectiveFullCodeMode ? restoreSkillsForFullCodePrompt(
|
|
5612
|
+
const systemPrompt = effectiveFullCodeMode ? restoreSkillsForFullCodePrompt(
|
|
5613
|
+
event.systemPrompt.join("\n"),
|
|
5614
|
+
listableSkills(skills)
|
|
5615
|
+
) : event.systemPrompt.join("\n");
|
|
5601
5616
|
const skillReferenceGuidance = effectiveFullCodeMode ? buildSkillReferenceGuidance(event.prompt, skills) : void 0;
|
|
5602
5617
|
const currentModel = context.model ? `${context.model.provider}/${context.model.id}` : void 0;
|
|
5603
5618
|
const resolvedGuidance = resolveFabricModelGuidance(state.modelGuidance(), {
|