@foundocs/foundocs-setup 0.3.24 → 0.3.26
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 +11 -3
- package/dist/bridge.mjs +740 -261
- package/package.json +3 -3
- package/skills/foundocs/SKILL.md +18 -8
- package/skills/foundocs/references/documents.md +13 -3
- package/skills/foundocs/references/dreaming.md +15 -7
- package/skills/foundocs/references/effect-measurement.md +21 -1
- package/skills/foundocs/scripts/session-start.mjs +1 -1
- package/skills/foundocs-capture-knowledge/SKILL.md +9 -9
- package/skills/foundocs-capture-knowledge/references/writing-guide.md +6 -4
- package/src/bridge.mjs +76 -24
- package/src/cli.mjs +2 -2
- package/src/effect-automatic.mjs +184 -0
- package/src/effect-config.mjs +31 -0
- package/src/effect-storage.mjs +2 -0
- package/src/effect.mjs +12 -3
- package/src/runtime.mjs +23 -1
- package/src/setup.mjs +12 -4
- package/templates/knowledge-policy.md +2 -2
package/README.md
CHANGED
|
@@ -15,9 +15,9 @@ The install command reads stdin until EOF. Commands never take codes or API keys
|
|
|
15
15
|
|
|
16
16
|
Input JSON follows `SetupInstallInput` version 1: `client` (`claude` or `codex`), `projectId`, `workspaceId`, `attemptId`, `code`, `exchangeUrl`, `mcpUrl`, and `version: 1`. The code is exchanged once for an installation key; same-attempt reruns reuse that private key. A newly issued attempt can replace a revoked key while retaining the previous key privately. Existing keys are never automatically revoked.
|
|
17
17
|
|
|
18
|
-
Configuration is local to the exact `--root`: `foundocs.json`, a marked `AGENTS.md` block, and either `.codex/config.toml` or `.mcp.json`. Claude additionally receives a marked `CLAUDE.md` reference to `AGENTS.md`. The package also installs its English Foundocs skill at `.agents/skills/foundocs/` for Codex or `.claude/skills/foundocs/` for Claude, including the Dreaming protocol reference. The managed instruction block points to the selected client’s discoverable skill. Existing instructions and foreign MCP entries are preserved. Skill files are updated only when unchanged from the installer’s recorded version. Byte-identical packaged files in a new clone are adopted locally; other foreign or user-edited skills stop preflight, and rollback preserves later user edits. Run `update-skills` to add the bundled skills to an older installation without a new connection code. Manual
|
|
18
|
+
Configuration is local to the exact `--root`: `foundocs.json`, a marked `AGENTS.md` block, and either `.codex/config.toml` or `.mcp.json`. Claude additionally receives a marked `CLAUDE.md` reference to `AGENTS.md`. The package also installs its English Foundocs skill at `.agents/skills/foundocs/` for Codex or `.claude/skills/foundocs/` for Claude, including the Dreaming protocol reference. The managed instruction block points to the selected client’s discoverable skill. Existing instructions and foreign MCP entries are preserved. Skill files are updated only when unchanged from the installer’s recorded version. Byte-identical packaged files in a new clone are adopted locally; other foreign or user-edited skills stop preflight, and rollback preserves later user edits. Run `update-skills` to add the bundled skills to an older installation without a new connection code. Manual document archival/restoration uses the server-discovered `set_content_status` tool on explicit request; the bundled Foundocs skill documents versioned writes, archived lookup and the separate Dreaming approval path. Existing installations receive this guidance through `update-skills`; ordinary capture does not authorize archival. The bridge discovers tools dynamically, so server tool additions do not require a runtime upgrade. Dreaming itself requires the connected server to expose `dream_memory` and `get_dream`; installation does not enable unavailable server capabilities. Conflicting project IDs, malformed files, symlinks, or a different same-name `foundocs` server stop installation before exchanging the code. Resolve a conflict explicitly; this installer does not overwrite it.
|
|
19
19
|
|
|
20
|
-
Keys, backups and installation journals live in `~/.local/share/foundocs/setup`, outside the project. `FOUNDOCS_SETUP_HOME` may select another absolute private directory outside the target project, including isolated test fixtures. Keep using that same value for doctor/rollback. Credentials are isolated by workspace, project, and canonical project root. Both clients use the exact-version npm package’s `mcp` command through `npx` on PATH; their project settings contain no user-specific path. Older copied helpers remain in private storage for compatibility and rollback, but portable MCP does not depend on them. Its stdio adapter forwards MCP tool discovery and calls to the same Remote HTTP endpoint with the saved Bearer key. This adapter preserves remote
|
|
20
|
+
Keys, backups and installation journals live in `~/.local/share/foundocs/setup`, outside the project. `FOUNDOCS_SETUP_HOME` may select another absolute private directory outside the target project, including isolated test fixtures. Keep using that same value for doctor/rollback. Credentials are isolated by workspace, project, and canonical project root. Both clients use the exact-version npm package’s `mcp` command through `npx` on PATH; their project settings contain no user-specific path. Older copied helpers remain in private storage for compatibility and rollback, but portable MCP does not depend on them. Its stdio adapter forwards MCP tool discovery and calls to the same Remote HTTP endpoint with the saved Bearer key. This adapter preserves remote structured results and errors, augments supported measurement schemas/annotations with local task metadata, and requires an explicit valid project ID on every call. A changed valid project ID is forwarded unchanged; the remote server enforces workspace access. It adds no remote service. macOS/Linux use user-only directories/files (0700/0600). Windows uses PowerShell to apply and verify a protected current-user-only ACL; unsupported ACL filesystems stop before code exchange.
|
|
21
21
|
|
|
22
22
|
The helper prefers the saved installation credential. To explicitly use a process-provided `FOUNDOCS_API_KEY`, also provide matching `FOUNDOCS_PROJECT_ID` and `FOUNDOCS_WORKSPACE_ID`. An unrelated shell key never silently overrides the saved workspace key. The legacy HTTP helper’s stdout contains authentication headers solely for the host MCP client; do not invoke it through tools that log stdout. The shared portable runtime writes only MCP messages to stdout.
|
|
23
23
|
|
|
@@ -115,7 +115,7 @@ Dreaming adversarial fixtures and trace checks live in `eval/`; see `eval/README
|
|
|
115
115
|
|
|
116
116
|
## Knowledge folders (0.3.8)
|
|
117
117
|
|
|
118
|
-
The bundled capture skill reuses existing topic folders beneath the fixed `knowledge/rules/`, `knowledge/learnings/` and `knowledge/decisions/` roots. Nested topic folders and files directly under a root are both valid. Related facts stay together rather than becoming fragments or duplicate shallow folders. Verified, reusable lessons from correcting the agent’s own mistakes are captured in the same turn; typo-only and unverified fixes are excluded.
|
|
118
|
+
The bridge opts into the unified tree on tools that advertise it, including updates and Dreaming. Canonical-default servers work without a flag. The same tree is visible under `shared/docs/` for workspace Shared content. The destination folder supplies 결정, 배움 or 규칙; write authored tags from `userTags` and use `move_docs` for an authorized project directory move. The bundled capture skill reuses existing topic folders beneath the fixed `docs/knowledge/rules/`, `docs/knowledge/learnings/` and `docs/knowledge/decisions/` roots. Nested topic folders and files directly under a root are both valid. Related facts stay together rather than becoming fragments or duplicate shallow folders. Verified, reusable lessons from correcting the agent’s own mistakes are captured in the same turn; typo-only and unverified fixes are excluded.
|
|
119
119
|
|
|
120
120
|
Dreaming inspects dispersed knowledge and similar folders within its existing six stages. Consolidation compares concrete topic groups, destination folders and retrieval benefits, including files still directly under a category root. Clear filenames alone do not justify skipping that assessment; justified moves are submitted, while a zero-move result records why the candidate groups should stay in place. The review avoids fragmentation and cosmetic churn rather than requiring a move quota.
|
|
121
121
|
|
|
@@ -147,6 +147,8 @@ The bundled `check-update.mjs` remains a read-only manual version checker, with
|
|
|
147
147
|
|
|
148
148
|
## Archival and Dreaming
|
|
149
149
|
|
|
150
|
+
The installed MCP bridge includes workspace global documents and knowledge by default in supported project context, search, explorer and exact-item reads. It preserves explicit scope and uses the live server's tool inventory to detect support. The bundled [global content workflow](skills/foundocs/references/documents.md#global-documents-and-knowledge) explains designation, synchronization, visibility, and approval.
|
|
151
|
+
|
|
150
152
|
The bundled Foundocs skill uses live tool discovery for `set_content_status` (atomic 1–100 document/knowledge archive or restore), `get_archive_candidates` (run-scoped review evidence) and `approve_archive_proposal` (one archive-only proposal explicitly approved by the human in chat). Existing `set_knowledge_status` remains compatible on servers with only single-knowledge archival. The stdio bridge forwards server tool schemas and responses dynamically; no hardcoded tool list or runtime upgrade is needed just to expose these tools.
|
|
151
153
|
|
|
152
154
|
Manual identified targets execute on explicit request. Dreaming never archives automatically: the 168-hour/four-negative-evaluation threshold selects review candidates, current bodies and beneficial uses must also be assessed, and only specific current human approval applies a proposal. Content-grounded low future reuse value is also a reason to propose archiving unnecessary knowledge, even if it is factually correct and has no retrieval history; rare but useful rules, decision context and recovery lessons remain protected. Documents gain archive proposals only. See the [Dreaming protocol](skills/foundocs/references/dreaming.md) and [evaluation cases](eval/README.md). Test new installs and skill updates in isolated fixtures; do not overwrite a developer's edited installed skills.
|
|
@@ -290,3 +292,9 @@ CODEX_HOME, with workspace-write and on-request approvals. It never alters the
|
|
|
290
292
|
real user configuration. Claude uses project/local settings and a scoped tool
|
|
291
293
|
allowlist, with no permission bypass. `eval/episode-api-check.mjs` separately
|
|
292
294
|
checks scripted API scenarios; those are not reported as host model evidence.
|
|
295
|
+
|
|
296
|
+
### Automatic effect measurement
|
|
297
|
+
|
|
298
|
+
After explicit consent, `measure configure --root /absolute/project` accepts stdin JSON with `enabled: true`, `consentVersion: 1`, `shareProjectDataWithWorkingModel: true`, `additionalModelUsage: true`, a relative `allowlist`, and `excludePaths`. New installations may include this object as `effectMeasurement`; existing installations do not need a new key. Use `measure status` with `{}` to diagnose readiness. Disable with `{"enabled":false}`. These commands never weaken host security or enable project policy.
|
|
299
|
+
|
|
300
|
+
On a server advertising measurement diagnostics, the local MCP runtime augments information read schemas with `effectTask` and evaluation with `effectTaskId`/`effectTaskComplete`. The first read supplies the pre-exposure brief and trusted current host identity; subsequent reads reuse the task ID. The installer prepares and attaches tracking before exposure, accumulates every retrieval, and runs once after the final successful evaluation. Ordinary reads continue on skip/failure. Reconnect recovery flushes normalized reports only, never repeats inference. Insights shows bounded status/reason metadata without prompts or source paths. Hosts that cannot run the installed process/network/model retain ordinary MCP and report the restriction.
|