palmier 1.1.11 → 1.1.13

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
- import{W as t}from"./index-DO60N3KY.js";class s extends t{constructor(){super(),this.handleVisibilityChange=()=>{const e={isActive:document.hidden!==!0};this.notifyListeners("appStateChange",e),document.hidden?this.notifyListeners("pause",null):this.notifyListeners("resume",null)},document.addEventListener("visibilitychange",this.handleVisibilityChange,!1)}exitApp(){throw this.unimplemented("Not implemented on web.")}async getInfo(){throw this.unimplemented("Not implemented on web.")}async getLaunchUrl(){return{url:""}}async getState(){return{isActive:document.hidden!==!0}}async minimizeApp(){throw this.unimplemented("Not implemented on web.")}async toggleBackButtonHandler(){throw this.unimplemented("Not implemented on web.")}async getAppLanguage(){return{value:navigator.language.split("-")[0].toLowerCase()}}}export{s as AppWeb};
1
+ import{W as t}from"./index-DztP_wQC.js";class s extends t{constructor(){super(),this.handleVisibilityChange=()=>{const e={isActive:document.hidden!==!0};this.notifyListeners("appStateChange",e),document.hidden?this.notifyListeners("pause",null):this.notifyListeners("resume",null)},document.addEventListener("visibilitychange",this.handleVisibilityChange,!1)}exitApp(){throw this.unimplemented("Not implemented on web.")}async getInfo(){throw this.unimplemented("Not implemented on web.")}async getLaunchUrl(){return{url:""}}async getState(){return{isActive:document.hidden!==!0}}async minimizeApp(){throw this.unimplemented("Not implemented on web.")}async toggleBackButtonHandler(){throw this.unimplemented("Not implemented on web.")}async getAppLanguage(){return{value:navigator.language.split("-")[0].toLowerCase()}}}export{s as AppWeb};
@@ -1 +1 @@
1
- import{W as i}from"./index-DO60N3KY.js";function o(){const t=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection;let n="unknown";const e=t?t.type||t.effectiveType:null;if(e&&typeof e=="string")switch(e){case"bluetooth":case"cellular":n="cellular";break;case"none":n="none";break;case"ethernet":case"wifi":case"wimax":n="wifi";break;case"other":case"unknown":n="unknown";break;case"slow-2g":case"2g":case"3g":n="cellular";break;case"4g":n="wifi";break}return n}class s extends i{constructor(){super(),this.handleOnline=()=>{const e={connected:!0,connectionType:o()};this.notifyListeners("networkStatusChange",e)},this.handleOffline=()=>{const n={connected:!1,connectionType:"none"};this.notifyListeners("networkStatusChange",n)},typeof window<"u"&&(window.addEventListener("online",this.handleOnline),window.addEventListener("offline",this.handleOffline))}async getStatus(){if(!window.navigator)throw this.unavailable("Browser does not support the Network Information API");const n=window.navigator.onLine,e=o();return{connected:n,connectionType:n?e:"none"}}}const r=new s;export{r as Network,s as NetworkWeb};
1
+ import{W as i}from"./index-DztP_wQC.js";function o(){const t=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection;let n="unknown";const e=t?t.type||t.effectiveType:null;if(e&&typeof e=="string")switch(e){case"bluetooth":case"cellular":n="cellular";break;case"none":n="none";break;case"ethernet":case"wifi":case"wimax":n="wifi";break;case"other":case"unknown":n="unknown";break;case"slow-2g":case"2g":case"3g":n="cellular";break;case"4g":n="wifi";break}return n}class s extends i{constructor(){super(),this.handleOnline=()=>{const e={connected:!0,connectionType:o()};this.notifyListeners("networkStatusChange",e)},this.handleOffline=()=>{const n={connected:!1,connectionType:"none"};this.notifyListeners("networkStatusChange",n)},typeof window<"u"&&(window.addEventListener("online",this.handleOnline),window.addEventListener("offline",this.handleOffline))}async getStatus(){if(!window.navigator)throw this.unavailable("Browser does not support the Network Information API");const n=window.navigator.onLine,e=o();return{connected:n,connectionType:n?e:"none"}}}const r=new s;export{r as Network,s as NetworkWeb};
@@ -1 +1 @@
1
- import{W as p}from"./index-DO60N3KY.js";class f extends p{constructor(){super(...arguments),this.group="CapacitorStorage"}async configure({group:e}){typeof e=="string"&&(this.group=e)}async get(e){return{value:this.impl.getItem(this.applyPrefix(e.key))}}async set(e){this.impl.setItem(this.applyPrefix(e.key),e.value)}async remove(e){this.impl.removeItem(this.applyPrefix(e.key))}async keys(){return{keys:this.rawKeys().map(t=>t.substring(this.prefix.length))}}async clear(){for(const e of this.rawKeys())this.impl.removeItem(e)}async migrate(){var e;const t=[],s=[],n="_cap_",o=Object.keys(this.impl).filter(i=>i.indexOf(n)===0);for(const i of o){const r=i.substring(n.length),a=(e=this.impl.getItem(i))!==null&&e!==void 0?e:"",{value:l}=await this.get({key:r});typeof l=="string"?s.push(r):(await this.set({key:r,value:a}),t.push(r))}return{migrated:t,existing:s}}async removeOld(){const e="_cap_",t=Object.keys(this.impl).filter(s=>s.indexOf(e)===0);for(const s of t)this.impl.removeItem(s)}get impl(){return window.localStorage}get prefix(){return this.group==="NativeStorage"?"":`${this.group}.`}rawKeys(){return Object.keys(this.impl).filter(e=>e.indexOf(this.prefix)===0)}applyPrefix(e){return this.prefix+e}}export{f as PreferencesWeb};
1
+ import{W as p}from"./index-DztP_wQC.js";class f extends p{constructor(){super(...arguments),this.group="CapacitorStorage"}async configure({group:e}){typeof e=="string"&&(this.group=e)}async get(e){return{value:this.impl.getItem(this.applyPrefix(e.key))}}async set(e){this.impl.setItem(this.applyPrefix(e.key),e.value)}async remove(e){this.impl.removeItem(this.applyPrefix(e.key))}async keys(){return{keys:this.rawKeys().map(t=>t.substring(this.prefix.length))}}async clear(){for(const e of this.rawKeys())this.impl.removeItem(e)}async migrate(){var e;const t=[],s=[],n="_cap_",o=Object.keys(this.impl).filter(i=>i.indexOf(n)===0);for(const i of o){const r=i.substring(n.length),a=(e=this.impl.getItem(i))!==null&&e!==void 0?e:"",{value:l}=await this.get({key:r});typeof l=="string"?s.push(r):(await this.set({key:r,value:a}),t.push(r))}return{migrated:t,existing:s}}async removeOld(){const e="_cap_",t=Object.keys(this.impl).filter(s=>s.indexOf(e)===0);for(const s of t)this.impl.removeItem(s)}get impl(){return window.localStorage}get prefix(){return this.group==="NativeStorage"?"":`${this.group}.`}rawKeys(){return Object.keys(this.impl).filter(e=>e.indexOf(this.prefix)===0)}applyPrefix(e){return this.prefix+e}}export{f as PreferencesWeb};
@@ -8,8 +8,8 @@
8
8
  <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
