@iseoane/agent-depot 0.4.1 → 0.5.1
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 +45 -0
- package/README.es.md +969 -0
- package/README.md +244 -23
- package/dist/src/app-flow.js +52 -51
- package/dist/src/app-recipe-removal.js +63 -0
- package/dist/src/cli.js +122 -11
- package/dist/src/executable-resolution.js +54 -0
- package/dist/src/git-source.js +150 -6
- package/dist/src/package-bundles.js +614 -0
- package/dist/src/package-cli.js +412 -0
- package/dist/src/package-content.js +158 -0
- package/dist/src/package-flow.js +645 -0
- package/dist/src/package-host-plans.js +243 -0
- package/dist/src/package-host-state.js +473 -0
- package/dist/src/package-model.js +33 -0
- package/dist/src/package-owned-skills.js +124 -0
- package/dist/src/package-state.js +404 -0
- package/dist/src/process-runner.js +9 -1
- package/dist/src/profile-cli.js +15 -9
- package/dist/src/profile-export.js +44 -9
- package/dist/src/profile-import.js +80 -17
- package/dist/src/profile.js +78 -3
- package/dist/src/skill-discovery.js +7 -2
- package/dist/src/skill-install.js +16 -0
- package/dist/src/sources.js +11 -0
- package/dist/src/tui/app-actions.js +1 -1
- package/dist/src/tui/app.js +10 -11
- package/dist/src/tui/catalog-browse.js +46 -13
- package/dist/src/tui/catalog-ownership.js +12 -0
- package/dist/src/tui/catalog-panel.js +16 -4
- package/dist/src/tui/catalog-state.js +62 -6
- package/dist/src/tui/catalog-tree.js +58 -12
- package/dist/src/tui/catalog-view.js +53 -7
- package/dist/src/tui/environment.js +8 -1
- package/dist/src/tui/installations-browse.js +20 -2
- package/dist/src/tui/installations-rows.js +2 -1
- package/dist/src/tui/installations-tree.js +14 -1
- package/dist/src/tui/installations-view.js +8 -2
- package/dist/src/tui/installations.js +12 -2
- package/dist/src/tui/manage-actions.js +2 -0
- package/dist/src/tui/manage-panel.js +5 -0
- package/dist/src/tui/package-actions.js +165 -0
- package/dist/src/tui/package-rows.js +91 -0
- package/dist/src/tui/profile-view.js +36 -14
- package/dist/src/tui/render.js +1 -1
- package/dist/src/tui/sources-mode.js +2 -0
- package/dist/src/tui/sources-recipes.js +116 -53
- package/dist/src/tui/sources-view.js +57 -19
- package/dist/src/tui/tree.js +3 -4
- package/dist/src/tui/updates-flow.js +4 -1
- package/dist/src/tui/updates-panel.js +2 -2
- package/dist/src/tui/updates.js +72 -4
- package/dist/src/tui/window.js +3 -4
- package/dist/src/user-global-skill-inventory.js +7 -2
- package/package.json +2 -1
- package/skills/agent-depot-apprecipe/SKILL.md +29 -5
|
@@ -3,6 +3,7 @@ import { randomUUID } from "node:crypto";
|
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { assertSkillNotAppOwned, loadAppOwnedSkillFilter } from "./app-owned-skills.js";
|
|
6
|
+
import { assertSkillNotPackageOwned, loadPackageOwnedSkillFilter, } from "./package-owned-skills.js";
|
|
6
7
|
import { pathsOverlap } from "./path-safety.js";
|
|
7
8
|
import { readExistingSkillTree } from "./skill-adoption.js";
|
|
8
9
|
import { parseSkillFrontmatter, skillTreeBaseline } from "./skill-discovery.js";
|
|
@@ -51,7 +52,9 @@ export async function scanUserGlobalSkillInventory(options = {}) {
|
|
|
51
52
|
const exposures = [];
|
|
52
53
|
const symlinks = [];
|
|
53
54
|
const isAppOwned = await loadAppOwnedSkillFilter({ ...options, homeDirectory });
|
|
54
|
-
const
|
|
55
|
+
const owned = await loadPackageOwnedSkillFilter({ ...options, homeDirectory });
|
|
56
|
+
const isPackageOwned = (name) => owned(name) !== undefined;
|
|
57
|
+
const state = { isAppOwned, isPackageOwned, managedPaths, managedCanonicalPaths, entries, skipped, exposures, symlinks };
|
|
55
58
|
for (const root of GLOBAL_SKILL_ROOTS) {
|
|
56
59
|
const rootPath = path.join(homeDirectory, ...root.relativePath);
|
|
57
60
|
await scanRoot(root, rootPath, homeDirectory, state);
|
|
@@ -108,7 +111,7 @@ async function listScannableRoot(root, rootPath, homeDirectory, skipped) {
|
|
|
108
111
|
}
|
|
109
112
|
async function scanRootEntry(root, name, candidatePath, homeDirectory, state) {
|
|
110
113
|
const { managedPaths, entries, skipped } = state;
|
|
111
|
-
if (!managedPaths.has(pathKey(candidatePath)) && state.isAppOwned(name))
|
|
114
|
+
if (!managedPaths.has(pathKey(candidatePath)) && (state.isAppOwned(name) || state.isPackageOwned(name)))
|
|
112
115
|
return;
|
|
113
116
|
if (isTransientName(name)) {
|
|
114
117
|
skipped.push({ name, path: candidatePath, root: root.kind, reason: "excluded-transient" });
|
|
@@ -293,6 +296,7 @@ export async function inspectUserGlobalSkillRemoval(candidatePath, options) {
|
|
|
293
296
|
const homeDirectory = path.resolve(options.homeDirectory);
|
|
294
297
|
const targetPath = validateExplicitGlobalPath(candidatePath, homeDirectory);
|
|
295
298
|
await assertSkillNotAppOwned(path.basename(candidatePath), options);
|
|
299
|
+
assertSkillNotPackageOwned(path.basename(candidatePath), await loadPackageOwnedSkillFilter({ ...options, homeDirectory }));
|
|
296
300
|
const fileSystem = options.fileSystem ?? nodeFileSystem;
|
|
297
301
|
await assertRealGlobalAncestors(homeDirectory, path.dirname(targetPath), fileSystem);
|
|
298
302
|
const managedPaths = managedProtectionPaths(homeDirectory, options.managedInstallations);
|
|
@@ -388,6 +392,7 @@ export async function inspectUserGlobalSymlinkRemoval(candidatePath, options) {
|
|
|
388
392
|
const homeDirectory = path.resolve(options.homeDirectory);
|
|
389
393
|
const linkPath = validateExplicitGlobalPath(candidatePath, homeDirectory);
|
|
390
394
|
await assertSkillNotAppOwned(path.basename(candidatePath), options);
|
|
395
|
+
assertSkillNotPackageOwned(path.basename(candidatePath), await loadPackageOwnedSkillFilter({ ...options, homeDirectory }));
|
|
391
396
|
const fileSystem = options.fileSystem ?? nodeFileSystem;
|
|
392
397
|
await assertRealGlobalAncestors(homeDirectory, path.dirname(linkPath), fileSystem);
|
|
393
398
|
const managedPath = managedProtectionPaths(homeDirectory, options.managedInstallations)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iseoane/agent-depot",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "A cross-platform catalog for reusable coding-agent skills.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "iseoane",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"!skills/**/test_*.py",
|
|
31
31
|
"!skills/**/testdata",
|
|
32
32
|
"README.md",
|
|
33
|
+
"README.es.md",
|
|
33
34
|
"LICENSE",
|
|
34
35
|
"CHANGELOG.md"
|
|
35
36
|
],
|
|
@@ -4,7 +4,7 @@ description: "Trigger: App recipe creation or repair. Research an App's actual i
|
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
6
|
author: "iseoane"
|
|
7
|
-
version: "1.
|
|
7
|
+
version: "1.2"
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
## Activation Contract
|
|
@@ -17,7 +17,8 @@ Use for creating or repairing user-global App recipes, not portable Skills.
|
|
|
17
17
|
- Write user-owned JSON in the environment-local `apps/` beside `sources.json`. Preserve existing files unless the user authorizes replacement. Keep Apps out of Sources and project manifests.
|
|
18
18
|
- Never approve a recipe on the user's behalf. Approval belongs to the user via `agent-depot app approve <name> --yes`; changed bytes need renewed approval. Validation is not approval.
|
|
19
19
|
- Use bare executable-plus-arguments arrays, without shells, shell syntax, credentials or environment assignments. Script-only routes (`curl | sh`, PowerShell scripts, `.cmd`) belong in `manual` text, never pipe-to-shell argv. Agent Depot displays manual text without executing it.
|
|
20
|
-
- Steps run from the user's home with stdin EOF and no timeout. Use non-interactive flags; terminal-dependent installers belong in manual steps.
|
|
20
|
+
- Steps run from the user's home with stdin EOF and no timeout. Verify non-interactive behavior against the installed installer's help/version, not just an upstream quickstart. Use supported non-interactive flags; terminal-dependent installers belong in manual steps.
|
|
21
|
+
- Preflight the chosen channel before writing lifecycle steps. Missing prerequisites must be declared, never silently installed, configured or trusted. Recipe approval does not authorize separate prerequisite installation.
|
|
21
22
|
|
|
22
23
|
## Decision Gates
|
|
23
24
|
|
|
@@ -30,15 +31,38 @@ Use for creating or repairing user-global App recipes, not portable Skills.
|
|
|
30
31
|
| brew / npm / pipx | Derive update and uninstall from that channel: upgrade/uninstall, global install/uninstall, or upgrade/uninstall respectively. |
|
|
31
32
|
| Go install / release binary | Use the documented update route and a manual binary-removal step. |
|
|
32
33
|
| App has its own uninstall | Prefer it after verifying scope and non-interactive flags; explain remaining channel cleanup. |
|
|
34
|
+
| Missing manager, runtime, PATH entry, repository/tap, permissions or hook dependency | Explain the blocker and preparation before approval. Use a complete manual route or ask whether the user wants an explicitly prerequisite-dependent recipe; never call it ready to install. |
|
|
35
|
+
| Installer needs several commands | Use schema-supported ordered steps only if present. Otherwise put the complete sequence in `manual` or obtain the user's explicit choice of the prerequisite-dependent route below; never invent dependency fields, concatenate commands in argv, or hide preparation in a fallback. |
|
|
36
|
+
|
|
37
|
+
## Installer Preflight
|
|
38
|
+
|
|
39
|
+
Check installation **and** update, uninstall, version/latest and each Host setup/teardown. Record evidence as satisfied, missing or unverified:
|
|
40
|
+
|
|
41
|
+
- **Executable and environment:** inspect all manager/runtime PATH matches, resolved paths and versions in the environment Agent Depot actually inherits. A shell alias/function is not a spawnable executable. A terminal's PATH change does not reach an already-running TUI; tell the user to relaunch it from the prepared environment. Prefer read-only checks; do not create shims or edit shell configuration merely to make validation pass.
|
|
42
|
+
- **Channel registration and trust:** inspect required taps, repositories, registries and plugin marketplaces, their identities and current package metadata. Verify whether this installer version auto-registers them or requires explicit preparation; do not assume historical behavior. Report missing registration before writing argv. Registration can clone repositories and execute package definitions: do not run it as a supposedly read-only probe or without user authorization.
|
|
43
|
+
- **Runtime/build and hook requirements:** verify documented engine ranges, compiler/toolchain minimums, architecture/libc support and utilities such as `git`, `curl`, `jq` or extraction tools. Check write access to the actual global prefix and required elevation; never assume sudo or request credentials in chat. Inspect prerequisites for Host plugins separately from the App binary.
|
|
44
|
+
- **Unattended behavior:** use installed manager `--help`/documented help and upstream installer source to establish confirmation defaults and supported flags. Verify explicit formula/cask or package disambiguation where necessary. Do not invent `--yes` flags or rely on stdin EOF to count as consent. Run dry-run/read-only probes only after checking they do not install, register, authenticate or rewrite configuration; never test a lifecycle command just to see whether it prompts.
|
|
45
|
+
- **Version and update signals:** verify a release-meaningful version (not an unchanged `dev`) and a latest signal for the chosen channel. A GitHub release can be ahead of a package-manager formula. Use channel metadata when available and disclose freshness limits; do not run `brew update` or another mutating refresh as a read-only latest probe.
|
|
46
|
+
- **Preserved state:** identify existing binary copies, data directories and Host wiring without reading private memory content. Explain migrations, backups and teardown scope outside executable argv where appropriate; never delete user data or remove a shared tap/marketplace implicitly.
|
|
47
|
+
|
|
48
|
+
### Homebrew checklist
|
|
49
|
+
|
|
50
|
+
Inspect `brew --version`, `brew help install`, `brew help upgrade`, `brew help uninstall`, `brew tap` and `brew list --versions`. Resolve `brew` from Agent Depot's PATH. Check the actual tap formula/cask and its release rather than trusting a possibly stale README. Homebrew auto-updates taps only for `install`, `outdated`, `upgrade`, `bundle`, `release` and `tap <name>`, never `info`, so `brew info --json=v2 <tap>/<formula>` reports the local clone's last refresh and lags a published release. When the tap mirrors a GitHub release, declare `latest` as `{"github": "owner/repo"}`; install and upgrade refresh the tap themselves. Use supported non-interactive flags for install/update and `--formula` or `--cask` when names conflict. Do not assume `brew install owner/tap/name` registers a missing tap automatically.
|
|
51
|
+
|
|
52
|
+
For example, Homebrew 7.0.8 encountered during recipe research required an explicit `brew tap gentleman-programming/tap`; its install help documented ask-by-default and `--yes`. This is version-specific evidence, not a universal flag or a claim about when the behavior changed. Recheck the user's installed version.
|
|
53
|
+
|
|
54
|
+
### Representing preparation
|
|
55
|
+
|
|
56
|
+
Read the current schema; do not assume it has dependency or multi-command fields. When a required tap is missing and a lifecycle step accepts only one argv, `install.manual` can describe both registration and installation. Alternatively, with the user's explicit choice, retain automated install as prerequisite-dependent and provide the preparation commands and blocked status clearly in the handoff. An `argv` plus `manual` step falls back **only on spawn failure**: it cannot perform preparation before argv and does not handle a non-zero exit. Keep manual text concise; put research and caveats in the handoff. Never approve either route on the user's behalf. Execute preparation only with separate user authorization; execute recipe commands only after user approval and an explicit execution request.
|
|
33
57
|
|
|
34
58
|
## Execution Steps
|
|
35
59
|
|
|
36
60
|
1. Record upstream evidence and platform support. Inspect all PATH matches (`which -a`/`whence -a`, or Windows `Get-Command -All`), resolved paths, and channel inventories such as `brew list`, `npm ls -g` or `pipx list`. List Windows shims seen from WSL separately: `/mnt/<drive>/` executables cannot serve a Linux recipe. Finish only when the actual channel is established or the user has chosen one.
|
|
37
|
-
2.
|
|
61
|
+
2. Complete the Installer Preflight and resolve the prerequisite decision gate before writing required `name`, `install`, `update`, `uninstall`, and `version`. Each lifecycle step uses `argv`, `manual`, or both; manual fallback applies only to spawn failure, never non-zero exit. `version` needs read-only argv and a JavaScript regex with exactly one capture group. Choose optional `latest` as `github: owner/repo`, `npm: package`, or read-only `argv` plus `pattern`; omit it when unknown. Consult [the illustrative example](assets/example.md), not as upstream command evidence.
|
|
38
62
|
3. Put user-global Host wiring in optional `setup`/`teardown` maps keyed by `pi`, `claude`, `codex`, or `opencode`. Keep install separate; uninstall never implicitly runs teardown. Delegate wiring to App commands or manual user instructions, not direct agent edits of Host configuration. Exclude project initialization.
|
|
39
63
|
4. Declare optional `skills` only for documented App-owned directory/link names. Match whole names case-sensitively; only `*` is special, while `?` and brackets are literal. Reject empty/whitespace-only, path separators, NUL and star-only patterns. These declarations filter unmanaged adoption/removal even before approval/install; they verify no artifacts or provenance.
|
|
40
|
-
5. Run `agent-depot app validate <file>...` for current-platform recipes. Fix structural errors; report unapproved recipes as needs approval, not runtime-verified. Version commands run only for approved applicable content. Mark other platforms unverified. After user approval, the user can inspect `app list` and separately preview `app install|update|uninstall <name>` or `app setup|teardown <name> --host <host>`.
|
|
64
|
+
5. Run `agent-depot app validate <file>...` for current-platform recipes. Fix structural errors; report unapproved recipes as needs approval, not runtime-verified. Distinguish structural validity, recipe approval, prerequisite readiness, installed version and Host wiring; none proves the others. A known missing prerequisite remains a blocker even when validation succeeds. Version commands run only for approved applicable content. Mark other platforms unverified. After user approval, the user can inspect `app list` and separately preview `app install|update|uninstall <name>` or `app setup|teardown <name> --host <host>`.
|
|
41
65
|
|
|
42
66
|
## Output Contract
|
|
43
67
|
|
|
44
|
-
Return file paths, platform/channel evidence, validation results and runtime-verification limits; unsupported platforms; omitted optional fields and why; license, telemetry/update-check behavior (or unknown); and conflicting duplicate install routes, including plugin-marketplace versus setup routes. Explain that version alone determines installed state, updates require a changed version, and unknown latest is not an available update. End with the user's approval command, without running it.
|
|
68
|
+
Return file paths, platform/channel evidence, a concise prerequisite status (satisfied/missing/unverified) with preparation commands and whether the recipe is ready or blocked, validation results and runtime-verification limits; unsupported platforms; omitted optional fields and why; license, telemetry/update-check behavior (or unknown); and conflicting duplicate install routes, including plugin-marketplace versus setup routes. Explain that version alone determines installed state, updates require a changed version, and unknown latest is not an available update. End with the user's approval command, without running it.
|