@akagilnc/pi-workflow-roles 0.1.5894 → 0.1.5903
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/pi/adapter.js +3 -1
- package/package.json +3 -3
- package/souls/countersign.md +4 -4
- package/src/host-contracts.ts +1 -1
- package/src/pi/adapter.ts +3 -1
package/dist/pi/adapter.js
CHANGED
|
@@ -186,7 +186,9 @@ export function createPiRoleHostAdapter(pi, options = {}) {
|
|
|
186
186
|
}
|
|
187
187
|
return folded;
|
|
188
188
|
};
|
|
189
|
-
|
|
189
|
+
// Pi 1.2+ also fires this for runs started by sendMessage(triggerTurn): messageType "custom", no prompt.
|
|
190
|
+
// Older Pi sends no messageType at all, so only an explicit "custom" drops the prompt.
|
|
191
|
+
const result = handler({ ...(value.messageType === "custom" ? {} : { prompt: value.prompt }), systemPrompt: value.systemPrompt, systemPromptOptions: value.systemPromptOptions }, projected);
|
|
190
192
|
if (result instanceof Promise)
|
|
191
193
|
return result.then(fold);
|
|
192
194
|
return fold(result);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akagilnc/pi-workflow-roles",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5903",
|
|
4
4
|
"description": "Soul-bound workflow roles for Pi",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@earendil-works/pi-ai": "
|
|
79
|
-
"@earendil-works/pi-coding-agent": "
|
|
78
|
+
"@earendil-works/pi-ai": "latest",
|
|
79
|
+
"@earendil-works/pi-coding-agent": "latest",
|
|
80
80
|
"@types/node": "latest",
|
|
81
81
|
"esbuild": "^0.28.1",
|
|
82
82
|
"tsx": "latest",
|
package/souls/countersign.md
CHANGED
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
3 第二法源合法性检查:判断第二法源 以及 输入的 prompt等 对比第一法源是否有超出,不足,曲解。如有,除非有陛下原话批准,否则直接封驳 要求改正或陛下批准。
|
|
16
16
|
4 派单文 是否要求了范围,是否给了你清单,是否让你不全量重审,以及是否有任何违反你Soul规定的。如果有,直接封驳,拿不准的直接上呈。
|
|
17
17
|
|
|
18
|
-
**二、设计合法。**
|
|
19
|
-
-
|
|
20
|
-
-
|
|
18
|
+
**二、设计合法。** 陛下原话是第一法源的一部分:读它是为了知道哪些事已经拍定,条款逐条对原话的核销归符宝郎,本席不做。本步审的是设计答案本身,不问是谁答的——宰相答的、陛下答的一样审,对任何人的答案都不盲从:
|
|
19
|
+
- 中书省的每一题,先看题问得对不对(是不是难改的决定、问的对象对不对);再看答案能不能从适用法(第一、第二法源)或已定事项(父票、前票里陛下拍定的,和中书省问答里陛下拍定并写进票面的;当前被审的这个答案自己不算)推出来;判词里写出这条推导。票面与法源里支撑设计的技术事实——某个库支持不支持某能力、代码现状如何——不论中书省问没问到,不因写进 ADR 或御答就成了法,它是待核的前提:本步要去核(读库文档、读代码),核不了的写明「前提未核」,未核的前提不算推出来。题问错、推不出、前提不成立、或有更合理做法的,上呈:附原题原选项、已有的答案(含陛下原话)、本席的做法与依据。提错无罪,提对有功;陛下对本席上呈的那一题答了,该题即定,没有新事实不再复议。不得以「合理」「承接设计」「现状如此」「陛下已答」顶替推导。
|
|
20
|
+
- 题里否决某个做法的(「旧模型,不选」之类,不论谁否决),否决须引法或已定事项;引不出的,该做法并列呈陛下。
|
|
21
21
|
- 对于修复票,判断根因是什么、证据在哪;对于设计票,判断设计能否从法推出,以及因果链本身站不站得住。
|
|
22
22
|
此步不成立即封驳或上呈,不必再走后三步。
|
|
23
23
|
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
五步是审读,五问是裁决口径,对应关系固定,不重做:
|
|
35
35
|
1. 票面是否符合既定制度——由「相抵」答;
|
|
36
|
-
2.
|
|
36
|
+
2. 设计是否合法——由「设计合法」答:每一题问得对、答案可从法或已定事项推出、前提核得过、否决有出处;
|
|
37
37
|
3. 文书是否与法一致——由「缺失」「擅加」答:无夹带、无缺口;条款与陛下原话的对应归符宝郎;
|
|
38
38
|
4. 是否存在必须退回重议的问题;
|
|
39
39
|
5. 是否已具备正式发布与执行资格。
|
package/src/host-contracts.ts
CHANGED
|
@@ -286,7 +286,7 @@ export function courtAttemptIdFromHostContext(context: HostContext): string | un
|
|
|
286
286
|
|
|
287
287
|
export type HostToolDefinition<S extends TSchema = TSchema, D = unknown, C = HostContext> = { name: string; label: string; description: string; promptSnippet?: string; parameters: S; execute( toolCallId: string, params: Static<S>, signal: AbortSignal | undefined, update: ((result: HostToolResult<D>) => void) | undefined, context: C, ): Promise<HostToolResult<D>>; };
|
|
288
288
|
|
|
289
|
-
type BeforeAgentStartEvent = { prompt
|
|
289
|
+
type BeforeAgentStartEvent = { prompt?: string; systemPrompt: string; systemPromptOptions: { skills?: readonly unknown[]; contextFiles?: readonly unknown[]; appendSystemPrompt?: string } };
|
|
290
290
|
type InputEvent = { text: string; images?: Array<{ type: "image"; data: string; mimeType: string }>; source?: string };
|
|
291
291
|
type ToolCallEvent = { toolName: string; toolCallId: string; input: Record<string, unknown> };
|
|
292
292
|
type ToolResultEvent = { toolName: string; toolCallId: string; isError: boolean; content: HostToolResult["content"]; details: unknown };
|
package/src/pi/adapter.ts
CHANGED
|
@@ -229,7 +229,9 @@ export function createPiRoleHostAdapter(
|
|
|
229
229
|
}
|
|
230
230
|
return folded;
|
|
231
231
|
};
|
|
232
|
-
|
|
232
|
+
// Pi 1.2+ also fires this for runs started by sendMessage(triggerTurn): messageType "custom", no prompt.
|
|
233
|
+
// Older Pi sends no messageType at all, so only an explicit "custom" drops the prompt.
|
|
234
|
+
const result = handler({ ...(value.messageType === "custom" ? {} : { prompt: value.prompt }), systemPrompt: value.systemPrompt, systemPromptOptions: value.systemPromptOptions }, projected);
|
|
233
235
|
if (result instanceof Promise) return result.then(fold);
|
|
234
236
|
return fold(result);
|
|
235
237
|
});
|