@notis_ai/cli 0.2.0-beta.157.1 → 0.2.0-beta.158.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/dist/agent-hooks/notis-agent-hook.mjs +8296 -7912
- package/dist/base-skills/notis-apps/SKILL.md +21 -483
- package/dist/base-skills/notis-apps/references/architecture.md +147 -0
- package/dist/base-skills/notis-apps/references/design.md +154 -0
- package/dist/base-skills/notis-apps/references/release.md +93 -0
- package/dist/base-skills/notis-apps/references/sdk.md +60 -0
- package/dist/base-skills/notis-apps/references/troubleshooting.md +26 -0
- package/dist/base-skills/notis-cli/SKILL.md +19 -200
- package/dist/base-skills/notis-cli/references/app-delivery.md +18 -0
- package/dist/base-skills/notis-cli/references/native-databases.md +20 -0
- package/dist/base-skills/notis-cli/references/tool-examples.md +56 -0
- package/dist/base-skills/notis-cli/references/troubleshooting.md +39 -0
- package/dist/base-skills/notis-query/SKILL.md +13 -651
- package/dist/base-skills/notis-query/references/database-discovery.md +59 -0
- package/dist/base-skills/notis-query/references/documents.md +50 -0
- package/dist/base-skills/notis-query/references/query.md +543 -0
- package/dist/skill-sync/index.js +24 -7
- package/dist/skill-sync/index.js.map +4 -4
- package/dist/skill-sync-worker.mjs +2989 -0
- package/package.json +1 -1
- package/src/cli.js +4 -0
- package/src/command-specs/diagnostics.js +37 -0
- package/src/command-specs/skills.js +23 -5
- package/src/runtime/profiles.js +5 -2
- package/src/runtime/skill-sync/cloud-client.ts +2 -1
- package/src/runtime/skill-sync/index.ts +24 -6
- package/src/runtime/skill-sync/types.ts +2 -0
- package/src/runtime/skill-sync-service.js +109 -0
- package/src/skill-sync-worker-entry.js +2 -0
- package/src/skill-sync-worker.js +50 -0
- package/template/packages/sdk/src/components/MultiSelectActionBar.tsx +36 -7
- package/template/packages/sdk/src/components/MultiSelectCheckbox.tsx +3 -1
- package/template/packages/sdk/src/hooks/useCollectionInteractions.ts +138 -28
- package/template/packages/sdk/src/hooks/useLongPressSelection.ts +79 -0
- package/template/packages/sdk/src/hooks/useMultiSelect.ts +2 -8
- package/template/packages/sdk/src/index.ts +3 -0
- package/template/packages/sdk/src/interactions/actions.ts +14 -1
- package/template/packages/sdk/src/interactions/shortcuts.tsx +79 -19
- package/template/packages/sdk/src/interactions/visibility.ts +13 -0
- package/template/packages/sdk/src/interactions.ts +3 -0
package/dist/skill-sync/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// src/runtime/skill-sync/index.ts
|
|
2
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
3
|
+
|
|
1
4
|
// src/runtime/skill-sync/types.ts
|
|
2
5
|
var DEFAULT_AGENT_TARGETS = {
|
|
3
6
|
notis: true,
|
|
@@ -752,6 +755,7 @@ async function writeCloudSkillToDisk(skill, bundleBytes, paths = DEFAULT_SYNC_PA
|
|
|
752
755
|
// src/runtime/skill-sync/cloud-client.ts
|
|
753
756
|
async function requestJson(url, jwt, options = {}) {
|
|
754
757
|
const response = await fetch(url, {
|
|
758
|
+
signal: AbortSignal.timeout(9e4),
|
|
755
759
|
method: options.method || "POST",
|
|
756
760
|
headers: {
|
|
757
761
|
"Content-Type": "application/json",
|
|
@@ -791,7 +795,7 @@ async function pushChangedSkills(serverUrl, jwt, changedSkills) {
|
|
|
791
795
|
});
|
|
792
796
|
}
|
|
793
797
|
async function downloadSkillBundle(bundleUrl) {
|
|
794
|
-
const response = await fetch(bundleUrl);
|
|
798
|
+
const response = await fetch(bundleUrl, { signal: AbortSignal.timeout(9e4) });
|
|
795
799
|
if (!response.ok) {
|
|
796
800
|
const text = await response.text();
|
|
797
801
|
throw new Error(`GET ${bundleUrl} \u2192 ${response.status}: ${text}`);
|
|
@@ -1217,6 +1221,15 @@ function decodeJwtSubject(jwt) {
|
|
|
1217
1221
|
return null;
|
|
1218
1222
|
}
|
|
1219
1223
|
}
|
|
1224
|
+
function cloudContentHash(skill) {
|
|
1225
|
+
return createHash2("sha256").update(JSON.stringify({
|
|
1226
|
+
md: skill.skill_md,
|
|
1227
|
+
hash: skill.skill_folder_hash,
|
|
1228
|
+
source: skill.skill_source_url,
|
|
1229
|
+
files: skill.bundle_files?.slice().sort((a, b) => a.path.localeCompare(b.path)),
|
|
1230
|
+
hydrationFailed: skill.bundle_hydration_failed === true
|
|
1231
|
+
})).digest("hex");
|
|
1232
|
+
}
|
|
1220
1233
|
function shouldWriteCloudSkill(cloudSkill, localSkills, previousState) {
|
|
1221
1234
|
const skillName = cloudSkill.name;
|
|
1222
1235
|
const cloudHash = cloudSkill.skill_folder_hash || "";
|
|
@@ -1224,14 +1237,15 @@ function shouldWriteCloudSkill(cloudSkill, localSkills, previousState) {
|
|
|
1224
1237
|
if (!localSkill) {
|
|
1225
1238
|
return true;
|
|
1226
1239
|
}
|
|
1240
|
+
const previous = previousState.skills[skillName];
|
|
1241
|
+
if (previous?.folderHash === localSkill.folderHash && previous.cloudContentHash === cloudContentHash(cloudSkill)) return false;
|
|
1227
1242
|
if (cloudSkill.source === "curated") {
|
|
1228
1243
|
return cloudHash ? cloudHash !== localSkill.folderHash : true;
|
|
1229
1244
|
}
|
|
1230
|
-
const previous = previousState.skills[skillName];
|
|
1231
1245
|
const localChangedSinceLastSync = !previous || previous.folderHash !== localSkill.folderHash;
|
|
1232
|
-
return !localChangedSinceLastSync && Boolean(cloudHash) && cloudHash !== localSkill.folderHash;
|
|
1246
|
+
return !localChangedSinceLastSync && (Boolean(cloudHash) && cloudHash !== localSkill.folderHash || Boolean(previous?.cloudContentHash && previous.cloudContentHash !== cloudContentHash(cloudSkill)));
|
|
1233
1247
|
}
|
|
1234
|
-
function buildSyncState(pullResponse, localSkills, lastSyncedAt, verifiedAgentLinks = {}) {
|
|
1248
|
+
function buildSyncState(pullResponse, localSkills, lastSyncedAt, verifiedAgentLinks = {}, failedContentNames = /* @__PURE__ */ new Set()) {
|
|
1235
1249
|
const localSkillMap = toSkillMap(localSkills);
|
|
1236
1250
|
const skills = Object.fromEntries(
|
|
1237
1251
|
pullResponse.skills.map((skill) => {
|
|
@@ -1244,6 +1258,7 @@ function buildSyncState(pullResponse, localSkills, lastSyncedAt, verifiedAgentLi
|
|
|
1244
1258
|
agentTargets: normalizeAgentTargets(skill.agent_targets),
|
|
1245
1259
|
verifiedAgentLinks: skill.status === "active" ? verifiedAgentLinks[skill.name] ?? {} : {},
|
|
1246
1260
|
cloudUpdatedAt: skill.updated_at,
|
|
1261
|
+
...!failedContentNames.has(skill.name) && !skill.skill_source_url ? { cloudContentHash: cloudContentHash(skill) } : {},
|
|
1247
1262
|
syncedAt: lastSyncedAt || (/* @__PURE__ */ new Date()).toISOString()
|
|
1248
1263
|
}
|
|
1249
1264
|
];
|
|
@@ -1379,7 +1394,7 @@ async function materializeCloudSkillsForLocalShell(serverUrl, jwt, dependencies
|
|
|
1379
1394
|
}
|
|
1380
1395
|
for (const failure of failedDownloads) delete verifiedLinks[failure.name];
|
|
1381
1396
|
await deps.writeSyncState(
|
|
1382
|
-
buildSyncState(pullResponse, finalLocalSkills, lastSyncedAt, verifiedLinks),
|
|
1397
|
+
buildSyncState(pullResponse, finalLocalSkills, lastSyncedAt, verifiedLinks, new Set(failedDownloads.map((item) => item.name))),
|
|
1383
1398
|
syncPaths
|
|
1384
1399
|
);
|
|
1385
1400
|
return {
|
|
@@ -1563,7 +1578,7 @@ async function runSkillSync(serverUrl, jwt, dependencies = {}, options = {}) {
|
|
|
1563
1578
|
for (const failure of failedDownloads) delete verifiedLinks[failure.name];
|
|
1564
1579
|
const lastSyncedAt = pullResponse.last_synced_at || (/* @__PURE__ */ new Date()).toISOString();
|
|
1565
1580
|
await deps.writeSyncState(
|
|
1566
|
-
buildSyncState(pullResponse, finalLocalSkills, lastSyncedAt, verifiedLinks),
|
|
1581
|
+
buildSyncState(pullResponse, finalLocalSkills, lastSyncedAt, verifiedLinks, new Set(failedDownloads.map((item) => item.name))),
|
|
1567
1582
|
syncPaths
|
|
1568
1583
|
);
|
|
1569
1584
|
return {
|
|
@@ -1584,7 +1599,9 @@ async function runSkillSync(serverUrl, jwt, dependencies = {}, options = {}) {
|
|
|
1584
1599
|
};
|
|
1585
1600
|
}
|
|
1586
1601
|
export {
|
|
1602
|
+
fetchSyncSettings,
|
|
1587
1603
|
materializeCloudSkillsForLocalShell,
|
|
1588
|
-
runSkillSync
|
|
1604
|
+
runSkillSync,
|
|
1605
|
+
shouldWriteCloudSkill
|
|
1589
1606
|
};
|
|
1590
1607
|
//# sourceMappingURL=index.js.map
|