@actionbookdev/cli 0.3.0 → 0.4.0-alpha.1

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 DELETED
@@ -1,201 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright 2025 Cue Labs, Inc.
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare const browserCommand: Command;
3
- //# sourceMappingURL=browser.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/commands/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAInC,eAAO,MAAM,cAAc,SA0BvB,CAAA"}
@@ -1,27 +0,0 @@
1
- import { Command } from 'commander';
2
- import { spawnAgentBrowser, installAgentBrowser } from '../utils/process.js';
3
- export const browserCommand = new Command('browser')
4
- .description('Execute actionbook browser commands (browser automation)')
5
- .allowUnknownOption(true) // Critical: allow any args through
6
- .allowExcessArguments(true)
7
- .helpOption(false) // Disable built-in help, forward to agent-browser instead
8
- .action(async (_options, command) => {
9
- // Get all arguments passed after 'browser'
10
- const args = command.args;
11
- // If no args, show agent-browser help
12
- if (args.length === 0) {
13
- const exitCode = await spawnAgentBrowser(['--help']);
14
- process.exit(exitCode);
15
- return;
16
- }
17
- // Special handling for 'install' command
18
- if (args[0] === 'install') {
19
- const exitCode = await installAgentBrowser(args.slice(1));
20
- process.exit(exitCode);
21
- return;
22
- }
23
- // Forward all args to agent-browser (including -h, --help)
24
- const exitCode = await spawnAgentBrowser(args);
25
- process.exit(exitCode);
26
- });
27
- //# sourceMappingURL=browser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/commands/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAE5E,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC;KACjD,WAAW,CAAC,0DAA0D,CAAC;KACvE,kBAAkB,CAAC,IAAI,CAAC,CAAC,mCAAmC;KAC5D,oBAAoB,CAAC,IAAI,CAAC;KAC1B,UAAU,CAAC,KAAK,CAAC,CAAC,0DAA0D;KAC5E,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;IAClC,2CAA2C;IAC3C,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;IAEzB,sCAAsC;IACtC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,MAAM,QAAQ,GAAG,MAAM,iBAAiB,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAA;QACpD,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACtB,OAAM;IACR,CAAC;IAED,yCAAyC;IACzC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,QAAQ,GAAG,MAAM,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;QACzD,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACtB,OAAM;IACR,CAAC;IAED,2DAA2D;IAC3D,MAAM,QAAQ,GAAG,MAAM,iBAAiB,CAAC,IAAI,CAAC,CAAA;IAC9C,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;AACxB,CAAC,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare const getCommand: Command;
3
- //# sourceMappingURL=get.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../src/commands/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAInC,eAAO,MAAM,UAAU,SAgBnB,CAAA"}
@@ -1,20 +0,0 @@
1
- import { Command } from 'commander';
2
- import { Actionbook } from '@actionbookdev/sdk';
3
- import { getApiKey, handleError } from '../output.js';
4
- export const getCommand = new Command('get')
5
- .alias('g')
6
- .description('Get complete action details by area ID')
7
- .argument('<area_id>', 'Area ID (e.g., "airbnb.com:/:default")')
8
- .action(async (areaId, options) => {
9
- try {
10
- const apiKey = getApiKey(options);
11
- const client = new Actionbook({ apiKey });
12
- const result = await client.getActionByAreaId(areaId);
13
- // Result is now plain text, output directly
14
- console.log(result);
15
- }
16
- catch (error) {
17
- handleError(error);
18
- }
19
- });
20
- //# sourceMappingURL=get.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get.js","sourceRoot":"","sources":["../../src/commands/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAErD,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC;KACzC,KAAK,CAAC,GAAG,CAAC;KACV,WAAW,CAAC,wCAAwC,CAAC;KACrD,QAAQ,CAAC,WAAW,EAAE,wCAAwC,CAAC;KAC/D,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,OAAO,EAAE,EAAE;IACxC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAA;QACjC,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;QAEzC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAA;QAErD,4CAA4C;QAC5C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACrB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,CAAC,KAAK,CAAC,CAAA;IACpB,CAAC;AACH,CAAC,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare const searchCommand: Command;
3
- //# sourceMappingURL=search.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/commands/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKnC,eAAO,MAAM,aAAa,SA4BtB,CAAA"}
@@ -1,32 +0,0 @@
1
- import { Command } from 'commander';
2
- import { Actionbook } from '@actionbookdev/sdk';
3
- import chalk from 'chalk';
4
- import { getApiKey, handleError } from '../output.js';
5
- export const searchCommand = new Command('search')
6
- .alias('s')
7
- .description('Search for action manuals by keyword')
8
- .argument('<query>', 'Search keyword (e.g., "airbnb search", "google login")')
9
- .option('-d, --domain <domain>', 'Filter by domain (e.g., "airbnb.com")')
10
- .option('-u, --url <url>', 'Filter by URL')
11
- .option('-p, --page <number>', 'Page number', '1')
12
- .option('-s, --page-size <number>', 'Results per page (1-100)', '10')
13
- .action(async (query, options) => {
14
- try {
15
- const apiKey = getApiKey(options);
16
- const client = new Actionbook({ apiKey });
17
- const result = await client.searchActions({
18
- query,
19
- domain: options.domain,
20
- url: options.url,
21
- page: parseInt(options.page, 10),
22
- page_size: parseInt(options.pageSize, 10),
23
- });
24
- // Result is now plain text, output directly
25
- console.log(result);
26
- console.log(chalk.cyan('\nNext step: ') + chalk.white(`actionbook get "<area_id>"`));
27
- }
28
- catch (error) {
29
- handleError(error);
30
- }
31
- });
32
- //# sourceMappingURL=search.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/commands/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAErD,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC/C,KAAK,CAAC,GAAG,CAAC;KACV,WAAW,CAAC,sCAAsC,CAAC;KACnD,QAAQ,CAAC,SAAS,EAAE,wDAAwD,CAAC;KAC7E,MAAM,CAAC,uBAAuB,EAAE,uCAAuC,CAAC;KACxE,MAAM,CAAC,iBAAiB,EAAE,eAAe,CAAC;KAC1C,MAAM,CAAC,qBAAqB,EAAE,aAAa,EAAE,GAAG,CAAC;KACjD,MAAM,CAAC,0BAA0B,EAAE,0BAA0B,EAAE,IAAI,CAAC;KACpE,MAAM,CAAC,KAAK,EAAE,KAAa,EAAE,OAAO,EAAE,EAAE;IACvC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAA;QACjC,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;QAEzC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC;YACxC,KAAK;YACL,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;YAChC,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;SAC1C,CAAC,CAAA;QAEF,4CAA4C;QAC5C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAEnB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC,CAAA;IACtF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,CAAC,KAAK,CAAC,CAAA;IACpB,CAAC;AACH,CAAC,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare const sourcesCommand: Command;
3
- //# sourceMappingURL=sources.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../src/commands/sources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAMnC,eAAO,MAAM,cAAc,SAqBvB,CAAA"}
@@ -1,97 +0,0 @@
1
- import { Command } from 'commander';
2
- import { Actionbook } from '@actionbookdev/sdk';
3
- import chalk from 'chalk';
4
- import { getApiKey, handleError, outputResult } from '../output.js';
5
- export const sourcesCommand = new Command('sources')
6
- .description('List or search available sources (websites)')
7
- .option('-l, --limit <number>', 'Maximum results', '50')
8
- .option('-j, --json', 'Output raw JSON')
9
- .action(async (options) => {
10
- try {
11
- const apiKey = getApiKey(options);
12
- const client = new Actionbook({ apiKey });
13
- const result = await client.listSources({
14
- limit: parseInt(options.limit, 10),
15
- });
16
- if (options.json) {
17
- outputResult(result);
18
- }
19
- else {
20
- formatSourceList(result.results, result.count);
21
- }
22
- }
23
- catch (error) {
24
- handleError(error);
25
- }
26
- });
27
- // Add search subcommand
28
- sourcesCommand
29
- .command('search <query>')
30
- .alias('s')
31
- .description('Search for sources by keyword')
32
- .option('-l, --limit <number>', 'Maximum results', '10')
33
- .option('-j, --json', 'Output raw JSON')
34
- .action(async (query, options) => {
35
- try {
36
- // Get parent command options
37
- const parentOpts = sourcesCommand.opts();
38
- const apiKey = getApiKey({ ...parentOpts, ...options });
39
- const client = new Actionbook({ apiKey });
40
- const result = await client.searchSources({
41
- query,
42
- limit: parseInt(options.limit, 10),
43
- });
44
- if (options.json) {
45
- outputResult(result);
46
- }
47
- else {
48
- if (result.results.length === 0) {
49
- console.log(chalk.yellow(`\nNo sources found for "${query}"`));
50
- }
51
- else {
52
- console.log(chalk.bold.cyan(`\nSources matching "${query}"\n`));
53
- formatSourceList(result.results, result.count);
54
- }
55
- }
56
- }
57
- catch (error) {
58
- handleError(error);
59
- }
60
- });
61
- function formatSourceList(sources, count) {
62
- if (sources.length === 0) {
63
- console.log(chalk.yellow('No sources found'));
64
- return;
65
- }
66
- console.log(chalk.dim(`${count} source(s)\n`));
67
- // Calculate column widths
68
- const maxIdLen = Math.max(...sources.map((s) => String(s.id).length), 2);
69
- const maxNameLen = Math.min(Math.max(...sources.map((s) => s.name.length), 4), 30);
70
- // Header
71
- console.log(chalk.bold(`${'ID'.padEnd(maxIdLen)} ${'Name'.padEnd(maxNameLen)} ${'URL'}`));
72
- console.log(chalk.dim('─'.repeat(80)));
73
- // Rows
74
- for (const source of sources) {
75
- const id = String(source.id).padEnd(maxIdLen);
76
- const name = truncate(source.name, maxNameLen).padEnd(maxNameLen);
77
- const url = source.baseUrl;
78
- console.log(`${chalk.yellow(id)} ${chalk.white(name)} ${chalk.cyan(url)}`);
79
- if (source.description) {
80
- console.log(chalk.dim(`${''.padEnd(maxIdLen)} ${truncate(source.description, 70)}`));
81
- }
82
- if (source.tags?.length) {
83
- console.log(chalk.dim(`${''.padEnd(maxIdLen)} Tags: `) +
84
- source.tags.map((t) => chalk.magenta(t)).join(', '));
85
- }
86
- }
87
- console.log();
88
- console.log(chalk.cyan('Tip: ') +
89
- chalk.white('Use --domain with search to filter by domain'));
90
- console.log(chalk.dim('Example: actionbook search "login" --domain github.com'));
91
- }
92
- function truncate(str, maxLen) {
93
- if (str.length <= maxLen)
94
- return str;
95
- return str.substring(0, maxLen - 1) + '…';
96
- }
97
- //# sourceMappingURL=sources.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sources.js","sourceRoot":"","sources":["../../src/commands/sources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAGnE,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC;KACjD,WAAW,CAAC,6CAA6C,CAAC;KAC1D,MAAM,CAAC,sBAAsB,EAAE,iBAAiB,EAAE,IAAI,CAAC;KACvD,MAAM,CAA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IAAI,EAAE,MAAM,EAAE,CAAC;YACxB,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC;gBACzC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CACtD,CAAA;QACH,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,EAAE,CAAA;IACb,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;QACjB,KAAK,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAC9D,CAAA;IACD,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,GAAG,CAAC,wDAAwD,CAAC,CACpE,CAAA;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,GAAW,EAAE,MAAc;IAC3C,IAAI,GAAG,CAAC,MAAM,IAAI,MAAM;QAAE,OAAO,GAAG,CAAA;IACpC,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG,CAAA;AAC3C,CAAC"}
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js DELETED
@@ -1,23 +0,0 @@
1
- #!/usr/bin/env node
2
- import { Command } from 'commander';
3
- import { readFileSync } from 'node:fs';
4
- import { fileURLToPath } from 'node:url';
5
- import { dirname, join } from 'node:path';
6
- import { searchCommand } from './commands/search.js';
7
- import { getCommand } from './commands/get.js';
8
- // import { sourcesCommand } from './commands/sources.js'
9
- import { browserCommand } from './commands/browser.js';
10
- const __dirname = dirname(fileURLToPath(import.meta.url));
11
- const pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf-8'));
12
- const program = new Command();
13
- program
14
- .name('actionbook')
15
- .description('CLI for Actionbook - Get website action manuals for AI agents')
16
- .version(pkg.version)
17
- .option('--api-key <key>', 'API key (or set ACTIONBOOK_API_KEY env var)');
18
- program.addCommand(searchCommand);
19
- program.addCommand(getCommand);
20
- // program.addCommand(sourcesCommand)
21
- program.addCommand(browserCommand);
22
- program.parse();
23
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,yDAAyD;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AACzD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC,CAAA;AAEpF,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAA;AAE7B,OAAO;KACJ,IAAI,CAAC,YAAY,CAAC;KAClB,WAAW,CAAC,+DAA+D,CAAC;KAC5E,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;KACpB,MAAM,CAAC,iBAAiB,EAAE,6CAA6C,CAAC,CAAA;AAE3E,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;AACjC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAA;AAC9B,qCAAqC;AACrC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAA;AAElC,OAAO,CAAC,KAAK,EAAE,CAAA"}
package/dist/output.d.ts DELETED
@@ -1,15 +0,0 @@
1
- /**
2
- * Get API key from options or environment
3
- */
4
- export declare function getApiKey(options: {
5
- apiKey?: string;
6
- }): string | undefined;
7
- /**
8
- * Output result as JSON
9
- */
10
- export declare function outputResult(data: unknown): void;
11
- /**
12
- * Handle and display errors
13
- */
14
- export declare function handleError(error: unknown): void;
15
- //# sourceMappingURL=output.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,GAAG,SAAS,CAE1E;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAEhD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAahD"}
package/dist/output.js DELETED
@@ -1,34 +0,0 @@
1
- import chalk from 'chalk';
2
- import { isActionbookError } from '@actionbookdev/sdk';
3
- /**
4
- * Get API key from options or environment
5
- */
6
- export function getApiKey(options) {
7
- return options.apiKey ?? process.env.ACTIONBOOK_API_KEY;
8
- }
9
- /**
10
- * Output result as JSON
11
- */
12
- export function outputResult(data) {
13
- console.log(JSON.stringify(data, null, 2));
14
- }
15
- /**
16
- * Handle and display errors
17
- */
18
- export function handleError(error) {
19
- if (isActionbookError(error)) {
20
- console.error(chalk.red(`\nError: ${error.code}`));
21
- console.error(chalk.white(error.message));
22
- if (error.suggestion) {
23
- console.error(chalk.yellow(`\nSuggestion: ${error.suggestion}`));
24
- }
25
- }
26
- else if (error instanceof Error) {
27
- console.error(chalk.red(`\nError: ${error.message}`));
28
- }
29
- else {
30
- console.error(chalk.red('\nUnknown error occurred'));
31
- }
32
- process.exit(1);
33
- }
34
- //# sourceMappingURL=output.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAEtD;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,OAA4B;IACpD,OAAO,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAA;AACzD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,IAAa;IACxC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,IAAI,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;QAClD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAA;QACzC,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;YACrB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,iBAAiB,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAA;QAClE,CAAC;IACH,CAAC;SAAM,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAClC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;IACvD,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC,CAAA;IACtD,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC"}
@@ -1,24 +0,0 @@
1
- /**
2
- * Spawn a command with arguments, inheriting stdio
3
- * Returns the exit code
4
- * If command is not found (ENOENT), shows installation instructions
5
- * @param suppressInstallInstructions - If true, don't show installation instructions on ENOENT
6
- */
7
- export declare function spawnCommand(command: string, args: string[], suppressInstallInstructions?: boolean): Promise<number>;
8
- /**
9
- * Spawn agent-browser command using npx from CLI package directory
10
- * This ensures agent-browser is executed from the CLI's node_modules
11
- * Replaces "agent-browser" with "actionbook browser" in output
12
- */
13
- export declare function spawnAgentBrowser(args: string[]): Promise<number>;
14
- /**
15
- * Show installation instructions for agent-browser
16
- */
17
- export declare function showAgentBrowserInstallation(): void;
18
- /**
19
- * Install Chromium browser binaries for agent-browser
20
- * Uses playwright-core CLI from package dependencies to ensure version compatibility
21
- * @param installArgs - Additional arguments like ['--with-deps'] for Linux
22
- */
23
- export declare function installAgentBrowser(installArgs?: string[]): Promise<number>;
24
- //# sourceMappingURL=process.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../src/utils/process.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,2BAA2B,UAAQ,GAClC,OAAO,CAAC,MAAM,CAAC,CA+BjB;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAgDvE;AAED;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,IAAI,CAYnD;AA+CD;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,WAAW,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CA0DrF"}