@xdfnet/ispeak 1.6.13 → 1.6.15

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.
@@ -21,7 +21,6 @@ typedef struct {
21
21
  pthread_cond_t cond;
22
22
  int pending;
23
23
  int closing;
24
- int started;
25
24
  } AVNativePlayer;
26
25
 
27
26
  static char *av_make_error(const char *prefix, NSError *error) {
@@ -91,7 +90,6 @@ static int av_player_create(double sampleRate, unsigned int channels, AVNativePl
91
90
  }
92
91
 
93
92
  [player->node play];
94
- player->started = 1;
95
93
  *out = player;
96
94
  return 0;
97
95
  }
@@ -111,7 +111,7 @@ function collectText(content) {
111
111
  }
112
112
 
113
113
  function lastClaudeTranscript(file, payload) {
114
- const deadline = Date.now() + 1200;
114
+ const deadline = Date.now() + 5000;
115
115
  let result = { text: "", turnId: extractTurnId(payload) };
116
116
 
117
117
  while (Date.now() <= deadline) {
@@ -164,13 +164,7 @@ function extractTurnId(payload) {
164
164
  return firstString(
165
165
  payload.turn_id,
166
166
  payload.turnId,
167
- payload["turn-id"],
168
- payload.session_id,
169
- payload.sessionId,
170
- payload["session-id"],
171
- payload.thread_id,
172
- payload.threadId,
173
- payload["thread-id"]
167
+ payload["turn-id"]
174
168
  );
175
169
  }
176
170
 
package/main.go CHANGED
@@ -15,7 +15,6 @@ import (
15
15
  "net/http"
16
16
  "os"
17
17
  "os/signal"
18
- "path/filepath"
19
18
  "strings"
20
19
  "sync"
21
20
  "syscall"
@@ -36,9 +35,6 @@ var (
36
35
 
37
36
  var ttsHTTPClient = &http.Client{Timeout: 30 * time.Second}
38
37
 
39
- // 进程级 temp 目录(进程退出时清理)
40
- var tempDir string
41
-
42
38
  var errAlreadyRunning = errors.New("iSpeak already running")
43
39
 
44
40
  type StreamPlayer interface {
@@ -422,15 +418,6 @@ func main() {
422
418
  Compress: true,
423
419
  })
424
420
 
425
- // 创建进程级 temp 目录
426
- cleanupOldTempDirs()
427
- var err error
428
- tempDir, err = os.MkdirTemp("", "ttsd-*")
429
- if err != nil {
430
- log.Fatalf("创建 temp 目录失败: %v", err)
431
- }
432
- defer os.RemoveAll(tempDir)
433
-
434
421
  cfg := loadConfig()
435
422
  if err := validateConfig(cfg); err != nil {
436
423
  log.Fatalf("配置错误: %v", err)
@@ -500,19 +487,6 @@ func listenUnixSocket(socketPath string) (net.Listener, error) {
500
487
  return listener, nil
501
488
  }
502
489
 
503
- // 清理历史遗留的 temp 目录(进程崩溃时留下)
504
- func cleanupOldTempDirs() {
505
- entries, err := os.ReadDir(os.TempDir())
506
- if err != nil {
507
- return
508
- }
509
- for _, e := range entries {
510
- if strings.HasPrefix(e.Name(), "ttsd-") {
511
- os.RemoveAll(filepath.Join(os.TempDir(), e.Name()))
512
- }
513
- }
514
- }
515
-
516
490
  // 校验配置必填项
517
491
  func validateConfig(cfg Config) error {
518
492
  if cfg.APIKey == "" {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xdfnet/ispeak",
3
- "version": "1.6.13",
3
+ "version": "1.6.15",
4
4
  "description": "Local macOS TTS daemon for AI coding assistants, powered by Volcengine streaming TTS.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/xdfnet/iSpeak#readme",