intention-coding 0.0.6 → 0.0.7
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/dist/config.d.ts +2 -2
- package/dist/index.cjs +11 -21
- package/dist/index.js +11 -18
- package/dist/utils/common.d.ts +0 -5
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
|
|
4
|
-
return 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
5
|
-
}();
|
|
6
3
|
var __webpack_require__ = {};
|
|
7
4
|
(()=>{
|
|
8
5
|
__webpack_require__.n = (module)=>{
|
|
@@ -155,21 +152,6 @@ const external_path_namespaceObject = require("path");
|
|
|
155
152
|
var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
|
|
156
153
|
const external_fs_namespaceObject = require("fs");
|
|
157
154
|
var external_fs_default = /*#__PURE__*/ __webpack_require__.n(external_fs_namespaceObject);
|
|
158
|
-
const external_url_namespaceObject = require("url");
|
|
159
|
-
const sanitizeFileName = (input)=>input.replace(/[\\/:*?"<>|\n\r#%&]/g, '').trim().replace(/\s+/g, '_').replace(/_+/g, '_').replace(/^_+|_+$/g, '');
|
|
160
|
-
function removeImagesFromMarkdown(content) {
|
|
161
|
-
let cleaned = content.replace(/!\[.*?\]\(.*?\)/g, '');
|
|
162
|
-
cleaned = cleaned.replace(/<img\b[^>]*>/g, '');
|
|
163
|
-
cleaned = cleaned.replace(/!\[.*?\]\(data:image\/[a-z+]+;base64,[a-zA-Z0-9+/=]+\)/g, '');
|
|
164
|
-
cleaned = cleaned.replace(/\n{3,}/g, '\n\n');
|
|
165
|
-
return cleaned.trim();
|
|
166
|
-
}
|
|
167
|
-
const getPackageJson = ()=>{
|
|
168
|
-
const __filename1 = (0, external_url_namespaceObject.fileURLToPath)(__rslib_import_meta_url__);
|
|
169
|
-
const __dirname = external_path_default().dirname(__filename1);
|
|
170
|
-
const packagePath = external_path_default().join(__dirname, '../../package.json');
|
|
171
|
-
return JSON.parse(external_fs_namespaceObject.readFileSync(packagePath, 'utf8'));
|
|
172
|
-
};
|
|
173
155
|
external_path_default().join(process.cwd(), '.aico');
|
|
174
156
|
const getStorageDir = ()=>{
|
|
175
157
|
const envDir = process.env.MCP_STORAGE_DIR + "/.aico";
|
|
@@ -180,8 +162,8 @@ const getStorageDir = ()=>{
|
|
|
180
162
|
};
|
|
181
163
|
const SERVICE_CONFIG = {
|
|
182
164
|
name: "\u667A\u80FD\u8F6F\u4EF6\u661F\u5DE5\u5382",
|
|
183
|
-
version:
|
|
184
|
-
description:
|
|
165
|
+
version: "0.0.1",
|
|
166
|
+
description: "\u8F6F\u4EF6\u5DE5\u7A0B\u5316\u7684\u9700\u6C42\u5206\u6790\uFF0C\u529F\u80FD\u8BBE\u8BA1\uFF0C\u4EE3\u7801\u7F16\u5199\uFF0C\u6D4B\u8BD5\u8FD0\u884C\u548C\u53D1\u5E03\u90E8\u7F72"
|
|
185
167
|
};
|
|
186
168
|
const logDir = getStorageDir() + '/logs';
|
|
187
169
|
const levels = {
|
|
@@ -3918,7 +3900,7 @@ const v3 = external_namespaceObject;
|
|
|
3918
3900
|
const esm = v3;
|
|
3919
3901
|
const RequirementClarifierParams = objectType({
|
|
3920
3902
|
user_input: stringType().describe("\u7528\u6237\u8F93\u5165\u7684\u9700\u6C42\u63CF\u8FF0"),
|
|
3921
|
-
file_path: stringType().describe("\u5982\u679C\u9700\u6C42\u63CF\u8FF0\u6765\u81EA\u6587\u6863\uFF0C\u9700\u8981\u63D0\u4F9B\u6587\u6863\u8F6C\u6362\u4E3Amd\u540E\u7684\u6587\u6863\u7684\u7EDD\u5BF9\u8DEF\u5F84")
|
|
3903
|
+
file_path: stringType().describe("\u5982\u679C\u9700\u6C42\u63CF\u8FF0\u6765\u81EA\u6587\u6863\uFF0C\u9700\u8981\u63D0\u4F9B\u6587\u6863\u8F6C\u6362\u4E3Amd\u683C\u5F0F\u540E\u7684\u6587\u6863\u7684\u7EDD\u5BF9\u8DEF\u5F84")
|
|
3922
3904
|
});
|
|
3923
3905
|
const RequirementManagerParams = objectType({
|
|
3924
3906
|
clarified_info: stringType().describe("\u6F84\u6E05\u540E\u7684\u9700\u6C42\u4FE1\u606F"),
|
|
@@ -4100,6 +4082,14 @@ function removeCodeBlock(content) {
|
|
|
4100
4082
|
const startRegExp = new RegExp(`^\\\`\\\`\\\`${language}\\n`);
|
|
4101
4083
|
return content.trim().replace(startRegExp, '').replace(/\n?```$/, '');
|
|
4102
4084
|
}
|
|
4085
|
+
const sanitizeFileName = (input)=>input.replace(/[\\/:*?"<>|\n\r#%&]/g, '').trim().replace(/\s+/g, '_').replace(/_+/g, '_').replace(/^_+|_+$/g, '');
|
|
4086
|
+
function removeImagesFromMarkdown(content) {
|
|
4087
|
+
let cleaned = content.replace(/!\[.*?\]\(.*?\)/g, '');
|
|
4088
|
+
cleaned = cleaned.replace(/<img\b[^>]*>/g, '');
|
|
4089
|
+
cleaned = cleaned.replace(/!\[.*?\]\(data:image\/[a-z+]+;base64,[a-zA-Z0-9+/=]+\)/g, '');
|
|
4090
|
+
cleaned = cleaned.replace(/\n{3,}/g, '\n\n');
|
|
4091
|
+
return cleaned.trim();
|
|
4092
|
+
}
|
|
4103
4093
|
const promises_namespaceObject = require("fs/promises");
|
|
4104
4094
|
var promises_default = /*#__PURE__*/ __webpack_require__.n(promises_namespaceObject);
|
|
4105
4095
|
const requirementClarifier = {
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,6 @@ import winston from "winston";
|
|
|
4
4
|
import winston_daily_rotate_file from "winston-daily-rotate-file";
|
|
5
5
|
import path_0, { join } from "path";
|
|
6
6
|
import fs_0, { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
7
|
-
import { fileURLToPath } from "url";
|
|
8
7
|
import promises, { mkdir, readFile, stat, writeFile } from "fs/promises";
|
|
9
8
|
import { convertToHtml } from "mammoth";
|
|
10
9
|
import html_to_md from "html-to-md";
|
|
@@ -141,20 +140,6 @@ __webpack_require__.d(external_namespaceObject, {
|
|
|
141
140
|
util: ()=>util_util,
|
|
142
141
|
void: ()=>voidType
|
|
143
142
|
});
|
|
144
|
-
const sanitizeFileName = (input)=>input.replace(/[\\/:*?"<>|\n\r#%&]/g, '').trim().replace(/\s+/g, '_').replace(/_+/g, '_').replace(/^_+|_+$/g, '');
|
|
145
|
-
function removeImagesFromMarkdown(content) {
|
|
146
|
-
let cleaned = content.replace(/!\[.*?\]\(.*?\)/g, '');
|
|
147
|
-
cleaned = cleaned.replace(/<img\b[^>]*>/g, '');
|
|
148
|
-
cleaned = cleaned.replace(/!\[.*?\]\(data:image\/[a-z+]+;base64,[a-zA-Z0-9+/=]+\)/g, '');
|
|
149
|
-
cleaned = cleaned.replace(/\n{3,}/g, '\n\n');
|
|
150
|
-
return cleaned.trim();
|
|
151
|
-
}
|
|
152
|
-
const getPackageJson = ()=>{
|
|
153
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
154
|
-
const __dirname = path_0.dirname(__filename);
|
|
155
|
-
const packagePath = path_0.join(__dirname, '../../package.json');
|
|
156
|
-
return JSON.parse(readFileSync(packagePath, 'utf8'));
|
|
157
|
-
};
|
|
158
143
|
path_0.join(process.cwd(), '.aico');
|
|
159
144
|
const getStorageDir = ()=>{
|
|
160
145
|
const envDir = process.env.MCP_STORAGE_DIR + "/.aico";
|
|
@@ -165,8 +150,8 @@ const getStorageDir = ()=>{
|
|
|
165
150
|
};
|
|
166
151
|
const SERVICE_CONFIG = {
|
|
167
152
|
name: "\u667A\u80FD\u8F6F\u4EF6\u661F\u5DE5\u5382",
|
|
168
|
-
version:
|
|
169
|
-
description:
|
|
153
|
+
version: "0.0.1",
|
|
154
|
+
description: "\u8F6F\u4EF6\u5DE5\u7A0B\u5316\u7684\u9700\u6C42\u5206\u6790\uFF0C\u529F\u80FD\u8BBE\u8BA1\uFF0C\u4EE3\u7801\u7F16\u5199\uFF0C\u6D4B\u8BD5\u8FD0\u884C\u548C\u53D1\u5E03\u90E8\u7F72"
|
|
170
155
|
};
|
|
171
156
|
const logDir = getStorageDir() + '/logs';
|
|
172
157
|
const levels = {
|
|
@@ -3903,7 +3888,7 @@ const v3 = external_namespaceObject;
|
|
|
3903
3888
|
const esm = v3;
|
|
3904
3889
|
const RequirementClarifierParams = objectType({
|
|
3905
3890
|
user_input: stringType().describe("\u7528\u6237\u8F93\u5165\u7684\u9700\u6C42\u63CF\u8FF0"),
|
|
3906
|
-
file_path: stringType().describe("\u5982\u679C\u9700\u6C42\u63CF\u8FF0\u6765\u81EA\u6587\u6863\uFF0C\u9700\u8981\u63D0\u4F9B\u6587\u6863\u8F6C\u6362\u4E3Amd\u540E\u7684\u6587\u6863\u7684\u7EDD\u5BF9\u8DEF\u5F84")
|
|
3891
|
+
file_path: stringType().describe("\u5982\u679C\u9700\u6C42\u63CF\u8FF0\u6765\u81EA\u6587\u6863\uFF0C\u9700\u8981\u63D0\u4F9B\u6587\u6863\u8F6C\u6362\u4E3Amd\u683C\u5F0F\u540E\u7684\u6587\u6863\u7684\u7EDD\u5BF9\u8DEF\u5F84")
|
|
3907
3892
|
});
|
|
3908
3893
|
const RequirementManagerParams = objectType({
|
|
3909
3894
|
clarified_info: stringType().describe("\u6F84\u6E05\u540E\u7684\u9700\u6C42\u4FE1\u606F"),
|
|
@@ -4085,6 +4070,14 @@ function removeCodeBlock(content) {
|
|
|
4085
4070
|
const startRegExp = new RegExp(`^\\\`\\\`\\\`${language}\\n`);
|
|
4086
4071
|
return content.trim().replace(startRegExp, '').replace(/\n?```$/, '');
|
|
4087
4072
|
}
|
|
4073
|
+
const sanitizeFileName = (input)=>input.replace(/[\\/:*?"<>|\n\r#%&]/g, '').trim().replace(/\s+/g, '_').replace(/_+/g, '_').replace(/^_+|_+$/g, '');
|
|
4074
|
+
function removeImagesFromMarkdown(content) {
|
|
4075
|
+
let cleaned = content.replace(/!\[.*?\]\(.*?\)/g, '');
|
|
4076
|
+
cleaned = cleaned.replace(/<img\b[^>]*>/g, '');
|
|
4077
|
+
cleaned = cleaned.replace(/!\[.*?\]\(data:image\/[a-z+]+;base64,[a-zA-Z0-9+/=]+\)/g, '');
|
|
4078
|
+
cleaned = cleaned.replace(/\n{3,}/g, '\n\n');
|
|
4079
|
+
return cleaned.trim();
|
|
4080
|
+
}
|
|
4088
4081
|
const requirementClarifier = {
|
|
4089
4082
|
name: "requirement_clarifier",
|
|
4090
4083
|
description: "\u9700\u6C42\u5DE5\u7A0B\u5E08 - \u5206\u6790\u7528\u6237\u9700\u6C42\u5B8C\u6574\u6027\uFF0C\u4E3B\u52A8\u53D1\u73B0\u4E0D\u660E\u786E\u7684\u5730\u65B9",
|
package/dist/utils/common.d.ts
CHANGED
|
@@ -6,11 +6,6 @@ export declare const sanitizeFileName: (input: string) => string;
|
|
|
6
6
|
* @returns 不含图片的纯文本Markdown
|
|
7
7
|
*/
|
|
8
8
|
export declare function removeImagesFromMarkdown(content: string): string;
|
|
9
|
-
/**
|
|
10
|
-
* 获取package信息
|
|
11
|
-
* @returns
|
|
12
|
-
*/
|
|
13
|
-
export declare const getPackageJson: () => any;
|
|
14
9
|
/**
|
|
15
10
|
* 验证文件路径安全性
|
|
16
11
|
*/
|