@pixelbyte-software/pixcode 1.55.1 → 1.55.3

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 (172) hide show
  1. package/dist-server/server/modules/tasks/git-worktree.js +98 -0
  2. package/dist-server/server/modules/tasks/git-worktree.js.map +1 -0
  3. package/dist-server/server/modules/tasks/index.js +8 -0
  4. package/dist-server/server/modules/tasks/index.js.map +1 -0
  5. package/dist-server/server/modules/tasks/prompt-builder.js +85 -0
  6. package/dist-server/server/modules/tasks/prompt-builder.js.map +1 -0
  7. package/dist-server/server/modules/tasks/role-presets.js +94 -0
  8. package/dist-server/server/modules/tasks/role-presets.js.map +1 -0
  9. package/dist-server/server/modules/tasks/runners/claude-runner.js +109 -0
  10. package/dist-server/server/modules/tasks/runners/claude-runner.js.map +1 -0
  11. package/dist-server/server/modules/tasks/runners/codex-runner.js +67 -0
  12. package/dist-server/server/modules/tasks/runners/codex-runner.js.map +1 -0
  13. package/dist-server/server/modules/tasks/runners/spawn-runner.js +111 -0
  14. package/dist-server/server/modules/tasks/runners/spawn-runner.js.map +1 -0
  15. package/dist-server/server/modules/tasks/runners/types.js +5 -0
  16. package/dist-server/server/modules/tasks/runners/types.js.map +1 -0
  17. package/dist-server/server/modules/tasks/scheduler.js +69 -0
  18. package/dist-server/server/modules/tasks/scheduler.js.map +1 -0
  19. package/dist-server/server/modules/tasks/task-queue.js +81 -0
  20. package/dist-server/server/modules/tasks/task-queue.js.map +1 -0
  21. package/dist-server/server/modules/tasks/task-routes.js +195 -0
  22. package/dist-server/server/modules/tasks/task-routes.js.map +1 -0
  23. package/dist-server/server/modules/tasks/task-runner.js +187 -0
  24. package/dist-server/server/modules/tasks/task-runner.js.map +1 -0
  25. package/dist-server/server/modules/tasks/task-store.js +196 -0
  26. package/dist-server/server/modules/tasks/task-store.js.map +1 -0
  27. package/dist-server/server/modules/tasks/task-types.js +5 -0
  28. package/dist-server/server/modules/tasks/task-types.js.map +1 -0
  29. package/dist-server/server/modules/tasks/user-interaction.js +73 -0
  30. package/dist-server/server/modules/tasks/user-interaction.js.map +1 -0
  31. package/package.json +1 -1
  32. package/server/modules/tasks/git-worktree.ts +102 -0
  33. package/server/modules/tasks/index.ts +9 -0
  34. package/server/modules/tasks/prompt-builder.ts +98 -0
  35. package/server/modules/tasks/role-presets.ts +113 -0
  36. package/server/modules/tasks/runners/claude-runner.ts +120 -0
  37. package/server/modules/tasks/runners/codex-runner.ts +80 -0
  38. package/server/modules/tasks/runners/spawn-runner.ts +122 -0
  39. package/server/modules/tasks/runners/types.ts +25 -0
  40. package/server/modules/tasks/scheduler.ts +75 -0
  41. package/server/modules/tasks/task-queue.ts +91 -0
  42. package/server/modules/tasks/task-routes.ts +245 -0
  43. package/server/modules/tasks/task-runner.ts +219 -0
  44. package/server/modules/tasks/task-store.ts +223 -0
  45. package/server/modules/tasks/task-types.ts +100 -0
  46. package/server/modules/tasks/user-interaction.ts +93 -0
  47. package/server/routes/auth.js +13 -6
  48. package/dist/api-automation.html +0 -110
  49. package/dist/api-docs.html +0 -548
  50. package/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  51. package/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  52. package/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  53. package/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  54. package/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  55. package/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  56. package/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  57. package/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  58. package/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  59. package/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  60. package/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  61. package/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  62. package/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  63. package/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  64. package/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  65. package/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  66. package/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  67. package/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  68. package/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  69. package/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  70. package/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  71. package/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  72. package/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  73. package/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  74. package/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  75. package/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  76. package/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  77. package/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  78. package/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  79. package/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  80. package/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  81. package/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  82. package/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  83. package/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  84. package/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  85. package/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  86. package/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  87. package/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  88. package/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  89. package/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  90. package/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  91. package/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  92. package/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  93. package/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  94. package/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  95. package/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  96. package/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  97. package/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  98. package/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  99. package/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  100. package/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  101. package/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  102. package/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  103. package/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  104. package/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  105. package/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  106. package/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  107. package/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  108. package/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  109. package/dist/assets/index-B-ySsQqi.js +0 -877
  110. package/dist/assets/index-CWO38aJI.css +0 -32
  111. package/dist/assets/index-ak1p_4ew.js +0 -11
  112. package/dist/assets/localMonaco-DFIbtDNp.js +0 -1
  113. package/dist/assets/vendor-codemirror-CIYNS698.js +0 -41
  114. package/dist/assets/vendor-react-DB6V5Fl1.js +0 -59
  115. package/dist/assets/vendor-xterm-C7tpxJl7.js +0 -9
  116. package/dist/clear-cache.html +0 -85
  117. package/dist/convert-icons.md +0 -53
  118. package/dist/docs.html +0 -308
  119. package/dist/favicon.png +0 -0
  120. package/dist/favicon.svg +0 -8
  121. package/dist/features.html +0 -133
  122. package/dist/generate-icons.js +0 -49
  123. package/dist/humans.txt +0 -15
  124. package/dist/icons/claude-ai-icon.svg +0 -1
  125. package/dist/icons/codex-white.svg +0 -3
  126. package/dist/icons/codex.svg +0 -3
  127. package/dist/icons/cursor-white.svg +0 -12
  128. package/dist/icons/cursor.svg +0 -1
  129. package/dist/icons/gemini-ai-icon.svg +0 -1
  130. package/dist/icons/icon-128x128.png +0 -0
  131. package/dist/icons/icon-128x128.svg +0 -9
  132. package/dist/icons/icon-144x144.png +0 -0
  133. package/dist/icons/icon-144x144.svg +0 -9
  134. package/dist/icons/icon-152x152.png +0 -0
  135. package/dist/icons/icon-152x152.svg +0 -9
  136. package/dist/icons/icon-192x192.png +0 -0
  137. package/dist/icons/icon-192x192.svg +0 -9
  138. package/dist/icons/icon-384x384.png +0 -0
  139. package/dist/icons/icon-384x384.svg +0 -9
  140. package/dist/icons/icon-512x512.png +0 -0
  141. package/dist/icons/icon-512x512.svg +0 -9
  142. package/dist/icons/icon-72x72.png +0 -0
  143. package/dist/icons/icon-72x72.svg +0 -9
  144. package/dist/icons/icon-96x96.png +0 -0
  145. package/dist/icons/icon-96x96.svg +0 -9
  146. package/dist/icons/icon-template.svg +0 -9
  147. package/dist/icons/opencode-logo-dark.svg +0 -1
  148. package/dist/icons/opencode-logo-light.svg +0 -1
  149. package/dist/icons/qwen-ai-icon.png +0 -0
  150. package/dist/icons/qwen-logo.svg +0 -15
  151. package/dist/index.html +0 -62
  152. package/dist/landing.html +0 -268
  153. package/dist/llms-full.txt +0 -119
  154. package/dist/llms.txt +0 -53
  155. package/dist/logo-128.png +0 -0
  156. package/dist/logo-256.png +0 -0
  157. package/dist/logo-32.png +0 -0
  158. package/dist/logo-512.png +0 -0
  159. package/dist/logo-64.png +0 -0
  160. package/dist/logo.png +0 -0
  161. package/dist/logo.svg +0 -12
  162. package/dist/manifest.json +0 -61
  163. package/dist/openapi.yaml +0 -1696
  164. package/dist/orchestration.html +0 -125
  165. package/dist/robots.txt +0 -4
  166. package/dist/screenshots/cli-selection.png +0 -0
  167. package/dist/screenshots/desktop-main.png +0 -0
  168. package/dist/screenshots/mobile-chat.png +0 -0
  169. package/dist/screenshots/tools-modal.png +0 -0
  170. package/dist/site.css +0 -692
  171. package/dist/sitemap.xml +0 -51
  172. package/dist/sw.js +0 -132
