copilotkit 4.4.0 → 4.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -77,7 +77,7 @@ persistence, insights), and `init` provisions a free license automatically —
77
77
  you sign in with your browser during scaffolding. The `-i`/`--intelligence`
78
78
  flag is retained as a deprecated no-op for backward compatibility.
79
79
 
80
- Supported framework values include `langgraph-py`, `langgraph-js`, `claude-sdk-typescript`, `claude-sdk-python`, `mastra`, `pydantic-ai`, `aws-strands-py`, `adk`, `a2a`, `microsoft-agent-framework-dotnet`, `microsoft-agent-framework-py`, `flows`, `llamaindex`, `agno`, `ag2`, `mcp-apps`, `agentcore-langgraph`, `agentcore-strands`, `a2ui`, and `opengenui`.
80
+ Supported framework values include `langgraph-py`, `langgraph-js`, `claude-sdk-typescript`, `claude-sdk-python`, `mastra`, `pydantic-ai`, `aws-strands-py`, `adk`, `adk-angular`, `a2a`, `microsoft-agent-framework-dotnet`, `microsoft-agent-framework-py`, `flows`, `llamaindex`, `agno`, `ag2`, `mcp-apps`, `agentcore-langgraph`, `agentcore-strands`, `a2ui`, and `opengenui`.
81
81
 
82
82
  `init` and `create` collect your starter choices, then connect project creation
83
83
  to your CopilotKit workspace through Ops/Clerk before scaffolding. If you
@@ -275,7 +275,7 @@ explicitly re-enabled. `copilotkit telemetry reset` restores the full
275
275
  fresh-install state: the decision is forgotten and the one-time notice shows
276
276
  again on the next interactive run.
277
277
 
278
- ## Prerelease builds
278
+ ## Preview and release builds
279
279
 
280
280
  Tester-facing prerelease builds are produced by CI via `workflow_dispatch` on
281
281
  the `pkg-pr-new (cli)` workflow — never built locally (the repo root `.env`
@@ -284,21 +284,23 @@ targets local services, and CI is the reproducible path).
284
284
  ```bash
285
285
  gh workflow run "pkg-pr-new (cli)" --ref <feature-branch> \
286
286
  -f cli_env=production \
287
- -f template_ref=<copilotkit-branch> # optional; omit to use main
287
+ -f template_ref=<copilotkit-branch-tag-or-commit>
288
288
  ```
289
289
 
290
290
  - `cli_env` — endpoint set baked into the binary (`local`, `dev`, `staging`,
291
291
  `production`; defaults to `production`).
292
- - `template_ref` — `CopilotKit/CopilotKit` branch or tag that `init` templates
293
- and the `_intelligence` overlay are pinned to (the workflow validates it
294
- exists before building). Empty means `main`. The `ag2`
295
- template comes from the third-party `ag2ai/ag2-copilotkit-starter` repo and
296
- is never repinned.
292
+ - `template_ref` — committed `CopilotKit/CopilotKit` branch, tag, or commit.
293
+ The workflow resolves it to one canonical commit before building. Empty means
294
+ current remote `main`, which is also resolved before publication. The `ag2`
295
+ template comes from the third-party `ag2ai/ag2-copilotkit-starter` repository
296
+ at mutable `main`; build provenance identifies this explicit unpinned
297
+ exception.
297
298
 
298
299
  Open the workflow run and copy the `npx https://pkg.pr.new/...` command from
299
300
  the **job summary**; hand that one-liner to testers. Prerelease binaries
300
301
  report `<version>-pre.<shortsha>` from `copilotkit --version`, so a tester's
301
- build is always identifiable.
302
+ build is always identifiable. `copilotkit version` also reports the canonical
303
+ Intelligence and first-party CopilotKit commits embedded in the artifact.
302
304
 
303
305
  Pushes and PRs continue to publish `CLI_ENV=local` builds automatically, as
304
306
  before.
@@ -306,3 +308,7 @@ before.
306
308
  Note: `workflow_dispatch` only works against refs that contain the dispatch
307
309
  trigger — branches cut before this workflow landed need a merge from `main`
308
310
  first.
