@lesliechan721/aw 0.1.0-beta.35 → 0.1.0-beta.36

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 (72) hide show
  1. package/dist/src/commands/operation-plan.d.ts +19 -0
  2. package/dist/src/commands/operation-plan.js.map +1 -1
  3. package/dist/src/commands/rebuild-command.d.ts +1 -0
  4. package/dist/src/commands/rebuild-command.js +890 -8
  5. package/dist/src/commands/rebuild-command.js.map +1 -1
  6. package/dist/src/commands/rebuild-integration.d.ts +12 -0
  7. package/dist/src/commands/rebuild-integration.js +88 -2
  8. package/dist/src/commands/rebuild-integration.js.map +1 -1
  9. package/dist/src/commands/status-v6.js +109 -19
  10. package/dist/src/commands/status-v6.js.map +1 -1
  11. package/dist/src/commands/wizard.d.ts +5 -1
  12. package/dist/src/commands/wizard.js +4 -2
  13. package/dist/src/commands/wizard.js.map +1 -1
  14. package/dist/src/commands/write-commands.js +3 -0
  15. package/dist/src/commands/write-commands.js.map +1 -1
  16. package/dist/src/index.js +57 -4
  17. package/dist/src/index.js.map +1 -1
  18. package/dist/src/tui/components.d.ts +20 -1
  19. package/dist/src/tui/components.js +41 -20
  20. package/dist/src/tui/components.js.map +1 -1
  21. package/dist/src/tui/console-app-v4.js +1323 -1165
  22. package/dist/src/tui/console-app-v4.js.map +1 -1
  23. package/dist/src/tui/content-item-card.d.ts +13 -0
  24. package/dist/src/tui/content-item-card.js +51 -0
  25. package/dist/src/tui/content-item-card.js.map +1 -0
  26. package/dist/src/tui/controller-runtime.js +18 -2
  27. package/dist/src/tui/controller-runtime.js.map +1 -1
  28. package/dist/src/tui/controller.d.ts +3 -0
  29. package/dist/src/tui/controller.js +57 -8
  30. package/dist/src/tui/controller.js.map +1 -1
  31. package/dist/src/tui/dependency-graph-view.d.ts +39 -0
  32. package/dist/src/tui/dependency-graph-view.js +121 -0
  33. package/dist/src/tui/dependency-graph-view.js.map +1 -0
  34. package/dist/src/tui/dependency-graph.js +16 -19
  35. package/dist/src/tui/dependency-graph.js.map +1 -1
  36. package/dist/src/tui/entity-cards.d.ts +55 -0
  37. package/dist/src/tui/entity-cards.js +220 -0
  38. package/dist/src/tui/entity-cards.js.map +1 -0
  39. package/dist/src/tui/input-display.js +10 -1
  40. package/dist/src/tui/input-display.js.map +1 -1
  41. package/dist/src/tui/model.d.ts +2 -0
  42. package/dist/src/tui/model.js +10 -2
  43. package/dist/src/tui/model.js.map +1 -1
  44. package/dist/src/tui/operation-diagnostic-screens.d.ts +2 -18
  45. package/dist/src/tui/operation-diagnostic-screens.js +16 -69
  46. package/dist/src/tui/operation-diagnostic-screens.js.map +1 -1
  47. package/dist/src/tui/operation-review-planner.js +44 -3
  48. package/dist/src/tui/operation-review-planner.js.map +1 -1
  49. package/dist/src/tui/plugin-content.d.ts +8 -0
  50. package/dist/src/tui/plugin-content.js +409 -65
  51. package/dist/src/tui/plugin-content.js.map +1 -1
  52. package/dist/src/tui/plugin-detail.d.ts +52 -0
  53. package/dist/src/tui/plugin-detail.js +165 -0
  54. package/dist/src/tui/plugin-detail.js.map +1 -0
  55. package/dist/src/tui/query-header.d.ts +30 -0
  56. package/dist/src/tui/query-header.js +40 -0
  57. package/dist/src/tui/query-header.js.map +1 -0
  58. package/dist/src/tui/reader.d.ts +37 -0
  59. package/dist/src/tui/reader.js +47 -0
  60. package/dist/src/tui/reader.js.map +1 -0
  61. package/dist/src/tui/router.d.ts +10 -0
  62. package/dist/src/tui/router.js.map +1 -1
  63. package/dist/src/tui/screen-registry.d.ts +2 -0
  64. package/dist/src/tui/source-detail-card.d.ts +29 -0
  65. package/dist/src/tui/source-detail-card.js +45 -0
  66. package/dist/src/tui/source-detail-card.js.map +1 -0
  67. package/dist/src/tui/wizard.js +26 -4
  68. package/dist/src/tui/wizard.js.map +1 -1
  69. package/dist/src/utils/local-marketplace.d.ts +1 -0
  70. package/dist/src/utils/local-marketplace.js +22 -0
  71. package/dist/src/utils/local-marketplace.js.map +1 -1
  72. package/package.json +4 -4
