orquesta-cli 0.2.33 → 0.2.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.
@@ -551,7 +551,8 @@ ${executorLines}
551
551
  if (sub === 'status') {
552
552
  if (!binding)
553
553
  return reply('🔌 Claude Code hook: not enabled in this directory.\nEnable it with /hook enable.');
554
- const name = oc?.projectId === binding.projectId && oc?.projectName ? oc.projectName : binding.projectId;
554
+ const name = binding.projectName
555
+ || (oc?.projectId === binding.projectId && oc?.projectName ? oc.projectName : binding.projectId);
555
556
  return reply(`🟢 Claude Code hook: enabled here → streaming into ${name}\n Project ID: ${binding.projectId}\n Disable with /hook disable.`);
556
557
  }
557
558
  if (sub === 'disable') {
@@ -570,6 +571,7 @@ ${executorLines}
570
571
  }
571
572
  const ok = writeHookFiles({
572
573
  projectId: oc.projectId,
574
+ projectName: oc.projectName,
573
575
  token: oc.token,
574
576
  apiUrl: binding?.apiUrl || 'https://getorquesta.com',
575
577
  quiet: true,
@@ -1,6 +1,7 @@
1
1
  export declare function initHooks(token: string, apiUrl?: string, preferredProjectId?: string): Promise<void>;
2
2
  export declare function writeHookFiles(opts: {
3
3
  projectId: string;
4
+ projectName?: string;
4
5
  token: string;
5
6
  apiUrl: string;
6
7
  cwd?: string;
@@ -9,6 +10,7 @@ export declare function writeHookFiles(opts: {
9
10
  }): boolean;
10
11
  export declare function readHookConfig(cwd?: string): {
11
12
  projectId: string;
13
+ projectName?: string;
12
14
  apiUrl?: string;
13
15
  } | null;
14
16
  export declare function disableHooks(cwd?: string, opts?: {
@@ -94,7 +94,7 @@ export async function initHooks(token, apiUrl = 'https://getorquesta.com', prefe
94
94
  process.exit(1);
95
95
  }
96
96
  const chosen = await resolveTargetProject(projects, preferredProjectId);
97
- writeHookFiles({ projectId: chosen.id, token, apiUrl, agentBin });
97
+ writeHookFiles({ projectId: chosen.id, projectName: chosen.name, token, apiUrl, agentBin });
98
98
  console.log(`
99
99
  Done! "${chosen.name}" is wired to this directory.
100
100
  Run \`claude\` here and every session streams into Orquesta automatically.
@@ -108,7 +108,7 @@ export function writeHookFiles(opts) {
108
108
  console.log(m); };
109
109
  try {
110
110
  const agentBin = opts.agentBin ?? resolveAgentBin();
111
- fs.writeFileSync(path.join(cwd, '.orquesta.json'), JSON.stringify({ projectId: opts.projectId, token: opts.token, apiUrl: opts.apiUrl }, null, 2) + '\n');
111
+ fs.writeFileSync(path.join(cwd, '.orquesta.json'), JSON.stringify({ projectId: opts.projectId, ...(opts.projectName ? { projectName: opts.projectName } : {}), token: opts.token, apiUrl: opts.apiUrl }, null, 2) + '\n');
112
112
  log(' Created .orquesta.json');
113
113
  const gitignorePath = path.join(cwd, '.gitignore');
114
114
  const entry = '.orquesta.json';
@@ -164,7 +164,7 @@ export function readHookConfig(cwd = process.cwd()) {
164
164
  const data = JSON.parse(fs.readFileSync(p, 'utf8'));
165
165
  if (!data.projectId)
166
166
  return null;
167
- return { projectId: data.projectId, apiUrl: data.apiUrl };
167
+ return { projectId: data.projectId, projectName: data.projectName, apiUrl: data.apiUrl };
168
168
  }
169
169
  catch {
170
170
  return null;
@@ -94,9 +94,9 @@ export const PlanExecuteApp = ({ llmClient: initialLlmClient, modelInfo }) => {
94
94
  if (!cfg)
95
95
  return null;
96
96
  const oc = configManager.getOrquestaConfig();
97
- const name = oc?.projectId === cfg.projectId && oc?.projectName
98
- ? oc.projectName
99
- : cfg.projectId.slice(0, 8);
97
+ const name = cfg.projectName
98
+ || (oc?.projectId === cfg.projectId && oc?.projectName ? oc.projectName : null)
99
+ || cfg.projectId.slice(0, 8);
100
100
  return { projectName: name };
101
101
  }, []);
102
102
  const [messages, setMessages] = useState([]);
@@ -882,6 +882,23 @@ export const PlanExecuteApp = ({ llmClient: initialLlmClient, modelInfo }) => {
882
882
  };
883
883
  const result = await executeSlashCommand(userMessage, commandContext);
884
884
  if (result.handled) {
885
+ const cmdWord = userMessage.trim().split(/\s+/)[0];
886
+ if (cmdWord === '/login' || cmdWord === '/sync') {
887
+ try {
888
+ if (configManager.hasEndpoints()) {
889
+ const newClient = createLLMClient();
890
+ setLlmClient(newClient);
891
+ const ep = configManager.getCurrentEndpoint();
892
+ const m = configManager.getCurrentModel();
893
+ if (ep && m)
894
+ setCurrentModelInfo({ model: m.name, endpoint: ep.baseUrl });
895
+ logger.debug('LLMClient rebuilt after auth/config change', { cmd: cmdWord });
896
+ }
897
+ }
898
+ catch (error) {
899
+ logger.error('Failed to rebuild LLMClient after auth change', error);
900
+ }
901
+ }
885
902
  if (result.updatedContext?.messages) {
886
903
  const lastMessage = result.updatedContext.messages[result.updatedContext.messages.length - 1];
887
904
  if (lastMessage && lastMessage.role === 'assistant') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orquesta-cli",
3
- "version": "0.2.33",
3
+ "version": "0.2.35",
4
4
  "description": "Orquesta CLI - AI-powered coding assistant with team collaboration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",