@ouro.bot/cli 0.1.0-alpha.227 → 0.1.0-alpha.229

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.
@@ -1,185 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.vaultToolDefinitions = void 0;
4
- const bitwarden_client_1 = require("./bitwarden-client");
5
- const runtime_1 = require("../nerves/runtime");
6
- exports.vaultToolDefinitions = [
7
- {
8
- tool: {
9
- type: "function",
10
- function: {
11
- name: "vault_get",
12
- description: "Retrieve a credential from the Bitwarden vault by ID or name. Returns metadata and fields but never raw passwords.",
13
- parameters: {
14
- type: "object",
15
- properties: {
16
- id: { type: "string", description: "Vault item ID (preferred)" },
17
- name: {
18
- type: "string",
19
- description: "Search by name (less precise, uses first match)",
20
- },
21
- },
22
- },
23
- },
24
- },
25
- handler: async (args) => {
26
- (0, runtime_1.emitNervesEvent)({
27
- component: "repertoire",
28
- event: "repertoire.vault_tool_call",
29
- message: "vault_get invoked",
30
- meta: { tool: "vault_get" },
31
- });
32
- try {
33
- const client = (0, bitwarden_client_1.getBitwardenClient)();
34
- if (args.id) {
35
- const item = await client.getItem(args.id);
36
- return JSON.stringify(item, null, 2);
37
- }
38
- if (args.name) {
39
- const items = await client.listItems(args.name);
40
- if (items.length === 0) {
41
- return `No vault item found matching "${args.name}". Try vault_list to see available items.`;
42
- }
43
- const item = await client.getItem(items[0].id);
44
- return JSON.stringify(item, null, 2);
45
- }
46
- return "Please provide either an id or name to look up a vault item.";
47
- }
48
- catch (err) {
49
- /* v8 ignore next -- defensive: callers throw Error instances @preserve */
50
- return `Vault error: ${err instanceof Error ? err.message : String(err)}`;
51
- }
52
- },
53
- summaryKeys: ["id", "name"],
54
- },
55
- {
56
- tool: {
57
- type: "function",
58
- function: {
59
- name: "vault_store",
60
- description: "Store a new credential in the Bitwarden vault. Supports login credentials, API keys, and structured fields.",
61
- parameters: {
62
- type: "object",
63
- properties: {
64
- name: { type: "string", description: "Name for the credential" },
65
- username: { type: "string", description: "Username (optional)" },
66
- password: { type: "string", description: "Password (optional)" },
67
- uri: { type: "string", description: "URI/URL (optional)" },
68
- notes: { type: "string", description: "Notes (optional)" },
69
- fields: {
70
- type: "string",
71
- description: 'JSON string of custom fields, e.g. {"apiKey": "key123", "region": "us-east"}',
72
- },
73
- },
74
- required: ["name"],
75
- },
76
- },
77
- },
78
- handler: async (args) => {
79
- (0, runtime_1.emitNervesEvent)({
80
- component: "repertoire",
81
- event: "repertoire.vault_tool_call",
82
- message: "vault_store invoked",
83
- meta: { tool: "vault_store", name: args.name },
84
- });
85
- try {
86
- const client = (0, bitwarden_client_1.getBitwardenClient)();
87
- const fields = {};
88
- if (args.username)
89
- fields.username = args.username;
90
- if (args.password)
91
- fields.password = args.password;
92
- if (args.uri)
93
- fields.uri = args.uri;
94
- if (args.notes)
95
- fields.notes = args.notes;
96
- if (args.fields) {
97
- const parsed = JSON.parse(args.fields);
98
- Object.assign(fields, parsed);
99
- }
100
- const handle = await client.createItem(args.name, fields);
101
- return JSON.stringify(handle, null, 2);
102
- }
103
- catch (err) {
104
- /* v8 ignore next -- defensive: callers throw Error instances @preserve */
105
- return `Vault error: ${err instanceof Error ? err.message : String(err)}`;
106
- }
107
- },
108
- confirmationRequired: true,
109
- summaryKeys: ["name"],
110
- },
111
- {
112
- tool: {
113
- type: "function",
114
- function: {
115
- name: "vault_list",
116
- description: "List credentials in the Bitwarden vault. Returns names and IDs only, never secrets.",
117
- parameters: {
118
- type: "object",
119
- properties: {
120
- search: {
121
- type: "string",
122
- description: "Optional search filter",
123
- },
124
- },
125
- },
126
- },
127
- },
128
- handler: async (args) => {
129
- (0, runtime_1.emitNervesEvent)({
130
- component: "repertoire",
131
- event: "repertoire.vault_tool_call",
132
- message: "vault_list invoked",
133
- meta: { tool: "vault_list" },
134
- });
135
- try {
136
- const client = (0, bitwarden_client_1.getBitwardenClient)();
137
- const items = await client.listItems(args.search);
138
- return JSON.stringify(items, null, 2);
139
- }
140
- catch (err) {
141
- /* v8 ignore next -- defensive: callers throw Error instances @preserve */
142
- return `Vault error: ${err instanceof Error ? err.message : String(err)}`;
143
- }
144
- },
145
- summaryKeys: ["search"],
146
- },
147
- {
148
- tool: {
149
- type: "function",
150
- function: {
151
- name: "vault_delete",
152
- description: "Delete a credential from the Bitwarden vault by ID.",
153
- parameters: {
154
- type: "object",
155
- properties: {
156
- id: {
157
- type: "string",
158
- description: "ID of the vault item to delete",
159
- },
160
- },
161
- required: ["id"],
162
- },
163
- },
164
- },
165
- handler: async (args) => {
166
- (0, runtime_1.emitNervesEvent)({
167
- component: "repertoire",
168
- event: "repertoire.vault_tool_call",
169
- message: "vault_delete invoked",
170
- meta: { tool: "vault_delete", id: args.id },
171
- });
172
- try {
173
- const client = (0, bitwarden_client_1.getBitwardenClient)();
174
- await client.deleteItem(args.id);
175
- return `Vault item ${args.id} deleted successfully.`;
176
- }
177
- catch (err) {
178
- /* v8 ignore next -- defensive: callers throw Error instances @preserve */
179
- return `Vault delete failed: ${err instanceof Error ? err.message : String(err)}`;
180
- }
181
- },
182
- confirmationRequired: true,
183
- summaryKeys: ["id"],
184
- },
185
- ];