@hallohuman/hightea-ahp-host 0.0.1 → 0.0.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.
Files changed (2) hide show
  1. package/dist/bin.js +9 -5
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -18,7 +18,7 @@ import { fileVault as fileVault2 } from "@ahpd/server/dist/vault.js";
18
18
  // package.json
19
19
  var package_default = {
20
20
  name: "@hallohuman/hightea-ahp-host",
21
- version: "0.0.1",
21
+ version: "0.0.2",
22
22
  publishConfig: { access: "public" },
23
23
  type: "module",
24
24
  exports: {
@@ -286,15 +286,18 @@ async function saveHostJson(claim, directory, name, configuration) {
286
286
  const existing = readJsonObject(destination);
287
287
  if (!existing.ok)
288
288
  throw new Error("HOST_JOIN_CONFIG_CORRUPT");
289
- const addApprovalDefault = name === "config.json" && configuration.unattendedAutoApprove === false && !Object.hasOwn(existing.value, "unattendedAutoApprove");
289
+ const backfill = {};
290
290
  for (const [key, value] of Object.entries(configuration)) {
291
- if (addApprovalDefault && key === "unattendedAutoApprove")
291
+ const restriction = key === "unattendedAutoApprove" && value === false || key === "pluginMarketplaces" && Array.isArray(value) && value.length === 0;
292
+ if (name === "config.json" && restriction && !Object.hasOwn(existing.value, key)) {
293
+ backfill[key] = value;
292
294
  continue;
295
+ }
293
296
  if (!isDeepStrictEqual2(existing.value[key], value))
294
297
  throw new Error("HOST_JOIN_CONFIG_CONFLICT");
295
298
  }
296
- if (addApprovalDefault) {
297
- writeJsonAtomic(destination, { ...existing.value, unattendedAutoApprove: false }, { mode: 384 });
299
+ if (Object.keys(backfill).length > 0) {
300
+ writeJsonAtomic(destination, { ...existing.value, ...backfill }, { mode: 384 });
298
301
  }
299
302
  await flushHostFile(destination);
300
303
  return destination;
@@ -558,6 +561,7 @@ async function runHostCli(arguments_) {
558
561
  modelApi: false,
559
562
  mcpTools: "none",
560
563
  unattendedAutoApprove: false,
564
+ pluginMarketplaces: [],
561
565
  plugins: [...ownerConfiguration.plugins, {
562
566
  source: fileURLToPath2(new URL("../plugin.json", import.meta.url)),
563
567
  grants: ["session:write", "session:state", "chat:turns"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hallohuman/hightea-ahp-host",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },