koishi-plugin-dify-ai 0.1.2 → 0.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.
package/lib/index.js CHANGED
@@ -112,20 +112,12 @@ var metaKeySchema = import_koishi.Schema.union([
112
112
  import_koishi.Schema.const("triggerTime").description("触发时间")
113
113
  ]);
114
114
  var variableSchema = import_koishi.Schema.union([
115
- import_koishi.Schema.intersect([
116
- import_koishi.Schema.object({
117
- source: import_koishi.Schema.const("session").required(),
118
- field: import_koishi.Schema.string().required().description("字段名"),
119
- key: sessionKeySchema.default("content").description("变量")
120
- }),
121
- import_koishi.Schema.union([
122
- import_koishi.Schema.object({
123
- key: import_koishi.Schema.const("history").required(),
124
- limit: import_koishi.Schema.natural().default(0).min(0).max(100).description("条数,0 用全局")
125
- }).default({ key: "history", limit: 0 }),
126
- import_koishi.Schema.object({})
127
- ])
128
- ]).default({ source: "session", field: "", key: "content" }).description("会话字段"),
115
+ import_koishi.Schema.object({
116
+ source: import_koishi.Schema.const("session").required(),
117
+ field: import_koishi.Schema.string().required().description("字段名"),
118
+ key: sessionKeySchema.default("content").description("变量"),
119
+ limit: import_koishi.Schema.natural().default(0).min(0).max(100).description("条数,选历史消息时生效")
120
+ }).default({ source: "session", field: "", key: "content", limit: 0 }).description("会话字段"),
129
121
  import_koishi.Schema.object({
130
122
  source: import_koishi.Schema.const("meta").required(),
131
123
  field: import_koishi.Schema.string().required().description("字段名"),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-dify-ai",
3
3
  "description": "Invoke Dify apps (chatflow / workflow / completion) in Koishi with triggers and conversation bindings",
4
- "version": "0.1.2",
4
+ "version": "0.1.3",
5
5
  "author": "PinkElysia",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/PinkElysiaDev/dify-ai-plugin-for-Koishi#readme",
@@ -1,4 +0,0 @@
1
- import { Command, Context } from 'koishi';
2
- import { RequestRunner } from '../requester/runner';
3
- /** dify.app.* 管理命令(authority 3;koishi 子命令不继承父命令权限,需各自声明) */
4
- export declare function registerAppCommands(parent: Command, ctx: Context, runner: RequestRunner): void;
@@ -1,4 +0,0 @@
1
- import { Command, Context } from 'koishi';
2
- import { TriggerEngine } from '../trigger/engine';
3
- /** dify.rule.* 管理命令(authority 3):规则以 JSON 导入维护 */
4
- export declare function registerRuleCommands(parent: Command, ctx: Context, engine: TriggerEngine): void;
@@ -1,17 +0,0 @@
1
- import { Context } from 'koishi';
2
- import { RequestRunner } from '../requester/runner';
3
- import { DifyApp } from '../state/tables';
4
- /** 应用接入的共享业务层:命令(dify.app.*)调用。 */
5
- /** 新建应用接入(重名拒绝);返回新行 id */
6
- export declare function createApp(ctx: Context, runner: RequestRunner, input: {
7
- name: string;
8
- apiURL: string;
9
- apiKey: string;
10
- }): Promise<string>;
11
- /** 探测应用类型(GET /info + /parameters),成败都回写 status/lastCheckAt */
12
- export declare function testApp(ctx: Context, runner: RequestRunner, app: DifyApp): Promise<{
13
- mode: string;
14
- name: string;
15
- }>;
16
- /** 删除应用;被规则引用时拒绝 */
17
- export declare function deleteApp(ctx: Context, runner: RequestRunner, app: DifyApp): Promise<void>;