@elizaos/capacitor-agent 1.0.0 → 2.0.3-beta.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from \"@capacitor/core\";\nexport * from \"./definitions\";\nexport const Agent = registerPlugin(\"Agent\", {\n web: () => import(\"./web\").then((m) => new m.AgentWeb()),\n // Electrobun uses the preload bridge (agent:start, agent:stop, etc.)\n // iOS/Android will use the web fallback (HTTP to API server) for now\n});\n//# sourceMappingURL=index.js.map","import { WebPlugin } from \"@capacitor/core\";\n/**\n * Web fallback implementation.\n *\n * On non-desktop platforms (iOS, Android, web), the agent runtime runs\n * on a server. This implementation delegates to the HTTP API.\n *\n * In Electrobun the desktop bridge calls the native main-process\n * implementation via RPC instead — this web fallback is only used when\n * no native plugin is available. If the page is served from a non-HTTP\n * origin (e.g. electrobun://), relative fetches would hit the\n * app shell HTML, so we bail early.\n *\n * Local-agent-on-Android (Phase E): when the host UI selects the\n * \"Local Agent\" tile, it sets `apiBase` to `http://127.0.0.1:31337`,\n * which the runtime mirrors into `window.__ELIZA_API_BASE__`. From this\n * plugin's perspective there is no special case — it simply HTTP-POSTs\n * to `${apiBase}/api/agent/start|stop|status`, which is exactly the same\n * surface Phase B's `ElizaAgentService` exposes. The web fallback path\n * therefore works unchanged for both remote and on-device agents.\n */\nexport class AgentWeb extends WebPlugin {\n legacyConversationStorageKey() {\n const base = this.apiBase() ||\n (typeof window !== \"undefined\" ? window.location.origin : \"same-origin\");\n return `eliza_agent_web_conversation:${encodeURIComponent(base)}`;\n }\n readLegacyConversationId() {\n if (typeof window === \"undefined\")\n return null;\n const stored = window.sessionStorage.getItem(this.legacyConversationStorageKey());\n return stored?.trim() ? stored.trim() : null;\n }\n writeLegacyConversationId(conversationId) {\n if (typeof window === \"undefined\")\n return;\n const key = this.legacyConversationStorageKey();\n if (conversationId?.trim()) {\n window.sessionStorage.setItem(key, conversationId.trim());\n return;\n }\n window.sessionStorage.removeItem(key);\n }\n async ensureLegacyConversationId() {\n const cached = this.readLegacyConversationId();\n if (cached)\n return cached;\n const res = await fetch(`${this.apiBase()}/api/conversations`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...this.authHeaders(),\n },\n body: JSON.stringify({ title: \"Quick Chat\" }),\n });\n if (!res.ok) {\n throw new Error(`Failed to create conversation: ${res.status}`);\n }\n const data = (await res.json());\n const conversationId = data.conversation?.id?.trim();\n if (!conversationId) {\n throw new Error(\"Conversation create response missing id\");\n }\n this.writeLegacyConversationId(conversationId);\n return conversationId;\n }\n async chatViaConversation(text, retryOnMissingConversation = true) {\n const conversationId = await this.ensureLegacyConversationId();\n const res = await fetch(`${this.apiBase()}/api/conversations/${encodeURIComponent(conversationId)}/messages`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...this.authHeaders(),\n },\n body: JSON.stringify({ text, channelType: \"DM\" }),\n });\n if (res.status === 404 && retryOnMissingConversation) {\n this.writeLegacyConversationId(null);\n return this.chatViaConversation(text, false);\n }\n if (!res.ok) {\n throw new Error(`Chat request failed: ${res.status}`);\n }\n return res.json();\n }\n apiBase() {\n const global = typeof window !== \"undefined\"\n ? window.__ELIZA_API_BASE__\n : undefined;\n if (typeof global === \"string\" && global.trim().length > 0)\n return global;\n // No explicit base — use relative URLs (works on http/https origins).\n return \"\";\n }\n apiToken() {\n const global = typeof window !== \"undefined\"\n ? window.__ELIZA_API_TOKEN__\n : undefined;\n if (typeof global === \"string\" && global.trim())\n return global.trim();\n if (typeof window === \"undefined\")\n return null;\n const stored = window.sessionStorage.getItem(\"eliza_api_token\");\n return stored?.trim() ? stored.trim() : null;\n }\n authHeaders() {\n const token = this.apiToken();\n return token ? { Authorization: `Bearer ${token}` } : {};\n }\n /** True when we can reach the API via HTTP. */\n canReachApi() {\n const global = typeof window !== \"undefined\"\n ? window.__ELIZA_API_BASE__\n : undefined;\n if (typeof global === \"string\" && global.trim().length > 0)\n return true;\n // No explicit base — relative fetches only work on http(s) origins.\n if (typeof window === \"undefined\")\n return false;\n const proto = window.location.protocol;\n return proto === \"http:\" || proto === \"https:\";\n }\n async start() {\n if (!this.canReachApi()) {\n return {\n state: \"not_started\",\n agentName: null,\n port: null,\n startedAt: null,\n error: \"No API endpoint\",\n };\n }\n const res = await fetch(`${this.apiBase()}/api/agent/start`, {\n method: \"POST\",\n headers: this.authHeaders(),\n });\n const data = await res.json();\n return data.status ?? data;\n }\n async stop() {\n if (!this.canReachApi()) {\n return { ok: false };\n }\n const res = await fetch(`${this.apiBase()}/api/agent/stop`, {\n method: \"POST\",\n headers: this.authHeaders(),\n });\n return res.json();\n }\n async getStatus() {\n if (!this.canReachApi()) {\n return {\n state: \"not_started\",\n agentName: null,\n port: null,\n startedAt: null,\n error: \"No API endpoint\",\n };\n }\n const res = await fetch(`${this.apiBase()}/api/status`, {\n headers: this.authHeaders(),\n });\n return res.json();\n }\n async chat(options) {\n if (!this.canReachApi()) {\n return { text: \"Agent API not available\", agentName: \"System\" };\n }\n return this.chatViaConversation(options.text);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AAEY,UAAC,KAAK,GAAGA,mBAAc,CAAC,OAAO,EAAE;IAC7C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC5D;IACA;IACA,CAAC;;ICLD;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACO,MAAM,QAAQ,SAASC,cAAS,CAAC;IACxC,IAAI,4BAA4B,GAAG;IACnC,QAAQ,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE;IACnC,aAAa,OAAO,MAAM,KAAK,WAAW,GAAG,MAA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E,KAAK,EAAE;IAChC,QAAQ;IACR,QAAQ,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,eAAe,CAAC,EAAE;IACpE,YAAY,MAAM,EAAE,MAAM;IAC1B,YAAY,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE;IACvC,SAAS,CAAC;IACV,QAAQ,OAAO,GAAG,CAAC,IAAI,EAAE;IACzB,IAAI;IACJ,IAAI,MAAM,SAAS,GAAG;IACtB,QAAQ,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE;IACjC,YAAY,OAAO;IACnB,gBAAgB,KAAK,EAAE,aAAa;IACpC,gBAAgB,SAAS,EAAE,IAAI;IAC/B,gBAAgB,IAAI,EAAE,IAAI;IAC1B,gBAAgB,SAAS,EAAE,IAAI;IAC/B,gBAAgB,KAAK,EAAE,iBAAiB;IACxC,aAAa;IACb,QAAQ;IACR,QAAQ,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,EAAE;IAChE,YAAY,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE;IACvC,SAAS,CAAC;IACV,QAAQ,OAAO,GAAG,CAAC,IAAI,EAAE;IACzB,IAAI;IACJ,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE;IACjC,YAAY,OAAO,EAAE,IAAI,EAAE,yBAAyB,EAAE,SAAS,EAAE,QAAQ,EAAE;IAC3E,QAAQ;IACR,QAAQ,OAAO,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,IAAI,CAAC;IACrD,IAAI;IACJ;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from \"@capacitor/core\";\nexport * from \"./definitions\";\nexport const Agent = registerPlugin(\"Agent\", {\n web: () => import(\"./web\").then((m) => new m.AgentWeb()),\n // Electrobun uses the preload bridge (agent:start, agent:stop, etc.)\n // iOS/Android use the native bridge when registered, otherwise the HTTP web fallback.\n});\n//# sourceMappingURL=index.js.map","import { WebPlugin } from \"@capacitor/core\";\nfunction assertNonEmptyText(text) {\n if (typeof text !== \"string\" || text.trim().length === 0) {\n throw new Error(\"Agent.chat requires non-empty text\");\n }\n return text;\n}\nfunction assertRequestPath(path) {\n if (typeof path !== \"string\" || path.trim().length === 0) {\n throw new Error(\"Agent.request path must start with /\");\n }\n const trimmed = path.trim();\n if (!trimmed.startsWith(\"/\") ||\n trimmed.startsWith(\"//\") ||\n trimmed.includes(\"\\\\\")) {\n throw new Error(\"Agent.request requires a local path that starts with / and is not an absolute URL\");\n }\n try {\n const parsed = new URL(trimmed);\n if (parsed.protocol) {\n throw new Error(\"Agent.request requires a local path that starts with / and is not an absolute URL\");\n }\n }\n catch (err) {\n if (err instanceof Error && err.message.includes(\"absolute URL\")) {\n throw err;\n }\n }\n return trimmed;\n}\nfunction assertRequestMethod(method) {\n if (method === undefined)\n return \"GET\";\n if (typeof method !== \"string\") {\n throw new Error(\"Unsupported HTTP method\");\n }\n const normalized = method.trim().toUpperCase();\n if (!/^[A-Z]{1,16}$/.test(normalized)) {\n throw new Error(\"Unsupported HTTP method\");\n }\n return normalized;\n}\n/**\n * Web fallback implementation.\n *\n * On non-desktop platforms (iOS, Android, web), the agent runtime runs\n * on a server. This implementation delegates to the HTTP API.\n *\n * In Electrobun the desktop bridge calls the native main-process\n * implementation via RPC instead — this web fallback is only used when\n * no native plugin is available. If the page is served from a non-HTTP\n * origin (e.g. electrobun://), relative fetches would hit the\n * app shell HTML, so we bail early.\n *\n * Local-agent-on-Android (Phase E): when the host UI selects the\n * \"Local Agent\" tile, it sets `apiBase` to `http://127.0.0.1:31337`,\n * which the runtime mirrors into `window.__ELIZA_API_BASE__`. From this\n * plugin's perspective there is no special case — it simply HTTP-POSTs\n * to `${apiBase}/api/agent/start|stop|status`, which is exactly the same\n * surface Phase B's `ElizaAgentService` exposes. The web fallback path\n * therefore works unchanged for both remote and on-device agents.\n */\nexport class AgentWeb extends WebPlugin {\n legacyConversationStorageKey() {\n const base = this.apiBase() ||\n (typeof window !== \"undefined\" ? window.location.origin : \"same-origin\");\n return `eliza_agent_web_conversation:${encodeURIComponent(base)}`;\n }\n readLegacyConversationId() {\n if (typeof window === \"undefined\")\n return null;\n const stored = window.sessionStorage.getItem(this.legacyConversationStorageKey());\n return stored?.trim() ? stored.trim() : null;\n }\n writeLegacyConversationId(conversationId) {\n if (typeof window === \"undefined\")\n return;\n const key = this.legacyConversationStorageKey();\n if (conversationId?.trim()) {\n window.sessionStorage.setItem(key, conversationId.trim());\n return;\n }\n window.sessionStorage.removeItem(key);\n }\n async ensureLegacyConversationId() {\n const cached = this.readLegacyConversationId();\n if (cached)\n return cached;\n const res = await fetch(`${this.apiBase()}/api/conversations`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...this.authHeaders(),\n },\n body: JSON.stringify({ title: \"Quick Chat\" }),\n });\n if (!res.ok) {\n throw new Error(`Failed to create conversation: ${res.status}`);\n }\n const data = (await res.json());\n const conversationId = data.conversation?.id?.trim();\n if (!conversationId) {\n throw new Error(\"Conversation create response missing id\");\n }\n this.writeLegacyConversationId(conversationId);\n return conversationId;\n }\n async chatViaConversation(text, retryOnMissingConversation = true) {\n const conversationId = await this.ensureLegacyConversationId();\n // @duplicate-component-audit-allow: agent API message POST; server-side runtime owns model trajectory logging.\n const res = await fetch(`${this.apiBase()}/api/conversations/${encodeURIComponent(conversationId)}/messages`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...this.authHeaders(),\n },\n body: JSON.stringify({ text, channelType: \"DM\" }),\n });\n if (res.status === 404 && retryOnMissingConversation) {\n this.writeLegacyConversationId(null);\n return this.chatViaConversation(text, false);\n }\n if (!res.ok) {\n throw new Error(`Chat request failed: ${res.status}`);\n }\n return res.json();\n }\n apiBase() {\n const global = typeof window !== \"undefined\"\n ? window.__ELIZA_API_BASE__\n : undefined;\n if (typeof global === \"string\" && global.trim().length > 0)\n return global;\n // No explicit base — use relative URLs (works on http/https origins).\n return \"\";\n }\n isLocalAgentIpcBase() {\n const base = this.apiBase().trim();\n if (!base)\n return false;\n const lower = base.toLowerCase();\n if (lower === \"eliza-local-agent://ipc\" ||\n lower.startsWith(\"eliza-local-agent://ipc/\") ||\n lower.startsWith(\"eliza-local-agent://ipc?\")) {\n return true;\n }\n try {\n const parsed = new URL(base);\n return (parsed.protocol === \"eliza-local-agent:\" &&\n (parsed.hostname === \"ipc\" ||\n parsed.pathname === \"//ipc\" ||\n parsed.pathname.startsWith(\"//ipc/\")));\n }\n catch {\n return false;\n }\n }\n apiToken() {\n const global = typeof window !== \"undefined\"\n ? window.__ELIZA_API_TOKEN__\n : undefined;\n if (typeof global === \"string\" && global.trim())\n return global.trim();\n if (typeof window === \"undefined\")\n return null;\n const stored = window.sessionStorage.getItem(\"eliza_api_token\");\n return stored?.trim() ? stored.trim() : null;\n }\n authHeaders() {\n const token = this.apiToken();\n return token ? { Authorization: `Bearer ${token}` } : {};\n }\n /** True when we can reach the API via HTTP. */\n canReachApi() {\n if (this.isLocalAgentIpcBase())\n return false;\n const global = typeof window !== \"undefined\"\n ? window.__ELIZA_API_BASE__\n : undefined;\n if (typeof global === \"string\" && global.trim().length > 0)\n return true;\n // No explicit base — relative fetches only work on http(s) origins.\n if (typeof window === \"undefined\")\n return false;\n const proto = window.location.protocol;\n return proto === \"http:\" || proto === \"https:\";\n }\n async start(_options) {\n if (!this.canReachApi()) {\n return {\n state: \"not_started\",\n agentName: null,\n port: null,\n startedAt: null,\n error: \"No API endpoint\",\n };\n }\n const res = await fetch(`${this.apiBase()}/api/agent/start`, {\n method: \"POST\",\n headers: this.authHeaders(),\n });\n const data = await res.json();\n return data.status ?? data;\n }\n async stop() {\n if (!this.canReachApi()) {\n return { ok: false };\n }\n const res = await fetch(`${this.apiBase()}/api/agent/stop`, {\n method: \"POST\",\n headers: this.authHeaders(),\n });\n return res.json();\n }\n async getStatus() {\n if (!this.canReachApi()) {\n return {\n state: \"not_started\",\n agentName: null,\n port: null,\n startedAt: null,\n error: \"No API endpoint\",\n };\n }\n const res = await fetch(`${this.apiBase()}/api/status`, {\n headers: this.authHeaders(),\n });\n return res.json();\n }\n async chat(options) {\n const text = assertNonEmptyText(options.text);\n if (!this.canReachApi()) {\n return { text: \"Agent API not available\", agentName: \"System\" };\n }\n return this.chatViaConversation(text);\n }\n async getLocalAgentToken() {\n const token = this.apiToken();\n return {\n available: Boolean(token),\n token,\n };\n }\n async request(options) {\n const path = assertRequestPath(options.path);\n const method = assertRequestMethod(options.method);\n if (this.isLocalAgentIpcBase()) {\n return {\n status: 503,\n statusText: \"Service Unavailable\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify({\n error: \"native_agent_unavailable\",\n message: \"Agent web fallback cannot handle eliza-local-agent://ipc; use the native Capacitor Agent plugin\",\n }),\n };\n }\n const res = await fetch(`${this.apiBase()}${path}`, {\n method,\n headers: {\n ...this.authHeaders(),\n ...options.headers,\n },\n body: options.body ?? undefined,\n });\n const headers = {};\n res.headers.forEach((value, key) => {\n headers[key] = value;\n });\n return {\n status: res.status,\n statusText: res.statusText,\n headers,\n body: await res.text(),\n };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AAEY,UAAC,KAAK,GAAGA,mBAAc,CAAC,OAAO,EAAE;IAC7C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC5D;IACA;IACA,CAAC;;ICLD,SAAS,kBAAkB,CAAC,IAAI,EAAE;IAClC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;IAC9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