agentlas 0.6.0 → 0.7.0

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.
@@ -326,11 +326,16 @@ function startRepl(opts) {
326
326
  : state.subject.system;
327
327
  state.routePreambleOnce = null;
328
328
  const sys = H.augmentSystem(db, subjectSystem, ctx, false);
329
+ // claude(--resume)·codex(resume <thread_id>)만 서버측에서 대화를 이어받아 이전 턴의
330
+ // 시스템 프롬프트를 유지한다(native-host.cjs claudeArgs/codexArgs). gemini CLI는 resume
331
+ // 플래그가 없어 매 턴이 새 프로세스 — session.id로 시스템 프롬프트를 비우면 2턴째부터
332
+ // 페르소나가 통째로 사라진다. 그래서 gemini는 매 턴 시스템 프롬프트를 다시 보낸다.
333
+ const resumesServerSide = rt.kind === "claude-code" || rt.kind === "codex";
329
334
  const res = await runNativeTurn({
330
335
  kind: rt.kind,
331
336
  bin,
332
337
  prompt,
333
- systemPrompt: session.id ? "" : sys,
338
+ systemPrompt: session.id && resumesServerSide ? "" : sys,
334
339
  cwd: state.cwd,
335
340
  permission: state.permission,
336
341
  session,
@@ -492,7 +497,7 @@ function startRepl(opts) {
492
497
  slug: firm.slug,
493
498
  label: displayName(firm) + " CEO",
494
499
  system: sys,
495
- capAgent: { name: firm.name, name_en: firm.name_en || firm.name, tagline: firm.tagline, system_prompt: sys },
500
+ capAgent: { name: firm.name, name_en: firm.name_en || firm.name, tagline: firm.tagline, tagline_en: firm.tagline_en, entity_kind: "team", system_prompt: sys },
496
501
  };
497
502
  state.history = [];
498
503
  state.routePreambleOnce = null;
@@ -778,7 +783,13 @@ function startRepl(opts) {
778
783
  case "build": {
779
784
  if (!arg) return ui.warn("usage: /build <만들고 싶은 에이전트/팀 설명>"), true;
780
785
  ui.line("");
781
- await H.hepRun(["hep-build", arg], { cwd: state.cwd });
786
+ if (typeof H.terminalBuild !== "function") throw new Error("Terminal MCP build preflight is unavailable");
787
+ await H.terminalBuild(db, arg, {
788
+ cwd: state.cwd,
789
+ input: process.stdin,
790
+ promptOutput: process.stderr,
791
+ out: (line) => ui.line(String(line)),
792
+ });
782
793
  return true;
783
794
  }
784
795
  case "route": {
@@ -799,14 +810,6 @@ function startRepl(opts) {
799
810
  else await H.hepRun(["hep-search", arg], { cwd: state.cwd });
800
811
  return true;
801
812
  }
802
- case "install": {
803
- if (!arg) return ui.warn("usage: /install <slug> (/search 로 먼저 찾으세요)"), true;
804
- if (H.cloudInstall) {
805
- try { const r = await H.cloudInstall(db, arg.trim()); ui.ok((r && r.name) ? `설치됨: ${r.name}` : `설치됨: ${arg.trim()}`); }
806
- catch (e) { ui.error((e && e.message) || String(e)); }
807
- } else ui.warn("설치 기능을 사용할 수 없습니다.");
808
- return true;
809
- }
810
813
  case "network":
811
814
  case "taskforce": {
812
815
  if (!arg) return ui.warn("usage: /network <요청> (A2A 태스크포스)"), true;
@@ -1026,11 +1029,16 @@ function startRepl(opts) {
1026
1029
  } else {
1027
1030
  return ui.error(ui.t("noAgent", s.agentSlug)), true;
1028
1031
  }
1029
- if (s.kind && H.RUNTIME_BIN[s.kind] && H.which(H.RUNTIME_BIN[s.kind])) {
1032
+ // 저장된 CLI 런타임이 실제로 설치돼 있을 때만 그 세션을 복원한다. s.kind 없거나
1033
+ // (손상된 resume 레코드) 런타임이 미설치면, 잘못된/"undefined" 키로 native 맵을
1034
+ // 덮어써 현재 세션을 잃는 것을 막고 새 대화로 시작한다.
1035
+ if (s.kind && s.sessionId && H.RUNTIME_BIN[s.kind] && H.which(H.RUNTIME_BIN[s.kind])) {
1030
1036
  state.runtime = { mode: "cli", kind: s.kind };
1031
1037
  baseRuntime = state.runtime;
1038
+ state.native = { [s.kind]: { id: s.sessionId } };
1039
+ } else {
1040
+ state.native = {};
1032
1041
  }
1033
- state.native = { [s.kind]: { id: s.sessionId } };
1034
1042
  try {
1035
1043
  const fs2 = require("node:fs");
1036
1044
  if (s.cwd && fs2.existsSync(s.cwd)) state.cwd = s.cwd;