portable-agent-layer 0.91.2 → 0.91.3
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/package.json
CHANGED
package/src/hooks/LoadContext.ts
CHANGED
|
@@ -57,10 +57,10 @@ try {
|
|
|
57
57
|
process.exit(0);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
// The reminder is built for one of
|
|
60
|
+
// The reminder is built for one of four targets; every other agent reads the
|
|
61
61
|
// same shape Claude Code does.
|
|
62
62
|
const target: AgentTarget =
|
|
63
|
-
active === "copilot" || active === "cursor" ? active : "claude";
|
|
63
|
+
active === "copilot" || active === "cursor" || active === "codex" ? active : "claude";
|
|
64
64
|
const reminder = buildSystemReminder({
|
|
65
65
|
agent: target,
|
|
66
66
|
withoutHandoff: wanted === "without-handoff",
|
package/src/hooks/lib/context.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { loadOpinionContext } from "./opinions";
|
|
|
13
13
|
import { paths, toPath } from "./paths";
|
|
14
14
|
import { loadActiveProjectsContext } from "./projects";
|
|
15
15
|
import { loadRecentNotes } from "./relationship";
|
|
16
|
-
import { loadFailurePatterns } from "./semi-static";
|
|
16
|
+
import { loadFailurePatterns, loadSteeringRules } from "./semi-static";
|
|
17
17
|
import { sessionDir } from "./session-dir";
|
|
18
18
|
import * as settings from "./settings";
|
|
19
19
|
import { readFramePrinciples } from "./wisdom";
|
|
@@ -173,10 +173,13 @@ function capSection(text: string, maxChars: number): string {
|
|
|
173
173
|
return kept.join("\n");
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
/**
|
|
176
|
+
/**
|
|
177
|
+
* Agent targets — determines which context sections are skipped due to native loading.
|
|
178
|
+
* Codex has no native include for them, so its reminder carries them.
|
|
179
|
+
*/
|
|
177
180
|
export type AgentTarget = Extract<
|
|
178
181
|
AgentName,
|
|
179
|
-
"claude" | "opencode" | "cursor" | "copilot"
|
|
182
|
+
"claude" | "opencode" | "cursor" | "copilot" | "codex"
|
|
180
183
|
>;
|
|
181
184
|
|
|
182
185
|
/**
|
|
@@ -215,6 +218,7 @@ export function buildSystemReminder(
|
|
|
215
218
|
!skipSemiStatic && settings.isEnabled("opinions") ? loadOpinionContext() : "";
|
|
216
219
|
const selfModel =
|
|
217
220
|
!skipSemiStatic && settings.isEnabled("selfModel") ? loadSelfModel() : "";
|
|
221
|
+
const steering = skipSemiStatic ? "" : loadSteeringRules();
|
|
218
222
|
const handoff =
|
|
219
223
|
!opts.withoutHandoff && settings.isEnabled("handoff")
|
|
220
224
|
? loadHandoffContext(sessionDir())
|
|
@@ -230,6 +234,7 @@ export function buildSystemReminder(
|
|
|
230
234
|
if (relationship) parts.push(relationship);
|
|
231
235
|
if (activeProjects) parts.push(activeProjects);
|
|
232
236
|
if (failures) parts.push(failures);
|
|
237
|
+
if (steering) parts.push(steering);
|
|
233
238
|
if (parts.length === 0) return "";
|
|
234
239
|
|
|
235
240
|
const now = new Date();
|
|
@@ -104,13 +104,20 @@ export function loadFailurePatterns(): string {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
function steeringRulesPath(): string {
|
|
108
|
+
return resolve(palHome(), "docs", "STEERING_RULES.md");
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function loadSteeringRules(): string {
|
|
112
|
+
return readFileSafe(steeringRulesPath());
|
|
113
|
+
}
|
|
114
|
+
|
|
107
115
|
/**
|
|
108
116
|
* All semi-static context sources in load order.
|
|
109
117
|
* Adding one entry here is the only change needed to extend coverage to all consumers.
|
|
110
118
|
*/
|
|
111
119
|
export function getSemiStaticSources(): SemiStaticSource[] {
|
|
112
120
|
const memory = paths.memory();
|
|
113
|
-
const home = palHome();
|
|
114
121
|
return [
|
|
115
122
|
{
|
|
116
123
|
path: resolve(memory, "self-model", "current.md"),
|
|
@@ -157,9 +164,9 @@ export function getSemiStaticSources(): SemiStaticSource[] {
|
|
|
157
164
|
description: "PAL recent failure lessons",
|
|
158
165
|
},
|
|
159
166
|
{
|
|
160
|
-
path:
|
|
167
|
+
path: steeringRulesPath(),
|
|
161
168
|
writesDigest: false,
|
|
162
|
-
load:
|
|
169
|
+
load: loadSteeringRules,
|
|
163
170
|
slug: "steering",
|
|
164
171
|
description: "PAL steering rules",
|
|
165
172
|
},
|