ultimate-brain 0.3.1 → 0.4.0

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.
Files changed (38) hide show
  1. package/.agents/skills/brain-apply/SKILL.md +10 -6
  2. package/.agents/skills/brain-catch-up/SKILL.md +27 -14
  3. package/.agents/skills/brain-connect-notion/SKILL.md +2 -2
  4. package/.agents/skills/brain-howto/references/guide.md +44 -11
  5. package/.agents/skills/brain-ingest/SKILL.md +14 -8
  6. package/.agents/skills/brain-ingest/references/cli-inputs.md +19 -2
  7. package/.agents/skills/brain-ingest/references/extraction.md +11 -7
  8. package/.agents/skills/brain-ingest/references/notion.md +25 -11
  9. package/.agents/skills/brain-ingest/references/sources.md +24 -1
  10. package/.agents/skills/brain-notion-change/SKILL.md +16 -2
  11. package/.agents/skills/brain-query/SKILL.md +22 -2
  12. package/.agents/skills/brain-sync/SKILL.md +6 -4
  13. package/.agents/skills/brain-sync/references/formats.md +1 -1
  14. package/README.md +1 -1
  15. package/dist/cli.js +5 -2
  16. package/dist/commands/proposal.js +21 -1
  17. package/dist/commands/repo.js +110 -0
  18. package/dist/commands/report.js +115 -0
  19. package/dist/commands/source.js +56 -0
  20. package/dist/commands/status.js +4 -1
  21. package/dist/commands/views.js +30 -15
  22. package/dist/lib/apply.js +83 -10
  23. package/dist/lib/errors.js +3 -0
  24. package/dist/lib/frontmatter.js +9 -4
  25. package/dist/lib/lint.js +34 -5
  26. package/dist/lib/note-new.js +44 -0
  27. package/dist/lib/notes.js +1 -0
  28. package/dist/lib/parts.js +82 -0
  29. package/dist/lib/proposals.js +183 -8
  30. package/dist/lib/repos.js +129 -0
  31. package/dist/lib/sync.js +167 -28
  32. package/dist/lib/views.js +53 -15
  33. package/package.json +1 -1
  34. package/spec/schemas/brain.schema.json +46 -0
  35. package/spec/schemas/note.schema.json +343 -3
  36. package/spec/schemas/proposal.schema.json +393 -10
  37. package/templates/brain/AGENTS.md +4 -4
  38. package/templates/brain/brain.json +2 -1
@@ -834,11 +834,49 @@
834
834
  "type": "string",
835
835
  "minLength": 1
836
836
  },
837
+ "repo": {
838
+ "type": "string",
839
+ "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
840
+ },
841
+ "repo_path": {
842
+ "type": "string",
843
+ "minLength": 1,
844
+ "pattern": "^[^/\\\\].*$"
845
+ },
846
+ "commit": {
847
+ "type": "string",
848
+ "pattern": "^[0-9a-f]{40}$"
849
+ },
850
+ "attached_to": {
851
+ "$ref": "#/$defs/sourceId"
852
+ },
837
853
  "summary": {
838
854
  "type": "string",
839
855
  "minLength": 1,
840
856
  "maxLength": 400
841
857
  },
858
+ "digest": {
859
+ "type": "string",
860
+ "minLength": 1
861
+ },
862
+ "notion_text": {
863
+ "enum": [
864
+ "digest",
865
+ "full"
866
+ ]
867
+ },
868
+ "notion_parts": {
869
+ "type": "array",
870
+ "minItems": 1,
871
+ "uniqueItems": true,
872
+ "items": {
873
+ "type": "string",
874
+ "pattern": "^[1-9][0-9]*(-[1-9][0-9]*)?$"
875
+ }
876
+ },
877
+ "notion_text_requested": {
878
+ "$ref": "#/$defs/timestamp"
879
+ },
842
880
  "notion": {
843
881
  "$ref": "#/$defs/notionPageId"
844
882
  },
@@ -936,13 +974,136 @@
936
974
  }
937
975
  }
938
976
  }
