Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ iOSInjectionProject/
!*/xcshareddata/swiftpm/Package.resolved
### Xcode Patch ###
**/xcshareddata/WorkspaceSettings.xcsettings
DemoApp/AssistantRuntimeDemoApp.xcodeproj/project.xcworkspace/

#Cocoapods
Pods/
Expand Down
47 changes: 36 additions & 11 deletions DemoApp/AssistantRuntimeDemoApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 60;
objects = {

/* Begin PBXBuildFile section */
Expand All @@ -25,6 +25,10 @@
1A2B3C4D5E6F700000000010 /* DemoMemoryExamples.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A2B3C4D5E6F700000000010 /* DemoMemoryExamples.swift */; };
1A2B3C4D5E6F700000000011 /* AgentDemoViewModel+Memory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A2B3C4D5E6F700000000011 /* AgentDemoViewModel+Memory.swift */; };
1A2B3C4D5E6F700000000012 /* MemoryDemoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A2B3C4D5E6F700000000012 /* MemoryDemoView.swift */; };
1A2B3C4D5E6F700000000013 /* AgentDemoViewModel+ComposerState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A2B3C4D5E6F700000000013 /* AgentDemoViewModel+ComposerState.swift */; };
1A2B3C4D5E6F700000000014 /* AgentDemoViewModel+ThreadState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A2B3C4D5E6F700000000014 /* AgentDemoViewModel+ThreadState.swift */; };
1A2B3C4D5E6F700000000015 /* AgentDemoViewModel+Observation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A2B3C4D5E6F700000000015 /* AgentDemoViewModel+Observation.swift */; };
1A2B3C4D5E6F700000000016 /* ThreadTurnActivityView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A2B3C4D5E6F700000000016 /* ThreadTurnActivityView.swift */; };
7482123BC63AC10F104DE092 /* AssistantRuntimeDemoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A6999E6475919476E726E8C /* AssistantRuntimeDemoApp.swift */; };
84726927B752451499D9257F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 906A95007C8ECB92CFC2CE15 /* Foundation.framework */; };
B060448C6464C41789B56EED /* AgentDemoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CA22585116A120BA97F76B8 /* AgentDemoView.swift */; };
Expand All @@ -35,6 +39,7 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
2481147A958D00EB4A70C928 /* AgentDemoViewModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AgentDemoViewModel.swift; sourceTree = "<group>"; };
2A2B3C4D5E6F700000000001 /* AgentDemoView+ChatSections.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "AgentDemoView+ChatSections.swift"; sourceTree = "<group>"; };
2A2B3C4D5E6F700000000002 /* AgentDemoView+ComposerAndSheets.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "AgentDemoView+ComposerAndSheets.swift"; sourceTree = "<group>"; };
2A2B3C4D5E6F700000000003 /* HealthCoachView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HealthCoachView.swift; sourceTree = "<group>"; };
Expand All @@ -53,7 +58,10 @@
2A2B3C4D5E6F700000000010 /* DemoMemoryExamples.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DemoMemoryExamples.swift; sourceTree = "<group>"; };
2A2B3C4D5E6F700000000011 /* AgentDemoViewModel+Memory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "AgentDemoViewModel+Memory.swift"; sourceTree = "<group>"; };
2A2B3C4D5E6F700000000012 /* MemoryDemoView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MemoryDemoView.swift; sourceTree = "<group>"; };
2481147A958D00EB4A70C928 /* AgentDemoViewModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AgentDemoViewModel.swift; sourceTree = "<group>"; };
2A2B3C4D5E6F700000000013 /* AgentDemoViewModel+ComposerState.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "AgentDemoViewModel+ComposerState.swift"; sourceTree = "<group>"; };
2A2B3C4D5E6F700000000014 /* AgentDemoViewModel+ThreadState.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "AgentDemoViewModel+ThreadState.swift"; sourceTree = "<group>"; };
2A2B3C4D5E6F700000000015 /* AgentDemoViewModel+Observation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "AgentDemoViewModel+Observation.swift"; sourceTree = "<group>"; };
2A2B3C4D5E6F700000000016 /* ThreadTurnActivityView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ThreadTurnActivityView.swift; sourceTree = "<group>"; };
3CA22585116A120BA97F76B8 /* AgentDemoView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AgentDemoView.swift; sourceTree = "<group>"; };
5A6999E6475919476E726E8C /* AssistantRuntimeDemoApp.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AssistantRuntimeDemoApp.swift; sourceTree = "<group>"; };
690A3E5A03E545F88FAF9A44 /* AssistantRuntimeDemoApp.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AssistantRuntimeDemoApp.entitlements; sourceTree = "<group>"; };
Expand Down Expand Up @@ -85,7 +93,6 @@
690A3E5A03E545F88FAF9A44 /* AssistantRuntimeDemoApp.entitlements */,
FE27E9F3273C1EAF47AE5198 /* Info.plist */,
);
name = AssistantRuntimeDemoApp;
path = AssistantRuntimeDemoApp;
sourceTree = "<group>";
};
Expand Down Expand Up @@ -133,6 +140,9 @@
2A2B3C4D5E6F700000000004 /* DeviceCodePromptView.swift */,
2A2B3C4D5E6F700000000005 /* Image+PlatformInit.swift */,
2481147A958D00EB4A70C928 /* AgentDemoViewModel.swift */,
2A2B3C4D5E6F700000000013 /* AgentDemoViewModel+ComposerState.swift */,
2A2B3C4D5E6F700000000014 /* AgentDemoViewModel+ThreadState.swift */,
2A2B3C4D5E6F700000000015 /* AgentDemoViewModel+Observation.swift */,
2A2B3C4D5E6F700000000006 /* AgentDemoViewModel+Messaging.swift */,
2A2B3C4D5E6F700000000007 /* AgentDemoViewModel+Tools.swift */,
2A2B3C4D5E6F700000000008 /* AgentDemoViewModel+HealthCoach.swift */,
Expand All @@ -143,11 +153,11 @@
2A2B3C4D5E6F70000000000D /* DemoUIComponents.swift */,
2A2B3C4D5E6F70000000000E /* StructuredOutputDemoView.swift */,
2A2B3C4D5E6F70000000000F /* ThreadDetailView.swift */,
2A2B3C4D5E6F700000000016 /* ThreadTurnActivityView.swift */,
2A2B3C4D5E6F700000000010 /* DemoMemoryExamples.swift */,
2A2B3C4D5E6F700000000011 /* AgentDemoViewModel+Memory.swift */,
2A2B3C4D5E6F700000000012 /* MemoryDemoView.swift */,
);
name = Shared;
path = Shared;
sourceTree = "<group>";
};
Expand Down Expand Up @@ -181,8 +191,9 @@
26901593A1B92DDA950D134D /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1600;
LastUpgradeCheck = 1600;
LastUpgradeCheck = 2630;
};
buildConfigurationList = 01B4A49BA7FDE96517E1DFD0 /* Build configuration list for PBXProject "AssistantRuntimeDemoApp" */;
compatibilityVersion = "Xcode 3.2";
Expand All @@ -193,11 +204,9 @@
Base,
);
mainGroup = B7BD2AF1370DA44DA0C52952;
minimizedProjectReferenceProxies = 0;
packageReferences = (
802CFFA933DE41B7A27EFE75 /* XCLocalSwiftPackageReference ".." */,
);
preferredProjectObjectVersion = 77;
productRefGroup = CA88F59A68B805C4F9DA5CAA /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -240,6 +249,10 @@
1A2B3C4D5E6F700000000010 /* DemoMemoryExamples.swift in Sources */,
1A2B3C4D5E6F700000000011 /* AgentDemoViewModel+Memory.swift in Sources */,
1A2B3C4D5E6F700000000012 /* MemoryDemoView.swift in Sources */,
1A2B3C4D5E6F700000000013 /* AgentDemoViewModel+ComposerState.swift in Sources */,
1A2B3C4D5E6F700000000014 /* AgentDemoViewModel+ThreadState.swift in Sources */,
1A2B3C4D5E6F700000000015 /* AgentDemoViewModel+Observation.swift in Sources */,
1A2B3C4D5E6F700000000016 /* ThreadTurnActivityView.swift in Sources */,
7482123BC63AC10F104DE092 /* AssistantRuntimeDemoApp.swift in Sources */,
BB4F38E64D1EBBB3821AC4E3 /* AgentDemoRuntimeFactory.swift in Sources */,
B060448C6464C41789B56EED /* AgentDemoView.swift in Sources */,
Expand Down Expand Up @@ -284,9 +297,12 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = T9G4574SJG;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand All @@ -305,6 +321,7 @@
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
STRING_CATALOG_GENERATE_SYMBOLS = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
Expand All @@ -320,11 +337,13 @@
CLANG_ENABLE_OBJC_WEAK = NO;
CODE_SIGN_ENTITLEMENTS = AssistantRuntimeDemoApp/AssistantRuntimeDemoApp.entitlements;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = T9G4574SJG;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = AssistantRuntimeDemoApp/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = ai.assistantruntime.demoapp;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
Expand All @@ -343,11 +362,13 @@
CLANG_ENABLE_OBJC_WEAK = NO;
CODE_SIGN_ENTITLEMENTS = AssistantRuntimeDemoApp/AssistantRuntimeDemoApp.entitlements;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = T9G4574SJG;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = AssistantRuntimeDemoApp/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = ai.assistantruntime.demoapp;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
Expand Down Expand Up @@ -390,9 +411,12 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = T9G4574SJG;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand All @@ -404,6 +428,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
STRING_CATALOG_GENERATE_SYMBOLS = YES;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1600"
LastUpgradeVersion = "2630"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ enum AgentDemoRuntimeFactory {
)
),
approvalPresenter: approvalInbox,
stateStore: FileRuntimeStateStore(url: stateURL ?? defaultStateURL()),
stateStore: try! GRDBRuntimeStateStore(url: stateURL ?? defaultStateURL()),
memory: .init(
store: try! SQLiteMemoryStore(url: defaultMemoryURL()),
automaticCapturePolicy: .init(
Expand All @@ -116,6 +116,16 @@ enum AgentDemoRuntimeFactory {
maxMemories: 2
)
)
),
contextCompaction: AgentContextCompactionConfiguration(
isEnabled: true,
mode: .automatic,
visibility: .hidden,
strategy: .preferRemoteThenLocal,
trigger: .init(
estimatedTokenThreshold: 2_000,
retryOnContextLimitError: true
)
)
))
}
Expand Down Expand Up @@ -143,7 +153,7 @@ enum AgentDemoRuntimeFactory {
)
),
approvalPresenter: NonInteractiveApprovalPresenter(),
stateStore: FileRuntimeStateStore(url: defaultStateURL()),
stateStore: try! GRDBRuntimeStateStore(url: defaultStateURL()),
memory: .init(
store: try! SQLiteMemoryStore(url: defaultMemoryURL()),
automaticCapturePolicy: .init(
Expand All @@ -157,6 +167,16 @@ enum AgentDemoRuntimeFactory {
maxMemories: 2
)
)
),
contextCompaction: AgentContextCompactionConfiguration(
isEnabled: true,
mode: .automatic,
visibility: .hidden,
strategy: .preferRemoteThenLocal,
trigger: .init(
estimatedTokenThreshold: 2_000,
retryOnContextLimitError: true
)
)
))
}
Expand All @@ -169,7 +189,7 @@ enum AgentDemoRuntimeFactory {

return baseDirectory
.appendingPathComponent("AssistantRuntimeDemoApp", isDirectory: true)
.appendingPathComponent("runtime-state.json")
.appendingPathComponent("runtime-state.sqlite")
}

