@fro.bot/systematic 2.12.1 → 2.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +0 -3
- package/dist/index.js +29 -30
- package/dist/lib/bootstrap.d.ts +13 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -29,6 +29,34 @@ var INTERNAL_AGENT_SIGNATURES = [
|
|
|
29
29
|
"You are a helpful AI assistant tasked with summarizing conversations",
|
|
30
30
|
"Summarize what was done in this conversation"
|
|
31
31
|
];
|
|
32
|
+
var BOOTSTRAP_MARKER_OPEN = "<SYSTEMATIC_WORKFLOWS>";
|
|
33
|
+
var BOOTSTRAP_MARKER_CLOSE = "</SYSTEMATIC_WORKFLOWS>";
|
|
34
|
+
var findBootstrapMarkerBlock = (entry) => {
|
|
35
|
+
const start = entry.indexOf(BOOTSTRAP_MARKER_OPEN);
|
|
36
|
+
if (start === -1)
|
|
37
|
+
return null;
|
|
38
|
+
const closeStart = entry.indexOf(BOOTSTRAP_MARKER_CLOSE, start + BOOTSTRAP_MARKER_OPEN.length);
|
|
39
|
+
if (closeStart === -1)
|
|
40
|
+
return null;
|
|
41
|
+
return { start, end: closeStart + BOOTSTRAP_MARKER_CLOSE.length };
|
|
42
|
+
};
|
|
43
|
+
var applyBootstrapContent = (output, content) => {
|
|
44
|
+
for (let i = 0;i < output.system.length; i++) {
|
|
45
|
+
const entry = output.system[i];
|
|
46
|
+
const block = findBootstrapMarkerBlock(entry);
|
|
47
|
+
if (block !== null) {
|
|
48
|
+
output.system[i] = entry.slice(0, block.start) + content + entry.slice(block.end);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (output.system.length > 0) {
|
|
53
|
+
output.system[output.system.length - 1] += `
|
|
54
|
+
|
|
55
|
+
${content}`;
|
|
56
|
+
} else {
|
|
57
|
+
output.system.push(content);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
32
60
|
function getToolMappingTemplate() {
|
|
33
61
|
return `**Tool Mapping for OpenCode:**
|
|
34
62
|
When skills reference tools you don't have, substitute OpenCode equivalents:
|
|
@@ -848,34 +876,6 @@ var bundledSkillsDir = path5.join(packageRoot, "skills");
|
|
|
848
876
|
var bundledAgentsDir = path5.join(packageRoot, "agents");
|
|
849
877
|
var bundledCommandsDir = path5.join(packageRoot, "commands");
|
|
850
878
|
var packageJsonPath = path5.join(packageRoot, "package.json");
|
|
851
|
-
var BOOTSTRAP_MARKER_OPEN = "<SYSTEMATIC_WORKFLOWS>";
|
|
852
|
-
var BOOTSTRAP_MARKER_CLOSE = "</SYSTEMATIC_WORKFLOWS>";
|
|
853
|
-
var findBootstrapMarkerBlock = (entry) => {
|
|
854
|
-
const start = entry.indexOf(BOOTSTRAP_MARKER_OPEN);
|
|
855
|
-
if (start === -1)
|
|
856
|
-
return null;
|
|
857
|
-
const closeStart = entry.indexOf(BOOTSTRAP_MARKER_CLOSE, start + BOOTSTRAP_MARKER_OPEN.length);
|
|
858
|
-
if (closeStart === -1)
|
|
859
|
-
return null;
|
|
860
|
-
return { start, end: closeStart + BOOTSTRAP_MARKER_CLOSE.length };
|
|
861
|
-
};
|
|
862
|
-
var applyBootstrapContent = (output, content) => {
|
|
863
|
-
for (let i = 0;i < output.system.length; i++) {
|
|
864
|
-
const entry = output.system[i];
|
|
865
|
-
const block = findBootstrapMarkerBlock(entry);
|
|
866
|
-
if (block !== null) {
|
|
867
|
-
output.system[i] = entry.slice(0, block.start) + content + entry.slice(block.end);
|
|
868
|
-
return;
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
if (output.system.length > 0) {
|
|
872
|
-
output.system[output.system.length - 1] += `
|
|
873
|
-
|
|
874
|
-
${content}`;
|
|
875
|
-
} else {
|
|
876
|
-
output.system.push(content);
|
|
877
|
-
}
|
|
878
|
-
};
|
|
879
879
|
var getPackageVersion = () => {
|
|
880
880
|
try {
|
|
881
881
|
if (!fs4.existsSync(packageJsonPath))
|
|
@@ -951,6 +951,5 @@ var SystematicPlugin = async (input) => {
|
|
|
951
951
|
};
|
|
952
952
|
var src_default = SystematicPlugin;
|
|
953
953
|
export {
|
|
954
|
-
src_default as default
|
|
955
|
-
applyBootstrapContent
|
|
954
|
+
src_default as default
|
|
956
955
|
};
|
package/dist/lib/bootstrap.d.ts
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import type { SystematicConfig } from './config.js';
|
|
2
2
|
export declare const INTERNAL_AGENT_SIGNATURES: string[];
|
|
3
|
+
/**
|
|
4
|
+
* Inject bootstrap content into the system prompt array, replacing any
|
|
5
|
+
* existing `<SYSTEMATIC_WORKFLOWS>` block. Multi-load idempotency is via
|
|
6
|
+
* the marker — most-recently-registered plugin wins under FIFO hook order.
|
|
7
|
+
*
|
|
8
|
+
* Exported for test access — must NOT be re-exported from the plugin entry
|
|
9
|
+
* point (src/index.ts) because OpenCode's plugin loader expects a single
|
|
10
|
+
* function export; additional named exports break loading. See
|
|
11
|
+
* `docs/solutions/integration-issues/` for the v2.5.0 and v2.12.1 incidents.
|
|
12
|
+
*/
|
|
13
|
+
export declare const applyBootstrapContent: (output: {
|
|
14
|
+
system: string[];
|
|
15
|
+
}, content: string) => void;
|
|
3
16
|
export interface BootstrapDeps {
|
|
4
17
|
bundledSkillsDir: string;
|
|
5
18
|
}
|