@dadado/agent-kit-cli 4.8.8 → 5.0.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/LICENSE CHANGED
@@ -1,21 +1,75 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 agent-kit-startup
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.
1
+ Required Notice: Copyright (c) 2026 agent-kit-startup
2
+
3
+ # PolyForm Noncommercial License 1.0.0
4
+
5
+ <https://polyformproject.org/licenses/noncommercial/1.0.0>
6
+
7
+ ## Acceptance
8
+
9
+ In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
10
+
11
+ ## Copyright License
12
+
13
+ The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
14
+
15
+ ## Distribution License
16
+
17
+ The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
18
+
19
+ ## Notices
20
+
21
+ You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
22
+
23
+ > Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
24
+
25
+ ## Changes and New Works License
26
+
27
+ The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
28
+
29
+ ## Patent License
30
+
31
+ The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
32
+
33
+ ## Noncommercial Purposes
34
+
35
+ Any noncommercial purpose is a permitted purpose.
36
+
37
+ ## Personal Uses
38
+
39
+ Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
40
+
41
+ ## Noncommercial Organizations
42
+
43
+ Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
44
+
45
+ ## Fair Use
46
+
47
+ You may have "fair use" rights for the software under the law. These terms do not limit them.
48
+
49
+ ## No Other Rights
50
+
51
+ These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
52
+
53
+ ## Patent Defense
54
+
55
+ If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
56
+
57
+ ## Violations
58
+
59
+ The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
60
+
61
+ ## No Liability
62
+
63
+ ***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
64
+
65
+ ## Definitions
66
+
67
+ The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
68
+
69
+ **You** refers to the individual or entity agreeing to these terms.
70
+
71
+ **Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
72
+
73
+ **Your licenses** are all the licenses granted to you for the software under these terms.
74
+
75
+ **Use** means anything you do with the software requiring one of your licenses.
package/README.md CHANGED
@@ -38,6 +38,23 @@ The panel binds to loopback by default, serves its own static files, and snapsho
38
38
 
39
39
  Older tags before 4.8.2 do not include those assets. Prefer a current pin, or point `MISSION_CONTROL_KIT_ROOT` / `AGENT_KIT_HOME` at an agent-kit checkout that contains `dashboard/`.
40
40
 
41
+ ## Bare invoke (welcome)
42
+
43
+ With no subcommand, `agent-kit` prints a branded Mission Kit welcome (ASCII helmet, version, and short utility hints) then exits. Technical identifiers stay `agent-kit` / `@dadado/agent-kit-cli`.
44
+
45
+ ```bash
46
+ agent-kit
47
+ # → welcome + hints (doctor, status, dashboard, init, --help)
48
+
49
+ agent-kit --help
50
+ # → grouped command list (SETUP / MISSION / DASHBOARD / INTEGRITY)
51
+
52
+ NO_COLOR=1 agent-kit
53
+ # → plain text (no ANSI); also plain when stdout is not a TTY or CI=1
54
+ ```
55
+
56
+ Subcommands and `agent-kit --version` are unchanged. Chat-only HITL flows (`/start-project`, `/git-staging`, `/git-prod`, `/run-plan-all`, backlog CRUD) are not CLI commands.
57
+
41
58
  ## Common commands
42
59
 
43
60
  | Command | Purpose |
