@oxmumu3/dsh-plugin-finder 0.13.1 → 0.13.2

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/client.js CHANGED
@@ -5957,13 +5957,124 @@ var ORDER = Object.fromEntries(STAGES.map((stage, index) => [stage.id, index]));
5957
5957
  var LABEL = { ...Object.fromEntries(STAGES.map((stage) => [stage.id, stage.label])), blocked: "\u5361\u4F4F\u4E86" };
5958
5958
  var PLAIN = {
5959
5959
  search: "\u5148\u770B\u770B\u6709\u6CA1\u6709\u73B0\u6210\u7684",
5960
- design: "\u8BF4\u6E05\u600E\u4E48\u505A",
5961
- skeleton: "\u5148\u642D\u4E2A\u80FD\u6253\u5F00\u7684",
5962
- feature: "\u4E00\u6B21\u52A0\u4E00\u4E2A\u529F\u80FD",
5963
- verify: "\u8DD1\u4E00\u904D\u786E\u8BA4",
5960
+ design: "\u5148\u5BF9\u9F50 3 \u53E5\u8BDD\u65B9\u6848",
5961
+ skeleton: "\u5148\u642D\u80FD\u70B9\u5F00\u7684\u7A7A\u67B6\u5B50",
5962
+ feature: "\u4E00\u6B21\u53EA\u52A0\u4E00\u4E2A\u6838\u5FC3\u529F\u80FD",
5963
+ verify: "\u6309\u63D0\u793A\u5237\u65B0\u6838\u5BF9\u5B9E\u6548",
5964
5964
  blocked: "\u5361\u4F4F\u4E86"
5965
5965
  };
5966
- var BRICK = "M3 7H3.4V5.3a1.1 1.1 0 0 1 1.1-1.1h3a1.1 1.1 0 0 1 1.1 1.1V7h2.8V5.3a1.1 1.1 0 0 1 1.1-1.1h3a1.1 1.1 0 0 1 1.1 1.1V7H17a3 3 0 0 1 3 3v7a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3v-7a3 3 0 0 1 3-3Z";
5966
+ var STAGE_SHORT = Object.freeze({
5967
+ search: "\u67E5\u73B0\u6210",
5968
+ design: "\u5B9A\u65B9\u6848",
5969
+ skeleton: "\u642D\u67B6\u5B50",
5970
+ feature: "\u52A0\u529F\u80FD",
5971
+ verify: "\u5F85\u9A8C\u6536"
5972
+ });
5973
+ var STAGE_HINTS = Object.freeze({
5974
+ search: "\u6709\u73B0\u6210\u63D2\u4EF6\u4F18\u5148\u590D\u7528\uFF0C\u786E\u5B9E\u6CA1\u6709\u518D\u81EA\u5DF1\u9020",
5975
+ design: "\u5148\u786E\u8BA4\u6302\u5728\u54EA\u3001\u5E73\u65F6\u600E\u4E48\u7528\uFF0C\u518D\u8BA9\u5B83\u5199\u4EE3\u7801",
5976
+ skeleton: "\u5148\u70B9\u5F00\u770B\u4F4D\u7F6E\u548C\u5165\u53E3\u6CA1\u767D\u5C4F\uFF0C\u5148\u4E0D\u7BA1\u7EC6\u8282",
5977
+ feature: "\u770B\u4E00\u773C\u521A\u52A0\u7684\u529F\u80FD\u987A\u4E0D\u987A\u624B\uFF0C\u4E00\u6B21\u53EA\u6539\u4E00\u5904",
5978
+ verify: "\u6309 \u2318R \u5237\u65B0\u770B\u5B9E\u6548\uFF08\u6539\u4E86\u540E\u53F0\u6216\u5DE5\u5177\u9700\u9000\u51FA\u91CD\u5F00 DSH\uFF09"
5979
+ });
5980
+ var STAGE_LESSONS = Object.freeze({
5981
+ search: [
5982
+ "\u5148\u641C\u793E\u533A\u73B0\u6210\u63D2\u4EF6\u80FD\u7701\u6389\u5927\u91CF\u91CD\u590D\u9020\u8F6E\u5B50\uFF1B\u771F\u6CA1\u6709\u73B0\u6210\u7684\uFF0C\u4E5F\u53EF\u6311\u6700\u63A5\u8FD1\u7684\u8BA9 AI \u7167\u7740\u6539\u3002",
5983
+ "\u804A\u5B8C\u53D1\u73B0\u73B0\u6210\u7684\u5C31\u80FD\u7528\u65F6\uFF0C\u76F4\u63A5\u88C5\u73B0\u6210\u63D2\u4EF6\u6700\u7A33\u3002"
5984
+ ],
5985
+ design: [
5986
+ "\u52A8\u624B\u524D\u53EA\u5BF9\u9F50\u4E09\u4EF6\u4E8B\uFF1A\u5165\u53E3\u6302\u5728\u54EA\uFF08\u4FA7\u680F\u3001\u9876\u90E8\u6807\u7B7E\u8FD8\u662F\u60AC\u6D6E\u7A97\uFF09\u3001\u5360\u591A\u5927\u7A7A\u95F4\u3001\u6570\u636E\u5B58\u54EA\u3002",
5987
+ "\u9996\u7248\u780D\u6389\u9526\u4E0A\u6DFB\u82B1\u7684\u529F\u80FD\uFF0C\u8D8A\u805A\u7126\u8D8A\u5BB9\u6613\u4E00\u6B21\u505A\u6210\u3002"
5988
+ ],
5989
+ skeleton: [
5990
+ "\u7B2C\u4E00\u7248\u53EA\u8981\u80FD\u70B9\u5F00\u3001\u4E0D\u767D\u5C4F\u3001\u4F4D\u7F6E\u987A\u773C\u5C31\u7B97\u8FC7\u5173\uFF0C\u522B\u4E00\u53E3\u6C14\u585E\u6EE1\u6240\u6709\u529F\u80FD\u3002",
5991
+ "\u5165\u53E3\u4F4D\u7F6E\u5982\u679C\u4E0D\u987A\u624B\uFF0C\u8D81\u73B0\u5728\u8FD8\u6CA1\u5806\u903B\u8F91\u65F6\u6362\u4F4D\u7F6E\u6700\u8F7B\u677E\u3002"
5992
+ ],
5993
+ feature: [
5994
+ "\u6BCF\u6B21\u53EA\u63D0 1\u20132 \u4E2A\u5177\u4F53\u8C03\u6574\uFF08\u5982\u201C\u538B\u5C0F\u5B57\u53F7\u201D\u201C\u53EA\u7559\u4E09\u9879\u6307\u6807\u201D\uFF09\uFF0C\u6BD4\u4E00\u6B21\u6539\u5341\u5904\u7A33\u5F97\u591A\u3002",
5995
+ "\u6BCF\u52A0\u5B8C\u4E00\u5757\u90FD\u987A\u624B\u70B9\u4E00\u4E0B\uFF0C\u786E\u8BA4\u6CA1\u628A\u4E0A\u4E00\u7248\u505A\u597D\u7684\u5730\u65B9\u6539\u574F\u3002"
5996
+ ],
5997
+ verify: [
5998
+ "\u53EA\u6539\u754C\u9762\u6837\u5F0F\u6309 \u2318R \u5373\u53EF\u751F\u6548\uFF1B\u65B0\u52A0\u4E86\u5DE5\u5177\u3001\u540E\u53F0\u63A5\u53E3\u6216\u91CD\u88C5\u540C\u540D\u63D2\u4EF6\uFF0C\u9700 \u2318Q \u9000\u51FA\u91CD\u5F00 DSH\u3002",
5999
+ "\u987A\u624B\u5207\u4E00\u4E0B\u6DF1\u8272/\u6D45\u8272\u548C\u7A84\u7A97\u53E3\uFF0C\u770B\u6709\u6CA1\u6709\u6324\u7206\u3001\u906E\u6321\u6216\u770B\u4E0D\u6E05\u7684\u5B57\u3002"
6000
+ ],
6001
+ blocked: [
6002
+ "\u540C\u4E00\u95EE\u9898\u8FDE\u6539\u4E09\u8F6E\u6CA1\u597D\uFF0C\u7EE7\u7EED\u5728\u957F\u5BF9\u8BDD\u91CC\u786C\u78E8\u53EA\u4F1A\u8D8A\u6539\u8D8A\u4E71\u3001\u8D8A\u82B1\u8D8A\u591A Token\uFF1B\u5E26\u8FDB\u5C55\u6362\u5E72\u51C0\u7A97\u53E3\u6700\u5212\u7B97\u3002"
6003
+ ]
6004
+ });
6005
+ var STARTER_CHIPS = Object.freeze([
6006
+ {
6007
+ label: "\u5148\u67E5\u6709\u6CA1\u6709\u73B0\u6210\u7684",
6008
+ prompt: "\u6211\u60F3\u505A\u4E00\u4E2A\u529F\u80FD\uFF1A___\u3002\u5148\u522B\u6025\u7740\u5199\u4EE3\u7801\uFF0C\u8BF7\u5148\u7528 finder_search \u67E5\u67E5\u793E\u533A\u6709\u6CA1\u6709\u73B0\u6210\u6216\u76F8\u8FD1\u7684\u63D2\u4EF6\u3002"
6009
+ },
6010
+ {
6011
+ label: "\u5148\u5BF9\u9F50 3 \u53E5\u8BDD\u65B9\u6848",
6012
+ prompt: "\u6211\u60F3\u81EA\u5DF1\u505A\u4E00\u4E2A\u5C0F\u63D2\u4EF6\uFF1A___\u3002\u5148\u522B\u5199\u4EE3\u7801\uFF0C\u8BF7\u7528\u4E09\u4E94\u53E5\u5927\u767D\u8BDD\u8DDF\u6211\u786E\u8BA4\u5165\u53E3\u6302\u5728\u54EA\u3001\u600E\u4E48\u4EA4\u4E92\u3001\u6570\u636E\u5B58\u54EA\u3002"
6013
+ },
6014
+ {
6015
+ label: "\u642D\u6700\u5C0F\u53EF\u70B9\u5F00\u521D\u7248",
6016
+ prompt: "\u6211\u60F3\u505A\uFF1A___\u3002\u7B2C\u4E00\u7248\u8BF7\u53EA\u642D\u4E00\u4E2A\u6700\u5C0F\u80FD\u70B9\u5F00\u3001\u4E0D\u767D\u5C4F\u7684\u7A7A\u67B6\u5B50\uFF0C\u6211\u786E\u8BA4\u4F4D\u7F6E\u987A\u773C\u540E\u518D\u9010\u4E2A\u52A0\u529F\u80FD\u3002"
6017
+ }
6018
+ ]);
6019
+ var STAGE_CHIPS = Object.freeze({
6020
+ search: {
6021
+ primary: {
6022
+ label: "\u81EA\u5DF1\u9020 \xB7 \u5148\u5B9A 3 \u53E5\u65B9\u6848",
6023
+ prompt: "\u73B0\u6210\u63D2\u4EF6\u4E0D\u5B8C\u5168\u5408\u9002\uFF0C\u6211\u4EEC\u81EA\u5DF1\u505A\u4E00\u4E2A\u8F7B\u91CF\u7248\u3002\u5148\u522B\u5199\u4EE3\u7801\uFF0C\u8BF7\u7528\u4E09\u4E94\u53E5\u5927\u767D\u8BDD\u8DDF\u6211\u786E\u8BA4\u5165\u53E3\u6302\u5728\u54EA\u3001\u5E73\u65F6\u600E\u4E48\u7528\u3001\u6570\u636E\u5B58\u54EA\u3002"
6024
+ },
6025
+ secondary: {
6026
+ label: "\u6311\u6700\u63A5\u8FD1\u7684\u7167\u7740\u6539",
6027
+ prompt: "\u8BF7\u6311\u4E00\u4E2A\u7ED3\u6784\u6700\u63A5\u8FD1\u7684\u73B0\u6210\u63D2\u4EF6\u53C2\u8003\u5B83\u7684\u6302\u8F7D\u65B9\u5F0F\uFF0C\u6309\u6211\u7684\u9700\u6C42\u7CBE\u7B80\u91CD\u505A\u4E00\u7248\u3002"
6028
+ }
6029
+ },
6030
+ design: {
6031
+ primary: {
6032
+ label: "\u65B9\u6848\u53EF\u4EE5 \xB7 \u5148\u642D\u7A7A\u67B6\u5B50",
6033
+ prompt: "\u8FD9\u4E2A\u65B9\u6848\u53EF\u4EE5\uFF0C\u7B2C\u4E00\u7248\u8BF7\u5148\u642D\u4E00\u4E2A\u6700\u5C0F\u80FD\u70B9\u5F00\u3001\u4E0D\u767D\u5C4F\u7684\u7A7A\u67B6\u5B50\uFF0C\u5148\u4E0D\u585E\u590D\u6742\u903B\u8F91\u3002"
6034
+ },
6035
+ secondary: {
6036
+ label: "\u518D\u538B\u7CBE\u7B80\u4E00\u70B9",
6037
+ prompt: "\u9996\u7248\u8FD8\u53EF\u4EE5\u518D\u7CBE\u7B80\u4E00\u70B9\uFF0C\u53EA\u4FDD\u7559\u6700\u6838\u5FC3\u7684\u4E00\u9879\u80FD\u529B\uFF1A"
6038
+ }
6039
+ },
6040
+ skeleton: {
6041
+ primary: {
6042
+ label: "\u67B6\u5B50 OK \xB7 \u52A0\u6838\u5FC3\u529F\u80FD",
6043
+ prompt: "\u5165\u53E3\u6211\u5DF2\u7ECF\u70B9\u5F00\u786E\u8BA4\u6B63\u5E38\u4E86\uFF0C\u73B0\u5728\u8BF7\u53EA\u52A0\u4E0A\u6700\u6838\u5FC3\u7684\u7B2C\u4E00\u4E2A\u529F\u80FD\uFF1A"
6044
+ },
6045
+ secondary: {
6046
+ label: "\u600E\u4E48\u5237\u65B0\u770B\u6548\u679C\uFF1F",
6047
+ prompt: "\u8BF7\u544A\u8BC9\u6211\u8FD9\u4E00\u6B65\u53EA\u9700\u8981\u6309 Cmd+R \u5237\u65B0\u754C\u9762\uFF0C\u8FD8\u662F\u9700\u8981\u5F7B\u5E95\u9000\u51FA\u91CD\u5F00 DSH\uFF1F"
6048
+ }
6049
+ },
6050
+ feature: {
6051
+ primary: {
6052
+ label: "\u81EA\u67E5\u6DF1\u6D45\u8272\u4E0E\u7A84\u7A97\u53E3",
6053
+ prompt: "\u8BF7\u5E2E\u6211\u68C0\u67E5\u4E00\u4E0B\u5F53\u524D\u754C\u9762\u5728\u6DF1\u8272/\u6D45\u8272\u4E3B\u9898\u548C\u7A84\u7A97\u53E3\u4E0B\u7684\u6392\u7248\u3001\u5BF9\u6BD4\u5EA6\u4E0E\u6EA2\u51FA\u60C5\u51B5\u3002"
6054
+ },
6055
+ secondary: {
6056
+ label: "\u5FAE\u8C03\u4EA4\u4E92\u4E0E\u7EC6\u8282",
6057
+ prompt: "\u521A\u52A0\u7684\u529F\u80FD\u6211\u770B\u4E86\u4E00\u773C\uFF0C\u60F3\u5FAE\u8C03\u4E00\u5904\u7EC6\u8282\uFF1A"
6058
+ }
6059
+ },
6060
+ verify: {
6061
+ primary: {
6062
+ label: "\u5FAE\u8C03\u6837\u5F0F\u4E0E\u7CBE\u7B80\u5EA6",
6063
+ prompt: "\u6211\u770B\u4E86\u4E00\u773C\u5F53\u524D\u6548\u679C\uFF0C\u60F3\u5FAE\u8C03\u4E00\u4E0B\u89C6\u89C9\u6837\u5F0F\u548C\u4FE1\u606F\u7CBE\u7B80\u5EA6\uFF1A"
6064
+ },
6065
+ secondary: {
6066
+ label: "\u628A\u8E29\u5751\u8BB0\u5165\u7ECF\u9A8C\u5E93",
6067
+ prompt: "\u8BF7\u628A\u8FD9\u6B21\u5236\u4F5C\u8FC7\u7A0B\u4E2D\u503C\u5F97\u590D\u7528\u7684\u907F\u5751\u70B9\u8C03\u7528 finder_creator_note \u8BB0\u5165\u63D2\u4EF6\u7ECF\u9A8C\u3002"
6068
+ }
6069
+ },
6070
+ blocked: {
6071
+ primary: {
6072
+ label: "\u5148\u603B\u7ED3\u8BD5\u8FC7\u4EC0\u4E48\u4E0E\u5361\u70B9",
6073
+ prompt: "\u5148\u505C\u4E00\u4E0B\u522B\u6539\u4EE3\u7801\u4E86\uFF1A\u8BF7\u7528\u4E09\u53E5\u8BDD\u603B\u7ED3\u521A\u624D\u8BD5\u8FC7\u4E86\u4EC0\u4E48\u3001\u5177\u4F53\u5361\u5728\u54EA\u4E2A\u73B0\u8C61\uFF0C\u65B9\u4FBF\u6211\u5224\u65AD\u6216\u6362\u65B0\u7A97\u53E3\u7EE7\u7EED\u3002"
6074
+ }
6075
+ }
6076
+ });
6077
+ var SPARK_PATH = "M10 2.25 11.9 7.1l4.85 1.9-4.85 1.9L10 15.75l-1.9-4.85-4.85-1.9 4.85-1.9L10 2.25Z";
5967
6078
  var text12 = (value) => typeof value === "string" ? value : "";
