Skip to content

Commit 2a6bcaf

Browse files
committed
chore: release prep
1 parent aa001c3 commit 2a6bcaf

39 files changed

+2864
-764
lines changed

apple/Clarissa/Clarissa.xcodeproj/project.pbxproj

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
7E968D0A2F365E22009C206E /* ClarissaShareExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 7E968D002F365E22009C206E /* ClarissaShareExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
1011
A0000001 /* ClarissaKit in Frameworks */ = {isa = PBXBuildFile; productRef = A0000002 /* ClarissaKit */; };
1112
W0000001 /* ClarissaKit in Frameworks */ = {isa = PBXBuildFile; productRef = W0000002 /* ClarissaKit */; };
1213
W0000010 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = W0000011 /* WidgetKit.framework */; };
@@ -16,6 +17,13 @@
1617
/* End PBXBuildFile section */
1718

1819
/* Begin PBXContainerItemProxy section */
20+
7E968D082F365E22009C206E /* PBXContainerItemProxy */ = {
21+
isa = PBXContainerItemProxy;
22+
containerPortal = A000000B /* Project object */;
23+
proxyType = 1;
24+
remoteGlobalIDString = 7E968CFF2F365E22009C206E;
25+
remoteInfo = ClarissaShareExtension;
26+
};
1927
7EECC06D2EFB0BE8006BB322 /* PBXContainerItemProxy */ = {
2028
isa = PBXContainerItemProxy;
2129
containerPortal = A000000B /* Project object */;
@@ -53,6 +61,7 @@
5361
dstPath = "";
5462
dstSubfolderSpec = 13;
5563
files = (
64+
7E968D0A2F365E22009C206E /* ClarissaShareExtension.appex in Embed Foundation Extensions */,
5665
W0000020 /* ClarissaWidgets.appex in Embed Foundation Extensions */,
5766
);
5867
name = "Embed Foundation Extensions";
@@ -72,6 +81,7 @@
7281
/* End PBXCopyFilesBuildPhase section */
7382

7483
/* Begin PBXFileReference section */
84+
7E968D002F365E22009C206E /* ClarissaShareExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = ClarissaShareExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
7585
7EECC0672EFB0BE8006BB322 /* ClarissaUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ClarissaUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
7686
A0000003 /* Clarissa.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Clarissa.app; sourceTree = BUILT_PRODUCTS_DIR; };
7787
W0000003 /* ClarissaWidgets.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = ClarissaWidgets.appex; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -106,6 +116,11 @@
106116
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
107117

108118
/* Begin PBXFileSystemSynchronizedRootGroup section */
119+
7E968D012F365E22009C206E /* ClarissaShareExtension */ = {
120+
isa = PBXFileSystemSynchronizedRootGroup;
121+
path = ClarissaShareExtension;
122+
sourceTree = "<group>";
123+
};
109124
7EECC0682EFB0BE8006BB322 /* ClarissaUITests */ = {
110125
isa = PBXFileSystemSynchronizedRootGroup;
111126
path = ClarissaUITests;
@@ -153,6 +168,13 @@
153168
/* End PBXFileSystemSynchronizedRootGroup section */
154169

155170
/* Begin PBXFrameworksBuildPhase section */
171+
7E968CFD2F365E22009C206E /* Frameworks */ = {
172+
isa = PBXFrameworksBuildPhase;
173+
buildActionMask = 2147483647;
174+
files = (
175+
);
176+
runOnlyForDeploymentPostprocessing = 0;
177+
};
156178
7EECC0642EFB0BE8006BB322 /* Frameworks */ = {
157179
isa = PBXFrameworksBuildPhase;
158180
buildActionMask = 2147483647;
@@ -205,6 +227,7 @@
205227
WA000050 /* ClarissaWatch */,
206228
7EECC0682EFB0BE8006BB322 /* ClarissaUITests */,
207229
WT000050 /* ClarissaWatchUITests */,
230+
7E968D012F365E22009C206E /* ClarissaShareExtension */,
208231
W0000070 /* Frameworks */,
209232
A0000008 /* Products */,
210233
);
@@ -218,6 +241,7 @@
218241
WA000002 /* ClarissaWatch.app */,
219242
7EECC0672EFB0BE8006BB322 /* ClarissaUITests.xctest */,
220243
WT000001 /* ClarissaWatchUITests.xctest */,
244+
7E968D002F365E22009C206E /* ClarissaShareExtension.appex */,
221245
);
222246
name = Products;
223247
sourceTree = "<group>";
@@ -234,6 +258,28 @@
234258
/* End PBXGroup section */
235259

236260
/* Begin PBXNativeTarget section */
261+
7E968CFF2F365E22009C206E /* ClarissaShareExtension */ = {
262+
isa = PBXNativeTarget;
263+
buildConfigurationList = 7E968D0D2F365E22009C206E /* Build configuration list for PBXNativeTarget "ClarissaShareExtension" */;
264+
buildPhases = (
265+
7E968CFC2F365E22009C206E /* Sources */,
266+
7E968CFD2F365E22009C206E /* Frameworks */,
267+
7E968CFE2F365E22009C206E /* Resources */,
268+
);
269+
buildRules = (
270+
);
271+
dependencies = (
272+
);
273+
fileSystemSynchronizedGroups = (
274+
7E968D012F365E22009C206E /* ClarissaShareExtension */,
275+
);
276+
name = ClarissaShareExtension;
277+
packageProductDependencies = (
278+
);
279+
productName = ClarissaShareExtension;
280+
productReference = 7E968D002F365E22009C206E /* ClarissaShareExtension.appex */;
281+
productType = "com.apple.product-type.app-extension";
282+
};
237283
7EECC0662EFB0BE8006BB322 /* ClarissaUITests */ = {
238284
isa = PBXNativeTarget;
239285
buildConfigurationList = 7EECC0712EFB0BE8006BB322 /* Build configuration list for PBXNativeTarget "ClarissaUITests" */;
@@ -272,6 +318,7 @@
272318
dependencies = (
273319
W0000031 /* PBXTargetDependency */,
274320
WA000011 /* PBXTargetDependency */,
321+
7E968D092F365E22009C206E /* PBXTargetDependency */,
275322
);
276323
fileSystemSynchronizedGroups = (
277324
A0000004 /* Sources/App */,
@@ -364,6 +411,10 @@
364411
LastSwiftUpdateCheck = 2620;
365412
LastUpgradeCheck = 2620;
366413
TargetAttributes = {
414+
7E968CFF2F365E22009C206E = {
415+
CreatedOnToolsVersion = 26.2;
416+
LastSwiftMigration = 2620;
417+
};
367418
7EECC0662EFB0BE8006BB322 = {
368419
CreatedOnToolsVersion = 26.2;
369420
TestTargetID = A0000009;
@@ -405,11 +456,19 @@
405456
WA000003 /* ClarissaWatch */,
406457
7EECC0662EFB0BE8006BB322 /* ClarissaUITests */,
407458
WT000002 /* ClarissaWatchUITests */,
459+
7E968CFF2F365E22009C206E /* ClarissaShareExtension */,
408460
);
409461
};
410462
/* End PBXProject section */
411463

412464
/* Begin PBXResourcesBuildPhase section */
465+
7E968CFE2F365E22009C206E /* Resources */ = {
466+
isa = PBXResourcesBuildPhase;
467+
buildActionMask = 2147483647;
468+
files = (
469+
);
470+
runOnlyForDeploymentPostprocessing = 0;
471+
};
413472
7EECC0652EFB0BE8006BB322 /* Resources */ = {
414473
isa = PBXResourcesBuildPhase;
415474
buildActionMask = 2147483647;
@@ -448,6 +507,13 @@
448507
/* End PBXResourcesBuildPhase section */
449508

450509
/* Begin PBXSourcesBuildPhase section */
510+
7E968CFC2F365E22009C206E /* Sources */ = {
511+
isa = PBXSourcesBuildPhase;
512+
buildActionMask = 2147483647;
513+
files = (
514+
);
515+
runOnlyForDeploymentPostprocessing = 0;
516+
};
451517
7EECC0632EFB0BE8006BB322 /* Sources */ = {
452518
isa = PBXSourcesBuildPhase;
453519
buildActionMask = 2147483647;
@@ -486,6 +552,11 @@
486552
/* End PBXSourcesBuildPhase section */
487553

488554
/* Begin PBXTargetDependency section */
555+
7E968D092F365E22009C206E /* PBXTargetDependency */ = {
556+
isa = PBXTargetDependency;
557+
target = 7E968CFF2F365E22009C206E /* ClarissaShareExtension */;
558+
targetProxy = 7E968D082F365E22009C206E /* PBXContainerItemProxy */;
559+
};
489560
7EECC06E2EFB0BE8006BB322 /* PBXTargetDependency */ = {
490561
isa = PBXTargetDependency;
491562
target = A0000009 /* Clarissa */;
@@ -510,6 +581,83 @@
510581
/* End PBXTargetDependency section */
511582

512583
/* Begin XCBuildConfiguration section */
584+
7E968D0B2F365E22009C206E /* Debug */ = {
585+
isa = XCBuildConfiguration;
586+
buildSettings = {
587+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
588+
CLANG_ENABLE_MODULES = YES;
589+
CLANG_ENABLE_OBJC_WEAK = YES;
590+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
591+
CODE_SIGN_STYLE = Automatic;
592+
CURRENT_PROJECT_VERSION = 1;
593+
GCC_C_LANGUAGE_STANDARD = gnu17;
594+
GCC_PREPROCESSOR_DEFINITIONS = (
595+
"DEBUG=1",
596+
"$(inherited)",
597+
);
598+
GENERATE_INFOPLIST_FILE = YES;
599+
INFOPLIST_FILE = ClarissaShareExtension/Info.plist;
600+
INFOPLIST_KEY_CFBundleDisplayName = ClarissaShareExtension;
601+
INFOPLIST_KEY_NSHumanReadableCopyright = "";
602+
IPHONEOS_DEPLOYMENT_TARGET = 26.2;
603+
LD_RUNPATH_SEARCH_PATHS = (
604+
"$(inherited)",
605+
"@executable_path/Frameworks",
606+
"@executable_path/../../Frameworks",
607+
);
608+
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
609+
MARKETING_VERSION = 1.0;
610+
PRODUCT_BUNDLE_IDENTIFIER = dev.rye.clarissa.ClarissaShareExtension;
611+
PRODUCT_NAME = "$(TARGET_NAME)";
612+
SDKROOT = iphoneos;
613+
SKIP_INSTALL = YES;
614+
STRING_CATALOG_GENERATE_SYMBOLS = YES;
615+
SWIFT_APPROACHABLE_CONCURRENCY = YES;
616+
SWIFT_EMIT_LOC_STRINGS = YES;
617+
SWIFT_OBJC_BRIDGING_HEADER = "ClarissaShareExtension/ClarissaShareExtension-Bridging-Header.h";
618+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
619+
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
620+
SWIFT_VERSION = 5.0;
621+
TARGETED_DEVICE_FAMILY = "1,2";
622+
};
623+
name = Debug;
624+
};
625+
7E968D0C2F365E22009C206E /* Release */ = {
626+
isa = XCBuildConfiguration;
627+
buildSettings = {
628+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
629+
CLANG_ENABLE_MODULES = YES;
630+
CLANG_ENABLE_OBJC_WEAK = YES;
631+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
632+
CODE_SIGN_STYLE = Automatic;
633+
CURRENT_PROJECT_VERSION = 1;
634+
GCC_C_LANGUAGE_STANDARD = gnu17;
635+
GENERATE_INFOPLIST_FILE = YES;
636+
INFOPLIST_FILE = ClarissaShareExtension/Info.plist;
637+
INFOPLIST_KEY_CFBundleDisplayName = ClarissaShareExtension;
638+
INFOPLIST_KEY_NSHumanReadableCopyright = "";
639+
IPHONEOS_DEPLOYMENT_TARGET = 26.2;
640+
LD_RUNPATH_SEARCH_PATHS = (
641+
"$(inherited)",
642+
"@executable_path/Frameworks",
643+
"@executable_path/../../Frameworks",
644+
);
645+
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
646+
MARKETING_VERSION = 1.0;
647+
PRODUCT_BUNDLE_IDENTIFIER = dev.rye.clarissa.ClarissaShareExtension;
648+
PRODUCT_NAME = "$(TARGET_NAME)";
649+
SDKROOT = iphoneos;
650+
SKIP_INSTALL = YES;
651+
STRING_CATALOG_GENERATE_SYMBOLS = YES;
652+
SWIFT_APPROACHABLE_CONCURRENCY = YES;
653+
SWIFT_EMIT_LOC_STRINGS = YES;
654+
SWIFT_OBJC_BRIDGING_HEADER = "ClarissaShareExtension/ClarissaShareExtension-Bridging-Header.h";
655+
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
656+
SWIFT_VERSION = 5.0;
657+
TARGETED_DEVICE_FAMILY = "1,2";
658+
};
659+
name = Release;
660+
};
513661
7EECC06F2EFB0BE8006BB322 /* Debug */ = {
514662
isa = XCBuildConfiguration;
515663
buildSettings = {
@@ -946,6 +1094,15 @@
9461094
/* End XCBuildConfiguration section */
9471095

9481096
/* Begin XCConfigurationList section */
1097+
7E968D0D2F365E22009C206E /* Build configuration list for PBXNativeTarget "ClarissaShareExtension" */ = {
1098+
isa = XCConfigurationList;
1099+
buildConfigurations = (
1100+
7E968D0B2F365E22009C206E /* Debug */,
1101+
7E968D0C2F365E22009C206E /* Release */,
1102+
);
1103+
defaultConfigurationIsVisible = 0;
1104+
defaultConfigurationName = Release;
1105+
};
9491106
7EECC0712EFB0BE8006BB322 /* Build configuration list for PBXNativeTarget "ClarissaUITests" */ = {
9501107
isa = XCConfigurationList;
9511108
buildConfigurations = (
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//
2+
// Use this file to import your target's public headers that you would like to expose to Swift.
3+
//
4+
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import Foundation
2+
#if canImport(FoundationModels)
3+
import FoundationModels
4+
#endif
5+
6+
/// Processes shared content using a lightweight Foundation Models session
7+
/// Handles text summarization, URL content analysis, and image description
8+
actor ShareProcessor {
9+
10+
/// Process shared text content
11+
func processText(_ text: String) async -> SharedResult {
12+
let analysis = await generateAnalysis(
13+
instruction: "Summarize the following text concisely in 2-3 sentences. Identify the key points.",
14+
content: text
15+
)
16+
return SharedResult(type: .text, originalContent: String(text.prefix(500)), analysis: analysis)
17+
}
18+
19+
/// Process a shared URL
20+
func processURL(_ url: URL) async -> SharedResult {
21+
// Fetch URL content
22+
let content: String
23+
do {
24+
let (data, _) = try await URLSession.shared.data(from: url)
25+
content = String(data: data, encoding: .utf8) ?? url.absoluteString
26+
} catch {
27+
content = url.absoluteString
28+
}
29+
30+
let truncated = String(content.prefix(2000))
31+
let analysis = await generateAnalysis(
32+
instruction: "Summarize this web content concisely. What is the main topic and key takeaways?",
33+
content: truncated
34+
)
35+
return SharedResult(type: .url, originalContent: url.absoluteString, analysis: analysis)
36+
}
37+
38+
/// Process a shared image
39+
func processImage(_ imageData: Data) async -> SharedResult {
40+
let analysis = await generateAnalysis(
41+
instruction: "An image was shared with Clarissa. The user may want to discuss it later.",
42+
content: "Image shared (\(imageData.count) bytes)"
43+
)
44+
return SharedResult(type: .image, originalContent: "Shared image", analysis: analysis)
45+
}
46+
47+
/// Generate analysis using a lightweight Foundation Models session
48+
private func generateAnalysis(instruction: String, content: String) async -> String {
49+
#if canImport(FoundationModels)
50+
if #available(iOS 26.0, macOS 26.0, *) {
51+
guard case .available = SystemLanguageModel.default.availability else {
52+
return fallbackAnalysis(content: content)
53+
}
54+
55+
do {
56+
let model = SystemLanguageModel(guardrails: .permissiveContentTransformations)
57+
let session = LanguageModelSession(
58+
model: model,
59+
instructions: Instructions(instruction)
60+
)
61+
let response = try await session.respond(to: Prompt(content))
62+
return response.content
63+
} catch {
64+
return fallbackAnalysis(content: content)
65+
}
66+
}
67+
#endif
68+
return fallbackAnalysis(content: content)
69+
}
70+
71+
/// Fallback when Foundation Models is unavailable
72+
private func fallbackAnalysis(content: String) -> String {
73+
let preview = String(content.prefix(200))
74+
return "Shared content saved for review: \(preview)..."
75+
}
76+
}

0 commit comments

Comments
 (0)