@@ -0,0 +1,100 @@
1
+ // ============================================================
2
+ // Task Types — Core type definitions for the task system
3
+ // ============================================================
4
+
5
+ export type TaskStatus =
6
+ | 'PENDING' // Created but waiting for predecessor or queue slot
7
+ | 'QUEUED' // Ready to run, waiting for scheduler
8
+ | 'RUNNING' // Agent is executing
9
+ | 'AWAITING_INPUT' // Agent asked a question, waiting for user
10
+ | 'COMPLETED' // Finished successfully
11
+ | 'FAILED' // Finished with error
12
+ | 'CANCELLED'; // User cancelled
13
+
14
+ export type AgentType = 'claude-code' | 'codex' | 'gemini' | 'qwen' | 'opencode';
15
+
16
+ export type TaskRole = 'backend' | 'frontend' | 'fullstack' | 'reviewer' | 'tester' | 'custom';
17
+
18
+ export type TaskPriority = 'low' | 'normal' | 'high' | 'urgent';
19
+
20
+ export interface TaskInteraction {
21
+ id: string;
22
+ taskId: string;
23
+ question: string;
24
+ options?: string[];
25
+ answer?: string;
26
+ status: 'pending' | 'answered' | 'timeout';
27
+ createdAt: string;
28
+ answeredAt?: string;
29
+ }
30
+
31
+ export interface TaskLog {
32
+ id: string;
33
+ taskId: string;
34
+ level: 'info' | 'warn' | 'error' | 'debug';
35
+ message: string;
36
+ timestamp: string;
37
+ }
38
+
39
+ export interface Task {
40
+ id: string;
41
+ projectId: string;
42
+ title: string;
43
+ prompt: string;
44
+ status: TaskStatus;
45
+ agentType: AgentType;
46
+ model?: string;
47
+ role: TaskRole;
48
+ priority: TaskPriority;
49
+
50
+ // Dependency chain — predecessor must complete before this starts
51
+ predecessorTaskId?: string;
52
+ continueSession?: boolean; // Continue predecessor's session
53
+ sessionId?: string; // Session ID from agent (for continuation)
54
+
55
+ // Budget
56
+ maxBudgetUsd?: number;
57
+ costUsd?: number;
58
+ tokenCount?: { input: number; output: number };
59
+
60
+ // Git worktree
61
+ branchName?: string;
62
+ worktreePath?: string;
63
+
64
+ // Result
65
+ result?: string;
66
+ summary?: string;
67
+ changedFiles?: string[];
68
+
69
+ // Timestamps
70
+ createdAt: string;
71
+ startedAt?: string;
72
+ completedAt?: string;
73
+
74
+ // Metadata
75
+ interactionTimeout?: number; // ms, default 300000 (5 min)
76
+ thinkingEnabled?: boolean;
77
+ permissionMode?: string;
78
+ }
79
+
80
+ export interface CreateTaskInput {
81
+ projectId: string;
82
+ title: string;
83
+ prompt: string;
84
+ agentType: AgentType;
85
+ model?: string;
86
+ role?: TaskRole;
87
+ priority?: TaskPriority;
88
+ predecessorTaskId?: string;
89
+ continueSession?: boolean;
90
+ maxBudgetUsd?: number;
91
+ interactionTimeout?: number;
92
+ thinkingEnabled?: boolean;
93
+ permissionMode?: string;
94
+ }
95
+
96
+ export interface DispatchTaskInput {
97
+ agentType: AgentType;
98
+ model?: string;
99
+ permissionMode?: string;
100
+ }
@@ -0,0 +1,93 @@
1
+ // ============================================================
2
+ // User Interaction — Agent asks questions, user responds via UI
3
+ // ============================================================
4
+
5
+ import { EventEmitter } from 'node:events';
6
+
7
+ import { createInteraction, answerInteraction, getPendingInteractions, timeoutInteraction, addLog } from './task-store.js';
8
+
9
+ // Event bus for WebSocket notifications
10
+ export const interactionEvents = new EventEmitter();
11
+
12
+ // Pending interaction promises — keyed by interaction ID
13
+ const pendingResolvers = new Map<string, { resolve: (answer: string) => void; reject: (err: Error) => void; timer: NodeJS.Timeout }>();
14
+
15
+ /**
16
+ * Create a question for the user and wait for the answer.
17
+ * Called by agent runners when the agent needs user input.
18
+ */
19
+ export function askUser(
20
+ taskId: string,
21
+ question: string,
22
+ options?: string[],
23
+ timeoutMs = 300_000,
24
+ ): Promise<string> {
25
+ return new Promise((resolve, reject) => {
26
+ const interaction = createInteraction(taskId, question, options);
27
+
28
+ // Emit event for WebSocket broadcast
29
+ interactionEvents.emit('interaction:created', {
30
+ taskId,
31
+ interactionId: interaction.id,
32
+ question,
33
+ options,
34
+ });
35
+
36
+ addLog(taskId, 'info', `Agent asked: "${question.slice(0, 100)}"`);
37
+
38
+ // Set timeout
39
+ const timer = setTimeout(() => {
40
+ timeoutInteraction(interaction.id);
41
+ pendingResolvers.delete(interaction.id);
42
+ addLog(taskId, 'warn', `Interaction timed out: "${question.slice(0, 60)}"`);
43
+ resolve('[TIMEOUT] No response from user');
44
+ }, timeoutMs);
45
+
46
+ pendingResolvers.set(interaction.id, { resolve, reject, timer });
47
+ });
48
+ }
49
+
50
+ /**
51
+ * Called when user answers a question via the UI.
52
+ */
53
+ export function submitAnswer(interactionId: string, answer: string): boolean {
54
+ const pending = pendingResolvers.get(interactionId);
55
+ if (!pending) return false;
56
+
57
+ clearTimeout(pending.timer);
58
+ pendingResolvers.delete(interactionId);
59
+
60
+ // Persist the answer
61
+ answerInteraction(interactionId, answer);
62
+
63
+ // Resolve the promise
64
+ pending.resolve(answer);
65
+
66
+ // Emit event for WebSocket broadcast
67
+ interactionEvents.emit('interaction:answered', { interactionId, answer });
68
+
69
+ return true;
70
+ }
71
+
72
+ /**
73
+ * Get all pending interactions for a task.
74
+ */
75
+ export function getTaskInteractions(taskId: string) {
76
+ return getPendingInteractions(taskId);
77
+ }
78
+
79
+ /**
80
+ * Cancel all pending interactions for a task (e.g. when task is cancelled).
81
+ */
82
+ export function cancelTaskInteractions(taskId: string): void {
83
+ const pending = getPendingInteractions(taskId);
84
+ for (const interaction of pending) {
85
+ const resolver = pendingResolvers.get(interaction.id);
86
+ if (resolver) {
87
+ clearTimeout(resolver.timer);
88
+ pendingResolvers.delete(interaction.id);
89
+ resolver.resolve('[CANCELLED] Task was cancelled');
90
+ }
91
+ timeoutInteraction(interaction.id);
92
+ }
93
+ }
@@ -36,7 +36,7 @@ function publicUser(user) {
36
36
  // Check auth status and setup requirements
37
37
  router.get('/status', async (req, res) => {
38
38
  try {
39
- const hasUsers = await userDb.hasUsers();
39
+ const hasUsers = userDb.hasUsers();
40
40
  res.json({
41
41
  needsSetup: !hasUsers,
42
42
  isAuthenticated: false // Will be overridden by frontend if token exists
@@ -62,16 +62,23 @@ router.put('/connection-mode', async (req, res) => {
62
62
  try {
63
63
  // During first-run setup no users exist yet, so we skip auth.
64
64
  // The setup form calls this endpoint before creating the admin account.
65
- const hasUsers = await userDb.hasUsers();
65
+ const hasUsers = userDb.hasUsers();
66
66
  if (!hasUsers) {
67
67
  return res.json({ success: true, connection: saveRemoteConnectionConfig(req.body || {}) });
68
68
  }
69
69
  // Post-setup: require authenticated admin
70
- authenticateToken(req, res, () => {
71
- requireAdmin(req, res, () => {
72
- res.json({ success: true, connection: saveRemoteConnectionConfig(req.body || {}) });
70
+ // Wrap authenticateToken in a try/catch so that if it sends a response
71
+ // (e.g. 401 when no token is present) we don't double-send.
72
+ try {
73
+ authenticateToken(req, res, () => {
74
+ requireAdmin(req, res, () => {
75
+ res.json({ success: true, connection: saveRemoteConnectionConfig(req.body || {}) });
76
+ });
73
77
  });
74
- });
78
+ } catch (err) {
79
+ // If authenticateToken throws instead of calling next/send, return 401
80
+ res.status(401).json({ error: err.message || 'Authentication required' });
81
+ }
75
82
  } catch (error) {
76
83
  res.status(400).json({ success: false, error: error.message });
77
84
  }
@@ -1,110 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <title>Pixcode API Automation - px_ API Keys, Agent Runs and Workflow Control</title>
7
- <meta
8
- name="description"
9
- content="Use Pixcode API automation with px_ API keys to list projects, run Claude Code, Codex, Cursor CLI, Gemini CLI, Qwen Code, and OpenCode tasks, preview orchestration workflows, start runs, stream events, cancel runs, and integrate Telegram or external tools."
10
- />
11
- <meta
12
- name="keywords"
13
- content="Pixcode API, px API key, AI coding agent API, Codex API automation, Claude Code automation, OpenCode automation, orchestration REST API, self-hosted developer automation, coding agent webhook"
14
- />
15
- <meta name="robots" content="index,follow,max-image-preview:large,max-snippet:-1" />
16
- <link rel="canonical" href="https://alicomert.github.io/pixcode/api-automation.html" />
17
- <link rel="icon" href="favicon.png" />
18
- <link rel="stylesheet" href="site.css" />
19
- </head>
20
- <body>
21
- <nav class="site-nav" aria-label="Main navigation">
22
- <a class="brand" href="landing.html">
23
- <img src="logo.png" alt="" />
24
- <span>Pixcode</span>
25
- </a>
26
- <div class="nav-links">
27
- <a href="docs.html">Documentation</a>
28
- <a href="features.html">Features</a>
29
- <a href="orchestration.html">Orchestration</a>
30
- <a href="api-automation.html">API</a>
31
- <a href="https://github.com/alicomert/pixcode">GitHub</a>
32
- </div>
33
- </nav>
34
-
35
- <header class="hero docs-hero">
36
- <div>
37
- <div class="eyebrow">API automation</div>
38
- <h1>Control Pixcode from scripts, dashboards, CI, and remote tools.</h1>
39
- <p class="lead">
40
- Pixcode exposes REST and WebSocket-powered workflows. Generate a `px_` API key, then trigger provider tasks, inspect projects, preview orchestration, start workflow runs, stream output, and cancel work from external clients.
41
- </p>
42
- </div>
43
- <div class="image-slot">
44
- <span><strong>API dashboard slot</strong>Recommended: 1400 x 1000. Show API keys, OpenAPI docs, and an automation request/result.</span>
45
- </div>
46
- </header>
47
-
48
- <main>
49
- <section class="section">
50
- <h2>Authentication</h2>
51
- <p class="sublead">
52
- New Pixcode API keys start with `px_`. Older `ck_` keys remain accepted for compatibility, but new documentation and examples should use `px_`.
53
- </p>
54
- <div class="grid two">
55
- <div class="code-panel"><pre><code>curl http://localhost:3001/api/projects \
56
- -H "Authorization: Bearer px_your_key_here"</code></pre></div>
57
- <div class="code-panel"><pre><code>curl http://localhost:3001/api/projects \
58
- -H "X-API-Key: px_your_key_here"</code></pre></div>
59
- </div>
60
- </section>
61
-
62
- <section class="section alt">
63
- <h2>Run a one-shot agent task</h2>
64
- <p class="sublead">
65
- `POST /api/agent` is the external REST entry point for non-interactive automation. It can run a provider against a project path, optionally stream events, and optionally return buffered JSON with `stream: false`.
66
- </p>
67
- <div class="code-panel"><pre><code>curl http://localhost:3001/api/agent \
68
- -H "Authorization: Bearer px_your_key_here" \
69
- -H "Content-Type: application/json" \
70
- -d '{
71
- "provider": "codex",
72
- "projectPath": "/home/me/project",
73
- "message": "Review the current diff and list release risks.",
74
- "stream": false
75
- }'</code></pre></div>
76
- </section>
77
-
78
- <section class="section warm">
79
- <h2>Workflow automation</h2>
80
- <p class="sublead">
81
- Orchestration endpoints can list workflow modes, preview expanded DAGs, start runs, read run state, stream events, and cancel active work.
82
- </p>
83
- <div class="grid two">
84
- <div class="card"><strong>Preview</strong><p>Validate agent metadata and inspect the node graph before running child agents.</p></div>
85
- <div class="card"><strong>Run</strong><p>Start the workflow and track node runs, agent task IDs, status, events, and output.</p></div>
86
- <div class="card"><strong>Stream</strong><p>Use run event endpoints to follow progress in dashboards or CLI scripts.</p></div>
87
- <div class="card"><strong>Cancel</strong><p>Stop active orchestration runs when the user changes direction or detects bad output.</p></div>
88
- </div>
89
- </section>
90
-
91
- <section class="section">
92
- <h2>Common integration ideas</h2>
93
- <ul class="feature-list">
94
- <li>Ask Codex or Claude Code to review a Git diff from a CI job before release.</li>
95
- <li>Trigger OpenCode or Gemini CLI from a custom internal dashboard.</li>
96
- <li>Build a Telegram command that starts a Pixcode agent run on an always-on server.</li>
97
- <li>Run multi-agent review on a branch before creating a tag or npm publish.</li>
98
- <li>Expose a safe internal tool that lists projects and starts approved workflows.</li>
99
- </ul>
100
- <p>
101
- Full OpenAPI reference: <a href="openapi.yaml">openapi.yaml</a>.
102
- </p>
103
- </section>
104
- </main>
105
-
106
- <footer class="footer">
107
- <strong>Pixcode API automation</strong> · <a href="docs.html">Documentation</a> · <a href="openapi.yaml">OpenAPI</a> · <a href="llms.txt">llms.txt</a>
108
- </footer>
109
- </body>
110
- </html>