@blxzer/cursor-trellis 0.1.3 → 0.2.1

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.
Files changed (74) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +45 -23
  3. package/dist/configurators/workflow.d.ts +1 -1
  4. package/dist/configurators/workflow.d.ts.map +1 -1
  5. package/dist/configurators/workflow.js +20 -9
  6. package/dist/configurators/workflow.js.map +1 -1
  7. package/dist/migrations/manifests/0.1.3.json +9 -0
  8. package/dist/migrations/manifests/0.1.4.json +9 -0
  9. package/dist/templates/markdown/agents.md +1 -1
  10. package/dist/templates/markdown/index.d.ts +1 -0
  11. package/dist/templates/markdown/index.d.ts.map +1 -1
  12. package/dist/templates/markdown/index.js +1 -0
  13. package/dist/templates/markdown/index.js.map +1 -1
  14. package/dist/templates/markdown/prompts/run-semantic-slice-12.md.txt +13 -29
  15. package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +0 -49
  16. package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +0 -85
  17. package/dist/templates/markdown/spec/guides/cursor-semantic-compliance.md.txt +7 -21
  18. package/dist/templates/markdown/spec/guides/cursor-subagent-policy.md.txt +6 -10
  19. package/dist/templates/markdown/spec/guides/retrieval-daily-guide.md.txt +7 -13
  20. package/dist/templates/shared-hooks/inject-retrieval-plan.py +42 -23
  21. package/dist/templates/shared-hooks/inject-subagent-context.py +6 -2
  22. package/dist/templates/shared-hooks/session-start.py +17 -9
  23. package/dist/templates/trellis/index.d.ts +7 -4
  24. package/dist/templates/trellis/index.d.ts.map +1 -1
  25. package/dist/templates/trellis/index.js +11 -7
  26. package/dist/templates/trellis/index.js.map +1 -1
  27. package/dist/templates/trellis/scripts/common/codebase_retrieval_router.py +2 -2
  28. package/dist/templates/trellis/scripts/common/config.py +1 -1
  29. package/dist/templates/trellis/scripts/common/parent_orchestration.py +27 -15
  30. package/dist/templates/trellis/scripts/common/retrieval_agent_instructions.py +1 -1
  31. package/dist/templates/trellis/scripts/common/smart_search_resolve.py +28 -3
  32. package/dist/templates/trellis/scripts/common/task_gates.py +372 -73
  33. package/dist/templates/trellis/scripts/common/task_map.py +29 -1
  34. package/dist/templates/trellis/workflow.md +9 -53
  35. package/package.json +5 -44
  36. package/bin/smart-search.js +0 -79
  37. package/dist/templates/trellis/scripts/aggregate_retrieval_telemetry.py +0 -342
  38. package/dist/templates/trellis/scripts/batch_plan_envelope.py +0 -105
  39. package/vendor/smart-search/LICENSE +0 -21
  40. package/vendor/smart-search/README.md +0 -412
  41. package/vendor/smart-search/README.zh-CN.md +0 -430
  42. package/vendor/smart-search/npm/bin/smart-search.js +0 -63
  43. package/vendor/smart-search/npm/scripts/postinstall.js +0 -87
  44. package/vendor/smart-search/npm/scripts/resolve-prerelease-version.js +0 -108
  45. package/vendor/smart-search/npm/scripts/set-package-version.js +0 -35
  46. package/vendor/smart-search/npm/scripts/sync-python-version.js +0 -22
  47. package/vendor/smart-search/npm/scripts/test-wrapper-repair.js +0 -99
  48. package/vendor/smart-search/npm/scripts/test.js +0 -85
  49. package/vendor/smart-search/package.json +0 -42
  50. package/vendor/smart-search/pyproject.toml +0 -37
  51. package/vendor/smart-search/skills/smart-search-cli/SKILL.md +0 -387
  52. package/vendor/smart-search/skills/smart-search-cli/agents/openai.yaml +0 -3
  53. package/vendor/smart-search/skills/smart-search-cli/examples/batch-search.md +0 -98
  54. package/vendor/smart-search/skills/smart-search-cli/examples/evidence-gathering.md +0 -89
  55. package/vendor/smart-search/skills/smart-search-cli/references/cli-contract.md +0 -337
  56. package/vendor/smart-search/src/smart_search/__init__.py +0 -1
  57. package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/SKILL.md +0 -387
  58. package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/agents/openai.yaml +0 -3
  59. package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/examples/batch-search.md +0 -98
  60. package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/examples/evidence-gathering.md +0 -89
  61. package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/references/cli-contract.md +0 -337
  62. package/vendor/smart-search/src/smart_search/cli.py +0 -2003
  63. package/vendor/smart-search/src/smart_search/config.py +0 -580
  64. package/vendor/smart-search/src/smart_search/logger.py +0 -43
  65. package/vendor/smart-search/src/smart_search/providers/__init__.py +0 -16
  66. package/vendor/smart-search/src/smart_search/providers/base.py +0 -41
  67. package/vendor/smart-search/src/smart_search/providers/context7.py +0 -141
  68. package/vendor/smart-search/src/smart_search/providers/exa.py +0 -206
  69. package/vendor/smart-search/src/smart_search/providers/jina.py +0 -136
  70. package/vendor/smart-search/src/smart_search/providers/openai_compatible.py +0 -370
  71. package/vendor/smart-search/src/smart_search/providers/zhipu.py +0 -143
  72. package/vendor/smart-search/src/smart_search/service.py +0 -2865
  73. package/vendor/smart-search/src/smart_search/sources.py +0 -429
  74. package/vendor/smart-search/src/smart_search/utils.py +0 -220
