carrick 0.3.143 → 0.3.145

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 (111) hide show
  1. package/README.md +1 -1
  2. package/bin/carrick.mjs +7 -7
  3. package/dist/auth/read.d.ts +0 -10
  4. package/dist/auth/read.js +3 -11
  5. package/dist/auth/read.js.map +1 -1
  6. package/dist/cli.d.ts +23 -20
  7. package/dist/cli.js +17 -32
  8. package/dist/cli.js.map +1 -1
  9. package/dist/contract.d.ts +54 -0
  10. package/dist/contract.js +14 -0
  11. package/dist/contract.js.map +1 -1
  12. package/dist/hook/checked.d.ts +11 -0
  13. package/dist/hook/checked.js +44 -0
  14. package/dist/hook/checked.js.map +1 -0
  15. package/dist/hook/edited.d.ts +22 -0
  16. package/dist/hook/edited.js +84 -0
  17. package/dist/hook/edited.js.map +1 -0
  18. package/dist/hook/invoker.d.ts +7 -0
  19. package/dist/hook/invoker.js +18 -0
  20. package/dist/hook/invoker.js.map +1 -0
  21. package/dist/hook/late.d.ts +8 -0
  22. package/dist/hook/late.js +60 -0
  23. package/dist/hook/late.js.map +1 -0
  24. package/dist/hook/post-edit.d.ts +0 -22
  25. package/dist/hook/post-edit.js +78 -126
  26. package/dist/hook/post-edit.js.map +1 -1
  27. package/dist/hook/post-read.js +19 -9
  28. package/dist/hook/post-read.js.map +1 -1
  29. package/dist/hook/probe.d.ts +15 -0
  30. package/dist/hook/probe.js +41 -0
  31. package/dist/hook/probe.js.map +1 -0
  32. package/dist/hook/recheck-run.d.ts +2 -0
  33. package/dist/hook/recheck-run.js +28 -0
  34. package/dist/hook/recheck-run.js.map +1 -0
  35. package/dist/hook/rechecks.d.ts +108 -0
  36. package/dist/hook/rechecks.js +537 -0
  37. package/dist/hook/rechecks.js.map +1 -0
  38. package/dist/hook/refresh.d.ts +1 -0
  39. package/dist/hook/refresh.js +1 -1
  40. package/dist/hook/refresh.js.map +1 -1
  41. package/dist/hook/reuse.d.ts +25 -5
  42. package/dist/hook/reuse.js +61 -14
  43. package/dist/hook/reuse.js.map +1 -1
  44. package/dist/hook/session-start.js +14 -0
  45. package/dist/hook/session-start.js.map +1 -1
  46. package/dist/hook/stop-wait.d.ts +17 -0
  47. package/dist/hook/stop-wait.js +120 -0
  48. package/dist/hook/stop-wait.js.map +1 -0
  49. package/dist/hook/stop.js +14 -3
  50. package/dist/hook/stop.js.map +1 -1
  51. package/dist/hook/user-prompt.js +6 -3
  52. package/dist/hook/user-prompt.js.map +1 -1
  53. package/dist/init/agents-section.d.ts +18 -4
  54. package/dist/init/agents-section.js +66 -18
  55. package/dist/init/agents-section.js.map +1 -1
  56. package/dist/init/connect.d.ts +6 -107
  57. package/dist/init/connect.js +7 -318
  58. package/dist/init/connect.js.map +1 -1
  59. package/dist/init/doctor.d.ts +8 -71
  60. package/dist/init/doctor.js +37 -223
  61. package/dist/init/doctor.js.map +1 -1
  62. package/dist/init/hosted.d.ts +7 -7
  63. package/dist/init/hosted.js +8 -10
  64. package/dist/init/hosted.js.map +1 -1
  65. package/dist/init/outdated.d.ts +11 -0
  66. package/dist/init/outdated.js +1 -1
  67. package/dist/init/outdated.js.map +1 -1
  68. package/dist/init/output.d.ts +0 -55
  69. package/dist/init/output.js +0 -142
  70. package/dist/init/output.js.map +1 -1
  71. package/dist/init/projects.d.ts +3 -200
  72. package/dist/init/projects.js +22 -352
  73. package/dist/init/projects.js.map +1 -1
  74. package/dist/init/remove.js +4 -5
  75. package/dist/init/remove.js.map +1 -1
  76. package/dist/init/repos.d.ts +25 -53
  77. package/dist/init/repos.js +28 -65
  78. package/dist/init/repos.js.map +1 -1
  79. package/dist/init/run.d.ts +52 -212
  80. package/dist/init/run.js +252 -988
  81. package/dist/init/run.js.map +1 -1
  82. package/dist/init/self-update.d.ts +18 -0
  83. package/dist/init/self-update.js +147 -0
  84. package/dist/init/self-update.js.map +1 -0
  85. package/dist/init/settings.d.ts +2 -0
  86. package/dist/init/settings.js +13 -2
  87. package/dist/init/settings.js.map +1 -1
  88. package/dist/init/task-skills.d.ts +1 -0
  89. package/dist/init/task-skills.js +1 -1
  90. package/dist/init/task-skills.js.map +1 -1
  91. package/dist/render.d.ts +24 -6
  92. package/dist/render.js +133 -42
  93. package/dist/render.js.map +1 -1
  94. package/dist/templates.d.ts +1 -6
  95. package/dist/templates.js +4 -14
  96. package/dist/templates.js.map +1 -1
  97. package/package.json +6 -6
  98. package/plugin/.claude-plugin/plugin.json +1 -1
  99. package/plugin/hooks/hooks.json +3 -2
  100. package/sidecar/dist/src/capture/api.d.ts +2 -2
  101. package/sidecar/dist/src/capture/deno-project.js +5 -1
  102. package/sidecar/dist/src/index.js +1 -1
  103. package/sidecar/dist/src/library-claims.d.ts +4 -0
  104. package/sidecar/dist/src/library-claims.js +2 -2
  105. package/sidecar/dist/src/project-loader.js +9 -2
  106. package/sidecar/dist/src/type-inferrer.d.ts +17 -2
  107. package/sidecar/dist/src/type-inferrer.js +59 -16
  108. package/sidecar/dist/src/types.d.ts +26 -0
  109. package/sidecar/dist/src/validators.d.ts +6 -0
  110. package/sidecar/dist/src/validators.js +2 -0
  111. package/templates/carrick.json +0 -7
