@integrity-labs/agt-cli 0.28.865 → 0.28.866

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.
Files changed (24) hide show
  1. package/dist/assets/review/SWEEP.md +169 -0
  2. package/dist/bin/agt.js +5 -5
  3. package/dist/{chunk-RVXI7GZO.js → chunk-52JZN5RZ.js} +4 -4
  4. package/dist/{chunk-PXDYKP5O.js → chunk-AFOW32B6.js} +2 -2
  5. package/dist/{chunk-JG3EAFZO.js → chunk-ULLOPIPI.js} +24 -3
  6. package/dist/{chunk-JG3EAFZO.js.map → chunk-ULLOPIPI.js.map} +1 -1
  7. package/dist/{claude-pair-runtime-OWOZ2ZQ7.js → claude-pair-runtime-ZPCSW7EP.js} +2 -2
  8. package/dist/lib/manager-worker.js +28 -23
  9. package/dist/lib/manager-worker.js.map +1 -1
  10. package/dist/mcp/direct-chat-channel.js +23 -2
  11. package/dist/mcp/index.js +23 -2
  12. package/dist/mcp/origami.js +23 -2
  13. package/dist/mcp/slack-channel.js +23 -2
  14. package/dist/mcp/telegram-channel.js +23 -2
  15. package/dist/{persistent-session-GSXFKCVO.js → persistent-session-NKC4H6CA.js} +3 -3
  16. package/dist/{responsiveness-probe-GOM3ZYW3.js → responsiveness-probe-E76NS3BE.js} +3 -3
  17. package/dist/{session-auth-dead-ID4L35CN.js → session-auth-dead-WSBNUP5I.js} +2 -2
  18. package/package.json +2 -2
  19. /package/dist/{chunk-RVXI7GZO.js.map → chunk-52JZN5RZ.js.map} +0 -0
  20. /package/dist/{chunk-PXDYKP5O.js.map → chunk-AFOW32B6.js.map} +0 -0
  21. /package/dist/{claude-pair-runtime-OWOZ2ZQ7.js.map → claude-pair-runtime-ZPCSW7EP.js.map} +0 -0
  22. /package/dist/{persistent-session-GSXFKCVO.js.map → persistent-session-NKC4H6CA.js.map} +0 -0
  23. /package/dist/{responsiveness-probe-GOM3ZYW3.js.map → responsiveness-probe-E76NS3BE.js.map} +0 -0
  24. /package/dist/{session-auth-dead-ID4L35CN.js.map → session-auth-dead-WSBNUP5I.js.map} +0 -0