9
9
  <title>Palmier</title>
10
10
  <meta name="description" content="Run tasks from anywhere, approve actions on the go, and let your agents use your phone’s built-in capabilities when needed." />
11
- <script type="module" crossorigin src="/assets/index-DO60N3KY.js"></script>
12
- <link rel="stylesheet" crossorigin href="/assets/index-DvUi9Jhi.css">
11
+ <script type="module" crossorigin src="/assets/index-DztP_wQC.js"></script>
12
+ <link rel="stylesheet" crossorigin href="/assets/index-ByB7B0d2.css">
13
13
  <link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
14
14
  <body>
15
15
  <div id="root"></div>
@@ -14,7 +14,7 @@ import { listPasswords, deletePassword } from "./password-store.js";
14
14
  import { currentVersion, performUpdate, performAgentUpdate } from "./update-checker.js";
15
15
  import { PLAYWRIGHT_CLI_PACKAGE, PLAYWRIGHT_CLI_LABEL } from "./playwright-cli.js";
16
16
  import { saveConfig } from "./config.js";
17
- import { parseTaskOutcome, parseAgentModel, stripPalmierMarkers } from "./commands/run.js";
17
+ import { parseTaskOutcome, parseAgentModel, createCliModelCapture, stripPalmierMarkers } from "./commands/run.js";
18
18
  import { resolveTaskFile, readTaskFileChunk } from "./task-files.js";
