axexec 1.1.6 → 1.2.0
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/agents/copilot/adapter.js +1 -2
- package/dist/agents/copilot/stream-session.js +3 -1
- package/dist/agents/copilot/tail-file.js +6 -2
- package/dist/agents/copilot/watch-session.js +7 -5
- package/dist/agents/opencode/process-sse-events.d.ts +1 -1
- package/dist/agents/opencode/process-sse-events.js +1 -1
- package/dist/agents/registry.d.ts +1 -1
- package/dist/build-execution-metadata.d.ts +1 -1
- package/dist/build-permissions-config.d.ts +1 -1
- package/dist/cli.js +1 -0
- package/dist/credentials/write-agent-credentials.js +5 -0
- package/dist/execute-agent.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/types/adapter.d.ts +2 -1
- package/dist/types/events.d.ts +1 -2
- package/dist/types/run-result.d.ts +2 -1
- package/package.json +2 -2
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
* to stdout.
|
|
10
10
|
*/
|
|
11
11
|
import path from "node:path";
|
|
12
|
-
import { fileURLToPath } from "node:url";
|
|
13
12
|
import { determineSessionSuccess } from "../../determine-session-success.js";
|
|
14
13
|
import { resolveBinary } from "../../resolve-binary.js";
|
|
15
14
|
import { registerAdapter } from "../registry.js";
|
|
@@ -21,7 +20,7 @@ const COPILOT_INFO = {
|
|
|
21
20
|
};
|
|
22
21
|
/** Get the path to the stream-session.js script */
|
|
23
22
|
function getWrapperScriptPath() {
|
|
24
|
-
const currentDirectory =
|
|
23
|
+
const currentDirectory = import.meta.dirname;
|
|
25
24
|
return path.join(currentDirectory, "stream-session.js");
|
|
26
25
|
}
|
|
27
26
|
/**
|
|
@@ -87,7 +87,9 @@ async function main() {
|
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
89
|
// Give a moment for final events to be written
|
|
90
|
-
await new Promise((resolve) =>
|
|
90
|
+
await new Promise((resolve) => {
|
|
91
|
+
setTimeout(resolve, 200);
|
|
92
|
+
});
|
|
91
93
|
// Stop tailing
|
|
92
94
|
abortController.abort();
|
|
93
95
|
// Wait for tail to finish processing
|
|
@@ -42,11 +42,15 @@ export async function* tailFile(filePath, signal) {
|
|
|
42
42
|
position = fileSize;
|
|
43
43
|
}
|
|
44
44
|
// Wait a bit before checking again
|
|
45
|
-
await new Promise((resolve) =>
|
|
45
|
+
await new Promise((resolve) => {
|
|
46
|
+
setTimeout(resolve, 50);
|
|
47
|
+
});
|
|
46
48
|
}
|
|
47
49
|
catch {
|
|
48
50
|
// File might be temporarily unavailable, wait and retry
|
|
49
|
-
await new Promise((resolve) =>
|
|
51
|
+
await new Promise((resolve) => {
|
|
52
|
+
setTimeout(resolve, 100);
|
|
53
|
+
});
|
|
50
54
|
}
|
|
51
55
|
}
|
|
52
56
|
}
|
|
@@ -136,18 +136,20 @@ export function waitForSessionFile(existingFiles, timeoutMs = 10_000) {
|
|
|
136
136
|
const eventsFile = path.join(SESSION_STATE_DIR, filename, SESSION_EVENTS_FILE);
|
|
137
137
|
const checkForEventsFile = () => {
|
|
138
138
|
if (resolved)
|
|
139
|
-
return;
|
|
139
|
+
return true;
|
|
140
140
|
if (existsSync(eventsFile)) {
|
|
141
141
|
resolved = true;
|
|
142
142
|
cleanup();
|
|
143
143
|
resolve(eventsFile);
|
|
144
|
+
return true;
|
|
144
145
|
}
|
|
146
|
+
return false;
|
|
145
147
|
};
|
|
146
148
|
// Check immediately and set up short polling for the events file
|
|
147
|
-
checkForEventsFile()
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
if (!checkForEventsFile()) {
|
|
150
|
+
eventsCheckInterval = setInterval(() => {
|
|
151
|
+
checkForEventsFile();
|
|
152
|
+
}, 50);
|
|
151
153
|
}
|
|
152
154
|
}
|
|
153
155
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* SSE event processing for OpenCode adapter.
|
|
3
3
|
*/
|
|
4
4
|
import type { AxexecEvent } from "../../types/events.js";
|
|
5
|
-
import { OpenCodeSSEEvent } from "./server-types.js";
|
|
5
|
+
import type { OpenCodeSSEEvent } from "./server-types.js";
|
|
6
6
|
interface ProcessEventsContext {
|
|
7
7
|
serverUrl: string;
|
|
8
8
|
sessionId: string;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { createSessionStartEvent } from "./create-session-start-event.js";
|
|
5
5
|
import { checkEmptySession, createContentTracker, trackContentEvent, } from "./detect-empty-session.js";
|
|
6
6
|
import { createSSEEventParser } from "./parse-sse-event.js";
|
|
7
|
-
import { isMessagePartUpdatedEvent, isSessionErrorEvent, isSessionIdleEvent,
|
|
7
|
+
import { isMessagePartUpdatedEvent, isSessionErrorEvent, isSessionIdleEvent, } from "./server-types.js";
|
|
8
8
|
import { getSessionModelInfo } from "./session-api.js";
|
|
9
9
|
/**
|
|
10
10
|
* Processes SSE events and yields normalized AxexecEvents.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* without modifying core code.
|
|
6
6
|
*/
|
|
7
7
|
import type { AgentAdapter, AgentInfo } from "../types/adapter.js";
|
|
8
|
-
import type { AgentCli } from "
|
|
8
|
+
import type { AgentCli } from "axshared";
|
|
9
9
|
/** Registers an adapter in the registry */
|
|
10
10
|
declare function registerAdapter(adapter: AgentAdapter): void;
|
|
11
11
|
/** Retrieves an adapter by ID, or undefined if not found */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentCli } from "
|
|
1
|
+
import type { AgentCli } from "axshared";
|
|
2
2
|
import type { RunAgentOptions, ExecutionMetadata } from "./types/run-result.js";
|
|
3
3
|
import type { Credentials } from "./credentials/credentials.js";
|
|
4
4
|
import type { installCredentials } from "./credentials/install-credentials.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Permission config building for agent execution.
|
|
3
3
|
*/
|
|
4
|
-
import type { AgentCli } from "
|
|
4
|
+
import type { AgentCli } from "axshared";
|
|
5
5
|
import type { RunAgentOptions } from "./types/run-result.js";
|
|
6
6
|
import type { installCredentials } from "./credentials/install-credentials.js";
|
|
7
7
|
type CredentialInstallResult = Awaited<ReturnType<typeof installCredentials>>;
|
package/dist/cli.js
CHANGED
|
@@ -118,6 +118,11 @@ function installOpenCodeCredentials(dataDirectory, credentials, warn = defaultWa
|
|
|
118
118
|
});
|
|
119
119
|
break;
|
|
120
120
|
}
|
|
121
|
+
case "oauth-token": {
|
|
122
|
+
// OpenCode doesn't support oauth-token, only oauth-credentials
|
|
123
|
+
warn(`Warning: installOpenCodeCredentials: oauth-token is not supported for OpenCode. auth.json was not written.`);
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
121
126
|
case "api-key": {
|
|
122
127
|
const apiKey = resolveStringField(credentials.data, "apiKey", "key");
|
|
123
128
|
if (!apiKey) {
|
package/dist/execute-agent.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentAdapter } from "./types/adapter.js";
|
|
2
|
-
import type { AgentCli } from "
|
|
2
|
+
import type { AgentCli } from "axshared";
|
|
3
3
|
import type { RunAgentOptions, RunResult } from "./types/run-result.js";
|
|
4
4
|
import type { Credentials } from "./credentials/credentials.js";
|
|
5
5
|
import type { installCredentials } from "./credentials/install-credentials.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -12,5 +12,5 @@ import "./agents/copilot/adapter.js";
|
|
|
12
12
|
export { runAgent } from "./run-agent.js";
|
|
13
13
|
export { cleanupCredentials } from "./credentials/install-credentials.js";
|
|
14
14
|
export type { ExecutionCredentials, ExecutionDirectories, ExecutionMetadata, RunAgentDiagnostics, RunAgentOptions, RunResult, } from "./types/run-result.js";
|
|
15
|
-
export type { AxexecEvent
|
|
15
|
+
export type { AxexecEvent } from "./types/events.js";
|
|
16
16
|
export type { Credentials } from "./credentials/credentials.js";
|
package/dist/types/adapter.d.ts
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* Adapters may optionally implement {@link StreamableAdapter} to provide
|
|
8
8
|
* custom streaming behavior (e.g., for server-mode agents).
|
|
9
9
|
*/
|
|
10
|
-
import type { AgentCli
|
|
10
|
+
import type { AgentCli } from "axshared";
|
|
11
|
+
import type { AxexecEvent } from "./events.js";
|
|
11
12
|
import type { RunOptions } from "./options.js";
|
|
12
13
|
/** Metadata about an agent */
|
|
13
14
|
interface AgentInfo {
|
package/dist/types/events.d.ts
CHANGED
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
* - agent.*: Agent content output (reasoning, message)
|
|
11
11
|
* - tool.*: Tool execution (call, result)
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
|
-
type AgentCli = import("axshared").AgentCli;
|
|
13
|
+
import type { AgentCli } from "axshared";
|
|
15
14
|
/** Statistics collected during session execution */
|
|
16
15
|
interface SessionStats {
|
|
17
16
|
durationMs: number;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Types for run-agent results and options.
|
|
3
3
|
*/
|
|
4
|
-
import type { AgentCli
|
|
4
|
+
import type { AgentCli } from "axshared";
|
|
5
|
+
import type { AxexecEvent } from "./events.js";
|
|
5
6
|
import type { OutputFormat } from "../resolve-output-mode.js";
|
|
6
7
|
import type { Credentials } from "../credentials/credentials.js";
|
|
7
8
|
interface RunAgentDiagnostics {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "axexec",
|
|
3
3
|
"author": "Łukasz Jerciński",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.2.0",
|
|
6
6
|
"description": "Unified CLI runner for AI coding agents with normalized event streaming",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"@types/node": "^25.0.7",
|
|
76
76
|
"@vitest/coverage-v8": "^4.0.17",
|
|
77
77
|
"eslint": "^9.39.2",
|
|
78
|
-
"eslint-config-axkit": "^1.
|
|
78
|
+
"eslint-config-axkit": "^1.1.0",
|
|
79
79
|
"fta-check": "^1.5.1",
|
|
80
80
|
"fta-cli": "^3.0.0",
|
|
81
81
|
"knip": "^5.80.2",
|