@spekn/cli 1.0.2 → 1.0.5
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/main.js +118 -52
- package/dist/resources/prompts/repo-sync-analysis.prompt.md +1 -1
- package/dist/tui/index.mjs +4745 -537
- package/dist/tui/prompts/spec-creation-system.prompt.md +2 -2
- package/dist/tui/prompts/spec-refinement-system.prompt.md +9 -0
- package/package.json +3 -3
- package/dist/tui/chunk-4WEASLXY.mjs +0 -3444
- package/dist/tui/chunk-755CADEG.mjs +0 -3401
- package/dist/tui/chunk-BUJQVTY5.mjs +0 -3409
- package/dist/tui/chunk-BZKKMGFB.mjs +0 -1959
- package/dist/tui/chunk-DJYOBCNM.mjs +0 -3159
- package/dist/tui/chunk-GTFTFDY4.mjs +0 -3417
- package/dist/tui/chunk-IMEBD2KA.mjs +0 -3444
- package/dist/tui/chunk-IX6DR5SW.mjs +0 -3433
- package/dist/tui/chunk-JKFOY4IF.mjs +0 -2003
- package/dist/tui/chunk-OXXZ3O5L.mjs +0 -3378
- package/dist/tui/chunk-SHJNIAAJ.mjs +0 -1697
- package/dist/tui/chunk-V4SNDRUS.mjs +0 -1666
- package/dist/tui/chunk-VXVHNZST.mjs +0 -1666
- package/dist/tui/chunk-WCTSFKTA.mjs +0 -3459
- package/dist/tui/chunk-X2XP5ACW.mjs +0 -3443
- package/dist/tui/chunk-YUYJ7VBG.mjs +0 -2029
- package/dist/tui/chunk-ZM3EI5IA.mjs +0 -3384
- package/dist/tui/chunk-ZYOX64HP.mjs +0 -1653
- package/dist/tui/use-session-store-63YUGUFA.mjs +0 -8
- package/dist/tui/use-session-store-ACO2SMJC.mjs +0 -8
- package/dist/tui/use-session-store-BVFDAWOB.mjs +0 -8
- package/dist/tui/use-session-store-DJIZ3FQZ.mjs +0 -9
- package/dist/tui/use-session-store-EAIQA4UG.mjs +0 -9
- package/dist/tui/use-session-store-EFBAXC3G.mjs +0 -8
- package/dist/tui/use-session-store-FJOR4KTG.mjs +0 -8
- package/dist/tui/use-session-store-IJE5KVOC.mjs +0 -8
- package/dist/tui/use-session-store-KGAFXCKI.mjs +0 -8
- package/dist/tui/use-session-store-KS4DPNDY.mjs +0 -8
- package/dist/tui/use-session-store-MMHJENNL.mjs +0 -8
- package/dist/tui/use-session-store-OZ6HC4I2.mjs +0 -9
- package/dist/tui/use-session-store-PTMWISNJ.mjs +0 -8
- package/dist/tui/use-session-store-VCDECQMW.mjs +0 -8
- package/dist/tui/use-session-store-VOK5ML5J.mjs +0 -9
package/dist/main.js
CHANGED
|
@@ -6123,8 +6123,8 @@ var require_SpecificationGeneration = __commonJS({
|
|
|
6123
6123
|
status;
|
|
6124
6124
|
content;
|
|
6125
6125
|
frontmatter;
|
|
6126
|
-
|
|
6127
|
-
|
|
6126
|
+
activatedBy;
|
|
6127
|
+
activatedAt;
|
|
6128
6128
|
qualityScore;
|
|
6129
6129
|
qualityGrade;
|
|
6130
6130
|
qualityBreakdown;
|
|
@@ -6171,13 +6171,13 @@ var require_SpecificationGeneration = __commonJS({
|
|
|
6171
6171
|
nullable: true
|
|
6172
6172
|
}),
|
|
6173
6173
|
__metadata("design:type", String)
|
|
6174
|
-
], SpecificationGeneration.prototype, "
|
|
6174
|
+
], SpecificationGeneration.prototype, "activatedBy", void 0);
|
|
6175
6175
|
__decorate([
|
|
6176
6176
|
(0, typeorm_1.Column)("timestamp", {
|
|
6177
6177
|
nullable: true
|
|
6178
6178
|
}),
|
|
6179
6179
|
__metadata("design:type", Date)
|
|
6180
|
-
], SpecificationGeneration.prototype, "
|
|
6180
|
+
], SpecificationGeneration.prototype, "activatedAt", void 0);
|
|
6181
6181
|
__decorate([
|
|
6182
6182
|
(0, typeorm_1.Column)("integer", {
|
|
6183
6183
|
nullable: true
|
|
@@ -6274,7 +6274,7 @@ var require_Specification = __commonJS({
|
|
|
6274
6274
|
(function(SpecificationStatus2) {
|
|
6275
6275
|
SpecificationStatus2["DRAFT"] = "draft";
|
|
6276
6276
|
SpecificationStatus2["REVIEW"] = "review";
|
|
6277
|
-
SpecificationStatus2["
|
|
6277
|
+
SpecificationStatus2["ACTIVE"] = "active";
|
|
6278
6278
|
SpecificationStatus2["ARCHIVED"] = "archived";
|
|
6279
6279
|
})(SpecificationStatus || (exports2.SpecificationStatus = SpecificationStatus = {}));
|
|
6280
6280
|
var Specification2 = class Specification {
|
|
@@ -6287,9 +6287,6 @@ var require_Specification = __commonJS({
|
|
|
6287
6287
|
status;
|
|
6288
6288
|
version;
|
|
6289
6289
|
specRef;
|
|
6290
|
-
isLocked;
|
|
6291
|
-
lockedBy;
|
|
6292
|
-
lockedAt;
|
|
6293
6290
|
frontmatter;
|
|
6294
6291
|
project;
|
|
6295
6292
|
projectId;
|
|
@@ -6343,24 +6340,6 @@ var require_Specification = __commonJS({
|
|
|
6343
6340
|
}),
|
|
6344
6341
|
__metadata("design:type", String)
|
|
6345
6342
|
], Specification2.prototype, "specRef", void 0);
|
|
6346
|
-
__decorate([
|
|
6347
|
-
(0, typeorm_1.Column)("boolean", {
|
|
6348
|
-
default: false
|
|
6349
|
-
}),
|
|
6350
|
-
__metadata("design:type", Boolean)
|
|
6351
|
-
], Specification2.prototype, "isLocked", void 0);
|
|
6352
|
-
__decorate([
|
|
6353
|
-
(0, typeorm_1.Column)("text", {
|
|
6354
|
-
nullable: true
|
|
6355
|
-
}),
|
|
6356
|
-
__metadata("design:type", String)
|
|
6357
|
-
], Specification2.prototype, "lockedBy", void 0);
|
|
6358
|
-
__decorate([
|
|
6359
|
-
(0, typeorm_1.Column)("timestamp", {
|
|
6360
|
-
nullable: true
|
|
6361
|
-
}),
|
|
6362
|
-
__metadata("design:type", Date)
|
|
6363
|
-
], Specification2.prototype, "lockedAt", void 0);
|
|
6364
6343
|
__decorate([
|
|
6365
6344
|
(0, typeorm_1.Column)("jsonb", {
|
|
6366
6345
|
nullable: true
|
|
@@ -7305,6 +7284,8 @@ var require_BridgeDevice = __commonJS({
|
|
|
7305
7284
|
lastBridgeVersion;
|
|
7306
7285
|
/** Last time the device was seen online (heartbeat). */
|
|
7307
7286
|
lastSeenAt;
|
|
7287
|
+
/** Local HTTP port the bridge is listening on, reported during WS auth. */
|
|
7288
|
+
localPort;
|
|
7308
7289
|
metadata;
|
|
7309
7290
|
createdAt;
|
|
7310
7291
|
updatedAt;
|
|
@@ -7361,6 +7342,12 @@ var require_BridgeDevice = __commonJS({
|
|
|
7361
7342
|
}),
|
|
7362
7343
|
__metadata("design:type", Object)
|
|
7363
7344
|
], BridgeDevice.prototype, "lastSeenAt", void 0);
|
|
7345
|
+
__decorate([
|
|
7346
|
+
(0, typeorm_1.Column)("integer", {
|
|
7347
|
+
nullable: true
|
|
7348
|
+
}),
|
|
7349
|
+
__metadata("design:type", Object)
|
|
7350
|
+
], BridgeDevice.prototype, "localPort", void 0);
|
|
7364
7351
|
__decorate([
|
|
7365
7352
|
(0, typeorm_1.Column)("jsonb", {
|
|
7366
7353
|
nullable: true
|
|
@@ -10344,7 +10331,7 @@ var require_skill_packs = __commonJS({
|
|
|
10344
10331
|
{
|
|
10345
10332
|
name: "spekn-spec-manager",
|
|
10346
10333
|
namespace: "spekn",
|
|
10347
|
-
description: "Manage the specification lifecycle \u2014 create, update,
|
|
10334
|
+
description: "Manage the specification lifecycle \u2014 create, update, activate, generate, review, and refine specs.",
|
|
10348
10335
|
author: "spekn",
|
|
10349
10336
|
tags: [
|
|
10350
10337
|
"specification",
|
|
@@ -10836,10 +10823,11 @@ var require_specification_frontmatter = __commonJS({
|
|
|
10836
10823
|
Object.defineProperty(exports2, "__esModule", {
|
|
10837
10824
|
value: true
|
|
10838
10825
|
});
|
|
10839
|
-
exports2.SpecificationFrontmatterSchema = exports2.ANCHOR_COMPLEXITIES = exports2.ANCHOR_STATUSES = exports2.ACP_POLICY_MODES = exports2.CATEGORY_TYPE_MAP = exports2.SPECIFICATION_DEPTHS = exports2.SPECIFICATION_CATEGORIES = exports2.SPECIFICATION_STATUSES = exports2.SPECIFICATION_TYPES = exports2.HINT_MAX_LENGTH = exports2.FRONTMATTER_MAX_SIZE_BYTES = void 0;
|
|
10826
|
+
exports2.SpecificationFrontmatterSchema = exports2.ANCHOR_COMPLEXITIES = exports2.ANCHOR_STATUSES = exports2.ACP_POLICY_MODES = exports2.CATEGORY_TYPE_MAP = exports2.SPECIFICATION_DEPTHS = exports2.SPECIFICATION_CATEGORIES = exports2.SPECIFICATION_STATUSES = exports2.SPECIFICATION_TYPES = exports2.HINT_MAX_LENGTH = exports2.FRONTMATTER_MAX_SIZE_BYTES = exports2.FRONTMATTER_MAX_TOKENS = void 0;
|
|
10840
10827
|
exports2.validateFrontmatterSize = validateFrontmatterSize;
|
|
10841
10828
|
var zod_1 = require("zod");
|
|
10842
|
-
exports2.
|
|
10829
|
+
exports2.FRONTMATTER_MAX_TOKENS = 1024;
|
|
10830
|
+
exports2.FRONTMATTER_MAX_SIZE_BYTES = exports2.FRONTMATTER_MAX_TOKENS * 4;
|
|
10843
10831
|
exports2.HINT_MAX_LENGTH = 200;
|
|
10844
10832
|
exports2.SPECIFICATION_TYPES = [
|
|
10845
10833
|
"intent",
|
|
@@ -11029,7 +11017,7 @@ var require_frontmatter_parser = __commonJS({
|
|
|
11029
11017
|
hasFrontmatter: true,
|
|
11030
11018
|
autoGenerated: false,
|
|
11031
11019
|
errors: [
|
|
11032
|
-
`Frontmatter exceeds ${specification_frontmatter_1.FRONTMATTER_MAX_SIZE_BYTES}
|
|
11020
|
+
`Frontmatter exceeds ${specification_frontmatter_1.FRONTMATTER_MAX_TOKENS} token limit (${specification_frontmatter_1.FRONTMATTER_MAX_SIZE_BYTES} bytes). Trim hints and remove optional fields.`
|
|
11033
11021
|
]
|
|
11034
11022
|
};
|
|
11035
11023
|
}
|
|
@@ -15761,9 +15749,9 @@ var require_dist4 = __commonJS({
|
|
|
15761
15749
|
});
|
|
15762
15750
|
exports2.SystemRole = exports2.SpecificationVersion = exports2.GenerationStatus = exports2.SpecificationGeneration = exports2.SpecificationStatus = exports2.Specification = exports2.RunUsage = exports2.WorkerAgentType = exports2.RunStatus = exports2.Run = exports2.Project = exports2.OrganizationCreditLedgerEntryType = exports2.OrganizationCreditLedger = exports2.OrganizationCreditWalletStatus = exports2.OrganizationCreditWallet = exports2.OrganizationApiKey = exports2.OrgMemberRole = exports2.OrganizationPlan = exports2.Organization = exports2.OrchestrationTemplate = exports2.OrchestrationPolicy = exports2.NoteType = exports2.Note = exports2.MergeRequestStatus = exports2.MergeRequest = exports2.GitRepository = exports2.EM_ACTION_TYPES = exports2.EMActionStatus = exports2.EMActionExecutionStatus = exports2.EMActionLog = exports2.validateDecisionChains = exports2.validateRollbackChain = exports2.validateSupersessionChain = exports2.MAX_CHAIN_DEPTH = exports2.DecisionType = exports2.DecisionStatus = exports2.Decision = exports2.AiProviderType = exports2.AiProvider = exports2.ModelType = exports2.CapabilityTier = exports2.AiModel = exports2.BridgePairingCode = exports2.BridgeDeviceRepository = exports2.BridgeDeviceStatus = exports2.BridgeDevice = exports2.ACPCompatMode = exports2.AgentInstallLocation = exports2.AgentSource = exports2.AgentConfig = void 0;
|
|
15763
15751
|
exports2.seedOrchestrationTemplates = exports2.MANAGED_SKILL_PACKS = exports2.seedManagedSkillPacks = exports2.SkillProposalStateMachine = exports2.ACTIVITY_EVENT_TYPE = exports2.ACTIVITY_SOURCE = exports2.ActivityEvent = exports2.ExportScopeMapping = exports2.ExportDeliveryMode = exports2.ExportArtifactRecord = exports2.GitHubDeadLetter = exports2.GitHubEvent = exports2.GitHubRepoMapping = exports2.RepositorySelection = exports2.GitHubAccountType = exports2.GitHubInstallation = exports2.PluginArtifact = exports2.SkillProposalType = exports2.SkillProposalStatus = exports2.SkillProposal = exports2.SkillTriggerType = exports2.SkillVersionStatus = exports2.SkillVersion = exports2.SkillPackStatus = exports2.SkillPack = exports2.DeviationStatus = exports2.DeviationSeverity = exports2.DeviationType = exports2.DeviationRecord = exports2.DecisionSeverity = exports2.RunDecisionType = exports2.DecisionRecord = exports2.RunReportStatus = exports2.RunReport = exports2.WorktreeStatus = exports2.Worktree = exports2.SpecificationLockStatus = exports2.WorkflowPhase = exports2.WorkflowState = exports2.WaitlistEntry = exports2.VerificationStatus = exports2.VerificationType = exports2.Verification = exports2.McpApiKey = exports2.UserApiKey = exports2.UserRole = exports2.User = exports2.TaskPriority = exports2.TaskStatus = exports2.Task = void 0;
|
|
15764
|
-
exports2.
|
|
15765
|
-
exports2.
|
|
15766
|
-
exports2.createCallerFactory = exports2.procedure = exports2.router = exports2.t = exports2.SpecQualityScorer = exports2.scoreSpecification = exports2.getRequiredPlan = exports2.PROJECT_CREATION_LIMITS = void 0;
|
|
15752
|
+
exports2.PluginInstallResponseSchema = exports2.PluginInstallRequestSchema = exports2.PluginPublishResponseSchema = exports2.PluginPublishRequestSchema = exports2.MarketplaceSearchResultSchema = exports2.MarketplaceSearchParamsSchema = exports2.MarketplaceCatalogEntrySchema = exports2.EXPORT_FORMAT_IDS = exports2.CONTEXT_LAYER_TYPES = exports2.DecisionTypeSchema = exports2.DecisionStatusTypeSchema = exports2.DecisionFetchResponseSchema = exports2.DecisionChainLinkSchema = exports2.DecisionFetchScopeSchema = exports2.ContextBundleResponseSchema = exports2.ContextBundleRequestSchema = exports2.clearPromptCache = exports2.resolveIncludes = exports2.interpolateTemplate = exports2.loadPromptTemplate = exports2.resolveSpecCategory = exports2.inferTypeFromContent = exports2.extractAnchorPaths = exports2.autoGenerateFrontmatter = exports2.serializeFrontmatter = exports2.parseSpecificationFrontmatter = exports2.CATEGORY_TYPE_MAP = exports2.SPECIFICATION_DEPTHS = exports2.SPECIFICATION_CATEGORIES = exports2.SPECIFICATION_STATUSES = exports2.SPECIFICATION_TYPES = exports2.HINT_MAX_LENGTH = exports2.FRONTMATTER_MAX_TOKENS = exports2.FRONTMATTER_MAX_SIZE_BYTES = exports2.validateFrontmatterSize = exports2.SpecificationFrontmatterSchema = exports2.SkillProposalStatusType = exports2.SkillPackStatusType = exports2.parseLegacyFrontmatter = exports2.RESERVED_SKILL_PREFIXES = exports2.SKILL_NAME_PATTERN = exports2.SkillSearchResultSchema = exports2.SkillSearchParamsSchema = exports2.SkillLintResultSchema = exports2.SkillProposalSchema = exports2.SkillVersionSchema = exports2.SkillPackSchema = exports2.SkillFrontmatterSchemaOriginal = exports2.SkillFrontmatterSchema = exports2.DEFAULT_GOVERNANCE_POLICY = void 0;
|
|
15753
|
+
exports2.ORG_CREATION_LIMITS = exports2.VECTOR_MEMORY_QUOTAS = exports2.FEATURE_TO_MIN_PLAN = exports2.getSatisfyingPlans = exports2.meetsMinimumTier = exports2.TIER_ORDER = exports2.hasPermissions = exports2.requirePermission = exports2.PERMISSIONS = exports2.extractUserIdentity = exports2.extractOrgRoles = exports2.decodeJwtPayload = exports2.CredentialsStore = exports2.AuthUserSchema = exports2.BRIDGE_RECONNECT_MAX_MS = exports2.BRIDGE_RECONNECT_BASE_MS = exports2.BRIDGE_HEARTBEAT_TIMEOUT_MS = exports2.BRIDGE_HEARTBEAT_INTERVAL_MS = exports2.BRIDGE_WS_PATH = exports2.emitRunStarted = exports2.emitRunFailed = exports2.emitRunCompleted = exports2.RUN_EVENTS = exports2.runEventEmitter = exports2.ensureCoreProjectSchema = exports2.resolvePgAdminClientConfig = exports2.resolvePgClientConfig = exports2.resolveDatabaseConfig = exports2.AppDataSource = exports2.DEFAULT_PLUGIN_LAYOUT = exports2.DEFAULT_MIGRATION_POLICY = exports2.DEFAULT_UPDATE_POLICY = exports2.DEFAULT_SCOPE_MAPPING = exports2.DEFAULT_NAMESPACE_POLICY = exports2.PluginRepositoryLayoutSchema = exports2.SpeknPluginManifestSchema = exports2.ClaudeCodeMarketplaceSchema = exports2.ClaudeCodeMarketplaceMetadataSchema = exports2.ClaudeCodePluginEntrySchema = exports2.ClaudeCodePluginAuthorSchema = exports2.ClaudeCodeHookMatcherSchema = exports2.ClaudeCodeHookEntrySchema = exports2.ClaudeCodePluginSourceSchema = exports2.ClaudeCodeOwnerSchema = exports2.PLUGIN_DEPRECATION_REASONS = exports2.MARKETPLACE_SORT_ORDERS = exports2.MARKETPLACE_SORT_FIELDS = exports2.MarketplaceCatalogManifestSchema = exports2.VersionCompatibilitySchema = exports2.PluginDeprecationRequestSchema = void 0;
|
|
15754
|
+
exports2.createCallerFactory = exports2.procedure = exports2.router = exports2.t = exports2.SpecQualityScorer = exports2.scoreSpecification = exports2.getRequiredPlan = exports2.PROJECT_CREATION_LIMITS = exports2.ORG_MEMBER_LIMITS = void 0;
|
|
15767
15755
|
var AgentConfig_1 = require_AgentConfig();
|
|
15768
15756
|
Object.defineProperty(exports2, "AgentConfig", {
|
|
15769
15757
|
enumerable: true,
|
|
@@ -16523,6 +16511,12 @@ var require_dist4 = __commonJS({
|
|
|
16523
16511
|
return specification_frontmatter_1.FRONTMATTER_MAX_SIZE_BYTES;
|
|
16524
16512
|
}, "get")
|
|
16525
16513
|
});
|
|
16514
|
+
Object.defineProperty(exports2, "FRONTMATTER_MAX_TOKENS", {
|
|
16515
|
+
enumerable: true,
|
|
16516
|
+
get: /* @__PURE__ */ __name(function() {
|
|
16517
|
+
return specification_frontmatter_1.FRONTMATTER_MAX_TOKENS;
|
|
16518
|
+
}, "get")
|
|
16519
|
+
});
|
|
16526
16520
|
Object.defineProperty(exports2, "HINT_MAX_LENGTH", {
|
|
16527
16521
|
enumerable: true,
|
|
16528
16522
|
get: /* @__PURE__ */ __name(function() {
|
|
@@ -41232,8 +41226,7 @@ ${spec2.content}`).join("\n\n");
|
|
|
41232
41226
|
projectId: payload.project_id,
|
|
41233
41227
|
title: payload.title,
|
|
41234
41228
|
content: payload.content,
|
|
41235
|
-
status: shared_1.SpecificationStatus.DRAFT
|
|
41236
|
-
isLocked: false
|
|
41229
|
+
status: shared_1.SpecificationStatus.DRAFT
|
|
41237
41230
|
});
|
|
41238
41231
|
const created = await dataSource.getRepository(shared_1.Specification).save(spec2);
|
|
41239
41232
|
return {
|
|
@@ -41268,11 +41261,11 @@ ${payload.content}`;
|
|
|
41268
41261
|
});
|
|
41269
41262
|
if (!specification) throw new Error("Specification not found");
|
|
41270
41263
|
assertProjectScope(specification.projectId, context2.projectId);
|
|
41271
|
-
specification.status = shared_1.SpecificationStatus.
|
|
41264
|
+
specification.status = shared_1.SpecificationStatus.ACTIVE;
|
|
41272
41265
|
const saved = await dataSource.getRepository(shared_1.Specification).save(specification);
|
|
41273
41266
|
return {
|
|
41274
41267
|
specification_id: saved.id,
|
|
41275
|
-
|
|
41268
|
+
activated: true
|
|
41276
41269
|
};
|
|
41277
41270
|
}, "spec_lock"),
|
|
41278
41271
|
task_create: /* @__PURE__ */ __name(async (action, context2) => {
|
|
@@ -81115,6 +81108,25 @@ __export(export_exports, {
|
|
|
81115
81108
|
parseArgs: () => parseArgs7,
|
|
81116
81109
|
runExportCli: () => runExportCli
|
|
81117
81110
|
});
|
|
81111
|
+
function mergeJsonConfig(existingContent, newContent) {
|
|
81112
|
+
try {
|
|
81113
|
+
const existing = JSON.parse(existingContent);
|
|
81114
|
+
const incoming = JSON.parse(newContent);
|
|
81115
|
+
for (const [key, value] of Object.entries(incoming)) {
|
|
81116
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value) && typeof existing[key] === "object" && existing[key] !== null && !Array.isArray(existing[key])) {
|
|
81117
|
+
existing[key] = {
|
|
81118
|
+
...existing[key],
|
|
81119
|
+
...value
|
|
81120
|
+
};
|
|
81121
|
+
} else {
|
|
81122
|
+
existing[key] = value;
|
|
81123
|
+
}
|
|
81124
|
+
}
|
|
81125
|
+
return JSON.stringify(existing, null, 2) + "\n";
|
|
81126
|
+
} catch {
|
|
81127
|
+
return newContent;
|
|
81128
|
+
}
|
|
81129
|
+
}
|
|
81118
81130
|
function normalizeTrpcUrl(apiUrl) {
|
|
81119
81131
|
if (apiUrl.endsWith("/trpc")) {
|
|
81120
81132
|
return apiUrl;
|
|
@@ -81157,6 +81169,7 @@ function parseArgs7(args) {
|
|
|
81157
81169
|
const parseArgs22 = command === "generate" ? args : args.slice(1);
|
|
81158
81170
|
let projectId = "";
|
|
81159
81171
|
let format = "";
|
|
81172
|
+
let platforms;
|
|
81160
81173
|
let output;
|
|
81161
81174
|
let anchors;
|
|
81162
81175
|
let mode = "global";
|
|
@@ -81194,6 +81207,14 @@ function parseArgs7(args) {
|
|
|
81194
81207
|
format = arg.slice("--format=".length);
|
|
81195
81208
|
continue;
|
|
81196
81209
|
}
|
|
81210
|
+
if (arg === "--platforms" && parseArgs22[index + 1]) {
|
|
81211
|
+
platforms = parseArgs22[++index].split(",").map((p) => p.trim()).filter(Boolean);
|
|
81212
|
+
continue;
|
|
81213
|
+
}
|
|
81214
|
+
if (arg.startsWith("--platforms=")) {
|
|
81215
|
+
platforms = arg.slice("--platforms=".length).split(",").map((p) => p.trim()).filter(Boolean);
|
|
81216
|
+
continue;
|
|
81217
|
+
}
|
|
81197
81218
|
if (arg === "--output" && parseArgs22[index + 1]) {
|
|
81198
81219
|
output = parseArgs22[++index];
|
|
81199
81220
|
continue;
|
|
@@ -81283,7 +81304,23 @@ function parseArgs7(args) {
|
|
|
81283
81304
|
continue;
|
|
81284
81305
|
}
|
|
81285
81306
|
}
|
|
81286
|
-
|
|
81307
|
+
const validPlatforms = [
|
|
81308
|
+
"claude-code",
|
|
81309
|
+
"codex",
|
|
81310
|
+
"gemini",
|
|
81311
|
+
"opencode",
|
|
81312
|
+
"vibe"
|
|
81313
|
+
];
|
|
81314
|
+
if (platforms?.length) {
|
|
81315
|
+
if (format) {
|
|
81316
|
+
throw new Error("--format and --platforms are mutually exclusive");
|
|
81317
|
+
}
|
|
81318
|
+
for (const p of platforms) {
|
|
81319
|
+
if (!validPlatforms.includes(p)) {
|
|
81320
|
+
throw new Error(`Invalid platform "${p}". Allowed values: ${validPlatforms.join(", ")}`);
|
|
81321
|
+
}
|
|
81322
|
+
}
|
|
81323
|
+
} else if (command !== "discover" && ![
|
|
81287
81324
|
"agents-md",
|
|
81288
81325
|
"claude-md",
|
|
81289
81326
|
"cursorrules",
|
|
@@ -81312,6 +81349,7 @@ function parseArgs7(args) {
|
|
|
81312
81349
|
command,
|
|
81313
81350
|
projectId,
|
|
81314
81351
|
format,
|
|
81352
|
+
platforms,
|
|
81315
81353
|
output,
|
|
81316
81354
|
anchors,
|
|
81317
81355
|
mode,
|
|
@@ -81488,7 +81526,13 @@ async function runExportCli(args, deps = defaultDeps) {
|
|
|
81488
81526
|
}
|
|
81489
81527
|
return 0;
|
|
81490
81528
|
}
|
|
81491
|
-
const plan = await client.export.delivery.
|
|
81529
|
+
const plan = options.platforms?.length ? await client.export.delivery.previewMultiPlatform.query({
|
|
81530
|
+
projectId: context2.projectId,
|
|
81531
|
+
platformTargets: options.platforms,
|
|
81532
|
+
mode: options.mode,
|
|
81533
|
+
scopePath: options.scope,
|
|
81534
|
+
anchorFilter: options.anchors
|
|
81535
|
+
}) : await client.export.delivery.previewTarget.query({
|
|
81492
81536
|
projectId: context2.projectId,
|
|
81493
81537
|
formatId: options.format,
|
|
81494
81538
|
mode: options.mode,
|
|
@@ -81554,7 +81598,7 @@ async function main7() {
|
|
|
81554
81598
|
const exitCode = await runExportCli(process.argv.slice(2));
|
|
81555
81599
|
process.exit(exitCode);
|
|
81556
81600
|
}
|
|
81557
|
-
var fs7, path7, defaultDeps;
|
|
81601
|
+
var fs7, path7, MERGEABLE_CONFIG_FILES, defaultDeps;
|
|
81558
81602
|
var init_export = __esm({
|
|
81559
81603
|
"src/commands/export.ts"() {
|
|
81560
81604
|
"use strict";
|
|
@@ -81564,6 +81608,12 @@ var init_export = __esm({
|
|
|
81564
81608
|
init_credentials_store();
|
|
81565
81609
|
init_project_context();
|
|
81566
81610
|
init_structured_log();
|
|
81611
|
+
MERGEABLE_CONFIG_FILES = /* @__PURE__ */ new Set([
|
|
81612
|
+
".mcp.json",
|
|
81613
|
+
".gemini/settings.json",
|
|
81614
|
+
"opencode.jsonc"
|
|
81615
|
+
]);
|
|
81616
|
+
__name(mergeJsonConfig, "mergeJsonConfig");
|
|
81567
81617
|
defaultDeps = {
|
|
81568
81618
|
createClient: /* @__PURE__ */ __name((apiUrl, organizationId, authToken) => createTRPCProxyClient({
|
|
81569
81619
|
links: [
|
|
@@ -81581,6 +81631,14 @@ var init_export = __esm({
|
|
|
81581
81631
|
fs7.mkdirSync(dir, {
|
|
81582
81632
|
recursive: true
|
|
81583
81633
|
});
|
|
81634
|
+
const relativePath = path7.relative(process.cwd(), filePath);
|
|
81635
|
+
const normalizedRelative = relativePath.replace(/\\/g, "/");
|
|
81636
|
+
if (MERGEABLE_CONFIG_FILES.has(normalizedRelative) && fs7.existsSync(filePath)) {
|
|
81637
|
+
const existingContent = fs7.readFileSync(filePath, "utf-8");
|
|
81638
|
+
const merged = mergeJsonConfig(existingContent, content);
|
|
81639
|
+
fs7.writeFileSync(filePath, merged, "utf-8");
|
|
81640
|
+
return;
|
|
81641
|
+
}
|
|
81584
81642
|
fs7.writeFileSync(filePath, content, "utf-8");
|
|
81585
81643
|
}, "writeFile"),
|
|
81586
81644
|
stdout: /* @__PURE__ */ __name((content) => process.stdout.write(content), "stdout"),
|
|
@@ -105917,7 +105975,8 @@ var require_dist18 = __commonJS({
|
|
|
105917
105975
|
"archived"
|
|
105918
105976
|
];
|
|
105919
105977
|
var HINT_MAX_LENGTH2 = 200;
|
|
105920
|
-
var
|
|
105978
|
+
var FRONTMATTER_MAX_TOKENS = 1024;
|
|
105979
|
+
var FRONTMATTER_MAX_SIZE = FRONTMATTER_MAX_TOKENS * 4;
|
|
105921
105980
|
function parseFrontmatter(content) {
|
|
105922
105981
|
const match = FRONTMATTER_REGEX.exec(content);
|
|
105923
105982
|
if (!match) return null;
|
|
@@ -106019,7 +106078,7 @@ var require_dist18 = __commonJS({
|
|
|
106019
106078
|
findings.push({
|
|
106020
106079
|
checkId,
|
|
106021
106080
|
severity: "error",
|
|
106022
|
-
message: `Frontmatter exceeds
|
|
106081
|
+
message: `Frontmatter exceeds ${FRONTMATTER_MAX_TOKENS}-token limit (${sizeBytes} bytes): ${file.relativePath}`,
|
|
106023
106082
|
file: file.relativePath,
|
|
106024
106083
|
autoFixable: false,
|
|
106025
106084
|
speknCta: "Spekn enforces frontmatter size limits during validation"
|
|
@@ -110671,9 +110730,9 @@ AI enhancement skipped: ${aiResult.error}
|
|
|
110671
110730
|
});
|
|
110672
110731
|
return;
|
|
110673
110732
|
}
|
|
110674
|
-
if (!body.formatId) {
|
|
110733
|
+
if (!body.formatId && !body.platformTargets?.length) {
|
|
110675
110734
|
sendJson(res, 400, {
|
|
110676
|
-
error: "formatId is required"
|
|
110735
|
+
error: "formatId or platformTargets is required"
|
|
110677
110736
|
});
|
|
110678
110737
|
return;
|
|
110679
110738
|
}
|
|
@@ -110682,6 +110741,7 @@ AI enhancement skipped: ${aiResult.error}
|
|
|
110682
110741
|
exportId,
|
|
110683
110742
|
projectId: body.projectId,
|
|
110684
110743
|
formatId: body.formatId,
|
|
110744
|
+
platformTargets: body.platformTargets,
|
|
110685
110745
|
apiUrl: body.apiUrl ?? "http://localhost:3001",
|
|
110686
110746
|
mode: body.mode,
|
|
110687
110747
|
scopePath: body.scopePath,
|
|
@@ -112366,17 +112426,20 @@ AI enhancement skipped: ${aiResult.error}
|
|
|
112366
112426
|
}
|
|
112367
112427
|
}
|
|
112368
112428
|
buildCliArgs(payload) {
|
|
112369
|
-
const { projectId, formatId, mode, scopePath, anchorFilter } = payload;
|
|
112429
|
+
const { projectId, formatId, platformTargets, mode, scopePath, anchorFilter } = payload;
|
|
112370
112430
|
const args = [
|
|
112371
112431
|
"export",
|
|
112372
112432
|
"--project",
|
|
112373
112433
|
projectId,
|
|
112374
|
-
"--format",
|
|
112375
|
-
formatId,
|
|
112376
112434
|
"--delivery",
|
|
112377
112435
|
"download",
|
|
112378
112436
|
"--json"
|
|
112379
112437
|
];
|
|
112438
|
+
if (platformTargets?.length) {
|
|
112439
|
+
args.push("--platforms", platformTargets.join(","));
|
|
112440
|
+
} else if (formatId) {
|
|
112441
|
+
args.push("--format", formatId);
|
|
112442
|
+
}
|
|
112380
112443
|
if (mode === "scoped") {
|
|
112381
112444
|
args.push("--mode", "scoped");
|
|
112382
112445
|
}
|
|
@@ -112478,7 +112541,8 @@ AI enhancement skipped: ${aiResult.error}
|
|
|
112478
112541
|
const payload = {
|
|
112479
112542
|
deviceId: pairing.deviceId,
|
|
112480
112543
|
credential: pairing.credential,
|
|
112481
|
-
bridgeVersion: BRIDGE_VERSION2
|
|
112544
|
+
bridgeVersion: BRIDGE_VERSION2,
|
|
112545
|
+
port: this.config.get().port
|
|
112482
112546
|
};
|
|
112483
112547
|
this.send("bridge.auth", payload);
|
|
112484
112548
|
}
|
|
@@ -112490,7 +112554,8 @@ AI enhancement skipped: ${aiResult.error}
|
|
|
112490
112554
|
const payload = {
|
|
112491
112555
|
deviceId: pairing?.deviceId ?? "unknown",
|
|
112492
112556
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
112493
|
-
uptime: Math.floor((Date.now() - this.startedAt.getTime()) / 1e3)
|
|
112557
|
+
uptime: Math.floor((Date.now() - this.startedAt.getTime()) / 1e3),
|
|
112558
|
+
port: this.config.get().port
|
|
112494
112559
|
};
|
|
112495
112560
|
this.send("bridge.heartbeat", payload);
|
|
112496
112561
|
this.ws.ping();
|
|
@@ -115949,7 +116014,8 @@ var require_frontmatter_quality = __commonJS({
|
|
|
115949
116014
|
"archived"
|
|
115950
116015
|
];
|
|
115951
116016
|
var HINT_MAX_LENGTH2 = 200;
|
|
115952
|
-
var
|
|
116017
|
+
var FRONTMATTER_MAX_TOKENS = 1024;
|
|
116018
|
+
var FRONTMATTER_MAX_SIZE = FRONTMATTER_MAX_TOKENS * 4;
|
|
115953
116019
|
function parseFrontmatter(content) {
|
|
115954
116020
|
const match = FRONTMATTER_REGEX.exec(content);
|
|
115955
116021
|
if (!match) return null;
|
|
@@ -116047,7 +116113,7 @@ var require_frontmatter_quality = __commonJS({
|
|
|
116047
116113
|
findings.push({
|
|
116048
116114
|
checkId,
|
|
116049
116115
|
severity: "error",
|
|
116050
|
-
message: `Frontmatter exceeds
|
|
116116
|
+
message: `Frontmatter exceeds ${FRONTMATTER_MAX_TOKENS}-token limit (${sizeBytes} bytes): ${file.relativePath}`,
|
|
116051
116117
|
file: file.relativePath,
|
|
116052
116118
|
autoFixable: false,
|
|
116053
116119
|
speknCta: "Spekn enforces frontmatter size limits during validation"
|
|
@@ -123312,7 +123378,7 @@ function registerVoidAction(command, pathSegments, runner) {
|
|
|
123312
123378
|
});
|
|
123313
123379
|
}
|
|
123314
123380
|
__name(registerVoidAction, "registerVoidAction");
|
|
123315
|
-
var cliVersion = true ? "1.0.
|
|
123381
|
+
var cliVersion = true ? "1.0.5" : "0.0.0-dev";
|
|
123316
123382
|
checkForUpdates(cliVersion);
|
|
123317
123383
|
var program = new import_commander.Command();
|
|
123318
123384
|
program.name("spekn").description("Spekn CLI \u2014 Spec-Driven Development toolchain").version(cliVersion);
|
|
@@ -42,7 +42,7 @@ RULES:
|
|
|
42
42
|
- ALWAYS use MCP tools (spekn_spec_create / spekn_spec_update / spekn_decision_create) — never just describe what you would create
|
|
43
43
|
- Every spec MUST follow the format from spekn-spec-format
|
|
44
44
|
- Every spec MUST score at least B (75+) per the spekn-quality-scoring checklist
|
|
45
|
-
- Frontmatter MUST stay under
|
|
45
|
+
- Frontmatter MUST stay under ~1024 tokens (~4KB) — if a tool call fails with size limit, trim and retry
|
|
46
46
|
- Minimize churn — prefer updates over new specs
|
|
47
47
|
- Respect existing canonical spec set
|
|
48
48
|
- If a tool call fails for other reasons, report the error and continue with the next item
|