그동안 쌓여 있던 미커밋 파일들을 정리. 소스·자산만 올리고, 개인 데이터와 런타임 상태는 gitignore로 차단. 추가된 자산: - web-ui/audiomass, web-ui/wavacity — 자체 호스팅 오디오 에디터 - web-ui/drums — 드럼 샘플 - wol-gate — WOL 프록시 컨테이너(Dockerfile + server.js) - glm-1m-fix — GLM 1M 컨텍스트 설치 스크립트(linux/windows) - RENODE_FIXES_SUMMARY*.md, CCTV정보_서울특별시.csv, .claude/plans 수정: - edge_tts_synth.py: rate 인자 추가(말하기 속도 조절) - .smallclaw/config.json: google(gemini) provider 등록 — 키는 vault 참조 - assets/SmallClaw*.png 삭제분 반영 gitignore (중요): - .smallclaw/users/*/workspace/ 전체 차단. 기존 패턴이 memory/uploads와 일부 확장자만 막아서 detective/(고소장·통화녹취·의사소견서·가족관계증명서), generated-media/, music/, pptx/ 등 앱 생성 개인 데이터 403MB가 노출돼 있었음 - .smallclaw/active-sessions.json 차단 — 살아있는 bearer 토큰과 admin 역할이 평문으로 들어있어 커밋 시 게이트웨이 관리자 자격증명이 그대로 공개됨 - google-usage.json, config.json.bak-*, workspace/memory·weather-maps· task_result_*, voice/ 등 런타임 상태도 함께 차단 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
137 lines
3.3 KiB
JavaScript
Executable File
137 lines
3.3 KiB
JavaScript
Executable File
(function ( PKAE ) {
|
|
'use strict';
|
|
|
|
function PKState ( _depth, app ) {
|
|
if (!_depth) _depth = 1;
|
|
|
|
var q = this;
|
|
|
|
var _id = 1;
|
|
var _fireEvent = app.fireEvent;
|
|
var _listenFor = app.listenFor;
|
|
|
|
var undo_state_list = [];
|
|
var redo_state_list = [];
|
|
|
|
function currentStateFor ( state ) {
|
|
var current = {
|
|
data: app.engine.wavesurfer.backend.buffer
|
|
};
|
|
if (state.type === 'mult' && app.multitrack)
|
|
current.mt = app.multitrack.getState ();
|
|
if (state.type === 'mrk' && app.mrk)
|
|
current.markers = app.mrk.ser (state.ctx);
|
|
return current;
|
|
}
|
|
|
|
function updateStateData ( state, current ) {
|
|
state.data = current.data;
|
|
if (current.mt) state.mt = current.mt;
|
|
if (current.markers) state.markers = current.markers;
|
|
}
|
|
|
|
q.getLastUndoState = function () {
|
|
return (undo_state_list [ undo_state_list.length - 1]);
|
|
};
|
|
|
|
q.pushUndoState = function ( state ) {
|
|
if (!state) return (false);
|
|
|
|
if (!state.id) state.id = ++_id;
|
|
if (undo_state_list.length >= _depth) undo_state_list.shift ();
|
|
|
|
if (undo_state_list.length > 0)
|
|
{
|
|
if (undo_state_list[undo_state_list.length - 1].id !== state.id - 1)
|
|
undo_state_list = [];
|
|
}
|
|
if (redo_state_list.length > 0)
|
|
{
|
|
if (redo_state_list[0].id !== state.id + 1)
|
|
redo_state_list = [];
|
|
}
|
|
|
|
undo_state_list.push ( state );
|
|
|
|
_fireEvent ( 'StatePush', undo_state_list.length );
|
|
_fireEvent ( 'DidStateChange', undo_state_list, redo_state_list);
|
|
|
|
return (true);
|
|
};
|
|
|
|
q.popUndoState = function () {
|
|
var last_state =undo_state_list.pop ();
|
|
|
|
if (last_state) {
|
|
if (redo_state_list.length > 0)
|
|
{
|
|
if (redo_state_list[0].id !== last_state.id + 1)
|
|
redo_state_list = [];
|
|
}
|
|
|
|
var current = currentStateFor ( last_state );
|
|
|
|
_fireEvent ( 'StateDidPop', last_state, 1 );
|
|
|
|
updateStateData ( last_state, current );
|
|
redo_state_list.unshift (last_state);
|
|
|
|
_fireEvent ( 'DidStateChange', undo_state_list, redo_state_list);
|
|
}
|
|
|
|
return (last_state);
|
|
};
|
|
|
|
q.shiftRedoState = function () {
|
|
var last_state = redo_state_list.shift ();
|
|
|
|
if (last_state) {
|
|
if (undo_state_list.length > 0)
|
|
{
|
|
if (undo_state_list[undo_state_list.length - 1].id !== last_state.id - 1)
|
|
undo_state_list = [];
|
|
}
|
|
|
|
var current = currentStateFor ( last_state );
|
|
|
|
_fireEvent ( 'StateDidPop', last_state, 0 );
|
|
|
|
updateStateData ( last_state, current );
|
|
undo_state_list.push (last_state);
|
|
|
|
_fireEvent ( 'DidStateChange', undo_state_list, redo_state_list);
|
|
}
|
|
|
|
return (last_state);
|
|
};
|
|
|
|
q.clearAllState = function () {
|
|
undo_state_list = [];
|
|
redo_state_list = [];
|
|
|
|
_fireEvent ( 'StateClearAll' );
|
|
_fireEvent ( 'DidStateChange', [], []);
|
|
};
|
|
|
|
_listenFor ('StateRequestPush', function ( _state ) {
|
|
q.pushUndoState ( _state );
|
|
});
|
|
_listenFor ('StateRequestUndo', function () {
|
|
q.popUndoState ();
|
|
});
|
|
_listenFor ('StateRequestRedo', function () {
|
|
q.shiftRedoState ();
|
|
});
|
|
_listenFor ('StateRequestClearAll', function () {
|
|
q.clearAllState ();
|
|
});
|
|
_listenFor ('StateRequestLastState', function () {
|
|
_fireEvent ('StateDidLastState', q.getLastUndoState ());
|
|
});
|
|
// -
|
|
};
|
|
|
|
PKAE._deps.state = PKState;
|
|
|
|
})( PKAudioEditor );
|