977
+ },
978
+ {
979
+ "description": "repo, repo_path and commit come together (0042).",
980
+ "if": {
981
+ "anyOf": [
982
+ {
983
+ "required": [
984
+ "repo"
985
+ ]
986
+ },
987
+ {
988
+ "required": [
989
+ "repo_path"
990
+ ]
991
+ },
992
+ {
993
+ "required": [
994
+ "commit"
995
+ ]
996
+ }
997
+ ]
998
+ },
999
+ "then": {
1000
+ "required": [
1001
+ "repo",
1002
+ "repo_path",
1003
+ "commit"
1004
+ ],
1005
+ "properties": {
1006
+ "source_key": {
1007
+ "pattern": "^file:"
1008
+ }
1009
+ }
1010
+ }
1011
+ },
1012
+ {
1013
+ "if": {
1014
+ "required": [
1015
+ "attached_to"
1016
+ ]
1017
+ },
1018
+ "then": {
1019
+ "properties": {
1020
+ "source_key": {
1021
+ "pattern": "^file:"
1022
+ }
1023
+ }
1024
+ }
1025
+ },
1026
+ {
1027
+ "description": "notion_parts only with notion_text: full (0043).",
1028
+ "if": {
1029
+ "required": [
1030
+ "notion_parts"
1031
+ ]
1032
+ },
1033
+ "then": {
1034
+ "required": [
1035
+ "notion_text"
1036
+ ],
1037
+ "properties": {
1038
+ "notion_text": {
1039
+ "const": "full"
1040
+ }
1041
+ }
1042
+ }
1043
+ },
1044
+ {
1045
+ "description": "No brain-written Inbox body on minutes, captures or attachments (0043).",
1046
+ "if": {
1047
+ "anyOf": [
1048
+ {
1049
+ "required": [
1050
+ "attached_to"
1051
+ ]
1052
+ },
1053
+ {
1054
+ "required": [
1055
+ "kind"
1056
+ ],
1057
+ "properties": {
1058
+ "kind": {
1059
+ "enum": [
1060
+ "minutes",
1061
+ "capture"
1062
+ ]
1063
+ }
1064
+ }
1065
+ },
1066
+ {
1067
+ "not": {
1068
+ "required": [
1069
+ "kind"
1070
+ ]
1071
+ }
1072
+ }
1073
+ ]
1074
+ },
1075
+ "then": {
1076
+ "not": {
1077
+ "anyOf": [
1078
+ {
1079
+ "required": [
1080
+ "digest"
1081
+ ]
1082
+ },
1083
+ {
1084
+ "required": [
1085
+ "notion_text"
1086
+ ]
1087
+ },
1088
+ {
1089
+ "required": [
1090
+ "notion_parts"
1091
+ ]
1092
+ },
1093
+ {
1094
+ "required": [
1095
+ "notion_text_requested"
1096
+ ]
1097
+ }
1098
+ ]
1099
+ }
1100
+ }
939
1101
  }
940
1102
  ]
941
1103
  },
942
1104
  "view": {
943
1105
  "required": [
944
1106
  "view_kind",
945
- "project",
946
1107
  "generated_from",
947
1108
  "generated_at"
948
1109
  ],
@@ -950,12 +1111,30 @@
950
1111
  "view_kind": {
951
1112
  "enum": [
952
1113
  "brief",
953
- "decision_log"
1114
+ "decision_log",
1115
+ "area_brief",
1116
+ "report"
954
1117
  ]
955
1118
  },
956
1119
  "project": {
957
1120
  "$ref": "#/$defs/projectId"
958
1121
  },
1122
+ "area": {
1123
+ "$ref": "#/$defs/areaId"
1124
+ },
1125
+ "projects": {
1126
+ "type": "array",
1127
+ "items": {
1128
+ "$ref": "#/$defs/projectId"
1129
+ }
1130
+ },
1131
+ "question": {
1132
+ "type": "string",
1133
+ "minLength": 1
1134
+ },
1135
+ "asked_in": {
1136
+ "$ref": "#/$defs/notionPageId"
1137
+ },
959
1138
  "generated_from": {
960
1139
  "type": "array",
961
1140
  "items": {
@@ -964,6 +1143,15 @@
964
1143
  },
965
1144
  "generated_at": {
966
1145
  "$ref": "#/$defs/timestamp"
1146
+ },
1147
+ "notion": {
1148
+ "$ref": "#/$defs/notionPageId"
1149
+ },
1150
+ "last_synced": {
1151
+ "$ref": "#/$defs/timestamp"
1152
+ },
1153
+ "notion_published": {
1154
+ "type": "object"
967
1155
  }
968
1156
  },
969
1157
  "not": {
@@ -984,7 +1172,159 @@
984
1172
  ]
985
1173
  }
