autokap 1.0.2 → 1.0.4

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.
Files changed (83) hide show
  1. package/dist/cli-config.d.ts +13 -0
  2. package/dist/cli-config.js +42 -0
  3. package/dist/cli-utils.d.ts +0 -19
  4. package/dist/cli-utils.js +2 -65
  5. package/dist/cli.d.ts +0 -1
  6. package/dist/cli.js +266 -305
  7. package/package.json +26 -19
  8. package/assets/chrome/ios-statusbar-comparison-reference.jpg +0 -0
  9. package/assets/chrome/ios-statusbar-dark-reference.jpg +0 -0
  10. package/assets/chrome/ios-statusbar-light-reference.jpg +0 -0
  11. package/assets/devices/ipad-pro-11-m4.json +0 -52
  12. package/assets/devices/iphone-16-pro.json +0 -53
  13. package/assets/devices/macbook-air-13.json +0 -45
  14. package/assets/frames/MacBook Air 13.svg +0 -242
  15. package/assets/frames/Status bar - iPhone.png +0 -0
  16. package/assets/frames/Status bar and Menu bar- iPad.png +0 -0
  17. package/assets/frames/iPad Pro M4 11_.png +0 -0
  18. package/assets/frames/iPhone 16 Pro.png +0 -0
  19. package/assets/icons/Cellular Connection.svg +0 -3
  20. package/assets/icons/Union.svg +0 -6
  21. package/assets/icons/Wifi.svg +0 -3
  22. package/assets/icons/battery.svg +0 -5
  23. package/assets/icons/battery_charging.svg +0 -8
  24. package/dist/abort.d.ts +0 -5
  25. package/dist/abort.js +0 -44
  26. package/dist/agent.d.ts +0 -142
  27. package/dist/agent.js +0 -4504
  28. package/dist/browser-bar.d.ts +0 -40
  29. package/dist/browser-bar.js +0 -147
  30. package/dist/clip-orchestrator.d.ts +0 -148
  31. package/dist/clip-orchestrator.js +0 -950
  32. package/dist/clip-postprocess.d.ts +0 -42
  33. package/dist/clip-postprocess.js +0 -192
  34. package/dist/credential-templates.d.ts +0 -5
  35. package/dist/credential-templates.js +0 -60
  36. package/dist/element-capture.d.ts +0 -53
  37. package/dist/element-capture.js +0 -766
  38. package/dist/hybrid-navigator.d.ts +0 -138
  39. package/dist/hybrid-navigator.js +0 -468
  40. package/dist/index.d.ts +0 -15
  41. package/dist/index.js +0 -11
  42. package/dist/llm-usage.d.ts +0 -17
  43. package/dist/llm-usage.js +0 -45
  44. package/dist/mockup-html.d.ts +0 -119
  45. package/dist/mockup-html.js +0 -253
  46. package/dist/mockup.d.ts +0 -94
  47. package/dist/mockup.js +0 -604
  48. package/dist/mouse-animation.d.ts +0 -46
  49. package/dist/mouse-animation.js +0 -100
  50. package/dist/overlay-utils.d.ts +0 -14
  51. package/dist/overlay-utils.js +0 -13
  52. package/dist/posthog.d.ts +0 -4
  53. package/dist/posthog.js +0 -26
  54. package/dist/prompt-cache.d.ts +0 -10
  55. package/dist/prompt-cache.js +0 -24
  56. package/dist/prompts.d.ts +0 -167
  57. package/dist/prompts.js +0 -1165
  58. package/dist/security.d.ts +0 -20
  59. package/dist/security.js +0 -569
  60. package/dist/session-profile.d.ts +0 -86
  61. package/dist/session-profile.js +0 -1471
  62. package/dist/sf-pro-fonts.d.ts +0 -4
  63. package/dist/sf-pro-fonts.js +0 -7
  64. package/dist/status-bar-l10n.d.ts +0 -14
  65. package/dist/status-bar-l10n.js +0 -177
  66. package/dist/status-bar.d.ts +0 -44
  67. package/dist/status-bar.js +0 -336
  68. package/dist/tools.d.ts +0 -4
  69. package/dist/tools.js +0 -578
  70. package/dist/video-agent.d.ts +0 -143
  71. package/dist/video-agent.js +0 -4783
  72. package/dist/video-observation.d.ts +0 -36
  73. package/dist/video-observation.js +0 -192
  74. package/dist/video-planner.d.ts +0 -12
  75. package/dist/video-planner.js +0 -500
  76. package/dist/video-prompts.d.ts +0 -37
  77. package/dist/video-prompts.js +0 -554
  78. package/dist/video-tools.d.ts +0 -3
  79. package/dist/video-tools.js +0 -59
  80. package/dist/video-variant-state.d.ts +0 -29
  81. package/dist/video-variant-state.js +0 -80
  82. package/dist/vision-model.d.ts +0 -17
  83. 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
@@ -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://app.autokap.com';
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
@@ -1,4 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command } from 'commander';
3
3
  export declare const program: Command;
4
- export declare function main(): Promise<void>;