@zhin.js/plugin-runtime 1.1.2 → 1.1.3

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.
@@ -5,12 +5,19 @@ export interface DatabaseHostSelection {
5
5
  limit(count: number): DatabaseHostSelection;
6
6
  then<TResult1 = Record<string, unknown>[], TResult2 = never>(onfulfilled?: ((value: Record<string, unknown>[]) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
7
7
  }
8
+ /**
9
+ * select() 需要显式列名:'*' 在 SQL 方言里会被当成字面列名(no such column: "*"),
10
+ * 类型层直接拒绝;运行时另有可读报错兜底(见 Host 实现)。
11
+ */
12
+ type SelectFields<Fields extends readonly string[]> = {
13
+ [K in keyof Fields]: Fields[K] extends '*' ? never : Fields[K];
14
+ };
8
15
  /**
9
16
  * Minimal model surface shared by lottery / rss / group-suite memory stores
10
17
  * and the Host-backed `@zhin.js/database` adapter.
11
18
  */
12
19
  export interface DatabaseHostModel {
13
- select(...fields: string[]): DatabaseHostSelection;
20
+ select<Fields extends string[]>(...fields: SelectFields<Fields>): DatabaseHostSelection;
14
21
  insert(row: Record<string, unknown>): Promise<unknown>;
15
22
  delete(): {
16
23
  where(query: Record<string, unknown>): Promise<unknown>;
@@ -124,3 +131,4 @@ export declare function unwrapPluginDatabaseHost(host: DatabaseHost | PluginData
124
131
  export declare const databaseHostToken: import("./token.js").Token<PluginDatabaseHost>;
125
132
  /** Root-only process host for CLI composition and Console administration. */
126
133
  export declare const databaseRootHostToken: import("./token.js").Token<DatabaseHost>;
134
+ export {};
@@ -1,3 +1,17 @@
1
+ /**
2
+ * 未锚定 endpoint 的会话地址(结构对齐 `@zhin.js/im-contract` 的
3
+ * `Omit<ConversationRef, 'endpoint'>`;plugin-runtime 是零依赖 kernel 层,
4
+ * 不能 import IM 契约,故此处独立声明,靠结构类型兼容)。
5
+ */
6
+ export interface OutboundConversation {
7
+ readonly kind: 'private' | 'group' | 'channel';
8
+ readonly id: string;
9
+ readonly parent?: Readonly<{
10
+ readonly kind: 'group' | 'channel';
11
+ readonly id: string;
12
+ }>;
13
+ readonly threadId?: string;
14
+ }
1
15
  /**
2
16
  * Thin Host Resource for proactive Adapter outbound (RSS poll, lottery push,
3
17
  * activity-feedback typing text). Implementations typically wrap ImRuntime
@@ -6,8 +20,7 @@
6
20
  export interface OutboundSendInput {
7
21
  readonly adapter: string;
8
22
  readonly endpointId: string;
9
- readonly channelType: string;
10
- readonly channelId: string;
23
+ readonly conversation: OutboundConversation;
11
24
  readonly content: string;
12
25
  }
13
26
  export interface OutboundReactionInput {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/plugin-runtime",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Zero-dependency Plugin tree, Scope and atomic generation runtime for Zhin",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",