intention-coding 0.0.4 → 0.0.6

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.
@@ -0,0 +1,33 @@
1
+ import { z } from "zod";
2
+ export declare const IntentRecognizerParams: z.ZodObject<{
3
+ user_input: z.ZodString;
4
+ context: z.ZodOptional<z.ZodString>;
5
+ }, "strip", z.ZodTypeAny, {
6
+ user_input: string;
7
+ context?: string | undefined;
8
+ }, {
9
+ user_input: string;
10
+ context?: string | undefined;
11
+ }>;
12
+ export declare const ContractSchema: z.ZodObject<{
13
+ sequence: z.ZodArray<z.ZodObject<{
14
+ tool_name: z.ZodString;
15
+ arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ tool_name: string;
18
+ arguments?: Record<string, any> | undefined;
19
+ }, {
20
+ tool_name: string;
21
+ arguments?: Record<string, any> | undefined;
22
+ }>, "many">;
23
+ }, "strip", z.ZodTypeAny, {
24
+ sequence: {
25
+ tool_name: string;
26
+ arguments?: Record<string, any> | undefined;
27
+ }[];
28
+ }, {
29
+ sequence: {
30
+ tool_name: string;
31
+ arguments?: Record<string, any> | undefined;
32
+ }[];
33
+ }>;
@@ -1,31 +1,13 @@
1
1
  import { z } from "zod";
2
- export interface RequirementEntry {
3
- timestamp: string;
4
- category?: string;
5
- content: string;
6
- design_focus?: string;
7
- }
8
- export interface Requirements {
9
- project_overview: RequirementEntry[];
10
- functional_requirements: RequirementEntry[];
11
- technical_requirements: RequirementEntry[];
12
- design_requirements: RequirementEntry[];
13
- deployment_requirements: RequirementEntry[];
14
- ai_constraints: RequirementEntry[];
15
- clarification_history: RequirementEntry[];
16
- architecture_designs: RequirementEntry[];
17
- last_updated: string | null;
18
- project_id: string | null;
19
- }
20
2
  export declare const RequirementClarifierParams: z.ZodObject<{
21
3
  user_input: z.ZodString;
22
- context: z.ZodOptional<z.ZodString>;
4
+ file_path: z.ZodString;
23
5
  }, "strip", z.ZodTypeAny, {
24
6
  user_input: string;
25
- context?: string | undefined;
7
+ file_path: string;
26
8
  }, {
27
9
  user_input: string;
28
- context?: string | undefined;
10
+ file_path: string;
29
11
  }>;