@@ -1 +1 @@
1
- {"version":3,"file":"stop.js","sourceRoot":"","sources":["../../src/hook/stop.ts"],"names":[],"mappings":";AACA,yEAAyE;AACzE,EAAE;AACF,yEAAyE;AACzE,wEAAwE;AACxE,4EAA4E;AAC5E,8EAA8E;AAC9E,4EAA4E;AAC5E,8EAA8E;AAC9E,wEAAwE;AACxE,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,uEAAuE;AACvE,4EAA4E;AAC5E,yDAAyD;AACzD,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,4EAA4E;AAC5E,0EAA0E;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EA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B,OAAO,sCAAsC,CAAC,CAAC;;QACrF,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAE7B,yEAAyE;IACzE,0EAA0E;IAC1E,wEAAwE;IACxE,wDAAwD;IACxD,MAAM,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,wBAAwB,CAAC,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;IACzF,IAAI,QAAQ;QAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAEnC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAC/B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACnD,IAAI,MAAM;QAAE,GAAG,CAAC,SAAS,MAAM,CAAC,KAAK,qCAAqC,MAAM,CAAC,KAAK,WAAW,CAAC,CAAC;AACrG,CAAC;AAED,MAAM,IAAI,EAAE,CAAC;AACb,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC"}
@@ -24,6 +24,7 @@
24
24
  // Reference: `docs/reference/task-skills.md`, "The reuse nudge".
25
25
  import { createLogger } from "../log.js";
