@ducking-mind/proxy-app-cli 0.1.0 → 0.1.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.
- package/README.md +128 -62
- package/agent-contract.mjs +125 -0
- package/agent-runtime/package-guide.mjs +144 -0
- package/agent-runtime/protocol.mjs +205 -0
- package/artifact-security.mjs +45 -0
- package/local-dev-credentials.mjs +187 -0
- package/local-dev-relay.mjs +368 -82
- package/package.json +23 -6
- package/platform-settings.mjs +19 -0
- package/prepare-agent-runtime.mjs +10 -0
- package/proxy-app.mjs +623 -190
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ducking-mind/proxy-app-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "CLI for creating, building and publishing Proxy platform apps",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,16 +12,33 @@
|
|
|
12
12
|
"url": "https://github.com/duckingmind/app/issues"
|
|
13
13
|
},
|
|
14
14
|
"type": "module",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": "./proxy-app.mjs",
|
|
17
|
+
"./agent-contract": "./agent-contract.mjs",
|
|
18
|
+
"./agent-protocol": "./agent-runtime/protocol.mjs",
|
|
19
|
+
"./package-guide": "./agent-runtime/package-guide.mjs",
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
15
22
|
"bin": {
|
|
16
|
-
"proxy-app": "./proxy-app.mjs"
|
|
23
|
+
"proxy-app": "./proxy-app.mjs",
|
|
24
|
+
"proxy-agent-contract": "./agent-contract.mjs"
|
|
17
25
|
},
|
|
18
26
|
"files": [
|
|
19
27
|
"proxy-app.mjs",
|
|
20
|
-
"
|
|
28
|
+
"platform-settings.mjs",
|
|
29
|
+
"local-dev-relay.mjs",
|
|
30
|
+
"local-dev-credentials.mjs",
|
|
31
|
+
"artifact-security.mjs",
|
|
32
|
+
"agent-contract.mjs",
|
|
33
|
+
"agent-runtime/protocol.mjs",
|
|
34
|
+
"agent-runtime/package-guide.mjs",
|
|
35
|
+
"prepare-agent-runtime.mjs"
|
|
21
36
|
],
|
|
22
37
|
"scripts": {
|
|
23
|
-
"test": "node --check proxy-app.mjs",
|
|
24
|
-
"prepublishOnly": "npm test"
|
|
38
|
+
"test": "node --check proxy-app.mjs && node --check agent-contract.mjs && node --test *.test.mjs",
|
|
39
|
+
"prepublishOnly": "npm test",
|
|
40
|
+
"prepack": "node prepare-agent-runtime.mjs",
|
|
41
|
+
"pretest": "npm --prefix ../proxy-app-sdk run build"
|
|
25
42
|
},
|
|
26
43
|
"publishConfig": {
|
|
27
44
|
"access": "public"
|
|
@@ -30,7 +47,7 @@
|
|
|
30
47
|
"fflate": "^0.8.2"
|
|
31
48
|
},
|
|
32
49
|
"engines": {
|
|
33
|
-
"node": ">=22.
|
|
50
|
+
"node": ">=22.18"
|
|
34
51
|
},
|
|
35
52
|
"license": "MIT"
|
|
36
53
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const DEFAULT_PLATFORM_URL = 'https://www.duckingmind.com'
|
|
2
|
+
|
|
3
|
+
export function platformAPIBaseURL(env = process.env) {
|
|
4
|
+
const explicit = env.PROXY_API_BASE_URL?.trim()
|
|
5
|
+
if (explicit) return explicit.replace(/\/$/, '')
|
|
6
|
+
const platform = env.PROXY_PLATFORM_URL?.trim() || DEFAULT_PLATFORM_URL
|
|
7
|
+
let url
|
|
8
|
+
try { url = new URL(platform) } catch { throw new Error('PROXY_PLATFORM_URL must be a valid platform origin, such as https://platform.example') }
|
|
9
|
+
if (!['http:', 'https:'].includes(url.protocol) || url.username || url.password || url.search || url.hash || url.pathname !== '/') {
|
|
10
|
+
throw new Error('PROXY_PLATFORM_URL must be a platform origin without a path, credentials, query, or hash')
|
|
11
|
+
}
|
|
12
|
+
return `${url.origin}/api`
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function platformPortalURL(env = process.env) {
|
|
16
|
+
const explicit = env.PROXY_PORTAL_URL?.trim() || env.PROXY_PUBLIC_URL?.trim()
|
|
17
|
+
if (explicit) return explicit
|
|
18
|
+
return env.PROXY_PLATFORM_URL?.trim() || DEFAULT_PLATFORM_URL
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { access } from 'node:fs/promises'
|
|
2
|
+
|
|
3
|
+
// These modules are deliberately maintained as public, dependency-free copies.
|
|
4
|
+
// They contain the application capability contract and package validation only;
|
|
5
|
+
// the proprietary desktop host and its build scripts are never copied into an
|
|
6
|
+
// npm package.
|
|
7
|
+
for (const file of ['./agent-runtime/protocol.mjs', './agent-runtime/package-guide.mjs']) {
|
|
8
|
+
await access(new URL(file, import.meta.url))
|
|
9
|
+
}
|
|
10
|
+
await import(new URL('./agent-contract.mjs', import.meta.url))
|