@@ -0,0 +1,13 @@
1
+ import type { PluginContentItem, PluginContentType } from './plugin-content.js';
2
+ import { type EntityCardLayout, entityCardWindowHeight } from './entity-cards.js';
3
+ export declare const contentTypeLabels: Record<PluginContentType, string>;
4
+ export declare function contentItemHasReader(item: PluginContentItem, width: number): boolean;
5
+ export declare function contentItemCardLayout(item: PluginContentItem, width: number): EntityCardLayout;
6
+ export declare function ContentItemCard(props: {
7
+ item: PluginContentItem;
8
+ width: number;
9
+ focused?: boolean;
10
+ lineOffset?: number;
11
+ lineLimit?: number;
12
+ }): React.JSX.Element;
13
+ export { entityCardWindowHeight as contentItemCardWindowHeight };
@@ -0,0 +1,51 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from 'ink';
3
+ import stringWidth from 'string-width';
4
+ import { ObjectCardFrame } from './components.js';
5
+ import { entityCardWindowHeight } from './entity-cards.js';
6
+ import { tuiTheme } from './theme.js';
7
+ import { wrapDisplayText } from './viewport.js';
8
+ export const contentTypeLabels = {
9
+ skill: 'Skill', agent: 'Agent', role: '角色', instruction: '指令', permission: '权限',
10
+ hook: 'Hook', command: '命令', mcpServer: 'MCP Server', app: 'App',
11
+ };
12
+ export function contentItemHasReader(item, width) {
13
+ const titleWidth = Math.max(1, width - 11 - stringWidth(contentTypeLabels[item.type]));
14
+ return Boolean(item.issue) || stringWidth(item.name) > titleWidth
15
+ || Boolean(item.description && wrapDisplayText(item.description, Math.max(1, width - 4)).length > 1);
16
+ }
17
+ function contentLines(item, width) {
18
+ const columns = Math.max(1, width - 4);
19
+ const lines = [];
20
+ const add = (text, kind) => {
21
+ for (const part of wrapDisplayText(text, columns))
22
+ lines.push({ text: part, kind });
23
+ };
24
+ if (item.descriptionState !== 'issue' && item.description) {
25
+ const wrapped = wrapDisplayText(item.description, columns);
26
+ add(wrapped.length > 1
27
+ ? `${wrapDisplayText(item.description, Math.max(1, columns - 1))[0]}…`
28
+ : wrapped[0], 'description');
29
+ }
30
+ add(item.tools.length ? item.tools.map((tool) => `[${tool}]`).join(' ') : '[工具未确认]', 'fact');
31
+ if (item.issue) {
32
+ add('! 简介读取问题 · Enter 查看原因', 'issue');
33
+ }
34
+ return lines;
35
+ }
36
+ export function contentItemCardLayout(item, width) {
37
+ const factRows = contentLines(item, width).length;
38
+ return { headerHeight: 1, factRows, fullHeight: factRows + 2,
39
+ sections: [{ key: item.id, offset: 0, height: factRows }] };
40
+ }
41
+ export function ContentItemCard(props) {
42
+ const lines = contentLines(props.item, props.width);
43
+ const offset = Math.min(Math.max(0, props.lineOffset ?? 0), Math.max(0, lines.length - 1));
44
+ const visible = lines.slice(offset, props.lineLimit === undefined
45
+ ? undefined : offset + Math.max(1, props.lineLimit));
46
+ return _jsxs(ObjectCardFrame, { width: props.width, title: props.item.name, headerMeta: contentTypeLabels[props.item.type], focused: props.focused, children: [offset > 0 ? _jsx(Text, { color: tuiTheme.colors.muted, children: "\u2191 \u524D\u9762\u8FD8\u6709\u4FE1\u606F" }) : null, visible.map((line, index) => _jsx(Box, { children: _jsx(Text, { color: line.kind === 'issue' ? tuiTheme.statusColors.warning
47
+ : line.kind === 'description' ? tuiTheme.colors.muted : tuiTheme.colors.text, children: line.text }) }, `${offset}:${index}`)), offset + visible.length < lines.length
48
+ ? _jsx(Text, { color: tuiTheme.colors.muted, children: "\u2193 \u540E\u9762\u8FD8\u6709\u4FE1\u606F" }) : null] });
49
+ }
50
+ export { entityCardWindowHeight as contentItemCardWindowHeight };
51
+ //# sourceMappingURL=content-item-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-item-card.js","sourceRoot":"","sources":["../../../src/tui/content-item-card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,WAAW,MAAM,cAAc,CAAC;AAGvC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAyB,sBAAsB,EAAE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AAC,MAAM,CAAC,IAAI,YAC3E,IAAI,CAAC,IAAI,GACL,IAJ+B,GAAG,MAAM,IAAI,KAAK,EAAE,CAKtD,CAAC,EACN,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM;gBACrC,CAAC,CAAC,KAAC,IAAI,IAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,4DAAiB,CAAC,CAAC,CAAC,IAAI,IAC9C,CAAC;AACrB,CAAC;AAED,OAAO,EAAE,sBAAsB,IAAI,2BAA2B,EAAE,CAAC"}
@@ -916,6 +916,11 @@ export function createTuiControllerDependencies(context, progressFeed, options =
916
916
  evidence: 'unavailable',
917
917
  items: [],
918
918
  notices: ['当前无法安全读取这个插件的目录内容。请检查来源状态后重试。'],
919
+ coverage: 'unavailable',
920
+ coverageIssue: {
921
+ code: 'unreadable',
922
+ message: '当前无法安全读取这个插件的目录内容。请检查来源状态后重试。',
923
+ },
919
924
  };
