@borgee/agents-host 0.2.2 → 0.2.26
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/README.md +184 -21
- package/dist/agents-host-supervisor.d.ts +7 -5
- package/dist/agents-host-supervisor.js +24 -4
- package/dist/agents-host.d.ts +89 -15
- package/dist/agents-host.js +2099 -141
- package/dist/chat/chat-control-plane.d.ts +13 -2
- package/dist/chat/sdk-chat-control-plane.d.ts +14 -3
- package/dist/chat/sdk-chat-control-plane.js +54 -2
- package/dist/cli-args.d.ts +46 -5
- package/dist/cli-args.js +313 -32
- package/dist/cli.d.ts +9 -0
- package/dist/cli.js +112 -5
- package/dist/compatibility-gates.d.ts +35 -0
- package/dist/compatibility-gates.js +127 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.js +23 -5
- package/dist/connections-state-store.d.ts +81 -0
- package/dist/connections-state-store.js +228 -0
- package/dist/context/injection.d.ts +109 -0
- package/dist/context/injection.js +350 -0
- package/dist/context/prompt.d.ts +4 -1
- package/dist/context/prompt.js +170 -1
- package/dist/context/turn-preparation.d.ts +9 -0
- package/dist/context/turn-preparation.js +106 -0
- package/dist/debug.d.ts +44 -0
- package/dist/debug.js +135 -0
- package/dist/gateway/localhost-gateway.d.ts +52 -0
- package/dist/gateway/localhost-gateway.js +857 -0
- package/dist/index.js +7 -5
- package/dist/local-config.d.ts +4 -1
- package/dist/local-config.js +24 -7
- package/dist/managed-daemon-log.d.ts +34 -0
- package/dist/managed-daemon-log.js +261 -0
- package/dist/managed-daemon.d.ts +220 -0
- package/dist/managed-daemon.js +1601 -0
- package/dist/policy/authorization-audit.d.ts +63 -0
- package/dist/policy/authorization-audit.js +94 -0
- package/dist/policy/copilot-permission.d.ts +15 -0
- package/dist/policy/copilot-permission.js +193 -0
- package/dist/policy/gateway-authorization.d.ts +42 -0
- package/dist/policy/gateway-authorization.js +162 -0
- package/dist/providers/awaiting-user.d.ts +12 -0
- package/dist/providers/awaiting-user.js +151 -0
- package/dist/providers/claude/adapter.d.ts +3 -1
- package/dist/providers/claude/adapter.js +8 -12
- package/dist/providers/claude/cli-client.d.ts +12 -5
- package/dist/providers/claude/cli-client.js +184 -37
- package/dist/providers/claude/session-store.d.ts +1 -0
- package/dist/providers/codex/adapter.d.ts +11 -0
- package/dist/providers/codex/adapter.js +19 -0
- package/dist/providers/codex/cli-client.d.ts +103 -0
- package/dist/providers/codex/cli-client.js +1133 -0
- package/dist/providers/codex/project-doc.d.ts +3 -0
- package/dist/providers/codex/project-doc.js +66 -0
- package/dist/providers/codex/session-store.d.ts +38 -0
- package/dist/providers/codex/session-store.js +150 -0
- package/dist/providers/copilot/adapter.d.ts +3 -1
- package/dist/providers/copilot/adapter.js +8 -12
- package/dist/providers/copilot/cli-client.d.ts +20 -2
- package/dist/providers/copilot/cli-client.js +251 -71
- package/dist/providers/copilot/session-store.d.ts +1 -0
- package/dist/providers/create-provider.d.ts +11 -2
- package/dist/providers/create-provider.js +131 -12
- package/dist/run.d.ts +1 -0
- package/dist/run.js +5 -2
- package/dist/state-paths.d.ts +13 -1
- package/dist/state-paths.js +84 -3
- package/dist/task-thread-resolution.d.ts +10 -0
- package/dist/task-thread-resolution.js +48 -0
- package/dist/types.d.ts +174 -1
- package/dist/visible-mentions.d.ts +3 -0
- package/dist/visible-mentions.js +15 -0
- package/package.json +19 -17
- package/skills/borgee-agent/SKILL.md +33 -0
- package/skills/borgee-agent/borgee-agent.mjs +473 -0
- package/skills/borgee-agent/borgee-agent.py +409 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createAwaitingUserProgressHandler, parseProviderReply } from '../awaiting-user.js';
|
|
2
|
+
export class CodexProviderAdapter {
|
|
3
|
+
cli;
|
|
4
|
+
turnPreparer;
|
|
5
|
+
constructor(cli, turnPreparer) {
|
|
6
|
+
this.cli = cli;
|
|
7
|
+
this.turnPreparer = turnPreparer;
|
|
8
|
+
}
|
|
9
|
+
async generateReply(input, options) {
|
|
10
|
+
const preparedTurn = await this.turnPreparer.prepare(input);
|
|
11
|
+
const text = await this.cli.generateReply(preparedTurn, {
|
|
12
|
+
onProgress: createAwaitingUserProgressHandler(options?.onProgress),
|
|
13
|
+
});
|
|
14
|
+
return parseProviderReply(text);
|
|
15
|
+
}
|
|
16
|
+
async dispose() {
|
|
17
|
+
await this.cli.dispose();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import spawn from 'cross-spawn';
|
|
2
|
+
import { PROTOCOL_VERSION, client, methods, ndJsonStream } from '@agentclientprotocol/sdk';
|
|
3
|
+
import { type DebugLogger } from '../../debug.js';
|
|
4
|
+
import type { PreparedProviderTurnInput, ProviderGenerateOptions } from '../../types.js';
|
|
5
|
+
import type { CodexChannelSessionStore } from './session-store.js';
|
|
6
|
+
interface CodexAcpRuntime {
|
|
7
|
+
spawn: typeof spawn;
|
|
8
|
+
client: typeof client;
|
|
9
|
+
ndJsonStream: typeof ndJsonStream;
|
|
10
|
+
methods: typeof methods;
|
|
11
|
+
protocolVersion: typeof PROTOCOL_VERSION;
|
|
12
|
+
cwd: string;
|
|
13
|
+
idleSessionTtlMs: number;
|
|
14
|
+
shutdownGracePeriodMs: number;
|
|
15
|
+
shutdownForceKillWaitMs: number;
|
|
16
|
+
readFile(path: string, options?: {
|
|
17
|
+
encoding?: BufferEncoding;
|
|
18
|
+
}): Promise<string>;
|
|
19
|
+
readdir(path: string): Promise<string[]>;
|
|
20
|
+
writeFile(path: string, data: string, options?: {
|
|
21
|
+
encoding?: BufferEncoding;
|
|
22
|
+
mode?: number;
|
|
23
|
+
}): Promise<void>;
|
|
24
|
+
mkdir(path: string, options?: {
|
|
25
|
+
recursive?: boolean;
|
|
26
|
+
mode?: number;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
unlink(path: string): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
export declare class CodexCliClient {
|
|
31
|
+
private readonly command;
|
|
32
|
+
private readonly args;
|
|
33
|
+
private readonly sessionStore?;
|
|
34
|
+
private readonly resolveSessionStoreAgentId;
|
|
35
|
+
private readonly logger;
|
|
36
|
+
private readonly runtime;
|
|
37
|
+
private readonly channels;
|
|
38
|
+
private readonly persistedSessions;
|
|
39
|
+
private readonly closingSessions;
|
|
40
|
+
private readonly pendingSessionStarts;
|
|
41
|
+
private readonly pendingSessionCloses;
|
|
42
|
+
private readonly pendingSessionStoreOperations;
|
|
43
|
+
private readonly fatalPromise;
|
|
44
|
+
private rejectFatalPromise;
|
|
45
|
+
private child?;
|
|
46
|
+
private connection?;
|
|
47
|
+
private startPromise?;
|
|
48
|
+
private shutdownPromise?;
|
|
49
|
+
private childExitPromise?;
|
|
50
|
+
private resolveChildExit?;
|
|
51
|
+
private fatalError;
|
|
52
|
+
private disposing;
|
|
53
|
+
private backendClosed;
|
|
54
|
+
private loadedSessionStoreAgentId;
|
|
55
|
+
private sessionStoreLoadPromise;
|
|
56
|
+
private sessionStoreWriteQueue;
|
|
57
|
+
private sessionCapabilities;
|
|
58
|
+
constructor(command: string, args?: string[], runtimeOverrides?: Partial<CodexAcpRuntime>, sessionStore?: CodexChannelSessionStore | undefined, resolveSessionStoreAgentId?: () => string | undefined, logger?: DebugLogger);
|
|
59
|
+
generateReply(turn: PreparedProviderTurnInput, options?: ProviderGenerateOptions): Promise<string>;
|
|
60
|
+
generateReply(channelId: string, prompt: string, options?: ProviderGenerateOptions): Promise<string>;
|
|
61
|
+
dispose(): Promise<void>;
|
|
62
|
+
private ensureStarted;
|
|
63
|
+
private startBackend;
|
|
64
|
+
private getOrCreateChannelState;
|
|
65
|
+
private processChannelQueue;
|
|
66
|
+
private getOrCreateSession;
|
|
67
|
+
private startFreshSession;
|
|
68
|
+
private restoreOrCreateSession;
|
|
69
|
+
private restoreSession;
|
|
70
|
+
private clearBufferedSessionReplay;
|
|
71
|
+
private resolveSessionCwd;
|
|
72
|
+
private recycleSessionIfInjectionScopeChanged;
|
|
73
|
+
private resolveSessionAdditionalDirectories;
|
|
74
|
+
private resolveSessionVisibilityKey;
|
|
75
|
+
private resolveProjectedContextDirectory;
|
|
76
|
+
private buildProjectedPromptContext;
|
|
77
|
+
private copyProjectedFile;
|
|
78
|
+
private pruneProjectedGatewayAuthFiles;
|
|
79
|
+
private refreshProjectedPromptContextBestEffort;
|
|
80
|
+
private rewritePromptContextPaths;
|
|
81
|
+
private runTurn;
|
|
82
|
+
private raceWithFatal;
|
|
83
|
+
private invalidateSession;
|
|
84
|
+
private rejectQueuedTurnsAfterSessionTaint;
|
|
85
|
+
private failAll;
|
|
86
|
+
private closeSession;
|
|
87
|
+
private clearIdleTimer;
|
|
88
|
+
private reconcileIdleChannelState;
|
|
89
|
+
private ensureSessionStoreLoaded;
|
|
90
|
+
private readPersistedSessionId;
|
|
91
|
+
private persistSession;
|
|
92
|
+
private persistSessionBestEffort;
|
|
93
|
+
private clearPersistedSession;
|
|
94
|
+
private clearPersistedSessionBestEffort;
|
|
95
|
+
private flushSessionStore;
|
|
96
|
+
private trackSessionStoreOperation;
|
|
97
|
+
private evictIdleChannel;
|
|
98
|
+
private shutdownBackend;
|
|
99
|
+
private waitForPendingSessionStarts;
|
|
100
|
+
private waitForPendingSessionCloses;
|
|
101
|
+
private waitForChildExit;
|
|
102
|
+
}
|
|
103
|
+
export {};
|