@@ -0,0 +1,169 @@
1
+ ---
2
+ name: pr-review-sweep
3
+ description: Find the pull requests in scope that have no review for their current head, and review them. Use when a recurring card asks you to sweep a repository's open PRs. Reviews via the pr-review skill; posts nothing.
4
+ ---
5
+
6
+ # Sweeping a repository's open pull requests
7
+
8
+ You are a Ninjafy agent (Ninjafy and Augmented Team are one platform, so you
9
+ answer to the old name too). This skill is the loop that decides **which** pull
10
+ requests get reviewed. The `pr-review` skill is what reviews one. Keep them
11
+ separate: this one chooses, that one reads.
12
+
13
+ **You post nothing, and neither does the review.** Every artefact this skill
14
+ touches is a file under your own working directory.
15
+
16
+ ---
17
+
18
+ ## 1. Read your scope — and refuse without one
19
+
20
+ The card that woke you must name a scope. One of:
21
+
22
+ - `label:<name>` — open PRs carrying that label
23
+ - `author:<login>` — open PRs opened by that account
24
+ - `prs:<n>,<n>,<n>` — an explicit list
25
+
26
+ **If the card names no scope, review nothing.** Write the sweep summary
27
+ (section 5) with `"status": "refused"` and `"reason": "no_scope"`, say so, and
28
+ stop.
29
+
30
+ This is not caution, it is the point. An unscoped sweep is "review every open
31
+ PR", which at this repository's volume is the most expensive thing you could be
32
+ asked to do, and nobody would have asked for it — they would have forgotten to
33
+ say. A missing scope is a missing instruction, so the safe reading is *nothing*,
34
+ never *everything*.
35
+
36
+ You also need the repository as `owner/name`. If the card does not name one,
37
+ that is `"reason": "no_repo"` and the same refusal.
38
+
39
+ ## 2. List the candidates
40
+
41
+ ```bash
42
+ gh pr list --repo OWNER/NAME --state open --limit 100 \
43
+ --json number,headRefOid,title,isDraft,author
44
+ ```
45
+
46
+ Add `--label <name>` or `--author <login>` per the scope.
47
+
48
+ For a `prs:` scope, read each one with `gh api repos/OWNER/NAME/pulls/NUMBER`
49
+ instead. **That payload names the same things differently** — `head.sha`, not
50
+ `headRefOid`; `draft`, not `isDraft` — and it does not filter by state, so check
51
+ `state` is `open` yourself and skip anything else. A closed PR reached this way
52
+ would otherwise enter the sweep, which the `--state open` above rules out for
53
+ every other scope.
54
+
55
+ **Skip drafts.** A draft moves under you by design, so a review of one is
56
+ usually filed against a head nobody will ever see again.
57
+
58
+ The head sha is `headRefOid` from the list, or `head.sha` from the API.
59
+ Everything below keys on its first 12 characters.
60
+
61
+ ## 3. Decide what to review — read the artefact, not just its name
62
+
63
+ For each candidate, the artefact is:
64
+
65
+ ```text
66
+ .smithers/review/<pr>-<first 12 chars of head sha>.code.json
67
+ ```
68
+
69
+ **A file existing is not a review having happened.** Read it and branch on
70
+ `status`:
71
+
72
+ - **No file** → review it.
73
+ - **`"status": "reviewed"`** → skip. This head has been reviewed, whether it
74
+ found anything or not. Count it as `alreadyReviewed`.
75
+ - **`"status": "incomplete"`** → this is a review that could not finish — an API
76
+ call failed, the diff was unreadable, the PR moved twice. Retry it, **up to 3
77
+ attempts total**. Read its `attempts` field and **remember the number** — you
78
+ will need it in section 4, and it is about to be overwritten. An absent field
79
+ means 1. At 3 or more, skip it and count it as `abandoned`.
80
+
81
+ Treating `incomplete` as done is the failure this branch exists to prevent: one
82
+ transient API error would park that head forever, and the sweep would report a
83
+ clean pass over a PR nobody ever read. Treating it as never-attempted is the
84
+ opposite failure — an unreadable diff retried every five minutes for a week.
85
+
86
+ A force-push changes the head, so it changes the filename, so it gets a fresh
87
+ review with a fresh attempt count. You do not need to do anything about that.
88
+
89
+ ## 4. Review, up to the cap
90
+
91
+ Review the candidates in ascending PR number, invoking the **`pr-review`** skill
92
+ for each. **Stop after 3 reviews in one sweep** unless the card names a
93
+ different `cap:<n>`. Count the rest as `skippedByCap`; the next tick takes them.
94
+
95
+ The cap is a cost guard, not a queue-management nicety. Each review is a full
96
+ read of a diff and costs real money against a shared subscription, and a sweep
97
+ that finds thirty unreviewed PRs is exactly when you least want to run thirty
98
+ reviews back to back.
99
+
100
+ **After a retry, record the attempt — from the number you remembered, not from
101
+ the file.** If the artefact `pr-review` just wrote is `incomplete`, set its
102
+ `attempts` to **one more than the value you read in section 3** (which was 1 if
103
+ the field was absent), then move on.
104
+
105
+ `pr-review` overwrites the artefact: same filename, fresh body, no `attempts`
106
+ field. So "increment what is in the file" reads 1 every time, the count never
107
+ reaches 3, and an unreadable diff is retried every tick forever — the cap looking
108
+ like it works while being unreachable. The remembered number is the only one
109
+ that carries.
110
+
111
+ ### Do not read what the other reviewers said
112
+
113
+ Never read `/reviews`, `/comments`, `/issues/NUMBER/comments`, or any other
114
+ reviewer's findings, on any PR, at any point in this sweep.
115
+
116
+ Your review has to be worth comparing against another reviewer's on the same
117
+ commit, and a review that has read the other one is not evidence of anything.
118
+ This is easy to do by accident — the endpoints are one call away and they look
119
+ like context.
120
+
121
+ ## 5. Write the sweep summary — this is how anyone knows you ran
122
+
123
+ Every sweep writes a summary, including a sweep that reviewed nothing and a
124
+ sweep that refused.
125
+
126
+ Append one line to `.smithers/review/sweep-log.jsonl`, and overwrite
127
+ `.smithers/review/sweep-latest.json` with the same object:
128
+
129
+ ```json
130
+ {
131
+ "at": "2026-09-09T04:00:00Z",
132
+ "status": "swept",
133
+ "repo": "owner/name",
134
+ "scope": "label:obi-wan-review",
135
+ "cap": 3,
136
+ "open": 12,
137
+ "candidates": 4,
138
+ "alreadyReviewed": 2,
139
+ "reviewed": [{ "pr": 1234, "head": "abc123def456", "status": "reviewed", "findings": 2 }],
140
+ "abandoned": [],
141
+ "skippedByCap": 1,
142
+ "posted": 0
143
+ }
144
+ ```
145
+
146
+ `status` is `swept` or `refused`; a `refused` summary carries `reason` and omits
147
+ the sweep counts — **but still carries `"posted": 0`**, which is not one of them.
148
+ It is the field the whole phase is checked on, and a summary that may drop it is
149
+ a guarantee with a hole exactly where a refusal happened.
150
+
151
+ **Write it even when the answer is boring, and especially then.** A reviewer
152
+ that has quietly stopped working — a credential gone, the skill missing, an
153
+ account at its limit — posts nothing and files nothing, which is precisely what
154
+ a working reviewer looks like on a quiet day. The difference between the two is
155
+ that one of them wrote this file. `"reviewed": []` with `"candidates": 0` is a
156
+ healthy sweep. **No summary at all is the alarm.**
157
+
158
+ `posted` is always `0`. It is in the summary because a number that is always
159
+ zero is checkable, and a promise in prose is not.
160
+
161
+ ## 6. Report, and stop
162
+
163
+ Say which repo and scope you swept, how many PRs were in scope, how many you
164
+ reviewed, how many were already done, and anything you abandoned or capped.
165
+ Name the summary file.
166
+
167
+ Then stop. Do not post the findings. Do not open a review. Do not comment on any
168
+ PR. Reviews are published by a separate, gated step that reads these artefacts —
169
+ not by you, and not in this phase.
package/dist/bin/agt.js CHANGED
@@ -40,12 +40,12 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-RVXI7GZO.js";
43
+ } from "../chunk-52JZN5RZ.js";
44
44
  import {
45
45
  getProjectDir,
46
46
  isSessionResumeDisabled,
47
47
  readDirectChatSessionState
48
- } from "../chunk-PXDYKP5O.js";
48
+ } from "../chunk-AFOW32B6.js";
49
49
  import {
50
50
  AnchorSessionClient,
51
51
  CHANNEL_REGISTRY,
@@ -79,7 +79,7 @@ import {
79
79
  serializeManifestForSlackCli,
80
80
  sessionFileExists,
81
81
  sessionTranscriptDir
82
- } from "../chunk-JG3EAFZO.js";
82
+ } from "../chunk-ULLOPIPI.js";
83
83
  import "../chunk-XWVM4KPK.js";