@@ -1,108 +0,0 @@
1
- const { execFileSync } = require("node:child_process");
2
-
3
- function parseArgs(argv) {
4
- const args = {
5
- prereleaseId: "beta",
6
- versionsJson: ""
7
- };
8
- for (let index = 0; index < argv.length; index += 1) {
9
- const arg = argv[index];
10
- const next = argv[index + 1];
11
- if (arg === "--package") {
12
- args.packageName = next;
13
- index += 1;
14
- } else if (arg === "--base") {
15
- args.baseVersion = next;
16
- index += 1;
17
- } else if (arg === "--id") {
18
- args.prereleaseId = next;
19
- index += 1;
20
- } else if (arg === "--versions-json") {
21
- args.versionsJson = next;
22
- index += 1;
23
- } else if (arg === "--help" || arg === "-h") {
24
- printUsage(0);
25
- } else {
26
- console.error(`Unknown argument: ${arg}`);
27
- printUsage(1);
28
- }
29
- }
30
- return args;
31
- }
32
-
33
- function printUsage(exitCode) {
34
- console.error(
35
- [
36
- "Usage: node npm/scripts/resolve-prerelease-version.js --package <name> --base <version> [--id beta]",
37
- "",
38
- "Options:",
39
- " --versions-json JSON Use an explicit version list instead of querying npm."
40
- ].join("\n")
41
- );
42
- process.exit(exitCode);
43
- }
44
-
45
- function escapeRegExp(value) {
46
- return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
47
- }
48
-
49
- function readPublishedVersions(packageName, versionsJson) {
50
- if (versionsJson) {
51
- return JSON.parse(versionsJson);
52
- }
53
- try {
54
- const output = execFileSync("npm", ["view", packageName, "versions", "--json"], {
55
- encoding: "utf8",
56
- stdio: ["ignore", "pipe", "pipe"]
57
- });
58
- return JSON.parse(output);
59
- } catch (error) {
60
- const stderr = String(error.stderr || "");
61
- if (stderr.includes("E404") || stderr.includes("404 Not Found")) {
62
- return [];
63
- }
64
- throw error;
65
- }
66
- }
67
-
68
- function resolvePrereleaseVersion(versions, baseVersion, prereleaseId) {
69
- const normalizedVersions = Array.isArray(versions) ? versions.filter((version) => typeof version === "string") : [];
70
- const escapedBase = escapeRegExp(baseVersion);
71
- const escapedId = escapeRegExp(prereleaseId);
72
- const prereleasePattern = new RegExp(`^${escapedBase}-${escapedId}\\.(\\d+)$`);
73
- const legacyDevPattern = new RegExp(`^${escapedBase}-dev\\..+$`);
74
- const existingPrereleaseNumbers = [];
75
- let legacyDevCount = 0;
76
-
77
- for (const version of normalizedVersions) {
78
- const prereleaseMatch = prereleasePattern.exec(version);
79
- if (prereleaseMatch) {
80
- existingPrereleaseNumbers.push(Number(prereleaseMatch[1]));
81
- continue;
82
- }
83
- if (legacyDevPattern.test(version)) {
84
- legacyDevCount += 1;
85
- }
86
- }
87
-
88
- const maxExistingPrerelease = existingPrereleaseNumbers.length > 0 ? Math.max(...existingPrereleaseNumbers) : 0;
89
- const nextNumber = Math.max(maxExistingPrerelease, legacyDevCount) + 1;
90
- return `${baseVersion}-${prereleaseId}.${nextNumber}`;
91
- }
92
-
93
- function main() {
94
- const args = parseArgs(process.argv.slice(2));
95
- if (!args.packageName || !args.baseVersion) {
96
- printUsage(1);
97
- }
98
- const versions = readPublishedVersions(args.packageName, args.versionsJson);
99
- process.stdout.write(resolvePrereleaseVersion(versions, args.baseVersion, args.prereleaseId));
100
- }
101
-
102
- if (require.main === module) {
103
- main();
104
- }
105
-
106
- module.exports = {
107
- resolvePrereleaseVersion
108
- };
@@ -1,35 +0,0 @@
1
- const fs = require("node:fs");
2
- const path = require("node:path");
3
-
4
- const version = process.argv[2];
5
- if (!version) {
6
- console.error("Usage: node npm/scripts/set-package-version.js <version>");
7
- process.exit(1);
8
- }
9
-
10
- const packageRoot = path.resolve(__dirname, "..", "..");
11
- const packageJsonPath = path.join(packageRoot, "package.json");
12
- const packageLockPath = path.join(packageRoot, "package-lock.json");
13
- const pyprojectPath = path.join(packageRoot, "pyproject.toml");
14
-
15
- function writeJsonVersion(filePath) {
16
- const data = JSON.parse(fs.readFileSync(filePath, "utf8"));
17
- data.version = version;
18
- if (data.packages && data.packages[""]) {
19
- data.packages[""].version = version;
20
- }
21
- fs.writeFileSync(filePath, `${JSON.stringify(data, null, 2)}\n`);
22
- }
23
-
24
- writeJsonVersion(packageJsonPath);
25
- writeJsonVersion(packageLockPath);
26
-
27
- const pyproject = fs.readFileSync(pyprojectPath, "utf8");
28
- const versionPattern = /^version = ".*"$/m;
29
- if (!versionPattern.test(pyproject)) {
30
- console.error("Could not find the project.version field in pyproject.toml.");
31
- process.exit(1);
32
- }
33
-
34
- fs.writeFileSync(pyprojectPath, pyproject.replace(versionPattern, `version = "${version}"`));
35
- console.log(`Set package version to ${version}.`);
@@ -1,22 +0,0 @@
1
- const fs = require("node:fs");
2
- const path = require("node:path");
3
-
4
- const packageRoot = path.resolve(__dirname, "..", "..");
5
- const packageJson = JSON.parse(
6
- fs.readFileSync(path.join(packageRoot, "package.json"), "utf8")
7
- );
8
- const pyprojectPath = path.join(packageRoot, "pyproject.toml");
9
- const pyproject = fs.readFileSync(pyprojectPath, "utf8");
10
- const versionPattern = /^version = ".*"$/m;
11
-
12
- if (!versionPattern.test(pyproject)) {
13
- console.error("Could not find the project.version field in pyproject.toml.");
14
- process.exit(1);
15
- }
16
-
17
- const updated = pyproject.replace(versionPattern, `version = "${packageJson.version}"`);
18
- if (updated !== pyproject) {
19
- fs.writeFileSync(pyprojectPath, updated);
20
- }
21
-
22
- console.log(`Synced pyproject.toml to ${packageJson.version}.`);
@@ -1,99 +0,0 @@
1
- const assert = require("node:assert");
2
- const fs = require("node:fs");
3
- const path = require("node:path");
4
- const vm = require("node:vm");
5
-
6
- const wrapperPath = path.resolve(__dirname, "..", "bin", "smart-search.js");
7
- const wrapperSource = fs.readFileSync(wrapperPath, "utf8");
8
-
9
- function runWrapper({ runtimeExists, repairStatus = 0, repairCreatesRuntime = true }) {
10
- let repairedRuntimeExists = runtimeExists;
11
- const spawnSyncCalls = [];
12
- const spawnCalls = [];
13
- const exits = [];
14
-
15
- const fakeFs = {
16
- existsSync(filePath) {
17
- const normalized = filePath.replaceAll("\\", "/");
18
- if (
19
- normalized.endsWith("/.smart-search-python/Scripts/python.exe") ||
20
- normalized.endsWith("/.smart-search-python/bin/python")
21
- ) {
22
- return repairedRuntimeExists;
23
- }
24
- return fs.existsSync(filePath);
25
- }
26
- };
27
-
28
- const fakeProcess = {
29
- ...process,
30
- argv: ["node", wrapperPath, "--version"],
31
- env: {},
32
- cwd: () => "C:\\caller",
33
- exit(code) {
34
- exits.push(code);
35
- throw new Error(`process.exit(${code})`);
36
- },
37
- kill() {}
38
- };
39
-
40
- const fakeChildProcess = {
41
- spawnSync(command, args, options) {
42
- spawnSyncCalls.push({ command, args, options });
43
- if (repairCreatesRuntime) {
44
- repairedRuntimeExists = true;
45
- }
46
- return { status: repairStatus };
47
- },
48
- spawn(command, args, options) {
49
- spawnCalls.push({ command, args, options });
50
- return {
51
- on() {
52
- return this;
53
- }
54
- };
55
- }
56
- };
57
-
58
- const context = {
59
- __dirname: path.dirname(wrapperPath),
60
- console: { error() {}, log() {} },
61
- process: fakeProcess,
62
- require(moduleName) {
63
- if (moduleName === "node:child_process") {
64
- return fakeChildProcess;
65
- }
66
- if (moduleName === "node:fs") {
67
- return fakeFs;
68
- }
69
- if (moduleName === "node:path") {
70
- return path;
71
- }
72
- return require(moduleName);
73
- }
74
- };
75
-
76
- try {
77
- vm.runInNewContext(wrapperSource, context, { filename: wrapperPath });
78
- } catch (error) {
79
- if (!String(error.message).startsWith("process.exit(")) {
80
- throw error;
81
- }
82
- }
83
-
84
- return { spawnSyncCalls, spawnCalls, exits };
85
- }
86
-
87
- const healthy = runWrapper({ runtimeExists: true });
88
- assert.strictEqual(healthy.spawnSyncCalls.length, 0);
89
- assert.strictEqual(healthy.spawnCalls.length, 1);
90
-
91
- const repaired = runWrapper({ runtimeExists: false });
92
- assert.strictEqual(repaired.spawnSyncCalls.length, 1);
93
- assert(
94
- repaired.spawnSyncCalls[0].args[0].replaceAll("\\", "/").endsWith("/npm/scripts/postinstall.js"),
95
- "missing runtime should invoke package postinstall repair"
96
- );
97
- assert.strictEqual(repaired.spawnCalls.length, 1);
98
- assert.deepStrictEqual(Array.from(repaired.spawnCalls[0].args.slice(0, 2)), ["-m", "smart_search.cli"]);
99
- assert.strictEqual(repaired.exits.length, 0);
@@ -1,85 +0,0 @@
1
- const { spawnSync } = require("node:child_process");
2
- const fs = require("node:fs");
3
- const path = require("node:path");
4
-
5
- const packageRoot = path.resolve(__dirname, "..", "..");
6
- const venvDir = path.join(packageRoot, ".smart-search-python");
7
- const pythonPath =
8
- process.platform === "win32"
9
- ? path.join(venvDir, "Scripts", "python.exe")
10
- : path.join(venvDir, "bin", "python");
11
-
12
- function run(command, args, options = {}) {
13
- const result = spawnSync(command, args, {
14
- cwd: packageRoot,
15
- stdio: "inherit",
16
- shell: options.shell || false,
17
- windowsHide: true
18
- });
19
- if (result.error) {
20
- console.error(result.error.message);
21
- process.exit(1);
22
- }
23
- if (result.status !== 0) {
24
- process.exit(result.status || 1);
25
- }
26
- }
27
-
28
- function capture(command, args) {
29
- const result = spawnSync(command, args, {
30
- cwd: packageRoot,
31
- encoding: "utf8",
32
- windowsHide: true
33
- });
34
- if (result.error) {
35
- console.error(result.error.message);
36
- process.exit(1);
37
- }
38
- if (result.status !== 0) {
39
- process.stdout.write(result.stdout || "");
40
- process.stderr.write(result.stderr || "");
41
- process.exit(result.status || 1);
42
- }
43
- return result.stdout || "";
44
- }
45
-
46
- function runNpm(args) {
47
- if (process.env.npm_execpath) {
48
- run(process.execPath, [process.env.npm_execpath, ...args]);
49
- return;
50
- }
51
- run("npm", args, { shell: process.platform === "win32" });
52
- }
53
-
54
- if (!fs.existsSync(pythonPath)) {
55
- console.error("Missing .smart-search-python runtime. Run npm install first.");
56
- process.exit(1);
57
- }
58
-
59
- run(pythonPath, ["-m", "pip", "install", "--disable-pip-version-check", "-e", ".[dev]"]);
60
- run(pythonPath, ["-m", "pytest"]);
61
- run(process.execPath, ["npm/scripts/test-wrapper-repair.js"]);
62
- run(process.execPath, ["npm/bin/smart-search.js", "--help"]);
63
- const utf8Probe = spawnSync(process.execPath, [
64
- "npm/bin/smart-search.js",
65
- "search",
66
- "深度搜索一下最近的比特币行情",
67
- "--format",
68
- "json"
69
- ], {
70
- cwd: packageRoot,
71
- encoding: "utf8",
72
- windowsHide: true,
73
- env: { ...process.env, OPENAI_COMPATIBLE_API_KEY: "" }
74
- });
75
- let utf8Query = "";
76
- try {
77
- utf8Query = JSON.parse(utf8Probe.stdout || "{}").query;
78
- } catch (err) {
79
- utf8Query = "";
80
- }
81
- if (utf8Query !== "深度搜索一下最近的比特币行情") {
82
- console.error("npm wrapper must preserve non-ASCII CLI arguments and JSON output as UTF-8.");
83
- process.exit(1);
84
- }
85
- runNpm(["pack", "--dry-run"]);
@@ -1,42 +0,0 @@
1
- {
2
- "name": "@konbakuyomu/smart-search",
3
- "version": "0.1.14",
4
- "description": "CLI-first bilingual web research with OpenAI-compatible search, Exa, Context7, Tavily, Firecrawl, and staged Deep Research execution.",
5
- "license": "MIT",
6
- "homepage": "https://github.com/konbakuyomu/smartsearch#readme",
7
- "repository": {
8
- "type": "git",
9
- "url": "git+https://github.com/konbakuyomu/smartsearch.git"
10
- },
11
- "bugs": {
12
- "url": "https://github.com/konbakuyomu/smartsearch/issues"
13
- },
14
- "bin": {
15
- "smart-search": "npm/bin/smart-search.js"
16
- },
17
- "files": [
18
- "npm/",
19
- "skills/smart-search-cli/**",
20
- "src/smart_search/**/*.py",
21
- "src/smart_search/assets/skills/smart-search-cli/**",
22
- "pyproject.toml",
23
- "README.md",
24
- "README.zh-CN.md",
25
- "LICENSE"
26
- ],
27
- "scripts": {
28
- "postinstall": "node npm/scripts/postinstall.js",
29
- "test": "node npm/scripts/test.js",
30
- "set-version": "node npm/scripts/set-package-version.js",
31
- "sync:python-version": "node npm/scripts/sync-python-version.js",
32
- "version": "node npm/scripts/sync-python-version.js && git add pyproject.toml package.json package-lock.json",
33
- "pack:dry": "npm pack --dry-run",
34
- "publish:dry": "npm publish --dry-run --access public"
35
- },
36
- "engines": {
37
- "node": ">=18"
38
- },
39
- "publishConfig": {
40
- "access": "public"
41
- }
42
- }
@@ -1,37 +0,0 @@
1
- [build-system]
2
- requires = ["setuptools>=61.0"]
3
- build-backend = "setuptools.build_meta"
4
-
5
- [project]
6
- name = "smart-search"
7
- version = "0.1.14"
8
- description = "CLI-first bilingual web research with OpenAI-compatible search, Exa, Context7, Tavily, Firecrawl, and staged Deep Research execution."
9
- readme = "README.md"
10
- requires-python = ">=3.10"
11
- dependencies = [
12
- "httpx[socks]>=0.28.0",
13
- "InquirerPy>=0.3.4,<0.4",
14
- "pyfiglet>=1.0,<2",
15
- "rich>=13.9,<16",
16
- "tenacity>=8.0.0",
17
- ]
18
-
19
- [project.optional-dependencies]
20
- dev = [
21
- "pytest>=8.0.0",
22
- "pytest-asyncio>=0.23.0",
23
- ]
24
-
25
- [tool.setuptools.packages.find]
26
- where = ["src"]
27
-
28
- [tool.setuptools.package-data]
29
- smart_search = [
30
- "assets/skills/smart-search-cli/SKILL.md",
31
- "assets/skills/smart-search-cli/agents/*.yaml",
32
- "assets/skills/smart-search-cli/examples/*.md",
33
- "assets/skills/smart-search-cli/references/*.md",
34
- ]
35
-
36
- [project.scripts]
37
- smart-search = "smart_search.cli:main"