@forwardimpact/libwiki 0.1.0 → 0.1.1
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/README.md +2 -1
- package/bin/fit-wiki.js +4 -5
- package/package.json +3 -3
- package/src/commands/memo.js +2 -1
- package/src/constants.js +1 -1
- package/src/index.js +1 -1
- package/src/marker-migrator.js +2 -2
- package/src/memo-writer.js +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,8 @@ import { writeMemo, listAgents, insertMarkers } from "@forwardimpact/libwiki";
|
|
|
17
17
|
## Key Exports
|
|
18
18
|
|
|
19
19
|
- `writeMemo({ summaryPath, sender, message, today })` — append a timestamped
|
|
20
|
-
|
|
20
|
+
bullet after the `<!-- memo:inbox -->` marker in a wiki summary's
|
|
21
|
+
`## Message Inbox` section.
|
|
21
22
|
- `listAgents({ agentsDir, wikiRoot })` — discover agents from
|
|
22
23
|
`.claude/agents/*.md` and derive wiki summary paths.
|
|
23
24
|
- `insertMarkers({ agentsDir, wikiRoot })` — idempotent insertion of the memo
|
package/bin/fit-wiki.js
CHANGED
|
@@ -16,8 +16,7 @@ const definition = {
|
|
|
16
16
|
commands: [
|
|
17
17
|
{
|
|
18
18
|
name: "memo",
|
|
19
|
-
description:
|
|
20
|
-
"Append a cross-team observation to a teammate's wiki summary",
|
|
19
|
+
description: "Send a cross-team memo into a teammate's Message Inbox",
|
|
21
20
|
options: {
|
|
22
21
|
from: {
|
|
23
22
|
type: "string",
|
|
@@ -27,11 +26,11 @@ const definition = {
|
|
|
27
26
|
to: {
|
|
28
27
|
type: "string",
|
|
29
28
|
description:
|
|
30
|
-
'Target agent name, or "all" to broadcast
|
|
29
|
+
'Target agent name, or "all" to broadcast (sender is skipped)',
|
|
31
30
|
},
|
|
32
31
|
message: {
|
|
33
32
|
type: "string",
|
|
34
|
-
description: "
|
|
33
|
+
description: "Memo text",
|
|
35
34
|
},
|
|
36
35
|
"wiki-root": {
|
|
37
36
|
type: "string",
|
|
@@ -57,7 +56,7 @@ const definition = {
|
|
|
57
56
|
title: "Wiki Operations",
|
|
58
57
|
url: "https://www.forwardimpact.team/docs/libraries/wiki-operations/index.md",
|
|
59
58
|
description:
|
|
60
|
-
"Send cross-team
|
|
59
|
+
"Send cross-team memos, discover agents, and manage wiki markers.",
|
|
61
60
|
},
|
|
62
61
|
],
|
|
63
62
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forwardimpact/libwiki",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Wiki lifecycle primitives for the Kata agent system: cross-team memos, agent roster discovery, and marker migration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wiki",
|
|
7
7
|
"memo",
|
|
8
|
-
"
|
|
8
|
+
"inbox",
|
|
9
9
|
"agent"
|
|
10
10
|
],
|
|
11
11
|
"homepage": "https://www.forwardimpact.team",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"forwardimpact": {
|
|
20
20
|
"capability": "agent-self-improvement",
|
|
21
21
|
"needs": [
|
|
22
|
-
"
|
|
22
|
+
"Send a cross-team memo to a teammate's wiki inbox"
|
|
23
23
|
]
|
|
24
24
|
},
|
|
25
25
|
"type": "module",
|
package/src/commands/memo.js
CHANGED
|
@@ -45,7 +45,8 @@ export function runMemoCommand(values, _args, cli) {
|
|
|
45
45
|
|
|
46
46
|
if (values.to === BROADCAST_TARGET) {
|
|
47
47
|
const agents = listAgents({ agentsDir, wikiRoot });
|
|
48
|
-
for (const { summaryPath } of agents) {
|
|
48
|
+
for (const { agent, summaryPath } of agents) {
|
|
49
|
+
if (agent === sender) continue;
|
|
49
50
|
writeAndCheck(summaryPath, sender, values.message, today);
|
|
50
51
|
}
|
|
51
52
|
} else {
|
package/src/constants.js
CHANGED
package/src/index.js
CHANGED
package/src/marker-migrator.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { MEMO_INBOX_MARKER,
|
|
2
|
+
import { MEMO_INBOX_MARKER, INBOX_HEADING } from "./constants.js";
|
|
3
3
|
import { listAgents } from "./agent-roster.js";
|
|
4
4
|
|
|
5
5
|
export function insertMarkers(
|
|
@@ -21,7 +21,7 @@ export function insertMarkers(
|
|
|
21
21
|
|
|
22
22
|
const lines = content.split("\n");
|
|
23
23
|
const headingIndex = lines.findIndex(
|
|
24
|
-
(line) => line.trim() ===
|
|
24
|
+
(line) => line.trim() === INBOX_HEADING,
|
|
25
25
|
);
|
|
26
26
|
|
|
27
27
|
if (headingIndex === -1) {
|
package/src/memo-writer.js
CHANGED
|
@@ -17,7 +17,7 @@ export function writeMemo(
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const flatMessage = message.replace(/\n/g, " ");
|
|
20
|
-
const bullet = `- ${today} **${sender}**: ${flatMessage}`;
|
|
20
|
+
const bullet = `- ${today} from **${sender}**: ${flatMessage}`;
|
|
21
21
|
|
|
22
22
|
lines.splice(markerIndex + 1, 0, bullet);
|
|
23
23
|
fs.writeFileSync(summaryPath, lines.join("\n"));
|