5968
6079
  var CREATOR_PRESET = "cordis";
5969
6080
  function creatorProgress(steps) {
@@ -5975,12 +6086,16 @@ function creatorProgress(steps) {
5975
6086
  const recorded = new Set(rows.map((item) => item.stage));
5976
6087
  const last = rows.at(-1) ?? null;
5977
6088
  return {
5978
- stages: STAGES.map((stage, index) => ({ ...stage, plain: PLAIN[stage.id], state: index === furthest ? "current" : index > furthest ? "todo" : recorded.has(stage.id) ? "done" : "skipped" })),
6089
+ stages: STAGES.map((stage, index) => ({
6090
+ ...stage,
6091
+ plain: PLAIN[stage.id],
6092
+ state: index === furthest ? "current" : index > furthest ? "todo" : recorded.has(stage.id) ? "done" : "skipped"
6093
+ })),
5979
6094
  last: last ? { stage: last.stage, label: LABEL[last.stage], summary: text12(last.summary) } : null,
5980
6095
  blocked: last?.stage === "blocked",
5981
6096
  blockedStep: recordedStep,
5982
6097
  count: rows.length,
5983
- reached: Math.max(0, STAGES.filter((stage, index) => index <= furthest).length)
6098
+ reached: Math.max(0, STAGES.filter((_, index) => index <= furthest).length)
5984
6099
  };
5985
6100
  }
5986
6101
  function creatorHandoffPrompt(steps) {
@@ -5993,133 +6108,326 @@ function creatorHandoffPrompt(steps) {
5993
6108
  "\u8BF7\u5148\u8C03\u7528 finder_creator_guide \u8BFB\u53D6\u521B\u9020\u7ECF\u9A8C\uFF0C\u518D\u4ECE\u6700\u540E\u4E00\u6B65\u7EE7\u7EED\uFF1B\u5DF2\u7ECF\u8DD1\u901A\u7684\u90E8\u5206\u4E0D\u8981\u91CD\u5199\u3002\u9700\u8981\u4E0A\u4E2A\u7A97\u53E3\u7684\u7EC6\u8282\u65F6\u5148\u95EE\u6211\u3002"
5994
6109
  ].join("\n");
5995
6110
  }
5996
- var STAGE_LESSONS = Object.freeze({
5997
- search: [
5998
- "\u5199\u4EE3\u7801\u524D\u5148\u7528 cordis_inspect \u67E5\u5C55\u4F4D\u548C\u63A5\u53E3\uFF0C\u627E\u7ED3\u6784\u76F8\u8FD1\u7684\u5DF2\u8DD1\u901A\u63D2\u4EF6\u7167\u7740\u6539\u3002",
5999
- "\u53EA\u8BFB\u5BBF\u4E3B\u5305\u91CC\u7684 api-catalog \u548C slots \u5B9A\u4E49\uFF0C\u4E0D\u51ED\u8BB0\u5FC6\u731C\u63A5\u53E3\u3002"
6000
- ],
6001
- design: [
6002
- "\u52A8\u624B\u524D\u7528\u4E09\u4E94\u53E5\u5927\u767D\u8BDD\u5BF9\u9F50\uFF1A\u6302\u5728\u54EA\u3001\u51E0\u4E2A\u6587\u4EF6\u3001\u6570\u636E\u5B58\u54EA\u3002",
6003
- "\u53EF\u9009\u670D\u52A1\u5199\u8FDB inject\uFF0C\u72B6\u6001\u6536\u5728\u4E00\u4E2A\u5730\u65B9\uFF0C\u5199\u63A5\u53E3\u62D2\u7EDD\u8DE8\u7AD9\u8BF7\u6C42\u3002"
6004
- ],
6005
- skeleton: [
6006
- "\u7B2C\u4E00\u7248\u53EA\u505A\u80FD\u70B9\u5F00\u3001\u4E0D\u767D\u5C4F\u7684\u7A7A\u67B6\u5B50\uFF0C\u6240\u6709\u6CE8\u518C\u653E\u8FDB ctx.effect\u3002",
6007
- "main \u9762\u677F\u7528 flex \u6491\u6EE1\u5E76\u81EA\u5DF1\u5F53\u6EDA\u52A8\u53E3\uFF1BReact \u7528\u5BBF\u4E3B\u90A3\u4EFD\uFF0C\u4E0D\u5F15\u5BBF\u4E3B UI \u5305\u3002"
6008
- ],
6009
- feature: [
6010
- "\u4E00\u8F6E\u53EA\u52A0\u4E00\u4E2A\u529F\u80FD\uFF1B@container \u91CF\u81EA\u8EAB\u5BBD\u5EA6\uFF0C\u989C\u8272\u53EA\u7528 --dsw-alias-* \u53D8\u91CF\u3002",
6011
- "\u6309\u94AE\u548C\u6A21\u578B\u5DE5\u5177\u8D70\u540C\u4E00\u5957\u5B9E\u73B0\uFF1B\u5BA2\u6237\u7AEF\u5165\u53E3\u5305\u8FDB window.__ModuleLoader__.load\u3002"
6012
- ],
6013
- verify: [
6014
- "\u5148\u6253\u5305\u5E76\u5728\u6D45\u8272/\u6DF1\u8272/\u7A84\u5C4F\u4E0B\u91CF\u771F\u5B9E\u6E32\u67D3\uFF0C\u518D\u8FDB\u9694\u79BB\u5BBF\u4E3B\u771F\u70B9\u5F00\u9A8C\u3002",
6015
- "\u5F39\u7A97\u548C\u5217\u8868\u884C\u5FC5\u987B\u6709\u72B6\u6001\u6587\u5B57\uFF0C\u4E0D\u5355\u9760\u989C\u8272\uFF1B\u6362\u5305\u540E\u5F7B\u5E95\u9000\u51FA\u684C\u9762\u7AEF\u91CD\u5F00\u3002"
6016
- ],
6017
- blocked: [
6018
- "\u540C\u4E00\u95EE\u9898\u8FDE\u6539\u4E09\u8F6E\u6CA1\u597D\u5C31\u505C\u4E0B\u6765\u5199\u6E05\u5C1D\u8BD5\u548C\u5361\u70B9\uFF0C\u5F00\u5E72\u51C0\u7A97\u53E3\u63A5\u7740\u505A\u3002"
6019
- ]
6020
- });
6111
+ async function applyCreatorPrompt({ ctx, sessionId, inputActions } = {}, prompt) {
6112
+ const value = text12(prompt).trim();
6113
+ if (!value) return "noop";
6114
+ if (typeof inputActions?.captureInsertion === "function" && typeof inputActions?.insertText === "function") {
6115
+ try {
6116
+ const span = inputActions.captureInsertion();
6117
+ const prefix = span && Number.isInteger(span.start) && span.start > 0 && span.start === span.end ? "\n" : "";
6118
+ if (inputActions.insertText(prefix + value, span)) {
6119
+ try {
6120
+ const editor = globalThis.document?.querySelector?.('[data-composer-seat] [contenteditable="true"], [data-composer-seat] textarea');
6121
+ editor?.focus?.();
6122
+ } catch {
6123
+ }
6124
+ return "inserted";
6125
+ }
6126
+ } catch {
6127
+ }
6128
+ }
6129
+ try {
6130
+ const binding = sessionId ? ctx?.sessions?.binding?.(sessionId) : null;
6131
+ const convInput = binding?.ctx?.get?.("conversation", false)?.input;
6132
+ if (typeof convInput?.requestDraftInitialization === "function") {
6133
+ const status = convInput.requestDraftInitialization(binding, {
6134
+ prompt: value,
6135
+ whenDraftExists: "append",
6136
+ clearPreviousDraft: false
6137
+ });
6138
+ if (status === "applied") return "inserted";
6139
+ }
6140
+ } catch {
6141
+ }
6142
+ try {
6143
+ if (typeof globalThis.navigator?.clipboard?.writeText === "function") {
6144
+ await globalThis.navigator.clipboard.writeText(value);
6145
+ return "copied";
6146
+ }
6147
+ } catch {
6148
+ }
6149
+ return "unavailable";
6150
+ }
6021
6151
  var css = `
6022
- .pfc_dock, .pfc_closed { box-sizing: border-box; color-scheme: light dark;
6152
+ .pfc_dock, .pfc_closed {
6153
+ box-sizing: border-box;
6154
+ container-type: inline-size;
6155
+ container-name: pfc-dock;
6156
+ color-scheme: light dark;
6023
6157
  --pfc_ink: var(--dsw-alias-label-primary, #191b1f);
6024
6158
  --pfc_ink2: var(--dsw-alias-label-secondary, #4b5058);
6025
6159
  --pfc_ink3: var(--dsw-alias-label-tertiary, #868c95);
6026
- --pfc_card: var(--dsw-alias-bg-layer-2, #ffffff);
6027
- --pfc_line: var(--dsw-alias-border-l2, #e7e7e2);
6028
- --pfc_line2: var(--dsw-alias-border-l4, #d0d0c9);
6029
- --pfc_build: var(--dsw-alias-state-warn-primary, #dd8500);
6160
+ --pfc_card: var(--dsw-specific-menu, var(--dsw-alias-bg-layer-2, #ffffff));
6161
+ --pfc_chip_bg: var(--dsw-alias-fill-l2, rgba(25, 27, 31, 0.05));
6162
+ --pfc_chip_hover: var(--dsw-alias-fill-l3, rgba(25, 27, 31, 0.09));
6163
+ --pfc_line: var(--dsw-alias-border-l1, rgba(25, 27, 31, 0.08));
6164
+ --pfc_line2: var(--dsw-alias-border-l3, rgba(25, 27, 31, 0.16));
6165
+ --pfc_accent: var(--dsw-alias-brand-primary, #4b83f0);
6166
+ --pfc_build: var(--dsw-alias-state-warn-primary, #d97706);
6030
6167
  --pfc_ok: var(--dsw-alias-state-success-primary, #2fa36b);
6031
6168
  --pfc_primary: var(--dsw-alias-button-primary-fill, #191b1f);
6032
6169
  --pfc_on_primary: var(--dsw-alias-label-primary-inverted, #ffffff);
6033
- --pfc_serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
6034
6170
  --pfc_sans: var(--dsw-font-family, -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif);
6035
- font-family: var(--pfc_sans); color: var(--pfc_ink); }
6171
+ width: calc(100% - var(--dsh-composer-side-clearance, 0px) - var(--dsh-composer-side-clearance, 0px) - var(--dsh-composer-dock-inset, 0px) - var(--dsh-composer-dock-inset, 0px) - var(--dsh-composer-dock-inset, 0px) - var(--dsh-composer-dock-inset, 0px));
6172
+ max-width: calc(var(--dsh-composer-card-max-width, 768px) - var(--dsh-composer-dock-inset, 0px) - var(--dsh-composer-dock-inset, 0px) - var(--dsh-composer-dock-inset, 0px) - var(--dsh-composer-dock-inset, 0px));
6173
+ margin: 0 auto 6px;
6174
+ border-radius: var(--dsw-radius-lg, 12px);
6175
+ border: 1px solid var(--pfc_line);
6176
+ background: var(--pfc_card);
6177
+ backdrop-filter: var(--dsw-menu-backdrop-filter, blur(16px));
6178
+ box-shadow: var(--dsw-elevation-panel, 0 2px 8px rgba(0, 0, 0, 0.06));
6179
+ font-family: var(--pfc_sans);
6180
+ color: var(--pfc_ink);
6181
+ overflow: hidden;
6182
+ }
6036
6183
  :where(.pfc_dock, .pfc_closed)[data-theme="dark"], .dark :where(.pfc_dock, .pfc_closed) {
6037
6184
  --pfc_ink: var(--dsw-alias-label-primary, #eceded);
6038
6185
  --pfc_ink2: var(--dsw-alias-label-secondary, #b5b9bf);
6039
6186
  --pfc_ink3: var(--dsw-alias-label-tertiary, #7e848d);
6040
- --pfc_card: var(--dsw-alias-bg-layer-2, #1d1f22);
6041
- --pfc_line: var(--dsw-alias-border-l2, #2a2c30);
6042
- --pfc_line2: var(--dsw-alias-border-l4, #3b3e43);
6187
+ --pfc_card: var(--dsw-specific-menu, var(--dsw-alias-bg-layer-2, rgba(31, 33, 38, 0.92)));
6188
+ --pfc_chip_bg: var(--dsw-alias-fill-l2, rgba(255, 255, 255, 0.07));
6189
+ --pfc_chip_hover: var(--dsw-alias-fill-l3, rgba(255, 255, 255, 0.12));
6190
+ --pfc_line: var(--dsw-alias-border-l1, rgba(255, 255, 255, 0.08));
6191
+ --pfc_line2: var(--dsw-alias-border-l3, rgba(255, 255, 255, 0.16));
6192
+ --pfc_accent: var(--dsw-alias-brand-primary, #6c9ef8);
6043
6193
  --pfc_build: var(--dsw-alias-state-warn-primary, #f0a530);
6044
6194
  --pfc_ok: var(--dsw-alias-state-success-primary, #4cc38a);
6045
6195
  --pfc_primary: var(--dsw-alias-button-primary-fill, #eceded);
6046
6196
  --pfc_on_primary: var(--dsw-alias-label-primary-inverted, #141517);
6197
+ box-shadow: var(--dsw-elevation-panel, 0 2px 10px rgba(0, 0, 0, 0.28));
6047
6198
  }
6048
6199
  @media (prefers-color-scheme: dark) {
6049
6200
  :where(.pfc_dock, .pfc_closed):not([data-theme="light"]) {
6050
6201
  --pfc_ink: var(--dsw-alias-label-primary, #eceded);
6051
6202
  --pfc_ink2: var(--dsw-alias-label-secondary, #b5b9bf);
6052
6203
  --pfc_ink3: var(--dsw-alias-label-tertiary, #7e848d);
6053
- --pfc_card: var(--dsw-alias-bg-layer-2, #1d1f22);
6054
- --pfc_line: var(--dsw-alias-border-l2, #2a2c30);
6055
- --pfc_line2: var(--dsw-alias-border-l4, #3b3e43);
6204
+ --pfc_card: var(--dsw-specific-menu, var(--dsw-alias-bg-layer-2, rgba(31, 33, 38, 0.92)));
6205
+ --pfc_chip_bg: var(--dsw-alias-fill-l2, rgba(255, 255, 255, 0.07));
6206
+ --pfc_chip_hover: var(--dsw-alias-fill-l3, rgba(255, 255, 255, 0.12));
6207
+ --pfc_line: var(--dsw-alias-border-l1, rgba(255, 255, 255, 0.08));
6208
+ --pfc_line2: var(--dsw-alias-border-l3, rgba(255, 255, 255, 0.16));
6209
+ --pfc_accent: var(--dsw-alias-brand-primary, #6c9ef8);
6056
6210
  --pfc_build: var(--dsw-alias-state-warn-primary, #f0a530);
6057
6211
  --pfc_ok: var(--dsw-alias-state-success-primary, #4cc38a);
6058
6212
  --pfc_primary: var(--dsw-alias-button-primary-fill, #eceded);
6059
6213
  --pfc_on_primary: var(--dsw-alias-label-primary-inverted, #141517);
6060
6214
  }
6061
6215
  }
6062
- .pfc_dock { width: 100%; margin: 0 0 8px; padding: 16px 20px 18px; border: 1px solid var(--pfc_line2); border-radius: 20px; background: var(--pfc_card); }
6063
- .pfc_dock[data-stuck="true"] { border-color: var(--pfc_build); }
6064
- .pfc_hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
6065
- .pfc_hd b { font: 400 18px/1.4 var(--pfc_serif); }
6066
- .pfc_brick { width: 24px; height: 24px; flex: none; margin: -2px 0 -2px -2px; overflow: visible; }
6067
- .pfc_brick path { fill: color-mix(in srgb, var(--pfc_build) 9%, transparent); stroke: var(--pfc_build); stroke-width: 1.3; stroke-dasharray: 2.6 2.3; stroke-linecap: round; stroke-linejoin: round; }
6068
- .pfc_hd .pfc_steps_link { margin-left: auto; }
6069
- .pfc_dock p { margin: 6px 0 0; font-size: 14px; line-height: 1.7; color: var(--pfc_ink2); }
6070
- .pfc_dock p b { color: var(--pfc_ink); font-weight: 500; }
6071
- .pfc_five { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; margin-top: 14px; }
6072
- .pfc_five div { min-width: 0; padding-right: 8px; }
6073
- .pfc_five i { display: block; height: 5px; border-radius: 3px; background: var(--pfc_line); }
6216
+
6217
+ .pfc_dock[data-compact="true"] { padding: 5px 10px; }
6218
+ .pfc_dock:not([data-compact="true"]) { padding: 10px 14px; }
6219
+ .pfc_dock[data-stuck="true"] { border-color: color-mix(in srgb, var(--pfc_build) 52%, var(--pfc_line)); }
6220
+
6221
+ .pfc_bar { display: flex; align-items: center; gap: 8px; min-height: 26px; }
6222
+ .pfc_bar_toggle {
6223
+ flex: 1 1 0;
6224
+ min-width: 0;
6225
+ display: flex;
6226
+ align-items: center;
6227
+ gap: 8px;
6228
+ padding: 2px 4px;
6229
+ border: 0;
6230
+ border-radius: 7px;
6231
+ background: transparent;
6232
+ color: inherit;
6233
+ font: inherit;
6234
+ text-align: left;
6235
+ cursor: pointer;
6236
+ }
6237
+ .pfc_bar_toggle:hover:not(:disabled) { background: var(--pfc_chip_bg); }
6238
+
6239
+ .pfc_mini_steps { display: inline-flex; align-items: center; gap: 3px; flex: none; }
6240
+ .pfc_mini_steps i { display: block; width: 14px; height: 4px; border-radius: 999px; background: var(--pfc_line2); }
6241
+ .pfc_mini_steps .is_done { background: var(--pfc_ok); }
6242
+ .pfc_mini_steps .is_skipped { background: color-mix(in srgb, var(--pfc_ok) 36%, var(--pfc_line2)); }
6243
+ .pfc_mini_steps .is_current { background: var(--pfc_accent); }
6244
+ .pfc_dock[data-stage="verify"][data-running="false"] .pfc_mini_steps .is_current { background: var(--pfc_ok); }
6245
+ .pfc_dock[data-stuck="true"] .pfc_mini_steps .is_current { background: var(--pfc_build); }
6246
+ .pfc_mini_steps .is_current.is_running { background: var(--pfc_accent); }
6247
+
6248
+ .pfc_badge { font-size: 12px; font-weight: 600; line-height: 18px; color: var(--pfc_ink); white-space: nowrap; flex: none; }
6249
+ .pfc_hint {
6250
+ min-width: 0;
6251
+ flex: 1 1 auto;
6252
+ font-size: 12.5px;
6253
+ line-height: 18px;
6254
+ color: var(--pfc_ink2);
6255
+ overflow: hidden;
6256
+ text-overflow: ellipsis;
6257
+ white-space: nowrap;
6258
+ }
6259
+ .pfc_bar_actions { display: flex; align-items: center; gap: 4px; flex: none; }
6260
+
6261
+ .pfc_chip {
6262
+ box-sizing: border-box;
6263
+ height: 26px;
6264
+ padding: 0 10px;
6265
+ border-radius: 999px;
6266
+ border: 1px solid var(--pfc_line);
6267
+ background: var(--pfc_chip_bg);
6268
+ color: var(--pfc_ink);
6269
+ font: inherit;
6270
+ font-size: 12px;
6271
+ font-weight: 500;
6272
+ line-height: 24px;
6273
+ white-space: nowrap;
6274
+ cursor: pointer;
6275
+ }
6276
+ .pfc_chip:hover:not(:disabled) { background: var(--pfc_chip_hover); border-color: var(--pfc_line2); }
6277
+ .pfc_chip:disabled { opacity: 0.45; cursor: default; }
6278
+
6279
+ .pfc_icon_btn {
6280
+ box-sizing: border-box;
6281
+ width: 24px;
6282
+ height: 24px;
6283
+ padding: 0;
6284
+ border: 0;
6285
+ border-radius: 6px;
6286
+ background: transparent;
6287
+ color: var(--pfc_ink3);
6288
+ display: inline-flex;
6289
+ align-items: center;
6290
+ justify-content: center;
6291
+ cursor: pointer;
6292
+ flex: none;
6293
+ }
6294
+ .pfc_icon_btn:hover:not(:disabled) { background: var(--pfc_chip_bg); color: var(--pfc_ink); }
6295
+ .pfc_icon_btn:disabled { opacity: 0.45; cursor: default; }
6296
+
6297
+ .pfc_hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 24px; }
6298
+ .pfc_hd b { font-size: 13px; font-weight: 600; line-height: 20px; color: var(--pfc_ink); }
6299
+ .pfc_sub { font-size: 12.5px; line-height: 18px; color: var(--pfc_ink2); flex: 1 1 200px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
6300
+ .pfc_hd_tools { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: none; }
6301
+ .pfc_spark { width: 15px; height: 15px; flex: none; color: var(--pfc_accent); }
6302
+ .pfc_stuck_dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pfc_build); flex: none; }
6303
+
6304
+ .pfc_chip_row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
6305
+ .pfc_stuck_note { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--pfc_ink2); }
6306
+
6307
+ .pfc_dock .pfc_button, .pfc_closed .pfc_button {
6308
+ box-sizing: border-box;
6309
+ height: 28px;
6310
+ padding: 0 12px;
6311
+ border-radius: 999px;
6312
+ border: 1px solid var(--pfc_line2);
6313
+ background: transparent;
6314
+ color: var(--pfc_ink);
6315
+ font: inherit;
6316
+ font-size: 12.5px;
6317
+ font-weight: 500;
6318
+ cursor: pointer;
6319
+ }
6320
+ .pfc_dock .pfc_button:hover:not(:disabled), .pfc_closed .pfc_button:hover:not(:disabled) { background: var(--pfc_chip_bg); }
6321
+ .pfc_dock .pfc_button[data-primary="true"] { border-color: var(--pfc_primary); background: var(--pfc_primary); color: var(--pfc_on_primary); }
6322
+ .pfc_dock .pfc_button[data-primary="true"]:hover:not(:disabled) { opacity: 0.9; background: var(--pfc_primary); }
6323
+ .pfc_dock .pfc_button:disabled, .pfc_closed .pfc_button:disabled { opacity: 0.45; cursor: default; }
6324
+
6325
+ .pfc_dock .pfc_ghost, .pfc_closed .pfc_ghost {
6326
+ box-sizing: border-box;
6327
+ height: 24px;
6328
+ padding: 0 8px;
6329
+ border: 0;
6330
+ border-radius: 6px;
6331
+ background: transparent;
6332
+ color: var(--pfc_ink3);
6333
+ font: inherit;
6334
+ font-size: 12px;
6335
+ line-height: 24px;
6336
+ text-decoration: none;
6337
+ cursor: pointer;
6338
+ white-space: nowrap;
6339
+ }
6340
+ .pfc_dock .pfc_ghost:hover:not(:disabled), .pfc_closed .pfc_ghost:hover:not(:disabled) { background: var(--pfc_chip_bg); color: var(--pfc_ink); }
6341
+ .pfc_dock .pfc_ghost:disabled, .pfc_closed .pfc_ghost:disabled { opacity: 0.45; cursor: default; }
6342
+
6343
+ .pfc_drawer { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--pfc_line); display: flex; flex-direction: column; gap: 10px; }
6344
+ .pfc_five { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
6345
+ .pfc_five div { min-width: 0; }
6346
+ .pfc_five i { display: block; height: 4px; border-radius: 999px; background: var(--pfc_line2); }
6074
6347
  .pfc_five .is_done i { background: var(--pfc_ok); }
6075
- .pfc_five .is_current i { background: var(--pfc_build); }
6076
- .pfc_five span { display: block; margin-top: 6px; font-size: 12px; line-height: 1.45; color: var(--pfc_ink3); }
6348
+ .pfc_five .is_skipped i { background: color-mix(in srgb, var(--pfc_ok) 36%, var(--pfc_line2)); }
6349
+ .pfc_five .is_current i { background: var(--pfc_accent); }
6350
+ .pfc_dock[data-stage="verify"][data-running="false"] .pfc_five .is_current i { background: var(--pfc_ok); }
6351
+ .pfc_dock[data-stuck="true"] .pfc_five .is_current i { background: var(--pfc_build); }
6352
+ .pfc_five span { display: block; margin-top: 5px; font-size: 11.5px; line-height: 1.35; color: var(--pfc_ink3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
6077
6353
  .pfc_five .is_done span { color: var(--pfc_ink2); }
6354
+ .pfc_five .is_skipped span { color: var(--pfc_ink3); }
6078
6355
  .pfc_five .is_current span { color: var(--pfc_ink); font-weight: 600; }
6079
- .pfc_acts { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
6080
- .pfc_dock .pfc_button, .pfc_closed .pfc_button { box-sizing: border-box; font: inherit; font-size: 13px; height: 32px; padding: 0 16px; border-radius: 16px; border: 1px solid var(--pfc_line2);
6081
- background: transparent; color: var(--pfc_ink); cursor: pointer; }
6082
- .pfc_dock .pfc_button:hover:not(:disabled), .pfc_closed .pfc_button:hover:not(:disabled) { background: color-mix(in srgb, var(--pfc_ink) 5%, transparent); }
6083
- .pfc_dock .pfc_button[data-primary="true"], .pfc_closed .pfc_button[data-primary="true"] { border-color: var(--pfc_primary); background: var(--pfc_primary); color: var(--pfc_on_primary); }
6084
- .pfc_dock .pfc_button[data-primary="true"]:hover:not(:disabled), .pfc_closed .pfc_button[data-primary="true"]:hover:not(:disabled) { opacity: .9; background: var(--pfc_primary); }
6085
- .pfc_dock .pfc_button:disabled, .pfc_closed .pfc_button:disabled { opacity: .45; cursor: default; }
6086
- .pfc_dock .pfc_link, .pfc_closed .pfc_link { box-sizing: border-box; font: inherit; font-size: 12.5px; padding: 0; border: 0; background: none; color: var(--pfc_ink3); cursor: pointer;
6087
- border-bottom: 1px solid var(--pfc_line2); line-height: 1.5; }
6088
- .pfc_dock .pfc_link:hover, .pfc_closed .pfc_link:hover { color: var(--pfc_ink); }
6089
- .pfc_notice { font-size: 12.5px; color: var(--pfc_ink3); }
6090
- .pfc_closed { width: 100%; margin: 0 0 8px; padding: 10px 14px; border: 1px solid var(--pfc_line); border-radius: 14px;
6091
- display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--pfc_ink3); background: var(--pfc_card); }
6092
- .pfc_button:focus-visible, .pfc_link:focus-visible { outline: 2px solid var(--pfc_ink); outline-offset: 2px; border-radius: 6px; }
6093
- .pfc_lessons { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--pfc_line); }
6094
- .pfc_lessons > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font-size: 12.5px; color: var(--pfc_ink2); }
6095
- .pfc_lessons > summary::-webkit-details-marker { display: none; }
6096
- .pfc_lessons > summary::before { content: ""; display: inline-block; width: 0; height: 0; border-left: 4.5px solid currentColor; border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent; }
6097
- .pfc_lessons[open] > summary::before { border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; border-top: 4.5px solid currentColor; border-bottom: 0; }
6098
- .pfc_lessons > summary:hover { color: var(--pfc_ink); }
6099
- .pfc_lessons_list { margin: 8px 0 0; padding-left: 18px; list-style: disc; font-size: 12.5px; line-height: 1.65; color: var(--pfc_ink2); }
6100
- .pfc_lessons_list li + li { margin-top: 4px; }
6101
- @media (max-width: 560px) {
6102
- .pfc_dock { padding: 14px 16px 16px; }
6356
+ .pfc_meta_note { margin: -2px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--pfc_ink3); }
6357
+
6358
+ .pfc_summary { margin: 0; padding: 8px 0 0; border-top: 1px solid var(--pfc_line); font-size: 12.5px; line-height: 1.55; color: var(--pfc_ink2); }
6359
+ .pfc_lessons { padding-top: 8px; border-top: 1px solid var(--pfc_line); }
6360
+ .pfc_lessons_hd { font-size: 12px; font-weight: 600; line-height: 18px; color: var(--pfc_ink); }
6361
+ .pfc_lessons_list { margin: 4px 0 0; padding-left: 16px; list-style: disc; font-size: 12px; line-height: 1.6; color: var(--pfc_ink2); }
6362
+ .pfc_lessons_list li + li { margin-top: 2px; }
6363
+
6364
+ .pfc_drawer_foot {
6365
+ padding-top: 8px;
6366
+ border-top: 1px solid var(--pfc_line);
6367
+ display: flex;
6368
+ align-items: center;
6369
+ justify-content: space-between;
6370
+ gap: 8px;
6371
+ flex-wrap: wrap;
6372
+ }
6373
+ .pfc_drawer_left, .pfc_drawer_right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
6374
+
6375
+ .pfc_notice_row { margin-top: 6px; font-size: 12px; line-height: 1.4; color: var(--pfc_ok); }
6376
+ .pfc_closed {
6377
+ padding: 6px 12px;
6378
+ display: flex;
6379
+ align-items: center;
6380
+ gap: 10px;
6381
+ flex-wrap: wrap;
6382
+ font-size: 12.5px;
6383
+ color: var(--pfc_ink2);
6384
+ }
6385
+ .pfc_closed .pfc_ghost { margin-left: auto; color: var(--pfc_ink); font-weight: 500; }
6386
+ .pfc_bar_toggle:focus-visible, .pfc_chip:focus-visible, .pfc_icon_btn:focus-visible, .pfc_button:focus-visible, .pfc_ghost:focus-visible {
6387
+ outline: 2px solid var(--pfc_accent);
6388
+ outline-offset: 2px;
6389
+ }
6390
+
6391
+ @container pfc-dock (max-width: 560px) {
6392
+ .pfc_hint { display: none; }
6393
+ .pfc_five { gap: 4px; }
6103
6394
  .pfc_five span { font-size: 11px; }
6104
6395
  }
6105
- @media (prefers-reduced-motion: no-preference) { .pfc_five i { transition: background-color .2s; } }
6396
+ @media (prefers-reduced-motion: no-preference) {
6397
+ @keyframes pfc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.38; } }
6398
+ .pfc_mini_steps .is_current.is_running { animation: pfc-pulse 1.4s ease-in-out infinite; }
6399
+ .pfc_mini_steps i, .pfc_five i { transition: background-color 0.2s ease; }
6400
+ }
6106
6401
  `;
6107
6402
  var creatorStripCss = css;
6108
6403
  function createCreatorDock(React2) {
6109
6404
  const h = React2.createElement;
6110
- const brick = () => h(
6405
+ const sparkIcon = () => h(
6406
+ "svg",
6407
+ { className: "pfc_spark", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true" },
6408
+ h("path", { d: SPARK_PATH, stroke: "currentColor", strokeWidth: "1.5", strokeLinejoin: "round" })
6409
+ );
6410
+ const chevronIcon = (open) => h(
6111
6411
  "svg",
6112
- { className: "pfc_brick", viewBox: "-3 0.6 26 22.6", role: "img", "aria-label": "\u8FD8\u6CA1\u505A\u5B8C\uFF0C\u8981\u4E00\u8D77\u505A" },
6113
- h("path", { d: BRICK })
6412
+ { width: 14, height: 14, viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" },
6413
+ h("path", { d: open ? "M4 10l4-4 4 4" : "M4 6l4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
6414
+ );
6415
+ const closeIcon = () => h(
6416
+ "svg",
6417
+ { width: 13, height: 13, viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" },
6418
+ h("path", { d: "M4.5 4.5l7 7m0-7l-7 7", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
6114
6419
  );
6115
6420
  return function CreatorDock({
6116
6421
  mode = "intro",
6117
6422
  progress = null,
6423
+ expanded = false,
6424
+ running = false,
6118
6425
  busy = "",
6119
6426
  notice = "",
6120
6427
  onKnow,
6121
6428
  onSkip,
6122
- onReopen,
6429
+ onToggleExpand,
6430
+ onPrompt,
6123
6431
  onOpenNext,
6124
6432
  onClose,
6125
6433
  onSettings,
@@ -6131,95 +6439,240 @@ function createCreatorDock(React2) {
6131
6439
  return h(
6132
6440
  "div",
6133
6441
  { className: "pfc_closed", role: "status" },
6134
- h("span", null, "\u5DF2\u5173\u95ED\u300C\u53D1\u73B0\u597D\u63D2\u4EF6\u300D\u7684\u521B\u9020\u7ECF\u9A8C\uFF0C\u4E4B\u540E\u65B0\u5F00\u7684\u521B\u9020\u6A21\u5F0F\u4F1A\u8BDD\u4E0D\u518D\u5E26\u4E0A\u3002"),
6135
- h("button", { type: "button", className: "pfc_link", disabled: busy !== "", onClick: onEnable }, "\u64A4\u9500"),
6136
- notice ? h("span", { className: "pfc_notice", role: "status" }, notice) : null
6442
+ h("span", null, "\u5DF2\u5168\u5C40\u5173\u95ED\u521B\u9020\u5411\u5BFC\u4E0E\u540E\u53F0\u7701 Token \u7ECF\u9A8C\uFF0C\u65B0\u5F00\u521B\u9020\u4F1A\u8BDD\u4E0D\u518D\u542F\u7528\u3002"),
6443
+ notice ? h("span", { className: "pfc_notice_row", role: "status" }, notice) : null,
6444
+ h("button", { type: "button", className: "pfc_ghost", disabled: busy !== "", onClick: onEnable }, "\u64A4\u9500")
6137
6445
  );
6138
6446
  }
6139
6447
  const stages = progress?.stages ?? [];
6140
6448
  const reached = progress?.reached ?? 0;
6141
6449
  const last = progress?.last ?? null;
6142
- const five = () => h(
6143
- "div",
6144
- { className: "pfc_five", role: "img", "aria-label": `\u4E94\u6B65\uFF1A${stages.map((stage, index) => `${index + 1} ${stage.plain ?? stage.label}`).join("\uFF0C")}` },
6145
- ...stages.map((stage, index) => h(
6146
- "div",
6147
- { key: stage.id, className: stage.state === "done" ? "is_done" : stage.state === "current" ? "is_current" : "" },
6148
- h("i", null),
6149
- h("span", null, `${index + 1} ${stage.plain ?? stage.label}`)
6150
- ))
6151
- );
6152
- const links = (showSteps = false) => h(
6153
- React2.Fragment,
6154
- null,
6155
- showSteps ? h("button", { type: "button", className: "pfc_link pfc_steps_link", onClick: onShowSteps, title: "\u8FD9\u51E0\u6B65\u662F\u4EC0\u4E48" }, "\u8FD9\u51E0\u6B65\u662F\u4EC0\u4E48") : null,
6156
- typeof onSettings === "function" ? h("button", { type: "button", className: "pfc_link", onClick: onSettings }, "\u7ECF\u9A8C") : null,
6157
- h("button", { type: "button", className: "pfc_link", disabled: busy !== "", onClick: onClose }, "\u5173\u95ED")
6450
+ const current = stages.find((stage) => stage.state === "current") ?? stages[Math.min(Math.max(reached - 1, 0), (stages.length || 1) - 1)] ?? STAGES[0];
6451
+ const currentId = current?.id || "search";
6452
+ const isExpanded = Boolean(expanded);
6453
+ const hasSkipped = stages.some((stage) => stage.state === "skipped");
6454
+ const stageTip = (stage, index, isRunning) => {
6455
+ const shortLabel = STAGE_SHORT[stage.id] ?? stage.label;
6456
+ const stateLabel = stage.state === "done" ? "\u5DF2\u5B8C\u6210" : stage.state === "skipped" ? "\u672C\u8F6E\u514D\u8D70\uFF08\u5982\u7EE7\u7EED\u8FED\u4EE3\u5DF2\u6709\u63D2\u4EF6\uFF09\uFF0C\u65E0\u9700\u8865\u505A" : stage.state === "current" ? isRunning ? "AI \u6B63\u5728\u6539\u52A8" : "\u5F53\u524D\u6B65\u9AA4" : "\u5F85\u8FDB\u884C";
6457
+ return `${index + 1}. ${shortLabel} \xB7 ${stateLabel}`;
6458
+ };
6459
+ const metaNote = () => h(
6460
+ "p",
6461
+ { className: "pfc_meta_note" },
6462
+ hasSkipped ? "\u6765\u81EA\u300C\u53D1\u73B0\u597D\u63D2\u4EF6\u300D\xB7 \u540E\u53F0\u7701 Token \u5F15\u5BFC\u751F\u6548\u4E2D\uFF08\u70B9 \xD7 \u4EC5\u6536\u8D77\u6D6E\u6761\uFF09\xB7 \u6807\u300C\u514D\u8D70\u300D\u4EE3\u8868\u8001\u9879\u76EE\u8FED\u4EE3\u6216\u76F4\u5954\u4E3B\u9898\uFF0C\u65E0\u9700\u56DE\u5934\u8865\u505A" : "\u6765\u81EA\u300C\u53D1\u73B0\u597D\u63D2\u4EF6\u300D\xB7 \u627E\u73B0\u6210\u6CA1\u5408\u9002\u7684\u5C31\u966A\u4F60\u9020 \xB7 \u540E\u53F0\u7701 Token \u5F15\u5BFC\u751F\u6548\u4E2D\uFF08\u70B9 \xD7 \u4EC5\u6536\u8D77\u6D6E\u6761\uFF09"
6158
6463
  );
6159
- if (mode === "intro") {
6160
- return h(
6161
- "div",
6162
- { className: "pfc_dock", role: "region", "aria-label": "\u53D1\u73B0\u597D\u63D2\u4EF6 \xB7 \u966A\u4F60\u505A\u63D2\u4EF6\u7684\u505A\u6CD5" },
6163
- h("div", { className: "pfc_hd" }, brick(), h("b", null, "\u8FD9\u4E00\u5757\uFF0C\u6211\u966A\u4F60\u505A")),
6164
- h("p", null, "\u505A\u63D2\u4EF6\u7684\u65F6\u5019\u6211\u6309\u4E0B\u9762\u4E94\u6B65\u6765\uFF0C\u6BCF\u4E00\u6B65\u5148\u95EE\u4F60\u3002\u4E0D\u7528\u8BBE\u7F6E\uFF1B\u804A\u522B\u7684\u4E8B\u6211\u4E0D\u51FA\u58F0\u3002"),
6165
- five(),
6166
- h(
6167
- "div",
6168
- { className: "pfc_acts" },
6169
- h("button", { type: "button", className: "pfc_button", "data-primary": "true", onClick: onKnow }, "\u77E5\u9053\u4E86"),
6170
- h("button", { type: "button", className: "pfc_link", onClick: onSkip }, "\u8FD9\u4E2A\u5BF9\u8BDD\u4E0D\u7528\u966A")
6171
- )
6172
- );
6173
- }
6464
+ const five = () => h("div", {
6465
+ className: "pfc_five",
6466
+ role: "img",
6467
+ "aria-label": `\u4E94\u6B65\u6D41\u7A0B\uFF1A${stages.map((stage, index) => `${index + 1} ${STAGE_SHORT[stage.id] ?? stage.label}`).join("\uFF0C")}`
6468
+ }, ...stages.map((stage, index) => {
6469
+ const shortLabel = STAGE_SHORT[stage.id] ?? stage.label;
6470
+ const tip = stageTip(stage, index, running);
6471
+ return h("div", {
6472
+ key: stage.id,
6473
+ title: tip,
6474
+ className: stage.state === "done" ? "is_done" : stage.state === "skipped" ? "is_skipped" : stage.state === "current" ? "is_current" : ""
6475
+ }, h("i", null), h("span", { title: tip }, `${index + 1} ${shortLabel}${stage.state === "skipped" ? " \xB7 \u514D\u8D70" : ""}`));
6476
+ }));
6174
6477
  const lessonList = (stageId, label) => {
6175
6478
  const items8 = STAGE_LESSONS[stageId] ?? STAGE_LESSONS.search;
6176
6479
  return h(
6177
- "details",
6480
+ "div",
6178
6481
  { className: "pfc_lessons" },
6179
- h("summary", { className: "pfc_lessons_sum" }, h("span", null, label ? `\u672C\u6B65\u907F\u5751\u94C1\u5F8B \xB7 ${label}` : "\u672C\u6B65\u907F\u5751\u94C1\u5F8B")),
6482
+ h("div", { className: "pfc_lessons_hd" }, label ? `\u8FD9\u4E00\u6B65\u6CE8\u610F\u4EC0\u4E48 \xB7 ${label}` : "\u8FD9\u4E00\u6B65\u6CE8\u610F\u4EC0\u4E48"),
6180
6483
  h("ul", { className: "pfc_lessons_list" }, ...items8.map((item, idx) => h("li", { key: idx }, item)))
6181
6484
  );
6182
6485
  };
6486
+ const noticeEl = notice ? h("div", { className: "pfc_notice_row", role: "status" }, notice) : null;
6487
+ if (mode === "intro") {
6488
+ return h(
6489
+ "div",
6490
+ { className: "pfc_dock", "data-mode": "intro", role: "region", "aria-label": "\u53D1\u73B0\u597D\u63D2\u4EF6 \xB7 \u521B\u9020\u5411\u5BFC" },
6491
+ h(
6492
+ "div",
6493
+ { className: "pfc_hd" },
6494
+ sparkIcon(),
6495
+ h("b", null, "\u53D1\u73B0\u597D\u63D2\u4EF6 \xB7 \u521B\u9020\u5411\u5BFC"),
6496
+ h("span", { className: "pfc_sub" }, "\u6CA1\u73B0\u6210\u63D2\u4EF6\u65F6\u966A\u4F60\u6309 5 \u6B65\u7A33\u9020 \xB7 \u540E\u53F0\u5DF2\u81EA\u52A8\u7ED9 AI \u5F00\u542F\u7701 Token \u89C4\u77E9"),
6497
+ h(
6498
+ "div",
6499
+ { className: "pfc_hd_tools" },
6500
+ typeof onSkip === "function" ? h("button", { type: "button", className: "pfc_ghost", title: "\u4EC5\u9690\u85CF\u672C\u6B21\u8D77\u6B65\u5361\uFF0C\u540E\u53F0\u7701 Token \u5F15\u5BFC\u7EE7\u7EED\u751F\u6548", onClick: onSkip }, "\u8FD9\u56DE\u4E0D\u7528") : null,
6501
+ typeof onClose === "function" ? h("button", { type: "button", className: "pfc_ghost", title: "\u5728\u6240\u6709\u521B\u9020\u4F1A\u8BDD\u4E2D\u540C\u65F6\u5173\u95ED\u5411\u5BFC\u6D6E\u6761\u4E0E\u540E\u53F0\u7701 Token \u7ECF\u9A8C", disabled: busy !== "", onClick: onClose }, "\u5168\u5C40\u5173\u95ED") : null
6502
+ )
6503
+ ),
6504
+ h(
6505
+ "div",
6506
+ { className: "pfc_chip_row" },
6507
+ ...STARTER_CHIPS.map((chip) => h("button", {
6508
+ key: chip.label,
6509
+ type: "button",
6510
+ className: "pfc_chip",
6511
+ title: chip.prompt,
6512
+ onClick: () => onPrompt ? onPrompt(chip.prompt, { fromIntro: true }) : onKnow?.()
6513
+ }, chip.label)),
6514
+ !onPrompt && typeof onKnow === "function" ? h("button", { type: "button", className: "pfc_ghost", onClick: onKnow }, "\u77E5\u9053\u4E86") : null
6515
+ ),
6516
+ noticeEl
6517
+ );
6518
+ }
6183
6519
  if (mode === "stuck") {
6184
6520
  const blockedStep = progress?.blockedStep;
6185
- const heading = blockedStep ? `\u5361\u5728\u7B2C ${blockedStep} \u6B65${last?.summary ? `\uFF1A${last.summary}` : ""}` : `\u5361\u4F4F\u4E86${last?.summary ? `\uFF1A${last.summary}` : ""}`;
6521
+ const heading = blockedStep ? `\u5361\u5728\u7B2C ${blockedStep} \u6B65` : "\u8FD9\u91CC\u5361\u4F4F\u4E86";
6522
+ const stuckChip = STAGE_CHIPS.blocked.primary;
6186
6523
  return h(
6187
6524
  "div",
6188
- { className: "pfc_dock", "data-stuck": "true", role: "region", "aria-label": "\u53D1\u73B0\u597D\u63D2\u4EF6 \xB7 \u521B\u9020\u8FDB\u5EA6" },
6525
+ { className: "pfc_dock", "data-mode": "stuck", "data-stuck": "true", "data-stage": currentId, "data-running": running ? "true" : "false", role: "region", "aria-label": "\u53D1\u73B0\u597D\u63D2\u4EF6 \xB7 \u5361\u70B9\u6B62\u635F" },
6189
6526
  h(
6190
6527
  "div",
6191
6528
  { className: "pfc_hd" },
6192
- brick(),
6193
- h("b", null, heading)
6529
+ h("i", { className: "pfc_stuck_dot", "aria-hidden": "true" }),
6530
+ h("b", null, heading),
6531
+ last?.summary ? h("span", { className: "pfc_sub", title: last.summary }, last.summary) : null,
6532
+ h(
6533
+ "div",
6534
+ { className: "pfc_hd_tools" },
6535
+ typeof onToggleExpand === "function" ? h("button", { type: "button", className: "pfc_ghost", "aria-expanded": isExpanded, onClick: onToggleExpand }, isExpanded ? "\u6536\u8D77" : "\u8BE6\u60C5") : null,
6536
+ h("button", { type: "button", className: "pfc_ghost", title: "\u672C\u6B21\u5148\u6536\u8D77\u63D0\u793A\uFF0C\u540E\u53F0\u7701 Token \u5F15\u5BFC\u7EE7\u7EED\u751F\u6548", onClick: onDismiss }, "\u5148\u4E0D\u7528")
6537
+ )
6194
6538
  ),
6195
- h("p", null, "\u540C\u4E00\u4E2A\u95EE\u9898\u5728\u4E00\u4E2A\u5BF9\u8BDD\u91CC\u53CD\u590D\u6539\uFF0C\u53EA\u4F1A\u8D8A\u6539\u8D8A\u8D35\u3002\u5F00\u4E2A\u65B0\u7A97\u53E3\uFF0C\u628A\u8BD5\u8FC7\u4EC0\u4E48\u3001\u5361\u5728\u54EA\u4E00\u8D77\u5E26\u8FC7\u53BB\u3002"),
6196
- five(),
6197
- lessonList("blocked", "\u6B62\u635F\u6362\u7A97"),
6539
+ h("p", { className: "pfc_stuck_note" }, "\u540C\u4E00\u4E2A\u95EE\u9898\u5728\u957F\u5BF9\u8BDD\u91CC\u53CD\u590D\u6539\u53EA\u4F1A\u8D8A\u6539\u8D8A\u4E71\uFF1B\u628A\u8FDB\u5C55\u548C\u5361\u70B9\u5E26\u53BB\u65B0\u7A97\u53E3\u63A5\u7740\u505A\u6700\u7A33\u3002"),
6198
6540
  h(
6199
6541
  "div",
6200
- { className: "pfc_acts" },
6201
- h("button", { type: "button", className: "pfc_button", "data-primary": "true", disabled: busy !== "", onClick: onOpenNext, title: "\u65B0\u5EFA\u4E00\u4E2A\u5E72\u51C0\u7684\u521B\u9020\u6A21\u5F0F\u7A97\u53E3\uFF0C\u628A\u8FD9\u91CC\u8BB0\u4E0B\u7684\u8FDB\u5C55\u5E26\u8FC7\u53BB" }, "\u5F00\u65B0\u7A97\u53E3\u63A5\u7740\u505A"),
6202
- h("button", { type: "button", className: "pfc_link", onClick: onDismiss }, "\u5148\u4E0D\u7528"),
6203
- links()
6542
+ { className: "pfc_chip_row" },
6543
+ h("button", {
6544
+ type: "button",
6545
+ className: "pfc_button",
6546
+ "data-primary": "true",
6547
+ disabled: busy !== "",
6548
+ onClick: onOpenNext,
6549
+ title: "\u65B0\u5EFA\u4E00\u4E2A\u5E72\u51C0\u7684\u521B\u9020\u6A21\u5F0F\u7A97\u53E3\uFF0C\u628A\u8FD9\u91CC\u8BB0\u4E0B\u7684\u8FDB\u5C55\u5E26\u8FC7\u53BB"
6550
+ }, "\u5F00\u65B0\u7A97\u53E3\u63A5\u7740\u505A"),
6551
+ h("button", {
6552
+ type: "button",
6553
+ className: "pfc_chip",
6554
+ title: stuckChip.prompt,
6555
+ onClick: () => onPrompt?.(stuckChip.prompt)
6556
+ }, stuckChip.label)
6204
6557
  ),
6205
- notice ? h("span", { className: "pfc_notice", role: "status" }, notice) : null
6558
+ isExpanded ? h(
6559
+ "div",
6560
+ { className: "pfc_drawer" },
6561
+ five(),
6562
+ metaNote(),
6563
+ lessonList("blocked", "\u6B62\u635F\u6362\u7A97"),
6564
+ h(
6565
+ "div",
6566
+ { className: "pfc_drawer_foot" },
6567
+ h(
6568
+ "div",
6569
+ { className: "pfc_drawer_right" },
6570
+ typeof onSettings === "function" ? h("button", { type: "button", className: "pfc_ghost", onClick: onSettings }, "\u7BA1\u7406\u7ECF\u9A8C\u5E93") : null,
6571
+ typeof onClose === "function" ? h("button", { type: "button", className: "pfc_ghost", title: "\u5728\u6240\u6709\u521B\u9020\u4F1A\u8BDD\u4E2D\u540C\u65F6\u5173\u95ED\u5411\u5BFC\u6D6E\u6761\u4E0E\u540E\u53F0\u7701 Token \u7ECF\u9A8C", disabled: busy !== "", onClick: onClose }, "\u5168\u5C40\u5173\u95ED") : null
6572
+ )
6573
+ )
6574
+ ) : null,
6575
+ noticeEl
6206
6576
  );
6207
6577
  }
6208
- const current = stages.find((stage) => stage.state === "current") ?? stages[Math.min(Math.max(reached, 0), (stages.length || 1) - 1)];
6578
+ const stepNum = Math.min(Math.max(reached, 1), stages.length || 5);
6579
+ const chips = STAGE_CHIPS[currentId] ?? STAGE_CHIPS.search;
6580
+ const shortTitle = STAGE_SHORT[currentId] ?? current?.label ?? "\u8FDB\u884C\u4E2D";
6581
+ const hintText = running ? "\u6B63\u5728\u6309\u4F60\u7684\u8981\u6C42\u66F4\u65B0\uFF0C\u5B8C\u6210\u540E\u518D\u6838\u5BF9\u6548\u679C" : STAGE_HINTS[currentId] ?? "";
6582
+ const badgeText = running ? `\u7B2C ${stepNum}/5 \u6B65 \xB7 \u6B63\u5728\u6539\u52A8\u2026` : `\u7B2C ${stepNum}/5 \u6B65 \xB7 ${shortTitle}`;
6209
6583
  return h(
6210
6584
  "div",
6211
- { className: "pfc_dock", role: "region", "aria-label": "\u53D1\u73B0\u597D\u63D2\u4EF6 \xB7 \u521B\u9020\u8FDB\u5EA6" },
6585
+ {
6586
+ className: "pfc_dock",
6587
+ "data-mode": "run",
6588
+ "data-compact": isExpanded ? "false" : "true",
6589
+ "data-stage": currentId,
6590
+ "data-running": running ? "true" : "false",
6591
+ role: "region",
6592
+ "aria-label": "\u53D1\u73B0\u597D\u63D2\u4EF6 \xB7 \u521B\u9020\u5411\u5BFC"
6593
+ },
6212
6594
  h(
6213
6595
  "div",
6214
- { className: "pfc_hd" },
6215
- brick(),
6216
- h("b", null, `\u505A\u5230\u7B2C ${Math.min(Math.max(reached, 1), stages.length || 5)} \u6B65${current ? `\uFF1A${current.plain ?? current.label}` : ""}`),
6217
- links(true)
6596
+ { className: "pfc_bar" },
6597
+ h(
6598
+ "button",
6599
+ {
6600
+ type: "button",
6601
+ className: "pfc_bar_toggle",
6602
+ "aria-expanded": isExpanded,
6603
+ onClick: onToggleExpand,
6604
+ title: isExpanded ? "\u6536\u8D77\u5411\u5BFC\u8BE6\u60C5" : "\u70B9\u51FB\u67E5\u770B 5 \u6B65\u8F68\u8FF9\u4E0E\u9A8C\u6536\u9526\u56CA\uFF08\u6765\u81EA\u300C\u53D1\u73B0\u597D\u63D2\u4EF6\u300D\uFF0C\u540E\u53F0\u7701 Token \u5F15\u5BFC\u751F\u6548\u4E2D\uFF09"
6605
+ },
6606
+ h("span", { className: "pfc_mini_steps", "aria-hidden": "true" }, ...stages.map((stage, index) => h("i", {
6607
+ key: stage.id,
6608
+ title: stageTip(stage, index, running),
6609
+ className: stage.state === "done" ? "is_done" : stage.state === "skipped" ? "is_skipped" : stage.state === "current" ? running ? "is_current is_running" : "is_current" : ""
6610
+ }))),
6611
+ h("span", { className: "pfc_badge" }, badgeText),
6612
+ h("span", { className: "pfc_hint" }, hintText)
6613
+ ),
6614
+ h(
6615
+ "div",
6616
+ { className: "pfc_bar_actions" },
6617
+ !running && chips.primary ? h("button", {
6618
+ type: "button",
6619
+ className: "pfc_chip",
6620
+ title: chips.primary.prompt,
6621
+ onClick: () => onPrompt?.(chips.primary.prompt)
6622
+ }, chips.primary.label) : null,
6623
+ h("button", {
6624
+ type: "button",
6625
+ className: "pfc_icon_btn",
6626
+ "aria-expanded": isExpanded,
6627
+ "aria-label": isExpanded ? "\u6536\u8D77\u5411\u5BFC\u8BE6\u60C5" : "\u5C55\u5F00\u5411\u5BFC\u8BE6\u60C5",
6628
+ title: isExpanded ? "\u6536\u8D77\u5411\u5BFC\u8BE6\u60C5" : "\u5C55\u5F00\u9636\u6BB5\u4E0E\u9526\u56CA",
6629
+ onClick: onToggleExpand
6630
+ }, chevronIcon(isExpanded)),
6631
+ typeof onDismiss === "function" ? h("button", {
6632
+ type: "button",
6633
+ className: "pfc_icon_btn",
6634
+ "aria-label": "\u672C\u4F1A\u8BDD\u6536\u8D77\u5411\u5BFC",
6635
+ title: "\u672C\u6B21\u5BF9\u8BDD\u5148\u6536\u8D77\u6D6E\u6761\uFF08\u540E\u53F0\u7701 Token \u5F15\u5BFC\u7EE7\u7EED\u751F\u6548\uFF09",
6636
+ onClick: onDismiss
6637
+ }, closeIcon()) : null
6638
+ )
6218
6639
  ),
6219
- h("p", null, last?.summary ? last.summary : "\u6BCF\u4E00\u6B65\u90FD\u5148\u95EE\u4F60\uFF0C\u4F60\u8BF4\u4E86\u624D\u5F80\u4E0B\u8D70\u3002"),
6220
- five(),
6221
- lessonList(current?.id || "search", current?.label || ""),
6222
- notice ? h("span", { className: "pfc_notice", role: "status" }, notice) : null
6640
+ isExpanded ? h(
6641
+ "div",
6642
+ { className: "pfc_drawer" },
6643
+ five(),
6644
+ metaNote(),
6645
+ last?.summary ? h("p", { className: "pfc_summary" }, `\u6700\u8FD1\u8BB0\u5F55\uFF1A${last.summary}`) : null,
6646
+ lessonList(currentId, shortTitle),
6647
+ h(
6648
+ "div",
6649
+ { className: "pfc_drawer_foot" },
6650
+ h(
6651
+ "div",
6652
+ { className: "pfc_drawer_left" },
6653
+ chips.secondary ? h("button", {
6654
+ type: "button",
6655
+ className: "pfc_chip",
6656
+ title: chips.secondary.prompt,
6657
+ onClick: () => onPrompt?.(chips.secondary.prompt)
6658
+ }, chips.secondary.label) : null,
6659
+ typeof onOpenNext === "function" ? h("button", {
6660
+ type: "button",
6661
+ className: "pfc_chip",
6662
+ disabled: busy !== "",
6663
+ onClick: onOpenNext
6664
+ }, "\u5E26\u8FDB\u5C55\u6362\u65B0\u7A97\u53E3") : null
6665
+ ),
6666
+ h(
6667
+ "div",
6668
+ { className: "pfc_drawer_right" },
6669
+ typeof onShowSteps === "function" ? h("button", { type: "button", className: "pfc_ghost", onClick: onShowSteps }, "\u67E5\u770B\u8D77\u6B65\u6A21\u677F") : null,
6670
+ typeof onSettings === "function" ? h("button", { type: "button", className: "pfc_ghost", onClick: onSettings }, "\u7BA1\u7406\u7ECF\u9A8C\u5E93") : null,
6671
+ typeof onClose === "function" ? h("button", { type: "button", className: "pfc_ghost", title: "\u5728\u6240\u6709\u521B\u9020\u4F1A\u8BDD\u4E2D\u540C\u65F6\u5173\u95ED\u5411\u5BFC\u6D6E\u6761\u4E0E\u540E\u53F0\u7701 Token \u7ECF\u9A8C", disabled: busy !== "", onClick: onClose }, "\u5168\u5C40\u5173\u95ED") : null
6672
+ )
6673
+ )
6674
+ ) : null,
6675
+ noticeEl
6223
6676
  );
6224
6677
  };
6225
6678
  }
@@ -6268,7 +6721,11 @@ function createCreatorStrip(React2, { ctx, request, openSettings }) {
6268
6721
  const [busy, setBusy] = React2.useState("");
6269
6722
  const [notice, setNotice] = React2.useState("");
6270
6723
  const [closedHere, setClosedHere] = React2.useState(false);
6271
- const [dismissed, setDismissed] = React2.useState(false);
6724
+ const [expanded, setExpanded] = React2.useState(false);
6725
+ const [running, setRunning] = React2.useState(false);
6726
+ const [turnEnds, setTurnEnds] = React2.useState(0);
6727
+ const [dismissedAt, setDismissedAt] = React2.useState(-1);
6728
+ const [manualIntro, setManualIntro] = React2.useState(false);
6272
6729
  const [introOpen, setIntroOpen] = React2.useState(() => {
6273
6730
  try {
6274
6731
  const store = globalThis.localStorage;
@@ -6277,15 +6734,40 @@ function createCreatorStrip(React2, { ctx, request, openSettings }) {
6277
6734
  return true;
6278
6735
  }
6279
6736
  });
6737
+ const noticeTimerRef = React2.useRef(null);
6738
+ const showNotice = React2.useCallback((message) => {
6739
+ if (noticeTimerRef.current) clearTimeout(noticeTimerRef.current);
6740
+ setNotice(message);
6741
+ if (message) noticeTimerRef.current = setTimeout(() => {
6742
+ noticeTimerRef.current = null;
6743
+ setNotice("");
6744
+ }, 2400);
6745
+ }, []);
6746
+ React2.useEffect(() => () => {
6747
+ if (noticeTimerRef.current) clearTimeout(noticeTimerRef.current);
6748
+ }, []);
6280
6749
  const dismissIntro = (hideForever) => {
6281
6750
  try {
6282
6751
  globalThis.localStorage?.setItem(hideForever ? `finder.creator.skip.${sessionId}` : `finder.creator.intro.${sessionId}`, "1");
6283
6752
  } catch {
6284
6753
  }
6285
6754
  setIntroOpen(false);
6755
+ setManualIntro(false);
6286
6756
  };
6287
6757
  React2.useEffect(() => {
6288
6758
  setPreset(presetOf(ctx, sessionId));
6759
+ setExpanded(false);
6760
+ setDismissedAt(-1);
6761
+ setManualIntro(false);
6762
+ setRunning(false);
6763
+ setTurnEnds(0);
6764
+ setNotice("");
6765
+ try {
6766
+ const store = globalThis.localStorage;
6767
+ setIntroOpen(store?.getItem(`finder.creator.intro.${sessionId}`) !== "1" && store?.getItem(`finder.creator.skip.${sessionId}`) !== "1");
6768
+ } catch {
6769
+ setIntroOpen(true);
6770
+ }
6289
6771
  const face = (() => {
6290
6772
  try {
6291
6773
  return ctx.sessions?.binding?.(sessionId)?.session?.projections?.faceOf?.("agentPreset");
@@ -6317,20 +6799,35 @@ function createCreatorStrip(React2, { ctx, request, openSettings }) {
6317
6799
  return null;
6318
6800
  }
6319
6801
  })();
6320
- const count2 = () => {
6802
+ const scan = () => {
6321
6803
  const entries = source?.getSnapshot?.()?.entries;
6322
- if (!Array.isArray(entries)) return 0;
6323
- let total = 0;
6804
+ if (!Array.isArray(entries)) return { signalCount: 0, endedCount: 0, isRunning: false };
6805
+ let signalCount = 0;
6806
+ let endedCount = 0;
6807
+ let lastTurnType = "";
6324
6808
  for (const entry of entries) {
6325
6809
  const event = entry?.event;
6326
- if (entry?.type === "event" && (event?.type === "turn/end" || event?.type === "tool/call" && event.data?.name === "finder_creator_step")) total += 1;
6810
+ if (entry?.type !== "event") continue;
6811
+ if (event?.type === "turn/start") {
6812
+ lastTurnType = "turn/start";
6813
+ continue;
6814
+ }
6815
+ if (event?.type === "turn/end") {
6816
+ lastTurnType = "turn/end";
6817
+ endedCount += 1;
6818
+ signalCount += 1;
6819
+ continue;
6820
+ }
6821
+ if (event?.type === "tool/call" && event.data?.name === "finder_creator_step") signalCount += 1;
6327
6822
  }
6328
- return total;
6823
+ return { signalCount, endedCount, isRunning: lastTurnType === "turn/start" };
6329
6824
  };
6330
6825
  const check = () => {
6331
- const now = count2();
6332
- if (now === seen) return;
6333
- seen = now;
6826
+ const next = scan();
6827
+ setRunning(next.isRunning);
6828
+ setTurnEnds(next.endedCount);
6829
+ if (next.signalCount === seen) return;
6830
+ seen = next.signalCount;
6334
6831
  if (timer) clearTimeout(timer);
6335
6832
  timer = setTimeout(() => {
6336
6833
  timer = null;
@@ -6351,37 +6848,58 @@ function createCreatorStrip(React2, { ctx, request, openSettings }) {
6351
6848
  void request("creator-configure", { enabled: true }).then(() => {
6352
6849
  setClosedHere(false);
6353
6850
  setData((current) => ({ ...current ?? {}, enabled: true }));
6354
- }).catch(() => setNotice("\u6CA1\u6709\u91CD\u65B0\u5F00\u542F\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002")).finally(() => setBusy(""));
6851
+ }).catch(() => showNotice("\u6CA1\u6709\u91CD\u65B0\u5F00\u542F\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002")).finally(() => setBusy(""));
6355
6852
  };
6356
6853
  if (closedHere) return h(Dock, { mode: "closed", busy, notice, onEnable: enable });
6357
6854
  if (data.enabled === false) return null;
6358
6855
  const progress = creatorProgress(data.steps);
6359
6856
  const openNext = () => {
6360
6857
  setBusy("next");
6361
- setNotice("");
6858
+ showNotice("");
6362
6859
  void openCreatorContinuation(ctx, sessionId, creatorHandoffPrompt(data.steps)).then((result) => {
6363
- if (result.draft !== "applied") setNotice("\u65B0\u7A97\u53E3\u5DF2\u6253\u5F00\uFF0C\u4EA4\u63A5\u5185\u5BB9\u6CA1\u80FD\u653E\u8FDB\u8F93\u5165\u6846\uFF0C\u53EF\u4EE5\u624B\u52A8\u8BF4\u660E\u8FDB\u5C55\u3002");
6364
- }).catch((error) => setNotice(error?.safeForUser ? error.message : "\u6CA1\u80FD\u5F00\u65B0\u7A97\u53E3\uFF0C\u8BF7\u4ECE\u5DE6\u4FA7\u65B0\u5EFA\u521B\u9020\u6A21\u5F0F\u4F1A\u8BDD\u3002")).finally(() => setBusy(""));
6860
+ if (result.draft !== "applied") showNotice("\u65B0\u7A97\u53E3\u5DF2\u6253\u5F00\uFF0C\u4EA4\u63A5\u5185\u5BB9\u6CA1\u80FD\u653E\u8FDB\u8F93\u5165\u6846\uFF0C\u53EF\u4EE5\u624B\u52A8\u8BF4\u660E\u8FDB\u5C55\u3002");
6861
+ }).catch((error) => showNotice(error?.safeForUser ? error.message : "\u6CA1\u80FD\u5F00\u65B0\u7A97\u53E3\uFF0C\u8BF7\u4ECE\u5DE6\u4FA7\u65B0\u5EFA\u521B\u9020\u6A21\u5F0F\u4F1A\u8BDD\u3002")).finally(() => setBusy(""));
6365
6862
  };
6366
6863
  const close = () => {
6367
6864
  setBusy("close");
6368
- setNotice("");
6369
- void request("creator-configure", { enabled: false }).then(() => setClosedHere(true)).catch(() => setNotice("\u6CA1\u6709\u5173\u95ED\u6210\u529F\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002")).finally(() => setBusy(""));
6865
+ showNotice("");
6866
+ void request("creator-configure", { enabled: false }).then(() => setClosedHere(true)).catch(() => showNotice("\u6CA1\u6709\u5173\u95ED\u6210\u529F\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002")).finally(() => setBusy(""));
6867
+ };
6868
+ const handlePrompt = (prompt, opts = {}) => {
6869
+ void applyCreatorPrompt({ ctx, sessionId, inputActions: props?.inputActions }, prompt).then((status) => {
6870
+ if (opts.fromIntro) dismissIntro(false);
6871
+ if (status === "copied") showNotice("\u5DF2\u590D\u5236\u5F15\u5BFC\u8BDD\u672F\uFF0C\u53EF\u76F4\u63A5\u7C98\u8D34\u5230\u8F93\u5165\u6846");
6872
+ else if (status === "unavailable") showNotice("\u6682\u65F6\u5199\u5165\u4E0D\u5230\u8F93\u5165\u6846\uFF0C\u8BF7\u5148\u70B9\u4E00\u4E0B\u8F93\u5165\u6846\u518D\u8BD5");
6873
+ else if (status === "inserted" && !opts.fromIntro) showNotice("\u5DF2\u586B\u5165\u8F93\u5165\u6846\uFF0C\u8865\u5145\u7EC6\u8282\u5373\u53EF\u53D1\u9001");
6874
+ });
6370
6875
  };
6371
- if (!progress.count && !introOpen) return null;
6372
- if (dismissed) return null;
6373
- const mode = progress.blocked ? "stuck" : progress.count ? "run" : "intro";
6876
+ if (!progress.count && !manualIntro && (!introOpen || turnEnds > 0)) return null;
6877
+ const isDismissed = dismissedAt >= 0 && !(progress.blocked && progress.count > dismissedAt);
6878
+ if (isDismissed && !manualIntro) return null;
6879
+ const mode = manualIntro ? "intro" : progress.blocked ? "stuck" : progress.count ? "run" : "intro";
6374
6880
  return h(Dock, {
6375
6881
  mode,
6376
6882
  progress,
6883
+ expanded,
6884
+ running,
6377
6885
  busy,
6378
6886
  notice,
6379
6887
  onKnow: () => dismissIntro(false),
6380
6888
  onSkip: () => dismissIntro(true),
6381
- onShowSteps: () => setIntroOpen(true),
6889
+ onToggleExpand: () => setExpanded((v) => !v),
6890
+ onPrompt: handlePrompt,
6891
+ onShowSteps: () => {
6892
+ setExpanded(false);
6893
+ setManualIntro(true);
6894
+ setIntroOpen(true);
6895
+ },
6382
6896
  onOpenNext: openNext,
6383
6897
  onClose: close,
6384
- onDismiss: () => setDismissed(true),
6898
+ onDismiss: () => {
6899
+ setExpanded(false);
6900
+ setManualIntro(false);
6901
+ setDismissedAt(progress.count);
6902
+ },
6385
6903
  onSettings: typeof openSettings === "function" ? openSettings : null,
6386
6904
  onEnable: enable
6387
6905
  });