@ainova-systems/intelligence 0.11.0-rc.1 → 0.11.0-rc.10

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 (72) hide show
  1. package/README.md +19 -16
  2. package/cli/commands/adapter.sh +153 -0
  3. package/cli/commands/init.sh +171 -34
  4. package/cli/commands/package.sh +30 -0
  5. package/cli/commands/registry.sh +65 -30
  6. package/cli/commands/status.sh +20 -11
  7. package/cli/commands/sync.sh +9 -4
  8. package/cli/commands/update.sh +80 -46
  9. package/cli/engine-package.yaml +14 -0
  10. package/cli/intelligence +37 -26
  11. package/cli/internal/align-project.sh +134 -0
  12. package/cli/internal/check.sh +128 -0
  13. package/cli/internal/convert-legacy.sh +400 -0
  14. package/cli/{commands/add.sh → internal/package-add.sh} +37 -19
  15. package/cli/{commands/list.sh → internal/package-list.sh} +10 -5
  16. package/cli/{commands/remove.sh → internal/package-remove.sh} +16 -4
  17. package/cli/internal/package-search.sh +83 -0
  18. package/cli/internal/package-update.sh +103 -0
  19. package/cli/internal/restore.sh +130 -0
  20. package/cli/internal/target-state.sh +57 -0
  21. package/cli/lib/cli-common.sh +213 -63
  22. package/cli/lib/lockfile.sh +15 -9
  23. package/cli/lib/manifest.sh +257 -4
  24. package/cli/lib/registry.sh +96 -47
  25. package/cli/lib/semver.sh +12 -4
  26. package/engine/ENGINE_SHA +1 -0
  27. package/engine/{scripts/adapters → adapters}/_template.sh +10 -9
  28. package/engine/{scripts/adapters → adapters}/agents.sh +20 -25
  29. package/engine/{scripts/adapters → adapters}/opencode.sh +1 -1
  30. package/engine/{scripts/lib → lib}/common.sh +30 -538
  31. package/engine/lib/contract.sh +120 -0
  32. package/engine/sync.sh +238 -0
  33. package/package.json +5 -5
  34. package/{engine → packages/sync}/agents/intelligence-architect.md +5 -3
  35. package/{engine → packages/sync}/agents/intelligence-operator.md +10 -13
  36. package/packages/sync/references/adapters.md +252 -0
  37. package/packages/sync/references/conventions.md +385 -0
  38. package/{engine → packages/sync}/rules/intelligence-authoring.md +7 -7
  39. package/{engine → packages/sync}/skills/intelligence-add-agent/SKILL.md +7 -7
  40. package/{engine → packages/sync}/skills/intelligence-add-rule/SKILL.md +5 -5
  41. package/{engine → packages/sync}/skills/intelligence-add-skill/SKILL.md +5 -5
  42. package/{engine → packages/sync}/skills/intelligence-extract-skill/SKILL.md +2 -2
  43. package/packages/sync/skills/intelligence-install-adapter/SKILL.md +38 -0
  44. package/{engine → packages/sync}/skills/intelligence-learn-from-context/SKILL.md +3 -3
  45. package/packages/sync/skills/intelligence-learn-from-repository/SKILL.md +55 -0
  46. package/{engine → packages/sync}/skills/intelligence-review-skills/SKILL.md +7 -7
  47. package/packages/sync/skills/intelligence-sync/SKILL.md +20 -0
  48. package/packages/sync/skills/intelligence-uninstall-adapter/SKILL.md +24 -0
  49. package/packages/sync/skills/intelligence-update/SKILL.md +43 -0
  50. package/cli/commands/doctor.sh +0 -100
  51. package/cli/commands/install.sh +0 -84
  52. package/cli/commands/migrate.sh +0 -251
  53. package/cli/commands/upgrade.sh +0 -27
  54. package/engine/INIT.md +0 -498
  55. package/engine/docs/ADAPTERS.md +0 -212
  56. package/engine/docs/CLI.md +0 -91
  57. package/engine/docs/CONVENTIONS.md +0 -440
  58. package/engine/scripts/lib/layout.sh +0 -51
  59. package/engine/scripts/lib/migrations.sh +0 -708
  60. package/engine/scripts/sync.sh +0 -311
  61. package/engine/scripts/update.sh +0 -237
  62. package/engine/skills/intelligence-install-adapter/SKILL.md +0 -31
  63. package/engine/skills/intelligence-sync/SKILL.md +0 -18
  64. package/engine/skills/intelligence-uninstall-adapter/SKILL.md +0 -42
  65. package/engine/skills/intelligence-update/SKILL.md +0 -159
  66. package/registry/index.yaml +0 -15
  67. /package/engine/{scripts/VERSION → VERSION} +0 -0
  68. /package/engine/{scripts/adapters → adapters}/claude.sh +0 -0
  69. /package/engine/{scripts/adapters → adapters}/codex.sh +0 -0
  70. /package/engine/{scripts/adapters → adapters}/copilot.sh +0 -0
  71. /package/engine/{scripts/adapters → adapters}/cursor.sh +0 -0
  72. /package/engine/{scripts/adapters → adapters}/pi.sh +0 -0
@@ -13,25 +13,20 @@
13
13
 
14
14
  source "$(dirname "${BASH_SOURCE[0]}")/../lib/common.sh"
15
15
 
