@voicethere/cli 0.1.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 +188 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +130 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/build/list.d.ts +5 -0
- package/dist/commands/build/list.d.ts.map +1 -0
- package/dist/commands/build/list.js +33 -0
- package/dist/commands/build/list.js.map +1 -0
- package/dist/commands/build/promote.d.ts +10 -0
- package/dist/commands/build/promote.d.ts.map +1 -0
- package/dist/commands/build/promote.js +21 -0
- package/dist/commands/build/promote.js.map +1 -0
- package/dist/commands/build/upload.d.ts +8 -0
- package/dist/commands/build/upload.d.ts.map +1 -0
- package/dist/commands/build/upload.js +23 -0
- package/dist/commands/build/upload.js.map +1 -0
- package/dist/commands/build/validate.d.ts +6 -0
- package/dist/commands/build/validate.d.ts.map +1 -0
- package/dist/commands/build/validate.js +38 -0
- package/dist/commands/build/validate.js.map +1 -0
- package/dist/commands/deploy.d.ts +5 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +9 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/login.d.ts +6 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +14 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/projects/create.d.ts +10 -0
- package/dist/commands/projects/create.d.ts.map +1 -0
- package/dist/commands/projects/create.js +36 -0
- package/dist/commands/projects/create.js.map +1 -0
- package/dist/commands/projects/list.d.ts +2 -0
- package/dist/commands/projects/list.d.ts.map +1 -0
- package/dist/commands/projects/list.js +16 -0
- package/dist/commands/projects/list.js.map +1 -0
- package/dist/commands/projects/show.d.ts +2 -0
- package/dist/commands/projects/show.d.ts.map +1 -0
- package/dist/commands/projects/show.js +18 -0
- package/dist/commands/projects/show.js.map +1 -0
- package/dist/commands/projects/use.d.ts +8 -0
- package/dist/commands/projects/use.d.ts.map +1 -0
- package/dist/commands/projects/use.js +15 -0
- package/dist/commands/projects/use.js.map +1 -0
- package/dist/lib/api.d.ts +51 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/api.js +90 -0
- package/dist/lib/api.js.map +1 -0
- package/dist/lib/config.d.ts +10 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +51 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/project-config.d.ts +36 -0
- package/dist/lib/project-config.d.ts.map +1 -0
- package/dist/lib/project-config.js +113 -0
- package/dist/lib/project-config.js.map +1 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 A KIRILYUK LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# @voicethere/cli
|
|
2
|
+
|
|
3
|
+
VoiceThere cloud CLI for API login, project management, and agent bundle upload.
|
|
4
|
+
|
|
5
|
+
Requires **Node.js 22+**.
|
|
6
|
+
|
|
7
|
+
**Release flow:** `build upload` stores a bundle in history; `build promote <buildId>` sets the active build in the control plane; `deploy` (coming later) will also roll out to cloud runners.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g @voicethere/cli
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Or run without a global install:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx @voicethere/cli <command>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Typical workflow
|
|
22
|
+
|
|
23
|
+
### 1. One-time login (per machine)
|
|
24
|
+
|
|
25
|
+
API keys live in `~/.config/voicethere/credentials.json` (mode `0600`) — **not** in your agent repo.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
voicethere login --api-key vth_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
29
|
+
# local platform dev server:
|
|
30
|
+
voicethere login --api-key "$VOICETHERE_API_KEY" --api-base http://localhost:3000/api/v1
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Default API base: `https://app.voicethere.dev/api/v1`
|
|
34
|
+
|
|
35
|
+
### 2. New agent repo — create project and link via git
|
|
36
|
+
|
|
37
|
+
From your agent project root (where you build `dist/agent.js`):
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm install @voicethere/agent
|
|
41
|
+
npx @voicethere/agent build
|
|
42
|
+
|
|
43
|
+
# Creates the cloud project and writes .voicethere/config.json
|
|
44
|
+
voicethere projects create --name "My Voice Agent"
|
|
45
|
+
|
|
46
|
+
git add .voicethere/config.json
|
|
47
|
+
git commit -m "chore: link VoiceThere project"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`.voicethere/config.json` holds the **project id** and default **bundle** path. Commit it so teammates and CI use the same project without passing `--project` every time.
|
|
51
|
+
|
|
52
|
+
### 3. Upload a build (store artifact)
|
|
53
|
+
|
|
54
|
+
Upload **stores** a new immutable build in history — it does **not** go live yet.
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
voicethere build validate # optional but recommended
|
|
58
|
+
voicethere build upload -m "Add Spanish greeting and fix barge-in"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
`-m` / `--message` is like a git commit message: a short label so you can tell builds apart in `build list` and the dashboard.
|
|
62
|
+
|
|
63
|
+
`build upload` reads `project_id` and `bundle` from `.voicethere/config.json` when flags are omitted.
|
|
64
|
+
|
|
65
|
+
### 4. Promote a build (set active in control plane)
|
|
66
|
+
|
|
67
|
+
**Promote** sets the **active** build in the VoiceThere control plane. It does **not** roll out to cloud runners yet — use **`voicethere deploy`** when that command ships.
|
|
68
|
+
|
|
69
|
+
Pass the build UUID from **`build list`** or from the **`build upload`** output:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
voicethere build list
|
|
73
|
+
voicethere build promote <build-uuid>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Typical release loop:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npx @voicethere/agent build
|
|
80
|
+
voicethere build upload -m "v0.2 — shorter silence timeout"
|
|
81
|
+
voicethere build promote <build-uuid-from-upload-or-list>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 5. Clone an existing repo (config already in git)
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
git clone <your-agent-repo>
|
|
88
|
+
cd <your-agent-repo>
|
|
89
|
+
voicethere login --api-key "$VOICETHERE_API_KEY"
|
|
90
|
+
|
|
91
|
+
npx @voicethere/agent build
|
|
92
|
+
voicethere build upload
|
|
93
|
+
voicethere build list
|
|
94
|
+
voicethere build promote <build-uuid>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
No `projects create` needed — the linked project travels with the repo.
|
|
98
|
+
|
|
99
|
+
### 6. Link an existing cloud project (no create)
|
|
100
|
+
|
|
101
|
+
If the project already exists in the dashboard:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
voicethere projects list
|
|
105
|
+
voicethere projects use --project <uuid> --slug my-agent --bundle dist/agent.js
|
|
106
|
+
git add .voicethere/config.json && git commit -m "chore: link VoiceThere project"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Inspect the link anytime:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
voicethere projects show
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### 7. CI / automation
|
|
116
|
+
|
|
117
|
+
- **Credentials:** inject `VOICETHERE_API_KEY` and run `voicethere login` (or set `VOICETHERE_CREDENTIALS_PATH` in tests).
|
|
118
|
+
- **Project:** rely on committed `.voicethere/config.json` — no `--project` in the pipeline.
|
|
119
|
+
- **Override config path:** `VOICETHERE_PROJECT_CONFIG=/path/to/config.json`
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
voicethere login --api-key "$VOICETHERE_API_KEY"
|
|
123
|
+
npx @voicethere/agent build
|
|
124
|
+
voicethere build upload -m "$GITHUB_SHA — $GITHUB_REF_NAME" --skip-validate
|
|
125
|
+
voicethere build promote <build-uuid>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Split upload and promote in separate jobs if you want a human approval gate between them.
|
|
129
|
+
|
|
130
|
+
### 8. `deploy` (coming soon)
|
|
131
|
+
|
|
132
|
+
`voicethere deploy` will **promote and roll out to cloud runners** with optional `--wait`. It is **not implemented yet**; use `build promote` today.
|
|
133
|
+
|
|
134
|
+
## Repo config (version control)
|
|
135
|
+
|
|
136
|
+
Per-agent-repo link file: **`.voicethere/config.json`** (safe to commit — no API keys).
|
|
137
|
+
|
|
138
|
+
| Field | Purpose |
|
|
139
|
+
| ---------------------- | ---------------------------------------------------------- |
|
|
140
|
+
| `project_id` | Platform project UUID — used as default for `build upload` |
|
|
141
|
+
| `project_slug`, `name` | Human-readable metadata (optional) |
|
|
142
|
+
| `bundle` | Default bundle path (default `dist/agent.js`) |
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# Link an existing cloud project
|
|
146
|
+
voicethere projects use --project <uuid> --slug my-agent --bundle dist/agent.js
|
|
147
|
+
|
|
148
|
+
# Override path for tests
|
|
149
|
+
export VOICETHERE_PROJECT_CONFIG=/path/to/config.json
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**Secrets stay global:** `~/.config/voicethere/credentials.json` (from `voicethere login`).
|
|
153
|
+
Optional gitignored overrides: `.voicethere/local.json` (reserved for future use).
|
|
154
|
+
|
|
155
|
+
Example: [`.voicethere/config.json.example`](./.voicethere/config.json.example)
|
|
156
|
+
|
|
157
|
+
## Commands
|
|
158
|
+
|
|
159
|
+
| Command | Description |
|
|
160
|
+
| ----------------------------------------------------- | -------------------------------------------------------- |
|
|
161
|
+
| `login --api-key <key> [--api-base <url>]` | Save credentials |
|
|
162
|
+
| `projects list` | List org projects |
|
|
163
|
+
| `projects create --name <name> [--slug <slug>]` | Create project; writes `.voicethere/config.json` |
|
|
164
|
+
| `projects use --project <id>` | Link repo to existing project |
|
|
165
|
+
| `projects show` | Print linked `.voicethere/config.json` |
|
|
166
|
+
| `build list [--project <id>]` | Uploaded builds: id, time, message, active flag |
|
|
167
|
+
| `build validate [--file dist/agent.js]` | Run `@voicethere/agent verify --no-build --bundle` |
|
|
168
|
+
| `build upload [-m <msg>] [--project <id>] [--file …]` | Store build in history (does not promote) |
|
|
169
|
+
| `build promote <buildId> [--project <id>]` | Set active build in the control plane |
|
|
170
|
+
| `deploy` | **Coming soon** — promote + cloud rollout + wait |
|
|
171
|
+
|
|
172
|
+
## Development
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
npm ci
|
|
176
|
+
npm run test:ci
|
|
177
|
+
node dist/cli.js --help
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Credentials path override for tests:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
export VOICETHERE_CREDENTIALS_PATH=/tmp/voicethere-credentials.json
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## License
|
|
187
|
+
|
|
188
|
+
MIT — see [LICENSE](./LICENSE).
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import { runLogin } from "./commands/login.js";
|
|
4
|
+
import { runProjectsCreate } from "./commands/projects/create.js";
|
|
5
|
+
import { runProjectsList } from "./commands/projects/list.js";
|
|
6
|
+
import { runProjectsShow } from "./commands/projects/show.js";
|
|
7
|
+
import { runProjectsUse } from "./commands/projects/use.js";
|
|
8
|
+
import { runBuildPromote } from "./commands/build/promote.js";
|
|
9
|
+
import { runBuildList } from "./commands/build/list.js";
|
|
10
|
+
import { runBuildUpload } from "./commands/build/upload.js";
|
|
11
|
+
import { runBuildValidate } from "./commands/build/validate.js";
|
|
12
|
+
import { runDeployReserved } from "./commands/deploy.js";
|
|
13
|
+
import { DEFAULT_API_BASE } from "./lib/config.js";
|
|
14
|
+
async function main() {
|
|
15
|
+
const program = new Command();
|
|
16
|
+
program
|
|
17
|
+
.name("voicethere")
|
|
18
|
+
.description("VoiceThere cloud CLI")
|
|
19
|
+
.version("0.1.0");
|
|
20
|
+
program
|
|
21
|
+
.command("login")
|
|
22
|
+
.description("Store API key and API base URL")
|
|
23
|
+
.requiredOption("--api-key <key>", "VoiceThere API key (Bearer token)")
|
|
24
|
+
.option("--api-base <url>", "API base URL", DEFAULT_API_BASE)
|
|
25
|
+
.action(async (options) => {
|
|
26
|
+
await runLogin({
|
|
27
|
+
apiKey: options.apiKey,
|
|
28
|
+
apiBase: options.apiBase,
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
const projects = program
|
|
32
|
+
.command("projects")
|
|
33
|
+
.description("Manage agent projects");
|
|
34
|
+
projects
|
|
35
|
+
.command("list")
|
|
36
|
+
.description("List projects in your organization")
|
|
37
|
+
.action(async () => {
|
|
38
|
+
await runProjectsList();
|
|
39
|
+
});
|
|
40
|
+
projects
|
|
41
|
+
.command("create")
|
|
42
|
+
.description("Create a new project")
|
|
43
|
+
.requiredOption("--name <name>", "Project display name")
|
|
44
|
+
.option("--slug <slug>", "URL-safe slug (derived from name when omitted)")
|
|
45
|
+
.option("--no-link", "Do not write .voicethere/config.json in the current repo")
|
|
46
|
+
.option("--bundle <path>", "Default bundle path stored in .voicethere/config.json", "dist/agent.js")
|
|
47
|
+
.action(async (options) => {
|
|
48
|
+
await runProjectsCreate({
|
|
49
|
+
name: options.name,
|
|
50
|
+
slug: options.slug,
|
|
51
|
+
link: !options.noLink,
|
|
52
|
+
bundle: options.bundle,
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
projects
|
|
56
|
+
.command("use")
|
|
57
|
+
.description("Link this repo to a platform project (.voicethere/config.json)")
|
|
58
|
+
.requiredOption("--project <id>", "Project UUID")
|
|
59
|
+
.option("--slug <slug>", "Project slug (metadata only)")
|
|
60
|
+
.option("--name <name>", "Project display name (metadata only)")
|
|
61
|
+
.option("--bundle <path>", "Default bundle path", "dist/agent.js")
|
|
62
|
+
.action(async (options) => {
|
|
63
|
+
await runProjectsUse({
|
|
64
|
+
project: options.project,
|
|
65
|
+
slug: options.slug,
|
|
66
|
+
name: options.name,
|
|
67
|
+
bundle: options.bundle,
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
projects
|
|
71
|
+
.command("show")
|
|
72
|
+
.description("Show linked .voicethere/config.json for this repo")
|
|
73
|
+
.action(async () => {
|
|
74
|
+
await runProjectsShow();
|
|
75
|
+
});
|
|
76
|
+
const build = program.command("build").description("Agent bundle operations");
|
|
77
|
+
build
|
|
78
|
+
.command("validate")
|
|
79
|
+
.description("Run @voicethere/agent sandbox verify on a bundle")
|
|
80
|
+
.option("--file <path>", "Bundle path (default: config bundle or dist/agent.js)")
|
|
81
|
+
.action(async (options) => {
|
|
82
|
+
await runBuildValidate({ file: options.file });
|
|
83
|
+
});
|
|
84
|
+
build
|
|
85
|
+
.command("list")
|
|
86
|
+
.description("List uploaded builds (newest first)")
|
|
87
|
+
.option("--project <id>", "Project UUID (default: .voicethere/config.json project_id)")
|
|
88
|
+
.action(async (options) => {
|
|
89
|
+
await runBuildList({ project: options.project });
|
|
90
|
+
});
|
|
91
|
+
build
|
|
92
|
+
.command("upload")
|
|
93
|
+
.description("Validate (unless skipped) and upload a bundle")
|
|
94
|
+
.option("--project <id>", "Project UUID (default: .voicethere/config.json project_id)")
|
|
95
|
+
.option("--file <path>", "Bundle path (default: config bundle or dist/agent.js)")
|
|
96
|
+
.option("-m, --message <text>", "Build label (like a git commit message)")
|
|
97
|
+
.option("--skip-validate", "Upload without local sandbox verify")
|
|
98
|
+
.action(async (options) => {
|
|
99
|
+
await runBuildUpload({
|
|
100
|
+
project: options.project,
|
|
101
|
+
file: options.file,
|
|
102
|
+
message: options.message,
|
|
103
|
+
skipValidate: options.skipValidate,
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
build
|
|
107
|
+
.command("promote")
|
|
108
|
+
.description("Set active build in the control plane (platform promote API; no cluster rollout)")
|
|
109
|
+
.argument("<buildId>", "Build UUID to promote (from build list or upload output)")
|
|
110
|
+
.option("--project <id>", "Project UUID (default: .voicethere/config.json project_id)")
|
|
111
|
+
.action(async (buildId, options) => {
|
|
112
|
+
await runBuildPromote({
|
|
113
|
+
project: options.project,
|
|
114
|
+
buildId,
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
program
|
|
118
|
+
.command("deploy")
|
|
119
|
+
.description("[Coming soon] Promote + roll out to cloud runners (use build promote today)")
|
|
120
|
+
.action(async () => {
|
|
121
|
+
await runDeployReserved();
|
|
122
|
+
});
|
|
123
|
+
await program.parseAsync(process.argv);
|
|
124
|
+
}
|
|
125
|
+
main().catch((error) => {
|
|
126
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
127
|
+
console.error(`Error: ${message}`);
|
|
128
|
+
process.exitCode = 1;
|
|
129
|
+
});
|
|
130
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,KAAK,UAAU,IAAI;IACjB,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAE9B,OAAO;SACJ,IAAI,CAAC,YAAY,CAAC;SAClB,WAAW,CAAC,sBAAs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B,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,OAAO,CAAC,KAAK,CAAC,UAAU,OAAO,EAAE,CAAC,CAAC;IACnC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/build/list.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAaD,wBAAsB,YAAY,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB3E"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createApi } from "../../lib/api.js";
|
|
2
|
+
import { requireCredentials } from "../../lib/config.js";
|
|
3
|
+
import { requireProjectId } from "../../lib/project-config.js";
|
|
4
|
+
function formatUploadedAt(iso) {
|
|
5
|
+
const date = new Date(iso);
|
|
6
|
+
if (Number.isNaN(date.getTime())) {
|
|
7
|
+
return iso;
|
|
8
|
+
}
|
|
9
|
+
return date
|
|
10
|
+
.toISOString()
|
|
11
|
+
.replace("T", " ")
|
|
12
|
+
.replace(/\.\d{3}Z$/, " UTC");
|
|
13
|
+
}
|
|
14
|
+
export async function runBuildList(options) {
|
|
15
|
+
const projectId = await requireProjectId({ projectFlag: options.project });
|
|
16
|
+
const credentials = await requireCredentials();
|
|
17
|
+
const api = createApi(credentials.api_key, credentials.api_base);
|
|
18
|
+
const [project, builds] = await Promise.all([
|
|
19
|
+
api.getProject(projectId),
|
|
20
|
+
api.listBuilds(projectId),
|
|
21
|
+
]);
|
|
22
|
+
if (builds.length === 0) {
|
|
23
|
+
console.log("No builds uploaded yet.");
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
console.log("build_id\tuploaded_at\tstatus\tactive\tmessage");
|
|
27
|
+
for (const build of builds) {
|
|
28
|
+
const active = project.active_build_id === build.id ? "yes" : "";
|
|
29
|
+
const message = build.message?.replace(/\s+/g, " ").trim() ?? "";
|
|
30
|
+
console.log(`${build.id}\t${formatUploadedAt(build.created_at)}\t${build.validation_status}\t${active}\t${message}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/build/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAM/D,SAAS,gBAAgB,CAAC,GAAW;IACnC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;QACjC,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,IAAI;SACR,WAAW,EAAE;SACb,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;SACjB,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,OAAyB;IAC1D,MAAM,SAAS,GAAG,MAAM,gBAAgB,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAC3E,MAAM,WAAW,GAAG,MAAM,kBAAkB,EAAE,CAAC;IAC/C,MAAM,GAAG,GAAG,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAEjE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC1C,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC;QACzB,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC;KAC1B,CAAC,CAAC;IAEH,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;QACvC,OAAO;IACT,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;IAE9D,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,OAAO,CAAC,eAAe,KAAK,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACjE,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC;QACjE,OAAO,CAAC,GAAG,CACT,GAAG,KAAK,CAAC,EAAE,KAAK,gBAAgB,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,KAAK,CAAC,iBAAiB,KAAK,MAAM,KAAK,OAAO,EAAE,CACxG,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface BuildPromoteOptions {
|
|
2
|
+
project?: string;
|
|
3
|
+
buildId: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Promote sets the active build in the control plane (platform `POST …/promote`).
|
|
7
|
+
* Does not roll out to cloud runners — use `voicethere deploy` when available.
|
|
8
|
+
*/
|
|
9
|
+
export declare function runBuildPromote(options: BuildPromoteOptions): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=promote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promote.d.ts","sourceRoot":"","sources":["../../../src/commands/build/promote.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBjF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createApi } from "../../lib/api.js";
|
|
2
|
+
import { requireCredentials } from "../../lib/config.js";
|
|
3
|
+
import { requireProjectId } from "../../lib/project-config.js";
|
|
4
|
+
/**
|
|
5
|
+
* Promote sets the active build in the control plane (platform `POST …/promote`).
|
|
6
|
+
* Does not roll out to cloud runners — use `voicethere deploy` when available.
|
|
7
|
+
*/
|
|
8
|
+
export async function runBuildPromote(options) {
|
|
9
|
+
const buildId = options.buildId.trim();
|
|
10
|
+
if (!buildId) {
|
|
11
|
+
throw new Error("Build ID is required. Usage: voicethere build promote <buildId>");
|
|
12
|
+
}
|
|
13
|
+
const projectId = await requireProjectId({ projectFlag: options.project });
|
|
14
|
+
const credentials = await requireCredentials();
|
|
15
|
+
const api = createApi(credentials.api_key, credentials.api_base);
|
|
16
|
+
const result = await api.promote(projectId, buildId);
|
|
17
|
+
console.log(`Promoted build ${result.active_build_id} for project ${result.project_id}`);
|
|
18
|
+
console.log(`Active artifact: ${result.active_storage_path}`);
|
|
19
|
+
console.log("Control plane updated — cloud runner rollout is not available yet (future: voicethere deploy --wait).");
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=promote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promote.js","sourceRoot":"","sources":["../../../src/commands/build/promote.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAO/D;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAA4B;IAChE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACvC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,iEAAiE,CAClE,CAAC;IACJ,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,gBAAgB,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAC3E,MAAM,WAAW,GAAG,MAAM,kBAAkB,EAAE,CAAC;IAC/C,MAAM,GAAG,GAAG,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAEjE,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAErD,OAAO,CAAC,GAAG,CACT,kBAAkB,MAAM,CAAC,eAAe,gBAAgB,MAAM,CAAC,UAAU,EAAE,CAC5E,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,oBAAoB,MAAM,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAC9D,OAAO,CAAC,GAAG,CACT,uGAAuG,CACxG,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type BuildValidateOptions } from "./validate.js";
|
|
2
|
+
export interface BuildUploadOptions extends BuildValidateOptions {
|
|
3
|
+
project?: string;
|
|
4
|
+
message?: string;
|
|
5
|
+
skipValidate?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function runBuildUpload(options: BuildUploadOptions): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=upload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/commands/build/upload.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE5E,MAAM,WAAW,kBAAmB,SAAQ,oBAAoB;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,wBAAsB,cAAc,CAClC,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAoBf"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createApi } from "../../lib/api.js";
|
|
2
|
+
import { requireCredentials } from "../../lib/config.js";
|
|
3
|
+
import { requireProjectId, resolveBundlePath } from "../../lib/project-config.js";
|
|
4
|
+
import { runBuildValidate } from "./validate.js";
|
|
5
|
+
export async function runBuildUpload(options) {
|
|
6
|
+
const projectId = await requireProjectId({ projectFlag: options.project });
|
|
7
|
+
const bundlePath = await resolveBundlePath(options.file);
|
|
8
|
+
if (!options.skipValidate) {
|
|
9
|
+
await runBuildValidate({ file: bundlePath });
|
|
10
|
+
}
|
|
11
|
+
const credentials = await requireCredentials();
|
|
12
|
+
const api = createApi(credentials.api_key, credentials.api_base);
|
|
13
|
+
const build = await api.uploadBuild(projectId, bundlePath, options.message);
|
|
14
|
+
console.log(`Uploaded build ${build.id}`);
|
|
15
|
+
if (build.message) {
|
|
16
|
+
console.log(`Message: ${build.message}`);
|
|
17
|
+
}
|
|
18
|
+
console.log(`Uploaded at: ${build.created_at}`);
|
|
19
|
+
console.log("");
|
|
20
|
+
console.log("Upload stored in history. Promote when ready:");
|
|
21
|
+
console.log(` voicethere build promote ${build.id}`);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=upload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../../src/commands/build/upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,iBAAi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../../src/commands/build/validate.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mBAAmB,kBAAkB,CAAC;AAEnD,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAKf"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { access } from "node:fs/promises";
|
|
2
|
+
import { spawn } from "node:child_process";
|
|
3
|
+
import { constants } from "node:fs";
|
|
4
|
+
import { resolveBundlePath } from "../../lib/project-config.js";
|
|
5
|
+
export const DEFAULT_BUNDLE_PATH = "dist/agent.js";
|
|
6
|
+
export async function runBuildValidate(options) {
|
|
7
|
+
const bundlePath = await resolveBundlePath(options.file);
|
|
8
|
+
await assertBundleExists(bundlePath);
|
|
9
|
+
await spawnAgentVerify(bundlePath);
|
|
10
|
+
console.log(`Bundle validated: ${bundlePath}`);
|
|
11
|
+
}
|
|
12
|
+
async function assertBundleExists(bundlePath) {
|
|
13
|
+
try {
|
|
14
|
+
await access(bundlePath, constants.R_OK);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
throw new Error(`Bundle not found or not readable: ${bundlePath} — run: npx @voicethere/agent build`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
async function spawnAgentVerify(bundlePath) {
|
|
21
|
+
return new Promise((resolve, reject) => {
|
|
22
|
+
const child = spawn("npx", ["@voicethere/agent", "verify", "--no-build", "--bundle", bundlePath], {
|
|
23
|
+
stdio: "inherit",
|
|
24
|
+
shell: process.platform === "win32",
|
|
25
|
+
});
|
|
26
|
+
child.on("error", (error) => {
|
|
27
|
+
reject(error);
|
|
28
|
+
});
|
|
29
|
+
child.on("close", (code) => {
|
|
30
|
+
if (code === 0) {
|
|
31
|
+
resolve();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
reject(new Error(`Agent verify failed with exit code ${code ?? "unknown"}`));
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/commands/build/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,MAAM,CAAC,MAAM,mBAAmB,GAAG,eAAe,CAAC;AAMnD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,OAA6B;IAE7B,MAAM,UAAU,GAAG,MAAM,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,MAAM,kBAAkB,CAAC,UAAU,CAAC,CAAC;IACrC,MAAM,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACnC,OAAO,CAAC,GAAG,CAAC,qBAAqB,UAAU,EAAE,CAAC,CAAC;AACjD,CAAC;AAED,KAAK,UAAU,kBAAkB,CAAC,UAAkB;IAClD,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,qCAAqC,UAAU,qCAAqC,CACrF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,gBAAgB,CAAC,UAAkB;IAChD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,KAAK,GAAG,KAAK,CACjB,KAAK,EACL,CAAC,mBAAmB,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,CAAC,EACrE;YACE,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,OAAO,CAAC,QAAQ,KAAK,OAAO;SACpC,CACF,CAAC;QAEF,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YAC1B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YACzB,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;gBACf,OAAO,EAAE,CAAC;gBACV,OAAO;YACT,CAAC;YACD,MAAM,CACJ,IAAI,KAAK,CAAC,sCAAsC,IAAI,IAAI,SAAS,EAAE,CAAC,CACrE,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAQvD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Placeholder until deploy rolls out to cloud runners after promote.
|
|
3
|
+
*/
|
|
4
|
+
export async function runDeployReserved() {
|
|
5
|
+
console.error("voicethere deploy is not available yet — it will promote and roll out to cloud runners.");
|
|
6
|
+
console.error("Use: voicethere build promote <buildId> # set the active build in the control plane");
|
|
7
|
+
process.exitCode = 1;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=deploy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,OAAO,CAAC,KAAK,CACX,yFAAyF,CAC1F,CAAC;IACF,OAAO,CAAC,KAAK,CACX,uFAAuF,CACxF,CAAC;IACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,QAAQ,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBnE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DEFAULT_API_BASE, writeCredentials } from "../lib/config.js";
|
|
2
|
+
export async function runLogin(options) {
|
|
3
|
+
const apiKey = options.apiKey.trim();
|
|
4
|
+
if (!apiKey) {
|
|
5
|
+
throw new Error("--api-key is required");
|
|
6
|
+
}
|
|
7
|
+
const apiBase = (options.apiBase?.trim() || DEFAULT_API_BASE).replace(/\/$/, "");
|
|
8
|
+
await writeCredentials({
|
|
9
|
+
api_key: apiKey,
|
|
10
|
+
api_base: apiBase,
|
|
11
|
+
});
|
|
12
|
+
console.log(`Saved credentials to config (api_base=${apiBase})`);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=login.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAOtE,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,OAAqB;IAClD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACrC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IAED,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,gBAAgB,CAAC,CAAC,OAAO,CACnE,KAAK,EACL,EAAE,CACH,CAAC;IAEF,MAAM,gBAAgB,CAAC;QACrB,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE,OAAO;KAClB,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,yCAAyC,OAAO,GAAG,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ProjectsCreateOptions {
|
|
2
|
+
name: string;
|
|
3
|
+
slug?: string;
|
|
4
|
+
/** Write `.voicethere/config.json` with the new project id (default true). */
|
|
5
|
+
link?: boolean;
|
|
6
|
+
bundle?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function slugifyName(name: string): string;
|
|
9
|
+
export declare function runProjectsCreate(options: ProjectsCreateOptions): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/projects/create.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOhD;AAED,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,IAAI,CAAC,CA8Bf"}
|