311
+
312
+ Production validation, publication, provenance inspection, post-npm recovery,
313
+ and rollback are documented in the
314
+ [CLI release runbook](../../docs/runbooks/cli-release.md).
@@ -0,0 +1,28 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "package": {
4
+ "name": "copilotkit",
5
+ "version": "4.5.1"
6
+ },
7
+ "intelligence": {
8
+ "commit": "c6368d6cc300a87a94e673ec36e8a53f7910c50d"
9
+ },
10
+ "copilotKit": {
11
+ "submittedInput": "e816a9315165db0746dfecdcf697038d1deda6c2",
12
+ "commit": "e816a9315165db0746dfecdcf697038d1deda6c2"
13
+ },
14
+ "channel": "production",
15
+ "triggeringActor": "contextablemark",
16
+ "workflow": {
17
+ "runId": "30555421477",
18
+ "runUrl": "https://github.com/CopilotKit/Intelligence/actions/runs/30555421477"
19
+ },
20
+ "validationResult": "passed",
21
+ "ag2": {
22
+ "ownership": "third-party",
23
+ "repository": "ag2ai/ag2-copilotkit-starter",
24
+ "revision": "main",
25
+ "pinned": false
26
+ },
27
+ "builtAt": "2026-07-30T15:13:07Z"
28
+ }
package/index.js CHANGED
@@ -87,13 +87,14 @@ function getTelemetryEndpointUrl() {
87
87
  }
88
88
  function getBuildInfo() {
89
89
  return {
90
- version: true ? "4.4.0" : "dev",
91
- buildNumber: true ? "29940326041" : "dev",
92
- commitSha: true ? "fd7dad3aeca7e583b77250aa962d3b520f4ecad2" : "dev"
90
+ version: true ? "4.5.1" : "dev",
91
+ buildNumber: true ? "30555421477" : "dev",
92
+ commitSha: true ? "c6368d6cc300a87a94e673ec36e8a53f7910c50d" : "dev",
93
+ copilotKitCommit: getTemplateRef()
93
94
  };
94
95
  }
95
96
  function getTemplateRef() {
96
- return true ? "main" : "main";
97
+ return true ? "e816a9315165db0746dfecdcf697038d1deda6c2" : "main";
97
98
  }
98
99
  function getC15tBackendUrl() {
99
100
  return true ? "https://calm-hazelnut-joy-copilotkit.inth.app" : "";
@@ -125,6 +126,93 @@ var init_config = __esm({
125
126
  }
126
127
  });
127
128
 
