pi-revit 0.4.0 → 0.5.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.
- package/AGENTS.md +167 -0
- package/CHANGELOG.md +465 -430
- package/README.md +604 -548
- package/bin/pi-revit.js +9 -9
- package/docs/architecture.md +271 -0
- package/docs/evaluation.md +434 -0
- package/docs/invariants.json +147 -0
- package/extensions/pi-revit/completion-monitor.ts +55 -0
- package/extensions/pi-revit/contracts.ts +146 -0
- package/extensions/pi-revit/discovery.ts +93 -0
- package/extensions/pi-revit/index.ts +342 -255
- package/extensions/pi-revit/instance-router.ts +86 -86
- package/extensions/pi-revit/platform-prompt.ts +40 -0
- package/extensions/pi-revit/scope-monitor.ts +114 -0
- package/extensions/pi-revit/script-library.ts +144 -144
- package/extensions/pi-revit/tool-catalog.ts +113 -14
- package/extensions/pi-revit/tool-documentation.ts +72 -0
- package/extensions/pi-revit/tool-schema.ts +8 -0
- package/package.json +8 -2
- package/scripts/build.ps1 +9 -9
- package/scripts/check-sdk.ps1 +66 -66
- package/scripts/check-tool-documentation.mjs +287 -0
- package/scripts/deploy.ps1 +16 -16
- package/scripts/generate-contracts.mjs +80 -0
- package/scripts/lib/platform.mjs +226 -0
- package/scripts/test-extension.mjs +15 -0
- package/skills/pi-revit/SKILL.md +30 -218
- package/skills/pi-revit/contracts.generated.json +3524 -0
- package/skills/pi-revit/references/execution-rules.md +41 -0
- package/skills/pi-revit/references/model-audit-export.md +38 -27
- package/skills/pi-revit/references/operation-recovery.md +33 -0
- package/skills/pi-revit/references/room-documentation.md +37 -26
- package/skills/pi-revit/references/tool-index.md +89 -0
- package/skills/pi-revit/references/tools/capture_view.md +62 -0
- package/skills/pi-revit/references/tools/change_element_types.md +65 -0
- package/skills/pi-revit/references/tools/create_tags.md +85 -0
- package/skills/pi-revit/references/tools/delete_elements.md +66 -0
- package/skills/pi-revit/references/tools/execute_csharp.md +81 -0
- package/skills/pi-revit/references/tools/export_documents.md +75 -0
- package/skills/pi-revit/references/tools/find_revit_tools.md +96 -0
- package/skills/pi-revit/references/tools/get_element_details.md +66 -0
- package/skills/pi-revit/references/tools/get_element_relationships.md +61 -0
- package/skills/pi-revit/references/tools/get_element_types.md +67 -0
- package/skills/pi-revit/references/tools/get_elements.md +87 -0
- package/skills/pi-revit/references/tools/get_linked_elements.md +79 -0
- package/skills/pi-revit/references/tools/get_linked_models.md +57 -0
- package/skills/pi-revit/references/tools/get_model_coordinates.md +64 -0
- package/skills/pi-revit/references/tools/get_model_health.md +53 -0
- package/skills/pi-revit/references/tools/get_model_overview.md +57 -0
- package/skills/pi-revit/references/tools/get_revit_operation.md +54 -0
- package/skills/pi-revit/references/tools/get_schedule_fields.md +62 -0
- package/skills/pi-revit/references/tools/get_schedules.md +71 -0
- package/skills/pi-revit/references/tools/manage_element_sets.md +92 -0
- package/skills/pi-revit/references/tools/manage_revit_instances.md +63 -0
- package/skills/pi-revit/references/tools/manage_revit_scripts.md +109 -0
- package/skills/pi-revit/references/tools/manage_schedules.md +90 -0
- package/skills/pi-revit/references/tools/manage_selection.md +66 -0
- package/skills/pi-revit/references/tools/manage_sheet_placements.md +82 -0
- package/skills/pi-revit/references/tools/manage_sheets.md +71 -0
- package/skills/pi-revit/references/tools/manage_views.md +95 -0
- package/skills/pi-revit/references/tools/measure_geometry.md +71 -0
- package/skills/pi-revit/references/tools/open_view.md +59 -0
- package/skills/pi-revit/references/tools/ping.md +41 -0
- package/skills/pi-revit/references/tools/query_spatial_elements.md +74 -0
- package/skills/pi-revit/references/tools/read_revit_result.md +53 -0
- package/skills/pi-revit/references/tools/search_api_docs.md +65 -0
- package/skills/pi-revit/references/tools/set_parameters.md +75 -0
- package/skills/pi-revit/references/tools/summarize_elements.md +64 -0
- package/skills/pi-revit/references/tools/transform_elements.md +79 -0
- package/skills/pi-revit/references/visual-verification.md +36 -0
- package/skills/pi-revit/tool-manifest.json +338 -0
- package/src/Revit/BridgeServer.cs +93 -87
- package/src/Revit/OperationStore.cs +178 -178
- package/src/Revit/ToolRegistry.cs +88 -57
- package/src/Revit/Tools/CaptureView.cs +10 -2
- package/src/Revit/Tools/ChangeElementTypes.cs +74 -60
- package/src/Revit/Tools/ChangeSet.cs +39 -0
- package/src/Revit/Tools/CreateTags.cs +107 -95
- package/src/Revit/Tools/DeleteElements.cs +53 -44
- package/src/Revit/Tools/DocumentGuard.cs +74 -64
- package/src/Revit/Tools/ElementNames.cs +103 -0
- package/src/Revit/Tools/ElementQueryScope.cs +27 -27
- package/src/Revit/Tools/ElementTraits.cs +53 -0
- package/src/Revit/Tools/ExecuteCsharp.cs +54 -45
- package/src/Revit/Tools/ExportDocuments.cs +129 -121
- package/src/Revit/Tools/GetElementDetails.cs +37 -41
- package/src/Revit/Tools/GetElementRelationships.cs +82 -76
- package/src/Revit/Tools/GetElementTypes.cs +8 -0
- package/src/Revit/Tools/GetElements.cs +75 -86
- package/src/Revit/Tools/GetLinkedElements.cs +89 -82
- package/src/Revit/Tools/GetLinkedModels.cs +73 -66
- package/src/Revit/Tools/GetModelCoordinates.cs +56 -49
- package/src/Revit/Tools/GetModelHealth.cs +7 -0
- package/src/Revit/Tools/GetModelOverview.cs +185 -158
- package/src/Revit/Tools/GetScheduleFields.cs +44 -37
- package/src/Revit/Tools/GetSchedules.cs +96 -89
- package/src/Revit/Tools/InheritedState.Summary.cs +57 -0
- package/src/Revit/Tools/InheritedState.cs +144 -0
- package/src/Revit/Tools/ManageElementSets.cs +114 -106
- package/src/Revit/Tools/ManageSchedules.cs +174 -164
- package/src/Revit/Tools/ManageSelection.cs +45 -37
- package/src/Revit/Tools/ManageSheetPlacements.cs +113 -97
- package/src/Revit/Tools/ManageSheets.cs +72 -63
- package/src/Revit/Tools/ManageViews.cs +115 -100
- package/src/Revit/Tools/MeasureGeometry.cs +60 -54
- package/src/Revit/Tools/ModelChanges.cs +154 -0
- package/src/Revit/Tools/ModelEditBatch.cs +105 -102
- package/src/Revit/Tools/ModelEditInputs.cs +49 -49
- package/src/Revit/Tools/OpenView.cs +9 -2
- package/src/Revit/Tools/ParameterResolver.cs +94 -0
- package/src/Revit/Tools/QuerySpatialElements.cs +70 -63
- package/src/Revit/Tools/SearchApiDocs.cs +72 -4
- package/src/Revit/Tools/SetParameters.cs +60 -79
- package/src/Revit/Tools/SpatialBounds.cs +30 -30
- package/src/Revit/Tools/SummarizeElements.cs +94 -87
- package/src/Revit/Tools/ToolContract.cs +48 -0
- package/src/Revit/Tools/ToolSupport.cs +5 -1
- package/src/Revit/Tools/TransformElements.cs +72 -57
- package/workspace/AGENTS.md +26 -20
package/bin/pi-revit.js
CHANGED
|
@@ -3,13 +3,13 @@ const { spawnSync } = require("node:child_process");
|
|
|
3
3
|
const fs = require("node:fs");
|
|
4
4
|
const path = require("node:path");
|
|
5
5
|
|
|
6
|
-
const root = path.resolve(__dirname, "..");
|
|
7
|
-
const scriptsDir = path.join(root, "scripts");
|
|
8
|
-
const packageVersion = require(path.join(root, "package.json")).version;
|
|
9
|
-
const packageSpec = `npm:pi-revit@${packageVersion}`;
|
|
6
|
+
const root = path.resolve(__dirname, "..");
|
|
7
|
+
const scriptsDir = path.join(root, "scripts");
|
|
8
|
+
const packageVersion = require(path.join(root, "package.json")).version;
|
|
9
|
+
const packageSpec = `npm:pi-revit@${packageVersion}`;
|
|
10
10
|
|
|
11
11
|
function usage() {
|
|
12
|
-
console.log(`pi-revit installer\n\nUsage:\n npx.cmd -y pi-revit\n\nWhat it does on Windows:\n 1. Runs: pi install ${packageSpec}\n 2. Builds and deploys the matching Revit bridge add-in\n 3. Creates the Documents\\pi-revit workspace and global pi-revit command\n\nClose Revit before running. Revit 2025, 2026, or 2027 and the matching .NET SDK are required.`);
|
|
12
|
+
console.log(`pi-revit installer\n\nUsage:\n npx.cmd -y pi-revit\n\nWhat it does on Windows:\n 1. Runs: pi install ${packageSpec}\n 2. Builds and deploys the matching Revit bridge add-in\n 3. Creates the Documents\\pi-revit workspace and global pi-revit command\n\nClose Revit before running. Revit 2025, 2026, or 2027 and the matching .NET SDK are required.`);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
function fail(message) {
|
|
@@ -37,10 +37,10 @@ function runCmd(title, commandLine) {
|
|
|
37
37
|
if (result.status !== 0) process.exit(result.status ?? 1);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
function runPowerShellScript(scriptName, args = []) {
|
|
40
|
+
function runPowerShellScript(scriptName, args = []) {
|
|
41
41
|
const scriptPath = path.join(scriptsDir, scriptName);
|
|
42
42
|
if (!fs.existsSync(scriptPath)) fail(`missing script: ${scriptPath}`);
|
|
43
|
-
run(scriptName, "powershell.exe", ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", scriptPath, ...args]);
|
|
43
|
+
run(scriptName, "powershell.exe", ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", scriptPath, ...args]);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
function revitIsRunning() {
|
|
@@ -74,7 +74,7 @@ if (!commandExists("pi")) {
|
|
|
74
74
|
fail("the 'pi' command was not found on PATH. Install Pi first: npm install -g --ignore-scripts @earendil-works/pi-coding-agent");
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
runPowerShellScript("deploy.ps1", ["-CheckOnly", "-OfferDownload"]);
|
|
77
|
+
runPowerShellScript("deploy.ps1", ["-CheckOnly", "-OfferDownload"]);
|
|
78
78
|
|
|
79
79
|
if (revitIsRunning()) {
|
|
80
80
|
waitForEnter();
|
|
@@ -84,7 +84,7 @@ if (revitIsRunning()) {
|
|
|
84
84
|
console.log("pi-revit full installer");
|
|
85
85
|
console.log("This installs the Pi package, deploys the Revit add-in, and creates the workspace/global command.");
|
|
86
86
|
|
|
87
|
-
runCmd("Install the matching Pi package from npm", `pi install ${packageSpec}`);
|
|
87
|
+
runCmd("Install the matching Pi package from npm", `pi install ${packageSpec}`);
|
|
88
88
|
runPowerShellScript("deploy.ps1");
|
|
89
89
|
runPowerShellScript("setup-workspace.ps1");
|
|
90
90
|
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# PI-Revit guidance and tool architecture
|
|
2
|
+
|
|
3
|
+
This document defines the implemented structure and how to extend it. It replaces
|
|
4
|
+
one long operational skill with focused resources and explicit discovery. The five
|
|
5
|
+
responsibilities below are PI-Revit's design, not a requirement imposed by Pi and
|
|
6
|
+
not a demonstrated performance improvement. Contributor instructions live in
|
|
7
|
+
[root AGENTS.md](../AGENTS.md); runtime task guidance starts at
|
|
8
|
+
[the PI-Revit skill](../skills/pi-revit/SKILL.md).
|
|
9
|
+
|
|
10
|
+
## Resource scope and resource type
|
|
11
|
+
|
|
12
|
+
**Global versus project** describes where instructions/resources are discovered
|
|
13
|
+
and apply. **Instructions, skills, tools, templates and packages** describe what
|
|
14
|
+
they do. These are separate axes: a globally installed skill is not automatically
|
|
15
|
+
an always-loaded global instruction file.
|
|
16
|
+
|
|
17
|
+
Pi's context files provide persistent instructions in their applicable scope.
|
|
18
|
+
Skills expose task descriptions for selection; reading their body and supporting
|
|
19
|
+
files is a separate action. Prompt templates are reusable requests. Extensions
|
|
20
|
+
are Pi's standard mechanism for adding model-callable tools and runtime behavior;
|
|
21
|
+
skills can invoke helper scripts through existing tools. Packages distribute these
|
|
22
|
+
resources and do not define a new instruction priority or workflow engine.
|
|
23
|
+
|
|
24
|
+
The implementation was checked against Pi 0.87.0. See its versioned
|
|
25
|
+
[skills documentation](https://github.com/earendil-works/pi/blob/v0.87.0/packages/coding-agent/docs/skills.md),
|
|
26
|
+
[extension documentation](https://github.com/earendil-works/pi/blob/v0.87.0/packages/coding-agent/docs/extensions.md),
|
|
27
|
+
[package documentation](https://github.com/earendil-works/pi/blob/v0.87.0/packages/coding-agent/docs/packages.md),
|
|
28
|
+
and [context-file documentation](https://github.com/earendil-works/pi/blob/v0.87.0/packages/coding-agent/README.md).
|
|
29
|
+
Recheck supported Pi behavior when upgrading. The model may omit a relevant skill
|
|
30
|
+
or reference; critical enforcement therefore stays in executable code.
|
|
31
|
+
|
|
32
|
+
## Platform layer and five responsibilities
|
|
33
|
+
|
|
34
|
+
Problems are fixed as classes, at the lowest layer where every present and future
|
|
35
|
+
resource inherits the fix. Each fix combines a mechanism in code or declared metadata,
|
|
36
|
+
a CI gate that makes a non-compliant addition fail, and an agent-evaluation scenario:
|
|
37
|
+
|
|
38
|
+
```text
|
|
39
|
+
L5 Gates (npm run test:docs) and agent evaluation (tests/agent-eval)
|
|
40
|
+
L4 Guidance: one router skill, protocols stated once, manuals with generated contracts
|
|
41
|
+
L3 Shared bridge primitives: ParameterResolver, ElementTraits, InheritedState, ElementNames,
|
|
42
|
+
ModelEditBatch, DocumentGuard; the dispatcher attaches model_changes to every write
|
|
43
|
+
L2 Resource contract v2: keywords, limits with alternatives, verification, effects
|
|
44
|
+
L1 Platform runtime in the Pi extension: acts on metadata, never on tool names
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
L1 therefore covers a tool that a future bridge advertises and this package has never
|
|
48
|
+
seen. A tool without declared metadata is treated conservatively: its limits are
|
|
49
|
+
"unknown", which leads to the API check rather than a refusal.
|
|
50
|
+
|
|
51
|
+
| Responsibility | Owner | Load/use when |
|
|
52
|
+
| --- | --- | --- |
|
|
53
|
+
| Cross-cutting protocols | The platform section injected by `platform-prompt.ts` through `before_agent_start`, always in context | Every request, whether or not the skill is read |
|
|
54
|
+
| Operating rules | Short `skills/pi-revit/SKILL.md`, shared execution/recovery/visual references | Task routing; model work; uncertainty; visible output respectively |
|
|
55
|
+
| Tool contracts | Runtime schemas and implementations, plus declared keywords, limits and verification; `references/tools/<name>.md` explains each, with a generated Contract block | A relevant tool is selected or explained |
|
|
56
|
+
| Revit knowledge | Future scoped subject skills and cited Autodesk Help references | A modeling concept or domain task needs explanation |
|
|
57
|
+
| Workflows | Room-documentation and model-audit/export references, indexed as guidance | Coordinating several operations into a requested outcome |
|
|
58
|
+
| API reference | `search_api_docs`, followed by inspection/compilation as appropriate | A custom script uses unfamiliar API members, or no dedicated tool covers a request |
|
|
59
|
+
|
|
60
|
+
The domain library is deliberately not filled with empty placeholders or copied
|
|
61
|
+
tool contracts. It can grow under `skills/revit-<subject>/` in this package, and
|
|
62
|
+
discovery finds any sibling skill automatically. A later `revit-skills` package is
|
|
63
|
+
optional when ownership/versioning warrant it, not required to make references work.
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
pi-revit/ repository and installable package
|
|
67
|
+
├── AGENTS.md source contributor instructions
|
|
68
|
+
├── docs/
|
|
69
|
+
│ ├── architecture.md structure, ownership and extension rules
|
|
70
|
+
│ ├── evaluation.md checks, evidence and remaining evaluation
|
|
71
|
+
│ └── invariants.json every normative rule and its enforcement
|
|
72
|
+
├── extensions/pi-revit/
|
|
73
|
+
│ ├── index.ts Pi registration, bridge calls, result handling
|
|
74
|
+
│ ├── platform-prompt.ts protocols stated once; shared-rule hoisting
|
|
75
|
+
│ ├── completion-monitor.ts metadata-driven completion check
|
|
76
|
+
│ ├── scope-monitor.ts per-request ledger; objects that predate the request
|
|
77
|
+
│ ├── contracts.ts native contracts; contract hash
|
|
78
|
+
│ ├── discovery.ts English-vocabulary search over all resources
|
|
79
|
+
│ ├── tool-catalog.ts discover/activate tools; limits; fallback route
|
|
80
|
+
│ ├── tool-documentation.ts allowlisted manual resolver; contract compatibility
|
|
81
|
+
│ ├── instance-router.ts target-session and operation routing
|
|
82
|
+
│ ├── tool-schema.ts public bridge input-schema composition
|
|
83
|
+
│ └── script-library.ts local reusable scripts
|
|
84
|
+
├── src/Revit/
|
|
85
|
+
│ ├── ToolRegistry.cs bridge inventory and metadata/schema projection
|
|
86
|
+
│ ├── BridgeServer.cs HTTP contract and dispatch
|
|
87
|
+
│ ├── CommandQueue.cs work on Revit's API thread
|
|
88
|
+
│ ├── OperationStore.cs operation receipts and deduplicated retry state
|
|
89
|
+
│ └── Tools/ implementations; ToolContract, ParameterResolver, ElementTraits,
|
|
90
|
+
│ InheritedState, ElementNames, ModelChanges
|
|
91
|
+
├── skills/pi-revit/
|
|
92
|
+
│ ├── SKILL.md short task entry; not an encyclopaedia
|
|
93
|
+
│ ├── tool-manifest.json documentation index: summaries, groups, guidance
|
|
94
|
+
│ ├── contracts.generated.json generated contract snapshot (offline discovery)
|
|
95
|
+
│ └── references/ shared rules, workflows, tool-index, tools/<name>.md
|
|
96
|
+
├── workspace/AGENTS.md runtime workspace template; output conventions
|
|
97
|
+
├── scripts/ install/build, generator and validation utilities
|
|
98
|
+
└── tests/ behavioral, documentation, discovery and agent-eval checks
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
The manifest describes 36 tools today: 30 bridge tools and six Pi utilities. That is
|
|
102
|
+
an inventory, not a limit. `package.json` loads `./skills` and the extension entry.
|
|
103
|
+
|
|
104
|
+
## Discovery, activation and reading
|
|
105
|
+
|
|
106
|
+
```mermaid
|
|
107
|
+
flowchart TD
|
|
108
|
+
R[User request, any language] --> P{Task path}
|
|
109
|
+
P -->|Explain or plan| D[Check capability: find_revit_tools, limits, API docs]
|
|
110
|
+
P -->|Inspect| I[Select intended session and inspect requested model scope]
|
|
111
|
+
P -->|Modify or deliver| M[Establish identity, inspect state, list requirements]
|
|
112
|
+
D --> F[Read selected files]
|
|
113
|
+
I --> T[Discover capability and activate if needed]
|
|
114
|
+
M --> T
|
|
115
|
+
T --> L{Dedicated tool covers it?}
|
|
116
|
+
L -->|Yes| S[Inspect active schema and read relevant manual]
|
|
117
|
+
L -->|No: follow declared alternative| A[search_api_docs, then execute_csharp in scope]
|
|
118
|
+
S --> E[Execute within requested scope]
|
|
119
|
+
A --> E
|
|
120
|
+
E --> V[Verify with declared method, then stop and report]
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
`find_revit_tools` has two scopes:
|
|
124
|
+
|
|
125
|
+
- **`available` (default):** six native utilities plus the selected bridge's last
|
|
126
|
+
discovered catalogue. If no catalogue is known, it attempts discovery. Query or
|
|
127
|
+
exact names activate the returned page by default; plain browsing does not.
|
|
128
|
+
Activation is additive and preserves other extensions' active tools.
|
|
129
|
+
- **`documentation`:** searches the packaged index and contract snapshot, enriched
|
|
130
|
+
with known live descriptors. It makes no bridge request and does not activate tools.
|
|
131
|
+
Explicit `activate: true` is rejected. An index entry does not imply executable support.
|
|
132
|
+
|
|
133
|
+
Search uses English tool vocabulary. There are no per-language rules: the platform
|
|
134
|
+
protocol tells the model to translate a request into English search words, reply in the
|
|
135
|
+
user's language, and read localized names from results. Matching normalizes case,
|
|
136
|
+
accents, plural and word forms, and ignores numbers, which are arguments. It scores the
|
|
137
|
+
name and keywords, the summary, declared limits and input names, and the live
|
|
138
|
+
description. All-word matches rank first, followed by strong partial matches. A
|
|
139
|
+
tool's declared limits are searchable, so a request just outside a tool finds that tool
|
|
140
|
+
together with its alternative. A zero or partial match returns the capability route (API
|
|
141
|
+
check, then custom execution) instead of an unexplained absence. Workflows, shared
|
|
142
|
+
references and every sibling skill are returned under `guidance`. Search quality is
|
|
143
|
+
gated by a corpus with a recall threshold.
|
|
144
|
+
|
|
145
|
+
Each result reports source, registration, selected-bridge advertisement, activation,
|
|
146
|
+
declared limits, verification method and a local documentation object.
|
|
147
|
+
`bridge_catalog_observed_at` dates the discovery snapshot. Neither `active` nor
|
|
148
|
+
`registered` is a health check. Use `ping` or instance management for connectivity;
|
|
149
|
+
`ping` also reports what is loaded: package, guidance revision, source revision and
|
|
150
|
+
per-tool contract agreement.
|
|
151
|
+
|
|
152
|
+
The resolver accepts known names from `tool-manifest.json`, constructs a local manual
|
|
153
|
+
path, verifies file accessibility and real-path containment, and reports missing
|
|
154
|
+
documentation nonfatally. It never trusts a bridge-provided filesystem path.
|
|
155
|
+
|
|
156
|
+
Compatibility is exact and per tool. The contract hash covers the input schema,
|
|
157
|
+
without descriptions, titles or examples, plus write/effects/document requirement:
|
|
158
|
+
|
|
159
|
+
- `contract_match`: the manual was generated from the selected bridge's exact contract.
|
|
160
|
+
- `contract_changed`: trust the active schema over the manual.
|
|
161
|
+
- `undocumented`: a newer bridge tool with no packaged manual.
|
|
162
|
+
- `unknown`: no live contract observed.
|
|
163
|
+
- `package_local`: a native utility.
|
|
164
|
+
|
|
165
|
+
Rewording guidance never flags a bridge. A changed type, requiredness, enum or effect always does.
|
|
166
|
+
|
|
167
|
+
Cross-cutting rules are stated once, in the platform section:
|
|
168
|
+
|
|
169
|
+
- capability resolution;
|
|
170
|
+
- scope and completion;
|
|
171
|
+
- evidence;
|
|
172
|
+
- identity;
|
|
173
|
+
- language;
|
|
174
|
+
- the manual location.
|
|
175
|
+
|
|
176
|
+
Bridge guidelines that repeat across tools are hoisted into that section generically,
|
|
177
|
+
by normalizing the tool name, so no per-tool copy returns even from older bridges. Per-tool
|
|
178
|
+
guidelines keep only tool-specific facts. Under Pi 0.87.0, snippets and guidelines
|
|
179
|
+
contribute for active tools. Specialist tools start inactive, and activation exposes
|
|
180
|
+
their schemas and guidance on subsequent model requests. No step automatically reads a
|
|
181
|
+
manual, and the skill may be skipped. That is why the protocols live in the always-present
|
|
182
|
+
section, and why critical enforcement stays in code.
|
|
183
|
+
|
|
184
|
+
Every call of a tool that can write or has model effects reports `model_changes`. The bridge
|
|
185
|
+
dispatcher records Revit's document-change events for the duration of the call and merges the net
|
|
186
|
+
added, modified and deleted objects into the result, with the visibility state of new views. Tools
|
|
187
|
+
need no code for it, and custom scripts are covered too. Objects made from an existing one also
|
|
188
|
+
report `inherited_state` through the shared `InheritedState` helper, and names and sheet numbers
|
|
189
|
+
go through `ElementNames`, which rejects a name already in use with the existing object's ID.
|
|
190
|
+
Architecture gates enforce all three for present and future tools.
|
|
191
|
+
|
|
192
|
+
The scope monitor reads those reports, never tool names. Per user request it keeps the objects
|
|
193
|
+
created in that request. When a call changes a pre-existing object whose name the request
|
|
194
|
+
mentions, or a creation hits a name collision, it appends a note that the object predates the
|
|
195
|
+
request, and the platform protocol requires asking the user or reporting it. It steers and never
|
|
196
|
+
blocks.
|
|
197
|
+
|
|
198
|
+
The completion monitor is metadata-driven. When an identical verification call repeats
|
|
199
|
+
after further model changes in one request, it appends a completion check, starting from
|
|
200
|
+
the third such check. The check asks the agent to verify the explicit requirements,
|
|
201
|
+
stop and report, and offer further improvements as suggestions. It steers and never
|
|
202
|
+
blocks, so legitimate multi-step work continues. A call's `model_changes`
|
|
203
|
+
decide whether it changed the model; declared write/effects are the fallback for older bridges.
|
|
204
|
+
|
|
205
|
+
## Contract ownership and enforcement
|
|
206
|
+
|
|
207
|
+
For a bridge tool, the final public input schema is composed in this order:
|
|
208
|
+
|
|
209
|
+
1. Tool class `ParametersSchema` supplies operation inputs.
|
|
210
|
+
2. `ToolRegistry.DescribeParameters` adds document identity and requiredness.
|
|
211
|
+
3. `publicBridgeSchema` adds extension `_operation_id` retry metadata.
|
|
212
|
+
|
|
213
|
+
Pi-native tools register their own TypeBox schemas, and their v2 metadata lives in
|
|
214
|
+
`contracts.ts`. Code owns every executable contract. `npm run generate:contracts`
|
|
215
|
+
snapshots it into `contracts.generated.json`, each manual's Contract block and the
|
|
216
|
+
tool index, and the gate fails when any of them is stale. Manuals explain these final
|
|
217
|
+
contracts, including action-dependent runtime checks that JSON Schema may not express.
|
|
218
|
+
The hand-written manifest holds only summaries, groups and guidance entries.
|
|
219
|
+
Current code/registered schemas govern accepted inputs; actual returned outcomes
|
|
220
|
+
govern claims about success. Documentation is not an enforcement boundary. Every
|
|
221
|
+
normative rule is registered in `docs/invariants.json` with its enforcement: code
|
|
222
|
+
with a named test, or, only for agent intent that code cannot observe, advisory with
|
|
223
|
+
the agent-eval scenario that measures it. Shared primitives own cross-cutting policy.
|
|
224
|
+
`ParameterResolver` never silently chooses among same-named parameters.
|
|
225
|
+
`ElementTraits` flags system-owned objects such as titleblock revision schedules.
|
|
226
|
+
Architecture gates stop a tool from reintroducing a private variant.
|
|
227
|
+
<!-- inv:manual-path-containment -->
|
|
228
|
+
|
|
229
|
+
Exact-document guards, supported transaction/preview behavior, original-session
|
|
230
|
+
receipt routing and tool-specific limits remain enforced by their existing code.
|
|
231
|
+
An explanation does not authorize a write; an audit does not authorize repair;
|
|
232
|
+
an edit does not imply file saving. Workflows inherit the user's scope, branch
|
|
233
|
+
accordingly, and use recovery/visual checks when relevant. No universal extra
|
|
234
|
+
confirmation step is introduced.
|
|
235
|
+
|
|
236
|
+
API search reads the selected Revit installation's available XML documentation
|
|
237
|
+
and supports enum reflection. It requires the bridge but no open document. It is
|
|
238
|
+
not a complete compile check or permission to run arbitrary scripts. General
|
|
239
|
+
Revit domain knowledge and current API signatures have different owners; storing
|
|
240
|
+
a copied API encyclopaedia in `SKILL.md` would duplicate and age those contracts.
|
|
241
|
+
|
|
242
|
+
## Content ownership and migration
|
|
243
|
+
|
|
244
|
+
The former long entry is redistributed as follows:
|
|
245
|
+
|
|
246
|
+
| Former material | Maintained home |
|
|
247
|
+
| --- | --- |
|
|
248
|
+
| Task routing and concise essential cautions | `SKILL.md` |
|
|
249
|
+
| Instance/document targeting, parameters, units, partial success | `execution-rules.md` and relevant tool manuals |
|
|
250
|
+
| Receipts, retries, timeout/bridge/no-document failures | `operation-recovery.md`, `get_revit_operation.md`, `ping.md` |
|
|
251
|
+
| Visual evidence and export verification | `visual-verification.md`, capture/export manuals |
|
|
252
|
+
| Per-tool inputs, outputs, limits and action differences | Matching tool manual |
|
|
253
|
+
| C# globals, transactions, results and reusable scripts | `execute_csharp.md`, `manage_revit_scripts.md`, `search_api_docs.md` |
|
|
254
|
+
| Room and audit sequences | Existing workflow references, now with explain/inspect/modify paths |
|
|
255
|
+
| Upgrade/deployment notes | README installation/upgrade section and CHANGELOG |
|
|
256
|
+
| Model output-folder conventions | `workspace/AGENTS.md` template |
|
|
257
|
+
|
|
258
|
+
The workspace template is copied only when absent; setup preserves a user's existing
|
|
259
|
+
file. When template guidance changes, describe the manual merge in upgrade notes.
|
|
260
|
+
Do not overwrite existing workspace conventions or place contributor rules there.
|
|
261
|
+
|
|
262
|
+
For new domain content, pick a useful subject/task boundary, cite the relevant
|
|
263
|
+
official Autodesk Help pages and version, and separate concepts from step-by-step
|
|
264
|
+
recipes. Give the entry skill a selective description and a short map to its
|
|
265
|
+
references. Keep tool inputs in their existing manuals. Validate routing on both
|
|
266
|
+
positive examples and nearby requests that should not load the subject skill.
|
|
267
|
+
|
|
268
|
+
New tools, changed contracts and documentation checks follow [AGENTS.md](../AGENTS.md).
|
|
269
|
+
Guidance revisions are tracked independently from release versions. This structure
|
|
270
|
+
is implemented on the branch; comparative agent effectiveness and latency remain
|
|
271
|
+
evaluation work described in [evaluation.md](evaluation.md).
|