@zhin.js/host-http 1.1.13 → 1.1.15

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.
@@ -1,7 +1,8 @@
1
1
  import type { AuthScope } from './token-registry.js';
2
2
  import type { DatabaseHostConsole } from '@zhin.js/plugin-runtime';
3
- import { type ConsoleConfigPatchRequest, type ConsoleConfigPatchResult, type ConsoleConfigSource, type ConsoleConfigExplanation, type ConsoleEndpointSummary } from '@zhin.js/console-protocol';
3
+ import { type ConsoleConfigPatchRequest, type ConsoleConfigPatchResult, type ConsoleConfigProjectPatchResult, type ConsoleConfigSource, type ConsoleConfigExplanation, type ConsoleEndpointSummary } from '@zhin.js/console-protocol';
4
4
  import { type ConsoleRpcExtendedCtx } from './console-rpc-extended/index.js';
5
+ export { isDemoHttpAllowed } from './console-rpc-handlers.js';
5
6
  /**
6
7
  * Console RPC 请求结构:未锚定 endpoint 的会话地址(结构对齐
7
8
  * `Omit<ConversationRef,'endpoint'>`;host/http 架构分层不允许依赖
@@ -155,19 +156,24 @@ export type RuntimeConsoleRpcContext = {
155
156
  replaceConfigSource?(source: string, expectedRevision: string): Promise<{
156
157
  readonly revision: string;
157
158
  readonly restartRequired: boolean;
158
- }>;
159
+ } & import('@zhin.js/console-protocol').ConsoleConfigApplicationStatus>;
159
160
  /**
160
161
  * Full-scope write: set `document[pluginName] = data` and persist.
161
162
  * Returns whether a process restart is required.
162
163
  */
163
164
  setConfigKey?(pluginName: string, data: unknown): Promise<{
164
165
  restartRequired: boolean;
165
- }>;
166
+ } & import('@zhin.js/console-protocol').ConsoleConfigApplicationStatus>;
166
167
  /**
167
168
  * Full-scope, path-allowlisted and revision-checked write (`config:patch`).
168
169
  * Scope and schema checks belong to the implementation; scope violations throw.
169
170
  */
170
171
  patchConfig?(request: ConsoleConfigPatchRequest): Promise<ConsoleConfigPatchResult>;
172
+ /** Full-scope, revision-checked project administration, distinct from page allowlists. */
173
+ patchProjectConfig?(request: Omit<ConsoleConfigPatchRequest, 'instanceKey'>): Promise<ConsoleConfigProjectPatchResult>;
174
+ /** Full-scope project read (`config:get-project`); masked unless `reveal`. */
175
+ readProjectConfig?(request: import('@zhin.js/console-protocol').ConsoleConfigProjectReadRequest): Promise<import('@zhin.js/console-protocol').ConsoleConfigProjectRead>;
176
+ applyConfig?(expectedRevision: string): Promise<import('@zhin.js/console-protocol').ConsoleConfigApplyResult>;
171
177
  /** Persist a declared child Plugin lifecycle state. Takes effect after restart. */
172
178
  setPluginEnabled?(instanceKey: string, enabled: boolean): Promise<Readonly<{
173
179
  disabled: readonly string[];
@@ -237,5 +243,3 @@ export type RuntimeEndpointSendInput = {
237
243
  };
238
244
  export declare function pickRpcReply(message: RuntimeConsoleRpcMessage, payloads: readonly RuntimeConsoleRpcReply[]): RuntimeConsoleRpcReply | null;
239
245
  export declare function dispatchRuntimeConsoleRpc(message: RuntimeConsoleRpcMessage, ctx: RuntimeConsoleRpcContext): Promise<RuntimeConsoleRpcReply[]>;
240
- /** HTTP paths under apiBase that demo scope may call (ADR 0016). */
241
- export declare function isDemoHttpAllowed(method: string, pathname: string, apiBase: string): boolean;