@mndrk/agx 1.4.34 → 1.4.35
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/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/BUILD_ID +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/app-build-manifest.json +47 -47
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/app-path-routes-manifest.json +9 -9
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/build-manifest.json +2 -2
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/prerender-manifest.json +22 -22
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/_not-found.html +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/_not-found.rsc +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/audit/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/auth/[...nextauth]/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/auth/daemon-secret/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/auth/device/code/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/auth/device/token/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/auth/refresh/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/domains/[id]/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/domains/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/learnings/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/logs/stream/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/orchestrator/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/orchestrator/tasks/[taskId]/signal/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/orchestrator/tasks/[taskId]/start/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/orchestrator/tasks/[taskId]/status/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/projects/[id]/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/queue/complete/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/queue/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/stage-prompts/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/comments/[commentId]/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/comments/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/heartbeat/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/history/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/logs/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/stream/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/user-settings/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/workflows/[id]/nodes/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/workflows/[id]/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/workflows/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/auth/callback/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/auth/device/page.js +5 -5
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/auth/device/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/auth/device.html +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/auth/device.rsc +2 -2
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/dashboard/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/dashboard.html +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/dashboard.rsc +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/index.html +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/index.rsc +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/login.html +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/login.rsc +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/[slug]/tasks/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/[slug]/workflow/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects.html +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects.rsc +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/settings.html +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/settings.rsc +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app-paths-manifest.json +9 -9
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/chunks/1240.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/chunks/6317.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/functions-config-manifest.json +2 -2
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/middleware-manifest.json +5 -5
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/pages/404.html +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/pages/500.html +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/server-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/server-reference-manifest.json +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/auth/device/page-89af167d1fe0348d.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/fallback/amp.js +1015 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/fallback/main-app.js +1893 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/fallback/main.js +1616 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/fallback/pages/_app.js +28 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/fallback/pages/_error.js +28 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/fallback/react-refresh.js +62 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/fallback/webpack.js +1368 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/polyfills.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/worker/index.js +1 -1
- package/lib/cli/cloudArtifacts.js +29 -23
- package/lib/cli/runCli.js +99 -28
- package/lib/prompts/cloudTask.js +144 -18
- package/package.json +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/auth/device/page-af9fda9ec7668e77.js +0 -1
- /package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/{D_7sZpASpEwgzK6REgmIt → _sQ7ofTHOJaquTtqRSH9B}/_buildManifest.js +0 -0
- /package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/{D_7sZpASpEwgzK6REgmIt → _sQ7ofTHOJaquTtqRSH9B}/_ssgManifest.js +0 -0
package/lib/prompts/cloudTask.js
CHANGED
|
@@ -59,7 +59,8 @@ function buildContinueCloudTaskPrompt({
|
|
|
59
59
|
const planDir = typeof runContext?.plan_dir === 'string' ? runContext.plan_dir.trim() : '';
|
|
60
60
|
const artifactsDir = typeof runContext?.artifacts_dir === 'string' ? runContext.artifacts_dir.trim() : '';
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
const hasTaskPrompt = typeof task?.prompt === 'string' && task.prompt.trim();
|
|
63
|
+
let augmentedPrompt = hasTaskPrompt ? task.prompt.trim() : `## Cloud Task Context
|
|
63
64
|
|
|
64
65
|
You are continuing a cloud task. Here is the current state:
|
|
65
66
|
|
|
@@ -88,31 +89,77 @@ Learnings: ${learnings || '(none)'}
|
|
|
88
89
|
|
|
89
90
|
`;
|
|
90
91
|
|
|
91
|
-
if (!
|
|
92
|
+
if (!hasTaskPrompt && task?.engine) {
|
|
92
93
|
augmentedPrompt += `Engine: ${task.engine}\n`;
|
|
93
94
|
}
|
|
94
95
|
|
|
95
|
-
augmentedPrompt +=
|
|
96
|
-
|
|
96
|
+
augmentedPrompt += `\n\n${buildLegacyInstructionFooter({
|
|
97
|
+
runContext: { runRoot, planDir, artifactsDir },
|
|
98
|
+
finalPrompt,
|
|
99
|
+
})}`;
|
|
97
100
|
|
|
98
|
-
|
|
99
|
-
|
|
101
|
+
return augmentedPrompt;
|
|
102
|
+
}
|
|
100
103
|
|
|
101
|
-
|
|
104
|
+
function buildCloudTaskPromptFromContext(task) {
|
|
105
|
+
if (!task || typeof task !== 'object') return '';
|
|
102
106
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
- [checkpoint: message] - Save progress checkpoint
|
|
108
|
-
- [learn: insight] - Record a learning
|
|
109
|
-
- [plan: text] - Update plan
|
|
110
|
-
- [todo: text] - Update todo list
|
|
107
|
+
const stagePrompt = task.stage_prompt || task.stagePrompt || '';
|
|
108
|
+
const comments = Array.isArray(task.comments) ? task.comments : [];
|
|
109
|
+
const learnings = task.learnings || { task: [], project: [], global: [] };
|
|
110
|
+
const projectContext = task.project_context || null;
|
|
111
111
|
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
const description = (task.description || extractBodyFromContent(task.content || '')).trim();
|
|
113
|
+
const provider = task.resolved_provider || task.provider || task.engine || 'unspecified';
|
|
114
|
+
const model = task.resolved_model || task.model || '';
|
|
115
|
+
const swarm = task.resolved_swarm ?? task.swarm ?? false;
|
|
116
|
+
const swarmModels = Array.isArray(task.resolved_swarm_models)
|
|
117
|
+
? task.resolved_swarm_models
|
|
118
|
+
: Array.isArray(task.swarm_models)
|
|
119
|
+
? task.swarm_models
|
|
120
|
+
: [];
|
|
114
121
|
|
|
115
|
-
|
|
122
|
+
const metaLines = [
|
|
123
|
+
`Title: ${task.title || 'Untitled'}`,
|
|
124
|
+
`Slug: ${task.slug || 'unspecified'}`,
|
|
125
|
+
`Stage: ${task.stage || 'ideation'}`,
|
|
126
|
+
`Project: ${task.project || 'none'}`,
|
|
127
|
+
`Engine: ${task.engine || provider || 'unspecified'}`,
|
|
128
|
+
`Provider: ${provider}`,
|
|
129
|
+
`Model: ${model}`,
|
|
130
|
+
`Swarm: ${swarm ? 'true' : 'false'}`,
|
|
131
|
+
`Swarm Models: ${swarmModels.length ? swarmModels.map((m) => `${m.provider}:${m.model}`).join(', ') : 'none'}`,
|
|
132
|
+
];
|
|
133
|
+
|
|
134
|
+
const commentLines = comments
|
|
135
|
+
.filter((comment) => isPromptRelevantComment(comment?.content))
|
|
136
|
+
.map((comment) => {
|
|
137
|
+
const when = comment?.created_at ? new Date(comment.created_at).toISOString() : 'unknown-time';
|
|
138
|
+
const author = comment?.author_type === 'agent' ? 'agent' : 'user';
|
|
139
|
+
return `[${when}] (${author}) ${comment?.content || ''}`;
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
const projectSections = projectContext?.project
|
|
143
|
+
? [
|
|
144
|
+
`PROJECT CONTEXT\n${formatProjectMetadata(projectContext.project)}`,
|
|
145
|
+
`REPOSITORY MAP\n${formatRepoLines(projectContext.repos || [])}`,
|
|
146
|
+
`PROJECT LEARNINGS\n${formatList(projectContext.learnings || [], '(none)')}`,
|
|
147
|
+
]
|
|
148
|
+
: [];
|
|
149
|
+
|
|
150
|
+
const sections = [
|
|
151
|
+
stagePrompt ? `STAGE PROMPT\n${stagePrompt}` : null,
|
|
152
|
+
'EXECUTION RULES\n- Do not use AGX MCP tools or AGX MCP servers for this task.\n- Complete work using local edits, shell commands, and allowed HTTP APIs only.',
|
|
153
|
+
`TASK META\n${metaLines.join('\n')}`,
|
|
154
|
+
`TASK\n${description || '(empty)'}`,
|
|
155
|
+
`COMMENTS\n${formatList(commentLines, '(none)')}`,
|
|
156
|
+
...projectSections,
|
|
157
|
+
`LEARNINGS (task)\n${formatList((learnings.task || []).map((l) => l.content || ''), '(none)')}`,
|
|
158
|
+
`LEARNINGS (project)\n${formatList((learnings.project || []).map((l) => l.content || ''), '(none)')}`,
|
|
159
|
+
`LEARNINGS (global)\n${formatList((learnings.global || []).map((l) => l.content || ''), '(none)')}`,
|
|
160
|
+
].filter(Boolean);
|
|
161
|
+
|
|
162
|
+
return sections.join('\n\n');
|
|
116
163
|
}
|
|
117
164
|
|
|
118
165
|
function buildNewAutonomousCloudTaskPrompt({
|
|
@@ -158,4 +205,83 @@ Goal: ${finalPrompt}
|
|
|
158
205
|
module.exports = {
|
|
159
206
|
buildContinueCloudTaskPrompt,
|
|
160
207
|
buildNewAutonomousCloudTaskPrompt,
|
|
208
|
+
buildLegacyInstructionFooter,
|
|
209
|
+
buildCloudTaskPromptFromContext,
|
|
161
210
|
};
|
|
211
|
+
|
|
212
|
+
function buildLegacyInstructionFooter({ runContext, finalPrompt } = {}) {
|
|
213
|
+
const runRoot = typeof runContext?.runRoot === 'string' ? runContext.runRoot.trim() : '';
|
|
214
|
+
const planDir = typeof runContext?.planDir === 'string' ? runContext.planDir.trim() : '';
|
|
215
|
+
const artifactsDir = typeof runContext?.artifactsDir === 'string' ? runContext.artifactsDir.trim() : '';
|
|
216
|
+
|
|
217
|
+
return `## Instructions
|
|
218
|
+
|
|
219
|
+
Continue working on this task. Use the cloud API to sync progress.
|
|
220
|
+
Respect the Stage Completion Requirement before using [complete] or [done].
|
|
221
|
+
|
|
222
|
+
${(runRoot || planDir || artifactsDir) ? `\nLocal run paths (scratch space):\n- Run root: ${runRoot || '(unset)'}\n- Plan dir: ${planDir || '(unset)'}\n- Artifacts dir: ${artifactsDir || '(unset)'}\n\nPrefer writing scratch planning docs under the run's Plan dir to avoid polluting the repo.\n` : ''}
|
|
223
|
+
|
|
224
|
+
To update the task:
|
|
225
|
+
- [done] - Mark task complete
|
|
226
|
+
- [complete: message] - Complete current stage
|
|
227
|
+
- [log: message] - Add a log entry
|
|
228
|
+
- [checkpoint: message] - Save progress checkpoint
|
|
229
|
+
- [learn: insight] - Record a learning
|
|
230
|
+
- [plan: text] - Update plan
|
|
231
|
+
- [todo: text] - Update todo list
|
|
232
|
+
|
|
233
|
+
${finalPrompt ? `Your specific task: ${finalPrompt}` : ''}`.trim();
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function extractBodyFromContent(content) {
|
|
237
|
+
if (!content) return '';
|
|
238
|
+
const match = String(content).match(/^---\n[\s\S]*?\n---\n([\s\S]*)$/);
|
|
239
|
+
return (match ? match[1] : content).trim();
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function isPromptRelevantComment(content) {
|
|
243
|
+
const normalized = String(content || '').trim();
|
|
244
|
+
if (!normalized) return false;
|
|
245
|
+
if (normalized.startsWith('[execution/')) return false;
|
|
246
|
+
if (normalized.startsWith('Execution result from agx')) return false;
|
|
247
|
+
return true;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function formatList(items, emptyLabel) {
|
|
251
|
+
const safe = Array.isArray(items) ? items.filter(Boolean) : [];
|
|
252
|
+
if (!safe.length) return emptyLabel;
|
|
253
|
+
return safe.map((item) => `- ${item}`).join('\n');
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function formatProjectMetadata(project) {
|
|
257
|
+
if (!project) return '(none)';
|
|
258
|
+
const lines = [];
|
|
259
|
+
if (project.name) lines.push(`Name: ${project.name}`);
|
|
260
|
+
if (project.slug) lines.push(`Slug: ${project.slug}`);
|
|
261
|
+
if (project.description) lines.push(`Description: ${project.description}`);
|
|
262
|
+
if (project.ci_cd_info) lines.push(`CI/CD: ${project.ci_cd_info}`);
|
|
263
|
+
if (project.workflow_id) lines.push(`Workflow: ${project.workflow_id}`);
|
|
264
|
+
if (project.metadata && typeof project.metadata === 'object' && !Array.isArray(project.metadata)) {
|
|
265
|
+
const entries = Object.entries(project.metadata);
|
|
266
|
+
if (entries.length) {
|
|
267
|
+
lines.push('Metadata:');
|
|
268
|
+
entries.forEach(([key, value]) => {
|
|
269
|
+
lines.push(`- ${key}: ${value}`);
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return lines.length ? lines.join('\n') : '(none)';
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function formatRepoLines(repos) {
|
|
277
|
+
if (!Array.isArray(repos) || repos.length === 0) return '(none)';
|
|
278
|
+
return repos
|
|
279
|
+
.map((repo) => {
|
|
280
|
+
const parts = [repo?.name || '(unnamed repo)'];
|
|
281
|
+
if (repo?.path) parts.push(`path: ${repo.path}`);
|
|
282
|
+
if (repo?.git_url) parts.push(`git_url: ${repo.git_url}`);
|
|
283
|
+
if (repo?.notes) parts.push(`notes: ${repo.notes}`);
|
|
284
|
+
return `- ${parts.join(' | ')}`;
|
|
285
|
+
})
|
|
286
|
+
.join('\n');
|
|
287
|
+
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8008],{63:(e,t,r)=>{"use strict";var s=r(7260);r.o(s,"usePathname")&&r.d(t,{usePathname:function(){return s.usePathname}}),r.o(s,"useRouter")&&r.d(t,{useRouter:function(){return s.useRouter}}),r.o(s,"useSearchParams")&&r.d(t,{useSearchParams:function(){return s.useSearchParams}})},926:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{callServer:function(){return s.callServer},createServerReference:function(){return c.createServerReference},findSourceMapURL:function(){return n.findSourceMapURL}});let s=r(1209),n=r(5153),c=r(7197)},5109:(e,t,r)=>{Promise.resolve().then(r.bind(r,9053))},9053:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var s=r(5155),n=r(2115),c=r(63),a=r(926);let l=(0,a.createServerReference)("402af22e910eb71e0867f901bdd4e9ceaeb0263b84",a.callServer,void 0,a.findSourceMapURL,"approveDeviceCode");function o(){let e=(0,c.useSearchParams)(),t=(0,c.useRouter)(),r=e.get("user_code")||"",[a,o]=(0,n.useState)(r),[u,i]=(0,n.useState)(!1),[d,f]=(0,n.useState)(null),[x,h]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(x){let e=setTimeout(()=>{t.push("/projects")},3e3);return()=>clearTimeout(e)}},[x,t]);let m=async e=>{e.preventDefault(),i(!0),f(null);try{let e=await l(a);if(!e.success)throw Error(e.error);h(!0)}catch(e){f(e.message)}finally{i(!1)}};return x?(0,s.jsx)("div",{className:"flex flex-col items-center justify-center min-h-screen bg-neutral-900 text-white p-4",children:(0,s.jsxs)("div",{className:"max-w-md w-full bg-neutral-800 p-8 rounded-xl shadow-2xl text-center",children:[(0,s.jsx)("h1",{className:"text-3xl font-bold mb-4 text-green-400",children:"Success!"}),(0,s.jsx)("p",{className:"text-gray-300 mb-2",children:"You have successfully authenticated your device."}),(0,s.jsx)("p",{className:"text-gray-400 text-sm mb-6 italic",children:"Redirecting to projects in a few seconds..."}),(0,s.jsx)("button",{onClick:()=>t.push("/projects"),className:"w-full py-3 px-4 bg-white text-black font-semibold rounded-lg hover:bg-gray-200 transition-colors",children:"Go to Projects"})]})}):(0,s.jsx)("div",{className:"flex flex-col items-center justify-center min-h-screen bg-neutral-900 text-white p-4",children:(0,s.jsxs)("div",{className:"max-w-md w-full bg-neutral-800 p-8 rounded-xl shadow-2xl",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold mb-6 text-center",children:"Connect Device"}),(0,s.jsx)("p",{className:"text-gray-400 mb-8 text-center text-sm",children:"Enter the code displayed on your device to authorize it."}),(0,s.jsxs)("form",{onSubmit:m,className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"code",className:"block text-sm font-medium text-gray-400 mb-2",children:"Device Code"}),(0,s.jsx)("input",{type:"text",id:"code",value:a,onChange:e=>o(e.target.value.toUpperCase()),placeholder:"BCDF-XXXX",className:"w-full px-4 py-3 bg-neutral-900 border border-neutral-700 rounded-lg text-white placeholder-neutral-600 focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono text-center tracking-widest text-lg uppercase",required:!0})]}),d&&(0,s.jsx)("div",{className:"p-3 bg-red-900/50 border border-red-800 rounded-lg text-red-200 text-center text-sm",children:d}),(0,s.jsx)("button",{type:"submit",disabled:u,className:"w-full py-3 px-4 bg-white text-black font-semibold rounded-lg hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-white transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:u?"Verifying...":"Authorize Device"})]})]})})}function u(){return(0,s.jsx)(n.Suspense,{fallback:(0,s.jsx)("div",{children:"Loading..."}),children:(0,s.jsx)(o,{})})}}},e=>{e.O(0,[8441,1255,7358],()=>e(e.s=5109)),_N_E=e.O()}]);
|
|
File without changes
|