copilotkit 1.54.0 → 2.0.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.
Files changed (150) hide show
  1. package/index.js +90052 -0
  2. package/package.json +4 -114
  3. package/src/commands/docs.d.ts +17 -0
  4. package/src/commands/docs.d.ts.map +1 -0
  5. package/src/commands/init.d.ts +103 -0
  6. package/src/commands/init.d.ts.map +1 -0
  7. package/src/commands/kite.d.ts +8 -0
  8. package/src/commands/kite.d.ts.map +1 -0
  9. package/src/commands/license.d.ts +17 -0
  10. package/src/commands/license.d.ts.map +1 -0
  11. package/src/commands/login.d.ts +13 -0
  12. package/src/commands/login.d.ts.map +1 -0
  13. package/src/commands/logs.d.ts +32 -0
  14. package/src/commands/logs.d.ts.map +1 -0
  15. package/src/commands/version.d.ts +8 -0
  16. package/src/commands/version.d.ts.map +1 -0
  17. package/src/config.d.ts +31 -0
  18. package/src/config.d.ts.map +1 -0
  19. package/src/index.d.ts +21 -0
  20. package/src/index.d.ts.map +1 -0
  21. package/src/services/agentcore-config.d.ts +34 -0
  22. package/src/services/agentcore-config.d.ts.map +1 -0
  23. package/src/services/api-client.d.ts +106 -0
  24. package/src/services/api-client.d.ts.map +1 -0
  25. package/src/services/auth.service.d.ts +107 -0
  26. package/src/services/auth.service.d.ts.map +1 -0
  27. package/src/services/cli-auth-diagnostics.d.ts +71 -0
  28. package/src/services/cli-auth-diagnostics.d.ts.map +1 -0
  29. package/src/services/cli-logs.d.ts +45 -0
  30. package/src/services/cli-logs.d.ts.map +1 -0
  31. package/src/services/config.service.d.ts +53 -0
  32. package/src/services/config.service.d.ts.map +1 -0
  33. package/src/services/feature-flags.d.ts +14 -0
  34. package/src/services/feature-flags.d.ts.map +1 -0
  35. package/src/services/kite-game-engine.d.ts +99 -0
  36. package/src/services/kite-game-engine.d.ts.map +1 -0
  37. package/src/services/kite-game-score.d.ts +33 -0
  38. package/src/services/kite-game-score.d.ts.map +1 -0
  39. package/src/services/project-scaffold.d.ts +49 -0
  40. package/src/services/project-scaffold.d.ts.map +1 -0
  41. package/src/services/showcase-config.d.ts +19 -0
  42. package/src/services/showcase-config.d.ts.map +1 -0
  43. package/src/types.d.ts +227 -0
  44. package/src/types.d.ts.map +1 -0
  45. package/src/ui/banner.d.ts +3 -0
  46. package/src/ui/banner.d.ts.map +1 -0
  47. package/src/ui/browser-login.d.ts +71 -0
  48. package/src/ui/browser-login.d.ts.map +1 -0
  49. package/src/ui/init-flow.d.ts +35 -0
  50. package/src/ui/init-flow.d.ts.map +1 -0
  51. package/src/ui/kite-game.d.ts +26 -0
  52. package/src/ui/kite-game.d.ts.map +1 -0
  53. package/src/ui/login-flow.d.ts +22 -0
  54. package/src/ui/login-flow.d.ts.map +1 -0
  55. package/src/ui/spinner.d.ts +9 -0
  56. package/src/ui/spinner.d.ts.map +1 -0
  57. package/LICENSE +0 -21
  58. package/README.md +0 -83
  59. package/bin/dev.cmd +0 -3
  60. package/bin/dev.js +0 -8
  61. package/bin/run.cmd +0 -3
  62. package/bin/run.js +0 -17
  63. package/dist/commands/base-command.d.ts +0 -12
  64. package/dist/commands/base-command.js +0 -65
  65. package/dist/commands/base-command.js.map +0 -1
  66. package/dist/commands/create.d.ts +0 -24
  67. package/dist/commands/create.js +0 -507
  68. package/dist/commands/create.js.map +0 -1
  69. package/dist/commands/dev.d.ts +0 -25
  70. package/dist/commands/dev.js +0 -776
  71. package/dist/commands/dev.js.map +0 -1
  72. package/dist/commands/init.d.ts +0 -11
  73. package/dist/commands/init.js +0 -523
  74. package/dist/commands/init.js.map +0 -1
  75. package/dist/commands/login.d.ts +0 -13
  76. package/dist/commands/login.js +0 -374
  77. package/dist/commands/login.js.map +0 -1
  78. package/dist/commands/logout.d.ts +0 -13
  79. package/dist/commands/logout.js +0 -375
  80. package/dist/commands/logout.js.map +0 -1
  81. package/dist/index.d.ts +0 -1
  82. package/dist/index.js +0 -6
  83. package/dist/index.js.map +0 -1
  84. package/dist/lib/init/ide-docs.d.ts +0 -25
  85. package/dist/lib/init/ide-docs.js +0 -170
  86. package/dist/lib/init/ide-docs.js.map +0 -1
  87. package/dist/lib/init/index.d.ts +0 -14
  88. package/dist/lib/init/index.js +0 -1104
  89. package/dist/lib/init/index.js.map +0 -1
  90. package/dist/lib/init/questions.d.ts +0 -9
  91. package/dist/lib/init/questions.js +0 -508
  92. package/dist/lib/init/questions.js.map +0 -1
  93. package/dist/lib/init/scaffold/agent.d.ts +0 -20
  94. package/dist/lib/init/scaffold/agent.js +0 -173
  95. package/dist/lib/init/scaffold/agent.js.map +0 -1
  96. package/dist/lib/init/scaffold/crew-inputs.d.ts +0 -3
  97. package/dist/lib/init/scaffold/crew-inputs.js +0 -59
  98. package/dist/lib/init/scaffold/crew-inputs.js.map +0 -1
  99. package/dist/lib/init/scaffold/env.d.ts +0 -7
  100. package/dist/lib/init/scaffold/env.js +0 -124
  101. package/dist/lib/init/scaffold/env.js.map +0 -1
  102. package/dist/lib/init/scaffold/github.d.ts +0 -17
  103. package/dist/lib/init/scaffold/github.js +0 -114
  104. package/dist/lib/init/scaffold/github.js.map +0 -1
  105. package/dist/lib/init/scaffold/index.d.ts +0 -10
  106. package/dist/lib/init/scaffold/index.js +0 -690
  107. package/dist/lib/init/scaffold/index.js.map +0 -1
  108. package/dist/lib/init/scaffold/langgraph-assistants.d.ts +0 -18
  109. package/dist/lib/init/scaffold/langgraph-assistants.js +0 -26
  110. package/dist/lib/init/scaffold/langgraph-assistants.js.map +0 -1
  111. package/dist/lib/init/scaffold/packages.d.ts +0 -7
  112. package/dist/lib/init/scaffold/packages.js +0 -62
  113. package/dist/lib/init/scaffold/packages.js.map +0 -1
  114. package/dist/lib/init/scaffold/shadcn.d.ts +0 -7
  115. package/dist/lib/init/scaffold/shadcn.js +0 -279
  116. package/dist/lib/init/scaffold/shadcn.js.map +0 -1
  117. package/dist/lib/init/types/index.d.ts +0 -4
  118. package/dist/lib/init/types/index.js +0 -238
  119. package/dist/lib/init/types/index.js.map +0 -1
  120. package/dist/lib/init/types/questions.d.ts +0 -209
  121. package/dist/lib/init/types/questions.js +0 -214
  122. package/dist/lib/init/types/questions.js.map +0 -1
  123. package/dist/lib/init/types/templates.d.ts +0 -17
  124. package/dist/lib/init/types/templates.js +0 -26
  125. package/dist/lib/init/types/templates.js.map +0 -1
  126. package/dist/lib/init/utils.d.ts +0 -3
  127. package/dist/lib/init/utils.js +0 -8
  128. package/dist/lib/init/utils.js.map +0 -1
  129. package/dist/services/analytics.service.d.ts +0 -38
  130. package/dist/services/analytics.service.js +0 -134
  131. package/dist/services/analytics.service.js.map +0 -1
  132. package/dist/services/auth.service.d.ts +0 -26
  133. package/dist/services/auth.service.js +0 -299
  134. package/dist/services/auth.service.js.map +0 -1
  135. package/dist/services/events.d.ts +0 -119
  136. package/dist/services/events.js +0 -1
  137. package/dist/services/events.js.map +0 -1
  138. package/dist/services/tunnel.service.d.ts +0 -15
  139. package/dist/services/tunnel.service.js +0 -21
  140. package/dist/services/tunnel.service.js.map +0 -1
  141. package/dist/utils/detect-endpoint-type.utils.d.ts +0 -15
  142. package/dist/utils/detect-endpoint-type.utils.js +0 -157
  143. package/dist/utils/detect-endpoint-type.utils.js.map +0 -1
  144. package/dist/utils/trpc.d.ts +0 -4
  145. package/dist/utils/trpc.js +0 -25
  146. package/dist/utils/trpc.js.map +0 -1
  147. package/dist/utils/version.d.ts +0 -3
  148. package/dist/utils/version.js +0 -6
  149. package/dist/utils/version.js.map +0 -1
  150. package/oclif.manifest.json +0 -208