30
12
  export declare const RequirementManagerParams: z.ZodObject<{
31
13
  clarified_info: z.ZodString;
@@ -44,3 +26,9 @@ export declare const ArchitectureDesignerParams: z.ZodObject<{
44
26
  }, {
45
27
  design_focus?: string | undefined;
46
28
  }>;
29
+ export interface ToolContract {
30
+ sequence: Array<{
31
+ tool_name: string;
32
+ arguments?: Record<string, any>;
33
+ }>;
34
+ }
@@ -0,0 +1,34 @@
1
+ import { z } from "zod";
2
+ export declare const Word2MdParams: z.ZodObject<{
3
+ file_path: z.ZodString;
4
+ options: z.ZodDefault<z.ZodOptional<z.ZodObject<{
5
+ skip_images: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
6
+ table_style: z.ZodDefault<z.ZodOptional<z.ZodEnum<["simple", "grid", "pipe"]>>>;
7
+ strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ skip_images: boolean;
10
+ table_style: "pipe" | "simple" | "grid";
11
+ strict_mode: boolean;
12
+ }, {
13
+ skip_images?: boolean | undefined;
14
+ table_style?: "pipe" | "simple" | "grid" | undefined;
15
+ strict_mode?: boolean | undefined;
16
+ }>>>;
17
+ }, "strip", z.ZodTypeAny, {
18
+ options: {
19
+ skip_images: boolean;
20
+ table_style: "pipe" | "simple" | "grid";
21
+ strict_mode: boolean;
22
+ };
23
+ file_path: string;
24
+ }, {
25
+ file_path: string;
26
+ options?: {
27
+ skip_images?: boolean | undefined;
28
+ table_style?: "pipe" | "simple" | "grid" | undefined;
29
+ strict_mode?: boolean | undefined;
30
+ } | undefined;
31
+ }>;
32
+ export interface Word2MdParams {
33
+ file_path: string;
34
+ }
@@ -0,0 +1,6 @@
1
+ import { FastMCP } from "fastmcp";
2
+ /**
3
+ * Register all tools with the MCP server
4
+ * @param {Object} server - FastMCP server instance
5
+ */
6
+ export declare function registerTaskMasterTools(server: FastMCP, asyncManager: (server: any, asyncManager: any) => void): void;
@@ -0,0 +1,15 @@
1
+ export declare const intentRecognizer: {
2
+ name: string;
3
+ description: string;
4
+ parameters: import("zod").ZodObject<{
5
+ user_input: import("zod").ZodString;
6
+ context: import("zod").ZodOptional<import("zod").ZodString>;
7
+ }, "strip", import("zod").ZodTypeAny, {
8
+ user_input: string;
9
+ context?: string | undefined;
10
+ }, {
11
+ user_input: string;
12
+ context?: string | undefined;
13
+ }>;
14
+ execute: (args: any) => Promise<string>;
15
+ };
@@ -1,15 +1,15 @@
1
- export declare const requirementClarifierTool: {
1
+ export declare const requirementClarifier: {
2
2
  name: string;
3
3
  description: string;
4
4
  parameters: import("zod").ZodObject<{
5
5
  user_input: import("zod").ZodString;
6
- context: import("zod").ZodOptional<import("zod").ZodString>;
6
+ file_path: import("zod").ZodString;
7
7
  }, "strip", import("zod").ZodTypeAny, {
8
8
  user_input: string;
9
- context?: string | undefined;
9
+ file_path: string;
10
10
  }, {
11
11
  user_input: string;
12
- context?: string | undefined;
12
+ file_path: string;
13
13
  }>;
14
14
  execute: (args: any) => Promise<string>;
15
15
  };
File without changes
@@ -0,0 +1,36 @@
1
+ import { Word2MdParams } from '../schemas/word2md';
2
+ export declare const word2mdTool: {
3
+ name: string;
4
+ description: string;
5
+ parameters: import("zod").ZodObject<{
6
+ file_path: import("zod").ZodString;
7
+ options: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodObject<{
8
+ skip_images: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
9
+ table_style: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodEnum<["simple", "grid", "pipe"]>>>;
10
+ strict_mode: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
11
+ }, "strip", import("zod").ZodTypeAny, {
12
+ skip_images: boolean;
13
+ table_style: "pipe" | "simple" | "grid";
14
+ strict_mode: boolean;
15
+ }, {
16
+ skip_images?: boolean | undefined;
17
+ table_style?: "pipe" | "simple" | "grid" | undefined;
18
+ strict_mode?: boolean | undefined;
19
+ }>>>;
20
+ }, "strip", import("zod").ZodTypeAny, {
21
+ options: {
22
+ skip_images: boolean;
23
+ table_style: "pipe" | "simple" | "grid";
24
+ strict_mode: boolean;
25
+ };
26
+ file_path: string;
27
+ }, {
28
+ file_path: string;
29
+ options?: {
30
+ skip_images?: boolean | undefined;
31
+ table_style?: "pipe" | "simple" | "grid" | undefined;
32
+ strict_mode?: boolean | undefined;
33
+ } | undefined;
34
+ }>;
35
+ execute: (args: Word2MdParams) => Promise<string>;
36
+ };
@@ -0,0 +1,17 @@
1
+ /** 格式化文件名安全字符 */
2
+ export declare const sanitizeFileName: (input: string) => string;
3
+ /**
4
+ * 从Markdown内容中移除所有图片
5
+ * @param content Markdown原始内容
6
+ * @returns 不含图片的纯文本Markdown
7
+ */
8
+ export declare function removeImagesFromMarkdown(content: string): string;
9
+ /**
10
+ * 获取package信息
11
+ * @returns
12
+ */
13
+ export declare const getPackageJson: () => any;
14
+ /**
15
+ * 验证文件路径安全性
16
+ */
17
+ export declare function validateFilePath(filePath: string): boolean;
@@ -0,0 +1,60 @@
1
+ interface ContextManagerConfig {
2
+ maxCacheSize?: number;
3
+ ttl?: number;
4
+ maxContextSize?: number;
5
+ }
6
+ interface ContextMetadata {
7
+ created: string;
8
+ [key: string]: any;
9
+ }
10
+ interface Context {
11
+ id: string;
12
+ metadata: ContextMetadata;
13
+ }
14
+ export declare class ContextManager {
15
+ private config;
16
+ private cache;
17
+ private stats;
18
+ constructor(config?: ContextManagerConfig);
19
+ /**
20
+ * 获取或创建上下文
21
+ */
22
+ getContext(contextId: string, metadata?: object): Promise<Context>;
23
+ /**
24
+ * 更新上下文
25
+ */
26
+ updateContext(contextId: string, updates: object): Promise<Context>;
27
+ /**
28
+ * 使上下文失效
29
+ */
30
+ invalidateContext(contextId: string, metadata?: object): void;
31
+ /**
32
+ * 获取缓存数据
33
+ */
34
+ getCachedData<T = any>(key: string): T | undefined;
35
+ /**
36
+ * 设置缓存数据
37
+ */
38
+ setCachedData(key: string, data: any): void;
39
+ /**
40
+ * 使缓存项失效
41
+ */
42
+ invalidateCacheKey(key: string): void;
43
+ /**
44
+ * 获取缓存统计信息
45
+ */
46
+ getStats(): {
47
+ size: number;
48
+ maxSize: number;
49
+ ttl: number;
50
+ hits: number;
51
+ misses: number;
52
+ invalidations: number;
53
+ };
54
+ /**
55
+ * 生成缓存键(基于上下文ID和元数据)
56
+ */
57
+ private generateCacheKey;
58
+ }
59
+ export declare const contextManager: ContextManager;
60
+ export {};
@@ -0,0 +1,30 @@
1
+ import { ReadableStreamController } from "stream/web";
2
+ interface Params {
3
+ appid?: string;
4
+ data: any;
5
+ timeout?: number;
6
+ }
7
+ type StreamCallback = (data: {
8
+ content?: string;
9
+ controller?: ReadableStreamController<any>;
10
+ isEnd?: boolean;
11
+ }) => void;
12
+ /**
13
+ * 调用工作流
14
+ *
15
+ * @param params 请求参数对象
16
+ * @param params.appid 应用ID,如果不提供则使用默认值 "app-ESTcrkOPOmkxdrO0120mE4s1"
17
+ * @param params.data 工作流输入数据
18
+ * @param params.timeout 请求超时时间(毫秒)
19
+ * @param streamCb 流回调函数,用于处理流式响应
20
+ * @returns Promise 返回一个Promise对象,解析为工作流响应结果或流响应对象
21
+ */
22
+ export declare function invokeFlow(params: Params, streamCb?: StreamCallback): Promise<any>;
23
+ /**
24
+ * 移除指定语言的代码块
25
+ *
26
+ * @param content 包含代码块的内容
27
+ * @returns 移除代码块后的内容
28
+ */
29
+ export declare function removeCodeBlock(content: string): string;
30
+ export {};
@@ -0,0 +1,2 @@
1
+ import winston from 'winston';
2
+ export declare const logger: winston.Logger;
@@ -0,0 +1,28 @@
1
+ import { FastMCP } from 'fastmcp';
2
+ /**
3
+ * Main MCP server class that integrates with Task Master
4
+ */
5
+ declare class TaskMasterMCPServer {
6
+ options: {
7
+ name: string;
8
+ version: `${number}.${number}.${number}`;
9
+ };
10
+ server: FastMCP<undefined>;
11
+ initialized: boolean;
12
+ logger: any;
13
+ constructor();
14
+ /**
15
+ * Initialize the MCP server with necessary tools and routes
16
+ */
17
+ init(): Promise<this | undefined>;
18
+ asyncManager(server: any, asyncManager: any): void;
19
+ /**
20
+ * Start the MCP server
21
+ */
22
+ start(): Promise<this>;
23
+ /**
24
+ * Stop the MCP server
25
+ */
26
+ stop(): Promise<void>;
27
+ }
28
+ export default TaskMasterMCPServer;
@@ -1,18 +1,33 @@
1
- import { Requirements } from "../schemas/types";
1
+ import { RequirementStorage } from "./storage";
2
+ export declare const storage: RequirementStorage;
3
+ export interface RequirementEntry {
4
+ timestamp: string;
5
+ category?: string;
6
+ content: string;
7
+ design_focus?: string;
8
+ }
9
+ export interface Requirements {
10
+ project_overview: RequirementEntry[];
11
+ functional_requirements: RequirementEntry[];
12
+ technical_requirements: RequirementEntry[];
13
+ design_requirements: RequirementEntry[];
14
+ deployment_requirements: RequirementEntry[];
15
+ ai_constraints: RequirementEntry[];
16
+ clarification_history: RequirementEntry[];
17
+ architecture_designs: RequirementEntry[];
18
+ requirement_analysis: RequirementEntry[];
19
+ last_updated: string | null;
20
+ project_id: string | null;
21
+ }
2
22
  export declare const currentRequirements: Requirements;
3
- export declare const categoryMapping: Record<string, keyof Requirements>;
4
23
  /**
5
24
  * 统计当前需求数量
6
25
  */
7
26
  export declare function countRequirements(requirements: Requirements): number;
8
- /**
9
- * 获取存储类别
10
- */
11
- export declare function getStorageCategory(category: string): keyof Requirements;
12
27
  /**
13
28
  * 添加需求条目
14
29
  */
15
- export declare function addRequirementEntry(requirements: Requirements, category: string, content: string): Requirements;
30
+ export declare function addRequirementEntry(type: string, category: string, content: string): Requirements;
16
31
  /**
17
32
  * 格式化需求更新响应信息
18
33
  */
@@ -1,4 +1,4 @@
1
- import { Requirements } from "../schemas/types";
1
+ import { Requirements } from "../utils/requirements-utils";
2
2
  export declare class RequirementStorage {
3
3
  storageDir: string;
4
4
  private _requirementsFile;
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "intention-coding",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
+ "description": "软件工程化的需求分析,功能设计,代码编写,测试运行和发布部署",
4
5
  "type": "module",
5
6
  "exports": {
6
7
  ".": {
@@ -9,7 +10,7 @@
9
10
  "require": "./dist/index.cjs"
10
11
  }
11
12
  },
12
- "bin": "./dist/index.cjs",
13
+ "bin": "./dist/index.js",
13
14
  "main": "./dist/index.cjs",
14
15
  "module": "./dist/index.js",
15
16
  "types": "./dist/index.d.ts",
@@ -38,7 +39,12 @@
38
39
  "zod": "3.25.64"
39
40
  },
40
41
  "dependencies": {
41
- "fastmcp": "^3.3.0"
42
+ "fastmcp": "^3.3.0",
43
+ "html-to-md": "^0.8.8",
44
+ "lru-cache": "^11.1.0",
45
+ "mammoth": "^1.9.1",
46
+ "winston": "^3.17.0",
47
+ "winston-daily-rotate-file": "^5.0.0"
42
48
  },
43
49
  "license": "MIT"
44
50
  }