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
@@ -0,0 +1,107 @@
1
+ import * as http from "http";
2
+ import { ApiClientError } from "./api-client.js";
3
+ import type { VerifySessionResponse } from "./api-client.js";
4
+ /**
5
+ * Result of a successful callback from the browser-based login flow.
6
+ */
7
+ export interface CallbackResult {
8
+ /** Short-lived Clerk token returned from the frontend callback. */
9
+ clerkToken: string;
10
+ }
11
+ /**
12
+ * Starts a temporary HTTP server on a random port bound to 127.0.0.1 that
13
+ * handles the CLI auth callback from the browser.
14
+ *
15
+ * The browser redirects (GET) to `/callback?clerkToken=…&state=…` after
16
+ * sign-in. The server validates `state`, resolves the result promise with
17
+ * the received `clerkToken`, and responds with a small HTML page telling
18
+ * the user they can close the tab. A full-page navigation is used rather
19
+ * than `fetch` so the flow works in Safari 15+ and Chrome 130+, which
20
+ * block HTTPS → private-network `fetch` requests.
21
+ *
22
+ * @param expectedState - The CSRF state token to validate against the callback
23
+ * payload.
24
+ * @returns A promise that resolves once the server is listening, providing the
25
+ * bound `port`, a `resultPromise` that resolves/rejects based on the callback
26
+ * payload, and the raw `server` handle for cleanup.
27
+ */
28
+ export declare function startCallbackServer(expectedState: string): Promise<{
29
+ port: number;
30
+ resultPromise: Promise<CallbackResult>;
31
+ server: http.Server;
32
+ }>;
33
+ /**
34
+ * Launches the browser-based login flow, waits for the callback, exchanges
35
+ * the Clerk token for a CLI session token, persists the credentials, and
36
+ * returns the authenticated user and organization.
37
+ *
38
+ * Steps:
39
+ * 1. Generate a random CSRF state token.
40
+ * 2. Start a local callback server.
41
+ * 3. Open the browser to the ops-frontend CLI auth page.
42
+ * 4. Wait for the callback with the Clerk token.
43
+ * 5. Exchange the Clerk token for a CLI session via ops-api.
44
+ * 6. Persist credentials to the auth store.
45
+ *
46
+ * @returns The authenticated user and organization from the ops-api response.
47
+ */
48
+ export declare function login(): Promise<{
49
+ user: {
50
+ id: string;
51
+ email: string;
52
+ name: string | null;
53
+ };
54
+ organization: {
55
+ clerkOrgId: string;
56
+ organizationName?: string;
57
+ };
58
+ }>;
59
+ export interface VerifyAndRefreshOptions {
60
+ /** When true, preserve the specific auth/session error instead of returning null. */
61
+ throwOnInvalid?: boolean;
62
+ }
63
+ /**
64
+ * User-facing guidance shown when a stored CLI session is no longer usable
65
+ * after the Clerk cutover and the user must authenticate again.
66
+ */
67
+ export declare const TERMINAL_SESSION_INVALID_MESSAGE = "Existing CLI sessions are invalid after the Clerk cutover. Please log in again.";
68
+ /**
69
+ * Checks whether an API error means the current stored CLI auth is no longer
70
+ * recoverable and must be cleared before the user logs in again.
71
+ *
72
+ * Treats all CLI session retirement errors, plus Clerk active-organization
73
+ * resolution failures, as terminal invalidation signals.
74
+ *
75
+ * @param error - Error raised by the API client.
76
+ * @returns `true` when local auth should be cleared and the user reauthenticated.
77
+ */
78
+ export declare function isTerminalSessionInvalidationError(error: unknown): error is ApiClientError;
79
+ /**
80
+ * Clears the local auth store when the error represents a terminal CLI auth
81
+ * invalidation that requires a fresh login.
82
+ *
83
+ * @param error - Error raised by the API client.
84
+ * @returns `true` when local auth was cleared.
85
+ */
86
+ export declare function clearAuthOnTerminalSessionInvalidation(error: unknown): boolean;
87
+ /**
88
+ * Verifies the stored CLI session token against ops-api and refreshes the
89
+ * locally persisted credentials if still valid.
90
+ *
91
+ * Returns `null` and clears the local auth store only when the server confirms
92
+ * the session is invalid. Missing local auth also returns `null`. Transport or
93
+ * server failures are rethrown so the caller can preserve the local session.
94
+ *
95
+ * @param options - Controls how invalid sessions are surfaced to the caller.
96
+ * @returns The fresh session user/org data, or `null` if unauthenticated.
97
+ */
98
+ export declare function verifyAndRefresh(options?: VerifyAndRefreshOptions): Promise<VerifySessionResponse | null>;
99
+ /**
100
+ * Terminates the current CLI session on ops-api (best-effort) and clears all
101
+ * locally stored credentials.
102
+ *
103
+ * Any network error from the server-side logout is swallowed; the local
104
+ * credentials are always cleared.
105
+ */
106
+ export declare function logout(): Promise<void>;
107
+ //# sourceMappingURL=auth.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/services/auth.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAmB,MAAM,iBAAiB,CAAC;AASlE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAI7D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,mEAAmE;IACnE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IACvC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;CACrB,CAAC,CA8ID;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,KAAK,IAAI,OAAO,CAAC;IACrC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IACzD,YAAY,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACjE,CAAC,CA2GD;AAED,MAAM,WAAW,uBAAuB;IACtC,qFAAqF;IACrF,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,gCAAgC,oFACsC,CAAC;AAEpF;;;;;;;;;GASG;AACH,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,cAAc,CAOzB;AAED;;;;;;GAMG;AACH,wBAAgB,sCAAsC,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAO9E;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CA2BvC;AAED;;;;;;GAMG;AACH,wBAAsB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAa5C"}
@@ -0,0 +1,71 @@
1
+ /** Shared CLI diagnostics log path retained for auth-specific imports/tests. */
2
+ export { CLI_LOG_PATH as CLI_AUTH_DIAGNOSTICS_LOG_PATH } from "./cli-logs.js";
3
+ /** Sanitized hosted CLI auth event captured in the browser flow. */
4
+ export interface HostedCliAuthDiagnosticEvent {
5
+ at: string;
6
+ details?: Record<string, unknown>;
7
+ phase: string;
8
+ }
9
+ /** Sanitized hosted CLI auth snapshot handed back to the local CLI callback. */
10
+ export interface HostedCliAuthDiagnosticSnapshot {
11
+ events: HostedCliAuthDiagnosticEvent[];
12
+ flowId: string;
13
+ }
14
+ /** Active CLI auth diagnostics session. */
15
+ export interface CliAuthDiagnostics {
16
+ readonly runId: string;
17
+ logError(phase: string, error: unknown, details?: Record<string, unknown>): void;
18
+ logHostedSnapshot(snapshot: HostedCliAuthDiagnosticSnapshot): void;
19
+ logPhase(phase: string, details?: Record<string, unknown>): void;
20
+ }
21
+ /**
22
+ * Summarizes a loopback callback URL without including auth query values.
23
+ *
24
+ * @param rawUrl - URL to summarize.
25
+ * @returns Safe callback metadata for diagnostics.
26
+ */
27
+ export declare function summarizeCallbackUrl(rawUrl: string): Record<string, unknown>;
28
+ /**
29
+ * Summarizes a state token without logging its full value.
30
+ *
31
+ * @param value - State token to summarize.
32
+ * @returns Redacted state metadata.
33
+ */
34
+ export declare function summarizeState(value: string | null | undefined): Record<string, unknown>;
35
+ /**
36
+ * Parses a hosted CLI auth diagnostics snapshot from the loopback callback.
37
+ *
38
+ * @param raw - Raw query parameter value.
39
+ * @returns A sanitized snapshot or null when absent/invalid.
40
+ */
41
+ export declare function parseHostedCliAuthDiagnosticSnapshot(raw: string | null): HostedCliAuthDiagnosticSnapshot | null;
42
+ /**
43
+ * Creates a temporary CLI auth diagnostics session.
44
+ *
45
+ * @param runId - Correlation id for the login attempt.
46
+ * @returns Logger that mirrors high-signal events to stderr and the CLI log.
47
+ */
48
+ export declare function createCliAuthDiagnostics(runId: string): CliAuthDiagnostics;
49
+ /**
50
+ * Controls whether CLI auth diagnostics are mirrored to stderr.
51
+ *
52
+ * Deprecated compatibility wrapper around the shared CLI logs setting.
53
+ *
54
+ * @param verbose - Whether stderr mirroring should be enabled.
55
+ */
56
+ export declare function setCliAuthDiagnosticsVerbose(verbose: boolean): void;
57
+ /**
58
+ * Returns whether CLI auth diagnostics are currently mirrored to stderr.
59
+ *
60
+ * @returns Current stderr mirroring state.
61
+ */
62
+ export declare function isCliAuthDiagnosticsVerboseEnabled(): boolean;
63
+ /**
64
+ * Returns a concrete error instance for user-facing CLI error propagation.
65
+ *
66
+ * @param error - Unknown thrown value.
67
+ * @param fallbackMessage - Message to use when no concrete error exists.
68
+ * @returns An Error instance.
69
+ */
70
+ export declare function toConcreteError(error: unknown, fallbackMessage: string): Error;
71
+ //# sourceMappingURL=cli-auth-diagnostics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-auth-diagnostics.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/services/cli-auth-diagnostics.ts"],"names":[],"mappings":"AAOA,gFAAgF;AAChF,OAAO,EAAE,YAAY,IAAI,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAE9E,oEAAoE;AACpE,MAAM,WAAW,4BAA4B;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,gFAAgF;AAChF,MAAM,WAAW,+BAA+B;IAC9C,MAAM,EAAE,4BAA4B,EAAE,CAAC;IACvC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,2CAA2C;AAC3C,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACjF,iBAAiB,CAAC,QAAQ,EAAE,+BAA+B,GAAG,IAAI,CAAC;IACnE,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAClE;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAY5E;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAUxF;AAED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAClD,GAAG,EAAE,MAAM,GAAG,IAAI,GACjB,+BAA+B,GAAG,IAAI,CA8CxC;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB,CAoD1E;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAEnE;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,IAAI,OAAO,CAE5D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,OAAO,EACd,eAAe,EAAE,MAAM,GACtB,KAAK,CAUP"}
@@ -0,0 +1,45 @@
1
+ /** Private per-user directory used by the CLI for structured diagnostics. */
2
+ export declare const CLI_LOG_DIRECTORY: string;
3
+ /** Shared per-user log file used by the CLI for structured diagnostics. */
4
+ export declare const CLI_LOG_PATH: string;
5
+ /**
6
+ * Returns the resolved filesystem path of the CLI log file.
7
+ *
8
+ * @returns Absolute CLI log path.
9
+ */
10
+ export declare function getCliLogPath(): string;
11
+ /**
12
+ * Controls whether high-signal CLI diagnostics are mirrored to stderr.
13
+ *
14
+ * @param verbose - Whether stderr mirroring should be enabled.
15
+ */
16
+ export declare function setCliLogsVerbose(verbose: boolean): void;
17
+ /**
18
+ * Returns whether CLI diagnostics are currently mirrored to stderr.
19
+ *
20
+ * @returns Current stderr mirroring state.
21
+ */
22
+ export declare function isCliLogsVerboseEnabled(): boolean;
23
+ /**
24
+ * Writes a structured log event to the shared CLI log file.
25
+ *
26
+ * @param level - Log level.
27
+ * @param payload - Structured payload to append.
28
+ */
29
+ export declare function writeCliLog(level: "error" | "info", payload: Record<string, unknown>): void;
30
+ /**
31
+ * Mirrors a formatted diagnostics line to stderr when verbose mode is enabled.
32
+ *
33
+ * @param prefix - User-facing log prefix.
34
+ * @param phase - Phase identifier.
35
+ * @param details - Sanitized metadata to render.
36
+ */
37
+ export declare function maybeWriteCliVerboseLine(prefix: string, phase: string, details: Record<string, unknown>): void;
38
+ /**
39
+ * Reads the last `count` lines from the shared CLI log file.
40
+ *
41
+ * @param count - Number of trailing lines to return.
42
+ * @returns Trailing log lines, or an empty array when the file does not exist.
43
+ */
44
+ export declare function readCliLogTail(count: number): string[];
45
+ //# sourceMappingURL=cli-logs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-logs.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/services/cli-logs.ts"],"names":[],"mappings":"AAKA,6EAA6E;AAC7E,eAAO,MAAM,iBAAiB,QAG7B,CAAC;AACF,2EAA2E;AAC3E,eAAO,MAAM,YAAY,QAA0C,CAAC;AAyDpE;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAExD;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,OAAO,CAEjD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,OAAO,GAAG,MAAM,EACvB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,IAAI,CAEN;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,IAAI,CAMN;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CA6BtD"}
@@ -0,0 +1,53 @@
1
+ import type { StoredAuth } from '../types.js';
2
+ /**
3
+ * Persistent store for CLI authentication credentials.
4
+ *
5
+ * Wraps the `copilotkit-auth` conf store and provides typed read/write access
6
+ * to the fields defined by {@link StoredAuth}.
7
+ */
8
+ export declare const authStore: {
9
+ /**
10
+ * Persists all fields of the given {@link StoredAuth} to disk.
11
+ *
12
+ * @param auth - The authentication data to store.
13
+ */
14
+ save(auth: StoredAuth): void;
15
+ /**
16
+ * Reads all stored auth fields and returns them as a {@link StoredAuth} object.
17
+ *
18
+ * Returns `null` if no `cliToken` is present in the store.
19
+ */
20
+ get(): StoredAuth | null;
21
+ /**
22
+ * Reads and returns only the stored CLI token.
23
+ *
24
+ * Returns `null` if no token has been saved.
25
+ */
26
+ getToken(): string | null;
27
+ /**
28
+ * Removes all entries from the auth store.
29
+ */
30
+ clear(): void;
31
+ };
32
+ /**
33
+ * General-purpose persistent key/value store for CLI dev settings.
34
+ *
35
+ * Wraps the `copilotkit-config` conf store with generic typed accessors.
36
+ */
37
+ export declare const configStore: {
38
+ /**
39
+ * Retrieves the value stored under the given key.
40
+ *
41
+ * @param key - The configuration key to look up.
42
+ * @returns The stored value cast to `T`, or `undefined` if not present.
43
+ */
44
+ get<T>(key: string): T | undefined;
45
+ /**
46
+ * Stores `value` under the given key.
47
+ *
48
+ * @param key - The configuration key to write.
49
+ * @param value - The value to store.
50
+ */
51
+ set(key: string, value: unknown): void;
52
+ };
53
+ //# sourceMappingURL=config.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.service.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/services/config.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C;;;;;GAKG;AACH,eAAO,MAAM,SAAS;IACpB;;;;OAIG;eACQ,UAAU,GAAG,IAAI;IAa5B;;;;OAIG;WACI,UAAU,GAAG,IAAI;IAcxB;;;;OAIG;gBACS,MAAM,GAAG,IAAI;IAIzB;;OAEG;aACM,IAAI;CAGd,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW;IACtB;;;;;OAKG;QACC,CAAC,OAAO,MAAM,GAAG,CAAC,GAAG,SAAS;IAIlC;;;;;OAKG;aACM,MAAM,SAAS,OAAO,GAAG,IAAI;CAGvC,CAAC"}
@@ -0,0 +1,14 @@
1
+ /** Hardcoded password for threads access (temporary). */
2
+ export declare const THREADS_PASSWORD = "earlyaccess";
3
+ /**
4
+ * Checks whether the user has previously unlocked threads access.
5
+ *
6
+ * Reads the `threads-access` key from the global config store.
7
+ * Returns `false` when the key is absent or not `true`.
8
+ */
9
+ export declare function hasThreadsAccess(): boolean;
10
+ /**
11
+ * Grants threads access by writing `threads-access: true` to the global config.
12
+ */
13
+ export declare function grantThreadsAccess(): void;
14
+ //# sourceMappingURL=feature-flags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature-flags.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/services/feature-flags.ts"],"names":[],"mappings":"AAEA,yDAAyD;AACzD,eAAO,MAAM,gBAAgB,gBAAgB,CAAC;AAE9C;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
@@ -0,0 +1,99 @@
1
+ /** Width of the default kite game board. */
2
+ export declare const DEFAULT_KITE_GAME_WIDTH = 42;
3
+ /** Height of the default kite game board. */
4
+ export declare const DEFAULT_KITE_GAME_HEIGHT = 20;
5
+ /** Initial X coordinate of the kite. */
6
+ export declare const KITE_X = 8;
7
+ /** Terminal glyph used to render the player kite. */
8
+ export declare const KITE_PLAYER_GLYPH = "\uD83E\uDE81";
9
+ /** Terminal glyph used to render cloud obstacles. */
10
+ export declare const KITE_CLOUD_GLYPH = "\u2601\uFE0F";
11
+ /** Function used to generate deterministic random values. */
12
+ export type KiteGameRng = () => number;
13
+ /** Cloud obstacle in the kite game board. */
14
+ export interface KiteCloud {
15
+ /** Horizontal position of the cloud column. */
16
+ readonly x: number;
17
+ /** First open row in the cloud gap. */
18
+ readonly gapY: number;
19
+ /** Height of the open cloud gap. */
20
+ readonly gapHeight: number;
21
+ /** Whether the kite already scored for passing this cloud. */
22
+ readonly passed: boolean;
23
+ }
24
+ /** Complete deterministic kite game state. */
25
+ export interface KiteGameState {
26
+ /** Board width in terminal cells. */
27
+ readonly width: number;
28
+ /** Board height in terminal rows. */
29
+ readonly height: number;
30
+ /** Current kite Y coordinate. */
31
+ readonly kiteY: number;
32
+ /** Current kite vertical velocity. */
33
+ readonly velocity: number;
34
+ /** Current score. */
35
+ readonly score: number;
36
+ /** Number of elapsed engine ticks. */
37
+ readonly tick: number;
38
+ /** Whether physics and cloud movement have started. */
39
+ readonly started: boolean;
40
+ /** Whether the current run has crashed. */
41
+ readonly crashed: boolean;
42
+ /** Active cloud obstacles. */
43
+ readonly clouds: readonly KiteCloud[];
44
+ }
45
+ /** Input options for creating a kite game. */
46
+ export interface CreateKiteGameOptions {
47
+ /** Board width in terminal cells. */
48
+ readonly width?: number;
49
+ /** Board height in terminal rows. */
50
+ readonly height?: number;
51
+ /** Random source for deterministic tests. */
52
+ readonly rng?: KiteGameRng;
53
+ }
54
+ /** Difficulty values derived from the current score. */
55
+ export interface KiteGameDifficulty {
56
+ /** Number of ticks between cloud movement steps. */
57
+ readonly moveEveryTicks: number;
58
+ /** Number of columns between newly spawned clouds. */
59
+ readonly cloudSpacing: number;
60
+ /** Height of the safe gap through each cloud. */
61
+ readonly gapHeight: number;
62
+ }
63
+ /**
64
+ * Derives progressive game difficulty from score.
65
+ *
66
+ * @param score - Current game score.
67
+ * @returns Difficulty values for the current score.
68
+ */
69
+ export declare function getKiteGameDifficulty(score: number): KiteGameDifficulty;
70
+ /**
71
+ * Creates the initial kite game state.
72
+ *
73
+ * @param options - Board size and deterministic RNG options.
74
+ * @returns A fresh kite game state.
75
+ */
76
+ export declare function createKiteGame(options?: CreateKiteGameOptions): KiteGameState;
77
+ /**
78
+ * Applies one flap impulse to the kite.
79
+ *
80
+ * @param state - Current game state.
81
+ * @returns Updated game state.
82
+ */
83
+ export declare function flapKite(state: KiteGameState): KiteGameState;
84
+ /**
85
+ * Advances the deterministic kite game by one tick.
86
+ *
87
+ * @param state - Current game state.
88
+ * @param rng - Random source for newly spawned clouds.
89
+ * @returns Updated game state.
90
+ */
91
+ export declare function tickKiteGame(state: KiteGameState, rng?: KiteGameRng): KiteGameState;
92
+ /**
93
+ * Renders the current game state into terminal text rows.
94
+ *
95
+ * @param state - Current game state.
96
+ * @returns Board rows suitable for Ink text rendering.
97
+ */
98
+ export declare function renderKiteGameRows(state: KiteGameState): string[];
99
+ //# sourceMappingURL=kite-game-engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kite-game-engine.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/services/kite-game-engine.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C,6CAA6C;AAC7C,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,wCAAwC;AACxC,eAAO,MAAM,MAAM,IAAI,CAAC;AAExB,qDAAqD;AACrD,eAAO,MAAM,iBAAiB,iBAAO,CAAC;AAEtC,qDAAqD;AACrD,eAAO,MAAM,gBAAgB,iBAAO,CAAC;AAErC,6DAA6D;AAC7D,MAAM,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC;AAEvC,6CAA6C;AAC7C,MAAM,WAAW,SAAS;IACxB,+CAA+C;IAC/C,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IAEnB,uCAAuC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,oCAAoC;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAED,8CAA8C;AAC9C,MAAM,WAAW,aAAa;IAC5B,qCAAqC;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,qCAAqC;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,iCAAiC;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,sCAAsC;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,qBAAqB;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,sCAAsC;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,uDAAuD;IACvD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B,2CAA2C;IAC3C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B,8BAA8B;IAC9B,QAAQ,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,CAAC;CACvC;AAED,8CAA8C;AAC9C,MAAM,WAAW,qBAAqB;IACpC,qCAAqC;IACrC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB,qCAAqC;IACrC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEzB,6CAA6C;IAC7C,QAAQ,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC;CAC5B;AAED,wDAAwD;AACxD,MAAM,WAAW,kBAAkB;IACjC,oDAAoD;IACpD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAEhC,sDAAsD;IACtD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B,iDAAiD;IACjD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAQD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB,CAMvE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,OAAO,GAAE,qBAA0B,GAClC,aAAa,CAiBf;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,aAAa,CAK5D;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,aAAa,EACpB,GAAG,GAAE,WAAyB,GAC7B,aAAa,CA0Cf;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,EAAE,CAcjE"}
@@ -0,0 +1,33 @@
1
+ import { z } from "zod";
2
+ /** Config key used to persist the anonymous kite game high score. */
3
+ export declare const KITE_GAME_HIGH_SCORE_KEY = "kite-game-high-score";
4
+ declare const kiteGameHighScoreSchema: z.ZodObject<{
5
+ version: z.ZodLiteral<1>;
6
+ score: z.ZodNumber;
7
+ }, z.core.$strip>;
8
+ /** Versioned high-score record stored in the CLI config store. */
9
+ export type KiteGameHighScore = z.infer<typeof kiteGameHighScoreSchema>;
10
+ /** Store contract used by the kite high-score service. */
11
+ export interface KiteGameScoreStore {
12
+ /** Reads a raw value from the backing store. */
13
+ get<T>(key: string): T | undefined;
14
+ /** Writes a raw value to the backing store. */
15
+ set(key: string, value: unknown): void;
16
+ }
17
+ /**
18
+ * Reads the stored kite game high score.
19
+ *
20
+ * @param store - Backing store to read from.
21
+ * @returns The validated high score, or zero when unset or invalid.
22
+ */
23
+ export declare function readKiteGameHighScore(store?: KiteGameScoreStore): number;
24
+ /**
25
+ * Persists a new kite game high score when it beats the current score.
26
+ *
27
+ * @param score - Candidate score to save.
28
+ * @param store - Backing store to write to.
29
+ * @returns The stored high score after applying the candidate score.
30
+ */
31
+ export declare function saveKiteGameHighScore(score: number, store?: KiteGameScoreStore): number;
32
+ export {};
33
+ //# sourceMappingURL=kite-game-score.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kite-game-score.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/services/kite-game-score.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,qEAAqE;AACrE,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAE/D,QAAA,MAAM,uBAAuB;;;iBAG3B,CAAC;AAEH,kEAAkE;AAClE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,0DAA0D;AAC1D,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC;IAEnC,+CAA+C;IAC/C,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CACxC;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,GAAE,kBAAgC,GAAG,MAAM,CAGrF;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,GAAE,kBAAgC,GAAG,MAAM,CASpG"}
@@ -0,0 +1,49 @@
1
+ import type { TemplateSource } from '../types.js';
2
+ /**
3
+ * Options for scaffolding a new CopilotKit project directory.
4
+ */
5
+ export interface ScaffoldOptions {
6
+ /** Absolute or relative path to the target project directory. */
7
+ projectDir: string;
8
+ /** Template source — either a GitHub URL string or explicit components. */
9
+ template: string | TemplateSource;
10
+ }
11
+ /**
12
+ * Scaffolds a new CopilotKit project by cloning a template from GitHub.
13
+ *
14
+ * @param options - {@link ScaffoldOptions} controlling scaffold behavior.
15
+ * @throws {Error} If `projectDir` already exists and is non-empty.
16
+ */
17
+ export declare function scaffoldProject(options: ScaffoldOptions): Promise<void>;
18
+ /**
19
+ * Copies `.env.example` to `.env` if `.env` does not already exist.
20
+ *
21
+ * @param projectDir - The project directory.
22
+ * @returns `true` when `.env` was created from `.env.example`.
23
+ */
24
+ export declare function copyEnvExample(projectDir: string): boolean;
25
+ /**
26
+ * Writes or appends the license key to the `.env` file in the project directory.
27
+ *
28
+ * If the template already contains a `.env.example`, copies it to `.env` first,
29
+ * then ensures `COPILOTKIT_LICENSE_TOKEN` is set. If no `.env.example` exists,
30
+ * creates a fresh `.env` with the license key.
31
+ *
32
+ * @param projectDir - The project directory.
33
+ * @param licenseKey - The license key value.
34
+ */
35
+ export declare function writeEnvLicenseKey(projectDir: string, licenseKey: string): void;
36
+ /**
37
+ * Checks whether a git user name and email are configured for `projectDir`.
38
+ *
39
+ * @param projectDir - Directory in which to check git identity.
40
+ * @returns `true` if both name and email are configured, `false` otherwise.
41
+ */
42
+ export declare function checkGitIdentity(projectDir: string): boolean;
43
+ /**
44
+ * Creates an initial git commit in `projectDir` staging all files.
45
+ *
46
+ * @param projectDir - Directory in which to create the initial commit.
47
+ */
48
+ export declare function commitInitial(projectDir: string): Promise<void>;
49
+ //# sourceMappingURL=project-scaffold.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-scaffold.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/services/project-scaffold.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,GAAG,cAAc,CAAC;CACnC;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAqB7E;AAkJD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAU1D;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,IAAI,CAsBN;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAkB5D;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMrE"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Showcase identifiers consumed by the langgraph-python starter when run
3
+ * under one of the showcase frameworks (a2ui, opengenui).
4
+ *
5
+ * The starter reads `showcase.json` at runtime to swap out the demo it shows.
6
+ */
7
+ export type ShowcaseId = 'a2ui' | 'opengenui';
8
+ /**
9
+ * Writes a `showcase.json` sidecar file selecting the showcase variant.
10
+ *
11
+ * Mirrors the legacy CLI's `applyShowcaseConfig` behavior so that pointing
12
+ * the a2ui / opengenui frameworks at the langgraph-python starter still
13
+ * works without a dedicated template repo.
14
+ *
15
+ * @param projectDir - The freshly-scaffolded project directory.
16
+ * @param showcase - Showcase variant to record.
17
+ */
18
+ export declare function writeShowcaseConfig(projectDir: string, showcase: ShowcaseId): Promise<void>;
19
+ //# sourceMappingURL=showcase-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"showcase-config.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/services/showcase-config.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,WAAW,CAAC;AAE9C;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,UAAU,GACnB,OAAO,CAAC,IAAI,CAAC,CAGf"}