19
19
  import { clearTaskQueue } from "./event-queues.js";
20
20
  import { reconcileCommandRunner, stopCommandRunner } from "./command-runners.js";
@@ -456,8 +456,13 @@ export function createRpcHandler(config, nc) {
456
456
  if (child.pid)
457
457
  writeFollowupStatus(followupRunDir, { pid: child.pid, spawned_at: Date.now() });
458
458
  const chunks = [];
459
+ const captureCliModel = createCliModelCapture(followupAgent);
460
+ let cliModel;
459
461
  child.stdout?.on("data", (d) => chunks.push(d));
460
- child.stderr?.on("data", (d) => process.stderr.write(d));
462
+ child.stderr?.on("data", (d) => {
463
+ process.stderr.write(d);
464
+ cliModel = captureCliModel(d.toString("utf-8"));
465
+ });
461
466
  onChildDone(child, async (code) => {
462
467
  activeFollowups.delete(followupKey);
463
468
  deleteFollowupStatus(followupRunDir);
@@ -466,7 +471,7 @@ export function createRpcHandler(config, nc) {
466
471
  return;
467
472
  const output = Buffer.concat(chunks).toString("utf-8");
468
473
  const outcome = code !== 0 ? "failed" : parseTaskOutcome(output);
469
- const agentModel = parseAgentModel(output);
474
+ const agentModel = cliModel ?? parseAgentModel(output);
470
475
  appendRunMessage(followupTaskDir, params.run_id, {
471
476
  role: "assistant",
472
477
  time: Date.now(),
@@ -9,12 +9,13 @@ const pkg = JSON.parse(fs.readFileSync(path.join(packageRoot, "package.json"), "
9
9
  /** True when running from a source checkout (has .git) rather than a global npm install. */
10
10
  export const isDevBuild = fs.existsSync(path.join(packageRoot, ".git"));
11
11
  export const currentVersion = isDevBuild ? `${pkg.version}-dev` : pkg.version;
12
+ const NPM_UPDATE_TIMEOUT_MS = 120_000;
12
13
  /** Returns an error message if the update fails. */
13
14
  export async function performUpdate() {
14
15
  try {
15
16
  const { output, exitCode } = await spawnCommand("npm", ["update", "-g", "palmier"], {
16
17
  cwd: process.cwd(),
17
- timeout: 120_000,
18
+ timeout: NPM_UPDATE_TIMEOUT_MS,
18
19
  resolveOnFailure: true,
19
20
  });
20
21
  if (exitCode !== 0) {
@@ -41,7 +42,7 @@ export async function performAgentUpdate(npmPackage) {
41
42
  try {
42
43
  const { output, exitCode } = await spawnCommand("npm", ["update", "-g", npmPackage], {
43
44
  cwd: process.cwd(),
44
- timeout: 180_000,
45
+ timeout: NPM_UPDATE_TIMEOUT_MS,
45
46
  resolveOnFailure: true,
46
47
  });
47
48
  if (exitCode !== 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palmier",
3
- "version": "1.1.11",
3
+ "version": "1.1.13",
4
4
  "description": "Palmier host CLI - provisions, executes tasks, and serves NATS RPC",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Hongxu Cai",