129
+ // apps/cli/starter-source-policy.cjs
130
+ var require_starter_source_policy = __commonJS({
131
+ "apps/cli/starter-source-policy.cjs"(exports2, module2) {
132
+ "use strict";
133
+ var AG2_STARTER_SOURCE2 = Object.freeze({
134
+ owner: "ag2ai",
135
+ repo: "ag2-copilotkit-starter",
136
+ path: "",
137
+ mode: "whole-repository",
138
+ ownership: "third-party",
139
+ revision: "main",
140
+ pinned: false
141
+ });
142
+ var AG2_SOURCE_POLICY = Object.freeze({
143
+ ownership: AG2_STARTER_SOURCE2.ownership,
144
+ repository: `${AG2_STARTER_SOURCE2.owner}/${AG2_STARTER_SOURCE2.repo}`,
145
+ revision: AG2_STARTER_SOURCE2.revision,
146
+ pinned: AG2_STARTER_SOURCE2.pinned
147
+ });
148
+ module2.exports = { AG2_SOURCE_POLICY, AG2_STARTER_SOURCE: AG2_STARTER_SOURCE2 };
149
+ }
150
+ });
151
+
152
+ // apps/cli/src/starter-source-catalog.ts
153
+ function copilotKitStarter(path27) {
154
+ return {
155
+ owner: "CopilotKit",
156
+ repo: "CopilotKit",
157
+ path: path27,
158
+ mode: "sparse",
159
+ ownership: "first-party"
160
+ };
161
+ }
162
+ function bindStarterSource(framework, revision) {
163
+ const source = STARTER_SOURCE_CATALOG[framework];
164
+ return {
165
+ owner: source.owner,
166
+ repo: source.repo,
167
+ path: source.path,
168
+ mode: source.mode,
169
+ ownership: source.ownership,
170
+ revision: source.ownership === "first-party" ? revision : source.revision
171
+ };
172
+ }
173
+ var import_starter_source_policy, langGraphPython, agentCore, STARTER_SOURCE_CATALOG;
174
+ var init_starter_source_catalog = __esm({
175
+ "apps/cli/src/starter-source-catalog.ts"() {
176
+ "use strict";
177
+ import_starter_source_policy = __toESM(require_starter_source_policy(), 1);
178
+ langGraphPython = copilotKitStarter(
179
+ "examples/integrations/langgraph-python"
180
+ );
181
+ agentCore = copilotKitStarter("examples/integrations/agentcore");
182
+ STARTER_SOURCE_CATALOG = {
183
+ "langgraph-py": langGraphPython,
184
+ "langgraph-js": copilotKitStarter("examples/integrations/langgraph-js"),
185
+ "claude-sdk-typescript": copilotKitStarter(
186
+ "examples/integrations/claude-sdk-typescript"
187
+ ),
188
+ "claude-sdk-python": copilotKitStarter(
189
+ "examples/integrations/claude-sdk-python"
190
+ ),
191
+ flows: copilotKitStarter("examples/integrations/crewai-flows"),
192
+ mastra: copilotKitStarter("examples/integrations/mastra"),
193
+ "pydantic-ai": copilotKitStarter("examples/integrations/pydantic-ai"),
194
+ llamaindex: copilotKitStarter("examples/integrations/llamaindex"),
195
+ agno: copilotKitStarter("examples/integrations/agno"),
196
+ ag2: import_starter_source_policy.AG2_STARTER_SOURCE,
197
+ adk: copilotKitStarter("examples/integrations/adk"),
198
+ "adk-angular": copilotKitStarter("examples/integrations/adk-angular"),
199
+ "aws-strands-py": copilotKitStarter("examples/integrations/strands-python"),
200
+ a2a: copilotKitStarter("examples/integrations/a2a-middleware"),
201
+ "microsoft-agent-framework-dotnet": copilotKitStarter(
202
+ "examples/integrations/ms-agent-framework-dotnet"
203
+ ),
204
+ "microsoft-agent-framework-py": copilotKitStarter(
205
+ "examples/integrations/ms-agent-framework-python"
206
+ ),
207
+ "mcp-apps": copilotKitStarter("examples/integrations/mcp-apps"),
208
+ "agentcore-langgraph": agentCore,
209
+ "agentcore-strands": agentCore,
210
+ a2ui: langGraphPython,
211
+ opengenui: langGraphPython
212
+ };
213
+ }
214
+ });
215
+
128
216
  // apps/cli/src/services/agentcore-config.ts
129
217
  import * as fs from "node:fs";
130
218
  import * as path from "node:path";