static func defaultMemoryURL() -> URL {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,23 @@ extension AgentDemoView {
.foregroundStyle(.secondary)
}

Toggle(
"Developer Logging",
isOn: Binding(
get: { viewModel.developerLoggingEnabled },
set: { viewModel.developerLoggingEnabled = $0 }
)
)
.toggleStyle(.switch)

Text("Debug builds start with logging enabled. Logs print to the Xcode console for restore, sign-in, thread lifecycle, turn events, and tool activity.")
.font(.caption)
.foregroundStyle(.secondary)

Text("State store: \(viewModel.resolvedStateURL.lastPathComponent)")
.font(.caption.monospaced())
.foregroundStyle(.secondary)

LazyVGrid(columns: tileColumns, spacing: 12) {
registerToolTile

Expand Down Expand Up @@ -88,7 +105,6 @@ extension AgentDemoView {
Text("Pick a thinking level for future requests. Existing threads stay intact; only new turns use the updated effort.")
.font(.subheadline)
.foregroundStyle(.secondary)

LazyVGrid(columns: tileColumns, spacing: 12) {
ForEach(ReasoningEffort.allCases, id: \.self) { effort in
reasoningEffortTile(for: effort)
Expand Down
1 change: 0 additions & 1 deletion DemoApp/AssistantRuntimeDemoApp/Shared/AgentDemoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ struct AgentDemoView: View {
#endif
.task {
await viewModel.restore()
await viewModel.registerDemoTool()
}
.sheet(item: approvalRequestBinding) { request in
approvalSheet(for: request)
Expand Down
Loading
Loading