@hiveai/cli 0.4.0 → 0.4.2
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/index.js +54 -13
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -382,9 +382,16 @@ See \`.ai/project-context.md\` for the full project context.
|
|
|
382
382
|
Memories live under \`.ai/memories/\` (personal/team/module).
|
|
383
383
|
|
|
384
384
|
## hAIve \u2014 mandatory rules for AI agents
|
|
385
|
+
|
|
386
|
+
### Session rules
|
|
385
387
|
- **Before** marking a task as done ("Done", "Finished", "C'est fait"), call the MCP prompt \`post_task\`.
|
|
386
388
|
- **Immediately** when an approach fails (wrong API, wrong pattern, wrong assumption), call \`mem_tried\` \u2014 do not wait until the end of the session.
|
|
387
389
|
- When starting a new task, call \`get_briefing\` with the task description to load relevant memories and avoid repeating past mistakes.
|
|
390
|
+
|
|
391
|
+
### Safety rules \u2014 NEVER violate these
|
|
392
|
+
- If \`get_briefing\` returns an \`action_required\` list, **stop and show each item to the developer** before doing anything. Use the exact \`developer_message\` provided. Wait for explicit confirmation.
|
|
393
|
+
- **Never modify code autonomously** because of a breaking change detected in another project (dependency version bump, API contract change, removed field). Always ask first.
|
|
394
|
+
- When in doubt about a cross-repo change: ask, don't act.
|
|
388
395
|
`;
|
|
389
396
|
var CI_WORKFLOW = `name: haive-sync
|
|
390
397
|
|
|
@@ -946,18 +953,33 @@ function registerSync(program2) {
|
|
|
946
953
|
if (majorBumps.length > 0) {
|
|
947
954
|
const slugParts = result.file.replace(/[^a-z0-9]/gi, "-").toLowerCase();
|
|
948
955
|
const slug = `dep-major-bump-${slugParts}-${Date.now().toString(36)}`;
|
|
949
|
-
const
|
|
956
|
+
const depList = majorBumps.map((c) => `- \u{1F534} **${c.name}** : \`${c.from}\` \u2192 \`${c.to}\``).join("\n");
|
|
957
|
+
const body = `## \u26A0\uFE0F Action requise \u2014 confirmation humaine obligatoire
|
|
958
|
+
|
|
959
|
+
Des d\xE9pendances dans \`${result.file}\` ont chang\xE9 de version majeure.
|
|
960
|
+
Une version majeure peut contenir des **breaking changes** qui impactent ce projet.
|
|
961
|
+
|
|
962
|
+
${depList}
|
|
963
|
+
|
|
964
|
+
---
|
|
965
|
+
|
|
966
|
+
**\u{1F6AB} Ne modifie aucun code de fa\xE7on autonome.**
|
|
967
|
+
|
|
968
|
+
Informe le d\xE9veloppeur avec ce message :
|
|
969
|
+
|
|
970
|
+
> *\xAB J'ai d\xE9tect\xE9 que ${majorBumps.map((c) => `\`${c.name}\``).join(", ")} a chang\xE9 de version majeure (${majorBumps.map((c) => `${c.from} \u2192 ${c.to}`).join(", ")}). Cela peut introduire des incompatibilit\xE9s dans ce projet. Veux-tu que j'analyse l'impact et que je propose des mises \xE0 jour ? \xBB*
|
|
950
971
|
|
|
951
|
-
|
|
972
|
+
Attends une **confirmation explicite** avant d'agir.
|
|
952
973
|
|
|
953
|
-
**
|
|
954
|
-
|
|
974
|
+
**Prochaines \xE9tapes (si confirm\xE9) :**
|
|
975
|
+
- Consulter le CHANGELOG : \`haive memory import-changelog --from node_modules/<pkg>/CHANGELOG.md\`
|
|
976
|
+
- V\xE9rifier les m\xE9moires ancr\xE9es : \`haive memory verify\``;
|
|
955
977
|
const fm = buildFrontmatter({
|
|
956
978
|
type: "gotcha",
|
|
957
979
|
slug,
|
|
958
980
|
scope: "team",
|
|
959
981
|
status: "validated",
|
|
960
|
-
tags: ["dependency", "breaking-change", "auto-generated"],
|
|
982
|
+
tags: ["dependency", "breaking-change", "auto-generated", "requires-human-approval"],
|
|
961
983
|
paths: [result.file],
|
|
962
984
|
topic: `dep-bump-${slugParts}`
|
|
963
985
|
});
|
|
@@ -965,7 +987,7 @@ Run \`haive memory import --from-changelog CHANGELOG.md\` if available.`;
|
|
|
965
987
|
await mkdir3(teamDir, { recursive: true });
|
|
966
988
|
await writeFile3(
|
|
967
989
|
path6.join(teamDir, `${fm.id}.md`),
|
|
968
|
-
serializeMemory({ frontmatter: fm, body }),
|
|
990
|
+
serializeMemory({ frontmatter: { ...fm, requires_human_approval: true }, body }),
|
|
969
991
|
"utf8"
|
|
970
992
|
);
|
|
971
993
|
log(ui.yellow(` \u2192 memory created: ${fm.id}`));
|
|
@@ -994,18 +1016,37 @@ Run \`haive memory import --from-changelog CHANGELOG.md\` if available.`;
|
|
|
994
1016
|
}
|
|
995
1017
|
if (breaking.length > 0) {
|
|
996
1018
|
const slug = `contract-breaking-${diff.contract.replace(/[^a-z0-9]/gi, "-").toLowerCase()}-${Date.now().toString(36)}`;
|
|
997
|
-
const
|
|
1019
|
+
const breakingList = breaking.map((c) => `- \u{1F534} **${c.kind}** : ${c.description}`).join("\n");
|
|
1020
|
+
const addList = additive.length > 0 ? `
|
|
1021
|
+
|
|
1022
|
+
### Changements non-breaking (additifs)
|
|
1023
|
+
` + additive.map((c) => `- \u{1F7E2} ${c.description}`).join("\n") : "";
|
|
1024
|
+
const body = `## \u26A0\uFE0F Action requise \u2014 confirmation humaine obligatoire
|
|
1025
|
+
|
|
1026
|
+
Le contrat **\`${diff.contract}\`** (\`${diff.file}\`) a \xE9t\xE9 modifi\xE9.
|
|
1027
|
+
Des **breaking changes** ont \xE9t\xE9 d\xE9tect\xE9s \u2014 ce projet consomme peut-\xEAtre ce contrat.
|
|
1028
|
+
|
|
1029
|
+
${breakingList}${addList}
|
|
1030
|
+
|
|
1031
|
+
---
|
|
1032
|
+
|
|
1033
|
+
**\u{1F6AB} Ne modifie aucun code de fa\xE7on autonome.**
|
|
1034
|
+
|
|
1035
|
+
Informe le d\xE9veloppeur avec ce message :
|
|
1036
|
+
|
|
1037
|
+
> *\xAB J'ai d\xE9tect\xE9 que le contrat \`${diff.contract}\` a chang\xE9 : ${breaking.length} breaking change(s) d\xE9tect\xE9(s). Ce projet d\xE9pend peut-\xEAtre de ce contrat. Veux-tu que j'analyse l'impact et que je propose des mises \xE0 jour ? \xBB*
|
|
998
1038
|
|
|
999
|
-
|
|
1039
|
+
Attends une **confirmation explicite** avant d'agir.
|
|
1000
1040
|
|
|
1001
|
-
**
|
|
1002
|
-
|
|
1041
|
+
**Prochaines \xE9tapes (si confirm\xE9) :**
|
|
1042
|
+
- Rechercher les usages : \`haive memory for-files <fichiers concern\xE9s>\`
|
|
1043
|
+
- V\xE9rifier les m\xE9moires li\xE9es : \`haive memory query ${diff.contract}\``;
|
|
1003
1044
|
const fm = buildFrontmatter({
|
|
1004
1045
|
type: "gotcha",
|
|
1005
1046
|
slug,
|
|
1006
1047
|
scope: "team",
|
|
1007
1048
|
status: "validated",
|
|
1008
|
-
tags: ["api-contract", "breaking-change", diff.contract, "auto-generated"],
|
|
1049
|
+
tags: ["api-contract", "breaking-change", diff.contract, "auto-generated", "requires-human-approval"],
|
|
1009
1050
|
paths: [diff.file],
|
|
1010
1051
|
topic: `contract-breaking-${diff.contract}`
|
|
1011
1052
|
});
|
|
@@ -1013,7 +1054,7 @@ Check memories tagged with \`${diff.contract}\` for potentially stale knowledge.
|
|
|
1013
1054
|
await mkdir3(teamDir, { recursive: true });
|
|
1014
1055
|
await writeFile3(
|
|
1015
1056
|
path6.join(teamDir, `${fm.id}.md`),
|
|
1016
|
-
serializeMemory({ frontmatter: fm, body }),
|
|
1057
|
+
serializeMemory({ frontmatter: { ...fm, requires_human_approval: true }, body }),
|
|
1017
1058
|
"utf8"
|
|
1018
1059
|
);
|
|
1019
1060
|
log(ui.yellow(` \u2192 memory created: ${fm.id}`));
|
|
@@ -3287,7 +3328,7 @@ Next steps:
|
|
|
3287
3328
|
|
|
3288
3329
|
// src/index.ts
|
|
3289
3330
|
var program = new Command32();
|
|
3290
|
-
program.name("haive").description("hAIve \u2014 team-first persistent memory layer for AI coding agents").version("0.4.
|
|
3331
|
+
program.name("haive").description("hAIve \u2014 team-first persistent memory layer for AI coding agents").version("0.4.2");
|
|
3291
3332
|
registerInit(program);
|
|
3292
3333
|
registerMcp(program);
|
|
3293
3334
|
registerBriefing(program);
|