@pippit-dev/cli 0.0.28 → 1.0.0
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/checksums.txt +6 -6
- package/cmd/short_drama/short_drama.go +2 -2
- package/cmd/update/update.go +0 -2
- package/cmd/update/update_test.go +0 -8
- package/internal/common/client.go +0 -2
- package/internal/{short_drama → common}/get_thread.go +3 -4
- package/package.json +1 -1
- package/scripts/telemetry.js +0 -2
package/checksums.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
91020e43a8e12d7e491b43200a4c1df4dd88a41683e5fe531b3fe038f6573e1a pippit-tool-cli-1.0.0-darwin-amd64.tar.gz
|
|
2
|
+
a0eea79da53e4f6877aa27c731503c7434d5cb72ab0aa62cd602ac5da0e779f0 pippit-tool-cli-1.0.0-darwin-arm64.tar.gz
|
|
3
|
+
babc1965565d1f2a458990b7bfa8f4b6b93c27ce74afc85d0099e82a14a332e0 pippit-tool-cli-1.0.0-linux-amd64.tar.gz
|
|
4
|
+
0c202f681c1c85c1b4ddd0e5980eb6ef35fa36bc3d6bd4bc840406e5c2661fa8 pippit-tool-cli-1.0.0-linux-arm64.tar.gz
|
|
5
|
+
3d6dae6812bd6fc95a2b6e54b8ef8bc24630d20cfc37417f3f84e787d81de11f pippit-tool-cli-1.0.0-windows-amd64.zip
|
|
6
|
+
1efdeaacda1dc09008ff0ed0582740ba989fdb766c26edec1ee667202bd565e0 pippit-tool-cli-1.0.0-windows-arm64.zip
|
|
@@ -143,7 +143,7 @@ func newShortDramaDownloadResultCommand(stdout, stderr io.Writer, runner *common
|
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
func newShortDramaGetThreadCommand(stdout, stderr io.Writer, runner *common.Runner) *cobra.Command {
|
|
146
|
-
var opts
|
|
146
|
+
var opts common.GetThreadOptions
|
|
147
147
|
|
|
148
148
|
cmd := &cobra.Command{
|
|
149
149
|
Use: "+get-thread",
|
|
@@ -161,7 +161,7 @@ func newShortDramaGetThreadCommand(stdout, stderr io.Writer, runner *common.Runn
|
|
|
161
161
|
}
|
|
162
162
|
opts.RunID = strings.TrimSpace(opts.RunID)
|
|
163
163
|
|
|
164
|
-
result, err :=
|
|
164
|
+
result, err := common.GetThread(cmd.Context(), &opts, runner)
|
|
165
165
|
if err != nil {
|
|
166
166
|
return err
|
|
167
167
|
}
|
package/cmd/update/update.go
CHANGED
|
@@ -180,8 +180,6 @@ func reportSkillTelemetry(payload telemetryPayload) error {
|
|
|
180
180
|
}
|
|
181
181
|
req.Header.Set("Content-Type", "application/json")
|
|
182
182
|
req.Header.Set("Authorization", telemetryAuthHeader)
|
|
183
|
-
req.Header.Set("x-use-ppe", "1")
|
|
184
|
-
req.Header.Set("x-tt-env", "ppe_harness_novel_v2")
|
|
185
183
|
|
|
186
184
|
resp, err := telemetryHTTPClient.Do(req)
|
|
187
185
|
if err != nil {
|
|
@@ -77,14 +77,12 @@ func TestCleanupLegacyGlobalSkills(t *testing.T) {
|
|
|
77
77
|
|
|
78
78
|
func TestReportSkillTelemetry(t *testing.T) {
|
|
79
79
|
var gotAuth string
|
|
80
|
-
var gotHeaders http.Header
|
|
81
80
|
var gotPayload telemetryPayload
|
|
82
81
|
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
83
82
|
if r.URL.Path != telemetryPath {
|
|
84
83
|
t.Fatalf("path = %q, want %q", r.URL.Path, telemetryPath)
|
|
85
84
|
}
|
|
86
85
|
gotAuth = r.Header.Get("Authorization")
|
|
87
|
-
gotHeaders = r.Header.Clone()
|
|
88
86
|
if err := json.NewDecoder(r.Body).Decode(&gotPayload); err != nil {
|
|
89
87
|
t.Fatalf("decode request body: %v", err)
|
|
90
88
|
}
|
|
@@ -107,12 +105,6 @@ func TestReportSkillTelemetry(t *testing.T) {
|
|
|
107
105
|
if gotAuth != telemetryAuthHeader {
|
|
108
106
|
t.Fatalf("Authorization = %q, want %q", gotAuth, telemetryAuthHeader)
|
|
109
107
|
}
|
|
110
|
-
if got := gotHeaders.Get("x-use-ppe"); got != "1" {
|
|
111
|
-
t.Fatalf("x-use-ppe = %q, want 1", got)
|
|
112
|
-
}
|
|
113
|
-
if got := gotHeaders.Get("x-tt-env"); got != "ppe_harness_novel_v2" {
|
|
114
|
-
t.Fatalf("x-tt-env = %q, want ppe_harness_novel_v2", got)
|
|
115
|
-
}
|
|
116
108
|
if gotPayload.Event != "update" || gotPayload.SkillName != "xyq-skill" || gotPayload.Source != "cli_update" {
|
|
117
109
|
t.Fatalf("payload = %#v", gotPayload)
|
|
118
110
|
}
|
|
@@ -202,8 +202,6 @@ func (c *httpClient) injectHeaders(req *http.Request) {
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
req.Header.Set("User-Agent", "Pippit-CLI/1.0")
|
|
205
|
-
req.Header.Set("x-use-ppe", "1")
|
|
206
|
-
req.Header.Set("x-tt-env", "ppe_harness_novel_v2")
|
|
207
205
|
}
|
|
208
206
|
|
|
209
207
|
func (c *httpClient) do(req *http.Request, out any) error {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
package
|
|
1
|
+
package common
|
|
2
2
|
|
|
3
3
|
import (
|
|
4
4
|
"context"
|
|
5
5
|
"fmt"
|
|
6
6
|
|
|
7
|
-
"github.com/Pippit-dev/pippit-cli/internal/common"
|
|
8
7
|
"github.com/Pippit-dev/pippit-cli/internal/config"
|
|
9
8
|
)
|
|
10
9
|
|
|
@@ -29,7 +28,7 @@ type getThreadResponse struct {
|
|
|
29
28
|
} `json:"data"`
|
|
30
29
|
}
|
|
31
30
|
|
|
32
|
-
func GetThread(ctx context.Context, opts *GetThreadOptions, runner *
|
|
31
|
+
func GetThread(ctx context.Context, opts *GetThreadOptions, runner *Runner) (*GetThreadResult, error) {
|
|
33
32
|
if runner == nil || runner.Client == nil {
|
|
34
33
|
return nil, fmt.Errorf("get_thread runner client is required")
|
|
35
34
|
}
|
|
@@ -61,7 +60,7 @@ func GetThread(ctx context.Context, opts *GetThreadOptions, runner *common.Runne
|
|
|
61
60
|
}, nil
|
|
62
61
|
}
|
|
63
62
|
|
|
64
|
-
func getThreadPath(runner *
|
|
63
|
+
func getThreadPath(runner *Runner) string {
|
|
65
64
|
if runner != nil && runner.Config != nil && runner.Config.Paths != nil && runner.Config.Paths.GetThread != "" {
|
|
66
65
|
return runner.Config.Paths.GetThread
|
|
67
66
|
}
|
package/package.json
CHANGED
package/scripts/telemetry.js
CHANGED