styrby-cli 0.1.0-beta.1
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/LICENSE +53 -0
- package/README.md +108 -0
- package/dist/daemon/daemonProcess.js +16912 -0
- package/dist/daemon/daemonProcess.js.map +7 -0
- package/dist/index.js +47002 -0
- package/dist/index.js.map +7 -0
- package/dist/lib.js +64 -0
- package/dist/lib.js.map +7 -0
- package/package.json +109 -0
package/dist/lib.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
|
+
|
|
5
|
+
// src/agent/core/AgentRegistry.ts
|
|
6
|
+
var AgentRegistry = class {
|
|
7
|
+
static {
|
|
8
|
+
__name(this, "AgentRegistry");
|
|
9
|
+
}
|
|
10
|
+
factories = /* @__PURE__ */ new Map();
|
|
11
|
+
/**
|
|
12
|
+
* Register a factory function for an agent type.
|
|
13
|
+
*
|
|
14
|
+
* @param id - The agent identifier
|
|
15
|
+
* @param factory - Factory function to create the backend
|
|
16
|
+
*/
|
|
17
|
+
register(id, factory) {
|
|
18
|
+
this.factories.set(id, factory);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Check if an agent type is registered.
|
|
22
|
+
*
|
|
23
|
+
* @param id - The agent identifier to check
|
|
24
|
+
* @returns true if the agent is registered
|
|
25
|
+
*/
|
|
26
|
+
has(id) {
|
|
27
|
+
return this.factories.has(id);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get the list of registered agent identifiers.
|
|
31
|
+
*
|
|
32
|
+
* @returns Array of registered agent IDs
|
|
33
|
+
*/
|
|
34
|
+
list() {
|
|
35
|
+
return Array.from(this.factories.keys());
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Create an agent backend instance.
|
|
39
|
+
*
|
|
40
|
+
* @param id - The agent identifier
|
|
41
|
+
* @param opts - Options for creating the backend
|
|
42
|
+
* @returns The created agent backend
|
|
43
|
+
* @throws Error if the agent type is not registered
|
|
44
|
+
*/
|
|
45
|
+
create(id, opts) {
|
|
46
|
+
const factory = this.factories.get(id);
|
|
47
|
+
if (!factory) {
|
|
48
|
+
const available = this.list().join(", ") || "none";
|
|
49
|
+
throw new Error(`Unknown agent: ${id}. Available agents: ${available}`);
|
|
50
|
+
}
|
|
51
|
+
return factory(opts);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
var agentRegistry = new AgentRegistry();
|
|
55
|
+
|
|
56
|
+
// src/lib.ts
|
|
57
|
+
var VERSION = "0.1.0-beta.1";
|
|
58
|
+
var isDev = process.env.NODE_ENV === "development";
|
|
59
|
+
export {
|
|
60
|
+
AgentRegistry,
|
|
61
|
+
VERSION,
|
|
62
|
+
isDev
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=lib.js.map
|
package/dist/lib.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/agent/core/AgentRegistry.ts", "../src/lib.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * AgentRegistry - Registry for agent backend factories\n * \n * This module provides a central registry for creating agent backends.\n * It allows registering factory functions for different agent types\n * and creating instances of those backends.\n */\n\nimport type { AgentBackend, AgentId } from './AgentBackend';\n\n/** Options passed to agent factory functions */\nexport interface AgentFactoryOptions {\n /** Working directory for the agent */\n cwd: string;\n \n /** Environment variables to pass to the agent */\n env?: Record<string, string>;\n}\n\n/** Factory function type for creating agent backends */\nexport type AgentFactory = (opts: AgentFactoryOptions) => AgentBackend;\n\n/**\n * Registry for agent backend factories.\n * \n * Use this to register and create agent backends by their identifier.\n * \n * @example\n * ```ts\n * const registry = new AgentRegistry();\n * registry.register('gemini', createGeminiBackend);\n * \n * const backend = registry.create('gemini', { cwd: process.cwd() });\n * await backend.startSession('Hello!');\n * ```\n */\nexport class AgentRegistry {\n private factories = new Map<AgentId, AgentFactory>();\n\n /**\n * Register a factory function for an agent type.\n * \n * @param id - The agent identifier\n * @param factory - Factory function to create the backend\n */\n register(id: AgentId, factory: AgentFactory): void {\n this.factories.set(id, factory);\n }\n\n /**\n * Check if an agent type is registered.\n * \n * @param id - The agent identifier to check\n * @returns true if the agent is registered\n */\n has(id: AgentId): boolean {\n return this.factories.has(id);\n }\n\n /**\n * Get the list of registered agent identifiers.\n * \n * @returns Array of registered agent IDs\n */\n list(): AgentId[] {\n return Array.from(this.factories.keys());\n }\n\n /**\n * Create an agent backend instance.\n * \n * @param id - The agent identifier\n * @param opts - Options for creating the backend\n * @returns The created agent backend\n * @throws Error if the agent type is not registered\n */\n create(id: AgentId, opts: AgentFactoryOptions): AgentBackend {\n const factory = this.factories.get(id);\n if (!factory) {\n const available = this.list().join(', ') || 'none';\n throw new Error(`Unknown agent: ${id}. Available agents: ${available}`);\n }\n return factory(opts);\n }\n}\n\n/** Global agent registry instance */\nexport const agentRegistry = new AgentRegistry();\n\n", "/**\n * Styrby CLI Library Exports\n *\n * Re-exports core functionality for external use.\n * This module provides the public API for the CLI.\n *\n * @module lib\n */\n\n// Agent types and interfaces\nexport type {\n AgentBackend,\n AgentId,\n AgentTransport,\n AgentBackendConfig,\n SessionId,\n ToolCallId,\n AgentMessage,\n AgentMessageHandler,\n StartSessionResult,\n} from './agent/core/AgentBackend';\n\n// Agent registry\nexport { AgentRegistry } from './agent/core/AgentRegistry';\n\n// Re-export shared types\nexport type {\n AgentType,\n SessionStatus,\n ConnectionStatus,\n ErrorSource,\n RiskLevel,\n PermissionRequest,\n SessionCost,\n SubscriptionTier,\n} from 'styrby-shared';\n\n/**\n * Version of the Styrby CLI\n */\nexport const VERSION = '0.1.0-beta.1';\n\n/**\n * Check if running in development mode\n */\nexport const isDev = process.env.NODE_ENV === 'development';\n"],
|
|
5
|
+
"mappings": ";;;;;AAoCO,IAAM,gBAAN,MAAoB;AAAA,EApC3B,OAoC2B;AAAA;AAAA;AAAA,EACjB,YAAY,oBAAI,IAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQnD,SAAS,IAAa,SAA6B;AACjD,SAAK,UAAU,IAAI,IAAI,OAAO;AAAA,EAChC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAI,IAAsB;AACxB,WAAO,KAAK,UAAU,IAAI,EAAE;AAAA,EAC9B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAkB;AAChB,WAAO,MAAM,KAAK,KAAK,UAAU,KAAK,CAAC;AAAA,EACzC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,OAAO,IAAa,MAAyC;AAC3D,UAAM,UAAU,KAAK,UAAU,IAAI,EAAE;AACrC,QAAI,CAAC,SAAS;AACZ,YAAM,YAAY,KAAK,KAAK,EAAE,KAAK,IAAI,KAAK;AAC5C,YAAM,IAAI,MAAM,kBAAkB,EAAE,uBAAuB,SAAS,EAAE;AAAA,IACxE;AACA,WAAO,QAAQ,IAAI;AAAA,EACrB;AACF;AAGO,IAAM,gBAAgB,IAAI,cAAc;;;AC/CxC,IAAM,UAAU;AAKhB,IAAM,QAAQ,QAAQ,IAAI,aAAa;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "styrby-cli",
|
|
3
|
+
"version": "0.1.0-beta.1",
|
|
4
|
+
"description": "Mobile remote control for AI coding agents. Control Claude Code, Codex, Gemini, and OpenCode from your phone.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Steel Motion LLC",
|
|
7
|
+
"email": "security@steelmotionllc.com",
|
|
8
|
+
"url": "https://steelmotionllc.com"
|
|
9
|
+
},
|
|
10
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"bin": {
|
|
13
|
+
"styrby": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"main": "./dist/lib.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/lib.js"
|
|
21
|
+
},
|
|
22
|
+
"./cli": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"LICENSE",
|
|
30
|
+
"README.md",
|
|
31
|
+
"SECURITY.md"
|
|
32
|
+
],
|
|
33
|
+
"keywords": [
|
|
34
|
+
"ai",
|
|
35
|
+
"coding",
|
|
36
|
+
"assistant",
|
|
37
|
+
"claude",
|
|
38
|
+
"codex",
|
|
39
|
+
"gemini",
|
|
40
|
+
"opencode",
|
|
41
|
+
"aider",
|
|
42
|
+
"mobile",
|
|
43
|
+
"remote",
|
|
44
|
+
"cli",
|
|
45
|
+
"terminal",
|
|
46
|
+
"vibe-coding",
|
|
47
|
+
"pair-programming",
|
|
48
|
+
"anthropic",
|
|
49
|
+
"openai",
|
|
50
|
+
"google"
|
|
51
|
+
],
|
|
52
|
+
"repository": {
|
|
53
|
+
"type": "git",
|
|
54
|
+
"url": "git+https://github.com/VetSecItPro/styrby-app.git",
|
|
55
|
+
"directory": "packages/styrby-cli"
|
|
56
|
+
},
|
|
57
|
+
"homepage": "https://styrbyapp.com",
|
|
58
|
+
"bugs": {
|
|
59
|
+
"url": "https://github.com/VetSecItPro/styrby-app/issues"
|
|
60
|
+
},
|
|
61
|
+
"funding": {
|
|
62
|
+
"type": "individual",
|
|
63
|
+
"url": "https://styrbyapp.com/pricing"
|
|
64
|
+
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"dev": "tsx src/index.ts",
|
|
67
|
+
"build": "node scripts/build.mjs",
|
|
68
|
+
"build:types": "tsc --emitDeclarationOnly",
|
|
69
|
+
"typecheck": "tsc --noEmit",
|
|
70
|
+
"test": "vitest run",
|
|
71
|
+
"audit": "pnpm audit --audit-level=high",
|
|
72
|
+
"prepublishOnly": "echo 'Skipping prepublishOnly — CI handles audit+typecheck+build'"
|
|
73
|
+
},
|
|
74
|
+
"dependencies": {
|
|
75
|
+
"@agentclientprotocol/sdk": "^0.8.0",
|
|
76
|
+
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
77
|
+
"@stablelib/base64": "^2.0.1",
|
|
78
|
+
"@stablelib/hex": "^2.0.1",
|
|
79
|
+
"@supabase/supabase-js": "^2.45.0",
|
|
80
|
+
"axios": "^1.13.6",
|
|
81
|
+
"chalk": "^5.6.2",
|
|
82
|
+
"http-proxy": "^1.18.1",
|
|
83
|
+
"ink": "^6.5.1",
|
|
84
|
+
"open": "^11.0.0",
|
|
85
|
+
"qrcode-terminal": "^0.12.0",
|
|
86
|
+
"react": "^19.2.0",
|
|
87
|
+
"tweetnacl": "^1.0.3",
|
|
88
|
+
"zod": "^3.25.76"
|
|
89
|
+
},
|
|
90
|
+
"devDependencies": {
|
|
91
|
+
"@types/cross-spawn": "^6.0.6",
|
|
92
|
+
"@types/http-proxy": "^1.17.17",
|
|
93
|
+
"@types/node": "~22.15.0",
|
|
94
|
+
"@types/qrcode-terminal": "^0.12.2",
|
|
95
|
+
"@types/react": "^19.2.7",
|
|
96
|
+
"@types/tmp": "^0.2.6",
|
|
97
|
+
"@vitest/coverage-v8": "4.0.18",
|
|
98
|
+
"cross-spawn": "^7.0.6",
|
|
99
|
+
"esbuild": "^0.27.2",
|
|
100
|
+
"tmp": "^0.2.5",
|
|
101
|
+
"tsc-alias": "^1.8.16",
|
|
102
|
+
"tsx": "^4.20.6",
|
|
103
|
+
"typescript": "5.9.3",
|
|
104
|
+
"vitest": "^3.2.4"
|
|
105
|
+
},
|
|
106
|
+
"engines": {
|
|
107
|
+
"node": ">=20.0.0"
|
|
108
|
+
}
|
|
109
|
+
}
|