agent-policy-kit 0.0.0-stage → 0.2.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/AGENT_INSTALL.md +79 -0
- package/CHANGELOG.md +101 -0
- package/LICENSE +21 -0
- package/README.md +69 -2
- package/bin/agent-policy.mjs +157 -0
- package/docs/architecture.md +17 -0
- package/docs/compatibility.md +23 -0
- package/docs/configuration-page.md +44 -0
- package/docs/deployment.md +31 -0
- package/docs/design/2026-11-01-grok-build-support.md +30 -0
- package/docs/development.md +21 -0
- package/docs/installation.md +23 -0
- package/docs/model-catalog.md +102 -0
- package/docs/model-updates.md +22 -0
- package/docs/npm-release.md +27 -0
- package/docs/policy.md +16 -0
- package/docs/privacy.md +9 -0
- package/docs/recovery.md +13 -0
- package/docs/releases.md +40 -0
- package/docs/use-cases.md +25 -0
- package/docs/verification.md +45 -0
- package/examples/kimi-pool.toml +17 -0
- package/models/README.md +7 -0
- package/models/catalog.json +743 -0
- package/package.json +63 -4
- package/policies/balanced.json +119 -0
- package/policies/fast.json +81 -0
- package/policies/quality.json +111 -0
- package/schema/policy.schema.json +459 -0
- package/site/index.html +1049 -0
- package/src/detect.mjs +137 -0
- package/src/explicit.mjs +89 -0
- package/src/inspect.mjs +203 -0
- package/src/install.mjs +582 -0
- package/src/native.mjs +64 -0
- package/src/output.mjs +108 -0
- package/src/policy.mjs +45 -0
- package/src/release.mjs +19 -0
- package/src/roles.mjs +13 -0
- package/src/setup.mjs +66 -0
- package/src/share.mjs +172 -0
- package/src/toml.mjs +96 -0
package/AGENT_INSTALL.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Agent Policy Kit — AI operator guide
|
|
2
|
+
|
|
3
|
+
APK is configuration-only. Native files remain independent after npm package/source removal. There is no hook, proxy, launcher, plugin, daemon, runtime audit or background updater. Subagent preferences apply only if the main agent chooses to delegate; preserve ordinary direct work and disabled delegation features.
|
|
4
|
+
|
|
5
|
+
Perform authorized technical setup/removal yourself; do not hand the owner a shell checklist. Use JSON plans/results, preserve main models, credentials, permissions, unrelated settings and later edits. Never log in, collect credentials, accept terms, start model tasks, publish, weaken sandboxes or bypass trust to force installation success. Private backups can contain existing secrets; keep state private.
|
|
6
|
+
|
|
7
|
+
Captured output stays JSON. Use --json explicitly when a terminal is attached. Interactive users receive a readable summary. Run show to inspect existing user-level native subagent settings without APK receipts or client executables. Show reads current supported fields, including manual edits, but does not resolve project, managed or session precedence. An incomplete read exits with code 3 while retaining independent client results. Doctor remains the owned-configuration integrity check.
|
|
8
|
+
|
|
9
|
+
## 1. Select the requested release
|
|
10
|
+
|
|
11
|
+
Package version is configuration-release version. Read that version's CHANGELOG.md or release output for what changed, why and migration limits. Check the installed tool versions, actual provisioned model aliases and current official model/effort documentation before applying. Preserve explicit user choices; a newer package/model is not an instruction to switch silently. See [model maintenance](docs/model-updates.md) and the dated [model catalog/presets](docs/model-catalog.md).
|
|
12
|
+
|
|
13
|
+
After publication, pinned invocation is supported:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
npx --yes --ignore-scripts --package agent-policy-kit@0.2.0 agent-policy release
|
|
17
|
+
npx --yes --ignore-scripts --package agent-policy-kit@0.2.0 agent-policy setup --release
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Before publication, replace the registry spec with the verified local .tgz. For several commands, install to a temporary or user-owned prefix with npm install --prefix PREFIX TARBALL --ignore-scripts --no-audit --no-fund, then invoke PREFIX/node_modules/.bin/agent-policy. No stable runtime prefix, sudo or shell-profile changes are needed.
|
|
21
|
+
|
|
22
|
+
## 2. Choose the input
|
|
23
|
+
|
|
24
|
+
The page always prints explicit arguments, including when a preset filled the form:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
agent-policy setup \
|
|
28
|
+
--roles reviewer,explorer \
|
|
29
|
+
--max-concurrent 3 \
|
|
30
|
+
--codex 'reviewer=gpt-6.1-sol:high,explorer=gpt-6-luna:high' \
|
|
31
|
+
--avoid-codex 'gpt-6-astra' \
|
|
32
|
+
--claude 'reviewer=sonnet:high,explorer=haiku:high' \
|
|
33
|
+
--avoid-claude 'opus,fable' \
|
|
34
|
+
--apply
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Use --codex, --claude, --kimi, --antigravity and/or --grok to select tools. Each tool must list every selected role exactly once. --roles and --max-concurrent are required in this mode. :native means effort null. Antigravity accepts role=tier and Grok Build accepts role=model, both without an effort. Split the model/effort pair at its last colon. Keep the visible shell quotes and line continuations. The optional --avoid-TOOL lists preserve routing guidance. An omitted list is empty.
|
|
38
|
+
|
|
39
|
+
Optional --codex-max-concurrent, --claude-max-concurrent, --kimi-max-concurrent, --antigravity-max-concurrent and --grok-max-concurrent override --max-concurrent for their selected tool. They accept whole numbers from 1 to 32 and require the corresponding tool argument. JSON preferences can instead set clients[tool].maxConcurrent. Omitted overrides use the top-level fallback.
|
|
40
|
+
|
|
41
|
+
Explicit arguments are setup/install-only and cannot combine with --client, --release, --preset, --policy or --config. Duplicate flags and incomplete role maps fail before writes. Omit --apply to plan first. Explicit commands allow deliberate owned replacement and record custom source with no named preset provenance. The native files do not retain a dependency on the codec or package.
|
|
42
|
+
|
|
43
|
+
Other supported inputs remain available:
|
|
44
|
+
|
|
45
|
+
- setup --release --preset balanced explicitly applies this executable's named preset and templates (fast/quality are alternatives). It is the supported pinned-release upgrade/downgrade path.
|
|
46
|
+
- setup --config BASE64URL explicitly applies custom choices through this version's templates. This legacy encoded input remains supported. Decode/inspect the JSON; it must contain preferences only, never credentials or executable content.
|
|
47
|
+
- init --policy FILE creates editable defaults without overwriting. setup --policy FILE is a conservative advanced workflow; ordinary mismatching setup refuses replacement. To deliberately replace saved choices from a file, validate it, encode its JSON with Buffer.from(JSON.stringify(preferences)).toString('base64url'), and use --config.
|
|
48
|
+
|
|
49
|
+
Explicit arguments, --release/--preset, --config and --policy are alternative input modes. The --config JSON is canonical unpadded base64url, at most 64 KiB decoded. APK validates it before target mutation and removes its temporary input file afterward.
|
|
50
|
+
|
|
51
|
+
Optional top-level selectedRoles selects worker, reviewer, explorer, tester, writer and/or routine. It must be nonempty and contain no duplicates. Omit it to configure all six roles in that release. Optional client roles overrides the selected roles' code/light recommendations. A selected subset creates only those native files and routing instructions. Unselected aliases do not require provisioning or receive effort pins. The first selected role in catalog order supplies the native subagent default.
|
|
52
|
+
|
|
53
|
+
Use model-supported native effort levels. null means no explicit pin. A known catalog model rejects unsupported explicit effort. Keep at most one non-null pin per selected Kimi alias. Preset identity and custom source are reported separately. Tools omitted from clients are not selected.
|
|
54
|
+
|
|
55
|
+
Run detect and inspect the setup plan. Working executable identity is required; stale directories are not presence. Automatic targets use standard native roots. Nondefault CODEX_HOME/CLAUDE_CONFIG_DIR/KIMI_CODE_HOME/GROK_HOME returns a per-client zero-write prerequisite rather than configuring a dormant folder. Explicit --home selects the standard layout under that intended base; preserve exact --home/--state-dir for later inspection/removal. It does not remap arbitrary native roots.
|
|
56
|
+
|
|
57
|
+
## 3. Apply the concrete reviewed plan
|
|
58
|
+
|
|
59
|
+
Already-authorized configuration needs no repeat confirmation. Add --apply to the same selected-release or custom-config command. APK updates existing owned files transactionally without an uninstall gap. It verifies old ownership, virtually restores the original user baseline, then commits the target files/receipt/requested snapshot. Drift or a native prerequisite leaves the existing release intact; a late failure rolls it back. Preserve unrelated edits.
|
|
60
|
+
|
|
61
|
+
Run doctor afterward. It reports each client's actual saved release/source independently of the current executable, bundle, external source or canonical preferences. A verified config is not model execution proof. Native clients may need a fresh session to load changes; do not terminate active user sessions automatically.
|
|
62
|
+
|
|
63
|
+
Per-client transactions are independent. A missing/blocked client can retain an older applied release while another advances. Read all results; never label a partial outcome fully updated. stateDir/policy.json is the latest requested snapshot, not the applied truth. Receipts are the applied truth. Canonical preferences may therefore differ from an older client's snapshot. Ordinary saved-file setup still detects unsafe mismatch. Explicit tool arguments and --release/--config are deliberate replacement operations.
|
|
64
|
+
|
|
65
|
+
Kimi needs provisioned aliases/provider metadata and supported effort; do not invent them. K3.1 Pro variants require thinking: explicit native thinking.enabled=false returns a prerequisite even if every requested effort is null. Do not change the main thinking setting to force helper installation. If a selected alias also serves the main model, a changed effort default without a valid explicit global override returns kimi-main-effort-conflict. Use a compatible separate native alias or deliberately prepare a native variant while preserving main behavior. Reserved primary cannot be a pool key. Claude force-model conflicts require an explicit native setting decision rather than a false per-role success.
|
|
66
|
+
|
|
67
|
+
The available role names are apk-worker/apk-reviewer/apk-explorer/apk-tester/apk-writer/apk-routine. APK creates only the selected names. Changing the selected role set through explicit arguments or --config safely replaces the earlier owned role set. APK preserves unowned files and refuses removal of edited owned roles. Only when delegation is chosen do model/effort/routing/parallelism preferences apply. Native files must not execute/import the package or depend on its executable/npm/source/state path. After verification you may remove the npm package. Keep private receipts for future owned undo.
|
|
68
|
+
|
|
69
|
+
## 4. Native limits
|
|
70
|
+
|
|
71
|
+
Codex/Claude have native defaults/caps with higher-priority setting and execution-path exceptions. Kimi role-to-pool selection and concurrency are guidance. Antigravity uses native Pro/Flash/Flash Lite/inherit tiers, with no documented per-role effort or universal hard cap. Grok Build writes agents/apk-ROLE.md, per-role models and a general-purpose fallback in config.toml [subagents.models], and a native [subagents] max_concurrent cap; it has no per-role effort, so subagents use the main session effort. avoidModels is guidance. A pinned configuration does not prove provider identity, entitlement, task quality or unchanged alias resolution. Never add a runtime gate to strengthen a missing native feature.
|
|
72
|
+
|
|
73
|
+
## 5. Removal and incompatible formats
|
|
74
|
+
|
|
75
|
+
Run uninstall, review it, then uninstall --apply. Receipts verify ownership without canonical/source preferences or the native executable. Final removal restores original user settings, including after supported release changes, and keeps unrelated later edits. Do not restore stale whole-file backups or force-delete locks/pending journals.
|
|
76
|
+
|
|
77
|
+
Current native receipt v4 records selectedRoles and their bounded fixed filenames. It verifies that the owned file set matches the role selection. Historical v3 and v2 native receipts remain inspectable and removable. v2 has unknown release provenance. Older executables can reject v4. Use an executable that supports the receipt before an incompatible downgrade. Unknown formats/layouts fail safely and require a documented compatible migration. Experimental runtime v1 receipts need their original owned uninstall first. Never delete arbitrary hooks by matching text.
|
|
78
|
+
|
|
79
|
+
Return concise per-client detected/configured/applied-release/source results, prerequisites, new-session needs and unchecked model/provider evidence. No public release, deployment or live model task is part of configuration acceptance.
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Each npm version is one configuration release: its presets, native role definitions, instructions and configuration page. Published versions are not rewritten. Applying another release is explicit; package installation alone changes no settings.
|
|
4
|
+
|
|
5
|
+
## 0.2.0 — 2026-11-01
|
|
6
|
+
|
|
7
|
+
### Why this release
|
|
8
|
+
|
|
9
|
+
Subagents draw on the same plan limits as the main session, and every parallel session adds to that usage. Without explicit choices, subagents can inherit the most expensive model and use up a weekly limit within days. This release names the work modes by how much of a plan subagents may use, adds per-tool parallel limits, a read-only settings check and Grok Build support.
|
|
10
|
+
|
|
11
|
+
### Who should update
|
|
12
|
+
|
|
13
|
+
Anyone who wants Grok Build roles, per-tool parallel limits or the renamed modes. Re-running setup with 0.2.0 applies the new preset values: Top-tier now uses Opus 5.5, GPT-6.1 Sol and K3 at high effort, with top models behind an opt-in switch, and Kimi's Standard Docs writer uses K3 256K. Installations of 0.1.0 keep working unchanged until setup is run again.
|
|
14
|
+
|
|
15
|
+
### Migration and rollback
|
|
16
|
+
|
|
17
|
+
Preset ids (`fast`, `balanced`, `quality`), receipt format v4 and ownership, drift and rollback behavior are unchanged. Version 1 share links still open; new links use version 2 and carry each tool's parallel limit. Applying 0.1.0 again restores its owned settings, as the synthetic upgrade/downgrade gate verifies. Grok Build is new, so it has nothing to migrate.
|
|
18
|
+
|
|
19
|
+
### Presets and model catalog
|
|
20
|
+
|
|
21
|
+
The model catalog snapshot is dated 2026-10-30; Grok Build entries were checked on 2026-11-01 against the Grok Build 1.0.70 user guide and the xAI model list. An independent audit compared every preset, tool and role with the catalog and the documentation tables, and a test now keeps those tables in sync. Configuration checks are not model-quality evaluations.
|
|
22
|
+
|
|
23
|
+
### What changed
|
|
24
|
+
|
|
25
|
+
- Add Grok Build as a fifth coding tool, listed after Antigravity. APK writes `agents/apk-<role>.md` role files (Reviewer and Code explorer use the read-only `permission_mode: plan`), per-role models and a `general-purpose` fallback copied from the first selected role (the Coder when selected) in `config.toml` `[subagents.models]`, a native `[subagents] max_concurrent` cap and a delegation block in `AGENTS.md` under `$GROK_HOME` (default `~/.grok`). Per-role effort is not configurable, so every Grok choice has effort null and the page shows no effort controls. Presets use Grok Build 0.1, xAI's fast coding model, for light work and Grok 4.7 for stronger roles; Grok 4.6 and 4.5 stay available in Custom. Explicit commands use `--grok`, `--grok-max-concurrent` and `--avoid-grok`. Removal restores the original settings and refuses on local edits.
|
|
26
|
+
|
|
27
|
+
- Rename work modes to Light, Standard and Top-tier and describe them by how much of a plan's limits subagents use. Preset ids and share-link ids are unchanged. Top-tier now uses Opus 5.5, GPT-6.1 Sol and K3 at high effort for code, review and tests. A per-tool switch under Top-tier opts those roles into Fable 5.1, GPT-6 Astra or K3.1 Pro; it is off by default. Top models no longer run at xhigh/max, because native default subagent settings copy the first selected role (the Coder when selected) to subagents started without a named role.
|
|
28
|
+
|
|
29
|
+
- Explain each configuration step with a short ? note, and stop repeating vendor billing or version documentation in the work-mode notice.
|
|
30
|
+
|
|
31
|
+
- Start a fresh or reset form with every subagent role selected, and give the empty coding-tool field the same appearance as the empty role field.
|
|
32
|
+
|
|
33
|
+
- Automatically deploy the latest website from verified main while preserving exact tagged release pages and older share links. Configuration guards keep commands pinned to published package capabilities; npm releases remain explicit.
|
|
34
|
+
|
|
35
|
+
- Credit Mykola Maksymenko in the configuration page and package metadata. Link the supplied LinkedIn profile and related projects, with static author/project structured data and a release-specific canonical URL.
|
|
36
|
+
|
|
37
|
+
- Interactive terminals get readable setup, doctor, release and show output; captured output keeps the existing JSON contract, and `--json` forces JSON.
|
|
38
|
+
|
|
39
|
+
- `agent-policy show` reads the current user-level subagent settings of every tool, before or after APK installation, without writing files. The page footer offers it as "Check current settings" with a copy button.
|
|
40
|
+
|
|
41
|
+
- Each tool has its own parallel limit from 1 to 32, set in its details on the page or with `--TOOL-max-concurrent`; policies accept `clients[tool].maxConcurrent`.
|
|
42
|
+
|
|
43
|
+
- The page adds Add all for roles and tools, a GitHub link in the header, Reset form beside the release line, and preset switching for a single selected tool without a needless confirmation.
|
|
44
|
+
|
|
45
|
+
## 0.1.0 — 2026-10-30
|
|
46
|
+
|
|
47
|
+
### Why this release
|
|
48
|
+
|
|
49
|
+
Use a common approach to optional delegation across Codex, Claude Code, Kimi and Antigravity, without an extra process in normal agent operation. Configure once and remove the installer afterward.
|
|
50
|
+
|
|
51
|
+
### What it configures
|
|
52
|
+
|
|
53
|
+
Six focused roles cover implementation, read-only review, code discovery, test creation, documentation and prescribed execution. Each preset assigns a model and supported effort to every role; the [preset matrix](docs/model-catalog.md#how-the-presets-are-designed) explains the choices.
|
|
54
|
+
|
|
55
|
+
These are starting preferences, not model-quality benchmarks. Native model formats and alias behavior were reviewed against the official sources linked in [support](docs/compatibility.md) and [model maintenance](docs/model-updates.md). Model availability must be checked before applying. Provider aliases and tiers may resolve differently over time.
|
|
56
|
+
|
|
57
|
+
### Presets and model catalog
|
|
58
|
+
|
|
59
|
+
All three presets were rebuilt for public use. Personal Astra/Opus/Fable and other avoid lists were removed. Fast gives review and testing more reasoning than simple execution. Balanced separates implementation, verification, discovery, documentation and mechanics. Quality uses Astra/Fable for demanding work and regular K3.1 Pro at max for Kimi code/review/tests. Claude recommendations pin current versioned IDs; Kimi Balanced uses the quota-conscious K3 256K variant. These are editable recommendations, not benchmark results.
|
|
60
|
+
|
|
61
|
+
The release contains a dated model/effort catalog from official documentation and native selector observations, including native-default effort and account-dependent availability. Antigravity role choices are native tiers, with no invented per-role effort setting.
|
|
62
|
+
|
|
63
|
+
Catalog audit, 2026-10-30 UTC: Kimi now lists all six current models, including K3.1 Pro and Pro Highspeed. Quality first now uses regular K3.1 Pro at max effort for implementation/review/tests; other roles have separate choices described in the preset matrix. Highspeed remains optional because its faster output consumes about twice regular Pro's quota, according to Kimi. Setup requires provisioned access and does not silently fall back to another model.
|
|
64
|
+
|
|
65
|
+
Both Pro variants require compatible thinking settings. Even with unpinned effort, setup refuses an explicit thinking-disabled setting without modifying it.
|
|
66
|
+
|
|
67
|
+
Codex effort choices/defaults now follow CLI 0.166.0 rather than API defaults; API metadata remains separate, and Ultra stays separate from ordinary effort. Claude Opus 4.5 no longer advertises an API-only native effort override. Existing custom inputs using levels outside the current native catalog require review before reapplication; owned inspection/removal remains independent of current recommendations. Sonnet 4.5 remains selectable with its Anthropic deprecation status marked. Antigravity CLI's four tier choices are unchanged.
|
|
68
|
+
|
|
69
|
+
### What changed
|
|
70
|
+
|
|
71
|
+
- Added Test writer and Docs writer; clarified Code explorer and Task runner. Old four-role native v2/v3 receipts remain supported, including explicit expansion to six, owned removal, drift refusal and late rollback. New v4 snapshots support six independently configured Kimi aliases.
|
|
72
|
+
|
|
73
|
+
- Readable type uses a compact 36/20/15/13 px scale with more spacing; narrow layouts stack model controls and command actions.
|
|
74
|
+
- A short collapsible explanation introduces role-specific models, native setup and optional delegation, using the same wording as the README.
|
|
75
|
+
- The builder now starts with no roles, tools or chosen modes. Green checks track completed selections and successful copy, and Reset form restores a blank state. URL fragments restore visible settings without a backend. Conditional section hints and changed step markers use a two-second highlight hold plus two-second fade, respecting reduced motion. Selection controls share a soft treatment; Copy remains the primary action.
|
|
76
|
+
- Page commands always list every selected role/model/effort under its tool, including presets. Explicit --roles, --max-concurrent and optional --avoid-TOOL preserve the existing selection, cap and guidance. :native represents unpinned effort; Antigravity remains tier-only. The shared codec validates complete role maps and rejects duplicate/mixed input before writes. Legacy release/config/policy inputs remain supported.
|
|
77
|
+
- The four-step page now selects subagent roles and coding tools before mode/model/effort configuration. It generates and copies a real pinned command. Tool additions preserve All or a manually selected view. Role help uses the same prompt definitions as native generation.
|
|
78
|
+
- Optional selectedRoles creates only the requested native roles. Receipt v4 binds that role set to owned files and supports safe expansion, reduction and removal. Earlier v2/v3 native receipts retain their historical four-role ownership boundary. Unselected Kimi aliases do not need provisioning or effort pins.
|
|
79
|
+
- Native role files and routing instructions apply only when the main agent chooses delegation. Main models and disabled delegation features are preserved.
|
|
80
|
+
- A static page lets each tool use its own mode and per-task models/effort. All shows mixed settings as Custom and can apply one preset to every tool. Scope warnings protect individual and global replacements; the page generates one pinned command.
|
|
81
|
+
- Explicit release application supports safe upgrade/downgrade of owned settings; per-client receipts record the actual applied version and custom choices.
|
|
82
|
+
- Ownership/drift checks, private backups and rollback preserve unrelated settings and earlier user values.
|
|
83
|
+
- No custom hooks, proxy, plugin, launcher, daemon or normal-operation runtime is installed.
|
|
84
|
+
|
|
85
|
+
### Who should use it
|
|
86
|
+
|
|
87
|
+
People who want consistent subagent preferences across their installed coding tools. You can keep the recommendations or select different native models in the configuration page.
|
|
88
|
+
|
|
89
|
+
### Applying this version
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
npx --yes --ignore-scripts --package agent-policy-kit@0.1.0 agent-policy setup --release --apply
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Without --apply the same command previews the changes. The page-generated explicit tool arguments apply the visible choices using this release's native templates. See [release usage](docs/releases.md).
|
|
96
|
+
|
|
97
|
+
### Migration and limits
|
|
98
|
+
|
|
99
|
+
This is the first public release. Synthetic versions in tests are not real releases. Experimental runtime receipts from older development commits require their original owned removal. Supported native snapshot formats can be updated safely; unknown future formats/layouts are refused.
|
|
100
|
+
|
|
101
|
+
Kimi/Antigravity concurrency guidance and native tier/precedence limits remain explicit. A pinned release reproduces declared configuration, not provider weights, entitlement or model quality.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Agent Policy Kit contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,70 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Agent Policy Kit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Created and maintained by [Mykola Maksymenko](https://www.linkedin.com/in/nick-maximenko/).
|
|
4
|
+
|
|
5
|
+
Coding agents can delegate specific tasks to temporary subagents. Those tasks vary in complexity and importance. A single model for every task is rarely the best balance of capability, speed and cost.
|
|
6
|
+
|
|
7
|
+
Agent Policy Kit lets you match subagent roles with models and effort. It configures your coding tools’ native environment, then exits. The main agent still decides when to delegate, and its model stays unchanged.
|
|
8
|
+
|
|
9
|
+
```mermaid
|
|
10
|
+
flowchart LR
|
|
11
|
+
Roles("1. Choose subagent roles") --> Tools("2. Choose your coding tools")
|
|
12
|
+
Tools --> Models("3. Choose models and effort")
|
|
13
|
+
Models --> Command("4. Run one setup command")
|
|
14
|
+
Command --> Done("Native configs saved<br/>APK exits")
|
|
15
|
+
classDef default fill:#f5f7fb,stroke:#e0e5ed,color:#19283e
|
|
16
|
+
classDef action fill:#3158c3,stroke:#3158c3,color:#ffffff
|
|
17
|
+
class Command action
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Choose your setup
|
|
21
|
+
|
|
22
|
+
Open the [configuration page](https://agent-policy-kit.trymenow.io/v/0.2.0/) in your browser. Choose roles and coding tools, keep a preset or adjust each role, then copy the fully expanded setup command. The page address saves your visible choices for sharing. APK creates only the selected roles in installed, selected tools.
|
|
23
|
+
|
|
24
|
+
The [bundled page](site/index.html) also works offline. APK has no proxy, background process or runtime during your normal coding sessions. You can remove the npm package afterward.
|
|
25
|
+
|
|
26
|
+
## Roles and work modes
|
|
27
|
+
|
|
28
|
+
Choose only the roles you need:
|
|
29
|
+
|
|
30
|
+
| Role | Result |
|
|
31
|
+
|---|---|
|
|
32
|
+
| Coder | Implementation and fixes |
|
|
33
|
+
| Reviewer | Read-only correctness, security and regression findings |
|
|
34
|
+
| Code explorer | Read-only code and documentation discovery |
|
|
35
|
+
| Test writer | Tests and targeted execution; product fixes return to Coder |
|
|
36
|
+
| Docs writer | Verified docs, examples and release notes |
|
|
37
|
+
| Task runner | Prescribed commands and mechanical edits; uncertain decisions return to the parent |
|
|
38
|
+
|
|
39
|
+
Subagents draw on the same plan limits as your main session, and every parallel session adds to that usage. Choose the mode by how much of your plan subagents may use. Light uses light models for every role, so limits last longest; it suits entry plans and many parallel sessions. Standard gives code, review, tests and docs stronger models and keeps search and routine work on light models; it fits most plans. Top-tier uses high-end models for most roles; it uses limits fastest and suits top plans with few parallel sessions. A switch under Top-tier opts each tool into its top model (Fable, Astra or K3.1 Pro) for those roles; it is off by default. All choices remain editable. Claude Fable may use additional usage credits on plans that do not include it.
|
|
40
|
+
|
|
41
|
+
See the [exact preset choices and rationale](docs/model-catalog.md#how-the-presets-are-designed). Recommendations contain no personal model bans. They configure the environment; the main agent still chooses whether to delegate.
|
|
42
|
+
|
|
43
|
+
## Use a specific release's defaults
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
npx --yes --ignore-scripts --package agent-policy-kit@0.2.0 agent-policy setup --release --apply
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Omit --apply to preview. Each version includes its own presets, instructions and configuration page. [Release notes](CHANGELOG.md) explain what changed and why; [release usage](docs/releases.md) covers upgrade and downgrade.
|
|
50
|
+
|
|
51
|
+
Prefer your AI agent to handle installation or removal? Give it the [AI operator guide](AGENT_INSTALL.md).
|
|
52
|
+
|
|
53
|
+
## Read your current setup
|
|
54
|
+
|
|
55
|
+
Run `agent-policy show` to read existing user-level subagent settings, including settings created before APK. Use `--client codex` to inspect one tool. The command shows roles, models, effort and concurrency without changing files or starting model tasks. Project and session settings can override these user-level values.
|
|
56
|
+
|
|
57
|
+
Configuration commands show a short summary in an interactive terminal. Captured output remains JSON. Add `--json` to request JSON explicitly.
|
|
58
|
+
|
|
59
|
+
Open an individual coding tool's details to set its maximum concurrent subagents from 1 to 32. Each tool has its own limit per session. Presets start at Light 2, Standard 3 and Top-tier 2; a manual limit makes that tool Custom. Kimi and Antigravity treat it as guidance; Grok Build applies it as a native cap.
|
|
60
|
+
|
|
61
|
+
[Model catalog](docs/model-catalog.md) · [Support](docs/compatibility.md) · [Model updates](docs/model-updates.md) · [Privacy](docs/privacy.md) · [Verification](docs/verification.md)
|
|
62
|
+
|
|
63
|
+
Node.js 22.x (22.13+) or 24+; macOS/Linux. Version 0.2.0. MIT licensed.
|
|
64
|
+
|
|
65
|
+
## Related projects
|
|
66
|
+
|
|
67
|
+
Other open-source projects by [Mykola Maksymenko](https://www.linkedin.com/in/nick-maximenko/):
|
|
68
|
+
|
|
69
|
+
- [Agents Can Communicate (ACC)](https://github.com/automatis-tools/agents-can-communicate) connects independent AI coding sessions across clients for local questions, code reviews, and handoffs. [Website](https://getacc.dev/).
|
|
70
|
+
- [Automatis Skills](https://github.com/automatis-tools/automatis-skills) provides reusable engineering skills for GitHub workflows, Git cleanup, port conflicts, and technical writing.
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import {fileURLToPath} from 'node:url';
|
|
6
|
+
import {parseArgs} from 'node:util';
|
|
7
|
+
import {CLIENTS,validatePolicy} from '../src/policy.mjs';
|
|
8
|
+
import {ROLE_IDS} from '../src/roles.mjs';
|
|
9
|
+
import {EXPLICIT_FIELDS,parseExplicitOptions} from '../src/explicit.mjs';
|
|
10
|
+
import {nativeHomeConflict} from '../src/native.mjs';
|
|
11
|
+
import {detectClients,resolveClient,summarizeDetection} from '../src/detect.mjs';
|
|
12
|
+
import {bundledReleaseInfo,presetPreferences} from '../src/release.mjs';
|
|
13
|
+
import {formatResult,useJsonOutput} from '../src/output.mjs';
|
|
14
|
+
const root=path.dirname(path.dirname(fileURLToPath(import.meta.url)));
|
|
15
|
+
const version=JSON.parse(fs.readFileSync(path.join(root,'package.json'))).version;
|
|
16
|
+
let outputContext={command:'',apply:false,json:process.argv.includes('--json')};
|
|
17
|
+
const print=value=>process.stdout.write(useJsonOutput({isTTY:process.stdout.isTTY,json:outputContext.json})?JSON.stringify(value,null,2)+'\n':formatResult(outputContext.command,value,{version,apply:outputContext.apply}));
|
|
18
|
+
const fail=code=>{throw Object.assign(new Error(code),{code});};
|
|
19
|
+
const safeCode=code=>typeof code==='string'&&/^[A-Z_]{1,64}$/.test(code)?code:'OPERATION_FAILED';
|
|
20
|
+
function loadPolicy(file) {
|
|
21
|
+
const stat=fs.lstatSync(file);
|
|
22
|
+
if(!stat.isFile()||stat.isSymbolicLink()||stat.size>65536) fail('INVALID_POLICY');
|
|
23
|
+
try{return validatePolicy(JSON.parse(fs.readFileSync(file,'utf8')));}catch{fail('INVALID_POLICY');}
|
|
24
|
+
}
|
|
25
|
+
function help(){console.log(`Agent Policy Kit ${version}
|
|
26
|
+
|
|
27
|
+
Usage: agent-policy <command> [options]
|
|
28
|
+
|
|
29
|
+
instructions Print the AI setup and removal guide
|
|
30
|
+
init Copy default preferences to --policy (never overwrite)
|
|
31
|
+
detect Detect installed coding tools from executable identity
|
|
32
|
+
release Show this package's configuration version and release notes
|
|
33
|
+
setup Plan native configuration; add --apply to write
|
|
34
|
+
install Plan one --client or all detected clients
|
|
35
|
+
uninstall Plan owned removals; add --apply to remove
|
|
36
|
+
doctor Check owned native configuration without model calls
|
|
37
|
+
show Read current user-level native subagent configuration
|
|
38
|
+
|
|
39
|
+
Options: --client codex|claude|kimi|agy|grok --home PATH --state-dir PATH
|
|
40
|
+
--policy FILE | --release [--preset fast|balanced|quality] | --config BASE64URL
|
|
41
|
+
--roles worker,reviewer,explorer,tester,writer,routine --max-concurrent 3
|
|
42
|
+
--codex ROLE=MODEL:EFFORT,... --claude ROLE=MODEL:EFFORT,...
|
|
43
|
+
--kimi ROLE=ALIAS:EFFORT,... --antigravity ROLE=TIER,... --grok ROLE=MODEL,...
|
|
44
|
+
--codex-max-concurrent N --claude-max-concurrent N
|
|
45
|
+
--kimi-max-concurrent N --antigravity-max-concurrent N --grok-max-concurrent N
|
|
46
|
+
--avoid-codex MODELS --avoid-claude MODELS --avoid-kimi MODELS --avoid-antigravity MODELS --avoid-grok MODELS
|
|
47
|
+
--apply --json --help --version
|
|
48
|
+
|
|
49
|
+
Explicit tool input requires --roles and --max-concurrent. Use :native for unpinned effort. Antigravity and Grok Build take ROLE=TIER and ROLE=MODEL with no effort.
|
|
50
|
+
Include every selected role for each selected tool. Per-tool concurrency overrides the shared fallback.
|
|
51
|
+
Avoid lists are comma-separated.
|
|
52
|
+
State defaults to AGENT_POLICY_HOME or ~/.agent-policy-kit.
|
|
53
|
+
Terminal output is readable text; captured output is JSON. --json always prints JSON.
|
|
54
|
+
This configurator exits after setup. Native files work without the package.`);}
|
|
55
|
+
async function main(){
|
|
56
|
+
const {values:opts,positionals,tokens}=parseArgs({allowPositionals:true,strict:true,tokens:true,options:{
|
|
57
|
+
client:{type:'string'},home:{type:'string'},'state-dir':{type:'string'},policy:{type:'string'},
|
|
58
|
+
apply:{type:'boolean',default:false},json:{type:'boolean',default:false},help:{type:'boolean'},version:{type:'boolean'},
|
|
59
|
+
release:{type:'boolean',default:false},config:{type:'string'},preset:{type:'string'},
|
|
60
|
+
...Object.fromEntries(EXPLICIT_FIELDS.map(name=>[name,{type:'string'}])),
|
|
61
|
+
}});
|
|
62
|
+
if(opts.version){console.log(version);return;}
|
|
63
|
+
const command=positionals[0];
|
|
64
|
+
outputContext={command,apply:opts.apply,json:opts.json};
|
|
65
|
+
if(opts.help||!command||command==='help'){help();return;}
|
|
66
|
+
if(!['instructions','init','detect','release','setup','install','uninstall','doctor','show'].includes(command)) fail('UNKNOWN_COMMAND');
|
|
67
|
+
if(positionals.length!==1) fail('UNEXPECTED_ARGUMENT');
|
|
68
|
+
const seen=new Set();for(const token of tokens)if(token.kind==='option'&&EXPLICIT_FIELDS.includes(token.name)){if(seen.has(token.name))fail('DUPLICATE_OPTION');seen.add(token.name);}
|
|
69
|
+
const explicitValues=Object.fromEntries(EXPLICIT_FIELDS.filter(name=>opts[name]!==undefined).map(name=>[name,opts[name]])),explicit=Object.keys(explicitValues).length>0;
|
|
70
|
+
const bundled=Boolean(opts.release||opts.preset!==undefined);
|
|
71
|
+
if([opts.policy!==undefined,bundled,opts.config!==undefined,explicit].filter(Boolean).length>1)fail('CONFLICTING_OPTIONS');
|
|
72
|
+
if(explicit&&(!['setup','install'].includes(command)||opts.client!==undefined))fail('CONFLICTING_OPTIONS');
|
|
73
|
+
if((opts.release||opts.config!==undefined)&&!['setup','install'].includes(command))fail('CONFLICTING_OPTIONS');
|
|
74
|
+
if(opts.preset!==undefined&&!['release','setup','install'].includes(command))fail('CONFLICTING_OPTIONS');
|
|
75
|
+
const preset=opts.preset??'balanced';
|
|
76
|
+
if(bundled)presetPreferences(preset);
|
|
77
|
+
if(command==='instructions'){process.stdout.write(fs.readFileSync(path.join(root,'AGENT_INSTALL.md'),'utf8'));return;}
|
|
78
|
+
if(command==='release'){print(bundledReleaseInfo(preset));return;}
|
|
79
|
+
const client=opts.client;
|
|
80
|
+
if(client!==undefined&&!CLIENTS.includes(client)) fail('UNSUPPORTED_CLIENT');
|
|
81
|
+
const home=path.resolve(opts.home??os.homedir());
|
|
82
|
+
const selectedState=opts['state-dir']??process.env.AGENT_POLICY_HOME??path.join(home,'.agent-policy-kit');
|
|
83
|
+
if(!path.isAbsolute(selectedState)) fail('STATE_PATH_MUST_BE_ABSOLUTE');
|
|
84
|
+
const stateDir=path.resolve(selectedState);
|
|
85
|
+
if(command==='show'){
|
|
86
|
+
if(opts.apply||opts.policy!==undefined||opts.preset!==undefined)fail('CONFLICTING_OPTIONS');
|
|
87
|
+
const {readConfiguration}=await import('../src/inspect.mjs');
|
|
88
|
+
const report=await readConfiguration({client:client??null,home,stateDir,explicitHome:Boolean(opts.home)});
|
|
89
|
+
print(report);if(Object.values(report.clients).some(c=>c.status==='attention'))process.exitCode=3;
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const builtin=path.join(root,`policies/${preset}.json`);
|
|
93
|
+
let policyPath=bundled?builtin:opts.policy?path.resolve(opts.policy):fs.existsSync(path.join(stateDir,'policy.json'))?path.join(stateDir,'policy.json'):builtin;
|
|
94
|
+
if(command==='detect'){print(summarizeDetection(client?[await resolveClient(client)]:await detectClients()));return;}
|
|
95
|
+
if(command==='init'){
|
|
96
|
+
if(!opts.policy) fail('POLICY_PATH_REQUIRED');
|
|
97
|
+
fs.mkdirSync(path.dirname(policyPath),{recursive:true,mode:0o700});
|
|
98
|
+
fs.writeFileSync(policyPath,JSON.stringify(loadPolicy(path.join(root,'policies/balanced.json')),null,2)+'\n',{flag:'wx',mode:0o600});
|
|
99
|
+
print({status:'created',schemaVersion:1});return;
|
|
100
|
+
}
|
|
101
|
+
if(command==='uninstall'){
|
|
102
|
+
const {uninstall,summarizePlan}=await import('../src/install.mjs');
|
|
103
|
+
const clients=client?[client]:CLIENTS.filter(c=>fs.existsSync(path.join(stateDir,'installations',c+'.json')));
|
|
104
|
+
const results=[];
|
|
105
|
+
for(const selected of clients){
|
|
106
|
+
try{const result=await uninstall({client:selected,home,stateDir,apply:opts.apply});results.push(opts.apply?result:summarizePlan(result));}
|
|
107
|
+
catch(error){results.push({client:selected,status:'error',error:safeCode(error.code)});}
|
|
108
|
+
}
|
|
109
|
+
const failed=results.some(r=>r.status==='error');
|
|
110
|
+
print(client&&!failed?results[0]:{schemaVersion:1,status:failed?'partial':clients.length?'completed':'not_installed',results});
|
|
111
|
+
if(failed) process.exitCode=3;
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if(command==='setup'||command==='install'){
|
|
115
|
+
let temporary;
|
|
116
|
+
try{
|
|
117
|
+
if(opts.config!==undefined||explicit){
|
|
118
|
+
let preferences;
|
|
119
|
+
if(explicit){try{preferences=validatePolicy(parseExplicitOptions(explicitValues,ROLE_IDS));}catch{fail('INVALID_EXPLICIT_CONFIG');}}
|
|
120
|
+
else try{
|
|
121
|
+
if(opts.config.length>87384||!/^[-_A-Za-z0-9]+$/.test(opts.config))throw new Error();
|
|
122
|
+
const bytes=Buffer.from(opts.config,'base64url');
|
|
123
|
+
if(bytes.length>65536||bytes.toString('base64url')!==opts.config)throw new Error();
|
|
124
|
+
preferences=validatePolicy(JSON.parse(bytes.toString('utf8')));
|
|
125
|
+
}catch{fail('INVALID_CONFIG');}
|
|
126
|
+
temporary=fs.mkdtempSync(path.join(fs.realpathSync(os.tmpdir()),'agent-policy-config-'));
|
|
127
|
+
policyPath=path.join(temporary,'preferences.json');
|
|
128
|
+
fs.writeFileSync(policyPath,JSON.stringify(preferences),{flag:'wx',mode:0o600});
|
|
129
|
+
}
|
|
130
|
+
const preferences=loadPolicy(policyPath);
|
|
131
|
+
const {setupDetected}=await import('../src/setup.mjs');
|
|
132
|
+
const result=await setupDetected({client:client??null,home,stateDir,policyPath,apply:opts.apply,explicitHome:Boolean(opts.home),
|
|
133
|
+
releaseVersion:version,replace:bundled||opts.config!==undefined||explicit,
|
|
134
|
+
preset:explicit||opts.config!==undefined||opts.policy||policyPath!==builtin?null:preset,
|
|
135
|
+
source:explicit||opts.config!==undefined||opts.policy?'custom':policyPath===builtin?'release':'saved',
|
|
136
|
+
enabledClients:Object.keys(preferences.clients)});
|
|
137
|
+
print(result);process.exitCode=result.exitCode;return;
|
|
138
|
+
}finally{if(temporary)fs.rmSync(temporary,{recursive:true,force:true});}
|
|
139
|
+
}
|
|
140
|
+
const {inspectConfiguration}=await import('../src/install.mjs');
|
|
141
|
+
const report={schemaVersion:1,mode:'configuration_only',version,clients:{}};
|
|
142
|
+
for(const selected of client?[client]:CLIENTS){
|
|
143
|
+
const detection=summarizeDetection([await resolveClient(selected)])[0];
|
|
144
|
+
let configuration={status:'not_configured'};
|
|
145
|
+
if(!opts.home&&nativeHomeConflict(selected,home,process.env)){
|
|
146
|
+
configuration={status:'attention',reason:'NATIVE_HOME_OVERRIDE_UNSUPPORTED'};
|
|
147
|
+
} else if(fs.existsSync(path.join(stateDir,'installations',selected+'.json'))){
|
|
148
|
+
try{configuration=await inspectConfiguration({client:selected,home,stateDir});}
|
|
149
|
+
catch(error){configuration={status:'attention',reason:safeCode(error.code)};}
|
|
150
|
+
}
|
|
151
|
+
report.clients[selected]={detection,configuration,modelExecution:'not_checked',
|
|
152
|
+
concurrency:['codex','claude','grok'].includes(selected)?'native_setting_with_client_exceptions':'instructions_only',
|
|
153
|
+
models:selected==='agy'?'native_tiers':selected==='kimi'?'native_pool_with_routing_guidance':'native_role_settings'};
|
|
154
|
+
}
|
|
155
|
+
print(report);
|
|
156
|
+
}
|
|
157
|
+
main().catch(error=>{print({error:safeCode(error.code)});process.exitCode=1;});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Architecture
|
|
2
|
+
|
|
3
|
+
APK runs only for configuration commands. It detects installed CLIs, reads release/custom preferences, writes native files and exits. Native agent operation never imports or launches APK.
|
|
4
|
+
|
|
5
|
+
One npm version is one configuration release. src/release.mjs exposes its presets, catalog date and notes. policies contains Light/Standard/Top-tier data (ids fast/balanced/quality); models/catalog.json is the dated native model/effort snapshot. The self-contained page is generated from that same version and data. src/explicit.mjs supplies the pure command codec to Node and is embedded in the page at build time. Commands always expand selected role values, even for presets. The CLI converts complete maps to normal validated policy. Required code/light fallbacks copy the first explicit role and are unused by the complete per-role map. No browser/backend/provider request is needed to compose a command.
|
|
6
|
+
|
|
7
|
+
src/share.mjs validates and encodes the visible form state into the URL fragment. It never runs native operations or stores clipboard history. The page restores only release-compatible state, then applies normal command validation.
|
|
8
|
+
|
|
9
|
+
src/roles.mjs supplies the shared role descriptions/prompts for the page and native generation. src/policy.mjs validates code/light defaults, optional selectedRoles and per-client role overrides. Native generation uses selected roles only. The first selected role in catalog order supplies the native subagent default. Effort null means no explicit pin. Documented levels depend on model and client. Selected Kimi aliases merge explicit effort and resolve only to provisioned entries. Ambiguity fails without writes.
|
|
10
|
+
|
|
11
|
+
The fixed native role filenames remain apk-worker/reviewer/explorer/tester/writer/routine. Their presence does not require delegation. The main agent decides whether helpers are useful; main models and disabled features are preserved.
|
|
12
|
+
|
|
13
|
+
Receipt v4 stores the selected role set, bounded ownership snapshots and actual release/source/preset provenance. It verifies that the owned file set matches selectedRoles. Inspection/removal checks old hashes, blocks and typed operations without current templates or catalog validation. Historical v3 and v2 native snapshots remain supported. v2 has unknown release provenance. Unsupported layouts/runtime receipts are refused.
|
|
14
|
+
|
|
15
|
+
Explicit replacement virtually undoes owned changes to the original user baseline, renders the target, and commits final changes against actual current preimages. The existing transaction protects complete read dependencies, locks, staging, rollback and competing edits. Final uninstall restores original user values and keeps unrelated later edits. Receipts are applied truth; canonical policy is the latest requested snapshot. Per-client partial outcomes are explicit.
|
|
16
|
+
|
|
17
|
+
There is one TOML parser dependency and no CLI compilation. The static page's data injection is a deterministic release-preparation step. Generated native files have no package/source/state dependency; npm package removal does not remove saved native settings.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Native configuration support
|
|
2
|
+
|
|
3
|
+
| Client | Written native configuration | Limits |
|
|
4
|
+
|---|---|---|
|
|
5
|
+
| Codex | User role TOMLs, native subagent defaults/concurrency, routing instructions | Higher-priority project/explicit settings still follow Codex rules |
|
|
6
|
+
| Claude Code | User role Markdown with model/effort, native default/concurrency env, routing instructions | Force settings and native execution-path exceptions can override the intended mapping |
|
|
7
|
+
| Kimi Code | User role Markdown, existing secondary-model pool, per-alias effort, routing instructions | Model-role selection and max concurrency are guidance; provisioned aliases/capabilities are required |
|
|
8
|
+
| Antigravity | User role Markdown with Pro/Flash/Flash Lite/inherit tiers and routing instructions | No concrete provider pin, documented per-role effort, or universal native max-three cap |
|
|
9
|
+
| Grok Build | User role Markdown (read-only roles use permission_mode plan), per-role models and a general-purpose fallback in config.toml, native max_concurrent, routing instructions | No documented per-role effort; subagents use the main session effort. Higher-priority project/explicit settings still follow Grok Build rules |
|
|
10
|
+
|
|
11
|
+
These are preferences implemented through native features. APK does not participate in later agent operation and does not enforce policy on every request. avoidModels is guidance. No hook, wrapper or proxy is installed to bypass native limits.
|
|
12
|
+
|
|
13
|
+
Global configuration can be superseded by a project's native settings, session flags, environment or plugins. A fresh client session may be needed. Configured files, native loading and actual provider model execution are separate evidence.
|
|
14
|
+
|
|
15
|
+
macOS is the local acceptance host. Linux has a source-isolation gate using bubblewrap and a hosted workflow prepared; hosted runs are pending. Windows application is explicitly unsupported.
|
|
16
|
+
|
|
17
|
+
Primary references checked for this design:
|
|
18
|
+
|
|
19
|
+
- [Codex native subagents](https://learn.chatgpt.com/docs/agent-configuration/subagents).
|
|
20
|
+
- [Claude native subagents](https://code.claude.com/docs/en/sub-agents).
|
|
21
|
+
- [Kimi configuration](https://github.com/MoonshotAI/kimi-code/blob/main/docs/en/configuration/config-files.md) and [agent definitions](https://github.com/MoonshotAI/kimi-code/blob/main/docs/en/customization/agents.md).
|
|
22
|
+
- [Antigravity native subagents](https://antigravity.google/docs/subagents?tab=cli).
|
|
23
|
+
- [Grok Build subagents](https://github.com/xai-org/grok-build/blob/main/crates/codegen/xai-grok-pager/docs/user-guide/16-subagents.md), observed with Grok Build 1.0.70 and an isolated GROK_HOME.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Configuration page
|
|
2
|
+
|
|
3
|
+
Open site/index.html in Google Chrome. The page is one self-contained HTML file. It has no backend, telemetry, asset requests or native account access. It embeds this release's model catalog, presets, role definitions, getacc.dev palette and licensed Public Sans font.
|
|
4
|
+
|
|
5
|
+
## Four steps
|
|
6
|
+
|
|
7
|
+
1. Add the subagent roles you need. A green check confirms a nonempty role selection. Each question-mark button explains its description and native prompt. Removing a role also removes its configuration rows. Readding it preserves its choices in the current page session.
|
|
8
|
+
2. Add your coding tools. A green check confirms a nonempty tool selection. New tools append to the list. The first becomes active. From the second onward, All is active by default. A manually selected tool or All stays active during later additions. All configures the selected tools together. The CLI, not the browser, detects which selected tools are installed.
|
|
9
|
+
3. Choose a work mode. No mode is selected initially. Each selected tool needs a chosen mode before the command becomes available. The first choice has no replacement warning. Individual tool details show every selected role's model and supported effort, followed by that tool's parallel limit. The shared All view hides these controls. All offers shared presets. Custom can be selected manually and is also set by model or effort edits. Each tool shows its own mode beneath its name. Individual presets warn before changing that tool. Replacing genuinely edited values, mixed per-tool bases or partially chosen modes from All warns before changing all selected tools. Selecting Custom alone without changing values does not create an overwrite warning. Cancel preserves the choices.
|
|
10
|
+
4. Copy the setup command and run it in a terminal. Incomplete selections identify the missing steps with links. Invalid model settings or per-tool limits disable copying and clear the previous command. Clipboard failure selects the full command for manual copying.
|
|
11
|
+
|
|
12
|
+
The page starts with every subagent role selected and no coding tool. A completed third step requires selected modes and valid model settings. A fourth green check means the current command was successfully copied, not installed. Configuration changes clear that check; opening another tool without changing values preserves it. Reset form clears selections, modes, copy status and the URL fragment without changing any installed native files. Light uses 2 parallel subagents, Standard uses 3 and Top-tier uses 2. Selecting a preset restores its models, effort and parallel limit for the targeted tools. Editing a limit marks only that tool Custom. Effort buttons fill their section and show supported explicit levels. A dash means no native effort setting. Unpinned values remain unpinned until changed. Kimi roles sharing a model alias share its effort. Antigravity offers only native tiers. Other tools also accept custom native model IDs, subject to CLI and account support.
|
|
13
|
+
|
|
14
|
+
The command is pinned to this page's package version. It always expands every selected tool and role into visible model/effort arguments. Presets fill the form but do not shorten or hide the command. Tools follow their selected order. --roles carries the selected role IDs and --max-concurrent carries the shared fallback. Optional --codex-max-concurrent, --claude-max-concurrent, --kimi-max-concurrent and --antigravity-max-concurrent carry independent overrides. Nonempty --avoid-TOOL lists preserve existing model-avoidance guidance. Omitted tools are not configured.
|
|
15
|
+
|
|
16
|
+
Each tool uses role=model:effort entries. :native means no explicit effort pin. Antigravity uses role=tier and Grok Build uses role=model, both without an effort suffix. The parser splits at the last colon, preserving model IDs that contain colons or @. Every selected role must be present exactly once for every selected tool. The generated command reports custom provenance because its values are explicit, even when a preset filled the form.
|
|
17
|
+
|
|
18
|
+
The complete command is visible in a read-only field that grows to fit its contents. Copy preserves the visible POSIX shell line continuations. Soft wrapping adds no additional newlines. [Native field sizing](https://developer.chrome.com/docs/css-ui/css-field-sizing) handles content and window-size changes without a JavaScript resize helper. The page never executes the command or grants model access.
|
|
19
|
+
|
|
20
|
+
Role/tool changes use native View Transitions with a reduced-motion setting and a synchronous fallback. Section hints are conditional: role guidance after selection, add-more guidance for one tool, individual-configuration guidance for two or more tools, mode guidance when available, and Copied in the fourth heading. Changed hints, step markers, editing-scope labels and per-tool mode captions hold a soft highlight for two seconds, then fade for two seconds. Tool-caption nodes are reused so switching the editing view does not interrupt a pulse. Identical state does not repeat the animation. Labels retain their size during layout changes. No animation dependency is installed.
|
|
21
|
+
|
|
22
|
+
## Share a setup
|
|
23
|
+
|
|
24
|
+
The Max at once field appears only in individual coding-tool details. It accepts whole numbers from 1 to 32. Each tool retains its own limit while switching the editing view. Model-preset selection restores that tool's preset limit. Invalid selected-tool limits block the command and copy action. Invalid cached settings on unselected tools do not block selected tools. Kimi and Antigravity use the value as guidance rather than a native hard cap.
|
|
25
|
+
|
|
26
|
+
Each form edit replaces the current URL fragment with its visible state. Copy the page address to share it. Version 2 fragments contain roles, tool order, mode/base, selected model/effort pairs, each tool's limit and editing scope. Version 1 scalar-limit links remain readable. Their exact count is preserved; a count that differs from the current preset makes the restored tool Custom. It excludes clipboard completion and unselected cached choices. Opening a link restores the form, including unfinished choices and model drafts. Command validation still blocks incomplete or invalid settings.
|
|
27
|
+
|
|
28
|
+
src/share.mjs is the pure browser/Node codec. It uses versioned base64url JSON with strict IDs, fields, duplicate-key, size, UTF-8 and release checks. The fragment stays in the browser and needs no database or config lookup service. Invalid or mismatched-release links show an error and cannot produce an applicable command. Missing-step links scroll/focus without overwriting the setup fragment.
|
|
29
|
+
|
|
30
|
+
Public friend links require this static page to be hosted, for example on getacc.dev. A local file URL is machine-local; localhost acceptance proves restoration behavior, not public deployment. Each published release should retain its versioned page so old links can use the matching release.
|
|
31
|
+
|
|
32
|
+
## Build and host
|
|
33
|
+
|
|
34
|
+
Run npm run build:site after changing the template, shared CSS, role definitions, command codec, version, presets, catalog or changelog. npm run check rejects a stale generated page. Source assets are in site/template.html, site/base.css and site/fonts/. src/explicit.mjs supplies the same pure codec to the CLI and page. The generated HTML needs no server or build step to open.
|
|
35
|
+
|
|
36
|
+
Serve site/index.html from any static host. It can become part of getacc.dev without a service or proxy. Publish immutable pages at versioned release paths. A latest landing URL can point to the current one. Set repository/homepage URLs only after the owner creates them.
|
|
37
|
+
|
|
38
|
+
The current version is unreleased. Its page labels that status. Before npm publication, use the verified local tarball as described in the [AI operator guide](../AGENT_INSTALL.md). The checks do not publish or deploy anything.
|
|
39
|
+
|
|
40
|
+
The introduction includes a collapsed “How it works and why you need it” explanation aligned with the README. Native details/summary supports keyboard toggling; opening/closing takes 200 ms and honors reduced motion. The hosted versioned URL preserves release-specific shared links.
|
|
41
|
+
|
|
42
|
+
The footer credits Mykola Maksymenko and links to his supplied LinkedIn profile, Agents Can Communicate and Automatis Skills. Package author metadata is the source for the visible byline, title, author tags and static JSON-LD Person/project/page relationship. The canonical URL follows the homepage origin and bundled release version. These links load only when followed; no social widgets or runtime metadata requests are added.
|
|
43
|
+
|
|
44
|
+
The latest hosted root can update its interface and author metadata from reviewed main independently of npm publication. Published versioned pages remain exact snapshots. Configuration-sensitive changes must match a published package before the host build accepts them. See [deployment](deployment.md).
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Website deployment
|
|
2
|
+
|
|
3
|
+
The latest configurator at https://agent-policy-kit.trymenow.io/ follows reviewed main after Verify package succeeds. npm publication remains a separate, explicitly authorized operation.
|
|
4
|
+
|
|
5
|
+
## Automatic path
|
|
6
|
+
|
|
7
|
+
GitHub Actions runs Deploy configurator after a successful same-repository push verification on main. A successful version-tag verification can retry a site build after a package release. The deployment workflow always checks out main, never the triggering branch or tag's code. It verifies successful main-push CI for the checked-out commit and rechecks the latest main immediately before upload. Stale runs skip; deployments are serialized.
|
|
8
|
+
|
|
9
|
+
The production environment permits the main branch only. It has no required-reviewer pause, so normal merges need no manual deployment. workflow_dispatch provides a main-only retry after an external outage or delayed npm publication.
|
|
10
|
+
|
|
11
|
+
## Latest page and archived releases
|
|
12
|
+
|
|
13
|
+
The root page uses the current main interface and author metadata. Its declared configuration version and generated command must already exist in npm, and configuration-sensitive source must match that version's reachable Git tag. A model/catalog/role/policy/explicit-option change requires a corresponding configuration release before it can be served.
|
|
14
|
+
|
|
15
|
+
The /v/VERSION/ pages are copied byte for byte from reachable release tags. They are not rebuilt with the latest template. Old root share links redirect only to a known same-origin archived release; malformed, unknown and offline links retain safe errors. The root canonical URL stays the project root.
|
|
16
|
+
|
|
17
|
+
npm run build:host requires full Git history/tags and anonymous registry access. It refuses unknown files/symlinks in the generated output and stops before replacing dist when release validation fails.
|
|
18
|
+
|
|
19
|
+
## One-time credentials
|
|
20
|
+
|
|
21
|
+
The GitHub production environment stores CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN as encrypted environment secrets. The deployment API token needs Workers Scripts edit for the target Cloudflare account. Routing is excluded from the generated CI configuration: domain changes remain explicit infrastructure operations, so the CI token needs no zone, DNS, KV or R2 permissions.
|
|
22
|
+
|
|
23
|
+
Do not store the interactive Wrangler OAuth token or refresh token in CI. Create a separate deployment token and keep its value out of Git/npm, logs and artifacts. Cloudflare may scope Workers Scripts edit to the account rather than one Worker; the workflow additionally fixes the target Worker name and checks out trusted main code only.
|
|
24
|
+
|
|
25
|
+
Deployment tooling is pinned to Wrangler 4.151.3 and installed with lifecycle scripts disabled before Cloudflare credentials are passed to the upload step. Account secrets are not exposed to PR test jobs.
|
|
26
|
+
|
|
27
|
+
## Validation and retry
|
|
28
|
+
|
|
29
|
+
Before upload, the workflow builds the allowlisted static output and verifies current main/CI. After upload, it checks ordinary HTTPS responses against local latest/archive bytes. A failed gate leaves the existing deployment in place. A post-upload HTTP mismatch fails the workflow and needs investigation; it does not silently claim success.
|
|
30
|
+
|
|
31
|
+
Use the Deploy configurator workflow's main-only manual retry for transient service failures. No tag, npm package or PR is merged or published by this workflow.
|