@oooooooooo/ch0de 0.0.0-stage → 1.9.55
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/API-TESTING.md +76 -0
- package/DEBTAUR-INTEGRATION.md +71 -0
- package/EDITING.md +80 -0
- package/EXPERT-PANEL.md +16 -0
- package/INTEGRATIONS.md +75 -0
- package/LICENSE +21 -0
- package/MODELS-DEV-LICENSE +21 -0
- package/PROVIDER-CONNECTIONS.md +48 -0
- package/PROVIDERS.md +17 -0
- package/README.md +523 -2
- package/RELIABILITY.md +95 -0
- package/UX-1.3.md +83 -0
- package/UX-1.4.1.md +13 -0
- package/UX-1.4.md +48 -0
- package/UX-1.5.md +13 -0
- package/UX-1.6.md +7 -0
- package/UX-1.7.3.md +13 -0
- package/UX-1.7.4.md +13 -0
- package/UX-1.7.md +19 -0
- package/acceptance-check.js +27 -0
- package/agent-budget.js +4 -0
- package/api-testing.js +140 -0
- package/automatic-re.js +19 -0
- package/benchmarks/public-baselines.json +29 -0
- package/benchmarks/render-1.4.0.json +8 -0
- package/benchmarks/targets.js +11 -0
- package/browser-check.js +1062 -0
- package/build-progress.js +10 -0
- package/build-quality.js +49 -0
- package/chode.js +7937 -0
- package/debtaur-engine.js +305 -0
- package/debtaur-orchestration.js +456 -0
- package/debtaur-worker.cjs +76 -0
- package/doctor.js +24 -0
- package/edit-transactions.js +79 -0
- package/elapsed.js +28 -0
- package/evidence-ledger.js +26 -0
- package/expert-panel.cjs +42 -0
- package/helios-ledger.js +405 -0
- package/install.cjs +25 -0
- package/integrations.js +30 -0
- package/json-output.js +8 -0
- package/local-memory.js +613 -0
- package/local-models.js +52 -0
- package/mcp-client.js +50 -0
- package/memory.js +511 -0
- package/model-catalog.js +46 -0
- package/native-tools.js +27 -0
- package/nosignups.js +325 -0
- package/observation-progress.js +33 -0
- package/orchestrator.js +299 -0
- package/package.json +158 -6
- package/plan-z6.js +490 -0
- package/project-memory.js +27 -0
- package/provider-capacity.js +13 -0
- package/provider-catalog.js +246 -0
- package/provider-connect.js +66 -0
- package/provider-credentials.js +5 -0
- package/provider-directory.js +8 -0
- package/provider-directory.json +32300 -0
- package/provider-errors.js +11 -0
- package/provider-picker.js +188 -0
- package/provider-policy.js +4 -0
- package/provider-race.js +25 -0
- package/provider-request.js +45 -0
- package/provider-store.js +13 -0
- package/rea-environment.js +5 -0
- package/read-window.js +21 -0
- package/recovery-context.js +3 -0
- package/reliability-memory.js +38 -0
- package/reliability-services.js +34 -0
- package/reliability-store.js +16 -0
- package/request-deadline.js +4 -0
- package/serve-frontend.html +172 -0
- package/settings-reset.js +11 -0
- package/skill-catalog.js +16 -0
- package/task-group.js +22 -0
- package/terminal-graphics.js +39 -0
- package/terminal-logo.js +76 -0
- package/terminal-ui.js +79 -0
- package/tool-call-validation.js +26 -0
- package/tool-health.js +22 -0
- package/tool-history.js +5 -0
- package/toolbox.js +156 -0
- package/tui-provider-picker.js +134 -0
- package/tui-worker.js +32 -0
- package/web-context.js +232 -0
- package/wolfram-math.js +6 -0
- package/worker-transport.js +11 -0
- package/workspace-commands.js +45 -0
- package/workspace-log.js +56 -0
- package/workspace-store.js +7 -0
- package/workspace-tui.js +113 -0
- package/workspace-view.js +109 -0
- package/worktrees.js +18 -0
- package/z6-integration.js +227 -0
package/native-tools.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const schemas={
|
|
3
|
+
skill:{description:'Discover installed skills or read a paged skill reference.',properties:{action:{type:'string',enum:['list']},name:{type:'string'},reference:{type:'string'},offset:{type:'integer',minimum:1},limit:{type:'integer',minimum:1,maximum:200},column:{type:'integer',minimum:0}},required:[]},
|
|
4
|
+
mcp:{description:'Discover trusted MCP servers. Configuration alone is not a working connection.',properties:{action:{type:'string',enum:['list','test','tools','schema']},server:{type:'string'},name:{type:'string'}},required:['action']},
|
|
5
|
+
mcp_call:{description:'Call a trusted external MCP tool; requires user approval. Read the schema first.',properties:{server:{type:'string'},name:{type:'string'},arguments:{type:'object'}},required:['server','name','arguments']},
|
|
6
|
+
read:{description:'Read a workspace file page. Follow nextRead until eof to see remaining content.',properties:{file:{type:'string'},offset:{type:'integer',minimum:1},limit:{type:'integer',minimum:1,maximum:200},column:{type:'integer',minimum:0}},required:['file']},
|
|
7
|
+
write:{description:'Write complete content to a permitted workspace file. Never omit content.',properties:{file:{type:'string'},content:{type:'string'}},required:['file','content']},
|
|
8
|
+
edit:{description:'Replace exact text observed in a workspace file. For whole files use write.',properties:{file:{type:'string'},oldString:{type:'string',minLength:1},newString:{type:'string'},replaceAll:{type:'boolean'}},required:['file','oldString','newString']},
|
|
9
|
+
glob:{description:'Find workspace files by pattern.',properties:{pattern:{type:'string'}},required:['pattern']},
|
|
10
|
+
grep:{description:'Search workspace source text.',properties:{pattern:{type:'string'},dir:{type:'string'}},required:['pattern']},
|
|
11
|
+
exec:{description:'Run a permitted workspace command. Use foreground by default for tests and short commands. Background is for long-running servers/jobs; use the returned job ID verbatim. Starting a job does not prove success.',properties:{cmd:{type:'string'},background:{type:'boolean'}},required:['cmd']}
|
|
12
|
+
};
|
|
13
|
+
function definitions(disallow=[]){return Object.entries(schemas).filter(([name])=>!disallow.includes(name)).map(([name,schema])=>({type:'function',function:{name,description:schema.description,parameters:{type:'object',properties:schema.properties,required:schema.required,additionalProperties:false}}}));}
|
|
14
|
+
function parse(data,allowed){
|
|
15
|
+
const message=data?.choices?.[0]?.message;if(!message)return '';
|
|
16
|
+
const content=typeof message.content==='string'?message.content:'';
|
|
17
|
+
const calls=(Array.isArray(message.tool_calls)?message.tool_calls:[]).slice(0,6),blocks=[];
|
|
18
|
+
for(const call of calls){const name=call?.function?.name;if(!allowed.includes(name))continue;let args={};try{if(typeof call.function.arguments==='string'&&call.function.arguments.length<=300000){const value=JSON.parse(call.function.arguments);if(value&&typeof value==='object'&&!Array.isArray(value))args=value;}}catch{}
|
|
19
|
+
blocks.push('```tool\n'+JSON.stringify({tool:name,args})+'\n```');
|
|
20
|
+
}
|
|
21
|
+
return [content,...blocks].filter(Boolean).join('\n');
|
|
22
|
+
}
|
|
23
|
+
function accumulator(){
|
|
24
|
+
const calls=new Map();let bytes=0;
|
|
25
|
+
return {push(frame){let progress=false;for(const delta of frame?.choices?.[0]?.delta?.tool_calls||[]){const index=delta.index;if(!Number.isInteger(index)||index<0||index>=6)throw Error('Invalid native tool index');let call=calls.get(index);if(!call){call={type:'function',function:{name:'',arguments:''}};calls.set(index,call);}if(delta.function?.name){if(call.function.name&&call.function.name!==delta.function.name)throw Error('Native tool name changed');if(!call.function.name)progress=true;call.function.name=delta.function.name;}if(typeof delta.function?.arguments==='string'&&delta.function.arguments.length){bytes+=Buffer.byteLength(delta.function.arguments);if(bytes>1024*1024)throw Error('Native tool arguments exceed limit');call.function.arguments+=delta.function.arguments;progress=true;}}return progress;},hasCalls:()=>calls.size>0,result:(content,allowed)=>parse({choices:[{message:{content,tool_calls:[...calls.entries()].sort((a,b)=>a[0]-b[0]).map(entry=>entry[1])}}]},allowed)};
|
|
26
|
+
}
|
|
27
|
+
module.exports={definitions,parse,accumulator};
|
package/nosignups.js
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NoSignups Integration
|
|
3
|
+
*
|
|
4
|
+
* Fetches and caches tools from https://nosignups.net
|
|
5
|
+
* Provides no-signup AI/LLM tools for offline use
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const https = require('https');
|
|
11
|
+
|
|
12
|
+
const CACHE_FILE = path.join(process.cwd(), '.chode', 'nosignups-cache.json');
|
|
13
|
+
const REFRESH_INTERVAL = 24 * 60 * 60 * 1000; // 24 hours
|
|
14
|
+
|
|
15
|
+
// No-signup AI tools from NoSignups
|
|
16
|
+
const NO_SIGNUP_TOOLS = {
|
|
17
|
+
webllm: {
|
|
18
|
+
name: 'WebLLM',
|
|
19
|
+
url: 'https://webllm.mlc.ai/',
|
|
20
|
+
description: 'High-performance In-browser LLM Inference Engine',
|
|
21
|
+
category: 'productivity',
|
|
22
|
+
type: 'llm',
|
|
23
|
+
noSignup: true,
|
|
24
|
+
openSource: true
|
|
25
|
+
},
|
|
26
|
+
sipp: {
|
|
27
|
+
name: 'Sipp Chat',
|
|
28
|
+
url: 'https://chat.sipp.sh/',
|
|
29
|
+
description: 'AI inference, packed simply. A blazing-fast, zero-dependency WebGPU runtime',
|
|
30
|
+
category: 'productivity',
|
|
31
|
+
type: 'llm',
|
|
32
|
+
noSignup: true,
|
|
33
|
+
openSource: true
|
|
34
|
+
},
|
|
35
|
+
clearcanvas: {
|
|
36
|
+
name: 'ClearCanvas AI',
|
|
37
|
+
url: 'https://clearcanvasai.vercel.app/',
|
|
38
|
+
description: 'Generate images, compress photos, upscale pictures, and remove backgrounds',
|
|
39
|
+
category: 'media',
|
|
40
|
+
type: 'image',
|
|
41
|
+
noSignup: true,
|
|
42
|
+
openSource: false
|
|
43
|
+
},
|
|
44
|
+
codemap: {
|
|
45
|
+
name: 'CodeMap AI',
|
|
46
|
+
url: 'https://code-map-ai-mu.vercel.app/',
|
|
47
|
+
description: 'Helps developers understand large repositories with AI',
|
|
48
|
+
category: 'development',
|
|
49
|
+
type: 'code',
|
|
50
|
+
noSignup: true,
|
|
51
|
+
openSource: false
|
|
52
|
+
},
|
|
53
|
+
editorpilot: {
|
|
54
|
+
name: 'EditorPilot',
|
|
55
|
+
url: 'https://editorpilot.com/',
|
|
56
|
+
description: 'AI writing assistant that lives entirely in your browser',
|
|
57
|
+
category: 'productivity',
|
|
58
|
+
type: 'writing',
|
|
59
|
+
noSignup: true,
|
|
60
|
+
openSource: false
|
|
61
|
+
},
|
|
62
|
+
mermify: {
|
|
63
|
+
name: 'Mermify',
|
|
64
|
+
url: 'https://tra-sco.github.io/mermify/',
|
|
65
|
+
description: 'Bi-directional visual editor for Mermaid.js flowcharts',
|
|
66
|
+
category: 'development',
|
|
67
|
+
type: 'diagram',
|
|
68
|
+
noSignup: true,
|
|
69
|
+
openSource: true
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// Prompt engineering techniques from Prompt Engineering Guide
|
|
74
|
+
const PROMPT_TECHNIQUES = {
|
|
75
|
+
zeroshot: {
|
|
76
|
+
name: 'Zero-Shot Prompting',
|
|
77
|
+
description: 'Ask the model to perform a task without any examples',
|
|
78
|
+
template: 'Please [TASK].\n\n[CONTEXT]',
|
|
79
|
+
example: 'Please translate the following text to French.\n\nHello, how are you?'
|
|
80
|
+
},
|
|
81
|
+
fewshot: {
|
|
82
|
+
name: 'Few-Shot Prompting',
|
|
83
|
+
description: 'Provide a few examples before the task',
|
|
84
|
+
template: 'Example 1:\nInput: [INPUT_1]\nOutput: [OUTPUT_1]\n\nExample 2:\nInput: [INPUT_2]\nOutput: [OUTPUT_2]\n\nNow do this:\nInput: [INPUT_3]\nOutput:',
|
|
85
|
+
example: 'Convert camelCase to snake_case:\n\ncamelCase -> camel_case\nhelloWorld -> hello_world\n\nWhat is the result of: firstName?'
|
|
86
|
+
},
|
|
87
|
+
cot: {
|
|
88
|
+
name: 'Chain-of-Thought',
|
|
89
|
+
description: 'Ask the model to think step by step',
|
|
90
|
+
template: 'Let\'s think step by step.\n\n[QUESTION]',
|
|
91
|
+
example: 'Let\'s think step by step.\n\nI have 5 apples. I eat 2. How many do I have left?'
|
|
92
|
+
},
|
|
93
|
+
self_consistency: {
|
|
94
|
+
name: 'Self-Consistency',
|
|
95
|
+
description: 'Generate multiple reasoning paths and pick the most consistent answer',
|
|
96
|
+
template: 'Generate 3 different ways to solve: [QUESTION]\n\nThen pick the most consistent answer.',
|
|
97
|
+
example: 'Generate 3 different ways to solve: What is 15% of 200?\n\nThen pick the most consistent answer.'
|
|
98
|
+
},
|
|
99
|
+
prompt_chaining: {
|
|
100
|
+
name: 'Prompt Chaining',
|
|
101
|
+
description: 'Break complex tasks into a chain of simpler prompts',
|
|
102
|
+
template: 'Step 1: [SUBTASK_1]\nStep 2: [SUBTASK_2]\nStep 3: [SUBTASK_3]',
|
|
103
|
+
example: 'Step 1: Extract key points from this article.\nStep 2: Summarize each key point.\nStep 3: Combine into a final summary.'
|
|
104
|
+
},
|
|
105
|
+
tot: {
|
|
106
|
+
name: 'Tree of Thoughts',
|
|
107
|
+
description: 'Explore multiple reasoning paths like a tree',
|
|
108
|
+
template: 'Think about [PROBLEM].\nConsider 3 different approaches:\n1. [APPROACH_1]\n2. [APPROACH_2]\n3. [APPROACH_3]\nWhich is best and why?',
|
|
109
|
+
example: 'Think about optimizing this code.\nConsider 3 different approaches:\n1. Reduce loop iterations\n2. Use memoization\n3. Parallelize work\nWhich is best and why?'
|
|
110
|
+
},
|
|
111
|
+
rag: {
|
|
112
|
+
name: 'Retrieval Augmented Generation',
|
|
113
|
+
description: 'Combine external knowledge with LLM generation',
|
|
114
|
+
template: 'Context:\n[PASSED_CONTEXT]\n\nQuestion: [QUESTION]\n\nAnswer using only the context above.',
|
|
115
|
+
example: 'Context:\nThe capital of France is Paris. The population is approximately 2.1 million.\n\nQuestion: What is the population of France\'s capital?\n\nAnswer using only the context above.'
|
|
116
|
+
},
|
|
117
|
+
react: {
|
|
118
|
+
name: 'ReAct Prompting',
|
|
119
|
+
description: 'Reason and Act in an interleaved manner',
|
|
120
|
+
template: 'Question: [QUESTION]\n\nThought: [REASONING]\nAction: [ACTION]\nObservation: [RESULT]\n...\nFinal Answer: [ANSWER]',
|
|
121
|
+
example: 'Question: What is the weather in Tokyo?\n\nThought: I need to search for current weather in Tokyo.\nAction: search("Tokyo weather")\nObservation: {"temperature": "22°C", "condition": "Sunny"}\nFinal Answer: It\'s 22°C and sunny in Tokyo.'
|
|
122
|
+
},
|
|
123
|
+
pal: {
|
|
124
|
+
name: 'Program-Aided Language Models',
|
|
125
|
+
description: 'Use code to verify mathematical reasoning',
|
|
126
|
+
template: '[MATH_PROBLEM]\n\nLet\'s write code to solve this:\n```python\n# Your code here\n```\n\nRunning the code gives us: [RESULT]',
|
|
127
|
+
example: 'What is the factorial of 5?\n\nLet\'s write code to solve this:\n```python\ndef factorial(n):\n if n <= 1:\n return 1\n return n * factorial(n - 1)\n\nprint(factorial(5))\n```\n\nRunning the code gives us: 120'
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
// Prompt engineering tips
|
|
132
|
+
const PROMPT_TIPS = [
|
|
133
|
+
'Be specific and clear about what you want',
|
|
134
|
+
'Provide context and background information',
|
|
135
|
+
'Use examples (few-shot prompting) for complex tasks',
|
|
136
|
+
'Ask the model to think step by step (chain-of-thought)',
|
|
137
|
+
'Break complex tasks into smaller sub-tasks',
|
|
138
|
+
'Specify the format you want the output in',
|
|
139
|
+
'Use role-playing: "You are an expert [ROLE]..."',
|
|
140
|
+
'Give the model time to "think" before answering',
|
|
141
|
+
'Provide constraints to narrow the search space',
|
|
142
|
+
'Use positive framing: "Do this" instead of "Don\'t do that"'
|
|
143
|
+
];
|
|
144
|
+
|
|
145
|
+
// --- Functions ---
|
|
146
|
+
|
|
147
|
+
function loadCache() {
|
|
148
|
+
try {
|
|
149
|
+
const data = JSON.parse(fs.readFileSync(CACHE_FILE, 'utf8'));
|
|
150
|
+
if (data.fetchedAt && Date.now() - data.fetchedAt < REFRESH_INTERVAL) {
|
|
151
|
+
return data;
|
|
152
|
+
}
|
|
153
|
+
} catch (e) {}
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function saveCache(data) {
|
|
158
|
+
fs.mkdirSync(path.dirname(CACHE_FILE), { recursive: true });
|
|
159
|
+
fs.writeFileSync(CACHE_FILE, JSON.stringify({
|
|
160
|
+
...data,
|
|
161
|
+
fetchedAt: Date.now()
|
|
162
|
+
}));
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
async function fetchNoSignups() {
|
|
166
|
+
return new Promise((resolve, reject) => {
|
|
167
|
+
https.get('https://raw.githubusercontent.com/BraveOPotato/FckSignups/main/tools.json', res => {
|
|
168
|
+
let data = '';
|
|
169
|
+
res.on('data', chunk => data += chunk);
|
|
170
|
+
res.on('end', () => {
|
|
171
|
+
try {
|
|
172
|
+
const parsed = JSON.parse(data);
|
|
173
|
+
resolve(parsed);
|
|
174
|
+
} catch (e) {
|
|
175
|
+
reject(e);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
}).on('error', reject);
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
async function getTools(forceRefresh = false) {
|
|
183
|
+
if (!forceRefresh) {
|
|
184
|
+
const cached = loadCache();
|
|
185
|
+
if (cached) return cached;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
try {
|
|
189
|
+
const data = await fetchNoSignups();
|
|
190
|
+
saveCache(data);
|
|
191
|
+
return data;
|
|
192
|
+
} catch (e) {
|
|
193
|
+
console.error('Failed to fetch NoSignups:', e.message);
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function getAITools(toolsData) {
|
|
199
|
+
if (!toolsData || !toolsData.tools) return Object.values(NO_SIGNUP_TOOLS);
|
|
200
|
+
|
|
201
|
+
const aiKeywords = ['ai', 'llm', 'chat', 'gpt', 'claude', 'gemini', 'ollama', 'stable diffusion', 'image', 'code', 'inference', 'neural', 'machine learning'];
|
|
202
|
+
|
|
203
|
+
return toolsData.tools.filter(t =>
|
|
204
|
+
aiKeywords.some(k => t.name?.toLowerCase().includes(k) || t.description?.toLowerCase().includes(k))
|
|
205
|
+
).slice(0, 20);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function getPromptTechniques() {
|
|
209
|
+
return PROMPT_TECHNIQUES;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function getPromptTips() {
|
|
213
|
+
return PROMPT_TIPS;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function formatPromptTechnique(name, technique) {
|
|
217
|
+
return `
|
|
218
|
+
${technique.name}
|
|
219
|
+
${'═'.repeat(40)}
|
|
220
|
+
Description: ${technique.description}
|
|
221
|
+
|
|
222
|
+
Template:
|
|
223
|
+
\`\`\`
|
|
224
|
+
${technique.template}
|
|
225
|
+
\`\`\`
|
|
226
|
+
|
|
227
|
+
Example:
|
|
228
|
+
\`\`\`
|
|
229
|
+
${technique.example}
|
|
230
|
+
\`\`\`
|
|
231
|
+
`;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function formatNoSignupTool(tool) {
|
|
235
|
+
// The remote dataset only lists no-signup tools, so a missing flag means
|
|
236
|
+
// yes (older cached entries predate the flags). Open source is derived
|
|
237
|
+
// from a repo link or license field when the flag is absent.
|
|
238
|
+
var noS = tool.noSignup !== false;
|
|
239
|
+
var os = tool.openSource || !!tool.github || !!tool.license;
|
|
240
|
+
return `
|
|
241
|
+
${tool.name}
|
|
242
|
+
${'─'.repeat(40)}
|
|
243
|
+
URL: ${tool.url}
|
|
244
|
+
Category: ${tool.category}
|
|
245
|
+
Description: ${tool.description}
|
|
246
|
+
No Signup: ${noS ? '✓' : '✗'}
|
|
247
|
+
Open Source: ${os ? '✓' : '✗'}
|
|
248
|
+
`;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// --- CLI Commands ---
|
|
252
|
+
|
|
253
|
+
async function cmdNoSignups(subcmd) {
|
|
254
|
+
if (subcmd === 'tools' || !subcmd) {
|
|
255
|
+
console.log('\n📦 NoSignups Tools (No account required)\n');
|
|
256
|
+
console.log('═'.repeat(60));
|
|
257
|
+
|
|
258
|
+
const toolsData = await getTools();
|
|
259
|
+
const aiTools = getAITools(toolsData);
|
|
260
|
+
|
|
261
|
+
console.log(`Found ${aiTools.length} AI/LLM tools:\n`);
|
|
262
|
+
|
|
263
|
+
for (const tool of aiTools) {
|
|
264
|
+
console.log(formatNoSignupTool(tool));
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
console.log('\n💡 Use these tools directly in your browser - no signup required!');
|
|
268
|
+
|
|
269
|
+
} else if (subcmd === 'techniques' || subcmd === 'prompts') {
|
|
270
|
+
console.log('\n🧠 Prompt Engineering Techniques\n');
|
|
271
|
+
console.log('═'.repeat(60));
|
|
272
|
+
|
|
273
|
+
const techniques = getPromptTechniques();
|
|
274
|
+
const names = Object.keys(techniques);
|
|
275
|
+
|
|
276
|
+
for (const name of names) {
|
|
277
|
+
console.log(formatPromptTechnique(name, techniques[name]));
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
} else if (subcmd === 'tips') {
|
|
281
|
+
console.log('\n💡 Prompt Engineering Tips\n');
|
|
282
|
+
console.log('═'.repeat(60));
|
|
283
|
+
|
|
284
|
+
const tips = getPromptTips();
|
|
285
|
+
tips.forEach((tip, i) => {
|
|
286
|
+
console.log(`${i + 1}. ${tip}`);
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
} else if (subcmd === 'refresh') {
|
|
290
|
+
console.log('\n🔄 Refreshing NoSignups cache...\n');
|
|
291
|
+
const toolsData = await getTools(true);
|
|
292
|
+
if (toolsData) {
|
|
293
|
+
console.log('✓ Cache refreshed!');
|
|
294
|
+
console.log(` Total tools: ${toolsData.tools?.length || 0}`);
|
|
295
|
+
console.log(` Categories: ${toolsData.categories?.length || 0}`);
|
|
296
|
+
} else {
|
|
297
|
+
console.log('✗ Failed to refresh cache');
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
} else if (subcmd === 'help') {
|
|
301
|
+
console.log(`
|
|
302
|
+
chode nosignups — No-signup tools & prompt engineering
|
|
303
|
+
|
|
304
|
+
Commands:
|
|
305
|
+
chode nosignups List AI/LLM tools (no signup required)
|
|
306
|
+
chode nosignups techniques Show prompt engineering techniques
|
|
307
|
+
chode nosignups tips Show prompt engineering tips
|
|
308
|
+
chode nosignups refresh Refresh the tools cache
|
|
309
|
+
chode nosignups help Show this help
|
|
310
|
+
`);
|
|
311
|
+
|
|
312
|
+
} else {
|
|
313
|
+
console.log('Unknown command: ' + subcmd);
|
|
314
|
+
console.log('Run: chode nosignups help');
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// Export for use in main script
|
|
319
|
+
module.exports = {
|
|
320
|
+
getTools,
|
|
321
|
+
getAITools,
|
|
322
|
+
getPromptTechniques,
|
|
323
|
+
getPromptTips,
|
|
324
|
+
cmdNoSignups
|
|
325
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const {createHash}=require('crypto');
|
|
3
|
+
|
|
4
|
+
// Observe progress only. Never skip a tool, grant permission, or extend a budget.
|
|
5
|
+
function create() {
|
|
6
|
+
const seen=new Map();
|
|
7
|
+
let repeated=0,lastJobs=null,jobsStreak=0;
|
|
8
|
+
return {
|
|
9
|
+
record(call,result) {
|
|
10
|
+
if(result?.ok&&(call.tool==='write'||call.tool==='edit'||call.tool==='multiedit'&&!result.preview&&result.files?.length)) {
|
|
11
|
+
seen.clear();repeated=0;lastJobs=null;jobsStreak=0;return;
|
|
12
|
+
}
|
|
13
|
+
if(call.tool==='jobs'&&result&&result.error==='Unknown background job.') {
|
|
14
|
+
const digest=createHash('sha256').update(JSON.stringify([call.tool,call.args,result.error])).digest('hex');
|
|
15
|
+
if(digest===lastJobs)jobsStreak++;else{lastJobs=digest;jobsStreak=1;}
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
lastJobs=null;jobsStreak=0;
|
|
19
|
+
if(!result?.ok||!['read','grep','glob'].includes(call.tool))return;
|
|
20
|
+
const digest=createHash('sha256').update(JSON.stringify([call.tool,call.args,result])).digest('hex');
|
|
21
|
+
if(seen.has(digest))repeated++;
|
|
22
|
+
seen.set(digest,true);
|
|
23
|
+
if(seen.size>64)seen.delete(seen.keys().next().value);
|
|
24
|
+
},
|
|
25
|
+
guidance() {
|
|
26
|
+
const out=[];
|
|
27
|
+
if(repeated>=2)out.push('\n[OBSERVATION RECOVERY] Identical successful file queries have repeated without an implementation change. Use the source already returned to implement the requested behavior. If a read is incomplete, follow its nextRead rather than requesting the same page. If specific evidence is still missing, make a targeted new query. Preserve existing working behavior and write permissions. If blocked, report the concrete missing information; do not claim completion. [END OBSERVATION RECOVERY]');
|
|
28
|
+
if(jobsStreak>=2)out.push('\n[JOB RECOVERY] The same unknown background job id was polled again with no new result. Call jobs list once and copy an exact returned id, or inspect the original exec result: a foreground command has no background job id and its output is already in the tool results. Do not poll the unknown id again. [END JOB RECOVERY]');
|
|
29
|
+
return out.join('\n');
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
module.exports={create};
|