pinokiod 7.1.49 → 7.1.50
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/kernel/api/index.js +42 -12
- package/kernel/shell.js +6 -2
- package/package.json +1 -1
- package/server/index.js +279 -64
- package/server/lib/install_validation.js +237 -0
- package/server/lib/task_packages.js +91 -0
- package/server/public/common.js +13 -2
- package/server/public/install.js +118 -0
- package/server/public/style.css +84 -0
- package/server/public/universal-launcher.css +1 -0
- package/server/public/universal-launcher.js +85 -41
- package/server/views/app.ejs +172 -46
- package/server/views/d.ejs +41 -6
- package/server/views/index.ejs +60 -9
- package/server/views/partials/d_terminal_column.ejs +5 -8
- package/server/views/task_builder.ejs +13 -9
- package/server/views/task_launch.ejs +6 -5
- package/server/views/task_list.ejs +2 -4
- package/server/views/task_share.ejs +5 -1
- package/test/docs-task-screenshots.js +317 -0
- package/test/universal-launcher.smoke.spec.js +138 -0
- package/test-results/after-conda-launch.png +0 -0
- package/test-results/dev-page.png +0 -0
package/kernel/api/index.js
CHANGED
|
@@ -133,21 +133,50 @@ class Api {
|
|
|
133
133
|
let p3
|
|
134
134
|
let api_path
|
|
135
135
|
let api_name
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
136
|
+
let api_root_path
|
|
137
|
+
const api_root = this.userdir || this.kernel.path("api")
|
|
138
|
+
const isWithinApiRoot = (candidatePath) => {
|
|
139
|
+
if (typeof candidatePath !== "string" || !candidatePath) {
|
|
140
|
+
return false
|
|
141
|
+
}
|
|
142
|
+
const relativePath = path.relative(api_root, candidatePath)
|
|
143
|
+
return relativePath === "" || (!relativePath.startsWith("..") && !path.isAbsolute(relativePath))
|
|
144
|
+
}
|
|
145
|
+
if (typeof name === "object" && name) {
|
|
146
|
+
if (name.name) {
|
|
147
|
+
api_root_path = this.kernel.path("api", name.name)
|
|
148
|
+
api_path = await this.launcher_path(name.name)
|
|
149
|
+
api_name = name.name
|
|
150
|
+
} else if (name.path) {
|
|
151
|
+
const resolvedPath = path.resolve(name.path)
|
|
152
|
+
const launcher = await this.launcher({ path: resolvedPath })
|
|
153
|
+
api_path = (launcher && launcher.script && launcher.launcher_root)
|
|
154
|
+
? path.resolve(launcher.root, launcher.launcher_root)
|
|
155
|
+
: resolvedPath
|
|
156
|
+
if (isWithinApiRoot(resolvedPath)) {
|
|
157
|
+
const relativeToApiRoot = path.relative(api_root, resolvedPath)
|
|
158
|
+
const segments = relativeToApiRoot.split(path.sep).filter(Boolean)
|
|
159
|
+
api_name = segments[0] || path.basename(resolvedPath)
|
|
160
|
+
api_root_path = path.resolve(api_root, api_name)
|
|
161
|
+
} else {
|
|
162
|
+
api_name = path.basename(resolvedPath)
|
|
163
|
+
api_root_path = resolvedPath
|
|
164
|
+
}
|
|
165
|
+
}
|
|
144
166
|
} else {
|
|
167
|
+
api_root_path = this.kernel.path("api", name)
|
|
145
168
|
api_path = await this.launcher_path(name)
|
|
146
169
|
api_name = name
|
|
147
|
-
p1 = path.resolve(api_path, "pinokio.js")
|
|
148
|
-
p2 = path.resolve(api_path, "pinokio_meta.json")
|
|
149
|
-
p3 = path.resolve(api_path, "pinokio.json")
|
|
150
170
|
}
|
|
171
|
+
if (!api_path) {
|
|
172
|
+
api_path = api_root_path
|
|
173
|
+
}
|
|
174
|
+
if (!api_root_path) {
|
|
175
|
+
api_root_path = api_path
|
|
176
|
+
}
|
|
177
|
+
p1 = path.resolve(api_path, "pinokio.js")
|
|
178
|
+
p2 = path.resolve(api_path, "pinokio_meta.json")
|
|
179
|
+
p3 = path.resolve(api_path, "pinokio.json")
|
|
151
180
|
let pinokio = (await this.kernel.loader.load(p1)).resolved
|
|
152
181
|
if (pinokio && pinokio.menu && !(Array.isArray(pinokio.menu) || typeof pinokio.menu === "function")) {
|
|
153
182
|
delete pinokio.menu
|
|
@@ -176,12 +205,13 @@ class Api {
|
|
|
176
205
|
// }
|
|
177
206
|
// }
|
|
178
207
|
|
|
208
|
+
meta.declared_path = typeof meta.path === "string" ? meta.path : ""
|
|
179
209
|
meta.iconpath = meta.icon ? meta.icon : null
|
|
180
210
|
//meta.iconpath = meta.icon ? path.resolve(api_path, meta.icon) : null
|
|
181
211
|
meta.path = api_path
|
|
182
212
|
meta.name = meta.title
|
|
183
213
|
|
|
184
|
-
let relpath = path.relative(
|
|
214
|
+
let relpath = path.relative(api_root_path, api_path)
|
|
185
215
|
if (relpath === ".") {
|
|
186
216
|
meta.icon = meta.icon ? `/asset/api/${api_name}/${meta.icon}` : "/pinokio-black.png"
|
|
187
217
|
meta.link = `/p/${api_name}/dev#n1`
|
package/kernel/shell.js
CHANGED
|
@@ -532,8 +532,12 @@ class Shell {
|
|
|
532
532
|
// console.log("RESIZE", { cols, rows })
|
|
533
533
|
this.cols = cols
|
|
534
534
|
this.rows = rows
|
|
535
|
-
this.ptyProcess.resize
|
|
536
|
-
|
|
535
|
+
if (this.ptyProcess && typeof this.ptyProcess.resize === "function") {
|
|
536
|
+
this.ptyProcess.resize(cols, rows)
|
|
537
|
+
}
|
|
538
|
+
if (this.vt && typeof this.vt.resize === "function") {
|
|
539
|
+
this.vt.resize(cols, rows)
|
|
540
|
+
}
|
|
537
541
|
this.stateSync.invalidate()
|
|
538
542
|
}
|
|
539
543
|
async emit2(message) {
|