pinokiod 7.2.18 → 7.3.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.
Files changed (89) hide show
  1. package/Dockerfile +2 -0
  2. package/kernel/api/index.js +13 -179
  3. package/kernel/api/process/index.js +44 -99
  4. package/kernel/bin/conda-python.js +30 -0
  5. package/kernel/bin/conda.js +22 -3
  6. package/kernel/bin/huggingface.js +1 -1
  7. package/kernel/bin/index.js +11 -1
  8. package/kernel/environment.js +11 -205
  9. package/kernel/git.js +13 -0
  10. package/kernel/index.js +1 -64
  11. package/kernel/plugin.js +58 -6
  12. package/kernel/prototype.js +0 -4
  13. package/kernel/shell.js +2 -23
  14. package/kernel/util.js +0 -60
  15. package/package.json +1 -1
  16. package/server/index.js +171 -229
  17. package/server/lib/content_validation.js +33 -47
  18. package/server/public/common.js +29 -103
  19. package/server/public/create-launcher.js +31 -4
  20. package/server/public/electron.css +6 -0
  21. package/server/public/style.css +0 -337
  22. package/server/public/task-launcher.css +3 -11
  23. package/server/public/task-launcher.js +32 -5
  24. package/server/public/universal-launcher.js +26 -3
  25. package/server/socket.js +11 -22
  26. package/server/views/app.ejs +30 -167
  27. package/server/views/d.ejs +35 -33
  28. package/server/views/editor.ejs +4 -25
  29. package/server/views/partials/main_sidebar.ejs +0 -1
  30. package/server/views/partials/menu.ejs +1 -1
  31. package/server/views/pre.ejs +1 -1
  32. package/server/views/shell.ejs +3 -11
  33. package/server/views/task_launch.ejs +10 -10
  34. package/server/views/terminal.ejs +5 -34
  35. package/spec/INSTRUCTION_SYNC.md +5 -5
  36. package/kernel/agent_instructions.js +0 -166
  37. package/kernel/api/shell_run_template.js +0 -273
  38. package/kernel/api/uri/index.js +0 -51
  39. package/kernel/plugin_sources.js +0 -289
  40. package/kernel/watch/context.js +0 -42
  41. package/kernel/watch/drivers/fs.js +0 -71
  42. package/kernel/watch/drivers/poll.js +0 -33
  43. package/kernel/watch/index.js +0 -185
  44. package/server/features/index.js +0 -13
  45. package/server/features/notes/index.js +0 -41
  46. package/server/features/notes/parser.js +0 -174
  47. package/server/features/notes/public/notes.css +0 -955
  48. package/server/features/notes/public/notes.js +0 -1149
  49. package/server/features/notes/registry_import.js +0 -412
  50. package/server/features/notes/routes.js +0 -156
  51. package/server/features/notes/service.js +0 -326
  52. package/server/features/notes/watcher.js +0 -74
  53. package/server/lib/workspace_catalog.js +0 -151
  54. package/server/lib/workspace_runtime.js +0 -390
  55. package/server/public/tasker.css +0 -336
  56. package/server/public/tasker.js +0 -407
  57. package/server/routes/workspaces.js +0 -44
  58. package/server/views/partials/workspace_row.ejs +0 -61
  59. package/server/views/tasker.ejs +0 -40
  60. package/server/views/workspaces.ejs +0 -813
  61. package/system/plugin/antigravity/antigravity.png +0 -0
  62. package/system/plugin/antigravity/pinokio.js +0 -35
  63. package/system/plugin/claude/claude.png +0 -0
  64. package/system/plugin/claude/pinokio.js +0 -61
  65. package/system/plugin/claude-auto/claude.png +0 -0
  66. package/system/plugin/claude-auto/pinokio.js +0 -72
  67. package/system/plugin/claude-desktop/icon.jpeg +0 -0
  68. package/system/plugin/claude-desktop/pinokio.js +0 -37
  69. package/system/plugin/codex/openai.webp +0 -0
  70. package/system/plugin/codex/pinokio.js +0 -56
  71. package/system/plugin/codex-auto/openai.webp +0 -0
  72. package/system/plugin/codex-auto/pinokio.js +0 -63
  73. package/system/plugin/codex-desktop/icon.png +0 -0
  74. package/system/plugin/codex-desktop/pinokio.js +0 -37
  75. package/system/plugin/crush/crush.png +0 -0
  76. package/system/plugin/crush/pinokio.js +0 -29
  77. package/system/plugin/cursor/cursor.jpeg +0 -0
  78. package/system/plugin/cursor/pinokio.js +0 -37
  79. package/system/plugin/gemini/gemini.jpeg +0 -0
  80. package/system/plugin/gemini/pinokio.js +0 -38
  81. package/system/plugin/gemini-auto/gemini.jpeg +0 -0
  82. package/system/plugin/gemini-auto/pinokio.js +0 -41
  83. package/system/plugin/qwen/pinokio.js +0 -48
  84. package/system/plugin/qwen/qwen.png +0 -0
  85. package/system/plugin/vscode/pinokio.js +0 -34
  86. package/system/plugin/vscode/vscode.png +0 -0
  87. package/system/plugin/windsurf/pinokio.js +0 -37
  88. package/system/plugin/windsurf/windsurf.png +0 -0
  89. package/test/plugin-sources.test.js +0 -45
