pinokiod 3.18.9 → 3.19.2

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.
Files changed (92) hide show
  1. package/kernel/api/index.js +0 -1
  2. package/kernel/prototype.js +34 -35
  3. package/kernel/shell.js +0 -1
  4. package/package.json +2 -2
  5. package/server/index.js +6 -7
  6. package/server/views/prototype/init.ejs +42 -12
  7. package/kernel/proto/PINOKIO.md +0 -6886
  8. package/kernel/proto/cli/icon.png +0 -0
  9. package/kernel/proto/cli/installable/README.md +0 -6
  10. package/kernel/proto/cli/installable/index.js +0 -54
  11. package/kernel/proto/cli/installable/static/AGENTS.md +0 -24
  12. package/kernel/proto/cli/installable/static/gitignore +0 -10
  13. package/kernel/proto/cli/installable/static/pinokio.js +0 -34
  14. package/kernel/proto/cli/instant/README.md +0 -5
  15. package/kernel/proto/cli/instant/index.js +0 -36
  16. package/kernel/proto/cli/instant/static/AGENTS.md +0 -24
  17. package/kernel/proto/cli/instant/static/gitignore +0 -10
  18. package/kernel/proto/cli/instant/static/pinokio.js +0 -11
  19. package/kernel/proto/documentation/new/README.md +0 -9
  20. package/kernel/proto/documentation/new/icon.png +0 -0
  21. package/kernel/proto/documentation/new/index.js +0 -39
  22. package/kernel/proto/documentation/new/static/AGENTS.md +0 -24
  23. package/kernel/proto/documentation/new/static/docs/docsify.min.js +0 -1
  24. package/kernel/proto/documentation/new/static/docs/index.html +0 -75
  25. package/kernel/proto/documentation/new/static/docs/style.css +0 -212
  26. package/kernel/proto/documentation/new/static/docs/vue.css +0 -1
  27. package/kernel/proto/documentation/new/static/gitignore +0 -10
  28. package/kernel/proto/documentation/new/static/pinokio.js +0 -28
  29. package/kernel/proto/documentation/new/static/start.js +0 -54
  30. package/kernel/proto/empty/clone/README.md +0 -14
  31. package/kernel/proto/empty/clone/index.js +0 -18
  32. package/kernel/proto/empty/clone/static/AGENTS.md +0 -28
  33. package/kernel/proto/empty/clone/static/gitignore +0 -11
  34. package/kernel/proto/empty/clone/static/install.js +0 -13
  35. package/kernel/proto/empty/clone/static/pinokio.js +0 -76
  36. package/kernel/proto/empty/clone/static/pinokio.json +0 -3
  37. package/kernel/proto/empty/clone/static/reset.js +0 -8
  38. package/kernel/proto/empty/clone/static/start.js +0 -35
  39. package/kernel/proto/empty/clone/static/update.js +0 -23
  40. package/kernel/proto/empty/icon.png +0 -0
  41. package/kernel/proto/empty/new/README.md +0 -14
  42. package/kernel/proto/empty/new/index.js +0 -18
  43. package/kernel/proto/empty/new/static/AGENTS.md +0 -28
  44. package/kernel/proto/empty/new/static/app/.gitkeep +0 -0
  45. package/kernel/proto/empty/new/static/gitignore +0 -10
  46. package/kernel/proto/empty/new/static/install.js +0 -13
  47. package/kernel/proto/empty/new/static/pinokio.js +0 -76
  48. package/kernel/proto/empty/new/static/pinokio.json +0 -3
  49. package/kernel/proto/empty/new/static/reset.js +0 -8
  50. package/kernel/proto/empty/new/static/start.js +0 -35
  51. package/kernel/proto/empty/new/static/update.js +0 -14
  52. package/kernel/proto/nodejs/clone/README.md +0 -16
  53. package/kernel/proto/nodejs/clone/index.js +0 -87
  54. package/kernel/proto/nodejs/clone/static/AGENTS.md +0 -27
  55. package/kernel/proto/nodejs/clone/static/gitignore +0 -11
  56. package/kernel/proto/nodejs/clone/static/pinokio.js +0 -77
  57. package/kernel/proto/nodejs/clone/static/reset.js +0 -8
  58. package/kernel/proto/nodejs/clone/static/update.js +0 -14
  59. package/kernel/proto/nodejs/icon.png +0 -0
  60. package/kernel/proto/nodejs/new/README.md +0 -15
  61. package/kernel/proto/nodejs/new/index.js +0 -82
  62. package/kernel/proto/nodejs/new/static/AGENTS.md +0 -27
  63. package/kernel/proto/nodejs/new/static/app/index.js +0 -10
  64. package/kernel/proto/nodejs/new/static/app/package.json +0 -16
  65. package/kernel/proto/nodejs/new/static/gitignore +0 -10
  66. package/kernel/proto/nodejs/new/static/pinokio.js +0 -84
  67. package/kernel/proto/nodejs/new/static/reset.js +0 -8
  68. package/kernel/proto/nodejs/new/static/update.js +0 -14
  69. package/kernel/proto/pinokio.js +0 -64
  70. package/kernel/proto/python/clone/README.md +0 -11
  71. package/kernel/proto/python/clone/form.png +0 -0
  72. package/kernel/proto/python/clone/index.js +0 -161
  73. package/kernel/proto/python/clone/static/AGENTS.md +0 -30
  74. package/kernel/proto/python/clone/static/gitignore +0 -11
  75. package/kernel/proto/python/clone/static/link.js +0 -10
  76. package/kernel/proto/python/clone/static/pinokio.js +0 -85
  77. package/kernel/proto/python/clone/static/reset.js +0 -8
  78. package/kernel/proto/python/clone/static/torch.js +0 -117
  79. package/kernel/proto/python/clone/static/update.js +0 -9
  80. package/kernel/proto/python/icon.png +0 -0
  81. package/kernel/proto/python/new/README.md +0 -18
  82. package/kernel/proto/python/new/index.js +0 -128
  83. package/kernel/proto/python/new/install_with_torch.js +0 -29
  84. package/kernel/proto/python/new/static/AGENTS.md +0 -27
  85. package/kernel/proto/python/new/static/app/app.py +0 -12
  86. package/kernel/proto/python/new/static/app/requirements.txt +0 -1
  87. package/kernel/proto/python/new/static/gitignore +0 -10
  88. package/kernel/proto/python/new/static/link.js +0 -10
  89. package/kernel/proto/python/new/static/pinokio.js +0 -84
  90. package/kernel/proto/python/new/static/reset.js +0 -8
  91. package/kernel/proto/python/new/static/torch.js +0 -117
  92. package/kernel/proto/python/new/static/update.js +0 -8
