Skip to content

Commit 967176a

Browse files
committed
feat: prepare v0.3.0 release
1 parent dc16a1d commit 967176a

84 files changed

Lines changed: 55522 additions & 95 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,18 @@ concurrency:
1616

1717
jobs:
1818
build-macos:
19-
name: Build And Package
20-
runs-on: macos-latest
19+
name: Build macOS Preview (${{ matrix.label }})
20+
runs-on: ${{ matrix.runner }}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
include:
25+
- runner: macos-15
26+
label: Apple Silicon
27+
artifact_suffix: macos-arm64
28+
- runner: macos-15-intel
29+
label: Intel
30+
artifact_suffix: macos-x64
2131
steps:
2232
- name: Checkout
2333
uses: actions/checkout@v5
@@ -39,13 +49,13 @@ jobs:
3949
test -f "dist/Lime Pet.app/Contents/Info.plist"
4050
4151
- name: Build release package preview
42-
run: ./scripts/package-release.sh --version "0.0.0-ci" --build-number "${{ github.run_number }}"
52+
run: ./scripts/package-release.sh --version "0.0.0-ci" --build-number "${{ github.run_number }}" --artifact-suffix "${{ matrix.artifact_suffix }}"
4353

4454
- name: Upload macOS preview artifact
4555
if: success()
4656
uses: actions/upload-artifact@v6
4757
with:
48-
name: lime-pet-macos-preview
58+
name: lime-pet-${{ matrix.artifact_suffix }}-preview
4959
path: |
5060
dist/release/*.zip
5161
dist/release/*.sha256

.github/workflows/release.yml

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ on:
44
workflow_dispatch:
55
inputs:
66
version:
7-
description: "发布版本,例如 v0.2.0"
7+
description: "发布版本,例如 v0.3.0"
88
required: true
9-
default: "v0.2.0"
9+
default: "v0.3.0"
1010
source_ref:
1111
description: "构建所用 Git ref,例如 main 或某个 commit/tag"
1212
required: false
@@ -65,9 +65,19 @@ jobs:
6565
fi
6666
6767
package-macos:
68-
name: Package macOS Release
69-
runs-on: macos-latest
68+
name: Package macOS Release (${{ matrix.label }})
69+
runs-on: ${{ matrix.runner }}
7070
needs: meta
71+
strategy:
72+
fail-fast: false
73+
matrix:
74+
include:
75+
- runner: macos-15
76+
label: Apple Silicon
77+
artifact_suffix: macos-arm64
78+
- runner: macos-15-intel
79+
label: Intel
80+
artifact_suffix: macos-x64
7181
steps:
7282
- name: Checkout
7383
uses: actions/checkout@v5
@@ -84,12 +94,12 @@ jobs:
8494
xcodebuild -version
8595
8696
- name: Build release package
87-
run: ./scripts/package-release.sh --version "${{ needs.meta.outputs.version }}" --build-number "${{ github.run_number }}"
97+
run: ./scripts/package-release.sh --version "${{ needs.meta.outputs.version }}" --build-number "${{ github.run_number }}" --artifact-suffix "${{ matrix.artifact_suffix }}"
8898

8999
- name: Upload release artifact
90100
uses: actions/upload-artifact@v6
91101
with:
92-
name: lime-pet-${{ needs.meta.outputs.tag }}-macos
102+
name: lime-pet-${{ needs.meta.outputs.tag }}-${{ matrix.artifact_suffix }}
93103
path: |
94104
dist/release/*.zip
95105
dist/release/*.sha256
@@ -157,11 +167,17 @@ jobs:
157167
fetch-depth: 0
158168
ref: ${{ needs.meta.outputs.target_ref }}
159169

160-
- name: Download macOS artifact
170+
- name: Download macOS Apple Silicon artifact
161171
uses: actions/download-artifact@v7
162172
with:
163-
name: lime-pet-${{ needs.meta.outputs.tag }}-macos
164-
path: artifacts/macos
173+
name: lime-pet-${{ needs.meta.outputs.tag }}-macos-arm64
174+
path: artifacts/macos-arm64
175+
176+
- name: Download macOS Intel artifact
177+
uses: actions/download-artifact@v7
178+
with:
179+
name: lime-pet-${{ needs.meta.outputs.tag }}-macos-x64
180+
path: artifacts/macos-x64
165181

166182
- name: Download Windows artifact
167183
uses: actions/download-artifact@v7
@@ -180,7 +196,8 @@ jobs:
180196
{
181197
echo "## Lime Pet ${{ needs.meta.outputs.tag }}"
182198
echo ""
183-
echo "- macOS companion app unsigned zip bundle"
199+
echo "- macOS Apple Silicon unsigned zip bundle"
200+
echo "- macOS Intel unsigned zip bundle"
184201
echo "- Windows companion NSIS installer"
185202
echo "- Shared companion protocol across macOS Swift shell and Windows Tauri shell"
186203
echo "- Version: ${{ needs.meta.outputs.version }}"
@@ -207,7 +224,7 @@ jobs:
207224
fi
208225
209226
shopt -s nullglob
210-
assets=(artifacts/macos/* artifacts/windows/*)
227+
assets=(artifacts/macos-arm64/* artifacts/macos-x64/* artifacts/windows/*)
211228
212229
if gh release view "${tag}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then
213230
gh release upload "${tag}" "${assets[@]}" --repo "${GITHUB_REPOSITORY}" --clobber

LICENSE-Live2D.md

Lines changed: 646 additions & 0 deletions
Large diffs are not rendered by default.

LimePet.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@
250250
"$(inherited)",
251251
"@executable_path/../Frameworks",
252252
);
253-
MARKETING_VERSION = 0.2.0;
253+
MARKETING_VERSION = 0.3.0;
254254
PRODUCT_BUNDLE_IDENTIFIER = com.lime.pet;
255255
PRODUCT_NAME = "Lime Pet";
256256
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -269,7 +269,7 @@
269269
"$(inherited)",
270270
"@executable_path/../Frameworks",
271271
);
272-
MARKETING_VERSION = 0.2.0;
272+
MARKETING_VERSION = 0.3.0;
273273
PRODUCT_BUNDLE_IDENTIFIER = com.lime.pet;
274274
PRODUCT_NAME = "Lime Pet";
275275
SWIFT_EMIT_LOC_STRINGS = YES;

LimePet/CompanionProtocol.swift

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@ import Foundation
22

33
let defaultCompanionEndpoint = "ws://127.0.0.1:45554/companion/pet"
44
let companionProtocolVersion = 1
5+
let petCompanionCapabilities = [
6+
"bubble",
7+
"movement",
8+
"tap-open-chat",
9+
"drag-reposition",
10+
"reactive-animations",
11+
"perch-memory",
12+
"dock-presets",
13+
"ambient-dialogue",
14+
"character-themes",
15+
"provider-overview",
16+
"provider-sync-request",
17+
"open-provider-settings",
18+
"multi-tap-actions",
19+
"live2d-renderer",
20+
"live2d-expressions"
21+
]
522

623
enum PetState: String, CaseIterable, Codable {
724
case hidden
@@ -17,13 +34,19 @@ enum CompanionCommandType: String {
1734
case stateChanged = "pet.state_changed"
1835
case showBubble = "pet.show_bubble"
1936
case openChatAnchor = "pet.open_chat_anchor"
37+
case providerOverview = "pet.provider_overview"
38+
case live2dAction = "pet.live2d_action"
2039
}
2140

2241
enum CompanionEventType: String {
2342
case ready = "pet.ready"
2443
case clicked = "pet.clicked"
2544
case openChat = "pet.open_chat"
2645
case dismissed = "pet.dismissed"
46+
case requestProviderOverviewSync = "pet.request_provider_overview_sync"
47+
case openProviderSettings = "pet.open_provider_settings"
48+
case requestPetCheer = "pet.request_pet_cheer"
49+
case requestPetNextStep = "pet.request_pet_next_step"
2750
}
2851

2952
enum IncomingCommand {
@@ -32,6 +55,8 @@ enum IncomingCommand {
3255
case stateChanged(PetState)
3356
case showBubble(text: String, autoHideMs: Int?)
3457
case openChatAnchor
58+
case providerOverview(CompanionProviderOverviewPayload)
59+
case live2dAction(CompanionLive2DActionPayload)
3560
}
3661

3762
enum PetIPCConnectionStatus {
@@ -130,6 +155,84 @@ struct BubblePayload: Decodable {
130155
}
131156
}
132157

158+
struct CompanionProviderSummary: Decodable {
159+
let providerType: String
160+
let displayName: String
161+
let totalCount: Int
162+
let healthyCount: Int
163+
let available: Bool
164+
let needsAttention: Bool
165+
166+
enum CodingKeys: String, CodingKey {
167+
case providerType = "provider_type"
168+
case displayName = "display_name"
169+
case totalCount = "total_count"
170+
case healthyCount = "healthy_count"
171+
case available
172+
case needsAttention = "needs_attention"
173+
}
174+
}
175+
176+
struct CompanionProviderOverviewPayload: Decodable {
177+
let providers: [CompanionProviderSummary]
178+
let totalProviderCount: Int
179+
let availableProviderCount: Int
180+
let needsAttentionProviderCount: Int
181+
182+
enum CodingKeys: String, CodingKey {
183+
case providers
184+
case totalProviderCount = "total_provider_count"
185+
case availableProviderCount = "available_provider_count"
186+
case needsAttentionProviderCount = "needs_attention_provider_count"
187+
}
188+
}
189+
190+
enum CompanionLive2DExpressionValue: Decodable, Hashable {
191+
case index(Int)
192+
case tag(String)
193+
194+
init(from decoder: Decoder) throws {
195+
let container = try decoder.singleValueContainer()
196+
if let intValue = try? container.decode(Int.self) {
197+
self = .index(intValue)
198+
return
199+
}
200+
if let stringValue = try? container.decode(String.self) {
201+
self = .tag(stringValue)
202+
return
203+
}
204+
throw DecodingError.typeMismatch(
205+
CompanionLive2DExpressionValue.self,
206+
DecodingError.Context(
207+
codingPath: decoder.codingPath,
208+
debugDescription: "Unsupported Live2D expression value"
209+
)
210+
)
211+
}
212+
}
213+
214+
struct CompanionLive2DActionPayload: Decodable {
215+
let expressions: [CompanionLive2DExpressionValue]
216+
let emotionTags: [String]
217+
let motionGroup: String?
218+
let motionIndex: Int?
219+
220+
enum CodingKeys: String, CodingKey {
221+
case expressions
222+
case emotionTags = "emotion_tags"
223+
case motionGroup = "motion_group"
224+
case motionIndex = "motion_index"
225+
}
226+
227+
init(from decoder: Decoder) throws {
228+
let container = try decoder.container(keyedBy: CodingKeys.self)
229+
expressions = try container.decodeIfPresent([CompanionLive2DExpressionValue].self, forKey: .expressions) ?? []
230+
emotionTags = try container.decodeIfPresent([String].self, forKey: .emotionTags) ?? []
231+
motionGroup = try container.decodeIfPresent(String.self, forKey: .motionGroup)
232+
motionIndex = try container.decodeIfPresent(Int.self, forKey: .motionIndex)
233+
}
234+
}
235+
133236
struct InboundEnvelope {
134237
let protocolVersion: Int
135238
let event: String

LimePet/PetCharacterLibrary.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,19 @@ struct PetCharacterTheme: Identifiable, Codable, Hashable {
215215
let id: String
216216
let displayName: String
217217
let switchBubble: String
218+
let renderer: PetRendererKind?
219+
let live2d: PetLive2DConfiguration?
218220
let palettes: PetCharacterStatePalettes
219221
let motion: PetCharacterMotion
220222
let dialogue: PetCharacterDialogue
221223
let accessories: PetCharacterAccessories
222224
let geometry: PetCharacterGeometry
223225
let symbols: PetCharacterSymbols
224226

227+
var rendererKind: PetRendererKind {
228+
renderer ?? .sprite
229+
}
230+
225231
func palette(for state: PetState) -> PetRenderPalette {
226232
switch state {
227233
case .hidden:
@@ -324,6 +330,8 @@ extension PetCharacterTheme {
324330
id: "lime-scout",
325331
displayName: "青柠巡游",
326332
switchBubble: "切换到青柠巡游形态",
333+
renderer: .sprite,
334+
live2d: nil,
327335
palettes: PetCharacterStatePalettes(
328336
idle: PetPaletteTokens(
329337
shell: PetColorToken(red: 0.25, green: 0.63, blue: 0.89, alpha: 1),

0 commit comments

Comments
 (0)