@notis_ai/cli 0.2.0-beta.136.1 → 0.2.0-beta.139.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -0
- package/dist/agent-hooks/notis-agent-hook.mjs +16620 -0
- package/{skills → dist/base-skills}/notis-apps/SKILL.md +9 -6
- package/{skills → dist/base-skills}/notis-cli/SKILL.md +1 -1
- package/dist/base-skills/notis-query/SKILL.md +705 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/config.ts +8 -0
- package/dist/scaffolds/notis-journal/packages/sdk/src/config.ts +8 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/config.ts +8 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/config.ts +8 -0
- package/dist/skill-sync/index.js +1528 -0
- package/dist/skill-sync/index.js.map +7 -0
- package/package.json +4 -1
- package/skills/notis-cli/AGENT_INSTRUCTIONS.md +39 -0
- package/skills/notis-onboarding/BRIEF.md +16 -0
- package/src/agent-hook-entry.js +5 -0
- package/src/cli.js +23 -14
- package/src/command-specs/agents.js +392 -0
- package/src/command-specs/auth.js +16 -0
- package/src/command-specs/index.js +6 -0
- package/src/command-specs/onboarding.js +59 -2
- package/src/command-specs/skills.js +56 -0
- package/src/runtime/agent-memory-state.js +126 -0
- package/src/runtime/agent-setup.js +383 -0
- package/src/runtime/base-skills.d.ts +20 -0
- package/src/runtime/base-skills.js +167 -0
- package/src/runtime/skill-sync/cloud-client.ts +96 -0
- package/src/runtime/skill-sync/index.ts +644 -0
- package/src/runtime/skill-sync/local-scanner.ts +1046 -0
- package/src/runtime/skill-sync/symlink-manager.ts +383 -0
- package/src/runtime/skill-sync/sync-plan.ts +22 -0
- package/src/runtime/skill-sync/types.ts +103 -0
- package/src/runtime/skill-sync/write-cloud-skill.ts +50 -0
- package/src/runtime/store-screenshot.js +6 -1
- package/src/runtime/sync-skills.d.ts +37 -0
- package/src/runtime/sync-skills.js +215 -0
- package/template/packages/sdk/src/config.ts +8 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { createSkillBundleBase64 } from './local-scanner';
|
|
2
|
+
import type { AgentTargets, LocalSkill, SyncPullResponse, SyncPushResponse, SyncSettings } from './types';
|
|
3
|
+
|
|
4
|
+
type JsonBody = Record<string, unknown> | undefined;
|
|
5
|
+
|
|
6
|
+
async function requestJson<T>(
|
|
7
|
+
url: string,
|
|
8
|
+
jwt: string,
|
|
9
|
+
options: { method?: string; body?: JsonBody } = {},
|
|
10
|
+
): Promise<T> {
|
|
11
|
+
const response = await fetch(url, {
|
|
12
|
+
method: options.method || 'POST',
|
|
13
|
+
headers: {
|
|
14
|
+
'Content-Type': 'application/json',
|
|
15
|
+
Authorization: `Bearer ${jwt}`,
|
|
16
|
+
},
|
|
17
|
+
body: options.body ? JSON.stringify(options.body) : undefined,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
if (!response.ok) {
|
|
21
|
+
const text = await response.text();
|
|
22
|
+
throw new Error(`${options.method || 'POST'} ${url} → ${response.status}: ${text}`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return response.json() as Promise<T>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export async function fetchSyncSettings(serverUrl: string, jwt: string): Promise<SyncSettings> {
|
|
29
|
+
return requestJson<SyncSettings>(`${serverUrl}/portal_skills/sync-settings`, jwt, {
|
|
30
|
+
body: {},
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export async function pullSkills(serverUrl: string, jwt: string): Promise<SyncPullResponse> {
|
|
35
|
+
return requestJson<SyncPullResponse>(`${serverUrl}/portal_skills/sync-pull`, jwt, {
|
|
36
|
+
body: {},
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export async function pushChangedSkills(
|
|
41
|
+
serverUrl: string,
|
|
42
|
+
jwt: string,
|
|
43
|
+
changedSkills: LocalSkill[],
|
|
44
|
+
): Promise<SyncPushResponse> {
|
|
45
|
+
const payloadSkills = await Promise.all(changedSkills.map(async (skill) => ({
|
|
46
|
+
name: skill.name,
|
|
47
|
+
description: skill.description,
|
|
48
|
+
skill_md: skill.skillMd,
|
|
49
|
+
source_url: skill.sourceUrl,
|
|
50
|
+
folder_hash: skill.folderHash,
|
|
51
|
+
bundle_base64: await createSkillBundleBase64(skill),
|
|
52
|
+
})));
|
|
53
|
+
|
|
54
|
+
return requestJson<SyncPushResponse>(`${serverUrl}/portal_skills/sync-push`, jwt, {
|
|
55
|
+
body: {
|
|
56
|
+
skills: payloadSkills,
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export async function downloadSkillBundle(bundleUrl: string): Promise<Buffer> {
|
|
62
|
+
const response = await fetch(bundleUrl);
|
|
63
|
+
if (!response.ok) {
|
|
64
|
+
const text = await response.text();
|
|
65
|
+
throw new Error(`GET ${bundleUrl} → ${response.status}: ${text}`);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return Buffer.from(await response.arrayBuffer());
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export async function updateAgentTargets(
|
|
72
|
+
serverUrl: string,
|
|
73
|
+
jwt: string,
|
|
74
|
+
skillId: string,
|
|
75
|
+
targets: AgentTargets,
|
|
76
|
+
): Promise<{ success: boolean; agent_targets: AgentTargets }> {
|
|
77
|
+
return requestJson<{ success: boolean; agent_targets: AgentTargets }>(`${serverUrl}/portal_skills/agent-targets`, jwt, {
|
|
78
|
+
method: 'PATCH',
|
|
79
|
+
body: {
|
|
80
|
+
skill_id: skillId,
|
|
81
|
+
agent_targets: targets,
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Install (enabled=true) or uninstall (enabled=false) the curated computer-use
|
|
87
|
+
// skill for the user, matching the desktop app's "Desktop Use" toggle.
|
|
88
|
+
export async function setComputerUseSkill(
|
|
89
|
+
serverUrl: string,
|
|
90
|
+
jwt: string,
|
|
91
|
+
enabled: boolean,
|
|
92
|
+
): Promise<{ installed: boolean }> {
|
|
93
|
+
return requestJson<{ installed: boolean }>(`${serverUrl}/portal_skills/desktop-use`, jwt, {
|
|
94
|
+
body: { enabled, name: 'notis-desktop-use' },
|
|
95
|
+
});
|
|
96
|
+
}
|