@almyty/acp-server 1.0.13 → 1.0.14
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/agent.js +14 -13
- package/dist/auth.d.ts +4 -20
- package/dist/auth.js +3 -34
- package/package.json +2 -1
package/dist/agent.js
CHANGED
|
@@ -378,19 +378,20 @@ export class AlmytyAcpAgent {
|
|
|
378
378
|
if (finalRun.status === 'running') {
|
|
379
379
|
process.stderr.write(`[acp] Run still running after stream ended, polling...\n`);
|
|
380
380
|
finalRun = await this.pollRunToCompletion(session.agentId, run.id, signal);
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
381
|
+
}
|
|
382
|
+
// Send output if streaming didn't capture it
|
|
383
|
+
if (collectedText.length === 0 && finalRun.output) {
|
|
384
|
+
const text = typeof finalRun.output === 'string'
|
|
385
|
+
? finalRun.output
|
|
386
|
+
: JSON.stringify(finalRun.output, null, 2);
|
|
387
|
+
collectedText.push(text);
|
|
388
|
+
this.sendSessionUpdate(session.id, { type: 'agent_message_chunk', text });
|
|
389
|
+
}
|
|
390
|
+
if (finalRun.error) {
|
|
391
|
+
const errText = typeof finalRun.error === 'string'
|
|
392
|
+
? finalRun.error
|
|
393
|
+
: JSON.stringify(finalRun.error);
|
|
394
|
+
if (!collectedText.includes(`Error: ${errText}`)) {
|
|
394
395
|
collectedText.push(`Error: ${errText}`);
|
|
395
396
|
}
|
|
396
397
|
}
|
package/dist/auth.d.ts
CHANGED
|
@@ -1,22 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Reads the shared credential store written by `npx @almyty/auth login`.
|
|
5
|
-
* Lookup order: ALMYTY_TOKEN env var, then ~/.almyty/credentials.json.
|
|
2
|
+
* Thin re-export from the shared @almyty/client credential resolver.
|
|
3
|
+
* Keeps `./auth.js` imports working across the acp-server codebase.
|
|
6
4
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
token: string;
|
|
10
|
-
email?: string;
|
|
11
|
-
frontendUrl?: string;
|
|
12
|
-
}
|
|
13
|
-
export declare function loadCredentials(): StoredCredentials | null;
|
|
14
|
-
/**
|
|
15
|
-
* Resolve token: env var > stored credentials. Returns null when no
|
|
16
|
-
* credentials are available.
|
|
17
|
-
*/
|
|
18
|
-
export declare function resolveCredentials(): {
|
|
19
|
-
url: string;
|
|
20
|
-
token: string;
|
|
21
|
-
} | null;
|
|
22
|
-
export {};
|
|
5
|
+
export { resolveCredentials, resolveCredentialsOrExit, loadCredentials, CREDENTIALS_FILE, } from '@almyty/client';
|
|
6
|
+
export type { StoredCredentials } from '@almyty/client';
|
package/dist/auth.js
CHANGED
|
@@ -1,36 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Reads the shared credential store written by `npx @almyty/auth login`.
|
|
5
|
-
* Lookup order: ALMYTY_TOKEN env var, then ~/.almyty/credentials.json.
|
|
2
|
+
* Thin re-export from the shared @almyty/client credential resolver.
|
|
3
|
+
* Keeps `./auth.js` imports working across the acp-server codebase.
|
|
6
4
|
*/
|
|
7
|
-
|
|
8
|
-
import { homedir } from 'node:os';
|
|
9
|
-
import { join } from 'node:path';
|
|
10
|
-
const CREDENTIALS_FILE = join(homedir(), '.almyty', 'credentials.json');
|
|
11
|
-
export function loadCredentials() {
|
|
12
|
-
try {
|
|
13
|
-
if (!existsSync(CREDENTIALS_FILE))
|
|
14
|
-
return null;
|
|
15
|
-
return JSON.parse(readFileSync(CREDENTIALS_FILE, 'utf-8'));
|
|
16
|
-
}
|
|
17
|
-
catch {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Resolve token: env var > stored credentials. Returns null when no
|
|
23
|
-
* credentials are available.
|
|
24
|
-
*/
|
|
25
|
-
export function resolveCredentials() {
|
|
26
|
-
const envToken = process.env.ALMYTY_TOKEN;
|
|
27
|
-
const envUrl = process.env.ALMYTY_URL || 'https://api.almyty.com';
|
|
28
|
-
if (envToken) {
|
|
29
|
-
return { url: envUrl, token: envToken };
|
|
30
|
-
}
|
|
31
|
-
const creds = loadCredentials();
|
|
32
|
-
if (creds?.token) {
|
|
33
|
-
return { url: creds.url, token: creds.token };
|
|
34
|
-
}
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
5
|
+
export { resolveCredentials, resolveCredentialsOrExit, loadCredentials, CREDENTIALS_FILE, } from '@almyty/client';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almyty/acp-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"description": "ACP agent server for almyty — expose any almyty agent via the Agent Client Protocol",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"author": "almyty",
|
|
29
29
|
"license": "BSL-1.1",
|
|
30
30
|
"dependencies": {
|
|
31
|
+
"@almyty/client": "file:../client",
|
|
31
32
|
"eventsource-parser": "^3.0.0"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|