autokap 1.0.2 → 1.0.3
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/cli-config.d.ts +13 -0
- package/dist/cli-config.js +42 -0
- package/dist/cli-utils.d.ts +0 -19
- package/dist/cli-utils.js +2 -65
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +266 -305
- package/package.json +23 -16
- package/assets/chrome/ios-statusbar-comparison-reference.jpg +0 -0
- package/assets/chrome/ios-statusbar-dark-reference.jpg +0 -0
- package/assets/chrome/ios-statusbar-light-reference.jpg +0 -0
- package/assets/devices/ipad-pro-11-m4.json +0 -52
- package/assets/devices/iphone-16-pro.json +0 -53
- package/assets/devices/macbook-air-13.json +0 -45
- package/assets/frames/MacBook Air 13.svg +0 -242
- package/assets/frames/Status bar - iPhone.png +0 -0
- package/assets/frames/Status bar and Menu bar- iPad.png +0 -0
- package/assets/frames/iPad Pro M4 11_.png +0 -0
- package/assets/frames/iPhone 16 Pro.png +0 -0
- package/assets/icons/Cellular Connection.svg +0 -3
- package/assets/icons/Union.svg +0 -6
- package/assets/icons/Wifi.svg +0 -3
- package/assets/icons/battery.svg +0 -5
- package/assets/icons/battery_charging.svg +0 -8
- package/dist/abort.d.ts +0 -5
- package/dist/abort.js +0 -44
- package/dist/agent.d.ts +0 -142
- package/dist/agent.js +0 -4504
- package/dist/browser-bar.d.ts +0 -40
- package/dist/browser-bar.js +0 -147
- package/dist/clip-orchestrator.d.ts +0 -148
- package/dist/clip-orchestrator.js +0 -950
- package/dist/clip-postprocess.d.ts +0 -42
- package/dist/clip-postprocess.js +0 -192
- package/dist/credential-templates.d.ts +0 -5
- package/dist/credential-templates.js +0 -60
- package/dist/element-capture.d.ts +0 -53
- package/dist/element-capture.js +0 -766
- package/dist/hybrid-navigator.d.ts +0 -138
- package/dist/hybrid-navigator.js +0 -468
- package/dist/index.d.ts +0 -15
- package/dist/index.js +0 -11
- package/dist/llm-usage.d.ts +0 -17
- package/dist/llm-usage.js +0 -45
- package/dist/mockup-html.d.ts +0 -119
- package/dist/mockup-html.js +0 -253
- package/dist/mockup.d.ts +0 -94
- package/dist/mockup.js +0 -604
- package/dist/mouse-animation.d.ts +0 -46
- package/dist/mouse-animation.js +0 -100
- package/dist/overlay-utils.d.ts +0 -14
- package/dist/overlay-utils.js +0 -13
- package/dist/posthog.d.ts +0 -4
- package/dist/posthog.js +0 -26
- package/dist/prompt-cache.d.ts +0 -10
- package/dist/prompt-cache.js +0 -24
- package/dist/prompts.d.ts +0 -167
- package/dist/prompts.js +0 -1165
- package/dist/security.d.ts +0 -20
- package/dist/security.js +0 -569
- package/dist/session-profile.d.ts +0 -86
- package/dist/session-profile.js +0 -1471
- package/dist/sf-pro-fonts.d.ts +0 -4
- package/dist/sf-pro-fonts.js +0 -7
- package/dist/status-bar-l10n.d.ts +0 -14
- package/dist/status-bar-l10n.js +0 -177
- package/dist/status-bar.d.ts +0 -44
- package/dist/status-bar.js +0 -336
- package/dist/tools.d.ts +0 -4
- package/dist/tools.js +0 -578
- package/dist/video-agent.d.ts +0 -143
- package/dist/video-agent.js +0 -4783
- package/dist/video-observation.d.ts +0 -36
- package/dist/video-observation.js +0 -192
- package/dist/video-planner.d.ts +0 -12
- package/dist/video-planner.js +0 -500
- package/dist/video-prompts.d.ts +0 -37
- package/dist/video-prompts.js +0 -554
- package/dist/video-tools.d.ts +0 -3
- package/dist/video-tools.js +0 -59
- package/dist/video-variant-state.d.ts +0 -29
- package/dist/video-variant-state.js +0 -80
- package/dist/vision-model.d.ts +0 -17
- package/dist/vision-model.js +0 -74
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface AutokapConfig {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
apiBaseUrl: string;
|
|
4
|
+
wsUrl: string;
|
|
5
|
+
}
|
|
6
|
+
declare const DEFAULT_API_BASE_URL = "https://autokap.app";
|
|
7
|
+
declare const DEFAULT_WS_URL = "wss://autokap.app/ws";
|
|
8
|
+
export declare function getConfigDir(): string;
|
|
9
|
+
export declare function getConfigPath(): string;
|
|
10
|
+
export declare function readConfig(): Promise<AutokapConfig | null>;
|
|
11
|
+
export declare function writeConfig(config: AutokapConfig): Promise<void>;
|
|
12
|
+
export declare function requireConfig(): Promise<AutokapConfig>;
|
|
13
|
+
export { DEFAULT_API_BASE_URL, DEFAULT_WS_URL };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import fs from 'node:fs/promises';
|
|
4
|
+
import { logger } from './logger.js';
|
|
5
|
+
const DEFAULT_API_BASE_URL = 'https://autokap.app';
|
|
6
|
+
const DEFAULT_WS_URL = 'wss://autokap.app/ws';
|
|
7
|
+
export function getConfigDir() {
|
|
8
|
+
return path.join(os.homedir(), '.autokap');
|
|
9
|
+
}
|
|
10
|
+
export function getConfigPath() {
|
|
11
|
+
return path.join(getConfigDir(), 'config.json');
|
|
12
|
+
}
|
|
13
|
+
export async function readConfig() {
|
|
14
|
+
try {
|
|
15
|
+
const raw = await fs.readFile(getConfigPath(), 'utf-8');
|
|
16
|
+
const parsed = JSON.parse(raw);
|
|
17
|
+
if (!parsed.apiKey)
|
|
18
|
+
return null;
|
|
19
|
+
return {
|
|
20
|
+
apiKey: parsed.apiKey,
|
|
21
|
+
apiBaseUrl: parsed.apiBaseUrl ?? DEFAULT_API_BASE_URL,
|
|
22
|
+
wsUrl: parsed.wsUrl ?? DEFAULT_WS_URL,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export async function writeConfig(config) {
|
|
30
|
+
await fs.mkdir(getConfigDir(), { recursive: true });
|
|
31
|
+
await fs.writeFile(getConfigPath(), JSON.stringify(config, null, 2), 'utf-8');
|
|
32
|
+
}
|
|
33
|
+
export async function requireConfig() {
|
|
34
|
+
const config = await readConfig();
|
|
35
|
+
if (!config) {
|
|
36
|
+
logger.error('Not authenticated. Run `autokap login <key>` first.');
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
return config;
|
|
40
|
+
}
|
|
41
|
+
export { DEFAULT_API_BASE_URL, DEFAULT_WS_URL };
|
|
42
|
+
//# sourceMappingURL=cli-config.js.map
|
package/dist/cli-utils.d.ts
CHANGED
|
@@ -1,25 +1,6 @@
|
|
|
1
|
-
import type { CaptureManifest, IsolatedElement, LoginCredentials } from './types.js';
|
|
2
|
-
export declare function parseViewport(input: string): {
|
|
3
|
-
width: number;
|
|
4
|
-
height: number;
|
|
5
|
-
};
|
|
6
|
-
export declare function parseViewports(input: string): Array<{
|
|
7
|
-
width: number;
|
|
8
|
-
height: number;
|
|
9
|
-
}>;
|
|
10
|
-
export declare function parseLanguages(input: string): string[];
|
|
11
|
-
export declare function buildThemeList(dark: boolean): Array<'light' | 'dark'>;
|
|
12
|
-
export declare function buildCredentials(opts: {
|
|
13
|
-
email?: string;
|
|
14
|
-
password?: string;
|
|
15
|
-
loginUrl?: string;
|
|
16
|
-
}): LoginCredentials | undefined;
|
|
17
|
-
export declare function parseElements(specs: string[]): IsolatedElement[];
|
|
18
|
-
export declare function stripBuffersFromManifest(manifest: CaptureManifest): object;
|
|
19
1
|
export declare function replaceSkillPlaceholders(content: string, opts: {
|
|
20
2
|
projectUrl?: string;
|
|
21
3
|
projectId?: string;
|
|
22
4
|
apiKey?: string;
|
|
23
5
|
apiBaseUrl?: string;
|
|
24
6
|
}): string;
|
|
25
|
-
export declare function buildRetryPrompt(originalPrompt: string, assessment: string, clarification: string, attemptNumber: number): string;
|
package/dist/cli-utils.js
CHANGED
|
@@ -1,64 +1,3 @@
|
|
|
1
|
-
export function parseViewport(input) {
|
|
2
|
-
const parts = input.split('x').map(Number);
|
|
3
|
-
if (parts.length !== 2 || parts.some(isNaN)) {
|
|
4
|
-
throw new Error(`Invalid viewport format: "${input}". Use WxH (e.g., 1440x900)`);
|
|
5
|
-
}
|
|
6
|
-
return { width: parts[0], height: parts[1] };
|
|
7
|
-
}
|
|
8
|
-
export function parseViewports(input) {
|
|
9
|
-
return input.split(',').map(s => {
|
|
10
|
-
const trimmed = s.trim();
|
|
11
|
-
const parts = trimmed.split('x').map(Number);
|
|
12
|
-
if (parts.length !== 2 || parts.some(isNaN)) {
|
|
13
|
-
throw new Error(`Invalid viewport in --viewports: "${trimmed}". Use WxH (e.g., 1440x900)`);
|
|
14
|
-
}
|
|
15
|
-
return { width: parts[0], height: parts[1] };
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
export function parseLanguages(input) {
|
|
19
|
-
return input.split(',').map(l => l.trim()).filter(Boolean);
|
|
20
|
-
}
|
|
21
|
-
export function buildThemeList(dark) {
|
|
22
|
-
const themes = ['light'];
|
|
23
|
-
if (dark)
|
|
24
|
-
themes.push('dark');
|
|
25
|
-
return themes;
|
|
26
|
-
}
|
|
27
|
-
export function buildCredentials(opts) {
|
|
28
|
-
if (!opts.email && !opts.password)
|
|
29
|
-
return undefined;
|
|
30
|
-
return {
|
|
31
|
-
loginUrl: opts.loginUrl,
|
|
32
|
-
email: opts.email,
|
|
33
|
-
password: opts.password,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export function parseElements(specs) {
|
|
37
|
-
const elements = [];
|
|
38
|
-
for (const spec of specs) {
|
|
39
|
-
const colonIdx = spec.indexOf(':');
|
|
40
|
-
if (colonIdx === -1) {
|
|
41
|
-
throw new Error(`Invalid --element format: "${spec}". Use "name:description"`);
|
|
42
|
-
}
|
|
43
|
-
elements.push({
|
|
44
|
-
name: spec.slice(0, colonIdx).trim(),
|
|
45
|
-
description: spec.slice(colonIdx + 1).trim(),
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
return elements;
|
|
49
|
-
}
|
|
50
|
-
export function stripBuffersFromManifest(manifest) {
|
|
51
|
-
return {
|
|
52
|
-
...manifest,
|
|
53
|
-
captures: manifest.captures.map(c => ({
|
|
54
|
-
...c,
|
|
55
|
-
result: {
|
|
56
|
-
...c.result,
|
|
57
|
-
screenshots: undefined,
|
|
58
|
-
},
|
|
59
|
-
})),
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
1
|
export function replaceSkillPlaceholders(content, opts) {
|
|
63
2
|
let result = content;
|
|
64
3
|
if (opts.projectUrl) {
|
|
@@ -70,11 +9,9 @@ export function replaceSkillPlaceholders(content, opts) {
|
|
|
70
9
|
if (opts.apiKey) {
|
|
71
10
|
result = result.replace(/YOUR_API_KEY/g, opts.apiKey);
|
|
72
11
|
}
|
|
73
|
-
const baseUrl = opts.apiBaseUrl ?? 'https://
|
|
12
|
+
const baseUrl = opts.apiBaseUrl ?? 'https://autokap.app';
|
|
74
13
|
result = result.replace(/https:\/\/app\.autokap\.com/g, baseUrl);
|
|
14
|
+
result = result.replace(/https:\/\/autokap\.com/g, baseUrl);
|
|
75
15
|
return result;
|
|
76
16
|
}
|
|
77
|
-
export function buildRetryPrompt(originalPrompt, assessment, clarification, attemptNumber) {
|
|
78
|
-
return `${originalPrompt}\n\nIMPORTANT CLARIFICATION FROM USER (attempt #${attemptNumber}):\nThe previous attempt failed: "${assessment}"\nUser says: ${clarification}`;
|
|
79
|
-
}
|
|
80
17
|
//# sourceMappingURL=cli-utils.js.map
|
package/dist/cli.d.ts
CHANGED