pinokiod 6.0.95 → 6.0.97

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "6.0.95",
3
+ "version": "6.0.97",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -19,7 +19,21 @@ If running outside Pinokio's own shell, do not assume `pterm` is on `PATH`.
19
19
  1. Resolve `pterm` via `GET http://127.0.0.1:42000/pinokio/path/pterm`.
20
20
  2. Read `path` from the response.
21
21
  3. Use that absolute binary path for all `pterm` commands in this skill.
22
- 4. If lookup fails, report `pterm` unavailable and stop.
22
+ 4. If lookup fails, do not immediately conclude that Pinokio is not running.
23
+ 5. Distinguish failure modes before stopping:
24
+ - `EPERM` / `EACCES` / sandbox denial to `127.0.0.1:42000`:
25
+ - treat this as a local permission problem, not a missing runtime
26
+ - ask for permission first if the client supports permission prompts, escalation, or tool approval
27
+ - rerun the same probe after permission is granted
28
+ - if permission prompts are unavailable, report that loopback access is blocked by the client/sandbox
29
+ - timeout / connection refused / DNS failure:
30
+ - report that the control plane is unreachable rather than claiming `pterm` is uninstalled
31
+ - HTTP success with missing/empty `path`:
32
+ - continue with fallback path checks below before concluding `pterm` is unavailable
33
+ 6. If the control-plane probe is blocked or returns an empty path, check common local `pterm` locations:
34
+ - `which pterm` or `where pterm`
35
+ 7. If a local `pterm` binary exists, use it and continue. If later `pterm` commands fail against `127.0.0.1:42000` with permission errors, report a loopback permission issue explicitly.
36
+ 8. Only report "`pterm` unavailable" when both the control-plane probe and fallback local path checks fail.
23
37
 
24
38
  Use direct `pterm` commands for control-plane operations:
25
39
 
@@ -31,11 +45,16 @@ Use direct `pterm` commands for control-plane operations:
31
45
  6. `pterm star <app_id>` / `pterm unstar <app_id>` (only when user explicitly asks to change preference)
32
46
 
33
47
  Do not run install/update commands from this skill.
48
+ Do not execute bundled app binaries or internal app CLIs from the app repo unless the user explicitly asks for CLI mode.
49
+ Once a Pinokio-managed app is selected, treat the launcher and its exposed interfaces as the source of truth for lifecycle and execution.
50
+ Do not switch to alternate repo-local execution paths unless the user explicitly requests that mode.
34
51
 
35
52
  Permission handling:
36
- - If a `pterm` command fails with loopback permission errors (`EPERM`/`EACCES` to `127.0.0.1:42000`), rerun the same command with required escalation/approval.
53
+ - If a probe or `pterm` command fails with loopback permission errors (`EPERM`/`EACCES` to `127.0.0.1:42000`), ask for permission first when the client supports permission prompts or escalation.
54
+ - After permission is granted, rerun the same command.
37
55
  - Continue normal flow if rerun succeeds.
38
- - Fail only if escalation is denied or rerun still cannot reach Pinokio.
56
+ - Fail only if permission/escalation is denied, unavailable, or rerun still cannot reach Pinokio.
57
+ - When failing after those retries, say "Pinokio may be running, but this client cannot reach the local control plane" rather than "Pinokio is not installed/running" unless you have confirmed both conditions.
39
58
 
40
59
  ## Workflow
41
60
 
@@ -57,14 +76,20 @@ Permission handling:
57
76
  - If no useful hits, run one fallback:
58
77
  - `pterm search "<query>" --mode broad --limit 8`
59
78
  - Deterministic ranking:
60
- - exact `app_id`/title match (for explicit app requests)
61
- - `starred=true` (user preference)
62
- - `ready=true`
63
- - higher `matched_terms_count` (if available)
64
- - higher `launch_count_total` (if available)
65
- - more recent `last_launch_at` (if available)
66
- - higher `score`
67
- - `running=true`
79
+ - First, rank by runtime tier:
80
+ - relevant apps with `ready=true`
81
+ - otherwise relevant apps with `running=true`
82
+ - otherwise relevant offline apps
83
+ - Within the selected runtime tier, rank by user preference:
84
+ - exact `app_id`/title match (for explicit app requests)
85
+ - `starred=true`
86
+ - Within that same tier, use the remaining tiebreakers:
87
+ - higher `matched_terms_count` (if available)
88
+ - higher `launch_count_total` (if available)
89
+ - more recent `last_launch_at` (if available)
90
+ - higher `score`
91
+ - Do not choose an offline app over a relevant `ready` or `running` app.
92
+ - Do not choose a non-starred app over a relevant starred app in the same runtime tier unless the starred app is clearly not a useful match.
68
93
  - If the top candidate is not clearly better than alternatives, ask user once with top 3 candidates.
69
94
 
70
95
  2. Check runtime state with `pterm status`.
@@ -90,6 +115,7 @@ Permission handling:
90
115
  4. Success criteria.
91
116
  - `state=online` and `ready=true`.
92
117
  - If `ready_url` exists, use it as API base URL.
118
+ - Treat `ready_url` plus a generated or reused client as the default execution path for app functionality.
93
119
 
94
120
  5. Failure criteria.
95
121
  - Timeout before success.
@@ -111,6 +137,9 @@ Permission handling:
111
137
  - 404/405 endpoint mismatch
112
138
  - 400/422 payload/schema mismatch
113
139
  - auth/header mismatch
140
+ - Prefer documented/public app APIs exposed by the running launcher.
141
+ - Do not execute the app's internal Python/Node/bundled CLI as a fallback when `pterm` has already selected a launcher-managed app.
142
+ - If no automatable API exists after the app is running, report that clearly instead of bypassing the launcher with an internal CLI.
114
143
 
115
144
  ## Behavior Rules
116
145
 
@@ -120,6 +149,13 @@ Permission handling:
120
149
  - Prefer returning full logs over brittle deterministic error parsing.
121
150
  - REST endpoints may be used for diagnostics only when pterm is unavailable; do not claim full install/launch lifecycle completion without compatible pterm commands.
122
151
  - Do not keep searching after app selection; move to status/run.
152
+ - Do not conflate loopback access failure, sandbox denial, or missing permission with "Pinokio is not running" or "`pterm` is not installed."
153
+ - On localhost permission failure, prefer asking for permission over asking the user to manually run commands.
154
+ - If `127.0.0.1:42000` is blocked but local `pterm` exists, explicitly tell the user this looks like a client permission/sandbox issue.
155
+ - After app selection, do not execute `python`, `node`, shell entrypoints, or repo-local binaries inside the selected app unless the user explicitly asks for CLI mode.
156
+ - Do not inspect bundled CLI help or probe repo-local executables as an alternative execution path when the task is to operate the Pinokio-managed app.
157
+ - "Launch the app server and run it" means `pterm status` -> `pterm run` -> wait for `ready=true` -> use `ready_url` with a generated/reused client.
158
+ - If `ready_url` is absent, use `pterm` only for lifecycle control and ask one targeted question or report that the app lacks a clear automatable API. Do not silently fall back to internal CLI execution.
123
159
 
124
160
  ## Example A (Capability Only)
125
161