@hasna/hooks 0.7.0 → 0.7.2

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/index.js CHANGED
@@ -49,7 +49,7 @@ function up(db) {
49
49
  db.exec(idx);
50
50
  }
51
51
  }
52
- var init__001_initial = __esm(() => {
52
+ var init_001_initial = __esm(() => {
53
53
  init_schema();
54
54
  });
55
55
 
@@ -78,7 +78,7 @@ function up2(db) {
78
78
  throw err;
79
79
  }
80
80
  }
81
- var init__002_session_events = __esm(() => {
81
+ var init_002_session_events = __esm(() => {
82
82
  init_schema();
83
83
  });
84
84
 
@@ -107,7 +107,7 @@ function up3(db) {
107
107
  throw err;
108
108
  }
109
109
  }
110
- var init__003_user_prompt_submit_event = __esm(() => {
110
+ var init_003_user_prompt_submit_event = __esm(() => {
111
111
  init_schema();
112
112
  });
113
113
 
@@ -131,7 +131,7 @@ var CREATE_HOOKS_TABLE = `
131
131
  last_verified_at TEXT
132
132
  )
133
133
  `, CREATE_HOOKS_INDEXES;
134
- var init__004_hooks_table = __esm(() => {
134
+ var init_004_hooks_table = __esm(() => {
135
135
  CREATE_HOOKS_INDEXES = [
136
136
  `CREATE INDEX IF NOT EXISTS idx_hooks_name ON hooks (name)`
137
137
  ];
@@ -162,7 +162,7 @@ function up5(db) {
162
162
  throw err;
163
163
  }
164
164
  }
165
- var init__005_subagent_start_event = __esm(() => {
165
+ var init_005_subagent_start_event = __esm(() => {
166
166
  init_schema();
167
167
  });
168
168
 
@@ -194,11 +194,11 @@ function runMigrations(db) {
194
194
  }
195
195
  var MIGRATIONS;
196
196
  var init_migrations = __esm(() => {
197
- init__001_initial();
198
- init__002_session_events();
199
- init__003_user_prompt_submit_event();
200
- init__004_hooks_table();
201
- init__005_subagent_start_event();
197
+ init_001_initial();
198
+ init_002_session_events();
199
+ init_003_user_prompt_submit_event();
200
+ init_004_hooks_table();
201
+ init_005_subagent_start_event();
202
202
  MIGRATIONS = [
203
203
  { version: "001_initial", up },
204
204
  { version: "002_session_events", up: up2 },
@@ -4296,113 +4296,113 @@ var init_types = __esm(() => {
4296
4296
  // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/external.js
4297
4297
  var exports_external = {};
4298
4298
  __export(exports_external, {
4299
- BRAND: () => BRAND,
4300
- DIRTY: () => DIRTY,
4301
- EMPTY_PATH: () => EMPTY_PATH,
4302
- INVALID: () => INVALID,
4303
- NEVER: () => NEVER,
4304
- OK: () => OK,
4305
- ParseStatus: () => ParseStatus,
4306
- Schema: () => ZodType,
4307
- ZodAny: () => ZodAny,
4308
- ZodArray: () => ZodArray,
4309
- ZodBigInt: () => ZodBigInt,
4310
- ZodBoolean: () => ZodBoolean,
4311
- ZodBranded: () => ZodBranded,
4312
- ZodCatch: () => ZodCatch,
4313
- ZodDate: () => ZodDate,
4314
- ZodDefault: () => ZodDefault,
4315
- ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
4316
- ZodEffects: () => ZodEffects,
4317
- ZodEnum: () => ZodEnum,
4318
- ZodError: () => ZodError,
4319
- ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
4320
- ZodFunction: () => ZodFunction,
4321
- ZodIntersection: () => ZodIntersection,
4322
- ZodIssueCode: () => ZodIssueCode,
4323
- ZodLazy: () => ZodLazy,
4324
- ZodLiteral: () => ZodLiteral,
4325
- ZodMap: () => ZodMap,
4326
- ZodNaN: () => ZodNaN,
4327
- ZodNativeEnum: () => ZodNativeEnum,
4328
- ZodNever: () => ZodNever,
4329
- ZodNull: () => ZodNull,
4330
- ZodNullable: () => ZodNullable,
4331
- ZodNumber: () => ZodNumber,
4332
- ZodObject: () => ZodObject,
4333
- ZodOptional: () => ZodOptional,
4334
- ZodParsedType: () => ZodParsedType,
4335
- ZodPipeline: () => ZodPipeline,
4336
- ZodPromise: () => ZodPromise,
4337
- ZodReadonly: () => ZodReadonly,
4338
- ZodRecord: () => ZodRecord,
4339
- ZodSchema: () => ZodType,
4340
- ZodSet: () => ZodSet,
4341
- ZodString: () => ZodString,
4342
- ZodSymbol: () => ZodSymbol,
4343
- ZodTransformer: () => ZodEffects,
4344
- ZodTuple: () => ZodTuple,
4345
- ZodType: () => ZodType,
4346
- ZodUndefined: () => ZodUndefined,
4347
- ZodUnion: () => ZodUnion,
4348
- ZodUnknown: () => ZodUnknown,
4349
- ZodVoid: () => ZodVoid,
4350
- addIssueToContext: () => addIssueToContext,
4351
- any: () => anyType,
4352
- array: () => arrayType,
4353
- bigint: () => bigIntType,
4354
- boolean: () => booleanType,
4355
- coerce: () => coerce,
4356
- custom: () => custom,
4357
- date: () => dateType,
4358
- datetimeRegex: () => datetimeRegex,
4359
- defaultErrorMap: () => en_default,
4360
- discriminatedUnion: () => discriminatedUnionType,
4361
- effect: () => effectsType,
4362
- enum: () => enumType,
4363
- function: () => functionType,
4364
- getErrorMap: () => getErrorMap,
4365
- getParsedType: () => getParsedType,
4366
- instanceof: () => instanceOfType,
4367
- intersection: () => intersectionType,
4368
- isAborted: () => isAborted,
4369
- isAsync: () => isAsync,
4370
- isDirty: () => isDirty,
4371
- isValid: () => isValid,
4372
- late: () => late,
4373
- lazy: () => lazyType,
4374
- literal: () => literalType,
4375
- makeIssue: () => makeIssue,
4376
- map: () => mapType,
4377
- nan: () => nanType,
4378
- nativeEnum: () => nativeEnumType,
4379
- never: () => neverType,
4380
- null: () => nullType,
4381
- nullable: () => nullableType,
4382
- number: () => numberType,
4383
- object: () => objectType,
4384
- objectUtil: () => objectUtil,
4385
- oboolean: () => oboolean,
4386
- onumber: () => onumber,
4387
- optional: () => optionalType,
4388
- ostring: () => ostring,
4389
- pipeline: () => pipelineType,
4390
- preprocess: () => preprocessType,
4391
- promise: () => promiseType,
4392
- quotelessJson: () => quotelessJson,
4393
- record: () => recordType,
4394
- set: () => setType,
4395
- setErrorMap: () => setErrorMap,
4396
- strictObject: () => strictObjectType,
4397
- string: () => stringType,
4398
- symbol: () => symbolType,
4399
- transformer: () => effectsType,
4400
- tuple: () => tupleType,
4401
- undefined: () => undefinedType,
4402
- union: () => unionType,
4403
- unknown: () => unknownType,
4299
+ void: () => voidType,
4404
4300
  util: () => util,
4405
- void: () => voidType
4301
+ unknown: () => unknownType,
4302
+ union: () => unionType,
4303
+ undefined: () => undefinedType,
4304
+ tuple: () => tupleType,
4305
+ transformer: () => effectsType,
4306
+ symbol: () => symbolType,
4307
+ string: () => stringType,
4308
+ strictObject: () => strictObjectType,
4309
+ setErrorMap: () => setErrorMap,
4310
+ set: () => setType,
4311
+ record: () => recordType,
4312
+ quotelessJson: () => quotelessJson,
4313
+ promise: () => promiseType,
4314
+ preprocess: () => preprocessType,
4315
+ pipeline: () => pipelineType,
4316
+ ostring: () => ostring,
4317
+ optional: () => optionalType,
4318
+ onumber: () => onumber,
4319
+ oboolean: () => oboolean,
4320
+ objectUtil: () => objectUtil,
4321
+ object: () => objectType,
4322
+ number: () => numberType,
4323
+ nullable: () => nullableType,
4324
+ null: () => nullType,
4325
+ never: () => neverType,
4326
+ nativeEnum: () => nativeEnumType,
4327
+ nan: () => nanType,
4328
+ map: () => mapType,
4329
+ makeIssue: () => makeIssue,
4330
+ literal: () => literalType,
4331
+ lazy: () => lazyType,
4332
+ late: () => late,
4333
+ isValid: () => isValid,
4334
+ isDirty: () => isDirty,
4335
+ isAsync: () => isAsync,
4336
+ isAborted: () => isAborted,
4337
+ intersection: () => intersectionType,
4338
+ instanceof: () => instanceOfType,
4339
+ getParsedType: () => getParsedType,
4340
+ getErrorMap: () => getErrorMap,
4341
+ function: () => functionType,
4342
+ enum: () => enumType,
4343
+ effect: () => effectsType,
4344
+ discriminatedUnion: () => discriminatedUnionType,
4345
+ defaultErrorMap: () => en_default,
4346
+ datetimeRegex: () => datetimeRegex,
4347
+ date: () => dateType,
4348
+ custom: () => custom,
4349
+ coerce: () => coerce,
4350
+ boolean: () => booleanType,
4351
+ bigint: () => bigIntType,
4352
+ array: () => arrayType,
4353
+ any: () => anyType,
4354
+ addIssueToContext: () => addIssueToContext,
4355
+ ZodVoid: () => ZodVoid,
4356
+ ZodUnknown: () => ZodUnknown,
4357
+ ZodUnion: () => ZodUnion,
4358
+ ZodUndefined: () => ZodUndefined,
4359
+ ZodType: () => ZodType,
4360
+ ZodTuple: () => ZodTuple,
4361
+ ZodTransformer: () => ZodEffects,
4362
+ ZodSymbol: () => ZodSymbol,
4363
+ ZodString: () => ZodString,
4364
+ ZodSet: () => ZodSet,
4365
+ ZodSchema: () => ZodType,
4366
+ ZodRecord: () => ZodRecord,
4367
+ ZodReadonly: () => ZodReadonly,
4368
+ ZodPromise: () => ZodPromise,
4369
+ ZodPipeline: () => ZodPipeline,
4370
+ ZodParsedType: () => ZodParsedType,
4371
+ ZodOptional: () => ZodOptional,
4372
+ ZodObject: () => ZodObject,
4373
+ ZodNumber: () => ZodNumber,
4374
+ ZodNullable: () => ZodNullable,
4375
+ ZodNull: () => ZodNull,
4376
+ ZodNever: () => ZodNever,
4377
+ ZodNativeEnum: () => ZodNativeEnum,
4378
+ ZodNaN: () => ZodNaN,
4379
+ ZodMap: () => ZodMap,
4380
+ ZodLiteral: () => ZodLiteral,
4381
+ ZodLazy: () => ZodLazy,
4382
+ ZodIssueCode: () => ZodIssueCode,
4383
+ ZodIntersection: () => ZodIntersection,
4384
+ ZodFunction: () => ZodFunction,
4385
+ ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
4386
+ ZodError: () => ZodError,
4387
+ ZodEnum: () => ZodEnum,
4388
+ ZodEffects: () => ZodEffects,
4389
+ ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
4390
+ ZodDefault: () => ZodDefault,
4391
+ ZodDate: () => ZodDate,
4392
+ ZodCatch: () => ZodCatch,
4393
+ ZodBranded: () => ZodBranded,
4394
+ ZodBoolean: () => ZodBoolean,
4395
+ ZodBigInt: () => ZodBigInt,
4396
+ ZodArray: () => ZodArray,
4397
+ ZodAny: () => ZodAny,
4398
+ Schema: () => ZodType,
4399
+ ParseStatus: () => ParseStatus,
4400
+ OK: () => OK,
4401
+ NEVER: () => NEVER,
4402
+ INVALID: () => INVALID,
4403
+ EMPTY_PATH: () => EMPTY_PATH,
4404
+ DIRTY: () => DIRTY,
4405
+ BRAND: () => BRAND
4406
4406
  });
4407
4407
  var init_external = __esm(() => {
4408
4408
  init_errors();
@@ -4758,20 +4758,20 @@ var init_semver = __esm(() => {
4758
4758
  // src/lib/manifest.ts
4759
4759
  var exports_manifest = {};
4760
4760
  __export(exports_manifest, {
4761
- HOOK_NAME_RE: () => HOOK_NAME_RE,
4762
- ScriptContainmentError: () => ScriptContainmentError,
4763
- assertContained: () => assertContained,
4764
- customHookDir: () => customHookDir,
4765
- isInlineScript: () => isInlineScript,
4766
- listCustomHooks: () => listCustomHooks,
4767
- manifestSchema: () => manifestSchema,
4768
- normalizeManifestName: () => normalizeManifestName,
4769
- parseManifest: () => parseManifest,
4770
- readCustomManifest: () => readCustomManifest,
4771
- resolveScript: () => resolveScript,
4772
- scriptRelFor: () => scriptRelFor,
4761
+ writeCustomHook: () => writeCustomHook,
4773
4762
  shortManifestName: () => shortManifestName,
4774
- writeCustomHook: () => writeCustomHook
4763
+ scriptRelFor: () => scriptRelFor,
4764
+ resolveScript: () => resolveScript,
4765
+ readCustomManifest: () => readCustomManifest,
4766
+ parseManifest: () => parseManifest,
4767
+ normalizeManifestName: () => normalizeManifestName,
4768
+ manifestSchema: () => manifestSchema,
4769
+ listCustomHooks: () => listCustomHooks,
4770
+ isInlineScript: () => isInlineScript,
4771
+ customHookDir: () => customHookDir,
4772
+ assertContained: () => assertContained,
4773
+ ScriptContainmentError: () => ScriptContainmentError,
4774
+ HOOK_NAME_RE: () => HOOK_NAME_RE
4775
4775
  });
4776
4776
  import { existsSync as existsSync4, mkdirSync as mkdirSync3, readFileSync as readFileSync4, readdirSync as readdirSync2, realpathSync, writeFileSync as writeFileSync2 } from "fs";
4777
4777
  import { basename, dirname, isAbsolute, join as join5, normalize, resolve, sep } from "path";
@@ -4928,23 +4928,23 @@ var init_manifest = __esm(() => {
4928
4928
  // src/lib/store.ts
4929
4929
  var exports_store = {};
4930
4930
  __export(exports_store, {
4931
- LockFileError: () => LockFileError,
4932
- checkScriptHash: () => checkScriptHash,
4933
- getHookRecord: () => getHookRecord,
4934
- getPinnedHook: () => getPinnedHook,
4935
- listHookRecords: () => listHookRecords,
4936
- pinInstalledHook: () => pinInstalledHook,
4937
- readLock: () => readLock,
4938
- removeHookFromStore: () => removeHookFromStore,
4939
- removeHookRecord: () => removeHookRecord,
4940
- removePinnedHook: () => removePinnedHook,
4941
- retrustHook: () => retrustHook,
4942
- setPinnedHook: () => setPinnedHook,
4943
- sha256File: () => sha256File,
4944
- sha256Of: () => sha256Of,
4945
- upsertHookRecord: () => upsertHookRecord,
4931
+ writeLock: () => writeLock,
4946
4932
  verifyScriptHash: () => verifyScriptHash,
4947
- writeLock: () => writeLock
4933
+ upsertHookRecord: () => upsertHookRecord,
4934
+ sha256Of: () => sha256Of,
4935
+ sha256File: () => sha256File,
4936
+ setPinnedHook: () => setPinnedHook,
4937
+ retrustHook: () => retrustHook,
4938
+ removePinnedHook: () => removePinnedHook,
4939
+ removeHookRecord: () => removeHookRecord,
4940
+ removeHookFromStore: () => removeHookFromStore,
4941
+ readLock: () => readLock,
4942
+ pinInstalledHook: () => pinInstalledHook,
4943
+ listHookRecords: () => listHookRecords,
4944
+ getPinnedHook: () => getPinnedHook,
4945
+ getHookRecord: () => getHookRecord,
4946
+ checkScriptHash: () => checkScriptHash,
4947
+ LockFileError: () => LockFileError
4948
4948
  });
4949
4949
  import { createHash } from "crypto";
4950
4950
  import { existsSync as existsSync6, mkdirSync as mkdirSync4, readFileSync as readFileSync5, writeFileSync as writeFileSync3, renameSync } from "fs";
@@ -5137,15 +5137,15 @@ var init_store = __esm(() => {
5137
5137
  // src/lib/profiles.ts
5138
5138
  var exports_profiles = {};
5139
5139
  __export(exports_profiles, {
5140
- createProfile: () => createProfile,
5141
- deleteProfile: () => deleteProfile,
5142
- exportProfiles: () => exportProfiles,
5143
- getProfile: () => getProfile,
5144
- getProfilesDir: () => getProfilesDir,
5145
- importProfiles: () => importProfiles,
5146
- listProfiles: () => listProfiles,
5140
+ updateProfile: () => updateProfile,
5147
5141
  touchProfile: () => touchProfile,
5148
- updateProfile: () => updateProfile
5142
+ listProfiles: () => listProfiles,
5143
+ importProfiles: () => importProfiles,
5144
+ getProfilesDir: () => getProfilesDir,
5145
+ getProfile: () => getProfile,
5146
+ exportProfiles: () => exportProfiles,
5147
+ deleteProfile: () => deleteProfile,
5148
+ createProfile: () => createProfile
5149
5149
  });
5150
5150
  import { existsSync as existsSync8, mkdirSync as mkdirSync6, readFileSync as readFileSync7, writeFileSync as writeFileSync5, readdirSync as readdirSync3, rmSync as rmSync2, cpSync as cpSync2 } from "fs";
5151
5151
  import { join as join8 } from "path";
@@ -5434,8 +5434,8 @@ var init_hook_env = __esm(() => {
5434
5434
  // src/lib/run.ts
5435
5435
  var exports_run = {};
5436
5436
  __export(exports_run, {
5437
- HookTimeoutError: () => HookTimeoutError,
5438
- executeVerifiedScript: () => executeVerifiedScript
5437
+ executeVerifiedScript: () => executeVerifiedScript,
5438
+ HookTimeoutError: () => HookTimeoutError
5439
5439
  });
5440
5440
  import { randomBytes as randomBytes2 } from "crypto";
5441
5441
  import { rmSync as rmSync4, writeFileSync as writeFileSync6 } from "fs";
@@ -5597,10 +5597,10 @@ var init_run = __esm(() => {
5597
5597
  // src/lib/db-writer.ts
5598
5598
  var exports_db_writer = {};
5599
5599
  __export(exports_db_writer, {
5600
- normalizeEventType: () => normalizeEventType,
5601
- recordHookRun: () => recordHookRun,
5600
+ writeHookEvent: () => writeHookEvent,
5602
5601
  resolveEventType: () => resolveEventType,
5603
- writeHookEvent: () => writeHookEvent
5602
+ recordHookRun: () => recordHookRun,
5603
+ normalizeEventType: () => normalizeEventType
5604
5604
  });
5605
5605
  function nanoid2() {
5606
5606
  return crypto.randomUUID().replace(/-/g, "").slice(0, 21);
@@ -8244,102 +8244,102 @@ async function runHook(name, input, options = {}) {
8244
8244
  return { output, stderr: stderrText, exitCode };
8245
8245
  }
8246
8246
  export {
8247
- CATEGORIES,
8248
- DEFAULT_SERVE_PORT,
8249
- HOOKS,
8250
- HOOKS_STORAGE_BACKEND_ENV,
8251
- HOOKS_STORAGE_BACKEND_FALLBACK_ENV,
8252
- HOOKS_STORAGE_ENV,
8253
- HOOKS_STORAGE_FALLBACK_ENV,
8254
- HOOKS_STORAGE_TABLES,
8255
- HOOK_EVENTS,
8256
- RETIRED_STORAGE_MODE_ENV,
8257
- STORAGE_BACKENDS,
8258
- STORAGE_BACKEND_ENV,
8259
- STORAGE_DATABASE_ENV,
8260
- STORAGE_TABLES,
8261
- buildCodewithTomlFragment,
8262
- checkScriptHash,
8263
- createProfile,
8264
- deleteProfile,
8265
- exportProfiles,
8266
- fetchPinnedHook,
8267
- getConfigPath,
8268
- getCustomHooksDir,
8269
- getHook,
8270
- getHookEvents,
8271
- getHookPath,
8272
- getHookRecord,
8273
- getHooksByCategory,
8274
- getHooksDataDir,
8275
- getInstalledHooks,
8276
- getLockPath,
8277
- getPinnedHook,
8278
- getProfile,
8279
- getProfilesDir,
8280
- getRegisteredHooks,
8281
- getRegisteredHooksForTarget,
8282
- getSettingsPath,
8283
- getStorageBackend,
8284
- getStorageDatabaseEnv,
8285
- getStorageDatabaseEnvName,
8286
- getStorageDatabaseUrl,
8287
- getStoragePg,
8288
- getStorageStatus,
8289
- getSyncMetaAll,
8290
- handleServeRequest,
8291
- hookExists,
8292
- importProfiles,
8293
- installCustomSource,
8294
- installHook,
8295
- installHookForProject,
8296
- installHooks,
8297
- installHooksForProject,
8298
- isCustomSource,
8299
- isEventSupported,
8300
- listCustomHooks,
8301
- listHookRecords,
8302
- listProfiles,
8303
- listProjectHooks,
8304
- parseManifest,
8305
- parseStorageTables,
8306
- pinInstalledHook,
8307
- planSync,
8308
- provisionCloudflareResources,
8309
- readConfig,
8310
- readCustomManifest,
8311
- readLock,
8312
- removeHook,
8313
- removeHookFromStore,
8314
- removeHookRecord,
8315
- removePinnedHook,
8316
- removeProjectHook,
8317
- resolveApiKey,
8318
- resolveApiUrl,
8319
- resolveHook,
8320
- resolveHookDir,
8321
- resolveHookMeta,
8322
- resolveScript,
8323
- resolveScriptPath,
8324
- resolveTables,
8325
- retrustHook,
8326
- runHook,
8327
- runStorageMigrations,
8328
- searchHooks,
8329
- setPinnedHook,
8330
- sha256File,
8331
- sha256Of,
8332
- startServeServer,
8333
- storagePull,
8334
- storagePush,
8335
- storageSync,
8336
- syncHooks,
8337
- touchProfile,
8338
- uninstallHook,
8339
- updateProfile,
8340
- upsertHookRecord,
8341
- verifyScriptHash,
8342
- writeConfig,
8247
+ writeLock,
8343
8248
  writeCustomHook,
8344
- writeLock
8249
+ writeConfig,
8250
+ verifyScriptHash,
8251
+ upsertHookRecord,
8252
+ updateProfile,
8253
+ uninstallHook,
8254
+ touchProfile,
8255
+ syncHooks,
8256
+ storageSync,
8257
+ storagePush,
8258
+ storagePull,
8259
+ startServeServer,
8260
+ sha256Of,
8261
+ sha256File,
8262
+ setPinnedHook,
8263
+ searchHooks,
8264
+ runStorageMigrations,
8265
+ runHook,
8266
+ retrustHook,
8267
+ resolveTables,
8268
+ resolveScriptPath,
8269
+ resolveScript,
8270
+ resolveHookMeta,
8271
+ resolveHookDir,
8272
+ resolveHook,
8273
+ resolveApiUrl,
8274
+ resolveApiKey,
8275
+ removeProjectHook,
8276
+ removePinnedHook,
8277
+ removeHookRecord,
8278
+ removeHookFromStore,
8279
+ removeHook,
8280
+ readLock,
8281
+ readCustomManifest,
8282
+ readConfig,
8283
+ provisionCloudflareResources,
8284
+ planSync,
8285
+ pinInstalledHook,
8286
+ parseStorageTables,
8287
+ parseManifest,
8288
+ listProjectHooks,
8289
+ listProfiles,
8290
+ listHookRecords,
8291
+ listCustomHooks,
8292
+ isEventSupported,
8293
+ isCustomSource,
8294
+ installHooksForProject,
8295
+ installHooks,
8296
+ installHookForProject,
8297
+ installHook,
8298
+ installCustomSource,
8299
+ importProfiles,
8300
+ hookExists,
8301
+ handleServeRequest,
8302
+ getSyncMetaAll,
8303
+ getStorageStatus,
8304
+ getStoragePg,
8305
+ getStorageDatabaseUrl,
8306
+ getStorageDatabaseEnvName,
8307
+ getStorageDatabaseEnv,
8308
+ getStorageBackend,
8309
+ getSettingsPath,
8310
+ getRegisteredHooksForTarget,
8311
+ getRegisteredHooks,
8312
+ getProfilesDir,
8313
+ getProfile,
8314
+ getPinnedHook,
8315
+ getLockPath,
8316
+ getInstalledHooks,
8317
+ getHooksDataDir,
8318
+ getHooksByCategory,
8319
+ getHookRecord,
8320
+ getHookPath,
8321
+ getHookEvents,
8322
+ getHook,
8323
+ getCustomHooksDir,
8324
+ getConfigPath,
8325
+ fetchPinnedHook,
8326
+ exportProfiles,
8327
+ deleteProfile,
8328
+ createProfile,
8329
+ checkScriptHash,
8330
+ buildCodewithTomlFragment,
8331
+ STORAGE_TABLES,
8332
+ STORAGE_DATABASE_ENV,
8333
+ STORAGE_BACKEND_ENV,
8334
+ STORAGE_BACKENDS,
8335
+ RETIRED_STORAGE_MODE_ENV,
8336
+ HOOK_EVENTS,
8337
+ HOOKS_STORAGE_TABLES,
8338
+ HOOKS_STORAGE_FALLBACK_ENV,
8339
+ HOOKS_STORAGE_ENV,
8340
+ HOOKS_STORAGE_BACKEND_FALLBACK_ENV,
8341
+ HOOKS_STORAGE_BACKEND_ENV,
8342
+ HOOKS,
8343
+ DEFAULT_SERVE_PORT,
8344
+ CATEGORIES
8345
8345
  };
package/dist/storage.js CHANGED
@@ -49,7 +49,7 @@ function up(db) {
49
49
  db.exec(idx);
50
50
  }
51
51
  }
52
- var init__001_initial = __esm(() => {
52
+ var init_001_initial = __esm(() => {
53
53
  init_schema();
54
54
  });
55
55
 
@@ -78,7 +78,7 @@ function up2(db) {
78
78
  throw err;
79
79
  }
80
80
  }
81
- var init__002_session_events = __esm(() => {
81
+ var init_002_session_events = __esm(() => {
82
82
  init_schema();
83
83
  });
84
84
 
@@ -107,7 +107,7 @@ function up3(db) {
107
107
  throw err;
108
108
  }
109
109
  }
110
- var init__003_user_prompt_submit_event = __esm(() => {
110
+ var init_003_user_prompt_submit_event = __esm(() => {
111
111
  init_schema();
112
112
  });
113
113
 
@@ -131,7 +131,7 @@ var CREATE_HOOKS_TABLE = `
131
131
  last_verified_at TEXT
132
132
  )
133
133
  `, CREATE_HOOKS_INDEXES;
134
- var init__004_hooks_table = __esm(() => {
134
+ var init_004_hooks_table = __esm(() => {
135
135
  CREATE_HOOKS_INDEXES = [
136
136
  `CREATE INDEX IF NOT EXISTS idx_hooks_name ON hooks (name)`
137
137
  ];
@@ -162,7 +162,7 @@ function up5(db) {
162
162
  throw err;
163
163
  }
164
164
  }
165
- var init__005_subagent_start_event = __esm(() => {
165
+ var init_005_subagent_start_event = __esm(() => {
166
166
  init_schema();
167
167
  });
168
168
 
@@ -194,11 +194,11 @@ function runMigrations(db) {
194
194
  }
195
195
  var MIGRATIONS;
196
196
  var init_migrations = __esm(() => {
197
- init__001_initial();
198
- init__002_session_events();
199
- init__003_user_prompt_submit_event();
200
- init__004_hooks_table();
201
- init__005_subagent_start_event();
197
+ init_001_initial();
198
+ init_002_session_events();
199
+ init_003_user_prompt_submit_event();
200
+ init_004_hooks_table();
201
+ init_005_subagent_start_event();
202
202
  MIGRATIONS = [
203
203
  { version: "001_initial", up },
204
204
  { version: "002_session_events", up: up2 },
@@ -888,29 +888,29 @@ function coerceForSqlite(value) {
888
888
  return String(value);
889
889
  }
890
890
  export {
891
- HOOKS_STORAGE_BACKEND_ENV,
892
- HOOKS_STORAGE_BACKEND_FALLBACK_ENV,
893
- HOOKS_STORAGE_ENV,
894
- HOOKS_STORAGE_FALLBACK_ENV,
895
- HOOKS_STORAGE_TABLES,
896
- PG_MIGRATIONS,
897
- PgAdapterAsync,
898
- RETIRED_STORAGE_MODE_ENV,
899
- STORAGE_BACKENDS,
900
- STORAGE_BACKEND_ENV,
901
- STORAGE_DATABASE_ENV,
902
- STORAGE_TABLES,
903
- getStorageBackend,
904
- getStorageDatabaseEnv,
905
- getStorageDatabaseEnvName,
906
- getStorageDatabaseUrl,
907
- getStoragePg,
908
- getStorageStatus,
909
- getSyncMetaAll,
910
- parseStorageTables,
911
- resolveTables,
912
- runStorageMigrations,
913
- storagePull,
891
+ storageSync,
914
892
  storagePush,
915
- storageSync
893
+ storagePull,
894
+ runStorageMigrations,
895
+ resolveTables,
896
+ parseStorageTables,
897
+ getSyncMetaAll,
898
+ getStorageStatus,
899
+ getStoragePg,
900
+ getStorageDatabaseUrl,
901
+ getStorageDatabaseEnvName,
902
+ getStorageDatabaseEnv,
903
+ getStorageBackend,
904
+ STORAGE_TABLES,
905
+ STORAGE_DATABASE_ENV,
906
+ STORAGE_BACKEND_ENV,
907
+ STORAGE_BACKENDS,
908
+ RETIRED_STORAGE_MODE_ENV,
909
+ PgAdapterAsync,
910
+ PG_MIGRATIONS,
911
+ HOOKS_STORAGE_TABLES,
912
+ HOOKS_STORAGE_FALLBACK_ENV,
913
+ HOOKS_STORAGE_ENV,
914
+ HOOKS_STORAGE_BACKEND_FALLBACK_ENV,
915
+ HOOKS_STORAGE_BACKEND_ENV
916
916
  };