@almyty/skills 1.0.6 → 1.0.7
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/auth.d.ts +4 -18
- package/dist/auth.js +3 -55
- package/package.json +5 -2
package/dist/auth.d.ts
CHANGED
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Authentication itself lives in the dedicated @almyty/auth package
|
|
5
|
-
* (`npx @almyty/auth login`). This module just READS the shared
|
|
6
|
-
* credentials store and surfaces them to the rest of the skills CLI.
|
|
7
|
-
*
|
|
8
|
-
* Lookup order:
|
|
9
|
-
* 1. ALMYTY_TOKEN environment variable (CI / scripts)
|
|
10
|
-
* 2. ~/.almyty/credentials.json (interactive use, written
|
|
11
|
-
* by `npx @almyty/auth login`)
|
|
2
|
+
* Thin re-export from the shared @almyty/client credential resolver.
|
|
3
|
+
* Keeps `./auth.js` imports working across the skills-cli codebase.
|
|
12
4
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* if no credentials are available.
|
|
16
|
-
*/
|
|
17
|
-
export declare function resolveAuth(): {
|
|
18
|
-
url: string;
|
|
19
|
-
token: string;
|
|
20
|
-
};
|
|
5
|
+
export { resolveCredentials, resolveCredentialsOrExit, resolveCredentialsOrExit as resolveAuth, loadCredentials, CREDENTIALS_FILE, } from '@almyty/client';
|
|
6
|
+
export type { StoredCredentials } from '@almyty/client';
|
package/dist/auth.js
CHANGED
|
@@ -1,57 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Authentication itself lives in the dedicated @almyty/auth package
|
|
5
|
-
* (`npx @almyty/auth login`). This module just READS the shared
|
|
6
|
-
* credentials store and surfaces them to the rest of the skills CLI.
|
|
7
|
-
*
|
|
8
|
-
* Lookup order:
|
|
9
|
-
* 1. ALMYTY_TOKEN environment variable (CI / scripts)
|
|
10
|
-
* 2. ~/.almyty/credentials.json (interactive use, written
|
|
11
|
-
* by `npx @almyty/auth login`)
|
|
2
|
+
* Thin re-export from the shared @almyty/client credential resolver.
|
|
3
|
+
* Keeps `./auth.js` imports working across the skills-cli codebase.
|
|
12
4
|
*/
|
|
13
|
-
|
|
14
|
-
import { homedir } from 'os';
|
|
15
|
-
import { join } from 'path';
|
|
16
|
-
const CREDENTIALS_FILE = join(homedir(), '.almyty', 'credentials.json');
|
|
17
|
-
function loadCredentials() {
|
|
18
|
-
try {
|
|
19
|
-
if (!existsSync(CREDENTIALS_FILE))
|
|
20
|
-
return null;
|
|
21
|
-
return JSON.parse(readFileSync(CREDENTIALS_FILE, 'utf-8'));
|
|
22
|
-
}
|
|
23
|
-
catch {
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Resolve token: env var > stored credentials. Exits with a clear hint
|
|
29
|
-
* if no credentials are available.
|
|
30
|
-
*/
|
|
31
|
-
export function resolveAuth() {
|
|
32
|
-
const envToken = process.env.ALMYTY_TOKEN;
|
|
33
|
-
// Read URL from: env > config file > default
|
|
34
|
-
let configUrl;
|
|
35
|
-
try {
|
|
36
|
-
const { readFileSync, existsSync } = require('fs');
|
|
37
|
-
const { join } = require('path');
|
|
38
|
-
const { homedir } = require('os');
|
|
39
|
-
const configPath = join(homedir(), '.almyty', 'config.json');
|
|
40
|
-
if (existsSync(configPath)) {
|
|
41
|
-
configUrl = JSON.parse(readFileSync(configPath, 'utf-8')).apiUrl;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
catch { }
|
|
45
|
-
const envUrl = process.env.ALMYTY_URL || configUrl || 'https://api.almyty.com';
|
|
46
|
-
if (envToken) {
|
|
47
|
-
return { url: envUrl, token: envToken };
|
|
48
|
-
}
|
|
49
|
-
const creds = loadCredentials();
|
|
50
|
-
if (creds?.token) {
|
|
51
|
-
return { url: creds.url, token: creds.token };
|
|
52
|
-
}
|
|
53
|
-
console.error('Not authenticated. Run one of:');
|
|
54
|
-
console.error(' npx @almyty/auth login # browser-based login');
|
|
55
|
-
console.error(' export ALMYTY_TOKEN=<token> # for CI');
|
|
56
|
-
process.exit(1);
|
|
57
|
-
}
|
|
5
|
+
export { resolveCredentials, resolveCredentialsOrExit, resolveCredentialsOrExit as resolveAuth, loadCredentials, CREDENTIALS_FILE, } from '@almyty/client';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almyty/skills",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Install API skills into AI coding agents — Claude Code, Cursor, Windsurf, Copilot, Codex",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dist"
|
|
12
12
|
],
|
|
13
13
|
"scripts": {
|
|
14
|
-
"build": "tsc",
|
|
14
|
+
"build": "tsc && chmod +x dist/index.js",
|
|
15
15
|
"dev": "tsx src/index.ts",
|
|
16
16
|
"test": "vitest run",
|
|
17
17
|
"test:watch": "vitest",
|
|
@@ -31,6 +31,9 @@
|
|
|
31
31
|
],
|
|
32
32
|
"author": "almyty",
|
|
33
33
|
"license": "BSL-1.1",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@almyty/client": "^0.1.0"
|
|
36
|
+
},
|
|
34
37
|
"devDependencies": {
|
|
35
38
|
"@types/node": "^25.4.0",
|
|
36
39
|
"tsx": "^4.7.0",
|