986
1174
  ]
987
- }
1175
+ },
1176
+ "allOf": [
1177
+ {
1178
+ "if": {
1179
+ "properties": {
1180
+ "view_kind": {
1181
+ "enum": [
1182
+ "brief",
1183
+ "decision_log"
1184
+ ]
1185
+ }
1186
+ }
1187
+ },
1188
+ "then": {
1189
+ "allOf": [
1190
+ {
1191
+ "required": [
1192
+ "project"
1193
+ ]
1194
+ },
1195
+ {
1196
+ "not": {
1197
+ "anyOf": [
1198
+ {
1199
+ "required": [
1200
+ "area"
1201
+ ]
1202
+ },
1203
+ {
1204
+ "required": [
1205
+ "projects"
1206
+ ]
1207
+ },
1208
+ {
1209
+ "required": [
1210
+ "question"
1211
+ ]
1212
+ },
1213
+ {
1214
+ "required": [
1215
+ "asked_in"
1216
+ ]
1217
+ },
1218
+ {
1219
+ "required": [
1220
+ "notion"
1221
+ ]
1222
+ },
1223
+ {
1224
+ "required": [
1225
+ "last_synced"
1226
+ ]
1227
+ },
1228
+ {
1229
+ "required": [
1230
+ "notion_published"
1231
+ ]
1232
+ }
1233
+ ]
1234
+ }
1235
+ }
1236
+ ]
1237
+ }
1238
+ },
1239
+ {
1240
+ "if": {
1241
+ "properties": {
1242
+ "view_kind": {
1243
+ "const": "area_brief"
1244
+ }
1245
+ }
1246
+ },
1247
+ "then": {
1248
+ "allOf": [
1249
+ {
1250
+ "required": [
1251
+ "area"
1252
+ ]
1253
+ },
1254
+ {
1255
+ "not": {
1256
+ "anyOf": [
1257
+ {
1258
+ "required": [
1259
+ "project"
1260
+ ]
1261
+ },
1262
+ {
1263
+ "required": [
1264
+ "projects"
1265
+ ]
1266
+ },
1267
+ {
1268
+ "required": [
1269
+ "question"
1270
+ ]
1271
+ },
1272
+ {
1273
+ "required": [
1274
+ "asked_in"
1275
+ ]
1276
+ },
1277
+ {
1278
+ "required": [
1279
+ "notion"
1280
+ ]
1281
+ },
1282
+ {
1283
+ "required": [
1284
+ "last_synced"
1285
+ ]
1286
+ },
1287
+ {
1288
+ "required": [
1289
+ "notion_published"
1290
+ ]
1291
+ }
1292
+ ]
1293
+ }
1294
+ }
1295
+ ]
1296
+ }
1297
+ },
1298
+ {
1299
+ "if": {
1300
+ "properties": {
1301
+ "view_kind": {
1302
+ "const": "report"
1303
+ }
1304
+ }
1305
+ },
1306
+ "then": {
1307
+ "allOf": [
1308
+ {
1309
+ "required": [
1310
+ "question"
1311
+ ]
1312
+ },
1313
+ {
1314
+ "not": {
1315
+ "anyOf": [
1316
+ {
1317
+ "required": [
1318
+ "project"
1319
+ ]
1320
+ }
1321
+ ]
1322
+ }
1323
+ }
1324
+ ]
1325
+ }
1326
+ }
1327
+ ]
988
1328
  },
989
1329
  "memory": {
990
1330
  "required": [