@foggy-projects/deepseek-harness-plugin 0.4.2-rc.3 → 0.4.4-rc.1
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/README.md +222 -173
- package/THIRD-PARTY-RUNTIME-NOTICES.md +16 -16
- package/cordis.patch.yml +6 -6
- package/docs/COMMUNITY-MARKETPLACES.md +64 -64
- package/docs/PUBLIC-BETA-READINESS.md +109 -109
- package/docs/RELEASE-CANDIDATE-0.4.0-RC.2.md +38 -38
- package/docs/RELEASE-CANDIDATE-0.4.0-RC.3.md +18 -18
- package/docs/RELEASE-CANDIDATE-0.4.1-DSH-0.1.5-RC.1.md +60 -60
- package/docs/RELEASE-CANDIDATE-0.4.2-DSH-0.1.7-RC.1.md +62 -62
- package/docs/RELEASE-CANDIDATE-0.4.2-DSH-0.1.7-RC.2.md +50 -50
- package/docs/RELEASE-CANDIDATE-0.4.2-DSH-0.1.7-RC.3.md +34 -34
- package/docs/RELEASE-CANDIDATE-0.4.2-DSH-0.1.7-RC.4.md +32 -0
- package/docs/RELEASE-CANDIDATE-0.4.2-DSH-0.1.7-RC.5.md +27 -0
- package/docs/RELEASE-CANDIDATE-0.4.3-DSH-0.2.0-RC.1.md +96 -0
- package/docs/RELEASE-CANDIDATE-0.4.4-DSH-0.2.1-RC.1.md +135 -0
- package/docs/WINDOWS-BETA-ACCEPTANCE.md +113 -113
- package/experience/linux/README.md +53 -53
- package/experience/linux/prepare.sh +2 -2
- package/lib/atomic-json.js +41 -41
- package/lib/client.js +1222 -906
- package/lib/component-manager.js +164 -0
- package/lib/component-releases.js +363 -0
- package/lib/diagnostics.js +86 -86
- package/lib/index.js +764 -698
- package/lib/operation-lock.js +139 -0
- package/lib/python-runtime.js +339 -339
- package/lib/query-tool.js +134 -104
- package/lib/remote-descriptor.js +74 -59
- package/lib/remote.js +8 -8
- package/lib/runtime-settings.js +89 -89
- package/lib/skill-provider.js +116 -116
- package/lib/typert.js +9 -9
- package/lib/version.js +20 -20
- package/lib/viewer-preview.js +44 -27
- package/package.json +25 -15
- package/skills/foggy-deepseek-onboarding/SKILL.md +149 -143
- package/skills/foggy-deepseek-onboarding/assets/connection.schema.json +48 -48
- package/skills/foggy-deepseek-onboarding/assets/datasource.example.json +14 -14
- package/skills/foggy-deepseek-onboarding/assets/env.example +14 -14
- package/skills/foggy-deepseek-onboarding/assets/onboarding-state.schema.json +71 -71
- package/skills/foggy-deepseek-onboarding/assets/semantic-plan.example.json +8 -8
- package/skills/foggy-deepseek-onboarding/assets/semantic-plan.schema.json +21 -21
- package/skills/foggy-deepseek-onboarding/assets/versions.json +23 -23
- package/skills/foggy-deepseek-onboarding/references/onboarding-workflow.md +168 -168
- package/skills/foggy-deepseek-onboarding/scripts/doctor.ps1 +4 -4
- package/skills/foggy-deepseek-onboarding/scripts/install.ps1 +4 -4
- package/skills/foggy-deepseek-onboarding/scripts/invoke-onboarding.ps1 +32 -32
- package/skills/foggy-deepseek-onboarding/scripts/onboard.ps1 +4 -4
- package/skills/foggy-deepseek-onboarding/scripts/onboarding.py +3721 -3681
- package/skills/foggy-deepseek-onboarding/scripts/runtime-start.ps1 +4 -4
- package/skills/foggy-deepseek-onboarding/scripts/runtime-stop.ps1 +4 -4
- package/skills/foggy-deepseek-onboarding/scripts/uninstall.ps1 +4 -4
package/lib/diagnostics.js
CHANGED
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
import { open } from 'node:fs/promises'
|
|
2
|
-
import { isAbsolute, join, relative, resolve, sep } from 'node:path'
|
|
3
|
-
|
|
4
|
-
const DEFAULT_MAX_BYTES = 32 * 1024
|
|
5
|
-
const DEFAULT_MAX_LINES = 120
|
|
6
|
-
const ANSI_ESCAPE = /\u001b(?:\[[0-?]*[ -/]*[@-~]|\][^\u0007]*(?:\u0007|\u001b\\))/g
|
|
7
|
-
const BEARER_SECRET = /\bBearer\s+[A-Za-z0-9._~+/=-]{8,}/gi
|
|
8
|
-
const API_KEY_SECRET = /\bsk-[A-Za-z0-9._-]{12,}/g
|
|
9
|
-
const JDBC_URL = /\bjdbc:[^\s"'<>]+/gi
|
|
10
|
-
const URL_CREDENTIALS = /(\b[a-z][a-z0-9+.-]*:\/\/)[^\s/@:]+:[^\s/@]+@/gi
|
|
11
|
-
const SENSITIVE_QUERY_VALUE = /([?&](?:password|passwd|pwd|secret|token|api[_-]?key|auth[_-]?code)=)[^&#\s]*/gi
|
|
12
|
-
const SENSITIVE_ASSIGNMENT = /\b([A-Za-z0-9_.-]*(?:password|passwd|pwd|secret|token|api[_-]?key|authorization|auth[_-]?code)[A-Za-z0-9_.-]*)(\s*[:=]\s*)(?:"[^"]*"|'[^']*'|[^\s,;]+)/gi
|
|
13
|
-
|
|
14
|
-
export function sanitizeDiagnosticText(value) {
|
|
15
|
-
return String(value ?? '')
|
|
16
|
-
.replace(ANSI_ESCAPE, '')
|
|
17
|
-
.replace(BEARER_SECRET, 'Bearer [REDACTED]')
|
|
18
|
-
.replace(API_KEY_SECRET, '[REDACTED_API_KEY]')
|
|
19
|
-
.replace(JDBC_URL, 'jdbc:[REDACTED_CONNECTION_URL]')
|
|
20
|
-
.replace(URL_CREDENTIALS, '$1[REDACTED]@')
|
|
21
|
-
.replace(SENSITIVE_QUERY_VALUE, '$1[REDACTED]')
|
|
22
|
-
.replace(SENSITIVE_ASSIGNMENT, '$1$2[REDACTED]')
|
|
23
|
-
.replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g, '')
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function isInside(root, candidate) {
|
|
27
|
-
const value = relative(resolve(root), resolve(candidate))
|
|
28
|
-
return value !== '' && value !== '..' && !value.startsWith(`..${sep}`) && !isAbsolute(value)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export async function readDiagnosticLogTail(path, {
|
|
32
|
-
allowedRoot,
|
|
33
|
-
maxBytes = DEFAULT_MAX_BYTES,
|
|
34
|
-
maxLines = DEFAULT_MAX_LINES,
|
|
35
|
-
} = {}) {
|
|
36
|
-
if (!path || !allowedRoot || !isInside(allowedRoot, path)) {
|
|
37
|
-
return { sanitizedTail: '', tailTruncated: false, tailError: 'LOG_PATH_OUTSIDE_RUNTIME_ROOT' }
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
let handle
|
|
41
|
-
try {
|
|
42
|
-
handle = await open(path, 'r')
|
|
43
|
-
const details = await handle.stat()
|
|
44
|
-
const bytesToRead = Math.min(details.size, maxBytes)
|
|
45
|
-
const buffer = Buffer.alloc(bytesToRead)
|
|
46
|
-
if (bytesToRead > 0) await handle.read(buffer, 0, bytesToRead, details.size - bytesToRead)
|
|
47
|
-
let text = buffer.toString('utf8')
|
|
48
|
-
let truncated = details.size > bytesToRead
|
|
49
|
-
if (truncated) {
|
|
50
|
-
const firstLineEnd = text.indexOf('\n')
|
|
51
|
-
if (firstLineEnd >= 0) text = text.slice(firstLineEnd + 1)
|
|
52
|
-
}
|
|
53
|
-
const lines = text.split(/\r?\n/)
|
|
54
|
-
if (lines.length > maxLines) {
|
|
55
|
-
text = lines.slice(-maxLines).join('\n')
|
|
56
|
-
truncated = true
|
|
57
|
-
}
|
|
58
|
-
return {
|
|
59
|
-
sanitizedTail: sanitizeDiagnosticText(text).trim(),
|
|
60
|
-
tailTruncated: truncated,
|
|
61
|
-
tailBytesRead: bytesToRead,
|
|
62
|
-
}
|
|
63
|
-
} catch (error) {
|
|
64
|
-
return {
|
|
65
|
-
sanitizedTail: '',
|
|
66
|
-
tailTruncated: false,
|
|
67
|
-
tailError: error?.code || 'LOG_READ_FAILED',
|
|
68
|
-
}
|
|
69
|
-
} finally {
|
|
70
|
-
await handle?.close()
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export async function enrichRuntimeStartFailure(failure, dataRoot) {
|
|
75
|
-
if (!failure || typeof failure !== 'object') return failure
|
|
76
|
-
const runtimeRoot = join(dataRoot, 'runtime')
|
|
77
|
-
const logs = Array.isArray(failure.logs)
|
|
78
|
-
? await Promise.all(failure.logs.map(async (entry) => ({
|
|
79
|
-
...entry,
|
|
80
|
-
...(entry?.exists && entry?.path
|
|
81
|
-
? await readDiagnosticLogTail(entry.path, { allowedRoot: runtimeRoot })
|
|
82
|
-
: {}),
|
|
83
|
-
})))
|
|
84
|
-
: []
|
|
85
|
-
return { ...failure, logs }
|
|
86
|
-
}
|
|
1
|
+
import { open } from 'node:fs/promises'
|
|
2
|
+
import { isAbsolute, join, relative, resolve, sep } from 'node:path'
|
|
3
|
+
|
|
4
|
+
const DEFAULT_MAX_BYTES = 32 * 1024
|
|
5
|
+
const DEFAULT_MAX_LINES = 120
|
|
6
|
+
const ANSI_ESCAPE = /\u001b(?:\[[0-?]*[ -/]*[@-~]|\][^\u0007]*(?:\u0007|\u001b\\))/g
|
|
7
|
+
const BEARER_SECRET = /\bBearer\s+[A-Za-z0-9._~+/=-]{8,}/gi
|
|
8
|
+
const API_KEY_SECRET = /\bsk-[A-Za-z0-9._-]{12,}/g
|
|
9
|
+
const JDBC_URL = /\bjdbc:[^\s"'<>]+/gi
|
|
10
|
+
const URL_CREDENTIALS = /(\b[a-z][a-z0-9+.-]*:\/\/)[^\s/@:]+:[^\s/@]+@/gi
|
|
11
|
+
const SENSITIVE_QUERY_VALUE = /([?&](?:password|passwd|pwd|secret|token|api[_-]?key|auth[_-]?code)=)[^&#\s]*/gi
|
|
12
|
+
const SENSITIVE_ASSIGNMENT = /\b([A-Za-z0-9_.-]*(?:password|passwd|pwd|secret|token|api[_-]?key|authorization|auth[_-]?code)[A-Za-z0-9_.-]*)(\s*[:=]\s*)(?:"[^"]*"|'[^']*'|[^\s,;]+)/gi
|
|
13
|
+
|
|
14
|
+
export function sanitizeDiagnosticText(value) {
|
|
15
|
+
return String(value ?? '')
|
|
16
|
+
.replace(ANSI_ESCAPE, '')
|
|
17
|
+
.replace(BEARER_SECRET, 'Bearer [REDACTED]')
|
|
18
|
+
.replace(API_KEY_SECRET, '[REDACTED_API_KEY]')
|
|
19
|
+
.replace(JDBC_URL, 'jdbc:[REDACTED_CONNECTION_URL]')
|
|
20
|
+
.replace(URL_CREDENTIALS, '$1[REDACTED]@')
|
|
21
|
+
.replace(SENSITIVE_QUERY_VALUE, '$1[REDACTED]')
|
|
22
|
+
.replace(SENSITIVE_ASSIGNMENT, '$1$2[REDACTED]')
|
|
23
|
+
.replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g, '')
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function isInside(root, candidate) {
|
|
27
|
+
const value = relative(resolve(root), resolve(candidate))
|
|
28
|
+
return value !== '' && value !== '..' && !value.startsWith(`..${sep}`) && !isAbsolute(value)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export async function readDiagnosticLogTail(path, {
|
|
32
|
+
allowedRoot,
|
|
33
|
+
maxBytes = DEFAULT_MAX_BYTES,
|
|
34
|
+
maxLines = DEFAULT_MAX_LINES,
|
|
35
|
+
} = {}) {
|
|
36
|
+
if (!path || !allowedRoot || !isInside(allowedRoot, path)) {
|
|
37
|
+
return { sanitizedTail: '', tailTruncated: false, tailError: 'LOG_PATH_OUTSIDE_RUNTIME_ROOT' }
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
let handle
|
|
41
|
+
try {
|
|
42
|
+
handle = await open(path, 'r')
|
|
43
|
+
const details = await handle.stat()
|
|
44
|
+
const bytesToRead = Math.min(details.size, maxBytes)
|
|
45
|
+
const buffer = Buffer.alloc(bytesToRead)
|
|
46
|
+
if (bytesToRead > 0) await handle.read(buffer, 0, bytesToRead, details.size - bytesToRead)
|
|
47
|
+
let text = buffer.toString('utf8')
|
|
48
|
+
let truncated = details.size > bytesToRead
|
|
49
|
+
if (truncated) {
|
|
50
|
+
const firstLineEnd = text.indexOf('\n')
|
|
51
|
+
if (firstLineEnd >= 0) text = text.slice(firstLineEnd + 1)
|
|
52
|
+
}
|
|
53
|
+
const lines = text.split(/\r?\n/)
|
|
54
|
+
if (lines.length > maxLines) {
|
|
55
|
+
text = lines.slice(-maxLines).join('\n')
|
|
56
|
+
truncated = true
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
sanitizedTail: sanitizeDiagnosticText(text).trim(),
|
|
60
|
+
tailTruncated: truncated,
|
|
61
|
+
tailBytesRead: bytesToRead,
|
|
62
|
+
}
|
|
63
|
+
} catch (error) {
|
|
64
|
+
return {
|
|
65
|
+
sanitizedTail: '',
|
|
66
|
+
tailTruncated: false,
|
|
67
|
+
tailError: error?.code || 'LOG_READ_FAILED',
|
|
68
|
+
}
|
|
69
|
+
} finally {
|
|
70
|
+
await handle?.close()
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export async function enrichRuntimeStartFailure(failure, dataRoot) {
|
|
75
|
+
if (!failure || typeof failure !== 'object') return failure
|
|
76
|
+
const runtimeRoot = join(dataRoot, 'runtime')
|
|
77
|
+
const logs = Array.isArray(failure.logs)
|
|
78
|
+
? await Promise.all(failure.logs.map(async (entry) => ({
|
|
79
|
+
...entry,
|
|
80
|
+
...(entry?.exists && entry?.path
|
|
81
|
+
? await readDiagnosticLogTail(entry.path, { allowedRoot: runtimeRoot })
|
|
82
|
+
: {}),
|
|
83
|
+
})))
|
|
84
|
+
: []
|
|
85
|
+
return { ...failure, logs }
|
|
86
|
+
}
|