@tenkara/afm-win32-x64 4.0.0-alpha.6 → 4.0.0-alpha.7
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/bin/afm.exe
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/bin/afm.exe
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 90102784 bytes
|
|
4
|
+
sha256: bd68e26c53cdfff566bb0964c175d72ad4d88240c1bbececd83224e3c9b0b268
|
package/package.json
CHANGED
package/plugin/agy/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "afm",
|
|
3
3
|
"description": "Agent Flow Methodology: autonomous discovery, a strict TDD delivery loop, and documentation that evolves from measured evidence. The CLI owns state, ids, gates and lint; the skills carry the judgment.",
|
|
4
|
-
"version": "4.0.0-alpha.
|
|
4
|
+
"version": "4.0.0-alpha.7",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mapree"
|
|
7
7
|
},
|
package/plugin/opencode/afm.js
CHANGED
|
@@ -45,6 +45,27 @@ function decisionOf(out) {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
/** The `systemMessage` of an `afm hook` answer: what the operator must read, not the model; undefined when there is none. */
|
|
49
|
+
function noticeOf(out) {
|
|
50
|
+
try {
|
|
51
|
+
const notice = JSON.parse(out).systemMessage;
|
|
52
|
+
return typeof notice === "string" && notice !== "" ? notice : undefined;
|
|
53
|
+
} catch {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Puts the notice on the operator's screen as a toast. The host may lack the API, and a notice is never worth a failure. */
|
|
59
|
+
async function showNotice(client, message) {
|
|
60
|
+
try {
|
|
61
|
+
await client?.tui?.showToast?.({
|
|
62
|
+
body: { title: "AFM", message, variant: "warning", duration: 20000 },
|
|
63
|
+
});
|
|
64
|
+
} catch {
|
|
65
|
+
// nowhere to show it: the next session start tries again
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
48
69
|
const bounded = (promise) => {
|
|
49
70
|
let timer;
|
|
50
71
|
const limit = new Promise((resolve) => {
|
|
@@ -103,13 +124,15 @@ export const AfmHooks = async ({ directory, client }) => {
|
|
|
103
124
|
sessionID,
|
|
104
125
|
(async () => {
|
|
105
126
|
const session = await sessionOf(client, sessionID, sessions);
|
|
106
|
-
if (!session.child)
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
)
|
|
127
|
+
if (!session.child) {
|
|
128
|
+
const out = await afmHook("SessionStart", {
|
|
129
|
+
...base(sessionID, session),
|
|
130
|
+
source: "startup",
|
|
131
|
+
});
|
|
132
|
+
const notice = noticeOf(out);
|
|
133
|
+
if (notice) await showNotice(client, notice);
|
|
134
|
+
return decisionOf(out).additionalContext;
|
|
135
|
+
}
|
|
113
136
|
if (!session.agent) return undefined;
|
|
114
137
|
return decisionOf(
|
|
115
138
|
await afmHook("SubagentStart", {
|