@agentvault/agentvault 0.14.0 → 0.14.2

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.
@@ -0,0 +1,28 @@
1
+ /**
2
+ * AgentVault "create" command — spin up a brand new OpenClaw peer agent.
3
+ *
4
+ * Ports the logic from ~/.openclaw/workspace/scripts/create-agent.sh into
5
+ * TypeScript, eliminating the jq dependency.
6
+ *
7
+ * Usage: npx @agentvault/agentvault create <name> --token=av_tok_...
8
+ */
9
+ export interface CreateAgentOptions {
10
+ name: string;
11
+ token: string;
12
+ port?: number;
13
+ apiUrl: string;
14
+ force?: boolean;
15
+ }
16
+ /** Resolve the OpenClaw home directory (~/.openclaw) */
17
+ export declare function openclawHome(): string;
18
+ /** Parse openclaw.json and return its contents. */
19
+ export declare function readOpenClawConfig(home: string): any;
20
+ /**
21
+ * Scan all accounts in openclaw.json for httpPort values and return next free port.
22
+ * Minimum port is `startPort` (default 18790).
23
+ */
24
+ export declare function findNextPort(config: any, startPort?: number): number;
25
+ /** Generate workspace template files for a new agent. */
26
+ export declare function generateWorkspaceFiles(name: string): Record<string, string>;
27
+ export declare function runCreateCommand(options: CreateAgentOptions): Promise<void>;
28
+ //# sourceMappingURL=create-agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-agent.d.ts","sourceRoot":"","sources":["../src/create-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAID,wDAAwD;AACxD,wBAAgB,YAAY,IAAI,MAAM,CAGrC;AAED,mDAAmD;AACnD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAIpD;AAUD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,SAAQ,GAAG,MAAM,CAwBnE;AAgBD,yDAAyD;AACzD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA8C3E;AAID,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CA6KjF"}
@@ -29,6 +29,33 @@ export interface GatewayStatusResult {
29
29
  * Never throws — returns `{ ok: false, error }` on failure.
30
30
  */
31
31
  export declare function sendToOwner(text: string, options?: GatewaySendOptions): Promise<GatewaySendResult>;
32
+ /**
33
+ * Send a decision request to the agent's owner via the gateway HTTP server.
34
+ * Never throws — returns `{ ok: false, error }` on failure.
35
+ */
36
+ export declare function sendDecisionToOwner(request: {
37
+ title: string;
38
+ description?: string;
39
+ options: Array<{
40
+ option_id: string;
41
+ label: string;
42
+ risk_level?: string;
43
+ is_default?: boolean;
44
+ }>;
45
+ context_refs?: Array<{
46
+ type: string;
47
+ uri: string;
48
+ label: string;
49
+ }>;
50
+ deadline?: string;
51
+ auto_action?: {
52
+ option_id: string;
53
+ trigger: string;
54
+ description?: string;
55
+ };
56
+ }, options?: GatewaySendOptions): Promise<GatewaySendResult & {
57
+ decision_id?: string;
58
+ }>;
32
59
  /**
33
60
  * Check gateway health / status.
34
61
  * Never throws — returns `{ ok: false, error }` on failure.
@@ -1 +1 @@
1
- {"version":3,"file":"gateway-send.d.ts","sourceRoot":"","sources":["../src/gateway-send.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAA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GG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE;IACP,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,KAAK,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAChG,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5E,EACD,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,iBAAiB,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA8BvD;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAChC,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,mBAAmB,CAAC,CAoB9B"}
@@ -21,6 +21,10 @@ export declare function handleSendRequest(parsed: Record<string, unknown>, chann
21
21
  * Handle POST /action — send an action confirmation.
22
22
  */
23
23
  export declare function handleActionRequest(parsed: Record<string, unknown>, channel: SecureChannel): Promise<HandlerResult>;
24
+ /**
25
+ * Handle POST /decision — send a decision request to the owner.
26
+ */
27
+ export declare function handleDecisionRequest(parsed: Record<string, unknown>, channel: SecureChannel): Promise<HandlerResult>;
24
28
  /**
25
29
  * Handle GET /status — return channel health info.
26
30
  */
@@ -1 +1 @@
1
- {"version":3,"file":"http-handlers.d.ts","sourceRoot":"","sources":["../src/http-handlers.ts"],"names":[],"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E,OAAO,CAAC,EAC/B,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,aAAa,CAAC,CA8BxB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa,CAUzE"}
package/dist/index.d.ts CHANGED
@@ -3,12 +3,12 @@ export type { SecureChannelConfig, ChannelState, MessageMetadata, AttachmentData
3
3
  export { listAccountIds, resolveAccount } from "./account-config.js";
4
4
  export type { ResolvedAccount } from "./account-config.js";
5
5
  export { agentVaultPlugin, setOcRuntime, getActiveChannel } from "./openclaw-plugin.js";
6
- export { sendToOwner, checkGateway } from "./gateway-send.js";
6
+ export { sendToOwner, sendDecisionToOwner, checkGateway } from "./gateway-send.js";
7
7
  export type { GatewaySendOptions, GatewaySendResult, GatewayStatusResult, } from "./gateway-send.js";
8
8
  export { requestHeartbeatNow, onAgentEvent, onSessionTranscriptUpdate } from "./openclaw-compat.js";
9
9
  export { isUsingManagedRoutes } from "./openclaw-entry.js";
10
- export { handleSendRequest, handleActionRequest, handleStatusRequest } from "./http-handlers.js";
10
+ export { handleSendRequest, handleActionRequest, handleDecisionRequest, handleStatusRequest } from "./http-handlers.js";
11
11
  export type { HandlerResult } from "./http-handlers.js";
12
12
  export type { OpenClawPluginApi, PluginRuntime, ChannelGatewayContext, ChannelOutboundPayloadContext, ReplyPayload, MessageSentEvent, SessionStartEvent, SessionEndEvent, AgentEventPayload, TranscriptUpdatePayload, } from "./openclaw-types.js";
13
- export declare const VERSION = "0.14.0";
13
+ export declare const VERSION = "0.14.1";
14
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,YAAY,EACV,mBAAmB,EACnB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,YAAY,EACZ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WAAW,EACX,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,WAAW,EACX,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,SAAS,EACT,UAAU,EACV,UAAU,EACV,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG3D,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxF,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACnF,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAG3D,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACxH,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,YAAY,EACV,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,6BAA6B,EAC7B,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,OAAO,WAAW,CAAC"}
package/dist/index.js CHANGED
@@ -45880,6 +45880,7 @@ var init_openclaw_compat = __esm({
45880
45880
  var http_handlers_exports = {};
45881
45881
  __export(http_handlers_exports, {
45882
45882
  handleActionRequest: () => handleActionRequest,
45883
+ handleDecisionRequest: () => handleDecisionRequest,
45883
45884
  handleSendRequest: () => handleSendRequest,
45884
45885
  handleStatusRequest: () => handleStatusRequest
45885
45886
  });
@@ -45933,6 +45934,34 @@ async function handleActionRequest(parsed, channel) {
45933
45934
  return { status: 500, body: { ok: false, error: String(err) } };
45934
45935
  }
45935
45936
  }
45937
+ async function handleDecisionRequest(parsed, channel) {
45938
+ const title = parsed.title;
45939
+ if (!title || typeof title !== "string") {
45940
+ return { status: 400, body: { ok: false, error: "Missing 'title' field" } };
45941
+ }
45942
+ const options = parsed.options;
45943
+ if (!Array.isArray(options) || options.length < 2) {
45944
+ return { status: 400, body: { ok: false, error: "'options' must be an array with at least 2 items" } };
45945
+ }
45946
+ for (const opt of options) {
45947
+ if (!opt || typeof opt !== "object" || !opt.option_id || !opt.label) {
45948
+ return { status: 400, body: { ok: false, error: "Each option must have 'option_id' and 'label'" } };
45949
+ }
45950
+ }
45951
+ try {
45952
+ const decision_id = await channel.sendDecisionRequest({
45953
+ title,
45954
+ description: parsed.description,
45955
+ options,
45956
+ context_refs: parsed.context_refs,
45957
+ deadline: parsed.deadline,
45958
+ auto_action: parsed.auto_action
45959
+ });
45960
+ return { status: 200, body: { ok: true, decision_id } };
45961
+ } catch (err) {
45962
+ return { status: 500, body: { ok: false, error: String(err) } };
45963
+ }
45964
+ }
45936
45965
  function handleStatusRequest(channel) {
45937
45966
  return {
45938
45967
  status: 200,
@@ -46737,6 +46766,22 @@ var init_channel = __esm({
46737
46766
  res.end(JSON.stringify({ ok: false, error: String(err) }));
46738
46767
  }
46739
46768
  });
46769
+ } else if (req.method === "POST" && req.url === "/decision") {
46770
+ let body = "";
46771
+ req.on("data", (chunk) => {
46772
+ body += chunk.toString();
46773
+ });
46774
+ req.on("end", async () => {
46775
+ try {
46776
+ const parsed = JSON.parse(body);
46777
+ const result = await handlers.handleDecisionRequest(parsed, this);
46778
+ res.writeHead(result.status, { "Content-Type": "application/json" });
46779
+ res.end(JSON.stringify(result.body));
46780
+ } catch (err) {
46781
+ res.writeHead(500, { "Content-Type": "application/json" });
46782
+ res.end(JSON.stringify({ ok: false, error: String(err) }));
46783
+ }
46784
+ });
46740
46785
  } else if (req.method === "POST" && req.url === "/action") {
46741
46786
  let body = "";
46742
46787
  req.on("data", (chunk) => {
@@ -46759,7 +46804,7 @@ var init_channel = __esm({
46759
46804
  res.end(JSON.stringify(result.body));
46760
46805
  } else {
46761
46806
  res.writeHead(404, { "Content-Type": "application/json" });
46762
- res.end(JSON.stringify({ ok: false, error: "Not found. Use POST /send, POST /action, or GET /status" }));
46807
+ res.end(JSON.stringify({ ok: false, error: "Not found. Use POST /send, POST /decision, POST /action, or GET /status" }));
46763
46808
  }
46764
46809
  });
46765
46810
  this._httpServer.listen(port, "127.0.0.1", () => {
@@ -48804,7 +48849,7 @@ async function _handleInbound(params) {
48804
48849
  replyOptions: {}
48805
48850
  });
48806
48851
  }
48807
- var _ocRuntime, _channels, _usingManagedRoutes, agentVaultPlugin;
48852
+ var _ocRuntime, _channels, agentVaultPlugin;
48808
48853
  var init_openclaw_plugin = __esm({
48809
48854
  async "src/openclaw-plugin.ts"() {
48810
48855
  "use strict";
@@ -48813,7 +48858,6 @@ var init_openclaw_plugin = __esm({
48813
48858
  init_openclaw_compat();
48814
48859
  _ocRuntime = null;
48815
48860
  _channels = /* @__PURE__ */ new Map();
48816
- _usingManagedRoutes = false;
48817
48861
  agentVaultPlugin = {
48818
48862
  id: "agentvault",
48819
48863
  meta: {
@@ -48896,12 +48940,8 @@ var init_openclaw_plugin = __esm({
48896
48940
  });
48897
48941
  const httpPort = account.httpPort;
48898
48942
  channel.on("ready", () => {
48899
- if (!_usingManagedRoutes) {
48900
- channel.startHttpServer(httpPort);
48901
- _log?.(`[AgentVault] HTTP send server listening on http://127.0.0.1:${httpPort}`);
48902
- } else {
48903
- _log?.(`[AgentVault] using OpenClaw managed HTTP routes (skipping self-managed server)`);
48904
- }
48943
+ channel.startHttpServer(httpPort);
48944
+ _log?.(`[AgentVault] HTTP send server listening on http://127.0.0.1:${httpPort}`);
48905
48945
  });
48906
48946
  abortSignal?.addEventListener("abort", async () => {
48907
48947
  await channel.stop();
@@ -49034,6 +49074,34 @@ async function sendToOwner(text, options) {
49034
49074
  return { ok: false, error: friendlyError(err) };
49035
49075
  }
49036
49076
  }
49077
+ async function sendDecisionToOwner(request, options) {
49078
+ if (!request.title || typeof request.title !== "string") {
49079
+ return { ok: false, error: "Decision title must be a non-empty string" };
49080
+ }
49081
+ if (!Array.isArray(request.options) || request.options.length < 2) {
49082
+ return { ok: false, error: "Decision must have at least 2 options" };
49083
+ }
49084
+ requestHeartbeatNow({ reason: "proactive-decision" }).catch(() => {
49085
+ });
49086
+ try {
49087
+ const base = resolveBaseUrl(options);
49088
+ const path = process.env.OPENCLAW_GATEWAY_URL ? "/agentvault/decision" : "/decision";
49089
+ const res = await fetch(`${base}${path}`, {
49090
+ method: "POST",
49091
+ headers: { "Content-Type": "application/json" },
49092
+ body: JSON.stringify(request),
49093
+ signal: options?.signal
49094
+ });
49095
+ if (!res.ok) {
49096
+ const body = await res.text().catch(() => "");
49097
+ return { ok: false, error: `HTTP ${res.status}${body ? `: ${body}` : ""}` };
49098
+ }
49099
+ const data = await res.json();
49100
+ return { ok: true, decision_id: data.decision_id };
49101
+ } catch (err) {
49102
+ return { ok: false, error: friendlyError(err) };
49103
+ }
49104
+ }
49037
49105
  async function checkGateway(options) {
49038
49106
  try {
49039
49107
  const base = resolveBaseUrl(options);
@@ -49094,7 +49162,7 @@ var init_index = __esm({
49094
49162
  init_openclaw_compat();
49095
49163
  init_openclaw_entry();
49096
49164
  init_http_handlers();
49097
- VERSION = "0.14.0";
49165
+ VERSION = "0.14.1";
49098
49166
  }
49099
49167
  });
49100
49168
  await init_index();
@@ -49105,6 +49173,7 @@ export {
49105
49173
  checkGateway,
49106
49174
  getActiveChannel,
49107
49175
  handleActionRequest,
49176
+ handleDecisionRequest,
49108
49177
  handleSendRequest,
49109
49178
  handleStatusRequest,
49110
49179
  isUsingManagedRoutes,
@@ -49113,6 +49182,7 @@ export {
49113
49182
  onSessionTranscriptUpdate,
49114
49183
  requestHeartbeatNow,
49115
49184
  resolveAccount,
49185
+ sendDecisionToOwner,
49116
49186
  sendToOwner,
49117
49187
  setOcRuntime
49118
49188
  };