@@ -62,7 +62,6 @@ class Api {
62
62
  delete pinokio3.menu
63
63
  }
64
64
  let meta = Object.assign({}, pinokio, pinokio2, pinokio3)
65
- console.log("meta", meta)
66
65
 
67
66
  // create pinokio.json if it doesn't exist
68
67
  // if (!pinokio3) {
@@ -18,52 +18,51 @@ class Proto {
18
18
  await fs.promises.mkdir(this.kernel.path("prototype"), { recursive: true }).catch((e) => { })
19
19
  await this.kernel.exec({
20
20
  //message: "git clone https://github.com/peanutcocktail/prototype system",
21
- message: "git clone https://github.com/pinokiocomputer/prototype system",
21
+ //message: "git clone https://github.com/pinokiocomputer/prototype system",
22
+ message: "git clone https://github.com/pinokiocomputer/proto system",
22
23
  path: this.kernel.path("prototype")
23
24
  }, (e) => {
24
25
  process.stdout.write(e.raw)
25
26
  })
26
- }
27
-
28
- let pinokiojs_path = this.kernel.path("prototype/system/pinokio.js")
29
- let config = await this.kernel.require(pinokiojs_path)
30
- this.config = config
31
-
32
- if (this.config && this.config.menu) {
33
- this.config.menu.push({
34
- icon: "fa-solid fa-rotate",
35
- text: "Update",
36
- shell: {
37
- message: "git pull",
38
- path: this.kernel.path("prototype/system")
39
- }
27
+ await this.kernel.download({
28
+ uri: "https://raw.githubusercontent.com/pinokiocomputer/home/refs/heads/main/docs/README.md",
29
+ path: this.kernel.path("prototype"),
30
+ filename: "PINOKIO.md"
31
+ }, (e) => {
32
+ process.stdout.write(e.raw)
40
33
  })
41
34
  }
35
+ }
36
+ }
37
+ async reset() {
38
+ await fs.promises.rm(this.kernel.path("prototype"), { recursive: true })
39
+ }
40
+ async create(req, ondata) {
41
+ console.log("proto.create", req)
42
+ try {
43
+ let projectType = req.params.projectType
44
+ let startType = req.params.cliType || req.params.startType
45
+ console.log({ projectType, startType })
42
46
 
47
+ let cwd = req.cwd
48
+ let name = req.name
49
+ let payload = {}
50
+ payload.cwd = path.resolve(cwd, name)
51
+ payload.input = req.params
43
52
 
53
+ let mod_path = this.kernel.path("prototype/system", projectType, startType)
54
+ let mod = await this.kernel.require(mod_path)
44
55
 
56
+ await mod(payload, ondata, this.kernel)
45
57
 
58
+ // copy readme
59
+ let readme_path = this.kernel.path("prototype/PINOKIO.md")
60
+ await fs.promises.cp(readme_path, path.resolve(cwd, name, "PINOKIO.md"))
46
61
 
47
- //// let prototype_paths = (await glob('**/pinokio.js', { cwd }))
48
- // let prototype_dir = path.resolve(this.kernel.homedir, "prototype")
49
- // for(let prototype_path of prototype_paths) {
50
- // let proto = path.dirname(prototype_path)
51
- // let pinokiojs = path.resolve(prototype_dir, prototype_path)
52
- // let config = await this.kernel.require(pinokiojs)
53
- // if (config && config.run) {
54
- // if (config.icon) {
55
- // config.icon = "/prototype/" + proto + "/" + config.icon
56
- // } else {
57
- // config.icon === "/pinokio-black.png"
58
- // }
59
- // let c = {
60
- // id: proto,
61
- // ...config
62
- // }
63
- // this.items.push(c)
64
- // this.kv[proto] = c
65
- // }
66
- // }
62
+ return { success: "/p/" + name }
63
+ } catch (e) {
64
+ console.log("ERROR", e)
65
+ return { error: e.stack }
67
66
  }
68
67
  }
