@nimiplatform/nimi-coding 0.6.2 → 0.6.4
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/CHANGELOG.md +8 -0
- package/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/cli/constants.mjs +1 -3
- package/cli/lib/code/context.mjs +7 -5
- package/cli/lib/entrypoints.mjs +0 -13
- package/cli/lib/fs-helpers.mjs +1 -3
- package/package.json +1 -1
- package/spec/code-context.yaml +1 -0
- package/spec/product-scope.yaml +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.6.4
|
|
6
|
+
|
|
7
|
+
- Made experimental `code context` declaration ordering independent of the host locale, using UTF-16 code-unit text order followed by numeric source positions.
|
|
8
|
+
|
|
9
|
+
## 0.6.3
|
|
10
|
+
|
|
11
|
+
- Removed Claude-specific managed entrypoints and path validation. `start`, `sync`, `doctor`, and `clear` now manage only `AGENTS.md` instruction blocks and leave unrelated host files untouched.
|
|
12
|
+
|
|
5
13
|
## 0.6.2
|
|
6
14
|
|
|
7
15
|
- Made managed authority/code queries depend on task-relevant uncertainty, including static-dependency questions for `code context`, while preserving authority admission and result boundaries.
|
package/README.md
CHANGED
|
@@ -69,7 +69,7 @@ The current Nimi-realm validation corpus contains 33 canonical containers, 2,212
|
|
|
69
69
|
|
|
70
70
|
## Using the code surface
|
|
71
71
|
|
|
72
|
-
`start` writes package-managed guidance into the marked blocks in `AGENTS.md
|
|
72
|
+
`start` writes package-managed guidance into the marked blocks in `AGENTS.md`. On an existing installation, `doctor` diagnoses drift in that guidance and the compact methodology projection; `sync --apply` restores the exact current package projections while preserving host-owned text outside the managed blocks. An AI host that honors repository instructions can therefore learn when to request `code authority` or `code context`, and when a changed authority-governed feature warrants a small number of `@nimi-authority` markers at key semantic owners.
|
|
73
73
|
|
|
74
74
|
This is instruction-based integration, not an automatic execution layer. Nimi Coding installs no hook or daemon, intercepts no task, requires no fixed preflight, and owns no task or completion state. The host decides whether a query is useful for the current coding task. `code authority` only recalls explicit markers and current authority lifecycle; `code context` only returns the admitted root-direct TypeScript projection. Neither result proves conformance, replaces affected builds and tests, or evaluates unannotated code.
|
|
75
75
|
|
|
@@ -84,7 +84,7 @@ pnpm add -D @nimiplatform/nimi-coding
|
|
|
84
84
|
pnpm exec nimicoding start --yes
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
`start` creates the compact AI-visible authoring guide, managed instruction blocks in `AGENTS.md
|
|
87
|
+
`start` creates the compact AI-visible authoring guide, managed instruction blocks in `AGENTS.md`, and the ignored `.nimi/local/` root. It does not generate product semantics or create `.nimi/spec` for the project.
|
|
88
88
|
|
|
89
89
|
`pnpm exec nimicoding` is the supported host invocation: run it from the repository root so automation resolves the pinned project-local package. A global `nimicoding` binary in `PATH` is neither required nor a valid availability check.
|
|
90
90
|
|
package/README.zh-CN.md
CHANGED
|
@@ -69,7 +69,7 @@ AI host · 第三方扩展 · CI · future editor/UI surfaces
|
|
|
69
69
|
|
|
70
70
|
## 使用 code surface
|
|
71
71
|
|
|
72
|
-
`start` 会把 package 管理的指导写入 `AGENTS.md`
|
|
72
|
+
`start` 会把 package 管理的指导写入 `AGENTS.md` 的 marked blocks。对于已有安装,`doctor` 会诊断这些指导及 compact methodology projection 的 drift,`sync --apply` 则恢复当前 package 的精确 projections,同时保留 managed blocks 之外的宿主文本。因此,遵守 repository instructions 的 AI host 可以知道何时按需调用 `code authority` 或 `code context`,以及何时只在发生变更、受 authority 约束的功能中,为少数关键语义 owner 添加 `@nimi-authority` marker。
|
|
73
73
|
|
|
74
74
|
这是一种基于 instruction 的集成,不是自动执行层。Nimi Coding 不安装 hook 或 daemon,不拦截 task,不要求固定 preflight,也不拥有 task 或 completion state。是否需要查询由 host 根据当前 coding task 决定。`code authority` 只召回显式 marker 和当前 authority lifecycle;`code context` 只返回 admitted root-direct TypeScript projection。两者都不证明 conformance,不替代 affected build/tests,也不评价未标注代码。
|
|
75
75
|
|
|
@@ -84,7 +84,7 @@ pnpm add -D @nimiplatform/nimi-coding
|
|
|
84
84
|
pnpm exec nimicoding start --yes
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
`start` 创建紧凑的 AI-visible authoring guide、`AGENTS.md
|
|
87
|
+
`start` 创建紧凑的 AI-visible authoring guide、`AGENTS.md` 中的 managed instruction blocks,以及 ignored `.nimi/local/` root。它不会生成产品语义,也不会替项目创建 `.nimi/spec`。
|
|
88
88
|
|
|
89
89
|
`pnpm exec nimicoding` 是受支持的宿主调用方式:应从仓库根目录执行,使自动化解析到项目锁定的本地 package。既不要求全局 `PATH` 中存在 `nimicoding`,也不能用它判断 CLI 是否可用。
|
|
90
90
|
|
package/cli/constants.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const VERSION = "0.6.
|
|
1
|
+
export const VERSION = "0.6.4";
|
|
2
2
|
export const PACKAGE_NAME = "@nimiplatform/nimi-coding";
|
|
3
3
|
export const PROJECT_LOCAL_CLI_INVOCATION = "pnpm exec nimicoding";
|
|
4
4
|
export const LOCAL_GITIGNORE_ENTRIES = [".nimi/local/"];
|
|
@@ -10,5 +10,3 @@ export const REQUIRED_LOCAL_DIRS = [".nimi/local"];
|
|
|
10
10
|
|
|
11
11
|
export const AGENTS_BEGIN = "<!-- nimicoding:managed:agents:start -->";
|
|
12
12
|
export const AGENTS_END = "<!-- nimicoding:managed:agents:end -->";
|
|
13
|
-
export const CLAUDE_BEGIN = "<!-- nimicoding:managed:claude:start -->";
|
|
14
|
-
export const CLAUDE_END = "<!-- nimicoding:managed:claude:end -->";
|
package/cli/lib/code/context.mjs
CHANGED
|
@@ -5,6 +5,8 @@ import { createRequire } from "node:module";
|
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { promisify } from "node:util";
|
|
7
7
|
|
|
8
|
+
import { compareText } from "../authority/diagnostics.mjs";
|
|
9
|
+
|
|
8
10
|
const execFileAsync = promisify(execFile);
|
|
9
11
|
const TYPESCRIPT_VERSION = "5.9.3";
|
|
10
12
|
|
|
@@ -339,10 +341,10 @@ function portableLocus(compiler, repository, compilerRoot, compilerVersion, node
|
|
|
339
341
|
}
|
|
340
342
|
|
|
341
343
|
function compareLoci(left, right) {
|
|
342
|
-
return left.origin
|
|
343
|
-
|| (left.package?.name ?? ""
|
|
344
|
-
|| (left.package?.version ?? ""
|
|
345
|
-
|| left.path
|
|
344
|
+
return compareText(left.origin, right.origin)
|
|
345
|
+
|| compareText(left.package?.name ?? "", right.package?.name ?? "")
|
|
346
|
+
|| compareText(left.package?.version ?? "", right.package?.version ?? "")
|
|
347
|
+
|| compareText(left.path, right.path)
|
|
346
348
|
|| left.range.start_line - right.range.start_line
|
|
347
349
|
|| left.range.start_column - right.range.start_column
|
|
348
350
|
|| left.range.end_line - right.range.end_line
|
|
@@ -437,7 +439,7 @@ function collectSites(compiler, rootNode) {
|
|
|
437
439
|
return sites.sort((left, right) => (
|
|
438
440
|
left.node.getStart() - right.node.getStart()
|
|
439
441
|
|| left.node.getEnd() - right.node.getEnd()
|
|
440
|
-
|| left.role
|
|
442
|
+
|| compareText(left.role, right.role)
|
|
441
443
|
));
|
|
442
444
|
}
|
|
443
445
|
|
package/cli/lib/entrypoints.mjs
CHANGED
|
@@ -4,8 +4,6 @@ import path from "node:path";
|
|
|
4
4
|
import {
|
|
5
5
|
AGENTS_BEGIN,
|
|
6
6
|
AGENTS_END,
|
|
7
|
-
CLAUDE_BEGIN,
|
|
8
|
-
CLAUDE_END,
|
|
9
7
|
PROJECT_LOCAL_CLI_INVOCATION,
|
|
10
8
|
} from "../constants.mjs";
|
|
11
9
|
import { pathExists, preflightManagedProjectPaths, readUtf8FileFatal } from "./fs-helpers.mjs";
|
|
@@ -41,9 +39,6 @@ function authorityAuthoringLines() {
|
|
|
41
39
|
function managedAgentsBlock() {
|
|
42
40
|
return [AGENTS_BEGIN, "# Nimi Coding Managed Block", "", ...authorityAuthoringLines(), AGENTS_END].join("\n");
|
|
43
41
|
}
|
|
44
|
-
function managedClaudeBlock() {
|
|
45
|
-
return [CLAUDE_BEGIN, "# Nimi Coding Managed Block", "", ...authorityAuthoringLines(), CLAUDE_END].join("\n");
|
|
46
|
-
}
|
|
47
42
|
|
|
48
43
|
function occurrenceIndexes(text, marker) {
|
|
49
44
|
const indexes = [];
|
|
@@ -101,14 +96,6 @@ function entrypointDefinitions(projectRoot) {
|
|
|
101
96
|
header: "# AGENTS.md\n",
|
|
102
97
|
relativePath: "AGENTS.md",
|
|
103
98
|
},
|
|
104
|
-
{
|
|
105
|
-
path: path.join(projectRoot, "CLAUDE.md"),
|
|
106
|
-
block: managedClaudeBlock(),
|
|
107
|
-
begin: CLAUDE_BEGIN,
|
|
108
|
-
end: CLAUDE_END,
|
|
109
|
-
header: "# CLAUDE.md\n",
|
|
110
|
-
relativePath: "CLAUDE.md",
|
|
111
|
-
},
|
|
112
99
|
];
|
|
113
100
|
}
|
|
114
101
|
|
package/cli/lib/fs-helpers.mjs
CHANGED
|
@@ -4,11 +4,10 @@ import path from "node:path";
|
|
|
4
4
|
const SHARED_INODE_FORBIDDEN_PATHS = new Set([
|
|
5
5
|
".nimi/methodology/authority-authoring.yaml",
|
|
6
6
|
"AGENTS.md",
|
|
7
|
-
"CLAUDE.md",
|
|
8
7
|
".gitignore",
|
|
9
8
|
".gitattributes",
|
|
10
9
|
]);
|
|
11
|
-
const FATAL_UTF8_HOST_PATHS = new Set(["AGENTS.md", "
|
|
10
|
+
const FATAL_UTF8_HOST_PATHS = new Set(["AGENTS.md", ".gitignore", ".gitattributes"]);
|
|
12
11
|
|
|
13
12
|
const BASE_MANAGED_PATHS = [
|
|
14
13
|
[".nimi", "directory"],
|
|
@@ -20,7 +19,6 @@ const BASE_MANAGED_PATHS = [
|
|
|
20
19
|
[".nimi/contracts", "directory"],
|
|
21
20
|
[".nimi/contracts/domain-admission.schema.yaml", "file"],
|
|
22
21
|
["AGENTS.md", "file"],
|
|
23
|
-
["CLAUDE.md", "file"],
|
|
24
22
|
[".gitignore", "file"],
|
|
25
23
|
[".gitattributes", "file"],
|
|
26
24
|
];
|
package/package.json
CHANGED
package/spec/code-context.yaml
CHANGED
|
@@ -18,6 +18,7 @@ projection:
|
|
|
18
18
|
scope: selected_root_AST_only
|
|
19
19
|
relations: [static_value_binding, static_type_binding, static_constructor_binding, static_JSX_binding]
|
|
20
20
|
target: complete_nonempty_portable_declaration_set
|
|
21
|
+
declaration_loci_order: origin_package_name_package_version_path_by_UTF_16_code_units_then_numeric_range
|
|
21
22
|
target_source: optional_single_repository_declaration_syntactic_slice
|
|
22
23
|
runtime_dispatch: not_evaluated
|
|
23
24
|
response:
|
package/spec/product-scope.yaml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
version:
|
|
1
|
+
version: 13
|
|
2
2
|
product:
|
|
3
3
|
package_name: "@nimiplatform/nimi-coding"
|
|
4
4
|
mission: canonical_authority_products_bounded_read_only_code_context_and_explicit_code_authority_marker_lookup
|
|
@@ -22,7 +22,7 @@ canonical_boundary:
|
|
|
22
22
|
surface_separation:
|
|
23
23
|
public: [documented_CLI, package_documentation]
|
|
24
24
|
canonical_project_owned: .nimi/spec/**/*.authority.{yaml,md}
|
|
25
|
-
projected_AI_visible_package_owned: [.nimi/methodology/authority-authoring.yaml, AGENTS.md#managed-block
|
|
25
|
+
projected_AI_visible_package_owned: [.nimi/methodology/authority-authoring.yaml, AGENTS.md#managed-block]
|
|
26
26
|
local_non_authority: .nimi/local/**
|
|
27
27
|
package_internal: [authority_grammar_contracts, AuthorityIR, SourceMap, compiler_implementation]
|
|
28
28
|
out_of_scope:
|