84
84
 
85
85
  // src/bin/agt.ts
@@ -5467,7 +5467,7 @@ import { execFileSync, execSync } from "child_process";
5467
5467
  import { existsSync as existsSync11, realpathSync as realpathSync2 } from "fs";
5468
5468
  import chalk18 from "chalk";
5469
5469
  import ora16 from "ora";
5470
- var cliVersion = true ? "0.28.865" : "dev";
5470
+ var cliVersion = true ? "0.28.866" : "dev";
5471
5471
  async function fetchLatestVersion() {
5472
5472
  const host2 = getHost();
5473
5473
  if (!host2) return null;
@@ -6658,7 +6658,7 @@ function handleError(err) {
6658
6658
  }
6659
6659
 
6660
6660
  // src/bin/agt.ts
6661
- var cliVersion2 = true ? "0.28.865" : "dev";
6661
+ var cliVersion2 = true ? "0.28.866" : "dev";
6662
6662
  var program = new Command();
6663
6663
  program.name("agt").description("Augmented CLI \u2014 agent provisioning and management").version(cliVersion2).option("--json", "Emit machine-readable JSON output (suppress spinners and colors)").option("--skip-update-check", "Skip the automatic update check on startup");
6664
6664
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -16,7 +16,7 @@ import {
16
16
  parseEnvIntegrations,
17
17
  shellQuote,
18
18
  summarizeUnanswerablePane
19
- } from "./chunk-PXDYKP5O.js";
19
+ } from "./chunk-AFOW32B6.js";
20
20
  import {
21
21
  BIND_FAILURE_QUARANTINE_THRESHOLD,
22
22
  INTEGRATIONS_SECTION_END,
@@ -76,7 +76,7 @@ import {
76
76
  sessionTranscriptDir,
77
77
  worseConnectivityOutcome,
78
78
  wrapScheduledTaskPrompt
79
- } from "./chunk-JG3EAFZO.js";
79
+ } from "./chunk-ULLOPIPI.js";
80
80
  import {
81
81
  parsePsRows
82
82
  } from "./chunk-XWVM4KPK.js";