16
- # Repo-relative paths to the umbrella folder and the engine module, DERIVED —
17
- # never hardcoded. The umbrella is named by the project (`intelligence/`,
18
- # `Intelligence/`, a codename) and the engine lives in a module inside it;
19
- # detect_layout resolved both before any adapter ran. A literal path here would
20
- # print a sync command that does not exist, and would be wrong outright on a
21
- # case-sensitive filesystem — in the one document Cursor, Copilot and Codex all
22
- # read as canonical.
23
- # sync.sh exports both as layout tokens; recompute only when an adapter is
24
- # driven directly (tests), never assume a folder name.
25
- agents_md_umbrella_rel() {
26
- local repo_root="$1" rel="${IS_UMBRELLA_REL:-}"
27
- [ -n "$rel" ] || rel="$(repo_rel_dir "$repo_root" "${LS_UMBRELLA_DIR:-$repo_root/intelligence}")"
28
- printf '%s' "${rel:-intelligence}"
16
+ # Repo-relative paths to the project's content dir and to the installed sync
17
+ # package, taken from the env contract — never hardcoded. The content dir is
18
+ # named by the project (`intelligence/`, a codename) and the package sits in
19
+ # the store; a literal path here would print a sync command that does not
20
+ # exist, and would be wrong outright on a case-sensitive filesystem — in the
21
+ # one document Cursor, Copilot and Codex all read as canonical.
22
+ # The defaults only cover an adapter driven directly (tests); sync.sh always
23
+ # exports both.
24
+ agents_md_content_rel() {
25
+ printf '%s' "${IS_CONTENT_REL:-intelligence}"
29
26
  }
30
27
 
31
28
  agents_md_module_rel() {
32
- local repo_root="$1" rel="${IS_MODULE_REL:-}"
33
- [ -n "$rel" ] || rel="$(repo_rel_dir "$repo_root" "${LS_MODULE_DIR:-$repo_root/intelligence/sync}")"
34
- printf '%s' "${rel:-intelligence/sync}"
29
+ printf '%s' "${IS_MODULE_REL:-.intelligence/packages/@ainova-systems/sync}"
35
30
  }
36
31
 
37
32
  # Append the static header block from config.yaml (or a fallback).
@@ -201,14 +196,14 @@ agents_md_append_rules_list() {
201
196
  # Path-scoped rules stay in tool-specific channels (.cursor/rules/,
202
197
  # .github/instructions/) so monorepo scoping is preserved.
203
198
  if [ "${#global_rule_files[@]}" -gt 0 ]; then
204
- local umbrella_rel
205
- umbrella_rel="$(agents_md_umbrella_rel "$repo_root")"
199
+ local content_rel
200
+ content_rel="$(agents_md_content_rel "$repo_root")"
206
201
  {
207
202
  echo "---"
208
203
  echo ""
209
204
  echo "## Project Context"
210
205
  echo ""
211
- echo "<!-- Inlined from always-on rules in $umbrella_rel/rules/ -->"
206
+ echo "<!-- Inlined from always-on rules in $content_rel/rules/ -->"
212
207
  echo ""
213
208
  } >> "$output"
214
209
  local rf
@@ -245,17 +240,17 @@ sync_to_agents() {
245
240
 
246
241
  mkdir -p "$(dirname "$output_file")"
247
242
 
248
- local umbrella_rel module_rel
249
- umbrella_rel="$(agents_md_umbrella_rel "$repo_root")"
243
+ local content_rel module_rel
244
+ content_rel="$(agents_md_content_rel "$repo_root")"
250
245
  module_rel="$(agents_md_module_rel "$repo_root")"
251
246
 
252
247
  # These two strings are written into a COMMITTED file. An absolute path here
253
248
  # means the derivation failed, and a machine-specific path in AGENTS.md is
254
249
  # worse than a failed sync — fail loudly instead.
255
- case "$umbrella_rel$module_rel" in
250
+ case "$content_rel$module_rel" in
256
251
  /*|*:[\\/]*)
257
252
  echo " ERROR: AGENTS.md paths did not resolve relative to the repo root:" >&2
258
- echo " umbrella='$umbrella_rel' module='$module_rel' repo_root='$repo_root'" >&2
253
+ echo " content='$content_rel' module='$module_rel' repo_root='$repo_root'" >&2
259
254
  return 1
260
255
  ;;
261
256
  esac
@@ -266,7 +261,7 @@ sync_to_agents() {
266
261
 
267
262
  {
268
263
  echo "<!-- Generated by intelligence-sync. Do not edit manually. -->"
269
- echo "<!-- Source: $umbrella_rel/ | Sync: $sync_cmd -->"
264
+ echo "<!-- Source: $content_rel/ | Sync: $sync_cmd -->"
270
265
  echo ""
271
266
  } > "$output_file"
272
267
 
@@ -275,7 +270,7 @@ sync_to_agents() {
275
270
  {
276
271
  echo "## Intelligence"
277
272
  echo ""
278
- echo "Source of truth: \`$umbrella_rel/\` | Sync: \`$sync_cmd\`"
273
+ echo "Source of truth: \`$content_rel/\` | Sync: \`$sync_cmd\`"
279
274
  echo ""
280
275
  } >> "$output_file"
281
276
 
@@ -29,7 +29,7 @@ source "$(dirname "${BASH_SOURCE[0]}")/../lib/common.sh"
29
29
  # Strip frontmatter, return body only.
30
30
  # Direct call to the shared `strip_frontmatter` helper in lib/common.sh —
31
31
  # duplicating the awk block here would violate the "all parsing in common.sh"
32
- # convention (see CLAUDE.md / docs/CONVENTIONS.md).
32
+ # convention (see CLAUDE.md / packages/sync/references/conventions.md).
33
33
 
34
34
  sync_opencode_skills() {
35
35
  local repo_root="$1"