69
68
  async readme(proto) {
package/kernel/shell.js CHANGED
@@ -449,7 +449,6 @@ class Shell {
449
449
  }
450
450
  this.prompt_pattern = await this.prompt(params.path)
451
451
  this.cb = cb
452
- console.log("shell request", params)
453
452
  let r = await this.exec(params)
454
453
  return r
455
454
  }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.18.9",
3
+ "version": "3.19.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "download_readme": "wget -O kernel/proto/PINOKIO.md https://raw.githubusercontent.com/pinokiocomputer/home/refs/heads/main/docs/README.md",
8
- "start": "npm run download_readme && node script/index"
8
+ "start": "node script/index"
9
9
  },
10
10
  "author": "",
11
11
  "license": "MIT",
package/server/index.js CHANGED
@@ -562,9 +562,6 @@ class Server {
562
562
  if (!this.kernel.proto.config) {
563
563
  await this.kernel.proto.init()
564
564
  }
565
- // if (!this.kernel.plugin.config) {
566
- // await this.kernel.plugin.init()
567
- // }
568
565
  res.render("app", result)
569
566
  }
570
567
  getVariationUrls(req) {
@@ -1934,7 +1931,6 @@ class Server {
1934
1931
  if (config.menu[i].popout) {
1935
1932
  config.menu[i].target = "_blank"
1936
1933
  } else {
1937
- console.log("config.menu", config.menu)
1938
1934
  config.menu[i].target = "@" + (config.menu[i].id || config.menu[i].src)
1939
1935
  }
1940
1936
 
@@ -2586,6 +2582,9 @@ class Server {
2586
2582
  path.resolve(__dirname, "..", "kernel", "gitconfig_template"),
2587
2583
  gitconfig
2588
2584
  )
2585
+
2586
+ let prototype_path = path.resolve(home, "prototype")
2587
+ await fse.remove(prototype_path)
2589
2588
 
2590
2589
 
2591
2590
  console.log("[TRY] Updating to the new version")
@@ -2738,9 +2737,9 @@ class Server {
2738
2737
  // return
2739
2738
  // }
2740
2739
 
2741
- if (!this.kernel.proto.config) {
2742
- await this.kernel.proto.init()
2743
- }
2740
+ // if (!this.kernel.proto.config) {
2741
+ // await this.kernel.proto.init()
2742
+ // }
2744
2743
  if (!this.kernel.plugin.config) {
2745
2744
  await this.kernel.plugin.init()
2746
2745
  }
@@ -22,7 +22,14 @@
22
22
  padding: 0;
23
23
  box-sizing: border-box;
24
24
  }
25
-
25
+ img.appicon {
26
+ width: 40px;
27
+ height: 40px;
28
+ margin-right: 10px;
29
+ padding: 5px;
30
+ border-radius: 4px;
31
+ background: white;
32
+ }
26
33
  .container {
27
34
  max-width: 800px;
28
35
  margin: 0 auto;
@@ -42,6 +49,7 @@ h4 {
42
49
  font-size: 15px;
43
50
  letter-spacing: 0px;
44
51
  margin-bottom: 5px;
52
+ margin-top: 10px;
45
53
  }
46
54
 
47
55
  h2 {
@@ -85,7 +93,7 @@ body.dark .progress-bar .step.active {
85
93
  }
86
94
  .progress-bar .step.active {
87
95
  background: rgba(0,0,0,0.1);
88
- color: #ffffff;
96
+ color: silver;
89
97
  }
90
98
 
91
99
  .progress-bar .step.completed {
@@ -117,11 +125,11 @@ body.dark .radio-group label {
117
125
  background: rgba(0,0,0,0.3);
118
126
  }
119
127
  .radio-group label {
128
+ background: rgba(0,0,0,0.03);
120
129
  display: flex;
121
130
  align-items: center;
122
131
  margin-bottom: 5px;
123
132
  padding: 10px;
124
- background: rgba(0,0,0,0.04);
125
133
  cursor: pointer;
126
134
  transition: all 0.3s ease;
127
135
  }
@@ -137,11 +145,12 @@ body.dark .radio-group label {
137
145
  }
138
146
 
139
147
  .radio-group label span {
140
- font-weight: 500;
148
+ font-weight: bold;
141
149
  flex: 1;
142
150
  }
143
151
 
144
152
  .radio-group label .description {
153
+ opacity: 0.7;
145
154
  margin-left: 0.5rem;
146
155
  }
147
156
 
@@ -169,7 +178,7 @@ body.dark .conditional-options {
169
178
  .conditional-options {
170
179
  margin: 20px 0;
171
180
  padding: 1rem;
172
- background: rgba(0,0,0,0.1);
181
+ background: rgba(0,0,0,0.04);
173
182
  /*
174
183
  border: 1px solid #000000;
175
184
  */
@@ -210,7 +219,7 @@ body.dark .conditional-options {
210
219
  textarea, input[type="url"], input[type="text"] {
211
220
  width: 100%;
212
221
  padding: 10px;
213
- border: 1px solid #000000;
222
+ border: none;
214
223
  font-family: inherit;
215
224
  }
216
225
 
@@ -971,11 +980,11 @@ body.dark .appcanvas {
971
980
  }
972
981
  .command-fields {
973
982
  background: rgba(0,0,0,0.04);
983
+ padding: 20px;
984
+ margin: 20px 0;
974
985
  }
975
986
  body.dark .command-fields {
976
- padding: 20px;
977
987
  background: rgba(0,0,0,0.3);
978
- margin: 20px 0;
979
988
  }
980
989
  </style>
981
990
  <link href="/app.css" rel="stylesheet"/>
@@ -1062,19 +1071,25 @@ body.dark .command-fields {
1062
1071
  <div class="radio-group">
1063
1072
  <label>
1064
1073
  <input type="radio" name="projectType" value="nodejs">
1074
+ <img class='appicon' src="/asset/prototype/system/nodejs/icon.png"/>
1065
1075
  <span>Node.js</span>
1076
+ <p class="description">A launcher for a typical node.js project</p>
1066
1077
  </label>
1067
1078
  <label>
1068
1079
  <input type="radio" name="projectType" value="python">
1080
+ <img class='appicon' src="/asset/prototype/system/python/icon.png"/>
1069
1081
  <span>Python</span>
1082
+ <p class='description'>A launcher for a typical python project)</p>
1070
1083
  </label>
1071
1084
  <label>
1072
1085
  <input type="radio" name="projectType" value="empty">
1073
- <span>Use AI</span>
1086
+ <img class='appicon' src="/asset/prototype/system/empty/icon.png"/>
1087
+ <span>Any</span>
1088
+ <p class='description'>A minimal launcher you can customize on your own</p>
1074
1089
  </label>
1075
1090
  </div>
1076
1091
 
1077
- <div class='command-fields'>
1092
+ <div class='command-fields conditional-options' id="clone-command-fields">
1078
1093
  <div class="git-url-input">
1079
1094
  <label for="gitUrl">Git Repository URL:</label>
1080
1095
  <input type="url" name="gitUrl" id="gitUrl" placeholder="https://github.com/username/repository.git">
@@ -1133,10 +1148,12 @@ body.dark .command-fields {
1133
1148
  <div class="radio-group">
1134
1149
  <label>
1135
1150
  <input type="radio" name="projectType" value="empty">
1151
+ <img class='appicon' src="/asset/prototype/system/empty/icon.png"/>
1136
1152
  <span>Empty Project</span>
1137
1153
  </label>
1138
1154
  <label>
1139
1155
  <input type="radio" name="projectType" value="cli">
1156
+ <img class='appicon' src="/asset/prototype/system/cli/icon.png"/>
1140
1157
  <span>CLI App Launcher</span>
1141
1158
  </label>
1142
1159
 
@@ -1184,6 +1201,7 @@ body.dark .command-fields {
1184
1201
 
1185
1202
  <label>
1186
1203
  <input type="radio" name="projectType" value="documentation">
1204
+ <img class='appicon' src="/asset/prototype/system/documentation/icon.png"/>
1187
1205
  <span>Documentation</span>
1188
1206
  </label>
1189
1207
 
@@ -1211,10 +1229,12 @@ body.dark .command-fields {
1211
1229
  </div>
1212
1230
  <label>
1213
1231
  <input type="radio" name="projectType" value="nodejs">
1232
+ <img class='appicon' src="/asset/prototype/system/nodejs/icon.png"/>
1214
1233
  <span>Node.js</span>
1215
1234
  </label>
1216
1235
  <label>
1217
1236
  <input type="radio" name="projectType" value="python">
1237
+ <img class='appicon' src="/asset/prototype/system/python/icon.png"/>
1218
1238
  <span>Python</span>
1219
1239
  </label>
1220
1240
  </div>
@@ -1352,6 +1372,12 @@ document.addEventListener('DOMContentLoaded', function() {
1352
1372
  });
1353
1373
 
1354
1374
  function showStep(stepNumber) {
1375
+ console.log(stepNumber)
1376
+ if (stepNumber === 1) {
1377
+ document.querySelectorAll("#step-1 input[type=radio]").forEach((el) => {
1378
+ el.checked = false
1379
+ })
1380
+ }
1355
1381
  // Hide all steps
1356
1382
  document.querySelectorAll('.step-content').forEach(step => {
1357
1383
  step.classList.remove('active');
@@ -1499,6 +1525,9 @@ function handleStartTypeChange(event) {
1499
1525
  document.getElementById('python-options').classList.remove('show');
1500
1526
  document.getElementById('python-options-clone').classList.remove('show');
1501
1527
 
1528
+ // Hide clone command fields
1529
+ document.getElementById('clone-command-fields').classList.remove('show');
1530
+
1502
1531
  if (startType === 'clone') {
1503
1532
  cloneOptions.classList.add('show');
1504
1533
  newOptions.classList.remove('show');
@@ -1532,8 +1561,9 @@ function handleProjectTypeChange(event) {
1532
1561
  // Clear CLI input fields
1533
1562
  clearCliInputs();
1534
1563
 
1535
- // Update clone fields with defaults based on project type
1564
+ // Show clone command fields when a project type is selected in clone mode
1536
1565
  if (startType === 'clone') {
1566
+ document.getElementById('clone-command-fields').classList.add('show');
1537
1567
  updateCloneDefaults(projectType);
1538
1568
  }
1539
1569
 
@@ -1734,7 +1764,7 @@ async function displayResults(config) {
1734
1764
  }
1735
1765
  }
1736
1766
  socket.run({
1737
- method: "kernel.bin.init_launcher",
1767
+ method: "kernel.proto.create",
1738
1768
  cwd: "<%-JSON.stringify(cwd).slice(1, -1)%>",
1739
1769
  name: "<%=name%>",
1740
1770
  params: config