@hwip/cli 0.1.18 → 0.1.20
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/installer.d.ts +3 -0
- package/dist/installer.js +6 -1
- package/dist/listener.d.ts +5 -0
- package/dist/listener.js +6 -2
- package/dist/transcript-tail.js +7 -3
- package/package.json +1 -1
package/dist/installer.d.ts
CHANGED
|
@@ -28,6 +28,9 @@ export declare const failedStepCount: () => number;
|
|
|
28
28
|
export declare const reportDetectedAgents: (agents: Agent[]) => void;
|
|
29
29
|
/** The install's last line. Exported for tests. */
|
|
30
30
|
export declare const closingLine: (failed: number) => string;
|
|
31
|
+
/** Where the install's last screen sends a new user for the phone app. `ct`/`utm_source` name this surface. */
|
|
32
|
+
export declare const APP_STORE_URL = "https://apps.apple.com/app/id6818053606?ct=cli-install";
|
|
33
|
+
export declare const PLAY_STORE_URL = "https://play.google.com/store/apps/details?id=app.hwip&referrer=utm_source%3Dcli-install";
|
|
31
34
|
/** Exported for tests (installGemini shells out to the real `gemini` binary,
|
|
32
35
|
* so the merge semantics can't be covered through it deterministically). */
|
|
33
36
|
export declare const mergeJsonFile: (filePath: string, patch: Record<string, unknown>) => void;
|
package/dist/installer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleInstall = exports.serviceInstallChoice = exports.collectCredentials = exports.unknownOnlyIds = exports.filterAgentsByIds = exports.AGENT_INSTALLERS = exports.firstStderrLine = exports.injectCodexMcpEntry = exports.injectMcpEntry = exports.addAiderReadDirective = exports.writeManagedRule = exports.mergeJsonFile = exports.closingLine = exports.reportDetectedAgents = exports.failedStepCount = exports.failMerge = exports.mergeFailureLines = exports.shouldReauth = void 0;
|
|
3
|
+
exports.handleInstall = exports.serviceInstallChoice = exports.collectCredentials = exports.unknownOnlyIds = exports.filterAgentsByIds = exports.AGENT_INSTALLERS = exports.firstStderrLine = exports.injectCodexMcpEntry = exports.injectMcpEntry = exports.addAiderReadDirective = exports.writeManagedRule = exports.mergeJsonFile = exports.PLAY_STORE_URL = exports.APP_STORE_URL = exports.closingLine = exports.reportDetectedAgents = exports.failedStepCount = exports.failMerge = exports.mergeFailureLines = exports.shouldReauth = void 0;
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
5
|
const os_1 = require("os");
|
|
6
6
|
const path_1 = require("path");
|
|
@@ -136,6 +136,9 @@ const closingLine = (failed) => {
|
|
|
136
136
|
return `Done, but ${steps} you: see the lines marked "-" above. Then restart your agents.`;
|
|
137
137
|
};
|
|
138
138
|
exports.closingLine = closingLine;
|
|
139
|
+
/** Where the install's last screen sends a new user for the phone app. `ct`/`utm_source` name this surface. */
|
|
140
|
+
exports.APP_STORE_URL = 'https://apps.apple.com/app/id6818053606?ct=cli-install';
|
|
141
|
+
exports.PLAY_STORE_URL = 'https://play.google.com/store/apps/details?id=app.hwip&referrer=utm_source%3Dcli-install';
|
|
139
142
|
/** An edit that would lose a comment of the user's names the file, like every other refusal. */
|
|
140
143
|
const namingFile = (filePath, edit) => {
|
|
141
144
|
try {
|
|
@@ -837,6 +840,8 @@ const handleInstall = async (args) => {
|
|
|
837
840
|
console.log('\n Testing connection...');
|
|
838
841
|
await testConnection(apiKey, baseUrl);
|
|
839
842
|
console.log(`\n ${(0, exports.closingLine)(failedSteps)}\n`);
|
|
843
|
+
console.log(` Get the app: ${exports.APP_STORE_URL}`);
|
|
844
|
+
console.log(` Android: ${exports.PLAY_STORE_URL}\n`);
|
|
840
845
|
// The single most-reported surprise: pushes are not scoped to `hwip cc`.
|
|
841
846
|
// Hooks fire for every session of every configured agent, so say it here —
|
|
842
847
|
// at the moment the hooks get installed — together with the volume dials.
|
package/dist/listener.d.ts
CHANGED
|
@@ -224,6 +224,11 @@ export type StaleConnectionAction =
|
|
|
224
224
|
export declare const staleConnectionAction: (message: unknown, drops: number) => StaleConnectionAction;
|
|
225
225
|
/** Each live run's first seq, for the report (Q24). A run that has recorded nothing yet has none. */
|
|
226
226
|
export declare const withRunSeqs: (sessions: AgentSession[], seqs?: Map<string, RunSeqs>) => AgentSession[];
|
|
227
|
+
/** What makes a cycle's inventory a change worth sending. lastActivityAt and
|
|
228
|
+
* stateChangedAt are left out: they move on every terminal output, and the
|
|
229
|
+
* server does not compare them either (REPORTED_SESSION_FIELDS). They reach
|
|
230
|
+
* the server with the next report that changes something else, or the
|
|
231
|
+
* heartbeat. */
|
|
227
232
|
export declare const sessionsFingerprint: (sessions: AgentSession[]) => string;
|
|
228
233
|
/** True when this cycle's inventory must be sent: it changed, or the
|
|
229
234
|
* idle heartbeat is due. */
|
package/dist/listener.js
CHANGED
|
@@ -302,12 +302,16 @@ const withRunSeqs = (sessions, seqs = (0, run_seqs_js_1.runSeqsByRun)()) => sess
|
|
|
302
302
|
return block ? { ...s, firstSeq: block.firstSeq } : s;
|
|
303
303
|
});
|
|
304
304
|
exports.withRunSeqs = withRunSeqs;
|
|
305
|
+
/** What makes a cycle's inventory a change worth sending. lastActivityAt and
|
|
306
|
+
* stateChangedAt are left out: they move on every terminal output, and the
|
|
307
|
+
* server does not compare them either (REPORTED_SESSION_FIELDS). They reach
|
|
308
|
+
* the server with the next report that changes something else, or the
|
|
309
|
+
* heartbeat. */
|
|
305
310
|
const sessionsFingerprint = (sessions) => sessions
|
|
306
311
|
.map((s) => JSON.stringify([
|
|
307
312
|
s.name, s.attached, s.agentKind, s.agentSessionId ?? null,
|
|
308
313
|
s.project, s.label ?? null, s.providerSessionName ?? null, s.providerSessionNameSource ?? null, s.providerSessionHandle ?? null, s.createdAt ?? null, s.runId ?? null, s.firstSeq ?? null,
|
|
309
|
-
s.
|
|
310
|
-
s.stateChangedAt ?? null, s.stateRuleId ?? null,
|
|
314
|
+
s.state ?? null, s.stateRuleId ?? null,
|
|
311
315
|
s.blockedPrompt?.id ?? null, s.blockedPrompt?.at ?? null,
|
|
312
316
|
]))
|
|
313
317
|
.sort()
|
package/dist/transcript-tail.js
CHANGED
|
@@ -507,6 +507,8 @@ const contentBlocks = (entry) => {
|
|
|
507
507
|
const SYNTHETIC_BLOCKS = /<(task-notification|system-reminder|local-command-caveat|local-command-stdout|command-message|command-name|command-args)>[\s\S]*?<\/\1>/g;
|
|
508
508
|
/** `<command-name>/simplify</command-name>` — the one wrapper worth keeping, as what it names. */
|
|
509
509
|
const COMMAND_NAME = /<command-name>([^<]*)<\/command-name>/;
|
|
510
|
+
/** `<command-args>prompt run</command-args>` — what the person typed after the command name. */
|
|
511
|
+
const COMMAND_ARGS = /<command-args>([\s\S]*?)<\/command-args>/;
|
|
510
512
|
/**
|
|
511
513
|
* Whether this entry is a person speaking.
|
|
512
514
|
*
|
|
@@ -577,10 +579,12 @@ const typedTextOf = (entry) => {
|
|
|
577
579
|
* separate feature, not a reason to ship the path.
|
|
578
580
|
*/
|
|
579
581
|
const stripAttachmentMarkers = (text) => {
|
|
580
|
-
const
|
|
582
|
+
const name = text.match(COMMAND_NAME)?.[1]?.trim();
|
|
583
|
+
const args = text.match(COMMAND_ARGS)?.[1]?.trim();
|
|
581
584
|
const body = text.replace(SYNTHETIC_BLOCKS, '');
|
|
582
|
-
// A slash command is a person's turn, and its name
|
|
583
|
-
// said — the wrapper around
|
|
585
|
+
// A slash command is a person's turn, and its name and arguments are the
|
|
586
|
+
// whole of what they said — the wrapper around them is not.
|
|
587
|
+
const command = name && args ? `${name} ${args}` : name;
|
|
584
588
|
const withCommand = command ? `${command}\n${body}` : body;
|
|
585
589
|
return withCommand.replace(/\[Image:[^\]]*\]/g, '').replace(/\n{3,}/g, '\n\n');
|
|
586
590
|
};
|