920
925
  }
921
926
  };
@@ -1863,11 +1868,15 @@ export function createTuiControllerDependencies(context, progressFeed, options =
1863
1868
  signal?.throwIfAborted();
1864
1869
  if (intent.action === 'cleanup') {
1865
1870
  const groups = [];
1871
+ const reviewedRemovedPlugins = new Set();
1866
1872
  for (const group of selection.groups) {
1867
1873
  signal?.throwIfAborted();
1874
+ const requestedPluginIds = group.requestedPluginIds.filter((pluginId) => !reviewedRemovedPlugins.has(pluginId));
1875
+ if (requestedPluginIds.length === 0)
1876
+ continue;
1868
1877
  const preview = await runBatchWriteGroup({
1869
1878
  intent,
1870
- group,
1879
+ group: { ...group, requestedPluginIds },
1871
1880
  cwd: context.cwd,
1872
1881
  runtime: {
1873
1882
  ...context,
@@ -1879,7 +1888,11 @@ export function createTuiControllerDependencies(context, progressFeed, options =
1879
1888
  } : {}),
1880
1889
  },
1881
1890
  });
1882
- groups.push({ ...group, preview, executable: preview.operationPlan !== undefined });
1891
+ for (const pluginId of preview.removedPluginCleanupIds ?? []) {
1892
+ reviewedRemovedPlugins.add(pluginId);
1893
+ }
1894
+ groups.push({ ...group, requestedPluginIds, preview,
1895
+ executable: preview.operationPlan !== undefined });
1883
1896
  }
1884
1897
  await preparation?.reporter.emit('evidence');
1885
1898
  signal?.throwIfAborted();
@@ -2042,6 +2055,9 @@ export function createTuiControllerDependencies(context, progressFeed, options =
2042
2055
  },
2043
2056
  operationPlan: preview.operationPlan,
2044
2057
  offlineCleanupPlans,
2058
+ ...(preview.removedPluginCleanupIds
2059
+ ? { removedPluginCleanupIds: preview.removedPluginCleanupIds }
2060
+ : {}),
2045
2061
  ...(offlineCleanupPlans.length === 1
2046
2062
  ? { offlineCleanup: offlineCleanupPlans[0] }
2047
2063
  : {}),