26
26
  import { resolveChannel } from "../channel.js";
27
+ import { deliverLate } from "./late.js";
27
28
  import { drain } from "./reuse.js";
28
29
  import { initialisedRoot, throttledVersionMismatch } from "../init/outdated.js";
29
30
  import { currentVersion } from "../update.js";
@@ -68,15 +69,17 @@ async function main() {
68
69
  log("no session id in the payload; nothing to look up");
69
70
  return;
70
71
  }
71
- const spoken = drain(session);
72
- const parts = [];
72
+ // Finished background re-checks first (Codex has no Stop to carry them),
73
+ // then the reuse nudge, which is about what the whole task added.
74
+ const parts = [...deliverLate(session)];
75
+ const root = initialisedRoot(process.env["CLAUDE_PROJECT_DIR"] ?? process.cwd());
76
+ const spoken = drain(session, root);
73
77
  if (spoken === null)
74
78
  log(`nothing new in ${session}: everything recorded has been named`);
75
79
  else
76
80
  parts.push(spoken.line);
77
81
  // The same backstop the other hooks carry: this `carrick` is not the one
78
82
  // that set this workspace up (carrick#1372), once a day per workspace.
79
- const root = initialisedRoot(process.env["CLAUDE_PROJECT_DIR"] ?? process.cwd());
80
83
  const mismatch = root === null ? null : throttledVersionMismatch(root, currentVersion());
81
84
  if (mismatch)
82
85
  parts.push(mismatch);
@@ -1 +1 @@
1
- {"version":3,"file":"user-prompt.js","sourceRoot":"","sources":["../../src/hook/user-prompt.ts"],"names":[],"mappings":";AACA,mEAAmE;AACnE,EAAE;AACF,0EAA0E;AAC1E,6EAA6E;AAC7E,8CAA8C;AAC9C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,4EAA4E;AAC5E,6EAA6E;AAC7E,gFAAgF;AAChF,6EAA6E;AAC7E,wCAAwC;AACxC,EAAE;AACF,gFAAgF;AAChF,8EAA8E;AAC9E,2EAA2E;AAC3E,gEAAgE;AAChE,EAAE;AACF,+EAA+E;AAC/E,8BAA8B;AAC9B,EAAE;AACF,iEAAiE;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,GAAG,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAAC;AAMhD,KAAK,UAAU,SAAS;IACtB,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,OAAO,CAAC,KAAK;QAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACzE,OAAO,MAAM,CAAC,MAA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T,CAAC;IAED,yEAAyE;IACzE,kEAAkE;IAClE,MAAM,KAAK,GAAa,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;IAClD,MAAM,IAAI,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACjF,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACpC,IAAI,MAAM,KAAK,IAAI;QAAE,GAAG,CAAC,kBAAkB,OAAO,sCAAsC,CAAC,CAAC;;QACrF,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAE7B,yEAAyE;IACzE,uEAAuE;IACvE,MAAM,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,wBAAwB,CAAC,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;IACzF,IAAI,QAAQ;QAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAEnC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAC/B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACnD,IAAI,MAAM;QAAE,GAAG,CAAC,SAAS,MAAM,CAAC,KAAK,qCAAqC,MAAM,CAAC,KAAK,WAAW,CAAC,CAAC;AACrG,CAAC;AAED,MAAM,IAAI,EAAE,CAAC;AACb,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC"}
@@ -1,8 +1,22 @@
1
+ import { type SkillScope } from "./task-skills.ts";
1
2
  export declare const AGENTS_FILE = "AGENTS.md";
