@mininglamp-oss/octo-runtime 1.1.0 → 1.1.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 +4 -2
- package/apps/cli/README.md +3 -1
- package/apps/cli/dist/build-info.json +2 -2
- package/apps/cli/dist/extras.d.ts +4 -2
- package/apps/cli/dist/extras.js +20 -21
- package/apps/cli/dist/help.js +3 -0
- package/apps/cli/dist/logs.d.ts +10 -0
- package/apps/cli/dist/logs.js +186 -0
- package/apps/cli/dist/main.d.ts +1 -0
- package/apps/cli/dist/main.js +94 -19
- package/apps/cli/dist/{default_adapters.json → manifest.json} +5 -0
- package/apps/cli/dist/module-manifest.d.ts +3 -0
- package/apps/cli/dist/module-manifest.js +11 -0
- package/apps/cli/dist/openclaw.js +30 -6
- package/apps/cli/dist/output.js +3 -0
- package/apps/cli/dist/playboard.js +10 -8
- package/apps/cli/dist/status-output.d.ts +10 -0
- package/apps/cli/dist/status-output.js +65 -0
- package/apps/cli/dist/worker.d.ts +1 -0
- package/apps/cli/dist/worker.js +18 -0
- package/dist/public/host.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.js +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/module-manifest.d.ts +33 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/module-manifest.js +118 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log-worker.js +7 -5
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log.d.ts +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log.js +45 -10
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.d.ts +11 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.js +70 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +5 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extras.d.ts +4 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extras.js +20 -21
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/help.js +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/logs.d.ts +10 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/logs.js +186 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.js +94 -19
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/{default_adapters.json → manifest.json} +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/module-manifest.d.ts +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/module-manifest.js +11 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/openclaw.js +30 -6
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +10 -8
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/status-output.d.ts +10 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/status-output.js +65 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/worker.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/worker.js +18 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +22 -9
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/model-input.d.ts +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/model-input.js +5 -5
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/heartbeat.d.ts +16 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/heartbeat.js +59 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.js +4 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/manifest-adapters.d.ts +6 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/manifest-adapters.js +88 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/module-specifier.d.ts +1 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/module-specifier.js +2 -9
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.d.ts +7 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.js +138 -9
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runner.js +3 -92
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/serve.js +36 -12
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.d.ts +4 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.js +14 -6
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/service.js +2 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.d.ts +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.js +57 -34
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +8 -16
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/config-schema.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/im-channel.js +16 -17
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/package.json +6 -6
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/config-schema.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +5 -5
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/config-schema.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/index.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/store.d.ts +4 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/store.js +54 -4
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-config.d.ts +8 -1
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-config.js +27 -12
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-service.js +39 -2
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/index.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
- package/node_modules/import-meta-resolve/index.d.ts +19 -0
- package/node_modules/import-meta-resolve/index.d.ts.map +1 -0
- package/node_modules/import-meta-resolve/index.js +47 -0
- package/node_modules/import-meta-resolve/lib/errors.d.ts +24 -0
- package/node_modules/import-meta-resolve/lib/errors.d.ts.map +1 -0
- package/node_modules/import-meta-resolve/lib/errors.js +504 -0
- package/node_modules/import-meta-resolve/lib/get-format.d.ts +13 -0
- package/node_modules/import-meta-resolve/lib/get-format.d.ts.map +1 -0
- package/node_modules/import-meta-resolve/lib/get-format.js +159 -0
- package/node_modules/import-meta-resolve/lib/package-json-reader.d.ts +31 -0
- package/node_modules/import-meta-resolve/lib/package-json-reader.d.ts.map +1 -0
- package/node_modules/import-meta-resolve/lib/package-json-reader.js +177 -0
- package/node_modules/import-meta-resolve/lib/resolve.d.ts +29 -0
- package/node_modules/import-meta-resolve/lib/resolve.d.ts.map +1 -0
- package/node_modules/import-meta-resolve/lib/resolve.js +1301 -0
- package/node_modules/import-meta-resolve/lib/utils.d.ts +6 -0
- package/node_modules/import-meta-resolve/lib/utils.d.ts.map +1 -0
- package/node_modules/import-meta-resolve/lib/utils.js +47 -0
- package/node_modules/import-meta-resolve/license +74 -0
- package/node_modules/import-meta-resolve/package.json +78 -0
- package/node_modules/import-meta-resolve/readme.md +252 -0
- package/package.json +28 -26
- package/packages/octo-runtime-extra-channel-gateway/config-schema.json +2 -2
- package/packages/octo-runtime-extra-channel-wecom/config-schema.json +2 -2
- package/packages/octo-runtime-extra-webui/config-schema.json +2 -2
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// Manually “tree shaken” from:
|
|
2
|
+
// <https://github.com/nodejs/node/blob/7c3dce0/lib/internal/modules/package_json_reader.js>
|
|
3
|
+
// Last checked on: Apr 29, 2024.
|
|
4
|
+
// Removed the native dependency.
|
|
5
|
+
// Also: no need to cache, we do that in resolve already.
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @import {ErrnoException} from './errors.js'
|
|
9
|
+
*
|
|
10
|
+
* @typedef {'commonjs' | 'module' | 'none'} PackageType
|
|
11
|
+
*
|
|
12
|
+
* @typedef PackageConfig
|
|
13
|
+
* @property {string} pjsonPath
|
|
14
|
+
* @property {boolean} exists
|
|
15
|
+
* @property {string | undefined} [main]
|
|
16
|
+
* @property {string | undefined} [name]
|
|
17
|
+
* @property {PackageType} type
|
|
18
|
+
* @property {Record<string, unknown> | undefined} [exports]
|
|
19
|
+
* @property {Record<string, unknown> | undefined} [imports]
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import fs from 'node:fs'
|
|
23
|
+
import path from 'node:path'
|
|
24
|
+
import {fileURLToPath} from 'node:url'
|
|
25
|
+
import {codes} from './errors.js'
|
|
26
|
+
|
|
27
|
+
const hasOwnProperty = {}.hasOwnProperty
|
|
28
|
+
|
|
29
|
+
const {ERR_INVALID_PACKAGE_CONFIG} = codes
|
|
30
|
+
|
|
31
|
+
/** @type {Map<string, PackageConfig>} */
|
|
32
|
+
const cache = new Map()
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @param {string} jsonPath
|
|
36
|
+
* @param {{specifier: URL | string, base?: URL}} options
|
|
37
|
+
* @returns {PackageConfig}
|
|
38
|
+
*/
|
|
39
|
+
export function read(jsonPath, {base, specifier}) {
|
|
40
|
+
const existing = cache.get(jsonPath)
|
|
41
|
+
|
|
42
|
+
if (existing) {
|
|
43
|
+
return existing
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** @type {string | undefined} */
|
|
47
|
+
let string
|
|
48
|
+
|
|
49
|
+
try {
|
|
50
|
+
string = fs.readFileSync(path.toNamespacedPath(jsonPath), 'utf8')
|
|
51
|
+
} catch (error) {
|
|
52
|
+
const exception = /** @type {ErrnoException} */ (error)
|
|
53
|
+
|
|
54
|
+
if (exception.code !== 'ENOENT') {
|
|
55
|
+
throw exception
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** @type {PackageConfig} */
|
|
60
|
+
const result = {
|
|
61
|
+
exists: false,
|
|
62
|
+
pjsonPath: jsonPath,
|
|
63
|
+
main: undefined,
|
|
64
|
+
name: undefined,
|
|
65
|
+
type: 'none', // Ignore unknown types for forwards compatibility
|
|
66
|
+
exports: undefined,
|
|
67
|
+
imports: undefined
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (string !== undefined) {
|
|
71
|
+
/** @type {Record<string, unknown>} */
|
|
72
|
+
let parsed
|
|
73
|
+
|
|
74
|
+
try {
|
|
75
|
+
parsed = JSON.parse(string)
|
|
76
|
+
} catch (error_) {
|
|
77
|
+
const cause = /** @type {ErrnoException} */ (error_)
|
|
78
|
+
const error = new ERR_INVALID_PACKAGE_CONFIG(
|
|
79
|
+
jsonPath,
|
|
80
|
+
(base ? `"${specifier}" from ` : '') + fileURLToPath(base || specifier),
|
|
81
|
+
cause.message
|
|
82
|
+
)
|
|
83
|
+
error.cause = cause
|
|
84
|
+
throw error
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
result.exists = true
|
|
88
|
+
|
|
89
|
+
if (
|
|
90
|
+
hasOwnProperty.call(parsed, 'name') &&
|
|
91
|
+
typeof parsed.name === 'string'
|
|
92
|
+
) {
|
|
93
|
+
result.name = parsed.name
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (
|
|
97
|
+
hasOwnProperty.call(parsed, 'main') &&
|
|
98
|
+
typeof parsed.main === 'string'
|
|
99
|
+
) {
|
|
100
|
+
result.main = parsed.main
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (hasOwnProperty.call(parsed, 'exports')) {
|
|
104
|
+
// @ts-expect-error: assume valid.
|
|
105
|
+
result.exports = parsed.exports
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (hasOwnProperty.call(parsed, 'imports')) {
|
|
109
|
+
// @ts-expect-error: assume valid.
|
|
110
|
+
result.imports = parsed.imports
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Ignore unknown types for forwards compatibility
|
|
114
|
+
if (
|
|
115
|
+
hasOwnProperty.call(parsed, 'type') &&
|
|
116
|
+
(parsed.type === 'commonjs' || parsed.type === 'module')
|
|
117
|
+
) {
|
|
118
|
+
result.type = parsed.type
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
cache.set(jsonPath, result)
|
|
123
|
+
|
|
124
|
+
return result
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* @param {URL | string} resolved
|
|
129
|
+
* @returns {PackageConfig}
|
|
130
|
+
*/
|
|
131
|
+
export function getPackageScopeConfig(resolved) {
|
|
132
|
+
// Note: in Node, this is now a native module.
|
|
133
|
+
let packageJSONUrl = new URL('package.json', resolved)
|
|
134
|
+
|
|
135
|
+
while (true) {
|
|
136
|
+
const packageJSONPath = packageJSONUrl.pathname
|
|
137
|
+
if (packageJSONPath.endsWith('node_modules/package.json')) {
|
|
138
|
+
break
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const packageConfig = read(fileURLToPath(packageJSONUrl), {
|
|
142
|
+
specifier: resolved
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
if (packageConfig.exists) {
|
|
146
|
+
return packageConfig
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const lastPackageJSONUrl = packageJSONUrl
|
|
150
|
+
packageJSONUrl = new URL('../package.json', packageJSONUrl)
|
|
151
|
+
|
|
152
|
+
// Terminates at root where ../package.json equals ../../package.json
|
|
153
|
+
// (can't just check "/package.json" for Windows support).
|
|
154
|
+
if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) {
|
|
155
|
+
break
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const packageJSONPath = fileURLToPath(packageJSONUrl)
|
|
160
|
+
// ^^ Note: in Node, this is now a native module.
|
|
161
|
+
|
|
162
|
+
return {
|
|
163
|
+
pjsonPath: packageJSONPath,
|
|
164
|
+
exists: false,
|
|
165
|
+
type: 'none'
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Returns the package type for a given URL.
|
|
171
|
+
* @param {URL} url - The URL to get the package type for.
|
|
172
|
+
* @returns {PackageType}
|
|
173
|
+
*/
|
|
174
|
+
export function getPackageType(url) {
|
|
175
|
+
// To do @anonrig: Write a C++ function that returns only "type".
|
|
176
|
+
return getPackageScopeConfig(url).type
|
|
177
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The “Resolver Algorithm Specification” as detailed in the Node docs (which is
|
|
3
|
+
* sync and slightly lower-level than `resolve`).
|
|
4
|
+
*
|
|
5
|
+
* @param {string} specifier
|
|
6
|
+
* `/example.js`, `./example.js`, `../example.js`, `some-package`, `fs`, etc.
|
|
7
|
+
* @param {URL} base
|
|
8
|
+
* Full URL (to a file) that `specifier` is resolved relative from.
|
|
9
|
+
* @param {Set<string>} [conditions]
|
|
10
|
+
* Conditions.
|
|
11
|
+
* @param {boolean} [preserveSymlinks]
|
|
12
|
+
* Keep symlinks instead of resolving them.
|
|
13
|
+
* @returns {URL}
|
|
14
|
+
* A URL object to the found thing.
|
|
15
|
+
*/
|
|
16
|
+
export function moduleResolve(specifier: string, base: URL, conditions?: Set<string>, preserveSymlinks?: boolean): URL;
|
|
17
|
+
/**
|
|
18
|
+
* @param {string} specifier
|
|
19
|
+
* @param {{parentURL?: string, conditions?: Array<string>}} context
|
|
20
|
+
* @returns {{url: string, format?: string | null}}
|
|
21
|
+
*/
|
|
22
|
+
export function defaultResolve(specifier: string, context?: {
|
|
23
|
+
parentURL?: string;
|
|
24
|
+
conditions?: Array<string>;
|
|
25
|
+
}): {
|
|
26
|
+
url: string;
|
|
27
|
+
format?: string | null;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["resolve.js"],"names":[],"mappings":"AAyiCA;;;;;;;;;;;;;;GAcG;AACH,yCAXW,MAAM,QAEN,GAAG,eAEH,GAAG,CAAC,MAAM,CAAC,qBAEX,OAAO,GAEL,GAAG,CAkDf;AAoGD;;;;GAIG;AACH,0CAJW,MAAM,YACN;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAC,GAC9C;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAC,CAsEjD"}
|