@open-dy/interest-card-cli 0.1.0-beta.30 → 0.1.0-beta.32
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/browser-runtime/scripts/capture-feed-card.sh +23 -18
- package/browser-runtime/scripts/cli.mjs +10 -3
- package/browser-runtime/scripts/inspect-preview-state.mjs +6 -4
- package/browser-runtime/scripts/preview-session.mjs +9 -0
- package/card-skills/douyin-interest-card-browser/references/commands.md +1 -1
- package/card-skills/douyin-interest-card-capability/SKILL.md +12 -4
- package/card-skills/douyin-interest-card-capability/references/common/openapi/external/guide.md +5 -5
- package/card-skills/douyin-interest-card-capability/references/microapp/api/capability-index.json +27 -27
- package/card-skills/douyin-interest-card-capability/references/microapp/api/connect-socket.md +24 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/api/create-bytenn-engine-context.md +11 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/api/create-camera-context.md +12 -0
- package/card-skills/douyin-interest-card-capability/references/microapp/api/create-canvas-context.md +45 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/api/create-effect-camera-stream.md +21 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/api/create-inner-audio-context.md +80 -3
- package/card-skills/douyin-interest-card-capability/references/microapp/api/create-intersection-observer.md +12 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/api/create-interstitial-ad.md +12 -0
- package/card-skills/douyin-interest-card-capability/references/microapp/api/create-live-player-context.md +16 -0
- package/card-skills/douyin-interest-card-capability/references/microapp/api/create-map-context.md +24 -0
- package/card-skills/douyin-interest-card-capability/references/microapp/api/create-media-recorder.md +17 -0
- package/card-skills/douyin-interest-card-capability/references/microapp/api/create-offscreen-canvas.md +9 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/api/create-rewarded-video-ad.md +16 -0
- package/card-skills/douyin-interest-card-capability/references/microapp/api/create-rtc-room-context.md +33 -0
- package/card-skills/douyin-interest-card-capability/references/microapp/api/create-scene-activity-context.md +13 -0
- package/card-skills/douyin-interest-card-capability/references/microapp/api/create-selector-query.md +13 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/api/create-sticker-manager.md +11 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/api/create-video-context.md +17 -0
- package/card-skills/douyin-interest-card-capability/references/microapp/api/download-file.md +10 -0
- package/card-skills/douyin-interest-card-capability/references/microapp/api/get-algorithm-manager.md +9 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/api/get-background-audio-manager.md +60 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/api/get-file-system-manager.md +37 -0
- package/card-skills/douyin-interest-card-capability/references/microapp/api/get-recorder-manager.md +23 -0
- package/card-skills/douyin-interest-card-capability/references/microapp/api/get-update-manager.md +11 -0
- package/card-skills/douyin-interest-card-capability/references/microapp/api/preload-video.md +8 -0
- package/card-skills/douyin-interest-card-capability/references/microapp/api/request.md +8 -0
- package/card-skills/douyin-interest-card-capability/references/microapp/api/upload-file.md +10 -0
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/capability-index.json +9 -4
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/censor-image.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/censor-text.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/check-fans.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/create-activity.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-affiliate-id.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-aiuser-data-info.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-aiuser-item-list.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-aiuser-profile.md +7 -5
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-fans-favourite.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-fans-profile.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-fans-source.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-feed.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-follow-feed.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-follow-hot-word.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-friend-list.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-hot-list.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-music-collection-list.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-recommend.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-related-id.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-room-real-time-data.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-user-basic-data.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-user-cert-labels-info.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-user-comment-data.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-user-constellation.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-user-fans-data.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-user-fans-profile.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-user-following.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-user-hash-mobile.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-user-interest.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-user-item-data.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-user-like-data.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-user-profile-data.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-user-share-data.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/get-video-pack.md +48 -3
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/modify-activity.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/query-activity-info.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/query-activity-user-completion-status.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/query-room-data.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/search-experience.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/search-general.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/search-live.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/search-music.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/search-user.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/search-video.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/microapp/openapi/external/search-vision.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/api/call-container.md +1 -0
- package/card-skills/douyin-interest-card-capability/references/opencard/api/capability-index.json +6 -6
- package/card-skills/douyin-interest-card-capability/references/opencard/api/create-inner-audio-context.md +60 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/api/create-map-context.md +24 -0
- package/card-skills/douyin-interest-card-capability/references/opencard/api/create-selector-query.md +13 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/api/create-video-context.md +17 -0
- package/card-skills/douyin-interest-card-capability/references/opencard/api/download-file.md +1 -3
- package/card-skills/douyin-interest-card-capability/references/opencard/api/get-background-audio-manager.md +60 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/api/request.md +1 -3
- package/card-skills/douyin-interest-card-capability/references/opencard/api/upload-file.md +1 -3
- package/card-skills/douyin-interest-card-capability/references/opencard/closed-domain-openapi.md +2 -2
- package/card-skills/douyin-interest-card-capability/references/opencard/component/button.md +4 -2
- package/card-skills/douyin-interest-card-capability/references/opencard/component/canvas.md +4 -3
- package/card-skills/douyin-interest-card-capability/references/opencard/component/capability-index.json +8 -9
- package/card-skills/douyin-interest-card-capability/references/opencard/component/checkbox-group.md +2 -0
- package/card-skills/douyin-interest-card-capability/references/opencard/component/image.md +3 -2
- package/card-skills/douyin-interest-card-capability/references/opencard/component/input.md +3 -2
- package/card-skills/douyin-interest-card-capability/references/opencard/component/text.md +3 -3
- package/card-skills/douyin-interest-card-capability/references/opencard/component/textarea.md +5 -5
- package/card-skills/douyin-interest-card-capability/references/opencard/component/video.md +10 -2
- package/card-skills/douyin-interest-card-capability/references/opencard/component-guide.md +5 -3
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/capability-index.json +16 -11
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/censor-image.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/censor-text.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/check-fans.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/create-activity.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-affiliate-id.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-aiuser-data-info.md +10 -9
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-aiuser-item-list.md +10 -9
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-aiuser-profile.md +16 -13
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-fans-favourite.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-fans-profile.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-fans-source.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-feed.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-follow-feed.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-follow-hot-word.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-friend-list.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-hot-list.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-music-collection-list.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-recommend.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-related-id.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-room-real-time-data.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-user-basic-data.md +10 -9
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-user-cert-labels-info.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-user-comment-data.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-user-constellation.md +10 -9
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-user-fans-data.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-user-fans-profile.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-user-following.md +10 -9
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-user-hash-mobile.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-user-interest.md +10 -9
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-user-item-data.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-user-like-data.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-user-profile-data.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-user-share-data.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/get-video-pack.md +48 -3
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/modify-activity.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/query-activity-info.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/query-activity-user-completion-status.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/query-room-data.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/search-experience.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/search-general.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/search-live.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/search-music.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/search-user.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/search-video.md +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/openapi/search-vision.md +1 -1
- package/card-skills/douyin-interest-card-capability/scripts/search-capabilities.mjs +7 -4
- package/card-skills/douyin-interest-card-cli/SKILL.md +11 -5
- package/card-skills/douyin-interest-card-generate/SKILL.md +5 -3
- package/card-skills/douyin-interest-card-generate/init.sh +13 -23
- package/card-skills/douyin-interest-card-generate/references/common/fullstack.md +6 -10
- package/card-skills/douyin-interest-card-generate/references/common/post-card-differences.md +29 -3
- package/card-skills/douyin-interest-card-generate/references/common/private-data-intent-routing.md +1 -1
- package/card-skills/douyin-interest-card-generate/references/common/upgrade-to-post.md +29 -6
- package/card-skills/douyin-interest-card-generate/references/microapp/microapp.md +1 -1
- package/card-skills/douyin-interest-card-generate/references/opencard/api.md +8 -0
- package/card-skills/douyin-interest-card-generate/references/opencard/closed-domain-card.md +1 -1
- package/card-skills/douyin-interest-card-generate/references/opencard/components.md +11 -28
- package/card-skills/douyin-interest-card-generate/references/opencard/opencard.md +9 -7
- package/card-skills/douyin-interest-card-generate/references/opencard/rendering.md +5 -5
- package/card-skills/douyin-interest-card-generate/references/opencard/taro-dsl.md +6 -6
- package/card-skills/douyin-interest-card-generate/scripts/inspect-post-upgrade.mjs +630 -0
- package/card-skills/douyin-interest-card-generate/templates/fragments/opencard/package.json +2 -2
- package/card-skills/douyin-interest-card-generate/templates/fragments/opencard/pnpm-lock.yaml +17 -17
- package/card-skills/douyin-interest-card-generate/templates/taro/closed-domain-server/package.json +1 -1
- package/card-skills/douyin-interest-card-generate/templates/taro/package.json +5 -4
- package/card-skills/douyin-interest-card-generate/templates/taro/pnpm-lock.yaml +27 -26
- package/card-skills/douyin-interest-card-generate/templates/taro/server/package.json +1 -1
- package/dist/src/args.js +23 -8
- package/dist/src/browser.js +3 -1
- package/dist/src/card/agent-chat.js +4 -0
- package/dist/src/card/binding.js +2 -1
- package/dist/src/card/candidate.js +90 -0
- package/dist/src/card/card-api.js +2 -2
- package/dist/src/card/card-token.js +25 -2
- package/dist/src/card/chat-commands.js +26 -11
- package/dist/src/card/constants.js +5 -0
- package/dist/src/card/create-project-client.js +2 -2
- package/dist/src/card/create.js +29 -3
- package/dist/src/card/editor-client.js +41 -6
- package/dist/src/card/editor-fs.js +4 -4
- package/dist/src/card/global-skills.js +6 -1
- package/dist/src/card/handlers-misc.js +3 -6
- package/dist/src/card/handlers.js +32 -24
- package/dist/src/card/help.js +6 -4
- package/dist/src/card/ignore.js +22 -0
- package/dist/src/card/project.js +13 -4
- package/dist/src/card-install.js +8 -9
- package/dist/src/cli.js +5 -2
- package/dist/src/config.js +26 -3
- package/dist/src/creator-device-login.js +2 -1
- package/dist/src/creator-login-session.js +6 -6
- package/dist/src/creator-passport-login.js +8 -2
- package/dist/src/creator-session.js +30 -7
- package/dist/src/current-user.js +29 -0
- package/dist/src/help-access.js +22 -0
- package/dist/src/help.js +6 -2
- package/dist/src/http.js +4 -4
- package/dist/src/login-handlers.js +2 -1
- package/dist/src/platform-process.js +98 -0
- package/dist/src/platform.js +1 -1
- package/dist/src/request-source.js +4 -0
- package/dist/src/telemetry-session.js +17 -0
- package/dist/src/telemetry.js +7 -2
- package/dist/src/update-check.js +5 -3
- package/dist/src/upgrade.js +56 -12
- package/package.json +1 -1
- package/card-skills/douyin-interest-card-capability/references/opencard/component/svg.md +0 -58
package/card-skills/douyin-interest-card-generate/templates/fragments/opencard/pnpm-lock.yaml
CHANGED
|
@@ -9,8 +9,8 @@ importers:
|
|
|
9
9
|
.:
|
|
10
10
|
dependencies:
|
|
11
11
|
'@open-dy/vibecoding-sdk-opencard':
|
|
12
|
-
specifier: ^0.1.
|
|
13
|
-
version: 0.1.
|
|
12
|
+
specifier: ^0.1.24
|
|
13
|
+
version: 0.1.24(@babel/plugin-transform-typescript@7.29.7(@babel/core@7.29.7))(@types/babel__core@7.20.5)(@types/node@18.19.130)(eslint@9.39.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.101.0)(terser@5.51.2)(typescript-eslint@8.64.0(eslint@9.39.5)(typescript@5.9.3))(typescript@5.9.3)
|
|
14
14
|
'@vitejs/plugin-react':
|
|
15
15
|
specifier: ^4.3.0
|
|
16
16
|
version: 4.7.0(vite@4.5.14(@types/node@18.19.130)(sass@1.101.0)(terser@5.51.2))
|
|
@@ -43,8 +43,8 @@ importers:
|
|
|
43
43
|
specifier: ^9.18.0
|
|
44
44
|
version: 9.39.5
|
|
45
45
|
'@open-dy/vibecoding-cli':
|
|
46
|
-
specifier: ^0.1.
|
|
47
|
-
version: 0.1.
|
|
46
|
+
specifier: ^0.1.27
|
|
47
|
+
version: 0.1.27(@open-dy/vibecoding-sdk-opencard@0.1.24(@babel/plugin-transform-typescript@7.29.7(@babel/core@7.29.7))(@types/babel__core@7.20.5)(@types/node@18.19.130)(eslint@9.39.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.101.0)(terser@5.51.2)(typescript-eslint@8.64.0(eslint@9.39.5)(typescript@5.9.3))(typescript@5.9.3))
|
|
48
48
|
'@types/node':
|
|
49
49
|
specifier: ^18.15.11
|
|
50
50
|
version: 18.19.130
|
|
@@ -1119,25 +1119,25 @@ packages:
|
|
|
1119
1119
|
resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==}
|
|
1120
1120
|
engines: {node: '>= 8'}
|
|
1121
1121
|
|
|
1122
|
-
'@open-dy/opencard-taro@0.1.
|
|
1123
|
-
resolution: {integrity: sha512
|
|
1122
|
+
'@open-dy/opencard-taro@0.1.23':
|
|
1123
|
+
resolution: {integrity: sha512-/sfCPaRkMm1fVnrR9qx2m9tVwuIjboRiB6ToQxexUZ19aCZ+2Zvlw3aN8iIuUkkb7EskQmVyH/vNqc+1hPVqkg==}
|
|
1124
1124
|
hasBin: true
|
|
1125
1125
|
|
|
1126
|
-
'@open-dy/vibecoding-cli@0.1.
|
|
1127
|
-
resolution: {integrity: sha512-
|
|
1126
|
+
'@open-dy/vibecoding-cli@0.1.27':
|
|
1127
|
+
resolution: {integrity: sha512-KrUboAb7F0QdSlbzmCjqak9/IfnM0t9o4ge+XoRgP5QabCOlMLIgBCQYlhBXZoHAyEtLSG9BWz2Ws/wyaxR/eQ==}
|
|
1128
1128
|
engines: {node: '>=18'}
|
|
1129
1129
|
hasBin: true
|
|
1130
1130
|
peerDependencies:
|
|
1131
|
-
'@open-dy/vibecoding-sdk-opencard': 0.1.
|
|
1132
|
-
'@open-dy/vibecoding-sdk-taro': 0.1.
|
|
1131
|
+
'@open-dy/vibecoding-sdk-opencard': 0.1.24
|
|
1132
|
+
'@open-dy/vibecoding-sdk-taro': 0.1.23
|
|
1133
1133
|
peerDependenciesMeta:
|
|
1134
1134
|
'@open-dy/vibecoding-sdk-opencard':
|
|
1135
1135
|
optional: true
|
|
1136
1136
|
'@open-dy/vibecoding-sdk-taro':
|
|
1137
1137
|
optional: true
|
|
1138
1138
|
|
|
1139
|
-
'@open-dy/vibecoding-sdk-opencard@0.1.
|
|
1140
|
-
resolution: {integrity: sha512-
|
|
1139
|
+
'@open-dy/vibecoding-sdk-opencard@0.1.24':
|
|
1140
|
+
resolution: {integrity: sha512-eJGTTQWLBYv4m+9bJJdMw13GIfDppDTGl4PnO9PcsRdg0CA8yOp0CzoRaedDKPgkygkfI6BWobYdORM9DON25Q==}
|
|
1141
1141
|
peerDependencies:
|
|
1142
1142
|
eslint: ^9.18.0
|
|
1143
1143
|
react: ^18.0.0
|
|
@@ -5192,7 +5192,7 @@ snapshots:
|
|
|
5192
5192
|
'@nodelib/fs.scandir': 2.1.5
|
|
5193
5193
|
fastq: 1.20.1
|
|
5194
5194
|
|
|
5195
|
-
'@open-dy/opencard-taro@0.1.
|
|
5195
|
+
'@open-dy/opencard-taro@0.1.23(@babel/plugin-transform-typescript@7.29.7(@babel/core@7.29.7))(@types/babel__core@7.20.5)(@types/node@18.19.130)(sass@1.101.0)(terser@5.51.2)(typescript@5.9.3)':
|
|
5196
5196
|
dependencies:
|
|
5197
5197
|
'@ampproject/remapping': 2.3.0
|
|
5198
5198
|
'@babel/core': 7.29.7
|
|
@@ -5320,15 +5320,15 @@ snapshots:
|
|
|
5320
5320
|
- tsx
|
|
5321
5321
|
- typescript
|
|
5322
5322
|
|
|
5323
|
-
'@open-dy/vibecoding-cli@0.1.
|
|
5323
|
+
'@open-dy/vibecoding-cli@0.1.27(@open-dy/vibecoding-sdk-opencard@0.1.24(@babel/plugin-transform-typescript@7.29.7(@babel/core@7.29.7))(@types/babel__core@7.20.5)(@types/node@18.19.130)(eslint@9.39.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.101.0)(terser@5.51.2)(typescript-eslint@8.64.0(eslint@9.39.5)(typescript@5.9.3))(typescript@5.9.3))':
|
|
5324
5324
|
dependencies:
|
|
5325
5325
|
ajv: 8.20.0
|
|
5326
5326
|
optionalDependencies:
|
|
5327
|
-
'@open-dy/vibecoding-sdk-opencard': 0.1.
|
|
5327
|
+
'@open-dy/vibecoding-sdk-opencard': 0.1.24(@babel/plugin-transform-typescript@7.29.7(@babel/core@7.29.7))(@types/babel__core@7.20.5)(@types/node@18.19.130)(eslint@9.39.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.101.0)(terser@5.51.2)(typescript-eslint@8.64.0(eslint@9.39.5)(typescript@5.9.3))(typescript@5.9.3)
|
|
5328
5328
|
|
|
5329
|
-
'@open-dy/vibecoding-sdk-opencard@0.1.
|
|
5329
|
+
'@open-dy/vibecoding-sdk-opencard@0.1.24(@babel/plugin-transform-typescript@7.29.7(@babel/core@7.29.7))(@types/babel__core@7.20.5)(@types/node@18.19.130)(eslint@9.39.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.101.0)(terser@5.51.2)(typescript-eslint@8.64.0(eslint@9.39.5)(typescript@5.9.3))(typescript@5.9.3)':
|
|
5330
5330
|
dependencies:
|
|
5331
|
-
'@open-dy/opencard-taro': 0.1.
|
|
5331
|
+
'@open-dy/opencard-taro': 0.1.23(@babel/plugin-transform-typescript@7.29.7(@babel/core@7.29.7))(@types/babel__core@7.20.5)(@types/node@18.19.130)(sass@1.101.0)(terser@5.51.2)(typescript@5.9.3)
|
|
5332
5332
|
eslint: 9.39.5
|
|
5333
5333
|
react: 18.3.1
|
|
5334
5334
|
react-dom: 18.3.1(react@18.3.1)
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
],
|
|
38
38
|
"author": "",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@open-dy/lucide-taro": "^0.1.
|
|
41
|
-
"@open-dy/vibecoding-sdk-taro": "^0.1.
|
|
40
|
+
"@open-dy/lucide-taro": "^0.1.18",
|
|
41
|
+
"@open-dy/vibecoding-sdk-taro": "^0.1.23",
|
|
42
42
|
"@tarojs/components": "4.2.0",
|
|
43
43
|
"@tarojs/plugin-framework-react": "4.2.0",
|
|
44
44
|
"@tarojs/plugin-platform-h5": "4.2.0",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@eslint/compat": "^2.0.0",
|
|
64
64
|
"@eslint/eslintrc": "^3.3.1",
|
|
65
65
|
"@eslint/js": "^9.18.0",
|
|
66
|
-
"@open-dy/vibecoding-cli": "^0.1.
|
|
66
|
+
"@open-dy/vibecoding-cli": "^0.1.27",
|
|
67
67
|
"@tailwindcss/postcss": "^4.2.1",
|
|
68
68
|
"@tarojs/cli": "4.2.0",
|
|
69
69
|
"@tarojs/plugin-inject": "4.2.0",
|
|
@@ -111,7 +111,8 @@
|
|
|
111
111
|
"overrides": {
|
|
112
112
|
"@eslint/eslintrc>ajv": "^6.12.6",
|
|
113
113
|
"clone-deep>is-plain-object": "^2.0.4",
|
|
114
|
-
"@babel/helper-compilation-targets>lru-cache": "^6.0.0"
|
|
114
|
+
"@babel/helper-compilation-targets>lru-cache": "^6.0.0",
|
|
115
|
+
"solid-js": "1.9.19"
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
118
|
}
|
|
@@ -8,6 +8,7 @@ overrides:
|
|
|
8
8
|
'@eslint/eslintrc>ajv': ^6.12.6
|
|
9
9
|
clone-deep>is-plain-object: ^2.0.4
|
|
10
10
|
'@babel/helper-compilation-targets>lru-cache': ^6.0.0
|
|
11
|
+
solid-js: 1.9.19
|
|
11
12
|
|
|
12
13
|
packageExtensionsChecksum: sha256-ox2jpQnKUVkiBSaaV35/2h24R9EKL5i6jW677LAGPNU=
|
|
13
14
|
|
|
@@ -21,11 +22,11 @@ importers:
|
|
|
21
22
|
.:
|
|
22
23
|
dependencies:
|
|
23
24
|
'@open-dy/lucide-taro':
|
|
24
|
-
specifier: ^0.1.
|
|
25
|
-
version: 0.1.
|
|
25
|
+
specifier: ^0.1.18
|
|
26
|
+
version: 0.1.18(@tarojs/components@4.2.0(@tarojs/helper@4.2.0)(@types/react@18.3.31)(postcss@8.5.19)(rollup@3.30.0)(webpack@5.106.2(@swc/core@1.3.96)(lightningcss@1.32.0)(postcss@8.5.19)))(react@18.3.1)
|
|
26
27
|
'@open-dy/vibecoding-sdk-taro':
|
|
27
|
-
specifier: ^0.1.
|
|
28
|
-
version: 0.1.
|
|
28
|
+
specifier: ^0.1.23
|
|
29
|
+
version: 0.1.23(bb2fb1d6bf49fec68865e6d4d90ca665)
|
|
29
30
|
'@tarojs/components':
|
|
30
31
|
specifier: 4.2.0
|
|
31
32
|
version: 4.2.0(@tarojs/helper@4.2.0)(@types/react@18.3.31)(postcss@8.5.19)(rollup@3.30.0)(webpack@5.106.2(@swc/core@1.3.96)(lightningcss@1.32.0)(postcss@8.5.19))
|
|
@@ -94,8 +95,8 @@ importers:
|
|
|
94
95
|
specifier: ^9.18.0
|
|
95
96
|
version: 9.39.5
|
|
96
97
|
'@open-dy/vibecoding-cli':
|
|
97
|
-
specifier: ^0.1.
|
|
98
|
-
version: 0.1.
|
|
98
|
+
specifier: ^0.1.27
|
|
99
|
+
version: 0.1.27(@open-dy/vibecoding-sdk-taro@0.1.23(bb2fb1d6bf49fec68865e6d4d90ca665))
|
|
99
100
|
'@tailwindcss/postcss':
|
|
100
101
|
specifier: ^4.2.1
|
|
101
102
|
version: 4.3.2
|
|
@@ -193,8 +194,8 @@ importers:
|
|
|
193
194
|
specifier: ^11.0.1
|
|
194
195
|
version: 11.1.28(@nestjs/common@11.1.28(reflect-metadata@0.2.2)(rxjs@7.8.2))(@nestjs/core@11.1.28)
|
|
195
196
|
'@open-dy/ai_coding_sdk':
|
|
196
|
-
specifier:
|
|
197
|
-
version: 1.0.
|
|
197
|
+
specifier: 1.0.27
|
|
198
|
+
version: 1.0.27
|
|
198
199
|
mysql2:
|
|
199
200
|
specifier: 3.24.4
|
|
200
201
|
version: 3.24.4(@types/node@22.20.1)
|
|
@@ -230,8 +231,8 @@ importers:
|
|
|
230
231
|
specifier: ^11.0.1
|
|
231
232
|
version: 11.2.3(@nestjs/common@11.1.28(reflect-metadata@0.2.2)(rxjs@7.8.2))(@nestjs/core@11.1.28)
|
|
232
233
|
'@open-dy/ai_coding_sdk':
|
|
233
|
-
specifier:
|
|
234
|
-
version: 1.0.
|
|
234
|
+
specifier: 1.0.27
|
|
235
|
+
version: 1.0.27
|
|
235
236
|
mysql2:
|
|
236
237
|
specifier: 3.24.4
|
|
237
238
|
version: 3.24.4(@types/node@22.20.1)
|
|
@@ -2234,31 +2235,31 @@ packages:
|
|
|
2234
2235
|
resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==}
|
|
2235
2236
|
engines: {node: '>= 8'}
|
|
2236
2237
|
|
|
2237
|
-
'@open-dy/ai_coding_sdk@1.0.
|
|
2238
|
-
resolution: {integrity: sha512-
|
|
2238
|
+
'@open-dy/ai_coding_sdk@1.0.27':
|
|
2239
|
+
resolution: {integrity: sha512-Bsx98V0gHZYn+WCMpB3Rbt3Luq5cDeLICdZBr0++Pfs0QVpXWDGP82IYlkWtHV9iLc8of6H0Cm9rGUKxVmPXAw==}
|
|
2239
2240
|
|
|
2240
|
-
'@open-dy/lucide-taro@0.1.
|
|
2241
|
-
resolution: {integrity: sha512
|
|
2241
|
+
'@open-dy/lucide-taro@0.1.18':
|
|
2242
|
+
resolution: {integrity: sha512-/oMiSAZGrSYs0bOoF20DvHLmgkkDGyF9ZMWnm1znkAEGNLhcGWCkflbOHZeGZDs76gJtt8vKGjZi3tg8RrtSjA==}
|
|
2242
2243
|
hasBin: true
|
|
2243
2244
|
peerDependencies:
|
|
2244
2245
|
'@tarojs/components': ^4.2.0
|
|
2245
2246
|
react: ^18.0.0
|
|
2246
2247
|
|
|
2247
|
-
'@open-dy/vibecoding-cli@0.1.
|
|
2248
|
-
resolution: {integrity: sha512-
|
|
2248
|
+
'@open-dy/vibecoding-cli@0.1.27':
|
|
2249
|
+
resolution: {integrity: sha512-KrUboAb7F0QdSlbzmCjqak9/IfnM0t9o4ge+XoRgP5QabCOlMLIgBCQYlhBXZoHAyEtLSG9BWz2Ws/wyaxR/eQ==}
|
|
2249
2250
|
engines: {node: '>=18'}
|
|
2250
2251
|
hasBin: true
|
|
2251
2252
|
peerDependencies:
|
|
2252
|
-
'@open-dy/vibecoding-sdk-opencard': 0.1.
|
|
2253
|
-
'@open-dy/vibecoding-sdk-taro': 0.1.
|
|
2253
|
+
'@open-dy/vibecoding-sdk-opencard': 0.1.24
|
|
2254
|
+
'@open-dy/vibecoding-sdk-taro': 0.1.23
|
|
2254
2255
|
peerDependenciesMeta:
|
|
2255
2256
|
'@open-dy/vibecoding-sdk-opencard':
|
|
2256
2257
|
optional: true
|
|
2257
2258
|
'@open-dy/vibecoding-sdk-taro':
|
|
2258
2259
|
optional: true
|
|
2259
2260
|
|
|
2260
|
-
'@open-dy/vibecoding-sdk-taro@0.1.
|
|
2261
|
-
resolution: {integrity: sha512-
|
|
2261
|
+
'@open-dy/vibecoding-sdk-taro@0.1.23':
|
|
2262
|
+
resolution: {integrity: sha512-ReKHLnU6VJLiTUnFJhRc0uZ9rObV/l6MUtH0JtHM7MBOFk90OU7Q2i1GAhcuM+V3dXdhEsTgtGsNbtED7VhDHg==}
|
|
2262
2263
|
peerDependencies:
|
|
2263
2264
|
'@babel/generator': ^7.29.0
|
|
2264
2265
|
'@babel/parser': ^7.29.0
|
|
@@ -2705,7 +2706,7 @@ packages:
|
|
|
2705
2706
|
resolution: {integrity: sha512-xQSnHIxNmVAqSNXE2rVHRDvu4bEvfGR4DEYZbho9IeY5W8i/Mc/+WzB4MpjyA8VDnmYLGltUt0+J9tzaOyv5Aw==}
|
|
2706
2707
|
peerDependencies:
|
|
2707
2708
|
react: '*'
|
|
2708
|
-
solid-js:
|
|
2709
|
+
solid-js: 1.9.19
|
|
2709
2710
|
|
|
2710
2711
|
'@tarojs/components@4.2.0':
|
|
2711
2712
|
resolution: {integrity: sha512-SQIK5UxKfmkhV0MdhmC0KV6duSkBtF9C8sX3dF6afKX8DvULXP5dirH8Y4bJEL+Mt+dkhlXiBmuSk/C2KB7sVg==}
|
|
@@ -9365,20 +9366,20 @@ snapshots:
|
|
|
9365
9366
|
'@nodelib/fs.scandir': 2.1.5
|
|
9366
9367
|
fastq: 1.20.1
|
|
9367
9368
|
|
|
9368
|
-
'@open-dy/ai_coding_sdk@1.0.
|
|
9369
|
+
'@open-dy/ai_coding_sdk@1.0.27': {}
|
|
9369
9370
|
|
|
9370
|
-
'@open-dy/lucide-taro@0.1.
|
|
9371
|
+
'@open-dy/lucide-taro@0.1.18(@tarojs/components@4.2.0(@tarojs/helper@4.2.0)(@types/react@18.3.31)(postcss@8.5.19)(rollup@3.30.0)(webpack@5.106.2(@swc/core@1.3.96)(lightningcss@1.32.0)(postcss@8.5.19)))(react@18.3.1)':
|
|
9371
9372
|
dependencies:
|
|
9372
9373
|
'@tarojs/components': 4.2.0(@tarojs/helper@4.2.0)(@types/react@18.3.31)(postcss@8.5.19)(rollup@3.30.0)(webpack@5.106.2(@swc/core@1.3.96)(lightningcss@1.32.0)(postcss@8.5.19))
|
|
9373
9374
|
react: 18.3.1
|
|
9374
9375
|
|
|
9375
|
-
'@open-dy/vibecoding-cli@0.1.
|
|
9376
|
+
'@open-dy/vibecoding-cli@0.1.27(@open-dy/vibecoding-sdk-taro@0.1.23(bb2fb1d6bf49fec68865e6d4d90ca665))':
|
|
9376
9377
|
dependencies:
|
|
9377
9378
|
ajv: 8.20.0
|
|
9378
9379
|
optionalDependencies:
|
|
9379
|
-
'@open-dy/vibecoding-sdk-taro': 0.1.
|
|
9380
|
+
'@open-dy/vibecoding-sdk-taro': 0.1.23(bb2fb1d6bf49fec68865e6d4d90ca665)
|
|
9380
9381
|
|
|
9381
|
-
'@open-dy/vibecoding-sdk-taro@0.1.
|
|
9382
|
+
'@open-dy/vibecoding-sdk-taro@0.1.23(bb2fb1d6bf49fec68865e6d4d90ca665)':
|
|
9382
9383
|
dependencies:
|
|
9383
9384
|
'@babel/generator': 7.29.7
|
|
9384
9385
|
'@babel/parser': 7.29.7
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@nestjs/core": "^11.0.1",
|
|
20
20
|
"@nestjs/platform-express": "^11.0.1",
|
|
21
21
|
"@nestjs/platform-fastify": "^11.0.1",
|
|
22
|
-
"@open-dy/ai_coding_sdk": "
|
|
22
|
+
"@open-dy/ai_coding_sdk": "1.0.27",
|
|
23
23
|
"mysql2": "3.24.4",
|
|
24
24
|
"reflect-metadata": "^0.2.2",
|
|
25
25
|
"rxjs": "^7.8.1"
|
package/dist/src/args.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
const globalLeadingOptions = new Set(['config', 'base-url', 'auth-base-url', 'platform']);
|
|
1
|
+
const globalLeadingOptions = new Set(['config', 'base-url', 'auth-base-url', 'platform', 'ppe']);
|
|
2
2
|
const valueOptions = new Set([
|
|
3
|
+
'ppe',
|
|
4
|
+
'prompt-file',
|
|
5
|
+
'skill',
|
|
3
6
|
'agent',
|
|
4
7
|
'answers',
|
|
5
8
|
'auth-base-url',
|
|
@@ -98,12 +101,24 @@ export function parseCliArgs(argv) {
|
|
|
98
101
|
const args = [...globalArgv, ...normalized.slice(1)];
|
|
99
102
|
const options = {};
|
|
100
103
|
const positionals = [];
|
|
101
|
-
if (wantsHelp) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
if (wantsHelp || normalized.length === 0) {
|
|
105
|
+
const positionals = [];
|
|
106
|
+
const options = { help: true };
|
|
107
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
108
|
+
const arg = args[index];
|
|
109
|
+
const [key, inline] = arg.startsWith('--') ? arg.slice(2).split(/=(.*)/s, 2) : [];
|
|
110
|
+
if (key && globalLeadingOptions.has(key)) {
|
|
111
|
+
const value = inline ?? args[index + 1];
|
|
112
|
+
if (value && !value.startsWith('-')) {
|
|
113
|
+
options[key] = value;
|
|
114
|
+
if (inline === undefined)
|
|
115
|
+
index += 1;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else if (!arg.startsWith('-'))
|
|
119
|
+
positionals.push(arg);
|
|
120
|
+
}
|
|
121
|
+
return { command, options, positionals };
|
|
107
122
|
}
|
|
108
123
|
for (let index = 0; index < args.length; index += 1) {
|
|
109
124
|
const arg = args[index];
|
|
@@ -146,7 +161,7 @@ function normalizeCommand(argv) {
|
|
|
146
161
|
return argv;
|
|
147
162
|
}
|
|
148
163
|
function appendOption(options, key, value) {
|
|
149
|
-
if (key !== 'agent') {
|
|
164
|
+
if (key !== 'agent' && key !== 'skill') {
|
|
150
165
|
options[key] = value;
|
|
151
166
|
return;
|
|
152
167
|
}
|
package/dist/src/browser.js
CHANGED
|
@@ -24,6 +24,8 @@ export async function launchLoginPersistentContext(userDataDir, options, chromiu
|
|
|
24
24
|
const type = chromium ?? (await loadChromium());
|
|
25
25
|
return tryChannels(channel => type.launchPersistentContext(userDataDir, { ...options, channel }));
|
|
26
26
|
}
|
|
27
|
+
/** Link authorization needs no browser on this machine, so it is the way out when one will not start. */
|
|
28
|
+
export const LINK_LOGIN_FALLBACK = 'Log in by link instead, without `--qr`: `interest-card-cli login --platform creator --json`.';
|
|
27
29
|
async function tryChannels(launch) {
|
|
28
30
|
const failures = [];
|
|
29
31
|
for (const channel of LOGIN_BROWSER_CHANNELS) {
|
|
@@ -36,7 +38,7 @@ async function tryChannels(launch) {
|
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
throw new CliError('No browser available for login.', 'BROWSER_LAUNCH_FAILED', {
|
|
39
|
-
hint:
|
|
41
|
+
hint: `${LINK_LOGIN_FALLBACK} To log in with a browser instead, install Google Chrome or Microsoft Edge, or run \`${chromiumInstallCommand()}\`.`,
|
|
40
42
|
attempts: failures,
|
|
41
43
|
});
|
|
42
44
|
}
|
|
@@ -20,6 +20,7 @@ export async function sendCardMessage(target, input) {
|
|
|
20
20
|
conversationId: target.conversationId,
|
|
21
21
|
...(container ? { containerConversationId: container } : {}),
|
|
22
22
|
text: input.text || '',
|
|
23
|
+
...(target.candidate ? { candidate: target.candidate } : {}),
|
|
23
24
|
...(input.systemReminder ? { systemReminder: input.systemReminder } : {}),
|
|
24
25
|
...(input.solutionIds?.length ? { solutionIds: input.solutionIds } : {}),
|
|
25
26
|
...(input.multiModal === false ? { multiModal: false } : {}),
|
|
@@ -39,6 +40,9 @@ export async function sendCardMessage(target, input) {
|
|
|
39
40
|
error: response.error,
|
|
40
41
|
});
|
|
41
42
|
}
|
|
43
|
+
if (target.candidate && response.error) {
|
|
44
|
+
throw new CliError('Candidate execution was not acknowledged. Check the run before retrying.', 'CARD_CANDIDATE_NOT_ACKNOWLEDGED', { messageId });
|
|
45
|
+
}
|
|
42
46
|
if (answer) {
|
|
43
47
|
await rememberAnsweredQuestion(target.conversationId, answer.toolCallId);
|
|
44
48
|
}
|
package/dist/src/card/binding.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
+
import { renameReplacing } from '../platform-process.js';
|
|
3
4
|
import { CliError } from '../types.js';
|
|
4
5
|
import { CARD_STATE_DIR } from './constants.js';
|
|
5
6
|
import { isNotFound } from './snapshot.js';
|
|
@@ -115,5 +116,5 @@ async function writeJsonAtomic(filePath, value) {
|
|
|
115
116
|
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
116
117
|
const tmpPath = `${filePath}.${process.pid}.tmp`;
|
|
117
118
|
await fs.writeFile(tmpPath, `${JSON.stringify(value, null, 2)}\n`);
|
|
118
|
-
await
|
|
119
|
+
await renameReplacing(tmpPath, filePath);
|
|
119
120
|
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { constants } from 'node:fs';
|
|
2
|
+
import { open } from 'node:fs/promises';
|
|
3
|
+
import { getString } from '../cli-helpers.js';
|
|
4
|
+
import { CliError } from '../types.js';
|
|
5
|
+
const OUTER_TOS_HOST = 'lf-aihub.douyinvod.com';
|
|
6
|
+
const LEGACY_SIGNED_HOST = 'lf1-developer-sign.bytemastatic.com';
|
|
7
|
+
const LEGACY_PUBLIC_HOST = 'lf3-static.bytednsdoc.com';
|
|
8
|
+
export function hasCandidateOptions(parsed) {
|
|
9
|
+
return ['skill', 'skill-dir', 'prompt-file', 'skill-archive', 'skill-cdn-url'].some(key => key in parsed.options);
|
|
10
|
+
}
|
|
11
|
+
async function readRegularFile(file, maxBytes) {
|
|
12
|
+
const handle = await open(file, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
|
|
13
|
+
try {
|
|
14
|
+
const stat = await handle.stat();
|
|
15
|
+
if (!stat.isFile())
|
|
16
|
+
throw invalidCandidate('--prompt-file must point to a regular file.');
|
|
17
|
+
if (stat.size > maxBytes)
|
|
18
|
+
throw invalidCandidate('--prompt-file exceeds 2 MiB.');
|
|
19
|
+
const bytes = Buffer.alloc(stat.size + 1);
|
|
20
|
+
let offset = 0;
|
|
21
|
+
while (offset < bytes.length) {
|
|
22
|
+
const { bytesRead } = await handle.read(bytes, offset, bytes.length - offset, offset);
|
|
23
|
+
if (!bytesRead)
|
|
24
|
+
break;
|
|
25
|
+
offset += bytesRead;
|
|
26
|
+
}
|
|
27
|
+
if (offset !== stat.size)
|
|
28
|
+
throw invalidCandidate('--prompt-file changed while reading.');
|
|
29
|
+
return bytes.subarray(0, offset);
|
|
30
|
+
}
|
|
31
|
+
finally {
|
|
32
|
+
await handle.close();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const invalidCandidate = (message) => new CliError(message, 'CARD_CANDIDATE_INVALID');
|
|
36
|
+
export async function readCardCandidate(parsed) {
|
|
37
|
+
if (!hasCandidateOptions(parsed))
|
|
38
|
+
return;
|
|
39
|
+
const promptPath = getString(parsed, 'prompt-file');
|
|
40
|
+
const values = parsed.options.skill;
|
|
41
|
+
const refs = Array.isArray(values) ? values : typeof values === 'string' ? [values] : [];
|
|
42
|
+
if ((!promptPath && refs.length === 0) || ('prompt-file' in parsed.options && !promptPath) || refs.length > 16 ||
|
|
43
|
+
['skill-dir', 'skill-archive', 'skill-cdn-url'].some(key => key in parsed.options)) {
|
|
44
|
+
throw new CliError('Supply --prompt-file, --skill <name>=<CDN URL> (up to 16), or both.', 'CARD_CANDIDATE_INVALID');
|
|
45
|
+
}
|
|
46
|
+
let prompt;
|
|
47
|
+
if (promptPath) {
|
|
48
|
+
const bytes = await readRegularFile(promptPath, 2 << 20).catch((error) => {
|
|
49
|
+
if (error instanceof CliError)
|
|
50
|
+
throw error;
|
|
51
|
+
throw invalidCandidate('Could not read --prompt-file. Check the path and file permissions.');
|
|
52
|
+
});
|
|
53
|
+
try {
|
|
54
|
+
prompt = new TextDecoder('utf-8', { fatal: true }).decode(bytes);
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
throw invalidCandidate('--prompt-file must contain valid UTF-8.');
|
|
58
|
+
}
|
|
59
|
+
if (!prompt.trim())
|
|
60
|
+
throw invalidCandidate('--prompt-file must contain a nonempty prompt.');
|
|
61
|
+
}
|
|
62
|
+
const names = new Set();
|
|
63
|
+
const skills = refs.map(ref => {
|
|
64
|
+
const separator = ref.indexOf('=');
|
|
65
|
+
const name = ref.slice(0, separator);
|
|
66
|
+
if (separator < 1 || !/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/.test(name)) {
|
|
67
|
+
throw invalidCandidate('Use --skill <name>=<CDN URL> with a valid Skill name.');
|
|
68
|
+
}
|
|
69
|
+
if (names.has(name))
|
|
70
|
+
throw invalidCandidate(`Duplicate Skill name: ${name}.`);
|
|
71
|
+
names.add(name);
|
|
72
|
+
const cdnUrl = ref.slice(separator + 1);
|
|
73
|
+
let url;
|
|
74
|
+
try {
|
|
75
|
+
url = new URL(cdnUrl);
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
throw invalidCandidate(`Invalid CDN URL for Skill ${name}.`);
|
|
79
|
+
}
|
|
80
|
+
const exactOrigin = cdnUrl.startsWith(`https://${url.hostname}/`);
|
|
81
|
+
const allowed = (url.hostname === OUTER_TOS_HOST && url.pathname.startsWith('/obj/developer/') && !url.search) ||
|
|
82
|
+
url.hostname === LEGACY_SIGNED_HOST || (url.hostname === LEGACY_PUBLIC_HOST && !url.search);
|
|
83
|
+
if (!exactOrigin || !allowed || cdnUrl.length > 2048 || url.pathname === '/' || /[#\\]/.test(cdnUrl) ||
|
|
84
|
+
(url.hostname !== LEGACY_SIGNED_HOST && cdnUrl.includes('?'))) {
|
|
85
|
+
throw invalidCandidate(`Unsupported CDN URL for Skill ${name}.`);
|
|
86
|
+
}
|
|
87
|
+
return { name, url: cdnUrl };
|
|
88
|
+
});
|
|
89
|
+
return { ...(prompt && { prompt }), ...(skills.length && { skills }) };
|
|
90
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cardAuthFor, fetchWithCredential, isCardGateError } from './card-token.js';
|
|
2
|
-
import {
|
|
2
|
+
import { cliSourceHeaders } from '../request-source.js';
|
|
3
3
|
import { CliError } from '../types.js';
|
|
4
4
|
import { CARD_API_ROUTES, CARD_LOGIN_HINT, getCardApiBaseUrl } from './constants.js';
|
|
5
5
|
import { NETWORK_RETRY_DELAY_MS, isNetworkError, networkErrorCode, neverConnected } from './aio-client.js';
|
|
@@ -34,7 +34,7 @@ export async function cardApi(config, route, body, options = {}) {
|
|
|
34
34
|
referer: `${CARD_WEB_ORIGIN}/`,
|
|
35
35
|
'content-type': 'application/json',
|
|
36
36
|
...(tenant ? { 'x-aicore-tenant': tenant } : {}),
|
|
37
|
-
...
|
|
37
|
+
...cliSourceHeaders(options.headers?.['x-tt-env']),
|
|
38
38
|
},
|
|
39
39
|
body: JSON.stringify(tenant && body.tenant === undefined ? { ...body, tenant } : body),
|
|
40
40
|
});
|
|
@@ -96,6 +96,18 @@ export function notAllowedError(xTtLogid) {
|
|
|
96
96
|
hint: '请联系抖音兴趣卡技术支持团队为该账号开通 CLI 权限。重新登录无法解决,开通前可继续使用网页端编辑。',
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
|
+
function testingAccessError(code, xTtLogid) {
|
|
100
|
+
if (code === 'CLI_TESTING_NOT_ALLOWED') {
|
|
101
|
+
return new CliError('当前账号未开通 CLI 测试权限。', code, {
|
|
102
|
+
hint: '请联系兴趣卡技术支持开通测试权限。重新登录无法解决。', xTtLogid,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
if (code === 'CLI_TESTING_UNAVAILABLE') {
|
|
106
|
+
return new CliError('CLI 测试权限服务暂不可用。', code, {
|
|
107
|
+
hint: '请稍后重试;无需重新登录或重复申请白名单。', xTtLogid,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
99
111
|
async function isNotAllowedResponse(response) {
|
|
100
112
|
if (response.status !== 403) {
|
|
101
113
|
return false;
|
|
@@ -128,6 +140,11 @@ export async function exchangeCookieForToken(config) {
|
|
|
128
140
|
});
|
|
129
141
|
}
|
|
130
142
|
const { response, envelope, xTtLogid } = outcome;
|
|
143
|
+
if (response.status === 403 || response.status === 503) {
|
|
144
|
+
const accessError = testingAccessError(envelope?.error_code, xTtLogid);
|
|
145
|
+
if (accessError)
|
|
146
|
+
throw accessError;
|
|
147
|
+
}
|
|
131
148
|
if (response.status === 403 && envelope?.error_code === NOT_ALLOWED_CODE) {
|
|
132
149
|
throw notAllowedError(xTtLogid);
|
|
133
150
|
}
|
|
@@ -321,7 +338,7 @@ async function rateLimitedError(response, url) {
|
|
|
321
338
|
* or not on the CLI allowlist. Callers pass them through instead of reporting a network failure.
|
|
322
339
|
*/
|
|
323
340
|
export function isCardGateError(error) {
|
|
324
|
-
return error instanceof CliError && (error.code === 'CARD_RATE_LIMITED' || error.code === NOT_ALLOWED_CODE);
|
|
341
|
+
return error instanceof CliError && (error.code === 'CARD_RATE_LIMITED' || error.code === NOT_ALLOWED_CODE || ['CLI_TESTING_NOT_ALLOWED', 'CLI_TESTING_UNAVAILABLE'].includes(error.code));
|
|
325
342
|
}
|
|
326
343
|
/**
|
|
327
344
|
* fetch with card credentials. A 401 is returned as is: the token cannot be renewed, so callers
|
|
@@ -335,6 +352,12 @@ export async function fetchWithCredential(credential, url, init) {
|
|
|
335
352
|
if (response.status === 429) {
|
|
336
353
|
throw await rateLimitedError(response, url);
|
|
337
354
|
}
|
|
355
|
+
if (response.status === 403 || response.status === 503) {
|
|
356
|
+
const body = await response.clone().json().catch(() => undefined);
|
|
357
|
+
const accessError = testingAccessError(body?.error_code, response.headers.get('x-tt-logid') || undefined);
|
|
358
|
+
if (accessError)
|
|
359
|
+
throw accessError;
|
|
360
|
+
}
|
|
338
361
|
if (await isNotAllowedResponse(response)) {
|
|
339
362
|
await response.body?.cancel().catch(() => undefined);
|
|
340
363
|
throw notAllowedError(response.headers.get('x-tt-logid') || undefined);
|
|
@@ -360,7 +383,7 @@ export async function replaceStoredCookieLogin(config) {
|
|
|
360
383
|
}
|
|
361
384
|
catch (error) {
|
|
362
385
|
await removeConfig(configPath).catch(() => false);
|
|
363
|
-
if (error instanceof CliError && error.code === NOT_ALLOWED_CODE) {
|
|
386
|
+
if (error instanceof CliError && (error.code === NOT_ALLOWED_CODE || ['CLI_TESTING_NOT_ALLOWED', 'CLI_TESTING_UNAVAILABLE'].includes(error.code))) {
|
|
364
387
|
throw error;
|
|
365
388
|
}
|
|
366
389
|
throw new CliError('The saved login was a browser Cookie, which is no longer kept on disk. It has been removed.', 'AUTH_REQUIRED', {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getString } from '../cli-helpers.js';
|
|
2
|
+
import { readCardCandidate } from './candidate.js';
|
|
2
3
|
import { printText } from '../output.js';
|
|
3
4
|
import { buildWorkspaceHeaders } from '../platform.js';
|
|
4
5
|
import { CliError } from '../types.js';
|
|
@@ -6,7 +7,7 @@ import { createChildConversation, followRun, formatQuestion, runConversation, se
|
|
|
6
7
|
import { parseAnswersJson } from './agent-questions.js';
|
|
7
8
|
import { findAnsweredQuestion } from './answered-questions.js';
|
|
8
9
|
import { findProjectRoot, readBinding, writeBinding } from './binding.js';
|
|
9
|
-
import { buildProjectPageUrl, getContainerConversationId, getTenantOption, loadCardConfig, parseProjectRef, resolveCardProject, } from './project.js';
|
|
10
|
+
import { buildProjectPageUrl, getContainerConversationId, getCardPpeHeaders, getTenantOption, loadCardConfig, parseProjectRef, resolveCardProject, } from './project.js';
|
|
10
11
|
const MAX_REPLY_CHARS = 4000;
|
|
11
12
|
/**
|
|
12
13
|
* The platform installs the latest project skills into the sandbox when its Agent starts a turn.
|
|
@@ -105,7 +106,7 @@ export async function followAndReport(parsed, target, messageId, command, extraD
|
|
|
105
106
|
...pendingData(outcome.action),
|
|
106
107
|
};
|
|
107
108
|
if (!json && !options.suppressText) {
|
|
108
|
-
printText(`\n\n${describeOutcome(data, target, options.followFlags)}`);
|
|
109
|
+
printText(`\n\n${describeOutcome(data, target, parsed, options.followFlags)}`);
|
|
109
110
|
}
|
|
110
111
|
return { ok: true, command, data };
|
|
111
112
|
}
|
|
@@ -117,16 +118,25 @@ function pendingData(action) {
|
|
|
117
118
|
? { toolCallId: action.toolCallId, questions: action.questions }
|
|
118
119
|
: { toolCallId: action.toolCallId, toolCallName: action.toolCallName, reason: action.reason };
|
|
119
120
|
}
|
|
120
|
-
function describeOutcome(data, target, flags) {
|
|
121
|
+
function describeOutcome(data, target, parsed, flags) {
|
|
121
122
|
const projectFlag = flags ?? (target.projectId ? ` --project ${target.projectId}` : '');
|
|
123
|
+
const lane = target.headers?.['x-tt-env'];
|
|
124
|
+
const followUpFlags = lane ? `${projectFlag} --ppe ${lane}` : projectFlag;
|
|
122
125
|
switch (data.status) {
|
|
123
|
-
case 'needs_input':
|
|
126
|
+
case 'needs_input': {
|
|
127
|
+
const quoteArg = (value) => "'" + value.replaceAll("'", "'\\''") + "'";
|
|
128
|
+
const promptPath = getString(parsed, 'prompt-file');
|
|
129
|
+
const candidateFlags = [
|
|
130
|
+
...(promptPath ? [' --prompt-file ' + quoteArg(promptPath)] : []),
|
|
131
|
+
...(target.candidate?.skills ?? []).map(skill => ' --skill ' + quoteArg(skill.name + '=' + skill.url)),
|
|
132
|
+
].join('');
|
|
124
133
|
return [
|
|
125
134
|
'The platform agent is waiting for your answer:',
|
|
126
135
|
...(data.questions || []).map(formatQuestion),
|
|
127
|
-
`Answer with: interest-card-cli answer${
|
|
136
|
+
`Answer with: interest-card-cli answer${followUpFlags}${candidateFlags} --tool-call-id ${data.toolCallId} ` +
|
|
128
137
|
`--answers '{"<question>":"<option value>"}'`,
|
|
129
138
|
].join('\n');
|
|
139
|
+
}
|
|
130
140
|
case 'needs_web':
|
|
131
141
|
return `${data.reason}. Continue on the web page: ${data.projectUrl || target.conversationId}`;
|
|
132
142
|
case 'stopped':
|
|
@@ -134,8 +144,8 @@ function describeOutcome(data, target, flags) {
|
|
|
134
144
|
default:
|
|
135
145
|
return [
|
|
136
146
|
'The platform agent finished this round.',
|
|
137
|
-
target.projectId ? `Pull the code: interest-card-cli pull ${target.projectId}` : '',
|
|
138
|
-
`Follow up: interest-card-cli reply "<message>"${
|
|
147
|
+
target.projectId && !lane ? `Pull the code: interest-card-cli pull ${target.projectId}` : '',
|
|
148
|
+
`Follow up: interest-card-cli reply "<message>"${followUpFlags}`,
|
|
139
149
|
]
|
|
140
150
|
.filter(Boolean)
|
|
141
151
|
.join('\n');
|
|
@@ -156,7 +166,12 @@ const CONVERSATION_ID_PATTERN = /^conv_[\w-]+$/;
|
|
|
156
166
|
async function resolveChatTarget(parsed) {
|
|
157
167
|
const { config } = await loadCardConfig(parsed);
|
|
158
168
|
const tenant = getTenantOption(parsed);
|
|
159
|
-
const
|
|
169
|
+
const routingHeaders = getCardPpeHeaders(parsed);
|
|
170
|
+
const headers = { ...(tenant ? buildWorkspaceHeaders(config.base_url, tenant) : {}), ...routingHeaders };
|
|
171
|
+
const candidate = await readCardCandidate(parsed);
|
|
172
|
+
if (parsed.options.ppe && parsed.options['new-conversation']) {
|
|
173
|
+
throw new CliError('PPE validation requires an existing owner conversation.', 'CARD_INVALID_ARGS');
|
|
174
|
+
}
|
|
160
175
|
const ref = getString(parsed, 'project');
|
|
161
176
|
const requested = getString(parsed, 'conversation-id');
|
|
162
177
|
if (requested && parsed.options['new-conversation']) {
|
|
@@ -171,7 +186,7 @@ async function resolveChatTarget(parsed) {
|
|
|
171
186
|
let chat;
|
|
172
187
|
let conversations;
|
|
173
188
|
if (ref) {
|
|
174
|
-
const project = await resolveCardProject(config, parseProjectRef(ref), tenant);
|
|
189
|
+
const project = await resolveCardProject(config, parseProjectRef(ref), tenant, routingHeaders);
|
|
175
190
|
projectId = project.projectId;
|
|
176
191
|
container = project.conversationId;
|
|
177
192
|
chat = container;
|
|
@@ -188,7 +203,7 @@ async function resolveChatTarget(parsed) {
|
|
|
188
203
|
}
|
|
189
204
|
if (requested) {
|
|
190
205
|
if (!conversations && projectId) {
|
|
191
|
-
conversations = (await resolveCardProject(config, projectId, tenant)).conversations;
|
|
206
|
+
conversations = (await resolveCardProject(config, projectId, tenant, routingHeaders)).conversations;
|
|
192
207
|
}
|
|
193
208
|
if (conversations) {
|
|
194
209
|
const item = conversations.find(entry => entry.conversationId === requested);
|
|
@@ -201,7 +216,7 @@ async function resolveChatTarget(parsed) {
|
|
|
201
216
|
}
|
|
202
217
|
return {
|
|
203
218
|
root,
|
|
204
|
-
target: { config, headers, conversationId: chat, projectId, containerConversationId: container },
|
|
219
|
+
target: { config, headers, conversationId: chat, projectId, containerConversationId: container, candidate },
|
|
205
220
|
};
|
|
206
221
|
}
|
|
207
222
|
/** Opens a "新建对话" child on the sandbox owner and makes it the directory's chat conversation. */
|