@agenshield/daemon 0.1.0

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 (124) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +118 -0
  3. package/acl.d.ts +44 -0
  4. package/acl.d.ts.map +1 -0
  5. package/auth/index.d.ts +9 -0
  6. package/auth/index.d.ts.map +1 -0
  7. package/auth/middleware.d.ts +49 -0
  8. package/auth/middleware.d.ts.map +1 -0
  9. package/auth/passcode.d.ts +70 -0
  10. package/auth/passcode.d.ts.map +1 -0
  11. package/auth/session.d.ts +71 -0
  12. package/auth/session.d.ts.map +1 -0
  13. package/command-sync.d.ts +41 -0
  14. package/command-sync.d.ts.map +1 -0
  15. package/config/defaults.d.ts +10 -0
  16. package/config/defaults.d.ts.map +1 -0
  17. package/config/index.d.ts +7 -0
  18. package/config/index.d.ts.map +1 -0
  19. package/config/loader.d.ts +25 -0
  20. package/config/loader.d.ts.map +1 -0
  21. package/config/paths.d.ts +20 -0
  22. package/config/paths.d.ts.map +1 -0
  23. package/data/integration-catalog.d.ts +32 -0
  24. package/data/integration-catalog.d.ts.map +1 -0
  25. package/events/emitter.d.ts +126 -0
  26. package/events/emitter.d.ts.map +1 -0
  27. package/events/index.d.ts +5 -0
  28. package/events/index.d.ts.map +1 -0
  29. package/index.d.ts +19 -0
  30. package/index.d.ts.map +1 -0
  31. package/index.js +7591 -0
  32. package/main.d.ts +6 -0
  33. package/main.d.ts.map +1 -0
  34. package/main.js +7539 -0
  35. package/mcp/client.d.ts +73 -0
  36. package/mcp/client.d.ts.map +1 -0
  37. package/mcp/index.d.ts +7 -0
  38. package/mcp/index.d.ts.map +1 -0
  39. package/mcp/oauth-provider.d.ts +27 -0
  40. package/mcp/oauth-provider.d.ts.map +1 -0
  41. package/mcp/state.d.ts +31 -0
  42. package/mcp/state.d.ts.map +1 -0
  43. package/package.json +43 -0
  44. package/routes/agenco.d.ts +13 -0
  45. package/routes/agenco.d.ts.map +1 -0
  46. package/routes/auth.d.ts +11 -0
  47. package/routes/auth.d.ts.map +1 -0
  48. package/routes/config.d.ts +6 -0
  49. package/routes/config.d.ts.map +1 -0
  50. package/routes/discovery.d.ts +8 -0
  51. package/routes/discovery.d.ts.map +1 -0
  52. package/routes/exec.d.ts +6 -0
  53. package/routes/exec.d.ts.map +1 -0
  54. package/routes/fs.d.ts +6 -0
  55. package/routes/fs.d.ts.map +1 -0
  56. package/routes/health.d.ts +6 -0
  57. package/routes/health.d.ts.map +1 -0
  58. package/routes/index.d.ts +9 -0
  59. package/routes/index.d.ts.map +1 -0
  60. package/routes/marketplace.d.ts +9 -0
  61. package/routes/marketplace.d.ts.map +1 -0
  62. package/routes/rpc.d.ts +9 -0
  63. package/routes/rpc.d.ts.map +1 -0
  64. package/routes/secrets.d.ts +6 -0
  65. package/routes/secrets.d.ts.map +1 -0
  66. package/routes/security.d.ts +6 -0
  67. package/routes/security.d.ts.map +1 -0
  68. package/routes/skills.d.ts +11 -0
  69. package/routes/skills.d.ts.map +1 -0
  70. package/routes/sse.d.ts +9 -0
  71. package/routes/sse.d.ts.map +1 -0
  72. package/routes/status.d.ts +6 -0
  73. package/routes/status.d.ts.map +1 -0
  74. package/routes/wrappers.d.ts +12 -0
  75. package/routes/wrappers.d.ts.map +1 -0
  76. package/server.d.ts +18 -0
  77. package/server.d.ts.map +1 -0
  78. package/services/activity-log.d.ts +21 -0
  79. package/services/activity-log.d.ts.map +1 -0
  80. package/services/broker-bridge.d.ts +43 -0
  81. package/services/broker-bridge.d.ts.map +1 -0
  82. package/services/integration-skills.d.ts +26 -0
  83. package/services/integration-skills.d.ts.map +1 -0
  84. package/services/marketplace.d.ts +79 -0
  85. package/services/marketplace.d.ts.map +1 -0
  86. package/services/openclaw-config.d.ts +15 -0
  87. package/services/openclaw-config.d.ts.map +1 -0
  88. package/services/skill-analyzer.d.ts +21 -0
  89. package/services/skill-analyzer.d.ts.map +1 -0
  90. package/services/skill-lifecycle.d.ts +23 -0
  91. package/services/skill-lifecycle.d.ts.map +1 -0
  92. package/state/index.d.ts +76 -0
  93. package/state/index.d.ts.map +1 -0
  94. package/static.d.ts +9 -0
  95. package/static.d.ts.map +1 -0
  96. package/ui-assets/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
  97. package/ui-assets/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
  98. package/ui-assets/assets/index-CC_zbvUx.css +1 -0
  99. package/ui-assets/assets/index-Chp3YFDr.js +947 -0
  100. package/ui-assets/assets/manrope-latin-400-normal-8tf8FM3T.woff +0 -0
  101. package/ui-assets/assets/manrope-latin-400-normal-PaqtzbVb.woff2 +0 -0
  102. package/ui-assets/assets/manrope-latin-500-normal-BYYD-dBL.woff2 +0 -0
  103. package/ui-assets/assets/manrope-latin-500-normal-DMZssgOp.woff +0 -0
  104. package/ui-assets/assets/manrope-latin-600-normal-4f0koTD-.woff2 +0 -0
  105. package/ui-assets/assets/manrope-latin-600-normal-BqgrALkZ.woff +0 -0
  106. package/ui-assets/assets/manrope-latin-700-normal-BZp_XxE4.woff2 +0 -0
  107. package/ui-assets/assets/manrope-latin-700-normal-DGRFkw-m.woff +0 -0
  108. package/ui-assets/assets/manrope-latin-800-normal-BfWYOv1c.woff2 +0 -0
  109. package/ui-assets/assets/manrope-latin-800-normal-uHUdIJgA.woff +0 -0
  110. package/ui-assets/favicon.svg +1 -0
  111. package/ui-assets/index.html +14 -0
  112. package/ui-assets/package.json +34 -0
  113. package/utils/logged-fetch.d.ts +13 -0
  114. package/utils/logged-fetch.d.ts.map +1 -0
  115. package/vault/crypto.d.ts +28 -0
  116. package/vault/crypto.d.ts.map +1 -0
  117. package/vault/index.d.ts +64 -0
  118. package/vault/index.d.ts.map +1 -0
  119. package/watchers/index.d.ts +6 -0
  120. package/watchers/index.d.ts.map +1 -0
  121. package/watchers/security.d.ts +20 -0
  122. package/watchers/security.d.ts.map +1 -0
  123. package/watchers/skills.d.ts +85 -0
  124. package/watchers/skills.d.ts.map +1 -0
