p-doom/crowd-code-dataset-0.2 huggingface dataset:
[tab] package.json (json)
{
  "name": "crowd-pilot",
  "displayName": "crowd-pilot-extension",
  "description": "Teaching language models to code like humans.",
  "publisher": "p(doom)",
  "version": "0.0.1",
  "engines": {
    "vscode": "^1.99.3"
  },
  "categories": [
    "Other"
  ],
  "activationEvents": [
    "onStartupFinished"
  ],
  "main": "./out/extension.js",
  "contributes": {
    "commands": [
      {
        "command": "crowd-pilot.testRun",
        "title": "Test Run"
      },
      {
        "command": "crowd-pilot.hideUi",
        "title": "crowd-pilot: Hide Preview"
      },
      {
        "command": "crowd-pilot.sglangTest",
        "title": "crowd-pilot: Test SGLang"
      },
      {
        "command": "crowd-pilot.modelRun",
        "title": "crowd-pilot: Model Plan & Run"
      }
    ],
    "keybindings": [
      {
        "command": "crowd-pilot.testRun",
        "key": "tab",
        "mac": "tab",
        "when": "editorTextFocus || terminalFocus"
      },
      {
        "command": "crowd-pilot.testRun",
        "key": "tab",
        "mac": "tab",
        "when": "inQuickOpen && crowdPilot.uiVisible"
      },
      {
        "command": "crowd-pilot.hideUi",
        "key": "escape",
        "mac": "escape",
        "when": "crowdPilot.uiVisible"
      }
    ]
  },
  "scripts": {
    "vscode:prepublish": "npm run compile",
    "compile": "tsc -p ./",
    "watch": "tsc -watch -p ./",
    "pretest": "npm run compile && npm run lint",
    "lint": "eslint src",
    "test": "vscode-test"
  },
  "devDependencies": {
    "@types/vscode": "^1.105.0",
    "@types/mocha": "^10.0.10",
    "@types/node": "22.x",
    "@typescript-eslint/eslint-plugin": "^8.45.0",
    "@typescript-eslint/parser": "^8.45.0",
    "eslint": "^9.36.0",
    "typescript": "^5.9.3",
    "@vscode/test-cli": "^0.0.11",
    "@vscode/test-electron": "^2.5.2"
  }
}
[content] src/extension.ts (typescript)
	const userPrompt = 'Create a concise demo plan that:
- focuses the active text document
- moves the cursor to (0, 0)
- inserts the line "hello from model\
" at (0, 0)
- focuses the terminal
- runs the command "echo model run"';
[content] src/extension.ts (typescript)
	const systemPrompt = 'Output ONLY a JSON array. No prose, no code fences.
Allowed actions (TypeScript-like schema):
{ kind: \'showTextDocument\' }
{ kind: \'setSelections\', selections: Array<{ start: [number, number], end: [number, number] }> }
{ kind: \'editInsert\', position: [number, number], text: string }
{ kind: \'terminalShow\' }
{ kind: \'terminalSendText\', text: string }
Coordinates are zero-based [line, column].';
[content] src/extension.ts (typescript)
			const portInput = await vscode.window.showInputBox({
				prompt: 'Enter SGLang server port',
				value: '30000'
			});
			if (!portInput) {
				return;
			}
			const port = Number(portInput);
			if (!Number.isFinite(port) || port <= 0) {
				vscode.window.showErrorMessage('Invalid port');
				return;
			}

			const plan = await requestModelActions(port, editor);
[content] src/extension.ts (typescript)
	const doc = editor.document;
	const cursor = editor.selection.active;
	const contextRange = new vscode.Range(new vscode.Position(0, 0), cursor);
	const contextCode = doc.getText(contextRange);
	const maxContextChars = 20000;
	const trimmedContext = contextCode.length > maxContextChars
		? contextCode.slice(contextCode.length - maxContextChars)
		: contextCode;

	const tabbingPrompt = [
		'Suggest the next 1-5 actions to progress the task in VS Code based on the current file context.',
		'Prefer small, safe, and reversible steps. If uncertain, position the cursor at the most relevant location.',
		'',
		`File: ${doc.fileName}`,
		`Language: ${doc.languageId}`,
		`Cursor: (${cursor.line}, ${cursor.character})`,
		'',
		'Context (file content up to the cursor):',
		'```',
		trimmedContext,
		'```'
[content] src/extension.ts (typescript)
	const demoGoal = [
		'Create a concise demo plan that:',
		'- focuses the active text document',
		'- moves the cursor to (0, 0)',
		"- inserts the line \"hello from model\
\" at (0, 0)",
		'- focuses the terminal',
		'- runs the command "echo model run"'
[content] src/extension.ts (typescript)
	const doc = editor.document;
	const cursor = editor.selection.active;
	const contextRange = new vscode.Range(new vscode.Position(0, 0), cursor);
	const contextCode = doc.getText(contextRange);
	const maxContextChars = 20000;
	const trimmedContext = contextCode.length > maxContextChars
		? contextCode.slice(contextCode.length - maxContextChars)
		: contextCode;

	const tabbingPrompt = [
		'Suggest the next 1-5 actions to progress the task in VS Code based on the current file context.',
		'If uncertain, position the cursor at the most relevant location.',
		'',
		`File: ${doc.fileName}`,
		`Language: ${doc.languageId}`,
		`Cursor: (${cursor.line}, ${cursor.character})`,
		'',
		'Context (file content up to the cursor):',
		'```',
		trimmedContext,
		'```'
[content] src/extension.ts (typescript)
		'Coordinates are zero-based [line, column].',
		'',
		'Examples (few-shot):',
		'1) Focus document and move cursor to start of file:',
		'[ { "kind": "showTextDocument" }, { "kind": "setSelections", "selections": [ { "start": [0, 0], "end": [0, 0] } ] } ]',
		'',
		'2) Insert a line at the current cursor position:',
		'[ { "kind": "editInsert", "position": [10, 0], "text": "console.log(\\"Hello\\")\
" } ]',
		'',
		'3) Focus terminal and run a command:',
		'[ { "kind": "terminalShow" }, { "kind": "terminalSendText", "text": "echo run tests" } ]'
[content] src/extension.ts (typescript)
		'Allowed actions (JSON schema-like):',
		'{ kind: "showTextDocument" }',
		'{ kind: "setSelections", selections: Array<{ start: [number, number], end: [number, number] }> }',
		'{ kind: "editInsert", position: [number, number], text: string }',
		'{ kind: "terminalShow" }',
		'{ kind: "terminalSendText", text: string }',
		'Guidelines:',
		'- Prefer small, safe, reversible steps.',
		'- Do not delete or overwrite unrelated content.',
		'- Keep terminal commands non-interactive and safe.',
		'- If uncertain, set a helpful cursor/selection.',
		'- Use double-quoted JSON strings.',