@ainova-systems/intelligence 0.11.0-rc.6 → 0.11.0-rc.8
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 +15 -16
- package/cli/commands/adapter.sh +153 -0
- package/cli/commands/init.sh +113 -22
- package/cli/commands/package.sh +30 -0
- package/cli/commands/registry.sh +5 -2
- package/cli/commands/status.sh +12 -4
- package/cli/commands/sync.sh +8 -21
- package/cli/commands/update.sh +76 -61
- package/cli/engine-package.yaml +4 -4
- package/cli/intelligence +37 -27
- package/cli/{commands/doctor.sh → internal/check.sh} +32 -14
- package/cli/{commands/migrate.sh → internal/migrate-v1.sh} +161 -42
- package/cli/{commands/add.sh → internal/package-add.sh} +11 -10
- package/cli/{commands/list.sh → internal/package-list.sh} +9 -4
- package/cli/{commands/remove.sh → internal/package-remove.sh} +3 -3
- package/cli/{commands/search.sh → internal/package-search.sh} +4 -4
- package/cli/internal/package-update.sh +97 -0
- package/cli/{commands/install.sh → internal/restore.sh} +11 -4
- package/cli/internal/target-state.sh +57 -0
- package/cli/{commands/upgrade.sh → internal/upgrade-v2.sh} +48 -8
- package/cli/lib/cli-common.sh +167 -14
- package/cli/lib/lockfile.sh +15 -9
- package/cli/lib/manifest.sh +106 -1
- package/cli/lib/registry.sh +29 -15
- package/cli/lib/semver.sh +4 -2
- package/engine/ENGINE_SHA +1 -0
- package/engine/{scripts/adapters → adapters}/_template.sh +10 -9
- package/engine/{scripts/adapters → adapters}/agents.sh +20 -25
- package/engine/{scripts/adapters → adapters}/opencode.sh +1 -1
- package/engine/{scripts/lib → lib}/common.sh +29 -541
- package/engine/lib/contract.sh +120 -0
- package/engine/sync.sh +238 -0
- package/package.json +6 -5
- package/{engine → packages/sync}/agents/intelligence-architect.md +5 -3
- package/{engine → packages/sync}/agents/intelligence-operator.md +10 -13
- package/packages/sync/references/adapters.md +252 -0
- package/packages/sync/references/conventions.md +385 -0
- package/{engine → packages/sync}/rules/intelligence-authoring.md +6 -6
- package/{engine → packages/sync}/skills/intelligence-add-agent/SKILL.md +5 -5
- package/{engine → packages/sync}/skills/intelligence-add-rule/SKILL.md +3 -3
- package/{engine → packages/sync}/skills/intelligence-add-skill/SKILL.md +3 -3
- package/{engine → packages/sync}/skills/intelligence-extract-skill/SKILL.md +2 -2
- package/packages/sync/skills/intelligence-install-adapter/SKILL.md +38 -0
- package/{engine → packages/sync}/skills/intelligence-learn-from-context/SKILL.md +3 -3
- package/packages/sync/skills/intelligence-learn-from-repository/SKILL.md +55 -0
- package/{engine → packages/sync}/skills/intelligence-review-skills/SKILL.md +6 -6
- package/packages/sync/skills/intelligence-sync/SKILL.md +20 -0
- package/packages/sync/skills/intelligence-uninstall-adapter/SKILL.md +24 -0
- package/packages/sync/skills/intelligence-update/SKILL.md +43 -0
- package/engine/INIT.md +0 -500
- package/engine/docs/ADAPTERS.md +0 -214
- package/engine/docs/CLI.md +0 -90
- package/engine/docs/CONVENTIONS.md +0 -456
- package/engine/scripts/ENGINE_SHA +0 -1
- package/engine/scripts/lib/layout.sh +0 -51
- package/engine/scripts/lib/migrations.sh +0 -708
- package/engine/scripts/sync.sh +0 -311
- package/engine/scripts/update.sh +0 -237
- package/engine/skills/intelligence-install-adapter/SKILL.md +0 -31
- package/engine/skills/intelligence-sync/SKILL.md +0 -16
- package/engine/skills/intelligence-uninstall-adapter/SKILL.md +0 -42
- package/engine/skills/intelligence-update/SKILL.md +0 -165
- /package/engine/{scripts/VERSION → VERSION} +0 -0
- /package/engine/{scripts/adapters → adapters}/claude.sh +0 -0
- /package/engine/{scripts/adapters → adapters}/codex.sh +0 -0
- /package/engine/{scripts/adapters → adapters}/copilot.sh +0 -0
- /package/engine/{scripts/adapters → adapters}/cursor.sh +0 -0
- /package/engine/{scripts/adapters → adapters}/pi.sh +0 -0
package/cli/lib/semver.sh
CHANGED
|
@@ -75,10 +75,11 @@ semver_match() {
|
|
|
75
75
|
# onto their tag.
|
|
76
76
|
list_remote_versions() {
|
|
77
77
|
local url="$1"
|
|
78
|
+
assert_safe_source_url "$url"
|
|
78
79
|
# `|| true` inside the pipeline: an unreachable repo must read as "no
|
|
79
80
|
# versions", not kill a pipefail caller mid-command-substitution —
|
|
80
81
|
# reachability is the CALLER's question (add probes it explicitly).
|
|
81
|
-
{ GIT_TERMINAL_PROMPT=0 git ls-remote --tags "$url" 2>/dev/null || true; } \
|
|
82
|
+
{ GIT_TERMINAL_PROMPT=0 git ls-remote --tags -- "$url" 2>/dev/null || true; } \
|
|
82
83
|
| awk '{
|
|
83
84
|
sub(/\r$/, "")
|
|
84
85
|
ref = $2
|
|
@@ -95,7 +96,8 @@ list_remote_versions() {
|
|
|
95
96
|
# prints "<tag> <sha>". Peeled sha (the commit a tag object points at) wins.
|
|
96
97
|
remote_tag_for_version() {
|
|
97
98
|
local url="$1" ver="${2#v}"
|
|
98
|
-
|
|
99
|
+
assert_safe_source_url "$url"
|
|
100
|
+
{ GIT_TERMINAL_PROMPT=0 git ls-remote --tags -- "$url" 2>/dev/null || true; } \
|
|
99
101
|
| awk -v want="$ver" '
|
|
100
102
|
{
|
|
101
103
|
sub(/\r$/, "")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
f2bfc5e3722bf6fb2f7309db2d248368d5b0cc5e
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
#
|
|
3
|
-
#
|
|
2
|
+
# Intelligence CLI: project adapter template
|
|
3
|
+
# Scaffold this file with: intelligence adapter create <name>
|
|
4
4
|
#
|
|
5
5
|
# This file is NOT executable as-is — `<name>` placeholders below would be
|
|
6
6
|
# parsed by bash as input redirection (`<` operator). Replace every
|
|
7
7
|
# occurrence with your adapter name before sourcing.
|
|
8
8
|
#
|
|
9
9
|
# Required:
|
|
10
|
-
# 1.
|
|
11
|
-
# 2.
|
|
12
|
-
#
|
|
13
|
-
# 4. Add target to config.yaml:
|
|
10
|
+
# 1. Implement sync_to_<name>() and its three content transforms
|
|
11
|
+
# 2. Enable it after implementation: intelligence adapter enable <name>
|
|
12
|
+
# This adds the target to intelligence.yaml when it is absent:
|
|
14
13
|
# targets:
|
|
15
14
|
# <name>: { enabled: true, output: ".<name>" }
|
|
16
15
|
#
|
|
17
16
|
# The sync_to_<name>() function receives:
|
|
18
17
|
# $1 = repo_root — absolute path to the project root
|
|
19
|
-
# $2 = config_file — absolute path to
|
|
18
|
+
# $2 = config_file — absolute path to intelligence.yaml
|
|
20
19
|
# $3 = output_dir — absolute path to the output directory (e.g., .myide/)
|
|
21
20
|
#
|
|
22
21
|
# Available library functions (from lib/common.sh):
|
|
@@ -29,10 +28,12 @@
|
|
|
29
28
|
# get_model_default(ide, tier) — hardcoded default for ide:tier
|
|
30
29
|
# map_access_to_claude_tools(access) — full->"" (no tools list; inherits all), readonly->restricted
|
|
31
30
|
# map_access_to_claude_disallowed(access) — readonly->"Write, Edit", full->""
|
|
32
|
-
# read_yaml_list(
|
|
31
|
+
# read_yaml_list(manifest, section) — read a source list from intelligence.yaml
|
|
33
32
|
# get_target_field(config, target, field) — read a target's config field
|
|
34
33
|
|
|
35
|
-
|
|
34
|
+
# Project adapters are sourced by engine/sync.sh after the shared library is
|
|
35
|
+
# loaded. Keep this template position-independent: after scaffolding it lives
|
|
36
|
+
# under the project's content directory, not beside engine/lib/.
|
|
36
37
|
|
|
37
38
|
# Sync rules for <agent-name>
|
|
38
39
|
# Typical transformations:
|
|
@@ -13,25 +13,20 @@
|
|
|
13
13
|
|
|
14
14
|
source "$(dirname "${BASH_SOURCE[0]}")/../lib/common.sh"
|
|
15
15
|
|
|
16
|
-
# Repo-relative paths to the
|
|
17
|
-
# never hardcoded. The
|
|
18
|
-
# `
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
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
|
|
205
|
-
|
|
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 $
|
|
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
|
|
249
|
-
|
|
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 "$
|
|
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 "
|
|
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: $
|
|
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: \`$
|
|
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 /
|
|
32
|
+
# convention (see CLAUDE.md / packages/sync/references/conventions.md).
|
|
33
33
|
|
|
34
34
|
sync_opencode_skills() {
|
|
35
35
|
local repo_root="$1"
|