@rubics-code/agent-kit 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +88 -2
- package/dist/approval.d.ts +20 -0
- package/dist/approval.js +32 -0
- package/dist/assemble.d.ts +24 -0
- package/dist/assemble.js +19 -0
- package/dist/briefing.d.ts +12 -0
- package/dist/briefing.js +22 -0
- package/dist/capabilities.d.ts +2 -0
- package/dist/capabilities.js +6 -0
- package/dist/cli/bin.d.ts +2 -0
- package/dist/cli/bin.js +39 -0
- package/dist/cli/init.d.ts +9 -0
- package/dist/cli/init.js +73 -0
- package/dist/credentials.d.ts +28 -0
- package/dist/credentials.js +134 -0
- package/dist/errors.d.ts +2 -0
- package/dist/errors.js +4 -0
- package/dist/group.d.ts +68 -0
- package/dist/group.js +89 -0
- package/dist/groups/cloudflare/client.d.ts +42 -0
- package/dist/groups/cloudflare/client.js +76 -0
- package/dist/groups/cloudflare/guidance.md +7 -0
- package/dist/groups/cloudflare/memory.d.ts +19 -0
- package/dist/groups/cloudflare/memory.js +43 -0
- package/dist/groups/cloudflare/tools.d.ts +3 -0
- package/dist/groups/cloudflare/tools.js +140 -0
- package/dist/groups/infisical/client.d.ts +30 -0
- package/dist/groups/infisical/client.js +133 -0
- package/dist/groups/infisical/guidance.md +8 -0
- package/dist/groups/infisical/memory.d.ts +18 -0
- package/dist/groups/infisical/memory.js +43 -0
- package/dist/groups/infisical/tools.d.ts +3 -0
- package/dist/groups/infisical/tools.js +88 -0
- package/dist/groups/mxroute/client.d.ts +90 -0
- package/dist/groups/mxroute/client.js +86 -0
- package/dist/groups/mxroute/guidance.md +13 -0
- package/dist/groups/mxroute/memory.d.ts +34 -0
- package/dist/groups/mxroute/memory.js +83 -0
- package/dist/groups/mxroute/tools.d.ts +3 -0
- package/dist/groups/mxroute/tools.js +158 -0
- package/dist/groups/openrouter/client.d.ts +66 -0
- package/dist/groups/openrouter/client.js +66 -0
- package/dist/groups/openrouter/guidance.md +7 -0
- package/dist/groups/openrouter/memory.d.ts +26 -0
- package/dist/groups/openrouter/memory.js +59 -0
- package/dist/groups/openrouter/tools.d.ts +3 -0
- package/dist/groups/openrouter/tools.js +130 -0
- package/dist/groups/registrar/client.d.ts +48 -0
- package/dist/groups/registrar/client.js +75 -0
- package/dist/groups/registrar/guidance.md +9 -0
- package/dist/groups/registrar/memory.d.ts +16 -0
- package/dist/groups/registrar/memory.js +27 -0
- package/dist/groups/registrar/tools.d.ts +4 -0
- package/dist/groups/registrar/tools.js +102 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.js +35 -0
- package/dist/policy.d.ts +12 -0
- package/dist/policy.js +1 -0
- package/dist/result.d.ts +2 -0
- package/dist/result.js +17 -0
- package/dist/runtime/agent.d.ts +28 -0
- package/dist/runtime/agent.js +28 -0
- package/dist/runtime/container.d.ts +8 -0
- package/dist/runtime/container.js +41 -0
- package/dist/runtime/run.d.ts +51 -0
- package/dist/runtime/run.js +152 -0
- package/dist/runtime/transcribe.d.ts +7 -0
- package/dist/runtime/transcribe.js +37 -0
- package/dist/runtime/turns.d.ts +13 -0
- package/dist/runtime/turns.js +23 -0
- package/dist/runtime/web/index.html +452 -0
- package/dist/runtime/web/server.d.ts +20 -0
- package/dist/runtime/web/server.js +150 -0
- package/dist/schemas.d.ts +2 -0
- package/dist/schemas.js +6 -0
- package/dist/secret-delivery.d.ts +18 -0
- package/dist/secret-delivery.js +45 -0
- package/dist/secret-store.d.ts +13 -0
- package/dist/secret-store.js +1 -0
- package/dist/secrets.d.ts +5 -0
- package/dist/secrets.js +13 -0
- package/package.json +61 -4
- package/template/Dockerfile +19 -0
- package/template/README.md +55 -0
- package/template/_dockerignore +7 -0
- package/template/_gitignore +4 -0
- package/template/entrypoint.sh +14 -0
- package/template/evals/notes.eval.ts +55 -0
- package/template/home/memory/README.md +1 -0
- package/template/home/prompts/system.md +15 -0
- package/template/src/agent.ts +47 -0
- package/template/src/groups/notes.ts +85 -0
- package/template/src/main.ts +4 -0
- package/template/test/agent.test.ts +22 -0
- package/template/tsconfig.json +17 -0
- package/template/vitest.config.ts +7 -0
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>{{NAME}}</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
--bg: #f6f5f2; --panel: #ffffff; --ink: #1c1b19; --muted: #6b6862; --line: #e3e0da;
|
|
10
|
+
--accent: #a3123a; --accent-soft: #f8e7ec; --ok: #1f7a4d; --warn-soft: #fff6e0; --warn-line: #e8c76a;
|
|
11
|
+
--me: #1c1b19; --me-ink: #ffffff;
|
|
12
|
+
}
|
|
13
|
+
@media (prefers-color-scheme: dark) {
|
|
14
|
+
:root {
|
|
15
|
+
--bg: #141312; --panel: #1d1c1a; --ink: #ecebe8; --muted: #9a968f; --line: #2f2d2a;
|
|
16
|
+
--accent: #ff5c86; --accent-soft: #3a1520; --ok: #57c68f; --warn-soft: #2c2412; --warn-line: #7a6326;
|
|
17
|
+
--me: #ecebe8; --me-ink: #141312;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
* { box-sizing: border-box; }
|
|
21
|
+
html, body { height: 100%; margin: 0; }
|
|
22
|
+
body {
|
|
23
|
+
background: var(--bg); color: var(--ink);
|
|
24
|
+
font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
25
|
+
display: flex; flex-direction: column;
|
|
26
|
+
}
|
|
27
|
+
header {
|
|
28
|
+
display: flex; align-items: center; gap: 12px; padding: 12px 16px;
|
|
29
|
+
border-bottom: 1px solid var(--line); background: var(--panel);
|
|
30
|
+
}
|
|
31
|
+
.mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); flex: none; }
|
|
32
|
+
header h1 { font-size: 17px; margin: 0; }
|
|
33
|
+
#meta { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
|
|
34
|
+
button { font: inherit; cursor: pointer; }
|
|
35
|
+
.ghost {
|
|
36
|
+
background: none; border: 1px solid var(--line); color: var(--ink);
|
|
37
|
+
padding: 6px 10px; border-radius: 8px; font-size: 14px;
|
|
38
|
+
}
|
|
39
|
+
.ghost:hover { border-color: var(--muted); }
|
|
40
|
+
.wrap { flex: 1; display: flex; min-height: 0; }
|
|
41
|
+
.chat { flex: 1; display: flex; flex-direction: column; min-width: 0; }
|
|
42
|
+
main { flex: 1; overflow-y: auto; }
|
|
43
|
+
aside {
|
|
44
|
+
width: 320px; flex: none; overflow-y: auto; border-left: 1px solid var(--line);
|
|
45
|
+
background: var(--panel); padding: 16px;
|
|
46
|
+
}
|
|
47
|
+
aside h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; }
|
|
48
|
+
.group { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
|
|
49
|
+
.group-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
|
|
50
|
+
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
|
|
51
|
+
.group.off .dot { background: var(--muted); }
|
|
52
|
+
.group.off .group-head { color: var(--muted); }
|
|
53
|
+
.state { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
|
|
54
|
+
.group ul { list-style: none; margin: 8px 0 0; padding: 0; }
|
|
55
|
+
.group li { display: flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; font: 12.5px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-word; }
|
|
56
|
+
.group.off li { color: var(--muted); }
|
|
57
|
+
.tag { font: 11px ui-sans-serif, system-ui, sans-serif; color: var(--accent); border: 1px solid var(--accent); border-radius: 4px; padding: 0 4px; flex: none; }
|
|
58
|
+
.missing { margin-top: 8px; font-size: 13px; background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: 8px; padding: 6px 8px; }
|
|
59
|
+
.missing code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
|
|
60
|
+
.keys { font-size: 12px; color: var(--muted); margin-top: 4px; }
|
|
61
|
+
#toggle { display: none; }
|
|
62
|
+
@media (max-width: 999px) {
|
|
63
|
+
#toggle { display: inline-block; }
|
|
64
|
+
aside { display: none; position: fixed; top: 53px; right: 0; bottom: 0; width: min(340px, 100%); z-index: 10; box-shadow: -8px 0 24px rgb(0 0 0 / .25); }
|
|
65
|
+
body.tools-open aside { display: block; }
|
|
66
|
+
}
|
|
67
|
+
#log { max-width: 760px; margin: 0 auto; padding: 20px 16px 8px; display: flex; flex-direction: column; gap: 12px; }
|
|
68
|
+
.msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
69
|
+
.me { align-self: flex-end; background: var(--me); color: var(--me-ink); border-bottom-right-radius: 4px; }
|
|
70
|
+
.agent { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
|
|
71
|
+
.md { white-space: normal; }
|
|
72
|
+
.md p { margin: 0 0 8px; } .md p:last-child { margin-bottom: 0; }
|
|
73
|
+
.md ul, .md ol { margin: 0 0 8px; padding-left: 22px; }
|
|
74
|
+
.md code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg); padding: 1px 5px; border-radius: 5px; }
|
|
75
|
+
.md pre { background: var(--bg); padding: 10px; border-radius: 8px; overflow-x: auto; margin: 0 0 8px; }
|
|
76
|
+
.md pre code { padding: 0; background: none; }
|
|
77
|
+
.md .table { overflow-x: auto; margin: 0 0 8px; }
|
|
78
|
+
.md table { border-collapse: collapse; font-size: 14px; }
|
|
79
|
+
.md th, .md td { border-bottom: 1px solid var(--line); padding: 5px 10px; text-align: left; white-space: nowrap; }
|
|
80
|
+
.md th { color: var(--muted); font-weight: 600; }
|
|
81
|
+
.err { align-self: center; color: var(--accent); font-size: 14px; }
|
|
82
|
+
.hint { color: var(--muted); text-align: center; font-size: 14px; padding: 24px 0; }
|
|
83
|
+
.card {
|
|
84
|
+
align-self: stretch; background: var(--warn-soft); border: 1px solid var(--warn-line);
|
|
85
|
+
border-radius: 12px; padding: 12px 14px;
|
|
86
|
+
}
|
|
87
|
+
.card .tool { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
|
|
88
|
+
.card .sum { margin: 4px 0 10px; overflow-wrap: anywhere; }
|
|
89
|
+
.card .row { display: flex; gap: 8px; flex-wrap: wrap; }
|
|
90
|
+
.approve { background: var(--ok); color: #fff; border: 0; padding: 7px 14px; border-radius: 8px; }
|
|
91
|
+
.reject { background: none; border: 1px solid var(--line); color: var(--ink); padding: 7px 14px; border-radius: 8px; }
|
|
92
|
+
.card .why {
|
|
93
|
+
flex: 1; min-width: 160px; font: inherit; font-size: 14px; padding: 6px 10px; color: var(--ink);
|
|
94
|
+
background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
|
|
95
|
+
}
|
|
96
|
+
.card.done { opacity: .6; }
|
|
97
|
+
.card .verdict { font-size: 14px; font-weight: 600; }
|
|
98
|
+
.typing { align-self: flex-start; color: var(--muted); font-size: 14px; }
|
|
99
|
+
footer { border-top: 1px solid var(--line); background: var(--panel); }
|
|
100
|
+
form { max-width: 760px; margin: 0 auto; padding: 12px 16px; display: flex; gap: 8px; align-items: flex-end; }
|
|
101
|
+
textarea {
|
|
102
|
+
flex: 1; resize: none; min-height: 44px; max-height: 180px; padding: 10px 12px;
|
|
103
|
+
font: inherit; color: var(--ink); background: var(--bg);
|
|
104
|
+
border: 1px solid var(--line); border-radius: 12px; outline: none;
|
|
105
|
+
}
|
|
106
|
+
textarea:focus { border-color: var(--muted); }
|
|
107
|
+
.round {
|
|
108
|
+
width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1px solid var(--line);
|
|
109
|
+
background: var(--bg); color: var(--ink); display: grid; place-items: center;
|
|
110
|
+
}
|
|
111
|
+
.round svg { width: 20px; height: 20px; }
|
|
112
|
+
#send { background: var(--accent); border-color: var(--accent); color: #fff; }
|
|
113
|
+
#mic.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
|
|
114
|
+
@keyframes pulse { 50% { box-shadow: 0 0 0 6px var(--accent-soft); } }
|
|
115
|
+
button:disabled { opacity: .45; cursor: default; }
|
|
116
|
+
.opts { max-width: 760px; margin: 0 auto; padding: 0 16px 10px; color: var(--muted); font-size: 13px; display: flex; gap: 16px; }
|
|
117
|
+
.opts label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
|
|
118
|
+
</style>
|
|
119
|
+
</head>
|
|
120
|
+
<body>
|
|
121
|
+
<header>
|
|
122
|
+
<div class="mark" aria-hidden="true"></div>
|
|
123
|
+
<h1>{{NAME}}</h1>
|
|
124
|
+
<div id="meta"></div>
|
|
125
|
+
<button class="ghost" id="toggle" type="button" aria-controls="tools" aria-expanded="false">Tools</button>
|
|
126
|
+
<button class="ghost" id="new" type="button">New chat</button>
|
|
127
|
+
</header>
|
|
128
|
+
<div class="wrap">
|
|
129
|
+
<div class="chat">
|
|
130
|
+
<main id="scroll"><div id="log" aria-live="polite"></div></main>
|
|
131
|
+
<footer>
|
|
132
|
+
<form id="form">
|
|
133
|
+
<button class="round" id="mic" type="button" title="Speak" aria-label="Speak">
|
|
134
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="3" width="6" height="11" rx="3"/><path d="M5 11a7 7 0 0 0 14 0M12 18v3"/></svg>
|
|
135
|
+
</button>
|
|
136
|
+
<textarea id="text" rows="1" placeholder="Message {{NAME}}" aria-label="Message"></textarea>
|
|
137
|
+
<button class="round" id="send" type="submit" title="Send" aria-label="Send">
|
|
138
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M13 6l6 6-6 6"/></svg>
|
|
139
|
+
</button>
|
|
140
|
+
</form>
|
|
141
|
+
<div class="opts">
|
|
142
|
+
<label><input type="checkbox" id="speak"> Read replies aloud</label>
|
|
143
|
+
<label><input type="checkbox" id="autosend" checked> Send when I stop talking</label>
|
|
144
|
+
</div>
|
|
145
|
+
</footer>
|
|
146
|
+
</div>
|
|
147
|
+
<aside id="tools" aria-label="Tools"><h2>Tools</h2><div id="groups"></div></aside>
|
|
148
|
+
</div>
|
|
149
|
+
<script>
|
|
150
|
+
(() => {
|
|
151
|
+
const $ = (id) => document.getElementById(id);
|
|
152
|
+
const log = $("log"), scroll = $("scroll"), text = $("text"), send = $("send"), mic = $("mic");
|
|
153
|
+
|
|
154
|
+
let thread = null, busy = false, waiting = false;
|
|
155
|
+
|
|
156
|
+
function add(cls, content) {
|
|
157
|
+
const el = document.createElement("div");
|
|
158
|
+
el.className = cls;
|
|
159
|
+
if (content !== undefined) el.textContent = content;
|
|
160
|
+
log.append(el);
|
|
161
|
+
scroll.scrollTop = scroll.scrollHeight;
|
|
162
|
+
return el;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
async function call(path, payload) {
|
|
166
|
+
const res = await fetch(path, {
|
|
167
|
+
method: "POST",
|
|
168
|
+
headers: { "Content-Type": "application/json" },
|
|
169
|
+
body: JSON.stringify(payload || {}),
|
|
170
|
+
});
|
|
171
|
+
const data = await res.json().catch(() => ({ error: res.statusText }));
|
|
172
|
+
if (!res.ok) throw new Error(data.error || res.statusText);
|
|
173
|
+
return data;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function setBusy(b) {
|
|
177
|
+
busy = b;
|
|
178
|
+
send.disabled = b || waiting;
|
|
179
|
+
text.disabled = waiting;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function speak(s) {
|
|
183
|
+
if (!$("speak").checked || !("speechSynthesis" in window)) return;
|
|
184
|
+
speechSynthesis.cancel();
|
|
185
|
+
const u = new SpeechSynthesisUtterance(s);
|
|
186
|
+
u.lang = "en-AU";
|
|
187
|
+
speechSynthesis.speak(u);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// A small Markdown subset. Each value is escaped first, so a reply can never inject HTML.
|
|
191
|
+
const esc = (s) => s.replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[c]);
|
|
192
|
+
const inline = (s) => esc(s)
|
|
193
|
+
.replace(/`([^`]+)`/g, "<code>$1</code>")
|
|
194
|
+
.replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>");
|
|
195
|
+
const cells = (row) => row.trim().replace(/^\||\|$/g, "").split("|").map((c) => c.trim());
|
|
196
|
+
function markdown(src) {
|
|
197
|
+
const out = [], lines = src.replace(/\r/g, "").split("\n");
|
|
198
|
+
for (let i = 0; i < lines.length; i++) {
|
|
199
|
+
const l = lines[i];
|
|
200
|
+
if (l.startsWith("```")) {
|
|
201
|
+
const code = [];
|
|
202
|
+
while (++i < lines.length && !lines[i].startsWith("```")) code.push(lines[i]);
|
|
203
|
+
out.push(`<pre><code>${esc(code.join("\n"))}</code></pre>`);
|
|
204
|
+
} else if (/^\s*\|.*\|\s*$/.test(l) && /^\s*\|?[\s:|-]+\|?\s*$/.test(lines[i + 1] || "")) {
|
|
205
|
+
const head = cells(l);
|
|
206
|
+
i++;
|
|
207
|
+
const body = [];
|
|
208
|
+
while (i + 1 < lines.length && /^\s*\|.*\|\s*$/.test(lines[i + 1])) body.push(cells(lines[++i]));
|
|
209
|
+
out.push(`<div class="table"><table><thead><tr>${head.map((h) => `<th>${inline(h)}</th>`).join("")}</tr></thead><tbody>${
|
|
210
|
+
body.map((r) => `<tr>${r.map((c) => `<td>${inline(c)}</td>`).join("")}</tr>`).join("")}</tbody></table></div>`);
|
|
211
|
+
} else if (/^\s*([-*]|\d+\.)\s+/.test(l)) {
|
|
212
|
+
const ordered = /^\s*\d+\./.test(l), items = [];
|
|
213
|
+
i--;
|
|
214
|
+
while (i + 1 < lines.length && /^\s*([-*]|\d+\.)\s+/.test(lines[i + 1])) items.push(lines[++i].replace(/^\s*([-*]|\d+\.)\s+/, ""));
|
|
215
|
+
const tag = ordered ? "ol" : "ul";
|
|
216
|
+
out.push(`<${tag}>${items.map((x) => `<li>${inline(x)}</li>`).join("")}</${tag}>`);
|
|
217
|
+
} else if (/^#{1,6}\s/.test(l)) {
|
|
218
|
+
out.push(`<p><strong>${inline(l.replace(/^#+\s*/, ""))}</strong></p>`);
|
|
219
|
+
} else if (l.trim()) {
|
|
220
|
+
out.push(`<p>${inline(l)}</p>`);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return out.join("");
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function show(result) {
|
|
227
|
+
if (result.reply !== undefined) {
|
|
228
|
+
add("msg agent md").innerHTML = markdown(result.reply);
|
|
229
|
+
speak(result.reply);
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
waiting = true;
|
|
233
|
+
setBusy(false);
|
|
234
|
+
const decisions = {};
|
|
235
|
+
const items = result.approvals;
|
|
236
|
+
for (const a of items) {
|
|
237
|
+
const card = add("card");
|
|
238
|
+
card.append(Object.assign(document.createElement("div"), { className: "tool", textContent: a.tool }));
|
|
239
|
+
card.append(Object.assign(document.createElement("div"), { className: "sum", textContent: a.summary }));
|
|
240
|
+
const row = Object.assign(document.createElement("div"), { className: "row" });
|
|
241
|
+
const yes = Object.assign(document.createElement("button"), { className: "approve", type: "button", textContent: "Approve" });
|
|
242
|
+
const no = Object.assign(document.createElement("button"), { className: "reject", type: "button", textContent: "Reject" });
|
|
243
|
+
const why = Object.assign(document.createElement("input"), {
|
|
244
|
+
className: "why", type: "text", maxLength: 500, placeholder: "Reason, if you reject (optional)",
|
|
245
|
+
});
|
|
246
|
+
row.append(yes, no, why);
|
|
247
|
+
card.append(row);
|
|
248
|
+
const decide = (approved) => {
|
|
249
|
+
const reason = approved ? undefined : why.value.trim() || undefined;
|
|
250
|
+
decisions[a.id] = { approved, reason };
|
|
251
|
+
row.replaceWith(Object.assign(document.createElement("div"), {
|
|
252
|
+
className: "verdict", textContent: approved ? "Approved" : "Rejected",
|
|
253
|
+
}));
|
|
254
|
+
card.classList.add("done");
|
|
255
|
+
if (Object.keys(decisions).length === items.length) submit(decisions);
|
|
256
|
+
};
|
|
257
|
+
yes.onclick = () => decide(true);
|
|
258
|
+
no.onclick = () => decide(false);
|
|
259
|
+
}
|
|
260
|
+
speak(items.length === 1 ? "I need your approval." : `I need ${items.length} approvals.`);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
async function submit(decisions) {
|
|
264
|
+
waiting = false;
|
|
265
|
+
await run(() => call("/api/decide", { thread, decisions }));
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
async function run(fn) {
|
|
269
|
+
setBusy(true);
|
|
270
|
+
const dots = add("typing", "{{NAME}} is working…");
|
|
271
|
+
try { show(await fn()); }
|
|
272
|
+
catch (e) { add("err", String(e.message || e)); }
|
|
273
|
+
finally { dots.remove(); setBusy(false); text.focus(); }
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function el(tag, cls, text) {
|
|
277
|
+
const e = document.createElement(tag);
|
|
278
|
+
if (cls) e.className = cls;
|
|
279
|
+
if (text !== undefined) e.textContent = text;
|
|
280
|
+
return e;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function renderGroups(groups) {
|
|
284
|
+
const box = $("groups");
|
|
285
|
+
box.textContent = "";
|
|
286
|
+
for (const g of groups) {
|
|
287
|
+
const card = el("section", "group" + (g.enabled ? "" : " off"));
|
|
288
|
+
const head = el("div", "group-head");
|
|
289
|
+
head.append(el("span", "dot"), el("span", "", g.name), el("span", "state", g.enabled ? "on" : "off"));
|
|
290
|
+
card.append(head);
|
|
291
|
+
if (!g.enabled) {
|
|
292
|
+
const m = el("div", "missing");
|
|
293
|
+
m.append(document.createTextNode("Missing: "));
|
|
294
|
+
g.missing.forEach((k, i) => { if (i) m.append(document.createTextNode(", ")); m.append(el("code", "", k)); });
|
|
295
|
+
m.append(el("div", "keys", g.setup));
|
|
296
|
+
card.append(m);
|
|
297
|
+
}
|
|
298
|
+
const ul = el("ul");
|
|
299
|
+
for (const t of g.catalog) {
|
|
300
|
+
const li = el("li", "", t.name);
|
|
301
|
+
if (t.approval) li.append(el("span", "tag", "approval"));
|
|
302
|
+
ul.append(li);
|
|
303
|
+
}
|
|
304
|
+
card.append(ul);
|
|
305
|
+
box.append(card);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
$("toggle").onclick = () => {
|
|
310
|
+
const open = document.body.classList.toggle("tools-open");
|
|
311
|
+
$("toggle").setAttribute("aria-expanded", String(open));
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
async function start() {
|
|
315
|
+
log.textContent = "";
|
|
316
|
+
waiting = false;
|
|
317
|
+
try {
|
|
318
|
+
const info = await call("/api/thread");
|
|
319
|
+
thread = info.thread;
|
|
320
|
+
$("meta").textContent = [info.model, info.keys && `keys: ${info.keys}`].filter(Boolean).join(" — ");
|
|
321
|
+
renderGroups(info.groups || []);
|
|
322
|
+
if (!info.speech) { mic.disabled = true; mic.title = "Speech to text is not set up"; }
|
|
323
|
+
add("hint", "Ask {{NAME}} a question. {{NAME}} asks you to approve each change.");
|
|
324
|
+
} catch (e) { add("err", String(e.message || e)); }
|
|
325
|
+
setBusy(false);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
$("form").addEventListener("submit", (e) => {
|
|
329
|
+
e.preventDefault();
|
|
330
|
+
const t = text.value.trim();
|
|
331
|
+
if (!t || busy || waiting || !thread) return;
|
|
332
|
+
text.value = ""; grow();
|
|
333
|
+
add("msg me", t);
|
|
334
|
+
run(() => call("/api/say", { thread, text: t }));
|
|
335
|
+
});
|
|
336
|
+
text.addEventListener("keydown", (e) => {
|
|
337
|
+
if (e.key === "Enter" && !e.shiftKey && !e.isComposing) { e.preventDefault(); $("form").requestSubmit(); }
|
|
338
|
+
});
|
|
339
|
+
const grow = () => { text.style.height = "auto"; text.style.height = Math.min(text.scrollHeight, 180) + "px"; };
|
|
340
|
+
text.addEventListener("input", grow);
|
|
341
|
+
$("new").onclick = start;
|
|
342
|
+
|
|
343
|
+
// Microphone: record in the page, then the agent turns the audio into text
|
|
344
|
+
// (POST /api/transcribe). It works in every browser with a microphone.
|
|
345
|
+
const SPEECH_RMS = 0.02; // louder than this counts as speech
|
|
346
|
+
const PAUSE_MS = 1500; // stop this long after the speech ends
|
|
347
|
+
const NO_SPEECH_MS = 8000; // give up when nobody speaks
|
|
348
|
+
const MAX_MS = 110000; // the server takes about two minutes
|
|
349
|
+
|
|
350
|
+
let recording = null;
|
|
351
|
+
|
|
352
|
+
function wavFrom(buffer) {
|
|
353
|
+
const data = buffer.getChannelData(0), rate = buffer.sampleRate;
|
|
354
|
+
const out = new DataView(new ArrayBuffer(44 + data.length * 2));
|
|
355
|
+
const str = (o, s) => { for (let i = 0; i < s.length; i++) out.setUint8(o + i, s.charCodeAt(i)); };
|
|
356
|
+
str(0, "RIFF"); out.setUint32(4, 36 + data.length * 2, true); str(8, "WAVE");
|
|
357
|
+
str(12, "fmt "); out.setUint32(16, 16, true); out.setUint16(20, 1, true); out.setUint16(22, 1, true);
|
|
358
|
+
out.setUint32(24, rate, true); out.setUint32(28, rate * 2, true); out.setUint16(32, 2, true); out.setUint16(34, 16, true);
|
|
359
|
+
str(36, "data"); out.setUint32(40, data.length * 2, true);
|
|
360
|
+
for (let i = 0; i < data.length; i++) {
|
|
361
|
+
const v = Math.max(-1, Math.min(1, data[i]));
|
|
362
|
+
out.setInt16(44 + i * 2, v < 0 ? v * 0x8000 : v * 0x7fff, true);
|
|
363
|
+
}
|
|
364
|
+
return new Uint8Array(out.buffer);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
async function toWav16k(blob) {
|
|
368
|
+
const ctx = new AudioContext();
|
|
369
|
+
try {
|
|
370
|
+
const decoded = await ctx.decodeAudioData(await blob.arrayBuffer());
|
|
371
|
+
const frames = Math.ceil(decoded.duration * 16000);
|
|
372
|
+
const off = new OfflineAudioContext(1, frames, 16000);
|
|
373
|
+
const src = off.createBufferSource();
|
|
374
|
+
src.buffer = decoded;
|
|
375
|
+
src.connect(off.destination);
|
|
376
|
+
src.start();
|
|
377
|
+
return wavFrom(await off.startRendering());
|
|
378
|
+
} finally { ctx.close(); }
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
function base64(bytes) {
|
|
382
|
+
let s = "";
|
|
383
|
+
for (let i = 0; i < bytes.length; i += 0x8000) s += String.fromCharCode.apply(null, bytes.subarray(i, i + 0x8000));
|
|
384
|
+
return btoa(s);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
function setMic(state) {
|
|
388
|
+
mic.classList.toggle("on", state === "listening");
|
|
389
|
+
mic.disabled = state === "working";
|
|
390
|
+
mic.title = state === "listening" ? "Stop" : state === "working" ? "Turning speech into text" : "Speak";
|
|
391
|
+
text.placeholder = state === "listening" ? "Listening… click the microphone to stop" : state === "working" ? "Turning speech into text…" : "Message {{NAME}}";
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
async function startRecording() {
|
|
395
|
+
if (!navigator.mediaDevices || !window.MediaRecorder) { add("err", "Microphone: this browser cannot record audio."); return; }
|
|
396
|
+
let stream;
|
|
397
|
+
try { stream = await navigator.mediaDevices.getUserMedia({ audio: { echoCancellation: true, noiseSuppression: true } }); }
|
|
398
|
+
catch (e) { add("err", "Microphone: " + (e.name === "NotAllowedError" ? "access was blocked. Allow the microphone for this page." : e.message)); return; }
|
|
399
|
+
if ("speechSynthesis" in window) speechSynthesis.cancel();
|
|
400
|
+
|
|
401
|
+
const chunks = [], rec = new MediaRecorder(stream);
|
|
402
|
+
const ctx = new AudioContext(), analyser = ctx.createAnalyser();
|
|
403
|
+
analyser.fftSize = 2048;
|
|
404
|
+
ctx.createMediaStreamSource(stream).connect(analyser);
|
|
405
|
+
const buf = new Float32Array(analyser.fftSize);
|
|
406
|
+
const t0 = Date.now();
|
|
407
|
+
let heard = false, lastLoud = t0;
|
|
408
|
+
|
|
409
|
+
const timer = setInterval(() => {
|
|
410
|
+
analyser.getFloatTimeDomainData(buf);
|
|
411
|
+
let sum = 0;
|
|
412
|
+
for (const v of buf) sum += v * v;
|
|
413
|
+
const now = Date.now();
|
|
414
|
+
if (Math.sqrt(sum / buf.length) > SPEECH_RMS) { heard = true; lastLoud = now; }
|
|
415
|
+
const paused = heard && $("autosend").checked && now - lastLoud > PAUSE_MS;
|
|
416
|
+
if (paused || (!heard && now - t0 > NO_SPEECH_MS) || now - t0 > MAX_MS) stop();
|
|
417
|
+
}, 100);
|
|
418
|
+
|
|
419
|
+
function stop() { if (rec.state !== "inactive") rec.stop(); }
|
|
420
|
+
|
|
421
|
+
rec.ondataavailable = (e) => { if (e.data.size) chunks.push(e.data); };
|
|
422
|
+
rec.onstop = async () => {
|
|
423
|
+
clearInterval(timer);
|
|
424
|
+
stream.getTracks().forEach((t) => t.stop());
|
|
425
|
+
ctx.close();
|
|
426
|
+
recording = null;
|
|
427
|
+
if (!heard) { setMic("idle"); add("err", "Microphone: no speech heard."); return; }
|
|
428
|
+
setMic("working");
|
|
429
|
+
try {
|
|
430
|
+
const wav = await toWav16k(new Blob(chunks, { type: rec.mimeType }));
|
|
431
|
+
const { text: said } = await call("/api/transcribe", { audio: base64(wav) });
|
|
432
|
+
if (!said) { add("err", "Microphone: no words found in the recording."); return; }
|
|
433
|
+
text.value = (text.value ? text.value.trimEnd() + " " : "") + said;
|
|
434
|
+
grow();
|
|
435
|
+
if ($("autosend").checked) $("form").requestSubmit(); else text.focus();
|
|
436
|
+
} catch (e) {
|
|
437
|
+
add("err", "Microphone: " + (e.message || e));
|
|
438
|
+
} finally { setMic("idle"); }
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
recording = { stop };
|
|
442
|
+
rec.start(250);
|
|
443
|
+
setMic("listening");
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
mic.onclick = () => { if (recording) recording.stop(); else startRecording(); };
|
|
447
|
+
|
|
448
|
+
start();
|
|
449
|
+
})();
|
|
450
|
+
</script>
|
|
451
|
+
</body>
|
|
452
|
+
</html>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type IncomingMessage, type ServerResponse } from "node:http";
|
|
2
|
+
import type { AgentGraph } from "../agent.js";
|
|
3
|
+
import type { GroupStatus } from "../../group.js";
|
|
4
|
+
import type { Transcriber } from "../transcribe.js";
|
|
5
|
+
export interface AgentInfo {
|
|
6
|
+
name?: string;
|
|
7
|
+
model: string;
|
|
8
|
+
groups: GroupStatus[];
|
|
9
|
+
keys: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function page(name: string): string;
|
|
12
|
+
export declare function startWeb(agent: AgentGraph, opts?: {
|
|
13
|
+
port?: number;
|
|
14
|
+
info?: AgentInfo;
|
|
15
|
+
transcribe?: Transcriber;
|
|
16
|
+
}): Promise<{
|
|
17
|
+
server: import("node:http").Server<typeof IncomingMessage, typeof ServerResponse>;
|
|
18
|
+
port: number;
|
|
19
|
+
url: string;
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { createServer } from "node:http";
|
|
4
|
+
import { resume, say } from "../turns.js";
|
|
5
|
+
const PAGE = readFileSync(new URL("./index.html", import.meta.url), "utf8");
|
|
6
|
+
// The name goes into HTML and into script strings, so it may hold only safe characters.
|
|
7
|
+
const SAFE_NAME = /^[A-Za-z0-9 _-]{1,40}$/;
|
|
8
|
+
export function page(name) {
|
|
9
|
+
if (!SAFE_NAME.test(name))
|
|
10
|
+
throw new Error(`agent name "${name}" must be 1 to 40 letters, digits, spaces, _ or -`);
|
|
11
|
+
return PAGE.replaceAll("{{NAME}}", name);
|
|
12
|
+
}
|
|
13
|
+
const MAX_BODY = 64 * 1024;
|
|
14
|
+
// 16 kHz mono 16-bit WAV is 32 kB a second: this is about two minutes.
|
|
15
|
+
const MAX_AUDIO = 4 * 1024 * 1024;
|
|
16
|
+
// Local web chat. It listens on 127.0.0.1 only. The Host check stops DNS rebinding.
|
|
17
|
+
// An API call must be JSON, and its Origin, if it has one, must be this server.
|
|
18
|
+
// A page on another site can send JSON only after a CORS preflight, and this
|
|
19
|
+
// server never allows one, so such a page cannot approve the agent's writes.
|
|
20
|
+
export async function startWeb(agent, opts = {}) {
|
|
21
|
+
const pending = new Map(); // thread -> interrupt id -> args hash
|
|
22
|
+
const busy = new Set();
|
|
23
|
+
let port = 0;
|
|
24
|
+
const name = opts.info?.name ?? "Agent";
|
|
25
|
+
const html = page(name);
|
|
26
|
+
const okHost = (h) => h === `127.0.0.1:${port}` || h === `localhost:${port}`;
|
|
27
|
+
const okOrigin = (o) => o === undefined || o === `http://localhost:${port}` || o === `http://127.0.0.1:${port}`;
|
|
28
|
+
function send(res, status, body) {
|
|
29
|
+
res.writeHead(status, { "Content-Type": "application/json", "Cache-Control": "no-store" });
|
|
30
|
+
res.end(JSON.stringify(body));
|
|
31
|
+
}
|
|
32
|
+
async function body(req, max = MAX_BODY) {
|
|
33
|
+
let size = 0;
|
|
34
|
+
const chunks = [];
|
|
35
|
+
for await (const c of req) {
|
|
36
|
+
size += c.length;
|
|
37
|
+
if (size > max)
|
|
38
|
+
throw new Error("request too large");
|
|
39
|
+
chunks.push(c);
|
|
40
|
+
}
|
|
41
|
+
const value = JSON.parse(Buffer.concat(chunks).toString("utf8") || "{}");
|
|
42
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
43
|
+
throw new Error("expected a JSON object");
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
function remember(thread, step) {
|
|
47
|
+
if (step.kind === "approvals")
|
|
48
|
+
pending.set(thread, new Map(step.items.map((i) => [i.id, i.argsHash])));
|
|
49
|
+
else
|
|
50
|
+
pending.delete(thread);
|
|
51
|
+
return step.kind === "approvals"
|
|
52
|
+
? { approvals: step.items.map(({ id, tool, summary, argsHash }) => ({ id, tool, summary, argsHash })) }
|
|
53
|
+
: { reply: step.text };
|
|
54
|
+
}
|
|
55
|
+
async function api(req, res, path) {
|
|
56
|
+
if (req.method !== "POST")
|
|
57
|
+
return send(res, 405, { error: "use POST" });
|
|
58
|
+
if (!okOrigin(req.headers.origin))
|
|
59
|
+
return send(res, 403, { error: "bad origin" });
|
|
60
|
+
if (!String(req.headers["content-type"] ?? "").startsWith("application/json")) {
|
|
61
|
+
return send(res, 415, { error: "use application/json" });
|
|
62
|
+
}
|
|
63
|
+
if (path === "/api/transcribe") {
|
|
64
|
+
if (!opts.transcribe)
|
|
65
|
+
return send(res, 501, { error: "speech to text is not set up" });
|
|
66
|
+
const b = await body(req, Math.ceil(MAX_AUDIO * 1.4));
|
|
67
|
+
const wav = typeof b.audio === "string" ? Buffer.from(b.audio, "base64") : Buffer.alloc(0);
|
|
68
|
+
if (wav.length < 44 || wav.toString("ascii", 0, 4) !== "RIFF" || wav.toString("ascii", 8, 12) !== "WAVE") {
|
|
69
|
+
return send(res, 400, { error: "audio must be a WAV file" });
|
|
70
|
+
}
|
|
71
|
+
if (wav.length > MAX_AUDIO)
|
|
72
|
+
return send(res, 413, { error: "recording is too long; keep it under two minutes" });
|
|
73
|
+
return send(res, 200, { text: await opts.transcribe(wav) });
|
|
74
|
+
}
|
|
75
|
+
const b = await body(req);
|
|
76
|
+
if (path === "/api/thread")
|
|
77
|
+
return send(res, 200, { thread: randomUUID(), ...opts.info, speech: !!opts.transcribe });
|
|
78
|
+
const thread = typeof b.thread === "string" && /^[0-9a-f-]{36}$/.test(b.thread) ? b.thread : undefined;
|
|
79
|
+
if (!thread)
|
|
80
|
+
return send(res, 400, { error: "thread is missing" });
|
|
81
|
+
if (busy.has(thread))
|
|
82
|
+
return send(res, 409, { error: `${name} is still busy with this conversation` });
|
|
83
|
+
busy.add(thread);
|
|
84
|
+
try {
|
|
85
|
+
if (path === "/api/say") {
|
|
86
|
+
if (pending.has(thread))
|
|
87
|
+
return send(res, 409, { error: "decide the open approvals first" });
|
|
88
|
+
const text = typeof b.text === "string" ? b.text.trim() : "";
|
|
89
|
+
if (!text || text.length > 8000)
|
|
90
|
+
return send(res, 400, { error: "text must be 1 to 8000 characters" });
|
|
91
|
+
return send(res, 200, remember(thread, await say(agent, thread, text)));
|
|
92
|
+
}
|
|
93
|
+
if (path === "/api/decide") {
|
|
94
|
+
const open = pending.get(thread);
|
|
95
|
+
const given = (b.decisions ?? {});
|
|
96
|
+
if (!open)
|
|
97
|
+
return send(res, 409, { error: "nothing waits for approval" });
|
|
98
|
+
if (Object.keys(given).sort().join() !== [...open.keys()].sort().join()) {
|
|
99
|
+
return send(res, 400, { error: "decide each open approval" });
|
|
100
|
+
}
|
|
101
|
+
const decisions = {};
|
|
102
|
+
for (const [id, hash] of open) {
|
|
103
|
+
const d = given[id];
|
|
104
|
+
decisions[id] = {
|
|
105
|
+
approved: d.approved === true,
|
|
106
|
+
argsHash: hash,
|
|
107
|
+
...(typeof d.reason === "string" && d.reason ? { reason: d.reason.slice(0, 500) } : {}),
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
return send(res, 200, remember(thread, await resume(agent, thread, decisions)));
|
|
111
|
+
}
|
|
112
|
+
return send(res, 404, { error: "not found" });
|
|
113
|
+
}
|
|
114
|
+
finally {
|
|
115
|
+
busy.delete(thread);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const server = createServer((req, res) => {
|
|
119
|
+
if (!okHost(req.headers.host)) {
|
|
120
|
+
res.writeHead(421).end();
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
const path = new URL(req.url ?? "/", "http://x").pathname;
|
|
124
|
+
if (path === "/" && req.method === "GET") {
|
|
125
|
+
res.writeHead(200, {
|
|
126
|
+
"Content-Type": "text/html; charset=utf-8",
|
|
127
|
+
"Cache-Control": "no-store",
|
|
128
|
+
"Content-Security-Policy": "default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; connect-src 'self'; img-src data:; base-uri 'none'; form-action 'none'; frame-ancestors 'none'",
|
|
129
|
+
"Referrer-Policy": "no-referrer",
|
|
130
|
+
"X-Content-Type-Options": "nosniff",
|
|
131
|
+
});
|
|
132
|
+
res.end(html);
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if (path.startsWith("/api/")) {
|
|
136
|
+
api(req, res, path).catch((err) => {
|
|
137
|
+
if (!res.headersSent)
|
|
138
|
+
send(res, 500, { error: err instanceof Error ? err.message : String(err) });
|
|
139
|
+
});
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
res.writeHead(404).end();
|
|
143
|
+
});
|
|
144
|
+
await new Promise((resolve, reject) => {
|
|
145
|
+
server.once("error", reject);
|
|
146
|
+
server.listen(opts.port ?? 4141, "127.0.0.1", () => resolve());
|
|
147
|
+
});
|
|
148
|
+
port = server.address().port;
|
|
149
|
+
return { server, port, url: `http://localhost:${port}/` };
|
|
150
|
+
}
|
package/dist/schemas.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Schemas shared by tool groups.
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export const domain = z
|
|
4
|
+
.string()
|
|
5
|
+
.regex(/^(?=.{1,253}$)([a-z0-9](-?[a-z0-9])*\.)+[a-z]{2,}$/, "a lowercase domain name, for example example.com")
|
|
6
|
+
.describe("Domain name, lowercase, for example example.com");
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AgentPolicy } from "./policy.js";
|
|
2
|
+
import type { SecretPlace, SecretStore } from "./secret-store.js";
|
|
3
|
+
import type { SecretSink } from "./secrets.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
export declare const secretName: z.ZodString;
|
|
6
|
+
export declare function storeAtFor(policy: AgentPolicy): z.ZodOptional<z.ZodObject<{
|
|
7
|
+
path: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
}, z.core.$strip>>;
|
|
10
|
+
export declare function placeText(policy: AgentPolicy, p: SecretPlace): string;
|
|
11
|
+
export declare function describePlace(policy: AgentPolicy, store: SecretStore, p: SecretPlace): Promise<string>;
|
|
12
|
+
export declare function deliverSecret(opts: {
|
|
13
|
+
policy: AgentPolicy;
|
|
14
|
+
secrets: SecretSink;
|
|
15
|
+
store?: SecretStore | undefined;
|
|
16
|
+
place?: SecretPlace | undefined;
|
|
17
|
+
}, label: string, value: string): Promise<string>;
|
|
18
|
+
export declare const NO_INFISICAL = "Not done: Infisical is not set up for you, so you cannot use storeAt. Call again without it.";
|