@@ -6728,7 +6728,7 @@ function exchangeFailureKind(err) {
6728
6728
  }
6729
6729
 
6730
6730
  // src/lib/api-client.ts
6731
- var agtCliVersion = true ? "0.28.865" : "dev";
6731
+ var agtCliVersion = true ? "0.28.866" : "dev";
6732
6732
  var lastConfigHash = null;
6733
6733
  function setConfigHash(hash) {
6734
6734
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -11338,4 +11338,4 @@ export {
11338
11338
  managerInstallSystemUnitCommand,
11339
11339
  managerUninstallSystemUnitCommand
11340
11340
  };
11341
- //# sourceMappingURL=chunk-RVXI7GZO.js.map
11341
+ //# sourceMappingURL=chunk-52JZN5RZ.js.map
@@ -18,7 +18,7 @@ import {
18
18
  rotateDailySession,
19
19
  sessionFileExists,
20
20
  todayLocalIso
21
- } from "./chunk-JG3EAFZO.js";
21
+ } from "./chunk-ULLOPIPI.js";
22
22
  import {
23
23
  reapOrphanChannelMcps
24
24
  } from "./chunk-XWVM4KPK.js";
@@ -5431,4 +5431,4 @@ export {
5431
5431
  stopAllSessionsAndWait,
5432
5432
  getProjectDir
5433
5433
  };
5434
- //# sourceMappingURL=chunk-PXDYKP5O.js.map
5434
+ //# sourceMappingURL=chunk-AFOW32B6.js.map
@@ -10126,7 +10126,9 @@ var OAUTH_PROVIDERS = {
10126
10126
  publicClient: true,
10127
10127
  mcpUrl: "https://mcp.kajabi.com/mcp",
10128
10128
  // Curated surface (matches the catalog seed's defined_scopes[].tools). Kajabi's
10129
- // live MCP advertises ~111 tools; the agent only needs these 28.
10129
+ // live MCP advertises ~111 tools; the agent only needs these 34.
10130
+ // (Was written as 28 and left stale when the four pages/themes tools landed
10131
+ // in ENG-7629's follow-up — recounted here rather than left to drift again.)
10130
10132
  // CS-1427: `enable_toolset` is included so an agent can activate its own
10131
10133
  // products/commerce + analytics toolsets on the connection (Kajabi gates those
10132
10134
  // tool groups behind a runtime toolset that returns "not active" until enabled).
@@ -10171,7 +10173,26 @@ var OAUTH_PROVIDERS = {
10171
10173
  "list_landing_pages",
10172
10174
  "get_landing_page",
10173
10175
  "update_landing_page",
10174
- "get_theme_content"
10176
+ "get_theme_content",
10177
+ // CS-1689: the write half of the two groups above. Every Kajabi write we
10178
+ // curate stopped at the email-content boundary — an agent could
10179
+ // create_sequence and get_theme_content but could not add an email to a
10180
+ // sequence or apply a theme edit, so any change to an EXISTING email had
10181
+ // to go back to the customer by hand.
10182
+ //
10183
+ // Both names are Kajabi's own, taken from the descriptions of tools we
10184
+ // already advertise rather than guessed: `create_sequence` says "Add
10185
+ // emails with add_sequence_email", and `create_broadcast` +
10186
+ // `get_theme_content` both say to "pair with update_theme_content to
10187
+ // apply changes". That sourcing matters here — a name the server does not
10188
+ // advertise is logged and SKIPPED by the proxy, so a wrong guess would
10189
+ // look applied and change nothing.
10190
+ //
10191
+ // No new catalog scope: these join the existing kajabi:emails and
10192
+ // kajabi:pages scopes, so already-connected sites do not need to
10193
+ // re-authorise to pick them up.
10194
+ "add_sequence_email",
10195
+ "update_theme_content"
10175
10196
  ],
10176
10197
  // CS-1446: Kajabi gates several tool groups behind a runtime `enable_toolset`
10177
10198
  // and does not advertise their tools in `tools/list` until the group is
@@ -14282,4 +14303,4 @@ export {
14282
14303
  peekCurrentSession,
14283
14304
  readDailySessionPin
14284
14305
  };
14285
- //# sourceMappingURL=chunk-JG3EAFZO.js.map
14306
+ //# sourceMappingURL=chunk-ULLOPIPI.js.map