@hasna/skills 0.1.64 → 0.1.67
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 +33 -16
- package/bin/index.js +710 -511
- package/bin/mcp.js +285 -239
- package/bin/server.js +791 -232
- package/bin/worker.js +178 -148
- package/dist/index.d.ts +1 -1
- package/dist/index.js +421 -321
- package/dist/lib/agent-sync.d.ts +2 -2
- package/dist/lib/native-storage.d.ts +28 -0
- package/dist/lib/portable-skills.d.ts +14 -0
- package/dist/lib/registry-types.d.ts +9 -0
- package/dist/lib/run-routing.d.ts +60 -0
- package/dist/mcp/index.d.ts +10 -0
- package/dist/sdk/index.js +14095 -14019
- package/dist/server/app.d.ts +3 -0
- package/dist/server/store-fixtures.d.ts +6 -0
- package/dist/storage.d.ts +1 -1
- package/dist/storage.js +50 -0
- package/package.json +3 -1
package/dist/server/app.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { type GovernanceStore } from "../sdk/governance-store.js";
|
|
1
2
|
import { type SkillsServerConfig } from "./config.js";
|
|
2
3
|
import { type MemorySkillsStore } from "./store.js";
|
|
3
4
|
import { type SkillsProductStore } from "./types.js";
|
|
4
5
|
export interface SkillsServerOptions {
|
|
5
6
|
config?: Partial<SkillsServerConfig>;
|
|
6
7
|
store?: SkillsProductStore;
|
|
8
|
+
/** Lifecycle ledger and ceiling reads for governance surfaces (cancellation). Defaults to the store's database. */
|
|
9
|
+
governanceStore?: GovernanceStore;
|
|
7
10
|
}
|
|
8
11
|
/**
|
|
9
12
|
* Refuse to serve traffic from storage that will not survive a restart.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type GovernanceStore } from "../sdk/governance-store.js";
|
|
1
2
|
import type { ApiPrincipal, SkillsProductStore } from "./types.js";
|
|
2
3
|
export declare const TEST_DATABASE_URL_ENV = "HASNA_SKILLS_TEST_DATABASE_URL";
|
|
3
4
|
export interface SeedApiKey {
|
|
@@ -6,6 +7,11 @@ export interface SeedApiKey {
|
|
|
6
7
|
}
|
|
7
8
|
export interface StoreFixture {
|
|
8
9
|
store: SkillsProductStore;
|
|
10
|
+
/**
|
|
11
|
+
* Governance store over the same database as `store`, for surfaces that need
|
|
12
|
+
* the append-only lifecycle ledger and ceiling reads (cancellation).
|
|
13
|
+
*/
|
|
14
|
+
governanceStore: GovernanceStore;
|
|
9
15
|
/** True when the server must be told it is allowed to run on this store. */
|
|
10
16
|
allowEphemeralStore: boolean;
|
|
11
17
|
close(): Promise<void>;
|
package/dist/storage.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { SKILLS_NATIVE_STORAGE_ENV, SKILLS_NATIVE_STORAGE_FALLBACK_ENV, SKILLS_STORAGE_ENV, SKILLS_STORAGE_FALLBACK_ENV, SKILLS_STORAGE_TABLES, STORAGE_TABLES, SkillsPostgresSyncStore, SkillsS3ObjectStore, buildSkillsS3ObjectUrl, createSkillsPostgresSyncStore, createSkillsS3ObjectStore, createSkillsSnapshotSyncRecord, exportSkillsLocalSnapshot, getSkillsNativeStorageStatus, getSkillsStorageDatabaseEnv, getSkillsStorageDatabaseUrl, getSkillsStorageStatus, getStorageDatabaseEnv, getStorageDatabaseUrl, getStorageStatus, importSkillsLocalSnapshot, planSkillsS3SnapshotUpload, resolveSkillsNativeStorageConfig, resolveStorageConfig, signSkillsAwsV4Request, skillsPostgresSyncSchemaSql, uploadSkillsSnapshotFilesToS3, type AwsCredentials, type SignSkillsAwsV4RequestOptions, type SkillsFetch, type SkillsLocalSnapshot, type SkillsNativeStorageConfig, type SkillsNativeStorageStatus, type SkillsPostgresQueryClient, type SkillsS3ObjectStoreOptions, type SkillsS3PutObjectOptions, type SkillsS3SnapshotPlanEntry, type SkillsS3StoredObject, type SkillsSnapshotFile, type SkillsStorageTable, type SkillsSyncRecord, } from "./lib/native-storage.js";
|
|
1
|
+
export { SKILLS_NATIVE_STORAGE_ENV, SKILLS_NATIVE_STORAGE_FALLBACK_ENV, SKILLS_STORAGE_ENV, SKILLS_STORAGE_FALLBACK_ENV, SKILLS_STORAGE_TABLES, STORAGE_TABLES, SkillsPostgresSyncStore, SkillsS3ObjectStore, buildSkillsS3ObjectUrl, createSkillsPostgresSyncStore, createSkillsS3ObjectStore, createSkillsSnapshotSyncRecord, exportSkillsLocalSnapshot, getSkillsNativeStorageStatus, getSkillsStorageDatabaseEnv, getSkillsStorageDatabaseUrl, getSkillsStorageStatus, getStorageDatabaseEnv, getStorageDatabaseUrl, getStorageStatus, importSkillsLocalSnapshot, planSkillsS3SnapshotUpload, resolveSkillsNativeStorageConfig, resolveStorageConfig, signSkillsAwsV4Request, skillsPostgresSyncSchemaSql, storageCapabilities, uploadSkillsSnapshotFilesToS3, type AwsCredentials, type SignSkillsAwsV4RequestOptions, type SkillsFetch, type SkillsLocalSnapshot, type SkillsNativeStorageConfig, type SkillsNativeStorageStatus, type SkillsPostgresQueryClient, type SkillsS3ObjectStoreOptions, type SkillsS3PutObjectOptions, type SkillsS3SnapshotPlanEntry, type SkillsS3StoredObject, type SkillsSnapshotFile, type SkillsStorageTable, type SkillsSyncRecord, } from "./lib/native-storage.js";
|
package/dist/storage.js
CHANGED
|
@@ -462,6 +462,55 @@ var SKILLS_NATIVE_STORAGE_FALLBACK_ENV = {
|
|
|
462
462
|
};
|
|
463
463
|
var SKILLS_STORAGE_ENV = SKILLS_NATIVE_STORAGE_ENV;
|
|
464
464
|
var SKILLS_STORAGE_FALLBACK_ENV = SKILLS_NATIVE_STORAGE_FALLBACK_ENV;
|
|
465
|
+
var storageCapabilities = {
|
|
466
|
+
version: 1,
|
|
467
|
+
values: [
|
|
468
|
+
"SKILLS_NATIVE_STORAGE_ENV",
|
|
469
|
+
"SKILLS_NATIVE_STORAGE_FALLBACK_ENV",
|
|
470
|
+
"SKILLS_STORAGE_ENV",
|
|
471
|
+
"SKILLS_STORAGE_FALLBACK_ENV",
|
|
472
|
+
"SKILLS_STORAGE_TABLES",
|
|
473
|
+
"STORAGE_TABLES",
|
|
474
|
+
"SkillsPostgresSyncStore",
|
|
475
|
+
"SkillsS3ObjectStore",
|
|
476
|
+
"buildSkillsS3ObjectUrl",
|
|
477
|
+
"createSkillsPostgresSyncStore",
|
|
478
|
+
"createSkillsS3ObjectStore",
|
|
479
|
+
"createSkillsSnapshotSyncRecord",
|
|
480
|
+
"exportSkillsLocalSnapshot",
|
|
481
|
+
"getSkillsNativeStorageStatus",
|
|
482
|
+
"getSkillsStorageDatabaseEnv",
|
|
483
|
+
"getSkillsStorageDatabaseUrl",
|
|
484
|
+
"getSkillsStorageStatus",
|
|
485
|
+
"getStorageDatabaseEnv",
|
|
486
|
+
"getStorageDatabaseUrl",
|
|
487
|
+
"getStorageStatus",
|
|
488
|
+
"importSkillsLocalSnapshot",
|
|
489
|
+
"planSkillsS3SnapshotUpload",
|
|
490
|
+
"resolveSkillsNativeStorageConfig",
|
|
491
|
+
"resolveStorageConfig",
|
|
492
|
+
"signSkillsAwsV4Request",
|
|
493
|
+
"skillsPostgresSyncSchemaSql",
|
|
494
|
+
"storageCapabilities",
|
|
495
|
+
"uploadSkillsSnapshotFilesToS3"
|
|
496
|
+
],
|
|
497
|
+
types: [
|
|
498
|
+
"AwsCredentials",
|
|
499
|
+
"SignSkillsAwsV4RequestOptions",
|
|
500
|
+
"SkillsFetch",
|
|
501
|
+
"SkillsLocalSnapshot",
|
|
502
|
+
"SkillsNativeStorageConfig",
|
|
503
|
+
"SkillsNativeStorageStatus",
|
|
504
|
+
"SkillsPostgresQueryClient",
|
|
505
|
+
"SkillsS3ObjectStoreOptions",
|
|
506
|
+
"SkillsS3PutObjectOptions",
|
|
507
|
+
"SkillsS3SnapshotPlanEntry",
|
|
508
|
+
"SkillsS3StoredObject",
|
|
509
|
+
"SkillsSnapshotFile",
|
|
510
|
+
"SkillsStorageTable",
|
|
511
|
+
"SkillsSyncRecord"
|
|
512
|
+
]
|
|
513
|
+
};
|
|
465
514
|
var SKILLS_ENV_NAMESPACE = "SKILLS";
|
|
466
515
|
function resolveSkillsNativeStorageConfig(env = process.env) {
|
|
467
516
|
assertNoRetiredModeEnvVars(env, {
|
|
@@ -948,6 +997,7 @@ function toArrayBuffer(bytes) {
|
|
|
948
997
|
}
|
|
949
998
|
export {
|
|
950
999
|
uploadSkillsSnapshotFilesToS3,
|
|
1000
|
+
storageCapabilities,
|
|
951
1001
|
skillsPostgresSyncSchemaSql,
|
|
952
1002
|
signSkillsAwsV4Request,
|
|
953
1003
|
resolveStorageConfig,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/skills",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.67",
|
|
4
4
|
"description": "Skills library for AI coding agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"scripts": {
|
|
42
42
|
"clean": "rm -rf bin/ dist/",
|
|
43
43
|
"build": "bun run clean && bun build ./src/cli/index.tsx --outdir ./bin --target bun && bun build ./src/mcp/index.ts --outfile ./bin/mcp.js --target bun && bun build ./src/server/index.ts --outfile ./bin/server.js --target bun && bun build ./src/server/worker.ts --outfile ./bin/worker.js --target bun && bun build ./src/server/migrate.ts --outfile ./bin/migrate.js --target bun && bun build ./src/index.ts ./src/storage.ts ./src/sdk/index.ts --outdir ./dist --target bun && tsc --emitDeclarationOnly --declaration --outDir dist",
|
|
44
|
+
"build:js": "rm -rf dist && bun build ./src/index.ts ./src/storage.ts ./src/sdk/index.ts --outdir ./dist --target bun && tsc --emitDeclarationOnly --declaration --outDir dist",
|
|
44
45
|
"test": "bun test --timeout 30000",
|
|
45
46
|
"dev": "bun run ./src/cli/index.tsx",
|
|
46
47
|
"dev:watch": "bun --watch run ./src/cli/index.tsx",
|
|
@@ -50,6 +51,7 @@
|
|
|
50
51
|
"migrate": "bun run ./src/server/migrate.ts",
|
|
51
52
|
"typecheck": "tsc --noEmit",
|
|
52
53
|
"verify:release": "bun run scripts/release-guard.ts",
|
|
54
|
+
"prepare": "bun run build:js",
|
|
53
55
|
"prepack": "bun run build && bun run verify:release",
|
|
54
56
|
"prepublishOnly": "bun run typecheck && bun run test",
|
|
55
57
|
"postinstall": "mkdir -p $HOME/.hasna/skills/custom 2>/dev/null || true"
|