@illuminis/comprism 2.5.1 → 2.7.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.
|
@@ -126,7 +126,13 @@ async function perform(order, folders, jobRoot) {
|
|
|
126
126
|
return { id: order.id, ok: false, error: String(error.message ?? error) };
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
|
|
129
|
+
// `~` is the person's home folder, as the server names it when browsing.
|
|
130
|
+
const abs = (v) => {
|
|
131
|
+
if (typeof v !== 'string')
|
|
132
|
+
return null;
|
|
133
|
+
const p = v === '~' || v.startsWith('~/') ? path.join(os.homedir(), v.slice(1)) : v;
|
|
134
|
+
return path.isAbsolute(p) ? path.resolve(p) : null;
|
|
135
|
+
};
|
|
130
136
|
if (order.op === 'tool' && typeof args.job === 'string' && args.job) {
|
|
131
137
|
// A terminal job's action, ordered by the server for the job it opened on
|
|
132
138
|
// this computer, on that job's own executor.
|
|
@@ -162,7 +168,10 @@ async function perform(order, folders, jobRoot) {
|
|
|
162
168
|
const root = abs(args.root);
|
|
163
169
|
const target = abs(args.path);
|
|
164
170
|
const where = root ?? target;
|
|
171
|
+
// Browsing lists names only, so anything under the home folder may be listed,
|
|
172
|
+
// as the desktop app allows; reading and writing stay inside connected folders.
|
|
165
173
|
const home = where ? folders.find((f) => within(f, where))
|
|
174
|
+
?? (order.op === 'list_dir' && within(os.homedir(), where) ? where : undefined)
|
|
166
175
|
?? (order.op === 'make_dir' && within(os.homedir(), where) && where !== os.homedir() ? where : undefined) : undefined;
|
|
167
176
|
if (!where || !home)
|
|
168
177
|
return { id: order.id, ok: false, error: REFUSED };
|
package/out/cli-start.js
CHANGED
|
@@ -124,6 +124,8 @@ function main() {
|
|
|
124
124
|
}
|
|
125
125
|
else if (said.type === 'clear_sign_in')
|
|
126
126
|
signIn.clearSignIn();
|
|
127
|
+
else if (said.type === 'open' && typeof said.url === 'string' && /^(https:\/\/|http:\/\/localhost[:/])/.test(said.url))
|
|
128
|
+
signIn.openAddress(said.url);
|
|
127
129
|
else if (said.type === 'run')
|
|
128
130
|
finish((0, run_ordered_1.runOrdered)(said));
|
|
129
131
|
else if (said.type === 'exit')
|
package/out/server.generated.js
CHANGED
|
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BUILD_COMMIT = exports.HOME_SERVER = void 0;
|
|
4
4
|
// Written by the build. Do not edit.
|
|
5
5
|
exports.HOME_SERVER = "https://completionprism.illuminis.ai";
|
|
6
|
-
exports.BUILD_COMMIT = "
|
|
6
|
+
exports.BUILD_COMMIT = "b711cdaf67b817d77cbef6293afd0cea61e2f680";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@illuminis/comprism",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "CompletionPrism in your terminal. A thin shell: what you type goes to CompletionPrism's front door, and what it answers comes back.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"private": false,
|