package/package.json CHANGED
@@ -1,118 +1,8 @@
1
1
  {
2
2
  "name": "copilotkit",
3
- "description": "CopilotKit CLI",
4
- "version": "1.54.0",
5
- "author": "CopilotKit",
6
- "bin": {
7
- "copilotkit": "./bin/run.js",
8
- "cpk": "./bin/run.js"
9
- },
10
- "bugs": "https://github.com/CopilotKit/CopilotKit/issues",
11
- "dependencies": {
12
- "@oclif/core": "^4.2.0",
13
- "@paralleldrive/cuid2": "^2.2.2",
14
- "@segment/analytics-node": "^2.1.2",
15
- "@sentry/node": "^7.116.0",
16
- "@trpc/client": "^11.0.1",
17
- "@trpc/server": "^11.0.1",
18
- "ansis": "^3.3.2",
19
- "axios": "^1.7.8",
20
- "chalk": "^5.3.0",
21
- "conf": "^13.1.0",
22
- "cors": "^2.8.5",
23
- "cross-spawn": "^7.0.6",
24
- "express": "^4.21.2",
25
- "get-port": "^7.1.0",
26
- "inquirer": "^12.3.0",
27
- "localtunnel": "^2.0.2",
28
- "open": "^10.1.0",
29
- "ora": "^8.1.1",
30
- "posthog-node": "^4.0.1",
31
- "superjson": "^2.2.1",
32
- "zod": "^3.22.4",
33
- "execa": "^8.0.1",
34
- "fs-extra": "^11.2.0",
35
- "tar": "6.1.13"
36
- },
37
- "devDependencies": {
38
- "@jest/globals": "30.0.0-beta.3",
39
- "@oclif/prettier-config": "^0.2.1",
40
- "@oclif/test": "^4",
41
- "@types/chai": "^4.3.20",
42
- "@types/cors": "^2.8.17",
43
- "@types/cross-spawn": "^6.0.6",
44
- "@types/express": "^5.0.0",
45
- "@types/jest": "^29.5.2",
46
- "@types/localtunnel": "^2.0.4",
47
- "@types/mocha": "^10",
48
- "@types/node": "^18",
49
- "@types/sinon": "^17.0.3",
50
- "@types/sinon-chai": "^4.0.0",
51
- "chai": "^4",
52
- "eslint": "^8",
53
- "eslint-config-oclif": "^5",
54
- "eslint-config-oclif-typescript": "^3",
55
- "eslint-config-prettier": "^9",
56
- "jest": "^29.5.0",
57
- "mocha": "^10",
58
- "oclif": "^4",
59
- "shx": "^0.3.3",
60
- "sinon": "^19.0.2",
61
- "sinon-chai": "^4.0.0",
62
- "ts-jest": "^29.1.0",
63
- "ts-node": "^10",
64
- "tsup": "^8.0.2",
65
- "typescript": "^5",
66
- "@types/fs-extra": "^11.0.4",
67
- "@types/tar": "6.1.13"
68
- },
69
- "engines": {
70
- "node": ">=18.0.0"
71
- },
72
- "files": [
73
- "/bin",
74
- "/dist",
75
- "/oclif.manifest.json"
76
- ],
77
- "homepage": "https://github.com/CopilotKit/CopilotKit/tree/main/packages/v1/cli",
78
- "keywords": [
79
- "oclif"
80
- ],
81
- "license": "MIT",
82
- "main": "dist/index.js",
3
+ "version": "2.0.1",
83
4
  "type": "module",
84
- "oclif": {
85
- "bin": "copilotkit",
86
- "dirname": "copilotkit",
87
- "commands": "./dist/commands",
88
- "topicSeparator": " ",
89
- "topics": {
90
- "tunnel": {
91
- "description": "Create a local tunnel to expose your agent to the internet"
92
- },
93
- "login": {
94
- "description": "Authenticate with Copilot Cloud"
95
- }
96
- }
97
- },
98
- "repository": {
99
- "type": "git",
100
- "url": "https://github.com/CopilotKit/CopilotKit.git",
101
- "directory": "packages/v1/cli"
102
- },
103
- "types": "dist/index.d.ts",
104
- "publishConfig": {
105
- "access": "public"
106
- },
107
- "scripts": {
108
- "clean": "shx rm -rf dist",
109
- "extract-version": "node -p \"'// This is auto generated!\\nexport const LIB_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/utils/version.ts",
110
- "prebuild": "pnpm run clean && pnpm run extract-version",
111
- "build": "tsup",
112
- "lint": "echo oops",
113
- "generate-manifest": "oclif manifest",
114
- "test": "jest",
115
- "version": "oclif readme && git add README.md",
116
- "validate": "node validate-package.js"
5
+ "bin": {
6
+ "copilotkit": "./index.js"
117
7
  }
118
- }
8
+ }
@@ -0,0 +1,17 @@
1
+ /** CopilotKit documentation URL opened by `copilotkit docs`. */
2
+ export declare const COPILOTKIT_DOCS_URL = "https://docs.copilotkit.ai";
3
+ /**
4
+ * Detects whether browser automation should be skipped for the current process.
5
+ *
6
+ * @param env - Process environment variables.
7
+ * @returns `true` when the command should print the URL instead of opening it.
8
+ */
9
+ export declare function shouldSkipBrowserOpen(env?: NodeJS.ProcessEnv): boolean;
10
+ /**
11
+ * Opens the CopilotKit documentation in the user's browser.
12
+ *
13
+ * In CI, or when browser opening fails, the command prints the URL so it can be
14
+ * opened manually.
15
+ */
16
+ export declare function runDocs(): Promise<void>;
17
+ //# sourceMappingURL=docs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/commands/docs.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,eAAO,MAAM,mBAAmB,+BAA+B,CAAC;AAEhE;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,OAAO,CAInF;AAED;;;;;GAKG;AACH,wBAAsB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAY7C"}
@@ -0,0 +1,103 @@
1
+ import type { InitOptions, InitTemplateDefinition } from '../types.js';
2
+ import { login, verifyAndRefresh } from '../services/auth.service.js';
3
+ import { createApiClient } from '../services/api-client.js';
4
+ import { scaffoldProject, copyEnvExample } from '../services/project-scaffold.js';
5
+ import { getOpsApiUrl } from '../config.js';
6
+ /**
7
+ * Flags accepted by the `copilotkit init` command.
8
+ */
9
+ export interface InitFlags {
10
+ /** Human-readable project name (sets the directory name). */
11
+ name?: string;
12
+ /** Pre-select the Intelligence (threads) path. */
13
+ intelligence?: boolean;
14
+ /** Pre-select a framework (skips intelligence question). */
15
+ framework?: string;
16
+ }
17
+ /** Phases of the scaffolding flow rendered after options are collected. */
18
+ type ScaffoldPhase = 'auth' | 'scaffold' | 'license' | 'git' | 'success' | 'error';
19
+ /** Writes a license key into the project's .env file. */
20
+ declare function writeLicenseKey(projectDir: string, licenseKey: string): void;
21
+ /** Runs git init and creates an initial commit if identity is configured. */
22
+ declare function initGit(projectDir: string): Promise<void>;
23
+ /**
24
+ * Checks whether a command is available on PATH.
25
+ *
26
+ * @param command - Executable name to check.
27
+ * @param environment - Environment variables that provide PATH/PATHEXT.
28
+ * @param platform - Platform used to apply executable extension rules.
29
+ * @returns `true` when the command can be resolved.
30
+ */
31
+ export declare function commandExists(command: string, environment?: NodeJS.ProcessEnv, platform?: NodeJS.Platform): boolean;
32
+ /** Outcome from preparing environment files during scaffolding. */
33
+ export interface InitScaffoldResult {
34
+ /** Absolute project directory created by init. */
35
+ projectDir: string;
36
+ /** Whether `.env` was created from `.env.example`. */
37
+ envCreatedFromExample: boolean;
38
+ /** Whether a license token was written to `.env`. */
39
+ licenseWritten: boolean;
40
+ /** Prerequisite commands missing from PATH. */
41
+ missingPrerequisites: string[];
42
+ }
43
+ /**
44
+ * Dependencies used by the `copilotkit init` scaffold flow.
45
+ *
46
+ * Extracted so the behavior split can be tested without rendering Ink or
47
+ * touching the network/filesystem.
48
+ */
49
+ export interface InitScaffoldDependencies {
50
+ /** Verifies the current CLI session, refreshing persisted auth when valid. */
51
+ verifyAndRefresh: typeof verifyAndRefresh;
52
+ /** Launches the browser login flow when no valid CLI session exists. */
53
+ login: typeof login;
54
+ /** Reads the persisted CLI session token after authentication. */
55
+ getCliToken: () => string | null;
56
+ /** Creates an authenticated ops API client. */
57
+ createApiClient: typeof createApiClient;
58
+ /** Resolves the ops API base URL used by the API client. */
59
+ getOpsApiUrl: typeof getOpsApiUrl;
60
+ /** Downloads and copies the selected starter template. */
61
+ scaffoldProject: typeof scaffoldProject;
62
+ /** Initializes git in the scaffolded project directory. */
63
+ initGit: typeof initGit;
64
+ /** Copies `.env.example` to `.env` when present. */
65
+ copyEnvExample: typeof copyEnvExample;
66
+ /** Writes the issued license key into the scaffolded project. */
67
+ writeLicenseKey: typeof writeLicenseKey;
68
+ /** Checks whether a prerequisite command is available on PATH. */
69
+ commandExists: typeof commandExists;
70
+ /** Resolves the final project directory for the supplied project name. */
71
+ resolveProjectDir: (projectName: string) => string;
72
+ }
73
+ /**
74
+ * Builds the final onboarding copy from template metadata and scaffold results.
75
+ *
76
+ * @param templateDefinition - Selected template metadata.
77
+ * @param projectName - Directory name chosen by the user.
78
+ * @param result - Filesystem and prerequisite outcomes from scaffolding.
79
+ * @returns Lines rendered as post-init next steps.
80
+ */
81
+ export declare function buildInitNextSteps(templateDefinition: InitTemplateDefinition, projectName: string, result: InitScaffoldResult): string[];
82
+ /**
83
+ * Runs the `copilotkit init` scaffold steps for the resolved template.
84
+ *
85
+ * The template metadata decides whether auth and license issuance are required,
86
+ * allowing non-license templates to scaffold without touching auth at all.
87
+ *
88
+ * @param options - Fully resolved init options.
89
+ * @param dependencies - Injectable dependencies for IO and auth operations.
90
+ * @param onPhaseChange - Optional callback used by the Ink UI to update progress.
91
+ */
92
+ export declare function scaffoldInitProject(options: InitOptions, dependencies?: InitScaffoldDependencies, onPhaseChange?: (phase: Exclude<ScaffoldPhase, 'success' | 'error'>) => void, onTerminalSessionInvalidation?: () => void): Promise<InitScaffoldResult>;
93
+ /**
94
+ * Entry point for the `copilotkit init` command.
95
+ *
96
+ * Parses and validates flags, then renders the interactive Ink UI that
97
+ * guides the user through prompts and scaffolding.
98
+ *
99
+ * @param flags - Raw flags passed from the CLI argument parser.
100
+ */
101
+ export declare function runInit(flags: InitFlags): Promise<void>;
102
+ export {};
103
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/commands/init.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Runs the hidden Ink-based kite game command.
3
+ *
4
+ * @returns A promise that resolves after the game exits.
5
+ * @throws When Ink fails while running the game.
6
+ */
7
+ export declare function runKite(): Promise<void>;
8
+ //# sourceMappingURL=kite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kite.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/commands/kite.tsx"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAsB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAS7C"}
@@ -0,0 +1,17 @@
1
+ import type { CliLicenseScope } from "../types.js";
2
+ /**
3
+ * Parsed `copilotkit license` command variants.
4
+ */
5
+ export type LicenseCommand = {
6
+ action: "create";
7
+ } | {
8
+ action: "list";
9
+ scope: CliLicenseScope;
10
+ };
11
+ /**
12
+ * Entry point for the `copilotkit license` command.
13
+ *
14
+ * @param command - Resolved license command variant.
15
+ */
16
+ export declare function runLicense(command: LicenseCommand): Promise<void>;
17
+ //# sourceMappingURL=license.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"license.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/commands/license.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAEV,eAAe,EAChB,MAAM,aAAa,CAAC;AAIrB;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB;IAAE,MAAM,EAAE,QAAQ,CAAA;CAAE,GACpB;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,eAAe,CAAA;CAAE,CAAC;AAuT/C;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBvE"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Runs the ink-based login command.
3
+ *
4
+ * Renders {@link LoginFlow} inside an ink instance and returns a promise that
5
+ * resolves when the user authenticates successfully or rejects when the login
6
+ * attempt fails. A short delay before unmounting ensures all output is flushed
7
+ * to the terminal before the process continues.
8
+ *
9
+ * @returns A promise that resolves on successful login.
10
+ * @throws When the browser-based login flow fails.
11
+ */
12
+ export declare function runLogin(): Promise<void>;
13
+ //# sourceMappingURL=login.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/commands/login.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAmB9C"}
@@ -0,0 +1,32 @@
1
+ /** Supported `copilotkit logs` actions. */
2
+ export interface LogsFlags {
3
+ lines?: number;
4
+ path?: boolean;
5
+ tail?: boolean;
6
+ }
7
+ /** Normalized `copilotkit logs` action after validating flag combinations. */
8
+ type NormalizedLogsAction = {
9
+ type: 'path';
10
+ } | {
11
+ lines: number;
12
+ type: 'tail';
13
+ };
14
+ /**
15
+ * Validates raw `copilotkit logs` flags and resolves the intended action.
16
+ *
17
+ * @param flags - Parsed command flags.
18
+ * @returns Normalized action to run.
19
+ */
20
+ export declare function normalizeLogsFlags(flags: LogsFlags): NormalizedLogsAction;
21
+ /**
22
+ * Runs the CLI logs command.
23
+ *
24
+ * `--path` prints the resolved log file path.
25
+ * `--tail` prints the most recent log lines.
26
+ * With no flags, this defaults to `--path`.
27
+ *
28
+ * @param flags - Parsed command flags.
29
+ */
30
+ export declare function runLogs(flags: LogsFlags): Promise<void>;
31
+ export {};
32
+ //# sourceMappingURL=logs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/commands/logs.ts"],"names":[],"mappings":"AAEA,2CAA2C;AAC3C,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,8EAA8E;AAC9E,KAAK,oBAAoB,GACrB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,GAAG,oBAAoB,CAiBzE;AAED;;;;;;;;GAQG;AACH,wBAAsB,OAAO,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAe7D"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Prints the CLI's build identity: semantic version, GitHub Actions run id,
3
+ * and the commit sha the binary was built from.
4
+ *
5
+ * `buildNumber` and `commitSha` are `"dev"` for local (non-CI) builds.
6
+ */
7
+ export declare function runVersion(): void;
8
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/commands/version.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAKjC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Build-time configuration injected via esbuild `define`.
3
+ *
4
+ * These values are replaced at build time with the corresponding
5
+ * environment variables. If not set during build, the build fails.
6
+ *
7
+ * {@link OPS_API_URL} can be overridden at runtime via the hidden
8
+ * `--ops-api-url` flag, which calls {@link setOpsApiUrl}.
9
+ */
10
+ /** Base URL for the CopilotKit operations API. */
11
+ export declare function getOpsApiUrl(): string;
12
+ /** Override the ops API URL at runtime. */
13
+ export declare function setOpsApiUrl(url: string): void;
14
+ /** Base URL for the CopilotKit operations frontend (serves CLI auth page). */
15
+ export declare function getOpsFrontendUrl(): string;
16
+ /** Override the ops frontend URL at runtime. */
17
+ export declare function setOpsFrontendUrl(url: string): void;
18
+ /**
19
+ * Build identity for this CLI binary.
20
+ *
21
+ * - `version` — semantic version from `apps/cli/package.json`.
22
+ * - `buildNumber` — GitHub Actions run id of the build, or `"dev"` for local builds.
23
+ * Maps back to a workflow run at github.com/<repo>/actions/runs/<buildNumber>.
24
+ * - `commitSha` — git commit the binary was built from, or `"dev"` for local builds.
25
+ */
26
+ export declare function getBuildInfo(): {
27
+ version: string;
28
+ buildNumber: string;
29
+ commitSha: string;
30
+ };
31
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../apps/cli/src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAaH,kDAAkD;AAClD,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,2CAA2C;AAC3C,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE9C;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,gDAAgD;AAChD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEnD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAMA"}
package/src/index.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Returns help text for a CLI argv list when it requests help.
4
+ */
5
+ export declare function getHelpTextForArgs(argv: readonly string[]): string | null;
6
+ /**
7
+ * Main CLI entrypoint.
8
+ */
9
+ export declare function main(rawArgv?: string[]): Promise<void>;
10
+ /**
11
+ * Detects whether this module is the process entrypoint.
12
+ *
13
+ * Package managers often execute bin shims through symlinks, so both sides are
14
+ * compared after resolving their real filesystem paths.
15
+ *
16
+ * @param entrypoint - The process entrypoint path, usually `process.argv[1]`.
17
+ * @param moduleUrl - The current module URL.
18
+ * @returns `true` when the entrypoint resolves to the current module.
19
+ */
20
+ export declare function isDirectInvocation(entrypoint: string | undefined, moduleUrl: string): boolean;
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../apps/cli/src/index.ts"],"names":[],"mappings":";AAoOA;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAIzE;AAgPD;;GAEG;AACH,wBAAsB,IAAI,CAAC,OAAO,WAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiEzE;AAkBD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,SAAS,EAAE,MAAM,GAChB,OAAO,CAMT"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Variant of the AgentCore template the user picked.
3
+ *
4
+ * Both variants download the same generic `agentcore` example; this value
5
+ * tells {@link configureAgentCore} which agent stays and which gets removed.
6
+ */
7
+ export type AgentCoreVariant = 'agentcore-langgraph' | 'agentcore-strands';
8
+ /**
9
+ * Specializes a freshly-scaffolded `agentcore` template into a single-framework
10
+ * project (LangGraph or Strands).
11
+ *
12
+ * Mirrors the behavior of the old CopilotKit CLI's `configureAgentCore` (in
13
+ * `packages/cli/src/commands/create.ts`) so existing AgentCore starters keep
14
+ * working unchanged. Specifically:
15
+ *
16
+ * 1. Renames `config.yaml.example` → `config.yaml`, patching the `pattern:`
17
+ * and `stack_name_base:` fields for the chosen variant.
18
+ * 2. Removes the unused agent folder, the unused deploy script, and the
19
+ * Terraform infra path that the merged template ships with.
20
+ * 3. Renames the kept `deploy-{framework}.sh` to `deploy.sh` and scrubs stale
21
+ * references to its sibling.
22
+ * 4. Patches Docker compose / `up.sh` / `resolve-env.py` defaults to use the
23
+ * chosen agent.
24
+ * 5. Replaces the README with a framework-specific version.
25
+ *
26
+ * Throws when the template is missing the expected files or when the YAML
27
+ * config doesn't match the expected `pattern:` / `stack_name_base:` shape —
28
+ * this keeps the CLI honest if upstream restructures the template.
29
+ *
30
+ * @param projectDir - The freshly-scaffolded AgentCore project directory.
31
+ * @param variant - The AgentCore framework variant to specialize for.
32
+ */
33
+ export declare function configureAgentCore(projectDir: string, variant: AgentCoreVariant): Promise<void>;
34
+ //# sourceMappingURL=agentcore-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentcore-config.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/services/agentcore-config.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,GAAG,mBAAmB,CAAC;AAE3E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CAgLf"}
@@ -0,0 +1,106 @@
1
+ import type { AuthPayload, CliLicenseRecord, CliLicenseScope } from "../types.js";
2
+ /**
3
+ * Error raised when ops-api returns a structured non-OK response.
4
+ */
5
+ export declare class ApiClientError extends Error {
6
+ /** HTTP status returned by the API. */
7
+ readonly status: number;
8
+ /** Stable API error code when present. */
9
+ readonly code?: string;
10
+ /**
11
+ * @param status - HTTP status from the failed response.
12
+ * @param message - User-facing error message.
13
+ * @param code - Optional stable API error code.
14
+ */
15
+ constructor(status: number, message: string, code?: string);
16
+ }
17
+ /**
18
+ * Shape of the response from the session verification endpoint.
19
+ */
20
+ export interface VerifySessionResponse {
21
+ /** The authenticated user record returned by ops-api. */
22
+ user: {
23
+ id: string;
24
+ email: string;
25
+ name: string | null;
26
+ };
27
+ /** The organization the user authenticated under. */
28
+ organization: {
29
+ clerkOrgId: string;
30
+ organizationName?: string;
31
+ };
32
+ }
33
+ /**
34
+ * HTTP client for the CopilotKit ops-api CLI endpoints.
35
+ *
36
+ * Encapsulates auth, session verification, logout, and license management
37
+ * requests against the configured `baseUrl`.
38
+ */
39
+ export interface ApiClient {
40
+ /**
41
+ * Exchanges a Clerk short-lived token for a CLI session token.
42
+ *
43
+ * POSTs to `/api/cli/auth/session` without an auth header since this is
44
+ * a pre-login exchange. Throws if the response is not OK.
45
+ *
46
+ * @param clerkToken - The Clerk token returned from the browser OAuth flow.
47
+ * @returns The parsed {@link AuthPayload} containing the CLI session token.
48
+ */
49
+ exchangeClerkToken(clerkToken: string): Promise<AuthPayload>;
50
+ /**
51
+ * Verifies the current CLI session token against ops-api.
52
+ *
53
+ * GETs `/api/cli/auth/verify` with a Bearer authorization header.
54
+ * Throws with the server-provided auth guidance on non-OK responses.
55
+ *
56
+ * @returns The session user/org data.
57
+ */
58
+ verifySession(): Promise<VerifySessionResponse>;
59
+ /**
60
+ * Terminates the current CLI session on the server.
61
+ *
62
+ * POSTs to `/api/cli/auth/logout` with a Bearer authorization header.
63
+ */
64
+ logout(): Promise<void>;
65
+ /**
66
+ * Lists licenses for the authenticated organization or current user.
67
+ *
68
+ * GETs `/api/cli/license?scope=...` with a Bearer authorization header.
69
+ * Throws if the response is not OK.
70
+ *
71
+ * @param scope - Whether to list organization-wide or user-only licenses.
72
+ * @returns The parsed list of license metadata.
73
+ */
74
+ listLicenses(scope: CliLicenseScope): Promise<CliLicenseRecord[]>;
75
+ /**
76
+ * Issues a new license key for the current authenticated organization.
77
+ *
78
+ * POSTs to `/api/cli/license` with a Bearer authorization header. Throws if
79
+ * the response is not OK.
80
+ *
81
+ * @returns An object containing the newly issued `licenseKey`.
82
+ */
83
+ issueLicense(): Promise<{
84
+ licenseKey: string;
85
+ }>;
86
+ /**
87
+ * Registers the user's interest in threads access (mailing list signup).
88
+ *
89
+ * POSTs to `/api/cli/threads-interest`. The user is already authenticated,
90
+ * so this just records their opt-in on the server side.
91
+ */
92
+ requestThreadsAccess(): Promise<void>;
93
+ }
94
+ /**
95
+ * Creates an HTTP client bound to the given base URL and optional bearer token.
96
+ *
97
+ * Methods that require authentication use the supplied `token` as a Bearer
98
+ * credential. The `exchangeClerkToken` method intentionally omits the auth
99
+ * header because it is used before a session exists.
100
+ *
101
+ * @param baseUrl - The root URL of the ops-api instance (no trailing slash).
102
+ * @param token - Optional CLI session token for authenticated requests.
103
+ * @returns An {@link ApiClient} instance.
104
+ */
105
+ export declare function createApiClient(baseUrl: string, token?: string): ApiClient;
106
+ //# sourceMappingURL=api-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/services/api-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,eAAe,EAChB,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,uCAAuC;IACvC,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,0CAA0C;IAC1C,SAAgB,IAAI,CAAC,EAAE,MAAM,CAAC;IAE9B;;;;OAIG;gBACS,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;CAM3D;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,yDAAyD;IACzD,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IACzD,qDAAqD;IACrD,YAAY,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACjE;AAmBD;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;;;OAQG;IACH,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAE7D;;;;;;;OAOG;IACH,aAAa,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAEhD;;;;OAIG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAExB;;;;;;;;OAQG;IACH,YAAY,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAElE;;;;;;;OAOG;IACH,YAAY,IAAI,OAAO,CAAC;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAEhD;;;;;OAKG;IACH,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CA8E1E"}