@skillsmith/core 0.4.16 → 0.5.0
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/CHANGELOG.md +34 -0
- package/README.md +57 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/src/api/client.d.ts +21 -21
- package/dist/src/api/client.d.ts.map +1 -1
- package/dist/src/api/client.events.d.ts +39 -0
- package/dist/src/api/client.events.d.ts.map +1 -0
- package/dist/src/api/client.events.js +77 -0
- package/dist/src/api/client.events.js.map +1 -0
- package/dist/src/api/client.js +39 -33
- package/dist/src/api/client.js.map +1 -1
- package/dist/src/api/event-batcher.d.ts +81 -0
- package/dist/src/api/event-batcher.d.ts.map +1 -0
- package/dist/src/api/event-batcher.js +191 -0
- package/dist/src/api/event-batcher.js.map +1 -0
- package/dist/src/api/index.d.ts +1 -0
- package/dist/src/api/index.d.ts.map +1 -1
- package/dist/src/api/index.js +2 -0
- package/dist/src/api/index.js.map +1 -1
- package/dist/src/api/schemas.d.ts +62 -4
- package/dist/src/api/schemas.d.ts.map +1 -1
- package/dist/src/api/schemas.js +45 -0
- package/dist/src/api/schemas.js.map +1 -1
- package/dist/src/db/migration-runner.d.ts +44 -0
- package/dist/src/db/migration-runner.d.ts.map +1 -0
- package/dist/src/db/migration-runner.js +175 -0
- package/dist/src/db/migration-runner.js.map +1 -0
- package/dist/src/db/migration.d.ts.map +1 -1
- package/dist/src/db/migration.js +2 -1
- package/dist/src/db/migration.js.map +1 -1
- package/dist/src/db/migrations/v12-risk-score-history.d.ts +10 -0
- package/dist/src/db/migrations/v12-risk-score-history.d.ts.map +1 -0
- package/dist/src/db/migrations/v12-risk-score-history.js +25 -0
- package/dist/src/db/migrations/v12-risk-score-history.js.map +1 -0
- package/dist/src/db/migrations/v13-team-tables.d.ts +11 -0
- package/dist/src/db/migrations/v13-team-tables.d.ts.map +1 -0
- package/dist/src/db/migrations/v13-team-tables.js +14 -0
- package/dist/src/db/migrations/v13-team-tables.js.map +1 -0
- package/dist/src/db/schema-sql.d.ts +16 -0
- package/dist/src/db/schema-sql.d.ts.map +1 -0
- package/dist/src/db/schema-sql.js +161 -0
- package/dist/src/db/schema-sql.js.map +1 -0
- package/dist/src/db/schema.d.ts +7 -32
- package/dist/src/db/schema.d.ts.map +1 -1
- package/dist/src/db/schema.js +14 -298
- package/dist/src/db/schema.js.map +1 -1
- package/dist/src/embeddings/hnsw-store.d.ts +1 -1
- package/dist/src/embeddings/hnsw-store.d.ts.map +1 -1
- package/dist/src/embeddings/hnsw-store.js +4 -34
- package/dist/src/embeddings/hnsw-store.js.map +1 -1
- package/dist/src/embeddings/hnsw-store.types.d.ts +18 -0
- package/dist/src/embeddings/hnsw-store.types.d.ts.map +1 -1
- package/dist/src/embeddings/hnsw-store.types.js.map +1 -1
- package/dist/src/exports/repositories.d.ts +1 -0
- package/dist/src/exports/repositories.d.ts.map +1 -1
- package/dist/src/exports/repositories.js +4 -0
- package/dist/src/exports/repositories.js.map +1 -1
- package/dist/src/exports/services.d.ts +4 -0
- package/dist/src/exports/services.d.ts.map +1 -1
- package/dist/src/exports/services.js +7 -0
- package/dist/src/exports/services.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/learning/PatternStore.d.ts.map +1 -1
- package/dist/src/learning/PatternStore.js +2 -9
- package/dist/src/learning/PatternStore.js.map +1 -1
- package/dist/src/repositories/RiskScoreHistoryRepository.d.ts +37 -0
- package/dist/src/repositories/RiskScoreHistoryRepository.d.ts.map +1 -0
- package/dist/src/repositories/RiskScoreHistoryRepository.js +66 -0
- package/dist/src/repositories/RiskScoreHistoryRepository.js.map +1 -0
- package/dist/src/routing/SONARouter.d.ts.map +1 -1
- package/dist/src/routing/SONARouter.js +4 -15
- package/dist/src/routing/SONARouter.js.map +1 -1
- package/dist/src/scoring/index.d.ts +1 -0
- package/dist/src/scoring/index.d.ts.map +1 -1
- package/dist/src/scoring/index.js +1 -0
- package/dist/src/scoring/index.js.map +1 -1
- package/dist/src/scoring/quality-score.d.ts +49 -0
- package/dist/src/scoring/quality-score.d.ts.map +1 -0
- package/dist/src/scoring/quality-score.js +73 -0
- package/dist/src/scoring/quality-score.js.map +1 -0
- package/dist/src/scripts/__tests__/scan-imported-skills.test.js +10 -0
- package/dist/src/scripts/__tests__/scan-imported-skills.test.js.map +1 -1
- package/dist/src/scripts/validation/types.d.ts +2 -2
- package/dist/src/security/index.d.ts +2 -0
- package/dist/src/security/index.d.ts.map +1 -1
- package/dist/src/security/index.js +2 -0
- package/dist/src/security/index.js.map +1 -1
- package/dist/src/security/risk-trend.d.ts +21 -0
- package/dist/src/security/risk-trend.d.ts.map +1 -0
- package/dist/src/security/risk-trend.js +81 -0
- package/dist/src/security/risk-trend.js.map +1 -0
- package/dist/src/security/scanner/SecurityScanner.d.ts +6 -2
- package/dist/src/security/scanner/SecurityScanner.d.ts.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.helpers.d.ts +24 -2
- package/dist/src/security/scanner/SecurityScanner.helpers.d.ts.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.helpers.js +111 -9
- package/dist/src/security/scanner/SecurityScanner.helpers.js.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.js +64 -71
- package/dist/src/security/scanner/SecurityScanner.js.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.ssrf.d.ts +15 -0
- package/dist/src/security/scanner/SecurityScanner.ssrf.d.ts.map +1 -0
- package/dist/src/security/scanner/SecurityScanner.ssrf.js +76 -0
- package/dist/src/security/scanner/SecurityScanner.ssrf.js.map +1 -0
- package/dist/src/security/scanner/index.d.ts +1 -1
- package/dist/src/security/scanner/index.d.ts.map +1 -1
- package/dist/src/security/scanner/index.js +1 -1
- package/dist/src/security/scanner/index.js.map +1 -1
- package/dist/src/security/scanner/patterns.d.ts +12 -0
- package/dist/src/security/scanner/patterns.d.ts.map +1 -1
- package/dist/src/security/scanner/patterns.js +57 -0
- package/dist/src/security/scanner/patterns.js.map +1 -1
- package/dist/src/security/scanner/types.d.ts +3 -1
- package/dist/src/security/scanner/types.d.ts.map +1 -1
- package/dist/src/security/scanner/weights.d.ts.map +1 -1
- package/dist/src/security/scanner/weights.js +2 -0
- package/dist/src/security/scanner/weights.js.map +1 -1
- package/dist/src/services/skill-config-schema.d.ts +36 -0
- package/dist/src/services/skill-config-schema.d.ts.map +1 -0
- package/dist/src/services/skill-config-schema.js +76 -0
- package/dist/src/services/skill-config-schema.js.map +1 -0
- package/dist/src/services/skill-installation.feedback.d.ts +24 -0
- package/dist/src/services/skill-installation.feedback.d.ts.map +1 -0
- package/dist/src/services/skill-installation.feedback.js +37 -0
- package/dist/src/services/skill-installation.feedback.js.map +1 -0
- package/dist/src/services/skill-installation.helpers.d.ts +88 -0
- package/dist/src/services/skill-installation.helpers.d.ts.map +1 -0
- package/dist/src/services/skill-installation.helpers.js +377 -0
- package/dist/src/services/skill-installation.helpers.js.map +1 -0
- package/dist/src/services/skill-installation.service.d.ts +37 -0
- package/dist/src/services/skill-installation.service.d.ts.map +1 -0
- package/dist/src/services/skill-installation.service.js +432 -0
- package/dist/src/services/skill-installation.service.js.map +1 -0
- package/dist/src/services/skill-installation.types.d.ts +166 -0
- package/dist/src/services/skill-installation.types.d.ts.map +1 -0
- package/dist/src/services/skill-installation.types.js +38 -0
- package/dist/src/services/skill-installation.types.js.map +1 -0
- package/dist/src/services/skill-manifest.d.ts +20 -0
- package/dist/src/services/skill-manifest.d.ts.map +1 -0
- package/dist/src/services/skill-manifest.js +84 -0
- package/dist/src/services/skill-manifest.js.map +1 -0
- package/dist/src/session/SessionManager.helpers.d.ts +1 -27
- package/dist/src/session/SessionManager.helpers.d.ts.map +1 -1
- package/dist/src/session/SessionManager.helpers.js +0 -64
- package/dist/src/session/SessionManager.helpers.js.map +1 -1
- package/dist/src/session/SessionManager.memory.d.ts +12 -11
- package/dist/src/session/SessionManager.memory.d.ts.map +1 -1
- package/dist/src/session/SessionManager.memory.js +23 -115
- package/dist/src/session/SessionManager.memory.js.map +1 -1
- package/dist/src/session/SessionManager.types.d.ts +0 -37
- package/dist/src/session/SessionManager.types.d.ts.map +1 -1
- package/dist/src/session/SessionManager.types.js.map +1 -1
- package/dist/src/session/SessionRecovery.js +4 -4
- package/dist/src/session/SessionRecovery.js.map +1 -1
- package/dist/src/testing/MultiLLMProvider.d.ts.map +1 -1
- package/dist/src/testing/MultiLLMProvider.js +5 -19
- package/dist/src/testing/MultiLLMProvider.js.map +1 -1
- package/dist/src/types.d.ts +2 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tests/SecurityScanner.ai-defence.test.d.ts +6 -0
- package/dist/tests/SecurityScanner.ai-defence.test.d.ts.map +1 -0
- package/dist/tests/SecurityScanner.ai-defence.test.js +221 -0
- package/dist/tests/SecurityScanner.ai-defence.test.js.map +1 -0
- package/dist/tests/SecurityScanner.performance.test.d.ts +6 -0
- package/dist/tests/SecurityScanner.performance.test.d.ts.map +1 -0
- package/dist/tests/SecurityScanner.performance.test.js +132 -0
- package/dist/tests/SecurityScanner.performance.test.js.map +1 -0
- package/dist/tests/SecurityScanner.scoring.test.d.ts +6 -0
- package/dist/tests/SecurityScanner.scoring.test.d.ts.map +1 -0
- package/dist/tests/SecurityScanner.scoring.test.js +197 -0
- package/dist/tests/SecurityScanner.scoring.test.js.map +1 -0
- package/dist/tests/SecurityScanner.test.d.ts +2 -2
- package/dist/tests/SecurityScanner.test.js +2 -520
- package/dist/tests/SecurityScanner.test.js.map +1 -1
- package/dist/tests/SkillMatcher.test.js +5 -5
- package/dist/tests/SkillMatcher.test.js.map +1 -1
- package/dist/tests/billing/StripeClient.test.d.ts +18 -0
- package/dist/tests/billing/StripeClient.test.d.ts.map +1 -0
- package/dist/tests/billing/StripeClient.test.js +566 -0
- package/dist/tests/billing/StripeClient.test.js.map +1 -0
- package/dist/tests/billing/StripeWebhookHandler.test.d.ts +16 -0
- package/dist/tests/billing/StripeWebhookHandler.test.d.ts.map +1 -0
- package/dist/tests/billing/StripeWebhookHandler.test.js +240 -0
- package/dist/tests/billing/StripeWebhookHandler.test.js.map +1 -0
- package/dist/tests/billing/stripe-helpers.test.d.ts +7 -0
- package/dist/tests/billing/stripe-helpers.test.d.ts.map +1 -0
- package/dist/tests/billing/stripe-helpers.test.js +91 -0
- package/dist/tests/billing/stripe-helpers.test.js.map +1 -0
- package/dist/tests/billing/webhook-handlers.test.d.ts +16 -0
- package/dist/tests/billing/webhook-handlers.test.d.ts.map +1 -0
- package/dist/tests/billing/webhook-handlers.test.js +519 -0
- package/dist/tests/billing/webhook-handlers.test.js.map +1 -0
- package/dist/tests/db/migration.test.d.ts +11 -0
- package/dist/tests/db/migration.test.d.ts.map +1 -0
- package/dist/tests/db/migration.test.js +265 -0
- package/dist/tests/db/migration.test.js.map +1 -0
- package/dist/tests/db/schema-migrations.test.js +8 -6
- package/dist/tests/db/schema-migrations.test.js.map +1 -1
- package/dist/tests/integration/events-batch-contract.test.d.ts +12 -0
- package/dist/tests/integration/events-batch-contract.test.d.ts.map +1 -0
- package/dist/tests/integration/events-batch-contract.test.js +69 -0
- package/dist/tests/integration/events-batch-contract.test.js.map +1 -0
- package/dist/tests/scoring/quality-score.test.d.ts +7 -0
- package/dist/tests/scoring/quality-score.test.d.ts.map +1 -0
- package/dist/tests/scoring/quality-score.test.js +78 -0
- package/dist/tests/scoring/quality-score.test.js.map +1 -0
- package/dist/tests/security/ContinuousSecurity.false-positives.test.d.ts +6 -0
- package/dist/tests/security/ContinuousSecurity.false-positives.test.d.ts.map +1 -0
- package/dist/tests/security/ContinuousSecurity.false-positives.test.js +89 -0
- package/dist/tests/security/ContinuousSecurity.false-positives.test.js.map +1 -0
- package/dist/tests/security/ContinuousSecurity.performance.test.d.ts +6 -0
- package/dist/tests/security/ContinuousSecurity.performance.test.d.ts.map +1 -0
- package/dist/tests/security/ContinuousSecurity.performance.test.js +177 -0
- package/dist/tests/security/ContinuousSecurity.performance.test.js.map +1 -0
- package/dist/tests/security/ContinuousSecurity.reporting.test.d.ts +6 -0
- package/dist/tests/security/ContinuousSecurity.reporting.test.d.ts.map +1 -0
- package/dist/tests/security/ContinuousSecurity.reporting.test.js +106 -0
- package/dist/tests/security/ContinuousSecurity.reporting.test.js.map +1 -0
- package/dist/tests/security/ContinuousSecurity.test.d.ts +9 -2
- package/dist/tests/security/ContinuousSecurity.test.d.ts.map +1 -1
- package/dist/tests/security/ContinuousSecurity.test.js +9 -336
- package/dist/tests/security/ContinuousSecurity.test.js.map +1 -1
- package/dist/tests/security/pii-detection.test.d.ts +7 -0
- package/dist/tests/security/pii-detection.test.d.ts.map +1 -0
- package/dist/tests/security/pii-detection.test.js +91 -0
- package/dist/tests/security/pii-detection.test.js.map +1 -0
- package/dist/tests/security/risk-trend.test.d.ts +6 -0
- package/dist/tests/security/risk-trend.test.d.ts.map +1 -0
- package/dist/tests/security/risk-trend.test.js +68 -0
- package/dist/tests/security/risk-trend.test.js.map +1 -0
- package/dist/tests/security/scanner-regression-guard.test.d.ts +12 -0
- package/dist/tests/security/scanner-regression-guard.test.d.ts.map +1 -0
- package/dist/tests/security/scanner-regression-guard.test.js +111 -0
- package/dist/tests/security/scanner-regression-guard.test.js.map +1 -0
- package/dist/tests/security.test.js +200 -0
- package/dist/tests/security.test.js.map +1 -1
- package/dist/tests/services/aidefence-feedback.test.d.ts +6 -0
- package/dist/tests/services/aidefence-feedback.test.d.ts.map +1 -0
- package/dist/tests/services/aidefence-feedback.test.js +115 -0
- package/dist/tests/services/aidefence-feedback.test.js.map +1 -0
- package/dist/tests/services/dep-quarantine-check.test.d.ts +5 -0
- package/dist/tests/services/dep-quarantine-check.test.d.ts.map +1 -0
- package/dist/tests/services/dep-quarantine-check.test.js +92 -0
- package/dist/tests/services/dep-quarantine-check.test.js.map +1 -0
- package/dist/tests/services/skill-config-schema.test.d.ts +5 -0
- package/dist/tests/services/skill-config-schema.test.d.ts.map +1 -0
- package/dist/tests/services/skill-config-schema.test.js +98 -0
- package/dist/tests/services/skill-config-schema.test.js.map +1 -0
- package/dist/tests/session/SessionManager.helpers.test.js +1 -9
- package/dist/tests/session/SessionManager.helpers.test.js.map +1 -1
- package/dist/tests/session/SessionManager.memory.test.d.ts +3 -4
- package/dist/tests/session/SessionManager.memory.test.d.ts.map +1 -1
- package/dist/tests/session/SessionManager.memory.test.js +41 -123
- package/dist/tests/session/SessionManager.memory.test.js.map +1 -1
- package/dist/tests/sync/BackgroundSyncService.test.d.ts +13 -0
- package/dist/tests/sync/BackgroundSyncService.test.d.ts.map +1 -0
- package/dist/tests/sync/BackgroundSyncService.test.js +259 -0
- package/dist/tests/sync/BackgroundSyncService.test.js.map +1 -0
- package/dist/tests/testkit.d.ts +14 -0
- package/dist/tests/testkit.d.ts.map +1 -0
- package/dist/tests/testkit.js +14 -0
- package/dist/tests/testkit.js.map +1 -0
- package/dist/tests/unit/api-client-events.test.d.ts +10 -0
- package/dist/tests/unit/api-client-events.test.d.ts.map +1 -0
- package/dist/tests/unit/api-client-events.test.js +73 -0
- package/dist/tests/unit/api-client-events.test.js.map +1 -0
- package/dist/tests/unit/event-batcher.test.d.ts +13 -0
- package/dist/tests/unit/event-batcher.test.d.ts.map +1 -0
- package/dist/tests/unit/event-batcher.test.js +155 -0
- package/dist/tests/unit/event-batcher.test.js.map +1 -0
- package/dist/tests/unit/migrations/v10-dependencies.test.js +3 -3
- package/dist/tests/unit/migrations/v10-dependencies.test.js.map +1 -1
- package/dist/tests/unit/services/skill-installation-extended.test.d.ts +8 -0
- package/dist/tests/unit/services/skill-installation-extended.test.d.ts.map +1 -0
- package/dist/tests/unit/services/skill-installation-extended.test.js +423 -0
- package/dist/tests/unit/services/skill-installation-extended.test.js.map +1 -0
- package/dist/tests/unit/services/skill-installation.service.test.d.ts +8 -0
- package/dist/tests/unit/services/skill-installation.service.test.d.ts.map +1 -0
- package/dist/tests/unit/services/skill-installation.service.test.js +342 -0
- package/dist/tests/unit/services/skill-installation.service.test.js.map +1 -0
- package/package.json +22 -10
- package/dist/vitest.config.d.ts +0 -3
- package/dist/vitest.config.d.ts.map +0 -1
- package/dist/vitest.config.js +0 -13
- package/dist/vitest.config.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-installation.types.js","sourceRoot":"","sources":["../../../src/services/skill-installation.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAkMH,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E,iDAAiD;AACjD,MAAM,CAAC,MAAM,0BAA0B,GAAsC;IAC3E,QAAQ,EAAE;QACR,aAAa,EAAE,EAAE;QACjB,gBAAgB,EAAE,SAAS;KAC5B;IACD,OAAO,EAAE;QACP,aAAa,EAAE,EAAE;QACjB,gBAAgB,EAAE,SAAS;KAC5B;IACD,SAAS,EAAE;QACT,aAAa,EAAE,EAAE;QACjB,gBAAgB,EAAE,SAAS;KAC5B;IACD,KAAK,EAAE;QACL,aAAa,EAAE,GAAG;QAClB,gBAAgB,EAAE,UAAU;KAC7B;IACD,YAAY,EAAE;QACZ,aAAa,EAAE,EAAE;QACjB,gBAAgB,EAAE,OAAO;KAC1B;IACD,OAAO,EAAE;QACP,aAAa,EAAE,EAAE;QACjB,gBAAgB,EAAE,OAAO;KAC1B;CACF,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Manifest manager for skill installation tracking
|
|
3
|
+
* @module @skillsmith/core/services/skill-manifest
|
|
4
|
+
* @see SMI-3483: Extracted from skill-installation.service.ts to meet 500-line standard
|
|
5
|
+
*/
|
|
6
|
+
import type { SkillManifest } from './skill-installation.types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Manages the skill manifest file (~/.skillsmith/manifest.json) with
|
|
9
|
+
* file-level locking for concurrent access safety (CLI + MCP server).
|
|
10
|
+
*/
|
|
11
|
+
export declare class ManifestManager {
|
|
12
|
+
private readonly manifestPath;
|
|
13
|
+
constructor(manifestPath: string);
|
|
14
|
+
load(): Promise<SkillManifest>;
|
|
15
|
+
save(manifest: SkillManifest): Promise<void>;
|
|
16
|
+
acquireLock(): Promise<void>;
|
|
17
|
+
releaseLock(): Promise<void>;
|
|
18
|
+
updateSafely(updateFn: (manifest: SkillManifest) => SkillManifest): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=skill-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-manifest.d.ts","sourceRoot":"","sources":["../../../src/services/skill-manifest.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAKlE;;;GAGG;AACH,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAAZ,YAAY,EAAE,MAAM;IAE3C,IAAI,IAAI,OAAO,CAAC,aAAa,CAAC;IAS9B,IAAI,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAO5C,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IA+B5B,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ5B,YAAY,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;CAUxF"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Manifest manager for skill installation tracking
|
|
3
|
+
* @module @skillsmith/core/services/skill-manifest
|
|
4
|
+
* @see SMI-3483: Extracted from skill-installation.service.ts to meet 500-line standard
|
|
5
|
+
*/
|
|
6
|
+
import * as fs from 'fs/promises';
|
|
7
|
+
import * as path from 'path';
|
|
8
|
+
const MANIFEST_LOCK_TIMEOUT_MS = 30000;
|
|
9
|
+
const MANIFEST_LOCK_RETRY_MS = 100;
|
|
10
|
+
/**
|
|
11
|
+
* Manages the skill manifest file (~/.skillsmith/manifest.json) with
|
|
12
|
+
* file-level locking for concurrent access safety (CLI + MCP server).
|
|
13
|
+
*/
|
|
14
|
+
export class ManifestManager {
|
|
15
|
+
manifestPath;
|
|
16
|
+
constructor(manifestPath) {
|
|
17
|
+
this.manifestPath = manifestPath;
|
|
18
|
+
}
|
|
19
|
+
async load() {
|
|
20
|
+
try {
|
|
21
|
+
const content = await fs.readFile(this.manifestPath, 'utf-8');
|
|
22
|
+
return JSON.parse(content);
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return { version: '1.0.0', installedSkills: {} };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
async save(manifest) {
|
|
29
|
+
await fs.mkdir(path.dirname(this.manifestPath), { recursive: true });
|
|
30
|
+
const tempPath = this.manifestPath + '.tmp.' + process.pid;
|
|
31
|
+
await fs.writeFile(tempPath, JSON.stringify(manifest, null, 2));
|
|
32
|
+
await fs.rename(tempPath, this.manifestPath);
|
|
33
|
+
}
|
|
34
|
+
async acquireLock() {
|
|
35
|
+
const lockPath = this.manifestPath + '.lock';
|
|
36
|
+
const startTime = Date.now();
|
|
37
|
+
await fs.mkdir(path.dirname(this.manifestPath), { recursive: true });
|
|
38
|
+
while (Date.now() - startTime < MANIFEST_LOCK_TIMEOUT_MS) {
|
|
39
|
+
try {
|
|
40
|
+
await fs.writeFile(lockPath, String(process.pid), { flag: 'wx' });
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
if (error.code === 'EEXIST') {
|
|
45
|
+
try {
|
|
46
|
+
const stats = await fs.stat(lockPath);
|
|
47
|
+
if (Date.now() - stats.mtimeMs > MANIFEST_LOCK_TIMEOUT_MS) {
|
|
48
|
+
await fs.unlink(lockPath).catch(() => { });
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
await new Promise((resolve) => setTimeout(resolve, MANIFEST_LOCK_RETRY_MS));
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
throw error;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
throw new Error('Failed to acquire manifest lock after ' + MANIFEST_LOCK_TIMEOUT_MS + 'ms');
|
|
63
|
+
}
|
|
64
|
+
async releaseLock() {
|
|
65
|
+
try {
|
|
66
|
+
await fs.unlink(this.manifestPath + '.lock');
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
// Ignore — lock may have been cleaned up by timeout
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async updateSafely(updateFn) {
|
|
73
|
+
await this.acquireLock();
|
|
74
|
+
try {
|
|
75
|
+
const manifest = await this.load();
|
|
76
|
+
const updated = updateFn(manifest);
|
|
77
|
+
await this.save(updated);
|
|
78
|
+
}
|
|
79
|
+
finally {
|
|
80
|
+
await this.releaseLock();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=skill-manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-manifest.js","sourceRoot":"","sources":["../../../src/services/skill-manifest.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAI5B,MAAM,wBAAwB,GAAG,KAAK,CAAA;AACtC,MAAM,sBAAsB,GAAG,GAAG,CAAA;AAElC;;;GAGG;AACH,MAAM,OAAO,eAAe;IACG;IAA7B,YAA6B,YAAoB;QAApB,iBAAY,GAAZ,YAAY,CAAQ;IAAG,CAAC;IAErD,KAAK,CAAC,IAAI;QACR,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;YAC7D,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAC5B,CAAC;QAAC,MAAM,CAAC;YACP,OAA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ager.helpers
|
|
4
4
|
*/
|
|
5
|
-
import type {
|
|
6
|
-
/**
|
|
7
|
-
* Lazily load claude-flow memory module
|
|
8
|
-
* Returns undefined if claude-flow is not installed
|
|
9
|
-
*
|
|
10
|
-
* Uses string concatenation for the import path to prevent Node.js
|
|
11
|
-
* ESM static analysis from resolving the module at parse time.
|
|
12
|
-
*/
|
|
13
|
-
export declare function getClaudeFlowMemory(): Promise<ClaudeFlowMemoryModule | undefined>;
|
|
14
|
-
/**
|
|
15
|
-
* Lazily load claude-flow MCP module
|
|
16
|
-
* Returns undefined if claude-flow is not installed
|
|
17
|
-
*
|
|
18
|
-
* Uses string concatenation for the import path to prevent Node.js
|
|
19
|
-
* ESM static analysis from resolving the module at parse time.
|
|
20
|
-
*/
|
|
21
|
-
export declare function getClaudeFlowMcp(): Promise<ClaudeFlowMcpModule | undefined>;
|
|
5
|
+
import type { CommandExecutor } from './SessionManager.types.js';
|
|
22
6
|
/**
|
|
23
7
|
* Memory key patterns for session storage
|
|
24
8
|
*/
|
|
@@ -27,16 +11,6 @@ export declare const MEMORY_KEYS: {
|
|
|
27
11
|
readonly SESSION_PREFIX: "session/";
|
|
28
12
|
readonly CHECKPOINT_PREFIX: "checkpoint/";
|
|
29
13
|
};
|
|
30
|
-
/**
|
|
31
|
-
* SMI-1518: Feature flag to enable V3 direct API
|
|
32
|
-
* Set CLAUDE_FLOW_USE_V3_API=true to use direct API calls
|
|
33
|
-
* Falls back to spawn-based CLI if not set or if V3 API fails
|
|
34
|
-
*/
|
|
35
|
-
export declare const USE_V3_API: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Default namespace for session memory entries
|
|
38
|
-
*/
|
|
39
|
-
export declare const MEMORY_NAMESPACE = "skillsmith-sessions";
|
|
40
14
|
/**
|
|
41
15
|
* Validates a memory key to prevent injection attacks
|
|
42
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionManager.helpers.d.ts","sourceRoot":"","sources":["../../../src/session/SessionManager.helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"SessionManager.helpers.d.ts","sourceRoot":"","sources":["../../../src/session/SessionManager.helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAMhE;;GAEG;AACH,eAAO,MAAM,WAAW;;;;CAId,CAAA;AAYV;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEtD;AAMD;;;GAGG;AACH,qBAAa,sBAAuB,YAAW,eAAe;IAC5D;;OAEG;IACG,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAK3E;;OAEG;IACG,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAiC5F;;OAEG;YACW,gBAAgB;CAO/B"}
|
|
@@ -4,60 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { spawn } from 'node:child_process';
|
|
6
6
|
// ============================================================================
|
|
7
|
-
// Module Loading State
|
|
8
|
-
// ============================================================================
|
|
9
|
-
// Use symbol to distinguish "not yet attempted" from "attempted but failed (undefined)"
|
|
10
|
-
const NOT_LOADED = Symbol('not-loaded');
|
|
11
|
-
let claudeFlowMemory = NOT_LOADED;
|
|
12
|
-
let claudeFlowMcp = NOT_LOADED;
|
|
13
|
-
// Module paths are constructed dynamically to prevent ESM static analysis
|
|
14
|
-
const CLAUDE_FLOW_BASE = 'claude-flow';
|
|
15
|
-
const MEMORY_MODULE_PATH = '/v3/@claude-flow/cli/dist/src/memory/memory-initializer.js';
|
|
16
|
-
const MCP_MODULE_PATH = '/v3/@claude-flow/cli/dist/src/mcp-client.js';
|
|
17
|
-
// ============================================================================
|
|
18
|
-
// Dynamic Module Loaders
|
|
19
|
-
// ============================================================================
|
|
20
|
-
/**
|
|
21
|
-
* Lazily load claude-flow memory module
|
|
22
|
-
* Returns undefined if claude-flow is not installed
|
|
23
|
-
*
|
|
24
|
-
* Uses string concatenation for the import path to prevent Node.js
|
|
25
|
-
* ESM static analysis from resolving the module at parse time.
|
|
26
|
-
*/
|
|
27
|
-
export async function getClaudeFlowMemory() {
|
|
28
|
-
if (claudeFlowMemory === NOT_LOADED) {
|
|
29
|
-
try {
|
|
30
|
-
// String concatenation prevents static analysis
|
|
31
|
-
const modulePath = CLAUDE_FLOW_BASE + MEMORY_MODULE_PATH;
|
|
32
|
-
claudeFlowMemory = await import(/* webpackIgnore: true */ modulePath);
|
|
33
|
-
}
|
|
34
|
-
catch {
|
|
35
|
-
claudeFlowMemory = undefined; // Mark as attempted but failed
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return claudeFlowMemory === NOT_LOADED ? undefined : claudeFlowMemory;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Lazily load claude-flow MCP module
|
|
42
|
-
* Returns undefined if claude-flow is not installed
|
|
43
|
-
*
|
|
44
|
-
* Uses string concatenation for the import path to prevent Node.js
|
|
45
|
-
* ESM static analysis from resolving the module at parse time.
|
|
46
|
-
*/
|
|
47
|
-
export async function getClaudeFlowMcp() {
|
|
48
|
-
if (claudeFlowMcp === NOT_LOADED) {
|
|
49
|
-
try {
|
|
50
|
-
// String concatenation prevents static analysis
|
|
51
|
-
const modulePath = CLAUDE_FLOW_BASE + MCP_MODULE_PATH;
|
|
52
|
-
claudeFlowMcp = await import(/* webpackIgnore: true */ modulePath);
|
|
53
|
-
}
|
|
54
|
-
catch {
|
|
55
|
-
claudeFlowMcp = undefined; // Mark as attempted but failed
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return claudeFlowMcp === NOT_LOADED ? undefined : claudeFlowMcp;
|
|
59
|
-
}
|
|
60
|
-
// ============================================================================
|
|
61
7
|
// Constants
|
|
62
8
|
// ============================================================================
|
|
63
9
|
/**
|
|
@@ -68,16 +14,6 @@ export const MEMORY_KEYS = {
|
|
|
68
14
|
SESSION_PREFIX: 'session/',
|
|
69
15
|
CHECKPOINT_PREFIX: 'checkpoint/',
|
|
70
16
|
};
|
|
71
|
-
/**
|
|
72
|
-
* SMI-1518: Feature flag to enable V3 direct API
|
|
73
|
-
* Set CLAUDE_FLOW_USE_V3_API=true to use direct API calls
|
|
74
|
-
* Falls back to spawn-based CLI if not set or if V3 API fails
|
|
75
|
-
*/
|
|
76
|
-
export const USE_V3_API = process.env.CLAUDE_FLOW_USE_V3_API === 'true';
|
|
77
|
-
/**
|
|
78
|
-
* Default namespace for session memory entries
|
|
79
|
-
*/
|
|
80
|
-
export const MEMORY_NAMESPACE = 'skillsmith-sessions';
|
|
81
17
|
// ============================================================================
|
|
82
18
|
// Validation
|
|
83
19
|
// ============================================================================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionManager.helpers.js","sourceRoot":"","sources":["../../../src/session/SessionManager.helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"SessionManager.helpers.js","sourceRoot":"","sources":["../../../src/session/SessionManager.helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAG1C,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,OAAO,EAAE,iBAAiB;IAC1B,cAAc,EAAE,UAAU;IAC1B,iBAAiB,EAAE,aAAa;CACxB,CAAA;AAEV,+EAA+E;AAC/E,aAAa;AACb,+EAA+E;AAE/E;;;GAGG;AAC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AE,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;gBAC3D,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,4BAA4B,IAAI,EAAE,CAAC,CAAC,CAAA;gBACjE,CAAC;YACH,CAAC,CAAC,CAAA;YAEF,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;gBACvB,MAAM,CAAC,GAAG,CAAC,CAAA;YACb,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,gBAAgB,CAAC,OAAe;QAC5C,2BAA2B;QAC3B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAChC,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QAC3B,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;IACrC,CAAC;CACF"}
|
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
* @fileoverview Session Manager Memory and Hook Operations
|
|
3
3
|
* @module @skillsmith/core/session/SessionManager.memory
|
|
4
4
|
* @see SMI-641: Session ID Storage in Claude-Flow Memory
|
|
5
|
-
* @see SMI-1518: V3 API Migration
|
|
6
5
|
* @see SMI-2741: Split from SessionManager.ts to meet 500-line standard
|
|
6
|
+
* @see SMI-3600: Remove dead V3 dynamic imports (claude-flow → ruflo rename)
|
|
7
|
+
* @see SMI-3601: Migrate npx claude-flow CLI calls to npx ruflo
|
|
7
8
|
*
|
|
8
|
-
* Standalone functions for
|
|
9
|
+
* Standalone functions for ruflo memory storage, retrieval, deletion,
|
|
9
10
|
* and hook invocation. Extracted to keep SessionManager.ts within the
|
|
10
|
-
* 500-line limit
|
|
11
|
+
* 500-line limit.
|
|
11
12
|
*/
|
|
12
13
|
import type { CommandExecutor, MemoryResult } from './SessionManager.types.js';
|
|
13
14
|
/**
|
|
14
|
-
* Store data in
|
|
15
|
+
* Store data in ruflo memory
|
|
15
16
|
*
|
|
16
17
|
* SMI-674: Uses spawn() with argument array to prevent command injection
|
|
17
|
-
* SMI-
|
|
18
|
+
* SMI-3601: Migrated from claude-flow to ruflo
|
|
18
19
|
*
|
|
19
20
|
* @param key - Memory key
|
|
20
21
|
* @param value - Value to store
|
|
@@ -23,10 +24,10 @@ import type { CommandExecutor, MemoryResult } from './SessionManager.types.js';
|
|
|
23
24
|
*/
|
|
24
25
|
export declare function storeMemoryEntry(key: string, value: string, executor: CommandExecutor): Promise<MemoryResult>;
|
|
25
26
|
/**
|
|
26
|
-
* Retrieve data from
|
|
27
|
+
* Retrieve data from ruflo memory
|
|
27
28
|
*
|
|
28
29
|
* SMI-674: Uses spawn() with argument array to prevent command injection
|
|
29
|
-
* SMI-
|
|
30
|
+
* SMI-3601: Migrated from claude-flow to ruflo
|
|
30
31
|
*
|
|
31
32
|
* @param key - Memory key
|
|
32
33
|
* @param executor - Command executor for spawn/execute fallback
|
|
@@ -34,10 +35,10 @@ export declare function storeMemoryEntry(key: string, value: string, executor: C
|
|
|
34
35
|
*/
|
|
35
36
|
export declare function retrieveMemoryEntry(key: string, executor: CommandExecutor): Promise<MemoryResult>;
|
|
36
37
|
/**
|
|
37
|
-
* Delete data from
|
|
38
|
+
* Delete data from ruflo memory
|
|
38
39
|
*
|
|
39
40
|
* SMI-674: Uses spawn() with argument array to prevent command injection
|
|
40
|
-
* SMI-
|
|
41
|
+
* SMI-3601: Migrated from claude-flow to ruflo
|
|
41
42
|
*
|
|
42
43
|
* @param key - Memory key to delete
|
|
43
44
|
* @param executor - Command executor for spawn/execute fallback
|
|
@@ -48,7 +49,7 @@ export declare function deleteMemoryEntry(key: string, executor: CommandExecutor
|
|
|
48
49
|
* Run pre-task hook
|
|
49
50
|
*
|
|
50
51
|
* SMI-674: Uses spawn() with argument array to prevent command injection
|
|
51
|
-
* SMI-
|
|
52
|
+
* SMI-3601: Migrated from claude-flow to ruflo
|
|
52
53
|
*
|
|
53
54
|
* @param description - Task description
|
|
54
55
|
* @param executor - Command executor for spawn/execute fallback
|
|
@@ -58,7 +59,7 @@ export declare function runPreTaskHook(description: string, executor: CommandExe
|
|
|
58
59
|
* Run post-task hook
|
|
59
60
|
*
|
|
60
61
|
* SMI-674: Uses spawn() with argument array to prevent command injection
|
|
61
|
-
* SMI-
|
|
62
|
+
* SMI-3601: Migrated from claude-flow to ruflo
|
|
62
63
|
*
|
|
63
64
|
* @param taskId - Task ID to pass to the hook
|
|
64
65
|
* @param executor - Command executor for spawn/execute fallback
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionManager.memory.d.ts","sourceRoot":"","sources":["../../../src/session/SessionManager.memory.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"SessionManager.memory.d.ts","sourceRoot":"","sources":["../../../src/session/SessionManager.memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAG9E;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,eAAe,GACxB,OAAO,CAAC,YAAY,CAAC,CAsBvB;AAED;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,eAAe,GACxB,OAAO,CAAC,YAAY,CAAC,CAwBvB;AAED;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,eAAe,GACxB,OAAO,CAAC,YAAY,CAAC,CAmBvB;AAED;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,eAAe,GACxB,OAAO,CAAC,IAAI,CAAC,CAsBf;AAED;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAa9F"}
|
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
* @fileoverview Session Manager Memory and Hook Operations
|
|
3
3
|
* @module @skillsmith/core/session/SessionManager.memory
|
|
4
4
|
* @see SMI-641: Session ID Storage in Claude-Flow Memory
|
|
5
|
-
* @see SMI-1518: V3 API Migration
|
|
6
5
|
* @see SMI-2741: Split from SessionManager.ts to meet 500-line standard
|
|
6
|
+
* @see SMI-3600: Remove dead V3 dynamic imports (claude-flow → ruflo rename)
|
|
7
|
+
* @see SMI-3601: Migrate npx claude-flow CLI calls to npx ruflo
|
|
7
8
|
*
|
|
8
|
-
* Standalone functions for
|
|
9
|
+
* Standalone functions for ruflo memory storage, retrieval, deletion,
|
|
9
10
|
* and hook invocation. Extracted to keep SessionManager.ts within the
|
|
10
|
-
* 500-line limit
|
|
11
|
+
* 500-line limit.
|
|
11
12
|
*/
|
|
12
|
-
import {
|
|
13
|
+
import { validateMemoryKey } from './SessionManager.helpers.js';
|
|
13
14
|
/**
|
|
14
|
-
* Store data in
|
|
15
|
+
* Store data in ruflo memory
|
|
15
16
|
*
|
|
16
17
|
* SMI-674: Uses spawn() with argument array to prevent command injection
|
|
17
|
-
* SMI-
|
|
18
|
+
* SMI-3601: Migrated from claude-flow to ruflo
|
|
18
19
|
*
|
|
19
20
|
* @param key - Memory key
|
|
20
21
|
* @param value - Value to store
|
|
@@ -25,34 +26,14 @@ export async function storeMemoryEntry(key, value, executor) {
|
|
|
25
26
|
if (!validateMemoryKey(key)) {
|
|
26
27
|
return { success: false, error: 'Invalid memory key' };
|
|
27
28
|
}
|
|
28
|
-
// SMI-1518, SMI-1609: Try V3 direct API first if enabled
|
|
29
|
-
if (USE_V3_API) {
|
|
30
|
-
try {
|
|
31
|
-
const memoryModule = await getClaudeFlowMemory();
|
|
32
|
-
if (memoryModule?.storeEntry) {
|
|
33
|
-
const result = await memoryModule.storeEntry({
|
|
34
|
-
key,
|
|
35
|
-
value,
|
|
36
|
-
namespace: MEMORY_NAMESPACE,
|
|
37
|
-
});
|
|
38
|
-
if (result.success) {
|
|
39
|
-
return { success: true };
|
|
40
|
-
}
|
|
41
|
-
console.warn(`V3 storeEntry failed: ${result.error}, falling back to spawn`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
console.warn(`V3 storeEntry exception: ${error}, falling back to spawn`);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
29
|
try {
|
|
49
|
-
const args = ['
|
|
30
|
+
const args = ['ruflo', 'memory', 'store', '--key', key, '--value', value];
|
|
50
31
|
if (executor.spawn) {
|
|
51
32
|
await executor.spawn('npx', args);
|
|
52
33
|
}
|
|
53
34
|
else {
|
|
54
35
|
const escapedValue = value.replace(/'/g, "'\\''");
|
|
55
|
-
const command = `npx
|
|
36
|
+
const command = `npx ruflo memory store --key "${key}" --value '${escapedValue}'`;
|
|
56
37
|
await executor.execute(command);
|
|
57
38
|
}
|
|
58
39
|
return { success: true };
|
|
@@ -65,10 +46,10 @@ export async function storeMemoryEntry(key, value, executor) {
|
|
|
65
46
|
}
|
|
66
47
|
}
|
|
67
48
|
/**
|
|
68
|
-
* Retrieve data from
|
|
49
|
+
* Retrieve data from ruflo memory
|
|
69
50
|
*
|
|
70
51
|
* SMI-674: Uses spawn() with argument array to prevent command injection
|
|
71
|
-
* SMI-
|
|
52
|
+
* SMI-3601: Migrated from claude-flow to ruflo
|
|
72
53
|
*
|
|
73
54
|
* @param key - Memory key
|
|
74
55
|
* @param executor - Command executor for spawn/execute fallback
|
|
@@ -78,37 +59,15 @@ export async function retrieveMemoryEntry(key, executor) {
|
|
|
78
59
|
if (!validateMemoryKey(key)) {
|
|
79
60
|
return { success: false, error: 'Invalid memory key' };
|
|
80
61
|
}
|
|
81
|
-
// SMI-1518, SMI-1609: Try V3 direct API first if enabled
|
|
82
|
-
if (USE_V3_API) {
|
|
83
|
-
try {
|
|
84
|
-
const memoryModule = await getClaudeFlowMemory();
|
|
85
|
-
if (memoryModule?.getEntry) {
|
|
86
|
-
const result = await memoryModule.getEntry({
|
|
87
|
-
key,
|
|
88
|
-
namespace: MEMORY_NAMESPACE,
|
|
89
|
-
});
|
|
90
|
-
if (result.success && result.found && result.entry) {
|
|
91
|
-
return { success: true, data: result.entry.content };
|
|
92
|
-
}
|
|
93
|
-
if (result.success && !result.found) {
|
|
94
|
-
return { success: false, error: 'Key not found' };
|
|
95
|
-
}
|
|
96
|
-
console.warn(`V3 getEntry failed: ${result.error}, falling back to spawn`);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
catch (error) {
|
|
100
|
-
console.warn(`V3 getEntry exception: ${error}, falling back to spawn`);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
62
|
try {
|
|
104
|
-
const args = ['
|
|
63
|
+
const args = ['ruflo', 'memory', 'get', '--key', key];
|
|
105
64
|
let stdout;
|
|
106
65
|
if (executor.spawn) {
|
|
107
66
|
const result = await executor.spawn('npx', args);
|
|
108
67
|
stdout = result.stdout;
|
|
109
68
|
}
|
|
110
69
|
else {
|
|
111
|
-
const command = `npx
|
|
70
|
+
const command = `npx ruflo memory get --key "${key}"`;
|
|
112
71
|
const result = await executor.execute(command);
|
|
113
72
|
stdout = result.stdout;
|
|
114
73
|
}
|
|
@@ -122,10 +81,10 @@ export async function retrieveMemoryEntry(key, executor) {
|
|
|
122
81
|
}
|
|
123
82
|
}
|
|
124
83
|
/**
|
|
125
|
-
* Delete data from
|
|
84
|
+
* Delete data from ruflo memory
|
|
126
85
|
*
|
|
127
86
|
* SMI-674: Uses spawn() with argument array to prevent command injection
|
|
128
|
-
* SMI-
|
|
87
|
+
* SMI-3601: Migrated from claude-flow to ruflo
|
|
129
88
|
*
|
|
130
89
|
* @param key - Memory key to delete
|
|
131
90
|
* @param executor - Command executor for spawn/execute fallback
|
|
@@ -135,33 +94,13 @@ export async function deleteMemoryEntry(key, executor) {
|
|
|
135
94
|
if (!validateMemoryKey(key)) {
|
|
136
95
|
return { success: false, error: 'Invalid memory key' };
|
|
137
96
|
}
|
|
138
|
-
// SMI-1518, SMI-1609: Try V3 MCP API first if enabled
|
|
139
|
-
if (USE_V3_API) {
|
|
140
|
-
try {
|
|
141
|
-
const mcpModule = await getClaudeFlowMcp();
|
|
142
|
-
if (mcpModule?.callMCPTool) {
|
|
143
|
-
const result = (await mcpModule.callMCPTool('memory/delete', { key }));
|
|
144
|
-
if (result.success) {
|
|
145
|
-
return { success: true };
|
|
146
|
-
}
|
|
147
|
-
console.warn(`V3 memory/delete failed, falling back to spawn`);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
catch (error) {
|
|
151
|
-
const mcpModule = await getClaudeFlowMcp();
|
|
152
|
-
const MCPClientError = mcpModule?.MCPClientError;
|
|
153
|
-
if (!MCPClientError || !(error instanceof MCPClientError)) {
|
|
154
|
-
console.warn(`V3 memory/delete exception: ${error}, falling back to spawn`);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
97
|
try {
|
|
159
|
-
const args = ['
|
|
98
|
+
const args = ['ruflo', 'memory', 'delete', '--key', key];
|
|
160
99
|
if (executor.spawn) {
|
|
161
100
|
await executor.spawn('npx', args);
|
|
162
101
|
}
|
|
163
102
|
else {
|
|
164
|
-
const command = `npx
|
|
103
|
+
const command = `npx ruflo memory delete --key "${key}"`;
|
|
165
104
|
await executor.execute(command);
|
|
166
105
|
}
|
|
167
106
|
return { success: true };
|
|
@@ -175,31 +114,15 @@ export async function deleteMemoryEntry(key, executor) {
|
|
|
175
114
|
* Run pre-task hook
|
|
176
115
|
*
|
|
177
116
|
* SMI-674: Uses spawn() with argument array to prevent command injection
|
|
178
|
-
* SMI-
|
|
117
|
+
* SMI-3601: Migrated from claude-flow to ruflo
|
|
179
118
|
*
|
|
180
119
|
* @param description - Task description
|
|
181
120
|
* @param executor - Command executor for spawn/execute fallback
|
|
182
121
|
*/
|
|
183
122
|
export async function runPreTaskHook(description, executor) {
|
|
184
|
-
// SMI-1518, SMI-1609: Try V3 MCP API first if enabled
|
|
185
|
-
if (USE_V3_API) {
|
|
186
|
-
try {
|
|
187
|
-
const mcpModule = await getClaudeFlowMcp();
|
|
188
|
-
if (mcpModule?.callMCPTool) {
|
|
189
|
-
await mcpModule.callMCPTool('hooks/pre-task', {
|
|
190
|
-
description,
|
|
191
|
-
memoryKey: MEMORY_KEYS.CURRENT,
|
|
192
|
-
});
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
catch {
|
|
197
|
-
// V3 API not available or failed, fall back to spawn
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
123
|
try {
|
|
201
124
|
const args = [
|
|
202
|
-
'
|
|
125
|
+
'ruflo',
|
|
203
126
|
'hooks',
|
|
204
127
|
'pre-task',
|
|
205
128
|
'--description',
|
|
@@ -212,7 +135,7 @@ export async function runPreTaskHook(description, executor) {
|
|
|
212
135
|
}
|
|
213
136
|
else {
|
|
214
137
|
const escapedDesc = description.replace(/'/g, "'\\''");
|
|
215
|
-
const command = `npx
|
|
138
|
+
const command = `npx ruflo hooks pre-task --description '${escapedDesc}' --memory-key "session/current"`;
|
|
216
139
|
await executor.execute(command);
|
|
217
140
|
}
|
|
218
141
|
}
|
|
@@ -224,34 +147,19 @@ export async function runPreTaskHook(description, executor) {
|
|
|
224
147
|
* Run post-task hook
|
|
225
148
|
*
|
|
226
149
|
* SMI-674: Uses spawn() with argument array to prevent command injection
|
|
227
|
-
* SMI-
|
|
150
|
+
* SMI-3601: Migrated from claude-flow to ruflo
|
|
228
151
|
*
|
|
229
152
|
* @param taskId - Task ID to pass to the hook
|
|
230
153
|
* @param executor - Command executor for spawn/execute fallback
|
|
231
154
|
*/
|
|
232
155
|
export async function runPostTaskHook(taskId, executor) {
|
|
233
|
-
// SMI-1518, SMI-1609: Try V3 MCP API first if enabled
|
|
234
|
-
if (USE_V3_API) {
|
|
235
|
-
try {
|
|
236
|
-
const mcpModule = await getClaudeFlowMcp();
|
|
237
|
-
if (mcpModule?.callMCPTool) {
|
|
238
|
-
await mcpModule.callMCPTool('hooks/post-task', {
|
|
239
|
-
taskId,
|
|
240
|
-
});
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
catch {
|
|
245
|
-
// V3 API not available or failed, fall back to spawn
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
156
|
try {
|
|
249
|
-
const args = ['
|
|
157
|
+
const args = ['ruflo', 'hooks', 'post-task', '--task-id', taskId];
|
|
250
158
|
if (executor.spawn) {
|
|
251
159
|
await executor.spawn('npx', args);
|
|
252
160
|
}
|
|
253
161
|
else {
|
|
254
|
-
const command = `npx
|
|
162
|
+
const command = `npx ruflo hooks post-task --task-id "${taskId}"`;
|
|
255
163
|
await executor.execute(command);
|
|
256
164
|
}
|
|
257
165
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionManager.memory.js","sourceRoot":"","sources":["../../../src/session/SessionManager.memory.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"SessionManager.memory.js","sourceRoot":"","sources":["../../../src/session/SessionManager.memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAE/D;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,GAAW,EACX,KAAa,EACb,QAAyB;IAEzB,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;QAC5B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAA;IACxD,C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3,43 +3,6 @@
|
|
|
3
3
|
* @module @skillsmith/core/session/SessionManager.types
|
|
4
4
|
*/
|
|
5
5
|
import type { SessionData } from './SessionContext.js';
|
|
6
|
-
/**
|
|
7
|
-
* SMI-1685: Type definitions for dynamically imported claude-flow memory module
|
|
8
|
-
* These interfaces define the expected shape of the memory module API
|
|
9
|
-
*/
|
|
10
|
-
export interface ClaudeFlowMemoryModule {
|
|
11
|
-
storeEntry?(params: {
|
|
12
|
-
key: string;
|
|
13
|
-
value: string;
|
|
14
|
-
namespace: string;
|
|
15
|
-
}): Promise<{
|
|
16
|
-
success: boolean;
|
|
17
|
-
error?: string;
|
|
18
|
-
}>;
|
|
19
|
-
getEntry?(params: {
|
|
20
|
-
key: string;
|
|
21
|
-
namespace: string;
|
|
22
|
-
}): Promise<{
|
|
23
|
-
success: boolean;
|
|
24
|
-
found: boolean;
|
|
25
|
-
entry?: {
|
|
26
|
-
content: string;
|
|
27
|
-
};
|
|
28
|
-
error?: string;
|
|
29
|
-
}>;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* SMI-1685: Type definitions for dynamically imported claude-flow MCP module
|
|
33
|
-
* These interfaces define the expected shape of the MCP client API
|
|
34
|
-
*/
|
|
35
|
-
export interface ClaudeFlowMcpModule {
|
|
36
|
-
callMCPTool?(toolName: string, params: Record<string, unknown>): Promise<{
|
|
37
|
-
success: boolean;
|
|
38
|
-
deleted?: boolean;
|
|
39
|
-
error?: string;
|
|
40
|
-
}>;
|
|
41
|
-
MCPClientError?: new (message: string) => Error;
|
|
42
|
-
}
|
|
43
6
|
/**
|
|
44
7
|
* Options for creating a new session
|
|
45
8
|
*/
|