@agent-native/core 0.114.5 → 0.114.7
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/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +14 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/cli/mcp-config-writers.ts +6 -4
- package/corpus/core/src/cli/mcp.ts +124 -0
- package/corpus/core/src/cli/skills-content/help.ts +4 -3
- package/corpus/core/src/cli/skills-content/index.ts +1 -0
- package/corpus/core/src/cli/skills-content/rewind-skill.ts +52 -0
- package/corpus/core/src/cli/skills.ts +115 -13
- package/corpus/core/src/client/resources/ResourceTree.tsx +11 -5
- package/corpus/core/src/client/resources/ResourcesPanel.tsx +141 -18
- package/corpus/core/src/mcp/screen-memory-stdio.ts +1360 -104
- package/corpus/core/src/mcp-client/index.ts +9 -0
- package/corpus/core/src/mcp-client/screen-memory-local.ts +847 -13
- package/corpus/templates/clips/actions/apply-rewind-extension.ts +195 -0
- package/corpus/templates/clips/actions/delete-agent-recording-if-unpromoted.ts +64 -0
- package/corpus/templates/clips/actions/get-rewind-extension-request.ts +22 -0
- package/corpus/templates/clips/actions/get-screen-memory-status.ts +18 -2
- package/corpus/templates/clips/actions/list-rewind-extension-requests.ts +52 -0
- package/corpus/templates/clips/actions/make-recording-private-for-rewind.ts +55 -0
- package/corpus/templates/clips/actions/query-screen-memory-context.ts +4 -4
- package/corpus/templates/clips/actions/request-rewind-extension.ts +81 -0
- package/corpus/templates/clips/actions/update-rewind-extension-request.ts +47 -0
- package/corpus/templates/clips/app/components/editor/editor-layout.tsx +25 -0
- package/corpus/templates/clips/app/components/editor/editor-toolbar.tsx +36 -0
- package/corpus/templates/clips/app/components/editor/rewind-extension-dialog.tsx +338 -0
- package/corpus/templates/clips/app/components/editor/stitch-manager.tsx +1 -16
- package/corpus/templates/clips/app/components/editor/timeline.tsx +26 -0
- package/corpus/templates/clips/app/components/meetings/meeting-card.tsx +1 -2
- package/corpus/templates/clips/app/i18n/en-US.ts +18 -0
- package/corpus/templates/clips/app/lib/ffmpeg-export.ts +19 -12
- package/corpus/templates/clips/app/lib/rewind-visibility.ts +31 -0
- package/corpus/templates/clips/app/lib/timestamp-mapping.ts +7 -0
- package/corpus/templates/clips/app/lib/upload-file-client.ts +17 -0
- package/corpus/templates/clips/changelog/2026-07-14-rewind-keeps-recent-screen-context-local-and-turns-it-into-clips.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-17-active-clips-keep-rewind-stable-and-settings-clear.md +12 -0
- package/corpus/templates/clips/changelog/2026-07-17-clicking-the-clips-icon-during-a-recording-now-opens-the-app.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-17-default-mic-now-uses-the-mac-default-and-transcription-shares-one-capture.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-17-full-screen-clips-finalize-even-when-screencapturekit-stop-hangs.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-17-normal-full-screen-clips-no-longer-stop-immediately-after-th.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-17-rewind-can-hand-one-bounded-private-clip-to-your-agent.md +12 -0
- package/corpus/templates/clips/changelog/2026-07-17-rewind-home-can-copy-a-local-agent-prompt.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-17-rewind-now-has-a-calm-home-status-focused-first-run-consent-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-17-rewind-settings-are-smaller-clearer-and-agent-first.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-17-the-full-clips-interface-stays-available-while-recording.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-18-rewind-organizes-recent-work-into-local-searchable-chapters.md +8 -0
- package/corpus/templates/clips/changelog/2026-07-18-searchable-rewind-chapters.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-19-rewind-backed-recordings-now-start-immediately-after-the-cou.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-20-opening-zoom-meeting-launches-native-app.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-20-rewind-can-set-up-your-local-agent-once-so-future-requests-w.md +6 -0
- package/corpus/templates/clips/desktop/package.json +1 -0
- package/corpus/templates/clips/desktop/scripts/sign-macos-local.ts +12 -1
- package/corpus/templates/clips/desktop/src/app.tsx +2478 -223
- package/corpus/templates/clips/desktop/src/components/ReadinessPanel.tsx +21 -1
- package/corpus/templates/clips/desktop/src/components/Switch.tsx +3 -0
- package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +156 -24
- package/corpus/templates/clips/desktop/src/lib/native-recording-warm.ts +6 -7
- package/corpus/templates/clips/desktop/src/lib/open-meeting-join-url.ts +22 -0
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +1763 -1160
- package/corpus/templates/clips/desktop/src/lib/rewind-agent-prompt.ts +9 -0
- package/corpus/templates/clips/desktop/src/lib/rewind-recording-start.ts +20 -0
- package/corpus/templates/clips/desktop/src/main.tsx +3 -0
- package/corpus/templates/clips/desktop/src/overlays/countdown.tsx +14 -14
- package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +2 -3
- package/corpus/templates/clips/desktop/src/overlays/onboarding.tsx +4 -4
- package/corpus/templates/clips/desktop/src/overlays/preparing.tsx +13 -0
- package/corpus/templates/clips/desktop/src/overlays/toolbar.tsx +27 -2
- package/corpus/templates/clips/desktop/src/shared/config.ts +16 -0
- package/corpus/templates/clips/desktop/src/styles.css +956 -134
- package/corpus/templates/clips/desktop/src-tauri/Cargo.toml +5 -0
- package/corpus/templates/clips/desktop/src-tauri/build.rs +69 -1
- package/corpus/templates/clips/desktop/src-tauri/src/accessibility.rs +386 -12
- package/corpus/templates/clips/desktop/src-tauri/src/capture_audio_bus.rs +382 -0
- package/corpus/templates/clips/desktop/src-tauri/src/capture_graph.rs +777 -0
- package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +249 -22
- package/corpus/templates/clips/desktop/src-tauri/src/config.rs +148 -1
- package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +58 -4
- package/corpus/templates/clips/desktop/src-tauri/src/logfile.rs +13 -1
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen/custom_capture.rs +1505 -51
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen/live_upload.rs +124 -0
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +1006 -95
- package/corpus/templates/clips/desktop/src-tauri/src/rewind_capture_suspension.rs +165 -0
- package/corpus/templates/clips/desktop/src-tauri/src/rewind_chapters.rs +2434 -0
- package/corpus/templates/clips/desktop/src-tauri/src/rewind_clip.rs +1650 -0
- package/corpus/templates/clips/desktop/src-tauri/src/rewind_egress.rs +643 -0
- package/corpus/templates/clips/desktop/src-tauri/src/rewind_local_ask.rs +803 -0
- package/corpus/templates/clips/desktop/src-tauri/src/rewind_meeting_history.rs +595 -0
- package/corpus/templates/clips/desktop/src-tauri/src/screen_memory.rs +2900 -91
- package/corpus/templates/clips/desktop/src-tauri/src/screen_memory_ocr.rs +360 -0
- package/corpus/templates/clips/desktop/src-tauri/src/screen_memory_transcript.rs +408 -0
- package/corpus/templates/clips/desktop/src-tauri/src/shortcuts.rs +114 -33
- package/corpus/templates/clips/desktop/src-tauri/src/state.rs +2 -2
- package/corpus/templates/clips/desktop/src-tauri/src/system_audio.rs +13 -3
- package/corpus/templates/clips/desktop/src-tauri/src/tray.rs +4 -1
- package/corpus/templates/clips/desktop/src-tauri/src/util.rs +7 -13
- package/corpus/templates/clips/desktop/src-tauri/src/whisper_speech.rs +198 -11
- package/corpus/templates/clips/desktop/src-tauri/tauri.alpha.conf.json +17 -0
- package/corpus/templates/clips/shared/meeting-join-url.ts +0 -5
- package/corpus/templates/content/.agents/skills/document-editing/SKILL.md +9 -1
- package/corpus/templates/content/AGENTS.md +4 -1
- package/corpus/templates/content/actions/_content-spaces.ts +6 -1
- package/corpus/templates/content/actions/_database-row-batch.ts +15 -2
- package/corpus/templates/content/actions/_database-utils.ts +83 -15
- package/corpus/templates/content/actions/add-database-item.ts +3 -0
- package/corpus/templates/content/actions/connect-local-folder-source.ts +2 -1
- package/corpus/templates/content/actions/delete-content-database.ts +12 -9
- package/corpus/templates/content/actions/delete-database-items.ts +3 -2
- package/corpus/templates/content/actions/delete-document.ts +233 -6
- package/corpus/templates/content/actions/duplicate-database-item.ts +1 -0
- package/corpus/templates/content/actions/get-document.ts +4 -1
- package/corpus/templates/content/actions/list-content-databases.ts +1 -0
- package/corpus/templates/content/actions/list-documents.ts +1 -0
- package/corpus/templates/content/actions/list-trashed-content-databases.ts +8 -2
- package/corpus/templates/content/actions/list-trashed-documents.ts +50 -0
- package/corpus/templates/content/actions/permanently-delete-document.ts +28 -0
- package/corpus/templates/content/actions/pull-document.ts +15 -2
- package/corpus/templates/content/actions/restore-content-database.ts +48 -11
- package/corpus/templates/content/actions/restore-document.ts +28 -0
- package/corpus/templates/content/actions/search-documents.ts +2 -1
- package/corpus/templates/content/actions/view-screen.ts +2 -1
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +149 -55
- package/corpus/templates/content/app/components/editor/database/GalleryView.tsx +7 -2
- package/corpus/templates/content/app/components/editor/database/ListView.tsx +7 -2
- package/corpus/templates/content/app/components/editor/database/TimelineView.tsx +3 -0
- package/corpus/templates/content/app/components/editor/database/sidebar.tsx +26 -5
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +243 -163
- package/corpus/templates/content/app/components/sidebar/WorkspaceSourceMenu.tsx +154 -0
- package/corpus/templates/content/app/components/sidebar/select-content-space.ts +11 -0
- package/corpus/templates/content/app/hooks/use-content-database.ts +6 -0
- package/corpus/templates/content/app/hooks/use-documents.ts +57 -0
- package/corpus/templates/content/app/i18n-data.ts +83 -2
- package/corpus/templates/content/app/routes/_app.local-files.tsx +8 -1
- package/corpus/templates/content/changelog/2026-07-19-pages-now-move-to-a-reversible-trash-and-the-organization-pi.md +6 -0
- package/corpus/templates/content/changelog/2026-07-20-trash-actions-now-preserve-independent-archived-pages-enforc.md +6 -0
- package/corpus/templates/content/changelog/2026-07-20-workspace-toggles-now-stay-independently-open-or-closed-and-.md +6 -0
- package/corpus/templates/content/changelog/2026-07-20-workspaces-can-be-added-from-a-blank-workspace-or-a-connecte.md +6 -0
- package/corpus/templates/content/parity/matrix.md +1 -1
- package/corpus/templates/content/parity/matrix.ts +3 -0
- package/corpus/templates/content/server/db/schema.ts +2 -0
- package/corpus/templates/content/server/lib/public-documents.ts +8 -2
- package/corpus/templates/content/server/plugins/db.ts +52 -0
- package/corpus/templates/content/server/routes/api/document-agent-context.json.get.ts +2 -2
- package/corpus/templates/content/shared/api.ts +10 -0
- package/corpus/toolkit/CHANGELOG.md +6 -0
- package/corpus/toolkit/package.json +1 -1
- package/corpus/toolkit/src/ui/progress.tsx +3 -2
- package/dist/cli/mcp-config-writers.d.ts +2 -2
- package/dist/cli/mcp-config-writers.d.ts.map +1 -1
- package/dist/cli/mcp-config-writers.js +6 -6
- package/dist/cli/mcp-config-writers.js.map +1 -1
- package/dist/cli/mcp.d.ts +14 -0
- package/dist/cli/mcp.d.ts.map +1 -1
- package/dist/cli/mcp.js +79 -0
- package/dist/cli/mcp.js.map +1 -1
- package/dist/cli/skills-content/help.d.ts +1 -1
- package/dist/cli/skills-content/help.d.ts.map +1 -1
- package/dist/cli/skills-content/help.js +4 -3
- package/dist/cli/skills-content/help.js.map +1 -1
- package/dist/cli/skills-content/index.d.ts +1 -0
- package/dist/cli/skills-content/index.d.ts.map +1 -1
- package/dist/cli/skills-content/index.js +1 -0
- package/dist/cli/skills-content/index.js.map +1 -1
- package/dist/cli/skills-content/rewind-skill.d.ts +2 -0
- package/dist/cli/skills-content/rewind-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/rewind-skill.js +53 -0
- package/dist/cli/skills-content/rewind-skill.js.map +1 -0
- package/dist/cli/skills.d.ts +6 -0
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +90 -14
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/resources/ResourceTree.d.ts +3 -1
- package/dist/client/resources/ResourceTree.d.ts.map +1 -1
- package/dist/client/resources/ResourceTree.js +4 -4
- package/dist/client/resources/ResourceTree.js.map +1 -1
- package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
- package/dist/client/resources/ResourcesPanel.js +55 -6
- package/dist/client/resources/ResourcesPanel.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/mcp/screen-memory-stdio.d.ts +365 -0
- package/dist/mcp/screen-memory-stdio.d.ts.map +1 -1
- package/dist/mcp/screen-memory-stdio.js +1014 -91
- package/dist/mcp/screen-memory-stdio.js.map +1 -1
- package/dist/mcp-client/index.d.ts +1 -1
- package/dist/mcp-client/index.d.ts.map +1 -1
- package/dist/mcp-client/index.js +1 -1
- package/dist/mcp-client/index.js.map +1 -1
- package/dist/mcp-client/screen-memory-local.d.ts +90 -0
- package/dist/mcp-client/screen-memory-local.d.ts.map +1 -1
- package/dist/mcp-client/screen-memory-local.js +590 -12
- package/dist/mcp-client/screen-memory-local.js.map +1 -1
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/observability/routes.d.ts +5 -5
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/provider-api.d.ts +4 -4
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/package.json +2 -2
- package/src/cli/mcp-config-writers.ts +6 -4
- package/src/cli/mcp.ts +124 -0
- package/src/cli/skills-content/help.ts +4 -3
- package/src/cli/skills-content/index.ts +1 -0
- package/src/cli/skills-content/rewind-skill.ts +52 -0
- package/src/cli/skills.ts +115 -13
- package/src/client/resources/ResourceTree.tsx +11 -5
- package/src/client/resources/ResourcesPanel.tsx +141 -18
- package/src/mcp/screen-memory-stdio.ts +1360 -104
- package/src/mcp-client/index.ts +9 -0
- package/src/mcp-client/screen-memory-local.ts +847 -13
package/dist/cli/mcp.d.ts
CHANGED
|
@@ -12,5 +12,19 @@
|
|
|
12
12
|
* Node-only CLI module. Hand-rolled `.env` upsert + minimal TOML block merge
|
|
13
13
|
* keep this dependency-free (no new npm deps).
|
|
14
14
|
*/
|
|
15
|
+
import { type ClientId } from "./mcp-config-writers.js";
|
|
16
|
+
export interface ScreenMemoryStoreResolutionOptions {
|
|
17
|
+
explicitDir?: string;
|
|
18
|
+
env?: NodeJS.ProcessEnv;
|
|
19
|
+
platform?: NodeJS.Platform;
|
|
20
|
+
homeDir?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Resolve the active Clips store without asking people to find an app-data
|
|
24
|
+
* path. Environment overrides remain the unambiguous escape hatch; otherwise
|
|
25
|
+
* the most recently touched installed Clips/Clips Alpha store wins.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveScreenMemoryStoreDir(options?: ScreenMemoryStoreResolutionOptions): string | undefined;
|
|
28
|
+
export declare function installScreenMemoryForClient(client: ClientId, storeDir: string, cwd: string, scope: string | undefined): string;
|
|
15
29
|
export declare function runMcp(args: string[]): Promise<void>;
|
|
16
30
|
//# sourceMappingURL=mcp.d.ts.map
|
package/dist/cli/mcp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/cli/mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/cli/mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAeH,OAAO,EAEL,KAAK,QAAQ,EAYd,MAAM,yBAAyB,CAAC;AA6CjC,MAAM,WAAW,kCAAkC;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,GAAE,kCAAuC,GAC/C,MAAM,GAAG,SAAS,CAoCpB;AAsQD,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,QAAQ,EAChB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,MAAM,CAyBR;AA2PD,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAqC1D"}
|
package/dist/cli/mcp.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import crypto from "node:crypto";
|
|
16
16
|
import fs from "node:fs";
|
|
17
|
+
import os from "node:os";
|
|
17
18
|
import path from "node:path";
|
|
18
19
|
import { MCP_PUBLIC_ROUTE_PREFIX } from "../mcp/route-paths.js";
|
|
19
20
|
import { runScreenMemoryMCPStdio } from "../mcp/screen-memory-stdio.js";
|
|
@@ -21,6 +22,7 @@ import { runMCPStdio } from "../mcp/stdio.js";
|
|
|
21
22
|
import { findWorkspaceRoot, resolveLocalAppOrigin, resolveWorkspace, } from "../mcp/workspace-resolve.js";
|
|
22
23
|
import { CLIENTS, buildCodexHttpBlock, buildCodexLocalBlock, buildHttpMcpEntryForClient, buildLocalMcpEntryForClient, codexConfigPath, codexHasBlock, configPathFor as clientConfigPathFor, hasJsonMcpEntryForClient, writeCodexBlock, writeFileAtomic, writeJsonMcpEntryForClient, } from "./mcp-config-writers.js";
|
|
23
24
|
const SERVER_NAME_PREFIX = "agent-native";
|
|
25
|
+
const SCREEN_MEMORY_SERVER_NAME = "clips-screen-memory";
|
|
24
26
|
function parseArgs(argv) {
|
|
25
27
|
const out = { _: [], standalone: false, rotate: false };
|
|
26
28
|
for (let i = 0; i < argv.length; i++) {
|
|
@@ -58,6 +60,39 @@ function logErr(msg) {
|
|
|
58
60
|
function logOut(msg) {
|
|
59
61
|
process.stdout.write(`${msg}\n`);
|
|
60
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Resolve the active Clips store without asking people to find an app-data
|
|
65
|
+
* path. Environment overrides remain the unambiguous escape hatch; otherwise
|
|
66
|
+
* the most recently touched installed Clips/Clips Alpha store wins.
|
|
67
|
+
*/
|
|
68
|
+
export function resolveScreenMemoryStoreDir(options = {}) {
|
|
69
|
+
if (options.explicitDir)
|
|
70
|
+
return path.resolve(options.explicitDir);
|
|
71
|
+
const env = options.env ?? process.env;
|
|
72
|
+
const override = env.CLIPS_SCREEN_MEMORY_DIR || env.AGENT_NATIVE_SCREEN_MEMORY_DIR;
|
|
73
|
+
if (override)
|
|
74
|
+
return path.resolve(override);
|
|
75
|
+
const platform = options.platform ?? process.platform;
|
|
76
|
+
const home = options.homeDir ?? os.homedir();
|
|
77
|
+
const appDataRoot = platform === "darwin"
|
|
78
|
+
? path.join(home, "Library", "Application Support")
|
|
79
|
+
: platform === "win32"
|
|
80
|
+
? env.APPDATA || path.join(home, "AppData", "Roaming")
|
|
81
|
+
: env.XDG_DATA_HOME || path.join(home, ".local", "share");
|
|
82
|
+
return ["com.clips.tray", "com.clips.tray.alpha"]
|
|
83
|
+
.map((bundleId) => path.join(appDataRoot, bundleId, "screen-memory"))
|
|
84
|
+
.filter((candidate) => fs.existsSync(candidate))
|
|
85
|
+
.map((candidate) => ({
|
|
86
|
+
candidate,
|
|
87
|
+
modifiedAt: Math.max(fs.statSync(candidate).mtimeMs, ...["feature-config.json", "chapters.json"]
|
|
88
|
+
.map((name) => name === "feature-config.json"
|
|
89
|
+
? path.join(path.dirname(candidate), name)
|
|
90
|
+
: path.join(candidate, name))
|
|
91
|
+
.filter((file) => fs.existsSync(file))
|
|
92
|
+
.map((file) => fs.statSync(file).mtimeMs)),
|
|
93
|
+
}))
|
|
94
|
+
.sort((a, b) => b.modifiedAt - a.modifiedAt || a.candidate.localeCompare(b.candidate))[0]?.candidate;
|
|
95
|
+
}
|
|
61
96
|
// ---------------------------------------------------------------------------
|
|
62
97
|
// .env token provisioning (local dev) — hand-rolled idempotent upsert
|
|
63
98
|
// ---------------------------------------------------------------------------
|
|
@@ -257,6 +292,24 @@ function installForClient(client, inputs, cwd, scope) {
|
|
|
257
292
|
}
|
|
258
293
|
return file;
|
|
259
294
|
}
|
|
295
|
+
export function installScreenMemoryForClient(client, storeDir, cwd, scope) {
|
|
296
|
+
const file = configPathFor(client, cwd, scope);
|
|
297
|
+
const args = [
|
|
298
|
+
"-y",
|
|
299
|
+
"@agent-native/core@latest",
|
|
300
|
+
"mcp",
|
|
301
|
+
"screen-memory",
|
|
302
|
+
"--dir",
|
|
303
|
+
path.resolve(storeDir),
|
|
304
|
+
];
|
|
305
|
+
if (client === "codex") {
|
|
306
|
+
writeCodexBlock(file, SCREEN_MEMORY_SERVER_NAME, buildCodexLocalBlock(SCREEN_MEMORY_SERVER_NAME, args, {}, "npx"));
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
writeJsonMcpEntryForClient(client, file, SCREEN_MEMORY_SERVER_NAME, buildLocalMcpEntryForClient(client, args, {}, "npx"));
|
|
310
|
+
}
|
|
311
|
+
return file;
|
|
312
|
+
}
|
|
260
313
|
function uninstallForClient(client, appId, cwd, scope) {
|
|
261
314
|
const name = serverNameFor(appId);
|
|
262
315
|
const file = configPathFor(client, cwd, scope);
|
|
@@ -340,6 +393,24 @@ async function cmdInstall(p) {
|
|
|
340
393
|
: ` Mode: stdio (npx @agent-native/core@latest mcp serve --app ${appId}${p.standalone ? " --standalone" : ""})`);
|
|
341
394
|
logOut(` Restart ${client} to pick up the new MCP server.`);
|
|
342
395
|
}
|
|
396
|
+
function cmdInstallScreenMemory(p) {
|
|
397
|
+
const client = normalizeClientId(p.client);
|
|
398
|
+
if (!client) {
|
|
399
|
+
logErr(`Usage: npx @agent-native/core@latest mcp install-screen-memory --client ${SELECTABLE_CLIENTS.join("|")} [--dir <path>] [--scope user|project]`);
|
|
400
|
+
process.exit(1);
|
|
401
|
+
}
|
|
402
|
+
const screenMemoryDir = resolveScreenMemoryStoreDir({
|
|
403
|
+
explicitDir: p.screenMemoryDir,
|
|
404
|
+
});
|
|
405
|
+
if (!screenMemoryDir) {
|
|
406
|
+
logErr("No local Clips Screen Memory store was found. Turn Rewind on in Clips, or pass --dir <path>.");
|
|
407
|
+
process.exit(1);
|
|
408
|
+
}
|
|
409
|
+
const file = installScreenMemoryForClient(client, screenMemoryDir, process.cwd(), p.scope);
|
|
410
|
+
logOut(`Installed \"${SCREEN_MEMORY_SERVER_NAME}\" for ${client} → ${file}`);
|
|
411
|
+
logOut(" Store: current local Clips Rewind memory");
|
|
412
|
+
logOut(` Restart ${client} to pick up the repaired Screen Memory MCP server.`);
|
|
413
|
+
}
|
|
343
414
|
function cmdUninstall(p) {
|
|
344
415
|
const client = normalizeClientId(p.client);
|
|
345
416
|
if (!client) {
|
|
@@ -414,6 +485,11 @@ Usage:
|
|
|
414
485
|
Run the local Clips Screen Memory stdio server.
|
|
415
486
|
Defaults to the Clips app-data screen-memory folder.
|
|
416
487
|
|
|
488
|
+
npx @agent-native/core@latest mcp install-screen-memory --client <c> [--dir <path>] [--scope user|project]
|
|
489
|
+
Install or repair the dedicated local Screen Memory MCP. The active Clips
|
|
490
|
+
or Clips Alpha store is discovered automatically; --dir is an override.
|
|
491
|
+
Clients: claude-code, codex, cowork, cursor, opencode, github-copilot
|
|
492
|
+
|
|
417
493
|
npx @agent-native/core@latest mcp install --client <c> [--app <id>] [--scope user|project]
|
|
418
494
|
Provision a token and write the client's MCP config (idempotent).
|
|
419
495
|
Clients: claude-code, codex, cowork, cursor, opencode, github-copilot
|
|
@@ -439,6 +515,9 @@ export async function runMcp(args) {
|
|
|
439
515
|
case "install":
|
|
440
516
|
await cmdInstall(p);
|
|
441
517
|
return;
|
|
518
|
+
case "install-screen-memory":
|
|
519
|
+
cmdInstallScreenMemory(p);
|
|
520
|
+
return;
|
|
442
521
|
case "uninstall":
|
|
443
522
|
cmdUninstall(p);
|
|
444
523
|
return;
|
package/dist/cli/mc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M,UAAU,CAAC,CAAC,CAAC,CAAC;YACpB,OAAO;QACT,KAAK,WAAW;YACd,YAAY,CAAC,CAAC,CAAC,CAAC;YAChB,OAAO;QACT,KAAK,QAAQ;YACX,MAAM,SAAS,EAAE,CAAC;YAClB,OAAO;QACT,KAAK,OAAO;YACV,QAAQ,CAAC,CAAC,CAAC,CAAC;YACZ,OAAO;QACT,KAAK,SAAS,CAAC;QACf,KAAK,QAAQ,CAAC;QACd,KAAK,IAAI,CAAC;QACV,KAAK,MAAM;YACT,MAAM,CAAC,IAAI,CAAC,CAAC;YACb,OAAO;QACT;YACE,MAAM,CAAC,2BAA2B,GAAG,EAAE,CAAC,CAAC;YACzC,MAAM,CAAC,IAAI,CAAC,CAAC;YACb,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACH,CAAC","sourcesContent":["/**\n * `agent-native mcp <subcommand>` — connect external coding agents (Claude\n * Code desktop & CLI, Claude Cowork, Codex, Cursor, OpenCode, GitHub Copilot /\n * VS Code) to this agent-native app/workspace over MCP.\n *\n * serve Run the MCP stdio transport (this is what client configs spawn).\n * install Provision a token + write the client's MCP config idempotently.\n * uninstall Remove the named entry from a client's MCP config.\n * status Print resolved MCP URL/port, token state, and per-client entries.\n * token Print or rotate the local ACCESS_TOKEN in the workspace .env.\n *\n * Node-only CLI module. Hand-rolled `.env` upsert + minimal TOML block merge\n * keep this dependency-free (no new npm deps).\n */\n\nimport crypto from \"node:crypto\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { MCP_PUBLIC_ROUTE_PREFIX } from \"../mcp/route-paths.js\";\nimport { runScreenMemoryMCPStdio } from \"../mcp/screen-memory-stdio.js\";\nimport { runMCPStdio } from \"../mcp/stdio.js\";\nimport {\n findWorkspaceRoot,\n resolveLocalAppOrigin,\n resolveWorkspace,\n} from \"../mcp/workspace-resolve.js\";\nimport {\n CLIENTS,\n type ClientId,\n buildCodexHttpBlock,\n buildCodexLocalBlock,\n buildHttpMcpEntryForClient,\n buildLocalMcpEntryForClient,\n codexConfigPath,\n codexHasBlock,\n configPathFor as clientConfigPathFor,\n hasJsonMcpEntryForClient,\n writeCodexBlock,\n writeFileAtomic,\n writeJsonMcpEntryForClient,\n} from \"./mcp-config-writers.js\";\n\nconst SERVER_NAME_PREFIX = \"agent-native\";\n\ninterface ParsedArgs {\n _: string[];\n client?: string;\n app?: string;\n port?: number;\n screenMemoryDir?: string;\n scope?: string;\n standalone: boolean;\n rotate: boolean;\n}\n\nfunction parseArgs(argv: string[]): ParsedArgs {\n const out: ParsedArgs = { _: [], standalone: false, rotate: false };\n for (let i = 0; i < argv.length; i++) {\n const a = argv[i];\n const eat = (flag: string): string | undefined => {\n if (a === flag) return argv[++i];\n if (a.startsWith(`${flag}=`)) return a.slice(flag.length + 1);\n return undefined;\n };\n let v: string | undefined;\n if ((v = eat(\"--client\")) !== undefined) out.client = v;\n else if ((v = eat(\"--app\")) !== undefined) out.app = v;\n else if ((v = eat(\"--port\")) !== undefined) out.port = Number(v);\n else if ((v = eat(\"--dir\")) !== undefined) out.screenMemoryDir = v;\n else if ((v = eat(\"--scope\")) !== undefined) out.scope = v;\n else if (a === \"--standalone\") out.standalone = true;\n else if (a === \"--rotate\") out.rotate = true;\n else if (!a.startsWith(\"-\")) out._.push(a);\n }\n return out;\n}\n\nfunction logErr(msg: string): void {\n process.stderr.write(`${msg}\\n`);\n}\nfunction logOut(msg: string): void {\n process.stdout.write(`${msg}\\n`);\n}\n\n// ---------------------------------------------------------------------------\n// .env token provisioning (local dev) — hand-rolled idempotent upsert\n// ---------------------------------------------------------------------------\n\n/** Workspace root (or cwd for a standalone app) — where .env lives. */\nfunction envBaseDir(cwd = process.cwd()): string {\n return findWorkspaceRoot(cwd) ?? path.resolve(cwd);\n}\n\n/** Prefer .env.local, else .env. Returns the path we should write to. */\nfunction envFilePath(baseDir: string): string {\n const local = path.join(baseDir, \".env.local\");\n if (fs.existsSync(local)) return local;\n return path.join(baseDir, \".env\");\n}\n\nfunction readEnvFile(file: string): string {\n try {\n return fs.readFileSync(file, \"utf-8\");\n } catch {\n return \"\";\n }\n}\n\n/** Read a single key from a dotenv-format string (last assignment wins). */\nfunction getEnvValue(content: string, key: string): string | undefined {\n let found: string | undefined;\n for (const line of content.split(/\\r?\\n/)) {\n const m = line.match(/^\\s*([A-Z0-9_]+)\\s*=\\s*(.*)\\s*$/i);\n if (m && m[1] === key) {\n found = m[2].replace(/^[\"']|[\"']$/g, \"\");\n }\n }\n return found;\n}\n\n/**\n * Idempotently set `key=value` in the dotenv file. If the key already exists\n * we leave it untouched unless `force` is set (used by `token --rotate`).\n * Never clobbers an existing token implicitly.\n */\nfunction upsertEnv(\n file: string,\n key: string,\n value: string,\n force = false,\n): { changed: boolean; value: string } {\n const content = readEnvFile(file);\n const existing = getEnvValue(content, key);\n if (existing && !force) return { changed: false, value: existing };\n\n const line = `${key}=${value}`;\n let next: string;\n if (new RegExp(`^\\\\s*${key}\\\\s*=`, \"m\").test(content)) {\n next = content.replace(new RegExp(`^\\\\s*${key}\\\\s*=.*$`, \"m\"), line);\n } else {\n next =\n content.length === 0\n ? `${line}\\n`\n : `${content.replace(/\\n*$/, \"\")}\\n${line}\\n`;\n }\n writeFileAtomic(file, next);\n return { changed: true, value };\n}\n\nfunction generateToken(): string {\n return crypto.randomBytes(24).toString(\"base64url\");\n}\n\n/**\n * Ensure a local ACCESS_TOKEN exists in the workspace .env and return it.\n * Existing tokens are reused (never clobbered). Set `rotate` to replace it.\n */\nfunction ensureLocalToken(\n cwd: string,\n rotate = false,\n): { token: string; file: string; created: boolean } {\n const baseDir = envBaseDir(cwd);\n const file = envFilePath(baseDir);\n const content = readEnvFile(file);\n const existing = getEnvValue(content, \"ACCESS_TOKEN\");\n if (existing && !rotate) {\n return { token: existing, file, created: false };\n }\n const token = generateToken();\n upsertEnv(file, \"ACCESS_TOKEN\", token, true);\n return { token, file, created: true };\n}\n\n// ---------------------------------------------------------------------------\n// Hosted vs local detection\n// ---------------------------------------------------------------------------\n\n/**\n * Detect a hosted deployment URL. When the workspace .env points at a hosted\n * origin (APP_URL / BETTER_AUTH_URL with a non-localhost host) we write an\n * `http` client entry pointing at `<origin>/mcp` with a JWT\n * bearer instead of a stdio entry.\n */\nfunction detectHostedUrl(cwd: string): string | undefined {\n const baseDir = envBaseDir(cwd);\n const content =\n readEnvFile(path.join(baseDir, \".env.local\")) +\n \"\\n\" +\n readEnvFile(path.join(baseDir, \".env\"));\n for (const key of [\"AGENT_NATIVE_MCP_URL\", \"APP_URL\", \"BETTER_AUTH_URL\"]) {\n const v = getEnvValue(content, key);\n if (!v) continue;\n try {\n const u = new URL(v);\n if (!/^(localhost|127\\.0\\.0\\.1|\\[::1\\])$/.test(u.hostname)) {\n const appPath = u.pathname.replace(/\\/+$/, \"\");\n return `${u.origin}${appPath === \"/\" ? \"\" : appPath}${MCP_PUBLIC_ROUTE_PREFIX}`;\n }\n } catch {\n // not a URL — skip\n }\n }\n return undefined;\n}\n\nasync function mintHostedJwt(cwd: string): Promise<string | undefined> {\n // Reuse the existing A2A signer — do not reinvent JWT minting.\n const owner =\n process.env.AGENT_NATIVE_OWNER_EMAIL ||\n process.env.OWNER_EMAIL ||\n \"owner@localhost\";\n let fileA2ASecret: string | undefined;\n if (!process.env.A2A_SECRET) {\n const baseDir = envBaseDir(cwd);\n const content =\n readEnvFile(path.join(baseDir, \".env.local\")) +\n \"\\n\" +\n readEnvFile(path.join(baseDir, \".env\"));\n fileA2ASecret = getEnvValue(content, \"A2A_SECRET\");\n }\n try {\n const { signA2AToken } = await import(\"../a2a/client.js\");\n return await signA2AToken(\n owner,\n undefined,\n process.env.A2A_SECRET || fileA2ASecret,\n {\n preferGlobalSecret: true,\n expiresIn: \"30d\",\n },\n );\n } catch (err: any) {\n logErr(\n ` Could not mint a hosted JWT (${err?.message ?? err}). ` +\n `Set A2A_SECRET in your workspace .env, or use the local stdio entry.`,\n );\n return undefined;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Client config entries\n// ---------------------------------------------------------------------------\n\ninterface ServerEntryInputs {\n serverName: string;\n appId: string;\n token?: string;\n ownerEmail?: string;\n hostedUrl?: string;\n standalone: boolean;\n}\n\nfunction mcpServeArgs(i: ServerEntryInputs): string[] {\n const args = [\"mcp\", \"serve\"];\n if (i.appId) args.push(\"--app\", i.appId);\n if (i.standalone) args.push(\"--standalone\");\n return args;\n}\n\nfunction mcpServeEnv(i: ServerEntryInputs): Record<string, string> {\n const env: Record<string, string> = {};\n if (i.token) env.ACCESS_TOKEN = i.token;\n if (i.ownerEmail) env.AGENT_NATIVE_OWNER_EMAIL = i.ownerEmail;\n return env;\n}\n\nfunction buildJsonServerEntry(\n client: ClientId,\n i: ServerEntryInputs,\n): Record<string, unknown> {\n if (i.hostedUrl) {\n return buildHttpMcpEntryForClient(client, i.hostedUrl, i.token);\n }\n return buildLocalMcpEntryForClient(client, mcpServeArgs(i), mcpServeEnv(i));\n}\n\nfunction buildCodexBlock(name: string, i: ServerEntryInputs): string {\n if (i.hostedUrl) {\n return buildCodexHttpBlock(name, i.hostedUrl, i.token);\n }\n return buildCodexLocalBlock(name, mcpServeArgs(i), mcpServeEnv(i));\n}\n\n// ---------------------------------------------------------------------------\n// Per-client install/uninstall/status\n// ---------------------------------------------------------------------------\n\nfunction configPathFor(\n client: ClientId,\n cwd: string,\n scope: string | undefined,\n): string {\n return clientConfigPathFor(client, envBaseDir(cwd), scope);\n}\n\nfunction serverNameFor(appId: string): string {\n return `${SERVER_NAME_PREFIX}-${appId}`;\n}\n\n// Clients advertised in usage/help and listed by status. Excludes the legacy\n// `claude-code-cli` alias so only a single \"Claude Code\" appears (it is still\n// accepted via --client and collapses to claude-code).\nconst SELECTABLE_CLIENTS: ClientId[] = CLIENTS.filter(\n (c) => c !== \"claude-code-cli\",\n);\n\nfunction normalizeClientId(raw: string | undefined): ClientId | null {\n const value = (raw ?? \"\").toLowerCase();\n if (\n value === \"claude\" ||\n value === \"claude-code-desktop\" ||\n value === \"claude-code-cli\"\n ) {\n return \"claude-code\";\n }\n if (value === \"open-code\") return \"opencode\";\n if (value === \"copilot\" || value === \"vscode\" || value === \"vs-code\") {\n return \"github-copilot\";\n }\n return (CLIENTS as string[]).includes(value) ? (value as ClientId) : null;\n}\n\nfunction installForClient(\n client: ClientId,\n inputs: ServerEntryInputs,\n cwd: string,\n scope: string | undefined,\n): string {\n const name = inputs.serverName;\n const file = configPathFor(client, cwd, scope);\n if (client === \"codex\") {\n writeCodexBlock(file, name, buildCodexBlock(name, inputs));\n } else {\n writeJsonMcpEntryForClient(\n client,\n file,\n name,\n buildJsonServerEntry(client, inputs),\n );\n }\n return file;\n}\n\nfunction uninstallForClient(\n client: ClientId,\n appId: string,\n cwd: string,\n scope: string | undefined,\n): { file: string; removed: boolean } {\n const name = serverNameFor(appId);\n const file = configPathFor(client, cwd, scope);\n if (client === \"codex\") {\n const had = codexHasBlock(file, name);\n if (had) writeCodexBlock(file, name, null);\n return { file, removed: had };\n }\n const had = hasJsonMcpEntryForClient(client, file, name);\n if (had) writeJsonMcpEntryForClient(client, file, name, null);\n return { file, removed: had };\n}\n\nfunction clientHasEntry(client: ClientId, appId: string, cwd: string): boolean {\n const name = serverNameFor(appId);\n if (client === \"codex\") return codexHasBlock(codexConfigPath(), name);\n if (client === \"cowork\") {\n return hasJsonMcpEntryForClient(\n client,\n configPathFor(client, cwd, undefined),\n name,\n );\n }\n return (\n hasJsonMcpEntryForClient(\n client,\n configPathFor(client, cwd, \"project\"),\n name,\n ) ||\n hasJsonMcpEntryForClient(client, configPathFor(client, cwd, \"user\"), name)\n );\n}\n\n// ---------------------------------------------------------------------------\n// Subcommands\n// ---------------------------------------------------------------------------\n\nasync function cmdServe(p: ParsedArgs): Promise<void> {\n await runMCPStdio({\n appId: p.app,\n port: p.port,\n standalone: p.standalone,\n });\n}\n\nasync function cmdInstall(p: ParsedArgs): Promise<void> {\n const client = normalizeClientId(p.client);\n if (!client) {\n logErr(\n `Usage: npx @agent-native/core@latest mcp install --client ${SELECTABLE_CLIENTS.join(\"|\")} ` +\n `[--app <id>] [--scope user|project]`,\n );\n process.exit(1);\n }\n const cwd = process.cwd();\n\n // Resolve which app this entry targets (default = workspace default app).\n let appId = p.app;\n if (!appId) {\n try {\n const resolved = await resolveLocalAppOrigin({ cwd });\n appId = resolved.appId;\n } catch {\n appId = \"app\";\n }\n }\n const serverName = serverNameFor(appId);\n\n const hostedUrl = detectHostedUrl(cwd);\n const ownerEmail = process.env.AGENT_NATIVE_OWNER_EMAIL;\n\n let token: string | undefined;\n if (hostedUrl) {\n token = await mintHostedJwt(cwd);\n logOut(`Detected hosted deployment: ${hostedUrl}`);\n } else {\n const t = ensureLocalToken(cwd, false);\n token = t.token;\n logOut(\n t.created\n ? `Provisioned ACCESS_TOKEN in ${t.file}`\n : `Reusing existing ACCESS_TOKEN from ${t.file}`,\n );\n }\n\n const inputs: ServerEntryInputs = {\n serverName,\n appId: appId!,\n token,\n ownerEmail,\n hostedUrl,\n standalone: p.standalone,\n };\n\n const file = installForClient(client, inputs, cwd, p.scope);\n logOut(`Installed \"${serverName}\" for ${client} → ${file}`);\n logOut(\n hostedUrl\n ? ` Mode: http (${hostedUrl})`\n : ` Mode: stdio (npx @agent-native/core@latest mcp serve --app ${appId}${\n p.standalone ? \" --standalone\" : \"\"\n })`,\n );\n logOut(` Restart ${client} to pick up the new MCP server.`);\n}\n\nfunction cmdUninstall(p: ParsedArgs): void {\n const client = normalizeClientId(p.client);\n if (!client) {\n logErr(\n `Usage: npx @agent-native/core@latest mcp uninstall --client ${SELECTABLE_CLIENTS.join(\"|\")} ` +\n `[--app <id>]`,\n );\n process.exit(1);\n }\n const cwd = process.cwd();\n const appId = p.app ?? \"app\";\n const { file, removed } = uninstallForClient(client, appId, cwd, p.scope);\n logOut(\n removed\n ? `Removed \"${serverNameFor(appId)}\" from ${client} → ${file}`\n : `No \"${serverNameFor(appId)}\" entry found for ${client} (${file}) — nothing to do.`,\n );\n}\n\nasync function cmdStatus(): Promise<void> {\n const cwd = process.cwd();\n let appId = \"app\";\n let origin = \"(app not running)\";\n let port: number | undefined;\n try {\n const resolved = await resolveLocalAppOrigin({ cwd });\n appId = resolved.appId;\n origin = resolved.origin;\n const ws = await resolveWorkspace(cwd);\n port = ws.apps.find((a) => a.id === appId)?.port;\n } catch (err: any) {\n logErr(` Could not resolve app: ${err?.message ?? err}`);\n }\n\n const hostedUrl = detectHostedUrl(cwd);\n const baseDir = envBaseDir(cwd);\n const envContent =\n readEnvFile(path.join(baseDir, \".env.local\")) +\n \"\\n\" +\n readEnvFile(path.join(baseDir, \".env\"));\n const hasToken = !!getEnvValue(envContent, \"ACCESS_TOKEN\");\n const hasA2A =\n !!process.env.A2A_SECRET || !!getEnvValue(envContent, \"A2A_SECRET\");\n\n logOut(`Agent-Native MCP status`);\n logOut(` App: ${appId}`);\n logOut(\n hostedUrl\n ? ` MCP URL: ${hostedUrl} (hosted)`\n : ` MCP URL: ${origin}/mcp${port ? ` (port ${port})` : \"\"}`,\n );\n logOut(` ACCESS_TOKEN: ${hasToken ? \"set\" : \"not set\"} (.env)`);\n logOut(` A2A_SECRET: ${hasA2A ? \"set\" : \"not set\"}`);\n logOut(` Clients:`);\n for (const client of SELECTABLE_CLIENTS) {\n const present = clientHasEntry(client, appId, cwd);\n logOut(` ${client.padEnd(18)} ${present ? \"configured\" : \"—\"}`);\n }\n}\n\nfunction cmdToken(p: ParsedArgs): void {\n const cwd = process.cwd();\n const t = ensureLocalToken(cwd, p.rotate);\n logOut(\n p.rotate\n ? `Rotated ACCESS_TOKEN in ${t.file}`\n : t.created\n ? `Provisioned ACCESS_TOKEN in ${t.file}`\n : `ACCESS_TOKEN (${t.file}):`,\n );\n logOut(t.token);\n if (p.rotate) {\n logOut(\n ` Re-run \\`npx @agent-native/core@latest mcp install --client <c>\\` so client configs ` +\n `pick up the new token.`,\n );\n }\n}\n\nconst HELP = `npx @agent-native/core@latest mcp — connect external coding agents over MCP\n\nUsage:\n npx @agent-native/core@latest mcp serve [--app <id>] [--port <n>] [--standalone]\n Run the MCP stdio transport (what client configs spawn).\n Default: proxy to the running local app; --standalone builds from disk.\n\n npx @agent-native/core@latest mcp screen-memory [--dir <path>]\n Run the local Clips Screen Memory stdio server.\n Defaults to the Clips app-data screen-memory folder.\n\n npx @agent-native/core@latest mcp install --client <c> [--app <id>] [--scope user|project]\n Provision a token and write the client's MCP config (idempotent).\n Clients: claude-code, codex, cowork, cursor, opencode, github-copilot\n\n npx @agent-native/core@latest mcp uninstall --client <c> [--app <id>]\n Remove the named MCP entry from a client's config (idempotent).\n\n npx @agent-native/core@latest mcp status\n Show resolved MCP URL/port, token state, and per-client entries.\n\n npx @agent-native/core@latest mcp token [--rotate]\n Print (or rotate) the local ACCESS_TOKEN in the workspace .env.`;\n\nexport async function runMcp(args: string[]): Promise<void> {\n const p = parseArgs(args);\n const sub = p._[0];\n\n switch (sub) {\n case \"serve\":\n await cmdServe(p);\n return;\n case \"screen-memory\":\n await runScreenMemoryMCPStdio({ storeDir: p.screenMemoryDir });\n return;\n case \"install\":\n await cmdInstall(p);\n return;\n case \"uninstall\":\n cmdUninstall(p);\n return;\n case \"status\":\n await cmdStatus();\n return;\n case \"token\":\n cmdToken(p);\n return;\n case undefined:\n case \"--help\":\n case \"-h\":\n case \"help\":\n logOut(HELP);\n return;\n default:\n logErr(`Unknown mcp subcommand: ${sub}`);\n logOut(HELP);\n process.exit(1);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/cli/mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAA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AAC;YACzC,MAAM,CAAC,IAAI,CAAC,CAAC;YACb,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACH,CAAC","sourcesContent":["/**\n * `agent-native mcp <subcommand>` — connect external coding agents (Claude\n * Code desktop & CLI, Claude Cowork, Codex, Cursor, OpenCode, GitHub Copilot /\n * VS Code) to this agent-native app/workspace over MCP.\n *\n * serve Run the MCP stdio transport (this is what client configs spawn).\n * install Provision a token + write the client's MCP config idempotently.\n * uninstall Remove the named entry from a client's MCP config.\n * status Print resolved MCP URL/port, token state, and per-client entries.\n * token Print or rotate the local ACCESS_TOKEN in the workspace .env.\n *\n * Node-only CLI module. Hand-rolled `.env` upsert + minimal TOML block merge\n * keep this dependency-free (no new npm deps).\n */\n\nimport crypto from \"node:crypto\";\nimport fs from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\nimport { MCP_PUBLIC_ROUTE_PREFIX } from \"../mcp/route-paths.js\";\nimport { runScreenMemoryMCPStdio } from \"../mcp/screen-memory-stdio.js\";\nimport { runMCPStdio } from \"../mcp/stdio.js\";\nimport {\n findWorkspaceRoot,\n resolveLocalAppOrigin,\n resolveWorkspace,\n} from \"../mcp/workspace-resolve.js\";\nimport {\n CLIENTS,\n type ClientId,\n buildCodexHttpBlock,\n buildCodexLocalBlock,\n buildHttpMcpEntryForClient,\n buildLocalMcpEntryForClient,\n codexConfigPath,\n codexHasBlock,\n configPathFor as clientConfigPathFor,\n hasJsonMcpEntryForClient,\n writeCodexBlock,\n writeFileAtomic,\n writeJsonMcpEntryForClient,\n} from \"./mcp-config-writers.js\";\n\nconst SERVER_NAME_PREFIX = \"agent-native\";\nconst SCREEN_MEMORY_SERVER_NAME = \"clips-screen-memory\";\n\ninterface ParsedArgs {\n _: string[];\n client?: string;\n app?: string;\n port?: number;\n screenMemoryDir?: string;\n scope?: string;\n standalone: boolean;\n rotate: boolean;\n}\n\nfunction parseArgs(argv: string[]): ParsedArgs {\n const out: ParsedArgs = { _: [], standalone: false, rotate: false };\n for (let i = 0; i < argv.length; i++) {\n const a = argv[i];\n const eat = (flag: string): string | undefined => {\n if (a === flag) return argv[++i];\n if (a.startsWith(`${flag}=`)) return a.slice(flag.length + 1);\n return undefined;\n };\n let v: string | undefined;\n if ((v = eat(\"--client\")) !== undefined) out.client = v;\n else if ((v = eat(\"--app\")) !== undefined) out.app = v;\n else if ((v = eat(\"--port\")) !== undefined) out.port = Number(v);\n else if ((v = eat(\"--dir\")) !== undefined) out.screenMemoryDir = v;\n else if ((v = eat(\"--scope\")) !== undefined) out.scope = v;\n else if (a === \"--standalone\") out.standalone = true;\n else if (a === \"--rotate\") out.rotate = true;\n else if (!a.startsWith(\"-\")) out._.push(a);\n }\n return out;\n}\n\nfunction logErr(msg: string): void {\n process.stderr.write(`${msg}\\n`);\n}\nfunction logOut(msg: string): void {\n process.stdout.write(`${msg}\\n`);\n}\n\nexport interface ScreenMemoryStoreResolutionOptions {\n explicitDir?: string;\n env?: NodeJS.ProcessEnv;\n platform?: NodeJS.Platform;\n homeDir?: string;\n}\n\n/**\n * Resolve the active Clips store without asking people to find an app-data\n * path. Environment overrides remain the unambiguous escape hatch; otherwise\n * the most recently touched installed Clips/Clips Alpha store wins.\n */\nexport function resolveScreenMemoryStoreDir(\n options: ScreenMemoryStoreResolutionOptions = {},\n): string | undefined {\n if (options.explicitDir) return path.resolve(options.explicitDir);\n const env = options.env ?? process.env;\n const override =\n env.CLIPS_SCREEN_MEMORY_DIR || env.AGENT_NATIVE_SCREEN_MEMORY_DIR;\n if (override) return path.resolve(override);\n\n const platform = options.platform ?? process.platform;\n const home = options.homeDir ?? os.homedir();\n const appDataRoot =\n platform === \"darwin\"\n ? path.join(home, \"Library\", \"Application Support\")\n : platform === \"win32\"\n ? env.APPDATA || path.join(home, \"AppData\", \"Roaming\")\n : env.XDG_DATA_HOME || path.join(home, \".local\", \"share\");\n return [\"com.clips.tray\", \"com.clips.tray.alpha\"]\n .map((bundleId) => path.join(appDataRoot, bundleId, \"screen-memory\"))\n .filter((candidate) => fs.existsSync(candidate))\n .map((candidate) => ({\n candidate,\n modifiedAt: Math.max(\n fs.statSync(candidate).mtimeMs,\n ...[\"feature-config.json\", \"chapters.json\"]\n .map((name) =>\n name === \"feature-config.json\"\n ? path.join(path.dirname(candidate), name)\n : path.join(candidate, name),\n )\n .filter((file) => fs.existsSync(file))\n .map((file) => fs.statSync(file).mtimeMs),\n ),\n }))\n .sort(\n (a, b) =>\n b.modifiedAt - a.modifiedAt || a.candidate.localeCompare(b.candidate),\n )[0]?.candidate;\n}\n\n// ---------------------------------------------------------------------------\n// .env token provisioning (local dev) — hand-rolled idempotent upsert\n// ---------------------------------------------------------------------------\n\n/** Workspace root (or cwd for a standalone app) — where .env lives. */\nfunction envBaseDir(cwd = process.cwd()): string {\n return findWorkspaceRoot(cwd) ?? path.resolve(cwd);\n}\n\n/** Prefer .env.local, else .env. Returns the path we should write to. */\nfunction envFilePath(baseDir: string): string {\n const local = path.join(baseDir, \".env.local\");\n if (fs.existsSync(local)) return local;\n return path.join(baseDir, \".env\");\n}\n\nfunction readEnvFile(file: string): string {\n try {\n return fs.readFileSync(file, \"utf-8\");\n } catch {\n return \"\";\n }\n}\n\n/** Read a single key from a dotenv-format string (last assignment wins). */\nfunction getEnvValue(content: string, key: string): string | undefined {\n let found: string | undefined;\n for (const line of content.split(/\\r?\\n/)) {\n const m = line.match(/^\\s*([A-Z0-9_]+)\\s*=\\s*(.*)\\s*$/i);\n if (m && m[1] === key) {\n found = m[2].replace(/^[\"']|[\"']$/g, \"\");\n }\n }\n return found;\n}\n\n/**\n * Idempotently set `key=value` in the dotenv file. If the key already exists\n * we leave it untouched unless `force` is set (used by `token --rotate`).\n * Never clobbers an existing token implicitly.\n */\nfunction upsertEnv(\n file: string,\n key: string,\n value: string,\n force = false,\n): { changed: boolean; value: string } {\n const content = readEnvFile(file);\n const existing = getEnvValue(content, key);\n if (existing && !force) return { changed: false, value: existing };\n\n const line = `${key}=${value}`;\n let next: string;\n if (new RegExp(`^\\\\s*${key}\\\\s*=`, \"m\").test(content)) {\n next = content.replace(new RegExp(`^\\\\s*${key}\\\\s*=.*$`, \"m\"), line);\n } else {\n next =\n content.length === 0\n ? `${line}\\n`\n : `${content.replace(/\\n*$/, \"\")}\\n${line}\\n`;\n }\n writeFileAtomic(file, next);\n return { changed: true, value };\n}\n\nfunction generateToken(): string {\n return crypto.randomBytes(24).toString(\"base64url\");\n}\n\n/**\n * Ensure a local ACCESS_TOKEN exists in the workspace .env and return it.\n * Existing tokens are reused (never clobbered). Set `rotate` to replace it.\n */\nfunction ensureLocalToken(\n cwd: string,\n rotate = false,\n): { token: string; file: string; created: boolean } {\n const baseDir = envBaseDir(cwd);\n const file = envFilePath(baseDir);\n const content = readEnvFile(file);\n const existing = getEnvValue(content, \"ACCESS_TOKEN\");\n if (existing && !rotate) {\n return { token: existing, file, created: false };\n }\n const token = generateToken();\n upsertEnv(file, \"ACCESS_TOKEN\", token, true);\n return { token, file, created: true };\n}\n\n// ---------------------------------------------------------------------------\n// Hosted vs local detection\n// ---------------------------------------------------------------------------\n\n/**\n * Detect a hosted deployment URL. When the workspace .env points at a hosted\n * origin (APP_URL / BETTER_AUTH_URL with a non-localhost host) we write an\n * `http` client entry pointing at `<origin>/mcp` with a JWT\n * bearer instead of a stdio entry.\n */\nfunction detectHostedUrl(cwd: string): string | undefined {\n const baseDir = envBaseDir(cwd);\n const content =\n readEnvFile(path.join(baseDir, \".env.local\")) +\n \"\\n\" +\n readEnvFile(path.join(baseDir, \".env\"));\n for (const key of [\"AGENT_NATIVE_MCP_URL\", \"APP_URL\", \"BETTER_AUTH_URL\"]) {\n const v = getEnvValue(content, key);\n if (!v) continue;\n try {\n const u = new URL(v);\n if (!/^(localhost|127\\.0\\.0\\.1|\\[::1\\])$/.test(u.hostname)) {\n const appPath = u.pathname.replace(/\\/+$/, \"\");\n return `${u.origin}${appPath === \"/\" ? \"\" : appPath}${MCP_PUBLIC_ROUTE_PREFIX}`;\n }\n } catch {\n // not a URL — skip\n }\n }\n return undefined;\n}\n\nasync function mintHostedJwt(cwd: string): Promise<string | undefined> {\n // Reuse the existing A2A signer — do not reinvent JWT minting.\n const owner =\n process.env.AGENT_NATIVE_OWNER_EMAIL ||\n process.env.OWNER_EMAIL ||\n \"owner@localhost\";\n let fileA2ASecret: string | undefined;\n if (!process.env.A2A_SECRET) {\n const baseDir = envBaseDir(cwd);\n const content =\n readEnvFile(path.join(baseDir, \".env.local\")) +\n \"\\n\" +\n readEnvFile(path.join(baseDir, \".env\"));\n fileA2ASecret = getEnvValue(content, \"A2A_SECRET\");\n }\n try {\n const { signA2AToken } = await import(\"../a2a/client.js\");\n return await signA2AToken(\n owner,\n undefined,\n process.env.A2A_SECRET || fileA2ASecret,\n {\n preferGlobalSecret: true,\n expiresIn: \"30d\",\n },\n );\n } catch (err: any) {\n logErr(\n ` Could not mint a hosted JWT (${err?.message ?? err}). ` +\n `Set A2A_SECRET in your workspace .env, or use the local stdio entry.`,\n );\n return undefined;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Client config entries\n// ---------------------------------------------------------------------------\n\ninterface ServerEntryInputs {\n serverName: string;\n appId: string;\n token?: string;\n ownerEmail?: string;\n hostedUrl?: string;\n standalone: boolean;\n}\n\nfunction mcpServeArgs(i: ServerEntryInputs): string[] {\n const args = [\"mcp\", \"serve\"];\n if (i.appId) args.push(\"--app\", i.appId);\n if (i.standalone) args.push(\"--standalone\");\n return args;\n}\n\nfunction mcpServeEnv(i: ServerEntryInputs): Record<string, string> {\n const env: Record<string, string> = {};\n if (i.token) env.ACCESS_TOKEN = i.token;\n if (i.ownerEmail) env.AGENT_NATIVE_OWNER_EMAIL = i.ownerEmail;\n return env;\n}\n\nfunction buildJsonServerEntry(\n client: ClientId,\n i: ServerEntryInputs,\n): Record<string, unknown> {\n if (i.hostedUrl) {\n return buildHttpMcpEntryForClient(client, i.hostedUrl, i.token);\n }\n return buildLocalMcpEntryForClient(client, mcpServeArgs(i), mcpServeEnv(i));\n}\n\nfunction buildCodexBlock(name: string, i: ServerEntryInputs): string {\n if (i.hostedUrl) {\n return buildCodexHttpBlock(name, i.hostedUrl, i.token);\n }\n return buildCodexLocalBlock(name, mcpServeArgs(i), mcpServeEnv(i));\n}\n\n// ---------------------------------------------------------------------------\n// Per-client install/uninstall/status\n// ---------------------------------------------------------------------------\n\nfunction configPathFor(\n client: ClientId,\n cwd: string,\n scope: string | undefined,\n): string {\n return clientConfigPathFor(client, envBaseDir(cwd), scope);\n}\n\nfunction serverNameFor(appId: string): string {\n return `${SERVER_NAME_PREFIX}-${appId}`;\n}\n\n// Clients advertised in usage/help and listed by status. Excludes the legacy\n// `claude-code-cli` alias so only a single \"Claude Code\" appears (it is still\n// accepted via --client and collapses to claude-code).\nconst SELECTABLE_CLIENTS: ClientId[] = CLIENTS.filter(\n (c) => c !== \"claude-code-cli\",\n);\n\nfunction normalizeClientId(raw: string | undefined): ClientId | null {\n const value = (raw ?? \"\").toLowerCase();\n if (\n value === \"claude\" ||\n value === \"claude-code-desktop\" ||\n value === \"claude-code-cli\"\n ) {\n return \"claude-code\";\n }\n if (value === \"open-code\") return \"opencode\";\n if (value === \"copilot\" || value === \"vscode\" || value === \"vs-code\") {\n return \"github-copilot\";\n }\n return (CLIENTS as string[]).includes(value) ? (value as ClientId) : null;\n}\n\nfunction installForClient(\n client: ClientId,\n inputs: ServerEntryInputs,\n cwd: string,\n scope: string | undefined,\n): string {\n const name = inputs.serverName;\n const file = configPathFor(client, cwd, scope);\n if (client === \"codex\") {\n writeCodexBlock(file, name, buildCodexBlock(name, inputs));\n } else {\n writeJsonMcpEntryForClient(\n client,\n file,\n name,\n buildJsonServerEntry(client, inputs),\n );\n }\n return file;\n}\n\nexport function installScreenMemoryForClient(\n client: ClientId,\n storeDir: string,\n cwd: string,\n scope: string | undefined,\n): string {\n const file = configPathFor(client, cwd, scope);\n const args = [\n \"-y\",\n \"@agent-native/core@latest\",\n \"mcp\",\n \"screen-memory\",\n \"--dir\",\n path.resolve(storeDir),\n ];\n if (client === \"codex\") {\n writeCodexBlock(\n file,\n SCREEN_MEMORY_SERVER_NAME,\n buildCodexLocalBlock(SCREEN_MEMORY_SERVER_NAME, args, {}, \"npx\"),\n );\n } else {\n writeJsonMcpEntryForClient(\n client,\n file,\n SCREEN_MEMORY_SERVER_NAME,\n buildLocalMcpEntryForClient(client, args, {}, \"npx\"),\n );\n }\n return file;\n}\n\nfunction uninstallForClient(\n client: ClientId,\n appId: string,\n cwd: string,\n scope: string | undefined,\n): { file: string; removed: boolean } {\n const name = serverNameFor(appId);\n const file = configPathFor(client, cwd, scope);\n if (client === \"codex\") {\n const had = codexHasBlock(file, name);\n if (had) writeCodexBlock(file, name, null);\n return { file, removed: had };\n }\n const had = hasJsonMcpEntryForClient(client, file, name);\n if (had) writeJsonMcpEntryForClient(client, file, name, null);\n return { file, removed: had };\n}\n\nfunction clientHasEntry(client: ClientId, appId: string, cwd: string): boolean {\n const name = serverNameFor(appId);\n if (client === \"codex\") return codexHasBlock(codexConfigPath(), name);\n if (client === \"cowork\") {\n return hasJsonMcpEntryForClient(\n client,\n configPathFor(client, cwd, undefined),\n name,\n );\n }\n return (\n hasJsonMcpEntryForClient(\n client,\n configPathFor(client, cwd, \"project\"),\n name,\n ) ||\n hasJsonMcpEntryForClient(client, configPathFor(client, cwd, \"user\"), name)\n );\n}\n\n// ---------------------------------------------------------------------------\n// Subcommands\n// ---------------------------------------------------------------------------\n\nasync function cmdServe(p: ParsedArgs): Promise<void> {\n await runMCPStdio({\n appId: p.app,\n port: p.port,\n standalone: p.standalone,\n });\n}\n\nasync function cmdInstall(p: ParsedArgs): Promise<void> {\n const client = normalizeClientId(p.client);\n if (!client) {\n logErr(\n `Usage: npx @agent-native/core@latest mcp install --client ${SELECTABLE_CLIENTS.join(\"|\")} ` +\n `[--app <id>] [--scope user|project]`,\n );\n process.exit(1);\n }\n const cwd = process.cwd();\n\n // Resolve which app this entry targets (default = workspace default app).\n let appId = p.app;\n if (!appId) {\n try {\n const resolved = await resolveLocalAppOrigin({ cwd });\n appId = resolved.appId;\n } catch {\n appId = \"app\";\n }\n }\n const serverName = serverNameFor(appId);\n\n const hostedUrl = detectHostedUrl(cwd);\n const ownerEmail = process.env.AGENT_NATIVE_OWNER_EMAIL;\n\n let token: string | undefined;\n if (hostedUrl) {\n token = await mintHostedJwt(cwd);\n logOut(`Detected hosted deployment: ${hostedUrl}`);\n } else {\n const t = ensureLocalToken(cwd, false);\n token = t.token;\n logOut(\n t.created\n ? `Provisioned ACCESS_TOKEN in ${t.file}`\n : `Reusing existing ACCESS_TOKEN from ${t.file}`,\n );\n }\n\n const inputs: ServerEntryInputs = {\n serverName,\n appId: appId!,\n token,\n ownerEmail,\n hostedUrl,\n standalone: p.standalone,\n };\n\n const file = installForClient(client, inputs, cwd, p.scope);\n logOut(`Installed \"${serverName}\" for ${client} → ${file}`);\n logOut(\n hostedUrl\n ? ` Mode: http (${hostedUrl})`\n : ` Mode: stdio (npx @agent-native/core@latest mcp serve --app ${appId}${\n p.standalone ? \" --standalone\" : \"\"\n })`,\n );\n logOut(` Restart ${client} to pick up the new MCP server.`);\n}\n\nfunction cmdInstallScreenMemory(p: ParsedArgs): void {\n const client = normalizeClientId(p.client);\n if (!client) {\n logErr(\n `Usage: npx @agent-native/core@latest mcp install-screen-memory --client ${SELECTABLE_CLIENTS.join(\"|\")} [--dir <path>] [--scope user|project]`,\n );\n process.exit(1);\n }\n const screenMemoryDir = resolveScreenMemoryStoreDir({\n explicitDir: p.screenMemoryDir,\n });\n if (!screenMemoryDir) {\n logErr(\n \"No local Clips Screen Memory store was found. Turn Rewind on in Clips, or pass --dir <path>.\",\n );\n process.exit(1);\n }\n const file = installScreenMemoryForClient(\n client,\n screenMemoryDir,\n process.cwd(),\n p.scope,\n );\n logOut(`Installed \\\"${SCREEN_MEMORY_SERVER_NAME}\\\" for ${client} → ${file}`);\n logOut(\" Store: current local Clips Rewind memory\");\n logOut(\n ` Restart ${client} to pick up the repaired Screen Memory MCP server.`,\n );\n}\n\nfunction cmdUninstall(p: ParsedArgs): void {\n const client = normalizeClientId(p.client);\n if (!client) {\n logErr(\n `Usage: npx @agent-native/core@latest mcp uninstall --client ${SELECTABLE_CLIENTS.join(\"|\")} ` +\n `[--app <id>]`,\n );\n process.exit(1);\n }\n const cwd = process.cwd();\n const appId = p.app ?? \"app\";\n const { file, removed } = uninstallForClient(client, appId, cwd, p.scope);\n logOut(\n removed\n ? `Removed \"${serverNameFor(appId)}\" from ${client} → ${file}`\n : `No \"${serverNameFor(appId)}\" entry found for ${client} (${file}) — nothing to do.`,\n );\n}\n\nasync function cmdStatus(): Promise<void> {\n const cwd = process.cwd();\n let appId = \"app\";\n let origin = \"(app not running)\";\n let port: number | undefined;\n try {\n const resolved = await resolveLocalAppOrigin({ cwd });\n appId = resolved.appId;\n origin = resolved.origin;\n const ws = await resolveWorkspace(cwd);\n port = ws.apps.find((a) => a.id === appId)?.port;\n } catch (err: any) {\n logErr(` Could not resolve app: ${err?.message ?? err}`);\n }\n\n const hostedUrl = detectHostedUrl(cwd);\n const baseDir = envBaseDir(cwd);\n const envContent =\n readEnvFile(path.join(baseDir, \".env.local\")) +\n \"\\n\" +\n readEnvFile(path.join(baseDir, \".env\"));\n const hasToken = !!getEnvValue(envContent, \"ACCESS_TOKEN\");\n const hasA2A =\n !!process.env.A2A_SECRET || !!getEnvValue(envContent, \"A2A_SECRET\");\n\n logOut(`Agent-Native MCP status`);\n logOut(` App: ${appId}`);\n logOut(\n hostedUrl\n ? ` MCP URL: ${hostedUrl} (hosted)`\n : ` MCP URL: ${origin}/mcp${port ? ` (port ${port})` : \"\"}`,\n );\n logOut(` ACCESS_TOKEN: ${hasToken ? \"set\" : \"not set\"} (.env)`);\n logOut(` A2A_SECRET: ${hasA2A ? \"set\" : \"not set\"}`);\n logOut(` Clients:`);\n for (const client of SELECTABLE_CLIENTS) {\n const present = clientHasEntry(client, appId, cwd);\n logOut(` ${client.padEnd(18)} ${present ? \"configured\" : \"—\"}`);\n }\n}\n\nfunction cmdToken(p: ParsedArgs): void {\n const cwd = process.cwd();\n const t = ensureLocalToken(cwd, p.rotate);\n logOut(\n p.rotate\n ? `Rotated ACCESS_TOKEN in ${t.file}`\n : t.created\n ? `Provisioned ACCESS_TOKEN in ${t.file}`\n : `ACCESS_TOKEN (${t.file}):`,\n );\n logOut(t.token);\n if (p.rotate) {\n logOut(\n ` Re-run \\`npx @agent-native/core@latest mcp install --client <c>\\` so client configs ` +\n `pick up the new token.`,\n );\n }\n}\n\nconst HELP = `npx @agent-native/core@latest mcp — connect external coding agents over MCP\n\nUsage:\n npx @agent-native/core@latest mcp serve [--app <id>] [--port <n>] [--standalone]\n Run the MCP stdio transport (what client configs spawn).\n Default: proxy to the running local app; --standalone builds from disk.\n\n npx @agent-native/core@latest mcp screen-memory [--dir <path>]\n Run the local Clips Screen Memory stdio server.\n Defaults to the Clips app-data screen-memory folder.\n\n npx @agent-native/core@latest mcp install-screen-memory --client <c> [--dir <path>] [--scope user|project]\n Install or repair the dedicated local Screen Memory MCP. The active Clips\n or Clips Alpha store is discovered automatically; --dir is an override.\n Clients: claude-code, codex, cowork, cursor, opencode, github-copilot\n\n npx @agent-native/core@latest mcp install --client <c> [--app <id>] [--scope user|project]\n Provision a token and write the client's MCP config (idempotent).\n Clients: claude-code, codex, cowork, cursor, opencode, github-copilot\n\n npx @agent-native/core@latest mcp uninstall --client <c> [--app <id>]\n Remove the named MCP entry from a client's config (idempotent).\n\n npx @agent-native/core@latest mcp status\n Show resolved MCP URL/port, token state, and per-client entries.\n\n npx @agent-native/core@latest mcp token [--rotate]\n Print (or rotate) the local ACCESS_TOKEN in the workspace .env.`;\n\nexport async function runMcp(args: string[]): Promise<void> {\n const p = parseArgs(args);\n const sub = p._[0];\n\n switch (sub) {\n case \"serve\":\n await cmdServe(p);\n return;\n case \"screen-memory\":\n await runScreenMemoryMCPStdio({ storeDir: p.screenMemoryDir });\n return;\n case \"install\":\n await cmdInstall(p);\n return;\n case \"install-screen-memory\":\n cmdInstallScreenMemory(p);\n return;\n case \"uninstall\":\n cmdUninstall(p);\n return;\n case \"status\":\n await cmdStatus();\n return;\n case \"token\":\n cmdToken(p);\n return;\n case undefined:\n case \"--help\":\n case \"-h\":\n case \"help\":\n logOut(HELP);\n return;\n default:\n logErr(`Unknown mcp subcommand: ${sub}`);\n logOut(HELP);\n process.exit(1);\n }\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const HELP = "npx @agent-native/core@latest skills\n\nUsage:\n npx @agent-native/core@latest skills list\n npx @agent-native/core@latest skills status [assets|content|design-exploration|visual-edit|visual-plan|visual-recap|visualize-repo|context-xray|scaffold] [--client codex|claude-code|pi|all] [--scope user|project] [--json]\n npx @agent-native/core@latest skills update [assets|content|design-exploration|visual-edit|visual-plan|visual-recap|visualize-repo|context-xray|scaffold] [--client codex|claude-code|pi|all] [--scope user|project] [--dry-run] [--json]\n npx @agent-native/core@latest skills add assets|content|design-exploration|visual-edit|visual-plan|visual-recap|visualize-repo|context-xray [--client codex|claude-code|cowork|cursor|opencode|github-copilot|all] [--scope user|project] [--mode hosted|local-files|self-hosted] [--mcp-url <url>] [--no-connect] [--with-github-action] [--yes] [--dry-run] [--json]\n npx @agent-native/core@latest skills add <manifest-or-app-dir|skill-repo> [--skill <name>] [--client ...] [--yes]\n\nExamples:\n npx @agent-native/core@latest skills add assets\n npx @agent-native/core@latest skills add content --mode local-files\n npx @agent-native/core@latest skills add design-exploration\n npx @agent-native/core@latest skills add visual-edit\n npx @agent-native/core@latest skills add visual-plan\n npx @agent-native/core@latest skills add visual-recap\n npx @agent-native/core@latest skills add visualize-repo\n npx @agent-native/core@latest skills add visual-recap --with-github-action\n npx @agent-native/core@latest skills add visual-plan --mode local-files\n npx @agent-native/core@latest skills add visual-plan --mode self-hosted --mcp-url https://my-plan-app.example.com\n npx @agent-native/core@latest skills status visual-plan\n npx @agent-native/core@latest skills update visual-plan\n npx @agent-native/core@latest skills update scaffold --project\n npx @agent-native/core@latest skills add visual-plan --no-connect\n npx @agent-native/core@latest skills add context-xray --client all\n npx @agent-native/core@latest skills add assets --client claude-code\n npx @agent-native/core@latest skills add assets --mcp-url https://my-app.ngrok-free.dev\n npx @agent-native/core@latest skills add ./dist/assets-skill --client codex\n npx @agent-native/core@latest skills add BuilderIO/skills --client codex --scope project\n npx @agent-native/core@latest skills add BuilderIO/skills --with-github-action\n\nThe add command installs the SKILL.md instructions, registers the app-backed\nMCP connector, and then authenticates it in one step so you do not hit an OAuth\nwall on the first tool call. Hosted installs can configure Claude Code, Codex,\nClaude Cowork, Cursor, OpenCode, and GitHub Copilot / VS Code; local-files\ninstruction installs target the shared .agents skill path used by Codex, Pi,\nCursor, OpenCode, Copilot, and similar agents, plus Claude Code's native skill\npath when selected. Pass --client to narrow it. Authentication reuses\n\"npx @agent-native/core@latest connect\": OAuth-capable clients (Claude Code,\nCursor, OpenCode, GitHub Copilot / VS Code) get URL-only entries and authenticate\ninside that host, while Codex / Cowork run the browser device-code flow. In a\nnon-interactive shell or CI the auth step is skipped and the exact\n\"npx @agent-native/core@latest connect <url> --client all\" command is printed instead.\n\nRunning \"npx @agent-native/skills@latest add ...\" uses this same shared install\nflow with the broader BuilderIO skills catalog enabled. Pass --no-connect to\nregister MCP where possible without authenticating (leave auth to the host or run\n\"npx @agent-native/core@latest connect\" later). Pass --mcp-url to register that connector against\na custom origin (an ngrok tunnel, a local dev server, or a self-hosted\ndeployment) instead of the built-in hosted default \u2014 a bare origin gets the\nstandard /mcp path appended. Use app-skill pack for marketplace\nbundles and custom adapter output.\n\nWhen installing visual-plan, visual-recap, or visualize-repo interactively, the\nCLI asks where Plans artifacts should live: hosted Plans for shareable\nlinks/comments, local files for \"No sharing, all local.\", or a\nself-hosted/custom Plan app URL.\nPass --mode to choose directly. Local-files mode skips MCP registration and\nauth and installs instructions that default to a no-auth block catalog fetch,\nMDX folders, and the localhost bridge viewer.\n\nWhen installing content with --mode local-files, the CLI installs Content\ninstructions and writes or updates agent-native.json with repo-backed Markdown /\nMDX roots for docs, blog, content, and resources. Use a local Content app, Agent\nNative Desktop, or another trusted local bridge for Content actions to read and\nwrite those files.\n\nWhen installing visual-recap interactively, the CLI offers to add the optional PR\nVisual Recap GitHub Action. Pass --with-github-action to write it directly, then\nrun \"npx @agent-native/core@latest recap setup\" / \"npx @agent-native/core@latest recap doctor\" to configure and\nverify GitHub Actions. Docs: https://www.agent-native.com/docs/pr-visual-recap.\n\nThe status/update commands inspect copied Agent Native skill folders and refresh\ntheir instruction files from the current @agent-native/core package. In generated\napps/workspaces, \"skills update scaffold --project\" refreshes the framework\nskills copied into the scaffold and repairs AGENTS.md / CLAUDE.md and\n.agents/skills / .claude/skills compatibility links.";
|
|
1
|
+
export declare const HELP = "npx @agent-native/core@latest skills\n\nUsage:\n npx @agent-native/core@latest skills list\n npx @agent-native/core@latest skills status [assets|content|rewind|design-exploration|visual-edit|visual-plan|visual-recap|visualize-repo|context-xray|scaffold] [--client codex|claude-code|pi|all] [--scope user|project] [--json]\n npx @agent-native/core@latest skills update [assets|content|rewind|design-exploration|visual-edit|visual-plan|visual-recap|visualize-repo|context-xray|scaffold] [--client codex|claude-code|pi|all] [--scope user|project] [--dry-run] [--json]\n npx @agent-native/core@latest skills add assets|content|rewind|design-exploration|visual-edit|visual-plan|visual-recap|visualize-repo|context-xray [--client codex|claude-code|cowork|cursor|opencode|github-copilot|all] [--scope user|project] [--mode hosted|local-files|self-hosted] [--mcp-url <url>] [--no-connect] [--with-github-action] [--yes] [--dry-run] [--json]\n npx @agent-native/core@latest skills add <manifest-or-app-dir|skill-repo> [--skill <name>] [--client ...] [--yes]\n\nExamples:\n npx @agent-native/core@latest skills add assets\n npx @agent-native/core@latest skills add rewind --client codex --scope user --yes\n npx @agent-native/core@latest skills add content --mode local-files\n npx @agent-native/core@latest skills add design-exploration\n npx @agent-native/core@latest skills add visual-edit\n npx @agent-native/core@latest skills add visual-plan\n npx @agent-native/core@latest skills add visual-recap\n npx @agent-native/core@latest skills add visualize-repo\n npx @agent-native/core@latest skills add visual-recap --with-github-action\n npx @agent-native/core@latest skills add visual-plan --mode local-files\n npx @agent-native/core@latest skills add visual-plan --mode self-hosted --mcp-url https://my-plan-app.example.com\n npx @agent-native/core@latest skills status visual-plan\n npx @agent-native/core@latest skills update visual-plan\n npx @agent-native/core@latest skills update scaffold --project\n npx @agent-native/core@latest skills add visual-plan --no-connect\n npx @agent-native/core@latest skills add context-xray --client all\n npx @agent-native/core@latest skills add assets --client claude-code\n npx @agent-native/core@latest skills add assets --mcp-url https://my-app.ngrok-free.dev\n npx @agent-native/core@latest skills add ./dist/assets-skill --client codex\n npx @agent-native/core@latest skills add BuilderIO/skills --client codex --scope project\n npx @agent-native/core@latest skills add BuilderIO/skills --with-github-action\n\nThe add command installs the SKILL.md instructions, registers the app-backed\nMCP connector, and then authenticates it in one step so you do not hit an OAuth\nwall on the first tool call. Hosted installs can configure Claude Code, Codex,\nClaude Cowork, Cursor, OpenCode, and GitHub Copilot / VS Code; local-files\ninstruction installs target the shared .agents skill path used by Codex, Pi,\nCursor, OpenCode, Copilot, and similar agents, plus Claude Code's native skill\npath when selected. Pass --client to narrow it. Authentication reuses\n\"npx @agent-native/core@latest connect\": OAuth-capable clients (Claude Code,\nCursor, OpenCode, GitHub Copilot / VS Code) get URL-only entries and authenticate\ninside that host, while Codex / Cowork run the browser device-code flow. In a\nnon-interactive shell or CI the auth step is skipped and the exact\n\"npx @agent-native/core@latest connect <url> --client all\" command is printed instead.\n\nRunning \"npx @agent-native/skills@latest add ...\" uses this same shared install\nflow with the broader BuilderIO skills catalog enabled. Pass --no-connect to\nregister MCP where possible without authenticating (leave auth to the host or run\n\"npx @agent-native/core@latest connect\" later). Pass --mcp-url to register that connector against\na custom origin (an ngrok tunnel, a local dev server, or a self-hosted\ndeployment) instead of the built-in hosted default \u2014 a bare origin gets the\nstandard /mcp path appended. Use app-skill pack for marketplace\nbundles and custom adapter output.\n\nWhen installing visual-plan, visual-recap, or visualize-repo interactively, the\nCLI asks where Plans artifacts should live: hosted Plans for shareable\nlinks/comments, local files for \"No sharing, all local.\", or a\nself-hosted/custom Plan app URL.\nPass --mode to choose directly. Local-files mode skips MCP registration and\nauth and installs instructions that default to a no-auth block catalog fetch,\nMDX folders, and the localhost bridge viewer.\n\nWhen installing content with --mode local-files, the CLI installs Content\ninstructions and writes or updates agent-native.json with repo-backed Markdown /\nMDX roots for docs, blog, content, and resources. Use a local Content app, Agent\nNative Desktop, or another trusted local bridge for Content actions to read and\nwrite those files.\n\nWhen installing visual-recap interactively, the CLI offers to add the optional PR\nVisual Recap GitHub Action. Pass --with-github-action to write it directly, then\nrun \"npx @agent-native/core@latest recap setup\" / \"npx @agent-native/core@latest recap doctor\" to configure and\nverify GitHub Actions. Docs: https://www.agent-native.com/docs/pr-visual-recap.\n\nThe status/update commands inspect copied Agent Native skill folders and refresh\ntheir instruction files from the current @agent-native/core package. In generated\napps/workspaces, \"skills update scaffold --project\" refreshes the framework\nskills copied into the scaffold and repairs AGENTS.md / CLAUDE.md and\n.agents/skills / .claude/skills compatibility links.";
|
|
2
2
|
//# sourceMappingURL=help.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../../src/cli/skills-content/help.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../../src/cli/skills-content/help.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,8hLA6EoC,CAAC"}
|
|
@@ -2,13 +2,14 @@ export const HELP = `npx @agent-native/core@latest skills
|
|
|
2
2
|
|
|
3
3
|
Usage:
|
|
4
4
|
npx @agent-native/core@latest skills list
|
|
5
|
-
npx @agent-native/core@latest skills status [assets|content|design-exploration|visual-edit|visual-plan|visual-recap|visualize-repo|context-xray|scaffold] [--client codex|claude-code|pi|all] [--scope user|project] [--json]
|
|
6
|
-
npx @agent-native/core@latest skills update [assets|content|design-exploration|visual-edit|visual-plan|visual-recap|visualize-repo|context-xray|scaffold] [--client codex|claude-code|pi|all] [--scope user|project] [--dry-run] [--json]
|
|
7
|
-
npx @agent-native/core@latest skills add assets|content|design-exploration|visual-edit|visual-plan|visual-recap|visualize-repo|context-xray [--client codex|claude-code|cowork|cursor|opencode|github-copilot|all] [--scope user|project] [--mode hosted|local-files|self-hosted] [--mcp-url <url>] [--no-connect] [--with-github-action] [--yes] [--dry-run] [--json]
|
|
5
|
+
npx @agent-native/core@latest skills status [assets|content|rewind|design-exploration|visual-edit|visual-plan|visual-recap|visualize-repo|context-xray|scaffold] [--client codex|claude-code|pi|all] [--scope user|project] [--json]
|
|
6
|
+
npx @agent-native/core@latest skills update [assets|content|rewind|design-exploration|visual-edit|visual-plan|visual-recap|visualize-repo|context-xray|scaffold] [--client codex|claude-code|pi|all] [--scope user|project] [--dry-run] [--json]
|
|
7
|
+
npx @agent-native/core@latest skills add assets|content|rewind|design-exploration|visual-edit|visual-plan|visual-recap|visualize-repo|context-xray [--client codex|claude-code|cowork|cursor|opencode|github-copilot|all] [--scope user|project] [--mode hosted|local-files|self-hosted] [--mcp-url <url>] [--no-connect] [--with-github-action] [--yes] [--dry-run] [--json]
|
|
8
8
|
npx @agent-native/core@latest skills add <manifest-or-app-dir|skill-repo> [--skill <name>] [--client ...] [--yes]
|
|
9
9
|
|
|
10
10
|
Examples:
|
|
11
11
|
npx @agent-native/core@latest skills add assets
|
|
12
|
+
npx @agent-native/core@latest skills add rewind --client codex --scope user --yes
|
|
12
13
|
npx @agent-native/core@latest skills add content --mode local-files
|
|
13
14
|
npx @agent-native/core@latest skills add design-exploration
|
|
14
15
|
npx @agent-native/core@latest skills add visual-edit
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../../src/cli/skills-content/help.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../../src/cli/skills-content/help.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qDA6EiC,CAAC","sourcesContent":["export const HELP = `npx @agent-native/core@latest skills\n\nUsage:\n npx @agent-native/core@latest skills list\n npx @agent-native/core@latest skills status [assets|content|rewind|design-exploration|visual-edit|visual-plan|visual-recap|visualize-repo|context-xray|scaffold] [--client codex|claude-code|pi|all] [--scope user|project] [--json]\n npx @agent-native/core@latest skills update [assets|content|rewind|design-exploration|visual-edit|visual-plan|visual-recap|visualize-repo|context-xray|scaffold] [--client codex|claude-code|pi|all] [--scope user|project] [--dry-run] [--json]\n npx @agent-native/core@latest skills add assets|content|rewind|design-exploration|visual-edit|visual-plan|visual-recap|visualize-repo|context-xray [--client codex|claude-code|cowork|cursor|opencode|github-copilot|all] [--scope user|project] [--mode hosted|local-files|self-hosted] [--mcp-url <url>] [--no-connect] [--with-github-action] [--yes] [--dry-run] [--json]\n npx @agent-native/core@latest skills add <manifest-or-app-dir|skill-repo> [--skill <name>] [--client ...] [--yes]\n\nExamples:\n npx @agent-native/core@latest skills add assets\n npx @agent-native/core@latest skills add rewind --client codex --scope user --yes\n npx @agent-native/core@latest skills add content --mode local-files\n npx @agent-native/core@latest skills add design-exploration\n npx @agent-native/core@latest skills add visual-edit\n npx @agent-native/core@latest skills add visual-plan\n npx @agent-native/core@latest skills add visual-recap\n npx @agent-native/core@latest skills add visualize-repo\n npx @agent-native/core@latest skills add visual-recap --with-github-action\n npx @agent-native/core@latest skills add visual-plan --mode local-files\n npx @agent-native/core@latest skills add visual-plan --mode self-hosted --mcp-url https://my-plan-app.example.com\n npx @agent-native/core@latest skills status visual-plan\n npx @agent-native/core@latest skills update visual-plan\n npx @agent-native/core@latest skills update scaffold --project\n npx @agent-native/core@latest skills add visual-plan --no-connect\n npx @agent-native/core@latest skills add context-xray --client all\n npx @agent-native/core@latest skills add assets --client claude-code\n npx @agent-native/core@latest skills add assets --mcp-url https://my-app.ngrok-free.dev\n npx @agent-native/core@latest skills add ./dist/assets-skill --client codex\n npx @agent-native/core@latest skills add BuilderIO/skills --client codex --scope project\n npx @agent-native/core@latest skills add BuilderIO/skills --with-github-action\n\nThe add command installs the SKILL.md instructions, registers the app-backed\nMCP connector, and then authenticates it in one step so you do not hit an OAuth\nwall on the first tool call. Hosted installs can configure Claude Code, Codex,\nClaude Cowork, Cursor, OpenCode, and GitHub Copilot / VS Code; local-files\ninstruction installs target the shared .agents skill path used by Codex, Pi,\nCursor, OpenCode, Copilot, and similar agents, plus Claude Code's native skill\npath when selected. Pass --client to narrow it. Authentication reuses\n\"npx @agent-native/core@latest connect\": OAuth-capable clients (Claude Code,\nCursor, OpenCode, GitHub Copilot / VS Code) get URL-only entries and authenticate\ninside that host, while Codex / Cowork run the browser device-code flow. In a\nnon-interactive shell or CI the auth step is skipped and the exact\n\"npx @agent-native/core@latest connect <url> --client all\" command is printed instead.\n\nRunning \"npx @agent-native/skills@latest add ...\" uses this same shared install\nflow with the broader BuilderIO skills catalog enabled. Pass --no-connect to\nregister MCP where possible without authenticating (leave auth to the host or run\n\"npx @agent-native/core@latest connect\" later). Pass --mcp-url to register that connector against\na custom origin (an ngrok tunnel, a local dev server, or a self-hosted\ndeployment) instead of the built-in hosted default — a bare origin gets the\nstandard /mcp path appended. Use app-skill pack for marketplace\nbundles and custom adapter output.\n\nWhen installing visual-plan, visual-recap, or visualize-repo interactively, the\nCLI asks where Plans artifacts should live: hosted Plans for shareable\nlinks/comments, local files for \"No sharing, all local.\", or a\nself-hosted/custom Plan app URL.\nPass --mode to choose directly. Local-files mode skips MCP registration and\nauth and installs instructions that default to a no-auth block catalog fetch,\nMDX folders, and the localhost bridge viewer.\n\nWhen installing content with --mode local-files, the CLI installs Content\ninstructions and writes or updates agent-native.json with repo-backed Markdown /\nMDX roots for docs, blog, content, and resources. Use a local Content app, Agent\nNative Desktop, or another trusted local bridge for Content actions to read and\nwrite those files.\n\nWhen installing visual-recap interactively, the CLI offers to add the optional PR\nVisual Recap GitHub Action. Pass --with-github-action to write it directly, then\nrun \"npx @agent-native/core@latest recap setup\" / \"npx @agent-native/core@latest recap doctor\" to configure and\nverify GitHub Actions. Docs: https://www.agent-native.com/docs/pr-visual-recap.\n\nThe status/update commands inspect copied Agent Native skill folders and refresh\ntheir instruction files from the current @agent-native/core package. In generated\napps/workspaces, \"skills update scaffold --project\" refreshes the framework\nskills copied into the scaffold and repairs AGENTS.md / CLAUDE.md and\n.agents/skills / .claude/skills compatibility links.`;\n"]}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
export * from "./help.js";
|
|
9
9
|
export * from "./assets-skill.js";
|
|
10
10
|
export * from "./content-skill.js";
|
|
11
|
+
export * from "./rewind-skill.js";
|
|
11
12
|
export * from "./design-exploration-skill.js";
|
|
12
13
|
export * from "./design-visual-edit-skill.js";
|
|
13
14
|
export * from "./plan-setup-auth.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/skills-content/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/skills-content/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC"}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
export * from "./help.js";
|
|
9
9
|
export * from "./assets-skill.js";
|
|
10
10
|
export * from "./content-skill.js";
|
|
11
|
+
export * from "./rewind-skill.js";
|
|
11
12
|
export * from "./design-exploration-skill.js";
|
|
12
13
|
export * from "./design-visual-edit-skill.js";
|
|
13
14
|
export * from "./plan-setup-auth.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/skills-content/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC","sourcesContent":["/**\n * Barrel for the large embedded-markdown string constants used by\n * `agent-native skills` (SKILL.md bodies, shared reference docs, and the CLI\n * help text). Split out of `skills.ts` so that file can lead with real CLI\n * logic instead of ~3,000 lines of data. Content is purely relocated here —\n * no bytes were changed.\n */\nexport * from \"./help.js\";\nexport * from \"./assets-skill.js\";\nexport * from \"./content-skill.js\";\nexport * from \"./design-exploration-skill.js\";\nexport * from \"./design-visual-edit-skill.js\";\nexport * from \"./plan-setup-auth.js\";\nexport * from \"./wireframe.js\";\nexport * from \"./canvas.js\";\nexport * from \"./document-quality.js\";\nexport * from \"./exemplar.js\";\nexport * from \"./connection.js\";\nexport * from \"./local-files.js\";\nexport * from \"./visual-plan-skill.js\";\nexport * from \"./visual-recap-skill.js\";\nexport * from \"./visualize-repo-skill.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/skills-content/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC","sourcesContent":["/**\n * Barrel for the large embedded-markdown string constants used by\n * `agent-native skills` (SKILL.md bodies, shared reference docs, and the CLI\n * help text). Split out of `skills.ts` so that file can lead with real CLI\n * logic instead of ~3,000 lines of data. Content is purely relocated here —\n * no bytes were changed.\n */\nexport * from \"./help.js\";\nexport * from \"./assets-skill.js\";\nexport * from \"./content-skill.js\";\nexport * from \"./rewind-skill.js\";\nexport * from \"./design-exploration-skill.js\";\nexport * from \"./design-visual-edit-skill.js\";\nexport * from \"./plan-setup-auth.js\";\nexport * from \"./wireframe.js\";\nexport * from \"./canvas.js\";\nexport * from \"./document-quality.js\";\nexport * from \"./exemplar.js\";\nexport * from \"./connection.js\";\nexport * from \"./local-files.js\";\nexport * from \"./visual-plan-skill.js\";\nexport * from \"./visual-recap-skill.js\";\nexport * from \"./visualize-repo-skill.js\";\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const REWIND_SKILL_MD = "---\nname: rewind\ndescription: >-\n Retrieve recent local Clips Rewind context when the user says \"Look at\n Rewind,\" asks what just happened, or refers to something they recently said\n or saw.\nmetadata:\n visibility: exported\n---\n\n# Rewind\n\nUse Clips Rewind as local screen memory. Start broad enough to find the right\nmoment, then read only the smallest relevant range.\n\n## Retrieval Flow\n\n1. Call `screen_memory_status` first. If the newest segment is still open,\n wait for it to finalize rather than substituting an older segment.\n2. Search `screen_memory_search_chapters` before requesting raw recent\n context. Use the user's words, the visible app or project, and the likely\n time range as clues.\n3. If several chapters plausibly match, show the candidates and ask which one\n the user means. Do not blend separate workstreams together.\n4. Read the smallest useful range with `screen_memory_recent_context`.\n Restate what you recovered before acting, and flag transcription or coverage\n uncertainty.\n5. Use `screen_memory_frame_at` for one exact visual moment or\n `screen_memory_contact_sheet` to scan a bounded range. Prefer local frames\n before escalating to cloud processing.\n6. Request the smallest relevant timestamp range through Clips' bounded private\n Clip handoff only when local text and frames are insufficient, such as\n garbled speech, important motion, dense analysis, or a Clip the user wants\n to keep and query later.\n\n## Boundaries\n\n- Rewind recordings, screenshots, audio, transcripts, OCR, and indexes remain\n local unless the user explicitly asks for a bounded Clip handoff.\n- Do not reveal archive filesystem paths, crawl Clips' app-data folders, or\n bypass the Screen Memory MCP broker.\n- Do not upload frames returned by local Screen Memory tools.\n- Treat foreground apps and chapter labels as evidence, not proof of intent.\n- If the Screen Memory MCP is missing, explain that the one-time setup needs to\n be repaired with:\n\n `npx -y @agent-native/core@latest skills add rewind --client <client> --scope user --yes`\n\n Replace `<client>` with the current compatible host: `codex`,\n `claude-code`, `cursor`, `opencode`, `github-copilot`, or `cowork`.\n Ask the user to restart the host if it cannot reload MCP servers in place.\n";
|
|
2
|
+
//# sourceMappingURL=rewind-skill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rewind-skill.d.ts","sourceRoot":"","sources":["../../../src/cli/skills-content/rewind-skill.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,myEAmD3B,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export const REWIND_SKILL_MD = `---
|
|
2
|
+
name: rewind
|
|
3
|
+
description: >-
|
|
4
|
+
Retrieve recent local Clips Rewind context when the user says "Look at
|
|
5
|
+
Rewind," asks what just happened, or refers to something they recently said
|
|
6
|
+
or saw.
|
|
7
|
+
metadata:
|
|
8
|
+
visibility: exported
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Rewind
|
|
12
|
+
|
|
13
|
+
Use Clips Rewind as local screen memory. Start broad enough to find the right
|
|
14
|
+
moment, then read only the smallest relevant range.
|
|
15
|
+
|
|
16
|
+
## Retrieval Flow
|
|
17
|
+
|
|
18
|
+
1. Call \`screen_memory_status\` first. If the newest segment is still open,
|
|
19
|
+
wait for it to finalize rather than substituting an older segment.
|
|
20
|
+
2. Search \`screen_memory_search_chapters\` before requesting raw recent
|
|
21
|
+
context. Use the user's words, the visible app or project, and the likely
|
|
22
|
+
time range as clues.
|
|
23
|
+
3. If several chapters plausibly match, show the candidates and ask which one
|
|
24
|
+
the user means. Do not blend separate workstreams together.
|
|
25
|
+
4. Read the smallest useful range with \`screen_memory_recent_context\`.
|
|
26
|
+
Restate what you recovered before acting, and flag transcription or coverage
|
|
27
|
+
uncertainty.
|
|
28
|
+
5. Use \`screen_memory_frame_at\` for one exact visual moment or
|
|
29
|
+
\`screen_memory_contact_sheet\` to scan a bounded range. Prefer local frames
|
|
30
|
+
before escalating to cloud processing.
|
|
31
|
+
6. Request the smallest relevant timestamp range through Clips' bounded private
|
|
32
|
+
Clip handoff only when local text and frames are insufficient, such as
|
|
33
|
+
garbled speech, important motion, dense analysis, or a Clip the user wants
|
|
34
|
+
to keep and query later.
|
|
35
|
+
|
|
36
|
+
## Boundaries
|
|
37
|
+
|
|
38
|
+
- Rewind recordings, screenshots, audio, transcripts, OCR, and indexes remain
|
|
39
|
+
local unless the user explicitly asks for a bounded Clip handoff.
|
|
40
|
+
- Do not reveal archive filesystem paths, crawl Clips' app-data folders, or
|
|
41
|
+
bypass the Screen Memory MCP broker.
|
|
42
|
+
- Do not upload frames returned by local Screen Memory tools.
|
|
43
|
+
- Treat foreground apps and chapter labels as evidence, not proof of intent.
|
|
44
|
+
- If the Screen Memory MCP is missing, explain that the one-time setup needs to
|
|
45
|
+
be repaired with:
|
|
46
|
+
|
|
47
|
+
\`npx -y @agent-native/core@latest skills add rewind --client <client> --scope user --yes\`
|
|
48
|
+
|
|
49
|
+
Replace \`<client>\` with the current compatible host: \`codex\`,
|
|
50
|
+
\`claude-code\`, \`cursor\`, \`opencode\`, \`github-copilot\`, or \`cowork\`.
|
|
51
|
+
Ask the user to restart the host if it cannot reload MCP servers in place.
|
|
52
|
+
`;
|
|
53
|
+
//# sourceMappingURL=rewind-skill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rewind-skill.js","sourceRoot":"","sources":["../../../src/cli/skills-content/rewind-skill.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmD9B,CAAC","sourcesContent":["export const REWIND_SKILL_MD = `---\nname: rewind\ndescription: >-\n Retrieve recent local Clips Rewind context when the user says \"Look at\n Rewind,\" asks what just happened, or refers to something they recently said\n or saw.\nmetadata:\n visibility: exported\n---\n\n# Rewind\n\nUse Clips Rewind as local screen memory. Start broad enough to find the right\nmoment, then read only the smallest relevant range.\n\n## Retrieval Flow\n\n1. Call \\`screen_memory_status\\` first. If the newest segment is still open,\n wait for it to finalize rather than substituting an older segment.\n2. Search \\`screen_memory_search_chapters\\` before requesting raw recent\n context. Use the user's words, the visible app or project, and the likely\n time range as clues.\n3. If several chapters plausibly match, show the candidates and ask which one\n the user means. Do not blend separate workstreams together.\n4. Read the smallest useful range with \\`screen_memory_recent_context\\`.\n Restate what you recovered before acting, and flag transcription or coverage\n uncertainty.\n5. Use \\`screen_memory_frame_at\\` for one exact visual moment or\n \\`screen_memory_contact_sheet\\` to scan a bounded range. Prefer local frames\n before escalating to cloud processing.\n6. Request the smallest relevant timestamp range through Clips' bounded private\n Clip handoff only when local text and frames are insufficient, such as\n garbled speech, important motion, dense analysis, or a Clip the user wants\n to keep and query later.\n\n## Boundaries\n\n- Rewind recordings, screenshots, audio, transcripts, OCR, and indexes remain\n local unless the user explicitly asks for a bounded Clip handoff.\n- Do not reveal archive filesystem paths, crawl Clips' app-data folders, or\n bypass the Screen Memory MCP broker.\n- Do not upload frames returned by local Screen Memory tools.\n- Treat foreground apps and chapter labels as evidence, not proof of intent.\n- If the Screen Memory MCP is missing, explain that the one-time setup needs to\n be repaired with:\n\n \\`npx -y @agent-native/core@latest skills add rewind --client <client> --scope user --yes\\`\n\n Replace \\`<client>\\` with the current compatible host: \\`codex\\`,\n \\`claude-code\\`, \\`cursor\\`, \\`opencode\\`, \\`github-copilot\\`, or \\`cowork\\`.\n Ask the user to restart the host if it cannot reload MCP servers in place.\n`;\n"]}
|
package/dist/cli/skills.d.ts
CHANGED
|
@@ -19,6 +19,12 @@ export declare const BUILT_IN_APP_SKILLS: {
|
|
|
19
19
|
manifest: AppSkillManifest;
|
|
20
20
|
skillMarkdown: string;
|
|
21
21
|
};
|
|
22
|
+
rewind: {
|
|
23
|
+
skillName: string;
|
|
24
|
+
screenMemoryMcp: true;
|
|
25
|
+
manifest: AppSkillManifest;
|
|
26
|
+
skillMarkdown: string;
|
|
27
|
+
};
|
|
22
28
|
design: {
|
|
23
29
|
skillName: string;
|
|
24
30
|
extraSkills: {
|
package/dist/cli/skills.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/cli/skills.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAaH,OAAO,EAKL,KAAK,gBAAgB,EAEtB,MAAM,gBAAgB,CAAC;AAUxB,OAAO,EAAW,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/cli/skills.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAaH,OAAO,EAKL,KAAK,gBAAgB,EAEtB,MAAM,gBAAgB,CAAC;AAUxB,OAAO,EAAW,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAOjE,OAAO,EAEL,mBAAmB,EACnB,uBAAuB,EAIvB,6BAA6B,EAC7B,qBAAqB,EAErB,wBAAwB,EAExB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEvE,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,6BAA6B,EAC7B,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,GACvB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuU/B,CAAC;AAKF,eAAO,MAAM,gCAAgC,4BAA4B,CAAC;AAsG1E,KAAK,wBAAwB,GAAG,QAAQ,GAAG,IAAI,CAAC;AAoDhD,KAAK,aAAa,GA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