@aiyiran/myclaw 1.1.203 → 1.1.204
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/myclaw-artifacts.js +279 -97
- package/package.json +1 -1
|
@@ -311,9 +311,12 @@
|
|
|
311
311
|
panelFooter.appendChild(historyFooterBtn);
|
|
312
312
|
panelFooter.appendChild(forkPanelBtn);
|
|
313
313
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
314
|
+
var workSection = document.createElement('section');
|
|
315
|
+
workSection.className = 'myclaw-artifacts-work-section';
|
|
316
|
+
workSection.appendChild(header);
|
|
317
|
+
workSection.appendChild(content);
|
|
318
|
+
workSection.appendChild(panelFooter);
|
|
319
|
+
panel.appendChild(workSection);
|
|
317
320
|
panel.appendChild(createTrainingCard(null));
|
|
318
321
|
document.body.appendChild(panel);
|
|
319
322
|
|
|
@@ -688,18 +691,17 @@
|
|
|
688
691
|
var TRAINING_CARD_STORAGE_LIMIT = 200;
|
|
689
692
|
|
|
690
693
|
function buildTrainingCardPrompt(values) {
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
''
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
].join('\n');
|
|
694
|
+
var sections = [];
|
|
695
|
+
function addSection(title, value) {
|
|
696
|
+
if (!value) return;
|
|
697
|
+
sections.push(title, value, '');
|
|
698
|
+
}
|
|
699
|
+
addSection('我最想解决的一个问题是:', values.problem);
|
|
700
|
+
addSection('我想在 10 分钟后达成的目标是:', values.goal);
|
|
701
|
+
addSection('我选择的方案是:', values.plan);
|
|
702
|
+
addSection('我验收的结果是:', values.acceptance);
|
|
703
|
+
sections.push('请只围绕我填写的内容帮助我,不要顺便修改其他内容。');
|
|
704
|
+
return sections.join('\n');
|
|
703
705
|
}
|
|
704
706
|
|
|
705
707
|
function createTrainingRecord(asset, values) {
|
|
@@ -717,12 +719,13 @@
|
|
|
717
719
|
} : null,
|
|
718
720
|
problem: values.problem,
|
|
719
721
|
goal: values.goal,
|
|
720
|
-
plan: values.plan
|
|
722
|
+
plan: values.plan,
|
|
723
|
+
acceptance: values.acceptance
|
|
721
724
|
};
|
|
722
725
|
}
|
|
723
726
|
|
|
724
|
-
function
|
|
725
|
-
var key = TRAINING_CARD_STORAGE_PREFIX +
|
|
727
|
+
function loadTrainingRecords(workspace) {
|
|
728
|
+
var key = TRAINING_CARD_STORAGE_PREFIX + workspace;
|
|
726
729
|
var records = [];
|
|
727
730
|
try {
|
|
728
731
|
var stored = JSON.parse(localStorage.getItem(key) || '[]');
|
|
@@ -730,12 +733,67 @@
|
|
|
730
733
|
} catch (e) {
|
|
731
734
|
records = [];
|
|
732
735
|
}
|
|
733
|
-
records
|
|
736
|
+
return records;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
function saveTrainingRecordLocally(asset, values, recordId) {
|
|
740
|
+
var workspace = getWorkspaceId();
|
|
741
|
+
var key = TRAINING_CARD_STORAGE_PREFIX + workspace;
|
|
742
|
+
var records = loadTrainingRecords(workspace);
|
|
743
|
+
var recordIndex = -1;
|
|
744
|
+
if (recordId) {
|
|
745
|
+
recordIndex = records.findIndex(function (item) {
|
|
746
|
+
return item && item.recordId === recordId;
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
var isUpdate = recordIndex !== -1;
|
|
751
|
+
var record;
|
|
752
|
+
if (isUpdate) {
|
|
753
|
+
record = Object.assign({}, records[recordIndex], {
|
|
754
|
+
updatedAt: new Date().toISOString(),
|
|
755
|
+
claw: lastKnownClawName || '',
|
|
756
|
+
studentAgent: getAgentName(),
|
|
757
|
+
asset: asset ? {
|
|
758
|
+
name: asset.name || '',
|
|
759
|
+
path: asset.path || ''
|
|
760
|
+
} : null,
|
|
761
|
+
problem: values.problem,
|
|
762
|
+
goal: values.goal,
|
|
763
|
+
plan: values.plan,
|
|
764
|
+
acceptance: values.acceptance
|
|
765
|
+
});
|
|
766
|
+
records[recordIndex] = record;
|
|
767
|
+
} else {
|
|
768
|
+
record = createTrainingRecord(asset, values);
|
|
769
|
+
records.push(record);
|
|
770
|
+
recordIndex = records.length - 1;
|
|
771
|
+
}
|
|
772
|
+
|
|
734
773
|
if (records.length > TRAINING_CARD_STORAGE_LIMIT) {
|
|
735
774
|
records = records.slice(records.length - TRAINING_CARD_STORAGE_LIMIT);
|
|
775
|
+
recordIndex = records.findIndex(function (item) {
|
|
776
|
+
return item && item.recordId === record.recordId;
|
|
777
|
+
});
|
|
736
778
|
}
|
|
737
779
|
localStorage.setItem(key, JSON.stringify(records));
|
|
738
|
-
return
|
|
780
|
+
return {
|
|
781
|
+
record: record,
|
|
782
|
+
index: recordIndex,
|
|
783
|
+
isUpdate: isUpdate
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
function formatTrainingCardNumber(index) {
|
|
788
|
+
var number = index + 1;
|
|
789
|
+
var digits = ['', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
|
|
790
|
+
if (number <= 9) return digits[number];
|
|
791
|
+
if (number === 10) return '十';
|
|
792
|
+
if (number < 20) return '十' + digits[number % 10];
|
|
793
|
+
if (number < 100) {
|
|
794
|
+
return digits[Math.floor(number / 10)] + '十' + digits[number % 10];
|
|
795
|
+
}
|
|
796
|
+
return String(number);
|
|
739
797
|
}
|
|
740
798
|
|
|
741
799
|
function createTrainingCard(asset) {
|
|
@@ -743,39 +801,31 @@
|
|
|
743
801
|
section.className = 'myclaw-training-card';
|
|
744
802
|
var voiceDestroyers = [];
|
|
745
803
|
|
|
746
|
-
var heading = document.createElement('div');
|
|
747
|
-
heading.className = 'myclaw-training-card__heading';
|
|
748
|
-
var headingText = document.createElement('div');
|
|
749
|
-
var title = document.createElement('h2');
|
|
750
|
-
title.textContent = '这一轮想做什么?';
|
|
751
|
-
var intro = document.createElement('p');
|
|
752
|
-
intro.textContent = '三句话就够了,简单写。';
|
|
753
|
-
headingText.appendChild(title);
|
|
754
|
-
headingText.appendChild(intro);
|
|
755
|
-
|
|
756
|
-
var step = document.createElement('div');
|
|
757
|
-
step.className = 'myclaw-training-card__step';
|
|
758
|
-
step.textContent = '问题 → 目标 → 方案';
|
|
759
|
-
heading.appendChild(headingText);
|
|
760
|
-
heading.appendChild(step);
|
|
761
|
-
section.appendChild(heading);
|
|
762
|
-
|
|
763
804
|
var fields = document.createElement('div');
|
|
764
805
|
fields.className = 'myclaw-training-card__fields';
|
|
765
806
|
|
|
766
|
-
function makeField(number, label, prompt,
|
|
807
|
+
function makeField(number, label, prompt, hints, target) {
|
|
767
808
|
var field = document.createElement('label');
|
|
768
809
|
field.className = 'myclaw-training-card__field';
|
|
810
|
+
var fieldHeader = document.createElement('span');
|
|
811
|
+
fieldHeader.className = 'myclaw-training-card__field-header';
|
|
769
812
|
var fieldTitle = document.createElement('span');
|
|
770
813
|
fieldTitle.className = 'myclaw-training-card__field-title';
|
|
771
|
-
fieldTitle.textContent = number + '、' +
|
|
772
|
-
var
|
|
773
|
-
|
|
774
|
-
|
|
814
|
+
fieldTitle.textContent = number + '、' + prompt;
|
|
815
|
+
var hintRow = null;
|
|
816
|
+
if (hints && hints.length) {
|
|
817
|
+
hintRow = document.createElement('span');
|
|
818
|
+
hintRow.className = 'myclaw-training-card__hints';
|
|
819
|
+
hints.forEach(function (hint) {
|
|
820
|
+
var hintTag = document.createElement('span');
|
|
821
|
+
hintTag.className = 'myclaw-training-card__hint';
|
|
822
|
+
hintTag.textContent = hint;
|
|
823
|
+
hintRow.appendChild(hintTag);
|
|
824
|
+
});
|
|
825
|
+
}
|
|
775
826
|
var input = document.createElement('textarea');
|
|
776
827
|
input.rows = 2;
|
|
777
828
|
input.maxLength = 1000;
|
|
778
|
-
input.placeholder = placeholder;
|
|
779
829
|
input.setAttribute('aria-label', label);
|
|
780
830
|
|
|
781
831
|
var inputWrap = document.createElement('span');
|
|
@@ -795,10 +845,11 @@
|
|
|
795
845
|
].join('');
|
|
796
846
|
inputWrap.appendChild(input);
|
|
797
847
|
inputWrap.appendChild(micBtn);
|
|
798
|
-
|
|
799
|
-
|
|
848
|
+
fieldHeader.appendChild(fieldTitle);
|
|
849
|
+
if (hintRow) fieldHeader.appendChild(hintRow);
|
|
850
|
+
field.appendChild(fieldHeader);
|
|
800
851
|
field.appendChild(inputWrap);
|
|
801
|
-
fields.appendChild(field);
|
|
852
|
+
(target || fields).appendChild(field);
|
|
802
853
|
|
|
803
854
|
if (typeof window.myclawBindVoiceInput === 'function') {
|
|
804
855
|
voiceDestroyers.push(window.myclawBindVoiceInput(input, micBtn));
|
|
@@ -811,58 +862,83 @@
|
|
|
811
862
|
|
|
812
863
|
var problemInput = makeField(
|
|
813
864
|
'1', '问题',
|
|
814
|
-
'
|
|
815
|
-
'
|
|
865
|
+
'我最想解决的一个问题是:',
|
|
866
|
+
['一个', '具体', '够小']
|
|
816
867
|
);
|
|
817
868
|
var goalInput = makeField(
|
|
818
869
|
'2', '目标',
|
|
819
|
-
'
|
|
820
|
-
'
|
|
870
|
+
'我想在 10 分钟后达成的目标是:',
|
|
871
|
+
['10分钟', '很清楚', '能检查']
|
|
821
872
|
);
|
|
822
873
|
var planInput = makeField(
|
|
823
874
|
'3', '方案',
|
|
824
|
-
'
|
|
825
|
-
'
|
|
875
|
+
'我选择的方案是:',
|
|
876
|
+
['为什么喜欢这个 / 其他的为什么不好']
|
|
826
877
|
);
|
|
827
878
|
section.appendChild(fields);
|
|
828
879
|
|
|
829
880
|
var footer = document.createElement('div');
|
|
830
881
|
footer.className = 'myclaw-training-card__footer';
|
|
882
|
+
var metaRow = document.createElement('div');
|
|
883
|
+
metaRow.className = 'myclaw-training-card__meta-row';
|
|
831
884
|
var status = document.createElement('div');
|
|
832
885
|
status.className = 'myclaw-training-card__status';
|
|
833
886
|
status.setAttribute('role', 'status');
|
|
834
887
|
status.setAttribute('aria-live', 'polite');
|
|
835
888
|
var actions = document.createElement('div');
|
|
836
889
|
actions.className = 'myclaw-training-card__actions';
|
|
890
|
+
var cardActions = document.createElement('div');
|
|
891
|
+
cardActions.className = 'myclaw-training-card__actions myclaw-training-card__card-actions';
|
|
837
892
|
var aiBtn = document.createElement('button');
|
|
838
893
|
aiBtn.type = 'button';
|
|
839
894
|
aiBtn.className = 'myclaw-training-card__button myclaw-training-card__button--ai';
|
|
840
895
|
aiBtn.textContent = '提交 AI';
|
|
841
|
-
var
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
896
|
+
var cardBtn = document.createElement('button');
|
|
897
|
+
cardBtn.type = 'button';
|
|
898
|
+
cardBtn.className = 'myclaw-training-card__button myclaw-training-card__button--teacher';
|
|
899
|
+
cardBtn.textContent = '提交卡片';
|
|
845
900
|
actions.appendChild(aiBtn);
|
|
846
|
-
|
|
847
|
-
|
|
901
|
+
cardActions.appendChild(cardBtn);
|
|
902
|
+
|
|
903
|
+
var history = document.createElement('div');
|
|
904
|
+
history.className = 'myclaw-training-card__history';
|
|
905
|
+
var historyList = document.createElement('div');
|
|
906
|
+
historyList.className = 'myclaw-training-card__history-list';
|
|
907
|
+
history.appendChild(historyList);
|
|
908
|
+
metaRow.appendChild(status);
|
|
909
|
+
footer.appendChild(metaRow);
|
|
848
910
|
footer.appendChild(actions);
|
|
849
911
|
section.appendChild(footer);
|
|
850
912
|
|
|
851
|
-
var
|
|
913
|
+
var acceptanceFields = document.createElement('div');
|
|
914
|
+
acceptanceFields.className = 'myclaw-training-card__fields myclaw-training-card__acceptance';
|
|
915
|
+
var acceptanceInput = makeField(
|
|
916
|
+
'4', '验收',
|
|
917
|
+
'验收',
|
|
918
|
+
['我预期是什么?', '实际是什么?', '问题在哪里?'],
|
|
919
|
+
acceptanceFields
|
|
920
|
+
);
|
|
921
|
+
section.appendChild(acceptanceFields);
|
|
922
|
+
section.appendChild(cardActions);
|
|
923
|
+
section.appendChild(history);
|
|
924
|
+
|
|
925
|
+
var editingRecordId = '';
|
|
852
926
|
|
|
853
927
|
function readValues() {
|
|
854
928
|
return {
|
|
855
929
|
problem: problemInput.value.trim(),
|
|
856
930
|
goal: goalInput.value.trim(),
|
|
857
|
-
plan: planInput.value.trim()
|
|
931
|
+
plan: planInput.value.trim(),
|
|
932
|
+
acceptance: acceptanceInput.value.trim()
|
|
858
933
|
};
|
|
859
934
|
}
|
|
860
935
|
|
|
861
|
-
function validate(values) {
|
|
936
|
+
function validate(values, includeAcceptance) {
|
|
862
937
|
var missing = [];
|
|
863
938
|
if (!values.problem) missing.push('问题');
|
|
864
939
|
if (!values.goal) missing.push('目标');
|
|
865
940
|
if (!values.plan) missing.push('方案');
|
|
941
|
+
if (includeAcceptance && !values.acceptance) missing.push('验收');
|
|
866
942
|
if (missing.length) {
|
|
867
943
|
status.className = 'myclaw-training-card__status myclaw-training-card__status--error';
|
|
868
944
|
status.textContent = '请先填写:' + missing.join('、');
|
|
@@ -871,9 +947,71 @@
|
|
|
871
947
|
return true;
|
|
872
948
|
}
|
|
873
949
|
|
|
950
|
+
function updateCardButtonState() {
|
|
951
|
+
var values = readValues();
|
|
952
|
+
var ready = !!(values.problem && values.goal && values.plan && values.acceptance);
|
|
953
|
+
cardBtn.disabled = !ready;
|
|
954
|
+
cardBtn.title = ready ? '保存这张卡片' : '填写问题、目标、方案和验收后即可提交';
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
function clearInputs() {
|
|
958
|
+
problemInput.value = '';
|
|
959
|
+
goalInput.value = '';
|
|
960
|
+
planInput.value = '';
|
|
961
|
+
acceptanceInput.value = '';
|
|
962
|
+
editingRecordId = '';
|
|
963
|
+
updateCardButtonState();
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
function renderHistory() {
|
|
967
|
+
var records = loadTrainingRecords(getWorkspaceId());
|
|
968
|
+
historyList.textContent = '';
|
|
969
|
+
history.hidden = records.length === 0;
|
|
970
|
+
records.forEach(function (record, index) {
|
|
971
|
+
if (!record) return;
|
|
972
|
+
var cardName = '卡片' + formatTrainingCardNumber(index);
|
|
973
|
+
var item = document.createElement('button');
|
|
974
|
+
item.type = 'button';
|
|
975
|
+
item.className = 'myclaw-training-card__history-item';
|
|
976
|
+
if (record.recordId === editingRecordId) {
|
|
977
|
+
item.classList.add('myclaw-training-card__history-item--active');
|
|
978
|
+
}
|
|
979
|
+
item.setAttribute('aria-label', '打开' + cardName);
|
|
980
|
+
|
|
981
|
+
var name = document.createElement('span');
|
|
982
|
+
name.className = 'myclaw-training-card__history-name';
|
|
983
|
+
name.textContent = cardName;
|
|
984
|
+
var preview = document.createElement('span');
|
|
985
|
+
preview.className = 'myclaw-training-card__history-preview';
|
|
986
|
+
preview.textContent = record.problem || '未填写问题';
|
|
987
|
+
item.appendChild(name);
|
|
988
|
+
item.appendChild(preview);
|
|
989
|
+
|
|
990
|
+
item.addEventListener('click', function () {
|
|
991
|
+
problemInput.value = record.problem || '';
|
|
992
|
+
goalInput.value = record.goal || '';
|
|
993
|
+
planInput.value = record.plan || '';
|
|
994
|
+
acceptanceInput.value = record.acceptance || '';
|
|
995
|
+
editingRecordId = record.recordId || '';
|
|
996
|
+
status.className = 'myclaw-training-card__status';
|
|
997
|
+
status.textContent = record.acceptance
|
|
998
|
+
? '正在编辑' + cardName + ',再次提交会更新原卡片。'
|
|
999
|
+
: '正在编辑' + cardName + ',请补充验收后更新。';
|
|
1000
|
+
renderHistory();
|
|
1001
|
+
updateCardButtonState();
|
|
1002
|
+
problemInput.focus();
|
|
1003
|
+
});
|
|
1004
|
+
historyList.appendChild(item);
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
|
|
874
1008
|
aiBtn.addEventListener('click', function () {
|
|
875
1009
|
var values = readValues();
|
|
876
|
-
if (!
|
|
1010
|
+
if (!(values.problem || values.goal || values.plan || values.acceptance)) {
|
|
1011
|
+
status.className = 'myclaw-training-card__status myclaw-training-card__status--error';
|
|
1012
|
+
status.textContent = '请至少填写一项再提交 AI。';
|
|
1013
|
+
return;
|
|
1014
|
+
}
|
|
877
1015
|
if (typeof window.myclawSendPrompt !== 'function') {
|
|
878
1016
|
status.className = 'myclaw-training-card__status myclaw-training-card__status--error';
|
|
879
1017
|
status.textContent = 'AI 提交功能还没有准备好,请刷新页面后重试。';
|
|
@@ -891,30 +1029,31 @@
|
|
|
891
1029
|
}
|
|
892
1030
|
});
|
|
893
1031
|
|
|
894
|
-
|
|
1032
|
+
cardBtn.addEventListener('click', function () {
|
|
895
1033
|
var values = readValues();
|
|
896
|
-
if (!validate(values)) return;
|
|
897
|
-
|
|
898
|
-
if (fingerprint === lastTeacherFingerprint) {
|
|
899
|
-
status.className = 'myclaw-training-card__status myclaw-training-card__status--success';
|
|
900
|
-
status.textContent = '这份内容已经提交老师。';
|
|
901
|
-
return;
|
|
902
|
-
}
|
|
903
|
-
teacherBtn.disabled = true;
|
|
1034
|
+
if (!validate(values, true)) return;
|
|
1035
|
+
cardBtn.disabled = true;
|
|
904
1036
|
try {
|
|
905
|
-
var
|
|
906
|
-
|
|
907
|
-
|
|
1037
|
+
var saved = saveTrainingRecordLocally(asset, values, editingRecordId);
|
|
1038
|
+
var cardName = '卡片' + formatTrainingCardNumber(saved.index);
|
|
1039
|
+
clearInputs();
|
|
1040
|
+
renderHistory();
|
|
908
1041
|
status.className = 'myclaw-training-card__status myclaw-training-card__status--success';
|
|
909
|
-
status.textContent = '
|
|
1042
|
+
status.textContent = cardName + (saved.isUpdate ? '已更新' : '已保存') + ',输入框已清空。';
|
|
910
1043
|
} catch (e) {
|
|
911
1044
|
console.error('[myclaw-training-card] 本地归档失败:', e);
|
|
912
1045
|
status.className = 'myclaw-training-card__status myclaw-training-card__status--error';
|
|
913
1046
|
status.textContent = '提交失败,填写内容仍然保留,请重试。';
|
|
914
1047
|
}
|
|
915
|
-
|
|
1048
|
+
updateCardButtonState();
|
|
916
1049
|
});
|
|
917
1050
|
|
|
1051
|
+
[problemInput, goalInput, planInput, acceptanceInput].forEach(function (input) {
|
|
1052
|
+
input.addEventListener('input', updateCardButtonState);
|
|
1053
|
+
});
|
|
1054
|
+
updateCardButtonState();
|
|
1055
|
+
renderHistory();
|
|
1056
|
+
|
|
918
1057
|
section._destroyVoiceInputs = function () {
|
|
919
1058
|
voiceDestroyers.forEach(function (destroy) {
|
|
920
1059
|
try { destroy(); } catch (e) {}
|
|
@@ -3325,53 +3464,74 @@
|
|
|
3325
3464
|
' to { transform: rotate(360deg); }',
|
|
3326
3465
|
'}',
|
|
3327
3466
|
'.myclaw-training-card {',
|
|
3328
|
-
' box-sizing: border-box; width: 100%; padding: 10px
|
|
3467
|
+
' box-sizing: border-box; width: 100%; padding: 5px 10px;',
|
|
3329
3468
|
' color: #e5e7eb; background: #191927; border-top: 1px solid #35354d;',
|
|
3330
3469
|
' font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;',
|
|
3331
3470
|
'}',
|
|
3332
|
-
'
|
|
3333
|
-
'
|
|
3334
|
-
'
|
|
3471
|
+
'.myclaw-artifacts-work-section {',
|
|
3472
|
+
' box-sizing: border-box; min-height: 0; flex: 1 1 0;',
|
|
3473
|
+
' display: flex; flex-direction: column; overflow: hidden;',
|
|
3474
|
+
'}',
|
|
3475
|
+
'.myclaw-artifacts-work-section > #myclaw-artifacts-content { min-height: 0; }',
|
|
3476
|
+
'#myclaw-artifacts-panel > .myclaw-training-card {',
|
|
3477
|
+
' min-height: 0; flex: 1 1 0; overflow: hidden;',
|
|
3335
3478
|
'}',
|
|
3336
|
-
'.myclaw-training-card__heading h2 { margin: 0; font-size: 15px; line-height: 1.2; color: #f4f4f5; }',
|
|
3337
|
-
'.myclaw-training-card__heading p { margin: 0; font-size: 11px; color: #8f90a5; }',
|
|
3338
|
-
'.myclaw-training-card__step { display: none; }',
|
|
3339
3479
|
'.myclaw-training-card__fields {',
|
|
3340
|
-
' display: grid; grid-template-columns: 1fr; gap:
|
|
3480
|
+
' display: grid; grid-template-columns: 1fr; gap: 7px;',
|
|
3341
3481
|
'}',
|
|
3342
3482
|
'.myclaw-training-card__field {',
|
|
3343
|
-
' min-width: 0; display:
|
|
3344
|
-
'
|
|
3483
|
+
' min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: 3px;',
|
|
3484
|
+
'}',
|
|
3485
|
+
'.myclaw-training-card__field-header {',
|
|
3486
|
+
' min-width: 0; display: flex; align-items: center; justify-content: flex-start; gap: 6px;',
|
|
3487
|
+
'}',
|
|
3488
|
+
'.myclaw-training-card__field-title {',
|
|
3489
|
+
' min-width: 0; font-size: 12px; line-height: 1.3; font-weight: 700; color: #d8d8e5;',
|
|
3490
|
+
' white-space: nowrap;',
|
|
3491
|
+
'}',
|
|
3492
|
+
'.myclaw-training-card__hints { display: flex; align-items: center; gap: 3px; flex: 0 0 auto; }',
|
|
3493
|
+
'.myclaw-training-card__hint {',
|
|
3494
|
+
' padding: 0 5px; border: 1px solid #67558f; border-radius: 999px;',
|
|
3495
|
+
' color: #e9ddff; background: rgba(124, 58, 237, 0.22); font-size: 10px; font-weight: 650;',
|
|
3496
|
+
' line-height: 1.35; white-space: nowrap;',
|
|
3497
|
+
'}',
|
|
3498
|
+
'.myclaw-training-card__acceptance {',
|
|
3499
|
+
' margin-top: 4px; padding-top: 4px; border-top: 1px solid #323247;',
|
|
3345
3500
|
'}',
|
|
3346
|
-
'.myclaw-training-card__field-title { font-size: 12px; font-weight: 700; color: #c9c9d7; }',
|
|
3347
|
-
'.myclaw-training-card__field-prompt { display: none; }',
|
|
3348
3501
|
'.myclaw-training-card__input-wrap {',
|
|
3349
|
-
' min-width: 0; display: flex; align-items: center; gap: 6px;',
|
|
3502
|
+
' min-width: 0; width: 100%; display: flex; align-items: center; gap: 6px;',
|
|
3350
3503
|
'}',
|
|
3351
3504
|
'.myclaw-training-card__field textarea {',
|
|
3352
|
-
' box-sizing: border-box; flex: 1; min-width: 0; width: auto; height:
|
|
3353
|
-
' resize:
|
|
3505
|
+
' box-sizing: border-box; flex: 1; min-width: 0; width: auto; height: 32px; min-height: 32px; max-height: 32px;',
|
|
3506
|
+
' resize: none; padding: 3px 7px; border: 1px solid #3d3d55; border-radius: 6px;',
|
|
3354
3507
|
' outline: none; color: #f4f4f5; background: #232334;',
|
|
3355
|
-
'
|
|
3508
|
+
' overflow-y: auto; scrollbar-width: none;',
|
|
3509
|
+
' font: 13px/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;',
|
|
3356
3510
|
'}',
|
|
3357
|
-
'.myclaw-training-card__field textarea
|
|
3511
|
+
'.myclaw-training-card__field textarea::-webkit-scrollbar { display: none; }',
|
|
3358
3512
|
'.myclaw-training-card__field textarea:focus { border-color: #8b5cf6; background: #27273a; }',
|
|
3359
3513
|
'.myclaw-training-card__mic {',
|
|
3360
|
-
' width:
|
|
3514
|
+
' width: 28px; height: 28px; flex: 0 0 28px; padding: 0; border-radius: 50%;',
|
|
3361
3515
|
' border: 1px solid #45455f; background: #232334; color: #9a9bad; cursor: pointer;',
|
|
3362
3516
|
' display: inline-flex; align-items: center; justify-content: center; transition: all .15s ease;',
|
|
3363
3517
|
'}',
|
|
3364
3518
|
'.myclaw-training-card__mic:hover { color: #ddd6fe; border-color: #7c3aed; background: #292940; }',
|
|
3365
3519
|
'.myclaw-training-card__mic:disabled { cursor: not-allowed; opacity: .4; }',
|
|
3366
3520
|
'.myclaw-training-card__footer {',
|
|
3367
|
-
' margin:
|
|
3521
|
+
' margin: 4px 0 0; display: flex; flex-direction: column; gap: 2px;',
|
|
3522
|
+
'}',
|
|
3523
|
+
'.myclaw-training-card__meta-row { min-width: 0; display: flex; align-items: center; gap: 6px; }',
|
|
3524
|
+
'.myclaw-training-card__status {',
|
|
3525
|
+
' min-width: 0; max-width: 44%; overflow: hidden; color: #9ca3af; font-size: 10px;',
|
|
3526
|
+
' white-space: nowrap; text-overflow: ellipsis; flex: 0 1 auto;',
|
|
3368
3527
|
'}',
|
|
3369
|
-
'.myclaw-training-card__status {
|
|
3528
|
+
'.myclaw-training-card__status:empty { display: none; }',
|
|
3370
3529
|
'.myclaw-training-card__status--success { color: #6ee7b7; }',
|
|
3371
3530
|
'.myclaw-training-card__status--error { color: #fca5a5; }',
|
|
3372
3531
|
'.myclaw-training-card__actions { display: flex; gap: 8px; width: 100%; }',
|
|
3532
|
+
'.myclaw-training-card__card-actions { margin-top: 4px; }',
|
|
3373
3533
|
'.myclaw-training-card__button {',
|
|
3374
|
-
' flex: 1; min-width: 0; padding:
|
|
3534
|
+
' flex: 1; min-width: 0; padding: 6px 9px; border: 0; border-radius: 6px; cursor: pointer;',
|
|
3375
3535
|
' color: #fff; font-size: 12px; font-weight: 700;',
|
|
3376
3536
|
' transition: transform .15s ease, opacity .15s ease, filter .15s ease;',
|
|
3377
3537
|
'}',
|
|
@@ -3379,6 +3539,28 @@
|
|
|
3379
3539
|
'.myclaw-training-card__button:disabled { cursor: wait; opacity: .55; transform: none; }',
|
|
3380
3540
|
'.myclaw-training-card__button--ai { background: #7c3aed; }',
|
|
3381
3541
|
'.myclaw-training-card__button--teacher { background: #2563eb; }',
|
|
3542
|
+
'.myclaw-training-card__history {',
|
|
3543
|
+
' min-width: 0; margin-top: 4px; padding-top: 4px; border-top: 1px solid #323247;',
|
|
3544
|
+
'}',
|
|
3545
|
+
'.myclaw-training-card__history[hidden] { display: none; }',
|
|
3546
|
+
'.myclaw-training-card__history-list {',
|
|
3547
|
+
' min-width: 0; max-height: 48px; display: flex; flex-flow: row wrap; align-content: flex-start;',
|
|
3548
|
+
' gap: 4px; overflow-x: hidden; overflow-y: auto;',
|
|
3549
|
+
' scrollbar-width: thin; scrollbar-color: #4b4b65 transparent;',
|
|
3550
|
+
'}',
|
|
3551
|
+
'.myclaw-training-card__history-item {',
|
|
3552
|
+
' box-sizing: border-box; min-width: 78px; max-width: 155px; flex: 0 0 auto;',
|
|
3553
|
+
' display: flex; align-items: center; gap: 6px;',
|
|
3554
|
+
' padding: 3px 7px; border: 1px solid #3a3a51; border-radius: 6px;',
|
|
3555
|
+
' color: #d4d4df; background: #222232; cursor: pointer; text-align: left;',
|
|
3556
|
+
'}',
|
|
3557
|
+
'.myclaw-training-card__history-item:hover { border-color: #625f88; background: #29293b; }',
|
|
3558
|
+
'.myclaw-training-card__history-item--active { border-color: #8b5cf6; background: #30284a; }',
|
|
3559
|
+
'.myclaw-training-card__history-name { color: #c4b5fd; font-size: 11px; font-weight: 700; }',
|
|
3560
|
+
'.myclaw-training-card__history-preview {',
|
|
3561
|
+
' min-width: 0; flex: 1; overflow: hidden; color: #9293a7; font-size: 10px;',
|
|
3562
|
+
' white-space: nowrap; text-overflow: ellipsis;',
|
|
3563
|
+
'}',
|
|
3382
3564
|
].join('\n');
|
|
3383
3565
|
document.head.appendChild(style);
|
|
3384
3566
|
}
|