@danypops/pi-packed 0.19.6 → 0.19.7
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/extension/src/packed.ts +18 -8
- package/package.json +2 -2
package/extension/src/packed.ts
CHANGED
|
@@ -8,6 +8,13 @@
|
|
|
8
8
|
* the rest of the Pi session -- vehicle-client's createRetryingClient detects
|
|
9
9
|
* that on the failing call itself and reconnects, so the happy path reuses
|
|
10
10
|
* one connected client instead of reconnecting on every single operation.
|
|
11
|
+
*
|
|
12
|
+
* Reads/idempotent lookups use call() (transparent retry once on a stale
|
|
13
|
+
* connection); install/installService/remove/update/setMutationApproval/
|
|
14
|
+
* setupApply/toggleResource use callOnce() instead -- a stale connection
|
|
15
|
+
* during any of those must surface its one real failure rather than risk a
|
|
16
|
+
* silently duplicated mutation (installing/removing/updating a package
|
|
17
|
+
* twice) if the retried call actually reached the daemon the first time.
|
|
11
18
|
*/
|
|
12
19
|
|
|
13
20
|
import { ensurePackedClient, InstallServiceError, type PackedExtensionClient } from "@danypops/packed/client";
|
|
@@ -77,22 +84,25 @@ export async function createNatives(connect: PackageDaemonConnector = connectDef
|
|
|
77
84
|
const client = createRetryingClient(connect, { label: "pi-packed" });
|
|
78
85
|
|
|
79
86
|
return {
|
|
87
|
+
// Reads/idempotent lookups: transparently retried once on a stale connection.
|
|
80
88
|
search: (query, limit) => client.call((daemon) => daemon.search(query, limit)),
|
|
81
89
|
searchOffline: (query, limit) => client.call((daemon) => daemon.search(query, limit, true)),
|
|
82
90
|
info: (name) => client.call((daemon) => daemon.info(name)),
|
|
83
91
|
installed: () => client.call((daemon) => daemon.installed()),
|
|
84
92
|
updates: () => client.call((daemon) => daemon.updates()),
|
|
85
93
|
security: () => client.call((daemon) => daemon.security()),
|
|
86
|
-
setMutationApproval: (value, approved) => client.call((daemon) => daemon.setMutationApproval(value, approved)),
|
|
87
|
-
install: (source, approved) => client.call((daemon) => daemon.install(source, approved)),
|
|
88
|
-
installService: (source, approved) => client.call((daemon) => daemon.installService(source, approved)),
|
|
89
|
-
remove: (name, approved) => client.call((daemon) => daemon.remove(name, approved)),
|
|
90
|
-
update: (source, approved) => client.call((daemon) => daemon.update(source, approved)),
|
|
91
94
|
setupPlan: (manifestPath, prune) => client.call((daemon) => daemon.setupPlan(manifestPath, prune)),
|
|
92
|
-
setupApply: (manifestPath, approved, prune) => client.call((daemon) => daemon.setupApply(manifestPath, approved, prune)),
|
|
93
95
|
listResources: (projectRoot) => client.call((daemon) => daemon.listResources(projectRoot)),
|
|
94
|
-
toggleResource: (source, field, path, enabled, projectRoot, approved) =>
|
|
95
|
-
client.call((daemon) => daemon.toggleResource(source, field, path, enabled, projectRoot, approved)),
|
|
96
96
|
piStatus: () => client.call((daemon) => daemon.piStatus()),
|
|
97
|
+
// Mutations: never transparently retried -- a stale connection surfaces its one
|
|
98
|
+
// real failure instead of risking a silently duplicated install/remove/update.
|
|
99
|
+
setMutationApproval: (value, approved) => client.callOnce((daemon) => daemon.setMutationApproval(value, approved)),
|
|
100
|
+
install: (source, approved) => client.callOnce((daemon) => daemon.install(source, approved)),
|
|
101
|
+
installService: (source, approved) => client.callOnce((daemon) => daemon.installService(source, approved)),
|
|
102
|
+
remove: (name, approved) => client.callOnce((daemon) => daemon.remove(name, approved)),
|
|
103
|
+
update: (source, approved) => client.callOnce((daemon) => daemon.update(source, approved)),
|
|
104
|
+
setupApply: (manifestPath, approved, prune) => client.callOnce((daemon) => daemon.setupApply(manifestPath, approved, prune)),
|
|
105
|
+
toggleResource: (source, field, path, enabled, projectRoot, approved) =>
|
|
106
|
+
client.callOnce((daemon) => daemon.toggleResource(source, field, path, enabled, projectRoot, approved)),
|
|
97
107
|
};
|
|
98
108
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danypops/pi-packed",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.7",
|
|
4
4
|
"description": "Pi package tools, commands, profiles, and TUI for the Packed daemon",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": ["pi-package"],
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@danypops/packed": "^0.5.0",
|
|
16
|
-
"@danypops/vehicle-client": "^0.
|
|
16
|
+
"@danypops/vehicle-client": "^0.2.0",
|
|
17
17
|
"@danypops/vehicle-client-pi": "^0.1.5",
|
|
18
18
|
"malevich-tui-components": "^0.16.1"
|
|
19
19
|
},
|