typeclaw 0.48.3 → 0.48.5
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/package.json +2 -2
- package/scripts/dump-system-prompt.ts +146 -11
- package/src/agent/index.ts +6 -1
- package/src/agent/live-subagents.ts +15 -0
- package/src/agent/plugin-tools.ts +7 -0
- package/src/agent/session-origin.ts +104 -16
- package/src/agent/subagent-completion-reminder.ts +1 -1
- package/src/agent/subagent-drain.ts +11 -1
- package/src/agent/subagents.ts +52 -7
- package/src/agent/tool-file-safety.ts +14 -4
- package/src/agent/tools/runtime-notice.ts +29 -0
- package/src/agent/tools/spawn-subagent.ts +88 -7
- package/src/agent/tools/subagent-cancel.ts +1 -0
- package/src/agent/tools/subagent-output.ts +7 -2
- package/src/agent/tools/webfetch/adaptive-html.ts +319 -0
- package/src/agent/tools/webfetch/html-lexical.ts +841 -0
- package/src/agent/tools/webfetch/inline-style-visibility.ts +281 -0
- package/src/agent/tools/webfetch/strategies/readability.ts +306 -5
- package/src/agent/tools/webfetch/tool.ts +45 -2
- package/src/agent/tools/webfetch/types.ts +7 -0
- package/src/agent/turn-runner.ts +7 -3
- package/src/bundled-plugins/github-cli-auth/gh-command.ts +187 -8
- package/src/bundled-plugins/github-cli-auth/git-command.ts +497 -652
- package/src/bundled-plugins/memory/load-memory.ts +23 -27
- package/src/bundled-plugins/reviewer/reviewer.ts +32 -5
- package/src/bundled-plugins/reviewer/skills/code-review.ts +5 -3
- package/src/bundled-plugins/reviewer/skills/doc-review.ts +1 -1
- package/src/bundled-plugins/reviewer/skills/plan-review.ts +1 -1
- package/src/bundled-plugins/security/index.ts +1 -0
- package/src/bundled-plugins/security/policies/private-surface-read.ts +74 -18
- package/src/channels/router.ts +32 -47
- package/src/cli/hostd.ts +1 -1
- package/src/hostd/kakao-renewal-manager.ts +23 -11
- package/src/plugin/index.ts +1 -0
- package/src/plugin/types.ts +9 -10
- package/src/run/channel-session-factory.ts +3 -1
- package/src/run/index.ts +29 -29
- package/src/run/subagent-coalescing.ts +24 -0
- package/src/secrets/kakao-renewal.ts +123 -20
- package/src/server/index.ts +4 -1
- package/src/skills/typeclaw-channel-github/SKILL.md +6 -6
- package/src/skills/typeclaw-channel-instagram/SKILL.md +1 -1
- package/src/skills/typeclaw-channel-kakaotalk/SKILL.md +1 -1
- package/src/skills/typeclaw-channel-line/SKILL.md +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: typeclaw-channel-github
|
|
3
|
-
description: Use this skill
|
|
3
|
+
description: Use this skill ALWAYS for PR review requests in any phrasing, including "requested your review on PR #N", "requested a review from team @… on PR #N", "@bot review this", "can you take a look at #123", "이 PR 리뷰해줘", and "리뷰 반영"; delegate reviews of other people's PRs to the `reviewer` subagent and post line-anchored findings with `post_github_review`. ALWAYS settle PR authorship first (triage #0): on a PR you opened, act as the CONTRIBUTOR/author, never review your own PR, and use host-stage operator checkout/push help to address feedback. Also use this skill to resolve threads you authored with `resolve_review_thread`, create issues with model-driven `gh issue create`, or prepare host-stage PR creation, checkout, and push actions.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
GitHub renders normal Markdown in issues, PRs, discussions, and review comments. Use headings, lists, tables, fenced code blocks, links, and inline code when they improve clarity.
|
|
@@ -117,10 +117,10 @@ The `reviewer` subagent is the analyst; you are the integration layer between it
|
|
|
117
117
|
|
|
118
118
|
**HARD RULE — a review with actionable findings is a formal review, never a flat comment.** If the reviewer returns **one or more** actionable findings (`blocker`/`concern`/`nit`), the ONLY acceptable way to deliver them is a formal review via `POST /pulls/<N>/reviews` (step 4) — `REQUEST_CHANGES`, `COMMENT`, or `APPROVE` per the verdict, with the line-anchored findings in `comments[]`. You may **never** flatten those findings into a `channel_reply` or a top-level issue comment, **even when** the `gh api` call fails. A 422 means an anchor is wrong (almost always a `line` not in the diff): re-anchor it or move that one finding into the top-level review `body`, then resubmit the formal review — do **not** abandon the formal review and post prose instead. A flat "## Review … two blockers" comment is a bug, not a fallback: it strands the findings without line anchors and is the exact failure this rule exists to prevent. The flat/issue-comment path is reserved for the **zero-actionable-findings** branch only (see below). If you genuinely cannot land a formal review after fixing anchors, say so plainly and post nothing that claims a review happened — silence beats a false receipt.
|
|
119
119
|
|
|
120
|
-
1. **
|
|
120
|
+
1. **Minimal intake, then delegate immediately.** Capture only the repo, PR number, current head SHA, exact base OID, authorship, and the prior blocking context needed to identify a re-review. Do not inspect the diff or changed files. Batch the independent metadata/history reads where the tool interface permits.
|
|
121
121
|
|
|
122
122
|
```sh
|
|
123
|
-
gh pr view <N> --repo owner/repo --json
|
|
123
|
+
gh pr view <N> --repo owner/repo --json author,headRefOid,baseRefOid
|
|
124
124
|
```
|
|
125
125
|
|
|
126
126
|
Then check for an **unresolved blocking obligation of yours** — this is what makes the current request a _re-review_ (the author pushed fixes after you previously blocked the PR). As in triage #1, a block can live in **two** places, and you must check both:
|
|
@@ -138,13 +138,13 @@ The `reviewer` subagent is the analyst; you are the integration layer between it
|
|
|
138
138
|
- **Filter to _decision_ states, not the latest review row.** GitHub's sticky block is cleared only by a later `APPROVED` (or a dismissal) from the same reviewer — a later `COMMENTED` review does **not** clear it. So a history of `CHANGES_REQUESTED` → `COMMENTED` is _still blocked_, even though the latest row is `COMMENTED`. Selecting `last` over the raw review list would misread that as "not a re-review". Filtering to `{CHANGES_REQUESTED, APPROVED}` first, then taking `last`, asks the right question: "what is my latest _blocking decision_, ignoring non-deciding comments?" (Dismissed reviews surface as `state: "DISMISSED"`, so they're correctly excluded from the decision set too.)
|
|
139
139
|
- **`--paginate --slurp` is mandatory.** GitHub returns reviews 30 per page; a bot on a long-lived PR can have its blocking `CHANGES_REQUESTED` past the first page. Without paginating, that review is invisible and a genuine re-review silently falls back to the plain-comment path. `--slurp` collects every page into one array of arrays; the `add` concatenates them before filtering.
|
|
140
140
|
|
|
141
|
-
2. **Spawn the `reviewer` subagent with the PR target.** The reviewer runs on the deep profile, so it always runs in the background — you stay responsive while it works. Pass the PR
|
|
141
|
+
2. **Spawn the `reviewer` subagent with the PR target immediately after minimal intake.** The reviewer runs on the deep profile, so it always runs in the background — you stay responsive while it works. Pass the repo, PR number, captured head SHA, captured base OID, any re-review context, and any requester focus. Also pass the exact typed identity from step 1 as `review_identity: { repo: "owner/repo", pull_request: N, head_sha: "<40-char headRefOid>", base_sha: "<40-char baseRefOid>", review_kind: "review" }`; use `review_kind: "re-review"` when step 1 found an unresolved blocking obligation. This is runtime coalescing metadata, not prose: identical repo/PR/head/base/kind jobs within this parent session share one in-flight analysis, while a new head, different base, different kind, or different parent session stays independent. Never guess or parse these fields from the request text — source both `headRefOid` and `baseRefOid` from the values returned by `gh pr view`. Do not use a base branch name as identity. Do not run `gh pr diff`, read changed files, or otherwise pre-analyze first. The reviewer acquires its own context, loads the `code-review` skill, and returns a `<review>` block whose code findings carry `location="path:line"`.
|
|
142
142
|
|
|
143
143
|
**If step 1 found an unresolved blocking obligation — a formal `CHANGES_REQUESTED` _or_ an unretracted flat-comment blocker — say so in the spawn payload** — e.g. _"This is a re-review: you previously blocked this PR (the prior blockers were …; the block was a formal `CHANGES_REQUESTED` / a flat PR comment). Verify they are resolved and return `approve` or `request-changes` — a re-review must re-decide the blocking state, not return `comment`."_ The reviewer's `code-review` skill enforces the same rule, but telling it the prior blockers (and which form they took) is what lets it apply that rule; a fresh reviewer session has no memory of your earlier block. The flat-comment case especially must be passed through — the reviewer cannot recover it from review state, so omitting it would silently drop the re-review context the moment the flow starts.
|
|
144
144
|
|
|
145
145
|
Do **not** post an "on it" acknowledgement comment before spawning the reviewer — the runtime already adds an :eyes: reaction to the PR the moment it engages, so a "looking into this" comment is redundant noise. Just spawn the reviewer (it runs in the background); the formal review is your reply. If you want to acknowledge explicitly, use `channel_react({ emoji: "eyes" })`, which reacts without posting a comment.
|
|
146
146
|
|
|
147
|
-
After spawning, **end your turn** — the background reviewer wakes you with a completion `<system-reminder>` (step 3). "Stay responsive" means you remain free to handle _other_ chats meanwhile; it does **not** license you to keep working _this_ PR. Do not poll `subagent_output`
|
|
147
|
+
After spawning, **end your turn** — the background reviewer wakes you with a completion `<system-reminder>` (step 3). "Stay responsive" means you remain free to handle _other_ chats meanwhile; it does **not** license you to keep working _this_ PR. Do not poll `subagent_output` at all before completion, and do not fill the wait by reviewing the diff yourself. Only after that reminder may you fetch the result.
|
|
148
148
|
|
|
149
149
|
3. **On the completion `<system-reminder>`, first check you have not already posted — then** call `subagent_output({ task_id })` to read the reviewer's final assistant message.
|
|
150
150
|
|
|
@@ -171,7 +171,7 @@ The `reviewer` subagent is the analyst; you are the integration layer between it
|
|
|
171
171
|
- **Re-spawn the reviewer once** (step 2) with the same target — a fresh `deep` context usually completes; if it now returns a real `<review>` block, post it normally.
|
|
172
172
|
- **If the re-spawn is still incomplete**, post a brief, honest `channel_reply` on the PR — e.g. _"리뷰를 자동 완료하지 못했어요 (reviewer returned no verdict). 다시 시도하거나 직접 확인이 필요합니다."_ — and remove your in-review label. An honest "couldn't complete the review" comment is the correct fallback; silence after you engaged, or a fabricated formal verdict, is not.
|
|
173
173
|
|
|
174
|
-
4. **
|
|
174
|
+
4. **Validate anchors proportionally, then translate into a `post_github_review` call.** Validate only the cited anchors needed for posting: confirm each actionable `path:line` belongs to the captured head/diff and that the cited text supports the finding. Batch independent anchor checks. Do not re-review the diff, inspect unrelated files, or second-guess the verdict; parent verification is proportional to the findings returned. Each `<finding>` with `severity` of `blocker`, `concern`, or `nit` and a valid `location="path:line"` becomes one entry in `comments[]`. Compose the inline `body` from the reviewer's `<issue>` + `<evidence>` + `<suggestion>` verbatim (modulo markdown). Findings whose `location` is `general` go into the top-level review `body`. **Skip `praise` findings when building `comments[]`**.
|
|
175
175
|
|
|
176
176
|
**The verdict and the inline comments are independent. The verdict sets only the `event` field; it never decides whether you post `comments[]`.** Whenever there is at least one actionable finding (`blocker`/`concern`/`nit`) with a `location="path:line"`, you MUST submit a formal review via `POST /pulls/<N>/reviews` carrying those findings in `comments[]` — including when the verdict is `approve`. An `approve` with three nits is still a formal `APPROVE` review with three inline comments, **not** a plain approval and **not** a flattened summary. Collapsing inline findings into a single `channel_reply` or issue comment loses the line anchors the reviewer worked to produce.
|
|
177
177
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: typeclaw-channel-instagram
|
|
3
|
-
description: Use this skill
|
|
3
|
+
description: Use this skill for Instagram inbound media being metadata-only, workspace types and engagement rules, transport fallback, or operator-side 2FA/checkpoint handling.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# typeclaw-channel-instagram
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: typeclaw-channel-kakaotalk
|
|
3
|
-
description: Use this skill
|
|
3
|
+
description: Use this skill for KakaoTalk inbound attachment/emoticon handling with `channel_fetch_attachment` or `look_at_channel_attachment`, outbound attachment/gallery MIME routing, engagement/stickiness and group-chat permission questions, mark-read behavior, or self-loop troubleshooting.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# typeclaw-channel-kakaotalk
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: typeclaw-channel-line
|
|
3
|
-
description: Use this skill
|
|
3
|
+
description: Use this skill for LINE inbound non-text content being unfetchable, workspace bucket semantics, or engagement behavior.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# typeclaw-channel-line
|