@defend-tech/opencode-optima 0.1.26 → 0.1.28
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/assets/codemap.yml +19 -0
- package/dist/index.js +20 -3
- package/dist/sanitize_cli.js +20 -3
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
scope: module
|
|
2
|
+
name: assets
|
|
3
|
+
parent: ../.optima/codemap.yml
|
|
4
|
+
purpose: Package-owned bundled runtime assets for opencode-optima.
|
|
5
|
+
code_roots:
|
|
6
|
+
- agents/
|
|
7
|
+
- policies/
|
|
8
|
+
modules:
|
|
9
|
+
- path: agents
|
|
10
|
+
summary: Bundled default agent prompts used by the plugin package.
|
|
11
|
+
- path: policies
|
|
12
|
+
summary: Bundled default policy markdown included by agent prompts.
|
|
13
|
+
entrypoints: []
|
|
14
|
+
sources_of_truth:
|
|
15
|
+
- path: agents
|
|
16
|
+
summary: Source of bundled agent definitions published with the npm package.
|
|
17
|
+
- path: policies
|
|
18
|
+
summary: Source of bundled policy defaults published with the npm package.
|
|
19
|
+
commands: {}
|
package/dist/index.js
CHANGED
|
@@ -9239,14 +9239,31 @@ function appendClickUpCommentLedgerEntry(ledgerPath, entry = {}) {
|
|
|
9239
9239
|
} catch {
|
|
9240
9240
|
}
|
|
9241
9241
|
}
|
|
9242
|
+
function stableClickUpCommentVersionMarker(value) {
|
|
9243
|
+
if (value === null || value === void 0 || value === "") return "";
|
|
9244
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return String(value).trim();
|
|
9245
|
+
if (Array.isArray(value)) {
|
|
9246
|
+
const parts = value.map((item) => stableClickUpCommentVersionMarker(item)).filter(Boolean);
|
|
9247
|
+
return parts.length ? parts.join(",") : "";
|
|
9248
|
+
}
|
|
9249
|
+
if (!isPlainObject(value)) return String(value).trim();
|
|
9250
|
+
if (Array.isArray(value.vector)) {
|
|
9251
|
+
const versions = value.vector.map((item) => stableClickUpCommentVersionMarker(item?.version ?? item?.date_updated ?? item?.updated_at ?? item?.revision)).filter(Boolean).sort();
|
|
9252
|
+
if (versions.length) return `vector:${versions.join(",")}`;
|
|
9253
|
+
}
|
|
9254
|
+
const direct = value.version ?? value.date_updated ?? value.updated_at ?? value.revision ?? value.modified_at;
|
|
9255
|
+
const directMarker = stableClickUpCommentVersionMarker(direct);
|
|
9256
|
+
if (directMarker) return directMarker;
|
|
9257
|
+
return `json:${crypto.createHash("sha256").update(JSON.stringify(value, Object.keys(value).sort())).digest("hex").slice(0, 16)}`;
|
|
9258
|
+
}
|
|
9242
9259
|
function clickUpCommentLedgerKey({ taskId, eventType, payload }) {
|
|
9243
9260
|
const history = Array.isArray(payload?.history_items) ? payload.history_items[0] : payload?.history_item;
|
|
9244
9261
|
const comment = clickUpCommentFromPayload(payload);
|
|
9245
9262
|
const commentId = String(comment?.id || payload?.comment_id || payload?.commentId || history?.comment_id || history?.commentId || "").trim();
|
|
9246
9263
|
if (!commentId) return "";
|
|
9247
|
-
const explicitVersion =
|
|
9264
|
+
const explicitVersion = stableClickUpCommentVersionMarker(
|
|
9248
9265
|
comment?.date_updated || comment?.dateUpdated || comment?.updated_at || comment?.updatedAt || comment?._version_vector || comment?.version_vector || comment?.versionVector || comment?.version || comment?.revision || comment?.modified_at || comment?.modifiedAt || ""
|
|
9249
|
-
)
|
|
9266
|
+
);
|
|
9250
9267
|
const contentVersion = crypto.createHash("sha256").update(JSON.stringify({ text: clickUpCommentText(comment), parts: Array.isArray(comment.comment) ? comment.comment : null })).digest("hex").slice(0, 16);
|
|
9251
9268
|
return [String(taskId || "").trim(), "comment", commentId, explicitVersion || `sha256-${contentVersion}`].filter(Boolean).join(":");
|
|
9252
9269
|
}
|
|
@@ -11478,7 +11495,7 @@ Follow-up: use optima_prompt_workflow with session_id '${sessionId}' to check in
|
|
|
11478
11495
|
}
|
|
11479
11496
|
};
|
|
11480
11497
|
}
|
|
11481
|
-
OptimaPlugin.__internals = { BUNDLE_AGENTS_DIR, BUNDLE_ASSETS_DIR, CLICKUP_DEFINITION_DOC_PARENT, activeClickUpWebhookLifecycleRegistry, cleanupManagedClickUpWebhook, deleteClickUpWebhookBestEffort, BUNDLE_POLICIES_DIR, buildClickUpApplyPayloadResult, buildClickUpCreateSubtasksPayload, buildClickUpStartTaskPayload, buildClickUpSummaryPayload, buildClickUpTransitionPayload, buildOptimaAgents, clickUpCommentLedgerKey, clickUpCommentMentionsProductManager, clickUpWebhookAuditLogDir, clickUpWebhookAuditLogPath, createClickUpApiClient, ensureClickUpWebhookSubscription, handleClickUpWebhookRequest, isClickUpWebhookStateActive, normalizeClickUpWebhookConfig, normalizeClickUpWebhookLogLevel, normalizeOpenCodeBaseUrl, readClickUpCommentLedger, readClickUpWebhookState, recordClickUpCommentVersionProcessed, resolveOptimaPluginOptions, resolveSecretReference, routeClickUpWebhookEvent, sendOpenCodeSessionEvent, sendOpenCodeSessionEventDirect, startClickUpWebhookListener, validateClickUpWebhookState, verifyClickUpSignature, writeClickUpWebhookState, decideClickUpStatusAction, deriveClickUpBranchName, deriveClickUpPendingSubtaskBranch, deriveClickUpPrTarget, deriveClickUpWorktree, determineClickUpMergeAuthority, ensureOptimaGitignoreRules, explicitSafeInputWorktree, finalApprovalAssignees, formatValidationResult, isIgnoredClickUpTaskType, isOptimaPluginPackageWorktree, isSafeWritableDirectory, loadHumansRegistry, mergeClickUpAgentMetadata, mergeClickUpSessionMetadata, migrateLegacyOptimaLayout, normalizeAgentMetadataJson, normalizeClickUpStatus, normalizeClickUpTaskType, normalizePromptResponseParts, normalizeWorkflowTaskPath, parseClickUpSubtasksMarkdown, parseHumansRegistry, parseMarkdownArtifact, parseMarkdownSections, preEstimateClickUpWork, readMarkdownArtifact, resolveHumanRoles, resolveSafeWorktree, safeWorktreeOrFailure, stripRawLogSections, validateMainWorkspaceBranchSafety, workflowFinalMessageFromPromptResponse };
|
|
11498
|
+
OptimaPlugin.__internals = { BUNDLE_AGENTS_DIR, BUNDLE_ASSETS_DIR, CLICKUP_DEFINITION_DOC_PARENT, activeClickUpWebhookLifecycleRegistry, cleanupManagedClickUpWebhook, deleteClickUpWebhookBestEffort, BUNDLE_POLICIES_DIR, buildClickUpApplyPayloadResult, buildClickUpCreateSubtasksPayload, buildClickUpStartTaskPayload, buildClickUpSummaryPayload, buildClickUpTransitionPayload, buildOptimaAgents, clickUpCommentLedgerKey, clickUpCommentMentionsProductManager, clickUpWebhookAuditLogDir, clickUpWebhookAuditLogPath, createClickUpApiClient, ensureClickUpWebhookSubscription, handleClickUpWebhookRequest, isClickUpWebhookStateActive, normalizeClickUpWebhookConfig, normalizeClickUpWebhookLogLevel, normalizeOpenCodeBaseUrl, readClickUpCommentLedger, readClickUpWebhookState, recordClickUpCommentVersionProcessed, resolveOptimaPluginOptions, resolveSecretReference, routeClickUpWebhookEvent, sendOpenCodeSessionEvent, sendOpenCodeSessionEventDirect, stableClickUpCommentVersionMarker, startClickUpWebhookListener, validateClickUpWebhookState, verifyClickUpSignature, writeClickUpWebhookState, decideClickUpStatusAction, deriveClickUpBranchName, deriveClickUpPendingSubtaskBranch, deriveClickUpPrTarget, deriveClickUpWorktree, determineClickUpMergeAuthority, ensureOptimaGitignoreRules, explicitSafeInputWorktree, finalApprovalAssignees, formatValidationResult, isIgnoredClickUpTaskType, isOptimaPluginPackageWorktree, isSafeWritableDirectory, loadHumansRegistry, mergeClickUpAgentMetadata, mergeClickUpSessionMetadata, migrateLegacyOptimaLayout, normalizeAgentMetadataJson, normalizeClickUpStatus, normalizeClickUpTaskType, normalizePromptResponseParts, normalizeWorkflowTaskPath, parseClickUpSubtasksMarkdown, parseHumansRegistry, parseMarkdownArtifact, parseMarkdownSections, preEstimateClickUpWork, readMarkdownArtifact, resolveHumanRoles, resolveSafeWorktree, safeWorktreeOrFailure, stripRawLogSections, validateMainWorkspaceBranchSafety, workflowFinalMessageFromPromptResponse };
|
|
11482
11499
|
export {
|
|
11483
11500
|
OptimaPlugin as default
|
|
11484
11501
|
};
|
package/dist/sanitize_cli.js
CHANGED
|
@@ -9246,14 +9246,31 @@ function appendClickUpCommentLedgerEntry(ledgerPath, entry = {}) {
|
|
|
9246
9246
|
} catch {
|
|
9247
9247
|
}
|
|
9248
9248
|
}
|
|
9249
|
+
function stableClickUpCommentVersionMarker(value) {
|
|
9250
|
+
if (value === null || value === void 0 || value === "") return "";
|
|
9251
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return String(value).trim();
|
|
9252
|
+
if (Array.isArray(value)) {
|
|
9253
|
+
const parts = value.map((item) => stableClickUpCommentVersionMarker(item)).filter(Boolean);
|
|
9254
|
+
return parts.length ? parts.join(",") : "";
|
|
9255
|
+
}
|
|
9256
|
+
if (!isPlainObject(value)) return String(value).trim();
|
|
9257
|
+
if (Array.isArray(value.vector)) {
|
|
9258
|
+
const versions = value.vector.map((item) => stableClickUpCommentVersionMarker(item?.version ?? item?.date_updated ?? item?.updated_at ?? item?.revision)).filter(Boolean).sort();
|
|
9259
|
+
if (versions.length) return `vector:${versions.join(",")}`;
|
|
9260
|
+
}
|
|
9261
|
+
const direct = value.version ?? value.date_updated ?? value.updated_at ?? value.revision ?? value.modified_at;
|
|
9262
|
+
const directMarker = stableClickUpCommentVersionMarker(direct);
|
|
9263
|
+
if (directMarker) return directMarker;
|
|
9264
|
+
return `json:${crypto.createHash("sha256").update(JSON.stringify(value, Object.keys(value).sort())).digest("hex").slice(0, 16)}`;
|
|
9265
|
+
}
|
|
9249
9266
|
function clickUpCommentLedgerKey({ taskId, eventType, payload }) {
|
|
9250
9267
|
const history = Array.isArray(payload?.history_items) ? payload.history_items[0] : payload?.history_item;
|
|
9251
9268
|
const comment = clickUpCommentFromPayload(payload);
|
|
9252
9269
|
const commentId = String(comment?.id || payload?.comment_id || payload?.commentId || history?.comment_id || history?.commentId || "").trim();
|
|
9253
9270
|
if (!commentId) return "";
|
|
9254
|
-
const explicitVersion =
|
|
9271
|
+
const explicitVersion = stableClickUpCommentVersionMarker(
|
|
9255
9272
|
comment?.date_updated || comment?.dateUpdated || comment?.updated_at || comment?.updatedAt || comment?._version_vector || comment?.version_vector || comment?.versionVector || comment?.version || comment?.revision || comment?.modified_at || comment?.modifiedAt || ""
|
|
9256
|
-
)
|
|
9273
|
+
);
|
|
9257
9274
|
const contentVersion = crypto.createHash("sha256").update(JSON.stringify({ text: clickUpCommentText(comment), parts: Array.isArray(comment.comment) ? comment.comment : null })).digest("hex").slice(0, 16);
|
|
9258
9275
|
return [String(taskId || "").trim(), "comment", commentId, explicitVersion || `sha256-${contentVersion}`].filter(Boolean).join(":");
|
|
9259
9276
|
}
|
|
@@ -11485,7 +11502,7 @@ Follow-up: use optima_prompt_workflow with session_id '${sessionId}' to check in
|
|
|
11485
11502
|
}
|
|
11486
11503
|
};
|
|
11487
11504
|
}
|
|
11488
|
-
OptimaPlugin.__internals = { BUNDLE_AGENTS_DIR, BUNDLE_ASSETS_DIR, CLICKUP_DEFINITION_DOC_PARENT, activeClickUpWebhookLifecycleRegistry, cleanupManagedClickUpWebhook, deleteClickUpWebhookBestEffort, BUNDLE_POLICIES_DIR, buildClickUpApplyPayloadResult, buildClickUpCreateSubtasksPayload, buildClickUpStartTaskPayload, buildClickUpSummaryPayload, buildClickUpTransitionPayload, buildOptimaAgents, clickUpCommentLedgerKey, clickUpCommentMentionsProductManager, clickUpWebhookAuditLogDir, clickUpWebhookAuditLogPath, createClickUpApiClient, ensureClickUpWebhookSubscription, handleClickUpWebhookRequest, isClickUpWebhookStateActive, normalizeClickUpWebhookConfig, normalizeClickUpWebhookLogLevel, normalizeOpenCodeBaseUrl, readClickUpCommentLedger, readClickUpWebhookState, recordClickUpCommentVersionProcessed, resolveOptimaPluginOptions, resolveSecretReference, routeClickUpWebhookEvent, sendOpenCodeSessionEvent, sendOpenCodeSessionEventDirect, startClickUpWebhookListener, validateClickUpWebhookState, verifyClickUpSignature, writeClickUpWebhookState, decideClickUpStatusAction, deriveClickUpBranchName, deriveClickUpPendingSubtaskBranch, deriveClickUpPrTarget, deriveClickUpWorktree, determineClickUpMergeAuthority, ensureOptimaGitignoreRules, explicitSafeInputWorktree, finalApprovalAssignees, formatValidationResult, isIgnoredClickUpTaskType, isOptimaPluginPackageWorktree, isSafeWritableDirectory, loadHumansRegistry, mergeClickUpAgentMetadata, mergeClickUpSessionMetadata, migrateLegacyOptimaLayout, normalizeAgentMetadataJson, normalizeClickUpStatus, normalizeClickUpTaskType, normalizePromptResponseParts, normalizeWorkflowTaskPath, parseClickUpSubtasksMarkdown, parseHumansRegistry, parseMarkdownArtifact, parseMarkdownSections, preEstimateClickUpWork, readMarkdownArtifact, resolveHumanRoles, resolveSafeWorktree, safeWorktreeOrFailure, stripRawLogSections, validateMainWorkspaceBranchSafety, workflowFinalMessageFromPromptResponse };
|
|
11505
|
+
OptimaPlugin.__internals = { BUNDLE_AGENTS_DIR, BUNDLE_ASSETS_DIR, CLICKUP_DEFINITION_DOC_PARENT, activeClickUpWebhookLifecycleRegistry, cleanupManagedClickUpWebhook, deleteClickUpWebhookBestEffort, BUNDLE_POLICIES_DIR, buildClickUpApplyPayloadResult, buildClickUpCreateSubtasksPayload, buildClickUpStartTaskPayload, buildClickUpSummaryPayload, buildClickUpTransitionPayload, buildOptimaAgents, clickUpCommentLedgerKey, clickUpCommentMentionsProductManager, clickUpWebhookAuditLogDir, clickUpWebhookAuditLogPath, createClickUpApiClient, ensureClickUpWebhookSubscription, handleClickUpWebhookRequest, isClickUpWebhookStateActive, normalizeClickUpWebhookConfig, normalizeClickUpWebhookLogLevel, normalizeOpenCodeBaseUrl, readClickUpCommentLedger, readClickUpWebhookState, recordClickUpCommentVersionProcessed, resolveOptimaPluginOptions, resolveSecretReference, routeClickUpWebhookEvent, sendOpenCodeSessionEvent, sendOpenCodeSessionEventDirect, stableClickUpCommentVersionMarker, startClickUpWebhookListener, validateClickUpWebhookState, verifyClickUpSignature, writeClickUpWebhookState, decideClickUpStatusAction, deriveClickUpBranchName, deriveClickUpPendingSubtaskBranch, deriveClickUpPrTarget, deriveClickUpWorktree, determineClickUpMergeAuthority, ensureOptimaGitignoreRules, explicitSafeInputWorktree, finalApprovalAssignees, formatValidationResult, isIgnoredClickUpTaskType, isOptimaPluginPackageWorktree, isSafeWritableDirectory, loadHumansRegistry, mergeClickUpAgentMetadata, mergeClickUpSessionMetadata, migrateLegacyOptimaLayout, normalizeAgentMetadataJson, normalizeClickUpStatus, normalizeClickUpTaskType, normalizePromptResponseParts, normalizeWorkflowTaskPath, parseClickUpSubtasksMarkdown, parseHumansRegistry, parseMarkdownArtifact, parseMarkdownSections, preEstimateClickUpWork, readMarkdownArtifact, resolveHumanRoles, resolveSafeWorktree, safeWorktreeOrFailure, stripRawLogSections, validateMainWorkspaceBranchSafety, workflowFinalMessageFromPromptResponse };
|
|
11489
11506
|
|
|
11490
11507
|
// src/sanitize_cli.js
|
|
11491
11508
|
var { migrateLegacyOptimaLayout: migrateLegacyOptimaLayout2 } = OptimaPlugin.__internals;
|