@tenkara/afm-linux-arm64 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 CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/bin/afm
3
3
  size: 83740664 bytes
4
- sha256: f61c684523923777f3a6f307adaa5b05738385fc9ebff5470c8697058ca7f0f5
4
+ sha256: e39da6997d5c476ba1ac459ac70e9007a17c405eac144cafd7936d8c3f6b96db
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenkara/afm-linux-arm64",
3
- "version": "4.0.0-alpha.6",
3
+ "version": "4.0.0-alpha.7",
4
4
  "description": "The afm binary (CLI and MCP server) for linux-arm64.",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "afm",
3
- "version": "4.0.0-alpha.6",
3
+ "version": "4.0.0-alpha.7",
4
4
  "description": "AFM (Agent Flow Methodology): hooks and an MCP server that keep a project's docs and its code in step.",
5
5
  "license": "UNLICENSED"
6
6
  }
@@ -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.6",
4
+ "version": "4.0.0-alpha.7",
5
5
  "author": {
6
6
  "name": "Mapree"
7
7
  },
@@ -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
- return decisionOf(
108
- await afmHook("SessionStart", {
109
- ...base(sessionID, session),
110
- source: "startup",
111
- }),
112
- ).additionalContext;
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", {