monomind 1.11.12 → 1.11.13
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/.claude/commands/mastermind/idea.md +1 -1
- package/.claude/commands/mastermind/master.md +1 -1
- package/.claude/skills/mastermind/_protocol.md +4 -4
- package/.claude/skills/mastermind/build.md +3 -3
- package/.claude/skills/mastermind/content.md +3 -3
- package/.claude/skills/mastermind/createorg.md +2 -2
- package/.claude/skills/mastermind/finance.md +3 -3
- package/.claude/skills/mastermind/marketing.md +3 -3
- package/.claude/skills/mastermind/ops.md +3 -3
- package/.claude/skills/mastermind/release.md +3 -3
- package/.claude/skills/mastermind/research.md +3 -3
- package/.claude/skills/mastermind/review.md +3 -3
- package/.claude/skills/mastermind/sales.md +3 -3
- package/package.json +1 -1
- package/packages/@monomind/cli/dist/src/init/statusline-generator.js +3 -3
- package/packages/@monomind/cli/dist/src/observability/replay-reader.d.ts +1 -1
- package/packages/@monomind/cli/dist/src/update/checker.js +24 -7
- package/packages/@monomind/cli/dist/src/update/index.js +3 -6
- package/packages/@monomind/cli/package.json +1 -1
- package/packages/@monomind/cli/dist/src/agents/halt-signal.d.ts +0 -25
- package/packages/@monomind/cli/dist/src/agents/halt-signal.js +0 -76
- package/packages/@monomind/cli/dist/src/agents/index.d.ts +0 -18
- package/packages/@monomind/cli/dist/src/agents/index.js +0 -13
- package/packages/@monomind/cli/dist/src/agents/managed-agent.d.ts +0 -41
- package/packages/@monomind/cli/dist/src/agents/managed-agent.js +0 -69
- package/packages/@monomind/cli/dist/src/agents/prompt-experiment.d.ts +0 -23
- package/packages/@monomind/cli/dist/src/agents/prompt-experiment.js +0 -49
- package/packages/@monomind/cli/dist/src/agents/prompt-version-manager.d.ts +0 -22
- package/packages/@monomind/cli/dist/src/agents/prompt-version-manager.js +0 -80
- package/packages/@monomind/cli/dist/src/agents/registry-query.d.ts +0 -71
- package/packages/@monomind/cli/dist/src/agents/registry-query.js +0 -125
- package/packages/@monomind/cli/dist/src/agents/score-decay.d.ts +0 -19
- package/packages/@monomind/cli/dist/src/agents/score-decay.js +0 -22
- package/packages/@monomind/cli/dist/src/agents/shared-instructions-loader.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/agents/shared-instructions-loader.js +0 -40
- package/packages/@monomind/cli/dist/src/agents/specialization-scorer.d.ts +0 -54
- package/packages/@monomind/cli/dist/src/agents/specialization-scorer.js +0 -212
- package/packages/@monomind/cli/dist/src/agents/termination-watcher.d.ts +0 -30
- package/packages/@monomind/cli/dist/src/agents/termination-watcher.js +0 -84
- package/packages/@monomind/cli/dist/src/agents/trigger-index.d.ts +0 -20
- package/packages/@monomind/cli/dist/src/agents/trigger-index.js +0 -38
- package/packages/@monomind/cli/dist/src/agents/trigger-scanner.d.ts +0 -64
- package/packages/@monomind/cli/dist/src/agents/trigger-scanner.js +0 -308
- package/packages/@monomind/cli/dist/src/agents/version-diff.d.ts +0 -18
- package/packages/@monomind/cli/dist/src/agents/version-diff.js +0 -64
- package/packages/@monomind/cli/dist/src/agents/version-store.d.ts +0 -60
- package/packages/@monomind/cli/dist/src/agents/version-store.js +0 -235
- package/packages/@monomind/cli/dist/src/benchmarks/pretrain/index.d.ts +0 -45
- package/packages/@monomind/cli/dist/src/benchmarks/pretrain/index.js +0 -404
- package/packages/@monomind/cli/dist/src/commands/agent-wasm.d.ts +0 -14
- package/packages/@monomind/cli/dist/src/commands/agent-wasm.js +0 -333
- package/packages/@monomind/cli/dist/src/commands/ui.js +0 -68
- package/packages/@monomind/cli/dist/src/consensus/index.d.ts +0 -7
- package/packages/@monomind/cli/dist/src/consensus/index.js +0 -6
- package/packages/@monomind/cli/dist/src/context/context-provider.d.ts +0 -44
- package/packages/@monomind/cli/dist/src/context/context-provider.js +0 -25
- package/packages/@monomind/cli/dist/src/context/git-state-provider.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/context/git-state-provider.js +0 -34
- package/packages/@monomind/cli/dist/src/context/index.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/context/index.js +0 -12
- package/packages/@monomind/cli/dist/src/context/project-conventions-provider.d.ts +0 -15
- package/packages/@monomind/cli/dist/src/context/project-conventions-provider.js +0 -19
- package/packages/@monomind/cli/dist/src/context/prompt-assembler.d.ts +0 -26
- package/packages/@monomind/cli/dist/src/context/prompt-assembler.js +0 -93
- package/packages/@monomind/cli/dist/src/context/task-history-provider.d.ts +0 -24
- package/packages/@monomind/cli/dist/src/context/task-history-provider.js +0 -32
- package/packages/@monomind/cli/dist/src/context/user-preferences-provider.d.ts +0 -14
- package/packages/@monomind/cli/dist/src/context/user-preferences-provider.js +0 -27
- package/packages/@monomind/cli/dist/src/dlq/dlq-reader.d.ts +0 -31
- package/packages/@monomind/cli/dist/src/dlq/dlq-reader.js +0 -81
- package/packages/@monomind/cli/dist/src/dlq/dlq-writer.d.ts +0 -24
- package/packages/@monomind/cli/dist/src/dlq/dlq-writer.js +0 -65
- package/packages/@monomind/cli/dist/src/dlq/index.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/dlq/index.js +0 -7
- package/packages/@monomind/cli/dist/src/eval/dataset-manager.d.ts +0 -33
- package/packages/@monomind/cli/dist/src/eval/dataset-manager.js +0 -107
- package/packages/@monomind/cli/dist/src/eval/dataset-runner.d.ts +0 -23
- package/packages/@monomind/cli/dist/src/eval/dataset-runner.js +0 -59
- package/packages/@monomind/cli/dist/src/eval/index.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/eval/index.js +0 -7
- package/packages/@monomind/cli/dist/src/eval/trace-collector.d.ts +0 -40
- package/packages/@monomind/cli/dist/src/eval/trace-collector.js +0 -102
- package/packages/@monomind/cli/dist/src/infrastructure/in-memory-repositories.d.ts +0 -68
- package/packages/@monomind/cli/dist/src/infrastructure/in-memory-repositories.js +0 -264
- package/packages/@monomind/cli/dist/src/interactive/interrupt.d.ts +0 -22
- package/packages/@monomind/cli/dist/src/interactive/interrupt.js +0 -71
- package/packages/@monomind/cli/dist/src/mcp/deprecation-injector.d.ts +0 -25
- package/packages/@monomind/cli/dist/src/mcp/deprecation-injector.js +0 -48
- package/packages/@monomind/cli/dist/src/mcp/tool-registry.d.ts +0 -61
- package/packages/@monomind/cli/dist/src/mcp/tool-registry.js +0 -246
- package/packages/@monomind/cli/dist/src/mcp-tools/wasm-agent-tools.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/mcp-tools/wasm-agent-tools.js +0 -230
- package/packages/@monomind/cli/dist/src/model/complexity-scorer.d.ts +0 -21
- package/packages/@monomind/cli/dist/src/model/complexity-scorer.js +0 -106
- package/packages/@monomind/cli/dist/src/model/index.d.ts +0 -4
- package/packages/@monomind/cli/dist/src/model/index.js +0 -4
- package/packages/@monomind/cli/dist/src/model/model-settings.d.ts +0 -22
- package/packages/@monomind/cli/dist/src/model/model-settings.js +0 -33
- package/packages/@monomind/cli/dist/src/model/model-tier-resolver.d.ts +0 -24
- package/packages/@monomind/cli/dist/src/model/model-tier-resolver.js +0 -65
- package/packages/@monomind/cli/dist/src/monovector/capabilities.d.ts +0 -34
- package/packages/@monomind/cli/dist/src/monovector/capabilities.js +0 -37
- package/packages/@monomind/cli/dist/src/orchestration/index.d.ts +0 -7
- package/packages/@monomind/cli/dist/src/orchestration/index.js +0 -6
- package/packages/@monomind/cli/dist/src/orchestration/mode-dispatcher.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/orchestration/mode-dispatcher.js +0 -31
- package/packages/@monomind/cli/dist/src/orchestration/routing-modes.d.ts +0 -68
- package/packages/@monomind/cli/dist/src/orchestration/routing-modes.js +0 -180
- package/packages/@monomind/cli/dist/src/plugins/tests/demo-plugin-store.d.ts +0 -7
- package/packages/@monomind/cli/dist/src/plugins/tests/demo-plugin-store.js +0 -126
- package/packages/@monomind/cli/dist/src/plugins/tests/standalone-test.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/plugins/tests/standalone-test.js +0 -188
- package/packages/@monomind/cli/dist/src/plugins/tests/test-plugin-store.d.ts +0 -7
- package/packages/@monomind/cli/dist/src/plugins/tests/test-plugin-store.js +0 -206
- package/packages/@monomind/cli/dist/src/runtime/headless.d.ts +0 -60
- package/packages/@monomind/cli/dist/src/runtime/headless.js +0 -284
- package/packages/@monomind/cli/dist/src/services/agentic-flow-bridge.d.ts +0 -50
- package/packages/@monomind/cli/dist/src/services/agentic-flow-bridge.js +0 -95
- package/packages/@monomind/cli/dist/src/services/container-worker-pool.d.ts +0 -197
- package/packages/@monomind/cli/dist/src/services/container-worker-pool.js +0 -623
- package/packages/@monomind/cli/dist/src/services/index.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/services/index.js +0 -11
- package/packages/@monomind/cli/dist/src/services/worker-queue.d.ts +0 -201
- package/packages/@monomind/cli/dist/src/services/worker-queue.js +0 -594
- package/packages/@monomind/cli/dist/src/swarm/communication-graph.d.ts +0 -25
- package/packages/@monomind/cli/dist/src/swarm/communication-graph.js +0 -77
- package/packages/@monomind/cli/dist/src/swarm/flow-enforcer.d.ts +0 -31
- package/packages/@monomind/cli/dist/src/swarm/flow-enforcer.js +0 -61
- package/packages/@monomind/cli/dist/src/swarm/flow-visualizer.d.ts +0 -19
- package/packages/@monomind/cli/dist/src/swarm/flow-visualizer.js +0 -68
- package/packages/@monomind/cli/dist/src/transfer/deploy-seraphine.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/transfer/deploy-seraphine.js +0 -205
- package/packages/@monomind/cli/dist/src/transfer/store/tests/standalone-test.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/transfer/store/tests/standalone-test.js +0 -190
- package/packages/@monomind/cli/dist/src/transfer/test-seraphine.d.ts +0 -6
- package/packages/@monomind/cli/dist/src/transfer/test-seraphine.js +0 -105
- package/packages/@monomind/cli/dist/src/transfer/tests/test-store.d.ts +0 -7
- package/packages/@monomind/cli/dist/src/transfer/tests/test-store.js +0 -214
- package/packages/@monomind/cli/dist/src/workflow/condition-evaluator.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/workflow/condition-evaluator.js +0 -82
- package/packages/@monomind/cli/dist/src/workflow/context-resolver.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/workflow/context-resolver.js +0 -23
- package/packages/@monomind/cli/dist/src/workflow/dag-builder.d.ts +0 -17
- package/packages/@monomind/cli/dist/src/workflow/dag-builder.js +0 -129
- package/packages/@monomind/cli/dist/src/workflow/dag-executor.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/workflow/dag-executor.js +0 -116
- package/packages/@monomind/cli/dist/src/workflow/dag-types.d.ts +0 -41
- package/packages/@monomind/cli/dist/src/workflow/dag-types.js +0 -8
- package/packages/@monomind/cli/dist/src/workflow/dsl-parser.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/workflow/dsl-parser.js +0 -20
- package/packages/@monomind/cli/dist/src/workflow/dsl-schema.d.ts +0 -165
- package/packages/@monomind/cli/dist/src/workflow/dsl-schema.js +0 -82
- package/packages/@monomind/cli/dist/src/workflow/index.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/workflow/index.js +0 -11
- package/packages/@monomind/cli/dist/src/workflow/template-engine.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/workflow/template-engine.js +0 -40
- package/packages/@monomind/cli/dist/src/workflow/workflow-executor.d.ts +0 -29
- package/packages/@monomind/cli/dist/src/workflow/workflow-executor.js +0 -227
- package/packages/@monomind/guidance/dist/adversarial.d.ts +0 -284
- package/packages/@monomind/guidance/dist/adversarial.js +0 -572
- package/packages/@monomind/guidance/dist/analyzer.d.ts +0 -530
- package/packages/@monomind/guidance/dist/analyzer.js +0 -2518
- package/packages/@monomind/guidance/dist/artifacts.d.ts +0 -283
- package/packages/@monomind/guidance/dist/artifacts.js +0 -356
- package/packages/@monomind/guidance/dist/authority.d.ts +0 -290
- package/packages/@monomind/guidance/dist/authority.js +0 -558
- package/packages/@monomind/guidance/dist/capabilities.d.ts +0 -209
- package/packages/@monomind/guidance/dist/capabilities.js +0 -485
- package/packages/@monomind/guidance/dist/coherence.d.ts +0 -233
- package/packages/@monomind/guidance/dist/coherence.js +0 -372
- package/packages/@monomind/guidance/dist/compiler.d.ts +0 -87
- package/packages/@monomind/guidance/dist/compiler.js +0 -419
- package/packages/@monomind/guidance/dist/conformance-kit.d.ts +0 -225
- package/packages/@monomind/guidance/dist/conformance-kit.js +0 -629
- package/packages/@monomind/guidance/dist/continue-gate.d.ts +0 -214
- package/packages/@monomind/guidance/dist/continue-gate.js +0 -353
- package/packages/@monomind/guidance/dist/crypto-utils.d.ts +0 -17
- package/packages/@monomind/guidance/dist/crypto-utils.js +0 -24
- package/packages/@monomind/guidance/dist/evolution.d.ts +0 -282
- package/packages/@monomind/guidance/dist/evolution.js +0 -500
- package/packages/@monomind/guidance/dist/gates.d.ts +0 -79
- package/packages/@monomind/guidance/dist/gates.js +0 -302
- package/packages/@monomind/guidance/dist/gateway.d.ts +0 -206
- package/packages/@monomind/guidance/dist/gateway.js +0 -452
- package/packages/@monomind/guidance/dist/generators.d.ts +0 -153
- package/packages/@monomind/guidance/dist/generators.js +0 -682
- package/packages/@monomind/guidance/dist/headless.d.ts +0 -177
- package/packages/@monomind/guidance/dist/headless.js +0 -342
- package/packages/@monomind/guidance/dist/hooks.d.ts +0 -109
- package/packages/@monomind/guidance/dist/hooks.js +0 -347
- package/packages/@monomind/guidance/dist/index.d.ts +0 -205
- package/packages/@monomind/guidance/dist/index.js +0 -321
- package/packages/@monomind/guidance/dist/ledger.d.ts +0 -162
- package/packages/@monomind/guidance/dist/ledger.js +0 -375
- package/packages/@monomind/guidance/dist/manifest-validator.d.ts +0 -289
- package/packages/@monomind/guidance/dist/manifest-validator.js +0 -838
- package/packages/@monomind/guidance/dist/memory-gate.d.ts +0 -222
- package/packages/@monomind/guidance/dist/memory-gate.js +0 -382
- package/packages/@monomind/guidance/dist/meta-governance.d.ts +0 -265
- package/packages/@monomind/guidance/dist/meta-governance.js +0 -348
- package/packages/@monomind/guidance/dist/optimizer.d.ts +0 -104
- package/packages/@monomind/guidance/dist/optimizer.js +0 -329
- package/packages/@monomind/guidance/dist/persistence.d.ts +0 -189
- package/packages/@monomind/guidance/dist/persistence.js +0 -464
- package/packages/@monomind/guidance/dist/proof.d.ts +0 -185
- package/packages/@monomind/guidance/dist/proof.js +0 -238
- package/packages/@monomind/guidance/dist/retriever.d.ts +0 -116
- package/packages/@monomind/guidance/dist/retriever.js +0 -394
- package/packages/@monomind/guidance/dist/ruvbot-integration.d.ts +0 -370
- package/packages/@monomind/guidance/dist/ruvbot-integration.js +0 -738
- package/packages/@monomind/guidance/dist/temporal.d.ts +0 -426
- package/packages/@monomind/guidance/dist/temporal.js +0 -658
- package/packages/@monomind/guidance/dist/trust.d.ts +0 -283
- package/packages/@monomind/guidance/dist/trust.js +0 -473
- package/packages/@monomind/guidance/dist/truth-anchors.d.ts +0 -276
- package/packages/@monomind/guidance/dist/truth-anchors.js +0 -488
- package/packages/@monomind/guidance/dist/types.d.ts +0 -378
- package/packages/@monomind/guidance/dist/types.js +0 -10
- package/packages/@monomind/guidance/dist/uncertainty.d.ts +0 -372
- package/packages/@monomind/guidance/dist/uncertainty.js +0 -619
- package/packages/@monomind/guidance/dist/wasm-kernel.d.ts +0 -48
- package/packages/@monomind/guidance/dist/wasm-kernel.js +0 -158
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* FlowEnforcer (Task 40)
|
|
3
|
-
*
|
|
4
|
-
* Checks messages against the communication graph and records violations.
|
|
5
|
-
* No database dependency — violations stored in memory.
|
|
6
|
-
*/
|
|
7
|
-
import type { FlowViolation } from '../../../shared/src/types/communication-flow.js';
|
|
8
|
-
import type { CommunicationGraph } from './communication-graph.js';
|
|
9
|
-
export declare class FlowEnforcer {
|
|
10
|
-
private readonly graph;
|
|
11
|
-
private readonly swarmId;
|
|
12
|
-
private readonly enforce;
|
|
13
|
-
private readonly violations;
|
|
14
|
-
private static readonly MAX_VIOLATIONS;
|
|
15
|
-
constructor(graph: CommunicationGraph, swarmId: string, enforceMode: boolean);
|
|
16
|
-
/**
|
|
17
|
-
* Check whether a message is authorized and record any violation.
|
|
18
|
-
*
|
|
19
|
-
* Returns BOTH `authorized` (the policy decision) and `enforced` (whether the
|
|
20
|
-
* decision is actually applied). Callers must read both — taking action based
|
|
21
|
-
* solely on `authorized` would let `enforce=false` silently bypass the policy.
|
|
22
|
-
*/
|
|
23
|
-
checkAndRecord(fromSlug: string, toSlug: string, messageContent: string): {
|
|
24
|
-
authorized: boolean;
|
|
25
|
-
enforced: boolean;
|
|
26
|
-
violation?: FlowViolation;
|
|
27
|
-
};
|
|
28
|
-
/** Return all recorded violations */
|
|
29
|
-
getViolations(): FlowViolation[];
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=flow-enforcer.d.ts.map
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* FlowEnforcer (Task 40)
|
|
3
|
-
*
|
|
4
|
-
* Checks messages against the communication graph and records violations.
|
|
5
|
-
* No database dependency — violations stored in memory.
|
|
6
|
-
*/
|
|
7
|
-
import { randomUUID } from 'crypto';
|
|
8
|
-
export class FlowEnforcer {
|
|
9
|
-
graph;
|
|
10
|
-
swarmId;
|
|
11
|
-
enforce;
|
|
12
|
-
violations = [];
|
|
13
|
-
static MAX_VIOLATIONS = 1000;
|
|
14
|
-
constructor(graph, swarmId, enforceMode) {
|
|
15
|
-
this.graph = graph;
|
|
16
|
-
this.swarmId = swarmId;
|
|
17
|
-
this.enforce = enforceMode;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Check whether a message is authorized and record any violation.
|
|
21
|
-
*
|
|
22
|
-
* Returns BOTH `authorized` (the policy decision) and `enforced` (whether the
|
|
23
|
-
* decision is actually applied). Callers must read both — taking action based
|
|
24
|
-
* solely on `authorized` would let `enforce=false` silently bypass the policy.
|
|
25
|
-
*/
|
|
26
|
-
checkAndRecord(fromSlug, toSlug, messageContent) {
|
|
27
|
-
if (this.graph.isAuthorized(fromSlug, toSlug)) {
|
|
28
|
-
return { authorized: true, enforced: this.enforce };
|
|
29
|
-
}
|
|
30
|
-
const violation = {
|
|
31
|
-
violationId: randomUUID(),
|
|
32
|
-
swarmId: this.swarmId,
|
|
33
|
-
fromAgentSlug: fromSlug,
|
|
34
|
-
toAgentSlug: toSlug,
|
|
35
|
-
// Truncated preview only; for sensitive traffic, redact via a hook before
|
|
36
|
-
// it reaches this enforcer. Cap means an attacker can't fill memory with
|
|
37
|
-
// long messages either.
|
|
38
|
-
messagePreview: messageContent.slice(0, 120),
|
|
39
|
-
detectedAt: new Date().toISOString(),
|
|
40
|
-
action: this.enforce ? 'blocked' : 'logged',
|
|
41
|
-
};
|
|
42
|
-
// FIFO eviction so a sustained attack can't grow violations to GB-scale.
|
|
43
|
-
if (this.violations.length >= FlowEnforcer.MAX_VIOLATIONS) {
|
|
44
|
-
this.violations.shift();
|
|
45
|
-
}
|
|
46
|
-
this.violations.push(violation);
|
|
47
|
-
return {
|
|
48
|
-
// Policy decision: NOT authorized. Whether the caller blocks the send is
|
|
49
|
-
// governed by `enforced`, which is exposed separately so callers cannot
|
|
50
|
-
// accidentally treat audit-mode as "permitted".
|
|
51
|
-
authorized: false,
|
|
52
|
-
enforced: this.enforce,
|
|
53
|
-
violation,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
/** Return all recorded violations */
|
|
57
|
-
getViolations() {
|
|
58
|
-
return [...this.violations];
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=flow-enforcer.js.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flow Visualizer (Task 40)
|
|
3
|
-
*
|
|
4
|
-
* ASCII and DOT (Graphviz) renderers for communication flow edges.
|
|
5
|
-
*/
|
|
6
|
-
import type { FlowEdge } from '../../../shared/src/types/communication-flow.js';
|
|
7
|
-
/**
|
|
8
|
-
* Render edges as human-readable ASCII art.
|
|
9
|
-
* Empty edges produce a single-line "unrestricted" notice.
|
|
10
|
-
*/
|
|
11
|
-
export declare function toAscii(edges: FlowEdge[], title?: string): string;
|
|
12
|
-
/**
|
|
13
|
-
* Render edges as a DOT language digraph (Graphviz compatible).
|
|
14
|
-
* Slugs are escaped so a malicious slug cannot inject DOT attributes
|
|
15
|
-
* (e.g., URL="javascript:..." would be rendered as a clickable link
|
|
16
|
-
* by Graphviz's SVG output without escaping).
|
|
17
|
-
*/
|
|
18
|
-
export declare function toDOT(edges: FlowEdge[], graphName?: string): string;
|
|
19
|
-
//# sourceMappingURL=flow-visualizer.d.ts.map
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flow Visualizer (Task 40)
|
|
3
|
-
*
|
|
4
|
-
* ASCII and DOT (Graphviz) renderers for communication flow edges.
|
|
5
|
-
*/
|
|
6
|
-
/** Escape a slug for safe DOT identifier interpolation. */
|
|
7
|
-
function dotEscape(s) {
|
|
8
|
-
return String(s ?? '').replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
9
|
-
}
|
|
10
|
-
/** Strip newlines/CR for safe ASCII line emission (log-injection defense). */
|
|
11
|
-
function asciiSafe(s) {
|
|
12
|
-
return String(s ?? '').replace(/[\r\n\x00-\x1f\x7f]/g, '?');
|
|
13
|
-
}
|
|
14
|
-
/** Restrict graph names to a safe DOT identifier — graph_name must be an ID. */
|
|
15
|
-
function safeGraphName(name) {
|
|
16
|
-
return /^[a-zA-Z_][a-zA-Z0-9_]{0,63}$/.test(name) ? name : 'swarm_flow';
|
|
17
|
-
}
|
|
18
|
-
const MAX_DISPLAY_EDGES = 500;
|
|
19
|
-
/**
|
|
20
|
-
* Render edges as human-readable ASCII art.
|
|
21
|
-
* Empty edges produce a single-line "unrestricted" notice.
|
|
22
|
-
*/
|
|
23
|
-
export function toAscii(edges, title) {
|
|
24
|
-
const lines = [];
|
|
25
|
-
if (title) {
|
|
26
|
-
lines.push(`=== ${asciiSafe(title)} ===`);
|
|
27
|
-
lines.push('');
|
|
28
|
-
}
|
|
29
|
-
if (edges.length === 0) {
|
|
30
|
-
lines.push('(unrestricted — all agents may communicate freely)');
|
|
31
|
-
return lines.join('\n');
|
|
32
|
-
}
|
|
33
|
-
const capped = edges.slice(0, MAX_DISPLAY_EDGES);
|
|
34
|
-
for (const [from, to] of capped) {
|
|
35
|
-
lines.push(` ${asciiSafe(from)} --> ${asciiSafe(to)}`);
|
|
36
|
-
}
|
|
37
|
-
if (edges.length > MAX_DISPLAY_EDGES) {
|
|
38
|
-
lines.push(` ... (${edges.length - MAX_DISPLAY_EDGES} more edges omitted)`);
|
|
39
|
-
}
|
|
40
|
-
return lines.join('\n');
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Render edges as a DOT language digraph (Graphviz compatible).
|
|
44
|
-
* Slugs are escaped so a malicious slug cannot inject DOT attributes
|
|
45
|
-
* (e.g., URL="javascript:..." would be rendered as a clickable link
|
|
46
|
-
* by Graphviz's SVG output without escaping).
|
|
47
|
-
*/
|
|
48
|
-
export function toDOT(edges, graphName) {
|
|
49
|
-
const name = safeGraphName(graphName ?? 'swarm_flow');
|
|
50
|
-
const lines = [];
|
|
51
|
-
lines.push(`digraph ${name} {`);
|
|
52
|
-
lines.push(' rankdir=LR;');
|
|
53
|
-
if (edges.length === 0) {
|
|
54
|
-
lines.push(' // unrestricted — no explicit edges');
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
const capped = edges.slice(0, MAX_DISPLAY_EDGES);
|
|
58
|
-
for (const [from, to] of capped) {
|
|
59
|
-
lines.push(` "${dotEscape(from)}" -> "${dotEscape(to)}";`);
|
|
60
|
-
}
|
|
61
|
-
if (edges.length > MAX_DISPLAY_EDGES) {
|
|
62
|
-
lines.push(` // ... (${edges.length - MAX_DISPLAY_EDGES} more edges omitted)`);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
lines.push('}');
|
|
66
|
-
return lines.join('\n');
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=flow-visualizer.js.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env npx tsx
|
|
2
|
-
/**
|
|
3
|
-
* Deploy Seraphine Genesis Model
|
|
4
|
-
* Exports and uploads the first Monomind pattern model to IPFS
|
|
5
|
-
*
|
|
6
|
-
* Usage:
|
|
7
|
-
* npx tsx deploy-seraphine.ts
|
|
8
|
-
* npx tsx deploy-seraphine.ts --output ./patterns/
|
|
9
|
-
* npx tsx deploy-seraphine.ts --to-ipfs
|
|
10
|
-
* npx tsx deploy-seraphine.ts --to-ipfs --anonymize strict
|
|
11
|
-
*/
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=deploy-seraphine.d.ts.map
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env npx tsx
|
|
2
|
-
/**
|
|
3
|
-
* Deploy Seraphine Genesis Model
|
|
4
|
-
* Exports and uploads the first Monomind pattern model to IPFS
|
|
5
|
-
*
|
|
6
|
-
* Usage:
|
|
7
|
-
* npx tsx deploy-seraphine.ts
|
|
8
|
-
* npx tsx deploy-seraphine.ts --output ./patterns/
|
|
9
|
-
* npx tsx deploy-seraphine.ts --to-ipfs
|
|
10
|
-
* npx tsx deploy-seraphine.ts --to-ipfs --anonymize strict
|
|
11
|
-
*/
|
|
12
|
-
import * as path from 'path';
|
|
13
|
-
import { fileURLToPath } from 'url';
|
|
14
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
15
|
-
const __dirname = path.dirname(__filename);
|
|
16
|
-
import { createSeraphineGenesis, getSeraphineInfo } from './models/seraphine.js';
|
|
17
|
-
import { exportPatterns } from './export.js';
|
|
18
|
-
import { validateCFP } from './serialization/cfp.js';
|
|
19
|
-
import { scanCFPForPII } from './anonymization/index.js';
|
|
20
|
-
/**
|
|
21
|
-
* Parse CLI arguments
|
|
22
|
-
*/
|
|
23
|
-
function parseArgs() {
|
|
24
|
-
const args = process.argv.slice(2);
|
|
25
|
-
const options = {
|
|
26
|
-
toIpfs: false,
|
|
27
|
-
anonymize: 'standard',
|
|
28
|
-
pin: true,
|
|
29
|
-
gateway: 'https://w3s.link',
|
|
30
|
-
validate: true,
|
|
31
|
-
verbose: false,
|
|
32
|
-
};
|
|
33
|
-
for (let i = 0; i < args.length; i++) {
|
|
34
|
-
const arg = args[i];
|
|
35
|
-
switch (arg) {
|
|
36
|
-
case '--output':
|
|
37
|
-
case '-o':
|
|
38
|
-
options.output = args[++i];
|
|
39
|
-
break;
|
|
40
|
-
case '--to-ipfs':
|
|
41
|
-
case '--ipfs':
|
|
42
|
-
options.toIpfs = true;
|
|
43
|
-
break;
|
|
44
|
-
case '--anonymize':
|
|
45
|
-
case '-a':
|
|
46
|
-
options.anonymize = args[++i];
|
|
47
|
-
break;
|
|
48
|
-
case '--no-pin':
|
|
49
|
-
options.pin = false;
|
|
50
|
-
break;
|
|
51
|
-
case '--gateway':
|
|
52
|
-
case '-g':
|
|
53
|
-
options.gateway = args[++i];
|
|
54
|
-
break;
|
|
55
|
-
case '--no-validate':
|
|
56
|
-
options.validate = false;
|
|
57
|
-
break;
|
|
58
|
-
case '--verbose':
|
|
59
|
-
case '-v':
|
|
60
|
-
options.verbose = true;
|
|
61
|
-
break;
|
|
62
|
-
case '--help':
|
|
63
|
-
case '-h':
|
|
64
|
-
printHelp();
|
|
65
|
-
process.exit(0);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return options;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Print help message
|
|
72
|
-
*/
|
|
73
|
-
function printHelp() {
|
|
74
|
-
console.log(`
|
|
75
|
-
Seraphine Genesis Deployer
|
|
76
|
-
==========================
|
|
77
|
-
|
|
78
|
-
Deploy the foundational Monomind pattern model.
|
|
79
|
-
|
|
80
|
-
Usage:
|
|
81
|
-
npx ts-node deploy-seraphine.ts [options]
|
|
82
|
-
|
|
83
|
-
Options:
|
|
84
|
-
--output, -o <path> Output file path
|
|
85
|
-
--to-ipfs, --ipfs Upload to IPFS
|
|
86
|
-
--anonymize, -a <level> Anonymization level (minimal|standard|strict|paranoid)
|
|
87
|
-
--gateway, -g <url> IPFS gateway URL
|
|
88
|
-
--no-pin Don't pin to pinning service
|
|
89
|
-
--no-validate Skip validation
|
|
90
|
-
--verbose, -v Verbose output
|
|
91
|
-
--help, -h Show this help
|
|
92
|
-
|
|
93
|
-
Examples:
|
|
94
|
-
npx ts-node deploy-seraphine.ts --output ./seraphine-genesis.cfp.json
|
|
95
|
-
npx ts-node deploy-seraphine.ts --to-ipfs --anonymize strict
|
|
96
|
-
npx ts-node deploy-seraphine.ts --to-ipfs --gateway https://dweb.link
|
|
97
|
-
`);
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Main deploy function
|
|
101
|
-
*/
|
|
102
|
-
async function deploy() {
|
|
103
|
-
const options = parseArgs();
|
|
104
|
-
console.log('');
|
|
105
|
-
console.log('╔══════════════════════════════════════════════════════════╗');
|
|
106
|
-
console.log('║ SERAPHINE GENESIS MODEL DEPLOYMENT ║');
|
|
107
|
-
console.log('║ The First Monomind Pattern Model ║');
|
|
108
|
-
console.log('╚══════════════════════════════════════════════════════════╝');
|
|
109
|
-
console.log('');
|
|
110
|
-
// Step 1: Create Seraphine Genesis
|
|
111
|
-
console.log('📦 Creating Seraphine Genesis Model...');
|
|
112
|
-
const genesis = createSeraphineGenesis();
|
|
113
|
-
const info = getSeraphineInfo();
|
|
114
|
-
console.log(` Name: ${info.name}`);
|
|
115
|
-
console.log(` Version: ${info.version}`);
|
|
116
|
-
console.log(` Description: ${info.description.slice(0, 60)}...`);
|
|
117
|
-
console.log('');
|
|
118
|
-
console.log(' Pattern Counts:');
|
|
119
|
-
for (const [type, count] of Object.entries(info.patternCounts)) {
|
|
120
|
-
console.log(` - ${type}: ${count}`);
|
|
121
|
-
}
|
|
122
|
-
console.log('');
|
|
123
|
-
// Step 2: Validate
|
|
124
|
-
if (options.validate) {
|
|
125
|
-
console.log('✅ Validating CFP format...');
|
|
126
|
-
const validation = validateCFP(genesis);
|
|
127
|
-
if (!validation.valid) {
|
|
128
|
-
console.error('❌ Validation failed:');
|
|
129
|
-
for (const error of validation.errors) {
|
|
130
|
-
console.error(` - ${error}`);
|
|
131
|
-
}
|
|
132
|
-
process.exit(1);
|
|
133
|
-
}
|
|
134
|
-
console.log(' Format is valid!');
|
|
135
|
-
console.log('');
|
|
136
|
-
}
|
|
137
|
-
// Step 3: Scan for PII
|
|
138
|
-
console.log('🔍 Scanning for PII...');
|
|
139
|
-
const piiScan = scanCFPForPII(genesis);
|
|
140
|
-
if (piiScan.found) {
|
|
141
|
-
console.log(` Found ${piiScan.count} PII items:`);
|
|
142
|
-
for (const [type, count] of Object.entries(piiScan.types)) {
|
|
143
|
-
console.log(` - ${type}: ${count}`);
|
|
144
|
-
}
|
|
145
|
-
console.log(' Will be redacted during export.');
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
console.log(' No PII detected!');
|
|
149
|
-
}
|
|
150
|
-
console.log('');
|
|
151
|
-
// Step 4: Export
|
|
152
|
-
console.log(`📤 Exporting with ${options.anonymize} anonymization...`);
|
|
153
|
-
const exportOptions = {
|
|
154
|
-
output: options.output,
|
|
155
|
-
toIpfs: options.toIpfs,
|
|
156
|
-
anonymize: options.anonymize,
|
|
157
|
-
pin: options.pin,
|
|
158
|
-
gateway: options.gateway,
|
|
159
|
-
format: 'json',
|
|
160
|
-
redactPii: true,
|
|
161
|
-
};
|
|
162
|
-
// If no output specified and not uploading to IPFS, create default output
|
|
163
|
-
if (!options.output && !options.toIpfs) {
|
|
164
|
-
const defaultOutput = path.join(process.cwd(), 'seraphine-genesis.cfp.json');
|
|
165
|
-
exportOptions.output = defaultOutput;
|
|
166
|
-
}
|
|
167
|
-
const result = await exportPatterns(genesis, exportOptions);
|
|
168
|
-
console.log('');
|
|
169
|
-
console.log('═══════════════════════════════════════════════════════════');
|
|
170
|
-
console.log(' DEPLOYMENT COMPLETE ');
|
|
171
|
-
console.log('═══════════════════════════════════════════════════════════');
|
|
172
|
-
console.log('');
|
|
173
|
-
if (result.success) {
|
|
174
|
-
console.log('✅ Successfully deployed Seraphine Genesis!');
|
|
175
|
-
console.log('');
|
|
176
|
-
console.log(' 📊 Export Summary:');
|
|
177
|
-
console.log(` Patterns: ${result.patternCount}`);
|
|
178
|
-
console.log(` Size: ${result.size} bytes`);
|
|
179
|
-
console.log(` Anonymization: ${result.anonymizationLevel}`);
|
|
180
|
-
if (result.outputPath) {
|
|
181
|
-
console.log('');
|
|
182
|
-
console.log(` 📁 File: ${result.outputPath}`);
|
|
183
|
-
}
|
|
184
|
-
if (result.cid) {
|
|
185
|
-
console.log('');
|
|
186
|
-
console.log(' 🌐 IPFS:');
|
|
187
|
-
console.log(` CID: ${result.cid}`);
|
|
188
|
-
console.log(` Gateway URL: ${result.gateway}/ipfs/${result.cid}`);
|
|
189
|
-
}
|
|
190
|
-
console.log('');
|
|
191
|
-
console.log(' 🎉 Hello World! The genesis pattern has been deployed.');
|
|
192
|
-
console.log(' 🌟 This is the first Monomind pattern ever shared.');
|
|
193
|
-
console.log('');
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
console.error('❌ Deployment failed!');
|
|
197
|
-
process.exit(1);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
// Run if executed directly
|
|
201
|
-
deploy().catch(error => {
|
|
202
|
-
console.error('Fatal error:', error);
|
|
203
|
-
process.exit(1);
|
|
204
|
-
});
|
|
205
|
-
//# sourceMappingURL=deploy-seraphine.js.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env npx tsx
|
|
2
|
-
/**
|
|
3
|
-
* Standalone Pattern Store Test
|
|
4
|
-
* Run this in any environment to verify the IPFS-based pattern store works
|
|
5
|
-
*
|
|
6
|
-
* Usage:
|
|
7
|
-
* npx tsx standalone-test.ts
|
|
8
|
-
* # or
|
|
9
|
-
* npm run test:pattern-store
|
|
10
|
-
*/
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=standalone-test.d.ts.map
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env npx tsx
|
|
2
|
-
/**
|
|
3
|
-
* Standalone Pattern Store Test
|
|
4
|
-
* Run this in any environment to verify the IPFS-based pattern store works
|
|
5
|
-
*
|
|
6
|
-
* Usage:
|
|
7
|
-
* npx tsx standalone-test.ts
|
|
8
|
-
* # or
|
|
9
|
-
* npm run test:pattern-store
|
|
10
|
-
*/
|
|
11
|
-
import { PatternStore, createDiscoveryService, searchPatterns, getFeaturedPatterns, getTrendingPatterns, getNewestPatterns, getCategoryStats, getTagCloud, getSearchSuggestions, } from '../index.js';
|
|
12
|
-
async function main() {
|
|
13
|
-
console.log('');
|
|
14
|
-
console.log('╔══════════════════════════════════════════════════════════════╗');
|
|
15
|
-
console.log('║ MONOMIND - STANDALONE PATTERN STORE TEST ║');
|
|
16
|
-
console.log('║ IPFS-Based Decentralized Pattern Marketplace ║');
|
|
17
|
-
console.log('╚══════════════════════════════════════════════════════════════╝');
|
|
18
|
-
console.log('');
|
|
19
|
-
let passed = 0;
|
|
20
|
-
let failed = 0;
|
|
21
|
-
// Test 1: Discovery Service Creation
|
|
22
|
-
console.log('▶ Test 1: Create Discovery Service');
|
|
23
|
-
try {
|
|
24
|
-
const discovery = createDiscoveryService();
|
|
25
|
-
const registries = discovery.listRegistries();
|
|
26
|
-
console.log(` ✅ Created service with ${registries.length} bootstrap registries`);
|
|
27
|
-
passed++;
|
|
28
|
-
}
|
|
29
|
-
catch (e) {
|
|
30
|
-
console.log(` ❌ Failed: ${e.message}`);
|
|
31
|
-
failed++;
|
|
32
|
-
}
|
|
33
|
-
// Test 2: Discover Registry
|
|
34
|
-
console.log('▶ Test 2: Discover Registry via IPNS');
|
|
35
|
-
let registry = null;
|
|
36
|
-
try {
|
|
37
|
-
const discovery = createDiscoveryService();
|
|
38
|
-
const result = await discovery.discoverRegistry();
|
|
39
|
-
if (result.success && result.registry) {
|
|
40
|
-
registry = result.registry;
|
|
41
|
-
console.log(` ✅ Discovered ${result.registry.patterns.length} patterns from ${result.source}`);
|
|
42
|
-
passed++;
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
throw new Error(result.error || 'No registry');
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
catch (e) {
|
|
49
|
-
console.log(` ❌ Failed: ${e.message}`);
|
|
50
|
-
failed++;
|
|
51
|
-
}
|
|
52
|
-
if (!registry) {
|
|
53
|
-
console.log('\n❌ Cannot continue without registry\n');
|
|
54
|
-
process.exit(1);
|
|
55
|
-
}
|
|
56
|
-
// Test 3: Search Patterns
|
|
57
|
-
console.log('▶ Test 3: Search for "agent"');
|
|
58
|
-
try {
|
|
59
|
-
const results = searchPatterns(registry, { query: 'agent' });
|
|
60
|
-
console.log(` ✅ Found ${results.patterns.length} patterns matching "agent"`);
|
|
61
|
-
passed++;
|
|
62
|
-
}
|
|
63
|
-
catch (e) {
|
|
64
|
-
console.log(` ❌ Failed: ${e.message}`);
|
|
65
|
-
failed++;
|
|
66
|
-
}
|
|
67
|
-
// Test 4: Get Featured Patterns
|
|
68
|
-
console.log('▶ Test 4: Get Featured Patterns');
|
|
69
|
-
try {
|
|
70
|
-
const featured = getFeaturedPatterns(registry);
|
|
71
|
-
console.log(` ✅ Found ${featured.length} featured patterns`);
|
|
72
|
-
if (featured.length > 0) {
|
|
73
|
-
console.log(` - ${featured[0].name} (${featured[0].id})`);
|
|
74
|
-
}
|
|
75
|
-
passed++;
|
|
76
|
-
}
|
|
77
|
-
catch (e) {
|
|
78
|
-
console.log(` ❌ Failed: ${e.message}`);
|
|
79
|
-
failed++;
|
|
80
|
-
}
|
|
81
|
-
// Test 5: Get Trending Patterns
|
|
82
|
-
console.log('▶ Test 5: Get Trending Patterns');
|
|
83
|
-
try {
|
|
84
|
-
const trending = getTrendingPatterns(registry);
|
|
85
|
-
console.log(` ✅ Found ${trending.length} trending patterns`);
|
|
86
|
-
passed++;
|
|
87
|
-
}
|
|
88
|
-
catch (e) {
|
|
89
|
-
console.log(` ❌ Failed: ${e.message}`);
|
|
90
|
-
failed++;
|
|
91
|
-
}
|
|
92
|
-
// Test 6: Get Newest Patterns
|
|
93
|
-
console.log('▶ Test 6: Get Newest Patterns');
|
|
94
|
-
try {
|
|
95
|
-
const newest = getNewestPatterns(registry);
|
|
96
|
-
console.log(` ✅ Found ${newest.length} newest patterns`);
|
|
97
|
-
passed++;
|
|
98
|
-
}
|
|
99
|
-
catch (e) {
|
|
100
|
-
console.log(` ❌ Failed: ${e.message}`);
|
|
101
|
-
failed++;
|
|
102
|
-
}
|
|
103
|
-
// Test 7: Search with Filters
|
|
104
|
-
console.log('▶ Test 7: Search with Filters (verified only)');
|
|
105
|
-
try {
|
|
106
|
-
const results = searchPatterns(registry, { verified: true });
|
|
107
|
-
console.log(` ✅ Found ${results.patterns.length} verified patterns`);
|
|
108
|
-
passed++;
|
|
109
|
-
}
|
|
110
|
-
catch (e) {
|
|
111
|
-
console.log(` ❌ Failed: ${e.message}`);
|
|
112
|
-
failed++;
|
|
113
|
-
}
|
|
114
|
-
// Test 8: Category Stats
|
|
115
|
-
console.log('▶ Test 8: Get Category Statistics');
|
|
116
|
-
try {
|
|
117
|
-
const stats = getCategoryStats(registry);
|
|
118
|
-
const count = Array.isArray(stats) ? stats.length : Object.keys(stats).length;
|
|
119
|
-
console.log(` ✅ Found ${count} categories with stats`);
|
|
120
|
-
passed++;
|
|
121
|
-
}
|
|
122
|
-
catch (e) {
|
|
123
|
-
console.log(` ❌ Failed: ${e.message}`);
|
|
124
|
-
failed++;
|
|
125
|
-
}
|
|
126
|
-
// Test 9: Tag Cloud
|
|
127
|
-
console.log('▶ Test 9: Get Tag Cloud');
|
|
128
|
-
try {
|
|
129
|
-
const tags = getTagCloud(registry);
|
|
130
|
-
console.log(` ✅ Found ${tags.size} unique tags`);
|
|
131
|
-
passed++;
|
|
132
|
-
}
|
|
133
|
-
catch (e) {
|
|
134
|
-
console.log(` ❌ Failed: ${e.message}`);
|
|
135
|
-
failed++;
|
|
136
|
-
}
|
|
137
|
-
// Test 10: Search Suggestions
|
|
138
|
-
console.log('▶ Test 10: Get Search Suggestions');
|
|
139
|
-
try {
|
|
140
|
-
const suggestions = getSearchSuggestions(registry, 'pat');
|
|
141
|
-
console.log(` ✅ Got ${suggestions.length} suggestions for "pat"`);
|
|
142
|
-
passed++;
|
|
143
|
-
}
|
|
144
|
-
catch (e) {
|
|
145
|
-
console.log(` ❌ Failed: ${e.message}`);
|
|
146
|
-
failed++;
|
|
147
|
-
}
|
|
148
|
-
// Test 11: PatternStore Class
|
|
149
|
-
console.log('▶ Test 11: PatternStore Class API');
|
|
150
|
-
try {
|
|
151
|
-
const store = new PatternStore();
|
|
152
|
-
await store.initialize();
|
|
153
|
-
const stats = store.getStats();
|
|
154
|
-
console.log(` ✅ PatternStore initialized:`);
|
|
155
|
-
console.log(` Total Patterns: ${stats.totalPatterns}`);
|
|
156
|
-
console.log(` Total Downloads: ${stats.totalDownloads.toLocaleString()}`);
|
|
157
|
-
console.log(` Categories: ${stats.categories}`);
|
|
158
|
-
passed++;
|
|
159
|
-
}
|
|
160
|
-
catch (e) {
|
|
161
|
-
console.log(` ❌ Failed: ${e.message}`);
|
|
162
|
-
failed++;
|
|
163
|
-
}
|
|
164
|
-
// Summary
|
|
165
|
-
console.log('');
|
|
166
|
-
console.log('═══════════════════════════════════════════════════════════════');
|
|
167
|
-
console.log(' TEST RESULTS ');
|
|
168
|
-
console.log('═══════════════════════════════════════════════════════════════');
|
|
169
|
-
console.log('');
|
|
170
|
-
console.log(` Total: ${passed + failed}`);
|
|
171
|
-
console.log(` ✅ Passed: ${passed}`);
|
|
172
|
-
console.log(` ❌ Failed: ${failed}`);
|
|
173
|
-
console.log('');
|
|
174
|
-
if (failed === 0) {
|
|
175
|
-
console.log(' 🎉 All tests passed! Pattern Store is working correctly.');
|
|
176
|
-
console.log('');
|
|
177
|
-
console.log(' Available CLI Commands:');
|
|
178
|
-
console.log(' npx @monoes/cli patterns list');
|
|
179
|
-
console.log(' npx @monoes/cli patterns list --featured');
|
|
180
|
-
console.log(' npx @monoes/cli patterns search -q "agent"');
|
|
181
|
-
console.log(' npx @monoes/cli patterns info -n <pattern-id>');
|
|
182
|
-
console.log('');
|
|
183
|
-
}
|
|
184
|
-
process.exit(failed > 0 ? 1 : 0);
|
|
185
|
-
}
|
|
186
|
-
main().catch(err => {
|
|
187
|
-
console.error('Fatal error:', err);
|
|
188
|
-
process.exit(1);
|
|
189
|
-
});
|
|
190
|
-
//# sourceMappingURL=standalone-test.js.map
|