@@ -0,0 +1,73 @@
1
+ /**
2
+ * MCP Client — thin wrapper around the official SDK
3
+ *
4
+ * Uses Client + StreamableHTTPClientTransport with VaultOAuthProvider
5
+ * for automatic OAuth (DCR, PKCE, token exchange, refresh, 401 retry).
6
+ *
7
+ * On-demand connection model: each operation opens a fresh connection,
8
+ * executes, and closes immediately. No persistent connection is maintained.
9
+ * State `connected` means "authenticated and ready for on-demand calls".
10
+ */
11
+ export type MCPConnectionState = 'disconnected' | 'connecting' | 'connected' | 'error' | 'unauthorized';
12
+ /**
13
+ * Typed error thrown when the MCP connection is unauthorized.
14
+ * Routes catch this to return structured `{ error: 'unauthorized' }` responses.
15
+ */
16
+ export declare class MCPUnauthorizedError extends Error {
17
+ constructor(message?: string);
18
+ }
19
+ export interface MCPTool {
20
+ name: string;
21
+ description: string;
22
+ inputSchema: Record<string, unknown>;
23
+ integration?: string;
24
+ }
25
+ export interface MCPToolResult {
26
+ content: Array<{
27
+ type: string;
28
+ text?: string;
29
+ data?: unknown;
30
+ }>;
31
+ isError?: boolean;
32
+ }
33
+ export declare class MCPClient {
34
+ private provider;
35
+ private gatewayUrl;
36
+ private state;
37
+ private active;
38
+ /** Transport kept only during the OAuth flow (activate → finishAuth) */
39
+ private authTransport;
40
+ /** Called when the connection state changes */
41
+ onStateChange?: (state: MCPConnectionState) => void;
42
+ constructor(gatewayUrl: string, daemonPort: number);
43
+ /**
44
+ * Activate the MCP client.
45
+ * Tries a probe connection to verify stored tokens are valid.
46
+ * Returns { authUrl } if the user needs to complete OAuth in a browser.
47
+ */
48
+ activate(): Promise<{
49
+ authUrl?: string;
50
+ }>;
51
+ /**
52
+ * Complete OAuth after receiving the authorization code.
53
+ * The SDK exchanges the code for tokens, then we verify with a probe connection.
54
+ */
55
+ finishAuth(code: string): Promise<void>;
56
+ /** Mark the client as deactivated */
57
+ deactivate(): Promise<void>;
58
+ /** Whether the client has been activated */
59
+ isActive(): boolean;
60
+ /** Current connection state */
61
+ getState(): MCPConnectionState;
62
+ /** List all available tools from the MCP gateway (on-demand connection) */
63
+ listTools(): Promise<MCPTool[]>;
64
+ /** Call a tool on the MCP gateway (on-demand connection) */
65
+ callTool(name: string, args: Record<string, unknown>): Promise<MCPToolResult>;
66
+ /**
67
+ * Open a temporary connection, run `fn`, then close.
68
+ * Handles UnauthorizedError → sets state and throws MCPUnauthorizedError.
69
+ */
70
+ private withConnection;
71
+ private setState;
72
+ }
73
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/mcp/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AASH,MAAM,MAAM,kBAAkB,GAAG,cAAc,GAAG,YAAY,GAAG,WAAW,GAAG,OAAO,GAAG,cAAc,CAAC;AAExG;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,OAAO,SAA+E;CAInG;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAChE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAqB;IACrC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,KAAK,CAAsC;IACnD,OAAO,CAAC,MAAM,CAAS;IAEvB,wEAAwE;IACxE,OAAO,CAAC,aAAa,CAA8C;IAEnE,+CAA+C;IAC/C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;gBAExC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAKlD;;;;OAIG;IACG,QAAQ,IAAI,OAAO,CAAC;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAwC/C;;;OAGG;IACG,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAmC7C,qCAAqC;IAC/B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAMjC,4CAA4C;IAC5C,QAAQ,IAAI,OAAO;IAInB,+BAA+B;IAC/B,QAAQ,IAAI,kBAAkB;IAI9B,2EAA2E;IACrE,SAAS,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAWrC,4DAA4D;IACtD,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IASnF;;;OAGG;YACW,cAAc;IA2B5B,OAAO,CAAC,QAAQ;CAMjB"}
package/mcp/index.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * MCP module exports
3
+ */
4
+ export { MCPClient, MCPUnauthorizedError } from './client';
5
+ export type { MCPConnectionState, MCPTool, MCPToolResult } from './client';
6
+ export { getMCPClient, activateMCP, deactivateMCP, getMCPState, finishMCPAuth } from './state';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAC3D,YAAY,EAAE,kBAAkB,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Vault-backed OAuth provider for MCP SDK
3
+ *
4
+ * Implements OAuthClientProvider using the encrypted vault for
5
+ * persisting client credentials and tokens. PKCE code verifier
6
+ * is kept in-memory (single auth session at a time).
7
+ */
8
+ import type { OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js';
9
+ import type { OAuthClientMetadata, OAuthTokens, OAuthClientInformationFull } from '@modelcontextprotocol/sdk/shared/auth.js';
10
+ export declare class VaultOAuthProvider implements OAuthClientProvider {
11
+ private _codeVerifier;
12
+ private _authUrl;
13
+ private daemonPort;
14
+ constructor(daemonPort: number);
15
+ /** Auth URL captured during redirectToAuthorization */
16
+ get capturedAuthUrl(): string | null;
17
+ get redirectUrl(): string;
18
+ get clientMetadata(): OAuthClientMetadata;
19
+ clientInformation(): Promise<OAuthClientInformationFull | undefined>;
20
+ saveClientInformation(info: OAuthClientInformationFull): Promise<void>;
21
+ tokens(): Promise<OAuthTokens | undefined>;
22
+ saveTokens(tokens: OAuthTokens): Promise<void>;
23
+ redirectToAuthorization(authorizationUrl: URL): Promise<void>;
24
+ saveCodeVerifier(codeVerifier: string): Promise<void>;
25
+ codeVerifier(): Promise<string>;
26
+ }
27
+ //# sourceMappingURL=oauth-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-provider.d.ts","sourceRoot":"","sources":["../../src/mcp/oauth-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,KAAK,EACV,mBAAmB,EACnB,WAAW,EACX,0BAA0B,EAC3B,MAAM,0CAA0C,CAAC;AASlD,qBAAa,kBAAmB,YAAW,mBAAmB;IAC5D,OAAO,CAAC,aAAa,CAAM;IAC3B,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,UAAU,CAAS;gBAEf,UAAU,EAAE,MAAM;IAI9B,uDAAuD;IACvD,IAAI,eAAe,IAAI,MAAM,GAAG,IAAI,CAEnC;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,cAAc,IAAI,mBAAmB,CAQxC;IAEK,iBAAiB,IAAI,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC;IAepE,qBAAqB,CAAC,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,IAAI,CAAC;IAatE,MAAM,IAAI,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAe1C,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB9C,uBAAuB,CAAC,gBAAgB,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAM7D,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKrD,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC;CAGtC"}
package/mcp/state.d.ts ADDED
@@ -0,0 +1,31 @@
1
+ /**
2
+ * MCP client lifecycle manager
3
+ *
4
+ * Singleton management for the MCP client instance.
5
+ */
6
+ import { MCPClient, type MCPConnectionState } from './client';
7
+ /**
8
+ * Get the current MCP client instance (or null if not initialized)
9
+ */
10
+ export declare function getMCPClient(): MCPClient | null;
11
+ /**
12
+ * Create and activate the MCP client.
13
+ * @param daemonPort The port the daemon is listening on (for OAuth redirect_uri)
14
+ * @returns { authUrl } if the user needs to complete OAuth in a browser
15
+ */
16
+ export declare function activateMCP(daemonPort: number): Promise<{
17
+ authUrl?: string;
18
+ }>;
19
+ /**
20
+ * Complete the OAuth flow with an authorization code.
21
+ */
22
+ export declare function finishMCPAuth(code: string): Promise<void>;
23
+ /**
24
+ * Deactivate and destroy the MCP client
25
+ */
26
+ export declare function deactivateMCP(): Promise<void>;
27
+ /**
28
+ * Get the current MCP connection state
29
+ */
30
+ export declare function getMCPState(): MCPConnectionState;
31
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/mcp/state.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAU9D;;GAEG;AACH,wBAAgB,YAAY,IAAI,SAAS,GAAG,IAAI,CAE/C;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAoCnF;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAK/D;AAED;;GAEG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAMnD;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,kBAAkB,CAGhD"}
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@agenshield/daemon",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "AgenShield HTTP daemon server with embedded UI",
6
+ "main": "./index.js",
7
+ "types": "./index.d.ts",
8
+ "bin": {
9
+ "agenshield-daemon": "./main.js"
10
+ },
11
+ "exports": {
12
+ "./package.json": "./package.json",
13
+ ".": {
14
+ "types": "./index.d.ts",
15
+ "import": "./index.js",
16
+ "default": "./index.js"
17
+ }
18
+ },
19
+ "files": [
20
+ "**/*.js",
21
+ "**/*.d.ts",
22
+ "**/*.d.ts.map",
23
+ "ui-assets"
24
+ ],
25
+ "license": "MIT",
26
+ "dependencies": {
27
+ "@agenshield/ipc": "0.1.0",
28
+ "@agenshield/broker": "0.1.0",
29
+ "@agenshield/sandbox": "0.1.0",
30
+ "@modelcontextprotocol/sdk": "^1.26.0",
31
+ "fastify": "^5.7.0",
32
+ "zod": "^4.3.6",
33
+ "@frontmcp/sdk": "^0.8.1",
34
+ "@fastify/static": "^8.3.0",
35
+ "@fastify/cors": "^11.0.0",
36
+ "jszip": "^3.10.1"
37
+ },
38
+ "devDependencies": {
39
+ "@types/node": "^24.0.0",
40
+ "tsx": "^4.21.0",
41
+ "typescript": "^5.9.3"
42
+ }
43
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * AgenCo API routes
3
+ *
4
+ * Routes for AgenCo authentication and tool execution.
5
+ * Tool/integration routes use the MCP client; auth routes handle OAuth
6
+ * via the official MCP SDK (DCR, PKCE, token exchange, refresh are automatic).
7
+ */
8
+ import type { FastifyInstance } from 'fastify';
9
+ /**
10
+ * Register AgenCo routes
11
+ */
12
+ export declare function agencoRoutes(app: FastifyInstance): Promise<void>;
13
+ //# sourceMappingURL=agenco.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agenco.d.ts","sourceRoot":"","sources":["../../src/routes/agenco.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAgC,MAAM,SAAS,CAAC;AAiK7E;;GAEG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAsbtE"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Authentication routes
3
+ *
4
+ * Handles passcode setup, authentication, and session management.
5
+ */
6
+ import type { FastifyInstance } from 'fastify';
7
+ /**
8
+ * Register authentication routes
9
+ */
10
+ export declare function authRoutes(app: FastifyInstance): Promise<void>;
11
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/routes/auth.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAgC,MAAM,SAAS,CAAC;AAiC7E;;GAEG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAkVpE"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Configuration routes
3
+ */
4
+ import type { FastifyInstance } from 'fastify';
5
+ export declare function configRoutes(app: FastifyInstance): Promise<void>;
6
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/routes/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAgC,MAAM,SAAS,CAAC;AAa7E,wBAAsB,YAAY,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAoHtE"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Discovery routes — GET /discovery/scan
3
+ *
4
+ * Provides a cached system discovery scan covering binaries and skills.
5
+ */
6
+ import type { FastifyInstance } from 'fastify';
7
+ export declare function discoveryRoutes(app: FastifyInstance): Promise<void>;
8
+ //# sourceMappingURL=discovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/routes/discovery.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAS/C,wBAAsB,eAAe,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBzE"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Exec command allowlist management routes
3
+ */
4
+ import type { FastifyInstance } from 'fastify';
5
+ export declare function execRoutes(app: FastifyInstance): Promise<void>;
6
+ //# sourceMappingURL=exec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../src/routes/exec.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAyF/C,wBAAsB,UAAU,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAwHpE"}
package/routes/fs.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Filesystem browse route
3
+ */
4
+ import type { FastifyInstance } from 'fastify';
5
+ export declare function fsRoutes(app: FastifyInstance): Promise<void>;
6
+ //# sourceMappingURL=fs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/routes/fs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAK/C,wBAAsB,QAAQ,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAmClE"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Health check route
3
+ */
4
+ import type { FastifyInstance } from 'fastify';
5
+ export declare function healthRoutes(app: FastifyInstance): Promise<void>;
6
+ //# sourceMappingURL=health.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/routes/health.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C,wBAAsB,YAAY,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAWtE"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Route registration
3
+ */
4
+ import type { FastifyInstance } from 'fastify';
5
+ /**
6
+ * Register all API routes under the /api prefix
7
+ */
8
+ export declare function registerRoutes(app: FastifyInstance): Promise<void>;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routes/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAoB/C;;GAEG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAsFxE"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Marketplace Routes
3
+ *
4
+ * Proxy endpoints for ClawHub marketplace search/detail,
5
+ * agen.co vulnerability analysis, and local skill installation.
6
+ */
7
+ import type { FastifyInstance } from 'fastify';
8
+ export declare function marketplaceRoutes(app: FastifyInstance): Promise<void>;
9
+ //# sourceMappingURL=marketplace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marketplace.d.ts","sourceRoot":"","sources":["../../src/routes/marketplace.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAgC,MAAM,SAAS,CAAC;AAmC7E,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAsX3E"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * JSON-RPC endpoint for the interceptor
3
+ *
4
+ * Handles policy_check, events_batch, http_request, and ping methods.
5
+ * Registered at root level (not under /api) so it skips auth middleware.
6
+ */
7
+ import type { FastifyInstance } from 'fastify';
8
+ export declare function rpcRoutes(app: FastifyInstance): Promise<void>;
9
+ //# sourceMappingURL=rpc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../../src/routes/rpc.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAgC,MAAM,SAAS,CAAC;AAsQ7E,wBAAsB,SAAS,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA0CnE"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Secrets routes — CRUD backed by encrypted vault
3
+ */
4
+ import type { FastifyInstance } from 'fastify';
5
+ export declare function secretsRoutes(app: FastifyInstance): Promise<void>;
6
+ //# sourceMappingURL=secrets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../src/routes/secrets.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AA6B/C,wBAAsB,aAAa,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA2FvE"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Security status route
3
+ */
4
+ import type { FastifyInstance } from 'fastify';
5
+ export declare function securityRoutes(app: FastifyInstance): Promise<void>;
6
+ //# sourceMappingURL=security.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../src/routes/security.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAI/C,wBAAsB,cAAc,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAwCxE"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Skills Management Routes
3
+ *
4
+ * API endpoints for managing agent skills (approved and quarantined).
5
+ */
6
+ import type { FastifyInstance } from 'fastify';
7
+ /**
8
+ * Register skills management routes
9
+ */
10
+ export declare function skillsRoutes(app: FastifyInstance): Promise<void>;
11
+ //# sourceMappingURL=skills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/routes/skills.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAgC,MAAM,SAAS,CAAC;AA0C7E;;GAEG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAuYtE"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Server-Sent Events (SSE) route for real-time updates
3
+ */
4
+ import type { FastifyInstance } from 'fastify';
5
+ /**
6
+ * Register SSE routes
7
+ */
8
+ export declare function sseRoutes(app: FastifyInstance): Promise<void>;
9
+ //# sourceMappingURL=sse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../src/routes/sse.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAgC,MAAM,SAAS,CAAC;AAsB7E;;GAEG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAmInE"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Status route
3
+ */
4
+ import type { FastifyInstance } from 'fastify';
5
+ export declare function statusRoutes(app: FastifyInstance): Promise<void>;
6
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/routes/status.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAO/C,wBAAsB,YAAY,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBtE"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Wrapper management routes
3
+ *
4
+ * Provides API endpoints for dynamic wrapper management.
5
+ * Allows adding, removing, updating wrappers based on policy configuration.
6
+ */
7
+ import type { FastifyInstance } from 'fastify';
8
+ /**
9
+ * Register wrapper management routes
10
+ */
11
+ export declare function wrappersRoutes(app: FastifyInstance): Promise<void>;
12
+ //# sourceMappingURL=wrappers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrappers.d.ts","sourceRoot":"","sources":["../../src/routes/wrappers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAgC,MAAM,SAAS,CAAC;AA2D7E;;GAEG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA8XxE"}
package/server.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Fastify server setup for AgenShield daemon
3
+ */
4
+ import { type FastifyInstance } from 'fastify';
5
+ import type { DaemonConfig } from '@agenshield/ipc';
6
+ /**
7
+ * Create and configure the Fastify server
8
+ * @param config Daemon configuration
9
+ * @returns Configured Fastify instance
10
+ */
11
+ export declare function createServer(config: DaemonConfig): Promise<FastifyInstance>;
12
+ /**
13
+ * Start the server
14
+ * @param config Daemon configuration
15
+ * @returns The running Fastify instance
16
+ */
17
+ export declare function startServer(config: DaemonConfig): Promise<FastifyInstance>;
18
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAGxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAUpD;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,CAgCjF;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,CAuDhF"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Persistent activity log with rotation
3
+ *
4
+ * Appends every daemon event as JSONL to ~/.agenshield/activity.jsonl.
5
+ * Rotation: max 100 MB file size (keep newest half), max 24 h retention.
6
+ */
7
+ export declare class ActivityLog {
8
+ private filePath;
9
+ private writeCount;
10
+ private unsubscribe?;
11
+ constructor();
12
+ start(): void;
13
+ stop(): void;
14
+ private append;
15
+ private rotate;
16
+ /** Keep newest half of lines when file exceeds size limit */
17
+ private truncateBySize;
18
+ /** Remove entries older than 24 hours */
19
+ private pruneOldEntries;
20
+ }
21
+ //# sourceMappingURL=activity-log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activity-log.d.ts","sourceRoot":"","sources":["../../src/services/activity-log.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,WAAW,CAAC,CAAa;;IAMjC,KAAK,IAAI,IAAI;IAOb,IAAI,IAAI,IAAI;IAIZ,OAAO,CAAC,MAAM;IAWd,OAAO,CAAC,MAAM;IAYd,6DAA6D;IAC7D,OAAO,CAAC,cAAc;IAOtB,yCAAyC;IACzC,OAAO,CAAC,eAAe;CAiBxB"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Broker Bridge Service
3
+ *
4
+ * Provides helper functions for daemon-to-broker communication.
5
+ * Used for privileged operations that require broker's elevated permissions.
6
+ */
7
+ import { type SkillInstallResult, type SkillUninstallResult } from '@agenshield/broker';
8
+ /**
9
+ * Check if the broker is available
10
+ */
11
+ export declare function isBrokerAvailable(): Promise<boolean>;
12
+ /**
13
+ * Install a skill via the broker
14
+ *
15
+ * @param slug - Skill slug (directory name)
16
+ * @param files - Array of files to install
17
+ * @param options - Installation options
18
+ * @returns Installation result
19
+ */
20
+ export declare function installSkillViaBroker(slug: string, files: Array<{
21
+ name: string;
22
+ content: string;
23
+ }>, options?: {
24
+ createWrapper?: boolean;
25
+ agentHome?: string;
26
+ socketGroup?: string;
27
+ }): Promise<SkillInstallResult>;
28
+ /**
29
+ * Uninstall a skill via the broker
30
+ *
31
+ * @param slug - Skill slug to uninstall
32
+ * @param options - Uninstallation options
33
+ * @returns Uninstallation result
34
+ */
35
+ export declare function uninstallSkillViaBroker(slug: string, options?: {
36
+ removeWrapper?: boolean;
37
+ agentHome?: string;
38
+ }): Promise<SkillUninstallResult>;
39
+ /**
40
+ * Reset the broker client (for testing or reconnection)
41
+ */
42
+ export declare function resetBrokerClient(): void;
43
+ //# sourceMappingURL=broker-bridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"broker-bridge.d.ts","sourceRoot":"","sources":["../../src/services/broker-bridge.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAuC,KAAK,kBAAkB,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAqB7H;;GAEG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC,CAO1D;AAED;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,EAC/C,OAAO,GAAE;IACP,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACjB,GACL,OAAO,CAAC,kBAAkB,CAAC,CAmB7B;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IACP,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACf,GACL,OAAO,CAAC,oBAAoB,CAAC,CAU/B;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAExC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Integration Skills Service
3
+ *
4
+ * Provisions the single `agenco-secure-integrations` skill into
5
+ * the user's skills directory when any integration is connected.
6
+ */
7
+ /**
8
+ * Provision the `agenco-secure-integrations` skill into the user's
9
+ * skills directory. Call this when ANY integration is connected.
10
+ *
11
+ * Returns `{ installed: true }` if newly copied, `{ installed: false }` if
12
+ * already present, or throws on unexpected errors.
13
+ */
14
+ export declare function provisionAgenCoSkill(): Promise<{
15
+ installed: boolean;
16
+ }>;
17
+ /**
18
+ * Provision an integration-specific documentation skill into the user's
19
+ * skills directory. Call this when a specific integration is connected.
20
+ *
21
+ * Graceful no-op if the skill folder doesn't exist (integration not in marketplace).
22
+ */
23
+ export declare function provisionIntegrationSkill(integrationSlug: string): Promise<{
24
+ installed: boolean;
25
+ }>;
26
+ //# sourceMappingURL=integration-skills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration-skills.d.ts","sourceRoot":"","sources":["../../src/services/integration-skills.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA0BH;;;;;;GAMG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAqC5E;AAED;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAsCxG"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Marketplace Service
3
+ *
4
+ * Proxies requests to ClawHub via Convex HTTP API (search/detail) and agen.co (analysis).
5
+ * Includes in-memory TTL cache for search and detail results.
6
+ */
7
+ import type { MarketplaceSkill, MarketplaceSkillFile, AnalyzeSkillResponse } from '@agenshield/ipc';
8
+ /**
9
+ * Download and extract a skill zip bundle from ClawHub.
10
+ * Returns the extracted text files as MarketplaceSkillFile[].
11
+ */
12
+ export declare function downloadAndExtractZip(slug: string): Promise<MarketplaceSkillFile[]>;
13
+ /** Metadata stored alongside downloaded skill files */
14
+ export interface DownloadedSkillMeta {
15
+ name: string;
16
+ slug: string;
17
+ author: string;
18
+ version: string;
19
+ description: string;
20
+ tags: string[];
21
+ downloadedAt: string;
22
+ analysis?: AnalyzeSkillResponse['analysis'];
23
+ }
24
+ /**
25
+ * Persist a downloaded skill to ~/.agenshield/marketplace/<slug>/.
26
+ */
27
+ export declare function storeDownloadedSkill(slug: string, meta: Omit<DownloadedSkillMeta, 'downloadedAt'>, files: MarketplaceSkillFile[]): void;
28
+ /**
29
+ * Update the analysis result in an already-stored download.
30
+ */
31
+ export declare function updateDownloadedAnalysis(slug: string, analysis: AnalyzeSkillResponse['analysis']): void;
32
+ /** Summary info for a downloaded skill */
33
+ export interface DownloadedSkillInfo {
34
+ slug: string;
35
+ name: string;
36
+ author: string;
37
+ version: string;
38
+ description: string;
39
+ hasAnalysis: boolean;
40
+ }
41
+ /**
42
+ * List all downloaded marketplace skills from ~/.agenshield/marketplace/.
43
+ */
44
+ export declare function listDownloadedSkills(): DownloadedSkillInfo[];
45
+ /**
46
+ * Read all files for a downloaded skill from the local cache.
47
+ */
48
+ export declare function getDownloadedSkillFiles(slug: string): MarketplaceSkillFile[];
49
+ /**
50
+ * Get the metadata for a downloaded skill, or null if not downloaded.
51
+ */
52
+ export declare function getDownloadedSkillMeta(slug: string): DownloadedSkillMeta | null;
53
+ /**
54
+ * Search the ClawHub marketplace for skills via Convex.
55
+ * Results are cached for 60 seconds keyed by query string.
56
+ */
57
+ export declare function searchMarketplace(query: string): Promise<MarketplaceSkill[]>;
58
+ /**
59
+ * Get a single skill's detail from ClawHub by slug via Convex.
60
+ * Fetches readme and file contents in parallel.
61
+ * Cached for 5 minutes.
62
+ */
63
+ export declare function getMarketplaceSkill(slug: string): Promise<MarketplaceSkill>;
64
+ /**
65
+ * Send skill files to the skills-analyzer edge function for AI-powered vulnerability analysis.
66
+ * Consumes an NDJSON stream and returns the aggregated summary as AnalyzeSkillResponse.
67
+ */
68
+ export declare function analyzeSkillBundle(files: MarketplaceSkillFile[], skillName?: string, publisher?: string): Promise<AnalyzeSkillResponse>;
69
+ /**
70
+ * Forward a slug + source to the skills-analyzer for remote ZIP download and analysis.
71
+ * Vercel handles the ZIP download directly — no local files needed.
72
+ */
73
+ export declare function analyzeSkillBySlug(slug: string, skillName?: string, publisher?: string): Promise<AnalyzeSkillResponse>;
74
+ /**
75
+ * Retrieve a previously cached analysis for a skill by name and publisher.
76
+ * Returns null if no cached result exists (upstream returns 404).
77
+ */
78
+ export declare function getCachedAnalysis(skillName: string, publisher: string): Promise<AnalyzeSkillResponse | null>;
79
+ //# sourceMappingURL=marketplace.d.ts.map