2
- /** The section as written, markers included. Ends in one newline. */
3
- export declare const CHECK_SECTION: string;
3
+ /** What init knows of the workspace when it writes the section. */
4
+ export type WorkspaceCounts = {
5
+ repos: number;
6
+ services: number;
7
+ };
8
+ /**
9
+ * The section as written, markers included. Ends in one newline.
10
+ *
11
+ * The words are the rules block measured in carrick-cloud#2991 (21 graded runs
12
+ * per arm on one build: reused 17/21 against 5/21), plus rule 5's contract
13
+ * sentence: without it agents ran `check --changed` on 0 of 7 tasks that add a
14
+ * call to another service, against 6 of 7 on the previous section. Only the
15
+ * counts and the scope clause vary; edit nothing else without a new measurement.
16
+ */
17
+ export declare function renderCheckSection(scope: SkillScope, counts: WorkspaceCounts | null): string;
4
18
  /** The body with our section written in: replaced where it is, appended where it is not. */
5
- export declare function withCheckSection(existing: string | null): string;
19
+ export declare function withCheckSection(existing: string | null, section: string): string;
6
20
  /** The body with our section taken out; `empty` where nothing else was in it. */
7
21
  export declare function withoutCheckSection(existing: string): {
8
22
  body: string;
@@ -10,7 +24,7 @@ export declare function withoutCheckSection(existing: string): {
10
24
  empty: boolean;
11
25
  };
12
26
  /** Write our section into the folder's AGENTS.md. */
13
- export declare function writeAgentsSection(workspace: string): "written" | "unchanged";
27
+ export declare function writeAgentsSection(workspace: string, scope: SkillScope, counts: WorkspaceCounts | null): "written" | "unchanged";
14
28
  /** True where the folder's AGENTS.md holds our section. */
15
29
  export declare function hasAgentsSection(workspace: string): boolean;
16
30
  /** Take our section out. The file goes too only where nothing else was in it. */
@@ -1,4 +1,4 @@
1
- // The "Carrick check" section `carrick init` keeps in a folder's AGENTS.md
1
+ // The Carrick rules section `carrick init` keeps in a folder's AGENTS.md
2
2
  // (carrick#2828), so an agent in Codex or Claude Code runs the local check
3
3
  // before it says a change is done.
4
4
  //
@@ -8,23 +8,71 @@
8
8
  // the file is somebody's and is never read for meaning. The file is created
9
9
  // when it is missing, and deleted again on remove only when our section was
10
10
  // all it held.
11
- //
12
- // carrick-cloud's scaffold (cloud#2289) must write this same block.
13
11
  import fs from "node:fs";
14
12
  import path from "node:path";
15
13
  import { writeIfChanged } from "./files.js";
14
+ import { scopeArgument } from "./task-skills.js";
16
15
  export const AGENTS_FILE = "AGENTS.md";
17
16
  const START = "<!-- carrick:check start -->";
18
17
  const END = "<!-- carrick:check end -->";
19
- /** The section as written, markers included. Ends in one newline. */
20
- export const CHECK_SECTION = [
21
- START,
22
- "## Carrick check",
23
- "",
24
- "Before you say a change is done, run `carrick check --changed` alongside the tests. The per-edit check covers only the file each edit touched; `check --changed` checks every changed file on this branch against the other services. It can take a few minutes: allow up to five. Then tell the user in one line what Carrick checked and found (for example \"Carrick checked 3 changed files against 35 services: no contract problems\"). If it exits non-zero, fix what it reports, or say why it is wrong. When you added functions, use the carrick-reuse skill on them.",
25
- END,
26
- "",
27
- ].join("\n");
18
+ /** "three repositories, 43 services" as the section says it; null where init has no count to give. */
19
+ function countsPhrase(counts) {
20
+ if (counts === null || counts.repos < 1 || counts.services < 1)
21
+ return null;
22
+ const repos = counts.repos === 1 ? "one repository" : `${counts.repos} repositories`;
23
+ const services = counts.services === 1 ? "1 service" : `${counts.services} services`;
24
+ return `${repos}, ${services}`;
25
+ }
26
+ /**
27
+ * The section as written, markers included. Ends in one newline.
28
+ *
29
+ * The words are the rules block measured in carrick-cloud#2991 (21 graded runs
30
+ * per arm on one build: reused 17/21 against 5/21), plus rule 5's contract
31
+ * sentence: without it agents ran `check --changed` on 0 of 7 tasks that add a
32
+ * call to another service, against 6 of 7 on the previous section. Only the
33
+ * counts and the scope clause vary; edit nothing else without a new measurement.
34
+ */
35
+ export function renderCheckSection(scope, counts) {
36
+ const phrase = countsPhrase(counts);
37
+ const indexed = phrase === null ? "This workspace is indexed by Carrick." : `This workspace (${phrase}) is indexed by Carrick.`;
38
+ return [
39
+ START,
40
+ "## Carrick: use it while you work, not only at the end",
41
+ "",
42
+ `${indexed} The`,
43
+ "`mcp__carrick__*` tools answer questions about code outside the file you are",
44
+ "editing more completely than grep: across every service and every protocol",
45
+ "(HTTP routes, socket events, pub/sub topics), including callers reached through",
46
+ "SDKs, wrappers, client instances and untyped helpers that share no searchable",
47
+ `name with what you changed. Pass \`${scopeArgument(scope)}\` on every Carrick`,
48
+ "call.",
49
+ "",
50
+ "1. Before you write a new function, helper or utility, call `search_by_intent`",
51
+ " (or `find_similar`) with a plain-English description of what it does. If",
52
+ " something in any package already does the job, or most of it, import it and",
53
+ " call it instead of writing your own. When the task names a new function or",
54
+ " file, still create it, but make its body call the existing function and add",
55
+ " only what the existing one lacks. Never leave a second copy of logic that",
56
+ " already exists.",
57
+ "2. Before you change a route, a request or response shape, an event payload or",
58
+ " an exported function, call `get_operation` (method and path, or the event or",
59
+ " topic name) or `get_callers`, and update or explicitly clear every consumer",
60
+ " it lists, in every repository.",
61
+ "3. Before you write code that calls another service's endpoint or handles its",
62
+ " event, call `get_endpoint_types` (or `get_contract_pair`) and use the real",
63
+ " request and response types it returns. Never take a shape from the ticket, a",
64
+ " similar endpoint or another API version, or a local copy of a type.",
65
+ "4. Use grep and Read to confirm and to read code once Carrick has told you",
66
+ " where to look.",
67
+ "5. After you edit a file, run `carrick check <file>` on that one file (one",
68
+ " file per call). When your change touches a route, a call to another service,",
69
+ " an event or a type another service reads, run `carrick check --changed`",
70
+ " before you say it is done. In your final summary,",
71
+ " say what Carrick found and what you changed because of it.",
72
+ END,
73
+ "",
74
+ ].join("\n");
75
+ }
28
76
  /** The span of our section in a body, end included; null where there is none. */
29
77
  function span(body) {
30
78
  const from = body.indexOf(START);
@@ -37,14 +85,14 @@ function span(body) {
37
85
  return { from, to: body[after] === "\n" ? after + 1 : after };
38
86
  }
39
87
  /** The body with our section written in: replaced where it is, appended where it is not. */
40
- export function withCheckSection(existing) {
88
+ export function withCheckSection(existing, section) {
41
89
  if (existing === null || existing.trim() === "")
42
- return CHECK_SECTION;
90
+ return section;
43
91
  const found = span(existing);
44
92
  if (found !== null)
45
- return existing.slice(0, found.from) + CHECK_SECTION + existing.slice(found.to);
93
+ return existing.slice(0, found.from) + section + existing.slice(found.to);
46
94
  const lf = existing.endsWith("\n") ? existing : `${existing}\n`;
47
- return `${lf}\n${CHECK_SECTION}`;
95
+ return `${lf}\n${section}`;
48
96
  }
49
97
  /** The body with our section taken out; `empty` where nothing else was in it. */
50
98
  export function withoutCheckSection(existing) {
@@ -60,10 +108,10 @@ export function withoutCheckSection(existing) {
60
108
  return { body, changed: true, empty: body.trim() === "" };
61
109
  }
62
110
  /** Write our section into the folder's AGENTS.md. */
63
- export function writeAgentsSection(workspace) {
111
+ export function writeAgentsSection(workspace, scope, counts) {
64
112
  const target = path.join(workspace, AGENTS_FILE);
65
113
  const existing = fs.existsSync(target) ? fs.readFileSync(target, "utf8") : null;
66
- return writeIfChanged(target, withCheckSection(existing));
114
+ return writeIfChanged(target, withCheckSection(existing, renderCheckSection(scope, counts)));
67
115
  }
68
116
  /** True where the folder's AGENTS.md holds our section. */
69
117
  export function hasAgentsSection(workspace) {
@@ -1 +1 @@
1
- {"version":3,"file":"agents-section.js","sourceRoot":"","sources":["../../src/init/agents-section.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,2EAA2E;AAC3E,mCAAmC;AACnC,EAAE;AACF,4EAA4E;AAC5E,2EAA2E;AAC3E,+EAA+E;AAC/E,4EAA4E;AAC5E,4EAA4E;AAC5E,eAAe;AACf,EAAE;AACF,oEAAoE;AAEpE,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAC;AAEvC,MAAM,KAAK,GAAG,8BAA8B,CAAC;AAC7C,MAAM,GAAG,GAAG,4BAA4B,CAAC;AAEzC,qEAAqE;AACrE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,KAAK;IACL,kBAAkB;IAClB,EAAE;IACF,ijBAAijB;IACjjB,GAAG;IACH,EAAE;CACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,iFAAiF;AACjF,SAAS,IAAI,CAAC,IAAY;IACxB,MAAM,IAAI,GAAG,IAAI,CAAC,O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E,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC;AACjF,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,mBAAmB,CAAC,SAAiB;IACnD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IACjD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IACxC,MAAM,OAAO,GAAG,mBAAmB,CAAC,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACrE,IAAI,CAAC,OAAO,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAClC,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAClB,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
@@ -1,110 +1,9 @@
1
- import { type ResolvedRepos } from "../auth/read.ts";
2
- import { type AssignOutcome } from "./projects.ts";
3
- import type { StepProgress, StepReport } from "./output.ts";
4
1
  /**
5
- * Show a status that updates in place while `work` runs, then its report.
2
+ * The dashboard page init sends a reader to: where a workspace's repos are
3
+ * added, and where each one shows how far its index has got.
6
4
  *
7
- * `InitOutput.step` in a run: a spinner on a terminal, one line per change on
8
- * a pipe. The default is the pipe's behaviour, for a caller with no output.
5
+ * The only page there is to send anyone to. Repos join the workspace through
6
+ * the GitHub App and the dashboard, never from this command, because the
7
+ * config and the index are Carrick's (carrick#3361).
9
8
  */
10
- export type Track = <T>(label: string, work: (progress: StepProgress) => Promise<T>, report: (value: T) => StepReport) => Promise<T>;
11
- type ConnectOptions = {
12
- interactive: boolean;
13
- say: (message: string) => void;
14
- project?: string;
15
- /** True when this run has already seen or created the project (carrick#955). */
16
- projectExists?: boolean;
17
- /**
18
- * The repos this run may take OUT of another project, lowercased.
19
- *
20
- * A move changes what every agent querying either project can see, so it is
21
- * named in the proposal and consented to there; this set is that consent
22
- * arriving (carrick#1338). A repo that was not connected at all when the
23
- * proposal was read is in it too: the App grant lands it in the workspace's
24
- * default project seconds later, and placing it where the run asked for is
25
- * the grant finishing rather than a move out of a project anyone chose.
26
- */
27
- movable?: Set<string>;
28
- /**
29
- * The movable repos whose move is said, lowercased: the ones in a project
30
- * somebody chose. A repo the App grant has just put in the default project
31
- * moves silently, because nobody chose where it was (carrick#1489).
32
- */
33
- announce?: Set<string>;
34
- /** How a project is printed: display name beside slug, where one is known. */
35
- label?: (slug: string) => string;
36
- /**
37
- * True where the workspace read says the signed-in user is a member, not an
38
- * owner or an admin. Only they are told who can finish a browser step: an
39
- * owner told to go and find an owner was the line in carrick#1512.
40
- */
41
- member?: boolean;
42
- /** How to run init again, for the member's line: "run carrick init in ~/shop again". */
43
- again?: string;
44
- open?: (url: string) => Promise<boolean>;
45
- poll?: (signal?: AbortSignal) => Promise<ResolvedRepos>;
46
- /** Placing repos in the project, injected so tests state the server (carrick#999). */
47
- assign?: (repos: string[], signal?: AbortSignal) => Promise<AssignOutcome>;
48
- wait?: (signal: AbortSignal) => Promise<void>;
49
- /** The live status line the wait is shown on (carrick#1489). */
50
- track?: Track;
51
- signal?: AbortSignal;
52
- };
53
- /**
54
- * The line before a member's wait.
55
- *
56
- * What is waited on is a page in the Carrick dashboard, and both of them —
57
- * the App grant and the Repos page — refuse anyone who is not an owner or an
58
- * admin of the workspace. Waiting thirty minutes on a page you may not use is
59
- * the friction this says out loud (carrick#993), to the members it is true of
60
- * (carrick#1512). `again` is how to run init again, which names the folder
61
- * when the run set up the one above where it started.
62
- */
63
- export declare function adminWait(again?: string): string;
64
- /** The dashboard pages init sends a reader to, for one workspace. */
65
- export declare function workspaceUrls(slug: string): {
66
- connect: string;
67
- projects: string;
68
- repos: string;
69
- };
70
- /** Every requested repo must be present, connected, and assigned to this project. */
71
- export declare function reposAreInProject(identity: ResolvedRepos, repos: string[], project: string): boolean;
72
- /**
73
- * The project each requested repo is in, in the order they were requested,
74
- * with null for one this workspace does not hold.
75
- *
76
- * The project step reads this before it asks anything: a repo that is already
77
- * in a project answers the question on its own (carrick#987).
78
- */
79
- export declare function projectAssignments(identity: ResolvedRepos, repos: string[]): Array<string | null>;
80
- /** The requested repos this read says are not connected, as the server spells them. */
81
- export declare function unconnectedRepos(identity: ResolvedRepos, repos: string[]): string[];
82
- /**
83
- * The line that sends a reader to the GitHub App, naming the repos it is for,
84
- * for a run that cannot open the page itself: one with no terminal, and one
85
- * whose wait was stopped with the grant still to do. Printed only for repos a
86
- * read taken just now says are unconnected: the grant page re-asks GitHub for
87
- * the whole repo list, which is wasted on a repo that is already connected
88
- * (carrick#1489).
89
- */
90
- export declare function connectLine(unconnected: string[], total: number, url: string): string;
91
- /**
92
- * The GitHub App grant is the only browser step; the CLI places the repos.
93
- *
94
- * Assignment is a server action on this credential (carrick#999), tried for
95
- * every connected repo the moment the poll sees it, so nobody has to open the
96
- * Repos page and move it by hand. An API that does not serve the action yet
97
- * answers an absence, and the browser instruction is what it falls back to.
98
- * Ctrl-C stops verification.
99
- *
100
- * What it prints is the state and the next step, not the traffic
101
- * (carrick#1489): the wait is one status line that updates in place, a move
102
- * the run was allowed to make is not announced (the first one out of an
103
- * untouched default project is the App grant finishing, not a decision), and
104
- * a repo gets a line of its own only when something about it failed.
105
- *
106
- * `initial` must be a read taken just before this call: it decides which
107
- * repos are sent to the grant page and whether there is anything to wait for.
108
- */
109
- export declare function connectRepos(token: string, repos: string[], initial: ResolvedRepos, options: ConnectOptions): Promise<ResolvedRepos>;
110
- export {};
9
+ export declare function reposUrl(slug: string): string;