jeopi-cli 16.6.11 → 16.6.13
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/CHANGELOG.md +22 -0
- package/README.md +34 -9
- package/dist/cli.js +3662 -3649
- package/dist/types/cli/update-cli.d.ts +9 -0
- package/dist/types/main.d.ts +1 -1
- package/dist/types/messenger/activity.d.ts +7 -0
- package/dist/types/messenger/artifacts.d.ts +12 -0
- package/dist/types/messenger/gateway.d.ts +5 -1
- package/dist/types/messenger/live-session.d.ts +4 -0
- package/dist/types/messenger/types.d.ts +18 -1
- package/dist/types/session/agent-session.d.ts +3 -1
- package/package.json +12 -12
- package/src/cli/update-cli.ts +13 -3
- package/src/extensibility/plugins/legacy-pi-bundled-keys.ts +2 -0
- package/src/extensibility/plugins/legacy-pi-bundled-registry.ts +8 -0
- package/src/internal-urls/docs-index.generated.txt +1 -1
- package/src/main.ts +12 -2
- package/src/messenger/activity.ts +24 -0
- package/src/messenger/artifacts.ts +167 -0
- package/src/messenger/config.ts +14 -2
- package/src/messenger/discord.ts +330 -22
- package/src/messenger/gateway.ts +225 -8
- package/src/messenger/http.ts +1 -0
- package/src/messenger/live-session.ts +219 -24
- package/src/messenger/session.ts +14 -2
- package/src/messenger/types.ts +23 -1
- package/src/modes/controllers/input-controller.ts +26 -4
- package/src/prompts/system/messenger-artifacts.md +4 -0
- package/src/session/agent-session.ts +14 -10
- package/src/slash-commands/builtin-registry.ts +25 -2
|
@@ -168,6 +168,15 @@ export declare function buildNpmInstallArgs(expectedVersion: string, nativeTag?:
|
|
|
168
168
|
export declare function buildHomebrewUpdateArgs(force: boolean): string[];
|
|
169
169
|
export declare function buildMiseUpgradeArgs(): string[];
|
|
170
170
|
export declare function buildMiseForceInstallArgs(expectedVersion: string): string[];
|
|
171
|
+
/**
|
|
172
|
+
* Update via package manager.
|
|
173
|
+
*/
|
|
174
|
+
export declare function updateViaBun(expectedVersion: string, runInstall?: (args: string[]) => Promise<{
|
|
175
|
+
exitCode: number;
|
|
176
|
+
stderr: {
|
|
177
|
+
toString(): string;
|
|
178
|
+
};
|
|
179
|
+
}>): Promise<void>;
|
|
171
180
|
/**
|
|
172
181
|
* Run the update command.
|
|
173
182
|
*/
|
package/dist/types/main.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export interface InteractiveModeNotify {
|
|
|
37
37
|
message: string;
|
|
38
38
|
}
|
|
39
39
|
export declare function buildModelScopeNotification(scopedModelsForDisplay: readonly Pick<ScopedModel, "model" | "thinkingLevel" | "explicitThinkingLevel">[], startupQuiet: boolean): InteractiveModeNotify | null;
|
|
40
|
-
export declare function submitInteractiveInput(mode: Pick<InteractiveMode, "markPendingSubmissionStarted" | "finishPendingSubmission" | "showError" | "checkShutdownRequested">, session: Pick<AgentSession, "prompt" | "promptCustomMessage" | "isStreaming">, input: SubmittedUserInput): Promise<void>;
|
|
40
|
+
export declare function submitInteractiveInput(mode: Pick<InteractiveMode, "markPendingSubmissionStarted" | "finishPendingSubmission" | "showError" | "checkShutdownRequested" | "liveDiscordBridge">, session: Pick<AgentSession, "prompt" | "promptCustomMessage" | "isStreaming">, input: SubmittedUserInput): Promise<void>;
|
|
41
41
|
type AcpSessionFactory = (cwd: string) => Promise<AgentSession>;
|
|
42
42
|
export interface AcpSessionFactoryOptions {
|
|
43
43
|
baseOptions: CreateAgentSessionOptions;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AgentSessionEvent } from "../session/agent-session";
|
|
2
|
+
import type { MessengerActivityReporter } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Derive one-line progress from session events: the model's declared tool intent (falling back to the
|
|
5
|
+
* tool name) and long-running lifecycle notices. Raw tool arguments, results and errors never surface.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createMessengerActivityTracker(report: MessengerActivityReporter): (event: AgentSessionEvent) => void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MessengerMessage } from "./types";
|
|
2
|
+
export declare function messengerArtifactDirectory(root: string, message: MessengerMessage): string;
|
|
3
|
+
export declare function prepareMessengerArtifactDirectory(root: string, message: MessengerMessage): Promise<string>;
|
|
4
|
+
export declare function downloadMessengerAttachments(directory: string, message: MessengerMessage, signal: AbortSignal, fetchImpl?: typeof fetch, timeoutMs?: number): Promise<string[]>;
|
|
5
|
+
export declare function messengerArtifactPrompt(root: string | undefined, message: MessengerMessage, signal: AbortSignal): Promise<string>;
|
|
6
|
+
export declare function readMessengerArtifacts(root: string, message: MessengerMessage, text: string): Promise<{
|
|
7
|
+
text: string;
|
|
8
|
+
files: {
|
|
9
|
+
name: string;
|
|
10
|
+
data: Uint8Array;
|
|
11
|
+
}[];
|
|
12
|
+
}>;
|
|
@@ -6,4 +6,8 @@ export interface MessengerGateway {
|
|
|
6
6
|
run(signal: AbortSignal): Promise<void>;
|
|
7
7
|
handle(message: MessengerMessage, signal?: AbortSignal): Promise<void>;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export interface MessengerGatewayOptions {
|
|
10
|
+
/** Minimum spacing between in-place activity edits for one request. */
|
|
11
|
+
activityIntervalMs?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function createMessengerGateway(config: MessengerConfig, adapters: MessengerAdapter[], reply: MessengerReply, options?: MessengerGatewayOptions): MessengerGateway;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { UserMessage } from "jeopi-ai";
|
|
1
2
|
import type { InteractiveModeContext } from "../modes/types";
|
|
2
3
|
import { createDiscordAdapter, type DiscordTransportDeps } from "./discord";
|
|
3
4
|
import { createMessengerGateway, type MessengerGateway } from "./gateway";
|
|
@@ -12,6 +13,9 @@ export interface LiveDiscordBridgeDependencies {
|
|
|
12
13
|
export interface LiveDiscordBridge {
|
|
13
14
|
readonly gateway: MessengerGateway;
|
|
14
15
|
readonly active: boolean;
|
|
16
|
+
readonly relayDestination: string | undefined;
|
|
17
|
+
setRelayDestination(channelId: string | undefined): void;
|
|
18
|
+
withLocalTurn<T>(text: string, submit: (onPreparedUserMessage: (message: UserMessage) => void) => Promise<T>): Promise<T>;
|
|
15
19
|
run(signal?: AbortSignal): Promise<void>;
|
|
16
20
|
close(): Promise<void>;
|
|
17
21
|
}
|
|
@@ -7,19 +7,36 @@ export interface MessengerMessage {
|
|
|
7
7
|
messageId: string;
|
|
8
8
|
text: string;
|
|
9
9
|
threadId?: string;
|
|
10
|
+
parentChannelId?: string;
|
|
10
11
|
direct: boolean;
|
|
11
12
|
mentioned: boolean;
|
|
13
|
+
attachments?: {
|
|
14
|
+
url: string;
|
|
15
|
+
filename: string;
|
|
16
|
+
size: number;
|
|
17
|
+
}[];
|
|
12
18
|
}
|
|
19
|
+
/** Report a short, human-readable description of the work in progress. */
|
|
20
|
+
export type MessengerActivityReporter = (text: string) => void;
|
|
13
21
|
export interface MessengerAdapter {
|
|
14
22
|
platform: MessengerPlatform;
|
|
15
23
|
start(onMessage: (message: MessengerMessage) => Promise<void>, signal: AbortSignal): Promise<void>;
|
|
16
24
|
send(message: MessengerMessage, text: string, signal?: AbortSignal): Promise<void>;
|
|
25
|
+
prepare?(message: MessengerMessage, signal?: AbortSignal): Promise<MessengerMessage>;
|
|
26
|
+
status?(message: MessengerMessage, status: "processing" | "success" | "failure", signal?: AbortSignal): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Show `text` (one sanitized line) as the request's single in-progress status, editing it in place on
|
|
29
|
+
* later calls; `undefined` removes it. The gateway serializes and throttles calls per request.
|
|
30
|
+
*/
|
|
31
|
+
activity?(message: MessengerMessage, text: string | undefined, signal?: AbortSignal): Promise<void>;
|
|
17
32
|
}
|
|
18
33
|
export interface MessengerPlatformConfig {
|
|
19
34
|
tokenEnv: string;
|
|
20
35
|
appTokenEnv?: string;
|
|
21
36
|
allowedUserIds: string[];
|
|
22
37
|
allowedChannelIds?: string[];
|
|
38
|
+
/** Dedicated operator-approved directory for Discord output files. */
|
|
39
|
+
artifactDir?: string;
|
|
23
40
|
}
|
|
24
41
|
export interface MessengerConfig {
|
|
25
42
|
cwd: string;
|
|
@@ -31,7 +48,7 @@ export interface MessengerTransportDeps {
|
|
|
31
48
|
fetch?: typeof fetch;
|
|
32
49
|
WebSocket?: typeof WebSocket;
|
|
33
50
|
}
|
|
34
|
-
export type MessengerReply = (message: MessengerMessage, signal: AbortSignal) => Promise<string>;
|
|
51
|
+
export type MessengerReply = (message: MessengerMessage, signal: AbortSignal, onActivity?: MessengerActivityReporter) => Promise<string>;
|
|
35
52
|
/** A partially initialized SDK must not be retried inside a live gateway. */
|
|
36
53
|
export declare class MessengerFatalError extends Error {
|
|
37
54
|
constructor();
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import { Agent, type AgentEvent, type AgentMessage, type AgentState, type AgentTool, type StreamFn, ThinkingLevel, type ToolChoiceDirective } from "jeopi-agent-core";
|
|
16
16
|
import { type CompactionResult, type ShakeConfig } from "jeopi-agent-core/compaction";
|
|
17
|
-
import type { AssistantMessage, Context, ImageContent, Message, MessageAttribution, Model, ProviderSessionState, ResetCreditAccountStatus, ResetCreditRedeemOutcome, ResetCreditTarget, ServiceTier, ServiceTierByFamily, ServiceTierFamily, SimpleStreamOptions, TextContent, ToolChoice, UsageReport } from "jeopi-ai";
|
|
17
|
+
import type { AssistantMessage, Context, ImageContent, Message, MessageAttribution, Model, ProviderSessionState, ResetCreditAccountStatus, ResetCreditRedeemOutcome, ResetCreditTarget, ServiceTier, ServiceTierByFamily, ServiceTierFamily, SimpleStreamOptions, TextContent, ToolChoice, UsageReport, UserMessage } from "jeopi-ai";
|
|
18
18
|
import { Effort } from "jeopi-ai";
|
|
19
19
|
import type { InMemorySnapshotStore } from "jeopi-hashline";
|
|
20
20
|
import { postmortem } from "jeopi-utils";
|
|
@@ -360,6 +360,8 @@ export interface PromptOptions {
|
|
|
360
360
|
userInitiated?: boolean;
|
|
361
361
|
/** Explicit billing/initiator attribution for the prompt. Defaults to user prompts as `user` and synthetic prompts as `agent`. */
|
|
362
362
|
attribution?: MessageAttribution;
|
|
363
|
+
/** Observe the exact user message prepared for this submission, including queued messages. */
|
|
364
|
+
onPreparedUserMessage?: (message: UserMessage) => void;
|
|
363
365
|
/** Skip pre-send compaction checks for this prompt (internal use for maintenance flows). */
|
|
364
366
|
skipCompactionCheck?: boolean;
|
|
365
367
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "jeopi-cli",
|
|
4
|
-
"version": "16.6.
|
|
4
|
+
"version": "16.6.13",
|
|
5
5
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
6
6
|
"homepage": "https://github.com/akillness/jeopi",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -57,17 +57,17 @@
|
|
|
57
57
|
"@agentclientprotocol/sdk": "0.25.0",
|
|
58
58
|
"@babel/parser": "^7.29.7",
|
|
59
59
|
"@mozilla/readability": "^0.6.0",
|
|
60
|
-
"jeopi-hashline": "16.6.
|
|
61
|
-
"jeopi-stats": "16.6.
|
|
62
|
-
"jeopi-agent-core": "16.6.
|
|
63
|
-
"jeopi-ai": "16.6.
|
|
64
|
-
"jeopi-catalog": "16.6.
|
|
65
|
-
"jeopi-mnemopi": "16.6.
|
|
66
|
-
"jeopi-natives": "16.6.
|
|
67
|
-
"jeopi-tui": "16.6.
|
|
68
|
-
"jeopi-utils": "16.6.
|
|
69
|
-
"jeopi-wire": "16.6.
|
|
70
|
-
"jeopi-snapcompact": "16.6.
|
|
60
|
+
"jeopi-hashline": "16.6.13",
|
|
61
|
+
"jeopi-stats": "16.6.13",
|
|
62
|
+
"jeopi-agent-core": "16.6.13",
|
|
63
|
+
"jeopi-ai": "16.6.13",
|
|
64
|
+
"jeopi-catalog": "16.6.13",
|
|
65
|
+
"jeopi-mnemopi": "16.6.13",
|
|
66
|
+
"jeopi-natives": "16.6.13",
|
|
67
|
+
"jeopi-tui": "16.6.13",
|
|
68
|
+
"jeopi-utils": "16.6.13",
|
|
69
|
+
"jeopi-wire": "16.6.13",
|
|
70
|
+
"jeopi-snapcompact": "16.6.13",
|
|
71
71
|
"@opentelemetry/api": "^1.9.1",
|
|
72
72
|
"@opentelemetry/context-async-hooks": "^2.7.1",
|
|
73
73
|
"@opentelemetry/exporter-trace-otlp-proto": "^0.218.0",
|
package/src/cli/update-cli.ts
CHANGED
|
@@ -972,12 +972,22 @@ export function buildMiseForceInstallArgs(expectedVersion: string): string[] {
|
|
|
972
972
|
/**
|
|
973
973
|
* Update via package manager.
|
|
974
974
|
*/
|
|
975
|
-
async function updateViaBun(
|
|
975
|
+
export async function updateViaBun(
|
|
976
|
+
expectedVersion: string,
|
|
977
|
+
runInstall: (args: string[]) => Promise<{ exitCode: number; stderr: { toString(): string } }> = async args =>
|
|
978
|
+
await $`bun ${args}`.nothrow(),
|
|
979
|
+
): Promise<void> {
|
|
976
980
|
console.log(chalk.dim("Updating via bun..."));
|
|
977
981
|
const args = buildBunInstallArgs(expectedVersion);
|
|
978
|
-
const result = await
|
|
982
|
+
const result = await runInstall(args);
|
|
979
983
|
if (result.exitCode !== 0) {
|
|
980
|
-
|
|
984
|
+
const guidance =
|
|
985
|
+
/^error: empty dependency name \(in "dependencies"\)\r?\n\s+at .+[\\/]package\.json:\d+:\d+\s*$/m.test(
|
|
986
|
+
Bun.stripANSI(result.stderr.toString()),
|
|
987
|
+
)
|
|
988
|
+
? "\nBack up the package.json shown in Bun's diagnostic above, then remove only the empty-name entry from its dependencies and retry the update."
|
|
989
|
+
: "";
|
|
990
|
+
throw new Error(`bun install failed with exit code ${result.exitCode}${guidance}`);
|
|
981
991
|
}
|
|
982
992
|
|
|
983
993
|
await printVerification(expectedVersion);
|
|
@@ -264,6 +264,7 @@ export const BUNDLED_PI_REGISTRY_KEYS: ReadonlySet<string> = new Set([
|
|
|
264
264
|
"@oh-my-pi/pi-coding-agent/cli/grep-cli",
|
|
265
265
|
"@oh-my-pi/pi-coding-agent/cli/grievances-cli",
|
|
266
266
|
"@oh-my-pi/pi-coding-agent/cli/initial-message",
|
|
267
|
+
"@oh-my-pi/pi-coding-agent/cli/messenger-cli",
|
|
267
268
|
"@oh-my-pi/pi-coding-agent/cli/models-cli",
|
|
268
269
|
"@oh-my-pi/pi-coding-agent/cli/plugin-cli",
|
|
269
270
|
"@oh-my-pi/pi-coding-agent/cli/profile-alias",
|
|
@@ -313,6 +314,7 @@ export const BUNDLED_PI_REGISTRY_KEYS: ReadonlySet<string> = new Set([
|
|
|
313
314
|
"@oh-my-pi/pi-coding-agent/commands/install",
|
|
314
315
|
"@oh-my-pi/pi-coding-agent/commands/join",
|
|
315
316
|
"@oh-my-pi/pi-coding-agent/commands/launch",
|
|
317
|
+
"@oh-my-pi/pi-coding-agent/commands/messenger",
|
|
316
318
|
"@oh-my-pi/pi-coding-agent/commands/models",
|
|
317
319
|
"@oh-my-pi/pi-coding-agent/commands/plugin",
|
|
318
320
|
"@oh-my-pi/pi-coding-agent/commands/read",
|
|
@@ -238,6 +238,7 @@ import * as bundledPiCodingAgentCliGcCli from "jeopi-cli/cli/gc-cli";
|
|
|
238
238
|
import * as bundledPiCodingAgentCliGrepCli from "jeopi-cli/cli/grep-cli";
|
|
239
239
|
import * as bundledPiCodingAgentCliGrievancesCli from "jeopi-cli/cli/grievances-cli";
|
|
240
240
|
import * as bundledPiCodingAgentCliInitialMessage from "jeopi-cli/cli/initial-message";
|
|
241
|
+
import * as bundledPiCodingAgentCliMessengerCli from "jeopi-cli/cli/messenger-cli";
|
|
241
242
|
import * as bundledPiCodingAgentCliModelsCli from "jeopi-cli/cli/models-cli";
|
|
242
243
|
import * as bundledPiCodingAgentCliPluginCli from "jeopi-cli/cli/plugin-cli";
|
|
243
244
|
import * as bundledPiCodingAgentCliProfileAlias from "jeopi-cli/cli/profile-alias";
|
|
@@ -274,6 +275,7 @@ import * as bundledPiCodingAgentCommandsGrievances from "jeopi-cli/commands/grie
|
|
|
274
275
|
import * as bundledPiCodingAgentCommandsInstall from "jeopi-cli/commands/install";
|
|
275
276
|
import * as bundledPiCodingAgentCommandsJoin from "jeopi-cli/commands/join";
|
|
276
277
|
import * as bundledPiCodingAgentCommandsLaunch from "jeopi-cli/commands/launch";
|
|
278
|
+
import * as bundledPiCodingAgentCommandsMessenger from "jeopi-cli/commands/messenger";
|
|
277
279
|
import * as bundledPiCodingAgentCommandsModels from "jeopi-cli/commands/models";
|
|
278
280
|
import * as bundledPiCodingAgentCommandsPlugin from "jeopi-cli/commands/plugin";
|
|
279
281
|
import * as bundledPiCodingAgentCommandsRead from "jeopi-cli/commands/read";
|
|
@@ -1591,6 +1593,9 @@ export const BUNDLED_PI_REGISTRY: Readonly<Record<string, Readonly<Record<string
|
|
|
1591
1593
|
"@oh-my-pi/pi-coding-agent/cli/initial-message": bundledPiCodingAgentCliInitialMessage as unknown as Readonly<
|
|
1592
1594
|
Record<string, unknown>
|
|
1593
1595
|
>,
|
|
1596
|
+
"@oh-my-pi/pi-coding-agent/cli/messenger-cli": bundledPiCodingAgentCliMessengerCli as unknown as Readonly<
|
|
1597
|
+
Record<string, unknown>
|
|
1598
|
+
>,
|
|
1594
1599
|
"@oh-my-pi/pi-coding-agent/cli/models-cli": bundledPiCodingAgentCliModelsCli as unknown as Readonly<
|
|
1595
1600
|
Record<string, unknown>
|
|
1596
1601
|
>,
|
|
@@ -1727,6 +1732,9 @@ export const BUNDLED_PI_REGISTRY: Readonly<Record<string, Readonly<Record<string
|
|
|
1727
1732
|
"@oh-my-pi/pi-coding-agent/commands/launch": bundledPiCodingAgentCommandsLaunch as unknown as Readonly<
|
|
1728
1733
|
Record<string, unknown>
|
|
1729
1734
|
>,
|
|
1735
|
+
"@oh-my-pi/pi-coding-agent/commands/messenger": bundledPiCodingAgentCommandsMessenger as unknown as Readonly<
|
|
1736
|
+
Record<string, unknown>
|
|
1737
|
+
>,
|
|
1730
1738
|
"@oh-my-pi/pi-coding-agent/commands/models": bundledPiCodingAgentCommandsModels as unknown as Readonly<
|
|
1731
1739
|
Record<string, unknown>
|
|
1732
1740
|
>,
|