@useconvoy/cli 0.48.0 → 0.52.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/README.md +17 -17
- package/dist/marketplace/.claude-plugin/marketplace.json +6 -6
- package/dist/marketplace/convoy/.claude-plugin/plugin.json +5 -0
- package/dist/marketplace/{opensana → convoy}/README.md +14 -14
- package/dist/marketplace/{opensana → convoy}/skills/tasks/SKILL.md +7 -7
- package/dist/marketplace/{opensana → convoy}/skills/tasks/references/mcp-setup.md +8 -8
- package/dist/src/agent/app/chunk-flush-buffer.js +26 -3
- package/dist/src/agent/app/chunk-flush-buffer.js.map +1 -1
- package/dist/src/agent/app/runner.js.map +1 -1
- package/dist/src/agent/app/thread-attachment-cache.js +2 -2
- package/dist/src/agent/app/thread-attachment-cache.js.map +1 -1
- package/dist/src/agent/app/thread-processor.d.ts +2 -2
- package/dist/src/agent/app/thread-processor.js +2 -2
- package/dist/src/agent/app/thread-processor.js.map +1 -1
- package/dist/src/agent/app/worktree-op-processor.d.ts +2 -2
- package/dist/src/agent/app/worktree-op-processor.js.map +1 -1
- package/dist/src/agent/runtimes/agent-instructions.d.ts +2 -2
- package/dist/src/agent/runtimes/agent-instructions.js +3 -3
- package/dist/src/agent/runtimes/agent-instructions.js.map +1 -1
- package/dist/src/agent/runtimes/claudeCode/prompts.js +1 -1
- package/dist/src/agent/runtimes/claudeCode/prompts.js.map +1 -1
- package/dist/src/agent/runtimes/claudeCode/runner.js +8 -8
- package/dist/src/agent/runtimes/claudeCode/runner.js.map +1 -1
- package/dist/src/agent/runtimes/claudeCode/runtime.js +2 -2
- package/dist/src/agent/runtimes/claudeCode/runtime.js.map +1 -1
- package/dist/src/agent/runtimes/codex/app-server-runner.js +3 -3
- package/dist/src/agent/runtimes/codex/app-server-runner.js.map +1 -1
- package/dist/src/agent/runtimes/codex/commands.d.ts +2 -2
- package/dist/src/agent/runtimes/codex/commands.js +2 -2
- package/dist/src/agent/runtimes/codex/runner.d.ts +1 -1
- package/dist/src/agent/runtimes/codex/runner.js +2 -2
- package/dist/src/agent/runtimes/codex/runner.js.map +1 -1
- package/dist/src/agent/runtimes/codex/runtime.js +5 -1
- package/dist/src/agent/runtimes/codex/runtime.js.map +1 -1
- package/dist/src/agent/runtimes/codex/streaming.d.ts +7 -0
- package/dist/src/agent/runtimes/codex/streaming.js +45 -0
- package/dist/src/agent/runtimes/codex/streaming.js.map +1 -0
- package/dist/src/agent/runtimes/contracts.d.ts +3 -5
- package/dist/src/agent/runtimes/cursor/commands.d.ts +1 -1
- package/dist/src/agent/runtimes/cursor/commands.js +1 -1
- package/dist/src/agent/runtimes/cursor/runner.d.ts +1 -1
- package/dist/src/agent/runtimes/cursor/runner.js +3 -3
- package/dist/src/agent/runtimes/cursor/runner.js.map +1 -1
- package/dist/src/agent/runtimes/cursor/runtime.js +1 -1
- package/dist/src/agent/runtimes/cursor/runtime.js.map +1 -1
- package/dist/src/agent/runtimes/debug.d.ts +1 -1
- package/dist/src/agent/runtimes/debug.js +2 -2
- package/dist/src/agent/runtimes/debug.js.map +1 -1
- package/dist/src/agent/runtimes/message-format.js +1 -1
- package/dist/src/agent/runtimes/message-format.js.map +1 -1
- package/dist/src/agent/runtimes/opencode/detect.d.ts +7 -1
- package/dist/src/agent/runtimes/opencode/detect.js +32 -9
- package/dist/src/agent/runtimes/opencode/detect.js.map +1 -1
- package/dist/src/agent/runtimes/opencode/runner.js +3 -3
- package/dist/src/agent/runtimes/opencode/runner.js.map +1 -1
- package/dist/src/agent/runtimes/opencode/runtime.js +1 -1
- package/dist/src/agent/runtimes/opencode/runtime.js.map +1 -1
- package/dist/src/agent/runtimes/opencode/server.d.ts +1 -1
- package/dist/src/agent/runtimes/opencode/server.js +3 -3
- package/dist/src/agent/runtimes/opencode/server.js.map +1 -1
- package/dist/src/agent/sdk/constants.d.ts +1 -1
- package/dist/src/agent/sdk/constants.js +1 -1
- package/dist/src/agent/sdk/constants.js.map +1 -1
- package/dist/src/agent/sdk/runtime/isolation-env.js +1 -1
- package/dist/src/agent/sdk/runtime/isolation-env.js.map +1 -1
- package/dist/src/agent/sdk/session-manager.js +1 -1
- package/dist/src/agent/sdk/session-manager.js.map +1 -1
- package/dist/src/cli.js +2 -0
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/connect/workflow.js +23 -4
- package/dist/src/commands/connect/workflow.js.map +1 -1
- package/dist/src/commands/devcontainer/command.js +2 -2
- package/dist/src/commands/devcontainer/command.js.map +1 -1
- package/dist/src/commands/devcontainer/install.d.ts +2 -2
- package/dist/src/commands/devcontainer/install.js +2 -2
- package/dist/src/commands/devcontainer/install.js.map +1 -1
- package/dist/src/commands/init/config/claude-mcp.d.ts +2 -2
- package/dist/src/commands/init/config/claude-mcp.js +3 -3
- package/dist/src/commands/init/config/claude-mcp.js.map +1 -1
- package/dist/src/commands/init/config/codex-mcp.d.ts +2 -2
- package/dist/src/commands/init/config/codex-mcp.js +4 -4
- package/dist/src/commands/init/config/codex-mcp.js.map +1 -1
- package/dist/src/commands/init/config/opencode-mcp.d.ts +2 -2
- package/dist/src/commands/init/config/opencode-mcp.js +4 -4
- package/dist/src/commands/init/config/opencode-mcp.js.map +1 -1
- package/dist/src/commands/init/io/file-copy.js +1 -1
- package/dist/src/commands/init/io/file-copy.js.map +1 -1
- package/dist/src/commands/init/prompts.js +1 -1
- package/dist/src/commands/init/prompts.js.map +1 -1
- package/dist/src/commands/init/targets/claude.js +9 -9
- package/dist/src/commands/init/targets/claude.js.map +1 -1
- package/dist/src/commands/init/targets/codex.js +4 -4
- package/dist/src/commands/init/targets/codex.js.map +1 -1
- package/dist/src/commands/init/targets/opencode.js +4 -4
- package/dist/src/commands/init/targets/opencode.js.map +1 -1
- package/dist/src/commands/init/types.d.ts +1 -1
- package/dist/src/commands/init/types.js +2 -2
- package/dist/src/commands/init/types.js.map +1 -1
- package/dist/src/commands/init.js +5 -5
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/labels/resolve.d.ts +2 -2
- package/dist/src/commands/labels/resolve.js.map +1 -1
- package/dist/src/commands/lists/resolve.d.ts +2 -2
- package/dist/src/commands/lists/resolve.js.map +1 -1
- package/dist/src/commands/prompts/create.js +6 -7
- package/dist/src/commands/prompts/create.js.map +1 -1
- package/dist/src/commands/prompts/list.js +3 -4
- package/dist/src/commands/prompts/list.js.map +1 -1
- package/dist/src/commands/setup/workflow.js +1 -1
- package/dist/src/commands/setup/workflow.js.map +1 -1
- package/dist/src/commands/skills/create.d.ts +2 -0
- package/dist/src/commands/skills/create.js +52 -0
- package/dist/src/commands/skills/create.js.map +1 -0
- package/dist/src/commands/skills/formatters.d.ts +4 -0
- package/dist/src/commands/skills/formatters.js +7 -0
- package/dist/src/commands/skills/formatters.js.map +1 -0
- package/dist/src/commands/skills/index.d.ts +2 -0
- package/dist/src/commands/skills/index.js +15 -0
- package/dist/src/commands/skills/index.js.map +1 -0
- package/dist/src/commands/skills/list.d.ts +2 -0
- package/dist/src/commands/skills/list.js +29 -0
- package/dist/src/commands/skills/list.js.map +1 -0
- package/dist/src/commands/skills/remove.d.ts +2 -0
- package/dist/src/commands/skills/remove.js +20 -0
- package/dist/src/commands/skills/remove.js.map +1 -0
- package/dist/src/commands/skills/show.d.ts +2 -0
- package/dist/src/commands/skills/show.js +34 -0
- package/dist/src/commands/skills/show.js.map +1 -0
- package/dist/src/commands/skills/update.d.ts +2 -0
- package/dist/src/commands/skills/update.js +59 -0
- package/dist/src/commands/skills/update.js.map +1 -0
- package/dist/src/commands/tasks/artifacts/index.js +2 -0
- package/dist/src/commands/tasks/artifacts/index.js.map +1 -1
- package/dist/src/commands/tasks/artifacts/move.d.ts +2 -0
- package/dist/src/commands/tasks/artifacts/move.js +39 -0
- package/dist/src/commands/tasks/artifacts/move.js.map +1 -0
- package/dist/src/commands/tasks/attachments/index.js +2 -0
- package/dist/src/commands/tasks/attachments/index.js.map +1 -1
- package/dist/src/commands/tasks/attachments/move.d.ts +2 -0
- package/dist/src/commands/tasks/attachments/move.js +48 -0
- package/dist/src/commands/tasks/attachments/move.js.map +1 -0
- package/dist/src/commands/tasks/attachments/resolve.d.ts +2 -2
- package/dist/src/commands/tasks/attachments/resolve.js.map +1 -1
- package/dist/src/commands/tasks/attachments/transfer.d.ts +2 -2
- package/dist/src/commands/tasks/attachments/transfer.js.map +1 -1
- package/dist/src/commands/tasks/hydrate.d.ts +3 -3
- package/dist/src/commands/tasks/hydrate.js.map +1 -1
- package/dist/src/commands/tasks/resolve.d.ts +3 -3
- package/dist/src/commands/tasks/resolve.js.map +1 -1
- package/dist/src/commands/threads/spawn-target.d.ts +2 -2
- package/dist/src/commands/threads/spawn-target.js.map +1 -1
- package/dist/src/convex/_generated/api.d.ts +20 -0
- package/dist/src/lib/config/convex-client.d.ts +1 -1
- package/dist/src/lib/config/index.d.ts +1 -1
- package/dist/src/lib/config/index.js +1 -1
- package/dist/src/lib/config/index.js.map +1 -1
- package/dist/src/lib/config/profile.d.ts +1 -1
- package/dist/src/lib/config/profile.js +1 -1
- package/dist/src/lib/config/provider-keys.d.ts +1 -1
- package/dist/src/lib/config/provider-keys.js +1 -1
- package/dist/src/lib/config/provider-keys.js.map +1 -1
- package/dist/src/lib/constants.d.ts +6 -6
- package/dist/src/lib/constants.js +6 -6
- package/dist/src/lib/constants.js.map +1 -1
- package/dist/src/lib/git/checkpoint.d.ts +1 -1
- package/dist/src/lib/git/checkpoint.js +4 -4
- package/dist/src/lib/git/checkpoint.js.map +1 -1
- package/dist/src/lib/git/worktrees.d.ts +1 -1
- package/dist/src/lib/git/worktrees.js +1 -1
- package/dist/src/lib/one-shot-command.d.ts +2 -2
- package/dist/src/lib/one-shot-command.js.map +1 -1
- package/dist/src/lib/organization-resolution.d.ts +8 -0
- package/dist/src/lib/organization-resolution.js +35 -0
- package/dist/src/lib/organization-resolution.js.map +1 -0
- package/dist/src/lib/project-resolution.d.ts +2 -2
- package/dist/src/lib/project-resolution.js.map +1 -1
- package/dist/src/lib/scope-resolution.d.ts +26 -0
- package/dist/src/lib/scope-resolution.js +33 -0
- package/dist/src/lib/scope-resolution.js.map +1 -0
- package/dist/src/lib/skill-install-guidance.d.ts +2 -2
- package/dist/src/lib/skill-install-guidance.js +7 -7
- package/dist/src/lib/skill-install-guidance.js.map +1 -1
- package/dist/src/lib/text-input.d.ts +5 -0
- package/dist/src/lib/text-input.js +10 -0
- package/dist/src/lib/text-input.js.map +1 -1
- package/dist/src/lib/thread-attachments.d.ts +2 -2
- package/dist/src/lib/thread-attachments.js.map +1 -1
- package/dist/src/lib/version.d.ts +6 -0
- package/dist/src/lib/version.js +25 -0
- package/dist/src/lib/version.js.map +1 -1
- package/dist/templates/devcontainer/Dockerfile +7 -1
- package/dist/templates/devcontainer/README.md +9 -7
- package/dist/templates/devcontainer/devcontainer.json +4 -4
- package/dist/templates/devcontainer/init-firewall.sh +38 -24
- package/package.json +4 -4
- package/dist/marketplace/opensana/.claude-plugin/plugin.json +0 -5
- package/dist/src/commands/prompts/parsers.d.ts +0 -9
- package/dist/src/commands/prompts/parsers.js +0 -12
- package/dist/src/commands/prompts/parsers.js.map +0 -1
- package/dist/src/commands/prompts/resolve.d.ts +0 -17
- package/dist/src/commands/prompts/resolve.js +0 -43
- package/dist/src/commands/prompts/resolve.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-input.js","sourceRoot":"","sources":["../../../src/lib/text-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,KAAa;IACtD,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,MAAM,IA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
1
|
import type { Id } from "../convex/_generated/dataModel.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ConvoyClient } from "./config/index.js";
|
|
3
3
|
/** What `cli.messages.send` / `cli.threads.create` take inline. */
|
|
4
4
|
export interface ThreadAttachmentInput {
|
|
5
5
|
storageId: Id<"_storage">;
|
|
@@ -18,4 +18,4 @@ export interface ThreadAttachmentInput {
|
|
|
18
18
|
* a committed send into a reported failure — losing the message id and inviting a
|
|
19
19
|
* retry that queues a duplicate.
|
|
20
20
|
*/
|
|
21
|
-
export declare function withThreadAttachments<T>(client:
|
|
21
|
+
export declare function withThreadAttachments<T>(client: ConvoyClient, projectId: Id<"projects">, files: string[], send: (attachments: ThreadAttachmentInput[]) => Promise<T>): Promise<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thread-attachments.js","sourceRoot":"","sources":["../../../src/lib/thread-attachments.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,GAAG,EAAE,MAAM,6BAA6B,CAAC;AAGlD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,8FAA8F;AAC9F,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B;;;;;GAKG;AACH,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAClC,MAAM,mBAAmB,GAAG,sBAAsB,GAAG,IAAI,GAAG,IAAI,CAAC;AAcjE,SAAS,gBAAgB,CAAC,KAAc;IACtC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,WAAW,CAAC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G,CAAC,GAAG,CAAC,QAAQ,CAAC,+BAA+B,EAAE;QAChE,SAAS;QACT,SAAS,EAAE,UAAU,CAAC,SAAS;KAChC,CAAC,CACH,CACF,CAAC;IAEF,KAAK,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;QAChD,IAAI,MAAM,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;YACjC,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;YAC7C,OAAO,CAAC,KAAK,CACX,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;gBACf,qCAAqC,SAAS,KAAK,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CACxF,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
/** The @useconvoy/cli package version, walking up from this module. */
|
|
2
2
|
export declare function getCliVersion(): string;
|
|
3
|
+
/**
|
|
4
|
+
* The npm `latest` version if it is newer than the running one, else null.
|
|
5
|
+
* Never throws — offline, self-hosted, and air-gapped installs get null.
|
|
6
|
+
* See docs/specs/cli-update-notice.md.
|
|
7
|
+
*/
|
|
8
|
+
export declare function checkForNewerVersion(timeoutMs?: number): Promise<string | null>;
|
package/dist/src/lib/version.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { compareVersions } from "../agent/sdk/versioning/provider-version.js";
|
|
5
|
+
const NPM_LATEST_URL = "https://registry.npmjs.org/@useconvoy/cli/latest";
|
|
4
6
|
function readPackageVersion(packageJsonPath) {
|
|
5
7
|
let packageJson;
|
|
6
8
|
try {
|
|
@@ -30,4 +32,27 @@ export function getCliVersion() {
|
|
|
30
32
|
}
|
|
31
33
|
return "0.0.0";
|
|
32
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* The npm `latest` version if it is newer than the running one, else null.
|
|
37
|
+
* Never throws — offline, self-hosted, and air-gapped installs get null.
|
|
38
|
+
* See docs/specs/cli-update-notice.md.
|
|
39
|
+
*/
|
|
40
|
+
export async function checkForNewerVersion(timeoutMs = 1500) {
|
|
41
|
+
try {
|
|
42
|
+
const response = await fetch(NPM_LATEST_URL, {
|
|
43
|
+
signal: AbortSignal.timeout(timeoutMs),
|
|
44
|
+
});
|
|
45
|
+
if (!response.ok) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
const { version } = (await response.json());
|
|
49
|
+
if (typeof version !== "string") {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
return compareVersions(version, getCliVersion()) > 0 ? version : null;
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
33
58
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/lib/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/lib/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAE9E,MAAM,cAAc,GAAG,kDAAkD,CAAC;AAE1E,SAAS,kBAAkB,CAAC,eAAuB;IACjD,IAAI,WAAoB,CAAC;IAEzB,IAAI,CAAC;QACH,WAAW,GAAG,I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YACjB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAA0B,CAAC;QACrE,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAChC,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,eAAe,CAAC,OAAO,EAAE,aAAa,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;IACxE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -89,7 +89,13 @@ ENV PATH=$PATH:/home/node/.local/bin
|
|
|
89
89
|
# Copy and set up the firewall script
|
|
90
90
|
COPY init-firewall.sh /usr/local/bin/
|
|
91
91
|
USER root
|
|
92
|
+
# env_keep is load-bearing: sudo's default env_reset strips the vars the firewall
|
|
93
|
+
# reads, so a strict-mode start (and the manual re-run in README.md) would silently
|
|
94
|
+
# lose the Convex, Bedrock-region, and extra-domain allowlist entries.
|
|
92
95
|
RUN chmod +x /usr/local/bin/init-firewall.sh && \
|
|
93
|
-
|
|
96
|
+
printf '%s\n' \
|
|
97
|
+
'node ALL=(root) NOPASSWD: /usr/local/bin/init-firewall.sh' \
|
|
98
|
+
'Defaults env_keep += "CONVEX_DEPLOYMENT AWS_REGION DEVCONTAINER_EXTRA_ALLOWED_DOMAINS"' \
|
|
99
|
+
> /etc/sudoers.d/node-devcontainer && \
|
|
94
100
|
chmod 0440 /etc/sudoers.d/node-devcontainer
|
|
95
101
|
USER node
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
A sandboxed dev container for running AI coding agents (Claude Code, Codex, OpenCode, Cursor CLI) against any project, with an optional outbound-network firewall.
|
|
4
4
|
|
|
5
|
-
This is the distributable version of the [
|
|
5
|
+
This is the distributable version of the [Convoy](https://convoy.build) dev container. It is generic: nothing in it requires Convoy, but Convoy users get their CLI profiles and Convex backend wired in automatically when the corresponding env vars are set.
|
|
6
6
|
|
|
7
7
|
## What you get
|
|
8
8
|
|
|
9
9
|
- **Claude Code, Codex CLI, OpenCode CLI, and Cursor CLI** installed globally from `latest` on container create (via `postCreateCommand`, so rebuilds are never stuck on a cached image layer's versions)
|
|
10
|
-
- **Agent auth shared with the host** — log in once on the host, the container reuses `~/.codex`, `~/.cursor`, `~/.local/share/opencode`, `~/.config/opencode`, and (optionally) `~/.config/
|
|
10
|
+
- **Agent auth shared with the host** — log in once on the host, the container reuses `~/.codex`, `~/.cursor`, `~/.local/share/opencode`, `~/.config/opencode`, and (optionally) `~/.config/convoy`
|
|
11
11
|
- **Two network modes** — `strict` blocks all outbound traffic except a curated allowlist; `open` skips the firewall
|
|
12
12
|
- **Persistent shell history and Claude Code config** across container rebuilds (Docker volumes)
|
|
13
13
|
- zsh + powerlevel10k, fzf, git-delta, gh, jq, corepack (pnpm/yarn via project pin)
|
|
14
14
|
|
|
15
15
|
## Install
|
|
16
16
|
|
|
17
|
-
### With the
|
|
17
|
+
### With the Convoy CLI
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
20
|
cd your-project
|
|
@@ -45,7 +45,7 @@ Everything is optional. The container pulls values from your host environment vi
|
|
|
45
45
|
| `AWS_BEARER_TOKEN_BEDROCK` | (unset) | Set to use Claude Code via AWS Bedrock |
|
|
46
46
|
| `CLAUDE_CODE_USE_BEDROCK` | (unset) | Set to `1` to route Claude Code through Bedrock |
|
|
47
47
|
| `AWS_REGION` | `us-east-1` | AWS region for the Bedrock firewall allowlist entry |
|
|
48
|
-
| `CONVEX_DEPLOYMENT` | (unset) |
|
|
48
|
+
| `CONVEX_DEPLOYMENT` | (unset) | Convoy/Convex deployment slug — adds `$CONVEX_DEPLOYMENT.convex.site` and `.convex.cloud` to the allowlist |
|
|
49
49
|
|
|
50
50
|
Export them in your shell profile (`~/.zshrc` / `~/.bashrc`) **before** the container starts, then rebuild.
|
|
51
51
|
|
|
@@ -57,7 +57,7 @@ Runs `init-firewall.sh` on container startup. All outbound traffic is blocked ex
|
|
|
57
57
|
|
|
58
58
|
- **GitHub** — git operations and API (GitHub meta API ranges, with a DNS fallback)
|
|
59
59
|
- **npm registry** — `registry.npmjs.org`
|
|
60
|
-
- **Anthropic** — `api.anthropic.com`, `
|
|
60
|
+
- **Anthropic** — `api.anthropic.com`, `claude.ai`, `claude.com`, `platform.claude.com` (sign-in plus OAuth token exchange, refresh, and revocation — required for both claude.ai and Console accounts), `sentry.io`, `statsig.com`
|
|
61
61
|
- **OpenAI / Codex** — `api.openai.com`, `auth.openai.com`, `auth.api.openai.org`, `chatgpt.com`, `chat.openai.com`, `ab.chatgpt.com`, `persistent.oaistatic.com`
|
|
62
62
|
- **OpenCode** — `opencode.ai`, `api.opencode.ai`, `models.dev`
|
|
63
63
|
- **Cursor** — `cursor.com`, `api2.cursor.sh`, `api3.cursor.sh`, `api4.cursor.sh`, `downloads.cursor.com`
|
|
@@ -67,6 +67,8 @@ Runs `init-firewall.sh` on container startup. All outbound traffic is blocked ex
|
|
|
67
67
|
- **Your extras** — anything in `DEVCONTAINER_EXTRA_ALLOWED_DOMAINS`
|
|
68
68
|
- **Localhost and the host network** — local dev servers, Docker DNS
|
|
69
69
|
|
|
70
|
+
A host that no longer resolves (or a DNS flake) is skipped with a `WARN:` line and listed again at the end of the setup log — the firewall is still applied without it. That is deliberate: aborting would leave the container with *no* firewall while still reporting `strict` mode. If an agent can only reach some services, read the setup log for those warnings first.
|
|
71
|
+
|
|
70
72
|
### `open`
|
|
71
73
|
|
|
72
74
|
Skips the firewall entirely. Use it when you want fewer networking surprises or broader tool compatibility.
|
|
@@ -99,7 +101,7 @@ The firewall resolves allowed domains to IPs once at startup. Providers rotate I
|
|
|
99
101
|
- **Codex** — shared with the host via `~/.codex`. Run `codex login` on the host; the container reuses `~/.codex/auth.json`.
|
|
100
102
|
- **OpenCode** — shared with the host via `~/.local/share/opencode` (auth) and `~/.config/opencode` (config). Run `opencode auth login` on the host. Providers other than Anthropic/OpenAI need their API endpoints added to the allowlist in strict mode.
|
|
101
103
|
- **Cursor CLI** — shared with the host via `~/.cursor`. Run `cursor-agent login` on the host; the container reuses the stored credentials.
|
|
102
|
-
- **
|
|
104
|
+
- **Convoy CLI** — profiles and API keys shared via `~/.config/convoy`. If you don't use Convoy the mount is harmless (the directory is auto-created empty).
|
|
103
105
|
|
|
104
106
|
## Mounted volumes
|
|
105
107
|
|
|
@@ -111,7 +113,7 @@ The firewall resolves allowed domains to IPs once at startup. Providers rotate I
|
|
|
111
113
|
| `~/.cursor/` | `/home/node/.cursor/` | Cursor CLI auth and config (shared with host) |
|
|
112
114
|
| `~/.local/share/opencode/` | `/home/node/.local/share/opencode/` | OpenCode auth and sessions (shared with host) |
|
|
113
115
|
| `~/.config/opencode/` | `/home/node/.config/opencode/` | OpenCode configuration (shared with host) |
|
|
114
|
-
| `~/.config/
|
|
116
|
+
| `~/.config/convoy/` | `/home/node/.config/convoy/` | Convoy CLI profiles and API keys (optional) |
|
|
115
117
|
|
|
116
118
|
The container's `initializeCommand` creates the host directories automatically if they are missing.
|
|
117
119
|
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"source=${localEnv:HOME}/.cursor,target=/home/node/.cursor,type=bind,consistency=cached",
|
|
43
43
|
"source=${localEnv:HOME}/.local/share/opencode,target=/home/node/.local/share/opencode,type=bind,consistency=cached",
|
|
44
44
|
"source=${localEnv:HOME}/.config/opencode,target=/home/node/.config/opencode,type=bind,consistency=cached",
|
|
45
|
-
// Optional:
|
|
46
|
-
"source=${localEnv:HOME}/.config/
|
|
45
|
+
// Optional: Convoy CLI profiles and API keys (harmless if you don't use Convoy)
|
|
46
|
+
"source=${localEnv:HOME}/.config/convoy,target=/home/node/.config/convoy,type=bind,consistency=cached"
|
|
47
47
|
],
|
|
48
48
|
"containerEnv": {
|
|
49
49
|
"DEVCONTAINER_NETWORK_MODE": "${localEnv:DEVCONTAINER_NETWORK_MODE:strict}",
|
|
@@ -67,14 +67,14 @@
|
|
|
67
67
|
"AWS_BEARER_TOKEN_BEDROCK": "${localEnv:AWS_BEARER_TOKEN_BEDROCK}",
|
|
68
68
|
"AWS_REGION": "${localEnv:AWS_REGION:us-east-1}",
|
|
69
69
|
"CLAUDE_CODE_USE_BEDROCK": "${localEnv:CLAUDE_CODE_USE_BEDROCK}",
|
|
70
|
-
// Optional:
|
|
70
|
+
// Optional: Convoy/Convex backend — adds $CONVEX_DEPLOYMENT.convex.{site,cloud} to the strict-mode firewall allowlist
|
|
71
71
|
"CONVEX_DEPLOYMENT": "${localEnv:CONVEX_DEPLOYMENT}",
|
|
72
72
|
// Optional: extra domains for the strict-mode firewall allowlist (comma or space separated)
|
|
73
73
|
"DEVCONTAINER_EXTRA_ALLOWED_DOMAINS": "${localEnv:DEVCONTAINER_EXTRA_ALLOWED_DOMAINS}"
|
|
74
74
|
},
|
|
75
75
|
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=delegated",
|
|
76
76
|
"workspaceFolder": "/workspace",
|
|
77
|
-
"initializeCommand": "mkdir -p \"${localEnv:HOME}/.codex\" \"${localEnv:HOME}/.cursor\" \"${localEnv:HOME}/.local/share/opencode\" \"${localEnv:HOME}/.config/opencode\" \"${localEnv:HOME}/.config/
|
|
77
|
+
"initializeCommand": "mkdir -p \"${localEnv:HOME}/.codex\" \"${localEnv:HOME}/.cursor\" \"${localEnv:HOME}/.local/share/opencode\" \"${localEnv:HOME}/.config/opencode\" \"${localEnv:HOME}/.config/convoy\"",
|
|
78
78
|
// Agent CLIs install here, not in the Dockerfile: Docker caches a
|
|
79
79
|
// `RUN npm install -g ...@latest` layer forever, so rebuilds silently keep the
|
|
80
80
|
// first build's versions. postCreateCommand runs once per container create,
|
|
@@ -70,13 +70,14 @@ resolve_github_fallback_ips() {
|
|
|
70
70
|
DOCKER_DNS_RULES=$(iptables-save -t nat | grep "127\.0\.0\.11" || true)
|
|
71
71
|
|
|
72
72
|
# 1b. Get host IP from default route
|
|
73
|
-
HOST_IP=$(ip route | grep default | cut -d" " -f3)
|
|
73
|
+
HOST_IP=$(ip route | grep default | cut -d" " -f3 || true)
|
|
74
|
+
HOST_NETWORK=""
|
|
74
75
|
if [ -z "$HOST_IP" ]; then
|
|
75
|
-
echo "
|
|
76
|
-
|
|
76
|
+
echo "WARN: Failed to detect host IP - the host network will NOT be allowed" >&2
|
|
77
|
+
else
|
|
78
|
+
HOST_NETWORK=$(echo "$HOST_IP" | sed "s/\.[0-9]*$/.0\/24/")
|
|
79
|
+
echo "Host network detected as: $HOST_NETWORK"
|
|
77
80
|
fi
|
|
78
|
-
HOST_NETWORK=$(echo "$HOST_IP" | sed "s/\.[0-9]*$/.0\/24/")
|
|
79
|
-
echo "Host network detected as: $HOST_NETWORK"
|
|
80
81
|
|
|
81
82
|
# 1c. Temporarily allow all outbound HTTPS so we can fetch GitHub IP ranges and resolve domains
|
|
82
83
|
# (needed when re-running the script after firewall is already locked down)
|
|
@@ -96,8 +97,7 @@ else
|
|
|
96
97
|
fi
|
|
97
98
|
|
|
98
99
|
if [ -z "${GITHUB_ALLOWLIST:-}" ]; then
|
|
99
|
-
echo "
|
|
100
|
-
exit 1
|
|
100
|
+
echo "WARN: Failed to build GitHub allowlist - GitHub will NOT be reachable" >&2
|
|
101
101
|
fi
|
|
102
102
|
|
|
103
103
|
# 1e. Build the allowed-domain list
|
|
@@ -106,6 +106,9 @@ AWS_REGION_VALUE="${AWS_REGION:-us-east-1}"
|
|
|
106
106
|
ALLOWED_DOMAINS=(
|
|
107
107
|
"registry.npmjs.org"
|
|
108
108
|
"api.anthropic.com"
|
|
109
|
+
"claude.ai"
|
|
110
|
+
"claude.com"
|
|
111
|
+
"platform.claude.com"
|
|
109
112
|
"api.openai.com"
|
|
110
113
|
"auth.openai.com"
|
|
111
114
|
"auth.api.openai.org"
|
|
@@ -122,7 +125,6 @@ ALLOWED_DOMAINS=(
|
|
|
122
125
|
"api4.cursor.sh"
|
|
123
126
|
"downloads.cursor.com"
|
|
124
127
|
"sentry.io"
|
|
125
|
-
"statsig.anthropic.com"
|
|
126
128
|
"statsig.com"
|
|
127
129
|
"marketplace.visualstudio.com"
|
|
128
130
|
"vscode.blob.core.windows.net"
|
|
@@ -130,7 +132,7 @@ ALLOWED_DOMAINS=(
|
|
|
130
132
|
"bedrock-runtime.${AWS_REGION_VALUE}.amazonaws.com"
|
|
131
133
|
)
|
|
132
134
|
|
|
133
|
-
# Optional:
|
|
135
|
+
# Optional: Convoy/Convex backend (set CONVEX_DEPLOYMENT on the host to enable)
|
|
134
136
|
if [ -n "${CONVEX_DEPLOYMENT:-}" ]; then
|
|
135
137
|
ALLOWED_DOMAINS+=(
|
|
136
138
|
"${CONVEX_DEPLOYMENT}.convex.site"
|
|
@@ -150,19 +152,25 @@ if [ -n "${DEVCONTAINER_EXTRA_ALLOWED_DOMAINS:-}" ]; then
|
|
|
150
152
|
done < <(printf "%s\n" "$DEVCONTAINER_EXTRA_ALLOWED_DOMAINS" | tr ', ' '\n\n')
|
|
151
153
|
fi
|
|
152
154
|
|
|
153
|
-
# 1f. Resolve all allowed domains to IPs
|
|
155
|
+
# 1f. Resolve all allowed domains to IPs.
|
|
156
|
+
# Nothing from here to the DROP policy in 2f may exit: this phase runs while the
|
|
157
|
+
# container is still unrestricted (1c even opens 443 outright), so aborting leaves
|
|
158
|
+
# it with no firewall at all while `strict` mode claims otherwise. Skip what fails
|
|
159
|
+
# and report it at the end instead.
|
|
154
160
|
declare -A DOMAIN_IPS
|
|
161
|
+
UNRESOLVED_DOMAINS=()
|
|
155
162
|
for domain in "${ALLOWED_DOMAINS[@]}"; do
|
|
156
163
|
echo "Resolving $domain..."
|
|
157
|
-
ips=$(resolve_ipv4_records "$domain")
|
|
164
|
+
ips=$(resolve_ipv4_records "$domain" || true)
|
|
158
165
|
if [ -z "$ips" ]; then
|
|
159
|
-
echo "
|
|
160
|
-
|
|
166
|
+
echo "WARN: Failed to resolve $domain - it will NOT be reachable" >&2
|
|
167
|
+
UNRESOLVED_DOMAINS+=("$domain")
|
|
168
|
+
continue
|
|
161
169
|
fi
|
|
162
170
|
DOMAIN_IPS["$domain"]="$ips"
|
|
163
171
|
done
|
|
164
172
|
|
|
165
|
-
echo "
|
|
173
|
+
echo "External data gathered"
|
|
166
174
|
|
|
167
175
|
# ==============================================================================
|
|
168
176
|
# Phase 2: Flush all rules and rebuild firewall from cached data
|
|
@@ -206,26 +214,26 @@ while read -r entry; do
|
|
|
206
214
|
|
|
207
215
|
if [ "$GITHUB_ALLOWLIST_KIND" = "cidr" ]; then
|
|
208
216
|
if [[ ! "$entry" =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/[0-9]{1,2}$ ]]; then
|
|
209
|
-
echo "
|
|
210
|
-
|
|
217
|
+
echo "WARN: Skipping invalid CIDR range from GitHub meta: $entry" >&2
|
|
218
|
+
continue
|
|
211
219
|
fi
|
|
212
220
|
echo "Adding GitHub range $entry"
|
|
213
221
|
else
|
|
214
222
|
if [[ ! "$entry" =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
|
|
215
|
-
echo "
|
|
216
|
-
|
|
223
|
+
echo "WARN: Skipping invalid fallback GitHub IP: $entry" >&2
|
|
224
|
+
continue
|
|
217
225
|
fi
|
|
218
226
|
echo "Adding GitHub fallback IP $entry"
|
|
219
227
|
fi
|
|
220
228
|
|
|
221
229
|
ipset add allowed-domains "$entry"
|
|
222
|
-
done < <(printf "%s\n" "$GITHUB_ALLOWLIST")
|
|
230
|
+
done < <(printf "%s\n" "${GITHUB_ALLOWLIST:-}")
|
|
223
231
|
|
|
224
232
|
for domain in "${!DOMAIN_IPS[@]}"; do
|
|
225
233
|
while read -r ip; do
|
|
226
234
|
if [[ ! "$ip" =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
|
|
227
|
-
echo "
|
|
228
|
-
|
|
235
|
+
echo "WARN: Skipping invalid IP from DNS for $domain: $ip" >&2
|
|
236
|
+
continue
|
|
229
237
|
fi
|
|
230
238
|
echo "Adding $ip for $domain"
|
|
231
239
|
ipset add allowed-domains "$ip" 2>/dev/null || true
|
|
@@ -233,9 +241,11 @@ for domain in "${!DOMAIN_IPS[@]}"; do
|
|
|
233
241
|
done
|
|
234
242
|
|
|
235
243
|
# 2e. Allow host network
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
iptables -A
|
|
244
|
+
if [ -n "$HOST_NETWORK" ]; then
|
|
245
|
+
echo "Allowing host network: $HOST_NETWORK"
|
|
246
|
+
iptables -A INPUT -s "$HOST_NETWORK" -j ACCEPT
|
|
247
|
+
iptables -A OUTPUT -d "$HOST_NETWORK" -j ACCEPT
|
|
248
|
+
fi
|
|
239
249
|
|
|
240
250
|
# 2f. Set default policies to DROP
|
|
241
251
|
iptables -P INPUT DROP
|
|
@@ -255,6 +265,10 @@ iptables -A OUTPUT -j REJECT --reject-with icmp-admin-prohibited
|
|
|
255
265
|
# ==============================================================================
|
|
256
266
|
|
|
257
267
|
echo "Firewall configuration complete"
|
|
268
|
+
if [ ${#UNRESOLVED_DOMAINS[@]} -gt 0 ]; then
|
|
269
|
+
echo "WARN: firewall applied WITHOUT these unresolvable domains:" >&2
|
|
270
|
+
printf ' - %s\n' "${UNRESOLVED_DOMAINS[@]}" >&2
|
|
271
|
+
fi
|
|
258
272
|
echo "Verifying firewall rules..."
|
|
259
273
|
if curl --connect-timeout 5 https://example.com >/dev/null 2>&1; then
|
|
260
274
|
echo "ERROR: Firewall verification failed - was able to reach https://example.com"
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useconvoy/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.52.0",
|
|
4
4
|
"description": "CLI agent for Convoy",
|
|
5
5
|
"license": "Elastic-2.0",
|
|
6
|
-
"homepage": "https://docs.
|
|
6
|
+
"homepage": "https://docs.convoy.build/docs/cli/install",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/
|
|
9
|
+
"url": "git+https://github.com/packtrain/convoy.git",
|
|
10
10
|
"directory": "apps/cli"
|
|
11
11
|
},
|
|
12
12
|
"bugs": {
|
|
13
|
-
"url": "https://github.com/
|
|
13
|
+
"url": "https://github.com/packtrain/convoy/issues"
|
|
14
14
|
},
|
|
15
15
|
"keywords": [
|
|
16
16
|
"convoy",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Command } from "commander";
|
|
2
|
-
import type { OutputOptions } from "../../lib/output.js";
|
|
3
|
-
export interface PromptScopeOptions extends OutputOptions {
|
|
4
|
-
scope?: string;
|
|
5
|
-
org?: string;
|
|
6
|
-
}
|
|
7
|
-
export type PromptScope = "project" | "organization";
|
|
8
|
-
export declare function addPromptScopeOptions<T extends Command>(cmd: T): T;
|
|
9
|
-
export declare function parsePromptScope(options: PromptScopeOptions): PromptScope;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { parseOptionalEnum } from "../../lib/parsers.js";
|
|
2
|
-
export function addPromptScopeOptions(cmd) {
|
|
3
|
-
return cmd
|
|
4
|
-
.option("--scope <scope>", "Prompt scope: project or organization (default: project)")
|
|
5
|
-
.option("--org <org>", "Organization ID or slug");
|
|
6
|
-
}
|
|
7
|
-
// Same vocabulary as the MCP `scope` argument — no `org` alias, so a prompt
|
|
8
|
-
// script reads the same on both surfaces.
|
|
9
|
-
export function parsePromptScope(options) {
|
|
10
|
-
return parseOptionalEnum(options.scope, "Scope", ["project", "organization"]) ?? "project";
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=parsers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parsers.js","sourceRoot":"","sources":["../../../../src/commands/prompts/parsers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AASzD,MAAM,UAAU,qBAAqB,CAAoB,GAAM;IAC7D,OAAO,GAAG;SACP,MAAM,CAAC,iBAAiB,EAAE,0DAA0D,CAAC;SACrF,MAAM,CAAC,aAAa,EAAE,yBAAyB,CAAM,CAAC;AAC3D,CAAC;AAED,4EAA4E;AAC5E,0CAA0C;AAC1C,MAAM,UAAU,gBAAgB,CAAC,OAA2B;IAC1D,OAAO,iBAAiB,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,cAAc,CAAU,CAAC,IAAI,SAAS,CAAC;AACtG,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Command } from "commander";
|
|
2
|
-
import type { Id } from "../../convex/_generated/dataModel.js";
|
|
3
|
-
import type { OpenSanaClient, RequiredConfig } from "../../lib/config/index.js";
|
|
4
|
-
import { type PromptScopeOptions } from "./parsers.js";
|
|
5
|
-
/**
|
|
6
|
-
* Scope target for a prompt command. Organization scope takes `--org` when given
|
|
7
|
-
* and otherwise borrows the resolved project's organization, so the common case
|
|
8
|
-
* needs no extra flag.
|
|
9
|
-
*/
|
|
10
|
-
export type PromptScopeTarget = {
|
|
11
|
-
scope: "project";
|
|
12
|
-
projectId: Id<"projects">;
|
|
13
|
-
} | {
|
|
14
|
-
scope: "organization";
|
|
15
|
-
organizationId: Id<"organizations">;
|
|
16
|
-
};
|
|
17
|
-
export declare function resolvePromptScopeTarget(client: OpenSanaClient, config: RequiredConfig, cmd: Command, options: PromptScopeOptions): Promise<PromptScopeTarget>;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { api } from "../../convex/_generated/api.js";
|
|
2
|
-
import { getGlobalProjectOption } from "../../lib/global-options.js";
|
|
3
|
-
import { parseId } from "../../lib/id.js";
|
|
4
|
-
import { resolveProjectFromCommand, resolveProjectId } from "../../lib/project-resolution.js";
|
|
5
|
-
import { parsePromptScope } from "./parsers.js";
|
|
6
|
-
export async function resolvePromptScopeTarget(client, config, cmd, options) {
|
|
7
|
-
const scope = parsePromptScope(options);
|
|
8
|
-
const projectRef = getGlobalProjectOption(cmd);
|
|
9
|
-
if (scope === "project") {
|
|
10
|
-
if (options.org && !projectRef) {
|
|
11
|
-
// In project scope `--org` only disambiguates `--project`; alone it reads
|
|
12
|
-
// as "the organization", which is a different scope.
|
|
13
|
-
throw new Error("--org needs --project in project scope. Pass --scope organization to target the organization itself.");
|
|
14
|
-
}
|
|
15
|
-
const { projectId } = await resolveProjectFromCommand(client, config, cmd, options.org);
|
|
16
|
-
return { scope, projectId };
|
|
17
|
-
}
|
|
18
|
-
if (options.org) {
|
|
19
|
-
// Asked of the backend rather than derived from the project list: an
|
|
20
|
-
// organization with no accessible projects is still a valid target for
|
|
21
|
-
// organization prompts.
|
|
22
|
-
const organization = await client.query(api.organizations.core.getByRef, { ref: options.org });
|
|
23
|
-
if (!organization) {
|
|
24
|
-
throw new Error(`Organization "${options.org}" was not found or not accessible. Run 'convoy orgs list' to see available organizations.`);
|
|
25
|
-
}
|
|
26
|
-
return { scope, organizationId: organization._id };
|
|
27
|
-
}
|
|
28
|
-
const projects = await client.query(api.projects.core.listAccessible, {});
|
|
29
|
-
const projectId = resolveProjectId({
|
|
30
|
-
projects,
|
|
31
|
-
defaultProjectId: config.projectId,
|
|
32
|
-
projectRef,
|
|
33
|
-
});
|
|
34
|
-
const project = projects.find((candidate) => candidate._id === projectId);
|
|
35
|
-
if (!project) {
|
|
36
|
-
throw new Error("Could not resolve an organization. Pass --org <orgId|orgSlug> or configure a project.");
|
|
37
|
-
}
|
|
38
|
-
return {
|
|
39
|
-
scope,
|
|
40
|
-
organizationId: parseId(project.organizationId, "organizationId"),
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=resolve.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../../src/commands/prompts/resolve.ts"],"names":[],"mappings":"AACA,OAAO,E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