teamloop 0.1.0 → 0.1.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.
package/README.md CHANGED
@@ -7,11 +7,11 @@ Use the hosted TeamLoop app to create a pairing token, then run the CLI from the
7
7
  ## Quick Start
8
8
 
9
9
  ```bash
10
- npx --yes teamloop doctor --repo . --agent codex
10
+ npx --yes teamloop@latest doctor --repo . --agent codex
11
11
  ```
12
12
 
13
13
  ```bash
14
- npx --yes teamloop connect \
14
+ npx --yes teamloop@latest connect \
15
15
  --url https://teamloop.kangkona.workers.dev \
16
16
  --pair tlp_from_dashboard \
17
17
  --repo . \
@@ -19,7 +19,7 @@ npx --yes teamloop connect \
19
19
  ```
20
20
 
21
21
  ```bash
22
- npx --yes teamloop work \
22
+ npx --yes teamloop@latest work \
23
23
  --url https://teamloop.kangkona.workers.dev \
24
24
  --runner runner_from_connect_output \
25
25
  --repo . \
@@ -33,7 +33,7 @@ npx --yes teamloop work \
33
33
  Use this only after the one-shot path works:
34
34
 
35
35
  ```bash
36
- npx --yes teamloop setup \
36
+ npx --yes teamloop@latest setup \
37
37
  --url https://teamloop.kangkona.workers.dev \
38
38
  --runner runner_from_connect_output \
39
39
  --repo . \
@@ -45,11 +45,11 @@ npx --yes teamloop setup \
45
45
  Lifecycle commands:
46
46
 
47
47
  ```bash
48
- npx --yes teamloop status --repo .
49
- npx --yes teamloop logs --repo .
50
- npx --yes teamloop stop --repo .
51
- npx --yes teamloop start --repo .
52
- npx --yes teamloop uninstall --repo .
48
+ npx --yes teamloop@latest status --repo .
49
+ npx --yes teamloop@latest logs --repo .
50
+ npx --yes teamloop@latest stop --repo .
51
+ npx --yes teamloop@latest start --repo .
52
+ npx --yes teamloop@latest uninstall --repo .
53
53
  ```
54
54
 
55
55
  ## Safety
@@ -71,7 +71,7 @@ async function connect(flags) {
71
71
  console.log(`Workspace ID: ${result.runner.workspaceId}`);
72
72
  console.log("");
73
73
  console.log("Next:");
74
- console.log(` pnpm --dir /Users/mingyoo/repos/teamloop runner:poll -- --url ${baseUrl} --runner ${result.runner.id}`);
74
+ console.log(` npx --yes teamloop@latest poll --url ${baseUrl} --runner ${result.runner.id} --repo ${JSON.stringify(repoPath)}`);
75
75
  }
76
76
 
