@groundtrack/hooks 0.1.20 → 0.1.22
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/dist/setup/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { connectAgents, connectionPrompt, formatNextSteps, prepareConnections, } from "./connections.js";
|
|
1
|
+
import { connectAgents, connectionPrompt, formatNextSteps, prepareConnections, sessionImportPrompt, } from "./connections.js";
|
|
2
2
|
import { AGENT_IDS, requiresHookRuntime } from "../agents.js";
|
|
3
3
|
import { spawn, spawnSync } from "node:child_process";
|
|
4
4
|
import { basename, join } from "node:path";
|
|
@@ -397,6 +397,7 @@ export async function runCli(argv) {
|
|
|
397
397
|
connections = connections.map((connection) => results.find((result) => result.agent === connection.agent) ?? connection);
|
|
398
398
|
}
|
|
399
399
|
process.stdout.write(formatNextSteps(ready, context, connections));
|
|
400
|
+
process.stdout.write(sessionImportPrompt(ready, context, args.url));
|
|
400
401
|
}
|
|
401
402
|
process.exitCode = localReady && !signInFailed ? 0 : 1;
|
|
402
403
|
}
|
|
@@ -25,5 +25,6 @@ export type Connection = {
|
|
|
25
25
|
export declare const runClient: ClientRunner;
|
|
26
26
|
export declare function prepareConnections(agents: AgentPlan[], context: SetupEnvironment, url: string, runner?: ClientRunner): Promise<Connection[]>;
|
|
27
27
|
export declare function connectionPrompt(agents: AgentPlan[]): string;
|
|
28
|
+
export declare function sessionImportPrompt(agents: AgentPlan[], context: SetupEnvironment, url: string): string;
|
|
28
29
|
export declare function connectAgents(connections: Connection[], context: SetupEnvironment, runner?: ClientRunner, onStart?: (agent: Agent) => void): Promise<Connection[]>;
|
|
29
30
|
export declare function formatNextSteps(agents: AgentPlan[], context: SetupEnvironment, connections?: Connection[]): string;
|
|
@@ -171,6 +171,18 @@ export function connectionPrompt(agents) {
|
|
|
171
171
|
const names = new Intl.ListFormat("en", { style: "long", type: "conjunction" }).format(agents.map((agent) => agent.name));
|
|
172
172
|
return `Connect Groundtrack to ${names} now?`;
|
|
173
173
|
}
|
|
174
|
+
export function sessionImportPrompt(agents, context, url) {
|
|
175
|
+
return [
|
|
176
|
+
"",
|
|
177
|
+
"Optional session import — paste this into a configured agent:",
|
|
178
|
+
"For each selected agent still needing sign-in, follow its step above and start that client's documented login flow in an interactive terminal; do not just list the command. Let me complete OAuth, and ask for project or hook approval separately when needed. Never bypass those prompts. If interactive login cannot be started, tell me what is blocking it.",
|
|
179
|
+
`Verify Groundtrack's connection and hook context with search_experiences when available. Then preview sessions for these already-selected agents from ${context.repoDir}. Run the local previews even if sign-in or hook approval is still pending; the dry run needs neither.`,
|
|
180
|
+
...agents.map((agent) => ` npx --yes --package @groundtrack/hooks@latest groundtrack import --agent ${agent.agent} --dry-run --url ${url}`),
|
|
181
|
+
"Use only the previews' reported session counts, repository/date scope, locally sanitized upload size, and skipped or unreadable counts. Explain that Groundtrack may analyze imported sessions for past discoveries, corrections, repository constraints, recurring friction, and possible follow-up initiatives; do not claim lessons exist before analysis.",
|
|
182
|
+
"Transcripts are private by default; high-confidence derived lessons may enter shared organizational knowledge. Ask whether I want to import and wait for yes; setup's --yes is not import approval. Once I say yes in chat, include --yes on each approved upload command to skip the CLI's duplicate confirmation; it is not a substitute for approval. Use an OAuth-minted temporary import key via the process environment only; never expose it in chat, arguments, files, or logs. After upload, share its sessions/results link and note that analysis for experiences and draft initiatives happens asynchronously.",
|
|
183
|
+
"",
|
|
184
|
+
].join("\n");
|
|
185
|
+
}
|
|
174
186
|
export async function connectAgents(connections, context, runner = runClient, onStart = () => { }) {
|
|
175
187
|
const results = [];
|
|
176
188
|
for (const connection of connections) {
|