ronds_ai 0.13.0 → 0.14.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.
- package/LICENSE +21 -21
- package/PRIVACY.md +56 -56
- package/README.md +59 -59
- package/bin/ronds_ai.js +10 -1
- package/contracts/component-protocol.json +85 -74
- package/lib/component-store.js +245 -245
- package/lib/consent.js +238 -221
- package/lib/default-org.js +27 -27
- package/lib/gateway.js +195 -185
- package/lib/legacy.js +760 -760
- package/lib/manager-store.js +703 -703
- package/lib/paths.js +24 -24
- package/lib/uninstall.js +239 -239
- package/lib/update-manager.js +247 -247
- package/package.json +1 -1
package/lib/consent.js
CHANGED
|
@@ -1,221 +1,238 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
/**
|
|
3
|
-
* 组织配置与持久授权(设计 §6/§6.1)。
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (typeof
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
function
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
return
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
//
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
for (const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
const
|
|
142
|
-
if (
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
loadConsent
|
|
221
|
-
}
|
|
1
|
+
'use strict';
|
|
2
|
+
/**
|
|
3
|
+
* 组织配置与持久授权(设计 §6/§6.1)。
|
|
4
|
+
* 布尔权限;缺失/未知/无法确认的字段一律不产生 grant。
|
|
5
|
+
* 例外(M1.1/1.7,G2 决策「组织策略全抓」):replyCapture / usageDetail /
|
|
6
|
+
* skillInstall(M3.1 技能分发)三项默认授权——consent.json 有效
|
|
7
|
+
* (schemaVersion=1)但缺这些键时按 true 处理,显式 false(用户显式撤销或
|
|
8
|
+
* 公司策略上界)才关闭;文件缺失/损坏仍全 false。
|
|
9
|
+
* 所有写入原子(临时文件 + rename),读失败按"未配置/未授权"处理,不推断。
|
|
10
|
+
*/
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
const crypto = require('crypto');
|
|
14
|
+
const paths = require('./paths');
|
|
15
|
+
|
|
16
|
+
const SCHEMA_VERSION = 1;
|
|
17
|
+
const CONSENT_FIELDS = Object.freeze([
|
|
18
|
+
'codeMetrics', 'codeContent', 'promptContent', 'identity', 'historyScan',
|
|
19
|
+
'hookRepair', 'schedule', 'managerAutoUpdate', 'componentAutoUpdate',
|
|
20
|
+
'replyCapture', 'usageDetail', 'skillInstall', 'skillContent',
|
|
21
|
+
]);
|
|
22
|
+
|
|
23
|
+
/** G2 默认授权字段:有效 consent.json 缺键按 true,显式 false 才关。 */
|
|
24
|
+
const DEFAULT_ON_CONSENT_FIELDS = Object.freeze(['replyCapture', 'usageDetail', 'skillInstall']);
|
|
25
|
+
|
|
26
|
+
function atomicWrite(file, data) {
|
|
27
|
+
const temp = file + '.' + process.pid + '-' + crypto.randomBytes(4).toString('hex');
|
|
28
|
+
try {
|
|
29
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
30
|
+
fs.writeFileSync(temp, JSON.stringify(data, null, 2) + '\n');
|
|
31
|
+
fs.renameSync(temp, file);
|
|
32
|
+
} finally {
|
|
33
|
+
try { fs.rmSync(temp, { force: true }); } catch { /* 临时文件可能已改名 */ }
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function readJson(file) {
|
|
38
|
+
try { return JSON.parse(fs.readFileSync(file, 'utf8')); } catch { return null; }
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// ---- 组织配置 ----
|
|
42
|
+
|
|
43
|
+
function validateOrgInput(input) {
|
|
44
|
+
if (!input || typeof input !== 'object') return '配置必须是 JSON 对象';
|
|
45
|
+
for (const k of ['organizationId', 'componentId']) {
|
|
46
|
+
if (typeof input[k] !== 'string' || !/^[A-Za-z0-9_.-]+$/.test(input[k])) return `${k} 缺失或非法`;
|
|
47
|
+
}
|
|
48
|
+
try { crypto.createPublicKey(input.publicKeyPem); } catch { return 'publicKeyPem 缺失或不是合法公钥'; }
|
|
49
|
+
const src = input.source;
|
|
50
|
+
if (!src || typeof src !== 'object') return 'source 缺失';
|
|
51
|
+
if (src.type === 'local') {
|
|
52
|
+
if (typeof src.dir !== 'string' || !fs.existsSync(path.resolve(src.dir))) return 'local source dir 不存在';
|
|
53
|
+
} else if (src.type === 'http') {
|
|
54
|
+
if (typeof src.url !== 'string' || !/^https?:\/\//.test(src.url)) return 'http source url 非法';
|
|
55
|
+
} else {
|
|
56
|
+
return 'source.type 必须是 local 或 http';
|
|
57
|
+
}
|
|
58
|
+
if (input.businessReceiver !== undefined) {
|
|
59
|
+
const br = input.businessReceiver;
|
|
60
|
+
if (!br || typeof br !== 'object' || typeof br.url !== 'string' || !/^https?:\/\//.test(br.url)) {
|
|
61
|
+
return 'businessReceiver.url 非法(可选字段,存在则必须是 http(s) URL)';
|
|
62
|
+
}
|
|
63
|
+
// code 队列分端点(可选):缺失回退 url
|
|
64
|
+
if (br.codeUrl !== undefined
|
|
65
|
+
&& (typeof br.codeUrl !== 'string' || !/^https?:\/\//.test(br.codeUrl))) {
|
|
66
|
+
return 'businessReceiver.codeUrl 非法(可选字段,存在则必须是 http(s) URL)';
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
// R13:公司签名配置入口(可选;缺省时 setup/maintenance 只用基础源)
|
|
70
|
+
if (input.configUrl !== undefined
|
|
71
|
+
&& (typeof input.configUrl !== 'string' || !/^https?:\/\//.test(input.configUrl))) {
|
|
72
|
+
return 'configUrl 非法(可选字段,存在则必须是 http(s) URL)';
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function saveOrganization(input, opts = {}) {
|
|
78
|
+
const error = validateOrgInput(input);
|
|
79
|
+
if (error) throw new Error(error);
|
|
80
|
+
const org = {
|
|
81
|
+
schemaVersion: SCHEMA_VERSION,
|
|
82
|
+
organizationId: input.organizationId,
|
|
83
|
+
componentId: input.componentId,
|
|
84
|
+
publicKeyPem: input.publicKeyPem,
|
|
85
|
+
source: input.source.type === 'local'
|
|
86
|
+
? { type: 'local', dir: path.resolve(input.source.dir) }
|
|
87
|
+
: { type: 'http', url: input.source.url },
|
|
88
|
+
// F11 组件源来源:builtin=内置默认(零填写,可被新版 npm 默认入口恢复/公司配置迁移);
|
|
89
|
+
// explicit=显式 setup --config(不被包内默认覆盖)。旧文件缺该字段按可恢复处理。
|
|
90
|
+
sourceProvenance: opts.sourceProvenance === 'builtin' ? 'builtin' : 'explicit',
|
|
91
|
+
...(input.businessReceiver ? { businessReceiver: input.businessReceiver } : {}),
|
|
92
|
+
...(input.configUrl ? { configUrl: input.configUrl } : {}),
|
|
93
|
+
savedAt: new Date().toISOString(),
|
|
94
|
+
};
|
|
95
|
+
atomicWrite(paths.organizationJson(), org);
|
|
96
|
+
return org;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function loadOrganization() {
|
|
100
|
+
const org = readJson(paths.organizationJson());
|
|
101
|
+
if (!org || org.schemaVersion !== SCHEMA_VERSION) return null;
|
|
102
|
+
return org;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// ---- 授权(consent)----
|
|
106
|
+
|
|
107
|
+
function emptyGrants() {
|
|
108
|
+
const grants = {};
|
|
109
|
+
for (const f of CONSENT_FIELDS) grants[f] = false;
|
|
110
|
+
return grants;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function loadConsent() {
|
|
114
|
+
const file = readJson(paths.consentJson());
|
|
115
|
+
if (!file || file.schemaVersion !== SCHEMA_VERSION) {
|
|
116
|
+
return {
|
|
117
|
+
schemaVersion: SCHEMA_VERSION, consentRevision: 0, source: null, grantedAt: null,
|
|
118
|
+
lastPolicyVersion: null, grants: emptyGrants(), policyEnforced: {}, unknownFields: [],
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
// 只有已知布尔 true 才算 grant;未知字段记录但不产生授权(§6.1)
|
|
122
|
+
const grants = emptyGrants();
|
|
123
|
+
const unknownFields = [];
|
|
124
|
+
const raw = file.grants && typeof file.grants === 'object' ? file.grants : {};
|
|
125
|
+
for (const [k, v] of Object.entries(raw)) {
|
|
126
|
+
if (CONSENT_FIELDS.includes(k)) { if (v === true) grants[k] = true; }
|
|
127
|
+
else unknownFields.push(k);
|
|
128
|
+
}
|
|
129
|
+
// G2 默认授权(M1.1/1.7):replyCapture/usageDetail 有效文件缺键按 true,
|
|
130
|
+
// 显式 false 才关(grantConsent/applyOrganizationPolicy 的写入与撤销基于此
|
|
131
|
+
// 有效值;applyOrganizationPolicy 显式 false 仍可撤销并记 policyEnforced)。
|
|
132
|
+
// 红队 L2:严格类型——仅 undefined(缺键)与显式 boolean true 按 true;
|
|
133
|
+
// "false"/null/0 等脏值一律 false(与老九项「严格 === true」口径对齐,
|
|
134
|
+
// 组件侧 consent-reader 同步收紧,双侧语义保持一致)。
|
|
135
|
+
for (const f of DEFAULT_ON_CONSENT_FIELDS) {
|
|
136
|
+
if (raw[f] === undefined || raw[f] === true) grants[f] = true;
|
|
137
|
+
}
|
|
138
|
+
// F12:公司强制策略上界——策略显式禁止(false)的字段集合,用户/引导授权不得越界补授
|
|
139
|
+
const rawEnforced = file.policyEnforced && typeof file.policyEnforced === 'object' && !Array.isArray(file.policyEnforced)
|
|
140
|
+
? file.policyEnforced : {};
|
|
141
|
+
const policyEnforced = {};
|
|
142
|
+
for (const f of CONSENT_FIELDS) if (rawEnforced[f] === true) policyEnforced[f] = true;
|
|
143
|
+
return {
|
|
144
|
+
schemaVersion: SCHEMA_VERSION,
|
|
145
|
+
consentRevision: Number.isInteger(file.consentRevision) ? file.consentRevision : 0,
|
|
146
|
+
source: typeof file.source === 'string' ? file.source : null,
|
|
147
|
+
grantedAt: typeof file.grantedAt === 'string' ? file.grantedAt : null,
|
|
148
|
+
lastPolicyVersion: typeof file.lastPolicyVersion === 'string' ? file.lastPolicyVersion : null,
|
|
149
|
+
grants, policyEnforced, unknownFields,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function grantConsent(fields, source) {
|
|
154
|
+
const unknown = fields.filter((f) => !CONSENT_FIELDS.includes(f));
|
|
155
|
+
if (unknown.length) throw new Error(`未知权限字段:${unknown.join(', ')}`);
|
|
156
|
+
const current = loadConsent();
|
|
157
|
+
// F12 策略上界:公司策略显式禁止的字段,用户/引导授权不可越界补授,拒绝并报原因
|
|
158
|
+
const forbidden = fields.filter((f) => current.policyEnforced[f] === true);
|
|
159
|
+
if (forbidden.length) {
|
|
160
|
+
throw new Error(`公司策略已禁用 ${forbidden.join(',')}(策略版本 ${current.lastPolicyVersion || '未知'}),用户授权不可越过公司策略上界`);
|
|
161
|
+
}
|
|
162
|
+
const grants = { ...current.grants };
|
|
163
|
+
const changed = [];
|
|
164
|
+
for (const f of fields) { if (!grants[f]) changed.push(f); grants[f] = true; }
|
|
165
|
+
const next = {
|
|
166
|
+
schemaVersion: SCHEMA_VERSION,
|
|
167
|
+
consentRevision: current.consentRevision + (changed.length ? 1 : 0),
|
|
168
|
+
source: source || current.source || 'user',
|
|
169
|
+
grantedAt: changed.length ? new Date().toISOString() : current.grantedAt,
|
|
170
|
+
grants,
|
|
171
|
+
// F12:公司强制上界记录不被用户授权抹掉
|
|
172
|
+
...(Object.keys(current.policyEnforced).length ? { policyEnforced: current.policyEnforced } : {}),
|
|
173
|
+
// 已应用的公司策略版本记录不被后续用户授权抹掉(status 显示用)
|
|
174
|
+
...(current.lastPolicyVersion ? { lastPolicyVersion: current.lastPolicyVersion } : {}),
|
|
175
|
+
};
|
|
176
|
+
atomicWrite(paths.consentJson(), next);
|
|
177
|
+
return next;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* 应用公司授权策略(设计 §6 组织受控策略;F12 收紧语义)。
|
|
182
|
+
*
|
|
183
|
+
* grants 全部已知字段:显式 true → 授予;显式 false → 撤销该字段现有授权并写入
|
|
184
|
+
* policyEnforced(公司强制上界——随后 grantConsent 对该字段的用户/引导授权被拒并
|
|
185
|
+
* 报原因);缺失/未知字段不改变现有授权。policyEnforced 每次按本版策略重算:新版
|
|
186
|
+
* 不再显式禁止即解除上界(公司统一放宽即时生效),收紧优先于用户 grant。
|
|
187
|
+
* consentRevision 口径:实际变化(新增/撤销授权、上界集合变化或策略版本更新)才 +1,
|
|
188
|
+
* 幂等重放不加。
|
|
189
|
+
*/
|
|
190
|
+
function applyOrganizationPolicy(policy) {
|
|
191
|
+
if (!policy || typeof policy !== 'object' || Array.isArray(policy)) throw new Error('授权策略非法(需对象)');
|
|
192
|
+
if (typeof policy.policyVersion !== 'string' || !policy.policyVersion) throw new Error('授权策略 policyVersion 缺失或非法');
|
|
193
|
+
if (!policy.grants || typeof policy.grants !== 'object' || Array.isArray(policy.grants)) throw new Error('授权策略 grants 非法(需对象)');
|
|
194
|
+
const current = loadConsent();
|
|
195
|
+
const grants = { ...current.grants };
|
|
196
|
+
const added = [];
|
|
197
|
+
const revoked = [];
|
|
198
|
+
const policyEnforced = {};
|
|
199
|
+
for (const field of CONSENT_FIELDS) {
|
|
200
|
+
if (policy.grants[field] === true) {
|
|
201
|
+
if (!grants[field]) { grants[field] = true; added.push(field); }
|
|
202
|
+
} else if (policy.grants[field] === false) {
|
|
203
|
+
policyEnforced[field] = true;
|
|
204
|
+
if (grants[field]) { grants[field] = false; revoked.push(field); }
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
const enforcedChanged = JSON.stringify(policyEnforced) !== JSON.stringify(current.policyEnforced);
|
|
208
|
+
const changed = added.length > 0 || revoked.length > 0 || enforcedChanged
|
|
209
|
+
|| current.lastPolicyVersion !== policy.policyVersion;
|
|
210
|
+
const next = {
|
|
211
|
+
schemaVersion: SCHEMA_VERSION,
|
|
212
|
+
consentRevision: current.consentRevision + (changed ? 1 : 0),
|
|
213
|
+
source: 'org-policy',
|
|
214
|
+
grantedAt: (added.length || revoked.length) ? new Date().toISOString() : current.grantedAt,
|
|
215
|
+
grants,
|
|
216
|
+
...(Object.keys(policyEnforced).length ? { policyEnforced } : {}),
|
|
217
|
+
lastPolicyVersion: policy.policyVersion,
|
|
218
|
+
};
|
|
219
|
+
atomicWrite(paths.consentJson(), next);
|
|
220
|
+
return loadConsent();
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// ---- 停用(§6 disable:持久标记,取消隐式恢复)----
|
|
224
|
+
|
|
225
|
+
function isDisabled() {
|
|
226
|
+
const d = readJson(paths.disabledJson());
|
|
227
|
+
return !!(d && d.disabled === true);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function setDisabled(reason) {
|
|
231
|
+
atomicWrite(paths.disabledJson(), { schemaVersion: SCHEMA_VERSION, disabled: true, reason: reason || null, at: new Date().toISOString() });
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
module.exports = {
|
|
235
|
+
CONSENT_FIELDS, atomicWrite, readJson,
|
|
236
|
+
validateOrgInput, saveOrganization, loadOrganization,
|
|
237
|
+
loadConsent, grantConsent, applyOrganizationPolicy, isDisabled, setDisabled,
|
|
238
|
+
};
|
package/lib/default-org.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
/**
|
|
3
|
-
* 内置默认组织源(设计 §7:管理器发行版可携带同组织恢复地址与公钥,实现终端用户零填写;
|
|
4
|
-
* 公开包中可见元数据,运维须知——不含私钥、令牌或业务 API 地址,可被 --config 显式覆盖)。
|
|
5
|
-
* 公钥为 Ed25519 验签公钥(SPKI),发布端私钥永不出现在任何包中。
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const DEFAULT_PUBLIC_KEY_PEM = [
|
|
9
|
-
'-----BEGIN PUBLIC KEY-----',
|
|
10
|
-
'MCowBQYDK2VwAyEAskfwneNrJytU5E09wofOncNNiH95eGUsmyjpZTCNZDI=',
|
|
11
|
-
'-----END PUBLIC KEY-----',
|
|
12
|
-
].join('\n');
|
|
13
|
-
|
|
14
|
-
const DEFAULT_ORGANIZATION = Object.freeze({
|
|
15
|
-
organizationId: 'ronds',
|
|
16
|
-
componentId: 'ronds_ai_component',
|
|
17
|
-
publicKeyPem: DEFAULT_PUBLIC_KEY_PEM,
|
|
18
|
-
source: Object.freeze({
|
|
19
|
-
type: 'http',
|
|
20
|
-
url: 'http://172.16.0.9:30000/api/v4/projects/1848/packages/generic/ronds_ai_channel/stable/stable.json',
|
|
21
|
-
}),
|
|
22
|
-
// §7/R13:公司签名配置入口(同一 Git 项目的 generic 包,匿名可读、Ed25519 验签)。
|
|
23
|
-
// setup 保存基础源后尝试拉取,失败不阻塞(使用基础源)。
|
|
24
|
-
configUrl: 'http://172.16.0.9:30000/api/v4/projects/1848/packages/generic/ronds_ai_orgconfig/stable/config.json',
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
module.exports = { DEFAULT_ORGANIZATION };
|
|
1
|
+
'use strict';
|
|
2
|
+
/**
|
|
3
|
+
* 内置默认组织源(设计 §7:管理器发行版可携带同组织恢复地址与公钥,实现终端用户零填写;
|
|
4
|
+
* 公开包中可见元数据,运维须知——不含私钥、令牌或业务 API 地址,可被 --config 显式覆盖)。
|
|
5
|
+
* 公钥为 Ed25519 验签公钥(SPKI),发布端私钥永不出现在任何包中。
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const DEFAULT_PUBLIC_KEY_PEM = [
|
|
9
|
+
'-----BEGIN PUBLIC KEY-----',
|
|
10
|
+
'MCowBQYDK2VwAyEAskfwneNrJytU5E09wofOncNNiH95eGUsmyjpZTCNZDI=',
|
|
11
|
+
'-----END PUBLIC KEY-----',
|
|
12
|
+
].join('\n');
|
|
13
|
+
|
|
14
|
+
const DEFAULT_ORGANIZATION = Object.freeze({
|
|
15
|
+
organizationId: 'ronds',
|
|
16
|
+
componentId: 'ronds_ai_component',
|
|
17
|
+
publicKeyPem: DEFAULT_PUBLIC_KEY_PEM,
|
|
18
|
+
source: Object.freeze({
|
|
19
|
+
type: 'http',
|
|
20
|
+
url: 'http://172.16.0.9:30000/api/v4/projects/1848/packages/generic/ronds_ai_channel/stable/stable.json',
|
|
21
|
+
}),
|
|
22
|
+
// §7/R13:公司签名配置入口(同一 Git 项目的 generic 包,匿名可读、Ed25519 验签)。
|
|
23
|
+
// setup 保存基础源后尝试拉取,失败不阻塞(使用基础源)。
|
|
24
|
+
configUrl: 'http://172.16.0.9:30000/api/v4/projects/1848/packages/generic/ronds_ai_orgconfig/stable/config.json',
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
module.exports = { DEFAULT_ORGANIZATION };
|