77
77
  async function poll(flags) {
@@ -101,8 +101,8 @@ async function poll(flags) {
101
101
  console.log(`Saved claim: ${claimPath}`);
102
102
  console.log("");
103
103
  console.log("Next:");
104
- console.log(` pnpm --dir ${repoPath} runner:evidence -- --claim ${claimPath} --kind test --status pass --title "Verification" --summary "Describe the passing check"`);
105
- console.log(` pnpm --dir ${repoPath} runner:complete -- --claim ${claimPath} --summary "Describe what changed"`);
104
+ console.log(` npx --yes teamloop@latest evidence --claim ${JSON.stringify(claimPath)} --kind test --status pass --title "Verification" --summary "Describe the passing check"`);
105
+ console.log(` npx --yes teamloop@latest complete --claim ${JSON.stringify(claimPath)} --summary "Describe what changed"`);
106
106
  }
107
107
 
108
108
  async function work(flags) {
@@ -354,6 +354,8 @@ async function workOnce(context) {
354
354
  let finalStatus = "success";
355
355
  let failureCode;
356
356
  let errorType;
357
+ let failureReason;
358
+ let latestLogRef;
357
359
  let completionSummary = "Runner completed the task and attached evidence.";
358
360
 
359
361
  try {
@@ -369,6 +371,7 @@ async function workOnce(context) {
369
371
  logParts.push(formatCommandLog("agent", agentResult));
370
372
 
371
373
  const agentLogRef = writeWorkLog(repoPath, claim.runId, logParts.join("\n\n"));
374
+ latestLogRef = agentLogRef;
372
375
  await postEvidence(baseUrl, proxy, claim, {
373
376
  kind: "agent_message",
374
377
  status: agentResult.ok ? "info" : "fail",
@@ -381,12 +384,14 @@ async function workOnce(context) {
381
384
  finalStatus = "failed";
382
385
  failureCode = agentResult.failureCode ?? "result_missing";
383
386
  errorType = agentResult.timedOut ? "timeout" : "agent";
387
+ failureReason = `${agentLabel(agentKind)} failed: ${summarizeAgentResult(agentResult)}`;
384
388
  completionSummary = `${agentLabel(agentKind)} did not complete successfully. Evidence and logs are attached.`;
385
389
  }
386
390
 
387
391
  const diffResult = await collectDiff(repoPath);
388
392
  logParts.push(formatCommandLog("diff", diffResult));
389
393
  const diffLogRef = writeWorkLog(repoPath, claim.runId, logParts.join("\n\n"));
394
+ latestLogRef = diffLogRef;
390
395
  await postEvidence(baseUrl, proxy, claim, {
391
396
  kind: "diff",
392
397
  status: diffResult.summary.includes("No git diff") ? "warning" : "info",
@@ -399,6 +404,7 @@ async function workOnce(context) {
399
404
  for (const check of checks) {
400
405
  logParts.push(formatCommandLog(check.title, check.result));
401
406
  const checkLogRef = writeWorkLog(repoPath, claim.runId, logParts.join("\n\n"));
407
+ latestLogRef = checkLogRef;
402
408
  await postEvidence(baseUrl, proxy, claim, {
403
409
  kind: check.kind,
404
410
  status: check.result.ok ? "pass" : "fail",
@@ -411,6 +417,7 @@ async function workOnce(context) {
411
417
  if (checks.length === 0 && finalStatus === "success") {
412
418
  finalStatus = "partial_success";
413
419
  failureCode = "missing_evidence";
420
+ failureReason = "No verification command was configured or detected.";
414
421
  completionSummary = "Runner finished the agent pass, but no verification command was configured or detected.";
415
422
  await postEvidence(baseUrl, proxy, claim, {
416
423
  kind: "test",
@@ -422,6 +429,8 @@ async function workOnce(context) {
422
429
  finalStatus = "failed";
423
430
  failureCode = "test_failed";
424
431
  errorType = "internal";
432
+ const failingChecks = checks.filter((check) => !check.result.ok);
433
+ failureReason = `Verification failed: ${failingChecks.map((check) => check.title).join(", ")}. ${summarizeCommandResult(failingChecks[0].result)}`;
425
434
  completionSummary = "Runner completed the agent pass, but verification failed. Evidence is attached.";
426
435
  }
427
436
 
@@ -433,6 +442,11 @@ async function workOnce(context) {
433
442
  }, repoPath);
434
443
  clearCurrentWork(workPath);
435
444
  console.log(`Completed task: ${task.title} (${finalStatus})`);
445
+ if (finalStatus !== "success") {
446
+ if (failureCode) console.log(`Failure code: ${failureCode}`);
447
+ if (failureReason) console.log(`Reason: ${truncateText(failureReason, 1000)}`);
448
+ if (latestLogRef) console.log(`Log: ${path.join(repoPath, latestLogRef)}`);
449
+ }
436
450
  return true;
437
451
  } catch (error) {
438
452
  await tryPostFailure(baseUrl, proxy, claim, error, repoPath);
@@ -481,7 +495,9 @@ async function runAgent(agentKind, prompt, repoPath, flags) {
481
495
 
482
496
  if (agentKind === "codex") {
483
497
  if (!commandExists("codex")) return missingAgentResult("codex");
484
- const args = ["exec", "--cd", repoPath, "--full-auto", "-"];
498
+ const args = ["exec", "--cd", repoPath, "--full-auto"];
499
+ if (!isGitWorktree(repoPath)) args.push("--skip-git-repo-check");
500
+ args.push("-");
485
501
  if (flags.model) args.splice(1, 0, "--model", flags.model);
486
502
  return runProcess("codex", args, { cwd: repoPath, timeoutMs, input: prompt });
487
503
  }
@@ -1277,6 +1293,19 @@ function commandExists(command) {
1277
1293
  }
1278
1294
  }
1279
1295
 
1296
+ function isGitWorktree(repoPath) {
1297
+ try {
1298
+ return execFileSync("git", ["rev-parse", "--is-inside-work-tree"], {
1299
+ cwd: repoPath,
1300
+ encoding: "utf8",
1301
+ stdio: ["ignore", "pipe", "ignore"],
1302
+ timeout: 2000
1303
+ }).trim() === "true";
1304
+ } catch {
1305
+ return false;
1306
+ }
1307
+ }
1308
+
1280
1309
  function missingAgentResult(command) {
1281
1310
  return {
1282
1311
  command,
@@ -1575,14 +1604,14 @@ Commands:
1575
1604
  complete Complete the last claimed task and generate readiness.
1576
1605
 
1577
1606
  Examples:
1578
- pnpm --dir /Users/mingyoo/repos/teamloop runner:connect -- --pair tlp_xxx
1579
- pnpm --dir /Users/mingyoo/repos/teamloop runner:poll -- --runner runner_xxx
1580
- pnpm --dir /Users/mingyoo/repos/teamloop runner:work -- --runner runner_xxx --repo /Users/mingyoo/repos/teamloop --agent codex --once
1581
- pnpm --dir /Users/mingyoo/repos/teamloop runner:setup -- --runner runner_xxx --repo /Users/mingyoo/repos/teamloop --agent codex --test "pnpm test"
1582
- pnpm --dir /Users/mingyoo/repos/teamloop runner:resume -- --repo /Users/mingyoo/repos/teamloop
1583
- pnpm --dir /Users/mingyoo/repos/teamloop runner:doctor -- --repo /Users/mingyoo/repos/teamloop --agent codex
1584
- pnpm --dir /Users/mingyoo/repos/teamloop runner:evidence -- --kind test --status pass --title "Typecheck" --summary "pnpm typecheck passed"
1585
- pnpm --dir /Users/mingyoo/repos/teamloop runner:complete -- --summary "Implementation and verification are attached"
1607
+ npx --yes teamloop@latest connect --pair tlp_xxx --repo .
1608
+ npx --yes teamloop@latest poll --runner runner_xxx --repo .
1609
+ npx --yes teamloop@latest work --runner runner_xxx --repo . --agent codex --once
1610
+ npx --yes teamloop@latest setup --runner runner_xxx --repo . --agent codex --test "pnpm test"
1611
+ npx --yes teamloop@latest resume --repo .
1612
+ npx --yes teamloop@latest doctor --repo . --agent codex
1613
+ npx --yes teamloop@latest evidence --kind test --status pass --title "Typecheck" --summary "pnpm typecheck passed"
1614
+ npx --yes teamloop@latest complete --summary "Implementation and verification are attached"
1586
1615
 
1587
1616
  Options:
1588
1617
  --url TeamLoop URL. Defaults to ${DEFAULT_URL}
package/package.json CHANGED
@@ -1,9 +1,18 @@
1
1
  {
2
2
  "name": "teamloop",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Local TeamLoop runner CLI for connecting Codex and Claude Code to a shared loop-engineering workspace.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
+ "homepage": "https://teamloop.kangkona.workers.dev",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/mingyooagi/teamloop.git",
11
+ "directory": "packages/runner"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/mingyooagi/teamloop/issues"
15
+ },
7
16
  "bin": {
8
17
  "teamloop": "bin/teamloop-runner.mjs",
9
18
  "teamloop-runner": "bin/teamloop-runner.mjs"