@geminixiang/mikan 0.5.0 → 0.5.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.
- package/CHANGELOG.md +13 -0
- package/dist/adapter.d.ts +1 -1
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js.map +1 -1
- package/dist/adapters/slack/blocks.d.ts +6 -0
- package/dist/adapters/slack/blocks.d.ts.map +1 -0
- package/dist/adapters/slack/blocks.js +176 -0
- package/dist/adapters/slack/blocks.js.map +1 -0
- package/dist/adapters/slack/bot.d.ts +0 -1
- package/dist/adapters/slack/bot.d.ts.map +1 -1
- package/dist/adapters/slack/bot.js +12 -34
- package/dist/adapters/slack/bot.js.map +1 -1
- package/dist/adapters/slack/response-lifecycle.d.ts.map +1 -1
- package/dist/adapters/slack/response-lifecycle.js +0 -25
- package/dist/adapters/slack/response-lifecycle.js.map +1 -1
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +40 -46
- package/dist/agent.js.map +1 -1
- package/dist/tools/index.d.ts +1 -2
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +0 -4
- package/dist/tools/index.js.map +1 -1
- package/dist/types.d.ts +0 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/web/admin/portal.js +125 -2
- package/dist/web/admin/portal.js.map +1 -1
- package/package.json +1 -1
- package/dist/adapters/slack/tools/block-kit.d.ts +0 -16
- package/dist/adapters/slack/tools/block-kit.d.ts.map +0 -1
- package/dist/adapters/slack/tools/block-kit.js +0 -105
- package/dist/adapters/slack/tools/block-kit.js.map +0 -1
- package/dist/tool-diagnostics.d.ts +0 -2
- package/dist/tool-diagnostics.d.ts.map +0 -1
- package/dist/tool-diagnostics.js +0 -7
- package/dist/tool-diagnostics.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { AgentTool } from "@earendil-works/pi-agent-core";
|
|
2
|
-
type SlackBlockKitResponse = {
|
|
3
|
-
text: string;
|
|
4
|
-
blocks: object[];
|
|
5
|
-
};
|
|
6
|
-
declare const blockKitSchema: import("@sinclair/typebox").TObject<{
|
|
7
|
-
label: import("@sinclair/typebox").TString;
|
|
8
|
-
text: import("@sinclair/typebox").TString;
|
|
9
|
-
blocks: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnknown>;
|
|
10
|
-
}>;
|
|
11
|
-
export declare function createSlackBlockKitTool(): {
|
|
12
|
-
tool: AgentTool<typeof blockKitSchema>;
|
|
13
|
-
setBlockKitResponseFunction: (fn: (response: SlackBlockKitResponse) => Promise<void>) => void;
|
|
14
|
-
};
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=block-kit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"block-kit.d.ts","sourceRoot":"","sources":["../../../../src/adapters/slack/tools/block-kit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAG/D,KAAK,qBAAqB,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,QAAA,MAAM,cAAc;;;;EAOlB,CAAC;AAkFH,wBAAgB,uBAAuB,IAAI;IACzC,IAAI,EAAE,SAAS,CAAC,OAAO,cAAc,CAAC,CAAC;IACvC,2BAA2B,EAAE,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,qBAAqB,KAAK,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;CAC/F,CAgCA"}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { Type } from "@sinclair/typebox";
|
|
2
|
-
const blockKitSchema = Type.Object({
|
|
3
|
-
label: Type.String({ description: "Brief description of the Slack Block Kit response" }),
|
|
4
|
-
text: Type.String({ description: "Plain-text fallback for notifications and non-Slack clients" }),
|
|
5
|
-
blocks: Type.Array(Type.Unknown(), {
|
|
6
|
-
description: "Slack Block Kit blocks. Supports section, context, divider, header, actions; buttons in actions.elements; static_select and multi_static_select in section.accessory.",
|
|
7
|
-
}),
|
|
8
|
-
});
|
|
9
|
-
const ALLOWED_BLOCK_TYPES = new Set(["section", "context", "divider", "header", "actions"]);
|
|
10
|
-
const ALLOWED_INTERACTIVE_ELEMENT_TYPES = new Set([
|
|
11
|
-
"button",
|
|
12
|
-
"static_select",
|
|
13
|
-
"multi_static_select",
|
|
14
|
-
]);
|
|
15
|
-
function assertPlainObject(value, label) {
|
|
16
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
17
|
-
throw new Error(`${label} must be an object`);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
function validateInteractiveElement(element, label) {
|
|
21
|
-
if (typeof element.type !== "string" || !ALLOWED_INTERACTIVE_ELEMENT_TYPES.has(element.type)) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
if (typeof element.action_id !== "string" || !element.action_id) {
|
|
25
|
-
throw new Error(`${label}.action_id is required`);
|
|
26
|
-
}
|
|
27
|
-
if (element.type === "button" && typeof element.value !== "string") {
|
|
28
|
-
throw new Error(`${label}.value is required for buttons`);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function validateInteractiveElements(value, label) {
|
|
32
|
-
if (!value || typeof value !== "object")
|
|
33
|
-
return;
|
|
34
|
-
if (Array.isArray(value)) {
|
|
35
|
-
value.forEach((item, index) => validateInteractiveElements(item, `${label}[${index}]`));
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
const obj = value;
|
|
39
|
-
validateInteractiveElement(obj, label);
|
|
40
|
-
for (const [key, nested] of Object.entries(obj)) {
|
|
41
|
-
validateInteractiveElements(nested, `${label}.${key}`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
function validateBlockPlacement(block, label) {
|
|
45
|
-
if (block.type === "actions") {
|
|
46
|
-
if (!Array.isArray(block.elements))
|
|
47
|
-
throw new Error(`${label}.elements is required`);
|
|
48
|
-
block.elements.forEach((element, index) => {
|
|
49
|
-
assertPlainObject(element, `${label}.elements[${index}]`);
|
|
50
|
-
if (element.type !== "button") {
|
|
51
|
-
throw new Error(`${label}.elements[${index}] uses ${String(element.type)}; put static_select and multi_static_select in section.accessory instead`);
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
if (block.type === "section" && block.accessory !== undefined) {
|
|
56
|
-
assertPlainObject(block.accessory, `${label}.accessory`);
|
|
57
|
-
const type = String(block.accessory.type);
|
|
58
|
-
if (!ALLOWED_INTERACTIVE_ELEMENT_TYPES.has(type)) {
|
|
59
|
-
throw new Error(`${label}.accessory has unsupported type: ${type}`);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
function validateBlocks(blocks) {
|
|
64
|
-
if (blocks.length === 0)
|
|
65
|
-
throw new Error("blocks must not be empty");
|
|
66
|
-
if (blocks.length > 20)
|
|
67
|
-
throw new Error("blocks must contain at most 20 blocks");
|
|
68
|
-
return blocks.map((block, index) => {
|
|
69
|
-
assertPlainObject(block, `blocks[${index}]`);
|
|
70
|
-
const type = block.type;
|
|
71
|
-
if (typeof type !== "string" || !ALLOWED_BLOCK_TYPES.has(type)) {
|
|
72
|
-
throw new Error(`Unsupported Block Kit block type: ${String(type)}`);
|
|
73
|
-
}
|
|
74
|
-
validateBlockPlacement(block, `blocks[${index}]`);
|
|
75
|
-
validateInteractiveElements(block, `blocks[${index}]`);
|
|
76
|
-
return block;
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
export function createSlackBlockKitTool() {
|
|
80
|
-
let respondFn = null;
|
|
81
|
-
const tool = {
|
|
82
|
-
name: "slack_blockkit",
|
|
83
|
-
label: "slack block kit",
|
|
84
|
-
description: "Send a Slack Block Kit response. Use when structured Slack UI helps the user choose or inspect information. Supports buttons, static_select, and multi_static_select. Put buttons in actions.elements. Put static_select and multi_static_select in section.accessory.",
|
|
85
|
-
parameters: blockKitSchema,
|
|
86
|
-
execute: async (_toolCallId, { text, blocks }, signal) => {
|
|
87
|
-
if (!respondFn)
|
|
88
|
-
throw new Error("Slack Block Kit response function not configured");
|
|
89
|
-
if (signal?.aborted)
|
|
90
|
-
throw new Error("Operation aborted");
|
|
91
|
-
await respondFn({ text, blocks: validateBlocks(blocks) });
|
|
92
|
-
return {
|
|
93
|
-
content: [{ type: "text", text: "Sent Slack Block Kit response" }],
|
|
94
|
-
details: undefined,
|
|
95
|
-
};
|
|
96
|
-
},
|
|
97
|
-
};
|
|
98
|
-
return {
|
|
99
|
-
tool,
|
|
100
|
-
setBlockKitResponseFunction: (fn) => {
|
|
101
|
-
respondFn = fn;
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
//# sourceMappingURL=block-kit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"block-kit.js","sourceRoot":"","sources":["../../../../src/adapters/slack/tools/block-kit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAOzC,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC;IACjC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,mDAAmD,EAAE,CAAC;IACxF,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,6DAA6D,EAAE,CAAC;IACjG,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE;QACjC,WAAW,EACT,uKAAuK;KAC1K,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;AAC5F,MAAM,iCAAiC,GAAG,IAAI,GAAG,CAAC;IAChD,QAAQ;IACR,eAAe;IACf,qBAAqB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SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAE1D,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,+BAA+B,EAAE,CAAC;gBAC3E,OAAO,EAAE,SAAS;aACnB,CAAC;QACJ,CAAC;KACF,CAAC;IAEF,OAAO;QACL,IAAI;QACJ,2BAA2B,EAAE,CAAC,EAAE,EAAE,EAAE;YAClC,SAAS,GAAG,EAAE,CAAC;QACjB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { AgentTool } from \"@earendil-works/pi-agent-core\";\nimport { Type } from \"@sinclair/typebox\";\n\ntype SlackBlockKitResponse = {\n text: string;\n blocks: object[];\n};\n\nconst blockKitSchema = Type.Object({\n label: Type.String({ description: \"Brief description of the Slack Block Kit response\" }),\n text: Type.String({ description: \"Plain-text fallback for notifications and non-Slack clients\" }),\n blocks: Type.Array(Type.Unknown(), {\n description:\n \"Slack Block Kit blocks. Supports section, context, divider, header, actions; buttons in actions.elements; static_select and multi_static_select in section.accessory.\",\n }),\n});\n\nconst ALLOWED_BLOCK_TYPES = new Set([\"section\", \"context\", \"divider\", \"header\", \"actions\"]);\nconst ALLOWED_INTERACTIVE_ELEMENT_TYPES = new Set([\n \"button\",\n \"static_select\",\n \"multi_static_select\",\n]);\n\nfunction assertPlainObject(\n value: unknown,\n label: string,\n): asserts value is Record<string, unknown> {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n throw new Error(`${label} must be an object`);\n }\n}\n\nfunction validateInteractiveElement(element: Record<string, unknown>, label: string): void {\n if (typeof element.type !== \"string\" || !ALLOWED_INTERACTIVE_ELEMENT_TYPES.has(element.type)) {\n return;\n }\n if (typeof element.action_id !== \"string\" || !element.action_id) {\n throw new Error(`${label}.action_id is required`);\n }\n if (element.type === \"button\" && typeof element.value !== \"string\") {\n throw new Error(`${label}.value is required for buttons`);\n }\n}\n\nfunction validateInteractiveElements(value: unknown, label: string): void {\n if (!value || typeof value !== \"object\") return;\n if (Array.isArray(value)) {\n value.forEach((item, index) => validateInteractiveElements(item, `${label}[${index}]`));\n return;\n }\n\n const obj = value as Record<string, unknown>;\n validateInteractiveElement(obj, label);\n for (const [key, nested] of Object.entries(obj)) {\n validateInteractiveElements(nested, `${label}.${key}`);\n }\n}\n\nfunction validateBlockPlacement(block: Record<string, unknown>, label: string): void {\n if (block.type === \"actions\") {\n if (!Array.isArray(block.elements)) throw new Error(`${label}.elements is required`);\n block.elements.forEach((element, index) => {\n assertPlainObject(element, `${label}.elements[${index}]`);\n if (element.type !== \"button\") {\n throw new Error(\n `${label}.elements[${index}] uses ${String(element.type)}; put static_select and multi_static_select in section.accessory instead`,\n );\n }\n });\n }\n\n if (block.type === \"section\" && block.accessory !== undefined) {\n assertPlainObject(block.accessory, `${label}.accessory`);\n const type = String(block.accessory.type);\n if (!ALLOWED_INTERACTIVE_ELEMENT_TYPES.has(type)) {\n throw new Error(`${label}.accessory has unsupported type: ${type}`);\n }\n }\n}\n\nfunction validateBlocks(blocks: unknown[]): object[] {\n if (blocks.length === 0) throw new Error(\"blocks must not be empty\");\n if (blocks.length > 20) throw new Error(\"blocks must contain at most 20 blocks\");\n\n return blocks.map((block, index) => {\n assertPlainObject(block, `blocks[${index}]`);\n const type = block.type;\n if (typeof type !== \"string\" || !ALLOWED_BLOCK_TYPES.has(type)) {\n throw new Error(`Unsupported Block Kit block type: ${String(type)}`);\n }\n validateBlockPlacement(block, `blocks[${index}]`);\n validateInteractiveElements(block, `blocks[${index}]`);\n return block;\n });\n}\n\nexport function createSlackBlockKitTool(): {\n tool: AgentTool<typeof blockKitSchema>;\n setBlockKitResponseFunction: (fn: (response: SlackBlockKitResponse) => Promise<void>) => void;\n} {\n let respondFn: ((response: SlackBlockKitResponse) => Promise<void>) | null = null;\n\n const tool: AgentTool<typeof blockKitSchema> = {\n name: \"slack_blockkit\",\n label: \"slack block kit\",\n description:\n \"Send a Slack Block Kit response. Use when structured Slack UI helps the user choose or inspect information. Supports buttons, static_select, and multi_static_select. Put buttons in actions.elements. Put static_select and multi_static_select in section.accessory.\",\n parameters: blockKitSchema,\n execute: async (\n _toolCallId: string,\n { text, blocks }: { label: string; text: string; blocks: unknown[] },\n signal?: AbortSignal,\n ) => {\n if (!respondFn) throw new Error(\"Slack Block Kit response function not configured\");\n if (signal?.aborted) throw new Error(\"Operation aborted\");\n\n await respondFn({ text, blocks: validateBlocks(blocks) });\n\n return {\n content: [{ type: \"text\" as const, text: \"Sent Slack Block Kit response\" }],\n details: undefined,\n };\n },\n };\n\n return {\n tool,\n setBlockKitResponseFunction: (fn) => {\n respondFn = fn;\n },\n };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool-diagnostics.d.ts","sourceRoot":"","sources":["../src/tool-diagnostics.ts"],"names":[],"mappings":"AAIA,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAErE"}
|
package/dist/tool-diagnostics.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// Central policy for what tool diagnostics are posted back to chat surfaces.
|
|
2
|
-
// Detailed tool calls/results still remain in the structured session history and session view.
|
|
3
|
-
const QUIET_TOOL_DIAGNOSTICS = new Set(["bash", "read", "write", "edit"]);
|
|
4
|
-
export function shouldSurfaceToolDiagnostic(toolName) {
|
|
5
|
-
return !QUIET_TOOL_DIAGNOSTICS.has(toolName);
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=tool-diagnostics.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool-diagnostics.js","sourceRoot":"","sources":["../src/tool-diagnostics.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,+FAA+F;AAC/F,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AAE1E,MAAM,UAAU,2BAA2B,CAAC,QAAgB;IAC1D,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["// Central policy for what tool diagnostics are posted back to chat surfaces.\n// Detailed tool calls/results still remain in the structured session history and session view.\nconst QUIET_TOOL_DIAGNOSTICS = new Set([\"bash\", \"read\", \"write\", \"edit\"]);\n\nexport function shouldSurfaceToolDiagnostic(toolName: string): boolean {\n return !QUIET_TOOL_DIAGNOSTICS.has(toolName);\n}\n"]}
|