@@ -1,174 +0,0 @@
1
- const fs = require("fs")
2
- const path = require("path")
3
-
4
- const RESULT_RELATIVE_DIR = path.join(".pinokio", "notes")
5
- const NOTE_FILENAME = "note.md"
6
- const METADATA_FILENAME = "pinokio.json"
7
- const DEFAULT_READY_FILENAME = METADATA_FILENAME
8
- const PREVIEW_CHARS = 1200
9
- const MEDIA_EXTENSIONS = new Set([
10
- ".apng",
11
- ".avif",
12
- ".gif",
13
- ".jpeg",
14
- ".jpg",
15
- ".m4a",
16
- ".mp3",
17
- ".mp4",
18
- ".ogg",
19
- ".png",
20
- ".svg",
21
- ".wav",
22
- ".webm",
23
- ".webp"
24
- ])
25
-
26
- function normalizeWhitespace(value) {
27
- return String(value || "").replace(/\s+/g, " ").trim()
28
- }
29
-
30
- function extractTitle(markdown, workspaceName) {
31
- const lines = String(markdown || "").split(/\r?\n/)
32
- for (const line of lines) {
33
- const match = line.match(/^#\s+(.+?)\s*#*\s*$/)
34
- if (match && match[1]) {
35
- return normalizeWhitespace(match[1]).slice(0, 140) || "Note"
36
- }
37
- }
38
- return workspaceName ? `Note for ${workspaceName}` : "Note"
39
- }
40
-
41
- function normalizeTitle(value) {
42
- return normalizeWhitespace(value).slice(0, 160)
43
- }
44
-
45
- function parseNoteMetadata(raw) {
46
- const parsed = JSON.parse(String(raw || ""))
47
- if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
48
- return {}
49
- }
50
- const metadata = { ...parsed }
51
- if (typeof metadata.title === "string") {
52
- metadata.title = normalizeTitle(metadata.title)
53
- } else {
54
- delete metadata.title
55
- }
56
- if (typeof metadata.content === "string") {
57
- metadata.content = metadata.content.trim().replace(/\\/g, "/")
58
- } else {
59
- delete metadata.content
60
- }
61
- return metadata
62
- }
63
-
64
- function extractTitleAndBody(markdown, fallbackTitle) {
65
- const lines = String(markdown || "").split(/\r?\n/)
66
- for (let i = 0; i < lines.length; i += 1) {
67
- const match = lines[i].match(/^#\s+(.+?)\s*#*\s*$/)
68
- if (!match || !match[1]) continue
69
- const title = normalizeWhitespace(match[1]).slice(0, 160)
70
- const bodyLines = [...lines.slice(0, i), ...lines.slice(i + 1)]
71
- while (bodyLines.length && !bodyLines[0].trim()) bodyLines.shift()
72
- return { title: title || fallbackTitle, body: bodyLines.join("\n").trim() }
73
- }
74
- return { title: fallbackTitle, body: String(markdown || "").trim() }
75
- }
76
-
77
- function buildExcerpt(markdown) {
78
- const stripped = String(markdown || "")
79
- .replace(/```[\s\S]*?```/g, " ")
80
- .replace(/!\[[^\]]*]\([^)]+\)/g, " ")
81
- .replace(/\[[^\]]+]\([^)]+\)/g, (match) => {
82
- const label = match.match(/^\[([^\]]+)]/)
83
- return label && label[1] ? ` ${label[1]} ` : " "
84
- })
85
- .replace(/^#+\s+/gm, "")
86
- .replace(/[*_`>#-]/g, " ")
87
- return normalizeWhitespace(stripped).slice(0, PREVIEW_CHARS)
88
- }
89
-
90
- function isExternalRef(value) {
91
- return /^(?:[a-z][a-z0-9+.-]*:|\/\/|#)/i.test(value)
92
- }
93
-
94
- function normalizeMarkdownRef(value) {
95
- const raw = String(value || "").trim().replace(/^<|>$/g, "")
96
- if (!raw || raw.includes("\0") || isExternalRef(raw) || path.isAbsolute(raw)) {
97
- return ""
98
- }
99
- const withoutHash = raw.split("#")[0]
100
- const withoutQuery = withoutHash.split("?")[0]
101
- if (!withoutQuery) {
102
- return ""
103
- }
104
- let decoded = withoutQuery
105
- try {
106
- decoded = decodeURIComponent(withoutQuery)
107
- } catch (_) {
108
- }
109
- const normalized = path.posix.normalize(decoded.replace(/\\/g, "/"))
110
- if (!normalized || normalized === "." || normalized === ".." || normalized.startsWith("../") || normalized.includes("/../")) {
111
- return ""
112
- }
113
- return normalized
114
- }
115
-
116
- function collectMarkdownRefs(markdown) {
117
- const refs = []
118
- const seen = new Set()
119
- const patterns = [
120
- /!\[[^\]]*]\(([^)\s]+)(?:\s+["'][^"']*["'])?\)/g,
121
- /\[(?:video|audio|media|image|screenshot|file|asset)[^\]]*]\(([^)\s]+)(?:\s+["'][^"']*["'])?\)/gi,
122
- /\[[^\]]+]\(([^)\s]+)(?:\s+["'][^"']*["'])?\)/g
123
- ]
124
- for (const pattern of patterns) {
125
- let match = null
126
- while ((match = pattern.exec(markdown))) {
127
- const ref = normalizeMarkdownRef(match[1])
128
- if (!ref || seen.has(ref)) continue
129
- seen.add(ref)
130
- refs.push(ref)
131
- }
132
- }
133
- return refs
134
- }
135
-
136
- async function describeMediaRefs(markdown, baseDir, options = {}) {
137
- const refs = collectMarkdownRefs(markdown)
138
- const media = []
139
- for (const ref of refs) {
140
- const ext = path.extname(ref).toLowerCase()
141
- if (options.mediaOnly !== false && !MEDIA_EXTENSIONS.has(ext)) {
142
- continue
143
- }
144
- const filePath = path.resolve(baseDir, ref)
145
- const relative = path.relative(baseDir, filePath)
146
- if (!relative || relative.startsWith("..") || path.isAbsolute(relative)) {
147
- continue
148
- }
149
- const stats = await fs.promises.stat(filePath).catch(() => null)
150
- media.push({
151
- ref,
152
- path: filePath,
153
- bytes: stats && stats.isFile() ? stats.size : 0,
154
- mtimeMs: stats && stats.isFile() ? stats.mtimeMs : 0,
155
- exists: Boolean(stats && stats.isFile())
156
- })
157
- }
158
- return media
159
- }
160
-
161
- module.exports = {
162
- METADATA_FILENAME,
163
- DEFAULT_READY_FILENAME,
164
- RESULT_RELATIVE_DIR,
165
- NOTE_FILENAME,
166
- buildExcerpt,
167
- collectMarkdownRefs,
168
- describeMediaRefs,
169
- extractTitle,
170
- extractTitleAndBody,
171
- normalizeMarkdownRef,
172
- normalizeTitle,
173
- parseNoteMetadata
174
- }