typeclaw 0.48.7 → 0.48.8
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/auth.schema.json +15 -1
- package/package.json +1 -1
- package/secrets.schema.json +15 -1
- package/src/agent/guard-types.ts +25 -0
- package/src/agent/guards.ts +102 -0
- package/src/agent/index.ts +33 -3
- package/src/agent/multimodal/read-redirect.ts +8 -9
- package/src/agent/plugin-tools.ts +283 -148
- package/src/agent/provider-error.ts +6 -1
- package/src/agent/reload-tool.ts +12 -5
- package/src/agent/retry-same-ref.ts +95 -36
- package/src/agent/session-origin.ts +13 -1
- package/src/agent/system-prompt.ts +14 -3
- package/src/agent/todo/continuation-policy.ts +3 -4
- package/src/agent/tool-file-safety.ts +36 -13
- package/src/agent/tools/channel-reply.ts +39 -2
- package/src/agent/tools/channel-send.ts +45 -2
- package/src/agent/tools/post-github-review.ts +31 -13
- package/src/agent/tools/spawn-subagent.ts +15 -0
- package/src/agent/tools/webfetch/inline-style-visibility.ts +2 -2
- package/src/agent/tools/webfetch/strategies/readability.ts +109 -10
- package/src/agent/turn-runner.ts +23 -19
- package/src/bundled-plugins/backup/git-auth.ts +7 -4
- package/src/bundled-plugins/backup/subagents.ts +1 -1
- package/src/bundled-plugins/bun-hygiene/README.md +23 -20
- package/src/bundled-plugins/bun-hygiene/index.ts +1 -7
- package/src/bundled-plugins/bun-hygiene/policy.ts +111 -35
- package/src/bundled-plugins/github-cli-auth/gh-review-detect.ts +44 -2
- package/src/bundled-plugins/github-cli-auth/gh-store.ts +733 -0
- package/src/bundled-plugins/github-cli-auth/git-askpass.ts +25 -0
- package/src/bundled-plugins/github-cli-auth/git-command.ts +209 -31
- package/src/bundled-plugins/github-cli-auth/git-credential-env.ts +151 -0
- package/src/bundled-plugins/github-cli-auth/index.ts +236 -38
- package/src/bundled-plugins/github-cli-auth/review-recorder.ts +5 -0
- package/src/bundled-plugins/guard/index.ts +2 -25
- package/src/bundled-plugins/guard/keys.ts +8 -0
- package/src/bundled-plugins/guard/policies/non-workspace-write.ts +7 -8
- package/src/bundled-plugins/guard/policy.ts +1 -7
- package/src/bundled-plugins/security/policies/git-exfil.ts +22 -30
- package/src/bundled-plugins/security/policies/outbound-secret-scan.ts +2 -4
- package/src/bundled-plugins/security/policies/private-surface-read.ts +8 -6
- package/src/bundled-plugins/security/policies/secret-exfil-bash.ts +2 -5
- package/src/bundled-plugins/security/policies/secret-exfil-read.ts +2 -4
- package/src/bundled-plugins/security/policies/session-search-secrets.ts +2 -4
- package/src/bundled-plugins/security/policies/system-prompt-leak.ts +2 -4
- package/src/bundled-plugins/security/policy.ts +0 -8
- package/src/channels/adapters/discord-bot-slash-commands.ts +22 -0
- package/src/channels/adapters/discord-bot.ts +2 -1
- package/src/channels/adapters/discord-classify.ts +16 -4
- package/src/channels/adapters/discord.ts +20 -8
- package/src/channels/adapters/github/dedup.ts +37 -8
- package/src/channels/adapters/github/inbound.ts +241 -46
- package/src/channels/adapters/github/review-state.ts +13 -9
- package/src/channels/adapters/github/review-thread-resolver.ts +52 -20
- package/src/channels/adapters/slack-classify.ts +40 -5
- package/src/channels/adapters/slack.ts +3 -9
- package/src/channels/adapters/webex-bot-classify.ts +4 -33
- package/src/channels/adapters/webex-bot.ts +2 -4
- package/src/channels/adapters/webex-classify.ts +4 -33
- package/src/channels/adapters/webex-format.ts +36 -0
- package/src/channels/adapters/webex.ts +2 -4
- package/src/channels/continuation-willingness.ts +64 -39
- package/src/channels/github-rereview-guard.ts +20 -0
- package/src/channels/github-review-turn-ledger.ts +11 -1
- package/src/channels/github-review-verdict-coordinator.ts +475 -41
- package/src/channels/github-verdict-activity.ts +14 -5
- package/src/channels/persistence.ts +89 -5
- package/src/channels/router.ts +1187 -254
- package/src/channels/types.ts +21 -5
- package/src/cli/compose-stats.ts +6 -7
- package/src/cli/compose-status.ts +6 -7
- package/src/cli/compose-usage.ts +6 -7
- package/src/cli/stats.ts +6 -7
- package/src/cli/status.ts +7 -8
- package/src/cli/ui.ts +4 -4
- package/src/container/start.ts +41 -1
- package/src/cron/consumer.ts +30 -9
- package/src/cron/scheduler.ts +24 -9
- package/src/doctor/channel-checks.ts +64 -0
- package/src/doctor/report.ts +8 -8
- package/src/dreams/render.ts +2 -2
- package/src/init/dockerfile.ts +8 -1
- package/src/inspect/render.ts +2 -2
- package/src/path-safety/real-intended-path.ts +14 -1
- package/src/permissions/permissions.ts +10 -2
- package/src/permissions/resolve.ts +8 -2
- package/src/plugin/core-tool-names.ts +15 -0
- package/src/plugin/hooks.ts +37 -3
- package/src/plugin/registry.ts +7 -3
- package/src/run/index.ts +33 -7
- package/src/sandbox/build.ts +19 -3
- package/src/sandbox/policy.ts +1 -0
- package/src/secrets/export-github-cli-store.ts +158 -0
- package/src/secrets/index.ts +19 -1
- package/src/secrets/provision-github-cli-store.ts +322 -0
- package/src/secrets/schema.ts +13 -7
- package/src/secrets/storage.ts +30 -0
- package/src/shared/index.ts +2 -0
- package/src/shared/style-text.ts +13 -0
- package/src/skills/typeclaw-channel-github/SKILL.md +24 -12
- package/src/skills/typeclaw-config/SKILL.md +3 -1
- package/src/skills/typeclaw-github-contributing/SKILL.md +6 -2
- package/src/skills/typeclaw-permissions/SKILL.md +11 -22
- package/src/usage/report.ts +3 -3
|
@@ -101,7 +101,7 @@ The security plugin classifies each guard on a two-axis policy:
|
|
|
101
101
|
- **high — direct audience-leak.** Bypass sends data to a third-party audience outside the operator's control loop with NO operator-visible intermediate step. Inhabitants: `outboundSecret`, `systemPromptLeak`, `gitRemoteTainted`. **`owner` bypasses by default; `trusted`, `member`, `guest` do not.** The canonical case is **owner-in-public-channel**: an owner-permissioned operator asking the agent to "post deploy status to #general" can silently leak a `Bearer ghp_…` line. The defense lives in `roles.owner.match[]` discipline — the default is TUI-only, where a human is present. Configs that widen owner to a channel author should narrow the match or strip `security.bypass.high` (and the wildcard sentinel) from `roles.owner.permissions[]` for those origins.
|
|
102
102
|
- **medium — silent-attack OR operator-reviewable state.** Two sub-shapes share this tier because they share a defense story (operator review catches it before the privileged effect escapes). (a) _silent-attack_: `secretExfilBash`, `secretExfilRead`, `ssrf`, and `sessionSearchSecrets` are heuristic/plugin defenses for non-canonical surfaces; bypassing them still cannot expose canonical credential stores or reusable child auth. For `ssrf`, a bypass skips only the heuristic plugin pre-check—the safe `web_fetch`/URL-backed `look_at` transport still enforces its independent policy below. (b) _operator-reviewable state_: bypass writes to a file the operator force-commits and reviews before the privileged effect takes hold — `gitExfil` (push to a clean operator-configured remote; the retarget-and-push path stays blocked by `gitRemoteTainted` at high), `rolePromotion` (`roles` is restart-required so the operator has wall-clock time), `cronPromotion` (deferred execution gives wall-clock time to revert). **`owner` and `trusted` bypass these plugin guards; `member`, `guest` do not.**
|
|
103
103
|
|
|
104
|
-
**Important:**
|
|
104
|
+
**Important:** security guards do not honor `acknowledgeGuards`. Their bypass is **permission-only**: an actor bypasses one by holding its tier permission or the per-guard `security.bypass.<guard>` string. Additionally, `cronPromotion` is caller-role-aware: it only blocks changes that schedule deferred work above the caller's resolved role.
|
|
105
105
|
|
|
106
106
|
- **low — noisy, immediately recoverable.** No inhabitants today. Forward-compat for future guards. **`owner`, `trusted`, `member` all carry `bypass.low`; `guest` does not.**
|
|
107
107
|
|
|
@@ -111,7 +111,7 @@ At `tool.before` time, an actor bypasses a guard if they hold **either** the tie
|
|
|
111
111
|
|
|
112
112
|
### SSRF has a non-bypassable transport layer
|
|
113
113
|
|
|
114
|
-
`security.bypass.ssrf`, `security.bypass.medium`, `owner`,
|
|
114
|
+
`security.bypass.ssrf`, `security.bypass.medium`, `owner`, and `trusted` can skip the heuristic `tool.before` warning only. They cannot make the safe transports behind `web_fetch` and URL-backed `look_at` connect to a destination that transport policy rejects.
|
|
115
115
|
|
|
116
116
|
Intentional internal access is operator-configured in raw-masked `.env`, not in `roles` or tool arguments:
|
|
117
117
|
|
|
@@ -148,31 +148,20 @@ See `typeclaw-plugins` for the authoring side of this — declaring and gating o
|
|
|
148
148
|
|
|
149
149
|
## When a tool is blocked
|
|
150
150
|
|
|
151
|
-
The security plugin's `tool.before` hook produces block messages
|
|
151
|
+
The security plugin's `tool.before` hook produces block messages:
|
|
152
152
|
|
|
153
153
|
```
|
|
154
|
-
Guard `<guardName>` blocked <what>.
|
|
155
|
-
|
|
156
|
-
<tool> arguments. Or run as a role carrying `<per-guard-permission>` (...role hint...)
|
|
157
|
-
or the tier permission `security.bypass.<low|medium|high>`; see the
|
|
158
|
-
`typeclaw-permissions` skill.
|
|
154
|
+
Guard `<guardName>` blocked <what>. Run as a role carrying `<per-guard-permission>`
|
|
155
|
+
or the tier permission `security.bypass.<low|medium|high>`.
|
|
159
156
|
```
|
|
160
157
|
|
|
161
|
-
|
|
158
|
+
Security-guard bypasses are permission-based. If the block concerns a canonical credential path, reusable authentication, or the safe HTTP transport's SSRF floor, there is no role escape hatch; direct the operator to the appropriate host-side workflow instead.
|
|
162
159
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
already resolves to a role
|
|
166
|
-
`security.bypass.medium` — the TUI is always `owner`, or claim the role out-of-band
|
|
167
|
-
via `typeclaw role claim` from the host CLI.
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
Four escape hatches for **bypassable plugin guards**, ordered from least to most invasive. If the block concerns a canonical credential path, reusable authentication, or the safe HTTP transport's SSRF floor, there is no role/ack escape hatch; direct the operator to the appropriate host-side workflow instead.
|
|
160
|
+
1. **Run as a role with the per-guard bypass permission.** Add the exact `security.bypass.<guardName>` string when the operator wants only that capability.
|
|
161
|
+
2. **Run as a role with the tier bypass permission.** Granting `security.bypass.low|medium|high` opens every security guard in that tier.
|
|
162
|
+
3. **Use a session that already resolves to a role with the bypass.** The TUI is always `owner`; role claims happen out-of-band through the host CLI.
|
|
171
163
|
|
|
172
|
-
|
|
173
|
-
2. **Run as a role with the per-guard bypass permission**. If the user wants this pattern to keep working without an ack every time, they edit `roles.<role>.permissions[]` to include the specific `security.bypass.<guardName>` string the block message named. This is the most granular grant — it only opens up that one guard. Use this when the user wants exactly one capability and nothing else.
|
|
174
|
-
3. **Run as a role with the tier bypass permission**. The block message also names the tier permission (`security.bypass.low` / `.medium` / `.high`). Granting the tier opens every bypassable plugin guard of that tier at once — never canonical secrets.
|
|
175
|
-
4. **Run from a session that already resolves to a role with the bypass**. The TUI is always `owner`, so a bypassable plugin guard that blocks a `member` channel author may permit the TUI. Canonical credential denial and safe-HTTP transport validation remain identical in both places. For `cronPromotion`, `rolePromotion`, and `pluginAddition` specifically, use a session carrying `security.bypass.medium` or claim the role out-of-band via `typeclaw role claim` from the host CLI.
|
|
164
|
+
Separate advisory plugins may expose per-call acknowledgements. Those use plugin-nested JSON, for example `acknowledgeGuards: { "guard": { "nonWorkspaceWrite": true } }` or `{ "bun-hygiene": { "nonBunPackageManager": true } }`. The block reason names the exact tuple. These acknowledgements never apply to security guards.
|
|
176
165
|
|
|
177
166
|
When you see a block, tell the user **which permission would skip it** (the block message now names both the per-guard and the tier options) and **which built-in roles have those permissions**. Do not just relay the guard reason — that loses the access-control framing entirely.
|
|
178
167
|
|
|
@@ -228,7 +217,7 @@ If you see a cron job mysteriously failing every fire with `denied by permission
|
|
|
228
217
|
- **Do not promise that `typeclaw reload` applied a `roles` edit.** `roles` is restart-required. The reload tool will return success on the config file change, but the live `PermissionService` was built at boot and is not swapped on reload.
|
|
229
218
|
- **Do not silently change a built-in role's permission list.** Setting `"permissions": []` on `member` is a wholesale replace, not a merge — you just took `channel.respond` away from every speaker who resolves to `member`. If the user said "give member just `channel.respond` and nothing else", that's fine (it's the same as the default), but say so explicitly: "this matches the default for `member`, no behavior change". If the user said "remove cron from `trusted`", make the change but warn that `trusted` no longer carries `cron.schedule` either.
|
|
230
219
|
- **Do not write match rules using display names** (`#general`, `@user`, channel/user names). Match rules are platform IDs. Display names change; IDs don't. Always look up the ID before writing the rule.
|
|
231
|
-
- **Do not edit `roles` to "fix" a security block** without explaining the
|
|
220
|
+
- **Do not edit `roles` to "fix" a security block** without explaining the implications. Security guards are permission-only; advisory plugin acknowledgements do not apply. Intentional internal `web_fetch`/URL-backed `look_at` access is an operator boot-policy change, not a role edit.
|
|
232
221
|
- **Do not interpret a missing `## Session origin` role line as "I have no role".** TUI sessions don't render the line because TUI is always `owner`. If you see no role line and you're not in TUI, something has gone wrong with the system prompt build — flag it, don't fabricate.
|
|
233
222
|
|
|
234
223
|
## What this skill does not cover
|
package/src/usage/report.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { styled, type StyleFormat } from '@/shared'
|
|
2
2
|
|
|
3
3
|
import type { ModelUsage, OriginUsage, UsageTotals } from './aggregate'
|
|
4
4
|
import { formatCacheHitRate, formatCost, formatTokens, isoDay } from './format'
|
|
@@ -448,9 +448,9 @@ function dim(text: string, ctx: RenderCtx): string {
|
|
|
448
448
|
return color('dim', text, ctx)
|
|
449
449
|
}
|
|
450
450
|
|
|
451
|
-
function color(modifier:
|
|
451
|
+
function color(modifier: StyleFormat, text: string, ctx: RenderCtx): string {
|
|
452
452
|
if (!ctx.useColor) return text
|
|
453
|
-
return
|
|
453
|
+
return styled(modifier, text)
|
|
454
454
|
}
|
|
455
455
|
|
|
456
456
|
// ANSI escape sequences would inflate column widths and break alignment under
|