@ycodium-ai/plugin-pentest 0.2.2974 → 0.2.2976

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -15
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -537,20 +537,16 @@ function turnContext(input) {
537
537
  }
538
538
 
539
539
  // src/related.ts
540
- async function relatedSessions(projections, threadId) {
541
- const current = await projections.getThread(threadId);
540
+ var RELATED_SESSION_LIMIT = 20;
541
+ async function relatedSessions(ctx, threadId) {
542
+ const current = await ctx.projections.getThread(threadId);
542
543
  if (current === null) return [];
543
- const page = await projections.listThreads({ limit: 100, includeArchived: false });
544
- const found = [];
545
- for (const shell of page.threads) {
546
- if (found.length >= 20) break;
547
- if (shell.projectId !== current.projectId || shell.threadId === threadId) continue;
548
- const thread = await projections.getThread(shell.threadId);
549
- if (thread?.origin?.parentThreadId === threadId) {
550
- found.push({ threadId: shell.threadId, title: shell.title });
551
- }
552
- }
553
- return found;
544
+ const page = await ctx.threads.list({
545
+ parentThreadId: threadId,
546
+ archived: "exclude",
547
+ limit: RELATED_SESSION_LIMIT
548
+ });
549
+ return page.items.map((shell) => ({ threadId: shell.threadId, title: shell.title }));
554
550
  }
555
551
 
556
552
  // src/store.ts
@@ -977,7 +973,7 @@ function submitFrom(args) {
977
973
  // src/index.ts
978
974
  var pentestPlugin = definePlugin({
979
975
  id: "pentest",
980
- apiVersion: 4,
976
+ apiVersion: 5,
981
977
  activate(ctx) {
982
978
  const store = createStore(ctx.paths.dataDir);
983
979
  ctx.sessionProjections.register({ name: GRAPH_PROJECTION });
@@ -1123,7 +1119,7 @@ async function snapshot(ctx, store, threadId) {
1123
1119
  let related = [];
1124
1120
  if (threadId.length > 0) {
1125
1121
  try {
1126
- related = await relatedSessions(ctx.projections, threadId);
1122
+ related = await relatedSessions(ctx, threadId);
1127
1123
  } catch (error) {
1128
1124
  ctx.log.warn("pentest related sessions skipped", {
1129
1125
  detail: error instanceof Error ? error.message : "unknown"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/plugin-pentest",
3
- "version": "0.2.2974",
3
+ "version": "0.2.2976",
4
4
  "description": "Records an assessment graph on a session: goal, intents, evidence, assets, and findings.",
5
5
  "keywords": [
6
6
  "sessions",
@@ -24,7 +24,7 @@
24
24
  "react": "19.2.6",
25
25
  "typescript": "~6.0.3",
26
26
  "vite-plus": "0.2.2",
27
- "@ycodium-ai/plugin-api": "0.2.2974"
27
+ "@ycodium-ai/plugin-api": "0.2.2976"
28
28
  },
29
29
  "ycodium": {
30
30
  "plugin": "./dist/index.js",