@@ -21,6 +21,7 @@ import {
21
21
  MAX_AGENT_PROMPTS,
22
22
  MAX_GIT_ACTIVITY,
23
23
  MISSION_TIMING_LEDGER_REL,
24
+ SUBAGENT_TRANSCRIPT_FILE_RE,
24
25
  buildMissionControlView,
25
26
  collectDeferredCheckIds,
26
27
  collectReadinessPendingFromReport,
@@ -35,6 +36,7 @@ import {
35
36
  parseFlightLogLedger,
36
37
  parseHandoffMarkdown,
37
38
  parseMissionTimingLedger,
39
+ parseSubagentRun,
38
40
  serializeFlightLogLedger,
39
41
  serializeMissionTimingLedger,
40
42
  } from "./lib/semantic-model.mjs";
@@ -69,6 +71,12 @@ const MAX_REPORT_FILES = 20; // cap memory reads per snapshot
69
71
  const MAX_REPORT_BYTES = 512 * 1024; // skip oversized reports, degrade quietly
70
72
  const REPORT_RECENCY_MS = 90 * 24 * 60 * 60 * 1000; // 90-day recency window
71
73
 
74
+ // Task subagent run scan bounds (fs half of the lifecycle contract).
75
+ const MAX_SUBAGENT_PARENTS = 12; // cap parent chat directories walked per snapshot
76
+ const MAX_SUBAGENT_FILES = 24; // cap worker transcripts read per snapshot
77
+ const MAX_SUBAGENT_BYTES = 512 * 1024; // skip oversized transcripts, degrade quietly
78
+ const SUBAGENT_RECENCY_MS = 6 * 60 * 60 * 1000; // 6-hour window: live feed, not an archive
79
+
72
80
  /** Redact likely secrets in terminal output (paths-only git payload uses separate rules). */
73
81
  const SECRET_OUTPUT_PATTERNS = [
74
82
  /(?:API_KEY|SECRET|PASSWORD|TOKEN|PRIVATE_KEY)\s*=\s*\S+/gi,
@@ -794,6 +802,100 @@ function collectExternalReports() {
794
802
  return reports;
795
803
  }
796
804
 
805
+ /**
806
+ * Task subagent run scan (fs half of the lifecycle contract).
807
+ *
808
+ * Worker transcripts live beside the main chat transcript, at
809
+ * `~/.cursor/projects/<project-slug>/agent-transcripts/<parent>/subagents/<id>.jsonl`
810
+ * — the same store `collectAgentPrompts` walks, whose nested `subagents/`
811
+ * directories it deliberately skips so a worker question never masquerades as a
812
+ * user prompt. This scan reads only those nested files.
813
+ *
814
+ * Read-only and bounded: parents outside a 6-hour recency window are skipped
815
+ * (the Crew Monitor is a live feed, not an archive), at most
816
+ * MAX_SUBAGENT_PARENTS parent directories and MAX_SUBAGENT_FILES transcripts are
817
+ * read, oversized transcripts are skipped, and only the first and last records
818
+ * of each file are parsed — the phase decision needs the dispatch prompt and the
819
+ * terminal record, nothing between. A missing or unreadable store yields an
820
+ * empty list, never an error state. The phase/actor decision itself lives in
821
+ * `parseSubagentRun`.
822
+ */
823
+ function collectSubagentRuns() {
824
+ if (!withinSnapshotBudget(700)) return [];
825
+ const projectsDir = resolve(process.env.HOME || "~", ".cursor", "projects");
826
+ const slug = ROOT.replace(/\//g, "-").replace(/^-/, "");
827
+ const transcriptsDir = join(projectsDir, slug, "agent-transcripts");
828
+ if (!existsSync(transcriptsDir)) return [];
829
+
830
+ const runs = [];
831
+ try {
832
+ const now = Date.now();
833
+ const candidates = [];
834
+ for (const dirent of readdirSync(transcriptsDir, { withFileTypes: true })) {
835
+ if (!dirent.isDirectory()) continue;
836
+ const subDir = join(transcriptsDir, dirent.name, "subagents");
837
+ if (!existsSync(subDir)) continue;
838
+ let dirStat;
839
+ try {
840
+ dirStat = statSync(subDir);
841
+ } catch {
842
+ continue;
843
+ }
844
+ if (now - dirStat.mtimeMs > SUBAGENT_RECENCY_MS) continue;
845
+ candidates.push({ parentId: dirent.name, dir: subDir, mtime: dirStat.mtimeMs });
846
+ }
847
+ candidates.sort((a, b) => b.mtime - a.mtime);
848
+
849
+ const files = [];
850
+ for (const parent of candidates.slice(0, MAX_SUBAGENT_PARENTS)) {
851
+ let names;
852
+ try {
853
+ names = readdirSync(parent.dir);
854
+ } catch {
855
+ continue;
856
+ }
857
+ for (const name of names) {
858
+ const match = SUBAGENT_TRANSCRIPT_FILE_RE.exec(name);
859
+ if (!match) continue;
860
+ const file = join(parent.dir, name);
861
+ let stat;
862
+ try {
863
+ stat = statSync(file);
864
+ } catch {
865
+ continue;
866
+ }
867
+ if (!stat.isFile()) continue;
868
+ if (now - stat.mtimeMs > SUBAGENT_RECENCY_MS) continue;
869
+ if (stat.size > MAX_SUBAGENT_BYTES) continue;
870
+ files.push({ id: match[1], parentId: parent.parentId, file, mtime: stat.mtime });
871
+ }
872
+ }
873
+ files.sort((a, b) => b.mtime - a.mtime);
874
+
875
+ for (const candidate of files.slice(0, MAX_SUBAGENT_FILES)) {
876
+ let raw;
877
+ try {
878
+ raw = readFileSync(candidate.file, "utf-8");
879
+ } catch {
880
+ continue;
881
+ }
882
+ const lines = raw.split("\n").filter((l) => l.trim().length > 0);
883
+ if (lines.length === 0) continue;
884
+ const run = parseSubagentRun({
885
+ id: candidate.id,
886
+ parentId: candidate.parentId,
887
+ firstLine: lines[0],
888
+ lastLine: lines[lines.length - 1],
889
+ modifiedAt: candidate.mtime.toISOString(),
890
+ });
891
+ if (run) runs.push(run);
892
+ }
893
+ } catch {
894
+ return [];
895
+ }
896
+ return runs;
897
+ }
898
+
797
899
  // 14. Mission Control semantic view model (now / activity / attention)
798
900
  let readinessPending = [];
799
901
  const readinessPath = join(ROOT, ".cursor", "context", "readiness.json");
@@ -944,6 +1046,7 @@ function readPreviousInventory() {
944
1046
  deferredCheckIds: collectOnboardingDeferredCheckIds(),
945
1047
  agentPrompts: collectAgentPrompts(),
946
1048
  externalReports: collectExternalReports(),
1049
+ subagentRuns: collectSubagentRuns(),
947
1050
  dismissedIds: collectFieldReportDismissedIds(),
948
1051
  archivedPlanFiles,
949
1052
  agents: SNAPSHOT.agents,