@@ -308,14 +396,6 @@ function isAgentFramework(value) {
308
396
  function formatInvalidFrameworkError(value) {
309
397
  return `Unsupported framework "${value}". Expected one of: ${AGENT_FRAMEWORKS.join(", ")}.`;
310
398
  }
311
- function ckTemplate(examplePath, ref2 = getTemplateRef()) {
312
- return {
313
- owner: "CopilotKit",
314
- repo: "CopilotKit",
315
- branch: ref2,
316
- path: examplePath
317
- };
318
- }
319
399
  function standardTemplate(framework, template, successEmoji) {
320
400
  const pythonUvTemplates = /* @__PURE__ */ new Set([
321
401
  "langgraph-py",
@@ -380,37 +460,18 @@ function formatIntelligenceUnavailableError(framework) {
380
460
  ...THREADS_FRAMEWORKS
381
461
  ].join(", ")}.`;
382
462
  }
383
- var AGENT_FRAMEWORKS, FRAMEWORK_ALIASES, FRAMEWORK_EMOJI, FRAMEWORK_CHOICES, AG2_TEMPLATE_SOURCE, COPILOTKIT_LANGGRAPH_PYTHON_TEMPLATE, COPILOTKIT_AGENTCORE_TEMPLATE, TEMPLATE_REPOS, UV_PREREQUISITE, DOTNET_PREREQUISITE, PYTHON3_PREREQUISITE, OPENAI_ENV_KEY, ANTHROPIC_ENV_KEY, GOOGLE_ENV_KEY, COPILOTKIT_LICENSE_ENV_KEY, FRAMEWORK_TEMPLATES, THREADS_FRAMEWORKS;
463
+ var AGENT_FRAMEWORKS, FRAMEWORK_ALIASES, FRAMEWORK_EMOJI, FRAMEWORK_CHOICES, TEMPLATE_REPOS, UV_PREREQUISITE, DOTNET_PREREQUISITE, PYTHON3_PREREQUISITE, OPENAI_ENV_KEY, ANTHROPIC_ENV_KEY, GOOGLE_ENV_KEY, COPILOTKIT_LICENSE_ENV_KEY, FRAMEWORK_TEMPLATES, THREADS_FRAMEWORKS;
384
464
  var init_types = __esm({
385
465
  "apps/cli/src/types.ts"() {
386
466
  "use strict";
387
467
  init_config();
468
+ init_starter_source_catalog();
388
469
  init_agentcore_config();
389
470
  init_showcase_config();
390
471
  init_event_properties();
391
- AGENT_FRAMEWORKS = [
392
- "langgraph-py",
393
- "langgraph-js",
394
- "claude-sdk-typescript",
395
- "claude-sdk-python",
396
- "flows",
397
- "mastra",
398
- "pydantic-ai",
399
- "llamaindex",
400
- "agno",
401
- "ag2",
402
- "adk",
403
- "adk-angular",
404
- "aws-strands-py",
405
- "a2a",
406
- "microsoft-agent-framework-dotnet",
407
- "microsoft-agent-framework-py",
408
- "mcp-apps",
409
- "agentcore-langgraph",
410
- "agentcore-strands",
411
- "a2ui",
412
- "opengenui"
413
- ];
472
+ AGENT_FRAMEWORKS = Object.keys(
473
+ STARTER_SOURCE_CATALOG
474
+ );
414
475
  FRAMEWORK_ALIASES = {
415
476
  "crew-ai": "flows",
416
477
  "angular-adk": "adk-angular"
@@ -497,47 +558,12 @@ var init_types = __esm({
497
558
  value: "opengenui"
498
559
  }
499
560
  ];
500
- AG2_TEMPLATE_SOURCE = {
501
- owner: "ag2ai",
502
- repo: "ag2-copilotkit-starter",
503
- branch: "main",
504
- path: ""
505
- };
506
- COPILOTKIT_LANGGRAPH_PYTHON_TEMPLATE = ckTemplate(
507
- "examples/integrations/langgraph-python"
508
- );
509
- COPILOTKIT_AGENTCORE_TEMPLATE = ckTemplate(
510
- "examples/integrations/agentcore"
561
+ TEMPLATE_REPOS = Object.fromEntries(
562
+ Object.keys(STARTER_SOURCE_CATALOG).map((framework) => [
563
+ framework,
564
+ bindStarterSource(framework, getTemplateRef())
565
+ ])
511
566
  );
512
- TEMPLATE_REPOS = {
513
- "langgraph-py": COPILOTKIT_LANGGRAPH_PYTHON_TEMPLATE,
514
- "langgraph-js": ckTemplate("examples/integrations/langgraph-js"),
515
- "claude-sdk-typescript": ckTemplate(
516
- "examples/integrations/claude-sdk-typescript"
517
- ),
518
- "claude-sdk-python": ckTemplate("examples/integrations/claude-sdk-python"),
519
- mastra: ckTemplate("examples/integrations/mastra"),
520
- flows: ckTemplate("examples/integrations/crewai-flows"),
521
- llamaindex: ckTemplate("examples/integrations/llamaindex"),
522
- agno: ckTemplate("examples/integrations/agno"),
523
- "pydantic-ai": ckTemplate("examples/integrations/pydantic-ai"),
524
- ag2: AG2_TEMPLATE_SOURCE,
525
- adk: ckTemplate("examples/integrations/adk"),
526
- "adk-angular": ckTemplate("examples/integrations/adk-angular"),
527
- "aws-strands-py": ckTemplate("examples/integrations/strands-python"),
528
- a2a: ckTemplate("examples/integrations/a2a-middleware"),
529
- "microsoft-agent-framework-dotnet": ckTemplate(
530
- "examples/integrations/ms-agent-framework-dotnet"
531
- ),
532
- "microsoft-agent-framework-py": ckTemplate(
533
- "examples/integrations/ms-agent-framework-python"
534
- ),
535
- "mcp-apps": ckTemplate("examples/integrations/mcp-apps"),
536
- "agentcore-langgraph": COPILOTKIT_AGENTCORE_TEMPLATE,
537
- "agentcore-strands": COPILOTKIT_AGENTCORE_TEMPLATE,
538
- a2ui: COPILOTKIT_LANGGRAPH_PYTHON_TEMPLATE,
539
- opengenui: COPILOTKIT_LANGGRAPH_PYTHON_TEMPLATE
540
- };
541
567
  UV_PREREQUISITE = {
542
568
  command: "uv",
543
569
  label: "uv",
@@ -27165,7 +27191,8 @@ var init_src2 = __esm({
27165
27191
  "managed_channels.slack",
27166
27192
  "managed_channels.teams",
27167
27193
  "managed_channels.max_channels",
27168
- "managed_channels.ingress_retry_minutes"
27194
+ "managed_channels.ingress_retry_minutes",
27195
+ "managed_channels.max_lifetime_turns"
27169
27196
  ];
27170
27197
  LICENSED_FEATURES = {
27171
27198
  "threads.retention_hours": {
@@ -27265,6 +27292,13 @@ var init_src2 = __esm({
27265
27292
  valueKind: "number",
27266
27293
  component: false,
27267
27294
  runtime: true
27295
+ },
27296
+ "managed_channels.max_lifetime_turns": {
27297
+ id: "managed_channels.max_lifetime_turns",
27298
+ displayName: "Managed Channels Lifetime Turn Limit",
27299
+ valueKind: "number",
27300
+ component: false,
27301
+ runtime: true
27268
27302
  }
27269
27303
  };
27270
27304
  BASE_FEATURES = {
@@ -27281,7 +27315,8 @@ var init_src2 = __esm({
27281
27315
  "managed_channels.slack": false,
27282
27316
  "managed_channels.teams": false,
27283
27317
  "managed_channels.max_channels": 0,
27284
- "managed_channels.ingress_retry_minutes": 0
27318
+ "managed_channels.ingress_retry_minutes": 0,
27319
+ "managed_channels.max_lifetime_turns": 0
27285
27320
  };
27286
27321
  LICENSE_CATALOG = {
27287
27322
  free: {
@@ -27297,7 +27332,13 @@ var init_src2 = __esm({
27297
27332
  "threads.retention_hours": 72,
27298
27333
  // 3 days
27299
27334
  "threads.max_count": 200,
27300
- multimodal_storage_gb: 1
27335
+ multimodal_storage_gb: 1,
27336
+ managed_channels: true,
27337
+ "managed_channels.slack": true,
27338
+ "managed_channels.teams": true,
27339
+ "managed_channels.max_channels": 1,
27340
+ "managed_channels.ingress_retry_minutes": 60,
27341
+ "managed_channels.max_lifetime_turns": 500
27301
27342
  }
27302
27343
  },
27303
27344
  developer: {
@@ -27313,7 +27354,14 @@ var init_src2 = __esm({
27313
27354
  "threads.retention_hours": 72,
27314
27355
  // 3 days
27315
27356
  "threads.max_count": 200,
27316
- multimodal_storage_gb: 1
27357
+ multimodal_storage_gb: 1,
27358
+ managed_channels: true,
27359
+ // Teams follows the all-plan policy; Slack stays off to preserve legacy
27360
+ // Developer behavior.
27361
+ "managed_channels.teams": true,
27362
+ "managed_channels.max_channels": 1,
27363
+ "managed_channels.ingress_retry_minutes": 60,
27364
+ "managed_channels.max_lifetime_turns": 500
27317
27365
  }
27318
27366
  },
27319
27367
  pro: {
@@ -27332,6 +27380,7 @@ var init_src2 = __esm({
27332
27380
  multimodal_storage_gb: 10,
27333
27381
  managed_channels: true,
27334
27382
  "managed_channels.slack": true,
27383
+ "managed_channels.teams": true,
27335
27384
  "managed_channels.max_channels": 3,
27336
27385
  "managed_channels.ingress_retry_minutes": 60
27337
27386
  }
@@ -27352,6 +27401,7 @@ var init_src2 = __esm({
27352
27401
  multimodal_storage_gb: 100,
27353
27402
  managed_channels: true,
27354
27403
  "managed_channels.slack": true,
27404
+ "managed_channels.teams": true,
27355
27405
  "managed_channels.max_channels": 5,
27356
27406
  "managed_channels.ingress_retry_minutes": 60
27357
27407
  }
@@ -27373,6 +27423,7 @@ var init_src2 = __esm({
27373
27423
  deployment_via_helm_chart: true,
27374
27424
  managed_channels: true,
27375
27425
  "managed_channels.slack": true,
27426
+ "managed_channels.teams": true,
27376
27427
  "managed_channels.max_channels": 0,
27377
27428
  "managed_channels.ingress_retry_minutes": 60
27378
27429
  }
@@ -27394,6 +27445,7 @@ var init_src2 = __esm({
27394
27445
  memory: true,
27395
27446
  managed_channels: true,
27396
27447
  "managed_channels.slack": true,
27448
+ "managed_channels.teams": true,
27397
27449
  "managed_channels.max_channels": 0,
27398
27450
  "managed_channels.ingress_retry_minutes": 60
27399
27451
  }
@@ -93335,7 +93387,7 @@ var init_browser_login = __esm({
93335
93387
  import * as fs14 from "node:fs";
93336
93388
  import * as path10 from "node:path";
93337
93389
  import * as os6 from "node:os";
93338
- import { execSync } from "node:child_process";
93390
+ import { execFileSync as execFileSync3 } from "node:child_process";
93339
93391
  function isProjectDirOccupied(projectDir) {
93340
93392
  return fs14.existsSync(projectDir) && fs14.readdirSync(projectDir).length > 0;
93341
93393
  }
@@ -93367,29 +93419,42 @@ async function scaffoldProject(options) {
93367
93419
  const source = typeof template === "string" ? parseGitHubUrl(template) : {
93368
93420
  owner: template.owner,
93369
93421
  repo: template.repo,
93370
- branch: template.branch,
93371
- subdirectoryPath: template.path
93422
+ revision: template.revision,
93423
+ subdirectoryPath: template.path,
93424
+ mode: template.mode
93372
93425
  };
93373
93426
  await cloneTemplate(source, projectDir);
93374
93427
  }
93428
+ function pathEntryExists(entryPath) {
93429
+ try {
93430
+ fs14.lstatSync(entryPath);
93431
+ return true;
93432
+ } catch (error48) {
93433
+ if (error48 instanceof Error && "code" in error48 && error48.code === "ENOENT") {
93434
+ return false;
93435
+ }
93436
+ throw error48;
93437
+ }
93438
+ }
93375
93439
  async function cloneTemplate(source, destinationPath) {
93376
- const { owner, repo, branch, subdirectoryPath } = source;
93440
+ const { owner, repo, revision, subdirectoryPath, mode } = source;
93377
93441
  const tempDir = fs14.mkdtempSync(path10.join(os6.tmpdir(), "copilotkit-clone-"));
93378
- const isWholeRepo = subdirectoryPath === "";
93442
+ const isWholeRepo = mode === "whole-repository";
93443
+ const destinationExisted = pathEntryExists(destinationPath);
93379
93444
  try {
93380
93445
  runGit(
93381
- "git init",
93446
+ ["init"],
93382
93447
  { cwd: tempDir, stdio: "pipe" },
93383
93448
  TELEMETRY_ERROR_CODES.GIT_FAILED
93384
93449
  );
93385
93450
  runGit(
93386
- `git remote add origin https://github.com/${owner}/${repo}.git`,
93451
+ ["remote", "add", "origin", `https://github.com/${owner}/${repo}.git`],
93387
93452
  { cwd: tempDir, stdio: "pipe" },
93388
93453
  TELEMETRY_ERROR_CODES.GIT_FAILED
93389
93454
  );
93390
93455
  if (!isWholeRepo) {
93391
93456
  runGit(
93392
- "git config core.sparseCheckout true",
93457
+ ["config", "core.sparseCheckout", "true"],
93393
93458
  { cwd: tempDir, stdio: "pipe" },
93394
93459
  TELEMETRY_ERROR_CODES.GIT_FAILED
93395
93460
  );
@@ -93399,10 +93464,15 @@ async function cloneTemplate(source, destinationPath) {
93399
93464
  );
93400
93465
  }
93401
93466
  runGit(
93402
- `git pull origin ${branch} --depth=1`,
93467
+ ["fetch", "--depth=1", "origin", revision],
93403
93468
  { cwd: tempDir, stdio: "pipe" },
93404
93469
  TELEMETRY_ERROR_CODES.TEMPLATE_FETCH_FAILED
93405
93470
  );
93471
+ runGit(
93472
+ ["checkout", "--detach", "FETCH_HEAD"],
93473
+ { cwd: tempDir, stdio: "pipe" },
93474
+ TELEMETRY_ERROR_CODES.GIT_FAILED
93475
+ );
93406
93476
  const sourcePath = isWholeRepo ? tempDir : path10.join(tempDir, subdirectoryPath);
93407
93477
  if (!isWholeRepo && !fs14.existsSync(sourcePath)) {
93408
93478
  throw tagError(
@@ -93414,6 +93484,16 @@ async function cloneTemplate(source, destinationPath) {
93414
93484
  }
93415
93485
  fs14.mkdirSync(destinationPath, { recursive: true });
93416
93486
  await copyDirectory(sourcePath, destinationPath, isWholeRepo);
93487
+ } catch (cause) {
93488
+ if (!destinationExisted) {
93489
+ fs14.rmSync(destinationPath, { recursive: true, force: true });
93490
+ }
93491
+ const error48 = cause instanceof Error ? cause : new Error("Starter template checkout failed");
93492
+ const code = error48.code;
93493
+ if (code === TELEMETRY_ERROR_CODES.TEMPLATE_FETCH_FAILED || code === TELEMETRY_ERROR_CODES.GIT_FAILED) {
93494
+ throw error48;
93495
+ }
93496
+ throw tagError(error48, TELEMETRY_ERROR_CODES.TEMPLATE_FETCH_FAILED);
93417
93497
  } finally {
93418
93498
  try {
93419
93499
  fs14.rmSync(tempDir, { recursive: true, force: true });
@@ -93439,11 +93519,11 @@ async function copyDirectory(source, destination, excludeGit = false) {
93439
93519
  }
93440
93520
  }
93441
93521
  }
93442
- function runGit(cmd, opts, code) {
93522
+ function runGit(args, opts, code) {
93443
93523
  try {
93444
- execSync(cmd, opts);
93524
+ execFileSync3("git", args, opts);
93445
93525
  } catch (cause) {
93446
- const wrapped = cause instanceof Error ? cause : new Error(`git command failed: ${cmd}`);
93526
+ const wrapped = cause instanceof Error ? cause : new Error(`git command failed: git ${args.join(" ")}`);
93447
93527
  throw tagError(wrapped, code);
93448
93528
  }
93449
93529
  }
@@ -93458,13 +93538,19 @@ function parseGitHubUrl(githubUrl) {
93458
93538
  }
93459
93539
  const owner = pathParts[0];
93460
93540
  const repo = pathParts[1];
93461
- let branch = "main";
93541
+ let revision = "main";
93462
93542
  let subdirectoryPath = "";
93463
93543
  if (pathParts.length > 3 && (pathParts[2] === "tree" || pathParts[2] === "blob")) {
93464
- branch = pathParts[3];
93544
+ revision = pathParts[3];
93465
93545
  subdirectoryPath = pathParts.slice(4).join("/");
93466
93546
  }
93467
- return { owner, repo, branch, subdirectoryPath };
93547
+ return {
93548
+ owner,
93549
+ repo,
93550
+ revision,
93551
+ subdirectoryPath,
93552
+ mode: subdirectoryPath === "" ? "whole-repository" : "sparse"
93553
+ };
93468
93554
  }
93469
93555
  function copyEnvExample(projectDir) {
93470
93556
  const envPath = path10.join(projectDir, ".env");
@@ -93514,11 +93600,11 @@ function writeEnvLicenseKey(projectDir, licenseKey) {
93514
93600
  }
93515
93601
  function checkGitIdentity(projectDir) {
93516
93602
  try {
93517
- const name = execSync("git config user.name", {
93603
+ const name = execFileSync3("git", ["config", "user.name"], {
93518
93604
  cwd: projectDir,
93519
93605
  stdio: "pipe"
93520
93606
  }).toString().trim();
93521
- const email3 = execSync("git config user.email", {
93607
+ const email3 = execFileSync3("git", ["config", "user.email"], {
93522
93608
  cwd: projectDir,
93523
93609
  stdio: "pipe"
93524
93610
  }).toString().trim();
@@ -93528,8 +93614,8 @@ function checkGitIdentity(projectDir) {
93528
93614
  }
93529
93615
  }
93530
93616
  async function commitInitial(projectDir) {
93531
- execSync("git add .", { cwd: projectDir, stdio: "pipe" });
93532
- execSync('git commit -m "Initial commit"', {
93617
+ execFileSync3("git", ["add", "."], { cwd: projectDir, stdio: "pipe" });
93618
+ execFileSync3("git", ["commit", "-m", "Initial commit"], {
93533
93619
  cwd: projectDir,
93534
93620
  stdio: "pipe"
93535
93621
  });
@@ -354451,7 +354537,7 @@ import {
354451
354537
  rmSync as rmSync3
354452
354538
  } from "node:fs";
354453
354539
  import * as path25 from "node:path";
354454
- import { execSync as execSync2 } from "node:child_process";
354540
+ import { execSync } from "node:child_process";
354455
354541
  function shouldRenderInitBrowserLoginConfirmation(phase) {
354456
354542
  return phase === "confirming" || phase === "waiting" || phase === "finalizing";
354457
354543
  }
@@ -354459,7 +354545,7 @@ function writeLicenseKey(projectDir, licenseKey) {
354459
354545
  writeEnvLicenseKey(projectDir, licenseKey);
354460
354546
  }
354461
354547
  async function initGit(projectDir) {
354462
- execSync2("git init", { cwd: projectDir, stdio: "pipe" });
354548
+ execSync("git init", { cwd: projectDir, stdio: "pipe" });
354463
354549
  if (checkGitIdentity(projectDir)) {
354464
354550
  await commitInitial(projectDir);
354465
354551
  }
@@ -355356,12 +355442,14 @@ __export(version_exports, {
355356
355442
  runVersion: () => runVersion
355357
355443
  });
355358
355444
  function runVersion() {
355359
- const { version: version5, buildNumber, commitSha } = getBuildInfo();
355360
- process.stdout.write(`Version: ${version5}
355445
+ const { version: version5, buildNumber, commitSha, copilotKitCommit } = getBuildInfo();
355446
+ process.stdout.write(`Version: ${version5}
355447
+ `);
355448
+ process.stdout.write(`Build: ${buildNumber}
355361
355449
  `);
355362
- process.stdout.write(`Build: ${buildNumber}
355450
+ process.stdout.write(`Intelligence commit: ${commitSha}
355363
355451
  `);
355364
- process.stdout.write(`Commit: ${commitSha}
355452
+ process.stdout.write(`CopilotKit commit: ${copilotKitCommit}
355365
355453
  `);
355366
355454
  }
355367
355455
  var init_version5 = __esm({
package/package.json CHANGED
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "name": "copilotkit",
3
- "version": "4.4.0",
3
+ "version": "4.5.1",
4
4
  "type": "module",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/CopilotKit/Intelligence.git",
8
+ "directory": "apps/cli"
9
+ },
5
10
  "bin": {
6
11
  "copilotkit": "./index.js"
7
12
  }