@agentprojectcontext/apx 1.33.0 → 1.34.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.
- package/package.json +1 -1
- package/skills/apc-context/SKILL.md +2 -5
- package/skills/apx/SKILL.md +49 -61
- package/src/core/agent/a2a/reply.js +48 -0
- package/src/core/agent/build-agent-system.js +4 -3
- package/src/core/agent/channels/voice-context.js +98 -0
- package/src/core/agent/memory.js +2 -1
- package/src/core/agent/prompt-builder.js +2 -1
- package/src/core/agent/prompts/modes/code-build.md +1 -0
- package/src/core/agent/prompts/modes/code-plan.md +1 -0
- package/src/core/agent/prompts/modes/index.js +28 -0
- package/src/core/agent/skills/loader.js +22 -18
- package/src/core/agent/stream/turn-accumulator.js +73 -0
- package/src/core/agent/suggestions.js +37 -0
- package/src/core/agent/tools/handlers/add-project.js +5 -2
- package/src/core/agent/tools/handlers/call-runtime.js +3 -2
- package/src/core/agent/tools/handlers/transcribe-audio.js +1 -1
- package/src/core/agent/tools/helpers.js +2 -2
- package/src/core/agent/tools/names.js +138 -0
- package/src/core/agent/tools/registry-bridge.js +6 -14
- package/src/core/agent/tools/registry.js +68 -65
- package/src/core/apc/context-copy.js +27 -0
- package/src/core/apc/notes.js +19 -0
- package/src/core/apc/parser.js +13 -6
- package/src/core/apc/paths.js +87 -0
- package/src/core/apc/scaffold.js +82 -74
- package/src/core/apc/skill-sync.js +13 -1
- package/src/core/channels/telegram/dispatch.js +595 -0
- package/src/core/channels/telegram/helpers.js +130 -0
- package/src/core/config/index.js +3 -2
- package/src/core/config/redact.js +95 -0
- package/src/core/constants/channels.js +2 -0
- package/src/core/constants/code-modes.js +10 -0
- package/src/core/constants/index.js +1 -0
- package/src/core/deck/manifest.js +186 -0
- package/src/core/engines/catalog.js +83 -0
- package/src/core/engines/gemini.js +28 -11
- package/src/core/engines/index.js +11 -1
- package/src/core/{tools → http-tools}/browser.js +0 -1
- package/src/core/{tools → http-tools}/fetch.js +0 -1
- package/src/core/{tools → http-tools}/glob.js +0 -1
- package/src/core/{tools → http-tools}/grep.js +0 -1
- package/src/core/{tools → http-tools}/registry.js +0 -1
- package/src/core/{tools → http-tools}/search.js +0 -1
- package/src/core/i18n/en.js +9 -0
- package/src/core/i18n/es.js +12 -0
- package/src/core/i18n/index.js +54 -0
- package/src/core/i18n/pt.js +9 -0
- package/src/core/identity/telegram.js +2 -1
- package/src/core/mcp/runner.js +272 -14
- package/src/core/mcp/sources.js +3 -2
- package/src/core/routines/index.js +16 -0
- package/src/{host/daemon/routines.js → core/routines/runner.js} +36 -103
- package/src/core/runtime-skills/apc-context/SKILL.md +159 -0
- package/src/core/runtime-skills/apx/SKILL.md +95 -0
- package/src/core/runtime-skills/apx-mcp/SKILL.md +116 -0
- package/src/core/runtime-skills/{claude-code.md → claude-code/SKILL.md} +1 -0
- package/src/core/runtime-skills/{codex-cli.md → codex-cli/SKILL.md} +1 -0
- package/src/core/runtime-skills/{opencode-cli.md → opencode-cli/SKILL.md} +1 -0
- package/src/core/runtime-skills/{openrouter.md → openrouter/SKILL.md} +1 -0
- package/src/{host/daemon/env-detect.js → core/runtimes/detect.js} +1 -1
- package/src/core/stores/code-sessions.js +50 -2
- package/src/core/stores/routine-memory.js +1 -1
- package/src/core/stores/sessions-search.js +121 -0
- package/src/core/stores/sessions.js +38 -0
- package/src/core/vars/index.js +14 -0
- package/src/core/vars/interpolate.js +86 -0
- package/src/core/vars/sources.js +151 -0
- package/src/core/voice/audio-decode.js +38 -0
- package/src/core/voice/transcription.js +225 -0
- package/src/host/daemon/api/admin-config.js +5 -82
- package/src/host/daemon/api/agents.js +5 -5
- package/src/host/daemon/api/code.js +17 -169
- package/src/host/daemon/api/config.js +3 -4
- package/src/host/daemon/api/conversations.js +8 -29
- package/src/host/daemon/api/deck.js +37 -404
- package/src/host/daemon/api/engines.js +1 -50
- package/src/host/daemon/api/exec.js +1 -1
- package/src/host/daemon/api/mcps.js +32 -0
- package/src/host/daemon/api/routines.js +1 -1
- package/src/host/daemon/api/runtimes.js +4 -3
- package/src/host/daemon/api/sessions-search.js +24 -140
- package/src/host/daemon/api/sessions.js +12 -30
- package/src/host/daemon/api/shared.js +2 -1
- package/src/host/daemon/api/telegram.js +1 -11
- package/src/host/daemon/api/tools.js +6 -6
- package/src/host/daemon/api/transcribe.js +2 -2
- package/src/host/daemon/api/vars.js +137 -0
- package/src/host/daemon/api/voice.js +13 -290
- package/src/host/daemon/api.js +2 -0
- package/src/host/daemon/db.js +6 -6
- package/src/host/daemon/deck-exec.js +148 -0
- package/src/host/daemon/index.js +3 -3
- package/src/host/daemon/plugins/telegram/index.js +24 -687
- package/src/host/daemon/routines-scheduler.js +64 -0
- package/src/host/daemon/smoke.js +3 -2
- package/src/host/daemon/whisper-server.js +225 -0
- package/src/interfaces/cli/commands/agent.js +3 -2
- package/src/interfaces/cli/commands/command.js +2 -3
- package/src/interfaces/cli/commands/messages.js +6 -2
- package/src/interfaces/cli/commands/pair.js +5 -4
- package/src/interfaces/cli/commands/search.js +1 -1
- package/src/interfaces/cli/commands/sessions.js +3 -2
- package/src/interfaces/cli/commands/skills.js +36 -55
- package/src/interfaces/web/dist/assets/index-DdmSRtsz.css +1 -0
- package/src/interfaces/web/dist/assets/index-M4FspaCH.js +613 -0
- package/src/interfaces/web/dist/assets/index-M4FspaCH.js.map +1 -0
- package/src/interfaces/web/dist/index.html +2 -2
- package/src/interfaces/web/package-lock.json +182 -182
- package/src/interfaces/web/src/components/ModelCombobox.tsx +44 -8
- package/src/interfaces/web/src/components/TelegramChannelDialog.tsx +1 -1
- package/src/interfaces/web/src/components/chat/AskAnswersCard.tsx +76 -0
- package/src/interfaces/web/src/components/chat/MessageBubble.tsx +16 -3
- package/src/interfaces/web/src/components/chat/MessageList.tsx +23 -1
- package/src/interfaces/web/src/components/chat/ModelPicker.tsx +3 -1
- package/src/interfaces/web/src/components/code/CodeArtifactsTab.tsx +4 -4
- package/src/interfaces/web/src/components/code/CodeChangesTab.tsx +1 -1
- package/src/interfaces/web/src/components/code/CodeFileTree.tsx +3 -2
- package/src/interfaces/web/src/components/code/CodeFileViewer.tsx +3 -2
- package/src/interfaces/web/src/components/code/CodeTerminal.tsx +3 -2
- package/src/interfaces/web/src/components/config/GlobalConfigEditor.tsx +2 -1
- package/src/interfaces/web/src/components/deck/WidgetRow.tsx +2 -1
- package/src/interfaces/web/src/components/inputs/KeyValueList.tsx +93 -0
- package/src/interfaces/web/src/components/inputs/VarTokenInput.tsx +449 -0
- package/src/interfaces/web/src/components/settings/DefaultRouterCard.tsx +2 -1
- package/src/interfaces/web/src/components/settings/EnginesPanel.tsx +2 -2
- package/src/interfaces/web/src/components/settings/MemoryPanel.tsx +5 -4
- package/src/interfaces/web/src/components/settings/providers/ProviderCard.tsx +3 -2
- package/src/interfaces/web/src/components/settings/providers/ProviderModal.tsx +3 -2
- package/src/interfaces/web/src/components/ui/chat-input.tsx +5 -4
- package/src/interfaces/web/src/components/ui/sidebar.tsx +3 -2
- package/src/interfaces/web/src/components/voice/VoiceProviderModal.tsx +2 -1
- package/src/interfaces/web/src/constants/index.ts +1 -1
- package/src/interfaces/web/src/i18n/en.ts +174 -7
- package/src/interfaces/web/src/i18n/es.ts +179 -15
- package/src/interfaces/web/src/lib/api/mcps.ts +25 -0
- package/src/interfaces/web/src/lib/api/vars.ts +38 -0
- package/src/interfaces/web/src/lib/api.ts +1 -0
- package/src/interfaces/web/src/screens/ProjectScreen.tsx +8 -31
- package/src/interfaces/web/src/screens/modules/CodeScreen.tsx +1 -1
- package/src/interfaces/web/src/screens/modules/DeckScreen.tsx +4 -3
- package/src/interfaces/web/src/screens/modules/DesktopScreen.tsx +7 -6
- package/src/interfaces/web/src/screens/modules/VoiceScreen.tsx +4 -3
- package/src/interfaces/web/src/screens/project/AgentDetailScreen.tsx +1 -1
- package/src/interfaces/web/src/screens/project/ConfigTab.tsx +132 -1
- package/src/interfaces/web/src/screens/project/McpsTab.tsx +549 -104
- package/src/interfaces/web/src/screens/project/RoutinesTab.tsx +1 -1
- package/src/interfaces/web/src/screens/project/VarsTab.tsx +300 -0
- package/src/interfaces/web/src/types/daemon.ts +5 -0
- package/src/host/daemon/transcription.js +0 -538
- package/src/host/daemon/whisper-transcribe.py +0 -73
- package/src/interfaces/web/dist/assets/index-7dVT2O1S.css +0 -1
- package/src/interfaces/web/dist/assets/index-DWsE_8Nz.js +0 -602
- package/src/interfaces/web/dist/assets/index-DWsE_8Nz.js.map +0 -1
- /package/src/{host/daemon → core/apc}/projects-helpers.js +0 -0
- /package/src/{host/daemon/plugins → core/channels}/telegram/ask.js +0 -0
- /package/src/{host/daemon/plugins → core/channels}/telegram/media.js +0 -0
- /package/src/core/{tools → http-tools}/index.js +0 -0
- /package/{skills → src/core/runtime-skills}/apx-agency-agents/SKILL.md +0 -0
- /package/{skills → src/core/runtime-skills}/apx-agent/SKILL.md +0 -0
- /package/{skills → src/core/runtime-skills}/apx-mcp-builder/SKILL.md +0 -0
- /package/{skills → src/core/runtime-skills}/apx-project/SKILL.md +0 -0
- /package/{skills → src/core/runtime-skills}/apx-routine/SKILL.md +0 -0
- /package/{skills → src/core/runtime-skills}/apx-runtime/SKILL.md +0 -0
- /package/{skills → src/core/runtime-skills}/apx-sessions/SKILL.md +0 -0
- /package/{skills → src/core/runtime-skills}/apx-skill-builder/SKILL.md +0 -0
- /package/{skills → src/core/runtime-skills}/apx-task/SKILL.md +0 -0
- /package/{skills → src/core/runtime-skills}/apx-telegram/SKILL.md +0 -0
- /package/{skills → src/core/runtime-skills}/apx-voice/SKILL.md +0 -0
- /package/src/{host/daemon/compact.js → core/stores/conversations-compactor.js} +0 -0
- /package/src/{host/daemon → core/stores}/conversations.js +0 -0
- /package/src/{host/daemon → core/util}/thinking.js +0 -0
|
@@ -50,7 +50,7 @@ const SCHED_PRESETS = [
|
|
|
50
50
|
{ label: "días hábiles 9am", value: "cron 0 9 * * 1-5" },
|
|
51
51
|
];
|
|
52
52
|
|
|
53
|
-
// Template/env vars the routine runner exposes (src/
|
|
53
|
+
// Template/env vars the routine runner exposes (src/core/routines/runner.js).
|
|
54
54
|
const VARS = [
|
|
55
55
|
{ v: "{{pre_output}}", where: "prompt", desc: "Salida de los pre-commands, inyectada en el prompt." },
|
|
56
56
|
{ v: "$APX_LLM_OUTPUT", where: "post", desc: "Respuesta del agente / super-agente." },
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { useEffect, useMemo, useState } from "react";
|
|
2
|
+
import useSWR from "swr";
|
|
3
|
+
import { Eye, EyeOff, Pencil, Plus, Trash2 } from "lucide-react";
|
|
4
|
+
import { Vars, type VarScope, type VarsList } from "../../lib/api";
|
|
5
|
+
import { Section } from "../../components/Section";
|
|
6
|
+
import { Badge, Button, Dialog, Empty, Field, Input, Loading, Switch } from "../../components/ui";
|
|
7
|
+
import { UiSelect } from "../../components/UiSelect";
|
|
8
|
+
import { useToast } from "../../components/Toast";
|
|
9
|
+
import { t } from "../../i18n";
|
|
10
|
+
|
|
11
|
+
interface Row {
|
|
12
|
+
name: string;
|
|
13
|
+
scope: VarScope;
|
|
14
|
+
masked: string;
|
|
15
|
+
revealed?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function VarsTab({ pid }: { pid: string }) {
|
|
19
|
+
const toast = useToast();
|
|
20
|
+
const isBase = String(pid) === "0";
|
|
21
|
+
const [filter, setFilter] = useState<"all" | "project" | "global">(
|
|
22
|
+
isBase ? "global" : "all",
|
|
23
|
+
);
|
|
24
|
+
const [revealAll, setRevealAll] = useState(false);
|
|
25
|
+
const list = useSWR<VarsList>(
|
|
26
|
+
`/projects/${pid}/vars?reveal=${revealAll ? 1 : 0}`,
|
|
27
|
+
() => Vars.list(pid, { reveal: revealAll }),
|
|
28
|
+
);
|
|
29
|
+
const [openCreate, setOpenCreate] = useState<{ name?: string; value?: string; scope?: VarScope } | null>(null);
|
|
30
|
+
|
|
31
|
+
const rows: Row[] = useMemo(() => {
|
|
32
|
+
if (!list.data) return [];
|
|
33
|
+
const out: Row[] = [];
|
|
34
|
+
const proj = list.data.project || {};
|
|
35
|
+
const glob = list.data.global || {};
|
|
36
|
+
for (const [name, masked] of Object.entries(proj)) {
|
|
37
|
+
out.push({ name, scope: "project", masked });
|
|
38
|
+
}
|
|
39
|
+
for (const [name, masked] of Object.entries(glob)) {
|
|
40
|
+
if (proj[name] !== undefined) continue;
|
|
41
|
+
out.push({ name, scope: "global", masked });
|
|
42
|
+
}
|
|
43
|
+
return out
|
|
44
|
+
.filter((r) => (filter === "all" ? true : r.scope === filter))
|
|
45
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
46
|
+
}, [list.data, filter]);
|
|
47
|
+
|
|
48
|
+
const remove = async (name: string, scope: VarScope) => {
|
|
49
|
+
if (!confirm(t("project.vars.delete_confirm", { name, scope }))) return;
|
|
50
|
+
try {
|
|
51
|
+
await Vars.remove(pid, name, scope);
|
|
52
|
+
toast.success(t("project.vars.removed"));
|
|
53
|
+
list.mutate();
|
|
54
|
+
} catch (e: any) {
|
|
55
|
+
toast.error(e?.message || t("common.error_generic"));
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<Section
|
|
61
|
+
title={t("project.vars.title")}
|
|
62
|
+
description={
|
|
63
|
+
isBase ? t("project.vars.subtitle_base") : t("project.vars.subtitle_project")
|
|
64
|
+
}
|
|
65
|
+
action={
|
|
66
|
+
<div className="flex items-center gap-2">
|
|
67
|
+
<Switch checked={revealAll} onChange={setRevealAll} label={t("project.vars.reveal_all")} />
|
|
68
|
+
<Button size="sm" variant="primary" onClick={() => setOpenCreate({})}>
|
|
69
|
+
<Plus size={14} /> {t("project.vars.new")}
|
|
70
|
+
</Button>
|
|
71
|
+
</div>
|
|
72
|
+
}
|
|
73
|
+
>
|
|
74
|
+
{!isBase && (
|
|
75
|
+
<div className="mb-3 flex items-center gap-2 text-xs">
|
|
76
|
+
<span className="text-muted-fg">{t("project.vars.filter_label")}</span>
|
|
77
|
+
<FilterPill active={filter === "all"} onClick={() => setFilter("all")}>
|
|
78
|
+
{t("project.vars.filter_all")}
|
|
79
|
+
</FilterPill>
|
|
80
|
+
<FilterPill active={filter === "project"} onClick={() => setFilter("project")}>
|
|
81
|
+
{t("project.vars.filter_project")}
|
|
82
|
+
</FilterPill>
|
|
83
|
+
<FilterPill active={filter === "global"} onClick={() => setFilter("global")}>
|
|
84
|
+
{t("project.vars.filter_global")}
|
|
85
|
+
</FilterPill>
|
|
86
|
+
</div>
|
|
87
|
+
)}
|
|
88
|
+
|
|
89
|
+
{list.isLoading && <Loading />}
|
|
90
|
+
{!list.isLoading && rows.length === 0 && <Empty>{t("project.vars.empty")}</Empty>}
|
|
91
|
+
|
|
92
|
+
{rows.length > 0 && (
|
|
93
|
+
<ul className="space-y-2 text-sm">
|
|
94
|
+
{rows.map((r) => (
|
|
95
|
+
<li
|
|
96
|
+
key={`${r.scope}-${r.name}`}
|
|
97
|
+
className="flex items-center gap-3 rounded-md border border-border bg-muted/30 px-3 py-2"
|
|
98
|
+
>
|
|
99
|
+
<span className="font-mono text-xs font-medium">{r.name}</span>
|
|
100
|
+
<Badge tone={r.scope === "project" ? "info" : "muted"}>
|
|
101
|
+
{r.scope === "project" ? t("project.vars.scope_project") : t("project.vars.scope_global")}
|
|
102
|
+
</Badge>
|
|
103
|
+
<span className="ml-2 font-mono text-xs text-muted-fg">{r.masked}</span>
|
|
104
|
+
<div className="ml-auto flex items-center gap-1">
|
|
105
|
+
{/* Edit: only project-scope rows can be edited from a non-base project.
|
|
106
|
+
Global rows can be edited from /p/0. We surface "edit globally" by
|
|
107
|
+
pre-filling the dialog with scope=global; the user can switch. */}
|
|
108
|
+
<Button
|
|
109
|
+
size="sm"
|
|
110
|
+
variant="ghost"
|
|
111
|
+
onClick={() => setOpenCreate({ name: r.name, scope: r.scope })}
|
|
112
|
+
aria-label={t("project.vars.edit_btn")}
|
|
113
|
+
>
|
|
114
|
+
<Pencil size={13} />
|
|
115
|
+
</Button>
|
|
116
|
+
{!(isBase && r.scope === "project") && (
|
|
117
|
+
<Button
|
|
118
|
+
size="sm"
|
|
119
|
+
variant="destructive"
|
|
120
|
+
onClick={() => remove(r.name, r.scope)}
|
|
121
|
+
aria-label={t("project.vars.delete_btn")}
|
|
122
|
+
>
|
|
123
|
+
<Trash2 size={13} />
|
|
124
|
+
</Button>
|
|
125
|
+
)}
|
|
126
|
+
</div>
|
|
127
|
+
</li>
|
|
128
|
+
))}
|
|
129
|
+
</ul>
|
|
130
|
+
)}
|
|
131
|
+
|
|
132
|
+
<UpsertVarDialog
|
|
133
|
+
open={openCreate !== null}
|
|
134
|
+
initial={openCreate || undefined}
|
|
135
|
+
onClose={() => setOpenCreate(null)}
|
|
136
|
+
pid={pid}
|
|
137
|
+
isBase={isBase}
|
|
138
|
+
onSaved={() => {
|
|
139
|
+
setOpenCreate(null);
|
|
140
|
+
list.mutate();
|
|
141
|
+
}}
|
|
142
|
+
/>
|
|
143
|
+
</Section>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function FilterPill({
|
|
148
|
+
active,
|
|
149
|
+
onClick,
|
|
150
|
+
children,
|
|
151
|
+
}: {
|
|
152
|
+
active: boolean;
|
|
153
|
+
onClick: () => void;
|
|
154
|
+
children: React.ReactNode;
|
|
155
|
+
}) {
|
|
156
|
+
return (
|
|
157
|
+
<button
|
|
158
|
+
type="button"
|
|
159
|
+
onClick={onClick}
|
|
160
|
+
className={
|
|
161
|
+
active
|
|
162
|
+
? "rounded-full border border-primary/50 bg-primary/10 px-2 py-0.5 text-xs"
|
|
163
|
+
: "rounded-full border border-border bg-muted/30 px-2 py-0.5 text-xs hover:bg-muted/60"
|
|
164
|
+
}
|
|
165
|
+
>
|
|
166
|
+
{children}
|
|
167
|
+
</button>
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function UpsertVarDialog({
|
|
172
|
+
open,
|
|
173
|
+
onClose,
|
|
174
|
+
pid,
|
|
175
|
+
isBase,
|
|
176
|
+
initial,
|
|
177
|
+
onSaved,
|
|
178
|
+
}: {
|
|
179
|
+
open: boolean;
|
|
180
|
+
onClose: () => void;
|
|
181
|
+
pid: string;
|
|
182
|
+
isBase: boolean;
|
|
183
|
+
initial?: { name?: string; value?: string; scope?: VarScope };
|
|
184
|
+
onSaved: () => void;
|
|
185
|
+
}) {
|
|
186
|
+
const toast = useToast();
|
|
187
|
+
const [busy, setBusy] = useState(false);
|
|
188
|
+
const [revealValue, setRevealValue] = useState(false);
|
|
189
|
+
const [name, setName] = useState(initial?.name || "");
|
|
190
|
+
const [value, setValue] = useState(initial?.value || "");
|
|
191
|
+
const [scope, setScope] = useState<VarScope>(
|
|
192
|
+
initial?.scope || (isBase ? "global" : "project"),
|
|
193
|
+
);
|
|
194
|
+
const isEdit = !!initial?.name;
|
|
195
|
+
|
|
196
|
+
// Reset state when the dialog opens with a different initial.
|
|
197
|
+
useEffect(() => {
|
|
198
|
+
if (open) {
|
|
199
|
+
setName(initial?.name || "");
|
|
200
|
+
setValue(initial?.value || "");
|
|
201
|
+
setScope(initial?.scope || (isBase ? "global" : "project"));
|
|
202
|
+
setRevealValue(false);
|
|
203
|
+
}
|
|
204
|
+
}, [open, initial?.name, initial?.scope, initial?.value, isBase]);
|
|
205
|
+
|
|
206
|
+
const submit = async () => {
|
|
207
|
+
if (!name.trim()) {
|
|
208
|
+
toast.error(t("project.vars.name_required"));
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
if (!value) {
|
|
212
|
+
toast.error(t("project.vars.value_required"));
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
setBusy(true);
|
|
216
|
+
try {
|
|
217
|
+
await Vars.upsert(pid, { name: name.trim(), value, scope });
|
|
218
|
+
toast.success(isEdit ? t("project.vars.updated") : t("project.vars.added"));
|
|
219
|
+
onSaved();
|
|
220
|
+
} catch (e: any) {
|
|
221
|
+
toast.error(e?.message || t("common.error_generic"));
|
|
222
|
+
} finally {
|
|
223
|
+
setBusy(false);
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
return (
|
|
228
|
+
<Dialog
|
|
229
|
+
open={open}
|
|
230
|
+
onClose={() => (busy ? null : onClose())}
|
|
231
|
+
title={isEdit ? t("project.vars.edit_title") : t("project.vars.new_title")}
|
|
232
|
+
description={t("project.vars.new_desc")}
|
|
233
|
+
size="sm"
|
|
234
|
+
footer={
|
|
235
|
+
<>
|
|
236
|
+
<Button variant="ghost" onClick={onClose} disabled={busy}>
|
|
237
|
+
{t("common.cancel")}
|
|
238
|
+
</Button>
|
|
239
|
+
<Button variant="primary" onClick={submit} loading={busy}>
|
|
240
|
+
{isEdit ? t("project.vars.save_btn") : t("project.vars.add_btn")}
|
|
241
|
+
</Button>
|
|
242
|
+
</>
|
|
243
|
+
}
|
|
244
|
+
>
|
|
245
|
+
<div className="space-y-3">
|
|
246
|
+
<Field label={t("project.vars.scope_label")}>
|
|
247
|
+
<UiSelect
|
|
248
|
+
value={scope}
|
|
249
|
+
onChange={(v) => setScope(v as VarScope)}
|
|
250
|
+
options={[
|
|
251
|
+
...(isBase
|
|
252
|
+
? []
|
|
253
|
+
: [
|
|
254
|
+
{
|
|
255
|
+
value: "project",
|
|
256
|
+
label: t("project.vars.scope_project"),
|
|
257
|
+
description: t("project.vars.scope_project_desc"),
|
|
258
|
+
},
|
|
259
|
+
]),
|
|
260
|
+
{
|
|
261
|
+
value: "global",
|
|
262
|
+
label: t("project.vars.scope_global"),
|
|
263
|
+
description: t("project.vars.scope_global_desc"),
|
|
264
|
+
},
|
|
265
|
+
]}
|
|
266
|
+
/>
|
|
267
|
+
</Field>
|
|
268
|
+
<Field label={t("project.vars.name_label")} hint={t("project.vars.name_hint")}>
|
|
269
|
+
<Input
|
|
270
|
+
value={name}
|
|
271
|
+
onChange={(e) => setName(e.target.value.toUpperCase().replace(/[^A-Z0-9_]/g, "_"))}
|
|
272
|
+
placeholder="MY_API_KEY"
|
|
273
|
+
disabled={isEdit}
|
|
274
|
+
autoFocus={!isEdit}
|
|
275
|
+
/>
|
|
276
|
+
</Field>
|
|
277
|
+
<Field label={t("project.vars.value_label")} hint={t("project.vars.value_hint")}>
|
|
278
|
+
<div className="relative">
|
|
279
|
+
<Input
|
|
280
|
+
type={revealValue ? "text" : "password"}
|
|
281
|
+
value={value}
|
|
282
|
+
onChange={(e) => setValue(e.target.value)}
|
|
283
|
+
placeholder={isEdit ? t("project.vars.value_edit_ph") : ""}
|
|
284
|
+
className="pr-9 font-mono text-xs"
|
|
285
|
+
autoFocus={isEdit}
|
|
286
|
+
/>
|
|
287
|
+
<button
|
|
288
|
+
type="button"
|
|
289
|
+
onClick={() => setRevealValue((v) => !v)}
|
|
290
|
+
className="absolute right-2 top-1/2 -translate-y-1/2 text-muted-fg hover:text-fg"
|
|
291
|
+
aria-label={revealValue ? t("project.vars.hide") : t("project.vars.reveal")}
|
|
292
|
+
>
|
|
293
|
+
{revealValue ? <EyeOff size={14} /> : <Eye size={14} />}
|
|
294
|
+
</button>
|
|
295
|
+
</div>
|
|
296
|
+
</Field>
|
|
297
|
+
</div>
|
|
298
|
+
</Dialog>
|
|
299
|
+
);
|
|
300
|
+
}
|
|
@@ -70,6 +70,11 @@ export interface McpEntry {
|
|
|
70
70
|
source: "apc" | "runtime" | "global" | string;
|
|
71
71
|
transport: string;
|
|
72
72
|
enabled: boolean;
|
|
73
|
+
command?: string | null;
|
|
74
|
+
args?: string[];
|
|
75
|
+
env?: Record<string, string>;
|
|
76
|
+
url?: string | null;
|
|
77
|
+
headers?: Record<string, string>;
|
|
73
78
|
}
|
|
74
79
|
|
|
75
80
|
export interface MessageEntry {
|